minecraft-renderer 0.1.102 → 0.1.104

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.
@@ -1,4 +1,4 @@
1
- var Jl=Object.create;var Er=Object.defineProperty;var Xl=Object.getOwnPropertyDescriptor;var Zl=Object.getOwnPropertyNames;var $l=Object.getPrototypeOf,ev=Object.prototype.hasOwnProperty;var tv=(n,e,t)=>e in n?Er(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var rv=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var Ve=(n,e)=>()=>(n&&(e=n(n=0)),e);var ht=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),R5=(n,e)=>{for(var t in e)Er(n,t,{get:e[t],enumerable:!0})},Bs=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Zl(e))!ev.call(n,i)&&i!==t&&Er(n,i,{get:()=>e[i],enumerable:!(r=Xl(e,i))||r.enumerable});return n};var xr=(n,e,t)=>(t=n!=null?Jl($l(n)):{},Bs(e||!n||!n.__esModule?Er(t,"default",{value:n,enumerable:!0}):t,n)),nv=n=>Bs(Er({},"__esModule",{value:!0}),n);var d=(n,e,t)=>(tv(n,typeof e!="symbol"?e+"":e,t),t);var A=Ve(()=>{});var E=Ve(()=>{});var L={};R5(L,{_debugEnd:()=>wo,_debugProcess:()=>_o,_events:()=>Do,_eventsCount:()=>Fo,_exiting:()=>eo,_fatalExceptions:()=>po,_getActiveHandles:()=>io,_getActiveRequests:()=>no,_kill:()=>oo,_linkedBinding:()=>Zs,_maxListeners:()=>Oo,_preload_modules:()=>Io,_rawDebug:()=>Js,_startProfilerIdleNotifier:()=>Ao,_stopProfilerIdleNotifier:()=>Eo,_tickCallback:()=>yo,abort:()=>So,addListener:()=>zo,allowedNodeEnvironmentFlags:()=>ho,arch:()=>Os,argv:()=>zs,argv0:()=>Po,assert:()=>fo,binding:()=>Ws,browser:()=>qs,chdir:()=>Qs,config:()=>to,cpuUsage:()=>T5,cwd:()=>Ys,debugPort:()=>Bo,default:()=>Ko,dlopen:()=>ro,domain:()=>$s,emit:()=>Wo,emitWarning:()=>Ns,env:()=>Fs,execArgv:()=>Us,execPath:()=>Co,exit:()=>co,features:()=>mo,hasUncaughtExceptionCaptureCallback:()=>bo,hrtime:()=>S5,kill:()=>vo,listeners:()=>Qo,memoryUsage:()=>lo,moduleLoadList:()=>Xs,nextTick:()=>Is,off:()=>Vo,on:()=>Lt,once:()=>Uo,openStdin:()=>uo,pid:()=>To,platform:()=>Ds,ppid:()=>Mo,prependListener:()=>jo,prependOnceListener:()=>Yo,reallyExit:()=>so,release:()=>Ks,removeAllListeners:()=>No,removeListener:()=>Go,resourceUsage:()=>ao,setSourceMapsEnabled:()=>Ho,setUncaughtExceptionCaptureCallback:()=>go,stderr:()=>Ro,stdin:()=>ko,stdout:()=>xo,title:()=>Ls,umask:()=>js,uptime:()=>Lo,version:()=>Vs,versions:()=>Gs});function gi(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function iv(){!j0||!d0||(j0=!1,d0.length?Ht=d0.concat(Ht):k5=-1,Ht.length&&Ps())}function Ps(){if(!j0){var n=setTimeout(iv,0);j0=!0;for(var e=Ht.length;e;){for(d0=Ht,Ht=[];++k5<e;)d0&&d0[k5].run();k5=-1,e=Ht.length}d0=null,j0=!1,clearTimeout(n)}}function Is(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];Ht.push(new Hs(n,e)),Ht.length===1&&!j0&&setTimeout(Ps,0)}function Hs(n,e){this.fun=n,this.array=e}function Ze(){}function Zs(n){gi("_linkedBinding")}function ro(n){gi("dlopen")}function no(){return[]}function io(){return[]}function fo(n,e){if(!n)throw new Error(e||"assertion error")}function bo(){return!1}function Lo(){return Yt.now()/1e3}function S5(n){var e=Math.floor((Date.now()-Yt.now())*.001),t=Yt.now()*.001,r=Math.floor(t)+e,i=Math.floor(t%1*1e9);return n&&(r=r-n[0],i=i-n[1],i<0&&(r--,i+=pi)),[r,i]}function Lt(){return Ko}function Qo(n){return[]}var Ht,j0,d0,k5,Ls,Os,Ds,Fs,zs,Us,Vs,Gs,Ns,Ws,js,Ys,Qs,Ks,qs,Js,Xs,$s,eo,to,so,oo,T5,ao,lo,vo,co,uo,ho,mo,po,go,yo,_o,wo,Ao,Eo,xo,Ro,ko,So,To,Mo,Co,Bo,Po,Io,Ho,Yt,mi,pi,Oo,Do,Fo,zo,Uo,Vo,Go,No,Wo,jo,Yo,Ko,qo=Ve(()=>{A();E();R();x();Ht=[],j0=!1,k5=-1;Hs.prototype.run=function(){this.fun.apply(null,this.array)};Ls="browser",Os="x64",Ds="browser",Fs={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},zs=["/usr/bin/node"],Us=[],Vs="v16.8.0",Gs={},Ns=function(n,e){},Ws=function(n){gi("binding")},js=function(n){return 0},Ys=function(){return"/"},Qs=function(n){},Ks={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};qs=!0,Js=Ze,Xs=[];$s={},eo=!1,to={};so=Ze,oo=Ze,T5=function(){return{}},ao=T5,lo=T5,vo=Ze,co=Ze,uo=Ze,ho={};mo={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},po=Ze,go=Ze;yo=Ze,_o=Ze,wo=Ze,Ao=Ze,Eo=Ze,xo=void 0,Ro=void 0,ko=void 0,So=Ze,To=2,Mo=1,Co="/bin/usr/node",Bo=9229,Po="node",Io=[],Ho=Ze,Yt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Yt.now===void 0&&(mi=Date.now(),Yt.timing&&Yt.timing.navigationStart&&(mi=Yt.timing.navigationStart),Yt.now=()=>Date.now()-mi);pi=1e9;S5.bigint=function(n){var e=S5(n);return typeof BigInt>"u"?e[0]*pi+e[1]:BigInt(e[0]*pi)+BigInt(e[1])};Oo=10,Do={},Fo=0;zo=Lt,Uo=Lt,Vo=Lt,Go=Lt,No=Lt,Wo=Ze,jo=Lt,Yo=Lt;Ko={version:Vs,versions:Gs,arch:Os,platform:Ds,browser:qs,release:Ks,_rawDebug:Js,moduleLoadList:Xs,binding:Ws,_linkedBinding:Zs,_events:Do,_eventsCount:Fo,_maxListeners:Oo,on:Lt,addListener:zo,once:Uo,off:Vo,removeListener:Go,removeAllListeners:No,emit:Wo,prependListener:jo,prependOnceListener:Yo,listeners:Qo,domain:$s,_exiting:eo,config:to,dlopen:ro,uptime:Lo,_getActiveRequests:no,_getActiveHandles:io,reallyExit:so,_kill:oo,cpuUsage:T5,resourceUsage:ao,memoryUsage:lo,kill:vo,exit:co,openStdin:uo,allowedNodeEnvironmentFlags:ho,assert:fo,features:mo,_fatalExceptions:po,setUncaughtExceptionCaptureCallback:go,hasUncaughtExceptionCaptureCallback:bo,emitWarning:Ns,nextTick:Is,_tickCallback:yo,_debugProcess:_o,_debugEnd:wo,_startProfilerIdleNotifier:Ao,_stopProfilerIdleNotifier:Eo,stdout:xo,stdin:ko,stderr:Ro,abort:So,umask:js,chdir:Qs,cwd:Ys,env:Fs,title:Ls,argv:zs,execArgv:Us,pid:To,ppid:Mo,execPath:Co,debugPort:Bo,hrtime:S5,argv0:Po,_preload_modules:Io,setSourceMapsEnabled:Ho}});var x=Ve(()=>{qo()});function sv(){if(Jo)return Rr;Jo=!0,Rr.byteLength=l,Rr.toByteArray=v,Rr.fromByteArray=h;for(var n=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=r.length;i<s;++i)n[i]=r[i],e[r.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(p){var m=p.length;if(m%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=p.indexOf("=");b===-1&&(b=m);var k=b===m?0:4-b%4;return[b,k]}function l(p){var m=o(p),b=m[0],k=m[1];return(b+k)*3/4-k}function a(p,m,b){return(m+b)*3/4-b}function v(p){var m,b=o(p),k=b[0],_=b[1],y=new t(a(p,k,_)),M=0,T=_>0?k-4:k,S;for(S=0;S<T;S+=4)m=e[p.charCodeAt(S)]<<18|e[p.charCodeAt(S+1)]<<12|e[p.charCodeAt(S+2)]<<6|e[p.charCodeAt(S+3)],y[M++]=m>>16&255,y[M++]=m>>8&255,y[M++]=m&255;return _===2&&(m=e[p.charCodeAt(S)]<<2|e[p.charCodeAt(S+1)]>>4,y[M++]=m&255),_===1&&(m=e[p.charCodeAt(S)]<<10|e[p.charCodeAt(S+1)]<<4|e[p.charCodeAt(S+2)]>>2,y[M++]=m>>8&255,y[M++]=m&255),y}function c(p){return n[p>>18&63]+n[p>>12&63]+n[p>>6&63]+n[p&63]}function u(p,m,b){for(var k,_=[],y=m;y<b;y+=3)k=(p[y]<<16&16711680)+(p[y+1]<<8&65280)+(p[y+2]&255),_.push(c(k));return _.join("")}function h(p){for(var m,b=p.length,k=b%3,_=[],y=16383,M=0,T=b-k;M<T;M+=y)_.push(u(p,M,M+y>T?T:M+y));return k===1?(m=p[b-1],_.push(n[m>>2]+n[m<<4&63]+"==")):k===2&&(m=(p[b-2]<<8)+p[b-1],_.push(n[m>>10]+n[m>>4&63]+n[m<<2&63]+"=")),_.join("")}return Rr}function ov(){if(Xo)return M5;Xo=!0;return M5.read=function(n,e,t,r,i){var s,o,l=i*8-r-1,a=(1<<l)-1,v=a>>1,c=-7,u=t?i-1:0,h=t?-1:1,p=n[e+u];for(u+=h,s=p&(1<<-c)-1,p>>=-c,c+=l;c>0;s=s*256+n[e+u],u+=h,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=r;c>0;o=o*256+n[e+u],u+=h,c-=8);if(s===0)s=1-v;else{if(s===a)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-v}return(p?-1:1)*o*Math.pow(2,s-r)},M5.write=function(n,e,t,r,i,s){var o,l,a,v=s*8-i-1,c=(1<<v)-1,u=c>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,m=r?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),o+u>=1?e+=h/a:e+=h*Math.pow(2,1-u),e*a>=2&&(o++,a/=2),o+u>=c?(l=0,o=c):o+u>=1?(l=(e*a-1)*Math.pow(2,i),o=o+u):(l=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;n[t+p]=l&255,p+=m,l/=256,i-=8);for(o=o<<i|l,v+=i;v>0;n[t+p]=o&255,p+=m,o/=256,v-=8);n[t+p-m]|=b*128},M5}function $o(){if(Zo)return u0;Zo=!0;let n=sv(),e=ov(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;u0.Buffer=o,u0.SlowBuffer=_,u0.INSPECT_MAX_BYTES=50;let r=2147483647;u0.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u";function i(){try{let w=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(w,f),w.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(w){if(w>r)throw new RangeError('The value "'+w+'" is invalid for option "size"');let f=new Uint8Array(w);return Object.setPrototypeOf(f,o.prototype),f}function o(w,f,g){if(typeof w=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(w)}return l(w,f,g)}o.poolSize=8192;function l(w,f,g){if(typeof w=="string")return u(w,f);if(ArrayBuffer.isView(w))return p(w);if(w==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w);if(Ie(w,ArrayBuffer)||w&&Ie(w.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ie(w,SharedArrayBuffer)||w&&Ie(w.buffer,SharedArrayBuffer)))return m(w,f,g);if(typeof w=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let C=w.valueOf&&w.valueOf();if(C!=null&&C!==w)return o.from(C,f,g);let I=b(w);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof w[Symbol.toPrimitive]=="function")return o.from(w[Symbol.toPrimitive]("string"),f,g);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w)}o.from=function(w,f,g){return l(w,f,g)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function a(w){if(typeof w!="number")throw new TypeError('"size" argument must be of type number');if(w<0)throw new RangeError('The value "'+w+'" is invalid for option "size"')}function v(w,f,g){return a(w),w<=0?s(w):f!==void 0?typeof g=="string"?s(w).fill(f,g):s(w).fill(f):s(w)}o.alloc=function(w,f,g){return v(w,f,g)};function c(w){return a(w),s(w<0?0:k(w)|0)}o.allocUnsafe=function(w){return c(w)},o.allocUnsafeSlow=function(w){return c(w)};function u(w,f){if((typeof f!="string"||f==="")&&(f="utf8"),!o.isEncoding(f))throw new TypeError("Unknown encoding: "+f);let g=y(w,f)|0,C=s(g),I=C.write(w,f);return I!==g&&(C=C.slice(0,I)),C}function h(w){let f=w.length<0?0:k(w.length)|0,g=s(f);for(let C=0;C<f;C+=1)g[C]=w[C]&255;return g}function p(w){if(Ie(w,Uint8Array)){let f=new Uint8Array(w);return m(f.buffer,f.byteOffset,f.byteLength)}return h(w)}function m(w,f,g){if(f<0||w.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(w.byteLength<f+(g||0))throw new RangeError('"length" is outside of buffer bounds');let C;return f===void 0&&g===void 0?C=new Uint8Array(w):g===void 0?C=new Uint8Array(w,f):C=new Uint8Array(w,f,g),Object.setPrototypeOf(C,o.prototype),C}function b(w){if(o.isBuffer(w)){let f=k(w.length)|0,g=s(f);return g.length===0||w.copy(g,0,0,f),g}if(w.length!==void 0)return typeof w.length!="number"||N0(w.length)?s(0):h(w);if(w.type==="Buffer"&&Array.isArray(w.data))return h(w.data)}function k(w){if(w>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return w|0}function _(w){return+w!=w&&(w=0),o.alloc(+w)}o.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==o.prototype},o.compare=function(f,g){if(Ie(f,Uint8Array)&&(f=o.from(f,f.offset,f.byteLength)),Ie(g,Uint8Array)&&(g=o.from(g,g.offset,g.byteLength)),!o.isBuffer(f)||!o.isBuffer(g))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===g)return 0;let C=f.length,I=g.length;for(let U=0,G=Math.min(C,I);U<G;++U)if(f[U]!==g[U]){C=f[U],I=g[U];break}return C<I?-1:I<C?1:0},o.isEncoding=function(f){switch(String(f).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}},o.concat=function(f,g){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return o.alloc(0);let C;if(g===void 0)for(g=0,C=0;C<f.length;++C)g+=f[C].length;let I=o.allocUnsafe(g),U=0;for(C=0;C<f.length;++C){let G=f[C];if(Ie(G,Uint8Array))U+G.length>I.length?(o.isBuffer(G)||(G=o.from(G)),G.copy(I,U)):Uint8Array.prototype.set.call(I,G,U);else if(o.isBuffer(G))G.copy(I,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=G.length}return I};function y(w,f){if(o.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||Ie(w,ArrayBuffer))return w.byteLength;if(typeof w!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof w);let g=w.length,C=arguments.length>2&&arguments[2]===!0;if(!C&&g===0)return 0;let I=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":return G0(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return fi(w).length;default:if(I)return C?-1:G0(w).length;f=(""+f).toLowerCase(),I=!0}}o.byteLength=y;function M(w,f,g){let C=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,f>>>=0,g<=f))return"";for(w||(w="utf8");;)switch(w){case"hex":return fe(this,f,g);case"utf8":case"utf-8":return q(this,f,g);case"ascii":return se(this,f,g);case"latin1":case"binary":return he(this,f,g);case"base64":return Y(this,f,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,f,g);default:if(C)throw new TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),C=!0}}o.prototype._isBuffer=!0;function T(w,f,g){let C=w[f];w[f]=w[g],w[g]=C}o.prototype.swap16=function(){let f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let g=0;g<f;g+=2)T(this,g,g+1);return this},o.prototype.swap32=function(){let f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let g=0;g<f;g+=4)T(this,g,g+3),T(this,g+1,g+2);return this},o.prototype.swap64=function(){let f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let g=0;g<f;g+=8)T(this,g,g+7),T(this,g+1,g+6),T(this,g+2,g+5),T(this,g+3,g+4);return this},o.prototype.toString=function(){let f=this.length;return f===0?"":arguments.length===0?q(this,0,f):M.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(f){if(!o.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:o.compare(this,f)===0},o.prototype.inspect=function(){let f="",g=u0.INSPECT_MAX_BYTES;return f=this.toString("hex",0,g).replace(/(.{2})/g,"$1 ").trim(),this.length>g&&(f+=" ... "),"<Buffer "+f+">"},t&&(o.prototype[t]=o.prototype.inspect),o.prototype.compare=function(f,g,C,I,U){if(Ie(f,Uint8Array)&&(f=o.from(f,f.offset,f.byteLength)),!o.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(g===void 0&&(g=0),C===void 0&&(C=f?f.length:0),I===void 0&&(I=0),U===void 0&&(U=this.length),g<0||C>f.length||I<0||U>this.length)throw new RangeError("out of range index");if(I>=U&&g>=C)return 0;if(I>=U)return-1;if(g>=C)return 1;if(g>>>=0,C>>>=0,I>>>=0,U>>>=0,this===f)return 0;let G=U-I,ie=C-g,Ae=Math.min(G,ie),_e=this.slice(I,U),we=f.slice(g,C);for(let ge=0;ge<Ae;++ge)if(_e[ge]!==we[ge]){G=_e[ge],ie=we[ge];break}return G<ie?-1:ie<G?1:0};function S(w,f,g,C,I){if(w.length===0)return-1;if(typeof g=="string"?(C=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,N0(g)&&(g=I?0:w.length-1),g<0&&(g=w.length+g),g>=w.length){if(I)return-1;g=w.length-1}else if(g<0)if(I)g=0;else return-1;if(typeof f=="string"&&(f=o.from(f,C)),o.isBuffer(f))return f.length===0?-1:B(w,f,g,C,I);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(w,f,g):Uint8Array.prototype.lastIndexOf.call(w,f,g):B(w,[f],g,C,I);throw new TypeError("val must be string, number or Buffer")}function B(w,f,g,C,I){let U=1,G=w.length,ie=f.length;if(C!==void 0&&(C=String(C).toLowerCase(),C==="ucs2"||C==="ucs-2"||C==="utf16le"||C==="utf-16le")){if(w.length<2||f.length<2)return-1;U=2,G/=2,ie/=2,g/=2}function Ae(we,ge){return U===1?we[ge]:we.readUInt16BE(ge*U)}let _e;if(I){let we=-1;for(_e=g;_e<G;_e++)if(Ae(w,_e)===Ae(f,we===-1?0:_e-we)){if(we===-1&&(we=_e),_e-we+1===ie)return we*U}else we!==-1&&(_e-=_e-we),we=-1}else for(g+ie>G&&(g=G-ie),_e=g;_e>=0;_e--){let we=!0;for(let ge=0;ge<ie;ge++)if(Ae(w,_e+ge)!==Ae(f,ge)){we=!1;break}if(we)return _e}return-1}o.prototype.includes=function(f,g,C){return this.indexOf(f,g,C)!==-1},o.prototype.indexOf=function(f,g,C){return S(this,f,g,C,!0)},o.prototype.lastIndexOf=function(f,g,C){return S(this,f,g,C,!1)};function P(w,f,g,C){g=Number(g)||0;let I=w.length-g;C?(C=Number(C),C>I&&(C=I)):C=I;let U=f.length;C>U/2&&(C=U/2);let G;for(G=0;G<C;++G){let ie=parseInt(f.substr(G*2,2),16);if(N0(ie))return G;w[g+G]=ie}return G}function H(w,f,g,C){return st(G0(f,w.length-g),w,g,C)}function V(w,f,g,C){return st(E5(f),w,g,C)}function z(w,f,g,C){return st(fi(f),w,g,C)}function N(w,f,g,C){return st(x5(f,w.length-g),w,g,C)}o.prototype.write=function(f,g,C,I){if(g===void 0)I="utf8",C=this.length,g=0;else if(C===void 0&&typeof g=="string")I=g,C=this.length,g=0;else if(isFinite(g))g=g>>>0,isFinite(C)?(C=C>>>0,I===void 0&&(I="utf8")):(I=C,C=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let U=this.length-g;if((C===void 0||C>U)&&(C=U),f.length>0&&(C<0||g<0)||g>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");let G=!1;for(;;)switch(I){case"hex":return P(this,f,g,C);case"utf8":case"utf-8":return H(this,f,g,C);case"ascii":case"latin1":case"binary":return V(this,f,g,C);case"base64":return z(this,f,g,C);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,f,g,C);default:if(G)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),G=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Y(w,f,g){return f===0&&g===w.length?n.fromByteArray(w):n.fromByteArray(w.slice(f,g))}function q(w,f,g){g=Math.min(w.length,g);let C=[],I=f;for(;I<g;){let U=w[I],G=null,ie=U>239?4:U>223?3:U>191?2:1;if(I+ie<=g){let Ae,_e,we,ge;switch(ie){case 1:U<128&&(G=U);break;case 2:Ae=w[I+1],(Ae&192)===128&&(ge=(U&31)<<6|Ae&63,ge>127&&(G=ge));break;case 3:Ae=w[I+1],_e=w[I+2],(Ae&192)===128&&(_e&192)===128&&(ge=(U&15)<<12|(Ae&63)<<6|_e&63,ge>2047&&(ge<55296||ge>57343)&&(G=ge));break;case 4:Ae=w[I+1],_e=w[I+2],we=w[I+3],(Ae&192)===128&&(_e&192)===128&&(we&192)===128&&(ge=(U&15)<<18|(Ae&63)<<12|(_e&63)<<6|we&63,ge>65535&&ge<1114112&&(G=ge))}}G===null?(G=65533,ie=1):G>65535&&(G-=65536,C.push(G>>>10&1023|55296),G=56320|G&1023),C.push(G),I+=ie}return te(C)}let J=4096;function te(w){let f=w.length;if(f<=J)return String.fromCharCode.apply(String,w);let g="",C=0;for(;C<f;)g+=String.fromCharCode.apply(String,w.slice(C,C+=J));return g}function se(w,f,g){let C="";g=Math.min(w.length,g);for(let I=f;I<g;++I)C+=String.fromCharCode(w[I]&127);return C}function he(w,f,g){let C="";g=Math.min(w.length,g);for(let I=f;I<g;++I)C+=String.fromCharCode(w[I]);return C}function fe(w,f,g){let C=w.length;(!f||f<0)&&(f=0),(!g||g<0||g>C)&&(g=C);let I="";for(let U=f;U<g;++U)I+=Ar[w[U]];return I}function pe(w,f,g){let C=w.slice(f,g),I="";for(let U=0;U<C.length-1;U+=2)I+=String.fromCharCode(C[U]+C[U+1]*256);return I}o.prototype.slice=function(f,g){let C=this.length;f=~~f,g=g===void 0?C:~~g,f<0?(f+=C,f<0&&(f=0)):f>C&&(f=C),g<0?(g+=C,g<0&&(g=0)):g>C&&(g=C),g<f&&(g=f);let I=this.subarray(f,g);return Object.setPrototypeOf(I,o.prototype),I};function oe(w,f,g){if(w%1!==0||w<0)throw new RangeError("offset is not uint");if(w+f>g)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(f,g,C){f=f>>>0,g=g>>>0,C||oe(f,g,this.length);let I=this[f],U=1,G=0;for(;++G<g&&(U*=256);)I+=this[f+G]*U;return I},o.prototype.readUintBE=o.prototype.readUIntBE=function(f,g,C){f=f>>>0,g=g>>>0,C||oe(f,g,this.length);let I=this[f+--g],U=1;for(;g>0&&(U*=256);)I+=this[f+--g]*U;return I},o.prototype.readUint8=o.prototype.readUInt8=function(f,g){return f=f>>>0,g||oe(f,1,this.length),this[f]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(f,g){return f=f>>>0,g||oe(f,2,this.length),this[f]|this[f+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(f,g){return f=f>>>0,g||oe(f,2,this.length),this[f]<<8|this[f+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(f,g){return f=f>>>0,g||oe(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(f,g){return f=f>>>0,g||oe(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},o.prototype.readBigUInt64LE=gt(function(f){f=f>>>0,jt(f,"offset");let g=this[f],C=this[f+7];(g===void 0||C===void 0)&&v0(f,this.length-8);let I=g+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,U=this[++f]+this[++f]*2**8+this[++f]*2**16+C*2**24;return BigInt(I)+(BigInt(U)<<BigInt(32))}),o.prototype.readBigUInt64BE=gt(function(f){f=f>>>0,jt(f,"offset");let g=this[f],C=this[f+7];(g===void 0||C===void 0)&&v0(f,this.length-8);let I=g*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],U=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+C;return(BigInt(I)<<BigInt(32))+BigInt(U)}),o.prototype.readIntLE=function(f,g,C){f=f>>>0,g=g>>>0,C||oe(f,g,this.length);let I=this[f],U=1,G=0;for(;++G<g&&(U*=256);)I+=this[f+G]*U;return U*=128,I>=U&&(I-=Math.pow(2,8*g)),I},o.prototype.readIntBE=function(f,g,C){f=f>>>0,g=g>>>0,C||oe(f,g,this.length);let I=g,U=1,G=this[f+--I];for(;I>0&&(U*=256);)G+=this[f+--I]*U;return U*=128,G>=U&&(G-=Math.pow(2,8*g)),G},o.prototype.readInt8=function(f,g){return f=f>>>0,g||oe(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},o.prototype.readInt16LE=function(f,g){f=f>>>0,g||oe(f,2,this.length);let C=this[f]|this[f+1]<<8;return C&32768?C|4294901760:C},o.prototype.readInt16BE=function(f,g){f=f>>>0,g||oe(f,2,this.length);let C=this[f+1]|this[f]<<8;return C&32768?C|4294901760:C},o.prototype.readInt32LE=function(f,g){return f=f>>>0,g||oe(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},o.prototype.readInt32BE=function(f,g){return f=f>>>0,g||oe(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},o.prototype.readBigInt64LE=gt(function(f){f=f>>>0,jt(f,"offset");let g=this[f],C=this[f+7];(g===void 0||C===void 0)&&v0(f,this.length-8);let I=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(C<<24);return(BigInt(I)<<BigInt(32))+BigInt(g+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),o.prototype.readBigInt64BE=gt(function(f){f=f>>>0,jt(f,"offset");let g=this[f],C=this[f+7];(g===void 0||C===void 0)&&v0(f,this.length-8);let I=(g<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(I)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+C)}),o.prototype.readFloatLE=function(f,g){return f=f>>>0,g||oe(f,4,this.length),e.read(this,f,!0,23,4)},o.prototype.readFloatBE=function(f,g){return f=f>>>0,g||oe(f,4,this.length),e.read(this,f,!1,23,4)},o.prototype.readDoubleLE=function(f,g){return f=f>>>0,g||oe(f,8,this.length),e.read(this,f,!0,52,8)},o.prototype.readDoubleBE=function(f,g){return f=f>>>0,g||oe(f,8,this.length),e.read(this,f,!1,52,8)};function Q(w,f,g,C,I,U){if(!o.isBuffer(w))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>I||f<U)throw new RangeError('"value" argument is out of bounds');if(g+C>w.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(f,g,C,I){if(f=+f,g=g>>>0,C=C>>>0,!I){let ie=Math.pow(2,8*C)-1;Q(this,f,g,C,ie,0)}let U=1,G=0;for(this[g]=f&255;++G<C&&(U*=256);)this[g+G]=f/U&255;return g+C},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(f,g,C,I){if(f=+f,g=g>>>0,C=C>>>0,!I){let ie=Math.pow(2,8*C)-1;Q(this,f,g,C,ie,0)}let U=C-1,G=1;for(this[g+U]=f&255;--U>=0&&(G*=256);)this[g+U]=f/G&255;return g+C},o.prototype.writeUint8=o.prototype.writeUInt8=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,1,255,0),this[g]=f&255,g+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,2,65535,0),this[g]=f&255,this[g+1]=f>>>8,g+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,2,65535,0),this[g]=f>>>8,this[g+1]=f&255,g+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,4,4294967295,0),this[g+3]=f>>>24,this[g+2]=f>>>16,this[g+1]=f>>>8,this[g]=f&255,g+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,4,4294967295,0),this[g]=f>>>24,this[g+1]=f>>>16,this[g+2]=f>>>8,this[g+3]=f&255,g+4};function ce(w,f,g,C,I){l0(f,C,I,w,g,7);let U=Number(f&BigInt(4294967295));w[g++]=U,U=U>>8,w[g++]=U,U=U>>8,w[g++]=U,U=U>>8,w[g++]=U;let G=Number(f>>BigInt(32)&BigInt(4294967295));return w[g++]=G,G=G>>8,w[g++]=G,G=G>>8,w[g++]=G,G=G>>8,w[g++]=G,g}function be(w,f,g,C,I){l0(f,C,I,w,g,7);let U=Number(f&BigInt(4294967295));w[g+7]=U,U=U>>8,w[g+6]=U,U=U>>8,w[g+5]=U,U=U>>8,w[g+4]=U;let G=Number(f>>BigInt(32)&BigInt(4294967295));return w[g+3]=G,G=G>>8,w[g+2]=G,G=G>>8,w[g+1]=G,G=G>>8,w[g]=G,g+8}o.prototype.writeBigUInt64LE=gt(function(f,g=0){return ce(this,f,g,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=gt(function(f,g=0){return be(this,f,g,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(f,g,C,I){if(f=+f,g=g>>>0,!I){let Ae=Math.pow(2,8*C-1);Q(this,f,g,C,Ae-1,-Ae)}let U=0,G=1,ie=0;for(this[g]=f&255;++U<C&&(G*=256);)f<0&&ie===0&&this[g+U-1]!==0&&(ie=1),this[g+U]=(f/G>>0)-ie&255;return g+C},o.prototype.writeIntBE=function(f,g,C,I){if(f=+f,g=g>>>0,!I){let Ae=Math.pow(2,8*C-1);Q(this,f,g,C,Ae-1,-Ae)}let U=C-1,G=1,ie=0;for(this[g+U]=f&255;--U>=0&&(G*=256);)f<0&&ie===0&&this[g+U+1]!==0&&(ie=1),this[g+U]=(f/G>>0)-ie&255;return g+C},o.prototype.writeInt8=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,1,127,-128),f<0&&(f=255+f+1),this[g]=f&255,g+1},o.prototype.writeInt16LE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,2,32767,-32768),this[g]=f&255,this[g+1]=f>>>8,g+2},o.prototype.writeInt16BE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,2,32767,-32768),this[g]=f>>>8,this[g+1]=f&255,g+2},o.prototype.writeInt32LE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,4,2147483647,-2147483648),this[g]=f&255,this[g+1]=f>>>8,this[g+2]=f>>>16,this[g+3]=f>>>24,g+4},o.prototype.writeInt32BE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[g]=f>>>24,this[g+1]=f>>>16,this[g+2]=f>>>8,this[g+3]=f&255,g+4},o.prototype.writeBigInt64LE=gt(function(f,g=0){return ce(this,f,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=gt(function(f,g=0){return be(this,f,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function qe(w,f,g,C,I,U){if(g+C>w.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function Re(w,f,g,C,I){return f=+f,g=g>>>0,I||qe(w,f,g,4),e.write(w,f,g,C,23,4),g+4}o.prototype.writeFloatLE=function(f,g,C){return Re(this,f,g,!0,C)},o.prototype.writeFloatBE=function(f,g,C){return Re(this,f,g,!1,C)};function at(w,f,g,C,I){return f=+f,g=g>>>0,I||qe(w,f,g,8),e.write(w,f,g,C,52,8),g+8}o.prototype.writeDoubleLE=function(f,g,C){return at(this,f,g,!0,C)},o.prototype.writeDoubleBE=function(f,g,C){return at(this,f,g,!1,C)},o.prototype.copy=function(f,g,C,I){if(!o.isBuffer(f))throw new TypeError("argument should be a Buffer");if(C||(C=0),!I&&I!==0&&(I=this.length),g>=f.length&&(g=f.length),g||(g=0),I>0&&I<C&&(I=C),I===C||f.length===0||this.length===0)return 0;if(g<0)throw new RangeError("targetStart out of bounds");if(C<0||C>=this.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("sourceEnd out of bounds");I>this.length&&(I=this.length),f.length-g<I-C&&(I=f.length-g+C);let U=I-C;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(g,C,I):Uint8Array.prototype.set.call(f,this.subarray(C,I),g),U},o.prototype.fill=function(f,g,C,I){if(typeof f=="string"){if(typeof g=="string"?(I=g,g=0,C=this.length):typeof C=="string"&&(I=C,C=this.length),I!==void 0&&typeof I!="string")throw new TypeError("encoding must be a string");if(typeof I=="string"&&!o.isEncoding(I))throw new TypeError("Unknown encoding: "+I);if(f.length===1){let G=f.charCodeAt(0);(I==="utf8"&&G<128||I==="latin1")&&(f=G)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(g<0||this.length<g||this.length<C)throw new RangeError("Out of range index");if(C<=g)return this;g=g>>>0,C=C===void 0?this.length:C>>>0,f||(f=0);let U;if(typeof f=="number")for(U=g;U<C;++U)this[U]=f;else{let G=o.isBuffer(f)?f:o.from(f,I),ie=G.length;if(ie===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(U=0;U<C-g;++U)this[U+g]=G[U%ie]}return this};let ye={};function ut(w,f,g){ye[w]=class extends g{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${w}]`,this.stack,delete this.name}get code(){return w}set code(I){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:I,writable:!0})}toString(){return`${this.name} [${w}]: ${this.message}`}}}ut("ERR_BUFFER_OUT_OF_BOUNDS",function(w){return w?`${w} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ut("ERR_INVALID_ARG_TYPE",function(w,f){return`The "${w}" argument must be of type number. Received type ${typeof f}`},TypeError),ut("ERR_OUT_OF_RANGE",function(w,f,g){let C=`The value of "${w}" is out of range.`,I=g;return Number.isInteger(g)&&Math.abs(g)>2**32?I=_r(String(g)):typeof g=="bigint"&&(I=String(g),(g>BigInt(2)**BigInt(32)||g<-(BigInt(2)**BigInt(32)))&&(I=_r(I)),I+="n"),C+=` It must be ${f}. Received ${I}`,C},RangeError);function _r(w){let f="",g=w.length,C=w[0]==="-"?1:0;for(;g>=C+4;g-=3)f=`_${w.slice(g-3,g)}${f}`;return`${w.slice(0,g)}${f}`}function wr(w,f,g){jt(f,"offset"),(w[f]===void 0||w[f+g]===void 0)&&v0(f,w.length-(g+1))}function l0(w,f,g,C,I,U){if(w>g||w<f){let G=typeof f=="bigint"?"n":"",ie;throw f===0||f===BigInt(0)?ie=`>= 0${G} and < 2${G} ** ${(U+1)*8}${G}`:ie=`>= -(2${G} ** ${(U+1)*8-1}${G}) and < 2 ** ${(U+1)*8-1}${G}`,new ye.ERR_OUT_OF_RANGE("value",ie,w)}wr(C,I,U)}function jt(w,f){if(typeof w!="number")throw new ye.ERR_INVALID_ARG_TYPE(f,"number",w)}function v0(w,f,g){throw Math.floor(w)!==w?(jt(w,g),new ye.ERR_OUT_OF_RANGE("offset","an integer",w)):f<0?new ye.ERR_BUFFER_OUT_OF_BOUNDS:new ye.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${f}`,w)}let A5=/[^+/0-9A-Za-z-_]/g;function c0(w){if(w=w.split("=")[0],w=w.trim().replace(A5,""),w.length<2)return"";for(;w.length%4!==0;)w=w+"=";return w}function G0(w,f){f=f||1/0;let g,C=w.length,I=null,U=[];for(let G=0;G<C;++G){if(g=w.charCodeAt(G),g>55295&&g<57344){if(!I){if(g>56319){(f-=3)>-1&&U.push(239,191,189);continue}else if(G+1===C){(f-=3)>-1&&U.push(239,191,189);continue}I=g;continue}if(g<56320){(f-=3)>-1&&U.push(239,191,189),I=g;continue}g=(I-55296<<10|g-56320)+65536}else I&&(f-=3)>-1&&U.push(239,191,189);if(I=null,g<128){if((f-=1)<0)break;U.push(g)}else if(g<2048){if((f-=2)<0)break;U.push(g>>6|192,g&63|128)}else if(g<65536){if((f-=3)<0)break;U.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((f-=4)<0)break;U.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return U}function E5(w){let f=[];for(let g=0;g<w.length;++g)f.push(w.charCodeAt(g)&255);return f}function x5(w,f){let g,C,I,U=[];for(let G=0;G<w.length&&!((f-=2)<0);++G)g=w.charCodeAt(G),C=g>>8,I=g%256,U.push(I),U.push(C);return U}function fi(w){return n.toByteArray(c0(w))}function st(w,f,g,C){let I;for(I=0;I<C&&!(I+g>=f.length||I>=w.length);++I)f[I+g]=w[I];return I}function Ie(w,f){return w instanceof f||w!=null&&w.constructor!=null&&w.constructor.name!=null&&w.constructor.name===f.name}function N0(w){return w!==w}let Ar=function(){let w="0123456789abcdef",f=new Array(256);for(let g=0;g<16;++g){let C=g*16;for(let I=0;I<16;++I)f[C+I]=w[g]+w[I]}return f}();function gt(w){return typeof BigInt>"u"?W0:w}function W0(){throw new Error("BigInt not supported")}return u0}var Rr,Jo,M5,Xo,u0,Zo,ea=Ve(()=>{A();E();R();x();Rr={},Jo=!1;M5={},Xo=!1;u0={},Zo=!1});var h0,O,sh,oh,ta=Ve(()=>{A();E();R();x();ea();h0=$o();h0.Buffer;h0.SlowBuffer;h0.INSPECT_MAX_BYTES;h0.kMaxLength;O=h0.Buffer,sh=h0.INSPECT_MAX_BYTES,oh=h0.kMaxLength});var R=Ve(()=>{ta()});var la=ht((xi,Ri)=>{A();E();R();x();(function(n,e){typeof xi=="object"&&typeof Ri<"u"?Ri.exports=e():typeof define=="function"&&define.amd?define(e):n.Stats=e()})(xi,function(){var n=function(){function e(u){return i.appendChild(u.dom),u}function t(u){for(var h=0;h<i.children.length;h++)i.children[h].style.display=h===u?"block":"none";r=u}var r=0,i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(u){u.preventDefault(),t(++r%i.children.length)},!1);var s=(performance||Date).now(),o=s,l=0,a=e(new n.Panel("FPS","#0ff","#002")),v=e(new n.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=e(new n.Panel("MB","#f08","#201"));return t(0),{REVISION:16,dom:i,addPanel:e,showPanel:t,begin:function(){s=(performance||Date).now()},end:function(){l++;var u=(performance||Date).now();if(v.update(u-s,200),u>o+1e3&&(a.update(1e3*l/(u-o),100),o=u,l=0,c)){var h=performance.memory;c.update(h.usedJSHeapSize/1048576,h.jsHeapSizeLimit/1048576)}return u},update:function(){s=this.end()},domElement:i,setMode:t}};return n.Panel=function(e,t,r){var i=1/0,s=0,o=Math.round,l=o(window.devicePixelRatio||1),a=80*l,v=48*l,c=3*l,u=2*l,h=3*l,p=15*l,m=74*l,b=30*l,k=document.createElement("canvas");k.width=a,k.height=v,k.style.cssText="width:80px;height:48px";var _=k.getContext("2d");return _.font="bold "+9*l+"px Helvetica,Arial,sans-serif",_.textBaseline="top",_.fillStyle=r,_.fillRect(0,0,a,v),_.fillStyle=t,_.fillText(e,c,u),_.fillRect(h,p,m,b),_.fillStyle=r,_.globalAlpha=.9,_.fillRect(h,p,m,b),{dom:k,update:function(y,M){i=Math.min(i,y),s=Math.max(s,y),_.fillStyle=r,_.globalAlpha=1,_.fillRect(0,0,a,p),_.fillStyle=t,_.fillText(o(y)+" "+e+" ("+o(i)+"-"+o(s)+")",c,u),_.drawImage(k,h+l,p,m-l,b,h,p,m-l,b),_.fillRect(h+m-l,p,l,b),_.fillStyle=r,_.globalAlpha=.9,_.fillRect(h+m-l,p,l,o((1-y/M)*b))}}},n})});var r8,n8,Ft,i8,N5=Ve(()=>{"use strict";A();E();R();x();r8=n=>{let e=n%24e3/24e3-.25;return e<0&&(e+=1),e>1&&(e-=1),e+(1-Math.cos(e*Math.PI))/2},n8=n=>{let e=(n%24e3+24e3)%24e3,t=r8(e),i=Math.cos(t*Math.PI*2)*.5+.5,s=Math.round(4+i*11);return Math.max(4,Math.min(15,s))},Ft=n=>{let e=(n%24e3+24e3)%24e3;if(e>=0&&e<12e3)return 15;if(e>=12e3&&e<13e3){let t=(e-12e3)/1e3;return Math.round(15-t*11)}else{if(e>=13e3&&e<23e3)return 4;{let t=(e-23e3)/1e3;return Math.round(4+t*11)}}},i8=()=>{let n=[{ticks:0,label:"6:00 AM (sunrise)"},{ticks:6e3,label:"12:00 PM (noon)"},{ticks:12e3,label:"6:00 PM (sunset starts)"},{ticks:12500,label:"6:30 PM (sunset mid)"},{ticks:13e3,label:"7:00 PM (night begins)"},{ticks:18e3,label:"12:00 AM (midnight)"},{ticks:19e3,label:"1:00 AM"},{ticks:23e3,label:"5:00 AM (dawn begins)"},{ticks:23500,label:"5:30 AM (dawn mid)"}];for(let{ticks:e,label:t}of n){let r=n8(e),i=Ft(e)}};typeof window<"u"&&(window.debugSkyLight=i8)});var a2=ht((o2,nn)=>{A();E();R();x();(function(n,e){typeof nn=="object"&&nn.exports?nn.exports=e():n.nearley=e()})(o2,function(){function n(a,v,c){return this.id=++n.highestId,this.name=a,this.symbols=v,this.postprocess=c,this}n.highestId=0,n.prototype.toString=function(a){var v=typeof a>"u"?this.symbols.map(l).join(" "):this.symbols.slice(0,a).map(l).join(" ")+" \u25CF "+this.symbols.slice(a).map(l).join(" ");return this.name+" \u2192 "+v};function e(a,v,c,u){this.rule=a,this.dot=v,this.reference=c,this.data=[],this.wantedBy=u,this.isComplete=this.dot===a.symbols.length}e.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},e.prototype.nextState=function(a){var v=new e(this.rule,this.dot+1,this.reference,this.wantedBy);return v.left=this,v.right=a,v.isComplete&&(v.data=v.build(),v.right=void 0),v},e.prototype.build=function(){var a=[],v=this;do a.push(v.right.data),v=v.left;while(v.left);return a.reverse(),a},e.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,s.fail))};function t(a,v){this.grammar=a,this.index=v,this.states=[],this.wants={},this.scannable=[],this.completed={}}t.prototype.process=function(a){for(var v=this.states,c=this.wants,u=this.completed,h=0;h<v.length;h++){var p=v[h];if(p.isComplete){if(p.finish(),p.data!==s.fail){for(var m=p.wantedBy,b=m.length;b--;){var k=m[b];this.complete(k,p)}if(p.reference===this.index){var _=p.rule.name;(this.completed[_]=this.completed[_]||[]).push(p)}}}else{var _=p.rule.symbols[p.dot];if(typeof _!="string"){this.scannable.push(p);continue}if(c[_]){if(c[_].push(p),u.hasOwnProperty(_))for(var y=u[_],b=0;b<y.length;b++){var M=y[b];this.complete(p,M)}}else c[_]=[p],this.predict(_)}}},t.prototype.predict=function(a){for(var v=this.grammar.byName[a]||[],c=0;c<v.length;c++){var u=v[c],h=this.wants[a],p=new e(u,0,this.index,h);this.states.push(p)}},t.prototype.complete=function(a,v){var c=a.nextState(v);this.states.push(c)};function r(a,v){this.rules=a,this.start=v||this.rules[0].name;var c=this.byName={};this.rules.forEach(function(u){c.hasOwnProperty(u.name)||(c[u.name]=[]),c[u.name].push(u)})}r.fromCompiled=function(u,v){var c=u.Lexer;u.ParserStart&&(v=u.ParserStart,u=u.ParserRules);var u=u.map(function(p){return new n(p.name,p.symbols,p.postprocess)}),h=new r(u,v);return h.lexer=c,h};function i(){this.reset("")}i.prototype.reset=function(a,v){this.buffer=a,this.index=0,this.line=v?v.line:1,this.lastLineBreak=v?-v.col:0},i.prototype.next=function(){if(this.index<this.buffer.length){var a=this.buffer[this.index++];return a===`
1
+ var $l=Object.create;var Er=Object.defineProperty;var ev=Object.getOwnPropertyDescriptor;var tv=Object.getOwnPropertyNames;var rv=Object.getPrototypeOf,nv=Object.prototype.hasOwnProperty;var iv=(n,e,t)=>e in n?Er(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var sv=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var Ve=(n,e)=>()=>(n&&(e=n(n=0)),e);var ht=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),R5=(n,e)=>{for(var t in e)Er(n,t,{get:e[t],enumerable:!0})},Bs=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of tv(e))!nv.call(n,i)&&i!==t&&Er(n,i,{get:()=>e[i],enumerable:!(r=ev(e,i))||r.enumerable});return n};var xr=(n,e,t)=>(t=n!=null?$l(rv(n)):{},Bs(e||!n||!n.__esModule?Er(t,"default",{value:n,enumerable:!0}):t,n)),ov=n=>Bs(Er({},"__esModule",{value:!0}),n);var d=(n,e,t)=>(iv(n,typeof e!="symbol"?e+"":e,t),t);var A=Ve(()=>{});var E=Ve(()=>{});var L={};R5(L,{_debugEnd:()=>wo,_debugProcess:()=>_o,_events:()=>Do,_eventsCount:()=>Fo,_exiting:()=>eo,_fatalExceptions:()=>po,_getActiveHandles:()=>io,_getActiveRequests:()=>no,_kill:()=>oo,_linkedBinding:()=>Zs,_maxListeners:()=>Oo,_preload_modules:()=>Io,_rawDebug:()=>Js,_startProfilerIdleNotifier:()=>Ao,_stopProfilerIdleNotifier:()=>Eo,_tickCallback:()=>yo,abort:()=>So,addListener:()=>zo,allowedNodeEnvironmentFlags:()=>ho,arch:()=>Os,argv:()=>zs,argv0:()=>Po,assert:()=>fo,binding:()=>Ws,browser:()=>qs,chdir:()=>Qs,config:()=>to,cpuUsage:()=>T5,cwd:()=>Ys,debugPort:()=>Bo,default:()=>Ko,dlopen:()=>ro,domain:()=>$s,emit:()=>Wo,emitWarning:()=>Ns,env:()=>Fs,execArgv:()=>Us,execPath:()=>Co,exit:()=>co,features:()=>mo,hasUncaughtExceptionCaptureCallback:()=>bo,hrtime:()=>S5,kill:()=>vo,listeners:()=>Qo,memoryUsage:()=>lo,moduleLoadList:()=>Xs,nextTick:()=>Is,off:()=>Vo,on:()=>Lt,once:()=>Uo,openStdin:()=>uo,pid:()=>To,platform:()=>Ds,ppid:()=>Mo,prependListener:()=>jo,prependOnceListener:()=>Yo,reallyExit:()=>so,release:()=>Ks,removeAllListeners:()=>No,removeListener:()=>Go,resourceUsage:()=>ao,setSourceMapsEnabled:()=>Ho,setUncaughtExceptionCaptureCallback:()=>go,stderr:()=>Ro,stdin:()=>ko,stdout:()=>xo,title:()=>Ls,umask:()=>js,uptime:()=>Lo,version:()=>Vs,versions:()=>Gs});function gi(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function av(){!j0||!d0||(j0=!1,d0.length?Ht=d0.concat(Ht):k5=-1,Ht.length&&Ps())}function Ps(){if(!j0){var n=setTimeout(av,0);j0=!0;for(var e=Ht.length;e;){for(d0=Ht,Ht=[];++k5<e;)d0&&d0[k5].run();k5=-1,e=Ht.length}d0=null,j0=!1,clearTimeout(n)}}function Is(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];Ht.push(new Hs(n,e)),Ht.length===1&&!j0&&setTimeout(Ps,0)}function Hs(n,e){this.fun=n,this.array=e}function Ze(){}function Zs(n){gi("_linkedBinding")}function ro(n){gi("dlopen")}function no(){return[]}function io(){return[]}function fo(n,e){if(!n)throw new Error(e||"assertion error")}function bo(){return!1}function Lo(){return Yt.now()/1e3}function S5(n){var e=Math.floor((Date.now()-Yt.now())*.001),t=Yt.now()*.001,r=Math.floor(t)+e,i=Math.floor(t%1*1e9);return n&&(r=r-n[0],i=i-n[1],i<0&&(r--,i+=pi)),[r,i]}function Lt(){return Ko}function Qo(n){return[]}var Ht,j0,d0,k5,Ls,Os,Ds,Fs,zs,Us,Vs,Gs,Ns,Ws,js,Ys,Qs,Ks,qs,Js,Xs,$s,eo,to,so,oo,T5,ao,lo,vo,co,uo,ho,mo,po,go,yo,_o,wo,Ao,Eo,xo,Ro,ko,So,To,Mo,Co,Bo,Po,Io,Ho,Yt,mi,pi,Oo,Do,Fo,zo,Uo,Vo,Go,No,Wo,jo,Yo,Ko,qo=Ve(()=>{A();E();R();x();Ht=[],j0=!1,k5=-1;Hs.prototype.run=function(){this.fun.apply(null,this.array)};Ls="browser",Os="x64",Ds="browser",Fs={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},zs=["/usr/bin/node"],Us=[],Vs="v16.8.0",Gs={},Ns=function(n,e){},Ws=function(n){gi("binding")},js=function(n){return 0},Ys=function(){return"/"},Qs=function(n){},Ks={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};qs=!0,Js=Ze,Xs=[];$s={},eo=!1,to={};so=Ze,oo=Ze,T5=function(){return{}},ao=T5,lo=T5,vo=Ze,co=Ze,uo=Ze,ho={};mo={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},po=Ze,go=Ze;yo=Ze,_o=Ze,wo=Ze,Ao=Ze,Eo=Ze,xo=void 0,Ro=void 0,ko=void 0,So=Ze,To=2,Mo=1,Co="/bin/usr/node",Bo=9229,Po="node",Io=[],Ho=Ze,Yt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Yt.now===void 0&&(mi=Date.now(),Yt.timing&&Yt.timing.navigationStart&&(mi=Yt.timing.navigationStart),Yt.now=()=>Date.now()-mi);pi=1e9;S5.bigint=function(n){var e=S5(n);return typeof BigInt>"u"?e[0]*pi+e[1]:BigInt(e[0]*pi)+BigInt(e[1])};Oo=10,Do={},Fo=0;zo=Lt,Uo=Lt,Vo=Lt,Go=Lt,No=Lt,Wo=Ze,jo=Lt,Yo=Lt;Ko={version:Vs,versions:Gs,arch:Os,platform:Ds,browser:qs,release:Ks,_rawDebug:Js,moduleLoadList:Xs,binding:Ws,_linkedBinding:Zs,_events:Do,_eventsCount:Fo,_maxListeners:Oo,on:Lt,addListener:zo,once:Uo,off:Vo,removeListener:Go,removeAllListeners:No,emit:Wo,prependListener:jo,prependOnceListener:Yo,listeners:Qo,domain:$s,_exiting:eo,config:to,dlopen:ro,uptime:Lo,_getActiveRequests:no,_getActiveHandles:io,reallyExit:so,_kill:oo,cpuUsage:T5,resourceUsage:ao,memoryUsage:lo,kill:vo,exit:co,openStdin:uo,allowedNodeEnvironmentFlags:ho,assert:fo,features:mo,_fatalExceptions:po,setUncaughtExceptionCaptureCallback:go,hasUncaughtExceptionCaptureCallback:bo,emitWarning:Ns,nextTick:Is,_tickCallback:yo,_debugProcess:_o,_debugEnd:wo,_startProfilerIdleNotifier:Ao,_stopProfilerIdleNotifier:Eo,stdout:xo,stdin:ko,stderr:Ro,abort:So,umask:js,chdir:Qs,cwd:Ys,env:Fs,title:Ls,argv:zs,execArgv:Us,pid:To,ppid:Mo,execPath:Co,debugPort:Bo,hrtime:S5,argv0:Po,_preload_modules:Io,setSourceMapsEnabled:Ho}});var x=Ve(()=>{qo()});function lv(){if(Jo)return Rr;Jo=!0,Rr.byteLength=l,Rr.toByteArray=v,Rr.fromByteArray=h;for(var n=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=r.length;i<s;++i)n[i]=r[i],e[r.charCodeAt(i)]=i;e[45]=62,e[95]=63;function o(p){var m=p.length;if(m%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=p.indexOf("=");b===-1&&(b=m);var k=b===m?0:4-b%4;return[b,k]}function l(p){var m=o(p),b=m[0],k=m[1];return(b+k)*3/4-k}function a(p,m,b){return(m+b)*3/4-b}function v(p){var m,b=o(p),k=b[0],_=b[1],y=new t(a(p,k,_)),M=0,T=_>0?k-4:k,S;for(S=0;S<T;S+=4)m=e[p.charCodeAt(S)]<<18|e[p.charCodeAt(S+1)]<<12|e[p.charCodeAt(S+2)]<<6|e[p.charCodeAt(S+3)],y[M++]=m>>16&255,y[M++]=m>>8&255,y[M++]=m&255;return _===2&&(m=e[p.charCodeAt(S)]<<2|e[p.charCodeAt(S+1)]>>4,y[M++]=m&255),_===1&&(m=e[p.charCodeAt(S)]<<10|e[p.charCodeAt(S+1)]<<4|e[p.charCodeAt(S+2)]>>2,y[M++]=m>>8&255,y[M++]=m&255),y}function c(p){return n[p>>18&63]+n[p>>12&63]+n[p>>6&63]+n[p&63]}function u(p,m,b){for(var k,_=[],y=m;y<b;y+=3)k=(p[y]<<16&16711680)+(p[y+1]<<8&65280)+(p[y+2]&255),_.push(c(k));return _.join("")}function h(p){for(var m,b=p.length,k=b%3,_=[],y=16383,M=0,T=b-k;M<T;M+=y)_.push(u(p,M,M+y>T?T:M+y));return k===1?(m=p[b-1],_.push(n[m>>2]+n[m<<4&63]+"==")):k===2&&(m=(p[b-2]<<8)+p[b-1],_.push(n[m>>10]+n[m>>4&63]+n[m<<2&63]+"=")),_.join("")}return Rr}function vv(){if(Xo)return M5;Xo=!0;return M5.read=function(n,e,t,r,i){var s,o,l=i*8-r-1,a=(1<<l)-1,v=a>>1,c=-7,u=t?i-1:0,h=t?-1:1,p=n[e+u];for(u+=h,s=p&(1<<-c)-1,p>>=-c,c+=l;c>0;s=s*256+n[e+u],u+=h,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=r;c>0;o=o*256+n[e+u],u+=h,c-=8);if(s===0)s=1-v;else{if(s===a)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-v}return(p?-1:1)*o*Math.pow(2,s-r)},M5.write=function(n,e,t,r,i,s){var o,l,a,v=s*8-i-1,c=(1<<v)-1,u=c>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,m=r?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),o+u>=1?e+=h/a:e+=h*Math.pow(2,1-u),e*a>=2&&(o++,a/=2),o+u>=c?(l=0,o=c):o+u>=1?(l=(e*a-1)*Math.pow(2,i),o=o+u):(l=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;n[t+p]=l&255,p+=m,l/=256,i-=8);for(o=o<<i|l,v+=i;v>0;n[t+p]=o&255,p+=m,o/=256,v-=8);n[t+p-m]|=b*128},M5}function $o(){if(Zo)return u0;Zo=!0;let n=lv(),e=vv(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;u0.Buffer=o,u0.SlowBuffer=_,u0.INSPECT_MAX_BYTES=50;let r=2147483647;u0.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u";function i(){try{let w=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(w,f),w.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(w){if(w>r)throw new RangeError('The value "'+w+'" is invalid for option "size"');let f=new Uint8Array(w);return Object.setPrototypeOf(f,o.prototype),f}function o(w,f,g){if(typeof w=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(w)}return l(w,f,g)}o.poolSize=8192;function l(w,f,g){if(typeof w=="string")return u(w,f);if(ArrayBuffer.isView(w))return p(w);if(w==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w);if(Ie(w,ArrayBuffer)||w&&Ie(w.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ie(w,SharedArrayBuffer)||w&&Ie(w.buffer,SharedArrayBuffer)))return m(w,f,g);if(typeof w=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let C=w.valueOf&&w.valueOf();if(C!=null&&C!==w)return o.from(C,f,g);let I=b(w);if(I)return I;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof w[Symbol.toPrimitive]=="function")return o.from(w[Symbol.toPrimitive]("string"),f,g);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof w)}o.from=function(w,f,g){return l(w,f,g)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function a(w){if(typeof w!="number")throw new TypeError('"size" argument must be of type number');if(w<0)throw new RangeError('The value "'+w+'" is invalid for option "size"')}function v(w,f,g){return a(w),w<=0?s(w):f!==void 0?typeof g=="string"?s(w).fill(f,g):s(w).fill(f):s(w)}o.alloc=function(w,f,g){return v(w,f,g)};function c(w){return a(w),s(w<0?0:k(w)|0)}o.allocUnsafe=function(w){return c(w)},o.allocUnsafeSlow=function(w){return c(w)};function u(w,f){if((typeof f!="string"||f==="")&&(f="utf8"),!o.isEncoding(f))throw new TypeError("Unknown encoding: "+f);let g=y(w,f)|0,C=s(g),I=C.write(w,f);return I!==g&&(C=C.slice(0,I)),C}function h(w){let f=w.length<0?0:k(w.length)|0,g=s(f);for(let C=0;C<f;C+=1)g[C]=w[C]&255;return g}function p(w){if(Ie(w,Uint8Array)){let f=new Uint8Array(w);return m(f.buffer,f.byteOffset,f.byteLength)}return h(w)}function m(w,f,g){if(f<0||w.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(w.byteLength<f+(g||0))throw new RangeError('"length" is outside of buffer bounds');let C;return f===void 0&&g===void 0?C=new Uint8Array(w):g===void 0?C=new Uint8Array(w,f):C=new Uint8Array(w,f,g),Object.setPrototypeOf(C,o.prototype),C}function b(w){if(o.isBuffer(w)){let f=k(w.length)|0,g=s(f);return g.length===0||w.copy(g,0,0,f),g}if(w.length!==void 0)return typeof w.length!="number"||N0(w.length)?s(0):h(w);if(w.type==="Buffer"&&Array.isArray(w.data))return h(w.data)}function k(w){if(w>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return w|0}function _(w){return+w!=w&&(w=0),o.alloc(+w)}o.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==o.prototype},o.compare=function(f,g){if(Ie(f,Uint8Array)&&(f=o.from(f,f.offset,f.byteLength)),Ie(g,Uint8Array)&&(g=o.from(g,g.offset,g.byteLength)),!o.isBuffer(f)||!o.isBuffer(g))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===g)return 0;let C=f.length,I=g.length;for(let U=0,G=Math.min(C,I);U<G;++U)if(f[U]!==g[U]){C=f[U],I=g[U];break}return C<I?-1:I<C?1:0},o.isEncoding=function(f){switch(String(f).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}},o.concat=function(f,g){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return o.alloc(0);let C;if(g===void 0)for(g=0,C=0;C<f.length;++C)g+=f[C].length;let I=o.allocUnsafe(g),U=0;for(C=0;C<f.length;++C){let G=f[C];if(Ie(G,Uint8Array))U+G.length>I.length?(o.isBuffer(G)||(G=o.from(G)),G.copy(I,U)):Uint8Array.prototype.set.call(I,G,U);else if(o.isBuffer(G))G.copy(I,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=G.length}return I};function y(w,f){if(o.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||Ie(w,ArrayBuffer))return w.byteLength;if(typeof w!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof w);let g=w.length,C=arguments.length>2&&arguments[2]===!0;if(!C&&g===0)return 0;let I=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return g;case"utf8":case"utf-8":return G0(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g*2;case"hex":return g>>>1;case"base64":return fi(w).length;default:if(I)return C?-1:G0(w).length;f=(""+f).toLowerCase(),I=!0}}o.byteLength=y;function M(w,f,g){let C=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((g===void 0||g>this.length)&&(g=this.length),g<=0)||(g>>>=0,f>>>=0,g<=f))return"";for(w||(w="utf8");;)switch(w){case"hex":return fe(this,f,g);case"utf8":case"utf-8":return q(this,f,g);case"ascii":return se(this,f,g);case"latin1":case"binary":return he(this,f,g);case"base64":return Y(this,f,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,f,g);default:if(C)throw new TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),C=!0}}o.prototype._isBuffer=!0;function T(w,f,g){let C=w[f];w[f]=w[g],w[g]=C}o.prototype.swap16=function(){let f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let g=0;g<f;g+=2)T(this,g,g+1);return this},o.prototype.swap32=function(){let f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let g=0;g<f;g+=4)T(this,g,g+3),T(this,g+1,g+2);return this},o.prototype.swap64=function(){let f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let g=0;g<f;g+=8)T(this,g,g+7),T(this,g+1,g+6),T(this,g+2,g+5),T(this,g+3,g+4);return this},o.prototype.toString=function(){let f=this.length;return f===0?"":arguments.length===0?q(this,0,f):M.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(f){if(!o.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:o.compare(this,f)===0},o.prototype.inspect=function(){let f="",g=u0.INSPECT_MAX_BYTES;return f=this.toString("hex",0,g).replace(/(.{2})/g,"$1 ").trim(),this.length>g&&(f+=" ... "),"<Buffer "+f+">"},t&&(o.prototype[t]=o.prototype.inspect),o.prototype.compare=function(f,g,C,I,U){if(Ie(f,Uint8Array)&&(f=o.from(f,f.offset,f.byteLength)),!o.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(g===void 0&&(g=0),C===void 0&&(C=f?f.length:0),I===void 0&&(I=0),U===void 0&&(U=this.length),g<0||C>f.length||I<0||U>this.length)throw new RangeError("out of range index");if(I>=U&&g>=C)return 0;if(I>=U)return-1;if(g>=C)return 1;if(g>>>=0,C>>>=0,I>>>=0,U>>>=0,this===f)return 0;let G=U-I,ie=C-g,Ae=Math.min(G,ie),_e=this.slice(I,U),we=f.slice(g,C);for(let ge=0;ge<Ae;++ge)if(_e[ge]!==we[ge]){G=_e[ge],ie=we[ge];break}return G<ie?-1:ie<G?1:0};function S(w,f,g,C,I){if(w.length===0)return-1;if(typeof g=="string"?(C=g,g=0):g>2147483647?g=2147483647:g<-2147483648&&(g=-2147483648),g=+g,N0(g)&&(g=I?0:w.length-1),g<0&&(g=w.length+g),g>=w.length){if(I)return-1;g=w.length-1}else if(g<0)if(I)g=0;else return-1;if(typeof f=="string"&&(f=o.from(f,C)),o.isBuffer(f))return f.length===0?-1:B(w,f,g,C,I);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(w,f,g):Uint8Array.prototype.lastIndexOf.call(w,f,g):B(w,[f],g,C,I);throw new TypeError("val must be string, number or Buffer")}function B(w,f,g,C,I){let U=1,G=w.length,ie=f.length;if(C!==void 0&&(C=String(C).toLowerCase(),C==="ucs2"||C==="ucs-2"||C==="utf16le"||C==="utf-16le")){if(w.length<2||f.length<2)return-1;U=2,G/=2,ie/=2,g/=2}function Ae(we,ge){return U===1?we[ge]:we.readUInt16BE(ge*U)}let _e;if(I){let we=-1;for(_e=g;_e<G;_e++)if(Ae(w,_e)===Ae(f,we===-1?0:_e-we)){if(we===-1&&(we=_e),_e-we+1===ie)return we*U}else we!==-1&&(_e-=_e-we),we=-1}else for(g+ie>G&&(g=G-ie),_e=g;_e>=0;_e--){let we=!0;for(let ge=0;ge<ie;ge++)if(Ae(w,_e+ge)!==Ae(f,ge)){we=!1;break}if(we)return _e}return-1}o.prototype.includes=function(f,g,C){return this.indexOf(f,g,C)!==-1},o.prototype.indexOf=function(f,g,C){return S(this,f,g,C,!0)},o.prototype.lastIndexOf=function(f,g,C){return S(this,f,g,C,!1)};function P(w,f,g,C){g=Number(g)||0;let I=w.length-g;C?(C=Number(C),C>I&&(C=I)):C=I;let U=f.length;C>U/2&&(C=U/2);let G;for(G=0;G<C;++G){let ie=parseInt(f.substr(G*2,2),16);if(N0(ie))return G;w[g+G]=ie}return G}function H(w,f,g,C){return st(G0(f,w.length-g),w,g,C)}function V(w,f,g,C){return st(E5(f),w,g,C)}function z(w,f,g,C){return st(fi(f),w,g,C)}function N(w,f,g,C){return st(x5(f,w.length-g),w,g,C)}o.prototype.write=function(f,g,C,I){if(g===void 0)I="utf8",C=this.length,g=0;else if(C===void 0&&typeof g=="string")I=g,C=this.length,g=0;else if(isFinite(g))g=g>>>0,isFinite(C)?(C=C>>>0,I===void 0&&(I="utf8")):(I=C,C=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let U=this.length-g;if((C===void 0||C>U)&&(C=U),f.length>0&&(C<0||g<0)||g>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");let G=!1;for(;;)switch(I){case"hex":return P(this,f,g,C);case"utf8":case"utf-8":return H(this,f,g,C);case"ascii":case"latin1":case"binary":return V(this,f,g,C);case"base64":return z(this,f,g,C);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,f,g,C);default:if(G)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),G=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Y(w,f,g){return f===0&&g===w.length?n.fromByteArray(w):n.fromByteArray(w.slice(f,g))}function q(w,f,g){g=Math.min(w.length,g);let C=[],I=f;for(;I<g;){let U=w[I],G=null,ie=U>239?4:U>223?3:U>191?2:1;if(I+ie<=g){let Ae,_e,we,ge;switch(ie){case 1:U<128&&(G=U);break;case 2:Ae=w[I+1],(Ae&192)===128&&(ge=(U&31)<<6|Ae&63,ge>127&&(G=ge));break;case 3:Ae=w[I+1],_e=w[I+2],(Ae&192)===128&&(_e&192)===128&&(ge=(U&15)<<12|(Ae&63)<<6|_e&63,ge>2047&&(ge<55296||ge>57343)&&(G=ge));break;case 4:Ae=w[I+1],_e=w[I+2],we=w[I+3],(Ae&192)===128&&(_e&192)===128&&(we&192)===128&&(ge=(U&15)<<18|(Ae&63)<<12|(_e&63)<<6|we&63,ge>65535&&ge<1114112&&(G=ge))}}G===null?(G=65533,ie=1):G>65535&&(G-=65536,C.push(G>>>10&1023|55296),G=56320|G&1023),C.push(G),I+=ie}return te(C)}let J=4096;function te(w){let f=w.length;if(f<=J)return String.fromCharCode.apply(String,w);let g="",C=0;for(;C<f;)g+=String.fromCharCode.apply(String,w.slice(C,C+=J));return g}function se(w,f,g){let C="";g=Math.min(w.length,g);for(let I=f;I<g;++I)C+=String.fromCharCode(w[I]&127);return C}function he(w,f,g){let C="";g=Math.min(w.length,g);for(let I=f;I<g;++I)C+=String.fromCharCode(w[I]);return C}function fe(w,f,g){let C=w.length;(!f||f<0)&&(f=0),(!g||g<0||g>C)&&(g=C);let I="";for(let U=f;U<g;++U)I+=Ar[w[U]];return I}function pe(w,f,g){let C=w.slice(f,g),I="";for(let U=0;U<C.length-1;U+=2)I+=String.fromCharCode(C[U]+C[U+1]*256);return I}o.prototype.slice=function(f,g){let C=this.length;f=~~f,g=g===void 0?C:~~g,f<0?(f+=C,f<0&&(f=0)):f>C&&(f=C),g<0?(g+=C,g<0&&(g=0)):g>C&&(g=C),g<f&&(g=f);let I=this.subarray(f,g);return Object.setPrototypeOf(I,o.prototype),I};function oe(w,f,g){if(w%1!==0||w<0)throw new RangeError("offset is not uint");if(w+f>g)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(f,g,C){f=f>>>0,g=g>>>0,C||oe(f,g,this.length);let I=this[f],U=1,G=0;for(;++G<g&&(U*=256);)I+=this[f+G]*U;return I},o.prototype.readUintBE=o.prototype.readUIntBE=function(f,g,C){f=f>>>0,g=g>>>0,C||oe(f,g,this.length);let I=this[f+--g],U=1;for(;g>0&&(U*=256);)I+=this[f+--g]*U;return I},o.prototype.readUint8=o.prototype.readUInt8=function(f,g){return f=f>>>0,g||oe(f,1,this.length),this[f]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(f,g){return f=f>>>0,g||oe(f,2,this.length),this[f]|this[f+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(f,g){return f=f>>>0,g||oe(f,2,this.length),this[f]<<8|this[f+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(f,g){return f=f>>>0,g||oe(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(f,g){return f=f>>>0,g||oe(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},o.prototype.readBigUInt64LE=gt(function(f){f=f>>>0,jt(f,"offset");let g=this[f],C=this[f+7];(g===void 0||C===void 0)&&v0(f,this.length-8);let I=g+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,U=this[++f]+this[++f]*2**8+this[++f]*2**16+C*2**24;return BigInt(I)+(BigInt(U)<<BigInt(32))}),o.prototype.readBigUInt64BE=gt(function(f){f=f>>>0,jt(f,"offset");let g=this[f],C=this[f+7];(g===void 0||C===void 0)&&v0(f,this.length-8);let I=g*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],U=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+C;return(BigInt(I)<<BigInt(32))+BigInt(U)}),o.prototype.readIntLE=function(f,g,C){f=f>>>0,g=g>>>0,C||oe(f,g,this.length);let I=this[f],U=1,G=0;for(;++G<g&&(U*=256);)I+=this[f+G]*U;return U*=128,I>=U&&(I-=Math.pow(2,8*g)),I},o.prototype.readIntBE=function(f,g,C){f=f>>>0,g=g>>>0,C||oe(f,g,this.length);let I=g,U=1,G=this[f+--I];for(;I>0&&(U*=256);)G+=this[f+--I]*U;return U*=128,G>=U&&(G-=Math.pow(2,8*g)),G},o.prototype.readInt8=function(f,g){return f=f>>>0,g||oe(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},o.prototype.readInt16LE=function(f,g){f=f>>>0,g||oe(f,2,this.length);let C=this[f]|this[f+1]<<8;return C&32768?C|4294901760:C},o.prototype.readInt16BE=function(f,g){f=f>>>0,g||oe(f,2,this.length);let C=this[f+1]|this[f]<<8;return C&32768?C|4294901760:C},o.prototype.readInt32LE=function(f,g){return f=f>>>0,g||oe(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},o.prototype.readInt32BE=function(f,g){return f=f>>>0,g||oe(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},o.prototype.readBigInt64LE=gt(function(f){f=f>>>0,jt(f,"offset");let g=this[f],C=this[f+7];(g===void 0||C===void 0)&&v0(f,this.length-8);let I=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(C<<24);return(BigInt(I)<<BigInt(32))+BigInt(g+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),o.prototype.readBigInt64BE=gt(function(f){f=f>>>0,jt(f,"offset");let g=this[f],C=this[f+7];(g===void 0||C===void 0)&&v0(f,this.length-8);let I=(g<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(I)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+C)}),o.prototype.readFloatLE=function(f,g){return f=f>>>0,g||oe(f,4,this.length),e.read(this,f,!0,23,4)},o.prototype.readFloatBE=function(f,g){return f=f>>>0,g||oe(f,4,this.length),e.read(this,f,!1,23,4)},o.prototype.readDoubleLE=function(f,g){return f=f>>>0,g||oe(f,8,this.length),e.read(this,f,!0,52,8)},o.prototype.readDoubleBE=function(f,g){return f=f>>>0,g||oe(f,8,this.length),e.read(this,f,!1,52,8)};function Q(w,f,g,C,I,U){if(!o.isBuffer(w))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>I||f<U)throw new RangeError('"value" argument is out of bounds');if(g+C>w.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(f,g,C,I){if(f=+f,g=g>>>0,C=C>>>0,!I){let ie=Math.pow(2,8*C)-1;Q(this,f,g,C,ie,0)}let U=1,G=0;for(this[g]=f&255;++G<C&&(U*=256);)this[g+G]=f/U&255;return g+C},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(f,g,C,I){if(f=+f,g=g>>>0,C=C>>>0,!I){let ie=Math.pow(2,8*C)-1;Q(this,f,g,C,ie,0)}let U=C-1,G=1;for(this[g+U]=f&255;--U>=0&&(G*=256);)this[g+U]=f/G&255;return g+C},o.prototype.writeUint8=o.prototype.writeUInt8=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,1,255,0),this[g]=f&255,g+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,2,65535,0),this[g]=f&255,this[g+1]=f>>>8,g+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,2,65535,0),this[g]=f>>>8,this[g+1]=f&255,g+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,4,4294967295,0),this[g+3]=f>>>24,this[g+2]=f>>>16,this[g+1]=f>>>8,this[g]=f&255,g+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,4,4294967295,0),this[g]=f>>>24,this[g+1]=f>>>16,this[g+2]=f>>>8,this[g+3]=f&255,g+4};function ce(w,f,g,C,I){l0(f,C,I,w,g,7);let U=Number(f&BigInt(4294967295));w[g++]=U,U=U>>8,w[g++]=U,U=U>>8,w[g++]=U,U=U>>8,w[g++]=U;let G=Number(f>>BigInt(32)&BigInt(4294967295));return w[g++]=G,G=G>>8,w[g++]=G,G=G>>8,w[g++]=G,G=G>>8,w[g++]=G,g}function be(w,f,g,C,I){l0(f,C,I,w,g,7);let U=Number(f&BigInt(4294967295));w[g+7]=U,U=U>>8,w[g+6]=U,U=U>>8,w[g+5]=U,U=U>>8,w[g+4]=U;let G=Number(f>>BigInt(32)&BigInt(4294967295));return w[g+3]=G,G=G>>8,w[g+2]=G,G=G>>8,w[g+1]=G,G=G>>8,w[g]=G,g+8}o.prototype.writeBigUInt64LE=gt(function(f,g=0){return ce(this,f,g,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=gt(function(f,g=0){return be(this,f,g,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(f,g,C,I){if(f=+f,g=g>>>0,!I){let Ae=Math.pow(2,8*C-1);Q(this,f,g,C,Ae-1,-Ae)}let U=0,G=1,ie=0;for(this[g]=f&255;++U<C&&(G*=256);)f<0&&ie===0&&this[g+U-1]!==0&&(ie=1),this[g+U]=(f/G>>0)-ie&255;return g+C},o.prototype.writeIntBE=function(f,g,C,I){if(f=+f,g=g>>>0,!I){let Ae=Math.pow(2,8*C-1);Q(this,f,g,C,Ae-1,-Ae)}let U=C-1,G=1,ie=0;for(this[g+U]=f&255;--U>=0&&(G*=256);)f<0&&ie===0&&this[g+U+1]!==0&&(ie=1),this[g+U]=(f/G>>0)-ie&255;return g+C},o.prototype.writeInt8=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,1,127,-128),f<0&&(f=255+f+1),this[g]=f&255,g+1},o.prototype.writeInt16LE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,2,32767,-32768),this[g]=f&255,this[g+1]=f>>>8,g+2},o.prototype.writeInt16BE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,2,32767,-32768),this[g]=f>>>8,this[g+1]=f&255,g+2},o.prototype.writeInt32LE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,4,2147483647,-2147483648),this[g]=f&255,this[g+1]=f>>>8,this[g+2]=f>>>16,this[g+3]=f>>>24,g+4},o.prototype.writeInt32BE=function(f,g,C){return f=+f,g=g>>>0,C||Q(this,f,g,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[g]=f>>>24,this[g+1]=f>>>16,this[g+2]=f>>>8,this[g+3]=f&255,g+4},o.prototype.writeBigInt64LE=gt(function(f,g=0){return ce(this,f,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=gt(function(f,g=0){return be(this,f,g,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function qe(w,f,g,C,I,U){if(g+C>w.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("Index out of range")}function Re(w,f,g,C,I){return f=+f,g=g>>>0,I||qe(w,f,g,4),e.write(w,f,g,C,23,4),g+4}o.prototype.writeFloatLE=function(f,g,C){return Re(this,f,g,!0,C)},o.prototype.writeFloatBE=function(f,g,C){return Re(this,f,g,!1,C)};function at(w,f,g,C,I){return f=+f,g=g>>>0,I||qe(w,f,g,8),e.write(w,f,g,C,52,8),g+8}o.prototype.writeDoubleLE=function(f,g,C){return at(this,f,g,!0,C)},o.prototype.writeDoubleBE=function(f,g,C){return at(this,f,g,!1,C)},o.prototype.copy=function(f,g,C,I){if(!o.isBuffer(f))throw new TypeError("argument should be a Buffer");if(C||(C=0),!I&&I!==0&&(I=this.length),g>=f.length&&(g=f.length),g||(g=0),I>0&&I<C&&(I=C),I===C||f.length===0||this.length===0)return 0;if(g<0)throw new RangeError("targetStart out of bounds");if(C<0||C>=this.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("sourceEnd out of bounds");I>this.length&&(I=this.length),f.length-g<I-C&&(I=f.length-g+C);let U=I-C;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(g,C,I):Uint8Array.prototype.set.call(f,this.subarray(C,I),g),U},o.prototype.fill=function(f,g,C,I){if(typeof f=="string"){if(typeof g=="string"?(I=g,g=0,C=this.length):typeof C=="string"&&(I=C,C=this.length),I!==void 0&&typeof I!="string")throw new TypeError("encoding must be a string");if(typeof I=="string"&&!o.isEncoding(I))throw new TypeError("Unknown encoding: "+I);if(f.length===1){let G=f.charCodeAt(0);(I==="utf8"&&G<128||I==="latin1")&&(f=G)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(g<0||this.length<g||this.length<C)throw new RangeError("Out of range index");if(C<=g)return this;g=g>>>0,C=C===void 0?this.length:C>>>0,f||(f=0);let U;if(typeof f=="number")for(U=g;U<C;++U)this[U]=f;else{let G=o.isBuffer(f)?f:o.from(f,I),ie=G.length;if(ie===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(U=0;U<C-g;++U)this[U+g]=G[U%ie]}return this};let ye={};function ut(w,f,g){ye[w]=class extends g{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${w}]`,this.stack,delete this.name}get code(){return w}set code(I){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:I,writable:!0})}toString(){return`${this.name} [${w}]: ${this.message}`}}}ut("ERR_BUFFER_OUT_OF_BOUNDS",function(w){return w?`${w} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ut("ERR_INVALID_ARG_TYPE",function(w,f){return`The "${w}" argument must be of type number. Received type ${typeof f}`},TypeError),ut("ERR_OUT_OF_RANGE",function(w,f,g){let C=`The value of "${w}" is out of range.`,I=g;return Number.isInteger(g)&&Math.abs(g)>2**32?I=_r(String(g)):typeof g=="bigint"&&(I=String(g),(g>BigInt(2)**BigInt(32)||g<-(BigInt(2)**BigInt(32)))&&(I=_r(I)),I+="n"),C+=` It must be ${f}. Received ${I}`,C},RangeError);function _r(w){let f="",g=w.length,C=w[0]==="-"?1:0;for(;g>=C+4;g-=3)f=`_${w.slice(g-3,g)}${f}`;return`${w.slice(0,g)}${f}`}function wr(w,f,g){jt(f,"offset"),(w[f]===void 0||w[f+g]===void 0)&&v0(f,w.length-(g+1))}function l0(w,f,g,C,I,U){if(w>g||w<f){let G=typeof f=="bigint"?"n":"",ie;throw f===0||f===BigInt(0)?ie=`>= 0${G} and < 2${G} ** ${(U+1)*8}${G}`:ie=`>= -(2${G} ** ${(U+1)*8-1}${G}) and < 2 ** ${(U+1)*8-1}${G}`,new ye.ERR_OUT_OF_RANGE("value",ie,w)}wr(C,I,U)}function jt(w,f){if(typeof w!="number")throw new ye.ERR_INVALID_ARG_TYPE(f,"number",w)}function v0(w,f,g){throw Math.floor(w)!==w?(jt(w,g),new ye.ERR_OUT_OF_RANGE("offset","an integer",w)):f<0?new ye.ERR_BUFFER_OUT_OF_BOUNDS:new ye.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${f}`,w)}let A5=/[^+/0-9A-Za-z-_]/g;function c0(w){if(w=w.split("=")[0],w=w.trim().replace(A5,""),w.length<2)return"";for(;w.length%4!==0;)w=w+"=";return w}function G0(w,f){f=f||1/0;let g,C=w.length,I=null,U=[];for(let G=0;G<C;++G){if(g=w.charCodeAt(G),g>55295&&g<57344){if(!I){if(g>56319){(f-=3)>-1&&U.push(239,191,189);continue}else if(G+1===C){(f-=3)>-1&&U.push(239,191,189);continue}I=g;continue}if(g<56320){(f-=3)>-1&&U.push(239,191,189),I=g;continue}g=(I-55296<<10|g-56320)+65536}else I&&(f-=3)>-1&&U.push(239,191,189);if(I=null,g<128){if((f-=1)<0)break;U.push(g)}else if(g<2048){if((f-=2)<0)break;U.push(g>>6|192,g&63|128)}else if(g<65536){if((f-=3)<0)break;U.push(g>>12|224,g>>6&63|128,g&63|128)}else if(g<1114112){if((f-=4)<0)break;U.push(g>>18|240,g>>12&63|128,g>>6&63|128,g&63|128)}else throw new Error("Invalid code point")}return U}function E5(w){let f=[];for(let g=0;g<w.length;++g)f.push(w.charCodeAt(g)&255);return f}function x5(w,f){let g,C,I,U=[];for(let G=0;G<w.length&&!((f-=2)<0);++G)g=w.charCodeAt(G),C=g>>8,I=g%256,U.push(I),U.push(C);return U}function fi(w){return n.toByteArray(c0(w))}function st(w,f,g,C){let I;for(I=0;I<C&&!(I+g>=f.length||I>=w.length);++I)f[I+g]=w[I];return I}function Ie(w,f){return w instanceof f||w!=null&&w.constructor!=null&&w.constructor.name!=null&&w.constructor.name===f.name}function N0(w){return w!==w}let Ar=function(){let w="0123456789abcdef",f=new Array(256);for(let g=0;g<16;++g){let C=g*16;for(let I=0;I<16;++I)f[C+I]=w[g]+w[I]}return f}();function gt(w){return typeof BigInt>"u"?W0:w}function W0(){throw new Error("BigInt not supported")}return u0}var Rr,Jo,M5,Xo,u0,Zo,ea=Ve(()=>{A();E();R();x();Rr={},Jo=!1;M5={},Xo=!1;u0={},Zo=!1});var h0,O,ch,dh,ta=Ve(()=>{A();E();R();x();ea();h0=$o();h0.Buffer;h0.SlowBuffer;h0.INSPECT_MAX_BYTES;h0.kMaxLength;O=h0.Buffer,ch=h0.INSPECT_MAX_BYTES,dh=h0.kMaxLength});var R=Ve(()=>{ta()});var la=ht((xi,Ri)=>{A();E();R();x();(function(n,e){typeof xi=="object"&&typeof Ri<"u"?Ri.exports=e():typeof define=="function"&&define.amd?define(e):n.Stats=e()})(xi,function(){var n=function(){function e(u){return i.appendChild(u.dom),u}function t(u){for(var h=0;h<i.children.length;h++)i.children[h].style.display=h===u?"block":"none";r=u}var r=0,i=document.createElement("div");i.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",i.addEventListener("click",function(u){u.preventDefault(),t(++r%i.children.length)},!1);var s=(performance||Date).now(),o=s,l=0,a=e(new n.Panel("FPS","#0ff","#002")),v=e(new n.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=e(new n.Panel("MB","#f08","#201"));return t(0),{REVISION:16,dom:i,addPanel:e,showPanel:t,begin:function(){s=(performance||Date).now()},end:function(){l++;var u=(performance||Date).now();if(v.update(u-s,200),u>o+1e3&&(a.update(1e3*l/(u-o),100),o=u,l=0,c)){var h=performance.memory;c.update(h.usedJSHeapSize/1048576,h.jsHeapSizeLimit/1048576)}return u},update:function(){s=this.end()},domElement:i,setMode:t}};return n.Panel=function(e,t,r){var i=1/0,s=0,o=Math.round,l=o(window.devicePixelRatio||1),a=80*l,v=48*l,c=3*l,u=2*l,h=3*l,p=15*l,m=74*l,b=30*l,k=document.createElement("canvas");k.width=a,k.height=v,k.style.cssText="width:80px;height:48px";var _=k.getContext("2d");return _.font="bold "+9*l+"px Helvetica,Arial,sans-serif",_.textBaseline="top",_.fillStyle=r,_.fillRect(0,0,a,v),_.fillStyle=t,_.fillText(e,c,u),_.fillRect(h,p,m,b),_.fillStyle=r,_.globalAlpha=.9,_.fillRect(h,p,m,b),{dom:k,update:function(y,M){i=Math.min(i,y),s=Math.max(s,y),_.fillStyle=r,_.globalAlpha=1,_.fillRect(0,0,a,p),_.fillStyle=t,_.fillText(o(y)+" "+e+" ("+o(i)+"-"+o(s)+")",c,u),_.drawImage(k,h+l,p,m-l,b,h,p,m-l,b),_.fillRect(h+m-l,p,l,b),_.fillStyle=r,_.globalAlpha=.9,_.fillRect(h+m-l,p,l,o((1-y/M)*b))}}},n})});var a8,l8,Ft,v8,N5=Ve(()=>{"use strict";A();E();R();x();a8=n=>{let e=n%24e3/24e3-.25;return e<0&&(e+=1),e>1&&(e-=1),e+(1-Math.cos(e*Math.PI))/2},l8=n=>{let e=(n%24e3+24e3)%24e3,t=a8(e),i=Math.cos(t*Math.PI*2)*.5+.5,s=Math.round(4+i*11);return Math.max(4,Math.min(15,s))},Ft=n=>{let e=(n%24e3+24e3)%24e3;if(e>=0&&e<12e3)return 15;if(e>=12e3&&e<13e3){let t=(e-12e3)/1e3;return Math.round(15-t*11)}else{if(e>=13e3&&e<23e3)return 4;{let t=(e-23e3)/1e3;return Math.round(4+t*11)}}},v8=()=>{let n=[{ticks:0,label:"6:00 AM (sunrise)"},{ticks:6e3,label:"12:00 PM (noon)"},{ticks:12e3,label:"6:00 PM (sunset starts)"},{ticks:12500,label:"6:30 PM (sunset mid)"},{ticks:13e3,label:"7:00 PM (night begins)"},{ticks:18e3,label:"12:00 AM (midnight)"},{ticks:19e3,label:"1:00 AM"},{ticks:23e3,label:"5:00 AM (dawn begins)"},{ticks:23500,label:"5:30 AM (dawn mid)"}];for(let{ticks:e,label:t}of n){let r=l8(e),i=Ft(e)}};typeof window<"u"&&(window.debugSkyLight=v8)});var c2=ht((v2,nn)=>{A();E();R();x();(function(n,e){typeof nn=="object"&&nn.exports?nn.exports=e():n.nearley=e()})(v2,function(){function n(a,v,c){return this.id=++n.highestId,this.name=a,this.symbols=v,this.postprocess=c,this}n.highestId=0,n.prototype.toString=function(a){var v=typeof a>"u"?this.symbols.map(l).join(" "):this.symbols.slice(0,a).map(l).join(" ")+" \u25CF "+this.symbols.slice(a).map(l).join(" ");return this.name+" \u2192 "+v};function e(a,v,c,u){this.rule=a,this.dot=v,this.reference=c,this.data=[],this.wantedBy=u,this.isComplete=this.dot===a.symbols.length}e.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},e.prototype.nextState=function(a){var v=new e(this.rule,this.dot+1,this.reference,this.wantedBy);return v.left=this,v.right=a,v.isComplete&&(v.data=v.build(),v.right=void 0),v},e.prototype.build=function(){var a=[],v=this;do a.push(v.right.data),v=v.left;while(v.left);return a.reverse(),a},e.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,s.fail))};function t(a,v){this.grammar=a,this.index=v,this.states=[],this.wants={},this.scannable=[],this.completed={}}t.prototype.process=function(a){for(var v=this.states,c=this.wants,u=this.completed,h=0;h<v.length;h++){var p=v[h];if(p.isComplete){if(p.finish(),p.data!==s.fail){for(var m=p.wantedBy,b=m.length;b--;){var k=m[b];this.complete(k,p)}if(p.reference===this.index){var _=p.rule.name;(this.completed[_]=this.completed[_]||[]).push(p)}}}else{var _=p.rule.symbols[p.dot];if(typeof _!="string"){this.scannable.push(p);continue}if(c[_]){if(c[_].push(p),u.hasOwnProperty(_))for(var y=u[_],b=0;b<y.length;b++){var M=y[b];this.complete(p,M)}}else c[_]=[p],this.predict(_)}}},t.prototype.predict=function(a){for(var v=this.grammar.byName[a]||[],c=0;c<v.length;c++){var u=v[c],h=this.wants[a],p=new e(u,0,this.index,h);this.states.push(p)}},t.prototype.complete=function(a,v){var c=a.nextState(v);this.states.push(c)};function r(a,v){this.rules=a,this.start=v||this.rules[0].name;var c=this.byName={};this.rules.forEach(function(u){c.hasOwnProperty(u.name)||(c[u.name]=[]),c[u.name].push(u)})}r.fromCompiled=function(u,v){var c=u.Lexer;u.ParserStart&&(v=u.ParserStart,u=u.ParserRules);var u=u.map(function(p){return new n(p.name,p.symbols,p.postprocess)}),h=new r(u,v);return h.lexer=c,h};function i(){this.reset("")}i.prototype.reset=function(a,v){this.buffer=a,this.index=0,this.line=v?v.line:1,this.lastLineBreak=v?-v.col:0},i.prototype.next=function(){if(this.index<this.buffer.length){var a=this.buffer[this.index++];return a===`
2
2
  `&&(this.line+=1,this.lastLineBreak=this.index),{value:a}}},i.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},i.prototype.formatError=function(a,v){var c=this.buffer;if(typeof c=="string"){var u=c.split(`
3
3
  `).slice(Math.max(0,this.line-5),this.line),h=c.indexOf(`
4
4
  `,this.index);h===-1&&(h=c.length);var p=this.index-this.lastLineBreak,m=String(this.line).length;return v+=" at line "+this.line+" col "+p+`:
@@ -9,16 +9,16 @@ var Jl=Object.create;var Er=Object.defineProperty;var Xl=Object.getOwnPropertyDe
9
9
  `,v}else return v+" at index "+(this.index-1);function b(k,_){var y=String(k);return Array(_-y.length+1).join(" ")+y}};function s(a,v,c){if(a instanceof r)var u=a,c=v;else var u=r.fromCompiled(a,v);this.grammar=u,this.options={keepHistory:!1,lexer:u.lexer||new i};for(var h in c||{})this.options[h]=c[h];this.lexer=this.options.lexer,this.lexerState=void 0;var p=new t(u,0),m=this.table=[p];p.wants[u.start]=[],p.predict(u.start),p.process(),this.current=0}s.fail={},s.prototype.feed=function(a){var v=this.lexer;v.reset(a,this.lexerState);for(var c;;){try{if(c=v.next(),!c)break}catch(B){var m=new t(this.grammar,this.current+1);this.table.push(m);var u=new Error(this.reportLexerError(B));throw u.offset=this.current,u.token=B.token,u}var h=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var p=this.current+1,m=new t(this.grammar,p);this.table.push(m);for(var b=c.text!==void 0?c.text:c.value,k=v.constructor===i?c.value:c,_=h.scannable,y=_.length;y--;){var M=_[y],T=M.rule.symbols[M.dot];if(T.test?T.test(k):T.type?T.type===c.type:T.literal===b){var S=M.nextState({data:k,token:c,isToken:!0,reference:p-1});m.states.push(S)}}if(m.process(),m.states.length===0){var u=new Error(this.reportError(c));throw u.offset=this.current,u.token=c,u}this.options.keepHistory&&(h.lexerState=v.save()),this.current++}return h&&(this.lexerState=v.save()),this.results=this.finish(),this},s.prototype.reportLexerError=function(a){var v,c,u=a.token;return u?(v="input "+JSON.stringify(u.text[0])+" (lexer error)",c=this.lexer.formatError(u,"Syntax error")):(v="input (lexer error)",c=a.message),this.reportErrorCommon(c,v)},s.prototype.reportError=function(a){var v=(a.type?a.type+" token: ":"")+JSON.stringify(a.value!==void 0?a.value:a),c=this.lexer.formatError(a,"Syntax error");return this.reportErrorCommon(c,v)},s.prototype.reportErrorCommon=function(a,v){var c=[];c.push(a);var u=this.table.length-2,h=this.table[u],p=h.states.filter(function(b){var k=b.rule.symbols[b.dot];return k&&typeof k!="string"});if(p.length===0)c.push("Unexpected "+v+`. I did not expect any more input. Here is the state of my parse table:
10
10
  `),this.displayStateStack(h.states,c);else{c.push("Unexpected "+v+`. Instead, I was expecting to see one of the following:
11
11
  `);var m=p.map(function(b){return this.buildFirstStateStack(b,[])||[b]},this);m.forEach(function(b){var k=b[0],_=k.rule.symbols[k.dot],y=this.getSymbolDisplay(_);c.push("A "+y+" based on:"),this.displayStateStack(b,c)},this)}return c.push(""),c.join(`
12
- `)},s.prototype.displayStateStack=function(a,v){for(var c,u=0,h=0;h<a.length;h++){var p=a[h],m=p.rule.toString(p.dot);m===c?u++:(u>0&&v.push(" ^ "+u+" more lines identical to this"),u=0,v.push(" "+m)),c=m}},s.prototype.getSymbolDisplay=function(a){return o(a)},s.prototype.buildFirstStateStack=function(a,v){if(v.indexOf(a)!==-1)return null;if(a.wantedBy.length===0)return[a];var c=a.wantedBy[0],u=[a].concat(v),h=this.buildFirstStateStack(c,u);return h===null?null:[a].concat(h)},s.prototype.save=function(){var a=this.table[this.current];return a.lexerState=this.lexerState,a},s.prototype.restore=function(a){var v=a.index;this.current=v,this.table[v]=a,this.table.splice(v+1),this.lexerState=a.lexerState,this.results=this.finish()},s.prototype.rewind=function(a){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[a])},s.prototype.finish=function(){var a=[],v=this.grammar.start,c=this.table[this.table.length-1];return c.states.forEach(function(u){u.rule.name===v&&u.dot===u.rule.symbols.length&&u.reference===0&&u.data!==s.fail&&a.push(u)}),a.map(function(u){return u.data})};function o(a){var v=typeof a;if(v==="string")return a;if(v==="object"){if(a.literal)return JSON.stringify(a.literal);if(a instanceof RegExp)return"character matching "+a;if(a.type)return a.type+" token";if(a.test)return"token matching "+String(a.test);throw new Error("Unknown symbol type: "+a)}}function l(a){var v=typeof a;if(v==="string")return a;if(v==="object"){if(a.literal)return JSON.stringify(a.literal);if(a instanceof RegExp)return a.toString();if(a.type)return"%"+a.type;if(a.test)return"<"+String(a.test)+">";throw new Error("Unknown symbol type: "+a)}}return{Parser:s,Grammar:r,Rule:n}})});var l2=ht((eE,sn)=>{A();E();R();x();(function(){function n(a){return a[0]}function e(a){if(a==="true")return{type:"boolean",value:!0};if(a==="false")return{type:"boolean",value:!1};let v="bslfdi",c={b:"byte",s:"short",l:"long",f:"float",d:"double",i:"int"},u=a.charAt(a.length-1).toLowerCase();if(v.indexOf(u)!==-1){let b=parseFloat(a.substring(0,a.length-1));return isNaN(b)?{value:a,type:"string"}:{value:b,type:c[u]}}let h=parseFloat(a),p=a.includes("."),m=h>>0===h;return!isNaN(a)&&(p||m)?{value:h,type:p?"double":"int"}:{value:a,type:"string"}}function t(a,v){a[0]!==void 0&&(v[a[0]]=a[1])}function r(a){let v={};t(a[2],v);for(let c in a[3])t(a[3][c][3],v);return{type:"compound",value:v}}function i(a){let v=[a[6]];for(let u in a[7])v.push(a[7][u][3]);return{type:{B:"byteArray",I:"intArray",L:"longArray"}[a[2]],value:{type:v[0].type,value:v.map(u=>u.value)}}}function s(a){let v=[a[2]];for(let c in a[3])v.push(a[3][c][3]);return{type:"list",value:{type:v[0].type,value:v.map(c=>c.value)}}}function o(a){let v=[];t(a[2],v);for(let c in a[3])t(a[3][c][3],v);return{type:"list",value:{type:v[0].type,value:v.map(c=>c.value)}}}var l={Lexer:void 0,ParserRules:[{name:"_$ebnf$1",symbols:[]},{name:"_$ebnf$1",symbols:["_$ebnf$1","wschar"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"_",symbols:["_$ebnf$1"],postprocess:function(a){return null}},{name:"__$ebnf$1",symbols:["wschar"]},{name:"__$ebnf$1",symbols:["__$ebnf$1","wschar"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"__",symbols:["__$ebnf$1"],postprocess:function(a){return null}},{name:"wschar",symbols:[/[ \t\n\v\f]/],postprocess:n},{name:"MAIN",symbols:["_","JVALUE","_"],postprocess:a=>a[1]},{name:"JVALUE",symbols:["JOBJECT"],postprocess:a=>a[0]},{name:"JVALUE",symbols:[{literal:"'"},"_","JOBJECT","_",{literal:"'"}],postprocess:a=>a[2]},{name:"JVALUE",symbols:["JARRAY"],postprocess:a=>a[0]},{name:"JVALUE",symbols:["STRING"],postprocess:a=>a[0]},{name:"JVALUE$string$1",symbols:[{literal:"n"},{literal:"u"},{literal:"l"},{literal:"l"}],postprocess:function(v){return v.join("")}},{name:"JVALUE",symbols:["JVALUE$string$1"],postprocess:a=>null},{name:"JOBJECT",symbols:[{literal:"{"},"_",{literal:"}"}],postprocess:a=>({type:"compound",value:{}})},{name:"JOBJECT$ebnf$1",symbols:[]},{name:"JOBJECT$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","PAIR"]},{name:"JOBJECT$ebnf$1",symbols:["JOBJECT$ebnf$1","JOBJECT$ebnf$1$subexpression$1"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"JOBJECT$ebnf$2$subexpression$1",symbols:["_",{literal:","}]},{name:"JOBJECT$ebnf$2",symbols:["JOBJECT$ebnf$2$subexpression$1"],postprocess:n},{name:"JOBJECT$ebnf$2",symbols:[],postprocess:function(a){return null}},{name:"JOBJECT",symbols:[{literal:"{"},"_","PAIR","JOBJECT$ebnf$1","JOBJECT$ebnf$2",{literal:"}"}],postprocess:r},{name:"JARRAY",symbols:[{literal:"["},"_",{literal:"]"}],postprocess:a=>({type:"list",value:{}})},{name:"JARRAY$ebnf$1",symbols:[]},{name:"JARRAY$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","JVALUE"]},{name:"JARRAY$ebnf$1",symbols:["JARRAY$ebnf$1","JARRAY$ebnf$1$subexpression$1"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"JARRAY$ebnf$2$subexpression$1",symbols:["_",{literal:","}]},{name:"JARRAY$ebnf$2",symbols:["JARRAY$ebnf$2$subexpression$1"],postprocess:n},{name:"JARRAY$ebnf$2",symbols:[],postprocess:function(a){return null}},{name:"JARRAY",symbols:[{literal:"["},"_",/[BIL]/,"_",{literal:";"},"_","JVALUE","JARRAY$ebnf$1","JARRAY$ebnf$2","_",{literal:"]"}],postprocess:i},{name:"JARRAY$ebnf$3",symbols:[]},{name:"JARRAY$ebnf$3$subexpression$1",symbols:["_",{literal:","},"_","JVALUE"]},{name:"JARRAY$ebnf$3",symbols:["JARRAY$ebnf$3","JARRAY$ebnf$3$subexpression$1"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"JARRAY$ebnf$4$subexpression$1",symbols:["_",{literal:","}]},{name:"JARRAY$ebnf$4",symbols:["JARRAY$ebnf$4$subexpression$1"],postprocess:n},{name:"JARRAY$ebnf$4",symbols:[],postprocess:function(a){return null}},{name:"JARRAY",symbols:[{literal:"["},"_","JVALUE","JARRAY$ebnf$3","JARRAY$ebnf$4","_",{literal:"]"}],postprocess:s},{name:"JARRAY$ebnf$5",symbols:[]},{name:"JARRAY$ebnf$5$subexpression$1",symbols:["_",{literal:","},"_","PAIR"]},{name:"JARRAY$ebnf$5",symbols:["JARRAY$ebnf$5","JARRAY$ebnf$5$subexpression$1"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"JARRAY$ebnf$6$subexpression$1",symbols:["_",{literal:","}]},{name:"JARRAY$ebnf$6",symbols:["JARRAY$ebnf$6$subexpression$1"],postprocess:n},{name:"JARRAY$ebnf$6",symbols:[],postprocess:function(a){return null}},{name:"JARRAY",symbols:[{literal:"["},"_","PAIR","JARRAY$ebnf$5","JARRAY$ebnf$6","_",{literal:"]"}],postprocess:o},{name:"PAIR",symbols:["STRING","_",{literal:":"},"_","JVALUE"],postprocess:a=>[a[0].value,a[4]]},{name:"STRING$ebnf$1",symbols:[]},{name:"STRING$ebnf$1$subexpression$1",symbols:[/[^\\"]/]},{name:"STRING$ebnf$1$subexpression$1",symbols:[{literal:"\\"},/["bfnrt\/\\]/]},{name:"STRING$ebnf$1$subexpression$1$string$1",symbols:[{literal:"\\"},{literal:"u"}],postprocess:function(v){return v.join("")}},{name:"STRING$ebnf$1$subexpression$1",symbols:["STRING$ebnf$1$subexpression$1$string$1",/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/]},{name:"STRING$ebnf$1",symbols:["STRING$ebnf$1","STRING$ebnf$1$subexpression$1"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"STRING",symbols:[{literal:'"'},"STRING$ebnf$1",{literal:'"'}],postprocess:a=>e(JSON.parse(a.flat(3).map(v=>v.replace(`
13
- `,"\\n")).join("")))},{name:"STRING$ebnf$2",symbols:[/[^\"\'}\]:;,\s]/]},{name:"STRING$ebnf$2",symbols:["STRING$ebnf$2",/[^\"\'}\]:;,\s]/],postprocess:function(v){return v[0].concat([v[1]])}},{name:"STRING",symbols:["STRING$ebnf$2"],postprocess:a=>e(a[0].join(""))}],ParserStart:"MAIN"};typeof sn<"u"&&typeof sn.exports<"u"?sn.exports=l:window.grammar=l})()});var A1=ht((sE,f2)=>{A();E();R();x();var v2=a2(),L8=l2();function u2(n){function e(t,r){return r==="compound"?Object.keys(t).reduce(function(i,s){return i[s]=u2(t[s]),i},{}):r==="list"?Array.isArray(t.value)?t.value.map(function(i){return e(i,t.type)}):[]:t}return e(n.value,n.type)}function on({value:n,type:e}){if(e==="compound"){let r=[],i=Object.entries(n);for(let s=0;s<i.length;s++){let o=i[s][0],l=on(i[s][1]);o==="string"&&(l=c2(l)),r.push(`${o}:${l}`)}return`{${r.join(",")}}`}else{if(e==="list")return Array.isArray(n.value)?`[${d2(n)}]`:"[]";if(e==="byteArray"||e==="intArray"||e==="longArray"){let r=D8(e),i=d2(n);return`[${r}${i}]`}}let t=n+F8(n,e);return e==="string"&&(t=c2(t)),t}function c2(n){return n=n.replace(/"/g,'\\"'),(/'|{|}|\[|\]|:|;|,|\(|\)|§|=/g.test(n)||n==="")&&(n=`"${n}"`),n}function d2({value:n,type:e}){let t=O8(n),r=[];for(let i=0;i<n.length;i++){let s=n[i];s!==void 0&&(s=on({value:s,type:e}),t?r.push(`${i}:${s}`):r.push(s))}return r.join(",")}function O8(n){for(let e=0;e<n.length;e++)if(n[e]===void 0)return!0;return!1}var D8=n=>n.charAt(0).toUpperCase()+";";function F8(n,e){return e==="double"?n>>0===n?"d":"":{int:"",byte:"b",short:"s",float:"f",long:"l",string:""}[e]}function z8(n){return on(h2(n))}function h2(n){try{let e=new v2.Parser(v2.Grammar.fromCompiled(L8));return e.feed(n),e.results[0]}catch(e){throw e.message=`Error parsing text '${n}'`,e}}f2.exports={parse:h2,simplify:u2,stringify:on,normalize:z8}});var y2={};R5(y2,{camelCase:()=>W8,capitalCase:()=>x1,constantCase:()=>Q8,dotCase:()=>K8,kebabCase:()=>q8,noCase:()=>Kr,pascalCase:()=>j8,pascalSnakeCase:()=>Y8,pathCase:()=>J8,sentenceCase:()=>X8,snakeCase:()=>R1,split:()=>E1,splitSeparateNumbers:()=>g2,trainCase:()=>Z8});function E1(n){let e=n.trim();e=e.replace(U8,m2).replace(V8,m2),e=e.replace(N8,"\0");let t=0,r=e.length;for(;e.charAt(t)==="\0";)t++;if(t===r)return[];for(;e.charAt(r-1)==="\0";)r--;return e.slice(t,r).split(/\0/g)}function g2(n){let e=E1(n);for(let t=0;t<e.length;t++){let r=e[t],i=G8.exec(r);if(i){let s=i.index+(i[1]??i[2]).length;e.splice(t,1,r.slice(0,s),r.slice(s))}}return e}function Kr(n,e){let[t,r,i]=tr(n,e);return t+r.map(qr(e?.locale)).join(e?.delimiter??" ")+i}function W8(n,e){let[t,r,i]=tr(n,e),s=qr(e?.locale),o=Jr(e?.locale),l=e?.mergeAmbiguousCharacters?an(s,o):b2(s,o);return t+r.map((a,v)=>v===0?s(a):l(a,v)).join(e?.delimiter??"")+i}function j8(n,e){let[t,r,i]=tr(n,e),s=qr(e?.locale),o=Jr(e?.locale),l=e?.mergeAmbiguousCharacters?an(s,o):b2(s,o);return t+r.map(l).join(e?.delimiter??"")+i}function Y8(n,e){return x1(n,{delimiter:"_",...e})}function x1(n,e){let[t,r,i]=tr(n,e),s=qr(e?.locale),o=Jr(e?.locale);return t+r.map(an(s,o)).join(e?.delimiter??" ")+i}function Q8(n,e){let[t,r,i]=tr(n,e);return t+r.map(Jr(e?.locale)).join(e?.delimiter??"_")+i}function K8(n,e){return Kr(n,{delimiter:".",...e})}function q8(n,e){return Kr(n,{delimiter:"-",...e})}function J8(n,e){return Kr(n,{delimiter:"/",...e})}function X8(n,e){let[t,r,i]=tr(n,e),s=qr(e?.locale),o=Jr(e?.locale),l=an(s,o);return t+r.map((a,v)=>v===0?l(a):s(a)).join(e?.delimiter??" ")+i}function R1(n,e){return Kr(n,{delimiter:"_",...e})}function Z8(n,e){return x1(n,{delimiter:"-",...e})}function qr(n){return n===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(n)}function Jr(n){return n===!1?e=>e.toUpperCase():e=>e.toLocaleUpperCase(n)}function an(n,e){return t=>`${e(t[0])}${n(t.slice(1))}`}function b2(n,e){return(t,r)=>{let i=t[0];return(r>0&&i>="0"&&i<="9"?"_"+i:e(i))+n(t.slice(1))}}function tr(n,e={}){let t=e.split??(e.separateNumbers?g2:E1),r=e.prefixCharacters??p2,i=e.suffixCharacters??p2,s=0,o=n.length;for(;s<n.length;){let l=n.charAt(s);if(!r.includes(l))break;s++}for(;o>s;){let l=o-1,a=n.charAt(l);if(!i.includes(a))break;o=l}return[n.slice(0,s),t(n.slice(s,o)),n.slice(o)]}var U8,V8,G8,N8,m2,p2,k1=Ve(()=>{A();E();R();x();U8=/([\p{Ll}\d])(\p{Lu})/gu,V8=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,G8=/(\d)\p{Ll}|(\p{L})\d/u,N8=/[^\p{L}\d]+/giu,m2="$1\0$2",p2=""});var _2=ht((fE,$8)=>{$8.exports={version:"1.21.4",attackable:["acacia_boat","acacia_chest_boat","allay","armadillo","armor_stand","axolotl","bamboo_chest_raft","bamboo_raft","bat","bee","birch_boat","birch_chest_boat","blaze","bogged","breeze","camel","cat","cave_spider","cherry_boat","cherry_chest_boat","chest_minecart","chicken","cod","command_block_minecart","cow","creaking","creeper","dark_oak_boat","dark_oak_chest_boat","dolphin","donkey","drowned","elder_guardian","end_crystal","ender_dragon","enderman","endermite","evoker","falling_block","fox","frog","furnace_minecart","ghast","giant","glow_item_frame","glow_squid","goat","guardian","hoglin","hopper_minecart","horse","husk","illusioner","iron_golem","item_frame","jungle_boat","jungle_chest_boat","leash_knot","llama","magma_cube","mangrove_boat","mangrove_chest_boat","minecart","mooshroom","mule","oak_boat","oak_chest_boat","ocelot","painting","pale_oak_boat","pale_oak_chest_boat","panda","parrot","phantom","pig","piglin","piglin_brute","pillager","player","polar_bear","pufferfish","rabbit","ravager","salmon","sheep","shulker","shulker_bullet","silverfish","skeleton","skeleton_horse","slime","sniffer","snow_golem","spawner_minecart","spider","spruce_boat","spruce_chest_boat","squid","stray","strider","tadpole","tnt","tnt_minecart","trader_llama","tropical_fish","turtle","vex","villager","vindicator","wandering_trader","warden","wind_charge","witch","wither","wither_skeleton","wolf","zoglin","zombie","zombie_horse","zombie_villager","zombified_piglin"],notAttackable:["area_effect_cloud","arrow","block_display","breeze_wind_charge","dragon_fireball","egg","ender_pearl","evoker_fangs","experience_bottle","experience_orb","eye_of_ender","fireball","firework_rocket","fishing_bobber","interaction","item","item_display","lightning_bolt","llama_spit","marker","ominous_item_spawner","potion","small_fireball","snowball","spectral_arrow","text_display","trident","wither_skull"],entityRenames:{Boat:"oak_boat",EnderCrystal:"end_crystal",EntityHorse:"horse",EyeOfEnderSignal:"eye_of_ender",FallingSand:"falling_block",FireworksRocketEntity:"firework_rocket","Fishing Float":"fishing_bobber","Fishing Hook":"fishing_bobber",LavaSlime:"magma_cube",MinecartRideable:"minecart",Mob:!1,Monster:!1,MushroomCow:"mooshroom",Ozelot:"ocelot",PigZombie:"zombified_piglin",PrimedTnt:"tnt",SnowMan:"snow_golem",ThrownEgg:"egg",ThrownEnderpearl:"ender_pearl",ThrownExpBottle:"experience_bottle",ThrownPotion:"potion",VillagerGolem:"iron_golem",WitherBoss:"wither",XPOrb:"experience_orb",activated_tnt:"tnt",armorstand:"armor_stand",boat:"oak_boat",chest_boat:"oak_chest_boat",commandblock_minecart:"command_block_minecart",creaking_transient:"creaking",ender_crystal:"end_crystal",endercrystal:"end_crystal",evocation_fangs:"evoker_fangs",evocation_illager:"evoker",eye_of_ender_signal:"eye_of_ender",falling_objects:"falling_block",firecharge:"fireball",fireworks_rocket:"firework_rocket",fishing_hook:"fishing_bobber",illusion_illager:"illusioner",item_frames:"item_frame",item_stack:"item",snowman:"snow_golem",thrown_enderpearl:"ender_pearl","thrown_exp bottle":"experience_bottle",thrown_exp_bottle:"experience_bottle",thrown_potion:"potion",tipped_arrow:"arrow",villager_golem:"iron_golem",vindication_illager:"vindicator",xp_bottle:"experience_bottle",xp_orb:"experience_orb",zombie_pigman:"zombified_piglin"}}});var A2=ht((mE,w2)=>{A();E();R();x();var rr=1e3,nr=rr*60,ir=nr*60,B0=ir*24,e4=B0*7,t4=B0*365.25;w2.exports=function(n,e){e=e||{};var t=typeof n;if(t==="string"&&n.length>0)return r4(n);if(t==="number"&&isFinite(n))return e.long?i4(n):n4(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function r4(n){if(n=String(n),!(n.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*t4;case"weeks":case"week":case"w":return t*e4;case"days":case"day":case"d":return t*B0;case"hours":case"hour":case"hrs":case"hr":case"h":return t*ir;case"minutes":case"minute":case"mins":case"min":case"m":return t*nr;case"seconds":case"second":case"secs":case"sec":case"s":return t*rr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function n4(n){var e=Math.abs(n);return e>=B0?Math.round(n/B0)+"d":e>=ir?Math.round(n/ir)+"h":e>=nr?Math.round(n/nr)+"m":e>=rr?Math.round(n/rr)+"s":n+"ms"}function i4(n){var e=Math.abs(n);return e>=B0?ln(n,e,B0,"day"):e>=ir?ln(n,e,ir,"hour"):e>=nr?ln(n,e,nr,"minute"):e>=rr?ln(n,e,rr,"second"):n+" ms"}function ln(n,e,t,r){var i=e>=t*1.5;return Math.round(n/t)+" "+r+(i?"s":"")}});var x2=ht((_E,E2)=>{A();E();R();x();function s4(n){t.debug=t,t.default=t,t.coerce=a,t.disable=o,t.enable=i,t.enabled=l,t.humanize=A2(),t.destroy=v,Object.keys(n).forEach(c=>{t[c]=n[c]}),t.names=[],t.skips=[],t.formatters={};function e(c){let u=0;for(let h=0;h<c.length;h++)u=(u<<5)-u+c.charCodeAt(h),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(c){let u,h=null,p,m;function b(...k){if(!b.enabled)return;let _=b,y=Number(new Date),M=y-(u||y);_.diff=M,_.prev=u,_.curr=y,u=y,k[0]=t.coerce(k[0]),typeof k[0]!="string"&&k.unshift("%O");let T=0;k[0]=k[0].replace(/%([a-zA-Z%])/g,(B,P)=>{if(B==="%%")return"%";T++;let H=t.formatters[P];if(typeof H=="function"){let V=k[T];B=H.call(_,V),k.splice(T,1),T--}return B}),t.formatArgs.call(_,k),(_.log||t.log).apply(_,k)}return b.namespace=c,b.useColors=t.useColors(),b.color=t.selectColor(c),b.extend=r,b.destroy=t.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==t.namespaces&&(p=t.namespaces,m=t.enabled(c)),m),set:k=>{h=k}}),typeof t.init=="function"&&t.init(b),b}function r(c,u){let h=t(this.namespace+(typeof u>"u"?":":u)+c);return h.log=this.log,h}function i(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let u=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of u)h[0]==="-"?t.skips.push(h.slice(1)):t.names.push(h)}function s(c,u){let h=0,p=0,m=-1,b=0;for(;h<c.length;)if(p<u.length&&(u[p]===c[h]||u[p]==="*"))u[p]==="*"?(m=p,b=h,p++):(h++,p++);else if(m!==-1)p=m+1,b++,h=b;else return!1;for(;p<u.length&&u[p]==="*";)p++;return p===u.length}function o(){let c=[...t.names,...t.skips.map(u=>"-"+u)].join(",");return t.enable(""),c}function l(c){for(let u of t.skips)if(s(c,u))return!1;for(let u of t.names)if(s(c,u))return!0;return!1}function a(c){return c instanceof Error?c.stack||c.message:c}function v(){}return t.enable(t.load()),t}E2.exports=s4});var R2=ht((vt,vn)=>{A();E();R();x();vt.formatArgs=a4;vt.save=l4;vt.load=v4;vt.useColors=o4;vt.storage=c4();vt.destroy=(()=>{let n=!1;return()=>{n||(n=!0)}})();vt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function o4(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a4(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+vn.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;n.splice(1,0,e,"color: inherit");let t=0,r=0;n[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(r=t))}),n.splice(r,0,e)}vt.log=console.debug||console.log||(()=>{});function l4(n){try{n?vt.storage.setItem("debug",n):vt.storage.removeItem("debug")}catch{}}function v4(){let n;try{n=vt.storage.getItem("debug")||vt.storage.getItem("DEBUG")}catch{}return!n&&typeof L<"u"&&"env"in L&&(n=L.env.DEBUG),n}function c4(){try{return localStorage}catch{}}vn.exports=x2()(vt);var{formatters:d4}=vn.exports;d4.j=function(n){try{return JSON.stringify(n)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var k2=ht(sr=>{"use strict";A();E();R();x();var u4=sr&&sr.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(sr,"__esModule",{value:!0});sr.debug=void 0;var h4=u4(R2());sr.debug=(0,h4.default)("mineflayer-mouse")});var C2=ht(P0=>{"use strict";A();E();R();x();var f4=P0&&P0.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(P0,"__esModule",{value:!0});P0.isEntityAttackable=void 0;P0.isArmorStandAttackable=M2;var S2=(k1(),nv(y2)),Xr=f4(_2()),m4=k2(),T2=Object.fromEntries([...Xr.default.attackable,...Xr.default.notAttackable].map(n=>[n,!0])),p4=Xr.default.attackable,g4=(n,e)=>{if(!e.name)throw new Error("Entity has no name");let t=n.entitiesByName[e.name],i=Xr.default.entityRenames[e.name]||Xr.default.entityRenames[(0,S2.snakeCase)(e.name)]||e.name;if(!T2[i]&&(i=(0,S2.snakeCase)(i),!T2[i]))return(0,m4.debug)(`Cannot find entity ${i} in entityData.json`),!1;let s=b4[i];return s?s(e,t):p4.includes(i)};P0.isEntityAttackable=g4;var b4={armor_stand:M2};function M2(n,e){let t=Number(n.metadata?.[e.metadataKeys?.indexOf("client_flags")??14]??0),r=(t&16)!==0,i=(t&8)!==0,s=(t&4)!==0,o=(t&1)!==0;return!r}});var c7=ht((OC,Ed)=>{Ed.exports={version:"1.20.4","1.8":{blocks:[["wood_planks","planks"],["large_flowers","double_plant"]]},"1.12":{items:[["totem","totem_of_undying"]]},"1.13":{blocks:[["grass","grass_block"],["planks","oak_planks"],["planks","spruce_planks"],["planks","birch_planks"],["planks","jungle_planks"],["planks","acacia_planks"],["planks","dark_oak_planks"],["sapling","oak_sapling"],["sapling","spruce_sapling"],["sapling","birch_sapling"],["sapling","jungle_sapling"],["sapling","acacia_sapling"],["sapling","dark_oak_sapling"],["sand","red_sand"],["log","oak_log"],["log","spruce_log"],["log","birch_log"],["log","jungle_log"],["log","oak_wood"],["log","spruce_wood"],["log","birch_wood"],["log","jungle_wood"],["leaves","oak_leaves"],["leaves","spruce_leaves"],["leaves","birch_leaves"],["leaves","jungle_leaves"],["sponge","wet_sponge"],["sandstone","chiseled_sandstone"],["sandstone","cut_sandstone"],["noteblock","note_block"],["bed","red_bed"],["golden_rail","powered_rail"],["web","cobweb"],["tallgrass","dead_bush"],["tallgrass","grass"],["tallgrass","fern"],["deadbush","dead_bush"],["wool","white_wool"],["wool","orange_wool"],["wool","magenta_wool"],["wool","light_blue_wool"],["wool","yellow_wool"],["wool","lime_wool"],["wool","pink_wool"],["wool","gray_wool"],["wool","light_gray_wool"],["wool","cyan_wool"],["wool","purple_wool"],["wool","blue_wool"],["wool","brown_wool"],["wool","green_wool"],["wool","red_wool"],["wool","black_wool"],["piston_extension","moving_piston"],["yellow_flower","dandelion"],["red_flower","poppy"],["red_flower","blue_orchid"],["red_flower","allium"],["red_flower","azure_bluet"],["red_flower","red_tulip"],["red_flower","orange_tulip"],["red_flower","white_tulip"],["red_flower","pink_tulip"],["red_flower","oxeye_daisy"],["double_stone_slab","stone_slab"],["double_stone_slab","sandstone_slab"],["double_stone_slab","petrified_oak_slab"],["double_stone_slab","cobblestone_slab"],["double_stone_slab","brick_slab"],["double_stone_slab","stone_brick_slab"],["double_stone_slab","nether_brick_slab"],["double_stone_slab","quartz_slab"],["double_stone_slab","smooth_stone"],["double_stone_slab","smooth_sandstone"],["double_stone_slab","smooth_quartz"],["stone_slab","sandstone_slab"],["stone_slab","petrified_oak_slab"],["stone_slab","cobblestone_slab"],["stone_slab","brick_slab"],["stone_slab","stone_brick_slab"],["stone_slab","nether_brick_slab"],["stone_slab","quartz_slab"],["brick_block","bricks"],["mob_spawner","spawner"],["lit_furnace","furnace"],["standing_sign","sign"],["wooden_door","oak_door"],["stone_stairs","cobblestone_stairs"],["wooden_pressure_plate","oak_pressure_plate"],["lit_redstone_ore","redstone_ore"],["unlit_redstone_torch","redstone_wall_torch"],["unlit_redstone_torch","redstone_torch"],["redstone_torch","redstone_wall_torch"],["snow_layer","snow"],["snow","snow_block"],["reeds","sugar_cane"],["fence","oak_fence"],["pumpkin","carved_pumpkin"],["portal","nether_portal"],["lit_pumpkin","jack_o_lantern"],["unpowered_repeater","repeater"],["powered_repeater","repeater"],["stained_glass","white_stained_glass"],["stained_glass","orange_stained_glass"],["stained_glass","magenta_stained_glass"],["stained_glass","light_blue_stained_glass"],["stained_glass","yellow_stained_glass"],["stained_glass","lime_stained_glass"],["stained_glass","pink_stained_glass"],["stained_glass","gray_stained_glass"],["stained_glass","light_gray_stained_glass"],["stained_glass","cyan_stained_glass"],["stained_glass","purple_stained_glass"],["stained_glass","blue_stained_glass"],["stained_glass","brown_stained_glass"],["stained_glass","green_stained_glass"],["stained_glass","red_stained_glass"],["stained_glass","black_stained_glass"],["trapdoor","oak_trapdoor"],["monster_egg","infested_stone"],["monster_egg","infested_cobblestone"],["monster_egg","infested_stone_bricks"],["monster_egg","infested_mossy_stone_bricks"],["monster_egg","infested_cracked_stone_bricks"],["monster_egg","infested_chiseled_stone_bricks"],["stonebrick","stone_bricks"],["stonebrick","mossy_stone_bricks"],["stonebrick","cracked_stone_bricks"],["stonebrick","chiseled_stone_bricks"],["brown_mushroom_block","mushroom_stem"],["red_mushroom_block","mushroom_stem"],["melon_block","melon"],["fence_gate","oak_fence_gate"],["waterlily","lily_pad"],["nether_brick","nether_bricks"],["lit_redstone_lamp","redstone_lamp"],["double_wooden_slab","oak_slab"],["double_wooden_slab","spruce_slab"],["double_wooden_slab","birch_slab"],["double_wooden_slab","jungle_slab"],["double_wooden_slab","acacia_slab"],["double_wooden_slab","dark_oak_slab"],["wooden_slab","oak_slab"],["wooden_slab","spruce_slab"],["wooden_slab","birch_slab"],["wooden_slab","jungle_slab"],["wooden_slab","acacia_slab"],["wooden_slab","dark_oak_slab"],["cobblestone_wall","mossy_cobblestone_wall"],["flower_pot","potted_poppy"],["flower_pot","potted_dandelion"],["flower_pot","potted_oak_sapling"],["flower_pot","potted_spruce_sapling"],["flower_pot","potted_birch_sapling"],["flower_pot","potted_jungle_sapling"],["flower_pot","potted_red_mushroom"],["flower_pot","potted_brown_mushroom"],["flower_pot","potted_cactus"],["flower_pot","potted_dead_bush"],["flower_pot","potted_fern"],["flower_pot","potted_acacia_sapling"],["flower_pot","potted_dark_oak_sapling"],["flower_pot","potted_blue_orchid"],["flower_pot","potted_allium"],["wooden_button","oak_button"],["skull","skeleton_skull"],["skull","skeleton_wall_skull"],["anvil","chipped_anvil"],["anvil","damaged_anvil"],["unpowered_comparator","comparator"],["powered_comparator","comparator"],["quartz_ore","nether_quartz_ore"],["quartz_block","chiseled_quartz_block"],["quartz_block","quartz_pillar"],["stained_hardened_clay","white_terracotta"],["stained_hardened_clay","orange_terracotta"],["stained_hardened_clay","magenta_terracotta"],["stained_hardened_clay","light_blue_terracotta"],["stained_hardened_clay","yellow_terracotta"],["stained_hardened_clay","lime_terracotta"],["stained_hardened_clay","pink_terracotta"],["stained_hardened_clay","gray_terracotta"],["stained_hardened_clay","light_gray_terracotta"],["stained_hardened_clay","cyan_terracotta"],["stained_hardened_clay","purple_terracotta"],["stained_hardened_clay","blue_terracotta"],["stained_hardened_clay","brown_terracotta"],["stained_hardened_clay","green_terracotta"],["stained_hardened_clay","red_terracotta"],["stained_hardened_clay","black_terracotta"],["stained_glass_pane","white_stained_glass_pane"],["stained_glass_pane","orange_stained_glass_pane"],["stained_glass_pane","magenta_stained_glass_pane"],["stained_glass_pane","light_blue_stained_glass_pane"],["stained_glass_pane","yellow_stained_glass_pane"],["stained_glass_pane","lime_stained_glass_pane"],["stained_glass_pane","pink_stained_glass_pane"],["stained_glass_pane","gray_stained_glass_pane"],["stained_glass_pane","light_gray_stained_glass_pane"],["stained_glass_pane","cyan_stained_glass_pane"],["stained_glass_pane","purple_stained_glass_pane"],["stained_glass_pane","blue_stained_glass_pane"],["stained_glass_pane","brown_stained_glass_pane"],["stained_glass_pane","green_stained_glass_pane"],["stained_glass_pane","red_stained_glass_pane"],["stained_glass_pane","black_stained_glass_pane"],["leaves2","acacia_leaves"],["leaves2","dark_oak_leaves"],["log2","acacia_log"],["log2","dark_oak_log"],["log2","acacia_wood"],["log2","dark_oak_wood"],["slime","slime_block"],["prismarine","prismarine_bricks"],["prismarine","dark_prismarine"],["carpet","white_carpet"],["carpet","orange_carpet"],["carpet","magenta_carpet"],["carpet","light_blue_carpet"],["carpet","yellow_carpet"],["carpet","lime_carpet"],["carpet","pink_carpet"],["carpet","gray_carpet"],["carpet","light_gray_carpet"],["carpet","cyan_carpet"],["carpet","purple_carpet"],["carpet","blue_carpet"],["carpet","brown_carpet"],["carpet","green_carpet"],["carpet","red_carpet"],["carpet","black_carpet"],["hardened_clay","terracotta"],["double_plant","sunflower"],["double_plant","lilac"],["double_plant","tall_grass"],["double_plant","large_fern"],["double_plant","rose_bush"],["double_plant","peony"],["standing_banner","white_banner"],["wall_banner","white_wall_banner"],["daylight_detector_inverted","daylight_detector"],["red_sandstone","chiseled_red_sandstone"],["red_sandstone","cut_red_sandstone"],["double_stone_slab2","red_sandstone_slab"],["double_stone_slab2","smooth_red_sandstone"],["stone_slab2","red_sandstone_slab"],["purpur_double_slab","purpur_slab"],["end_bricks","end_stone_bricks"],["magma","magma_block"],["red_nether_brick","red_nether_bricks"],["concrete","white_concrete"],["concrete","orange_concrete"],["concrete","magenta_concrete"],["concrete","light_blue_concrete"],["concrete","yellow_concrete"],["concrete","lime_concrete"],["concrete","pink_concrete"],["concrete","gray_concrete"],["concrete","light_gray_concrete"],["concrete","cyan_concrete"],["concrete","purple_concrete"],["concrete","blue_concrete"],["concrete","brown_concrete"],["concrete","green_concrete"],["concrete","red_concrete"],["concrete","black_concrete"],["concrete_powder","white_concrete_powder"],["concrete_powder","orange_concrete_powder"],["concrete_powder","magenta_concrete_powder"],["concrete_powder","light_blue_concrete_powder"],["concrete_powder","yellow_concrete_powder"],["concrete_powder","lime_concrete_powder"],["concrete_powder","pink_concrete_powder"],["concrete_powder","gray_concrete_powder"],["concrete_powder","light_gray_concrete_powder"],["concrete_powder","cyan_concrete_powder"],["concrete_powder","purple_concrete_powder"],["concrete_powder","blue_concrete_powder"],["concrete_powder","brown_concrete_powder"],["concrete_powder","green_concrete_powder"],["concrete_powder","red_concrete_powder"],["concrete_powder","black_concrete_powder"]],items:[["stone","granite"],["stone","polished_granite"],["stone","diorite"],["stone","polished_diorite"],["stone","andesite"],["stone","polished_andesite"],["grass","grass_block"],["dirt","coarse_dirt"],["dirt","podzol"],["planks","oak_planks"],["planks","spruce_planks"],["planks","birch_planks"],["planks","jungle_planks"],["planks","acacia_planks"],["planks","dark_oak_planks"],["sapling","oak_sapling"],["sapling","spruce_sapling"],["sapling","birch_sapling"],["sapling","jungle_sapling"],["sapling","acacia_sapling"],["sapling","dark_oak_sapling"],["sand","red_sand"],["log","oak_log"],["log","spruce_log"],["log","birch_log"],["log","jungle_log"],["leaves","oak_leaves"],["leaves","spruce_leaves"],["leaves","birch_leaves"],["leaves","jungle_leaves"],["sponge","wet_sponge"],["sandstone","chiseled_sandstone"],["sandstone","cut_sandstone"],["noteblock","note_block"],["golden_rail","powered_rail"],["web","cobweb"],["tallgrass","grass"],["tallgrass","fern"],["deadbush","dead_bush"],["wool","white_wool"],["wool","orange_wool"],["wool","magenta_wool"],["wool","light_blue_wool"],["wool","yellow_wool"],["wool","lime_wool"],["wool","pink_wool"],["wool","gray_wool"],["wool","light_gray_wool"],["wool","cyan_wool"],["wool","purple_wool"],["wool","blue_wool"],["wool","brown_wool"],["wool","green_wool"],["wool","red_wool"],["wool","black_wool"],["yellow_flower","dandelion"],["red_flower","poppy"],["red_flower","blue_orchid"],["red_flower","allium"],["red_flower","azure_bluet"],["red_flower","red_tulip"],["red_flower","orange_tulip"],["red_flower","white_tulip"],["red_flower","pink_tulip"],["red_flower","oxeye_daisy"],["stone_slab","sandstone_slab"],["stone_slab","cobblestone_slab"],["stone_slab","brick_slab"],["stone_slab","stone_brick_slab"],["stone_slab","nether_brick_slab"],["stone_slab","quartz_slab"],["brick_block","bricks"],["mob_spawner","spawner"],["stone_stairs","cobblestone_stairs"],["wooden_pressure_plate","oak_pressure_plate"],["snow_layer","snow"],["snow","snow_block"],["fence","oak_fence"],["pumpkin","carved_pumpkin"],["lit_pumpkin","jack_o_lantern"],["stained_glass","white_stained_glass"],["stained_glass","orange_stained_glass"],["stained_glass","magenta_stained_glass"],["stained_glass","light_blue_stained_glass"],["stained_glass","yellow_stained_glass"],["stained_glass","lime_stained_glass"],["stained_glass","pink_stained_glass"],["stained_glass","gray_stained_glass"],["stained_glass","light_gray_stained_glass"],["stained_glass","cyan_stained_glass"],["stained_glass","purple_stained_glass"],["stained_glass","blue_stained_glass"],["stained_glass","brown_stained_glass"],["stained_glass","green_stained_glass"],["stained_glass","red_stained_glass"],["stained_glass","black_stained_glass"],["trapdoor","oak_trapdoor"],["monster_egg","infested_stone"],["monster_egg","infested_cobblestone"],["monster_egg","infested_stone_bricks"],["monster_egg","infested_mossy_stone_bricks"],["monster_egg","infested_cracked_stone_bricks"],["monster_egg","infested_chiseled_stone_bricks"],["stonebrick","stone_bricks"],["stonebrick","mossy_stone_bricks"],["stonebrick","cracked_stone_bricks"],["stonebrick","chiseled_stone_bricks"],["melon_block","melon"],["fence_gate","oak_fence_gate"],["waterlily","lily_pad"],["nether_brick","nether_bricks"],["wooden_slab","oak_slab"],["wooden_slab","spruce_slab"],["wooden_slab","birch_slab"],["wooden_slab","jungle_slab"],["wooden_slab","acacia_slab"],["wooden_slab","dark_oak_slab"],["cobblestone_wall","mossy_cobblestone_wall"],["wooden_button","oak_button"],["anvil","chipped_anvil"],["anvil","damaged_anvil"],["quartz_ore","nether_quartz_ore"],["quartz_block","chiseled_quartz_block"],["quartz_block","quartz_pillar"],["stained_hardened_clay","white_terracotta"],["stained_hardened_clay","orange_terracotta"],["stained_hardened_clay","magenta_terracotta"],["stained_hardened_clay","light_blue_terracotta"],["stained_hardened_clay","yellow_terracotta"],["stained_hardened_clay","lime_terracotta"],["stained_hardened_clay","pink_terracotta"],["stained_hardened_clay","gray_terracotta"],["stained_hardened_clay","light_gray_terracotta"],["stained_hardened_clay","cyan_terracotta"],["stained_hardened_clay","purple_terracotta"],["stained_hardened_clay","blue_terracotta"],["stained_hardened_clay","brown_terracotta"],["stained_hardened_clay","green_terracotta"],["stained_hardened_clay","red_terracotta"],["stained_hardened_clay","black_terracotta"],["stained_glass_pane","white_stained_glass_pane"],["stained_glass_pane","orange_stained_glass_pane"],["stained_glass_pane","magenta_stained_glass_pane"],["stained_glass_pane","light_blue_stained_glass_pane"],["stained_glass_pane","yellow_stained_glass_pane"],["stained_glass_pane","lime_stained_glass_pane"],["stained_glass_pane","pink_stained_glass_pane"],["stained_glass_pane","gray_stained_glass_pane"],["stained_glass_pane","light_gray_stained_glass_pane"],["stained_glass_pane","cyan_stained_glass_pane"],["stained_glass_pane","purple_stained_glass_pane"],["stained_glass_pane","blue_stained_glass_pane"],["stained_glass_pane","brown_stained_glass_pane"],["stained_glass_pane","green_stained_glass_pane"],["stained_glass_pane","red_stained_glass_pane"],["stained_glass_pane","black_stained_glass_pane"],["leaves2","acacia_leaves"],["leaves2","dark_oak_leaves"],["log2","acacia_log"],["log2","dark_oak_log"],["slime","slime_block"],["prismarine","prismarine_bricks"],["prismarine","dark_prismarine"],["carpet","white_carpet"],["carpet","orange_carpet"],["carpet","magenta_carpet"],["carpet","light_blue_carpet"],["carpet","yellow_carpet"],["carpet","lime_carpet"],["carpet","pink_carpet"],["carpet","gray_carpet"],["carpet","light_gray_carpet"],["carpet","cyan_carpet"],["carpet","purple_carpet"],["carpet","blue_carpet"],["carpet","brown_carpet"],["carpet","green_carpet"],["carpet","red_carpet"],["carpet","black_carpet"],["hardened_clay","terracotta"],["double_plant","sunflower"],["double_plant","lilac"],["double_plant","tall_grass"],["double_plant","large_fern"],["double_plant","rose_bush"],["double_plant","peony"],["red_sandstone","chiseled_red_sandstone"],["red_sandstone","cut_red_sandstone"],["stone_slab2","red_sandstone_slab"],["end_bricks","end_stone_bricks"],["magma","magma_block"],["red_nether_brick","red_nether_bricks"],["silver_shulker_box","light_gray_shulker_box"],["silver_glazed_terracotta","light_gray_glazed_terracotta"],["concrete","white_concrete"],["concrete","orange_concrete"],["concrete","magenta_concrete"],["concrete","light_blue_concrete"],["concrete","yellow_concrete"],["concrete","lime_concrete"],["concrete","pink_concrete"],["concrete","gray_concrete"],["concrete","light_gray_concrete"],["concrete","cyan_concrete"],["concrete","purple_concrete"],["concrete","blue_concrete"],["concrete","brown_concrete"],["concrete","green_concrete"],["concrete","red_concrete"],["concrete","black_concrete"],["concrete_powder","white_concrete_powder"],["concrete_powder","orange_concrete_powder"],["concrete_powder","magenta_concrete_powder"],["concrete_powder","light_blue_concrete_powder"],["concrete_powder","yellow_concrete_powder"],["concrete_powder","lime_concrete_powder"],["concrete_powder","pink_concrete_powder"],["concrete_powder","gray_concrete_powder"],["concrete_powder","light_gray_concrete_powder"],["concrete_powder","cyan_concrete_powder"],["concrete_powder","purple_concrete_powder"],["concrete_powder","blue_concrete_powder"],["concrete_powder","brown_concrete_powder"],["concrete_powder","green_concrete_powder"],["concrete_powder","red_concrete_powder"],["concrete_powder","black_concrete_powder"],["coal","charcoal"],["golden_apple","enchanted_golden_apple"],["wooden_door","oak_door"],["boat","oak_boat"],["reeds","sugar_cane"],["fish","cod"],["fish","salmon"],["fish","tropical_fish"],["fish","pufferfish"],["cooked_fish","cooked_cod"],["cooked_fish","cooked_salmon"],["dye","ink_sac"],["dye","rose_red"],["dye","cactus_green"],["dye","cocoa_beans"],["dye","lapis_lazuli"],["dye","purple_dye"],["dye","cyan_dye"],["dye","light_gray_dye"],["dye","gray_dye"],["dye","pink_dye"],["dye","lime_dye"],["dye","dandelion_yellow"],["dye","light_blue_dye"],["dye","magenta_dye"],["dye","orange_dye"],["dye","bone_meal"],["bed","white_bed"],["bed","orange_bed"],["bed","magenta_bed"],["bed","light_blue_bed"],["bed","yellow_bed"],["bed","lime_bed"],["bed","pink_bed"],["bed","gray_bed"],["bed","light_gray_bed"],["bed","cyan_bed"],["bed","purple_bed"],["bed","blue_bed"],["bed","brown_bed"],["bed","green_bed"],["bed","red_bed"],["bed","black_bed"],["melon","melon_slice"],["speckled_melon","glistering_melon_slice"],["spawn_egg","pig_spawn_egg"],["skull","skeleton_skull"],["skull","wither_skeleton_skull"],["skull","zombie_head"],["skull","player_head"],["skull","creeper_head"],["skull","dragon_head"],["fireworks","firework_rocket"],["firework_charge","firework_star"],["netherbrick","nether_brick"],["banner","black_banner"],["banner","red_banner"],["banner","green_banner"],["banner","brown_banner"],["banner","blue_banner"],["banner","purple_banner"],["banner","cyan_banner"],["banner","light_gray_banner"],["banner","gray_banner"],["banner","pink_banner"],["banner","lime_banner"],["banner","yellow_banner"],["banner","light_blue_banner"],["banner","magenta_banner"],["banner","orange_banner"],["banner","white_banner"],["chorus_fruit_popped","popped_chorus_fruit"],["record_13","music_disc_13"],["record_cat","music_disc_cat"],["record_blocks","music_disc_blocks"],["record_chirp","music_disc_chirp"],["record_far","music_disc_far"],["record_mall","music_disc_mall"],["record_mellohi","music_disc_mellohi"],["record_stal","music_disc_stal"],["record_strad","music_disc_strad"],["record_ward","music_disc_ward"],["record_11","music_disc_11"],["record_wait","music_disc_wait"]]},"1.14":{blocks:[["sign","oak_sign"],["wall_sign","oak_wall_sign"]],items:[["sign","oak_sign"],["rose_red","red_dye"],["cactus_green","green_dye"],["dandelion_yellow","yellow_dye"]]},"1.15.2":{blocks:[],items:[]},"1.16.1":{blocks:[],items:[["zombie_pigman_spawn_egg","zombified_piglin_spawn_egg"]]},"1.16.2":{blocks:[],items:[]},"1.17":{blocks:[["grass_path","dirt_path"]],items:[["grass_path","dirt_path"]]},"1.18":{blocks:[],items:[]},"1.19":{blocks:[],items:[]},"1.19.3":{blocks:[],items:[]},"1.19.4":{blocks:[],items:[]},"1.20":{blocks:[],items:[["pottery_shard_archer","archer_pottery_sherd"],["pottery_shard_prize","prize_pottery_sherd"],["pottery_shard_arms_up","arms_up_pottery_sherd"],["pottery_shard_skull","skull_pottery_sherd"]]},"1.16":{items:[["zombie_pigman_spawn_egg","zombified_piglin_spawn_egg"]]},"1.20.3":{blocks:[["grass","short_grass"]],items:[["grass","short_grass"]]}}});var d7=ht(En=>{"use strict";A();E();R();x();Object.defineProperty(En,"__esModule",{value:!0});En.versionToNumber=void 0;var xd=n=>{let[e,t="0",r="0"]=n.split(".");return+`${e.padStart(2,"0")}${parseInt(t).toString().padStart(2,"0")}${parseInt(r).toString().padStart(2,"0")}`};En.versionToNumber=xd});var h7=ht(dr=>{"use strict";A();E();R();x();var Rd=dr&&dr.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(dr,"__esModule",{value:!0});dr.getRenamedData=void 0;var u7=Rd(c7()),t0=d7(),kd=(n,e,t,r)=>{let i=(0,t0.versionToNumber)(t),s=(0,t0.versionToNumber)(r),o=i<s?1:-1,l=o>0?1:0,a=e,v=Object.keys(u7.default).sort((h,p)=>o*((0,t0.versionToNumber)(h)-(0,t0.versionToNumber)(p))),c=o>0?s:i,u=o>0?i:s;for(let h of v.filter(p=>(0,t0.versionToNumber)(p)<=c&&(0,t0.versionToNumber)(p)>=u)){if(o>0&&(0,t0.versionToNumber)(h)>=c||o<0&&(0,t0.versionToNumber)(h)<=u)break;let p=u7.default[h][n];if(p)for(let m of p){let b=m[l],k=m[1-l];if(Array.isArray(a))a.includes(k)&&(a=a.map(_=>_===k?b:_));else if(a===k){a=b;break}}}return a};dr.getRenamedData=kd});function Ln(n,e,t,r){let i=n.length/3,s=[];for(let o=0;o<i;o++){let l=Math.max(t[o]??0,Math.min(e[o]??1,r)),a=o*3;s.push(n[a]*l,n[a+1]*l,n[a+2]*l)}return s}var k7=Ve(()=>{"use strict";A();E();R();x()});var On=Ve(()=>{"use strict";A();E();R();x()});function Fd(n,e=nt){let t=e.curve??nt.curve,r=e.minBrightness??nt.minBrightness,i=e.gamma??nt.gamma,s=n/(4-3*n),o=n*(1-t)+s*t;return o=r+o*(1-r),Math.min(1,Math.max(0,o**i))}function zd(n,e,t){return Math.max(n,Math.min(e,t))}function ts(n,e,t,r=nt){let i=zd(n,e,t);return Fd(i,r)}var nt,Dn,Fn=Ve(()=>{"use strict";A();E();R();x();nt={curve:0,minBrightness:.12,gamma:1},Dn=`
12
+ `)},s.prototype.displayStateStack=function(a,v){for(var c,u=0,h=0;h<a.length;h++){var p=a[h],m=p.rule.toString(p.dot);m===c?u++:(u>0&&v.push(" ^ "+u+" more lines identical to this"),u=0,v.push(" "+m)),c=m}},s.prototype.getSymbolDisplay=function(a){return o(a)},s.prototype.buildFirstStateStack=function(a,v){if(v.indexOf(a)!==-1)return null;if(a.wantedBy.length===0)return[a];var c=a.wantedBy[0],u=[a].concat(v),h=this.buildFirstStateStack(c,u);return h===null?null:[a].concat(h)},s.prototype.save=function(){var a=this.table[this.current];return a.lexerState=this.lexerState,a},s.prototype.restore=function(a){var v=a.index;this.current=v,this.table[v]=a,this.table.splice(v+1),this.lexerState=a.lexerState,this.results=this.finish()},s.prototype.rewind=function(a){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[a])},s.prototype.finish=function(){var a=[],v=this.grammar.start,c=this.table[this.table.length-1];return c.states.forEach(function(u){u.rule.name===v&&u.dot===u.rule.symbols.length&&u.reference===0&&u.data!==s.fail&&a.push(u)}),a.map(function(u){return u.data})};function o(a){var v=typeof a;if(v==="string")return a;if(v==="object"){if(a.literal)return JSON.stringify(a.literal);if(a instanceof RegExp)return"character matching "+a;if(a.type)return a.type+" token";if(a.test)return"token matching "+String(a.test);throw new Error("Unknown symbol type: "+a)}}function l(a){var v=typeof a;if(v==="string")return a;if(v==="object"){if(a.literal)return JSON.stringify(a.literal);if(a instanceof RegExp)return a.toString();if(a.type)return"%"+a.type;if(a.test)return"<"+String(a.test)+">";throw new Error("Unknown symbol type: "+a)}}return{Parser:s,Grammar:r,Rule:n}})});var d2=ht((fE,sn)=>{A();E();R();x();(function(){function n(a){return a[0]}function e(a){if(a==="true")return{type:"boolean",value:!0};if(a==="false")return{type:"boolean",value:!1};let v="bslfdi",c={b:"byte",s:"short",l:"long",f:"float",d:"double",i:"int"},u=a.charAt(a.length-1).toLowerCase();if(v.indexOf(u)!==-1){let b=parseFloat(a.substring(0,a.length-1));return isNaN(b)?{value:a,type:"string"}:{value:b,type:c[u]}}let h=parseFloat(a),p=a.includes("."),m=h>>0===h;return!isNaN(a)&&(p||m)?{value:h,type:p?"double":"int"}:{value:a,type:"string"}}function t(a,v){a[0]!==void 0&&(v[a[0]]=a[1])}function r(a){let v={};t(a[2],v);for(let c in a[3])t(a[3][c][3],v);return{type:"compound",value:v}}function i(a){let v=[a[6]];for(let u in a[7])v.push(a[7][u][3]);return{type:{B:"byteArray",I:"intArray",L:"longArray"}[a[2]],value:{type:v[0].type,value:v.map(u=>u.value)}}}function s(a){let v=[a[2]];for(let c in a[3])v.push(a[3][c][3]);return{type:"list",value:{type:v[0].type,value:v.map(c=>c.value)}}}function o(a){let v=[];t(a[2],v);for(let c in a[3])t(a[3][c][3],v);return{type:"list",value:{type:v[0].type,value:v.map(c=>c.value)}}}var l={Lexer:void 0,ParserRules:[{name:"_$ebnf$1",symbols:[]},{name:"_$ebnf$1",symbols:["_$ebnf$1","wschar"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"_",symbols:["_$ebnf$1"],postprocess:function(a){return null}},{name:"__$ebnf$1",symbols:["wschar"]},{name:"__$ebnf$1",symbols:["__$ebnf$1","wschar"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"__",symbols:["__$ebnf$1"],postprocess:function(a){return null}},{name:"wschar",symbols:[/[ \t\n\v\f]/],postprocess:n},{name:"MAIN",symbols:["_","JVALUE","_"],postprocess:a=>a[1]},{name:"JVALUE",symbols:["JOBJECT"],postprocess:a=>a[0]},{name:"JVALUE",symbols:[{literal:"'"},"_","JOBJECT","_",{literal:"'"}],postprocess:a=>a[2]},{name:"JVALUE",symbols:["JARRAY"],postprocess:a=>a[0]},{name:"JVALUE",symbols:["STRING"],postprocess:a=>a[0]},{name:"JVALUE$string$1",symbols:[{literal:"n"},{literal:"u"},{literal:"l"},{literal:"l"}],postprocess:function(v){return v.join("")}},{name:"JVALUE",symbols:["JVALUE$string$1"],postprocess:a=>null},{name:"JOBJECT",symbols:[{literal:"{"},"_",{literal:"}"}],postprocess:a=>({type:"compound",value:{}})},{name:"JOBJECT$ebnf$1",symbols:[]},{name:"JOBJECT$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","PAIR"]},{name:"JOBJECT$ebnf$1",symbols:["JOBJECT$ebnf$1","JOBJECT$ebnf$1$subexpression$1"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"JOBJECT$ebnf$2$subexpression$1",symbols:["_",{literal:","}]},{name:"JOBJECT$ebnf$2",symbols:["JOBJECT$ebnf$2$subexpression$1"],postprocess:n},{name:"JOBJECT$ebnf$2",symbols:[],postprocess:function(a){return null}},{name:"JOBJECT",symbols:[{literal:"{"},"_","PAIR","JOBJECT$ebnf$1","JOBJECT$ebnf$2",{literal:"}"}],postprocess:r},{name:"JARRAY",symbols:[{literal:"["},"_",{literal:"]"}],postprocess:a=>({type:"list",value:{}})},{name:"JARRAY$ebnf$1",symbols:[]},{name:"JARRAY$ebnf$1$subexpression$1",symbols:["_",{literal:","},"_","JVALUE"]},{name:"JARRAY$ebnf$1",symbols:["JARRAY$ebnf$1","JARRAY$ebnf$1$subexpression$1"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"JARRAY$ebnf$2$subexpression$1",symbols:["_",{literal:","}]},{name:"JARRAY$ebnf$2",symbols:["JARRAY$ebnf$2$subexpression$1"],postprocess:n},{name:"JARRAY$ebnf$2",symbols:[],postprocess:function(a){return null}},{name:"JARRAY",symbols:[{literal:"["},"_",/[BIL]/,"_",{literal:";"},"_","JVALUE","JARRAY$ebnf$1","JARRAY$ebnf$2","_",{literal:"]"}],postprocess:i},{name:"JARRAY$ebnf$3",symbols:[]},{name:"JARRAY$ebnf$3$subexpression$1",symbols:["_",{literal:","},"_","JVALUE"]},{name:"JARRAY$ebnf$3",symbols:["JARRAY$ebnf$3","JARRAY$ebnf$3$subexpression$1"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"JARRAY$ebnf$4$subexpression$1",symbols:["_",{literal:","}]},{name:"JARRAY$ebnf$4",symbols:["JARRAY$ebnf$4$subexpression$1"],postprocess:n},{name:"JARRAY$ebnf$4",symbols:[],postprocess:function(a){return null}},{name:"JARRAY",symbols:[{literal:"["},"_","JVALUE","JARRAY$ebnf$3","JARRAY$ebnf$4","_",{literal:"]"}],postprocess:s},{name:"JARRAY$ebnf$5",symbols:[]},{name:"JARRAY$ebnf$5$subexpression$1",symbols:["_",{literal:","},"_","PAIR"]},{name:"JARRAY$ebnf$5",symbols:["JARRAY$ebnf$5","JARRAY$ebnf$5$subexpression$1"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"JARRAY$ebnf$6$subexpression$1",symbols:["_",{literal:","}]},{name:"JARRAY$ebnf$6",symbols:["JARRAY$ebnf$6$subexpression$1"],postprocess:n},{name:"JARRAY$ebnf$6",symbols:[],postprocess:function(a){return null}},{name:"JARRAY",symbols:[{literal:"["},"_","PAIR","JARRAY$ebnf$5","JARRAY$ebnf$6","_",{literal:"]"}],postprocess:o},{name:"PAIR",symbols:["STRING","_",{literal:":"},"_","JVALUE"],postprocess:a=>[a[0].value,a[4]]},{name:"STRING$ebnf$1",symbols:[]},{name:"STRING$ebnf$1$subexpression$1",symbols:[/[^\\"]/]},{name:"STRING$ebnf$1$subexpression$1",symbols:[{literal:"\\"},/["bfnrt\/\\]/]},{name:"STRING$ebnf$1$subexpression$1$string$1",symbols:[{literal:"\\"},{literal:"u"}],postprocess:function(v){return v.join("")}},{name:"STRING$ebnf$1$subexpression$1",symbols:["STRING$ebnf$1$subexpression$1$string$1",/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/]},{name:"STRING$ebnf$1",symbols:["STRING$ebnf$1","STRING$ebnf$1$subexpression$1"],postprocess:function(v){return v[0].concat([v[1]])}},{name:"STRING",symbols:[{literal:'"'},"STRING$ebnf$1",{literal:'"'}],postprocess:a=>e(JSON.parse(a.flat(3).map(v=>v.replace(`
13
+ `,"\\n")).join("")))},{name:"STRING$ebnf$2",symbols:[/[^\"\'}\]:;,\s]/]},{name:"STRING$ebnf$2",symbols:["STRING$ebnf$2",/[^\"\'}\]:;,\s]/],postprocess:function(v){return v[0].concat([v[1]])}},{name:"STRING",symbols:["STRING$ebnf$2"],postprocess:a=>e(a[0].join(""))}],ParserStart:"MAIN"};typeof sn<"u"&&typeof sn.exports<"u"?sn.exports=l:window.grammar=l})()});var A1=ht((yE,g2)=>{A();E();R();x();var u2=c2(),U8=d2();function m2(n){function e(t,r){return r==="compound"?Object.keys(t).reduce(function(i,s){return i[s]=m2(t[s]),i},{}):r==="list"?Array.isArray(t.value)?t.value.map(function(i){return e(i,t.type)}):[]:t}return e(n.value,n.type)}function on({value:n,type:e}){if(e==="compound"){let r=[],i=Object.entries(n);for(let s=0;s<i.length;s++){let o=i[s][0],l=on(i[s][1]);o==="string"&&(l=h2(l)),r.push(`${o}:${l}`)}return`{${r.join(",")}}`}else{if(e==="list")return Array.isArray(n.value)?`[${f2(n)}]`:"[]";if(e==="byteArray"||e==="intArray"||e==="longArray"){let r=G8(e),i=f2(n);return`[${r}${i}]`}}let t=n+N8(n,e);return e==="string"&&(t=h2(t)),t}function h2(n){return n=n.replace(/"/g,'\\"'),(/'|{|}|\[|\]|:|;|,|\(|\)|§|=/g.test(n)||n==="")&&(n=`"${n}"`),n}function f2({value:n,type:e}){let t=V8(n),r=[];for(let i=0;i<n.length;i++){let s=n[i];s!==void 0&&(s=on({value:s,type:e}),t?r.push(`${i}:${s}`):r.push(s))}return r.join(",")}function V8(n){for(let e=0;e<n.length;e++)if(n[e]===void 0)return!0;return!1}var G8=n=>n.charAt(0).toUpperCase()+";";function N8(n,e){return e==="double"?n>>0===n?"d":"":{int:"",byte:"b",short:"s",float:"f",long:"l",string:""}[e]}function W8(n){return on(p2(n))}function p2(n){try{let e=new u2.Parser(u2.Grammar.fromCompiled(U8));return e.feed(n),e.results[0]}catch(e){throw e.message=`Error parsing text '${n}'`,e}}g2.exports={parse:p2,simplify:m2,stringify:on,normalize:W8}});var A2={};R5(A2,{camelCase:()=>q8,capitalCase:()=>x1,constantCase:()=>Z8,dotCase:()=>$8,kebabCase:()=>e4,noCase:()=>Kr,pascalCase:()=>J8,pascalSnakeCase:()=>X8,pathCase:()=>t4,sentenceCase:()=>r4,snakeCase:()=>R1,split:()=>E1,splitSeparateNumbers:()=>_2,trainCase:()=>n4});function E1(n){let e=n.trim();e=e.replace(j8,b2).replace(Y8,b2),e=e.replace(K8,"\0");let t=0,r=e.length;for(;e.charAt(t)==="\0";)t++;if(t===r)return[];for(;e.charAt(r-1)==="\0";)r--;return e.slice(t,r).split(/\0/g)}function _2(n){let e=E1(n);for(let t=0;t<e.length;t++){let r=e[t],i=Q8.exec(r);if(i){let s=i.index+(i[1]??i[2]).length;e.splice(t,1,r.slice(0,s),r.slice(s))}}return e}function Kr(n,e){let[t,r,i]=tr(n,e);return t+r.map(qr(e?.locale)).join(e?.delimiter??" ")+i}function q8(n,e){let[t,r,i]=tr(n,e),s=qr(e?.locale),o=Jr(e?.locale),l=e?.mergeAmbiguousCharacters?an(s,o):w2(s,o);return t+r.map((a,v)=>v===0?s(a):l(a,v)).join(e?.delimiter??"")+i}function J8(n,e){let[t,r,i]=tr(n,e),s=qr(e?.locale),o=Jr(e?.locale),l=e?.mergeAmbiguousCharacters?an(s,o):w2(s,o);return t+r.map(l).join(e?.delimiter??"")+i}function X8(n,e){return x1(n,{delimiter:"_",...e})}function x1(n,e){let[t,r,i]=tr(n,e),s=qr(e?.locale),o=Jr(e?.locale);return t+r.map(an(s,o)).join(e?.delimiter??" ")+i}function Z8(n,e){let[t,r,i]=tr(n,e);return t+r.map(Jr(e?.locale)).join(e?.delimiter??"_")+i}function $8(n,e){return Kr(n,{delimiter:".",...e})}function e4(n,e){return Kr(n,{delimiter:"-",...e})}function t4(n,e){return Kr(n,{delimiter:"/",...e})}function r4(n,e){let[t,r,i]=tr(n,e),s=qr(e?.locale),o=Jr(e?.locale),l=an(s,o);return t+r.map((a,v)=>v===0?l(a):s(a)).join(e?.delimiter??" ")+i}function R1(n,e){return Kr(n,{delimiter:"_",...e})}function n4(n,e){return x1(n,{delimiter:"-",...e})}function qr(n){return n===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(n)}function Jr(n){return n===!1?e=>e.toUpperCase():e=>e.toLocaleUpperCase(n)}function an(n,e){return t=>`${e(t[0])}${n(t.slice(1))}`}function w2(n,e){return(t,r)=>{let i=t[0];return(r>0&&i>="0"&&i<="9"?"_"+i:e(i))+n(t.slice(1))}}function tr(n,e={}){let t=e.split??(e.separateNumbers?_2:E1),r=e.prefixCharacters??y2,i=e.suffixCharacters??y2,s=0,o=n.length;for(;s<n.length;){let l=n.charAt(s);if(!r.includes(l))break;s++}for(;o>s;){let l=o-1,a=n.charAt(l);if(!i.includes(a))break;o=l}return[n.slice(0,s),t(n.slice(s,o)),n.slice(o)]}var j8,Y8,Q8,K8,b2,y2,k1=Ve(()=>{A();E();R();x();j8=/([\p{Ll}\d])(\p{Lu})/gu,Y8=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,Q8=/(\d)\p{Ll}|(\p{L})\d/u,K8=/[^\p{L}\d]+/giu,b2="$1\0$2",y2=""});var E2=ht((TE,i4)=>{i4.exports={version:"1.21.4",attackable:["acacia_boat","acacia_chest_boat","allay","armadillo","armor_stand","axolotl","bamboo_chest_raft","bamboo_raft","bat","bee","birch_boat","birch_chest_boat","blaze","bogged","breeze","camel","cat","cave_spider","cherry_boat","cherry_chest_boat","chest_minecart","chicken","cod","command_block_minecart","cow","creaking","creeper","dark_oak_boat","dark_oak_chest_boat","dolphin","donkey","drowned","elder_guardian","end_crystal","ender_dragon","enderman","endermite","evoker","falling_block","fox","frog","furnace_minecart","ghast","giant","glow_item_frame","glow_squid","goat","guardian","hoglin","hopper_minecart","horse","husk","illusioner","iron_golem","item_frame","jungle_boat","jungle_chest_boat","leash_knot","llama","magma_cube","mangrove_boat","mangrove_chest_boat","minecart","mooshroom","mule","oak_boat","oak_chest_boat","ocelot","painting","pale_oak_boat","pale_oak_chest_boat","panda","parrot","phantom","pig","piglin","piglin_brute","pillager","player","polar_bear","pufferfish","rabbit","ravager","salmon","sheep","shulker","shulker_bullet","silverfish","skeleton","skeleton_horse","slime","sniffer","snow_golem","spawner_minecart","spider","spruce_boat","spruce_chest_boat","squid","stray","strider","tadpole","tnt","tnt_minecart","trader_llama","tropical_fish","turtle","vex","villager","vindicator","wandering_trader","warden","wind_charge","witch","wither","wither_skeleton","wolf","zoglin","zombie","zombie_horse","zombie_villager","zombified_piglin"],notAttackable:["area_effect_cloud","arrow","block_display","breeze_wind_charge","dragon_fireball","egg","ender_pearl","evoker_fangs","experience_bottle","experience_orb","eye_of_ender","fireball","firework_rocket","fishing_bobber","interaction","item","item_display","lightning_bolt","llama_spit","marker","ominous_item_spawner","potion","small_fireball","snowball","spectral_arrow","text_display","trident","wither_skull"],entityRenames:{Boat:"oak_boat",EnderCrystal:"end_crystal",EntityHorse:"horse",EyeOfEnderSignal:"eye_of_ender",FallingSand:"falling_block",FireworksRocketEntity:"firework_rocket","Fishing Float":"fishing_bobber","Fishing Hook":"fishing_bobber",LavaSlime:"magma_cube",MinecartRideable:"minecart",Mob:!1,Monster:!1,MushroomCow:"mooshroom",Ozelot:"ocelot",PigZombie:"zombified_piglin",PrimedTnt:"tnt",SnowMan:"snow_golem",ThrownEgg:"egg",ThrownEnderpearl:"ender_pearl",ThrownExpBottle:"experience_bottle",ThrownPotion:"potion",VillagerGolem:"iron_golem",WitherBoss:"wither",XPOrb:"experience_orb",activated_tnt:"tnt",armorstand:"armor_stand",boat:"oak_boat",chest_boat:"oak_chest_boat",commandblock_minecart:"command_block_minecart",creaking_transient:"creaking",ender_crystal:"end_crystal",endercrystal:"end_crystal",evocation_fangs:"evoker_fangs",evocation_illager:"evoker",eye_of_ender_signal:"eye_of_ender",falling_objects:"falling_block",firecharge:"fireball",fireworks_rocket:"firework_rocket",fishing_hook:"fishing_bobber",illusion_illager:"illusioner",item_frames:"item_frame",item_stack:"item",snowman:"snow_golem",thrown_enderpearl:"ender_pearl","thrown_exp bottle":"experience_bottle",thrown_exp_bottle:"experience_bottle",thrown_potion:"potion",tipped_arrow:"arrow",villager_golem:"iron_golem",vindication_illager:"vindicator",xp_bottle:"experience_bottle",xp_orb:"experience_orb",zombie_pigman:"zombified_piglin"}}});var R2=ht((ME,x2)=>{A();E();R();x();var rr=1e3,nr=rr*60,ir=nr*60,B0=ir*24,s4=B0*7,o4=B0*365.25;x2.exports=function(n,e){e=e||{};var t=typeof n;if(t==="string"&&n.length>0)return a4(n);if(t==="number"&&isFinite(n))return e.long?v4(n):l4(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function a4(n){if(n=String(n),!(n.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(e){var t=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*o4;case"weeks":case"week":case"w":return t*s4;case"days":case"day":case"d":return t*B0;case"hours":case"hour":case"hrs":case"hr":case"h":return t*ir;case"minutes":case"minute":case"mins":case"min":case"m":return t*nr;case"seconds":case"second":case"secs":case"sec":case"s":return t*rr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function l4(n){var e=Math.abs(n);return e>=B0?Math.round(n/B0)+"d":e>=ir?Math.round(n/ir)+"h":e>=nr?Math.round(n/nr)+"m":e>=rr?Math.round(n/rr)+"s":n+"ms"}function v4(n){var e=Math.abs(n);return e>=B0?ln(n,e,B0,"day"):e>=ir?ln(n,e,ir,"hour"):e>=nr?ln(n,e,nr,"minute"):e>=rr?ln(n,e,rr,"second"):n+" ms"}function ln(n,e,t,r){var i=e>=t*1.5;return Math.round(n/t)+" "+r+(i?"s":"")}});var S2=ht((HE,k2)=>{A();E();R();x();function c4(n){t.debug=t,t.default=t,t.coerce=a,t.disable=o,t.enable=i,t.enabled=l,t.humanize=R2(),t.destroy=v,Object.keys(n).forEach(c=>{t[c]=n[c]}),t.names=[],t.skips=[],t.formatters={};function e(c){let u=0;for(let h=0;h<c.length;h++)u=(u<<5)-u+c.charCodeAt(h),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(c){let u,h=null,p,m;function b(...k){if(!b.enabled)return;let _=b,y=Number(new Date),M=y-(u||y);_.diff=M,_.prev=u,_.curr=y,u=y,k[0]=t.coerce(k[0]),typeof k[0]!="string"&&k.unshift("%O");let T=0;k[0]=k[0].replace(/%([a-zA-Z%])/g,(B,P)=>{if(B==="%%")return"%";T++;let H=t.formatters[P];if(typeof H=="function"){let V=k[T];B=H.call(_,V),k.splice(T,1),T--}return B}),t.formatArgs.call(_,k),(_.log||t.log).apply(_,k)}return b.namespace=c,b.useColors=t.useColors(),b.color=t.selectColor(c),b.extend=r,b.destroy=t.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==t.namespaces&&(p=t.namespaces,m=t.enabled(c)),m),set:k=>{h=k}}),typeof t.init=="function"&&t.init(b),b}function r(c,u){let h=t(this.namespace+(typeof u>"u"?":":u)+c);return h.log=this.log,h}function i(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let u=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of u)h[0]==="-"?t.skips.push(h.slice(1)):t.names.push(h)}function s(c,u){let h=0,p=0,m=-1,b=0;for(;h<c.length;)if(p<u.length&&(u[p]===c[h]||u[p]==="*"))u[p]==="*"?(m=p,b=h,p++):(h++,p++);else if(m!==-1)p=m+1,b++,h=b;else return!1;for(;p<u.length&&u[p]==="*";)p++;return p===u.length}function o(){let c=[...t.names,...t.skips.map(u=>"-"+u)].join(",");return t.enable(""),c}function l(c){for(let u of t.skips)if(s(c,u))return!1;for(let u of t.names)if(s(c,u))return!0;return!1}function a(c){return c instanceof Error?c.stack||c.message:c}function v(){}return t.enable(t.load()),t}k2.exports=c4});var T2=ht((vt,vn)=>{A();E();R();x();vt.formatArgs=u4;vt.save=h4;vt.load=f4;vt.useColors=d4;vt.storage=m4();vt.destroy=(()=>{let n=!1;return()=>{n||(n=!0)}})();vt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function d4(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function u4(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+vn.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;n.splice(1,0,e,"color: inherit");let t=0,r=0;n[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(r=t))}),n.splice(r,0,e)}vt.log=console.debug||console.log||(()=>{});function h4(n){try{n?vt.storage.setItem("debug",n):vt.storage.removeItem("debug")}catch{}}function f4(){let n;try{n=vt.storage.getItem("debug")||vt.storage.getItem("DEBUG")}catch{}return!n&&typeof L<"u"&&"env"in L&&(n=L.env.DEBUG),n}function m4(){try{return localStorage}catch{}}vn.exports=S2()(vt);var{formatters:p4}=vn.exports;p4.j=function(n){try{return JSON.stringify(n)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var M2=ht(sr=>{"use strict";A();E();R();x();var g4=sr&&sr.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(sr,"__esModule",{value:!0});sr.debug=void 0;var b4=g4(T2());sr.debug=(0,b4.default)("mineflayer-mouse")});var I2=ht(P0=>{"use strict";A();E();R();x();var y4=P0&&P0.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(P0,"__esModule",{value:!0});P0.isEntityAttackable=void 0;P0.isArmorStandAttackable=P2;var C2=(k1(),ov(A2)),Xr=y4(E2()),_4=M2(),B2=Object.fromEntries([...Xr.default.attackable,...Xr.default.notAttackable].map(n=>[n,!0])),w4=Xr.default.attackable,A4=(n,e)=>{if(!e.name)throw new Error("Entity has no name");let t=n.entitiesByName[e.name],i=Xr.default.entityRenames[e.name]||Xr.default.entityRenames[(0,C2.snakeCase)(e.name)]||e.name;if(!B2[i]&&(i=(0,C2.snakeCase)(i),!B2[i]))return(0,_4.debug)(`Cannot find entity ${i} in entityData.json`),!1;let s=E4[i];return s?s(e,t):w4.includes(i)};P0.isEntityAttackable=A4;var E4={armor_stand:P2};function P2(n,e){let t=Number(n.metadata?.[e.metadataKeys?.indexOf("client_flags")??14]??0),r=(t&16)!==0,i=(t&8)!==0,s=(t&4)!==0,o=(t&1)!==0;return!r}});var h7=ht((JC,Td)=>{Td.exports={version:"1.20.4","1.8":{blocks:[["wood_planks","planks"],["large_flowers","double_plant"]]},"1.12":{items:[["totem","totem_of_undying"]]},"1.13":{blocks:[["grass","grass_block"],["planks","oak_planks"],["planks","spruce_planks"],["planks","birch_planks"],["planks","jungle_planks"],["planks","acacia_planks"],["planks","dark_oak_planks"],["sapling","oak_sapling"],["sapling","spruce_sapling"],["sapling","birch_sapling"],["sapling","jungle_sapling"],["sapling","acacia_sapling"],["sapling","dark_oak_sapling"],["sand","red_sand"],["log","oak_log"],["log","spruce_log"],["log","birch_log"],["log","jungle_log"],["log","oak_wood"],["log","spruce_wood"],["log","birch_wood"],["log","jungle_wood"],["leaves","oak_leaves"],["leaves","spruce_leaves"],["leaves","birch_leaves"],["leaves","jungle_leaves"],["sponge","wet_sponge"],["sandstone","chiseled_sandstone"],["sandstone","cut_sandstone"],["noteblock","note_block"],["bed","red_bed"],["golden_rail","powered_rail"],["web","cobweb"],["tallgrass","dead_bush"],["tallgrass","grass"],["tallgrass","fern"],["deadbush","dead_bush"],["wool","white_wool"],["wool","orange_wool"],["wool","magenta_wool"],["wool","light_blue_wool"],["wool","yellow_wool"],["wool","lime_wool"],["wool","pink_wool"],["wool","gray_wool"],["wool","light_gray_wool"],["wool","cyan_wool"],["wool","purple_wool"],["wool","blue_wool"],["wool","brown_wool"],["wool","green_wool"],["wool","red_wool"],["wool","black_wool"],["piston_extension","moving_piston"],["yellow_flower","dandelion"],["red_flower","poppy"],["red_flower","blue_orchid"],["red_flower","allium"],["red_flower","azure_bluet"],["red_flower","red_tulip"],["red_flower","orange_tulip"],["red_flower","white_tulip"],["red_flower","pink_tulip"],["red_flower","oxeye_daisy"],["double_stone_slab","stone_slab"],["double_stone_slab","sandstone_slab"],["double_stone_slab","petrified_oak_slab"],["double_stone_slab","cobblestone_slab"],["double_stone_slab","brick_slab"],["double_stone_slab","stone_brick_slab"],["double_stone_slab","nether_brick_slab"],["double_stone_slab","quartz_slab"],["double_stone_slab","smooth_stone"],["double_stone_slab","smooth_sandstone"],["double_stone_slab","smooth_quartz"],["stone_slab","sandstone_slab"],["stone_slab","petrified_oak_slab"],["stone_slab","cobblestone_slab"],["stone_slab","brick_slab"],["stone_slab","stone_brick_slab"],["stone_slab","nether_brick_slab"],["stone_slab","quartz_slab"],["brick_block","bricks"],["mob_spawner","spawner"],["lit_furnace","furnace"],["standing_sign","sign"],["wooden_door","oak_door"],["stone_stairs","cobblestone_stairs"],["wooden_pressure_plate","oak_pressure_plate"],["lit_redstone_ore","redstone_ore"],["unlit_redstone_torch","redstone_wall_torch"],["unlit_redstone_torch","redstone_torch"],["redstone_torch","redstone_wall_torch"],["snow_layer","snow"],["snow","snow_block"],["reeds","sugar_cane"],["fence","oak_fence"],["pumpkin","carved_pumpkin"],["portal","nether_portal"],["lit_pumpkin","jack_o_lantern"],["unpowered_repeater","repeater"],["powered_repeater","repeater"],["stained_glass","white_stained_glass"],["stained_glass","orange_stained_glass"],["stained_glass","magenta_stained_glass"],["stained_glass","light_blue_stained_glass"],["stained_glass","yellow_stained_glass"],["stained_glass","lime_stained_glass"],["stained_glass","pink_stained_glass"],["stained_glass","gray_stained_glass"],["stained_glass","light_gray_stained_glass"],["stained_glass","cyan_stained_glass"],["stained_glass","purple_stained_glass"],["stained_glass","blue_stained_glass"],["stained_glass","brown_stained_glass"],["stained_glass","green_stained_glass"],["stained_glass","red_stained_glass"],["stained_glass","black_stained_glass"],["trapdoor","oak_trapdoor"],["monster_egg","infested_stone"],["monster_egg","infested_cobblestone"],["monster_egg","infested_stone_bricks"],["monster_egg","infested_mossy_stone_bricks"],["monster_egg","infested_cracked_stone_bricks"],["monster_egg","infested_chiseled_stone_bricks"],["stonebrick","stone_bricks"],["stonebrick","mossy_stone_bricks"],["stonebrick","cracked_stone_bricks"],["stonebrick","chiseled_stone_bricks"],["brown_mushroom_block","mushroom_stem"],["red_mushroom_block","mushroom_stem"],["melon_block","melon"],["fence_gate","oak_fence_gate"],["waterlily","lily_pad"],["nether_brick","nether_bricks"],["lit_redstone_lamp","redstone_lamp"],["double_wooden_slab","oak_slab"],["double_wooden_slab","spruce_slab"],["double_wooden_slab","birch_slab"],["double_wooden_slab","jungle_slab"],["double_wooden_slab","acacia_slab"],["double_wooden_slab","dark_oak_slab"],["wooden_slab","oak_slab"],["wooden_slab","spruce_slab"],["wooden_slab","birch_slab"],["wooden_slab","jungle_slab"],["wooden_slab","acacia_slab"],["wooden_slab","dark_oak_slab"],["cobblestone_wall","mossy_cobblestone_wall"],["flower_pot","potted_poppy"],["flower_pot","potted_dandelion"],["flower_pot","potted_oak_sapling"],["flower_pot","potted_spruce_sapling"],["flower_pot","potted_birch_sapling"],["flower_pot","potted_jungle_sapling"],["flower_pot","potted_red_mushroom"],["flower_pot","potted_brown_mushroom"],["flower_pot","potted_cactus"],["flower_pot","potted_dead_bush"],["flower_pot","potted_fern"],["flower_pot","potted_acacia_sapling"],["flower_pot","potted_dark_oak_sapling"],["flower_pot","potted_blue_orchid"],["flower_pot","potted_allium"],["wooden_button","oak_button"],["skull","skeleton_skull"],["skull","skeleton_wall_skull"],["anvil","chipped_anvil"],["anvil","damaged_anvil"],["unpowered_comparator","comparator"],["powered_comparator","comparator"],["quartz_ore","nether_quartz_ore"],["quartz_block","chiseled_quartz_block"],["quartz_block","quartz_pillar"],["stained_hardened_clay","white_terracotta"],["stained_hardened_clay","orange_terracotta"],["stained_hardened_clay","magenta_terracotta"],["stained_hardened_clay","light_blue_terracotta"],["stained_hardened_clay","yellow_terracotta"],["stained_hardened_clay","lime_terracotta"],["stained_hardened_clay","pink_terracotta"],["stained_hardened_clay","gray_terracotta"],["stained_hardened_clay","light_gray_terracotta"],["stained_hardened_clay","cyan_terracotta"],["stained_hardened_clay","purple_terracotta"],["stained_hardened_clay","blue_terracotta"],["stained_hardened_clay","brown_terracotta"],["stained_hardened_clay","green_terracotta"],["stained_hardened_clay","red_terracotta"],["stained_hardened_clay","black_terracotta"],["stained_glass_pane","white_stained_glass_pane"],["stained_glass_pane","orange_stained_glass_pane"],["stained_glass_pane","magenta_stained_glass_pane"],["stained_glass_pane","light_blue_stained_glass_pane"],["stained_glass_pane","yellow_stained_glass_pane"],["stained_glass_pane","lime_stained_glass_pane"],["stained_glass_pane","pink_stained_glass_pane"],["stained_glass_pane","gray_stained_glass_pane"],["stained_glass_pane","light_gray_stained_glass_pane"],["stained_glass_pane","cyan_stained_glass_pane"],["stained_glass_pane","purple_stained_glass_pane"],["stained_glass_pane","blue_stained_glass_pane"],["stained_glass_pane","brown_stained_glass_pane"],["stained_glass_pane","green_stained_glass_pane"],["stained_glass_pane","red_stained_glass_pane"],["stained_glass_pane","black_stained_glass_pane"],["leaves2","acacia_leaves"],["leaves2","dark_oak_leaves"],["log2","acacia_log"],["log2","dark_oak_log"],["log2","acacia_wood"],["log2","dark_oak_wood"],["slime","slime_block"],["prismarine","prismarine_bricks"],["prismarine","dark_prismarine"],["carpet","white_carpet"],["carpet","orange_carpet"],["carpet","magenta_carpet"],["carpet","light_blue_carpet"],["carpet","yellow_carpet"],["carpet","lime_carpet"],["carpet","pink_carpet"],["carpet","gray_carpet"],["carpet","light_gray_carpet"],["carpet","cyan_carpet"],["carpet","purple_carpet"],["carpet","blue_carpet"],["carpet","brown_carpet"],["carpet","green_carpet"],["carpet","red_carpet"],["carpet","black_carpet"],["hardened_clay","terracotta"],["double_plant","sunflower"],["double_plant","lilac"],["double_plant","tall_grass"],["double_plant","large_fern"],["double_plant","rose_bush"],["double_plant","peony"],["standing_banner","white_banner"],["wall_banner","white_wall_banner"],["daylight_detector_inverted","daylight_detector"],["red_sandstone","chiseled_red_sandstone"],["red_sandstone","cut_red_sandstone"],["double_stone_slab2","red_sandstone_slab"],["double_stone_slab2","smooth_red_sandstone"],["stone_slab2","red_sandstone_slab"],["purpur_double_slab","purpur_slab"],["end_bricks","end_stone_bricks"],["magma","magma_block"],["red_nether_brick","red_nether_bricks"],["concrete","white_concrete"],["concrete","orange_concrete"],["concrete","magenta_concrete"],["concrete","light_blue_concrete"],["concrete","yellow_concrete"],["concrete","lime_concrete"],["concrete","pink_concrete"],["concrete","gray_concrete"],["concrete","light_gray_concrete"],["concrete","cyan_concrete"],["concrete","purple_concrete"],["concrete","blue_concrete"],["concrete","brown_concrete"],["concrete","green_concrete"],["concrete","red_concrete"],["concrete","black_concrete"],["concrete_powder","white_concrete_powder"],["concrete_powder","orange_concrete_powder"],["concrete_powder","magenta_concrete_powder"],["concrete_powder","light_blue_concrete_powder"],["concrete_powder","yellow_concrete_powder"],["concrete_powder","lime_concrete_powder"],["concrete_powder","pink_concrete_powder"],["concrete_powder","gray_concrete_powder"],["concrete_powder","light_gray_concrete_powder"],["concrete_powder","cyan_concrete_powder"],["concrete_powder","purple_concrete_powder"],["concrete_powder","blue_concrete_powder"],["concrete_powder","brown_concrete_powder"],["concrete_powder","green_concrete_powder"],["concrete_powder","red_concrete_powder"],["concrete_powder","black_concrete_powder"]],items:[["stone","granite"],["stone","polished_granite"],["stone","diorite"],["stone","polished_diorite"],["stone","andesite"],["stone","polished_andesite"],["grass","grass_block"],["dirt","coarse_dirt"],["dirt","podzol"],["planks","oak_planks"],["planks","spruce_planks"],["planks","birch_planks"],["planks","jungle_planks"],["planks","acacia_planks"],["planks","dark_oak_planks"],["sapling","oak_sapling"],["sapling","spruce_sapling"],["sapling","birch_sapling"],["sapling","jungle_sapling"],["sapling","acacia_sapling"],["sapling","dark_oak_sapling"],["sand","red_sand"],["log","oak_log"],["log","spruce_log"],["log","birch_log"],["log","jungle_log"],["leaves","oak_leaves"],["leaves","spruce_leaves"],["leaves","birch_leaves"],["leaves","jungle_leaves"],["sponge","wet_sponge"],["sandstone","chiseled_sandstone"],["sandstone","cut_sandstone"],["noteblock","note_block"],["golden_rail","powered_rail"],["web","cobweb"],["tallgrass","grass"],["tallgrass","fern"],["deadbush","dead_bush"],["wool","white_wool"],["wool","orange_wool"],["wool","magenta_wool"],["wool","light_blue_wool"],["wool","yellow_wool"],["wool","lime_wool"],["wool","pink_wool"],["wool","gray_wool"],["wool","light_gray_wool"],["wool","cyan_wool"],["wool","purple_wool"],["wool","blue_wool"],["wool","brown_wool"],["wool","green_wool"],["wool","red_wool"],["wool","black_wool"],["yellow_flower","dandelion"],["red_flower","poppy"],["red_flower","blue_orchid"],["red_flower","allium"],["red_flower","azure_bluet"],["red_flower","red_tulip"],["red_flower","orange_tulip"],["red_flower","white_tulip"],["red_flower","pink_tulip"],["red_flower","oxeye_daisy"],["stone_slab","sandstone_slab"],["stone_slab","cobblestone_slab"],["stone_slab","brick_slab"],["stone_slab","stone_brick_slab"],["stone_slab","nether_brick_slab"],["stone_slab","quartz_slab"],["brick_block","bricks"],["mob_spawner","spawner"],["stone_stairs","cobblestone_stairs"],["wooden_pressure_plate","oak_pressure_plate"],["snow_layer","snow"],["snow","snow_block"],["fence","oak_fence"],["pumpkin","carved_pumpkin"],["lit_pumpkin","jack_o_lantern"],["stained_glass","white_stained_glass"],["stained_glass","orange_stained_glass"],["stained_glass","magenta_stained_glass"],["stained_glass","light_blue_stained_glass"],["stained_glass","yellow_stained_glass"],["stained_glass","lime_stained_glass"],["stained_glass","pink_stained_glass"],["stained_glass","gray_stained_glass"],["stained_glass","light_gray_stained_glass"],["stained_glass","cyan_stained_glass"],["stained_glass","purple_stained_glass"],["stained_glass","blue_stained_glass"],["stained_glass","brown_stained_glass"],["stained_glass","green_stained_glass"],["stained_glass","red_stained_glass"],["stained_glass","black_stained_glass"],["trapdoor","oak_trapdoor"],["monster_egg","infested_stone"],["monster_egg","infested_cobblestone"],["monster_egg","infested_stone_bricks"],["monster_egg","infested_mossy_stone_bricks"],["monster_egg","infested_cracked_stone_bricks"],["monster_egg","infested_chiseled_stone_bricks"],["stonebrick","stone_bricks"],["stonebrick","mossy_stone_bricks"],["stonebrick","cracked_stone_bricks"],["stonebrick","chiseled_stone_bricks"],["melon_block","melon"],["fence_gate","oak_fence_gate"],["waterlily","lily_pad"],["nether_brick","nether_bricks"],["wooden_slab","oak_slab"],["wooden_slab","spruce_slab"],["wooden_slab","birch_slab"],["wooden_slab","jungle_slab"],["wooden_slab","acacia_slab"],["wooden_slab","dark_oak_slab"],["cobblestone_wall","mossy_cobblestone_wall"],["wooden_button","oak_button"],["anvil","chipped_anvil"],["anvil","damaged_anvil"],["quartz_ore","nether_quartz_ore"],["quartz_block","chiseled_quartz_block"],["quartz_block","quartz_pillar"],["stained_hardened_clay","white_terracotta"],["stained_hardened_clay","orange_terracotta"],["stained_hardened_clay","magenta_terracotta"],["stained_hardened_clay","light_blue_terracotta"],["stained_hardened_clay","yellow_terracotta"],["stained_hardened_clay","lime_terracotta"],["stained_hardened_clay","pink_terracotta"],["stained_hardened_clay","gray_terracotta"],["stained_hardened_clay","light_gray_terracotta"],["stained_hardened_clay","cyan_terracotta"],["stained_hardened_clay","purple_terracotta"],["stained_hardened_clay","blue_terracotta"],["stained_hardened_clay","brown_terracotta"],["stained_hardened_clay","green_terracotta"],["stained_hardened_clay","red_terracotta"],["stained_hardened_clay","black_terracotta"],["stained_glass_pane","white_stained_glass_pane"],["stained_glass_pane","orange_stained_glass_pane"],["stained_glass_pane","magenta_stained_glass_pane"],["stained_glass_pane","light_blue_stained_glass_pane"],["stained_glass_pane","yellow_stained_glass_pane"],["stained_glass_pane","lime_stained_glass_pane"],["stained_glass_pane","pink_stained_glass_pane"],["stained_glass_pane","gray_stained_glass_pane"],["stained_glass_pane","light_gray_stained_glass_pane"],["stained_glass_pane","cyan_stained_glass_pane"],["stained_glass_pane","purple_stained_glass_pane"],["stained_glass_pane","blue_stained_glass_pane"],["stained_glass_pane","brown_stained_glass_pane"],["stained_glass_pane","green_stained_glass_pane"],["stained_glass_pane","red_stained_glass_pane"],["stained_glass_pane","black_stained_glass_pane"],["leaves2","acacia_leaves"],["leaves2","dark_oak_leaves"],["log2","acacia_log"],["log2","dark_oak_log"],["slime","slime_block"],["prismarine","prismarine_bricks"],["prismarine","dark_prismarine"],["carpet","white_carpet"],["carpet","orange_carpet"],["carpet","magenta_carpet"],["carpet","light_blue_carpet"],["carpet","yellow_carpet"],["carpet","lime_carpet"],["carpet","pink_carpet"],["carpet","gray_carpet"],["carpet","light_gray_carpet"],["carpet","cyan_carpet"],["carpet","purple_carpet"],["carpet","blue_carpet"],["carpet","brown_carpet"],["carpet","green_carpet"],["carpet","red_carpet"],["carpet","black_carpet"],["hardened_clay","terracotta"],["double_plant","sunflower"],["double_plant","lilac"],["double_plant","tall_grass"],["double_plant","large_fern"],["double_plant","rose_bush"],["double_plant","peony"],["red_sandstone","chiseled_red_sandstone"],["red_sandstone","cut_red_sandstone"],["stone_slab2","red_sandstone_slab"],["end_bricks","end_stone_bricks"],["magma","magma_block"],["red_nether_brick","red_nether_bricks"],["silver_shulker_box","light_gray_shulker_box"],["silver_glazed_terracotta","light_gray_glazed_terracotta"],["concrete","white_concrete"],["concrete","orange_concrete"],["concrete","magenta_concrete"],["concrete","light_blue_concrete"],["concrete","yellow_concrete"],["concrete","lime_concrete"],["concrete","pink_concrete"],["concrete","gray_concrete"],["concrete","light_gray_concrete"],["concrete","cyan_concrete"],["concrete","purple_concrete"],["concrete","blue_concrete"],["concrete","brown_concrete"],["concrete","green_concrete"],["concrete","red_concrete"],["concrete","black_concrete"],["concrete_powder","white_concrete_powder"],["concrete_powder","orange_concrete_powder"],["concrete_powder","magenta_concrete_powder"],["concrete_powder","light_blue_concrete_powder"],["concrete_powder","yellow_concrete_powder"],["concrete_powder","lime_concrete_powder"],["concrete_powder","pink_concrete_powder"],["concrete_powder","gray_concrete_powder"],["concrete_powder","light_gray_concrete_powder"],["concrete_powder","cyan_concrete_powder"],["concrete_powder","purple_concrete_powder"],["concrete_powder","blue_concrete_powder"],["concrete_powder","brown_concrete_powder"],["concrete_powder","green_concrete_powder"],["concrete_powder","red_concrete_powder"],["concrete_powder","black_concrete_powder"],["coal","charcoal"],["golden_apple","enchanted_golden_apple"],["wooden_door","oak_door"],["boat","oak_boat"],["reeds","sugar_cane"],["fish","cod"],["fish","salmon"],["fish","tropical_fish"],["fish","pufferfish"],["cooked_fish","cooked_cod"],["cooked_fish","cooked_salmon"],["dye","ink_sac"],["dye","rose_red"],["dye","cactus_green"],["dye","cocoa_beans"],["dye","lapis_lazuli"],["dye","purple_dye"],["dye","cyan_dye"],["dye","light_gray_dye"],["dye","gray_dye"],["dye","pink_dye"],["dye","lime_dye"],["dye","dandelion_yellow"],["dye","light_blue_dye"],["dye","magenta_dye"],["dye","orange_dye"],["dye","bone_meal"],["bed","white_bed"],["bed","orange_bed"],["bed","magenta_bed"],["bed","light_blue_bed"],["bed","yellow_bed"],["bed","lime_bed"],["bed","pink_bed"],["bed","gray_bed"],["bed","light_gray_bed"],["bed","cyan_bed"],["bed","purple_bed"],["bed","blue_bed"],["bed","brown_bed"],["bed","green_bed"],["bed","red_bed"],["bed","black_bed"],["melon","melon_slice"],["speckled_melon","glistering_melon_slice"],["spawn_egg","pig_spawn_egg"],["skull","skeleton_skull"],["skull","wither_skeleton_skull"],["skull","zombie_head"],["skull","player_head"],["skull","creeper_head"],["skull","dragon_head"],["fireworks","firework_rocket"],["firework_charge","firework_star"],["netherbrick","nether_brick"],["banner","black_banner"],["banner","red_banner"],["banner","green_banner"],["banner","brown_banner"],["banner","blue_banner"],["banner","purple_banner"],["banner","cyan_banner"],["banner","light_gray_banner"],["banner","gray_banner"],["banner","pink_banner"],["banner","lime_banner"],["banner","yellow_banner"],["banner","light_blue_banner"],["banner","magenta_banner"],["banner","orange_banner"],["banner","white_banner"],["chorus_fruit_popped","popped_chorus_fruit"],["record_13","music_disc_13"],["record_cat","music_disc_cat"],["record_blocks","music_disc_blocks"],["record_chirp","music_disc_chirp"],["record_far","music_disc_far"],["record_mall","music_disc_mall"],["record_mellohi","music_disc_mellohi"],["record_stal","music_disc_stal"],["record_strad","music_disc_strad"],["record_ward","music_disc_ward"],["record_11","music_disc_11"],["record_wait","music_disc_wait"]]},"1.14":{blocks:[["sign","oak_sign"],["wall_sign","oak_wall_sign"]],items:[["sign","oak_sign"],["rose_red","red_dye"],["cactus_green","green_dye"],["dandelion_yellow","yellow_dye"]]},"1.15.2":{blocks:[],items:[]},"1.16.1":{blocks:[],items:[["zombie_pigman_spawn_egg","zombified_piglin_spawn_egg"]]},"1.16.2":{blocks:[],items:[]},"1.17":{blocks:[["grass_path","dirt_path"]],items:[["grass_path","dirt_path"]]},"1.18":{blocks:[],items:[]},"1.19":{blocks:[],items:[]},"1.19.3":{blocks:[],items:[]},"1.19.4":{blocks:[],items:[]},"1.20":{blocks:[],items:[["pottery_shard_archer","archer_pottery_sherd"],["pottery_shard_prize","prize_pottery_sherd"],["pottery_shard_arms_up","arms_up_pottery_sherd"],["pottery_shard_skull","skull_pottery_sherd"]]},"1.16":{items:[["zombie_pigman_spawn_egg","zombified_piglin_spawn_egg"]]},"1.20.3":{blocks:[["grass","short_grass"]],items:[["grass","short_grass"]]}}});var f7=ht(En=>{"use strict";A();E();R();x();Object.defineProperty(En,"__esModule",{value:!0});En.versionToNumber=void 0;var Md=n=>{let[e,t="0",r="0"]=n.split(".");return+`${e.padStart(2,"0")}${parseInt(t).toString().padStart(2,"0")}${parseInt(r).toString().padStart(2,"0")}`};En.versionToNumber=Md});var p7=ht(dr=>{"use strict";A();E();R();x();var Cd=dr&&dr.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(dr,"__esModule",{value:!0});dr.getRenamedData=void 0;var m7=Cd(h7()),t0=f7(),Bd=(n,e,t,r)=>{let i=(0,t0.versionToNumber)(t),s=(0,t0.versionToNumber)(r),o=i<s?1:-1,l=o>0?1:0,a=e,v=Object.keys(m7.default).sort((h,p)=>o*((0,t0.versionToNumber)(h)-(0,t0.versionToNumber)(p))),c=o>0?s:i,u=o>0?i:s;for(let h of v.filter(p=>(0,t0.versionToNumber)(p)<=c&&(0,t0.versionToNumber)(p)>=u)){if(o>0&&(0,t0.versionToNumber)(h)>=c||o<0&&(0,t0.versionToNumber)(h)<=u)break;let p=m7.default[h][n];if(p)for(let m of p){let b=m[l],k=m[1-l];if(Array.isArray(a))a.includes(k)&&(a=a.map(_=>_===k?b:_));else if(a===k){a=b;break}}}return a};dr.getRenamedData=Bd});function Ln(n,e,t,r){let i=n.length/3,s=[];for(let o=0;o<i;o++){let l=Math.max(t[o]??0,Math.min(e[o]??1,r)),a=o*3;s.push(n[a]*l,n[a+1]*l,n[a+2]*l)}return s}var M7=Ve(()=>{"use strict";A();E();R();x()});var On=Ve(()=>{"use strict";A();E();R();x()});function Nd(n,e=nt){let t=e.curve??nt.curve,r=e.minBrightness??nt.minBrightness,i=e.gamma??nt.gamma,s=n/(4-3*n),o=n*(1-t)+s*t;return o=r+o*(1-r),Math.min(1,Math.max(0,o**i))}function Wd(n,e,t){return Math.max(n,Math.min(e,t))}function ts(n,e,t,r=nt){let i=Wd(n,e,t);return Nd(i,r)}var nt,Dn,Fn=Ve(()=>{"use strict";A();E();R();x();nt={curve:0,minBrightness:.12,gamma:1},Dn=`
14
14
  float applyLightmap(float L) {
15
15
  float curved = L / (4.0 - 3.0 * L);
16
16
  float shaped = mix(L, curved, u_lightCurve);
17
17
  shaped = mix(u_minBrightness, 1.0, shaped);
18
18
  return clamp(pow(shaped, u_lightGamma), 0.0, 1.0);
19
19
  }
20
- `});import*as ct from"three";function Vd(){return Ud.map(([n,e],t)=>` ${t===0?"if":"else if"} (faceId == ${t}u) uv = vec2(${S7(n)}, ${S7(e)});`).join(`
21
- `)}function zn(){return new ct.ShaderMaterial({vertexShader:Nd,fragmentShader:Wd,uniforms:ct.UniformsUtils.merge([ct.UniformsLib.fog,{u_atlas:{value:null},u_tintPalette:{value:null},u_debugMode:{value:0},u_skyLevel:{value:1},u_shadingTheme:{value:1},u_cardinalLight:{value:0},u_lightCurve:{value:nt.curve},u_minBrightness:{value:nt.minBrightness},u_lightGamma:{value:nt.gamma},u_sectionOriginRel:{value:new ct.Vector3(0,0,0)},u_originDelta:{value:new ct.Vector3},u_cameraOriginFrac:{value:new ct.Vector3}}]),transparent:!1,depthWrite:!0,depthTest:!0,blending:ct.NoBlending,glslVersion:ct.GLSL3,fog:!0})}function Un(n,e){let t=n.uniforms.u_skyLevel;t&&(t.value=e)}function rs(n,e,t){let r=n.uniforms.u_shadingTheme;r&&(r.value=e==="high-contrast"?1:0);let i=n.uniforms.u_cardinalLight;i&&(i.value=t==="nether"?1:0)}function T7(n,e){if(e.curve!==void 0){let t=n.uniforms.u_lightCurve;t&&(t.value=e.curve)}if(e.minBrightness!==void 0){let t=n.uniforms.u_minBrightness;t&&(t.value=e.minBrightness)}if(e.gamma!==void 0){let t=n.uniforms.u_lightGamma;t&&(t.value=e.gamma)}}function Vn(n){return{x:Math.round(n.x/16),y:Math.round(n.y/16),z:Math.round(n.z/16)}}var Ud,S7,Gd,Nd,Wd,Nt,D0,M7,jd,n0=Ve(()=>{"use strict";A();E();R();x();Fn();Ud=[["u","1-v"],["1-u","v"],["v","u"],["v","u"],["u","v"],["1-u","v"]],S7=n=>({u:"u",v:"v","1-u":"1.0 - u","1-v":"1.0 - v"})[n];Gd=Vd(),Nd=`
20
+ `});import*as ct from"three";function Yd(){return jd.map(([n,e],t)=>` ${t===0?"if":"else if"} (faceId == ${t}u) uv = vec2(${C7(n)}, ${C7(e)});`).join(`
21
+ `)}function zn(){return new ct.ShaderMaterial({vertexShader:Kd,fragmentShader:qd,uniforms:ct.UniformsUtils.merge([ct.UniformsLib.fog,{u_atlas:{value:null},u_tintPalette:{value:null},u_debugMode:{value:0},u_skyLevel:{value:1},u_shadingTheme:{value:1},u_cardinalLight:{value:0},u_lightCurve:{value:nt.curve},u_minBrightness:{value:nt.minBrightness},u_lightGamma:{value:nt.gamma},u_sectionOriginRel:{value:new ct.Vector3(0,0,0)},u_originDelta:{value:new ct.Vector3},u_cameraOriginFrac:{value:new ct.Vector3}}]),transparent:!1,depthWrite:!0,depthTest:!0,blending:ct.NoBlending,glslVersion:ct.GLSL3,fog:!0})}function Un(n,e){let t=n.uniforms.u_skyLevel;t&&(t.value=e)}function rs(n,e,t){let r=n.uniforms.u_shadingTheme;r&&(r.value=e==="high-contrast"?1:0);let i=n.uniforms.u_cardinalLight;i&&(i.value=t==="nether"?1:0)}function B7(n,e){if(e.curve!==void 0){let t=n.uniforms.u_lightCurve;t&&(t.value=e.curve)}if(e.minBrightness!==void 0){let t=n.uniforms.u_minBrightness;t&&(t.value=e.minBrightness)}if(e.gamma!==void 0){let t=n.uniforms.u_lightGamma;t&&(t.value=e.gamma)}}function Vn(n){return{x:Math.round(n.x/16),y:Math.round(n.y/16),z:Math.round(n.z/16)}}var jd,C7,Qd,Kd,qd,Nt,D0,P7,Jd,n0=Ve(()=>{"use strict";A();E();R();x();Fn();jd=[["u","1-v"],["1-u","v"],["v","u"],["v","u"],["u","v"],["1-u","v"]],C7=n=>({u:"u",v:"v","1-u":"1.0 - u","1-v":"1.0 - v"})[n];Qd=Yd(),Kd=`
22
22
  precision highp float;
23
23
  precision highp int;
24
24
 
@@ -157,7 +157,7 @@ void main() {
157
157
  // --- Per-face UV: canonical tile-local UV (su>0, sv>0), generated from
158
158
  // FACE_UV_TERMS \u2014 same source as shaderCubeFaceUv() ---
159
159
  vec2 uv;
160
- ${Gd}
160
+ ${Qd}
161
161
 
162
162
  // su/sv sign from resolved model: negative scale = mirror on axis.
163
163
  // Bit offsets mirror WORD2.FLIP_U_SHIFT / WORD0.FLIP_V_SHIFT (GLSL cannot import TS).
@@ -190,7 +190,7 @@ ${Gd}
190
190
  vFogDepth = -mvPosition.z;
191
191
  #endif
192
192
  }
193
- `,Wd=`
193
+ `,qd=`
194
194
  precision highp float;
195
195
  precision highp int;
196
196
 
@@ -326,8 +326,8 @@ void main() {
326
326
  applyFog();
327
327
  writeLogDepth();
328
328
  }
329
- `;Nt=6;D0={LX_BITS:4,LY_BITS:4,LZ_BITS:4,FACE_BITS:3,TINT_BITS:8,AO_BITS_PER_CORNER:2,NUM_CORNERS:4,LX_SHIFT:0,LY_SHIFT:4,LZ_SHIFT:8,FACE_SHIFT:12,TINT_SHIFT:15,AO_SHIFT:23,FLIP_V_SHIFT:31},M7={TEX_INDEX_BITS:12,DIAGONAL_FLAG_SHIFT:12,SECTION_Y_SHIFT:13,SECTION_Y_BITS:5,EMPTY_SHIFT:18,SECTION_X_HI_SHIFT:19,SECTION_Z_HI_SHIFT:25,SECTION_HI_BITS:6,FLIP_U_SHIFT:31},jd={SECTION_BITS:22,SECTION_MASK:(1<<22)-1,LO_BITS:16,HI_BITS:6,SECTION_BIAS:2097152}});var Gn,C7=Ve(()=>{"use strict";A();E();R();x();Gn=class{constructor(e){d(this,"atlasWidth");d(this,"atlasHeight");d(this,"tileSize");d(this,"tilesPerRow");d(this,"maxTiles");d(this,"valid");this.atlasWidth=e.width,this.atlasHeight=e.height,this.tileSize=e.tileSize,this.tilesPerRow=Math.floor(this.atlasWidth/this.tileSize),this.maxTiles=this.tilesPerRow*Math.floor(this.atlasHeight/this.tileSize),this.valid=this.atlasWidth===1024&&this.atlasHeight===1024&&this.tileSize===16&&this.maxTiles<=4096}isValid(){return this.valid}getTilesPerRow(){return this.tilesPerRow}tileIndexFromPixelCoords(e,t){if(!this.valid)return-1;let r=Math.floor(e/this.tileSize),i=Math.floor(t/this.tileSize);if(r<0||r>=this.tilesPerRow||i<0)return-1;let s=i*this.tilesPerRow+r;return s>=this.maxTiles?-1:s}tileIndexFromTextureEntry(e){return!this.valid||e.su!==this.tileSize||e.sv!==this.tileSize?-1:this.tileIndexFromPixelCoords(e.u,e.v)}tileIndexFromTextureName(e,t){if(!this.valid)return-1;let r=t.textures[e];if(!r&&e.includes(":")&&(r=t.textures[e.split(":")[1]]),!r&&e.includes("/")&&(r=t.textures[e.split("/")[1]]),r||(r=t.textures[`block/${e}`]),!r){let i=e.replace(/^block\//,"");r=t.textures[i]}return r?this.tileIndexFromTextureEntry(r):-1}}});import*as At from"three";var Nn,B7=Ve(()=>{"use strict";A();E();R();x();Nn=class n{constructor(){d(this,"entries",[{r:1,g:1,b:1}]);d(this,"colorToIndex",new Map);d(this,"categoryBiomeToIndex",new Map);d(this,"texture",null);d(this,"ready",!1)}packColor(e,t,r){let i=Math.round(e*255),s=Math.round(t*255),o=Math.round(r*255);return i<<16|s<<8|o}add(e,t,r,i,s){let o=this.packColor(e,t,r),l=`${i}:${s}`,a=this.categoryBiomeToIndex.get(l);if(a!==void 0)return a;let v=this.colorToIndex.get(o);if(v!==void 0)return this.categoryBiomeToIndex.set(l,v),v;let c=this.entries.length;return this.entries.push({r:e,g:t,b:r}),this.colorToIndex.set(o,c),this.categoryBiomeToIndex.set(l,c),c}getTintIndex(e,t,r,i){return e===void 0?0:e===0?t==="redstone_wire"?this.categoryBiomeToIndex.get(`redstone:${r.power}`)??this.categoryBiomeToIndex.get("redstone:0")??0:t==="birch_leaves"||t==="spruce_leaves"||t==="lily_pad"?this.categoryBiomeToIndex.get(`constant:${t}`)??this.categoryBiomeToIndex.get("constant:default")??0:t.includes("leaves")||t==="vine"?this.categoryBiomeToIndex.get(`foliage:${i}`)??this.categoryBiomeToIndex.get("foliage:plains")??0:this.categoryBiomeToIndex.get(`grass:${i}`)??this.categoryBiomeToIndex.get("grass:plains")??0:0}getEntry(e){return this.entries[e]??this.entries[0]}get size(){return this.entries.length}buildTextureData(){let e=new Float32Array(1024);for(let t=0;t<this.entries.length&&t<256;t++){let r=this.entries[t];e[t*4]=r.r,e[t*4+1]=r.g,e[t*4+2]=r.b,e[t*4+3]=1}return e}createTexture(){this.texture&&(this.texture.dispose(),this.texture=null,this.ready=!1);let e=this.buildTextureData(),t=new At.DataTexture(e,256,1,At.RGBAFormat,At.FloatType);return t.minFilter=At.NearestFilter,t.magFilter=At.NearestFilter,t.wrapS=At.ClampToEdgeWrapping,t.wrapT=At.ClampToEdgeWrapping,t.needsUpdate=!0,this.texture=t,this.ready=!0,t}getTexture(){return this.texture}isReady(){return this.ready}static fromTintsData(e){let t=new n;function r(i){let s=(i>>16&255)/255,o=(i>>8&255)/255,l=(i&255)/255;return[s,o,l]}if(e.grass){let i=r(e.grass.default);for(let{keys:s,color:o}of e.grass.data??[]){let l=r(o);for(let a of s)t.add(l[0],l[1],l[2],"grass",a)}t.add(i[0],i[1],i[2],"grass","plains")}if(e.foliage){let i=r(e.foliage.default);for(let{keys:s,color:o}of e.foliage.data??[]){let l=r(o);for(let a of s)t.add(l[0],l[1],l[2],"foliage",a)}t.add(i[0],i[1],i[2],"foliage","plains")}if(e.redstone){let i=r(e.redstone.default);for(let{keys:s,color:o}of e.redstone.data??[]){let l=r(o);for(let a of s)t.add(l[0],l[1],l[2],"redstone",a)}t.add(i[0],i[1],i[2],"redstone","0")}if(e.constant){let i=r(e.constant.default);for(let{keys:s,color:o}of e.constant.data??[]){let l=r(o);for(let a of s)t.add(l[0],l[1],l[2],"constant",a)}t.add(i[0],i[1],i[2],"constant","default")}return t}}});import P7 from"mc-assets/dist/blocksAtlases.json";function Yd(){let n=globalThis.loadedData?.tints;return n||(I7||(I7=!0),null)}function jn(){let n=Yd();if(!n)return null;if(Wn||(Wn=Nn.fromTintsData(n),Wn.createTexture()),!ns){let e=P7.latest??P7;ns=new Gn({width:e.width,height:e.height,tileSize:e.tileSize??16,suSv:e.suSv??16,textures:e.textures??{}})}return{tintPalette:Wn,textureIndexMapping:ns}}function H7(){return 1<<M7.EMPTY_SHIFT>>>0}var Wn,ns,I7,hr=Ve(()=>{"use strict";A();E();R();x();On();n0();C7();B7();On();Wn=null,ns=null,I7=!1});import*as Le from"three";function Qd(n,e){let t=new Le.InstancedBufferGeometry,r=new Float32Array(Nt*3);t.setAttribute("position",new Le.BufferAttribute(r,3));let i=new Uint32Array(e),s=new Uint32Array(e),o=new Uint32Array(e),l=new Uint32Array(e),a=4;for(let v=0;v<e;v++)i[v]=n[v*a],s[v]=n[v*a+1],o[v]=n[v*a+2],l[v]=n[v*a+3];return t.setAttribute("a_w0",new Le.InstancedBufferAttribute(i,1)),t.setAttribute("a_w1",new Le.InstancedBufferAttribute(s,1)),t.setAttribute("a_w2",new Le.InstancedBufferAttribute(o,1)),t.setAttribute("a_w3",new Le.InstancedBufferAttribute(l,1)),t.instanceCount=e,t.boundingBox=new Le.Box3(new Le.Vector3(-8,-8,-8),new Le.Vector3(8,8,8)),t.boundingSphere=new Le.Sphere(new Le.Vector3(0,0,0),Math.sqrt(3*8**2)),t}function Kd(n){n.raycast=(e,t)=>{let{geometry:r}=n;if(!r.boundingBox||(L7.copy(r.boundingBox).applyMatrix4(n.matrixWorld),!e.ray.intersectBox(L7,ss)))return;let i=e.ray.origin.distanceTo(ss);t.push({distance:i,point:ss.clone(),object:n})}}function Yn(n,e){let t=Qd(n.words,n.count),r=new Le.Mesh(t,e);return r.name="shaderMesh",r.matrixAutoUpdate=!1,r.frustumCulled=!1,Kd(r),r}function os(n){n.geometry.dispose()}var L7,ss,as=Ve(()=>{"use strict";A();E();R();x();n0();hr();L7=new Le.Box3,ss=new Le.Vector3});var V7={};R5(V7,{applyWorldGeometryExport:()=>Xd,createMeshesFromExport:()=>z7,downloadWorldGeometry:()=>ls,exportWorldGeometry:()=>D7,loadTextureFromDataUrl:()=>U7,loadWorldGeometryFromUrl:()=>qd});import*as Oe from"three";function D7(n,e,t,r=!1){let i=[],s=Ft(n.timeOfTheDay)/15,o=n.chunkMeshManager.globalLegacyBuffer;for(let[a,v]of Object.entries(n.sectionObjects)){let c=[],u=[],h=[],p=[],m=[],b=[],k=[],_=o?.getSectionGeometryData(a);_&&(c.push(..._.positions),h.push(...Ln(_.colors,_.skyLights,_.blockLights,s)),p.push(..._.skyLights),m.push(..._.blockLights),b.push(..._.uvs),k.push(..._.indices));let y=v.children.find(M=>M.name==="mesh");if(y?.geometry){let{geometry:M}=y,T=M.getAttribute("position"),S=M.getAttribute("normal"),B=M.getAttribute("color"),P=M.getAttribute("a_skyLight"),H=M.getAttribute("a_blockLight"),V=M.getAttribute("uv"),z=M.index;if(T&&z&&B){let N=c.length/3,Y=T.count,q=Array.from(B.array),J=P?Array.from(P.array):new Array(Y).fill(1),te=H?Array.from(H.array):new Array(Y).fill(0);c.push(...Array.from(T.array)),S&&u.push(...Array.from(S.array)),h.push(...Ln(q,J,te,s)),p.push(...J),m.push(...te),V&&b.push(...Array.from(V.array));for(let se of Array.from(z.array))k.push(se+N)}}c.length===0||k.length===0||i.push({key:a,position:{x:v.worldX??0,y:v.worldY??0,z:v.worldZ??0},geometry:{positions:c,normals:u,colors:h,skyLights:p,blockLights:m,uvs:b,indices:k}})}let l={version:n.version??"unknown",exportedAt:new Date().toISOString(),camera:{position:e,rotation:t},sections:i};if(r&&n.material.map){let a=document.createElement("canvas"),v=n.material.map,{image:c}=v;c&&(a.width=c.width,a.height=c.height,a.getContext("2d").drawImage(c,0,0),l.textureAtlasDataUrl=a.toDataURL("image/png"))}return l}function ls(n,e,t,r="world-geometry.json",i=!1){let s=D7(n,e,t,i),o=JSON.stringify(s),l=new Blob([o],{type:"application/json"}),a=URL.createObjectURL(l),v=document.createElement("a");v.href=a,v.download=r,v.click(),URL.revokeObjectURL(a)}async function qd(n){let e=await fetch(n);if(!e.ok)throw new Error(`Failed to fetch world geometry: ${e.statusText}`);return e.json()}function F7(n,e){let t=n.map??n.map;if(!t)return null;let r=zn();r.uniforms.u_atlas.value=t,Un(r,e);let i=jn();if(!i)return null;let{tintPalette:s}=i;return s.isReady()||s.createTexture(),r.uniforms.u_tintPalette.value=s.getTexture(),r}function z7(n,e,t,r=1){let i=[],s=t??F7(e,r),o=0,l;for(let a of n.sections){let v=new Oe.Group;if(v.name="chunk",a.geometry.positions.length>0&&a.geometry.indices.length>0){let h=new Oe.BufferGeometry;if(h.setAttribute("position",new Oe.Float32BufferAttribute(a.geometry.positions,3)),a.geometry.normals.length&&h.setAttribute("normal",new Oe.Float32BufferAttribute(a.geometry.normals,3)),a.geometry.colors.length){let k=a.geometry.skyLights?.length?Ln(a.geometry.colors,a.geometry.skyLights,a.geometry.blockLights,r):a.geometry.colors;h.setAttribute("color",new Oe.Float32BufferAttribute(k,3))}a.geometry.uvs.length&&h.setAttribute("uv",new Oe.Float32BufferAttribute(a.geometry.uvs,2));let m=Math.max(...a.geometry.indices)>65535?Uint32Array:Uint16Array;h.setIndex(new Oe.BufferAttribute(new m(a.geometry.indices),1));let b=new Oe.Mesh(h,e);b.position.set(a.position.x,a.position.y,a.position.z),b.name="mesh",v.add(b)}let u=a.shaderCubes;if(u&&u.count>0&&s)if(u.formatVersion!==4)o++,l??(l=u.formatVersion);else{let h=Yn(u,s);h.position.set(a.position.x,a.position.y,a.position.z),v.add(h)}v.children.length>0&&i.push(v)}return o>0,i}async function U7(n){return new Promise((e,t)=>{let r=new Image;r.onload=()=>{let i=new Oe.Texture(r);i.magFilter=Oe.NearestFilter,i.minFilter=Oe.NearestFilter,i.needsUpdate=!0,i.flipY=!1,e(i)},r.onerror=t,r.src=n})}async function Xd(n,e){let{scene:t,renderUpdateEmitter:r,material:i}=n,s=t.getObjectByName(O7);s&&(t.remove(s),Jd(s));let o=!!e.textureAtlasDataUrl,l;if(o&&e.textureAtlasDataUrl){let h=await U7(e.textureAtlasDataUrl);l=new Oe.MeshLambertMaterial({map:h,vertexColors:!0,transparent:!0,alphaTest:.1}),l.name="geometry-export-material"}else l=i;let a=Ft(n.timeOfTheDay)/15,v=e.sections.some(h=>(h.shaderCubes?.count??0)>0)?F7(l,a):null,c=z7(e,l,v,a),u=new Oe.Group;u.name=O7,o&&(u.userData.geometryExportMaterial=l);for(let h of c)u.add(h);return t.add(u),r.emit("update"),c.length}var O7,Jd,vs=Ve(()=>{"use strict";A();E();R();x();N5();k7();hr();On();n0();as();O7="geometry-export-root";Jd=n=>{n.traverse(t=>{t.isMesh&&t.geometry?.dispose()});let e=n.userData?.geometryExportMaterial;e&&(e.map?.dispose?.(),e.dispose?.())}});A();E();R();x();A();E();R();x();A();E();R();x();A();E();R();x();import{proxy as ra}from"valtio";A();E();R();x();A();E();R();x();var bi=()=>({longRenderTime:!1,constantLongRenderTime:!1,tooManyEntities:!1,tooManyTextures:!1,unknownReason:!1});A();E();R();x();var C5=30;var yi=45,_i=100;A();E();R();x();var kr=class{constructor(e){this.factors=e;d(this,"renderTimeHistory",[])}onFrame(e){this.pushRenderTime(e.totalMs),this.recompute(e)}pushRenderTime(e){this.renderTimeHistory.push(e),this.renderTimeHistory.length>24&&this.renderTimeHistory.shift()}recompute(e){let t=e.fps>0&&e.fps<=45,r=Math.max(0,e.totalMs-e.entitiesMs),i=e.totalMs>=30,s=this.renderTimeHistory.length,o=this.renderTimeHistory.filter(h=>h>=30).length,l=s>=8&&o/s>=.65,a=e.loadedTextureCount>=100,v=t&&e.entitiesMs>=8&&r<=20,u=t&&!(i||l||v||a);this.factors.longRenderTime=i,this.factors.constantLongRenderTime=l,this.factors.tooManyEntities=v,this.factors.tooManyTextures=a,this.factors.unknownReason=u}reset(){this.renderTimeHistory.length=0,this.factors.longRenderTime=!1,this.factors.constantLongRenderTime=!1,this.factors.tooManyEntities=!1,this.factors.tooManyTextures=!1,this.factors.unknownReason=!1}};A();E();R();x();var uv=[{key:"longRenderTime",code:"LR"},{key:"constantLongRenderTime",code:"CLR"},{key:"tooManyEntities",code:"ENT"},{key:"tooManyTextures",code:"TEX"},{key:"unknownReason",code:"UNK"}];function wi(n){let e=uv.filter(({key:t})=>n[t]).map(({code:t})=>t);return e.length>0?e.join("+"):""}var Sr={paused:!1,showChunkBorders:!1,enableDebugOverlay:!1,debugWasmPerf:!1,debugModelVariant:void 0,futuristicReveal:!1,smartCull:!1,wasmMesher:!0,shaderCubeBlocks:!1,shaderCubeDebugMode:0,mesherWorkers:1,addChunksBatchWaitTime:200,_experimentalSmoothChunkLoading:!0,_renderByChunks:!1,autoLowerRenderDistance:!1,disableMesherConversionCache:!1,dedicatedChangeWorker:!1,shadingTheme:"high-contrast",cardinalLight:"default",dayCycle:!0,smoothLighting:!0,enableLighting:!0,starfield:!0,defaultSkybox:!0,renderEntities:!0,extraBlockRenderers:!0,foreground:!0,fov:75,volume:1,showHand:!1,viewBobbing:!1,handRenderer:"vanilla",renderEars:!0,highlightBlockColor:"blue",fetchPlayerSkins:!0,skinTexturesProxy:void 0,vrSupport:!0,vrPageGameRendering:!0,clipWorldBelowY:void 0,isPlayground:!1,instantCameraUpdate:!1,isRaining:!1,rainColor:"rgb(118, 148, 226)",rainOpacity:.5,moduleStates:{}},na={fpsLimit:void 0,sceneBackground:"lightblue",timeoutRendering:!1},Xh=(n={})=>ra({...Sr,...n}),f0=()=>({reactive:ra({world:{chunksLoaded:{},heightmaps:{},allChunksLoaded:!1,mesherWork:!1,instabilityFactors:bi(),intersectMedia:null},renderer:"...",preventEscapeMenu:!1}),nonReactive:{fps:0,worstRenderTime:0,avgRenderTime:0,world:{chunksLoadedCount:0,chunksTotalNumber:0,chunksFullInfo:"-"},renderer:{timeline:{live:[],frozen:[],lastSecond:[]}}}});A();E();R();x();import{proxy as hv}from"valtio";var Ai=()=>hv({playerSkin:void 0,inWater:!1,waterBreathing:!1,backgroundColor:[0,0,0],ambientLight:0,directionalLight:0,eyeHeight:0,gameMode:void 0,lookingAtBlock:void 0,diggingBlock:void 0,movementState:"NOT_MOVING",onGround:!0,sneaking:!1,flying:!1,sprinting:!1,walkDist:0,prevWalkDist:0,bob:0,prevBob:0,itemUsageTicks:0,username:"",onlineMode:!1,cardinalLight:"default",lightingDisabled:!1,shouldHideHand:!1,heldItemMain:void 0,heldItemOff:void 0,perspective:"first_person",onFire:!1,fovMultiplier:1,cameraSpectatingEntity:void 0,team:void 0}),ia=n=>({isSpectator(){return n.gameMode==="spectator"},isSpectatingEntity(){return n.cameraSpectatingEntity!==void 0&&n.gameMode==="spectator"},isThirdPerson(){return this.isSpectatingEntity()?!1:n.perspective==="third_person_back"||n.perspective==="third_person_front"}}),sa=()=>({reactive:Ai()});A();E();R();x();import{Vec3 as kv}from"vec3";import{proxy as wa}from"valtio";A();E();R();x();A();E();R();x();A();E();R();x();A();E();R();x();var B5={},oa=!1;function fv(){if(oa)return B5;oa=!0;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(S,B,P){return Function.prototype.apply.call(S,B,P)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:t=function(S){return Object.getOwnPropertyNames(S)};function r(T){}var i=Number.isNaN||function(S){return S!==S};function s(){s.init.call(this)}B5=s,B5.once=_,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function l(T){if(typeof T!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof T)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(T){if(typeof T!="number"||T<0||i(T))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+T+".");o=T}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||i(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function a(T){return T._maxListeners===void 0?s.defaultMaxListeners:T._maxListeners}s.prototype.getMaxListeners=function(){return a(this)},s.prototype.emit=function(S){for(var B=[],P=1;P<arguments.length;P++)B.push(arguments[P]);var H=S==="error",V=this._events;if(V!==void 0)H=H&&V.error===void 0;else if(!H)return!1;if(H){var z;if(B.length>0&&(z=B[0]),z instanceof Error)throw z;var N=new Error("Unhandled error."+(z?" ("+z.message+")":""));throw N.context=z,N}var Y=V[S];if(Y===void 0)return!1;if(typeof Y=="function")e(Y,this,B);else for(var q=Y.length,J=m(Y,q),P=0;P<q;++P)e(J[P],this,B);return!0};function v(T,S,B,P){var H,V,z;if(l(B),V=T._events,V===void 0?(V=T._events=Object.create(null),T._eventsCount=0):(V.newListener!==void 0&&(T.emit("newListener",S,B.listener?B.listener:B),V=T._events),z=V[S]),z===void 0)z=V[S]=B,++T._eventsCount;else if(typeof z=="function"?z=V[S]=P?[B,z]:[z,B]:P?z.unshift(B):z.push(B),H=a(T),H>0&&z.length>H&&!z.warned){z.warned=!0;var N=new Error("Possible EventEmitter memory leak detected. "+z.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");N.name="MaxListenersExceededWarning",N.emitter=T,N.type=S,N.count=z.length}return T}s.prototype.addListener=function(S,B){return v(this,S,B,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(S,B){return v(this,S,B,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(T,S,B){var P={fired:!1,wrapFn:void 0,target:T,type:S,listener:B},H=c.bind(P);return H.listener=B,P.wrapFn=H,H}s.prototype.once=function(S,B){return l(B),this.on(S,u(this,S,B)),this},s.prototype.prependOnceListener=function(S,B){return l(B),this.prependListener(S,u(this,S,B)),this},s.prototype.removeListener=function(S,B){var P,H,V,z,N;if(l(B),H=this._events,H===void 0)return this;if(P=H[S],P===void 0)return this;if(P===B||P.listener===B)--this._eventsCount===0?this._events=Object.create(null):(delete H[S],H.removeListener&&this.emit("removeListener",S,P.listener||B));else if(typeof P!="function"){for(V=-1,z=P.length-1;z>=0;z--)if(P[z]===B||P[z].listener===B){N=P[z].listener,V=z;break}if(V<0)return this;V===0?P.shift():b(P,V),P.length===1&&(H[S]=P[0]),H.removeListener!==void 0&&this.emit("removeListener",S,N||B)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(S){var B,P,H;if(P=this._events,P===void 0)return this;if(P.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):P[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete P[S]),this;if(arguments.length===0){var V=Object.keys(P),z;for(H=0;H<V.length;++H)z=V[H],z!=="removeListener"&&this.removeAllListeners(z);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(B=P[S],typeof B=="function")this.removeListener(S,B);else if(B!==void 0)for(H=B.length-1;H>=0;H--)this.removeListener(S,B[H]);return this};function h(T,S,B){var P=T._events;if(P===void 0)return[];var H=P[S];return H===void 0?[]:typeof H=="function"?B?[H.listener||H]:[H]:B?k(H):m(H,H.length)}s.prototype.listeners=function(S){return h(this,S,!0)},s.prototype.rawListeners=function(S){return h(this,S,!1)},s.listenerCount=function(T,S){return typeof T.listenerCount=="function"?T.listenerCount(S):p.call(T,S)},s.prototype.listenerCount=p;function p(T){var S=this._events;if(S!==void 0){var B=S[T];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function m(T,S){for(var B=new Array(S),P=0;P<S;++P)B[P]=T[P];return B}function b(T,S){for(;S+1<T.length;S++)T[S]=T[S+1];T.pop()}function k(T){for(var S=new Array(T.length),B=0;B<S.length;++B)S[B]=T[B].listener||T[B];return S}function _(T,S){return new Promise(function(B,P){function H(z){T.removeListener(S,V),P(z)}function V(){typeof T.removeListener=="function"&&T.removeListener("error",H),B([].slice.call(arguments))}M(T,S,V,{once:!0}),S!=="error"&&y(T,H,{once:!0})})}function y(T,S,B){typeof T.on=="function"&&M(T,"error",S,B)}function M(T,S,B,P){if(typeof T.on=="function")P.once?T.once(S,B):T.on(S,B);else if(typeof T.addEventListener=="function")T.addEventListener(S,function H(V){P.once&&T.removeEventListener(S,H),B(V)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof T)}return B5}var P5=fv();P5.once;P5.once=function(n,e){return new Promise((t,r)=>{function i(...o){s!==void 0&&n.removeListener("error",s),t(o)}let s;e!=="error"&&(s=o=>{n.removeListener(name,i),r(o)},n.once("error",s)),n.once(e,i)})};P5.on=function(n,e){let t=[],r=[],i=null,s=!1,o={async next(){let v=t.shift();if(v)return createIterResult(v,!1);if(i){let c=Promise.reject(i);return i=null,c}return s?createIterResult(void 0,!0):new Promise((c,u)=>r.push({resolve:c,reject:u}))},async return(){n.removeListener(e,l),n.removeListener("error",a),s=!0;for(let v of r)v.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(v){i=v,n.removeListener(e,l),n.removeListener("error",a)},[Symbol.asyncIterator](){return this}};return n.on(e,l),n.on("error",a),o;function l(...v){let c=r.shift();c?c.resolve(createIterResult(v,!1)):t.push(v)}function a(v){s=!0;let c=r.shift();c?c.reject(v):i=v,o.return()}};var{EventEmitter:m0,defaultMaxListeners:ff,init:mf,listenerCount:pf,on:gf,once:bf}=P5;import{Vec3 as p0}from"vec3";A();E();R();x();function Tr(n){let e=n*2+1;if(e<=0)return[];let t=[],r=0,i=0,s=0,o=-1;for(let l=0;l<e*e;l++){if(Math.abs(r)<=e/2&&Math.abs(i)<=e/2&&t.push([r,i]),r===i||r<0&&r===-i||r>0&&r===1-i){let a=s;s=-o,o=a}r+=s,i+=o}return t}A();E();R();x();function Ei(n,e=0){if(e>16)return;if(n==null)return n;let t=typeof n;if(t==="function"||t==="symbol")return;if(t==="bigint")return n.toString();if(t!=="object"||n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n)){let s=n;return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}if(n instanceof Date)return n.toISOString();if(Array.isArray(n))return n.map(s=>Ei(s,e+1)).filter(s=>s!==void 0);let r=n;if(typeof r.x=="number"&&typeof r.y=="number"&&typeof r.z=="number"&&!("w"in r))return{x:r.x,y:r.y,z:r.z};let i={};for(let s of Object.keys(r)){if(s==="_client"||s==="_events"||s==="_eventsCount")continue;let o=Ei(r[s],e+1);o!==void 0&&(i[s]=o)}return i}function I5(n){return n.map(e=>Ei(e))}var Q0=n=>[Math.floor(n.x/16),Math.floor(n.z/16)],mv=n=>[Math.floor(n.x/16),Math.floor(n.y/16),Math.floor(n.z/16)],aa=async(n,e,t,r=1)=>{for(let i=0;i<n.length;i+=r)e&&await new Promise(s=>setTimeout(s,e)),await t(n[i],i)},Y0=new WeakMap,Mr=class Mr extends m0{static restoreTransferred(e,t){let r=new Mr;if(!t)return r;let i=Y0.get(t);if(i)i.activeWorldView=r;else{let s=({data:o})=>{let a=Y0.get(t)?.activeWorldView;!a||o?.class!==Mr.restorerName||o.type==="event"&&a.emit(o.eventName,...o.args)};t.addEventListener("message",s),i={activeWorldView:r,handler:s},Y0.set(t,i)}return r}static clearWorkerBridgeForTest(e){let t=Y0.get(e);t&&(e.removeEventListener("message",t.handler),Y0.delete(e))}static getWorkerBridgeListenerCountForTest(e){return Y0.has(e)?1:0}};d(Mr,"restorerName","WorldViewWorker");var g0=Mr,b0=class extends m0{constructor(t,r,i=new p0(0,0,0)){super();this.world=t;this.viewDistance=r;d(this,"spiralNumber",0);d(this,"gotPanicLastTime",!1);d(this,"panicChunksReload",()=>{});d(this,"loadedChunks",{});d(this,"inLoading",!1);d(this,"chunkReceiveTimes",[]);d(this,"lastChunkReceiveTime",0);d(this,"lastChunkReceiveTimeAvg",0);d(this,"panicTimeout");d(this,"lastPos");d(this,"eventListeners",{});d(this,"debugChunksInfo",{});d(this,"waitingSpiralChunksLoad",{});d(this,"addWaitTime",1);d(this,"keepChunksDistance",0);d(this,"isPlayground",!1);d(this,"allowPositionUpdate",!0);d(this,"lastBiomeId",null);d(this,"lastPosCheck",null);this.lastPos=new p0(0,0,0).update(i)}prepareForTransfer(t){if(t){let r=this.emit.bind(this);this.emit=(i,...s)=>{r(i,...s),t.postMessage({class:g0.restorerName,type:"event",eventName:i,args:I5(s)})}}return{__restorer:g0.restorerName}}setBlockStateId(t,r){let i=this.world.setBlockStateId(t,r);if(i&&typeof i.then=="function")throw new Error("setBlockStateId returned promise (not supported)");this.emit("blockUpdate",{pos:t,stateId:r})}updateViewDistance(t){this.viewDistance=t,this.emit("renderDistance",t)}async init(t,r){this.updateViewDistance(this.viewDistance),this.emit("chunkPosUpdate",{pos:t}),r?.time?.timeOfDay!==void 0&&this.emit("time",r.time.timeOfDay),r?.entity&&this.emit("playerEntity",r.entity),this.emitterGotConnected(r);let[i,s]=Q0(t),o=Tr(this.viewDistance).map(([l,a])=>new p0((i+l)*16,0,(s+a)*16));this.lastPos.update(t),await this._loadChunks(o,t)}chunkProgress(){if(this.panicTimeout&&clearTimeout(this.panicTimeout),this.chunkReceiveTimes.length>=5){let t=this.chunkReceiveTimes.reduce((i,s)=>i+s,0)/this.chunkReceiveTimes.length;this.lastChunkReceiveTimeAvg=t;let r=t*2+1e3;this.panicTimeout&&clearTimeout(this.panicTimeout),this.panicTimeout=setTimeout(()=>{!this.gotPanicLastTime&&this.inLoading&&(this.gotPanicLastTime=!0,this.panicChunksReload())},r)}}async _loadChunks(t,r){this.spiralNumber++;let{spiralNumber:i}=this;for(let o of Object.keys(this.waitingSpiralChunksLoad))this.waitingSpiralChunksLoad[o](!1),delete this.waitingSpiralChunksLoad[o];let s=!0;this.inLoading=!0,await aa(t,this.addWaitTime,async o=>{!s||this.loadedChunks[`${o.x},${o.z}`]||(this.world.getColumnAt(o)||(s=await new Promise(l=>{this.waitingSpiralChunksLoad[`${o.x},${o.z}`]=l})),s&&(await this.loadChunk(o,void 0,`spiral ${i} from ${r.x},${r.z}`),this.chunkProgress()))}),i===this.spiralNumber&&(this.panicTimeout&&clearTimeout(this.panicTimeout),this.inLoading=!1,this.gotPanicLastTime=!1,this.chunkReceiveTimes=[],this.lastChunkReceiveTime=0)}async loadChunk(t,r=!1,i="spiral"){var v,c;let[s,o]=Q0(this.lastPos),l=Math.abs(s-Math.floor(t.x/16)),a=Math.abs(o-Math.floor(t.z/16));if(l<=this.viewDistance&&a<=this.viewDistance){let u=await this.world.getColumnAt(t.y!==void 0?t:new p0(t.x,0,t.z));if(u){let h=u.toJson(),p={minY:u.minY??0,worldHeight:u.worldHeight??256};this.emit("loadChunk",{x:t.x,z:t.z,chunk:h,blockEntities:u.blockEntities,worldConfig:p,isLightUpdate:r}),this.loadedChunks[`${t.x},${t.z}`]=!0,(v=this.debugChunksInfo)[c=`${t.x},${t.z}`]??(v[c]={loads:[]}),this.debugChunksInfo[`${t.x},${t.z}`].loads.push({dataLength:h.length,reason:i,time:Date.now()})}else this.isPlayground&&this.emit("markAsLoaded",{x:t.x,z:t.z})}}async reloadLoadedChunks(){let t=Object.keys(this.loadedChunks);for(let r of t){let[i,s]=r.split(",").map(Number);await this.loadChunk({x:i,z:s},!1,"mesher-reconfigure")}}unloadAllChunks(){for(let t of Object.keys(this.loadedChunks)){let[r,i]=t.split(",").map(Number);this.unloadChunk({x:r,z:i})}}unloadChunk(t){this.emit("unloadChunk",{x:t.x,z:t.z}),delete this.loadedChunks[`${t.x},${t.z}`],delete this.debugChunksInfo[`${t.x},${t.z}`]}emitterGotConnected(t){typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope||!t||this.emit("blockEntities",new Proxy({},{get(i,s,o){if(typeof s!="string")return;let[l,a,v]=s.split(",").map(Number);return t.world.getBlock(new p0(l,a,v))?.entity}}))}updateBiome(t){try{if(!this.world.getBiome)return;let r=this.world.getBiome(t);r!==this.lastBiomeId&&(this.lastBiomeId=r,this.emit("biomeReset"))}catch{}}async updatePosition(t,r=!1){if(!this.allowPositionUpdate)return;let i=t.floored();if(!r&&this.lastPosCheck&&this.lastPosCheck.equals(i))return;this.lastPosCheck=i,this.updateBiome(t);let[s,o]=Q0(this.lastPos),[l,a]=Q0(t);if(s!==l||o!==a||r){this.emit("chunkPosUpdate",{pos:t});let v=[],c=r?this.viewDistance:this.viewDistance+this.keepChunksDistance;for(let h of Object.keys(this.loadedChunks)){let[p,m]=h.split(",").map(Number),b=new p0(p,0,m),[k,_]=Q0(b),y=Math.abs(l-k),M=Math.abs(a-_);(y>c||M>c)&&v.push(b)}for(let h of v)this.unloadChunk(h);let u=Tr(this.viewDistance).map(([h,p])=>{let m=new p0((l+h)*16,0,(a+p)*16);if(!this.loadedChunks[`${m.x},${m.z}`])return m}).filter(h=>!!h);this.lastPos.update(t),this._loadChunks(u,t)}else this.emit("chunkPosUpdate",{pos:t}),this.lastPos.update(t)}};A();E();R();x();A();E();R();x();import ga from"minecraft-data";import pv from"mc-assets/dist/blocksAtlases.json";import gv from"mc-assets/dist/itemsAtlases.json";import Bi from"mc-assets/dist/itemDefinitions.json";import bv from"mc-assets/dist/blocksAtlasLatest.png";import yv from"mc-assets/dist/blocksAtlasLegacy.png";import _v from"mc-assets/dist/itemsAtlasLatest.png";import wv from"mc-assets/dist/itemsAtlasLegacy.png";import Av from"mc-assets/dist/textureReplacements/christmas";import{AtlasParser as y0}from"mc-assets/dist/atlasParser";import fa from"mc-assets/dist/worldBlockProvider";A();E();R();x();var Ti=xr(la(),1);import*as O5 from"three";A();E();R();x();A();E();R();x();var H5=class{constructor(e,t,r){this.name=e,this.fg=t,this.bg=r,this.PR=Math.round(window.devicePixelRatio||1),this.WIDTH=90*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=84*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.canvas=document.createElement("canvas"),this.canvas.width=90*this.PR,this.canvas.height=48*this.PR,this.canvas.style.width="90px",this.canvas.style.position="absolute",this.canvas.style.height="48px",this.canvas.style.cssText="width:90px;height:48px",this.context=this.canvas.getContext("2d"),this.context&&(this.context.font="bold "+9*this.PR+"px Helvetica,Arial,sans-serif",this.context.textBaseline="top",this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y),this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT))}update(e,t,r,i,s=0){let o=1/0,l=0;this.context&&(o=Math.min(o,e),l=Math.max(r,e),i=Math.max(i,t),this.context.fillStyle=this.bg,this.context.globalAlpha=1,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(e.toFixed(s)+" "+this.name+" ("+o.toFixed(s)+"-"+parseFloat(l.toFixed(s))+")",this.TEXT_X,this.TEXT_Y),this.context.drawImage(this.canvas,this.GRAPH_X+this.PR,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT,this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT),this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,(1-t/i)*this.GRAPH_HEIGHT))}};var va=class L5{constructor({logsPerSecond:e=20,samplesLog:t=100,samplesGraph:r=10,precision:i=2,minimal:s=!1,horizontal:o=!0,mode:l=0}={}){this.mode=l,this.horizontal=o,this.container=document.createElement("div"),this.container.style.cssText="position:fixed;top:0;left:0;opacity:0.9;z-index:10000;",s&&(this.container.style.cssText+="cursor:pointer"),this.gl=null,this.query=null,this.minimal=s,this.beginTime=(performance||Date).now(),this.prevTime=this.beginTime,this.prevCpuTime=this.beginTime,this.frames=0,this.averageCpu={logs:[],graph:[]},this.averageGpu={logs:[],graph:[]},this.queryCreated=!1,this.fpsPanel=this.addPanel(new L5.Panel("FPS","#0ff","#002"),0),this.msPanel=this.addPanel(new L5.Panel("CPU","#0f0","#020"),1),this.gpuPanel=null,this.samplesLog=t,this.samplesGraph=r,this.precision=i,this.logsPerSecond=e,this.minimal?(this.container.addEventListener("click",a=>{a.preventDefault(),this.showPanel(++this.mode%this.container.children.length)},!1),this.mode=l,this.showPanel(this.mode)):window.addEventListener("resize",()=>{this.resizePanel(this.fpsPanel,0),this.resizePanel(this.msPanel,1),this.gpuPanel&&this.resizePanel(this.gpuPanel,2)})}resizePanel(e,t){e.canvas.style.position="absolute",this.minimal?e.canvas.style.display="none":(e.canvas.style.display="block",this.horizontal?(e.canvas.style.top="0px",e.canvas.style.left=t*e.WIDTH/e.PR+"px"):(e.canvas.style.left="0px",e.canvas.style.top=t*e.HEIGHT/e.PR+"px"))}addPanel(e,t){return e.canvas&&(this.container.appendChild(e.canvas),this.resizePanel(e,t)),e}showPanel(e){for(let t=0;t<this.container.children.length;t++){let r=this.container.children[t];r.style.display=t===e?"block":"none"}this.mode=e}init(e){if(e){if(e instanceof WebGL2RenderingContext)this.gl=e;else if(e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas){if(this.gl=e.getContext("webgl2"),!this.gl)return}else return;this.ext=this.gl.getExtension("EXT_disjoint_timer_query_webgl2"),this.ext&&(this.gpuPanel=this.addPanel(new L5.Panel("GPU","#ff0","#220"),2))}}begin(){if(this.beginProfiling("cpu-started"),!(!this.gl||!this.ext)){if(this.query){let e=this.gl.getQueryParameter(this.query,this.gl.QUERY_RESULT_AVAILABLE);if(this.disjoint=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT),e&&!this.disjoint){this.ns=this.gl.getQueryParameter(this.query,this.gl.QUERY_RESULT);let t=this.ns*1e-6;(e||this.disjoint)&&(this.gl.deleteQuery(this.query),this.query=null),e&&this.addToAverage(t,this.averageGpu)}}this.query||(this.queryCreated=!0,this.query=this.gl.createQuery(),this.query&&this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,this.query))}}end(){this.beginTime=this.endInternal(),this.endProfiling("cpu-started","cpu-finished","cpu-duration",this.averageCpu),!(!this.gl||!this.ext)&&this.queryCreated&&this.gl.getQuery(this.ext.TIME_ELAPSED_EXT,this.gl.CURRENT_QUERY)&&this.gl.endQuery(this.ext.TIME_ELAPSED_EXT)}endInternal(){this.frames++;let e=(performance||Date).now();if(e>=this.prevCpuTime+1e3/this.logsPerSecond&&(this.updatePanel(this.msPanel,this.averageCpu),this.updatePanel(this.gpuPanel,this.averageGpu),this.prevCpuTime=e),e>=this.prevTime+1e3){let t=this.frames*1e3/(e-this.prevTime);this.fpsPanel.update(t,t,100,100,0),this.prevTime=e,this.frames=0}return e}addToAverage(e,t){t.logs.push(e),t.logs.length>this.samplesLog&&t.logs.shift(),t.graph.push(e),t.graph.length>this.samplesGraph&&t.graph.shift()}beginProfiling(e){window.performance&&window.performance.mark(e)}endProfiling(e,t,r,i){if(window.performance&&t){window.performance.mark(t);let s=performance.measure(r,e,t);this.addToAverage(s.duration,i)}}updatePanel(e,t){if(t.logs.length>0){let r=0,i=.01;for(let l=0;l<t.logs.length;l++)r+=t.logs[l],t.logs[l]>i&&(i=t.logs[l]);let s=0,o=.01;for(let l=0;l<t.graph.length;l++)s+=t.graph[l],t.graph[l]>o&&(o=t.graph[l]);e&&e.update(r/Math.min(t.logs.length,this.samplesLog),s/Math.min(t.graph.length,this.samplesGraph),i,o,this.precision)}}};va.Panel=H5;var ca=va;A();E();R();x();var Fe=Object.freeze({Linear:Object.freeze({None:function(n){return n},In:function(n){return this.None(n)},Out:function(n){return this.None(n)},InOut:function(n){return this.None(n)}}),Quadratic:Object.freeze({In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}}),Cubic:Object.freeze({In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}}),Quartic:Object.freeze({In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}}),Quintic:Object.freeze({In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}}),Sinusoidal:Object.freeze({In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}}),Exponential:Object.freeze({In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}}),Circular:Object.freeze({In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}}),Elastic:Object.freeze({In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(n){var e=1.70158;return n===1?1:n*n*((e+1)*n-e)},Out:function(n){var e=1.70158;return n===0?0:--n*n*((e+1)*n+e)+1},InOut:function(n){var e=2.5949095;return(n*=2)<1?.5*(n*n*((e+1)*n-e)):.5*((n-=2)*n*((e+1)*n+e)+2)}}),Bounce:Object.freeze({In:function(n){return 1-Fe.Bounce.Out(1-n)},Out:function(n){return n<.36363636363636365?7.5625*n*n:n<.7272727272727273?7.5625*(n-=.5454545454545454)*n+.75:n<.9090909090909091?7.5625*(n-=.8181818181818182)*n+.9375:7.5625*(n-=.9545454545454546)*n+.984375},InOut:function(n){return n<.5?Fe.Bounce.In(n*2)*.5:Fe.Bounce.Out(n*2-1)*.5+.5}}),generatePow:function(n){return n===void 0&&(n=4),n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(e){return Math.pow(e,n)},Out:function(e){return 1-Math.pow(1-e,n)},InOut:function(e){return e<.5?Math.pow(e*2,n)/2:(1-Math.pow(2-e*2,n))/2+.5}}}}),Cr=function(){return performance.now()},q0=function(){function n(){this._tweens={},this._tweensAddedDuringUpdate={}}return n.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},n.prototype.removeAll=function(){this._tweens={}},n.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},n.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},n.prototype.update=function(e,t){e===void 0&&(e=Cr()),t===void 0&&(t=!1);var r=Object.keys(this._tweens);if(r.length===0)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<r.length;i++){var s=this._tweens[r[i]],o=!t;s&&s.update(e,o)===!1&&!t&&delete this._tweens[r[i]]}r=Object.keys(this._tweensAddedDuringUpdate)}return!0},n}(),K0={Linear:function(n,e){var t=n.length-1,r=t*e,i=Math.floor(r),s=K0.Utils.Linear;return e<0?s(n[0],n[1],r):e>1?s(n[t],n[t-1],t-r):s(n[i],n[i+1>t?t:i+1],r-i)},Bezier:function(n,e){for(var t=0,r=n.length-1,i=Math.pow,s=K0.Utils.Bernstein,o=0;o<=r;o++)t+=i(1-e,r-o)*i(e,o)*n[o]*s(r,o);return t},CatmullRom:function(n,e){var t=n.length-1,r=t*e,i=Math.floor(r),s=K0.Utils.CatmullRom;return n[0]===n[t]?(e<0&&(i=Math.floor(r=t*(1+e))),s(n[(i-1+t)%t],n[i],n[(i+1)%t],n[(i+2)%t],r-i)):e<0?n[0]-(s(n[0],n[0],n[1],n[1],-r)-n[0]):e>1?n[t]-(s(n[t],n[t],n[t-1],n[t-1],r-t)-n[t]):s(n[i?i-1:0],n[i],n[t<i+1?t:i+1],n[t<i+2?t:i+2],r-i)},Utils:{Linear:function(n,e,t){return(e-n)*t+n},Bernstein:function(n,e){var t=K0.Utils.Factorial;return t(n)/t(e)/t(n-e)},Factorial:function(){var n=[1];return function(e){var t=1;if(n[e])return n[e];for(var r=e;r>1;r--)t*=r;return n[e]=t,t}}(),CatmullRom:function(n,e,t,r,i){var s=(t-n)*.5,o=(r-e)*.5,l=i*i,a=i*l;return(2*e-2*t+s+o)*a+(-3*e+3*t-2*s-o)*l+s*i+e}}},da=function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n}(),ki=new q0,Ge=function(){function n(e,t){t===void 0&&(t=ki),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Fe.Linear.None,this._interpolationFunction=K0.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=da.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return n.prototype.getId=function(){return this._id},n.prototype.isPlaying=function(){return this._isPlaying},n.prototype.isPaused=function(){return this._isPaused},n.prototype.to=function(e,t){if(t===void 0&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t,this},n.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e,this},n.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},n.prototype.start=function(e,t){if(e===void 0&&(e=Cr()),t===void 0&&(t=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var r in this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var s in this._valuesEnd)i[s]=this._valuesEnd[s];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},n.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},n.prototype._setupProperties=function(e,t,r,i,s){for(var o in r){var l=e[o],a=Array.isArray(l),v=a?"array":typeof l,c=!a&&Array.isArray(r[o]);if(!(v==="undefined"||v==="function")){if(c){var u=r[o];if(u.length===0)continue;for(var h=[l],p=0,m=u.length;p<m;p+=1){var b=this._handleRelativeValue(l,u[p]);if(isNaN(b)){c=!1;break}h.push(b)}c&&(r[o]=h)}if((v==="object"||a)&&l&&!c){t[o]=a?[]:{};var k=l;for(var _ in k)t[o][_]=k[_];i[o]=a?[]:{};var u=r[o];if(!this._isDynamic){var y={};for(var _ in u)y[_]=u[_];r[o]=u=y}this._setupProperties(k,t[o],u,i[o],s)}else(typeof t[o]>"u"||s)&&(t[o]=l),a||(t[o]*=1),c?i[o]=r[o].slice().reverse():i[o]=t[o]||0}}},n.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},n.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},n.prototype.pause=function(e){return e===void 0&&(e=Cr()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this),this)},n.prototype.resume=function(e){return e===void 0&&(e=Cr()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},n.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},n.prototype.group=function(e){return e===void 0&&(e=ki),this._group=e,this},n.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},n.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},n.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},n.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},n.prototype.easing=function(e){return e===void 0&&(e=Fe.Linear.None),this._easingFunction=e,this},n.prototype.interpolation=function(e){return e===void 0&&(e=K0.Linear),this._interpolationFunction=e,this},n.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},n.prototype.onStart=function(e){return this._onStartCallback=e,this},n.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},n.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},n.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},n.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},n.prototype.onStop=function(e){return this._onStopCallback=e,this},n.prototype.update=function(e,t){if(e===void 0&&(e=Cr()),t===void 0&&(t=!0),this._isPaused)return!0;var r,i,s=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>s)return!1;t&&this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),i=(e-this._startTime)/this._duration,i=this._duration===0||i>1?1:i;var o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var l=0,a=this._chainedTweens.length;l<a;l++)this._chainedTweens[l].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},n.prototype._updateProperties=function(e,t,r,i){for(var s in r)if(t[s]!==void 0){var o=t[s]||0,l=r[s],a=Array.isArray(e[s]),v=Array.isArray(l),c=!a&&v;c?e[s]=this._interpolationFunction(l,i):typeof l=="object"&&l?this._updateProperties(e[s],o,l,i):(l=this._handleRelativeValue(o,l),typeof l=="number"&&(e[s]=o+(l-o)*i))}},n.prototype._handleRelativeValue=function(e,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?e+parseFloat(t):parseFloat(t)},n.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=t},n}();var um=da.nextId,Mt=ki,hm=Mt.getAll.bind(Mt),fm=Mt.removeAll.bind(Mt),mm=Mt.add.bind(Mt),pm=Mt.remove.bind(Mt),ua=Mt.update.bind(Mt);A();E();R();x();function Si(n){if(n==="high-performance")return"high-performance";if(n==="low-power")return"low-power"}var de=typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope,Mi=class{constructor(e,t=0){this.canvas=e;d(this,"stats");d(this,"stats2");d(this,"statsGl");d(this,"total",0);d(this,"denseMode");this.stats=new Ti.default,this.stats2=new Ti.default,this.statsGl=new ca({minimal:!0}),this.stats2.showPanel(2),this.denseMode=typeof L<"u"&&!0||typeof window<"u"&&window.innerHeight<500,this.initStats(),this.setVisibility(t)}addStat(e,t=80){e.style.position="absolute",this.denseMode&&(e.style.height="12px"),e.style.overflow="hidden",e.style.left="",e.style.top="0",e.style.right=`${this.total}px`,e.style.width="80px",e.style.zIndex="1",e.style.opacity="0.8";let r=document.getElementById("corner-indicator-stats"),i=r??document.body;r&&(e.style.position="relative"),i.appendChild(e),this.total+=t}initStats(){let e=this.stats2.dom.children.length===3;this.addStat(this.stats.dom),e&&this.addStat(this.stats2.dom),this.statsGl.init(this.canvas),this.statsGl.container.style.display="flex",this.statsGl.container.style.justifyContent="flex-end";let t=0;for(let r of this.statsGl.container.children){let i=r;t++===0&&(i.style.display="none"),i.style.position=""}}setVisibility(e){e>0?(this.stats.dom.style.display="block",this.stats2.dom.style.display=e>=2?"block":"none",this.statsGl.container.style.display=e>=2?"block":"none"):(this.stats.dom.style.display="none",this.stats2.dom.style.display="none",this.statsGl.container.style.display="none")}markStart(){this.stats.begin(),this.stats2.begin(),this.statsGl.begin()}markEnd(){this.stats.end(),this.stats2.end(),this.statsGl.end()}dispose(){this.stats.dom.remove(),this.stats2.dom.remove(),this.statsGl.container.remove()}},Br=class{constructor(e,t,r){this.initOptions=e;this.externalCanvas=t;d(this,"canvas");d(this,"renderer");d(this,"animationFrameId");d(this,"timeoutId");d(this,"lastRenderTime",0);d(this,"previousCanvasWidth",0);d(this,"previousCanvasHeight",0);d(this,"currentWidth",0);d(this,"currentHeight",0);d(this,"pendingResize",!1);d(this,"renderedFps",0);d(this,"fpsInterval");d(this,"stats");d(this,"paused",!1);d(this,"disconnected",!1);d(this,"preRender",()=>{});d(this,"render",e=>{});d(this,"postRender",()=>{});d(this,"sizeChanged",()=>{});d(this,"droppedFpsPercentage",0);d(this,"config");d(this,"onRender",[]);d(this,"inWorldRenderingConfig");d(this,"nonReactiveState");this.config=e.config,t?this.canvas=t:this.addToPage();try{let s=e.getRendererOptions?.()?.gpuPreference??"default";this.renderer=new O5.WebGLRenderer({canvas:this.canvas,preserveDrawingBuffer:!0,logarithmicDepthBuffer:!0,powerPreference:Si(s)})}catch(s){throw e.callbacks.displayCriticalError(new Error(`Failed to create WebGL context, not possible to render (restart browser): ${s.message}`)),s}this.renderer.outputColorSpace=O5.LinearSRGBColorSpace,t||(this.updatePixelRatio(),this.setupResizeListener()),this.sizeUpdated(),this.previousCanvasWidth=this.canvas.width,this.previousCanvasHeight=this.canvas.height;let i="WebGL2RenderingContext"in globalThis;!t&&i&&!de&&(this.stats=new Mi(this.canvas,this.config.statsVisible)),this.setupFpsTracking(),this.startRenderLoop()}setupResizeListener(){if(typeof window>"u")return;let e,t=()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.pendingResize=!0},16)};window.addEventListener("resize",t,{passive:!0})}updatePixelRatio(){if(typeof window>"u")return;let e=window.devicePixelRatio||1;this.renderer.capabilities.isWebGL2||(e=1),this.renderer.setPixelRatio(e)}sizeUpdated(){this.renderer.setSize(this.currentWidth,this.currentHeight,!1)}addToPage(){this.canvas=ha(),this.updateCanvasSize()}updateSizeExternal(e,t,r){this.currentWidth=e,this.currentHeight=t,this.renderer.setPixelRatio(r),this.sizeUpdated()}updateCanvasSize(){if(this.externalCanvas||typeof document>"u")return;let e=document.body.offsetWidth,t=document.body.offsetHeight;this.currentWidth!==e&&(this.currentWidth=e),this.currentHeight!==t&&(this.currentHeight=t)}setupFpsTracking(){let e=0;this.fpsInterval=setInterval(()=>{e>0&&(this.droppedFpsPercentage=this.renderedFps/e),e=Math.max(this.renderedFps,e),this.nonReactiveState&&(this.nonReactiveState.fps=this.renderedFps),this.renderedFps=0},1e3)}startRenderLoop(){let e=()=>{if(this.disconnected)return;if(this.config.timeoutRendering){let i=1e3/(this.config.fpsLimit?Math.min(this.config.fpsLimit,60):60);this.timeoutId=setTimeout(e,i)}else this.animationFrameId=requestAnimationFrame(e);if(this.paused||this.renderer.xr.isPresenting&&!this.inWorldRenderingConfig?.vrPageGameRendering)return;if(!this.config.timeoutRendering&&this.config.fpsLimit){let r=performance.now(),i=r-this.lastRenderTime,s=1e3/this.config.fpsLimit;if(i<s)return;this.lastRenderTime=r-i%s}let t=!1;this.pendingResize&&(this.updateCanvasSize(),this.pendingResize=!1),(this.previousCanvasWidth!==this.currentWidth||this.previousCanvasHeight!==this.currentHeight)&&(this.previousCanvasWidth=this.currentWidth,this.previousCanvasHeight=this.currentHeight,this.sizeUpdated(),t=!0),this.frameRender(t),this.config.statsVisible!==void 0&&this.stats?.setVisibility(this.config.statsVisible)};e()}frameRender(e){this.preRender(),this.stats?.markStart(),ua(),globalThis.freezeRender||this.render(e);for(let t of this.onRender)t(e);this.renderedFps++,this.stats?.markEnd(),this.postRender()}setPaused(e){this.paused=e}dispose(){this.disconnected=!0,this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.timeoutId&&clearTimeout(this.timeoutId),this.canvas instanceof HTMLCanvasElement&&this.canvas.remove(),clearInterval(this.fpsInterval),this.stats?.dispose(),this.renderer.dispose()}};function ha(){let n=document.createElement("canvas");return n.id="viewer-canvas",document.body.appendChild(n),n}var Ci=()=>{let n=ha(),e=n.transferControlToOffscreen(),t=!1,r=(o,l)=>{},i={width:0,height:0},s=()=>{t||((i.width!==window.innerWidth||i.height!==window.innerHeight)&&(r(window.innerWidth,window.innerHeight),i={width:window.innerWidth,height:window.innerHeight}),requestAnimationFrame(s))};return requestAnimationFrame(s),{canvas:e,destroy(){t=!0,n.remove()},onSizeChanged(o){r=o},get size(){return{width:window.innerWidth,height:window.innerHeight}}}};import{ItemsRenderer as ma}from"mc-assets/dist/itemsRenderer";import{getLoadedItemDefinitionsStore as Pi}from"mc-assets/dist/stores";var D5=null;function ba(n){return de?((!D5||typeof D5.get!="function")&&(D5=Pi(Bi)),D5):(ya(n),n.itemsDefinitionsStore)}function ya(n){de||typeof n.itemsDefinitionsStore?.get=="function"||(n.itemsDefinitionsStore=Pi(n.sourceItemDefinitionsJson??Bi))}var J0=class{constructor(e){d(this,"sourceItemDefinitionsJson",Bi);d(this,"itemsDefinitionsStore",Pi(this.sourceItemDefinitionsJson));d(this,"allReady",!1);d(this,"itemsAtlasImage");d(this,"blocksAtlasImage");d(this,"blocksAtlasJson");d(this,"itemsAtlasJson");d(this,"customBlockStates");d(this,"customModels");d(this,"customItemModelNames",{});d(this,"customTextures",{});d(this,"guiAtlas",null);d(this,"guiAtlasVersion",0);d(this,"itemsRenderer");d(this,"worldBlockProvider");d(this,"blockstatesModels",null);d(this,"version");d(this,"texturesVersion");d(this,"mcData");if(e){let t={...e};delete t.itemsDefinitionsStore,delete t.sourceItemDefinitionsJson,Object.assign(this,t),ya(this)}if(this.version){let t=globalThis.loadedData??globalThis.mcData;de&&t?.entitiesByName?this.mcData=t:this.mcData=ga(this.version)}}prepareForTransfer(){let e={};for(let t in this)Object.prototype.hasOwnProperty.call(this,t)&&typeof this[t]!="function"&&(t==="itemsRenderer"||t==="worldBlockProvider"||t==="mcData"||t==="itemsDefinitionsStore"||t==="sourceItemDefinitionsJson"||(e[t]=this[t]));return e.customTextures={},delete e.itemsDefinitionsStore,delete e.sourceItemDefinitionsJson,e}},pa="1.21.4",Kt=class Kt extends m0{constructor(){super(...arguments);d(this,"sourceBlockStatesModels",null);d(this,"sourceBlocksAtlases",pv);d(this,"sourceItemsAtlases",gv);d(this,"currentResources");d(this,"itemsAtlasParser");d(this,"blocksAtlasParser");d(this,"currentConfig");d(this,"abortController",new AbortController);d(this,"_promiseAssetsReadyResolvers",Promise.withResolvers())}rebuildWorkerRenderers(t){if(de&&!(!t.version||!t.blockstatesModels||!t.blocksAtlasJson)){if(this.blocksAtlasParser=new y0({latest:t.blocksAtlasJson},""),t.itemsAtlasJson)this.itemsAtlasParser=new y0({latest:t.itemsAtlasJson},"");else if(!this.itemsAtlasParser?.atlas?.latest){if(!this.sourceItemsAtlases||Object.keys(this.sourceItemsAtlases).length===0)return;this.itemsAtlasParser=new y0(this.sourceItemsAtlases,"")}t.itemsRenderer=new ma(t.version,t.blockstatesModels,this.itemsAtlasParser,this.blocksAtlasParser),t.worldBlockProvider=fa(t.blockstatesModels,this.blocksAtlasParser.atlas,pa)}}static restoreTransferred(t,r){let i=new Kt,s=o=>{i.currentResources=new J0(o),i.rebuildWorkerRenderers(i.currentResources)};return s(t.currentResources),r&&r.addEventListener("message",({data:o})=>{o.class===Kt.restorerName&&(o.type==="newResources"&&s(o.currentResources),o.type==="event"&&i.emit(o.eventName,...o.args))}),i}enrichTransferSnapshot(t){return t&&(this.itemsAtlasParser?.atlas?.latest&&(t.itemsAtlasJson=this.itemsAtlasParser.atlas.latest),this.blocksAtlasParser?.atlas?.latest&&(t.blocksAtlasJson=this.blocksAtlasParser.atlas.latest),t)}prepareForTransfer(t){if(t){let r=this.emit.bind(this);this.emit=(i,...s)=>{if(r(i,...s),t.postMessage({class:Kt.restorerName,type:"event",eventName:i,args:I5(s)}),i==="assetsTexturesUpdated"||i==="assetsInventoryReady"){let o=this.enrichTransferSnapshot(this.currentResources?.prepareForTransfer());t.postMessage({class:Kt.restorerName,type:"newResources",currentResources:o})}}}return{__restorer:Kt.restorerName,currentResources:this.enrichTransferSnapshot(this.currentResources?.prepareForTransfer())}}get promiseAssetsReady(){return this._promiseAssetsReadyResolvers.promise}async loadSourceData(t=this.currentConfig?.version){if(!t)throw new Error("No version loaded");this.sourceBlockStatesModels??(this.sourceBlockStatesModels=(await import("mc-assets/dist/blockStatesModels.json")).default)}resetResources(){this.currentResources=new J0}async updateAssetsData(t,r=!1){if(!this.currentConfig)throw new Error("No config loaded");this._promiseAssetsReadyResolvers=Promise.withResolvers();let i=new AbortController;if(await this.loadSourceData(this.currentConfig.version),i.signal.aborted)return;let s=this.currentResources??new J0;s.version=this.currentConfig.version,s.texturesVersion=this.currentConfig.texturesVersion??s.version,s.mcData=ga(s.version),s.blockstatesModels={blockstates:{},models:{}},s.blockstatesModels.blockstates.latest={...this.sourceBlockStatesModels.blockstates.latest,...s.customBlockStates},s.blockstatesModels.models.latest={...this.sourceBlockStatesModels.models.latest,...s.customModels},await Promise.all([this.recreateBlockAtlas(s),this.recreateItemsAtlas(s)]),!i.signal.aborted&&(s.version&&s.blockstatesModels&&this.itemsAtlasParser&&this.blocksAtlasParser&&(s.itemsRenderer=new ma(s.version,s.blockstatesModels,this.itemsAtlasParser,this.blocksAtlasParser)),!i.signal.aborted&&(this.currentResources=s,s.allReady=!0,r||this.emit("assetsTexturesUpdated"),this.currentConfig.noInventoryGui?this._promiseAssetsReadyResolvers.resolve():(this.emit("assetsInventoryStarted"),this.generateGuiTextures().then(()=>{i.signal.aborted||(r||this.emit("assetsInventoryReady"),this._promiseAssetsReadyResolvers.resolve())}))))}async recreateBlockAtlas(t=this.currentResources){let r={},i=new Date;(i.getMonth()===11&&i.getDate()>=24||i.getMonth()===0&&i.getDate()<=6)&&Object.assign(r,Av);let s=new y0(this.sourceBlocksAtlases,bv,yv),o=Object.keys(t.customTextures.blocks?.textures??{}),{atlas:l,canvas:a}=await s.makeNewAtlas(t.texturesVersion,v=>{if(this.currentConfig.includeOnlyBlocks&&!this.currentConfig.includeOnlyBlocks.includes(v))return!1;let c=t.customTextures.blocks?.textures[v];return r[v]??c},void 0,void 0,o,{needHorizontalIndexes:!!this.currentConfig.includeOnlyBlocks});this.blocksAtlasParser=new y0({latest:l},a.toDataURL()),t.blocksAtlasImage=await createImageBitmap(a),t.blocksAtlasJson=this.blocksAtlasParser.atlas.latest,t.worldBlockProvider=fa(t.blockstatesModels,this.blocksAtlasParser.atlas,pa)}async recreateItemsAtlas(t=this.currentResources){let r=new y0(this.sourceItemsAtlases,_v,wv),i=Object.keys(t.customTextures.items?.textures??{}),{atlas:s,canvas:o}=await r.makeNewAtlas(t.texturesVersion,l=>{let a=t.customTextures.items?.textures[l];if(a)return a},t.customTextures.items?.tileSize,void 0,i);this.itemsAtlasParser=new y0({latest:s},o.toDataURL()),t.itemsAtlasImage=await createImageBitmap(o),t.itemsAtlasJson=this.itemsAtlasParser.atlas.latest}async generateGuiTextures(){}async downloadDebugAtlas(t=!1){if(!this.currentResources)throw new Error("No resources loaded");let s=await(t?this.itemsAtlasParser:this.blocksAtlasParser).createDebugImage(!0),o=document.createElement("a");o.href=s,o.download=`atlas-debug-${t?"items":"blocks"}.png`,o.click()}destroy(){this.abortController.abort(),this.currentResources=void 0,this.abortController=new AbortController}};d(Kt,"restorerName","ResourcesManager");var Rt=Kt;A();E();R();x();var bt=class extends Error{constructor(t,r){super(t);d(this,"failure");this.name="MesherWorkerPreloadError",this.failure=r}};function Ev(n){return!n||typeof n!="object"?!1:n.type==="mc-web-pong"?!0:Array.isArray(n)?n.some(e=>e&&typeof e=="object"&&e.type==="mc-web-pong"):!1}var xv=45e3,Rv=1e4;async function _a(n){if(L.env.SINGLE_FILE_BUILD)return;let e=n?.fetchTimeoutMs??xv,t=n?.pingTimeoutMs??Rv,r=n?.script??"mesher.js",i=new URL(r,document.baseURI).href,s;try{let u=new AbortController,h=window.setTimeout(()=>u.abort(),e);try{s=await fetch(i,{credentials:"same-origin",cache:"force-cache",signal:u.signal})}finally{clearTimeout(h)}}catch(u){let h=u;throw h?.name==="AbortError"?new bt(`Mesher script fetch timed out after ${e}ms (${i}).`,{phase:"fetch",code:"timeout"}):new bt(`Mesher script fetch failed (network): ${h?.message??u}. URL: ${i}`,{phase:"fetch",code:"network",detail:String(h?.message??u)})}if(!s.ok)throw new bt(`Mesher script HTTP ${s.status} ${s.statusText}: ${i}`,{phase:"fetch",code:"bad-status",status:s.status});let o=s.headers.get("content-type")??"",l=await s.arrayBuffer();if(l.byteLength===0)throw new bt(`Mesher script response was empty: ${i}`,{phase:"fetch",code:"invalid-body",hint:"empty"});let a=Math.min(1024,l.byteLength),v=new TextDecoder().decode(l.slice(0,a)).trimStart();if(v.startsWith("<!DOCTYPE")||v.startsWith("<html")||v.startsWith("<HTML"))throw new bt(`Mesher URL returned HTML (wrong path, redirect, or SPA fallback), not JavaScript: ${i}`,{phase:"fetch",code:"invalid-body",hint:"html"});o.length>0&&/javascript|ecmascript/i.test(o);let c;try{c=new Worker(i)}catch(u){let h=u instanceof Error?u.message:String(u);throw new bt(`Could not construct Worker for mesher (${i}): ${h}`,{phase:"worker",code:"construct-failed",message:h})}await new Promise((u,h)=>{let p=!1,m=window.setTimeout(()=>{p||(p=!0,b(),h(new bt(`Mesher worker did not reply with mc-web-pong within ${t}ms (wrong script, SW stale cache, worker blocked, or COEP/CORP). URL: ${i}`,{phase:"ping",code:"timeout"})))},t),b=()=>{clearTimeout(m);let S=c;c=void 0,S&&(S.removeEventListener("message",y),S.removeEventListener("error",M),S.removeEventListener("messageerror",T),S.terminate())},k=()=>{p||(p=!0,b(),u())},_=S=>{p||(p=!0,b(),h(S))};function y(S){Ev(S.data)&&k()}function M(S){_(new bt(`Mesher worker script failed to load or threw during startup: ${S.message||"unknown"} @ ${i}`,{phase:"worker",code:"script-error",message:S.message}))}function T(){_(new bt(`Mesher worker message channel error (structured clone / deserialization). URL: ${i}`,{phase:"ping",code:"messageerror"}))}c.addEventListener("message",y),c.addEventListener("error",M),c.addEventListener("messageerror",T);try{c.postMessage({type:"mc-web-ping",t:performance.now(),workerIndex:0})}catch(S){let B=S instanceof Error?S.message:String(S);_(new bt(`Failed to post mc-web-ping to mesher worker: ${B}`,{phase:"ping",code:"post-failed",detail:B}))}})}var Aa=class{constructor(e={},t=new Rt){this.resourcesManager=t;d(this,"waitBackendLoadPromises",[]);d(this,"onWorldStart");d(this,"onBeforeWorldStart");d(this,"worldView");d(this,"config");d(this,"menuBackgroundOptions");d(this,"inWorldRenderingConfig");d(this,"backend");d(this,"backendLoader");d(this,"currentState");d(this,"currentDisplay",null);d(this,"playerState",{reactive:Ai()});d(this,"rendererState");d(this,"nonReactiveState");d(this,"worldReady");d(this,"resolveWorldReady");d(this,"lastCamUpdate",0);d(this,"getRendererOptions");this.config={...na,...e.config},this.menuBackgroundOptions={...e.config?.menuBackground,...e.menuBackground},this.inWorldRenderingConfig=wa({...Sr,...e.rendererConfig});let r=f0();this.rendererState=r.reactive,this.nonReactiveState=r.nonReactive,this.initWorldReadyPromise()}initWorldReadyPromise(){let{promise:e,resolve:t}=Promise.withResolvers();this.worldReady=e,this.resolveWorldReady=t}preloadWorkers(){let e=this.inWorldRenderingConfig.wasmMesher?"mesherWasm.js":"mesher.js";return _a({script:e})}bindRendererOptions(e){this.getRendererOptions=e}async loadBackend(e){this.backend&&this.disconnectBackend(),await Promise.all(this.waitBackendLoadPromises),this.waitBackendLoadPromises=[],this.backendLoader=e;let t={config:this.config,getRendererOptions:this.getRendererOptions,callbacks:{displayCriticalError:i=>{},setRendererSpecificSettings:(i,s)=>{},fireCustomEvent:(i,...s)=>{}},rendererSpecificSettings:{}},r=e(t);if(this.backend=await Promise.resolve(r),this.currentState)if(this.currentState.method==="startMenuBackground")this.startMenuBackground(...this.currentState.args);else{let{method:i,args:s}=this.currentState;this.backend[i](...s)}}async startWorld(e,t,r=this.playerState.reactive,i){if(this.currentDisplay==="world")throw new Error("World already started");this.currentDisplay="world";let s=i??new kv(0,64,0);this.worldView=new b0(e,t,s),this.worldView.isPlayground=this.inWorldRenderingConfig.isPlayground;let o={version:this.resourcesManager?.currentConfig?.version??"1.20.4",worldView:this.worldView,inWorldRenderingConfig:this.inWorldRenderingConfig,playerStateReactive:r,rendererState:this.rendererState,nonReactiveState:this.nonReactiveState,resourcesManager:this.resourcesManager};this.onBeforeWorldStart?.();let l;if(this.backend){let a=this.backend.startWorld(o);a&&typeof a.then=="function"&&(l=a)}return this.currentState={method:"startWorld",args:[o]},await l,this.resolveWorldReady(),this.onWorldStart?.(),!!l}startMenuBackground(e){if(this.currentDisplay==="menu")return;let t={...this.menuBackgroundOptions,...e,resourcesManager:e?.resourcesManager??this.resourcesManager};this.backend&&(this.currentDisplay="menu",this.backend.startMenuBackground(t)),this.currentState={method:"startMenuBackground",args:[t]}}resetBackend(e=!1){this.disconnectBackend(e),this.backendLoader&&this.loadBackend(this.backendLoader)}disconnectBackend(e=!1){e&&(this.currentState=void 0,this.currentDisplay=null,this.worldView=void 0),this.backend&&(this.backend.disconnect(),this.backend=void 0),this.currentDisplay=null,this.initWorldReadyPromise(),this.rendererState=wa(f0().reactive),this.nonReactiveState=f0().nonReactive}updateCamera(e,t,r,i){this.backend?.updateCamera(e,t,r,i)}setRendering(e){this.backend?.setRendering(e)}async startWithBot(e,t){await this.startWorld(e.world,t),this.worldView&&typeof this.worldView.listenToBot=="function"&&this.worldView.listenToBot(e)}destroyAll(){this.disconnectBackend(!0),this.resourcesManager&&typeof this.resourcesManager.destroy=="function"&&this.resourcesManager.destroy()}get utils(){let e=this.backend;return{async waitingForChunks(){if(!e?.worldState?.allChunksLoaded)return new Promise(t=>{let r=setInterval(()=>{e?.worldState?.allChunksLoaded&&(clearInterval(r),t())},100)})}}}destroy(){this.disconnectBackend(!0)}};A();E();R();x();import{subscribe as Dv}from"valtio/vanilla";A();E();R();x();A();E();R();x();var _0=["galaxy","nether","end","cyber","light"],w0=["cruise","barrel","dive","orbit","snake"],Pr={galaxy:"Galaxy",nether:"Nether",end:"The End",cyber:"Cyber",light:"Light Space"},Ir={cruise:"Cruise",barrel:"Barrel",dive:"Dive",orbit:"Orbit",snake:"Snake"},A0=["mixed","stainedGlass","wool","construction","glow","world"],Hr={mixed:"Mixed",stainedGlass:"Stained glass",wool:"Wool",construction:"Construction",glow:"Glow",world:"World (grass & ores)"};A();E();R();x();var Ct={mode:"v2",minecraftTextures:!0,v2Scene:"light",v2Camera:"dive",v2BlockGroup:"stainedGlass",v2CameraSpeedPercent:80,v2BlockSpeedPercent:40},Ot=n=>n/100,Lr={camera:Ot(Ct.v2CameraSpeedPercent),block:Ot(Ct.v2BlockSpeedPercent)};var Sv={off:0,holes:1,texIndex:2,faces:3,atlasAlpha:4};function Ii(n){return Sv[n]}var E0=Ct,Ea={rendererWorldPerformance:"normal",rendererMeshersCountOverride:null,starfieldRendering:!0,defaultSkybox:!0,menuBackgroundMode:E0.mode,menuBackgroundMinecraftTextures:E0.minecraftTextures,menuBackgroundV2Scene:E0.v2Scene,menuBackgroundV2Camera:E0.v2Camera,menuBackgroundV2BlockGroup:E0.v2BlockGroup,menuBackgroundV2CameraSpeed:E0.v2CameraSpeedPercent,menuBackgroundV2BlockSpeed:E0.v2BlockSpeedPercent,rendererFuturisticReveal:!1,rendererPerfDebugOverlay:!1,disableBlockEntityTextures:!1,rendererMesher:"wasm",rendererShaderCubeDebugMode:"off",showChunkBorders:!1,renderEntities:!0,renderDebug:"basic",frameLimit:!1,backgroundRendering:"20fps",vanillaLook:!1,smoothLighting:!0,newVersionsLighting:!1,vrSupport:!0,vrPageGameRendering:!1,clipWorldBelowY:void 0,highlightBlockColor:"auto",loadPlayerSkins:!0,renderEars:!0,showHand:!0,viewBobbing:!0,dayCycleAndLighting:!0,keepChunksDistance:1,gpuPreference:"default",fov:75};function Tv(n){n.highPerformanceGpu&&(n.gpuPreference="high-performance",delete n.highPerformanceGpu),n.rendererMesher!=="wasm"&&n.rendererMesher!=="legacy-js"&&(typeof n.rendererWasmMesher=="boolean"?n.rendererMesher=n.rendererWasmMesher?"wasm":"legacy-js":typeof n.wasmExperimentalMesher=="boolean"&&(n.rendererMesher=n.wasmExperimentalMesher?"wasm":"legacy-js")),delete n.wasmExperimentalMesher,delete n.rendererWasmMesher,delete n.rendererShaderCubeBlocks,n.menuBackgroundMode==="futuristic"&&(n.menuBackgroundMode="v2");let e=[["menuBackgroundFuturisticScene","menuBackgroundV2Scene"],["menuBackgroundFuturisticCamera","menuBackgroundV2Camera"],["menuBackgroundFuturisticBlockGroup","menuBackgroundV2BlockGroup"],["menuBackgroundFuturisticCameraSpeed","menuBackgroundV2CameraSpeed"],["menuBackgroundFuturisticBlockSpeed","menuBackgroundV2BlockSpeed"]];for(let[t,r]of e)n[t]!==void 0&&n[r]===void 0&&(n[r]=n[t]),delete n[t]}var xa={menuBackgroundMode:{possibleValues:[["classic","Classic"],["v2","V2"]],requiresRestart:!0},menuBackgroundMinecraftTextures:{text:"Minecraft block textures",tooltip:"Use block atlas on V2 menu cubes (loads assets on menu)"},menuBackgroundV2Scene:{possibleValues:_0.map(n=>[n,Pr[n]])},menuBackgroundV2Camera:{possibleValues:w0.map(n=>[n,Ir[n]])},menuBackgroundV2BlockGroup:{possibleValues:A0.map(n=>[n,Hr[n]]),text:"Block pool",tooltip:"Block set for textured menu cubes (requires Minecraft textures)"},menuBackgroundV2CameraSpeed:{text:"Camera speed",tooltip:"Orbit / fly-through camera path speed. 0 freezes the path; mouse parallax still works.",min:0,max:200,unit:"%"},menuBackgroundV2BlockSpeed:{text:"Block speed",tooltip:"Floating blocks and sky rotation. Independent of camera path speed.",min:0,max:200,unit:"%"},rendererWorldPerformance:{text:"World performance",tooltip:"Background workers for chunk geometry. Recreates mesher workers and reloads chunks.",requiresChunksReload:!0,possibleValues:[["low-energy","Low Energy"],["normal","Normal"],["maximum","Maximum"]]},starfieldRendering:{text:"Starfield"},defaultSkybox:{text:"Default skybox"},rendererFuturisticReveal:{text:"Futuristic world reveal"},rendererPerfDebugOverlay:{text:"Performance debug overlay"},disableBlockEntityTextures:{text:"Disable block entity textures",tooltip:"Skips signs, banners, heads, maps, etc."},rendererMesher:{possibleValues:[["wasm","WASM"],["legacy-js","Legacy JS"]],text:"Mesher pipeline",tooltip:"Browser technology for processing world geometry before render. WASM is the fastest; if you see a dead tab icon, reloads, or other errors, switch to Legacy JS.",requiresChunksReload:!0},rendererShaderCubeDebugMode:{text:"Shader cube debug",tooltip:"Instanced cube path visualization (requires shader cubes enabled).",possibleValues:[["off","Off"],["holes","Hole test (red)"],["texIndex","Tile index colors"],["faces","Face id colors"],["atlasAlpha","Atlas alpha"]]},showChunkBorders:{text:"Chunk borders"},renderEntities:{text:"Render entities"},renderDebug:{possibleValues:["advanced","basic","none"]},frameLimit:{text:"Frame limit",tooltip:"false = VSync / unlimited when focused"},backgroundRendering:{text:"Background FPS limit",possibleValues:[["full","NO"],["5fps","5 FPS"],["20fps","20 FPS"]]},vanillaLook:{text:"Vanilla shading",tooltip:"On: Minecraft-style face shading. Off: higher-contrast client shading."},smoothLighting:{},newVersionsLighting:{text:"Lighting in newer versions"},vrSupport:{text:"VR support",tooltip:"Shows VR entry; does not force VR on."},vrPageGameRendering:{text:"VR page game rendering"},clipWorldBelowY:{text:"Clip world below Y"},highlightBlockColor:{possibleValues:[["auto","Auto"],["blue","Blue"],["classic","Classic"]]},loadPlayerSkins:{},renderEars:{tooltip:"Deadmau5 ears when the skin texture includes them"},showHand:{},viewBobbing:{},dayCycleAndLighting:{text:"Day cycle"},keepChunksDistance:{text:"Keep chunks distance",tooltip:"Extra distance before unloading chunks",max:5,unit:""},fov:{min:30,max:110,unit:"\xB0",text:"FOV"},gpuPreference:{text:"GPU preference",tooltip:"WebGL power preference. Requires reload / backend restart to apply.",requiresRestart:!0,possibleValues:[["default","Auto"],["high-performance","Dedicated"],["low-power","Low power"]]}},Ra=[{title:"World rendering",keys:["rendererWorldPerformance","starfieldRendering","defaultSkybox","disableBlockEntityTextures","showChunkBorders","renderEntities","smoothLighting","vanillaLook","newVersionsLighting","dayCycleAndLighting","loadPlayerSkins","renderEars","showHand","viewBobbing","fov","keepChunksDistance","highlightBlockColor","clipWorldBelowY"]},{title:"Frame pacing",keys:["frameLimit","backgroundRendering","renderDebug","gpuPreference"]},{title:"VR",keys:["vrSupport","vrPageGameRendering"]},{title:"Menu background",keys:["menuBackgroundMode","menuBackgroundMinecraftTextures","menuBackgroundV2Scene","menuBackgroundV2Camera","menuBackgroundV2BlockGroup","menuBackgroundV2CameraSpeed","menuBackgroundV2BlockSpeed"]},{title:"Mesher",keys:["rendererMesher"]},{title:"Renderer debug",keys:["rendererFuturisticReveal","rendererPerfDebugOverlay","rendererShaderCubeDebugMode"]}];A();E();R();x();A();E();R();x();A();E();R();x();A();E();R();x();function Hi(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let l=0;l<i;l++){let a=(o+l*r)*4;if(s.data[a+3]!==255)return!0}return!1}function F5(n){return n/64}function ka(n,e,t){if(t){if(Hi(n,0,0,e,e))return}else if(Hi(n,0,0,e,e/2))return;let r=F5(e),i=(s,o,l,a)=>n.clearRect(s*r,o*r,l*r,a*r);i(40,0,8,8),i(48,0,8,8),i(32,8,8,8),i(40,8,8,8),i(48,8,8,8),i(56,8,8,8),t&&(i(4,32,4,4),i(8,32,4,4),i(0,36,4,12),i(4,36,4,12),i(8,36,4,12),i(12,36,4,12),i(20,32,8,4),i(28,32,8,4),i(16,36,4,12),i(20,36,8,12),i(28,36,4,12),i(32,36,8,12),i(44,32,4,4),i(48,32,4,4),i(40,36,4,12),i(44,36,4,12),i(48,36,4,12),i(52,36,12,12),i(4,48,4,4),i(8,48,4,4),i(0,52,4,12),i(4,52,4,12),i(8,52,4,12),i(12,52,4,12),i(52,48,4,4),i(56,48,4,4),i(48,52,4,12),i(52,52,4,12),i(56,52,4,12),i(60,52,4,12))}function Mv(n,e){n.save(),n.scale(-1,1);let t=F5(e),r=(i,s,o,l,a,v)=>n.drawImage(n.canvas,i*t,s*t,o*t,l*t,-a*t,v*t,-o*t,l*t);r(4,16,4,4,20,48),r(8,16,4,4,24,48),r(0,20,4,12,24,52),r(4,20,4,12,20,52),r(8,20,4,12,16,52),r(12,20,4,12,28,52),r(44,16,4,4,36,48),r(48,16,4,4,40,48),r(40,20,4,12,40,52),r(44,20,4,12,36,52),r(48,20,4,12,32,52),r(52,20,4,12,44,52),n.restore()}function Li(n,e){let t=!1;if(e.width!==e.height)if(e.width===2*e.height)t=!0;else throw new Error(`Bad skin size: ${e.width}x${e.height}`);let r=n.getContext("2d",{willReadFrequently:!0});if(t){let i=e.width;n.width=i,n.height=i,r.clearRect(0,0,i,i),r.drawImage(e,0,0,i,i/2),Mv(r,i),ka(r,n.width,!1)}else n.width=e.width,n.height=e.height,r.clearRect(0,0,e.width,e.height),r.drawImage(e,0,0,n.width,n.height),ka(r,n.width,!0)}function Cv(n){if(n.width===2*n.height)return n.width/64;if(n.width*17===n.height*22)return n.width/22;if(n.width*11===n.height*23)return n.width/46;throw new Error(`Bad cape size: ${n.width}x${n.height}`)}function Oi(n,e){let t=Cv(e);n.width=64*t,n.height=32*t;let r=n.getContext("2d",{willReadFrequently:!0});r.clearRect(0,0,n.width,n.height),r.drawImage(e,0,0,e.width,e.height)}function Bv(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let l=0;l<i;l++){let a=(o+l*r)*4;if(!(s.data[a+0]===0&&s.data[a+1]===0&&s.data[a+2]===0&&s.data[a+3]===255))return!1}return!0}function Pv(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let l=0;l<i;l++){let a=(o+l*r)*4;if(!(s.data[a+0]===255&&s.data[a+1]===255&&s.data[a+2]===255&&s.data[a+3]===255))return!1}return!0}function Di(n){let e=F5(n.width),t=n.getContext("2d",{willReadFrequently:!0}),r=(l,a,v,c)=>Hi(t,l*e,a*e,v*e,c*e),i=(l,a,v,c)=>Bv(t,l*e,a*e,v*e,c*e),s=(l,a,v,c)=>Pv(t,l*e,a*e,v*e,c*e);return r(50,16,2,4)||r(54,20,2,12)||r(42,48,2,4)||r(46,52,2,12)||i(50,16,2,4)&&i(54,20,2,12)&&i(42,48,2,4)&&i(46,52,2,12)||s(50,16,2,4)&&s(54,20,2,12)&&s(42,48,2,4)&&s(46,52,2,12)?"slim":"default"}function Fi(n,e){if(e.width!==e.height&&e.width!==2*e.height)throw new Error(`Bad skin size: ${e.width}x${e.height}`);let t=F5(e.width),r=14*t,i=7*t;n.width=r,n.height=i;let s=n.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,r,i),s.drawImage(e,24*t,0,r,i,0,0,r,i)}A();E();R();x();import Lv from"mc-assets/dist/other-textures/latest/entity/player/wide/steve.png";A();E();R();x();import*as ft from"three";A();E();R();x();var Iv=()=>{if(typeof OffscreenCanvas>"u")return!1;try{let n=new OffscreenCanvas(1,1);return(n.getContext("webgl2")||n.getContext("webgl"))!==null}catch{return!1}},Hv=Iv(),Ne=(n,e)=>{if(Hv||typeof document>"u")return new OffscreenCanvas(n,e);let t=document.createElement("canvas");return t.width=n,t.height=e,t};async function x0(n){let t=await(await fetch(n)).blob();return createImageBitmap(t)}var zi=n=>{let[e,t="0",r="0"]=n.split(".");return+`${e.padStart(2,"0")}${t.padStart(2,"0")}${r.padStart(2,"0")}`};var Me=(n,e=!1)=>{n instanceof ft.Mesh&&(n.geometry?.dispose?.(),n.material?.dispose?.()),n instanceof ft.SkinnedMesh&&n.skeleton?.dispose?.(),n.children&&n.children.forEach(t=>Me(t,e)),e&&n instanceof ft.Mesh&&n.material?.map?.dispose?.()},Ui={},Sa={},Or=n=>{let e=new ft.Texture,t=x0(n).then(r=>{let i=new OffscreenCanvas(r.width,r.height);return i.getContext("2d").drawImage(r,0,0),e.source.data=i,e.needsUpdate=!0,e});return{texture:e,promise:t}},X0=async n=>Or(n).texture,qt=n=>{let e=Ne(n.width,n.height);e.getContext("2d").drawImage(n,0,0);let r=new ft.Texture(e);return r.magFilter=ft.NearestFilter,r.minFilter=ft.NearestFilter,r};function Z0(n){let{texture:e,promise:t}=Or(n);return e.magFilter=ft.NearestFilter,e.minFilter=ft.NearestFilter,t.catch(r=>{}),e}async function z5(n,e,t){if(!Ui[n]){let{promise:i,resolve:s}=Promise.withResolvers(),o=Or(n);Ui[n]=o.texture,o.promise.then(s),Sa[n]=i}e(Ui[n]),Sa[n].then(()=>{t?.()})}var lt=Lv,Lg=X0(lt);var Ta={apiEnabled:!0},U5=n=>{Object.assign(Ta,n)};async function Jt(n,e){if(!Ta.apiEnabled||e==="cape")return;let t=`https://playerdb.co/api/player/minecraft/${n}`,r=await fetch(t);return r.ok?(await r.json()).data.player.skin_texture:void 0}async function Bt(n){n.startsWith("data:")||(n=await Ov(n.replace("http://","https://")));let e=await x0(n),t=Ne(64,64);return Li(t,e),{canvas:t,image:e}}var Ov=async n=>{let t=await(await fetch(n,{})).arrayBuffer();return`data:image/png;base64,${O.from(t).toString("base64")}`};function jg(n){return{mode:n.menuBackgroundMode,useMinecraftTextures:n.menuBackgroundMinecraftTextures,v2Scene:n.menuBackgroundV2Scene,v2Camera:n.menuBackgroundV2Camera,v2BlockGroup:n.menuBackgroundV2BlockGroup,v2CameraSpeed:Ot(n.menuBackgroundV2CameraSpeed),v2BlockSpeed:Ot(n.menuBackgroundV2BlockSpeed)}}function Fv(n,e){let t=n.v2;t&&(t.setScene?.(e.menuBackgroundV2Scene),t.setCamera?.(e.menuBackgroundV2Camera),t.setBlockGroup?.(e.menuBackgroundV2BlockGroup),t.setCameraSpeed?.(Ot(e.menuBackgroundV2CameraSpeed)),t.setBlockSpeed?.(Ot(e.menuBackgroundV2BlockSpeed)))}function zv(n){return n.rendererMesher!=="legacy-js"}function Uv(n,e,t){let r=n.inWorldRenderingConfig,i=e.rendererMeshersCountOverride,s=o=>{r.mesherWorkers=i??o};switch(e.rendererWorldPerformance){case"low-energy":s(1),r.dedicatedChangeWorker=!1;break;case"normal":s(2),r.dedicatedChangeWorker=!t;break;case"maximum":s(Math.max(3,Math.min(navigator.hardwareConcurrency??0,8))),r.dedicatedChangeWorker=!t;break}}function Vv(n,e,t){let r=e.backgroundRendering,i=e.frameLimit;t?n.config.fpsLimit=i||void 0:r==="5fps"?n.config.fpsLimit=5:r==="20fps"?n.config.fpsLimit=20:n.config.fpsLimit=void 0}function Gv(n,e,t){let{renderDebug:r}=e;r==="none"||t.isCypress?n.config.statsVisible=0:r==="basic"?n.config.statsVisible=1:r==="advanced"&&(n.config.statsVisible=2)}function Nv(n,e,t={}){let r=n.inWorldRenderingConfig,i=zv(e);r.showChunkBorders=e.showChunkBorders,r.futuristicReveal=e.rendererFuturisticReveal,Uv(n,e,i),r.renderEntities=e.renderEntities,Gv(n,e,t),Vv(n,e,t.windowFocused!==!1),r.vrSupport=e.vrSupport,r.vrPageGameRendering=e.vrPageGameRendering,r.enableDebugOverlay=e.rendererPerfDebugOverlay,r.clipWorldBelowY=e.clipWorldBelowY,r.extraBlockRenderers=!e.disableBlockEntityTextures,r.fetchPlayerSkins=e.loadPlayerSkins,r.highlightBlockColor=e.highlightBlockColor,r.wasmMesher=i,r.shaderCubeBlocks=i,r.disableMesherConversionCache=!!t.isSafari,U5({apiEnabled:e.loadPlayerSkins}),r.smoothLighting=e.smoothLighting,r.shadingTheme=e.vanillaLook?"vanilla":"high-contrast",r.starfield=e.starfieldRendering,r.defaultSkybox=e.defaultSkybox,r.fov=e.fov,r.shaderCubeDebugMode=Ii(e.rendererShaderCubeDebugMode)}function Yg(n,e,t){e.keepChunksDistance=t.keepChunksDistance;let r=n.inWorldRenderingConfig;r.renderEars=t.renderEars,r.showHand=t.showHand,r.viewBobbing=t.viewBobbing,r.dayCycle=t.dayCycleAndLighting}function Qg(n,e,t={}){n.bindRendererOptions(()=>e);let r=t.getWindowFocused?.()??!0,i=()=>{let s=e;if(Nv(n,s,{isSafari:t.isSafari,isCypress:t.isCypress,windowFocused:r}),n.currentDisplay==="menu"){let o=n.backend?.getMenuBackground?.();o&&Fv(o,s)}};return i(),t.onRegisterFocusHandlers?.({onFocus:()=>{r=!0,i()},onBlur:()=>{r=!1,i()}}),Dv(e,i)}function Kg(n,e,t){n.inWorldRenderingConfig.enableLighting=!t||e}A();E();R();x();import{proxy as Wv}from"valtio";var Ma=()=>Wv({playerSkin:void 0,inWater:!1,waterBreathing:!1,backgroundColor:[0,0,0],ambientLight:0,directionalLight:0,eyeHeight:0,gameMode:void 0,lookingAtBlock:void 0,diggingBlock:void 0,movementState:"NOT_MOVING",onGround:!0,sneaking:!1,flying:!1,sprinting:!1,walkDist:0,prevWalkDist:0,bob:0,prevBob:0,itemUsageTicks:0,username:"",onlineMode:!1,cardinalLight:"default",lightingDisabled:!1,shouldHideHand:!1,heldItemMain:void 0,heldItemOff:void 0,perspective:"first_person",onFire:!1,fovMultiplier:1,cameraSpectatingEntity:void 0,team:void 0}),jv=n=>({isSpectator(){return n.gameMode==="spectator"},isSpectatingEntity(){return n.cameraSpectatingEntity!==void 0&&n.gameMode==="spectator"},isThirdPerson(){return this.isSpectatingEntity()?!1:n.perspective==="third_person_back"||n.perspective==="third_person_front"}}),Yv=()=>({reactive:Ma()}),Ca=(n,e,t)=>({...e,"minecraft:date":new Date});A();E();R();x();A();E();R();x();import*as w5 from"three";import{Vec3 as Uu}from"vec3";A();E();R();x();import{proxy as Qv,getVersion as Ni,subscribe as Ia}from"valtio";import{Vec3 as Wi}from"vec3";function Ha(n,e){let t=e??globalThis;return t.addEventListener("message",r=>{let{type:i,args:s,msgId:o}=r.data;if(n[i]){let l=n[i](...s);l instanceof Promise&&l.then(a=>{t.postMessage({type:"result",msgId:o,args:[a]})})}}),null}var La=(n,e=!0)=>{let t=0;return new Proxy({},{get(r,i){return i==="transfer"?(...s)=>new Proxy({},{get(o,l){return(...a)=>{n.postMessage({type:l,args:a},s)}}}):(...s)=>{let o=t++,l=e?s.filter(a=>a instanceof ArrayBuffer||a instanceof MessagePort||typeof ImageBitmap<"u"&&a instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&a instanceof OffscreenCanvas||typeof ImageData<"u"&&a instanceof ImageData):[];return n.postMessage({type:i,msgId:o,args:s},l),{then(a){let v=({data:c})=>{c.type==="result"&&c.msgId===o&&(a(c.args[0]),n.removeEventListener("message",v))};n.addEventListener("message",v)}}}}})},Oa=!1,Dr={toWorker:0,fromWorker:0},Ba=null,Kv=()=>{Ba==null&&(typeof window>"u"||(Ba=setInterval(()=>{globalThis.debugWorkerSyncStats={...Dr},Dr.toWorker=0,Dr.fromWorker=0},1e3)))},V5=n=>{Kv(),n==="toWorker"?Dr.toWorker++:Dr.fromWorker++};var qv=()=>Math.random().toString(36).slice(2,15)+Math.random().toString(36).slice(2,15),Jv=(n,e,t)=>{if(e.length===0)return;let r=n;for(let i=0;i<e.length-1;i++){let s=e[i];(r[s]==null||typeof r[s]!="object")&&(r[s]={}),r=r[s]}r[e[e.length-1]]=t},Xv=(n,e)=>{if(e.length===0)return;let t=n;for(let r=0;r<e.length-1;r++)if(t=t[e[r]],t==null)return;delete t[e[e.length-1]]},Gi=(n,e)=>{if(n==null||typeof n!="object")return n;if(n instanceof Wi)return{x:n.x,y:n.y,z:n.z,__restorer:"Vec3"};if(typeof n.prepareForTransfer=="function")return n.prepareForTransfer(e);if(ArrayBuffer.isView(n))return n;if(Array.isArray(n))return n.map(r=>Gi(r,e));if(Ni(n)!==void 0)return Fr(n);let t={};for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=Gi(n[r],e));return t},Zv=(n,e)=>{let t=[];for(let r of n){let i=r[0];i==="delete"?t.push({kind:"delete",path:r[1]}):i==="set"&&t.push({kind:"set",path:r[1],value:Gi(r[2],e)})}return t},Da=(n,e,t,r,i)=>{if(e.length===0)return;let s=Zv(e,t);if(s.length!==0)try{t.postMessage({type:"sync",syncId:n,ops:s}),r==="toWorker"&&V5("toWorker")}catch{for(let l of s)l.kind==="set"&&R0(l.value)}},Fa=(n,e,t,r=!1)=>{for(let i of e)i.kind==="delete"?Xv(n,i.path):Jv(n,i.path,Ur(i.value,[],t,!1,!1));r==="fromWorker"&&V5("fromWorker")},za=(n,e,t,r,i)=>{try{let s=Fr(e);t.postMessage({type:"sync",syncId:n,value:s}),r==="toWorker"&&V5("toWorker")}catch{R0(e)}},Ua=(n,e,t,r=!1)=>{Object.assign(n,Ur(e,[],t,!1,!1)),r==="fromWorker"&&V5("fromWorker")},Vi=(n,e,t,r,i)=>{let s=n.__syncFromWorker||e.__syncFromWorker,o=n.__syncToWorker||e.__syncToWorker;if(!o&&!s&&!r)return;let l=qv();if(n.__syncId=l,o||r){r&&o!==!1&&Ia(e,v=>{Da(l,v,t,"toWorker",`toWorker:${i}`)});let a=n.__syncToWorkerInterval??e.__syncToWorkerInterval??0;a>0&&!r&&setInterval(()=>{za(l,e,t,"toWorker",`toWorker:interval:${i}`)},a)}e.__syncFromWorker&&t.addEventListener("message",a=>{a.data.type==="sync"&&a.data.syncId===l&&(a.data.ops?Fa(e,a.data.ops,t,"fromWorker"):a.data.value&&Ua(e,a.data.value,t,"fromWorker"))})},Fr=n=>{if(Ni(n)===void 0)return n;if(Array.isArray(n))return n.map(Fr);if(typeof n=="object"&&n!==null){let e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=Fr(n[t]));return e}return n},zr=(n,e,t=!0,r=!0,i=!1)=>{var l,a;let s=n,o={};for(let v in n)if(Object.prototype.hasOwnProperty.call(n,v)){if(t&&typeof n[v]=="function")continue;if(n[v]instanceof Date||n[v]instanceof RegExp||n[v]instanceof Map||n[v]instanceof Set||n[v]instanceof WeakMap||n[v]instanceof WeakSet,n[v]instanceof Wi){o[v]={x:n[v].x,y:n[v].y,z:n[v].z},o[v].__restorer="Vec3";continue}if(o[v]=n[v],typeof n[v]=="object"&&n[v]!==null){if(n[v].prepareForTransfer){o[v]=n[v].prepareForTransfer(e);continue}let c=Ni(n[v])!==void 0;o[v]=c?Fr(n[v]):n[v],n[v].__syncFromWorker&&(o[v].__syncFromWorker=!0),n[v].__syncToWorker&&(o[v].__syncToWorker=!0),n[v].__syncFromWorkerInterval&&(o[v].__syncFromWorkerInterval=n[v].__syncFromWorkerInterval),n[v].__syncToWorkerInterval&&(o[v].__syncToWorkerInterval=n[v].__syncToWorkerInterval);let u=n[v].__syncToWorker!==!1&&!i&&c&&!n[v].__syncFromWorker;if((l=o[v]).__syncToWorker??(l.__syncToWorker=u),c&&((a=o[v]).__valtio??(a.__valtio=!0)),o[v].__syncToWorker&&c){Vi(o[v],s[v],e,!0,v);continue}if(o[v].__syncFromWorker||o[v].__syncToWorker){Vi(o[v],s[v],e,c,v);continue}Vi(o[v],s[v],e,!1,v),o[v]=zr(o[v],e,t,!1,c)}}return o},R0=(n,e=[])=>{for(let t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(!n[t])continue;typeof n[t]=="object"&&n[t]!==null&&R0(n[t],[...e,t]);try{structuredClone(n[t])}catch{}}},Pa=new WeakMap,$v=(n,e,t)=>{if(!n.__syncId)return;let r=n.__syncId,i=Pa.get(e);if(i||(i=new Set,Pa.set(e,i)),!i.has(r)&&(i.add(r),n.__syncToWorker&&e.addEventListener("message",s=>{s.data.type==="sync"&&s.data.syncId===r&&(s.data.ops?Fa(n,s.data.ops,e):s.data.value&&Ua(n,s.data.value,e))}),n.__syncFromWorker)){n.__valtio&&Ia(n,o=>{Da(r,o,e,"fromWorker",`fromWorker:${t}`)});let s=n.__syncFromWorkerInterval??0;s>0&&!n.__valtio&&setInterval(()=>{za(r,n,e,"fromWorker",`fromWorker:interval:${t}`)},s)}},e8=[{restorerName:"Vec3",restoreTransferred(n,e){return new Wi(n.x,n.y,n.z)}}];var Ur=(n,e,t,r=!0,i=!0)=>{let s=[...e8,...e],o=(l,a)=>{if(l==null||typeof l!="object")return l;if(l.__restorer){let v=s.find(u=>u.restorerName?u.restorerName===l.__restorer:u.name===l.__restorer);if(v)return v.restoreTransferred(l,t);let c=new Error(`Restorer ${l.__restorer} not found`);if(typeof r=="function")r(c);else if(r)throw c;return l}if(Array.isArray(l))return l.map((v,c)=>o(v,`${a}[${c}]`));for(let v in l){if(!Object.prototype.hasOwnProperty.call(l,v))continue;let c=l[v];c!=null&&typeof c=="object"&&(l[v]=o(c,`${a}.${v}`))}return l.__valtio&&(l=Qv(l)),i&&$v(l,t,a),l};return o(n,"root")};A();E();R();x();var G5=class{constructor(e){this.nonReactiveState=e;d(this,"events",[]);d(this,"frozenEvents",[]);d(this,"lastSecondEvents",[]);d(this,"currentFrameStartTime",null);d(this,"lastInteractionTime",0);d(this,"lastSecondUpdateTime",0);d(this,"timeWindowMs",5e3);d(this,"lastSecondWindowMs",1e3);d(this,"maxEvents",500);d(this,"lastSecondUpdateInterval",1e3);this.nonReactiveState.renderer||(this.nonReactiveState.renderer={timeline:{live:[],frozen:[],lastSecond:[]}}),this.nonReactiveState.renderer.timeline||(this.nonReactiveState.renderer.timeline={live:[],frozen:[],lastSecond:[]}),setInterval(()=>{this.updateLastSecondTimeline()},this.lastSecondUpdateInterval)}markFrameStart(){this.currentFrameStartTime=performance.now(),this.addEvent({type:"frameStart",timestamp:this.currentFrameStartTime})}markFrameEnd(){if(!this.currentFrameStartTime)return;let e=performance.now(),t=e-this.currentFrameStartTime;this.addEvent({type:"frameEnd",timestamp:e,duration:t}),this.currentFrameStartTime=null}markCameraUpdate(e){if(!e)return;let t=performance.now();this.lastInteractionTime=t,this.addEvent({type:"cameraUpdate",timestamp:t}),this.frozenEvents=[...this.events],this.trimEvents(this.frozenEvents),this.syncFrozenEvents()}markFrameDisplay(){this.addEvent({type:"frameDisplay",timestamp:performance.now()})}addEvent(e){this.events.push(e),this.lastSecondEvents.push(e),this.trimEvents(this.events),this.trimLastSecondEvents(),this.syncLiveEvents()}trimEvents(e){let r=performance.now()-this.timeWindowMs;for(;e.length>0&&e[0].timestamp<r;)e.shift();e.length>this.maxEvents&&e.splice(0,e.length-this.maxEvents)}trimLastSecondEvents(){let t=performance.now()-this.lastSecondWindowMs;for(;this.lastSecondEvents.length>0&&this.lastSecondEvents[0].timestamp<t;)this.lastSecondEvents.shift()}updateLastSecondTimeline(){let e=performance.now();e-this.lastSecondUpdateTime<this.lastSecondUpdateInterval||(this.lastSecondUpdateTime=e,this.trimLastSecondEvents(),this.syncLastSecondEvents())}syncLiveEvents(){this.nonReactiveState.renderer.timeline.live=[...this.events]}syncFrozenEvents(){this.nonReactiveState.renderer.timeline.frozen=[...this.frozenEvents]}syncLastSecondEvents(){this.nonReactiveState.renderer.timeline.lastSecond=[...this.lastSecondEvents]}clear(){this.events=[],this.frozenEvents=[],this.lastSecondEvents=[],this.syncLiveEvents(),this.syncFrozenEvents(),this.syncLastSecondEvents()}};A();E();R();x();import*as Z from"three";import{Vec3 as o0}from"vec3";A();E();R();x();function Va(n){let e=Math.floor(n.x/16),t=Math.floor(n.z/16);return[e,t]}function ji(n){let e=Math.floor(n.x/16),t=Math.floor(n.y/16),r=Math.floor(n.z/16);return[e,t,r]}A();E();R();x();import{Vec3 as Vr}from"vec3";import{subscribeKey as $i}from"valtio/utils";import{proxy as h8,subscribe as f8}from"valtio";A();E();R();x();var k0={blocks:"blocksArray",blockCollisionShapes:"blockCollisionShapes",biomes:"biomesArray",tints:"tints"};A();E();R();x();var Ga=16;var Na=(n,e)=>e?`${n}:${e}`:String(n);A();E();R();x();var Wa=0,Dt={},Yi=40,S0="mc-renderer-debug-overlay",T0=(n,e=80,t=Wa,r=Yi,i)=>{if(de)return{updateText(){},setVisibility(){}};let s=document.createElement("div");return s.style.position="fixed",s.style.top=`${r??Yi}px`,s.style.right=`${t}px`,s.style.backgroundColor="rgba(0, 0, 0, 0.7)",s.style.color="white",s.style.padding="2px",s.style.fontFamily="monospace",s.style.fontSize="12px",i?.className?s.className=i.className:s.style.zIndex="100",s.style.pointerEvents="none",document.body.appendChild(s),Dt[n]=s,r===void 0&&t===Wa&&(Yi+=20),{updateText(o){s.innerText!==o&&(s.innerText=o)},setVisibility(o){s.style.display=o?"block":"none"}}};var Qi=(n,e)=>{de||!Dt[n]||(Dt[n].innerText=e)},ja=n=>{if(!de)for(let e in Dt)Dt[e].style.display=n?"block":"none"},Ya=()=>{if(!de)for(let n in Dt)t8(n)},t8=n=>{de||!Dt[n]||(Dt[n].remove(),delete Dt[n])};N5();A();E();R();x();function Je(n,e,t,r){if(n.on(e,t),r.aborted){n.off(e,t);return}r.addEventListener("abort",()=>{n.off(e,t)},{once:!0})}function Qa(n,e,t,r){if(n.on(e,t),r.aborted){n.off(e,t);return}r.addEventListener("abort",()=>{n.off(e,t)},{once:!0})}A();E();R();x();import qa from"prismarine-chunk";import{Vec3 as v8}from"vec3";A();E();R();x();import o8 from"minecraft-data";import a8 from"prismarine-block";var Ki={lightLevels:{lava:15,brown_mushroom:1,torch:14,wall_torch:14,fire:15,soul_fire:10,soul_torch:10,soul_wall_torch:10,glowstone:15,nether_portal:11,jack_o_lantern:15,enchanting_table:7,brewing_stand:1,lava_cauldron:15,end_portal:15,end_portal_frame:1,dragon_egg:1,ender_chest:7,beacon:15,sea_lantern:15,end_rod:14,end_gateway:15,magma_block:3,conduit:15,lantern:15,soul_lantern:10,shroomlight:15,crying_obsidian:10,amethyst_cluster:5,large_amethyst_bud:4,medium_amethyst_bud:2,small_amethyst_bud:1,sculk_sensor:1,sculk_catalyst:6,ochre_froglight:15,verdant_froglight:15,pearlescent_froglight:15},noOcclusions:{mangrove_roots:!0,oak_leaves:!0,spruce_leaves:!0,birch_leaves:!0,jungle_leaves:!0,acacia_leaves:!0,cherry_leaves:!0,dark_oak_leaves:!0,mangrove_leaves:!0,azalea_leaves:!0,flowering_azalea_leaves:!0,glass:!0,white_bed:!0,orange_bed:!0,magenta_bed:!0,light_blue_bed:!0,yellow_bed:!0,lime_bed:!0,pink_bed:!0,gray_bed:!0,light_gray_bed:!0,cyan_bed:!0,purple_bed:!0,blue_bed:!0,brown_bed:!0,green_bed:!0,red_bed:!0,black_bed:!0,moving_piston:!0,spawner:!0,oak_door:!0,ladder:!0,iron_door:!0,ice:!0,white_stained_glass:!0,orange_stained_glass:!0,magenta_stained_glass:!0,light_blue_stained_glass:!0,yellow_stained_glass:!0,lime_stained_glass:!0,pink_stained_glass:!0,gray_stained_glass:!0,light_gray_stained_glass:!0,cyan_stained_glass:!0,purple_stained_glass:!0,blue_stained_glass:!0,brown_stained_glass:!0,green_stained_glass:!0,red_stained_glass:!0,black_stained_glass:!0,oak_trapdoor:!0,spruce_trapdoor:!0,birch_trapdoor:!0,jungle_trapdoor:!0,acacia_trapdoor:!0,cherry_trapdoor:!0,dark_oak_trapdoor:!0,mangrove_trapdoor:!0,bamboo_trapdoor:!0,iron_bars:!0,chain:!0,glass_pane:!0,lily_pad:!0,brewing_stand:!0,cauldron:!0,dragon_egg:!0,cocoa:!0,beacon:!0,hopper:!0,white_stained_glass_pane:!0,orange_stained_glass_pane:!0,magenta_stained_glass_pane:!0,light_blue_stained_glass_pane:!0,yellow_stained_glass_pane:!0,lime_stained_glass_pane:!0,pink_stained_glass_pane:!0,gray_stained_glass_pane:!0,light_gray_stained_glass_pane:!0,cyan_stained_glass_pane:!0,purple_stained_glass_pane:!0,blue_stained_glass_pane:!0,brown_stained_glass_pane:!0,green_stained_glass_pane:!0,red_stained_glass_pane:!0,black_stained_glass_pane:!0,slime_block:!0,barrier:!0,light:!0,iron_trapdoor:!0,spruce_door:!0,birch_door:!0,jungle_door:!0,acacia_door:!0,cherry_door:!0,dark_oak_door:!0,mangrove_door:!0,bamboo_door:!0,end_rod:!0,chorus_plant:!0,chorus_flower:!0,frosted_ice:!0,turtle_egg:!0,sniffer_egg:!0,sea_pickle:!0,conduit:!0,bamboo:!0,lantern:!0,soul_lantern:!0,campfire:!0,soul_campfire:!0,crimson_trapdoor:!0,warped_trapdoor:!0,crimson_door:!0,warped_door:!0,honey_block:!0,candle:!0,white_candle:!0,orange_candle:!0,magenta_candle:!0,light_blue_candle:!0,yellow_candle:!0,lime_candle:!0,pink_candle:!0,gray_candle:!0,light_gray_candle:!0,cyan_candle:!0,purple_candle:!0,blue_candle:!0,brown_candle:!0,green_candle:!0,red_candle:!0,black_candle:!0,amethyst_cluster:!0,tinted_glass:!0,lightning_rod:!0,pointed_dripstone:!0,azalea:!0,flowering_azalea:!0,frogspawn:!0,decorated_pot:!0},colors:{stone:"rgb(112, 112, 112)",granite:"rgb(151, 109, 77)",polished_granite:"rgb(151, 109, 77)",diorite:"rgb(255, 252, 245)",polished_diorite:"rgb(255, 252, 245)",andesite:"rgb(112, 112, 112)",polished_andesite:"rgb(112, 112, 112)",grass_block:"rgb(127, 178, 56)",dirt:"rgb(151, 109, 77)",coarse_dirt:"rgb(151, 109, 77)",podzol:"rgb(129, 86, 49)",cobblestone:"rgb(112, 112, 112)",oak_planks:"rgb(143, 119, 72)",spruce_planks:"rgb(129, 86, 49)",birch_planks:"rgb(247, 233, 163)",jungle_planks:"rgb(151, 109, 77)",acacia_planks:"rgb(216, 127, 51)",cherry_planks:"rgb(209, 177, 161)",dark_oak_planks:"rgb(102, 76, 51)",mangrove_planks:"rgb(153, 51, 51)",bamboo_planks:"rgb(229, 229, 51)",bamboo_mosaic:"rgb(229, 229, 51)",oak_sapling:"rgb(0, 124, 0)",spruce_sapling:"rgb(0, 124, 0)",birch_sapling:"rgb(0, 124, 0)",jungle_sapling:"rgb(0, 124, 0)",acacia_sapling:"rgb(0, 124, 0)",cherry_sapling:"rgb(242, 127, 165)",dark_oak_sapling:"rgb(0, 124, 0)",mangrove_propagule:"rgb(0, 124, 0)",bedrock:"rgb(112, 112, 112)",water:"rgb(64, 64, 255)",lava:"rgb(255, 0, 0)",sand:"rgb(247, 233, 163)",suspicious_sand:"rgb(247, 233, 163)",red_sand:"rgb(216, 127, 51)",gravel:"rgb(112, 112, 112)",suspicious_gravel:"rgb(112, 112, 112)",gold_ore:"rgb(112, 112, 112)",deepslate_gold_ore:"rgb(100, 100, 100)",iron_ore:"rgb(112, 112, 112)",deepslate_iron_ore:"rgb(100, 100, 100)",coal_ore:"rgb(112, 112, 112)",deepslate_coal_ore:"rgb(100, 100, 100)",nether_gold_ore:"rgb(112, 2, 0)",mangrove_roots:"rgb(129, 86, 49)",muddy_mangrove_roots:"rgb(129, 86, 49)",oak_wood:"rgb(143, 119, 72)",spruce_wood:"rgb(129, 86, 49)",birch_wood:"rgb(247, 233, 163)",jungle_wood:"rgb(151, 109, 77)",acacia_wood:"rgb(76, 76, 76)",cherry_wood:"rgb(57, 41, 35)",dark_oak_wood:"rgb(102, 76, 51)",mangrove_wood:"rgb(153, 51, 51)",stripped_oak_wood:"rgb(143, 119, 72)",stripped_spruce_wood:"rgb(129, 86, 49)",stripped_birch_wood:"rgb(247, 233, 163)",stripped_jungle_wood:"rgb(151, 109, 77)",stripped_acacia_wood:"rgb(216, 127, 51)",stripped_cherry_wood:"rgb(160, 77, 78)",stripped_dark_oak_wood:"rgb(102, 76, 51)",oak_leaves:"rgb(0, 124, 0)",spruce_leaves:"rgb(0, 124, 0)",birch_leaves:"rgb(0, 124, 0)",jungle_leaves:"rgb(0, 124, 0)",acacia_leaves:"rgb(0, 124, 0)",cherry_leaves:"rgb(242, 127, 165)",dark_oak_leaves:"rgb(0, 124, 0)",mangrove_leaves:"rgb(0, 124, 0)",azalea_leaves:"rgb(0, 124, 0)",flowering_azalea_leaves:"rgb(0, 124, 0)",sponge:"rgb(229, 229, 51)",wet_sponge:"rgb(229, 229, 51)",lapis_ore:"rgb(112, 112, 112)",deepslate_lapis_ore:"rgb(100, 100, 100)",lapis_block:"rgb(74, 128, 255)",dispenser:"rgb(112, 112, 112)",sandstone:"rgb(247, 233, 163)",chiseled_sandstone:"rgb(247, 233, 163)",cut_sandstone:"rgb(247, 233, 163)",note_block:"rgb(143, 119, 72)",sticky_piston:"rgb(112, 112, 112)",cobweb:"rgb(199, 199, 199)",grass:"rgb(0, 124, 0)",fern:"rgb(0, 124, 0)",dead_bush:"rgb(143, 119, 72)",seagrass:"rgb(64, 64, 255)",tall_seagrass:"rgb(64, 64, 255)",piston:"rgb(112, 112, 112)",piston_head:"rgb(112, 112, 112)",white_wool:"rgb(255, 255, 255)",orange_wool:"rgb(216, 127, 51)",magenta_wool:"rgb(178, 76, 216)",light_blue_wool:"rgb(102, 153, 216)",yellow_wool:"rgb(229, 229, 51)",lime_wool:"rgb(127, 204, 25)",pink_wool:"rgb(242, 127, 165)",gray_wool:"rgb(76, 76, 76)",light_gray_wool:"rgb(153, 153, 153)",cyan_wool:"rgb(76, 127, 153)",purple_wool:"rgb(127, 63, 178)",blue_wool:"rgb(51, 76, 178)",brown_wool:"rgb(102, 76, 51)",green_wool:"rgb(102, 127, 51)",red_wool:"rgb(153, 51, 51)",black_wool:"rgb(25, 25, 25)",moving_piston:"rgb(112, 112, 112)",dandelion:"rgb(0, 124, 0)",torchflower:"rgb(0, 124, 0)",poppy:"rgb(0, 124, 0)",blue_orchid:"rgb(0, 124, 0)",allium:"rgb(0, 124, 0)",azure_bluet:"rgb(0, 124, 0)",red_tulip:"rgb(0, 124, 0)",orange_tulip:"rgb(0, 124, 0)",white_tulip:"rgb(0, 124, 0)",pink_tulip:"rgb(0, 124, 0)",oxeye_daisy:"rgb(0, 124, 0)",cornflower:"rgb(0, 124, 0)",wither_rose:"rgb(0, 124, 0)",lily_of_the_valley:"rgb(0, 124, 0)",brown_mushroom:"rgb(102, 76, 51)",red_mushroom:"rgb(153, 51, 51)",gold_block:"rgb(250, 238, 77)",iron_block:"rgb(167, 167, 167)",bricks:"rgb(153, 51, 51)",tnt:"rgb(255, 0, 0)",bookshelf:"rgb(143, 119, 72)",chiseled_bookshelf:"rgb(143, 119, 72)",mossy_cobblestone:"rgb(112, 112, 112)",obsidian:"rgb(25, 25, 25)",fire:"rgb(255, 0, 0)",soul_fire:"rgb(102, 153, 216)",spawner:"rgb(112, 112, 112)",chest:"rgb(143, 119, 72)",diamond_ore:"rgb(112, 112, 112)",deepslate_diamond_ore:"rgb(100, 100, 100)",diamond_block:"rgb(92, 219, 213)",crafting_table:"rgb(143, 119, 72)",wheat:"rgb(0, 124, 0)",farmland:"rgb(151, 109, 77)",furnace:"rgb(112, 112, 112)",oak_sign:"rgb(143, 119, 72)",birch_sign:"rgb(247, 233, 163)",acacia_sign:"rgb(216, 127, 51)",oak_wall_sign:"rgb(143, 119, 72)",birch_wall_sign:"rgb(247, 233, 163)",acacia_wall_sign:"rgb(216, 127, 51)",birch_hanging_sign:"rgb(247, 233, 163)",acacia_hanging_sign:"rgb(216, 127, 51)",cherry_hanging_sign:"rgb(160, 77, 78)",crimson_hanging_sign:"rgb(148, 63, 97)",warped_hanging_sign:"rgb(58, 142, 140)",bamboo_hanging_sign:"rgb(229, 229, 51)",spruce_wall_hanging_sign:"rgb(143, 119, 72)",birch_wall_hanging_sign:"rgb(247, 233, 163)",acacia_wall_hanging_sign:"rgb(216, 127, 51)",cherry_wall_hanging_sign:"rgb(160, 77, 78)",crimson_wall_hanging_sign:"rgb(148, 63, 97)",warped_wall_hanging_sign:"rgb(58, 142, 140)",bamboo_wall_hanging_sign:"rgb(229, 229, 51)",stone_pressure_plate:"rgb(112, 112, 112)",iron_door:"rgb(167, 167, 167)",redstone_ore:"rgb(112, 112, 112)",deepslate_redstone_ore:"rgb(100, 100, 100)",snow:"rgb(255, 255, 255)",ice:"rgb(160, 160, 255)",snow_block:"rgb(255, 255, 255)",cactus:"rgb(0, 124, 0)",clay:"rgb(164, 168, 184)",sugar_cane:"rgb(0, 124, 0)",jukebox:"rgb(151, 109, 77)",pumpkin:"rgb(216, 127, 51)",netherrack:"rgb(112, 2, 0)",soul_sand:"rgb(102, 76, 51)",soul_soil:"rgb(102, 76, 51)",basalt:"rgb(25, 25, 25)",polished_basalt:"rgb(25, 25, 25)",glowstone:"rgb(247, 233, 163)",carved_pumpkin:"rgb(216, 127, 51)",jack_o_lantern:"rgb(216, 127, 51)",oak_trapdoor:"rgb(143, 119, 72)",spruce_trapdoor:"rgb(129, 86, 49)",birch_trapdoor:"rgb(247, 233, 163)",jungle_trapdoor:"rgb(151, 109, 77)",acacia_trapdoor:"rgb(216, 127, 51)",cherry_trapdoor:"rgb(209, 177, 161)",dark_oak_trapdoor:"rgb(102, 76, 51)",mangrove_trapdoor:"rgb(153, 51, 51)",bamboo_trapdoor:"rgb(229, 229, 51)",stone_bricks:"rgb(112, 112, 112)",mossy_stone_bricks:"rgb(112, 112, 112)",cracked_stone_bricks:"rgb(112, 112, 112)",chiseled_stone_bricks:"rgb(112, 112, 112)",mud_bricks:"rgb(135, 107, 98)",infested_stone:"rgb(164, 168, 184)",infested_cobblestone:"rgb(164, 168, 184)",infested_stone_bricks:"rgb(164, 168, 184)",infested_mossy_stone_bricks:"rgb(164, 168, 184)",infested_cracked_stone_bricks:"rgb(164, 168, 184)",infested_chiseled_stone_bricks:"rgb(164, 168, 184)",brown_mushroom_block:"rgb(151, 109, 77)",red_mushroom_block:"rgb(153, 51, 51)",mushroom_stem:"rgb(199, 199, 199)",melon:"rgb(127, 204, 25)",attached_pumpkin_stem:"rgb(0, 124, 0)",attached_melon_stem:"rgb(0, 124, 0)",pumpkin_stem:"rgb(0, 124, 0)",melon_stem:"rgb(0, 124, 0)",vine:"rgb(0, 124, 0)",glow_lichen:"rgb(127, 167, 150)",mycelium:"rgb(127, 63, 178)",lily_pad:"rgb(0, 124, 0)",nether_bricks:"rgb(112, 2, 0)",nether_brick_fence:"rgb(112, 2, 0)",nether_wart:"rgb(153, 51, 51)",enchanting_table:"rgb(153, 51, 51)",brewing_stand:"rgb(167, 167, 167)",cauldron:"rgb(112, 112, 112)",end_portal:"rgb(25, 25, 25)",end_portal_frame:"rgb(102, 127, 51)",end_stone:"rgb(247, 233, 163)",dragon_egg:"rgb(25, 25, 25)",cocoa:"rgb(0, 124, 0)",emerald_ore:"rgb(112, 112, 112)",deepslate_emerald_ore:"rgb(100, 100, 100)",ender_chest:"rgb(112, 112, 112)",emerald_block:"rgb(0, 217, 58)",command_block:"rgb(102, 76, 51)",beacon:"rgb(92, 219, 213)",carrots:"rgb(0, 124, 0)",potatoes:"rgb(0, 124, 0)",anvil:"rgb(167, 167, 167)",chipped_anvil:"rgb(167, 167, 167)",damaged_anvil:"rgb(167, 167, 167)",trapped_chest:"rgb(143, 119, 72)",light_weighted_pressure_plate:"rgb(250, 238, 77)",heavy_weighted_pressure_plate:"rgb(167, 167, 167)",daylight_detector:"rgb(143, 119, 72)",redstone_block:"rgb(255, 0, 0)",nether_quartz_ore:"rgb(112, 2, 0)",hopper:"rgb(112, 112, 112)",quartz_block:"rgb(255, 252, 245)",chiseled_quartz_block:"rgb(255, 252, 245)",quartz_pillar:"rgb(255, 252, 245)",dropper:"rgb(112, 112, 112)",white_terracotta:"rgb(209, 177, 161)",orange_terracotta:"rgb(159, 82, 36)",magenta_terracotta:"rgb(149, 87, 108)",light_blue_terracotta:"rgb(112, 108, 138)",yellow_terracotta:"rgb(186, 133, 36)",lime_terracotta:"rgb(103, 117, 53)",pink_terracotta:"rgb(160, 77, 78)",gray_terracotta:"rgb(57, 41, 35)",light_gray_terracotta:"rgb(135, 107, 98)",cyan_terracotta:"rgb(87, 92, 92)",purple_terracotta:"rgb(122, 73, 88)",blue_terracotta:"rgb(76, 62, 92)",brown_terracotta:"rgb(76, 50, 35)",green_terracotta:"rgb(76, 82, 42)",red_terracotta:"rgb(142, 60, 46)",black_terracotta:"rgb(37, 22, 16)",slime_block:"rgb(127, 178, 56)",iron_trapdoor:"rgb(167, 167, 167)",prismarine:"rgb(76, 127, 153)",prismarine_bricks:"rgb(92, 219, 213)",dark_prismarine:"rgb(92, 219, 213)",prismarine_slab:"rgb(76, 127, 153)",prismarine_brick_slab:"rgb(92, 219, 213)",dark_prismarine_slab:"rgb(92, 219, 213)",sea_lantern:"rgb(255, 252, 245)",hay_block:"rgb(229, 229, 51)",white_carpet:"rgb(255, 255, 255)",orange_carpet:"rgb(216, 127, 51)",magenta_carpet:"rgb(178, 76, 216)",light_blue_carpet:"rgb(102, 153, 216)",yellow_carpet:"rgb(229, 229, 51)",lime_carpet:"rgb(127, 204, 25)",pink_carpet:"rgb(242, 127, 165)",gray_carpet:"rgb(76, 76, 76)",light_gray_carpet:"rgb(153, 153, 153)",cyan_carpet:"rgb(76, 127, 153)",purple_carpet:"rgb(127, 63, 178)",blue_carpet:"rgb(51, 76, 178)",brown_carpet:"rgb(102, 76, 51)",green_carpet:"rgb(102, 127, 51)",red_carpet:"rgb(153, 51, 51)",black_carpet:"rgb(25, 25, 25)",terracotta:"rgb(216, 127, 51)",coal_block:"rgb(25, 25, 25)",packed_ice:"rgb(160, 160, 255)",sunflower:"rgb(0, 124, 0)",lilac:"rgb(0, 124, 0)",rose_bush:"rgb(0, 124, 0)",peony:"rgb(0, 124, 0)",tall_grass:"rgb(0, 124, 0)",large_fern:"rgb(0, 124, 0)",white_banner:"rgb(143, 119, 72)",orange_banner:"rgb(143, 119, 72)",magenta_banner:"rgb(143, 119, 72)",light_blue_banner:"rgb(143, 119, 72)",yellow_banner:"rgb(143, 119, 72)",lime_banner:"rgb(143, 119, 72)",pink_banner:"rgb(143, 119, 72)",gray_banner:"rgb(143, 119, 72)",light_gray_banner:"rgb(143, 119, 72)",cyan_banner:"rgb(143, 119, 72)",purple_banner:"rgb(143, 119, 72)",blue_banner:"rgb(143, 119, 72)",brown_banner:"rgb(143, 119, 72)",green_banner:"rgb(143, 119, 72)",red_banner:"rgb(143, 119, 72)",black_banner:"rgb(143, 119, 72)",white_wall_banner:"rgb(143, 119, 72)",orange_wall_banner:"rgb(143, 119, 72)",magenta_wall_banner:"rgb(143, 119, 72)",light_blue_wall_banner:"rgb(143, 119, 72)",yellow_wall_banner:"rgb(143, 119, 72)",lime_wall_banner:"rgb(143, 119, 72)",pink_wall_banner:"rgb(143, 119, 72)",gray_wall_banner:"rgb(143, 119, 72)",light_gray_wall_banner:"rgb(143, 119, 72)",cyan_wall_banner:"rgb(143, 119, 72)",purple_wall_banner:"rgb(143, 119, 72)",blue_wall_banner:"rgb(143, 119, 72)",brown_wall_banner:"rgb(143, 119, 72)",green_wall_banner:"rgb(143, 119, 72)",red_wall_banner:"rgb(143, 119, 72)",black_wall_banner:"rgb(143, 119, 72)",red_sandstone:"rgb(216, 127, 51)",chiseled_red_sandstone:"rgb(216, 127, 51)",cut_red_sandstone:"rgb(216, 127, 51)",oak_slab:"rgb(143, 119, 72)",spruce_slab:"rgb(129, 86, 49)",birch_slab:"rgb(247, 233, 163)",jungle_slab:"rgb(151, 109, 77)",acacia_slab:"rgb(216, 127, 51)",cherry_slab:"rgb(209, 177, 161)",dark_oak_slab:"rgb(102, 76, 51)",mangrove_slab:"rgb(153, 51, 51)",bamboo_slab:"rgb(229, 229, 51)",bamboo_mosaic_slab:"rgb(229, 229, 51)",stone_slab:"rgb(112, 112, 112)",smooth_stone_slab:"rgb(112, 112, 112)",sandstone_slab:"rgb(247, 233, 163)",cut_sandstone_slab:"rgb(247, 233, 163)",petrified_oak_slab:"rgb(143, 119, 72)",cobblestone_slab:"rgb(112, 112, 112)",brick_slab:"rgb(153, 51, 51)",stone_brick_slab:"rgb(112, 112, 112)",mud_brick_slab:"rgb(135, 107, 98)",nether_brick_slab:"rgb(112, 2, 0)",quartz_slab:"rgb(255, 252, 245)",red_sandstone_slab:"rgb(216, 127, 51)",cut_red_sandstone_slab:"rgb(216, 127, 51)",purpur_slab:"rgb(178, 76, 216)",smooth_stone:"rgb(112, 112, 112)",smooth_sandstone:"rgb(247, 233, 163)",smooth_quartz:"rgb(255, 252, 245)",smooth_red_sandstone:"rgb(216, 127, 51)",chorus_plant:"rgb(127, 63, 178)",chorus_flower:"rgb(127, 63, 178)",purpur_block:"rgb(178, 76, 216)",purpur_pillar:"rgb(178, 76, 216)",end_stone_bricks:"rgb(247, 233, 163)",torchflower_crop:"rgb(0, 124, 0)",pitcher_crop:"rgb(0, 124, 0)",pitcher_plant:"rgb(0, 124, 0)",beetroots:"rgb(0, 124, 0)",dirt_path:"rgb(151, 109, 77)",end_gateway:"rgb(25, 25, 25)",repeating_command_block:"rgb(127, 63, 178)",chain_command_block:"rgb(102, 127, 51)",frosted_ice:"rgb(160, 160, 255)",magma_block:"rgb(112, 2, 0)",nether_wart_block:"rgb(153, 51, 51)",red_nether_bricks:"rgb(112, 2, 0)",bone_block:"rgb(247, 233, 163)",observer:"rgb(112, 112, 112)",kelp:"rgb(64, 64, 255)",kelp_plant:"rgb(64, 64, 255)",dried_kelp_block:"rgb(102, 127, 51)",turtle_egg:"rgb(247, 233, 163)",sniffer_egg:"rgb(153, 51, 51)",dead_tube_coral_block:"rgb(76, 76, 76)",dead_brain_coral_block:"rgb(76, 76, 76)",dead_bubble_coral_block:"rgb(76, 76, 76)",dead_fire_coral_block:"rgb(76, 76, 76)",dead_horn_coral_block:"rgb(76, 76, 76)",tube_coral_block:"rgb(51, 76, 178)",brain_coral_block:"rgb(242, 127, 165)",bubble_coral_block:"rgb(127, 63, 178)",fire_coral_block:"rgb(153, 51, 51)",horn_coral_block:"rgb(229, 229, 51)",dead_tube_coral:"rgb(76, 76, 76)",dead_brain_coral:"rgb(76, 76, 76)",dead_bubble_coral:"rgb(76, 76, 76)",dead_fire_coral:"rgb(76, 76, 76)",dead_horn_coral:"rgb(76, 76, 76)",tube_coral:"rgb(51, 76, 178)",brain_coral:"rgb(242, 127, 165)",bubble_coral:"rgb(127, 63, 178)",fire_coral:"rgb(153, 51, 51)",horn_coral:"rgb(229, 229, 51)",dead_tube_coral_fan:"rgb(76, 76, 76)",dead_brain_coral_fan:"rgb(76, 76, 76)",dead_bubble_coral_fan:"rgb(76, 76, 76)",dead_fire_coral_fan:"rgb(76, 76, 76)",dead_horn_coral_fan:"rgb(76, 76, 76)",tube_coral_fan:"rgb(51, 76, 178)",brain_coral_fan:"rgb(242, 127, 165)",bubble_coral_fan:"rgb(127, 63, 178)",fire_coral_fan:"rgb(153, 51, 51)",horn_coral_fan:"rgb(229, 229, 51)",dead_tube_coral_wall_fan:"rgb(76, 76, 76)",dead_brain_coral_wall_fan:"rgb(76, 76, 76)",dead_bubble_coral_wall_fan:"rgb(76, 76, 76)",dead_fire_coral_wall_fan:"rgb(76, 76, 76)",dead_horn_coral_wall_fan:"rgb(76, 76, 76)",tube_coral_wall_fan:"rgb(51, 76, 178)",brain_coral_wall_fan:"rgb(242, 127, 165)",bubble_coral_wall_fan:"rgb(127, 63, 178)",fire_coral_wall_fan:"rgb(153, 51, 51)",horn_coral_wall_fan:"rgb(229, 229, 51)",sea_pickle:"rgb(102, 127, 51)",blue_ice:"rgb(160, 160, 255)",conduit:"rgb(92, 219, 213)",bamboo_sapling:"rgb(143, 119, 72)",bamboo:"rgb(0, 124, 0)",bubble_column:"rgb(64, 64, 255)",scaffolding:"rgb(247, 233, 163)",loom:"rgb(143, 119, 72)",barrel:"rgb(143, 119, 72)",smoker:"rgb(112, 112, 112)",blast_furnace:"rgb(112, 112, 112)",cartography_table:"rgb(143, 119, 72)",fletching_table:"rgb(143, 119, 72)",grindstone:"rgb(167, 167, 167)",lectern:"rgb(143, 119, 72)",smithing_table:"rgb(143, 119, 72)",stonecutter:"rgb(112, 112, 112)",bell:"rgb(250, 238, 77)",lantern:"rgb(167, 167, 167)",soul_lantern:"rgb(167, 167, 167)",campfire:"rgb(129, 86, 49)",soul_campfire:"rgb(129, 86, 49)",sweet_berry_bush:"rgb(0, 124, 0)",warped_hyphae:"rgb(86, 44, 62)",stripped_warped_hyphae:"rgb(86, 44, 62)",warped_nylium:"rgb(22, 126, 134)",warped_fungus:"rgb(76, 127, 153)",warped_wart_block:"rgb(20, 180, 133)",warped_roots:"rgb(76, 127, 153)",nether_sprouts:"rgb(76, 127, 153)",crimson_hyphae:"rgb(92, 25, 29)",stripped_crimson_hyphae:"rgb(92, 25, 29)",crimson_nylium:"rgb(189, 48, 49)",crimson_fungus:"rgb(112, 2, 0)",shroomlight:"rgb(153, 51, 51)",weeping_vines:"rgb(112, 2, 0)",weeping_vines_plant:"rgb(112, 2, 0)",twisting_vines:"rgb(76, 127, 153)",twisting_vines_plant:"rgb(76, 127, 153)",crimson_roots:"rgb(112, 2, 0)",crimson_planks:"rgb(148, 63, 97)",warped_planks:"rgb(58, 142, 140)",structure_block:"rgb(153, 153, 153)",jigsaw:"rgb(153, 153, 153)",composter:"rgb(143, 119, 72)",target:"rgb(255, 252, 245)",bee_nest:"rgb(229, 229, 51)",beehive:"rgb(143, 119, 72)",honey_block:"rgb(216, 127, 51)",honeycomb_block:"rgb(216, 127, 51)",netherite_block:"rgb(25, 25, 25)",ancient_debris:"rgb(25, 25, 25)",crying_obsidian:"rgb(25, 25, 25)",respawn_anchor:"rgb(25, 25, 25)",lodestone:"rgb(167, 167, 167)",blackstone:"rgb(25, 25, 25)",polished_blackstone_pressure_plate:"rgb(25, 25, 25)",chiseled_nether_bricks:"rgb(112, 2, 0)",cracked_nether_bricks:"rgb(112, 2, 0)",amethyst_block:"rgb(127, 63, 178)",budding_amethyst:"rgb(127, 63, 178)",amethyst_cluster:"rgb(127, 63, 178)",tuff:"rgb(57, 41, 35)",calcite:"rgb(209, 177, 161)",tinted_glass:"rgb(76, 76, 76)",powder_snow:"rgb(255, 255, 255)",sculk_sensor:"rgb(76, 127, 153)",sculk:"rgb(25, 25, 25)",sculk_vein:"rgb(25, 25, 25)",sculk_catalyst:"rgb(25, 25, 25)",sculk_shrieker:"rgb(25, 25, 25)",oxidized_copper:"rgb(22, 126, 134)",weathered_copper:"rgb(58, 142, 140)",exposed_copper:"rgb(135, 107, 98)",copper_block:"rgb(216, 127, 51)",deepslate_copper_ore:"rgb(100, 100, 100)",lightning_rod:"rgb(216, 127, 51)",pointed_dripstone:"rgb(76, 50, 35)",dripstone_block:"rgb(76, 50, 35)",cave_vines:"rgb(0, 124, 0)",cave_vines_plant:"rgb(0, 124, 0)",spore_blossom:"rgb(0, 124, 0)",azalea:"rgb(0, 124, 0)",flowering_azalea:"rgb(0, 124, 0)",moss_carpet:"rgb(102, 127, 51)",pink_petals:"rgb(0, 124, 0)",moss_block:"rgb(102, 127, 51)",big_dripleaf:"rgb(0, 124, 0)",big_dripleaf_stem:"rgb(0, 124, 0)",small_dripleaf:"rgb(0, 124, 0)",hanging_roots:"rgb(151, 109, 77)",rooted_dirt:"rgb(151, 109, 77)",mud:"rgb(87, 92, 92)",deepslate:"rgb(100, 100, 100)",infested_deepslate:"rgb(100, 100, 100)",raw_iron_block:"rgb(216, 175, 147)",raw_copper_block:"rgb(216, 127, 51)",raw_gold_block:"rgb(250, 238, 77)",ochre_froglight:"rgb(247, 233, 163)",verdant_froglight:"rgb(127, 167, 150)",pearlescent_froglight:"rgb(242, 127, 165)",frogspawn:"rgb(64, 64, 255)",reinforced_deepslate:"rgb(100, 100, 100)",decorated_pot:"rgb(142, 60, 46)"},invisibleBlocks:{air:!0,void_air:!0,cave_air:!0,barrier:!0,light:!0,moving_piston:!0},hasSemiTransparentTextuersRegex:{_stained_glass$:!0,_stained_glass_pane$:!0,"^ice$":!0,"^tinted_glass$":!0,"^slime_block$":!0,"^honey_block$":!0}};var Ka=new Map,l8=new Set(["water","flowing_water","lava","flowing_lava","grass","short_grass","tall_grass"]);function qi(n){let e=Ka.get(n);if(e)return e;let t=o8(n),r=a8(n),i=new Set(Object.keys(Ki.noOcclusions)),s=new Set(t.blocksArray.filter(a=>Ki.invisibleBlocks[a.name]).map(a=>a.name)),o=0;for(let a of Object.keys(t.blocksByStateId))o=Math.max(o,Number(a));let l=new Uint8Array(o+1);for(let a of Object.keys(t.blocksByStateId)){let v=Number(a);if(!v)continue;let c=r.fromStateId(v,0);c&&(s.has(c.name)||i.has(c.name)||l8.has(c.name)||c.boundingBox!=="empty"&&(c.transparent&&c.boundingBox!=="block"||!c.shapes||c.shapes.length===0||(l[v]=1)))}return Ka.set(n,l),l}function Ji(n,e){return n>0&&n<e.length&&e[n]===1}var Y5=128,c8=Y5*4,W5=(n,e,t)=>`${n},${e},${t}`,kt=n=>Math.floor(n/16)*16,j5=n=>(n%16+16)%16,Xi=(n,e,t)=>n+t*16+e*256,d8=(n,e)=>{let t=e>>>5;return(n[t]&1<<(e&31))!==0},Zi=(n,e,t)=>{let r=e>>>5,i=1<<(e&31);t?n[r]|=i:n[r]&=~i},u8=n=>{for(let e=0;e<Y5;e++)if(n[e])return!1;return!0},Q5=class{constructor(e){d(this,"sections",new Map);d(this,"Chunk");d(this,"solidityTable");d(this,"worldMinY",0);d(this,"worldMaxY",256);this.Chunk=qa(e),this.solidityTable=qi(e)}setVersion(e){this.Chunk=qa(e),this.solidityTable=qi(e),this.sections.clear()}setWorldBounds(e,t){this.worldMinY===e&&this.worldMaxY===t||(this.worldMinY=e,this.worldMaxY=t,this.sections.clear())}clear(){this.sections.clear()}getAllocatedSectionCount(){return this.sections.size}getAllocatedBytes(){return this.sections.size*c8}removeColumn(e,t){let r=kt(this.worldMinY);for(let i=r;i<this.worldMaxY;i+=16)this.sections.delete(W5(e,i,t))}ingestColumn(e,t,r){let i=this.Chunk.fromJson(r),s=new v8(0,0,0);for(let o=this.worldMinY;o<this.worldMaxY;o++){s.y=o;let l=kt(o),a=o-l;for(let v=0;v<16;v++){s.z=v;let c=t+v,u=kt(c),h=c-u;for(let p=0;p<16;p++){s.x=p;let m=i.getBlockStateId(s)||0;if(!Ji(m,this.solidityTable))continue;let b=e+p,k=kt(b),_=W5(k,l,u),y=this.sections.get(_);y||(y=new Uint32Array(Y5),this.sections.set(_,y)),Zi(y,Xi(b-k,a,h),!0)}}}}setBlockStateId(e,t,r,i){if(t<this.worldMinY||t>=this.worldMaxY)return;let s=kt(e),o=kt(t),l=kt(r),a=W5(s,o,l),v=Xi(j5(e),t-o,j5(r));if(Ji(i,this.solidityTable)){let h=this.sections.get(a);h||(h=new Uint32Array(Y5),this.sections.set(a,h)),Zi(h,v,!0);return}let u=this.sections.get(a);u&&(Zi(u,v,!1),u8(u)&&this.sections.delete(a))}isSolidBlock(e,t,r){if(t<this.worldMinY||t>=this.worldMaxY)return!1;let i=this.sections.get(W5(kt(e),kt(t),kt(r)));return i?d8(i,Xi(j5(e),t-kt(t),j5(r))):!1}};function Gr(n,e){return(n%e+e)%e}var zt=class zt{constructor(e,t,r){this.resourcesManager=e;this.displayOptions=t;this.initOptions=r;d(this,"worldReadyResolvers",Promise.withResolvers());d(this,"worldReadyPromise",this.worldReadyResolvers.promise);d(this,"timeOfTheDay",0);d(this,"lastMesherSkyLight",15);d(this,"worldSizeParams",{minY:0,worldHeight:256});d(this,"cameraCollisionBlockCache");d(this,"reactiveDebugParams",h8({stopRendering:!1,chunksRenderAboveOverride:void 0,chunksRenderAboveEnabled:!1,chunksRenderBelowOverride:void 0,chunksRenderBelowEnabled:!1,chunksRenderDistanceOverride:void 0,chunksRenderDistanceEnabled:!1,disableEntities:!1,caveCullingDebug:!1,smartCull:!1}));d(this,"active",!1);d(this,"loadedChunks",{});d(this,"finishedChunks",{});d(this,"finishedSections",{});d(this,"sectionsWaiting",new Map);d(this,"queuedChunks",new Set);d(this,"queuedFunctions",[]);d(this,"renderUpdateEmitter",new m0);d(this,"customTexturesDataUrl");d(this,"workers",[]);d(this,"viewerChunkPosition");d(this,"lastViewerChunkGridX");d(this,"lastViewerChunkGridZ");d(this,"lastCamUpdate",0);d(this,"droppedFpsPercentage",0);d(this,"initialChunkLoadWasStartedIn");d(this,"initialChunksLoad",!0);d(this,"enableChunksLoadDelay",!1);d(this,"texturesVersion");d(this,"viewDistance",-1);d(this,"onRenderDistanceChanged");d(this,"chunksLength",0);d(this,"allChunksFinished",!1);d(this,"messageQueue",[]);d(this,"isProcessingQueue",!1);d(this,"ONMESSAGE_TIME_LIMIT",30);d(this,"handleResize",()=>{});d(this,"highestBlocksByChunks",new Map);d(this,"blockEntities",{});d(this,"workersProcessAverageTime",0);d(this,"workersProcessAverageTimeCount",0);d(this,"maxWorkersProcessTime",0);d(this,"workersPreAverageTime",0);d(this,"workersWasmAverageTime",0);d(this,"workersPostAverageTime",0);d(this,"workersPhaseSampleCount",0);d(this,"workersPreTargetConvertAverageTime",0);d(this,"workersPreNeighborConvertAverageTime",0);d(this,"workersPreNeighborCountAverage",0);d(this,"workersPreTypedArrayBuildAverageTime",0);d(this,"workersPreOtherAverageTime",0);d(this,"workersPreCacheHitsTotal",0);d(this,"workersPreCacheMissesTotal",0);d(this,"geometryReceiveCount",{});d(this,"allLoadedIn");d(this,"onWorldSwitched",[]);d(this,"renderTimeMax",0);d(this,"renderTimeAvg",0);d(this,"renderTimeAvgCount",0);d(this,"edgeChunks",{});d(this,"lastAddChunk",null);d(this,"neighborChunkUpdates",!0);d(this,"lastChunkDistance",0);d(this,"debugStopGeometryUpdate",!1);d(this,"protocolCustomBlocks",new Map);d(this,"mesherPoolSnapshot",{mesherWorkers:-1,wasmMesher:!1,dedicatedChangeWorker:!1});d(this,"mesherReconfigureQueue",Promise.resolve());d(this,"heightmapDebounceTimers",new Map);d(this,"sectionDirtyCount",new Map);d(this,"sectionDirtyTimers",new Map);d(this,"sectionDirtyPendingArgs",new Map);d(this,"blockStateModelInfo",new Map);d(this,"worldBlockProvider");d(this,"soundSystem");d(this,"worldRendererConfig");d(this,"playerStateReactive");d(this,"playerStateUtils");d(this,"reactiveState");d(this,"mesherLogReader");d(this,"forceCallFromMesherReplayer",!1);d(this,"stopMesherMessagesProcessing",!1);d(this,"abortController",new AbortController);d(this,"valtioUnsubs",[]);d(this,"lastRendered",0);d(this,"renderingActive",!0);d(this,"geometryReceiveCountPerSec",0);d(this,"mesherLogger",{contents:[],active:new URL(location.href).searchParams.get("mesherlog")==="true"});d(this,"currentRenderedFrames",0);d(this,"fpsAverage",0);d(this,"lastFps",0);d(this,"fpsWorst");d(this,"fpsSamples",0);d(this,"backendInfoReport","-");d(this,"chunksFullInfo","-");d(this,"workerCustomHandleTime",0);d(this,"queueAwaited",!1);d(this,"toWorkerMessagesQueue",{});this.cameraCollisionBlockCache=new Q5(this.displayOptions.version),this.snapshotInitialValues(),this.worldRendererConfig=t.inWorldRenderingConfig,this.playerStateReactive=t.playerStateReactive,this.playerStateUtils=ia(this.playerStateReactive),this.reactiveState=t.rendererState,this.renderUpdateEmitter.on("update",()=>{let o=Object.keys(this.finishedChunks).length;Qi("loaded-chunks",`${o}/${this.chunksLength} chunks (${this.lastChunkDistance}/${this.viewDistance})`)}),T0("downloaded-chunks",100,140,20,{className:S0}),this.connect(this.displayOptions.worldView);let i=setInterval(()=>{this.geometryReceiveCountPerSec=Object.values(this.geometryReceiveCount).reduce((o,l)=>o+l,0),this.geometryReceiveCount={},ja(this.displayAdvancedStats),this.updateChunksStats()},500),s=setInterval(()=>{this.fpsUpdate()},1e3);this.abortController.signal.addEventListener("abort",()=>{clearInterval(i),clearInterval(s)})}anyModuleRequiresHeightmap(){return!1}isShaderCubeBlocksEnabled(){return this.worldRendererConfig.shaderCubeBlocks===!0}shaderCubeBlocksEnabled(){return this.isShaderCubeBlocksEnabled()}get version(){return this.displayOptions.version}get displayAdvancedStats(){return(this.initOptions.config.statsVisible??0)>1}fpsUpdate(){this.fpsSamples++,this.fpsAverage=(this.fpsAverage*(this.fpsSamples-1)+this.currentRenderedFrames)/this.fpsSamples,this.fpsWorst===void 0?this.fpsWorst=this.currentRenderedFrames:this.fpsWorst=Math.min(this.fpsWorst,this.currentRenderedFrames),this.lastFps=this.currentRenderedFrames,this.displayOptions.nonReactiveState.fps=this.currentRenderedFrames,this.displayOptions.nonReactiveState.worstRenderTime=this.renderTimeMax,this.displayOptions.nonReactiveState.avgRenderTime=this.renderTimeAvg,this.currentRenderedFrames=0}logWorkerWork(e){this.mesherLogger.active&&this.mesherLogger.contents.push(typeof e=="function"?e():e)}async init(){if(this.active)throw new Error("WorldRendererCommon is already initialized");await Promise.all([this.resetWorkers(),(async()=>{this.resourcesManager.currentResources?.allReady&&await this.updateAssetsData()})()]);let e=async()=>{this.active&&await this.updateAssetsData()};Qa(this.resourcesManager,"assetsTexturesUpdated",e,this.abortController.signal),this.watchReactivePlayerState(),this.watchReactiveConfig(),this.watchMesherPoolConfig(),this.worldReadyResolvers.resolve()}snapshotInitialValues(){}wasChunkSentToWorker(e){return this.loadedChunks[e]}async getHighestBlocks(e){return this.highestBlocksByChunks.get(e)}updateCustomBlock(e,t,r){if(this.protocolCustomBlocks.set(e,{...this.protocolCustomBlocks.get(e),[t]:r}),this.logWorkerWork(()=>`-> updateCustomBlock ${e} ${t} ${r} ${this.wasChunkSentToWorker(e)}`),this.wasChunkSentToWorker(e)){let[i,s,o]=t.split(",").map(Number);this.setBlockStateId(new Vr(i,s,o),void 0)}}async getBlockInfo(e,t){let i=`${Math.floor(e.x/16)*16},${Math.floor(e.z/16)*16}`,s=this.protocolCustomBlocks.get(i)?.[`${e.x},${e.y},${e.z}`],o=Na(t,s),l=this.blockStateModelInfo.get(o);return{customBlockName:s,modelInfo:l}}getMesherWorkerScript(){return this.worldRendererConfig.wasmMesher?"wasm":"legacy"}createMesherWorker(){let e=this.getMesherWorkerScript();return m8(t=>{Array.isArray(t)?this.messageQueue.push(...t):this.messageQueue.push(t),this.processMessageQueue("worker")},e==="wasm"?"mesherWasm.js":"mesher.js")}initWorkers(e=this.worldRendererConfig.mesherWorkers){for(let t=0;t<e;t++)this.workers.push(this.createMesherWorker())}syncMesherPoolSnapshot(){this.mesherPoolSnapshot={mesherWorkers:this.worldRendererConfig.mesherWorkers,wasmMesher:this.worldRendererConfig.wasmMesher,dedicatedChangeWorker:this.worldRendererConfig.dedicatedChangeWorker}}watchMesherPoolConfig(){this.syncMesherPoolSnapshot();let e=()=>{let t=this.worldRendererConfig,r=this.mesherPoolSnapshot;t.mesherWorkers===r.mesherWorkers&&t.wasmMesher===r.wasmMesher&&t.dedicatedChangeWorker===r.dedicatedChangeWorker||(this.syncMesherPoolSnapshot(),this.enqueueMesherWorkersReconfigure())};for(let t of["mesherWorkers","wasmMesher","dedicatedChangeWorker"])this.valtioUnsubs.push(this.onReactiveConfigUpdated(t,e,!1))}enqueueMesherWorkersReconfigure(){this.mesherReconfigureQueue=this.mesherReconfigureQueue.then(()=>this.reconfigureMesherWorkers()).catch(e=>{})}clearMesherPendingState(){this.sectionsWaiting.clear(),this.toWorkerMessagesQueue={},this.queueAwaited=!1,this.messageQueue=[],this.isProcessingQueue=!1;for(let e of this.sectionDirtyTimers.values())clearTimeout(e);this.sectionDirtyTimers.clear(),this.sectionDirtyCount.clear(),this.sectionDirtyPendingArgs.clear(),this.reactiveState.world.mesherWork=!1}terminateAllMesherWorkers(){for(let e of this.workers)e.terminate();this.workers=[]}async bootstrapMesherWorkers(){this.workers.length!==0&&(this.sendMesherMcData(),await this.updateAssetsData(),this.logWorkerWork("# mesher workers bootstrapped"))}async reconfigureMesherWorkers(){this.active&&(this.clearMesherPendingState(),this.terminateAllMesherWorkers(),this.initWorkers(),await this.bootstrapMesherWorkers(),this.active&&await this.requestLoadedChunksReload())}async requestLoadedChunksReload(){try{let e=this.displayOptions.worldView;if(typeof e.reloadLoadedChunks=="function"){await e.reloadLoadedChunks();return}let t=globalThis;typeof t.WorkerGlobalScope<"u"&&globalThis instanceof t.WorkerGlobalScope&&self.postMessage({type:"reloadLoadedChunks"})}catch{}}onReactivePlayerStateUpdated(e,t,r=!0){return r&&t(this.playerStateReactive[e]),$i(this.playerStateReactive,e,t)}onReactiveConfigUpdated(e,t,r=!0){return r&&t(this.worldRendererConfig[e]),e==="*"?f8(this.worldRendererConfig,t):$i(this.worldRendererConfig,e,t)}onReactiveDebugUpdated(e,t){t(this.reactiveDebugParams[e]),$i(this.reactiveDebugParams,e,t)}watchReactivePlayerState(){this.valtioUnsubs.push(this.onReactivePlayerStateUpdated("backgroundColor",e=>{this.changeBackgroundColor(e)})),this.valtioUnsubs.push(this.onReactivePlayerStateUpdated("cardinalLight",e=>{this.changeCardinalLight(e)}))}watchReactiveConfig(){this.valtioUnsubs.push(this.onReactiveConfigUpdated("fetchPlayerSkins",e=>{U5({apiEnabled:e})}))}async processMessageQueue(e){if(this.isProcessingQueue||this.messageQueue.length===0)return;if(this.logWorkerWork(`# ${e} processing queue`),this.lastRendered&&performance.now()-this.lastRendered>this.ONMESSAGE_TIME_LIMIT&&this.worldRendererConfig._experimentalSmoothChunkLoading&&this.renderingActive){let i=performance.now();await new Promise(s=>{requestAnimationFrame(s)}),this.logWorkerWork(`# processing got delayed by ${performance.now()-i}ms`)}this.isProcessingQueue=!0;let t=performance.now(),r=0;for(;this.messageQueue.length>0;){let i=this.stopMesherMessagesProcessing;if(!i){let s=this.messageQueue.shift();this.handleMessage(s),r++}if(i||performance.now()-t>this.ONMESSAGE_TIME_LIMIT&&this.renderingActive&&this.worldRendererConfig._experimentalSmoothChunkLoading){if(this.messageQueue.length>0){requestAnimationFrame(async()=>{this.isProcessingQueue=!1,this.processMessageQueue("queue-delay")});return}break}}this.isProcessingQueue=!1}handleMessage(e){var r,i;let t=e;if(this.active){if(this.mesherLogReader?.workerMessageReceived(t.type,t),t.type!=="geometry"||!this.debugStopGeometryUpdate){let s=performance.now();this.handleWorkerMessage(t),this.workerCustomHandleTime+=performance.now()-s}if(t.type==="geometry"){this.logWorkerWork(()=>`-> ${t.workerIndex} geometry ${t.key} ${JSON.stringify({dataSize:JSON.stringify(t).length})}`),(r=this.geometryReceiveCount)[i=t.workerIndex]??(r[i]=0),this.geometryReceiveCount[t.workerIndex]++;let s=t.key.split(",").map(Number);this.lastChunkDistance=Math.max(...this.getDistance(new Vr(s[0],0,s[2])))}if(t.type==="sectionFinished"){if(this.logWorkerWork(`<- ${t.workerIndex} sectionFinished ${t.key} ${JSON.stringify({processTime:t.processTime})}`),!this.sectionsWaiting.has(t.key))return;this.sectionsWaiting.set(t.key,this.sectionsWaiting.get(t.key)-1),this.sectionsWaiting.get(t.key)===0&&(this.sectionsWaiting.delete(t.key),this.finishedSections[t.key]=!0);let s=t.key.split(",").map(Number),o=`${s[0]},${s[2]}`;if(this.loadedChunks[o]){let l=!0,a=this.getSectionHeight();for(let v=this.worldMinYRender;v<this.worldSizeParams.worldHeight;v+=a)if(!this.finishedSections[`${s[0]},${v},${s[2]}`]){l=!1;break}if(l){this.finishedChunks[o]=!0;let v=16,c=`${Math.floor(s[0]/v)},${Math.floor(s[2]/v)}`;this.reactiveState.world.chunksLoaded[c]=!0,this.renderUpdateEmitter.emit("chunkFinished",`${s[0]},${s[2]}`),this.checkAllFinished()}}if(this.renderUpdateEmitter.emit("update"),t.processTime&&(this.workersProcessAverageTimeCount++,this.workersProcessAverageTime=(this.workersProcessAverageTime*(this.workersProcessAverageTimeCount-1)+t.processTime)/this.workersProcessAverageTimeCount,this.maxWorkersProcessTime=Math.max(this.maxWorkersProcessTime,t.processTime)),typeof t.pre=="number"&&typeof t.wasm=="number"&&typeof t.post=="number"&&(t.pre>0||t.wasm>0||t.post>0)){let l=++this.workersPhaseSampleCount;this.workersPreAverageTime=(this.workersPreAverageTime*(l-1)+t.pre)/l,this.workersWasmAverageTime=(this.workersWasmAverageTime*(l-1)+t.wasm)/l,this.workersPostAverageTime=(this.workersPostAverageTime*(l-1)+t.post)/l;let a=typeof t.preTargetConvert=="number"?t.preTargetConvert:0,v=typeof t.preNeighborConvert=="number"?t.preNeighborConvert:0,c=typeof t.preNeighborCount=="number"?t.preNeighborCount:0,u=typeof t.preTypedArrayBuild=="number"?t.preTypedArrayBuild:0,h=typeof t.preOther=="number"?t.preOther:0,p=typeof t.preCacheHits=="number"?t.preCacheHits:0,m=typeof t.preCacheMisses=="number"?t.preCacheMisses:0;if(this.workersPreTargetConvertAverageTime=(this.workersPreTargetConvertAverageTime*(l-1)+a)/l,this.workersPreNeighborConvertAverageTime=(this.workersPreNeighborConvertAverageTime*(l-1)+v)/l,this.workersPreNeighborCountAverage=(this.workersPreNeighborCountAverage*(l-1)+c)/l,this.workersPreTypedArrayBuildAverageTime=(this.workersPreTypedArrayBuildAverageTime*(l-1)+u)/l,this.workersPreOtherAverageTime=(this.workersPreOtherAverageTime*(l-1)+h)/l,this.workersPreCacheHitsTotal+=p,this.workersPreCacheMissesTotal+=m,this.worldRendererConfig.debugWasmPerf&&l%zt.PHASE_PERF_LOG_INTERVAL===0){let b=this.workersPreAverageTime+this.workersWasmAverageTime+this.workersPostAverageTime,k=b>0?this.workersPreAverageTime/b*100:0,_=b>0?this.workersWasmAverageTime/b*100:0,y=b>0?this.workersPostAverageTime/b*100:0,M=this.workersPreAverageTime,T=M>0?this.workersPreTargetConvertAverageTime/M*100:0,S=M>0?this.workersPreNeighborConvertAverageTime/M*100:0,B=M>0?this.workersPreTypedArrayBuildAverageTime/M*100:0,P=M>0?this.workersPreOtherAverageTime/M*100:0,H=this.workersPreNeighborCountAverage,V=H>0?this.workersPreNeighborConvertAverageTime/H:0,z=this.workersPreCacheHitsTotal+this.workersPreCacheMissesTotal,N=z>0?this.workersPreCacheHitsTotal/z*100:0}}}if(t.type==="blockStateModelInfo")for(let[s,o]of Object.entries(t.info))this.blockStateModelInfo.set(s,o);if(t.type==="heightmap"){let s=new Int16Array(t.heightmap);this.reactiveState.world.heightmaps[t.key]=s}if(t.type==="neighborDataArrived"){let s=this.getSectionHeight();for(let o=this.worldMinYRender;o<this.worldSizeParams.worldHeight;o+=s)this.setSectionDirty(new Vr(t.x,o,t.z))}}}downloadMesherLog(){let e=document.createElement("a");e.href="data:text/plain;charset=utf-8,"+encodeURIComponent(this.mesherLogger.contents.join(`
330
- `)),e.download="mesher.log",e.click()}checkAllFinished(){this.sectionsWaiting.size===0&&(this.reactiveState.world.mesherWork=!1),Object.keys(this.finishedChunks).length>=this.chunksLength&&(this.allChunksLoaded?.(),this.allChunksFinished=!0,this.allLoadedIn??(this.allLoadedIn=Date.now()-this.initialChunkLoadWasStartedIn)),this.updateChunksStats()}changeHandSwingingState(e,t){}updateViewerPosition(e){this.viewerChunkPosition=e;for(let[i,s]of Object.entries(this.loadedChunks))s&&this.updatePosDataChunk?.(i);let t=Math.floor(e.x/16),r=Math.floor(e.z/16);(t!==this.lastViewerChunkGridX||r!==this.lastViewerChunkGridZ)&&(this.lastViewerChunkGridX=t,this.lastViewerChunkGridZ=r,this.onViewerChunkPositionChanged())}onViewerChunkPositionChanged(){}sendWorkers(e){for(let t of this.workers)t.postMessage(e)}getDistance(e){let[t,r]=Va(this.viewerChunkPosition),i=16,s=Math.abs(t-Math.floor(e.x/i)),o=Math.abs(r-Math.floor(e.z/i));return[s,o]}resetWorld(){for(let e of this.workers)e.terminate();this.workers=[]}async resetWorkers(){this.resetWorld(),typeof document<"u"&&document?.readyState==="loading"&&await new Promise(e=>{document.addEventListener("DOMContentLoaded",e)}),this.initWorkers(),this.active=!0,this.syncMesherPoolSnapshot(),this.sendMesherMcData()}getMesherConfig(){let e=this.timeOfTheDay,t=e<0||e>24e3?15:Ft(e);return{version:this.version,enableLighting:this.worldRendererConfig.enableLighting,skyLight:t,smoothLighting:this.worldRendererConfig.smoothLighting,shadingTheme:this.worldRendererConfig.shadingTheme,cardinalLight:this.worldRendererConfig.cardinalLight,outputFormat:this.outputFormat,debugModelVariant:this.worldRendererConfig.debugModelVariant,clipWorldBelowY:this.worldRendererConfig.clipWorldBelowY,disableBlockEntityTextures:!this.worldRendererConfig.extraBlockRenderers,worldMinY:this.worldMinYRender,worldMaxY:this.worldMinYRender+this.worldSizeParams.worldHeight,disableConversionCache:this.worldRendererConfig.disableMesherConversionCache,computeWireframeEdges:this.worldRendererConfig.futuristicReveal===!0,shaderCubeBlocks:this.isShaderCubeBlocksEnabled()}}sendMesherMcData(){let e=this.resourcesManager.currentResources.mcData;Xa(this.workers,this.version,k0,e),this.logWorkerWork("# mcData sent")}async updateAssetsData(){let e=this.resourcesManager.currentResources;if(this.workers.length===0)throw new Error("workers not initialized yet");for(let[t,r]of this.workers.entries()){let{blockstatesModels:i}=e;r.postMessage({type:"mesherData",workerIndex:t,blocksAtlas:{latest:e.blocksAtlasJson},blockstatesModels:i,config:this.getMesherConfig()})}this.logWorkerWork("# mesherData sent")}getSectionHeight(){return Ga}get worldMinYRender(){let e=this.getSectionHeight();return Math.floor(Math.max(this.worldSizeParams.minY,this.worldRendererConfig.clipWorldBelowY??-1/0)/e)*e}updateChunksStats(){let e=Object.keys(this.finishedChunks);this.displayOptions.nonReactiveState.world.chunksLoadedCount=e.length,this.displayOptions.nonReactiveState.world.chunksTotalNumber=this.chunksLength,this.reactiveState.world.allChunksLoaded=this.allChunksFinished;let t=`Q: ${this.messageQueue.length} ${Object.keys(this.loadedChunks).length}/${Object.keys(this.finishedChunks).length}/${this.chunksLength} chunks (${this.workers.length}:${this.workersProcessAverageTime.toFixed(0)}ms/${this.geometryReceiveCountPerSec}ss/${this.allLoadedIn?.toFixed(1)??"-"}s)`;this.chunksFullInfo=t,this.displayOptions.nonReactiveState.world.chunksFullInfo=t,Qi("downloaded-chunks",t)}addColumn(e,t,r,i){if(!this.active)return;if(this.workers.length===0)throw new Error("workers not initialized yet");this.initialChunksLoad=!1,this.initialChunkLoadWasStartedIn??(this.initialChunkLoadWasStartedIn=Date.now()),this.loadedChunks[`${e},${t}`]=!0,this.updateChunksStats();let s=`${e},${t}`,o=this.protocolCustomBlocks.get(s);for(let v of this.workers)v.postMessage({type:"chunk",x:e,z:t,chunk:r,customBlockModels:o||void 0});this.worldRendererConfig.wasmMesher||this.workers[0].postMessage({type:"getHeightmap",x:e,z:t}),this.logWorkerWork(()=>`-> chunk ${JSON.stringify({x:e,z:t,chunkLength:r.length,customBlockModelsLength:o?Object.keys(o).length:0})}`),this.mesherLogReader?.chunkReceived(e,t,r.length),this.cameraCollisionBlockCache.ingestColumn(e,t,r);let l=this.getSectionHeight(),a=16;for(let v=this.worldMinYRender;v<this.worldSizeParams.worldHeight;v+=l){let c=new Vr(e,v,t);this.setSectionDirty(c),this.neighborChunkUpdates&&(!i||this.worldRendererConfig.smoothLighting)&&(this.setSectionDirty(c.offset(-a,0,0)),this.setSectionDirty(c.offset(a,0,0)),this.setSectionDirty(c.offset(0,0,-a)),this.setSectionDirty(c.offset(0,0,a)))}}markAsLoaded(e,t){this.loadedChunks[`${e},${t}`]=!0,this.finishedChunks[`${e},${t}`]=!0,this.logWorkerWork(`-> markAsLoaded ${JSON.stringify({x:e,z:t})}`),this.renderUpdateEmitter.emit("chunkFinished",`${e},${t}`),this.checkAllFinished()}removeColumn(e,t){var l;delete this.loadedChunks[`${e},${t}`];let r=`${e},${t}`,i=this.heightmapDebounceTimers.get(r);i&&(clearTimeout(i),this.heightmapDebounceTimers.delete(r));for(let[a,v]of this.sectionDirtyTimers)a.startsWith(`${e},`)&&a.endsWith(`,${t}`)&&(clearTimeout(v),this.sectionDirtyTimers.delete(a),this.sectionDirtyCount.delete(a),this.sectionDirtyPendingArgs.delete(a));for(let a=0;a<this.workers.length;a++)(l=this.toWorkerMessagesQueue)[a]??(l[a]=[]),this.toWorkerMessagesQueue[a].push({type:"unloadChunk",x:e,z:t});this.dispatchMessages(),this.logWorkerWork(`-> unloadChunk ${JSON.stringify({x:e,z:t})}`),delete this.finishedChunks[`${e},${t}`],this.allChunksFinished=Object.keys(this.finishedChunks).length===this.chunksLength,Object.keys(this.finishedChunks).length===0&&(this.allLoadedIn=void 0,this.initialChunkLoadWasStartedIn=void 0);let s=this.getSectionHeight();for(let a=this.worldMinYRender;a<this.worldSizeParams.worldHeight;a+=s){let v=`${e},${a},${t}`,c=this.sectionsWaiting.get(v);c!==void 0&&c>0,this.sectionsWaiting.delete(v),delete this.finishedSections[v]}this.highestBlocksByChunks.delete(`${e},${t}`),this.cameraCollisionBlockCache.removeColumn(e,t);let o=`${Math.floor(e/16)},${Math.floor(t/16)}`;delete this.reactiveState.world.heightmaps[o],this.updateChunksStats(),Object.keys(this.loadedChunks).length===0&&(this.mesherLogger.contents=[],this.logWorkerWork("# all chunks unloaded. New log started"),this.mesherLogReader?.maybeStartReplay())}setBlockStateId(e,t,r=!0){(async()=>{let o=Math.floor(e.x/16)*16,l=Math.floor(e.z/16)*16;this.queuedChunks.has(`${o},${l}`)&&await new Promise(a=>{this.queuedFunctions.push(()=>{a()})}),this.loadedChunks[`${o},${l}`],this.setBlockStateIdInner(e,t,r)})()}updateEntity(e,t=!1){}lightUpdate(e,t){}connect(e){let t=e,r=this.abortController.signal;Je(t,"entity",s=>{this.updateEntity(s,!1)},r),Je(t,"entityMoved",s=>{this.updateEntity(s,!0)},r),Je(t,"playerEntity",s=>{this.updatePlayerEntity?.(s)},r);let i=null;Je(t,"loadChunk",({x:s,z:o,chunk:l,worldConfig:a,isLightUpdate:v})=>{this.worldSizeParams=a,this.cameraCollisionBlockCache.setWorldBounds(a.minY,a.worldHeight),this.queuedChunks.add(`${s},${o}`);let c=[s,o,l,v];i||(i={data:[],timeout:setTimeout(()=>{for(let u of i.data)this.queuedChunks.delete(`${u[0]},${u[1]}`),this.addColumn(...u);for(let u of this.queuedFunctions)u();this.queuedFunctions=[],i=null},this.worldRendererConfig.addChunksBatchWaitTime)}),i.data.push(c)},r),Je(t,"blockEntities",s=>{this.blockEntities=s},r),Je(t,"unloadChunk",({x:s,z:o})=>{this.removeColumn(s,o)},r),Je(t,"blockUpdate",({pos:s,stateId:o})=>{this.setBlockStateId(new Vr(s.x,s.y,s.z),o)},r),Je(t,"chunkPosUpdate",({pos:s})=>{this.updateViewerPosition(s)},r),Je(t,"end",()=>{this.worldStop?.()},r),Je(t,"renderDistance",s=>{this.viewDistance=s,this.chunksLength=s===0?1:Tr(s).length,this.allChunksFinished=Object.keys(this.finishedChunks).length===this.chunksLength,this.onRenderDistanceChanged?.(s)},r),Je(t,"markAsLoaded",({x:s,z:o})=>{this.markAsLoaded(s,o)},r),Je(t,"updateLight",({pos:s})=>{this.lightUpdate(s.x,s.z)},r),Je(t,"onWorldSwitch",()=>{this.cameraCollisionBlockCache.clear();for(let s of this.onWorldSwitched)try{s()}catch(o){setTimeout(()=>{throw o},0)}},r),Je(t,"time",s=>{if(!this.worldRendererConfig.dayCycle)return;this.timeUpdated?.(s),this.timeOfTheDay=s;let o=s<0||s>24e3?15:Ft(s);this.lastMesherSkyLight!==o&&(this.lastMesherSkyLight=o,this.workers.length>0&&this.sendWorkers({config:{skyLight:o}}),this.onDayCycleSkyLightChanged?.(o))},r),Je(t,"biomeUpdate",({biome:s})=>{this.biomeUpdated?.(s)},r),Je(t,"biomeReset",()=>{this.biomeReset?.()},r)}setBlockStateIdInner(e,t,r=!0){let s=`${Math.floor(e.x/16)*16},${Math.floor(e.z/16)*16}`,o=`${e.x},${e.y},${e.z}`,l=this.protocolCustomBlocks.get(s)||{};for(let a of this.workers)a.postMessage({type:"blockUpdate",pos:e,stateId:t,customBlockModels:l});if(this.anyModuleRequiresHeightmap()){let a=Math.floor(e.x/16)*16,v=Math.floor(e.z/16)*16,c=`${a},${v}`;if(!this.worldRendererConfig.wasmMesher){let u=this.heightmapDebounceTimers.get(c);u&&clearTimeout(u),this.heightmapDebounceTimers.set(c,setTimeout(()=>{this.heightmapDebounceTimers.delete(c),this.workers[0]?.postMessage({type:"getHeightmap",x:a,z:v})},100))}}if(this.logWorkerWork(`-> blockUpdate ${JSON.stringify({pos:e,stateId:t,customBlockModels:l})}`),t!==void 0&&this.cameraCollisionBlockCache.setBlockStateId(e.x,e.y,e.z,t),this.setSectionDirty(e,!0,!0),this.neighborChunkUpdates){let v=this.getSectionHeight();e.x&15||this.setSectionDirty(e.offset(-16,0,0),!0,!0),(e.x&15)===15&&this.setSectionDirty(e.offset(16,0,0),!0,!0),e.y&v-1||this.setSectionDirty(e.offset(0,-v,0),!0,!0),(e.y&v-1)===v-1&&this.setSectionDirty(e.offset(0,v,0),!0,!0),e.z&15||this.setSectionDirty(e.offset(0,0,-16),!0,!0),(e.z&15)===15&&this.setSectionDirty(e.offset(0,0,16),!0,!0),r&&(!(e.x&15)&&!(e.z&15)&&this.setSectionDirty(e.offset(-16,0,-16),!0,!0),(e.x&15)===15&&!(e.z&15)&&this.setSectionDirty(e.offset(16,0,-16),!0,!0),!(e.x&15)&&(e.z&15)===15&&this.setSectionDirty(e.offset(-16,0,16),!0,!0),(e.x&15)===15&&(e.z&15)===15&&this.setSectionDirty(e.offset(16,0,16),!0,!0),!(e.x&15)&&!(e.y&v-1)&&this.setSectionDirty(e.offset(-16,-v,0),!0,!0),(e.x&15)===15&&!(e.y&v-1)&&this.setSectionDirty(e.offset(16,-v,0),!0,!0),!(e.z&15)&&!(e.y&v-1)&&this.setSectionDirty(e.offset(0,-v,-16),!0,!0),(e.z&15)===15&&!(e.y&v-1)&&this.setSectionDirty(e.offset(0,-v,16),!0,!0),!(e.y&v-1)&&!(e.x&15)&&!(e.z&15)&&this.setSectionDirty(e.offset(-16,-v,-16),!0,!0),!(e.y&v-1)&&(e.x&15)===15&&!(e.z&15)&&this.setSectionDirty(e.offset(16,-v,-16),!0,!0),!(e.y&v-1)&&!(e.x&15)&&(e.z&15)===15&&this.setSectionDirty(e.offset(-16,-v,16),!0,!0),!(e.y&v-1)&&(e.x&15)===15&&(e.z&15)===15&&this.setSectionDirty(e.offset(16,-v,16),!0,!0))}}getWorkerNumber(e,t=!1){let i=this.getSectionHeight();if(this.worldRendererConfig.dedicatedChangeWorker&&this.workers.length>1){if(this.worldRendererConfig.wasmMesher)return Gr(Math.floor(e.x/16)+Math.floor(e.z/16),this.workers.length);if(t){let l=`${Math.floor(e.x/16)*16},${Math.floor(e.y/i)*i},${Math.floor(e.z/16)*16}`;if(this.sectionsWaiting.get(l)&&!this.finishedSections[l]){let v=this.workers.length-1;return Gr(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),v)}return this.workers.length-1}let o=this.workers.length-1;return Gr(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),o)}if(this.worldRendererConfig.wasmMesher)return Gr(Math.floor(e.x/16)+Math.floor(e.z/16),this.workers.length);if(t){let o=`${Math.floor(e.x/16)*16},${Math.floor(e.y/i)*i},${Math.floor(e.z/16)*16}`;if(!(this.sectionsWaiting.get(o)&&!this.finishedSections[o]))return 0}return Gr(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),this.workers.length)}async debugGetWorkerCustomBlockModel(e){let t=[];for(let r of this.workers)t.push(new Promise(i=>{r.addEventListener("message",s=>{s.data.type==="customBlockModel"&&i(s.data.customBlockModel)})})),r.postMessage({type:"getCustomBlockModel",pos:e});return Promise.all(t)}setSectionDirty(e,t=!0,r=!1){if(!this.forceCallFromMesherReplayer&&this.mesherLogReader)return;if(this.viewDistance===-1)throw new Error("viewDistance not set");let i=this.getDistance(e);if(!this.workers.length||i[0]>this.viewDistance||i[1]>this.viewDistance)return;if(!t){this._dispatchDirtyImmediate(e,t,r);return}let s=16,o=this.getSectionHeight(),l=`${Math.floor(e.x/s)*s},${Math.floor(e.y/o)*o},${Math.floor(e.z/s)*s}`,a=(this.sectionDirtyCount.get(l)??0)+1;this.sectionDirtyCount.set(l,a),a<=zt.GEOMETRY_THROTTLE_THRESHOLD?(this._dispatchDirtyImmediate(e,t,r),this.sectionDirtyTimers.has(l)||this.sectionDirtyTimers.set(l,setTimeout(()=>{let v=this.sectionDirtyPendingArgs.get(l);this.sectionDirtyCount.delete(l),this.sectionDirtyTimers.delete(l),this.sectionDirtyPendingArgs.delete(l),v&&this._dispatchDirtyImmediate(v.pos,v.value,v.useChangeWorker)},zt.GEOMETRY_THROTTLE_DELAY))):(this.sectionDirtyPendingArgs.set(l,{pos:e,value:t,useChangeWorker:r}),this.sectionDirtyTimers.has(l)||this.sectionDirtyTimers.set(l,setTimeout(()=>{let v=this.sectionDirtyPendingArgs.get(l);this.sectionDirtyCount.delete(l),this.sectionDirtyTimers.delete(l),this.sectionDirtyPendingArgs.delete(l),v&&this._dispatchDirtyImmediate(v.pos,v.value,v.useChangeWorker)},zt.GEOMETRY_THROTTLE_DELAY)))}_dispatchDirtyImmediate(e,t,r){var a;this.reactiveState.world.mesherWork=!0;let i=16,s=this.getSectionHeight(),o=`${Math.floor(e.x/i)*i},${Math.floor(e.y/s)*s},${Math.floor(e.z/i)*i}`;this.renderUpdateEmitter.emit("dirty",e,t);let l=this.getWorkerNumber(e,r&&(this.mesherLogger.active||this.worldRendererConfig.dedicatedChangeWorker));this.sectionsWaiting.set(o,(this.sectionsWaiting.get(o)??0)+1),this.forceCallFromMesherReplayer?this.workers[l].postMessage({type:"dirty",x:e.x,y:e.y,z:e.z,value:t,config:this.getMesherConfig()}):((a=this.toWorkerMessagesQueue)[l]??(a[l]=[]),this.toWorkerMessagesQueue[l].push({type:"dirty",x:e.x,y:e.y,z:e.z,value:t,config:this.getMesherConfig()}),this.dispatchMessages())}dispatchMessages(){this.queueAwaited||(this.queueAwaited=!0,setTimeout(()=>{for(let e in this.toWorkerMessagesQueue){let t=this.workers[Number(e)],r=this.toWorkerMessagesQueue[e];t.postMessage(r);for(let i of r)this.logWorkerWork(`-> ${e} dispatchMessages ${i.type} ${JSON.stringify({x:i.x,y:i.y,z:i.z,value:i.value})}`)}this.toWorkerMessagesQueue={},this.queueAwaited=!1}))}async waitForChunksToRender(){return new Promise((e,t)=>{if([...this.sectionsWaiting].length===0){e();return}let r=()=>{this.sectionsWaiting.size===0&&(this.renderUpdateEmitter.removeListener("update",r),e())};this.renderUpdateEmitter.on("update",r)})}async waitForChunkToLoad(e){return new Promise((t,r)=>{let s=`${Math.floor(e.x/16)*16},${Math.floor(e.z/16)*16}`;if(this.loadedChunks[s]){t();return}let o=()=>{this.loadedChunks[s]&&(this.renderUpdateEmitter.removeListener("update",o),t())};this.renderUpdateEmitter.on("update",o)})}destroy(){for(let e of this.valtioUnsubs)e();this.valtioUnsubs=[];for(let e of this.heightmapDebounceTimers.values())clearTimeout(e);this.heightmapDebounceTimers.clear();for(let e of this.sectionDirtyTimers.values())clearTimeout(e);this.sectionDirtyTimers.clear(),this.sectionDirtyCount.clear(),this.sectionDirtyPendingArgs.clear();for(let e of this.workers)e.terminate();this.workers=[],this.soundSystem&&(this.soundSystem.destroy(),this.soundSystem=void 0),this.active=!1,this.loadedChunks={},this.finishedChunks={},this.finishedSections={},this.sectionsWaiting.clear(),this.queuedChunks.clear(),this.blockStateModelInfo.clear(),this.renderUpdateEmitter.removeAllListeners(),this.abortController.abort(),Ya()}};d(zt,"PHASE_PERF_LOG_INTERVAL",64),d(zt,"GEOMETRY_THROTTLE_THRESHOLD",1),d(zt,"GEOMETRY_THROTTLE_DELAY",100);var K5=zt,m8=(n,e="mesher.js")=>{let t;if(L.env.SINGLE_FILE_BUILD){let r=document.getElementById("mesher-worker-code").textContent,i=new Blob([r],{type:"text/javascript"});t=new Worker(window.URL.createObjectURL(i))}else t=new Worker(e);return t.onmessage=({data:r})=>{n(r)},t.on&&t.on("message",r=>{t.onmessage({data:r})}),t},Ja=!1,Xa=(n,e,t=k0,r)=>{let i={version:JSON.parse(JSON.stringify(r.version))};for(let[s,o]of Object.entries(t))i[s]=r[o];"tints"in t&&!i.tints&&!Ja&&(Ja=!0);for(let s of n)s.postMessage({type:"mcData",mcData:i})},e1=(n,e,t=k0,r,i=1e4)=>Promise.all(n.map(s=>new Promise((o,l)=>{let a=setTimeout(()=>{s.removeEventListener("message",v),l(new Error(`mcData transfer timeout (${i}ms)`))},i),v=({data:c})=>{c?.type==="mcDataApplied"&&(clearTimeout(a),s.removeEventListener("message",v),o())};s.addEventListener("message",v),Xa([s],e,t,r)}))).then(()=>{});N5();A();E();R();x();import{Vec3 as p8}from"vec3";import*as mt from"three";A();E();R();x();function J5(n,e){let t=e/180*Math.PI,r=Math.cos(t),i=Math.sin(t),s={x:0,y:1,z:2}[n],o=(s+1)%3,l=(s+2)%3,a=[[0,0,0],[0,0,0],[0,0,0]];return a[s][s]=1,a[o][o]=r,a[o][l]=-i,a[l][o]=+i,a[l][l]=r,a}function t1(n,e){return e?[n[0]+e[0],n[1]+e[1],n[2]+e[2]]:n}function q5(n,e){return e?[n[0]-e[0],n[1]-e[1],n[2]-e[2]]:n}function M0(n,e){return n?[n[0][0]*e[0]+n[0][1]*e[1]+n[0][2]*e[2],n[1][0]*e[0]+n[1][1]*e[1]+n[1][2]*e[2],n[2][0]*e[0]+n[2][1]*e[1]+n[2][2]*e[2]]:e}function r1(n,e){let t=[[0,0,0],[0,0,0],[0,0,0]],r=n[0][0],i=n[1][0],s=n[2][0],o=n[0][1],l=n[1][1],a=n[2][1],v=n[0][2],c=n[1][2],u=n[2][2],h=e[0][0],p=e[1][0],m=e[2][0],b=e[0][1],k=e[1][1],_=e[2][1],y=e[0][2],M=e[1][2],T=e[2][2];return t[0][0]=r*h+i*b+s*y,t[1][0]=r*p+i*k+s*M,t[2][0]=r*m+i*_+s*T,t[0][1]=o*h+l*b+a*y,t[1][1]=o*p+l*k+a*M,t[2][1]=o*m+l*_+a*T,t[0][2]=v*h+c*b+u*y,t[1][2]=v*p+c*k+u*M,t[2][2]=v*m+c*_+u*T,t}function Za(n){let e=J5(n.axis,n.angle),t=q5(n.origin,M0(e,n.origin));if(n.rescale){let r=2-Math.sqrt(2),i=n.angle*Math.PI/180,s=Math.abs(Math.sin(i))*r,o=n.axis==="x"?1:0,l=n.axis==="y"?1:0,a=n.axis==="z"?1:0,v=[[(1-o)*s+1,0,0],[0,(1-l)*s+1,0],[0,0,(1-a)*s+1]];e=r1(e,v),t=q5(n.origin,M0(e,n.origin))}return{localMatrix:e,localShift:t}}var n1={up:{dir:[0,1,0],mask1:[1,1,0],mask2:[0,1,1],corners:[[0,1,1,0,1],[1,1,1,1,1],[0,1,0,0,0],[1,1,0,1,0]]},down:{dir:[0,-1,0],mask1:[1,1,0],mask2:[0,1,1],corners:[[1,0,1,0,1],[0,0,1,1,1],[1,0,0,0,0],[0,0,0,1,0]]},east:{dir:[1,0,0],mask1:[1,1,0],mask2:[1,0,1],corners:[[1,1,1,0,0],[1,0,1,0,1],[1,1,0,1,0],[1,0,0,1,1]]},west:{dir:[-1,0,0],mask1:[1,1,0],mask2:[1,0,1],corners:[[0,1,0,0,0],[0,0,0,0,1],[0,1,1,1,0],[0,0,1,1,1]]},north:{dir:[0,0,-1],mask1:[1,0,1],mask2:[0,1,1],corners:[[1,0,0,1,1],[0,0,0,0,1],[1,1,0,1,0],[0,1,0,0,0]]},south:{dir:[0,0,1],mask1:[1,0,1],mask2:[0,1,1],corners:[[0,0,1,0,1],[1,0,1,1,1],[0,1,1,0,0],[1,1,1,1,0]]}};function g8(n,e,t,r,i,s,o,l){let a=new p8(0,0,0);for(let v in n.faces){let c=n.faces[v],{corners:u,mask1:h,mask2:p}=n1[v],m=M0(r,n1[v].dir);if(c.cullface&&l[v])continue;let b=n.from[0],k=n.from[1],_=n.from[2],y=n.to[0],M=n.to[1],T=n.to[2],S=c.texture,{u:B}=S,{v:P}=S,{su:H}=S,{sv:V}=S,z=Math.floor(t.positions.length/3),N=[1,1,1];c.tintindex!==void 0&&c.tintindex===0&&(N=[.5686274509803921,.7411764705882353,.34901960784313724]);let Y=c.rotation||0,q=Math.cos(Y*Math.PI/180),J=-Math.sin(Y*Math.PI/180),te=null,se=null;n.rotation&&({localMatrix:te,localShift:se}=Za(n.rotation));let he=[],fe=1;for(let pe of u){let oe=[pe[0]?y:b,pe[1]?M:k,pe[2]?T:_];oe=t1(M0(te,oe),se),oe=t1(M0(r,oe),i),oe=oe.map(qe=>qe/16),t.positions.push(oe[0],oe[1],oe[2]),t.normals.push(...m);let Q=(pe[3]-.5)*q-(pe[4]-.5)*J+.5,ce=(pe[3]-.5)*J+(pe[4]-.5)*q+.5;t.uvs.push(Q*H+B,ce*V+P);let be=1;e&&(be=4/4*(15/15),he.push(3)),t.colors.push(fe*N[0]*be,fe*N[1]*be,fe*N[2]*be)}e&&he[0]+he[3]>=he[1]+he[2]?t.indices.push(z,z+3,z+2,z,z+1,z+3):t.indices.push(z,z+1,z+2,z+2,z+1,z+3)}}var b8=(n,e,t,r,i=[],s={})=>{let v={sx:.5,sy:.5,sz:.5,positions:[],normals:[],colors:[],uvs:[],t_positions:[],t_normals:[],t_colors:[],t_uvs:[],indices:[],tiles:{}};for(let[u,h]of n.entries()){let p=h[i[u]]??h[0];if(!p)continue;let m=null,b=null;for(let _ of["x","y","z"])_ in p&&(m?m=r1(m,J5(_,-(p[_]??0))):m=J5(_,-(p[_]??0)));m&&(b=[8,8,8],b=q5(b,M0(m,b)));let k=p.ao??!0;for(let _ of p.elements??[])g8(_,k,v,m,b,e,t,s)}let c=v.positions.length/3;for(let u=0;u<v.t_positions.length/12;u++)v.indices.push(c,c+1,c+2,c+2,c+1,c+3,c,c+2,c+1,c+2,c+3,c+1),c+=4;return v.positions.push(...v.t_positions),v.normals.push(...v.t_normals),v.colors.push(...v.t_colors),v.uvs.push(...v.t_uvs),delete v.t_positions,delete v.t_normals,delete v.t_colors,delete v.t_uvs,v.positions=new Float32Array(v.positions),v.normals=new Float32Array(v.normals),v.colors=new Float32Array(v.colors),v.uvs=new Float32Array(v.uvs),v},y8=(...n)=>{let t={geometry:b8(...n)},r=new mt.BufferGeometry;return r.setAttribute("position",new mt.BufferAttribute(t.geometry.positions,3)),r.setAttribute("normal",new mt.BufferAttribute(t.geometry.normals,3)),r.setAttribute("color",new mt.BufferAttribute(t.geometry.colors,3)),r.setAttribute("uv",new mt.BufferAttribute(t.geometry.uvs,2)),r.setIndex(t.geometry.indices),r.name="block-geometry",r},i1=(n,...e)=>{let t=y8(...e),r=new mt.Mesh(t,n);r.position.set(-.5,-.5,-.5);let i=new mt.Group;return i.add(r),i.rotation.set(0,-mt.MathUtils.degToRad(90),0,"ZYX"),globalThis.mesh=i,i},$a=(n,e)=>{n.position.set(e.x+.5,e.y+.5,e.z+.5)};A();E();R();x();import*as We from"three";var Nr=async(n,e)=>{let t;if(!n&&!e){let{canvas:v}=await Bt(lt);t=new We.CanvasTexture(v)}else{if(n||(n=await Jt(e,"skin")),!n)return;let{canvas:v}=await Bt(n);t=new We.CanvasTexture(v)}t.magFilter=We.NearestFilter,t.minFilter=We.NearestFilter;let r=!1,s=_8(40,16,r?-2:-3,-2,-2,r?3:4,12,4,64,64),o=new We.MeshStandardMaterial;o.map=t,o.needsUpdate=!0;let l=new We.Mesh(s,o),a=new We.Group;return a.add(l),a};function _8(n,e,t,r,i,s,o,l,a,v,c=!1){let u=t/16,h=r/16,p=i/16,m=(t+s)/16,b=(r+o)/16,k=(i+l)/16;c&&([u,m]=[m,u]);let _=[[u,h,p],[m,h,p],[m,b,p],[u,b,p],[u,h,k],[m,h,k],[m,b,k],[u,b,k]],y=n,M=n+l,T=n+l+s,S=n+l+s+s,B=n+l+s+l,P=n+l+s+l+s,H=e,V=e+l,z=e+l+o,N=[{vi:[5,4,0,1],uv:[M,H,T,V],n:[0,-1,0]},{vi:[2,3,7,6],uv:[T,V,S,H],n:[0,1,0]},{vi:[0,4,7,3],uv:[y,V,M,z],n:[-1,0,0]},{vi:[1,0,3,2],uv:[M,V,T,z],n:[0,0,-1]},{vi:[5,1,2,6],uv:[T,V,B,z],n:[1,0,0]},{vi:[4,5,6,7],uv:[B,V,P,z],n:[0,0,1]}],Y=[],q=[],J=[],te=[];for(let he=0;he<N.length;he++){let fe=N[he],pe=he*4,[oe,Q,ce,be]=fe.uv,qe=[[ce/a,1-Q/v],[oe/a,1-Q/v],[oe/a,1-be/v],[ce/a,1-be/v]],Re=c?[3,2,1,0]:[0,1,2,3],at=c?-fe.n[0]:fe.n[0];for(let ye=0;ye<4;ye++){let ut=_[fe.vi[Re[ye]]];Y.push(ut[0],ut[1],ut[2]),q.push(qe[ye][0],qe[ye][1]),J.push(at,fe.n[1],fe.n[2])}te.push(pe,pe+1,pe+2,pe,pe+2,pe+3)}let se=new We.BufferGeometry;return se.setAttribute("position",new We.Float32BufferAttribute(Y,3)),se.setAttribute("uv",new We.Float32BufferAttribute(q,2)),se.setAttribute("normal",new We.Float32BufferAttribute(J,3)),se.setIndex(te),se}A();E();R();x();A();E();R();x();import*as He from"three";A();E();R();x();A();E();R();x();var Xt=class n{constructor(e,t,r,i,s="div"){this.parent=e,this.object=t,this.property=r,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(i),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id=`lil-gui-name-${++n.nextNameID}`,this.$widget=document.createElement(s),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",o=>o.stopPropagation()),this.domElement.addEventListener("keyup",o=>o.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(r)}name(e){return this._name=e,this.$name.innerHTML=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){let t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.object[this.property]=e,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}},s1=class extends Xt{constructor(e,t,r){super(e,t,r,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};function o1(n){let e,t;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?t=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?t=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(t=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),t?"#"+t:!1}var w8={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:o1,toHexString:o1},jr={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},A8={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,t=1){let r=jr.fromHexString(n);e[0]=(r>>16&255)/255*t,e[1]=(r>>8&255)/255*t,e[2]=(r&255)/255*t},toHexString([n,e,t],r=1){r=255/r;let i=n*r<<16^e*r<<8^t*r<<0;return jr.toHexString(i)}},E8={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,t=1){let r=jr.fromHexString(n);e.r=(r>>16&255)/255*t,e.g=(r>>8&255)/255*t,e.b=(r&255)/255*t},toHexString({r:n,g:e,b:t},r=1){r=255/r;let i=n*r<<16^e*r<<8^t*r<<0;return jr.toHexString(i)}},x8=[w8,jr,A8,E8];function R8(n){return x8.find(e=>e.match(n))}var a1=class extends Xt{constructor(e,t,r,i){super(e,t,r,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=R8(this.initialValue),this._rgbScale=i,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let s=o1(this.$text.value);s&&this._setValueFromHexString(s)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){let t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}},Wr=class extends Xt{constructor(e,t,r){super(e,t,r,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",i=>{i.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},l1=class extends Xt{constructor(e,t,r,i,s,o){super(e,t,r,"number"),this._initInput(),this.min(i),this.max(s);let l=o!==void 0;this.step(l?o:this._getImplicitStep(),l),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){let e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=t*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let t=()=>{let y=parseFloat(this.$input.value);isNaN(y)||(this._stepExplicit&&(y=this._snap(y)),this.setValue(this._clamp(y)))},r=y=>{let M=parseFloat(this.$input.value);isNaN(M)||(this._snapClampSetValue(M+y),this.$input.value=this.getValue())},i=y=>{y.key==="Enter"&&this.$input.blur(),y.code==="ArrowUp"&&(y.preventDefault(),r(this._step*this._arrowKeyMultiplier(y))),y.code==="ArrowDown"&&(y.preventDefault(),r(this._step*this._arrowKeyMultiplier(y)*-1))},s=y=>{this._inputFocused&&(y.preventDefault(),r(this._step*this._normalizeMouseWheel(y)))},o=!1,l,a,v,c,u,h=5,p=y=>{l=y.clientX,a=v=y.clientY,o=!0,c=this.getValue(),u=0,window.addEventListener("mousemove",m),window.addEventListener("mouseup",b)},m=y=>{if(o){let M=y.clientX-l,T=y.clientY-a;Math.abs(T)>h?(y.preventDefault(),this.$input.blur(),o=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(M)>h&&b()}if(!o){let M=y.clientY-v;u-=M*this._step*this._arrowKeyMultiplier(y),c+u>this._max?u=this._max-c:c+u<this._min&&(u=this._min-c),this._snapClampSetValue(c+u)}v=y.clientY},b=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",b)},k=()=>{this._inputFocused=!0},_=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",t),this.$input.addEventListener("keydown",i),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",p),this.$input.addEventListener("focus",k),this.$input.addEventListener("blur",_)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let e=(_,y,M,T,S)=>(_-y)/(M-y)*(S-T)+T,t=_=>{let y=this.$slider.getBoundingClientRect(),M=e(_,y.left,y.right,this._min,this._max);this._snapClampSetValue(M)},r=_=>{this._setDraggingStyle(!0),t(_.clientX),window.addEventListener("mousemove",i),window.addEventListener("mouseup",s)},i=_=>{t(_.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",s)},o=!1,l,a,v=_=>{_.preventDefault(),this._setDraggingStyle(!0),t(_.touches[0].clientX),o=!1},c=_=>{_.touches.length>1||(this._hasScrollBar?(l=_.touches[0].clientX,a=_.touches[0].clientY,o=!0):v(_),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",h))},u=_=>{if(o){let y=_.touches[0].clientX-l,M=_.touches[0].clientY-a;Math.abs(y)>Math.abs(M)?v(_):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",h))}else _.preventDefault(),t(_.touches[0].clientX)},h=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",h)},p=this._callOnFinishChange.bind(this),m=400,b,k=_=>{if(Math.abs(_.deltaX)<Math.abs(_.deltaY)&&this._hasScrollBar)return;_.preventDefault();let M=this._normalizeMouseWheel(_)*this._step;this._snapClampSetValue(this.getValue()+M),this.$input.value=this.getValue(),clearTimeout(b),b=setTimeout(p,m)};this.$slider.addEventListener("mousedown",r),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",k,{passive:!1})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle(`lil-gui-${t}`,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:t,deltaY:r}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,r=-e.wheelDelta/120,r*=this._stepExplicit?1:10),t+-r}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){let t=Math.round(e/this._step)*this._step;return parseFloat(t.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){let e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},v1=class extends Xt{constructor(e,t,r,i){super(e,t,r,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this._values=Array.isArray(i)?i:Object.values(i),this._names=Array.isArray(i)?i:Object.keys(i),this._names.forEach(s=>{let o=document.createElement("option");o.innerHTML=s,this.$select.appendChild(o)}),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.updateDisplay()}updateDisplay(){let e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.innerHTML=t===-1?e:this._names[t],this}},c1=class extends Xt{constructor(e,t,r){super(e,t,r,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",i=>{i.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}},k8=`.lil-gui {
329
+ `;Nt=6;D0={LX_BITS:4,LY_BITS:4,LZ_BITS:4,FACE_BITS:3,TINT_BITS:8,AO_BITS_PER_CORNER:2,NUM_CORNERS:4,LX_SHIFT:0,LY_SHIFT:4,LZ_SHIFT:8,FACE_SHIFT:12,TINT_SHIFT:15,AO_SHIFT:23,FLIP_V_SHIFT:31},P7={TEX_INDEX_BITS:12,DIAGONAL_FLAG_SHIFT:12,SECTION_Y_SHIFT:13,SECTION_Y_BITS:5,EMPTY_SHIFT:18,SECTION_X_HI_SHIFT:19,SECTION_Z_HI_SHIFT:25,SECTION_HI_BITS:6,FLIP_U_SHIFT:31},Jd={SECTION_BITS:22,SECTION_MASK:(1<<22)-1,LO_BITS:16,HI_BITS:6,SECTION_BIAS:2097152}});var Gn,I7=Ve(()=>{"use strict";A();E();R();x();Gn=class{constructor(e){d(this,"atlasWidth");d(this,"atlasHeight");d(this,"tileSize");d(this,"tilesPerRow");d(this,"maxTiles");d(this,"valid");this.atlasWidth=e.width,this.atlasHeight=e.height,this.tileSize=e.tileSize,this.tilesPerRow=Math.floor(this.atlasWidth/this.tileSize),this.maxTiles=this.tilesPerRow*Math.floor(this.atlasHeight/this.tileSize),this.valid=this.atlasWidth===1024&&this.atlasHeight===1024&&this.tileSize===16&&this.maxTiles<=4096}isValid(){return this.valid}getTilesPerRow(){return this.tilesPerRow}tileIndexFromPixelCoords(e,t){if(!this.valid)return-1;let r=Math.floor(e/this.tileSize),i=Math.floor(t/this.tileSize);if(r<0||r>=this.tilesPerRow||i<0)return-1;let s=i*this.tilesPerRow+r;return s>=this.maxTiles?-1:s}tileIndexFromTextureEntry(e){return!this.valid||e.su!==this.tileSize||e.sv!==this.tileSize?-1:this.tileIndexFromPixelCoords(e.u,e.v)}tileIndexFromTextureName(e,t){if(!this.valid)return-1;let r=t.textures[e];if(!r&&e.includes(":")&&(r=t.textures[e.split(":")[1]]),!r&&e.includes("/")&&(r=t.textures[e.split("/")[1]]),r||(r=t.textures[`block/${e}`]),!r){let i=e.replace(/^block\//,"");r=t.textures[i]}return r?this.tileIndexFromTextureEntry(r):-1}}});import*as At from"three";var Nn,H7=Ve(()=>{"use strict";A();E();R();x();Nn=class n{constructor(){d(this,"entries",[{r:1,g:1,b:1}]);d(this,"colorToIndex",new Map);d(this,"categoryBiomeToIndex",new Map);d(this,"texture",null);d(this,"ready",!1)}packColor(e,t,r){let i=Math.round(e*255),s=Math.round(t*255),o=Math.round(r*255);return i<<16|s<<8|o}add(e,t,r,i,s){let o=this.packColor(e,t,r),l=`${i}:${s}`,a=this.categoryBiomeToIndex.get(l);if(a!==void 0)return a;let v=this.colorToIndex.get(o);if(v!==void 0)return this.categoryBiomeToIndex.set(l,v),v;let c=this.entries.length;return this.entries.push({r:e,g:t,b:r}),this.colorToIndex.set(o,c),this.categoryBiomeToIndex.set(l,c),c}getTintIndex(e,t,r,i){return e===void 0?0:e===0?t==="redstone_wire"?this.categoryBiomeToIndex.get(`redstone:${r.power}`)??this.categoryBiomeToIndex.get("redstone:0")??0:t==="birch_leaves"||t==="spruce_leaves"||t==="lily_pad"?this.categoryBiomeToIndex.get(`constant:${t}`)??this.categoryBiomeToIndex.get("constant:default")??0:t.includes("leaves")||t==="vine"?this.categoryBiomeToIndex.get(`foliage:${i}`)??this.categoryBiomeToIndex.get("foliage:plains")??0:this.categoryBiomeToIndex.get(`grass:${i}`)??this.categoryBiomeToIndex.get("grass:plains")??0:0}getEntry(e){return this.entries[e]??this.entries[0]}get size(){return this.entries.length}buildTextureData(){let e=new Float32Array(1024);for(let t=0;t<this.entries.length&&t<256;t++){let r=this.entries[t];e[t*4]=r.r,e[t*4+1]=r.g,e[t*4+2]=r.b,e[t*4+3]=1}return e}createTexture(){this.texture&&(this.texture.dispose(),this.texture=null,this.ready=!1);let e=this.buildTextureData(),t=new At.DataTexture(e,256,1,At.RGBAFormat,At.FloatType);return t.minFilter=At.NearestFilter,t.magFilter=At.NearestFilter,t.wrapS=At.ClampToEdgeWrapping,t.wrapT=At.ClampToEdgeWrapping,t.needsUpdate=!0,this.texture=t,this.ready=!0,t}getTexture(){return this.texture}isReady(){return this.ready}static fromTintsData(e){let t=new n;function r(i){let s=(i>>16&255)/255,o=(i>>8&255)/255,l=(i&255)/255;return[s,o,l]}if(e.grass){let i=r(e.grass.default);for(let{keys:s,color:o}of e.grass.data??[]){let l=r(o);for(let a of s)t.add(l[0],l[1],l[2],"grass",a)}t.add(i[0],i[1],i[2],"grass","plains")}if(e.foliage){let i=r(e.foliage.default);for(let{keys:s,color:o}of e.foliage.data??[]){let l=r(o);for(let a of s)t.add(l[0],l[1],l[2],"foliage",a)}t.add(i[0],i[1],i[2],"foliage","plains")}if(e.redstone){let i=r(e.redstone.default);for(let{keys:s,color:o}of e.redstone.data??[]){let l=r(o);for(let a of s)t.add(l[0],l[1],l[2],"redstone",a)}t.add(i[0],i[1],i[2],"redstone","0")}if(e.constant){let i=r(e.constant.default);for(let{keys:s,color:o}of e.constant.data??[]){let l=r(o);for(let a of s)t.add(l[0],l[1],l[2],"constant",a)}t.add(i[0],i[1],i[2],"constant","default")}return t}}});import L7 from"mc-assets/dist/blocksAtlases.json";function Xd(){let n=globalThis.loadedData?.tints;return n||(O7||(O7=!0),null)}function jn(){let n=Xd();if(!n)return null;if(Wn||(Wn=Nn.fromTintsData(n),Wn.createTexture()),!ns){let e=L7.latest??L7;ns=new Gn({width:e.width,height:e.height,tileSize:e.tileSize??16,suSv:e.suSv??16,textures:e.textures??{}})}return{tintPalette:Wn,textureIndexMapping:ns}}function D7(){return 1<<P7.EMPTY_SHIFT>>>0}var Wn,ns,O7,hr=Ve(()=>{"use strict";A();E();R();x();On();n0();I7();H7();On();Wn=null,ns=null,O7=!1});import*as Le from"three";function Zd(n,e){let t=new Le.InstancedBufferGeometry,r=new Float32Array(Nt*3);t.setAttribute("position",new Le.BufferAttribute(r,3));let i=new Uint32Array(e),s=new Uint32Array(e),o=new Uint32Array(e),l=new Uint32Array(e),a=4;for(let v=0;v<e;v++)i[v]=n[v*a],s[v]=n[v*a+1],o[v]=n[v*a+2],l[v]=n[v*a+3];return t.setAttribute("a_w0",new Le.InstancedBufferAttribute(i,1)),t.setAttribute("a_w1",new Le.InstancedBufferAttribute(s,1)),t.setAttribute("a_w2",new Le.InstancedBufferAttribute(o,1)),t.setAttribute("a_w3",new Le.InstancedBufferAttribute(l,1)),t.instanceCount=e,t.boundingBox=new Le.Box3(new Le.Vector3(-8,-8,-8),new Le.Vector3(8,8,8)),t.boundingSphere=new Le.Sphere(new Le.Vector3(0,0,0),Math.sqrt(3*8**2)),t}function $d(n){n.raycast=(e,t)=>{let{geometry:r}=n;if(!r.boundingBox||(F7.copy(r.boundingBox).applyMatrix4(n.matrixWorld),!e.ray.intersectBox(F7,ss)))return;let i=e.ray.origin.distanceTo(ss);t.push({distance:i,point:ss.clone(),object:n})}}function Yn(n,e){let t=Zd(n.words,n.count),r=new Le.Mesh(t,e);return r.name="shaderMesh",r.matrixAutoUpdate=!1,r.frustumCulled=!1,$d(r),r}function os(n){n.geometry.dispose()}var F7,ss,as=Ve(()=>{"use strict";A();E();R();x();n0();hr();F7=new Le.Box3,ss=new Le.Vector3});var W7={};R5(W7,{applyWorldGeometryExport:()=>ru,createMeshesFromExport:()=>G7,downloadWorldGeometry:()=>ls,exportWorldGeometry:()=>U7,loadTextureFromDataUrl:()=>N7,loadWorldGeometryFromUrl:()=>eu});import*as Oe from"three";function U7(n,e,t,r=!1){let i=[],s=Ft(n.timeOfTheDay)/15,o=n.chunkMeshManager.globalLegacyBuffer;for(let[a,v]of Object.entries(n.sectionObjects)){let c=[],u=[],h=[],p=[],m=[],b=[],k=[],_=o?.getSectionGeometryData(a);_&&(c.push(..._.positions),h.push(...Ln(_.colors,_.skyLights,_.blockLights,s)),p.push(..._.skyLights),m.push(..._.blockLights),b.push(..._.uvs),k.push(..._.indices));let y=v.children.find(M=>M.name==="mesh");if(y?.geometry){let{geometry:M}=y,T=M.getAttribute("position"),S=M.getAttribute("normal"),B=M.getAttribute("color"),P=M.getAttribute("a_skyLight"),H=M.getAttribute("a_blockLight"),V=M.getAttribute("uv"),z=M.index;if(T&&z&&B){let N=c.length/3,Y=T.count,q=Array.from(B.array),J=P?Array.from(P.array):new Array(Y).fill(1),te=H?Array.from(H.array):new Array(Y).fill(0);c.push(...Array.from(T.array)),S&&u.push(...Array.from(S.array)),h.push(...Ln(q,J,te,s)),p.push(...J),m.push(...te),V&&b.push(...Array.from(V.array));for(let se of Array.from(z.array))k.push(se+N)}}c.length===0||k.length===0||i.push({key:a,position:{x:v.worldX??0,y:v.worldY??0,z:v.worldZ??0},geometry:{positions:c,normals:u,colors:h,skyLights:p,blockLights:m,uvs:b,indices:k}})}let l={version:n.version??"unknown",exportedAt:new Date().toISOString(),camera:{position:e,rotation:t},sections:i};if(r&&n.material.map){let a=document.createElement("canvas"),v=n.material.map,{image:c}=v;c&&(a.width=c.width,a.height=c.height,a.getContext("2d").drawImage(c,0,0),l.textureAtlasDataUrl=a.toDataURL("image/png"))}return l}function ls(n,e,t,r="world-geometry.json",i=!1){let s=U7(n,e,t,i),o=JSON.stringify(s),l=new Blob([o],{type:"application/json"}),a=URL.createObjectURL(l),v=document.createElement("a");v.href=a,v.download=r,v.click(),URL.revokeObjectURL(a)}async function eu(n){let e=await fetch(n);if(!e.ok)throw new Error(`Failed to fetch world geometry: ${e.statusText}`);return e.json()}function V7(n,e){let t=n.map??n.map;if(!t)return null;let r=zn();r.uniforms.u_atlas.value=t,Un(r,e);let i=jn();if(!i)return null;let{tintPalette:s}=i;return s.isReady()||s.createTexture(),r.uniforms.u_tintPalette.value=s.getTexture(),r}function G7(n,e,t,r=1){let i=[],s=t??V7(e,r),o=0,l;for(let a of n.sections){let v=new Oe.Group;if(v.name="chunk",a.geometry.positions.length>0&&a.geometry.indices.length>0){let h=new Oe.BufferGeometry;if(h.setAttribute("position",new Oe.Float32BufferAttribute(a.geometry.positions,3)),a.geometry.normals.length&&h.setAttribute("normal",new Oe.Float32BufferAttribute(a.geometry.normals,3)),a.geometry.colors.length){let k=a.geometry.skyLights?.length?Ln(a.geometry.colors,a.geometry.skyLights,a.geometry.blockLights,r):a.geometry.colors;h.setAttribute("color",new Oe.Float32BufferAttribute(k,3))}a.geometry.uvs.length&&h.setAttribute("uv",new Oe.Float32BufferAttribute(a.geometry.uvs,2));let m=Math.max(...a.geometry.indices)>65535?Uint32Array:Uint16Array;h.setIndex(new Oe.BufferAttribute(new m(a.geometry.indices),1));let b=new Oe.Mesh(h,e);b.position.set(a.position.x,a.position.y,a.position.z),b.name="mesh",v.add(b)}let u=a.shaderCubes;if(u&&u.count>0&&s)if(u.formatVersion!==4)o++,l??(l=u.formatVersion);else{let h=Yn(u,s);h.position.set(a.position.x,a.position.y,a.position.z),v.add(h)}v.children.length>0&&i.push(v)}return o>0,i}async function N7(n){return new Promise((e,t)=>{let r=new Image;r.onload=()=>{let i=new Oe.Texture(r);i.magFilter=Oe.NearestFilter,i.minFilter=Oe.NearestFilter,i.needsUpdate=!0,i.flipY=!1,e(i)},r.onerror=t,r.src=n})}async function ru(n,e){let{scene:t,renderUpdateEmitter:r,material:i}=n,s=t.getObjectByName(z7);s&&(t.remove(s),tu(s));let o=!!e.textureAtlasDataUrl,l;if(o&&e.textureAtlasDataUrl){let h=await N7(e.textureAtlasDataUrl);l=new Oe.MeshLambertMaterial({map:h,vertexColors:!0,transparent:!0,alphaTest:.1}),l.name="geometry-export-material"}else l=i;let a=Ft(n.timeOfTheDay)/15,v=e.sections.some(h=>(h.shaderCubes?.count??0)>0)?V7(l,a):null,c=G7(e,l,v,a),u=new Oe.Group;u.name=z7,o&&(u.userData.geometryExportMaterial=l);for(let h of c)u.add(h);return t.add(u),r.emit("update"),c.length}var z7,tu,vs=Ve(()=>{"use strict";A();E();R();x();N5();M7();hr();On();n0();as();z7="geometry-export-root";tu=n=>{n.traverse(t=>{t.isMesh&&t.geometry?.dispose()});let e=n.userData?.geometryExportMaterial;e&&(e.map?.dispose?.(),e.dispose?.())}});A();E();R();x();A();E();R();x();A();E();R();x();A();E();R();x();import{proxy as ra}from"valtio";A();E();R();x();A();E();R();x();var bi=()=>({longRenderTime:!1,constantLongRenderTime:!1,tooManyEntities:!1,tooManyTextures:!1,unknownReason:!1});A();E();R();x();var C5=30;var yi=45,_i=100;A();E();R();x();var kr=class{constructor(e){this.factors=e;d(this,"renderTimeHistory",[])}onFrame(e){this.pushRenderTime(e.totalMs),this.recompute(e)}pushRenderTime(e){this.renderTimeHistory.push(e),this.renderTimeHistory.length>24&&this.renderTimeHistory.shift()}recompute(e){let t=e.fps>0&&e.fps<=45,r=Math.max(0,e.totalMs-e.entitiesMs),i=e.totalMs>=30,s=this.renderTimeHistory.length,o=this.renderTimeHistory.filter(h=>h>=30).length,l=s>=8&&o/s>=.65,a=e.loadedTextureCount>=100,v=t&&e.entitiesMs>=8&&r<=20,u=t&&!(i||l||v||a);this.factors.longRenderTime=i,this.factors.constantLongRenderTime=l,this.factors.tooManyEntities=v,this.factors.tooManyTextures=a,this.factors.unknownReason=u}reset(){this.renderTimeHistory.length=0,this.factors.longRenderTime=!1,this.factors.constantLongRenderTime=!1,this.factors.tooManyEntities=!1,this.factors.tooManyTextures=!1,this.factors.unknownReason=!1}};A();E();R();x();var mv=[{key:"longRenderTime",code:"LR"},{key:"constantLongRenderTime",code:"CLR"},{key:"tooManyEntities",code:"ENT"},{key:"tooManyTextures",code:"TEX"},{key:"unknownReason",code:"UNK"}];function wi(n){let e=mv.filter(({key:t})=>n[t]).map(({code:t})=>t);return e.length>0?e.join("+"):""}var Sr={paused:!1,showChunkBorders:!1,enableDebugOverlay:!1,debugWasmPerf:!1,debugModelVariant:void 0,futuristicReveal:!1,smartCull:!1,wasmMesher:!0,shaderCubeBlocks:!1,shaderCubeDebugMode:0,mesherWorkers:1,addChunksBatchWaitTime:200,_experimentalSmoothChunkLoading:!0,_renderByChunks:!1,autoLowerRenderDistance:!1,disableMesherConversionCache:!1,dedicatedChangeWorker:!1,shadingTheme:"high-contrast",cardinalLight:"default",dayCycle:!0,smoothLighting:!0,enableLighting:!0,starfield:!0,defaultSkybox:!0,renderEntities:!0,extraBlockRenderers:!0,foreground:!0,fov:75,volume:1,showHand:!1,viewBobbing:!1,handRenderer:"vanilla",renderEars:!0,highlightBlockColor:"blue",fetchPlayerSkins:!0,skinTexturesProxy:void 0,vrSupport:!0,vrPageGameRendering:!0,clipWorldBelowY:void 0,isPlayground:!1,instantCameraUpdate:!1,isRaining:!1,rainColor:"rgb(118, 148, 226)",rainOpacity:.5,moduleStates:{}},na={fpsLimit:void 0,sceneBackground:"lightblue",timeoutRendering:!1},rf=(n={})=>ra({...Sr,...n}),f0=()=>({reactive:ra({world:{chunksLoaded:{},heightmaps:{},allChunksLoaded:!1,mesherWork:!1,instabilityFactors:bi(),intersectMedia:null},renderer:"...",preventEscapeMenu:!1}),nonReactive:{fps:0,worstRenderTime:0,avgRenderTime:0,world:{chunksLoadedCount:0,chunksTotalNumber:0,chunksFullInfo:"-"},renderer:{timeline:{live:[],frozen:[],lastSecond:[]}}}});A();E();R();x();import{proxy as pv}from"valtio";var Ai=()=>pv({playerSkin:void 0,inWater:!1,waterBreathing:!1,backgroundColor:[0,0,0],ambientLight:0,directionalLight:0,eyeHeight:0,gameMode:void 0,lookingAtBlock:void 0,diggingBlock:void 0,movementState:"NOT_MOVING",onGround:!0,sneaking:!1,flying:!1,sprinting:!1,walkDist:0,prevWalkDist:0,bob:0,prevBob:0,itemUsageTicks:0,username:"",onlineMode:!1,cardinalLight:"default",lightingDisabled:!1,shouldHideHand:!1,heldItemMain:void 0,heldItemOff:void 0,perspective:"first_person",onFire:!1,fovMultiplier:1,cameraSpectatingEntity:void 0,team:void 0}),ia=n=>({isSpectator(){return n.gameMode==="spectator"},isSpectatingEntity(){return n.cameraSpectatingEntity!==void 0&&n.gameMode==="spectator"},isThirdPerson(){return this.isSpectatingEntity()?!1:n.perspective==="third_person_back"||n.perspective==="third_person_front"}}),sa=()=>({reactive:Ai()});A();E();R();x();import{Vec3 as Mv}from"vec3";import{proxy as wa}from"valtio";A();E();R();x();A();E();R();x();A();E();R();x();A();E();R();x();var B5={},oa=!1;function gv(){if(oa)return B5;oa=!0;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(S,B,P){return Function.prototype.apply.call(S,B,P)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(S){return Object.getOwnPropertyNames(S).concat(Object.getOwnPropertySymbols(S))}:t=function(S){return Object.getOwnPropertyNames(S)};function r(T){}var i=Number.isNaN||function(S){return S!==S};function s(){s.init.call(this)}B5=s,B5.once=_,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function l(T){if(typeof T!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof T)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(T){if(typeof T!="number"||T<0||i(T))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+T+".");o=T}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(S){if(typeof S!="number"||S<0||i(S))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+S+".");return this._maxListeners=S,this};function a(T){return T._maxListeners===void 0?s.defaultMaxListeners:T._maxListeners}s.prototype.getMaxListeners=function(){return a(this)},s.prototype.emit=function(S){for(var B=[],P=1;P<arguments.length;P++)B.push(arguments[P]);var H=S==="error",V=this._events;if(V!==void 0)H=H&&V.error===void 0;else if(!H)return!1;if(H){var z;if(B.length>0&&(z=B[0]),z instanceof Error)throw z;var N=new Error("Unhandled error."+(z?" ("+z.message+")":""));throw N.context=z,N}var Y=V[S];if(Y===void 0)return!1;if(typeof Y=="function")e(Y,this,B);else for(var q=Y.length,J=m(Y,q),P=0;P<q;++P)e(J[P],this,B);return!0};function v(T,S,B,P){var H,V,z;if(l(B),V=T._events,V===void 0?(V=T._events=Object.create(null),T._eventsCount=0):(V.newListener!==void 0&&(T.emit("newListener",S,B.listener?B.listener:B),V=T._events),z=V[S]),z===void 0)z=V[S]=B,++T._eventsCount;else if(typeof z=="function"?z=V[S]=P?[B,z]:[z,B]:P?z.unshift(B):z.push(B),H=a(T),H>0&&z.length>H&&!z.warned){z.warned=!0;var N=new Error("Possible EventEmitter memory leak detected. "+z.length+" "+String(S)+" listeners added. Use emitter.setMaxListeners() to increase limit");N.name="MaxListenersExceededWarning",N.emitter=T,N.type=S,N.count=z.length}return T}s.prototype.addListener=function(S,B){return v(this,S,B,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(S,B){return v(this,S,B,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(T,S,B){var P={fired:!1,wrapFn:void 0,target:T,type:S,listener:B},H=c.bind(P);return H.listener=B,P.wrapFn=H,H}s.prototype.once=function(S,B){return l(B),this.on(S,u(this,S,B)),this},s.prototype.prependOnceListener=function(S,B){return l(B),this.prependListener(S,u(this,S,B)),this},s.prototype.removeListener=function(S,B){var P,H,V,z,N;if(l(B),H=this._events,H===void 0)return this;if(P=H[S],P===void 0)return this;if(P===B||P.listener===B)--this._eventsCount===0?this._events=Object.create(null):(delete H[S],H.removeListener&&this.emit("removeListener",S,P.listener||B));else if(typeof P!="function"){for(V=-1,z=P.length-1;z>=0;z--)if(P[z]===B||P[z].listener===B){N=P[z].listener,V=z;break}if(V<0)return this;V===0?P.shift():b(P,V),P.length===1&&(H[S]=P[0]),H.removeListener!==void 0&&this.emit("removeListener",S,N||B)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(S){var B,P,H;if(P=this._events,P===void 0)return this;if(P.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):P[S]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete P[S]),this;if(arguments.length===0){var V=Object.keys(P),z;for(H=0;H<V.length;++H)z=V[H],z!=="removeListener"&&this.removeAllListeners(z);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(B=P[S],typeof B=="function")this.removeListener(S,B);else if(B!==void 0)for(H=B.length-1;H>=0;H--)this.removeListener(S,B[H]);return this};function h(T,S,B){var P=T._events;if(P===void 0)return[];var H=P[S];return H===void 0?[]:typeof H=="function"?B?[H.listener||H]:[H]:B?k(H):m(H,H.length)}s.prototype.listeners=function(S){return h(this,S,!0)},s.prototype.rawListeners=function(S){return h(this,S,!1)},s.listenerCount=function(T,S){return typeof T.listenerCount=="function"?T.listenerCount(S):p.call(T,S)},s.prototype.listenerCount=p;function p(T){var S=this._events;if(S!==void 0){var B=S[T];if(typeof B=="function")return 1;if(B!==void 0)return B.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function m(T,S){for(var B=new Array(S),P=0;P<S;++P)B[P]=T[P];return B}function b(T,S){for(;S+1<T.length;S++)T[S]=T[S+1];T.pop()}function k(T){for(var S=new Array(T.length),B=0;B<S.length;++B)S[B]=T[B].listener||T[B];return S}function _(T,S){return new Promise(function(B,P){function H(z){T.removeListener(S,V),P(z)}function V(){typeof T.removeListener=="function"&&T.removeListener("error",H),B([].slice.call(arguments))}M(T,S,V,{once:!0}),S!=="error"&&y(T,H,{once:!0})})}function y(T,S,B){typeof T.on=="function"&&M(T,"error",S,B)}function M(T,S,B,P){if(typeof T.on=="function")P.once?T.once(S,B):T.on(S,B);else if(typeof T.addEventListener=="function")T.addEventListener(S,function H(V){P.once&&T.removeEventListener(S,H),B(V)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof T)}return B5}var P5=gv();P5.once;P5.once=function(n,e){return new Promise((t,r)=>{function i(...o){s!==void 0&&n.removeListener("error",s),t(o)}let s;e!=="error"&&(s=o=>{n.removeListener(name,i),r(o)},n.once("error",s)),n.once(e,i)})};P5.on=function(n,e){let t=[],r=[],i=null,s=!1,o={async next(){let v=t.shift();if(v)return createIterResult(v,!1);if(i){let c=Promise.reject(i);return i=null,c}return s?createIterResult(void 0,!0):new Promise((c,u)=>r.push({resolve:c,reject:u}))},async return(){n.removeListener(e,l),n.removeListener("error",a),s=!0;for(let v of r)v.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(v){i=v,n.removeListener(e,l),n.removeListener("error",a)},[Symbol.asyncIterator](){return this}};return n.on(e,l),n.on("error",a),o;function l(...v){let c=r.shift();c?c.resolve(createIterResult(v,!1)):t.push(v)}function a(v){s=!0;let c=r.shift();c?c.reject(v):i=v,o.return()}};var{EventEmitter:m0,defaultMaxListeners:yf,init:_f,listenerCount:wf,on:Af,once:Ef}=P5;import{Vec3 as p0}from"vec3";A();E();R();x();function Tr(n){let e=n*2+1;if(e<=0)return[];let t=[],r=0,i=0,s=0,o=-1;for(let l=0;l<e*e;l++){if(Math.abs(r)<=e/2&&Math.abs(i)<=e/2&&t.push([r,i]),r===i||r<0&&r===-i||r>0&&r===1-i){let a=s;s=-o,o=a}r+=s,i+=o}return t}A();E();R();x();function Ei(n,e=0){if(e>16)return;if(n==null)return n;let t=typeof n;if(t==="function"||t==="symbol")return;if(t==="bigint")return n.toString();if(t!=="object"||n instanceof ArrayBuffer)return n;if(ArrayBuffer.isView(n)){let s=n;return s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)}if(n instanceof Date)return n.toISOString();if(Array.isArray(n))return n.map(s=>Ei(s,e+1)).filter(s=>s!==void 0);let r=n;if(typeof r.x=="number"&&typeof r.y=="number"&&typeof r.z=="number"&&!("w"in r))return{x:r.x,y:r.y,z:r.z};let i={};for(let s of Object.keys(r)){if(s==="_client"||s==="_events"||s==="_eventsCount")continue;let o=Ei(r[s],e+1);o!==void 0&&(i[s]=o)}return i}function I5(n){return n.map(e=>Ei(e))}var Q0=n=>[Math.floor(n.x/16),Math.floor(n.z/16)],bv=n=>[Math.floor(n.x/16),Math.floor(n.y/16),Math.floor(n.z/16)],aa=async(n,e,t,r=1)=>{for(let i=0;i<n.length;i+=r)e&&await new Promise(s=>setTimeout(s,e)),await t(n[i],i)},Y0=new WeakMap,Mr=class Mr extends m0{static restoreTransferred(e,t){let r=new Mr;if(!t)return r;let i=Y0.get(t);if(i)i.activeWorldView=r;else{let s=({data:o})=>{let a=Y0.get(t)?.activeWorldView;!a||o?.class!==Mr.restorerName||o.type==="event"&&a.emit(o.eventName,...o.args)};t.addEventListener("message",s),i={activeWorldView:r,handler:s},Y0.set(t,i)}return r}static clearWorkerBridgeForTest(e){let t=Y0.get(e);t&&(e.removeEventListener("message",t.handler),Y0.delete(e))}static getWorkerBridgeListenerCountForTest(e){return Y0.has(e)?1:0}};d(Mr,"restorerName","WorldViewWorker");var g0=Mr,b0=class extends m0{constructor(t,r,i=new p0(0,0,0)){super();this.world=t;this.viewDistance=r;d(this,"spiralNumber",0);d(this,"gotPanicLastTime",!1);d(this,"panicChunksReload",()=>{});d(this,"loadedChunks",{});d(this,"inLoading",!1);d(this,"chunkReceiveTimes",[]);d(this,"lastChunkReceiveTime",0);d(this,"lastChunkReceiveTimeAvg",0);d(this,"panicTimeout");d(this,"lastPos");d(this,"eventListeners",{});d(this,"debugChunksInfo",{});d(this,"waitingSpiralChunksLoad",{});d(this,"addWaitTime",1);d(this,"keepChunksDistance",0);d(this,"isPlayground",!1);d(this,"allowPositionUpdate",!0);d(this,"lastBiomeId",null);d(this,"lastPosCheck",null);this.lastPos=new p0(0,0,0).update(i)}prepareForTransfer(t){if(t){let r=this.emit.bind(this);this.emit=(i,...s)=>{r(i,...s),t.postMessage({class:g0.restorerName,type:"event",eventName:i,args:I5(s)})}}return{__restorer:g0.restorerName}}setBlockStateId(t,r){let i=this.world.setBlockStateId(t,r);if(i&&typeof i.then=="function")throw new Error("setBlockStateId returned promise (not supported)");this.emit("blockUpdate",{pos:t,stateId:r})}updateViewDistance(t){this.viewDistance=t,this.emit("renderDistance",t)}async init(t,r){this.updateViewDistance(this.viewDistance),this.emit("chunkPosUpdate",{pos:t}),r?.time?.timeOfDay!==void 0&&this.emit("time",r.time.timeOfDay),r?.entity&&this.emit("playerEntity",r.entity),this.emitterGotConnected(r);let[i,s]=Q0(t),o=Tr(this.viewDistance).map(([l,a])=>new p0((i+l)*16,0,(s+a)*16));this.lastPos.update(t),await this._loadChunks(o,t)}chunkProgress(){if(this.panicTimeout&&clearTimeout(this.panicTimeout),this.chunkReceiveTimes.length>=5){let t=this.chunkReceiveTimes.reduce((i,s)=>i+s,0)/this.chunkReceiveTimes.length;this.lastChunkReceiveTimeAvg=t;let r=t*2+1e3;this.panicTimeout&&clearTimeout(this.panicTimeout),this.panicTimeout=setTimeout(()=>{!this.gotPanicLastTime&&this.inLoading&&(this.gotPanicLastTime=!0,this.panicChunksReload())},r)}}async _loadChunks(t,r){this.spiralNumber++;let{spiralNumber:i}=this;for(let o of Object.keys(this.waitingSpiralChunksLoad))this.waitingSpiralChunksLoad[o](!1),delete this.waitingSpiralChunksLoad[o];let s=!0;this.inLoading=!0,await aa(t,this.addWaitTime,async o=>{!s||this.loadedChunks[`${o.x},${o.z}`]||(this.world.getColumnAt(o)||(s=await new Promise(l=>{this.waitingSpiralChunksLoad[`${o.x},${o.z}`]=l})),s&&(await this.loadChunk(o,void 0,`spiral ${i} from ${r.x},${r.z}`),this.chunkProgress()))}),i===this.spiralNumber&&(this.panicTimeout&&clearTimeout(this.panicTimeout),this.inLoading=!1,this.gotPanicLastTime=!1,this.chunkReceiveTimes=[],this.lastChunkReceiveTime=0)}async loadChunk(t,r=!1,i="spiral"){var v,c;let[s,o]=Q0(this.lastPos),l=Math.abs(s-Math.floor(t.x/16)),a=Math.abs(o-Math.floor(t.z/16));if(l<=this.viewDistance&&a<=this.viewDistance){let u=await this.world.getColumnAt(t.y!==void 0?t:new p0(t.x,0,t.z));if(u){let h=u.toJson(),p={minY:u.minY??0,worldHeight:u.worldHeight??256};this.emit("loadChunk",{x:t.x,z:t.z,chunk:h,blockEntities:u.blockEntities,worldConfig:p,isLightUpdate:r}),this.loadedChunks[`${t.x},${t.z}`]=!0,(v=this.debugChunksInfo)[c=`${t.x},${t.z}`]??(v[c]={loads:[]}),this.debugChunksInfo[`${t.x},${t.z}`].loads.push({dataLength:h.length,reason:i,time:Date.now()})}else this.isPlayground&&this.emit("markAsLoaded",{x:t.x,z:t.z})}}async reloadLoadedChunks(){let t=Object.keys(this.loadedChunks);for(let r of t){let[i,s]=r.split(",").map(Number);await this.loadChunk({x:i,z:s},!1,"mesher-reconfigure")}}unloadAllChunks(){for(let t of Object.keys(this.loadedChunks)){let[r,i]=t.split(",").map(Number);this.unloadChunk({x:r,z:i})}}unloadChunk(t){this.emit("unloadChunk",{x:t.x,z:t.z}),delete this.loadedChunks[`${t.x},${t.z}`],delete this.debugChunksInfo[`${t.x},${t.z}`]}emitterGotConnected(t){typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope||!t||this.emit("blockEntities",new Proxy({},{get(i,s,o){if(typeof s!="string")return;let[l,a,v]=s.split(",").map(Number);return t.world.getBlock(new p0(l,a,v))?.entity}}))}updateBiome(t){try{if(!this.world.getBiome)return;let r=this.world.getBiome(t);r!==this.lastBiomeId&&(this.lastBiomeId=r,this.emit("biomeReset"))}catch{}}async updatePosition(t,r=!1){if(!this.allowPositionUpdate)return;let i=t.floored();if(!r&&this.lastPosCheck&&this.lastPosCheck.equals(i))return;this.lastPosCheck=i,this.updateBiome(t);let[s,o]=Q0(this.lastPos),[l,a]=Q0(t);if(s!==l||o!==a||r){this.emit("chunkPosUpdate",{pos:t});let v=[],c=r?this.viewDistance:this.viewDistance+this.keepChunksDistance;for(let h of Object.keys(this.loadedChunks)){let[p,m]=h.split(",").map(Number),b=new p0(p,0,m),[k,_]=Q0(b),y=Math.abs(l-k),M=Math.abs(a-_);(y>c||M>c)&&v.push(b)}for(let h of v)this.unloadChunk(h);let u=Tr(this.viewDistance).map(([h,p])=>{let m=new p0((l+h)*16,0,(a+p)*16);if(!this.loadedChunks[`${m.x},${m.z}`])return m}).filter(h=>!!h);this.lastPos.update(t),this._loadChunks(u,t)}else this.emit("chunkPosUpdate",{pos:t}),this.lastPos.update(t)}};A();E();R();x();A();E();R();x();import ga from"minecraft-data";import yv from"mc-assets/dist/blocksAtlases.json";import _v from"mc-assets/dist/itemsAtlases.json";import Bi from"mc-assets/dist/itemDefinitions.json";import wv from"mc-assets/dist/blocksAtlasLatest.png";import Av from"mc-assets/dist/blocksAtlasLegacy.png";import Ev from"mc-assets/dist/itemsAtlasLatest.png";import xv from"mc-assets/dist/itemsAtlasLegacy.png";import Rv from"mc-assets/dist/textureReplacements/christmas";import{AtlasParser as y0}from"mc-assets/dist/atlasParser";import fa from"mc-assets/dist/worldBlockProvider";A();E();R();x();var Ti=xr(la(),1);import*as O5 from"three";A();E();R();x();A();E();R();x();var H5=class{constructor(e,t,r){this.name=e,this.fg=t,this.bg=r,this.PR=Math.round(window.devicePixelRatio||1),this.WIDTH=90*this.PR,this.HEIGHT=48*this.PR,this.TEXT_X=3*this.PR,this.TEXT_Y=2*this.PR,this.GRAPH_X=3*this.PR,this.GRAPH_Y=15*this.PR,this.GRAPH_WIDTH=84*this.PR,this.GRAPH_HEIGHT=30*this.PR,this.canvas=document.createElement("canvas"),this.canvas.width=90*this.PR,this.canvas.height=48*this.PR,this.canvas.style.width="90px",this.canvas.style.position="absolute",this.canvas.style.height="48px",this.canvas.style.cssText="width:90px;height:48px",this.context=this.canvas.getContext("2d"),this.context&&(this.context.font="bold "+9*this.PR+"px Helvetica,Arial,sans-serif",this.context.textBaseline="top",this.context.fillStyle=this.bg,this.context.fillRect(0,0,this.WIDTH,this.HEIGHT),this.context.fillStyle=this.fg,this.context.fillText(this.name,this.TEXT_X,this.TEXT_Y),this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH,this.GRAPH_HEIGHT))}update(e,t,r,i,s=0){let o=1/0,l=0;this.context&&(o=Math.min(o,e),l=Math.max(r,e),i=Math.max(i,t),this.context.fillStyle=this.bg,this.context.globalAlpha=1,this.context.fillRect(0,0,this.WIDTH,this.GRAPH_Y),this.context.fillStyle=this.fg,this.context.fillText(e.toFixed(s)+" "+this.name+" ("+o.toFixed(s)+"-"+parseFloat(l.toFixed(s))+")",this.TEXT_X,this.TEXT_Y),this.context.drawImage(this.canvas,this.GRAPH_X+this.PR,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT,this.GRAPH_X,this.GRAPH_Y,this.GRAPH_WIDTH-this.PR,this.GRAPH_HEIGHT),this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,this.GRAPH_HEIGHT),this.context.fillStyle=this.bg,this.context.globalAlpha=.9,this.context.fillRect(this.GRAPH_X+this.GRAPH_WIDTH-this.PR,this.GRAPH_Y,this.PR,(1-t/i)*this.GRAPH_HEIGHT))}};var va=class L5{constructor({logsPerSecond:e=20,samplesLog:t=100,samplesGraph:r=10,precision:i=2,minimal:s=!1,horizontal:o=!0,mode:l=0}={}){this.mode=l,this.horizontal=o,this.container=document.createElement("div"),this.container.style.cssText="position:fixed;top:0;left:0;opacity:0.9;z-index:10000;",s&&(this.container.style.cssText+="cursor:pointer"),this.gl=null,this.query=null,this.minimal=s,this.beginTime=(performance||Date).now(),this.prevTime=this.beginTime,this.prevCpuTime=this.beginTime,this.frames=0,this.averageCpu={logs:[],graph:[]},this.averageGpu={logs:[],graph:[]},this.queryCreated=!1,this.fpsPanel=this.addPanel(new L5.Panel("FPS","#0ff","#002"),0),this.msPanel=this.addPanel(new L5.Panel("CPU","#0f0","#020"),1),this.gpuPanel=null,this.samplesLog=t,this.samplesGraph=r,this.precision=i,this.logsPerSecond=e,this.minimal?(this.container.addEventListener("click",a=>{a.preventDefault(),this.showPanel(++this.mode%this.container.children.length)},!1),this.mode=l,this.showPanel(this.mode)):window.addEventListener("resize",()=>{this.resizePanel(this.fpsPanel,0),this.resizePanel(this.msPanel,1),this.gpuPanel&&this.resizePanel(this.gpuPanel,2)})}resizePanel(e,t){e.canvas.style.position="absolute",this.minimal?e.canvas.style.display="none":(e.canvas.style.display="block",this.horizontal?(e.canvas.style.top="0px",e.canvas.style.left=t*e.WIDTH/e.PR+"px"):(e.canvas.style.left="0px",e.canvas.style.top=t*e.HEIGHT/e.PR+"px"))}addPanel(e,t){return e.canvas&&(this.container.appendChild(e.canvas),this.resizePanel(e,t)),e}showPanel(e){for(let t=0;t<this.container.children.length;t++){let r=this.container.children[t];r.style.display=t===e?"block":"none"}this.mode=e}init(e){if(e){if(e instanceof WebGL2RenderingContext)this.gl=e;else if(e instanceof HTMLCanvasElement||e instanceof OffscreenCanvas){if(this.gl=e.getContext("webgl2"),!this.gl)return}else return;this.ext=this.gl.getExtension("EXT_disjoint_timer_query_webgl2"),this.ext&&(this.gpuPanel=this.addPanel(new L5.Panel("GPU","#ff0","#220"),2))}}begin(){if(this.beginProfiling("cpu-started"),!(!this.gl||!this.ext)){if(this.query){let e=this.gl.getQueryParameter(this.query,this.gl.QUERY_RESULT_AVAILABLE);if(this.disjoint=this.gl.getParameter(this.ext.GPU_DISJOINT_EXT),e&&!this.disjoint){this.ns=this.gl.getQueryParameter(this.query,this.gl.QUERY_RESULT);let t=this.ns*1e-6;(e||this.disjoint)&&(this.gl.deleteQuery(this.query),this.query=null),e&&this.addToAverage(t,this.averageGpu)}}this.query||(this.queryCreated=!0,this.query=this.gl.createQuery(),this.query&&this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,this.query))}}end(){this.beginTime=this.endInternal(),this.endProfiling("cpu-started","cpu-finished","cpu-duration",this.averageCpu),!(!this.gl||!this.ext)&&this.queryCreated&&this.gl.getQuery(this.ext.TIME_ELAPSED_EXT,this.gl.CURRENT_QUERY)&&this.gl.endQuery(this.ext.TIME_ELAPSED_EXT)}endInternal(){this.frames++;let e=(performance||Date).now();if(e>=this.prevCpuTime+1e3/this.logsPerSecond&&(this.updatePanel(this.msPanel,this.averageCpu),this.updatePanel(this.gpuPanel,this.averageGpu),this.prevCpuTime=e),e>=this.prevTime+1e3){let t=this.frames*1e3/(e-this.prevTime);this.fpsPanel.update(t,t,100,100,0),this.prevTime=e,this.frames=0}return e}addToAverage(e,t){t.logs.push(e),t.logs.length>this.samplesLog&&t.logs.shift(),t.graph.push(e),t.graph.length>this.samplesGraph&&t.graph.shift()}beginProfiling(e){window.performance&&window.performance.mark(e)}endProfiling(e,t,r,i){if(window.performance&&t){window.performance.mark(t);let s=performance.measure(r,e,t);this.addToAverage(s.duration,i)}}updatePanel(e,t){if(t.logs.length>0){let r=0,i=.01;for(let l=0;l<t.logs.length;l++)r+=t.logs[l],t.logs[l]>i&&(i=t.logs[l]);let s=0,o=.01;for(let l=0;l<t.graph.length;l++)s+=t.graph[l],t.graph[l]>o&&(o=t.graph[l]);e&&e.update(r/Math.min(t.logs.length,this.samplesLog),s/Math.min(t.graph.length,this.samplesGraph),i,o,this.precision)}}};va.Panel=H5;var ca=va;A();E();R();x();var Fe=Object.freeze({Linear:Object.freeze({None:function(n){return n},In:function(n){return this.None(n)},Out:function(n){return this.None(n)},InOut:function(n){return this.None(n)}}),Quadratic:Object.freeze({In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}}),Cubic:Object.freeze({In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}}),Quartic:Object.freeze({In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}}),Quintic:Object.freeze({In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}}),Sinusoidal:Object.freeze({In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}}),Exponential:Object.freeze({In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}}),Circular:Object.freeze({In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}}),Elastic:Object.freeze({In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(n){var e=1.70158;return n===1?1:n*n*((e+1)*n-e)},Out:function(n){var e=1.70158;return n===0?0:--n*n*((e+1)*n+e)+1},InOut:function(n){var e=2.5949095;return(n*=2)<1?.5*(n*n*((e+1)*n-e)):.5*((n-=2)*n*((e+1)*n+e)+2)}}),Bounce:Object.freeze({In:function(n){return 1-Fe.Bounce.Out(1-n)},Out:function(n){return n<.36363636363636365?7.5625*n*n:n<.7272727272727273?7.5625*(n-=.5454545454545454)*n+.75:n<.9090909090909091?7.5625*(n-=.8181818181818182)*n+.9375:7.5625*(n-=.9545454545454546)*n+.984375},InOut:function(n){return n<.5?Fe.Bounce.In(n*2)*.5:Fe.Bounce.Out(n*2-1)*.5+.5}}),generatePow:function(n){return n===void 0&&(n=4),n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(e){return Math.pow(e,n)},Out:function(e){return 1-Math.pow(1-e,n)},InOut:function(e){return e<.5?Math.pow(e*2,n)/2:(1-Math.pow(2-e*2,n))/2+.5}}}}),Cr=function(){return performance.now()},q0=function(){function n(){this._tweens={},this._tweensAddedDuringUpdate={}}return n.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(t){return e._tweens[t]})},n.prototype.removeAll=function(){this._tweens={}},n.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},n.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},n.prototype.update=function(e,t){e===void 0&&(e=Cr()),t===void 0&&(t=!1);var r=Object.keys(this._tweens);if(r.length===0)return!1;for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<r.length;i++){var s=this._tweens[r[i]],o=!t;s&&s.update(e,o)===!1&&!t&&delete this._tweens[r[i]]}r=Object.keys(this._tweensAddedDuringUpdate)}return!0},n}(),K0={Linear:function(n,e){var t=n.length-1,r=t*e,i=Math.floor(r),s=K0.Utils.Linear;return e<0?s(n[0],n[1],r):e>1?s(n[t],n[t-1],t-r):s(n[i],n[i+1>t?t:i+1],r-i)},Bezier:function(n,e){for(var t=0,r=n.length-1,i=Math.pow,s=K0.Utils.Bernstein,o=0;o<=r;o++)t+=i(1-e,r-o)*i(e,o)*n[o]*s(r,o);return t},CatmullRom:function(n,e){var t=n.length-1,r=t*e,i=Math.floor(r),s=K0.Utils.CatmullRom;return n[0]===n[t]?(e<0&&(i=Math.floor(r=t*(1+e))),s(n[(i-1+t)%t],n[i],n[(i+1)%t],n[(i+2)%t],r-i)):e<0?n[0]-(s(n[0],n[0],n[1],n[1],-r)-n[0]):e>1?n[t]-(s(n[t],n[t],n[t-1],n[t-1],r-t)-n[t]):s(n[i?i-1:0],n[i],n[t<i+1?t:i+1],n[t<i+2?t:i+2],r-i)},Utils:{Linear:function(n,e,t){return(e-n)*t+n},Bernstein:function(n,e){var t=K0.Utils.Factorial;return t(n)/t(e)/t(n-e)},Factorial:function(){var n=[1];return function(e){var t=1;if(n[e])return n[e];for(var r=e;r>1;r--)t*=r;return n[e]=t,t}}(),CatmullRom:function(n,e,t,r,i){var s=(t-n)*.5,o=(r-e)*.5,l=i*i,a=i*l;return(2*e-2*t+s+o)*a+(-3*e+3*t-2*s-o)*l+s*i+e}}},da=function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n}(),ki=new q0,Ge=function(){function n(e,t){t===void 0&&(t=ki),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Fe.Linear.None,this._interpolationFunction=K0.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=da.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return n.prototype.getId=function(){return this._id},n.prototype.isPlaying=function(){return this._isPlaying},n.prototype.isPaused=function(){return this._isPaused},n.prototype.to=function(e,t){if(t===void 0&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t,this},n.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e,this},n.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},n.prototype.start=function(e,t){if(e===void 0&&(e=Cr()),t===void 0&&(t=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var r in this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var s in this._valuesEnd)i[s]=this._valuesEnd[s];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},n.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},n.prototype._setupProperties=function(e,t,r,i,s){for(var o in r){var l=e[o],a=Array.isArray(l),v=a?"array":typeof l,c=!a&&Array.isArray(r[o]);if(!(v==="undefined"||v==="function")){if(c){var u=r[o];if(u.length===0)continue;for(var h=[l],p=0,m=u.length;p<m;p+=1){var b=this._handleRelativeValue(l,u[p]);if(isNaN(b)){c=!1;break}h.push(b)}c&&(r[o]=h)}if((v==="object"||a)&&l&&!c){t[o]=a?[]:{};var k=l;for(var _ in k)t[o][_]=k[_];i[o]=a?[]:{};var u=r[o];if(!this._isDynamic){var y={};for(var _ in u)y[_]=u[_];r[o]=u=y}this._setupProperties(k,t[o],u,i[o],s)}else(typeof t[o]>"u"||s)&&(t[o]=l),a||(t[o]*=1),c?i[o]=r[o].slice().reverse():i[o]=t[o]||0}}},n.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},n.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},n.prototype.pause=function(e){return e===void 0&&(e=Cr()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this),this)},n.prototype.resume=function(e){return e===void 0&&(e=Cr()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},n.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},n.prototype.group=function(e){return e===void 0&&(e=ki),this._group=e,this},n.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},n.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},n.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},n.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},n.prototype.easing=function(e){return e===void 0&&(e=Fe.Linear.None),this._easingFunction=e,this},n.prototype.interpolation=function(e){return e===void 0&&(e=K0.Linear),this._interpolationFunction=e,this},n.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},n.prototype.onStart=function(e){return this._onStartCallback=e,this},n.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},n.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},n.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},n.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},n.prototype.onStop=function(e){return this._onStopCallback=e,this},n.prototype.update=function(e,t){if(e===void 0&&(e=Cr()),t===void 0&&(t=!0),this._isPaused)return!0;var r,i,s=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>s)return!1;t&&this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),i=(e-this._startTime)/this._duration,i=this._duration===0||i>1?1:i;var o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var l=0,a=this._chainedTweens.length;l<a;l++)this._chainedTweens[l].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},n.prototype._updateProperties=function(e,t,r,i){for(var s in r)if(t[s]!==void 0){var o=t[s]||0,l=r[s],a=Array.isArray(e[s]),v=Array.isArray(l),c=!a&&v;c?e[s]=this._interpolationFunction(l,i):typeof l=="object"&&l?this._updateProperties(e[s],o,l,i):(l=this._handleRelativeValue(o,l),typeof l=="number"&&(e[s]=o+(l-o)*i))}},n.prototype._handleRelativeValue=function(e,t){return typeof t!="string"?t:t.charAt(0)==="+"||t.charAt(0)==="-"?e+parseFloat(t):parseFloat(t)},n.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r=="string"?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=t},n}();var gm=da.nextId,Mt=ki,bm=Mt.getAll.bind(Mt),ym=Mt.removeAll.bind(Mt),_m=Mt.add.bind(Mt),wm=Mt.remove.bind(Mt),ua=Mt.update.bind(Mt);A();E();R();x();function Si(n){if(n==="high-performance")return"high-performance";if(n==="low-power")return"low-power"}var de=typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope,Mi=class{constructor(e,t=0){this.canvas=e;d(this,"stats");d(this,"stats2");d(this,"statsGl");d(this,"total",0);d(this,"denseMode");this.stats=new Ti.default,this.stats2=new Ti.default,this.statsGl=new ca({minimal:!0}),this.stats2.showPanel(2),this.denseMode=typeof L<"u"&&!0||typeof window<"u"&&window.innerHeight<500,this.initStats(),this.setVisibility(t)}addStat(e,t=80){e.style.position="absolute",this.denseMode&&(e.style.height="12px"),e.style.overflow="hidden",e.style.left="",e.style.top="0",e.style.right=`${this.total}px`,e.style.width="80px",e.style.zIndex="1",e.style.opacity="0.8";let r=document.getElementById("corner-indicator-stats"),i=r??document.body;r&&(e.style.position="relative"),i.appendChild(e),this.total+=t}initStats(){let e=this.stats2.dom.children.length===3;this.addStat(this.stats.dom),e&&this.addStat(this.stats2.dom),this.statsGl.init(this.canvas),this.statsGl.container.style.display="flex",this.statsGl.container.style.justifyContent="flex-end";let t=0;for(let r of this.statsGl.container.children){let i=r;t++===0&&(i.style.display="none"),i.style.position=""}}setVisibility(e){e>0?(this.stats.dom.style.display="block",this.stats2.dom.style.display=e>=2?"block":"none",this.statsGl.container.style.display=e>=2?"block":"none"):(this.stats.dom.style.display="none",this.stats2.dom.style.display="none",this.statsGl.container.style.display="none")}markStart(){this.stats.begin(),this.stats2.begin(),this.statsGl.begin()}markEnd(){this.stats.end(),this.stats2.end(),this.statsGl.end()}dispose(){this.stats.dom.remove(),this.stats2.dom.remove(),this.statsGl.container.remove()}},Br=class{constructor(e,t,r){this.initOptions=e;this.externalCanvas=t;d(this,"canvas");d(this,"renderer");d(this,"animationFrameId");d(this,"timeoutId");d(this,"lastRenderTime",0);d(this,"previousCanvasWidth",0);d(this,"previousCanvasHeight",0);d(this,"currentWidth",0);d(this,"currentHeight",0);d(this,"pendingResize",!1);d(this,"renderedFps",0);d(this,"fpsInterval");d(this,"stats");d(this,"paused",!1);d(this,"disconnected",!1);d(this,"preRender",()=>{});d(this,"render",e=>{});d(this,"postRender",()=>{});d(this,"sizeChanged",()=>{});d(this,"droppedFpsPercentage",0);d(this,"config");d(this,"onRender",[]);d(this,"inWorldRenderingConfig");d(this,"nonReactiveState");this.config=e.config,t?this.canvas=t:this.addToPage();try{let s=e.getRendererOptions?.()?.gpuPreference??"default";this.renderer=new O5.WebGLRenderer({canvas:this.canvas,preserveDrawingBuffer:!0,logarithmicDepthBuffer:!0,powerPreference:Si(s)})}catch(s){throw e.callbacks.displayCriticalError(new Error(`Failed to create WebGL context, not possible to render (restart browser): ${s.message}`)),s}this.renderer.outputColorSpace=O5.LinearSRGBColorSpace,t||(this.updatePixelRatio(),this.setupResizeListener()),this.sizeUpdated(),this.previousCanvasWidth=this.canvas.width,this.previousCanvasHeight=this.canvas.height;let i="WebGL2RenderingContext"in globalThis;!t&&i&&!de&&(this.stats=new Mi(this.canvas,this.config.statsVisible)),this.setupFpsTracking(),this.startRenderLoop()}setupResizeListener(){if(typeof window>"u")return;let e,t=()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.pendingResize=!0},16)};window.addEventListener("resize",t,{passive:!0})}updatePixelRatio(){if(typeof window>"u")return;let e=window.devicePixelRatio||1;this.renderer.capabilities.isWebGL2||(e=1),this.renderer.setPixelRatio(e)}sizeUpdated(){this.renderer.setSize(this.currentWidth,this.currentHeight,!1)}addToPage(){this.canvas=ha(),this.updateCanvasSize()}updateSizeExternal(e,t,r){this.currentWidth=e,this.currentHeight=t,this.renderer.setPixelRatio(r),this.sizeUpdated()}updateCanvasSize(){if(this.externalCanvas||typeof document>"u")return;let e=document.body.offsetWidth,t=document.body.offsetHeight;this.currentWidth!==e&&(this.currentWidth=e),this.currentHeight!==t&&(this.currentHeight=t)}setupFpsTracking(){let e=0;this.fpsInterval=setInterval(()=>{e>0&&(this.droppedFpsPercentage=this.renderedFps/e),e=Math.max(this.renderedFps,e),this.nonReactiveState&&(this.nonReactiveState.fps=this.renderedFps),this.renderedFps=0},1e3)}startRenderLoop(){let e=()=>{if(this.disconnected)return;if(this.config.timeoutRendering){let i=1e3/(this.config.fpsLimit?Math.min(this.config.fpsLimit,60):60);this.timeoutId=setTimeout(e,i)}else this.animationFrameId=requestAnimationFrame(e);if(this.paused||this.renderer.xr.isPresenting&&!this.inWorldRenderingConfig?.vrPageGameRendering)return;if(!this.config.timeoutRendering&&this.config.fpsLimit){let r=performance.now(),i=r-this.lastRenderTime,s=1e3/this.config.fpsLimit;if(i<s)return;this.lastRenderTime=r-i%s}let t=!1;this.pendingResize&&(this.updateCanvasSize(),this.pendingResize=!1),(this.previousCanvasWidth!==this.currentWidth||this.previousCanvasHeight!==this.currentHeight)&&(this.previousCanvasWidth=this.currentWidth,this.previousCanvasHeight=this.currentHeight,this.sizeUpdated(),t=!0),this.frameRender(t),this.config.statsVisible!==void 0&&this.stats?.setVisibility(this.config.statsVisible)};e()}frameRender(e){this.preRender(),this.stats?.markStart(),ua(),globalThis.freezeRender||this.render(e);for(let t of this.onRender)t(e);this.renderedFps++,this.stats?.markEnd(),this.postRender()}setPaused(e){this.paused=e}dispose(){this.disconnected=!0,this.animationFrameId&&cancelAnimationFrame(this.animationFrameId),this.timeoutId&&clearTimeout(this.timeoutId),this.canvas instanceof HTMLCanvasElement&&this.canvas.remove(),clearInterval(this.fpsInterval),this.stats?.dispose(),this.renderer.dispose()}};function ha(){let n=document.createElement("canvas");return n.id="viewer-canvas",document.body.appendChild(n),n}var Ci=()=>{let n=ha(),e=n.transferControlToOffscreen(),t=!1,r=(o,l)=>{},i={width:0,height:0},s=()=>{t||((i.width!==window.innerWidth||i.height!==window.innerHeight)&&(r(window.innerWidth,window.innerHeight),i={width:window.innerWidth,height:window.innerHeight}),requestAnimationFrame(s))};return requestAnimationFrame(s),{canvas:e,destroy(){t=!0,n.remove()},onSizeChanged(o){r=o},get size(){return{width:window.innerWidth,height:window.innerHeight}}}};import{ItemsRenderer as ma}from"mc-assets/dist/itemsRenderer";import{getLoadedItemDefinitionsStore as Pi}from"mc-assets/dist/stores";var D5=null;function ba(n){return de?((!D5||typeof D5.get!="function")&&(D5=Pi(Bi)),D5):(ya(n),n.itemsDefinitionsStore)}function ya(n){de||typeof n.itemsDefinitionsStore?.get=="function"||(n.itemsDefinitionsStore=Pi(n.sourceItemDefinitionsJson??Bi))}var J0=class{constructor(e){d(this,"sourceItemDefinitionsJson",Bi);d(this,"itemsDefinitionsStore",Pi(this.sourceItemDefinitionsJson));d(this,"allReady",!1);d(this,"itemsAtlasImage");d(this,"blocksAtlasImage");d(this,"blocksAtlasJson");d(this,"itemsAtlasJson");d(this,"customBlockStates");d(this,"customModels");d(this,"customItemModelNames",{});d(this,"customTextures",{});d(this,"guiAtlas",null);d(this,"guiAtlasVersion",0);d(this,"itemsRenderer");d(this,"worldBlockProvider");d(this,"blockstatesModels",null);d(this,"version");d(this,"texturesVersion");d(this,"mcData");if(e){let t={...e};delete t.itemsDefinitionsStore,delete t.sourceItemDefinitionsJson,Object.assign(this,t),ya(this)}if(this.version){let t=globalThis.loadedData??globalThis.mcData;de&&t?.entitiesByName?this.mcData=t:this.mcData=ga(this.version)}}prepareForTransfer(){let e={};for(let t in this)Object.prototype.hasOwnProperty.call(this,t)&&typeof this[t]!="function"&&(t==="itemsRenderer"||t==="worldBlockProvider"||t==="mcData"||t==="itemsDefinitionsStore"||t==="sourceItemDefinitionsJson"||(e[t]=this[t]));return e.customTextures={},delete e.itemsDefinitionsStore,delete e.sourceItemDefinitionsJson,e}},pa="1.21.4",Kt=class Kt extends m0{constructor(){super(...arguments);d(this,"sourceBlockStatesModels",null);d(this,"sourceBlocksAtlases",yv);d(this,"sourceItemsAtlases",_v);d(this,"currentResources");d(this,"itemsAtlasParser");d(this,"blocksAtlasParser");d(this,"currentConfig");d(this,"abortController",new AbortController);d(this,"_promiseAssetsReadyResolvers",Promise.withResolvers())}rebuildWorkerRenderers(t){if(de&&!(!t.version||!t.blockstatesModels||!t.blocksAtlasJson)){if(this.blocksAtlasParser=new y0({latest:t.blocksAtlasJson},""),t.itemsAtlasJson)this.itemsAtlasParser=new y0({latest:t.itemsAtlasJson},"");else if(!this.itemsAtlasParser?.atlas?.latest){if(!this.sourceItemsAtlases||Object.keys(this.sourceItemsAtlases).length===0)return;this.itemsAtlasParser=new y0(this.sourceItemsAtlases,"")}t.itemsRenderer=new ma(t.version,t.blockstatesModels,this.itemsAtlasParser,this.blocksAtlasParser),t.worldBlockProvider=fa(t.blockstatesModels,this.blocksAtlasParser.atlas,pa)}}static restoreTransferred(t,r){let i=new Kt,s=o=>{i.currentResources=new J0(o),i.rebuildWorkerRenderers(i.currentResources)};return s(t.currentResources),r&&r.addEventListener("message",({data:o})=>{o.class===Kt.restorerName&&(o.type==="newResources"&&s(o.currentResources),o.type==="event"&&i.emit(o.eventName,...o.args))}),i}enrichTransferSnapshot(t){return t&&(this.itemsAtlasParser?.atlas?.latest&&(t.itemsAtlasJson=this.itemsAtlasParser.atlas.latest),this.blocksAtlasParser?.atlas?.latest&&(t.blocksAtlasJson=this.blocksAtlasParser.atlas.latest),t)}prepareForTransfer(t){if(t){let r=this.emit.bind(this);this.emit=(i,...s)=>{if(r(i,...s),t.postMessage({class:Kt.restorerName,type:"event",eventName:i,args:I5(s)}),i==="assetsTexturesUpdated"||i==="assetsInventoryReady"){let o=this.enrichTransferSnapshot(this.currentResources?.prepareForTransfer());t.postMessage({class:Kt.restorerName,type:"newResources",currentResources:o})}}}return{__restorer:Kt.restorerName,currentResources:this.enrichTransferSnapshot(this.currentResources?.prepareForTransfer())}}get promiseAssetsReady(){return this._promiseAssetsReadyResolvers.promise}async loadSourceData(t=this.currentConfig?.version){if(!t)throw new Error("No version loaded");this.sourceBlockStatesModels??(this.sourceBlockStatesModels=(await import("mc-assets/dist/blockStatesModels.json")).default)}resetResources(){this.currentResources=new J0}async updateAssetsData(t,r=!1){if(!this.currentConfig)throw new Error("No config loaded");this._promiseAssetsReadyResolvers=Promise.withResolvers();let i=new AbortController;if(await this.loadSourceData(this.currentConfig.version),i.signal.aborted)return;let s=this.currentResources??new J0;s.version=this.currentConfig.version,s.texturesVersion=this.currentConfig.texturesVersion??s.version,s.mcData=ga(s.version),s.blockstatesModels={blockstates:{},models:{}},s.blockstatesModels.blockstates.latest={...this.sourceBlockStatesModels.blockstates.latest,...s.customBlockStates},s.blockstatesModels.models.latest={...this.sourceBlockStatesModels.models.latest,...s.customModels},await Promise.all([this.recreateBlockAtlas(s),this.recreateItemsAtlas(s)]),!i.signal.aborted&&(s.version&&s.blockstatesModels&&this.itemsAtlasParser&&this.blocksAtlasParser&&(s.itemsRenderer=new ma(s.version,s.blockstatesModels,this.itemsAtlasParser,this.blocksAtlasParser)),!i.signal.aborted&&(this.currentResources=s,s.allReady=!0,r||this.emit("assetsTexturesUpdated"),this.currentConfig.noInventoryGui?this._promiseAssetsReadyResolvers.resolve():(this.emit("assetsInventoryStarted"),this.generateGuiTextures().then(()=>{i.signal.aborted||(r||this.emit("assetsInventoryReady"),this._promiseAssetsReadyResolvers.resolve())}))))}async recreateBlockAtlas(t=this.currentResources){let r={},i=new Date;(i.getMonth()===11&&i.getDate()>=24||i.getMonth()===0&&i.getDate()<=6)&&Object.assign(r,Rv);let s=new y0(this.sourceBlocksAtlases,wv,Av),o=Object.keys(t.customTextures.blocks?.textures??{}),{atlas:l,canvas:a}=await s.makeNewAtlas(t.texturesVersion,v=>{if(this.currentConfig.includeOnlyBlocks&&!this.currentConfig.includeOnlyBlocks.includes(v))return!1;let c=t.customTextures.blocks?.textures[v];return r[v]??c},void 0,void 0,o,{needHorizontalIndexes:!!this.currentConfig.includeOnlyBlocks});this.blocksAtlasParser=new y0({latest:l},a.toDataURL()),t.blocksAtlasImage=await createImageBitmap(a),t.blocksAtlasJson=this.blocksAtlasParser.atlas.latest,t.worldBlockProvider=fa(t.blockstatesModels,this.blocksAtlasParser.atlas,pa)}async recreateItemsAtlas(t=this.currentResources){let r=new y0(this.sourceItemsAtlases,Ev,xv),i=Object.keys(t.customTextures.items?.textures??{}),{atlas:s,canvas:o}=await r.makeNewAtlas(t.texturesVersion,l=>{let a=t.customTextures.items?.textures[l];if(a)return a},t.customTextures.items?.tileSize,void 0,i);this.itemsAtlasParser=new y0({latest:s},o.toDataURL()),t.itemsAtlasImage=await createImageBitmap(o),t.itemsAtlasJson=this.itemsAtlasParser.atlas.latest}async generateGuiTextures(){}async downloadDebugAtlas(t=!1){if(!this.currentResources)throw new Error("No resources loaded");let s=await(t?this.itemsAtlasParser:this.blocksAtlasParser).createDebugImage(!0),o=document.createElement("a");o.href=s,o.download=`atlas-debug-${t?"items":"blocks"}.png`,o.click()}destroy(){this.abortController.abort(),this.currentResources=void 0,this.abortController=new AbortController}};d(Kt,"restorerName","ResourcesManager");var Rt=Kt;A();E();R();x();var bt=class extends Error{constructor(t,r){super(t);d(this,"failure");this.name="MesherWorkerPreloadError",this.failure=r}};function kv(n){return!n||typeof n!="object"?!1:n.type==="mc-web-pong"?!0:Array.isArray(n)?n.some(e=>e&&typeof e=="object"&&e.type==="mc-web-pong"):!1}var Sv=45e3,Tv=1e4;async function _a(n){if(L.env.SINGLE_FILE_BUILD)return;let e=n?.fetchTimeoutMs??Sv,t=n?.pingTimeoutMs??Tv,r=n?.script??"mesher.js",i=new URL(r,document.baseURI).href,s;try{let u=new AbortController,h=window.setTimeout(()=>u.abort(),e);try{s=await fetch(i,{credentials:"same-origin",cache:"force-cache",signal:u.signal})}finally{clearTimeout(h)}}catch(u){let h=u;throw h?.name==="AbortError"?new bt(`Mesher script fetch timed out after ${e}ms (${i}).`,{phase:"fetch",code:"timeout"}):new bt(`Mesher script fetch failed (network): ${h?.message??u}. URL: ${i}`,{phase:"fetch",code:"network",detail:String(h?.message??u)})}if(!s.ok)throw new bt(`Mesher script HTTP ${s.status} ${s.statusText}: ${i}`,{phase:"fetch",code:"bad-status",status:s.status});let o=s.headers.get("content-type")??"",l=await s.arrayBuffer();if(l.byteLength===0)throw new bt(`Mesher script response was empty: ${i}`,{phase:"fetch",code:"invalid-body",hint:"empty"});let a=Math.min(1024,l.byteLength),v=new TextDecoder().decode(l.slice(0,a)).trimStart();if(v.startsWith("<!DOCTYPE")||v.startsWith("<html")||v.startsWith("<HTML"))throw new bt(`Mesher URL returned HTML (wrong path, redirect, or SPA fallback), not JavaScript: ${i}`,{phase:"fetch",code:"invalid-body",hint:"html"});o.length>0&&/javascript|ecmascript/i.test(o);let c;try{c=new Worker(i)}catch(u){let h=u instanceof Error?u.message:String(u);throw new bt(`Could not construct Worker for mesher (${i}): ${h}`,{phase:"worker",code:"construct-failed",message:h})}await new Promise((u,h)=>{let p=!1,m=window.setTimeout(()=>{p||(p=!0,b(),h(new bt(`Mesher worker did not reply with mc-web-pong within ${t}ms (wrong script, SW stale cache, worker blocked, or COEP/CORP). URL: ${i}`,{phase:"ping",code:"timeout"})))},t),b=()=>{clearTimeout(m);let S=c;c=void 0,S&&(S.removeEventListener("message",y),S.removeEventListener("error",M),S.removeEventListener("messageerror",T),S.terminate())},k=()=>{p||(p=!0,b(),u())},_=S=>{p||(p=!0,b(),h(S))};function y(S){kv(S.data)&&k()}function M(S){_(new bt(`Mesher worker script failed to load or threw during startup: ${S.message||"unknown"} @ ${i}`,{phase:"worker",code:"script-error",message:S.message}))}function T(){_(new bt(`Mesher worker message channel error (structured clone / deserialization). URL: ${i}`,{phase:"ping",code:"messageerror"}))}c.addEventListener("message",y),c.addEventListener("error",M),c.addEventListener("messageerror",T);try{c.postMessage({type:"mc-web-ping",t:performance.now(),workerIndex:0})}catch(S){let B=S instanceof Error?S.message:String(S);_(new bt(`Failed to post mc-web-ping to mesher worker: ${B}`,{phase:"ping",code:"post-failed",detail:B}))}})}var Aa=class{constructor(e={},t=new Rt){this.resourcesManager=t;d(this,"waitBackendLoadPromises",[]);d(this,"onWorldStart");d(this,"onBeforeWorldStart");d(this,"worldView");d(this,"config");d(this,"menuBackgroundOptions");d(this,"inWorldRenderingConfig");d(this,"backend");d(this,"backendLoader");d(this,"currentState");d(this,"currentDisplay",null);d(this,"playerState",{reactive:Ai()});d(this,"rendererState");d(this,"nonReactiveState");d(this,"worldReady");d(this,"resolveWorldReady");d(this,"lastCamUpdate",0);d(this,"getRendererOptions");this.config={...na,...e.config},this.menuBackgroundOptions={...e.config?.menuBackground,...e.menuBackground},this.inWorldRenderingConfig=wa({...Sr,...e.rendererConfig});let r=f0();this.rendererState=r.reactive,this.nonReactiveState=r.nonReactive,this.initWorldReadyPromise()}initWorldReadyPromise(){let{promise:e,resolve:t}=Promise.withResolvers();this.worldReady=e,this.resolveWorldReady=t}preloadWorkers(){let e=this.inWorldRenderingConfig.wasmMesher?"mesherWasm.js":"mesher.js";return _a({script:e})}bindRendererOptions(e){this.getRendererOptions=e}async loadBackend(e){this.backend&&this.disconnectBackend(),await Promise.all(this.waitBackendLoadPromises),this.waitBackendLoadPromises=[],this.backendLoader=e;let t={config:this.config,getRendererOptions:this.getRendererOptions,callbacks:{displayCriticalError:i=>{},setRendererSpecificSettings:(i,s)=>{},fireCustomEvent:(i,...s)=>{}},rendererSpecificSettings:{}},r=e(t);if(this.backend=await Promise.resolve(r),this.currentState)if(this.currentState.method==="startMenuBackground")this.startMenuBackground(...this.currentState.args);else{let{method:i,args:s}=this.currentState;this.backend[i](...s)}}async startWorld(e,t,r=this.playerState.reactive,i){if(this.currentDisplay==="world")throw new Error("World already started");this.currentDisplay="world";let s=i??new Mv(0,64,0);this.worldView=new b0(e,t,s),this.worldView.isPlayground=this.inWorldRenderingConfig.isPlayground;let o={version:this.resourcesManager?.currentConfig?.version??"1.20.4",worldView:this.worldView,inWorldRenderingConfig:this.inWorldRenderingConfig,playerStateReactive:r,rendererState:this.rendererState,nonReactiveState:this.nonReactiveState,resourcesManager:this.resourcesManager};this.onBeforeWorldStart?.();let l;if(this.backend){let a=this.backend.startWorld(o);a&&typeof a.then=="function"&&(l=a)}return this.currentState={method:"startWorld",args:[o]},await l,this.resolveWorldReady(),this.onWorldStart?.(),!!l}startMenuBackground(e){if(this.currentDisplay==="menu")return;let t={...this.menuBackgroundOptions,...e,resourcesManager:e?.resourcesManager??this.resourcesManager};this.backend&&(this.currentDisplay="menu",this.backend.startMenuBackground(t)),this.currentState={method:"startMenuBackground",args:[t]}}resetBackend(e=!1){this.disconnectBackend(e),this.backendLoader&&this.loadBackend(this.backendLoader)}disconnectBackend(e=!1){e&&(this.currentState=void 0,this.currentDisplay=null,this.worldView=void 0),this.backend&&(this.backend.disconnect(),this.backend=void 0),this.currentDisplay=null,this.initWorldReadyPromise(),this.rendererState=wa(f0().reactive),this.nonReactiveState=f0().nonReactive}updateCamera(e,t,r,i){this.backend?.updateCamera(e,t,r,i)}setRendering(e){this.backend?.setRendering(e)}async startWithBot(e,t){await this.startWorld(e.world,t),this.worldView&&typeof this.worldView.listenToBot=="function"&&this.worldView.listenToBot(e)}destroyAll(){this.disconnectBackend(!0),this.resourcesManager&&typeof this.resourcesManager.destroy=="function"&&this.resourcesManager.destroy()}get utils(){let e=this.backend;return{async waitingForChunks(){if(!e?.worldState?.allChunksLoaded)return new Promise(t=>{let r=setInterval(()=>{e?.worldState?.allChunksLoaded&&(clearInterval(r),t())},100)})}}}destroy(){this.disconnectBackend(!0)}};A();E();R();x();import{subscribe as Uv}from"valtio/vanilla";A();E();R();x();A();E();R();x();var _0=["galaxy","nether","end","cyber","light"],w0=["cruise","barrel","dive","orbit","snake"],Pr={galaxy:"Galaxy",nether:"Nether",end:"The End",cyber:"Cyber",light:"Light Space"},Ir={cruise:"Cruise",barrel:"Barrel",dive:"Dive",orbit:"Orbit",snake:"Snake"},A0=["mixed","stainedGlass","wool","construction","glow","world"],Hr={mixed:"Mixed",stainedGlass:"Stained glass",wool:"Wool",construction:"Construction",glow:"Glow",world:"World (grass & ores)"};A();E();R();x();var Ct={mode:"v2",minecraftTextures:!0,v2Scene:"light",v2Camera:"dive",v2BlockGroup:"stainedGlass",v2CameraSpeedPercent:80,v2BlockSpeedPercent:40},Ot=n=>n/100,Lr={camera:Ot(Ct.v2CameraSpeedPercent),block:Ot(Ct.v2BlockSpeedPercent)};var Cv={off:0,holes:1,texIndex:2,faces:3,atlasAlpha:4};function Ii(n){return Cv[n]}var E0=Ct,Ea={rendererWorldPerformance:"normal",rendererMeshersCountOverride:null,starfieldRendering:!0,defaultSkybox:!0,menuBackgroundMode:E0.mode,menuBackgroundMinecraftTextures:E0.minecraftTextures,menuBackgroundV2Scene:E0.v2Scene,menuBackgroundV2Camera:E0.v2Camera,menuBackgroundV2BlockGroup:E0.v2BlockGroup,menuBackgroundV2CameraSpeed:E0.v2CameraSpeedPercent,menuBackgroundV2BlockSpeed:E0.v2BlockSpeedPercent,rendererFuturisticReveal:!1,rendererPerfDebugOverlay:!1,disableBlockEntityTextures:!1,rendererMesher:"wasm",rendererShaderCubeDebugMode:"off",showChunkBorders:!1,renderEntities:!0,renderDebug:"basic",frameLimit:!1,backgroundRendering:"20fps",vanillaLook:!1,smoothLighting:!0,newVersionsLighting:!1,vrSupport:!0,vrPageGameRendering:!1,clipWorldBelowY:void 0,highlightBlockColor:"auto",loadPlayerSkins:!0,renderEars:!0,showHand:!0,viewBobbing:!0,dayCycleAndLighting:!0,keepChunksDistance:1,gpuPreference:"default",fov:75};function Bv(n){n.highPerformanceGpu&&(n.gpuPreference="high-performance",delete n.highPerformanceGpu),n.rendererMesher!=="wasm"&&n.rendererMesher!=="legacy-js"&&(typeof n.rendererWasmMesher=="boolean"?n.rendererMesher=n.rendererWasmMesher?"wasm":"legacy-js":typeof n.wasmExperimentalMesher=="boolean"&&(n.rendererMesher=n.wasmExperimentalMesher?"wasm":"legacy-js")),delete n.wasmExperimentalMesher,delete n.rendererWasmMesher,delete n.rendererShaderCubeBlocks,n.menuBackgroundMode==="futuristic"&&(n.menuBackgroundMode="v2");let e=[["menuBackgroundFuturisticScene","menuBackgroundV2Scene"],["menuBackgroundFuturisticCamera","menuBackgroundV2Camera"],["menuBackgroundFuturisticBlockGroup","menuBackgroundV2BlockGroup"],["menuBackgroundFuturisticCameraSpeed","menuBackgroundV2CameraSpeed"],["menuBackgroundFuturisticBlockSpeed","menuBackgroundV2BlockSpeed"]];for(let[t,r]of e)n[t]!==void 0&&n[r]===void 0&&(n[r]=n[t]),delete n[t]}var xa={menuBackgroundMode:{possibleValues:[["classic","Classic"],["v2","V2"]],requiresRestart:!0},menuBackgroundMinecraftTextures:{text:"Minecraft block textures",tooltip:"Use block atlas on V2 menu cubes (loads assets on menu)"},menuBackgroundV2Scene:{possibleValues:_0.map(n=>[n,Pr[n]])},menuBackgroundV2Camera:{possibleValues:w0.map(n=>[n,Ir[n]])},menuBackgroundV2BlockGroup:{possibleValues:A0.map(n=>[n,Hr[n]]),text:"Block pool",tooltip:"Block set for textured menu cubes (requires Minecraft textures)"},menuBackgroundV2CameraSpeed:{text:"Camera speed",tooltip:"Orbit / fly-through camera path speed. 0 freezes the path; mouse parallax still works.",min:0,max:200,unit:"%"},menuBackgroundV2BlockSpeed:{text:"Block speed",tooltip:"Floating blocks and sky rotation. Independent of camera path speed.",min:0,max:200,unit:"%"},rendererWorldPerformance:{text:"World performance",tooltip:"Background workers for chunk geometry. Recreates mesher workers and reloads chunks.",requiresChunksReload:!0,possibleValues:[["low-energy","Low Energy"],["normal","Normal"],["maximum","Maximum"]]},starfieldRendering:{text:"Starfield"},defaultSkybox:{text:"Default skybox"},rendererFuturisticReveal:{text:"Futuristic world reveal"},rendererPerfDebugOverlay:{text:"Performance debug overlay"},disableBlockEntityTextures:{text:"Disable block entity textures",tooltip:"Skips signs, banners, heads, maps, etc."},rendererMesher:{possibleValues:[["wasm","WASM"],["legacy-js","Legacy JS"]],text:"Mesher pipeline",tooltip:"Browser technology for processing world geometry before render. WASM is the fastest; if you see a dead tab icon, reloads, or other errors, switch to Legacy JS.",requiresChunksReload:!0},rendererShaderCubeDebugMode:{text:"Shader cube debug",tooltip:"Instanced cube path visualization (requires shader cubes enabled).",possibleValues:[["off","Off"],["holes","Hole test (red)"],["texIndex","Tile index colors"],["faces","Face id colors"],["atlasAlpha","Atlas alpha"]]},showChunkBorders:{text:"Chunk borders"},renderEntities:{text:"Render entities"},renderDebug:{possibleValues:["advanced","basic","none"]},frameLimit:{text:"Frame limit",tooltip:"false = VSync / unlimited when focused"},backgroundRendering:{text:"Background FPS limit",possibleValues:[["full","NO"],["5fps","5 FPS"],["20fps","20 FPS"]]},vanillaLook:{text:"Vanilla shading",tooltip:"On: Minecraft-style face shading. Off: higher-contrast client shading."},smoothLighting:{},newVersionsLighting:{text:"Lighting in newer versions"},vrSupport:{text:"VR support",tooltip:"Shows VR entry; does not force VR on."},vrPageGameRendering:{text:"VR page game rendering"},clipWorldBelowY:{text:"Clip world below Y"},highlightBlockColor:{possibleValues:[["auto","Auto"],["blue","Blue"],["classic","Classic"]]},loadPlayerSkins:{},renderEars:{tooltip:"Deadmau5 ears when the skin texture includes them"},showHand:{},viewBobbing:{},dayCycleAndLighting:{text:"Day cycle"},keepChunksDistance:{text:"Keep chunks distance",tooltip:"Extra distance before unloading chunks",max:5,unit:""},fov:{min:30,max:110,unit:"\xB0",text:"FOV"},gpuPreference:{text:"GPU preference",tooltip:"WebGL power preference. Requires reload / backend restart to apply.",requiresRestart:!0,possibleValues:[["default","Auto"],["high-performance","Dedicated"],["low-power","Low power"]]}},Ra=[{title:"World rendering",keys:["rendererWorldPerformance","starfieldRendering","defaultSkybox","disableBlockEntityTextures","showChunkBorders","renderEntities","smoothLighting","vanillaLook","newVersionsLighting","dayCycleAndLighting","loadPlayerSkins","renderEars","showHand","viewBobbing","fov","keepChunksDistance","highlightBlockColor","clipWorldBelowY"]},{title:"Frame pacing",keys:["frameLimit","backgroundRendering","renderDebug","gpuPreference"]},{title:"VR",keys:["vrSupport","vrPageGameRendering"]},{title:"Menu background",keys:["menuBackgroundMode","menuBackgroundMinecraftTextures","menuBackgroundV2Scene","menuBackgroundV2Camera","menuBackgroundV2BlockGroup","menuBackgroundV2CameraSpeed","menuBackgroundV2BlockSpeed"]},{title:"Mesher",keys:["rendererMesher"]},{title:"Renderer debug",keys:["rendererFuturisticReveal","rendererPerfDebugOverlay","rendererShaderCubeDebugMode"]}];A();E();R();x();A();E();R();x();A();E();R();x();A();E();R();x();function Hi(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let l=0;l<i;l++){let a=(o+l*r)*4;if(s.data[a+3]!==255)return!0}return!1}function F5(n){return n/64}function ka(n,e,t){if(t){if(Hi(n,0,0,e,e))return}else if(Hi(n,0,0,e,e/2))return;let r=F5(e),i=(s,o,l,a)=>n.clearRect(s*r,o*r,l*r,a*r);i(40,0,8,8),i(48,0,8,8),i(32,8,8,8),i(40,8,8,8),i(48,8,8,8),i(56,8,8,8),t&&(i(4,32,4,4),i(8,32,4,4),i(0,36,4,12),i(4,36,4,12),i(8,36,4,12),i(12,36,4,12),i(20,32,8,4),i(28,32,8,4),i(16,36,4,12),i(20,36,8,12),i(28,36,4,12),i(32,36,8,12),i(44,32,4,4),i(48,32,4,4),i(40,36,4,12),i(44,36,4,12),i(48,36,4,12),i(52,36,12,12),i(4,48,4,4),i(8,48,4,4),i(0,52,4,12),i(4,52,4,12),i(8,52,4,12),i(12,52,4,12),i(52,48,4,4),i(56,48,4,4),i(48,52,4,12),i(52,52,4,12),i(56,52,4,12),i(60,52,4,12))}function Pv(n,e){n.save(),n.scale(-1,1);let t=F5(e),r=(i,s,o,l,a,v)=>n.drawImage(n.canvas,i*t,s*t,o*t,l*t,-a*t,v*t,-o*t,l*t);r(4,16,4,4,20,48),r(8,16,4,4,24,48),r(0,20,4,12,24,52),r(4,20,4,12,20,52),r(8,20,4,12,16,52),r(12,20,4,12,28,52),r(44,16,4,4,36,48),r(48,16,4,4,40,48),r(40,20,4,12,40,52),r(44,20,4,12,36,52),r(48,20,4,12,32,52),r(52,20,4,12,44,52),n.restore()}function Li(n,e){let t=!1;if(e.width!==e.height)if(e.width===2*e.height)t=!0;else throw new Error(`Bad skin size: ${e.width}x${e.height}`);let r=n.getContext("2d",{willReadFrequently:!0});if(t){let i=e.width;n.width=i,n.height=i,r.clearRect(0,0,i,i),r.drawImage(e,0,0,i,i/2),Pv(r,i),ka(r,n.width,!1)}else n.width=e.width,n.height=e.height,r.clearRect(0,0,e.width,e.height),r.drawImage(e,0,0,n.width,n.height),ka(r,n.width,!0)}function Iv(n){if(n.width===2*n.height)return n.width/64;if(n.width*17===n.height*22)return n.width/22;if(n.width*11===n.height*23)return n.width/46;throw new Error(`Bad cape size: ${n.width}x${n.height}`)}function Oi(n,e){let t=Iv(e);n.width=64*t,n.height=32*t;let r=n.getContext("2d",{willReadFrequently:!0});r.clearRect(0,0,n.width,n.height),r.drawImage(e,0,0,e.width,e.height)}function Hv(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let l=0;l<i;l++){let a=(o+l*r)*4;if(!(s.data[a+0]===0&&s.data[a+1]===0&&s.data[a+2]===0&&s.data[a+3]===255))return!1}return!0}function Lv(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let l=0;l<i;l++){let a=(o+l*r)*4;if(!(s.data[a+0]===255&&s.data[a+1]===255&&s.data[a+2]===255&&s.data[a+3]===255))return!1}return!0}function Di(n){let e=F5(n.width),t=n.getContext("2d",{willReadFrequently:!0}),r=(l,a,v,c)=>Hi(t,l*e,a*e,v*e,c*e),i=(l,a,v,c)=>Hv(t,l*e,a*e,v*e,c*e),s=(l,a,v,c)=>Lv(t,l*e,a*e,v*e,c*e);return r(50,16,2,4)||r(54,20,2,12)||r(42,48,2,4)||r(46,52,2,12)||i(50,16,2,4)&&i(54,20,2,12)&&i(42,48,2,4)&&i(46,52,2,12)||s(50,16,2,4)&&s(54,20,2,12)&&s(42,48,2,4)&&s(46,52,2,12)?"slim":"default"}function Fi(n,e){if(e.width!==e.height&&e.width!==2*e.height)throw new Error(`Bad skin size: ${e.width}x${e.height}`);let t=F5(e.width),r=14*t,i=7*t;n.width=r,n.height=i;let s=n.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,r,i),s.drawImage(e,24*t,0,r,i,0,0,r,i)}A();E();R();x();import Fv from"mc-assets/dist/other-textures/latest/entity/player/wide/steve.png";A();E();R();x();import*as ft from"three";A();E();R();x();var Ov=()=>{if(typeof OffscreenCanvas>"u")return!1;try{let n=new OffscreenCanvas(1,1);return(n.getContext("webgl2")||n.getContext("webgl"))!==null}catch{return!1}},Dv=Ov(),Ne=(n,e)=>{if(Dv||typeof document>"u")return new OffscreenCanvas(n,e);let t=document.createElement("canvas");return t.width=n,t.height=e,t};async function x0(n){let t=await(await fetch(n)).blob();return createImageBitmap(t)}var zi=n=>{let[e,t="0",r="0"]=n.split(".");return+`${e.padStart(2,"0")}${t.padStart(2,"0")}${r.padStart(2,"0")}`};var Me=(n,e=!1)=>{n instanceof ft.Mesh&&(n.geometry?.dispose?.(),n.material?.dispose?.()),n instanceof ft.SkinnedMesh&&n.skeleton?.dispose?.(),n.children&&n.children.forEach(t=>Me(t,e)),e&&n instanceof ft.Mesh&&n.material?.map?.dispose?.()},Ui={},Sa={},Or=n=>{let e=new ft.Texture,t=x0(n).then(r=>{let i=new OffscreenCanvas(r.width,r.height);return i.getContext("2d").drawImage(r,0,0),e.source.data=i,e.needsUpdate=!0,e});return{texture:e,promise:t}},X0=async n=>Or(n).texture,qt=n=>{let e=Ne(n.width,n.height);e.getContext("2d").drawImage(n,0,0);let r=new ft.Texture(e);return r.magFilter=ft.NearestFilter,r.minFilter=ft.NearestFilter,r};function Z0(n){let{texture:e,promise:t}=Or(n);return e.magFilter=ft.NearestFilter,e.minFilter=ft.NearestFilter,t.catch(r=>{}),e}async function z5(n,e,t){if(!Ui[n]){let{promise:i,resolve:s}=Promise.withResolvers(),o=Or(n);Ui[n]=o.texture,o.promise.then(s),Sa[n]=i}e(Ui[n]),Sa[n].then(()=>{t?.()})}var lt=Fv,Ug=X0(lt);var Ta={apiEnabled:!0},U5=n=>{Object.assign(Ta,n)};async function Jt(n,e){if(!Ta.apiEnabled||e==="cape")return;let t=`https://playerdb.co/api/player/minecraft/${n}`,r=await fetch(t);return r.ok?(await r.json()).data.player.skin_texture:void 0}async function Bt(n){n.startsWith("data:")||(n=await zv(n.replace("http://","https://")));let e=await x0(n),t=Ne(64,64);return Li(t,e),{canvas:t,image:e}}var zv=async n=>{let t=await(await fetch(n,{})).arrayBuffer();return`data:image/png;base64,${O.from(t).toString("base64")}`};function Jg(n){return{mode:n.menuBackgroundMode,useMinecraftTextures:n.menuBackgroundMinecraftTextures,v2Scene:n.menuBackgroundV2Scene,v2Camera:n.menuBackgroundV2Camera,v2BlockGroup:n.menuBackgroundV2BlockGroup,v2CameraSpeed:Ot(n.menuBackgroundV2CameraSpeed),v2BlockSpeed:Ot(n.menuBackgroundV2BlockSpeed)}}function Vv(n,e){let t=n.v2;t&&(t.setScene?.(e.menuBackgroundV2Scene),t.setCamera?.(e.menuBackgroundV2Camera),t.setBlockGroup?.(e.menuBackgroundV2BlockGroup),t.setCameraSpeed?.(Ot(e.menuBackgroundV2CameraSpeed)),t.setBlockSpeed?.(Ot(e.menuBackgroundV2BlockSpeed)))}function Gv(n){return n.rendererMesher!=="legacy-js"}function Nv(n,e,t){let r=n.inWorldRenderingConfig,i=e.rendererMeshersCountOverride,s=o=>{r.mesherWorkers=i??o};switch(e.rendererWorldPerformance){case"low-energy":s(1),r.dedicatedChangeWorker=!1;break;case"normal":s(2),r.dedicatedChangeWorker=!t;break;case"maximum":s(Math.max(3,Math.min(navigator.hardwareConcurrency??0,8))),r.dedicatedChangeWorker=!t;break}}function Wv(n,e,t){let r=e.backgroundRendering,i=e.frameLimit;t?n.config.fpsLimit=i||void 0:r==="5fps"?n.config.fpsLimit=5:r==="20fps"?n.config.fpsLimit=20:n.config.fpsLimit=void 0}function jv(n,e,t){let{renderDebug:r}=e;r==="none"||t.isCypress?n.config.statsVisible=0:r==="basic"?n.config.statsVisible=1:r==="advanced"&&(n.config.statsVisible=2)}function Yv(n,e,t={}){let r=n.inWorldRenderingConfig,i=Gv(e);r.showChunkBorders=e.showChunkBorders,r.futuristicReveal=e.rendererFuturisticReveal,Nv(n,e,i),r.renderEntities=e.renderEntities,jv(n,e,t),Wv(n,e,t.windowFocused!==!1),r.vrSupport=e.vrSupport,r.vrPageGameRendering=e.vrPageGameRendering,r.enableDebugOverlay=e.rendererPerfDebugOverlay,r.clipWorldBelowY=e.clipWorldBelowY,r.extraBlockRenderers=!e.disableBlockEntityTextures,r.fetchPlayerSkins=e.loadPlayerSkins,r.highlightBlockColor=e.highlightBlockColor,r.wasmMesher=i,r.shaderCubeBlocks=i,r.disableMesherConversionCache=!!t.isSafari,U5({apiEnabled:e.loadPlayerSkins}),r.smoothLighting=e.smoothLighting,r.shadingTheme=e.vanillaLook?"vanilla":"high-contrast",r.starfield=e.starfieldRendering,r.defaultSkybox=e.defaultSkybox,r.fov=e.fov,r.shaderCubeDebugMode=Ii(e.rendererShaderCubeDebugMode)}function Xg(n,e,t){e.keepChunksDistance=t.keepChunksDistance;let r=n.inWorldRenderingConfig;r.renderEars=t.renderEars,r.showHand=t.showHand,r.viewBobbing=t.viewBobbing,r.dayCycle=t.dayCycleAndLighting}function Zg(n,e,t={}){n.bindRendererOptions(()=>e);let r=t.getWindowFocused?.()??!0,i=()=>{let s=e;if(Yv(n,s,{isSafari:t.isSafari,isCypress:t.isCypress,windowFocused:r}),n.currentDisplay==="menu"){let o=n.backend?.getMenuBackground?.();o&&Vv(o,s)}};return i(),t.onRegisterFocusHandlers?.({onFocus:()=>{r=!0,i()},onBlur:()=>{r=!1,i()}}),Uv(e,i)}function $g(n,e,t){n.inWorldRenderingConfig.enableLighting=!t||e}A();E();R();x();import{proxy as Qv}from"valtio";var Ma=()=>Qv({playerSkin:void 0,inWater:!1,waterBreathing:!1,backgroundColor:[0,0,0],ambientLight:0,directionalLight:0,eyeHeight:0,gameMode:void 0,lookingAtBlock:void 0,diggingBlock:void 0,movementState:"NOT_MOVING",onGround:!0,sneaking:!1,flying:!1,sprinting:!1,walkDist:0,prevWalkDist:0,bob:0,prevBob:0,itemUsageTicks:0,username:"",onlineMode:!1,cardinalLight:"default",lightingDisabled:!1,shouldHideHand:!1,heldItemMain:void 0,heldItemOff:void 0,perspective:"first_person",onFire:!1,fovMultiplier:1,cameraSpectatingEntity:void 0,team:void 0}),Kv=n=>({isSpectator(){return n.gameMode==="spectator"},isSpectatingEntity(){return n.cameraSpectatingEntity!==void 0&&n.gameMode==="spectator"},isThirdPerson(){return this.isSpectatingEntity()?!1:n.perspective==="third_person_back"||n.perspective==="third_person_front"}}),qv=()=>({reactive:Ma()}),Ca=(n,e,t)=>({...e,"minecraft:date":new Date});A();E();R();x();A();E();R();x();import*as w5 from"three";import{Vec3 as ju}from"vec3";A();E();R();x();import{proxy as Jv,getVersion as Ni,subscribe as Ia}from"valtio";import{Vec3 as Wi}from"vec3";function Ha(n,e){let t=e??globalThis;return t.addEventListener("message",r=>{let{type:i,args:s,msgId:o}=r.data;if(n[i]){let l=n[i](...s);l instanceof Promise&&l.then(a=>{t.postMessage({type:"result",msgId:o,args:[a]})})}}),null}var La=(n,e=!0)=>{let t=0;return new Proxy({},{get(r,i){return i==="transfer"?(...s)=>new Proxy({},{get(o,l){return(...a)=>{n.postMessage({type:l,args:a},s)}}}):(...s)=>{let o=t++,l=e?s.filter(a=>a instanceof ArrayBuffer||a instanceof MessagePort||typeof ImageBitmap<"u"&&a instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&a instanceof OffscreenCanvas||typeof ImageData<"u"&&a instanceof ImageData):[];return n.postMessage({type:i,msgId:o,args:s},l),{then(a){let v=({data:c})=>{c.type==="result"&&c.msgId===o&&(a(c.args[0]),n.removeEventListener("message",v))};n.addEventListener("message",v)}}}}})},Oa=!1,Dr={toWorker:0,fromWorker:0},Ba=null,Xv=()=>{Ba==null&&(typeof window>"u"||(Ba=setInterval(()=>{globalThis.debugWorkerSyncStats={...Dr},Dr.toWorker=0,Dr.fromWorker=0},1e3)))},V5=n=>{Xv(),n==="toWorker"?Dr.toWorker++:Dr.fromWorker++};var Zv=()=>Math.random().toString(36).slice(2,15)+Math.random().toString(36).slice(2,15),$v=(n,e,t)=>{if(e.length===0)return;let r=n;for(let i=0;i<e.length-1;i++){let s=e[i];(r[s]==null||typeof r[s]!="object")&&(r[s]={}),r=r[s]}r[e[e.length-1]]=t},e8=(n,e)=>{if(e.length===0)return;let t=n;for(let r=0;r<e.length-1;r++)if(t=t[e[r]],t==null)return;delete t[e[e.length-1]]},Gi=(n,e)=>{if(n==null||typeof n!="object")return n;if(n instanceof Wi)return{x:n.x,y:n.y,z:n.z,__restorer:"Vec3"};if(typeof n.prepareForTransfer=="function")return n.prepareForTransfer(e);if(ArrayBuffer.isView(n))return n;if(Array.isArray(n))return n.map(r=>Gi(r,e));if(Ni(n)!==void 0)return Fr(n);let t={};for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=Gi(n[r],e));return t},t8=(n,e)=>{let t=[];for(let r of n){let i=r[0];i==="delete"?t.push({kind:"delete",path:r[1]}):i==="set"&&t.push({kind:"set",path:r[1],value:Gi(r[2],e)})}return t},Da=(n,e,t,r,i)=>{if(e.length===0)return;let s=t8(e,t);if(s.length!==0)try{t.postMessage({type:"sync",syncId:n,ops:s}),r==="toWorker"&&V5("toWorker")}catch{for(let l of s)l.kind==="set"&&R0(l.value)}},Fa=(n,e,t,r=!1)=>{for(let i of e)i.kind==="delete"?e8(n,i.path):$v(n,i.path,Ur(i.value,[],t,!1,!1));r==="fromWorker"&&V5("fromWorker")},za=(n,e,t,r,i)=>{try{let s=Fr(e);t.postMessage({type:"sync",syncId:n,value:s}),r==="toWorker"&&V5("toWorker")}catch{R0(e)}},Ua=(n,e,t,r=!1)=>{Object.assign(n,Ur(e,[],t,!1,!1)),r==="fromWorker"&&V5("fromWorker")},Vi=(n,e,t,r,i)=>{let s=n.__syncFromWorker||e.__syncFromWorker,o=n.__syncToWorker||e.__syncToWorker;if(!o&&!s&&!r)return;let l=Zv();if(n.__syncId=l,o||r){r&&o!==!1&&Ia(e,v=>{Da(l,v,t,"toWorker",`toWorker:${i}`)});let a=n.__syncToWorkerInterval??e.__syncToWorkerInterval??0;a>0&&!r&&setInterval(()=>{za(l,e,t,"toWorker",`toWorker:interval:${i}`)},a)}e.__syncFromWorker&&t.addEventListener("message",a=>{a.data.type==="sync"&&a.data.syncId===l&&(a.data.ops?Fa(e,a.data.ops,t,"fromWorker"):a.data.value&&Ua(e,a.data.value,t,"fromWorker"))})},Fr=n=>{if(Ni(n)===void 0)return n;if(Array.isArray(n))return n.map(Fr);if(typeof n=="object"&&n!==null){let e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=Fr(n[t]));return e}return n},zr=(n,e,t=!0,r=!0,i=!1)=>{var l,a;let s=n,o={};for(let v in n)if(Object.prototype.hasOwnProperty.call(n,v)){if(t&&typeof n[v]=="function")continue;if(n[v]instanceof Date||n[v]instanceof RegExp||n[v]instanceof Map||n[v]instanceof Set||n[v]instanceof WeakMap||n[v]instanceof WeakSet,n[v]instanceof Wi){o[v]={x:n[v].x,y:n[v].y,z:n[v].z},o[v].__restorer="Vec3";continue}if(o[v]=n[v],typeof n[v]=="object"&&n[v]!==null){if(n[v].prepareForTransfer){o[v]=n[v].prepareForTransfer(e);continue}let c=Ni(n[v])!==void 0;o[v]=c?Fr(n[v]):n[v],n[v].__syncFromWorker&&(o[v].__syncFromWorker=!0),n[v].__syncToWorker&&(o[v].__syncToWorker=!0),n[v].__syncFromWorkerInterval&&(o[v].__syncFromWorkerInterval=n[v].__syncFromWorkerInterval),n[v].__syncToWorkerInterval&&(o[v].__syncToWorkerInterval=n[v].__syncToWorkerInterval);let u=n[v].__syncToWorker!==!1&&!i&&c&&!n[v].__syncFromWorker;if((l=o[v]).__syncToWorker??(l.__syncToWorker=u),c&&((a=o[v]).__valtio??(a.__valtio=!0)),o[v].__syncToWorker&&c){Vi(o[v],s[v],e,!0,v);continue}if(o[v].__syncFromWorker||o[v].__syncToWorker){Vi(o[v],s[v],e,c,v);continue}Vi(o[v],s[v],e,!1,v),o[v]=zr(o[v],e,t,!1,c)}}return o},R0=(n,e=[])=>{for(let t in n)if(Object.prototype.hasOwnProperty.call(n,t)){if(!n[t])continue;typeof n[t]=="object"&&n[t]!==null&&R0(n[t],[...e,t]);try{structuredClone(n[t])}catch{}}},Pa=new WeakMap,r8=(n,e,t)=>{if(!n.__syncId)return;let r=n.__syncId,i=Pa.get(e);if(i||(i=new Set,Pa.set(e,i)),!i.has(r)&&(i.add(r),n.__syncToWorker&&e.addEventListener("message",s=>{s.data.type==="sync"&&s.data.syncId===r&&(s.data.ops?Fa(n,s.data.ops,e):s.data.value&&Ua(n,s.data.value,e))}),n.__syncFromWorker)){n.__valtio&&Ia(n,o=>{Da(r,o,e,"fromWorker",`fromWorker:${t}`)});let s=n.__syncFromWorkerInterval??0;s>0&&!n.__valtio&&setInterval(()=>{za(r,n,e,"fromWorker",`fromWorker:interval:${t}`)},s)}},n8=[{restorerName:"Vec3",restoreTransferred(n,e){return new Wi(n.x,n.y,n.z)}}];var Ur=(n,e,t,r=!0,i=!0)=>{let s=[...n8,...e],o=(l,a)=>{if(l==null||typeof l!="object")return l;if(l.__restorer){let v=s.find(u=>u.restorerName?u.restorerName===l.__restorer:u.name===l.__restorer);if(v)return v.restoreTransferred(l,t);let c=new Error(`Restorer ${l.__restorer} not found`);if(typeof r=="function")r(c);else if(r)throw c;return l}if(Array.isArray(l))return l.map((v,c)=>o(v,`${a}[${c}]`));for(let v in l){if(!Object.prototype.hasOwnProperty.call(l,v))continue;let c=l[v];c!=null&&typeof c=="object"&&(l[v]=o(c,`${a}.${v}`))}return l.__valtio&&(l=Jv(l)),i&&r8(l,t,a),l};return o(n,"root")};A();E();R();x();var G5=class{constructor(e){this.nonReactiveState=e;d(this,"events",[]);d(this,"frozenEvents",[]);d(this,"lastSecondEvents",[]);d(this,"currentFrameStartTime",null);d(this,"lastInteractionTime",0);d(this,"lastSecondUpdateTime",0);d(this,"timeWindowMs",5e3);d(this,"lastSecondWindowMs",1e3);d(this,"maxEvents",500);d(this,"lastSecondUpdateInterval",1e3);this.nonReactiveState.renderer||(this.nonReactiveState.renderer={timeline:{live:[],frozen:[],lastSecond:[]}}),this.nonReactiveState.renderer.timeline||(this.nonReactiveState.renderer.timeline={live:[],frozen:[],lastSecond:[]}),setInterval(()=>{this.updateLastSecondTimeline()},this.lastSecondUpdateInterval)}markFrameStart(){this.currentFrameStartTime=performance.now(),this.addEvent({type:"frameStart",timestamp:this.currentFrameStartTime})}markFrameEnd(){if(!this.currentFrameStartTime)return;let e=performance.now(),t=e-this.currentFrameStartTime;this.addEvent({type:"frameEnd",timestamp:e,duration:t}),this.currentFrameStartTime=null}markCameraUpdate(e){if(!e)return;let t=performance.now();this.lastInteractionTime=t,this.addEvent({type:"cameraUpdate",timestamp:t}),this.frozenEvents=[...this.events],this.trimEvents(this.frozenEvents),this.syncFrozenEvents()}markFrameDisplay(){this.addEvent({type:"frameDisplay",timestamp:performance.now()})}addEvent(e){this.events.push(e),this.lastSecondEvents.push(e),this.trimEvents(this.events),this.trimLastSecondEvents(),this.syncLiveEvents()}trimEvents(e){let r=performance.now()-this.timeWindowMs;for(;e.length>0&&e[0].timestamp<r;)e.shift();e.length>this.maxEvents&&e.splice(0,e.length-this.maxEvents)}trimLastSecondEvents(){let t=performance.now()-this.lastSecondWindowMs;for(;this.lastSecondEvents.length>0&&this.lastSecondEvents[0].timestamp<t;)this.lastSecondEvents.shift()}updateLastSecondTimeline(){let e=performance.now();e-this.lastSecondUpdateTime<this.lastSecondUpdateInterval||(this.lastSecondUpdateTime=e,this.trimLastSecondEvents(),this.syncLastSecondEvents())}syncLiveEvents(){this.nonReactiveState.renderer.timeline.live=[...this.events]}syncFrozenEvents(){this.nonReactiveState.renderer.timeline.frozen=[...this.frozenEvents]}syncLastSecondEvents(){this.nonReactiveState.renderer.timeline.lastSecond=[...this.lastSecondEvents]}clear(){this.events=[],this.frozenEvents=[],this.lastSecondEvents=[],this.syncLiveEvents(),this.syncFrozenEvents(),this.syncLastSecondEvents()}};A();E();R();x();import*as Z from"three";import{Vec3 as o0}from"vec3";A();E();R();x();function Va(n){let e=Math.floor(n.x/16),t=Math.floor(n.z/16);return[e,t]}function ji(n){let e=Math.floor(n.x/16),t=Math.floor(n.y/16),r=Math.floor(n.z/16);return[e,t,r]}A();E();R();x();import{Vec3 as Vr}from"vec3";import{subscribeKey as $i}from"valtio/utils";import{proxy as b8,subscribe as y8}from"valtio";A();E();R();x();var k0={blocks:"blocksArray",blockCollisionShapes:"blockCollisionShapes",biomes:"biomesArray",tints:"tints"};A();E();R();x();import i8 from"minecraft-data";import s8 from"minecraft-data/minecraft-data/data/pc/common/features.json";var Ga,Na=new WeakMap,Wa=n=>{Ga??(Ga=i8.versions.pc.map(({minecraftVersion:t,majorVersion:r,dataVersion:i,version:s})=>({minecraftVersion:t,majorVersion:r,dataVersion:i,version:s})));let e=Na.get(n);if(!e){if(e={},n.type==="pc")for(let{name:t}of s8)e[t]=n.supportFeature(t);Na.set(n,e)}return{protocolVersions:Ga,features:e}};A();E();R();x();var ja=16;var Ya=(n,e)=>e?`${n}:${e}`:String(n);A();E();R();x();var Qa=0,Dt={},Yi=40,S0="mc-renderer-debug-overlay",T0=(n,e=80,t=Qa,r=Yi,i)=>{if(de)return{updateText(){},setVisibility(){}};let s=document.createElement("div");return s.style.position="fixed",s.style.top=`${r??Yi}px`,s.style.right=`${t}px`,s.style.backgroundColor="rgba(0, 0, 0, 0.7)",s.style.color="white",s.style.padding="2px",s.style.fontFamily="monospace",s.style.fontSize="12px",i?.className?s.className=i.className:s.style.zIndex="100",s.style.pointerEvents="none",document.body.appendChild(s),Dt[n]=s,r===void 0&&t===Qa&&(Yi+=20),{updateText(o){s.innerText!==o&&(s.innerText=o)},setVisibility(o){s.style.display=o?"block":"none"}}};var Qi=(n,e)=>{de||!Dt[n]||(Dt[n].innerText=e)},Ka=n=>{if(!de)for(let e in Dt)Dt[e].style.display=n?"block":"none"},qa=()=>{if(!de)for(let n in Dt)o8(n)},o8=n=>{de||!Dt[n]||(Dt[n].remove(),delete Dt[n])};N5();A();E();R();x();function Je(n,e,t,r){if(n.on(e,t),r.aborted){n.off(e,t);return}r.addEventListener("abort",()=>{n.off(e,t)},{once:!0})}function Ja(n,e,t,r){if(n.on(e,t),r.aborted){n.off(e,t);return}r.addEventListener("abort",()=>{n.off(e,t)},{once:!0})}A();E();R();x();import Za from"prismarine-chunk";import{Vec3 as f8}from"vec3";A();E();R();x();import d8 from"minecraft-data";import u8 from"prismarine-block";var Ki={lightLevels:{lava:15,brown_mushroom:1,torch:14,wall_torch:14,fire:15,soul_fire:10,soul_torch:10,soul_wall_torch:10,glowstone:15,nether_portal:11,jack_o_lantern:15,enchanting_table:7,brewing_stand:1,lava_cauldron:15,end_portal:15,end_portal_frame:1,dragon_egg:1,ender_chest:7,beacon:15,sea_lantern:15,end_rod:14,end_gateway:15,magma_block:3,conduit:15,lantern:15,soul_lantern:10,shroomlight:15,crying_obsidian:10,amethyst_cluster:5,large_amethyst_bud:4,medium_amethyst_bud:2,small_amethyst_bud:1,sculk_sensor:1,sculk_catalyst:6,ochre_froglight:15,verdant_froglight:15,pearlescent_froglight:15},noOcclusions:{mangrove_roots:!0,oak_leaves:!0,spruce_leaves:!0,birch_leaves:!0,jungle_leaves:!0,acacia_leaves:!0,cherry_leaves:!0,dark_oak_leaves:!0,mangrove_leaves:!0,azalea_leaves:!0,flowering_azalea_leaves:!0,glass:!0,white_bed:!0,orange_bed:!0,magenta_bed:!0,light_blue_bed:!0,yellow_bed:!0,lime_bed:!0,pink_bed:!0,gray_bed:!0,light_gray_bed:!0,cyan_bed:!0,purple_bed:!0,blue_bed:!0,brown_bed:!0,green_bed:!0,red_bed:!0,black_bed:!0,moving_piston:!0,spawner:!0,oak_door:!0,ladder:!0,iron_door:!0,ice:!0,white_stained_glass:!0,orange_stained_glass:!0,magenta_stained_glass:!0,light_blue_stained_glass:!0,yellow_stained_glass:!0,lime_stained_glass:!0,pink_stained_glass:!0,gray_stained_glass:!0,light_gray_stained_glass:!0,cyan_stained_glass:!0,purple_stained_glass:!0,blue_stained_glass:!0,brown_stained_glass:!0,green_stained_glass:!0,red_stained_glass:!0,black_stained_glass:!0,oak_trapdoor:!0,spruce_trapdoor:!0,birch_trapdoor:!0,jungle_trapdoor:!0,acacia_trapdoor:!0,cherry_trapdoor:!0,dark_oak_trapdoor:!0,mangrove_trapdoor:!0,bamboo_trapdoor:!0,iron_bars:!0,chain:!0,glass_pane:!0,lily_pad:!0,brewing_stand:!0,cauldron:!0,dragon_egg:!0,cocoa:!0,beacon:!0,hopper:!0,white_stained_glass_pane:!0,orange_stained_glass_pane:!0,magenta_stained_glass_pane:!0,light_blue_stained_glass_pane:!0,yellow_stained_glass_pane:!0,lime_stained_glass_pane:!0,pink_stained_glass_pane:!0,gray_stained_glass_pane:!0,light_gray_stained_glass_pane:!0,cyan_stained_glass_pane:!0,purple_stained_glass_pane:!0,blue_stained_glass_pane:!0,brown_stained_glass_pane:!0,green_stained_glass_pane:!0,red_stained_glass_pane:!0,black_stained_glass_pane:!0,slime_block:!0,barrier:!0,light:!0,iron_trapdoor:!0,spruce_door:!0,birch_door:!0,jungle_door:!0,acacia_door:!0,cherry_door:!0,dark_oak_door:!0,mangrove_door:!0,bamboo_door:!0,end_rod:!0,chorus_plant:!0,chorus_flower:!0,frosted_ice:!0,turtle_egg:!0,sniffer_egg:!0,sea_pickle:!0,conduit:!0,bamboo:!0,lantern:!0,soul_lantern:!0,campfire:!0,soul_campfire:!0,crimson_trapdoor:!0,warped_trapdoor:!0,crimson_door:!0,warped_door:!0,honey_block:!0,candle:!0,white_candle:!0,orange_candle:!0,magenta_candle:!0,light_blue_candle:!0,yellow_candle:!0,lime_candle:!0,pink_candle:!0,gray_candle:!0,light_gray_candle:!0,cyan_candle:!0,purple_candle:!0,blue_candle:!0,brown_candle:!0,green_candle:!0,red_candle:!0,black_candle:!0,amethyst_cluster:!0,tinted_glass:!0,lightning_rod:!0,pointed_dripstone:!0,azalea:!0,flowering_azalea:!0,frogspawn:!0,decorated_pot:!0},colors:{stone:"rgb(112, 112, 112)",granite:"rgb(151, 109, 77)",polished_granite:"rgb(151, 109, 77)",diorite:"rgb(255, 252, 245)",polished_diorite:"rgb(255, 252, 245)",andesite:"rgb(112, 112, 112)",polished_andesite:"rgb(112, 112, 112)",grass_block:"rgb(127, 178, 56)",dirt:"rgb(151, 109, 77)",coarse_dirt:"rgb(151, 109, 77)",podzol:"rgb(129, 86, 49)",cobblestone:"rgb(112, 112, 112)",oak_planks:"rgb(143, 119, 72)",spruce_planks:"rgb(129, 86, 49)",birch_planks:"rgb(247, 233, 163)",jungle_planks:"rgb(151, 109, 77)",acacia_planks:"rgb(216, 127, 51)",cherry_planks:"rgb(209, 177, 161)",dark_oak_planks:"rgb(102, 76, 51)",mangrove_planks:"rgb(153, 51, 51)",bamboo_planks:"rgb(229, 229, 51)",bamboo_mosaic:"rgb(229, 229, 51)",oak_sapling:"rgb(0, 124, 0)",spruce_sapling:"rgb(0, 124, 0)",birch_sapling:"rgb(0, 124, 0)",jungle_sapling:"rgb(0, 124, 0)",acacia_sapling:"rgb(0, 124, 0)",cherry_sapling:"rgb(242, 127, 165)",dark_oak_sapling:"rgb(0, 124, 0)",mangrove_propagule:"rgb(0, 124, 0)",bedrock:"rgb(112, 112, 112)",water:"rgb(64, 64, 255)",lava:"rgb(255, 0, 0)",sand:"rgb(247, 233, 163)",suspicious_sand:"rgb(247, 233, 163)",red_sand:"rgb(216, 127, 51)",gravel:"rgb(112, 112, 112)",suspicious_gravel:"rgb(112, 112, 112)",gold_ore:"rgb(112, 112, 112)",deepslate_gold_ore:"rgb(100, 100, 100)",iron_ore:"rgb(112, 112, 112)",deepslate_iron_ore:"rgb(100, 100, 100)",coal_ore:"rgb(112, 112, 112)",deepslate_coal_ore:"rgb(100, 100, 100)",nether_gold_ore:"rgb(112, 2, 0)",mangrove_roots:"rgb(129, 86, 49)",muddy_mangrove_roots:"rgb(129, 86, 49)",oak_wood:"rgb(143, 119, 72)",spruce_wood:"rgb(129, 86, 49)",birch_wood:"rgb(247, 233, 163)",jungle_wood:"rgb(151, 109, 77)",acacia_wood:"rgb(76, 76, 76)",cherry_wood:"rgb(57, 41, 35)",dark_oak_wood:"rgb(102, 76, 51)",mangrove_wood:"rgb(153, 51, 51)",stripped_oak_wood:"rgb(143, 119, 72)",stripped_spruce_wood:"rgb(129, 86, 49)",stripped_birch_wood:"rgb(247, 233, 163)",stripped_jungle_wood:"rgb(151, 109, 77)",stripped_acacia_wood:"rgb(216, 127, 51)",stripped_cherry_wood:"rgb(160, 77, 78)",stripped_dark_oak_wood:"rgb(102, 76, 51)",oak_leaves:"rgb(0, 124, 0)",spruce_leaves:"rgb(0, 124, 0)",birch_leaves:"rgb(0, 124, 0)",jungle_leaves:"rgb(0, 124, 0)",acacia_leaves:"rgb(0, 124, 0)",cherry_leaves:"rgb(242, 127, 165)",dark_oak_leaves:"rgb(0, 124, 0)",mangrove_leaves:"rgb(0, 124, 0)",azalea_leaves:"rgb(0, 124, 0)",flowering_azalea_leaves:"rgb(0, 124, 0)",sponge:"rgb(229, 229, 51)",wet_sponge:"rgb(229, 229, 51)",lapis_ore:"rgb(112, 112, 112)",deepslate_lapis_ore:"rgb(100, 100, 100)",lapis_block:"rgb(74, 128, 255)",dispenser:"rgb(112, 112, 112)",sandstone:"rgb(247, 233, 163)",chiseled_sandstone:"rgb(247, 233, 163)",cut_sandstone:"rgb(247, 233, 163)",note_block:"rgb(143, 119, 72)",sticky_piston:"rgb(112, 112, 112)",cobweb:"rgb(199, 199, 199)",grass:"rgb(0, 124, 0)",fern:"rgb(0, 124, 0)",dead_bush:"rgb(143, 119, 72)",seagrass:"rgb(64, 64, 255)",tall_seagrass:"rgb(64, 64, 255)",piston:"rgb(112, 112, 112)",piston_head:"rgb(112, 112, 112)",white_wool:"rgb(255, 255, 255)",orange_wool:"rgb(216, 127, 51)",magenta_wool:"rgb(178, 76, 216)",light_blue_wool:"rgb(102, 153, 216)",yellow_wool:"rgb(229, 229, 51)",lime_wool:"rgb(127, 204, 25)",pink_wool:"rgb(242, 127, 165)",gray_wool:"rgb(76, 76, 76)",light_gray_wool:"rgb(153, 153, 153)",cyan_wool:"rgb(76, 127, 153)",purple_wool:"rgb(127, 63, 178)",blue_wool:"rgb(51, 76, 178)",brown_wool:"rgb(102, 76, 51)",green_wool:"rgb(102, 127, 51)",red_wool:"rgb(153, 51, 51)",black_wool:"rgb(25, 25, 25)",moving_piston:"rgb(112, 112, 112)",dandelion:"rgb(0, 124, 0)",torchflower:"rgb(0, 124, 0)",poppy:"rgb(0, 124, 0)",blue_orchid:"rgb(0, 124, 0)",allium:"rgb(0, 124, 0)",azure_bluet:"rgb(0, 124, 0)",red_tulip:"rgb(0, 124, 0)",orange_tulip:"rgb(0, 124, 0)",white_tulip:"rgb(0, 124, 0)",pink_tulip:"rgb(0, 124, 0)",oxeye_daisy:"rgb(0, 124, 0)",cornflower:"rgb(0, 124, 0)",wither_rose:"rgb(0, 124, 0)",lily_of_the_valley:"rgb(0, 124, 0)",brown_mushroom:"rgb(102, 76, 51)",red_mushroom:"rgb(153, 51, 51)",gold_block:"rgb(250, 238, 77)",iron_block:"rgb(167, 167, 167)",bricks:"rgb(153, 51, 51)",tnt:"rgb(255, 0, 0)",bookshelf:"rgb(143, 119, 72)",chiseled_bookshelf:"rgb(143, 119, 72)",mossy_cobblestone:"rgb(112, 112, 112)",obsidian:"rgb(25, 25, 25)",fire:"rgb(255, 0, 0)",soul_fire:"rgb(102, 153, 216)",spawner:"rgb(112, 112, 112)",chest:"rgb(143, 119, 72)",diamond_ore:"rgb(112, 112, 112)",deepslate_diamond_ore:"rgb(100, 100, 100)",diamond_block:"rgb(92, 219, 213)",crafting_table:"rgb(143, 119, 72)",wheat:"rgb(0, 124, 0)",farmland:"rgb(151, 109, 77)",furnace:"rgb(112, 112, 112)",oak_sign:"rgb(143, 119, 72)",birch_sign:"rgb(247, 233, 163)",acacia_sign:"rgb(216, 127, 51)",oak_wall_sign:"rgb(143, 119, 72)",birch_wall_sign:"rgb(247, 233, 163)",acacia_wall_sign:"rgb(216, 127, 51)",birch_hanging_sign:"rgb(247, 233, 163)",acacia_hanging_sign:"rgb(216, 127, 51)",cherry_hanging_sign:"rgb(160, 77, 78)",crimson_hanging_sign:"rgb(148, 63, 97)",warped_hanging_sign:"rgb(58, 142, 140)",bamboo_hanging_sign:"rgb(229, 229, 51)",spruce_wall_hanging_sign:"rgb(143, 119, 72)",birch_wall_hanging_sign:"rgb(247, 233, 163)",acacia_wall_hanging_sign:"rgb(216, 127, 51)",cherry_wall_hanging_sign:"rgb(160, 77, 78)",crimson_wall_hanging_sign:"rgb(148, 63, 97)",warped_wall_hanging_sign:"rgb(58, 142, 140)",bamboo_wall_hanging_sign:"rgb(229, 229, 51)",stone_pressure_plate:"rgb(112, 112, 112)",iron_door:"rgb(167, 167, 167)",redstone_ore:"rgb(112, 112, 112)",deepslate_redstone_ore:"rgb(100, 100, 100)",snow:"rgb(255, 255, 255)",ice:"rgb(160, 160, 255)",snow_block:"rgb(255, 255, 255)",cactus:"rgb(0, 124, 0)",clay:"rgb(164, 168, 184)",sugar_cane:"rgb(0, 124, 0)",jukebox:"rgb(151, 109, 77)",pumpkin:"rgb(216, 127, 51)",netherrack:"rgb(112, 2, 0)",soul_sand:"rgb(102, 76, 51)",soul_soil:"rgb(102, 76, 51)",basalt:"rgb(25, 25, 25)",polished_basalt:"rgb(25, 25, 25)",glowstone:"rgb(247, 233, 163)",carved_pumpkin:"rgb(216, 127, 51)",jack_o_lantern:"rgb(216, 127, 51)",oak_trapdoor:"rgb(143, 119, 72)",spruce_trapdoor:"rgb(129, 86, 49)",birch_trapdoor:"rgb(247, 233, 163)",jungle_trapdoor:"rgb(151, 109, 77)",acacia_trapdoor:"rgb(216, 127, 51)",cherry_trapdoor:"rgb(209, 177, 161)",dark_oak_trapdoor:"rgb(102, 76, 51)",mangrove_trapdoor:"rgb(153, 51, 51)",bamboo_trapdoor:"rgb(229, 229, 51)",stone_bricks:"rgb(112, 112, 112)",mossy_stone_bricks:"rgb(112, 112, 112)",cracked_stone_bricks:"rgb(112, 112, 112)",chiseled_stone_bricks:"rgb(112, 112, 112)",mud_bricks:"rgb(135, 107, 98)",infested_stone:"rgb(164, 168, 184)",infested_cobblestone:"rgb(164, 168, 184)",infested_stone_bricks:"rgb(164, 168, 184)",infested_mossy_stone_bricks:"rgb(164, 168, 184)",infested_cracked_stone_bricks:"rgb(164, 168, 184)",infested_chiseled_stone_bricks:"rgb(164, 168, 184)",brown_mushroom_block:"rgb(151, 109, 77)",red_mushroom_block:"rgb(153, 51, 51)",mushroom_stem:"rgb(199, 199, 199)",melon:"rgb(127, 204, 25)",attached_pumpkin_stem:"rgb(0, 124, 0)",attached_melon_stem:"rgb(0, 124, 0)",pumpkin_stem:"rgb(0, 124, 0)",melon_stem:"rgb(0, 124, 0)",vine:"rgb(0, 124, 0)",glow_lichen:"rgb(127, 167, 150)",mycelium:"rgb(127, 63, 178)",lily_pad:"rgb(0, 124, 0)",nether_bricks:"rgb(112, 2, 0)",nether_brick_fence:"rgb(112, 2, 0)",nether_wart:"rgb(153, 51, 51)",enchanting_table:"rgb(153, 51, 51)",brewing_stand:"rgb(167, 167, 167)",cauldron:"rgb(112, 112, 112)",end_portal:"rgb(25, 25, 25)",end_portal_frame:"rgb(102, 127, 51)",end_stone:"rgb(247, 233, 163)",dragon_egg:"rgb(25, 25, 25)",cocoa:"rgb(0, 124, 0)",emerald_ore:"rgb(112, 112, 112)",deepslate_emerald_ore:"rgb(100, 100, 100)",ender_chest:"rgb(112, 112, 112)",emerald_block:"rgb(0, 217, 58)",command_block:"rgb(102, 76, 51)",beacon:"rgb(92, 219, 213)",carrots:"rgb(0, 124, 0)",potatoes:"rgb(0, 124, 0)",anvil:"rgb(167, 167, 167)",chipped_anvil:"rgb(167, 167, 167)",damaged_anvil:"rgb(167, 167, 167)",trapped_chest:"rgb(143, 119, 72)",light_weighted_pressure_plate:"rgb(250, 238, 77)",heavy_weighted_pressure_plate:"rgb(167, 167, 167)",daylight_detector:"rgb(143, 119, 72)",redstone_block:"rgb(255, 0, 0)",nether_quartz_ore:"rgb(112, 2, 0)",hopper:"rgb(112, 112, 112)",quartz_block:"rgb(255, 252, 245)",chiseled_quartz_block:"rgb(255, 252, 245)",quartz_pillar:"rgb(255, 252, 245)",dropper:"rgb(112, 112, 112)",white_terracotta:"rgb(209, 177, 161)",orange_terracotta:"rgb(159, 82, 36)",magenta_terracotta:"rgb(149, 87, 108)",light_blue_terracotta:"rgb(112, 108, 138)",yellow_terracotta:"rgb(186, 133, 36)",lime_terracotta:"rgb(103, 117, 53)",pink_terracotta:"rgb(160, 77, 78)",gray_terracotta:"rgb(57, 41, 35)",light_gray_terracotta:"rgb(135, 107, 98)",cyan_terracotta:"rgb(87, 92, 92)",purple_terracotta:"rgb(122, 73, 88)",blue_terracotta:"rgb(76, 62, 92)",brown_terracotta:"rgb(76, 50, 35)",green_terracotta:"rgb(76, 82, 42)",red_terracotta:"rgb(142, 60, 46)",black_terracotta:"rgb(37, 22, 16)",slime_block:"rgb(127, 178, 56)",iron_trapdoor:"rgb(167, 167, 167)",prismarine:"rgb(76, 127, 153)",prismarine_bricks:"rgb(92, 219, 213)",dark_prismarine:"rgb(92, 219, 213)",prismarine_slab:"rgb(76, 127, 153)",prismarine_brick_slab:"rgb(92, 219, 213)",dark_prismarine_slab:"rgb(92, 219, 213)",sea_lantern:"rgb(255, 252, 245)",hay_block:"rgb(229, 229, 51)",white_carpet:"rgb(255, 255, 255)",orange_carpet:"rgb(216, 127, 51)",magenta_carpet:"rgb(178, 76, 216)",light_blue_carpet:"rgb(102, 153, 216)",yellow_carpet:"rgb(229, 229, 51)",lime_carpet:"rgb(127, 204, 25)",pink_carpet:"rgb(242, 127, 165)",gray_carpet:"rgb(76, 76, 76)",light_gray_carpet:"rgb(153, 153, 153)",cyan_carpet:"rgb(76, 127, 153)",purple_carpet:"rgb(127, 63, 178)",blue_carpet:"rgb(51, 76, 178)",brown_carpet:"rgb(102, 76, 51)",green_carpet:"rgb(102, 127, 51)",red_carpet:"rgb(153, 51, 51)",black_carpet:"rgb(25, 25, 25)",terracotta:"rgb(216, 127, 51)",coal_block:"rgb(25, 25, 25)",packed_ice:"rgb(160, 160, 255)",sunflower:"rgb(0, 124, 0)",lilac:"rgb(0, 124, 0)",rose_bush:"rgb(0, 124, 0)",peony:"rgb(0, 124, 0)",tall_grass:"rgb(0, 124, 0)",large_fern:"rgb(0, 124, 0)",white_banner:"rgb(143, 119, 72)",orange_banner:"rgb(143, 119, 72)",magenta_banner:"rgb(143, 119, 72)",light_blue_banner:"rgb(143, 119, 72)",yellow_banner:"rgb(143, 119, 72)",lime_banner:"rgb(143, 119, 72)",pink_banner:"rgb(143, 119, 72)",gray_banner:"rgb(143, 119, 72)",light_gray_banner:"rgb(143, 119, 72)",cyan_banner:"rgb(143, 119, 72)",purple_banner:"rgb(143, 119, 72)",blue_banner:"rgb(143, 119, 72)",brown_banner:"rgb(143, 119, 72)",green_banner:"rgb(143, 119, 72)",red_banner:"rgb(143, 119, 72)",black_banner:"rgb(143, 119, 72)",white_wall_banner:"rgb(143, 119, 72)",orange_wall_banner:"rgb(143, 119, 72)",magenta_wall_banner:"rgb(143, 119, 72)",light_blue_wall_banner:"rgb(143, 119, 72)",yellow_wall_banner:"rgb(143, 119, 72)",lime_wall_banner:"rgb(143, 119, 72)",pink_wall_banner:"rgb(143, 119, 72)",gray_wall_banner:"rgb(143, 119, 72)",light_gray_wall_banner:"rgb(143, 119, 72)",cyan_wall_banner:"rgb(143, 119, 72)",purple_wall_banner:"rgb(143, 119, 72)",blue_wall_banner:"rgb(143, 119, 72)",brown_wall_banner:"rgb(143, 119, 72)",green_wall_banner:"rgb(143, 119, 72)",red_wall_banner:"rgb(143, 119, 72)",black_wall_banner:"rgb(143, 119, 72)",red_sandstone:"rgb(216, 127, 51)",chiseled_red_sandstone:"rgb(216, 127, 51)",cut_red_sandstone:"rgb(216, 127, 51)",oak_slab:"rgb(143, 119, 72)",spruce_slab:"rgb(129, 86, 49)",birch_slab:"rgb(247, 233, 163)",jungle_slab:"rgb(151, 109, 77)",acacia_slab:"rgb(216, 127, 51)",cherry_slab:"rgb(209, 177, 161)",dark_oak_slab:"rgb(102, 76, 51)",mangrove_slab:"rgb(153, 51, 51)",bamboo_slab:"rgb(229, 229, 51)",bamboo_mosaic_slab:"rgb(229, 229, 51)",stone_slab:"rgb(112, 112, 112)",smooth_stone_slab:"rgb(112, 112, 112)",sandstone_slab:"rgb(247, 233, 163)",cut_sandstone_slab:"rgb(247, 233, 163)",petrified_oak_slab:"rgb(143, 119, 72)",cobblestone_slab:"rgb(112, 112, 112)",brick_slab:"rgb(153, 51, 51)",stone_brick_slab:"rgb(112, 112, 112)",mud_brick_slab:"rgb(135, 107, 98)",nether_brick_slab:"rgb(112, 2, 0)",quartz_slab:"rgb(255, 252, 245)",red_sandstone_slab:"rgb(216, 127, 51)",cut_red_sandstone_slab:"rgb(216, 127, 51)",purpur_slab:"rgb(178, 76, 216)",smooth_stone:"rgb(112, 112, 112)",smooth_sandstone:"rgb(247, 233, 163)",smooth_quartz:"rgb(255, 252, 245)",smooth_red_sandstone:"rgb(216, 127, 51)",chorus_plant:"rgb(127, 63, 178)",chorus_flower:"rgb(127, 63, 178)",purpur_block:"rgb(178, 76, 216)",purpur_pillar:"rgb(178, 76, 216)",end_stone_bricks:"rgb(247, 233, 163)",torchflower_crop:"rgb(0, 124, 0)",pitcher_crop:"rgb(0, 124, 0)",pitcher_plant:"rgb(0, 124, 0)",beetroots:"rgb(0, 124, 0)",dirt_path:"rgb(151, 109, 77)",end_gateway:"rgb(25, 25, 25)",repeating_command_block:"rgb(127, 63, 178)",chain_command_block:"rgb(102, 127, 51)",frosted_ice:"rgb(160, 160, 255)",magma_block:"rgb(112, 2, 0)",nether_wart_block:"rgb(153, 51, 51)",red_nether_bricks:"rgb(112, 2, 0)",bone_block:"rgb(247, 233, 163)",observer:"rgb(112, 112, 112)",kelp:"rgb(64, 64, 255)",kelp_plant:"rgb(64, 64, 255)",dried_kelp_block:"rgb(102, 127, 51)",turtle_egg:"rgb(247, 233, 163)",sniffer_egg:"rgb(153, 51, 51)",dead_tube_coral_block:"rgb(76, 76, 76)",dead_brain_coral_block:"rgb(76, 76, 76)",dead_bubble_coral_block:"rgb(76, 76, 76)",dead_fire_coral_block:"rgb(76, 76, 76)",dead_horn_coral_block:"rgb(76, 76, 76)",tube_coral_block:"rgb(51, 76, 178)",brain_coral_block:"rgb(242, 127, 165)",bubble_coral_block:"rgb(127, 63, 178)",fire_coral_block:"rgb(153, 51, 51)",horn_coral_block:"rgb(229, 229, 51)",dead_tube_coral:"rgb(76, 76, 76)",dead_brain_coral:"rgb(76, 76, 76)",dead_bubble_coral:"rgb(76, 76, 76)",dead_fire_coral:"rgb(76, 76, 76)",dead_horn_coral:"rgb(76, 76, 76)",tube_coral:"rgb(51, 76, 178)",brain_coral:"rgb(242, 127, 165)",bubble_coral:"rgb(127, 63, 178)",fire_coral:"rgb(153, 51, 51)",horn_coral:"rgb(229, 229, 51)",dead_tube_coral_fan:"rgb(76, 76, 76)",dead_brain_coral_fan:"rgb(76, 76, 76)",dead_bubble_coral_fan:"rgb(76, 76, 76)",dead_fire_coral_fan:"rgb(76, 76, 76)",dead_horn_coral_fan:"rgb(76, 76, 76)",tube_coral_fan:"rgb(51, 76, 178)",brain_coral_fan:"rgb(242, 127, 165)",bubble_coral_fan:"rgb(127, 63, 178)",fire_coral_fan:"rgb(153, 51, 51)",horn_coral_fan:"rgb(229, 229, 51)",dead_tube_coral_wall_fan:"rgb(76, 76, 76)",dead_brain_coral_wall_fan:"rgb(76, 76, 76)",dead_bubble_coral_wall_fan:"rgb(76, 76, 76)",dead_fire_coral_wall_fan:"rgb(76, 76, 76)",dead_horn_coral_wall_fan:"rgb(76, 76, 76)",tube_coral_wall_fan:"rgb(51, 76, 178)",brain_coral_wall_fan:"rgb(242, 127, 165)",bubble_coral_wall_fan:"rgb(127, 63, 178)",fire_coral_wall_fan:"rgb(153, 51, 51)",horn_coral_wall_fan:"rgb(229, 229, 51)",sea_pickle:"rgb(102, 127, 51)",blue_ice:"rgb(160, 160, 255)",conduit:"rgb(92, 219, 213)",bamboo_sapling:"rgb(143, 119, 72)",bamboo:"rgb(0, 124, 0)",bubble_column:"rgb(64, 64, 255)",scaffolding:"rgb(247, 233, 163)",loom:"rgb(143, 119, 72)",barrel:"rgb(143, 119, 72)",smoker:"rgb(112, 112, 112)",blast_furnace:"rgb(112, 112, 112)",cartography_table:"rgb(143, 119, 72)",fletching_table:"rgb(143, 119, 72)",grindstone:"rgb(167, 167, 167)",lectern:"rgb(143, 119, 72)",smithing_table:"rgb(143, 119, 72)",stonecutter:"rgb(112, 112, 112)",bell:"rgb(250, 238, 77)",lantern:"rgb(167, 167, 167)",soul_lantern:"rgb(167, 167, 167)",campfire:"rgb(129, 86, 49)",soul_campfire:"rgb(129, 86, 49)",sweet_berry_bush:"rgb(0, 124, 0)",warped_hyphae:"rgb(86, 44, 62)",stripped_warped_hyphae:"rgb(86, 44, 62)",warped_nylium:"rgb(22, 126, 134)",warped_fungus:"rgb(76, 127, 153)",warped_wart_block:"rgb(20, 180, 133)",warped_roots:"rgb(76, 127, 153)",nether_sprouts:"rgb(76, 127, 153)",crimson_hyphae:"rgb(92, 25, 29)",stripped_crimson_hyphae:"rgb(92, 25, 29)",crimson_nylium:"rgb(189, 48, 49)",crimson_fungus:"rgb(112, 2, 0)",shroomlight:"rgb(153, 51, 51)",weeping_vines:"rgb(112, 2, 0)",weeping_vines_plant:"rgb(112, 2, 0)",twisting_vines:"rgb(76, 127, 153)",twisting_vines_plant:"rgb(76, 127, 153)",crimson_roots:"rgb(112, 2, 0)",crimson_planks:"rgb(148, 63, 97)",warped_planks:"rgb(58, 142, 140)",structure_block:"rgb(153, 153, 153)",jigsaw:"rgb(153, 153, 153)",composter:"rgb(143, 119, 72)",target:"rgb(255, 252, 245)",bee_nest:"rgb(229, 229, 51)",beehive:"rgb(143, 119, 72)",honey_block:"rgb(216, 127, 51)",honeycomb_block:"rgb(216, 127, 51)",netherite_block:"rgb(25, 25, 25)",ancient_debris:"rgb(25, 25, 25)",crying_obsidian:"rgb(25, 25, 25)",respawn_anchor:"rgb(25, 25, 25)",lodestone:"rgb(167, 167, 167)",blackstone:"rgb(25, 25, 25)",polished_blackstone_pressure_plate:"rgb(25, 25, 25)",chiseled_nether_bricks:"rgb(112, 2, 0)",cracked_nether_bricks:"rgb(112, 2, 0)",amethyst_block:"rgb(127, 63, 178)",budding_amethyst:"rgb(127, 63, 178)",amethyst_cluster:"rgb(127, 63, 178)",tuff:"rgb(57, 41, 35)",calcite:"rgb(209, 177, 161)",tinted_glass:"rgb(76, 76, 76)",powder_snow:"rgb(255, 255, 255)",sculk_sensor:"rgb(76, 127, 153)",sculk:"rgb(25, 25, 25)",sculk_vein:"rgb(25, 25, 25)",sculk_catalyst:"rgb(25, 25, 25)",sculk_shrieker:"rgb(25, 25, 25)",oxidized_copper:"rgb(22, 126, 134)",weathered_copper:"rgb(58, 142, 140)",exposed_copper:"rgb(135, 107, 98)",copper_block:"rgb(216, 127, 51)",deepslate_copper_ore:"rgb(100, 100, 100)",lightning_rod:"rgb(216, 127, 51)",pointed_dripstone:"rgb(76, 50, 35)",dripstone_block:"rgb(76, 50, 35)",cave_vines:"rgb(0, 124, 0)",cave_vines_plant:"rgb(0, 124, 0)",spore_blossom:"rgb(0, 124, 0)",azalea:"rgb(0, 124, 0)",flowering_azalea:"rgb(0, 124, 0)",moss_carpet:"rgb(102, 127, 51)",pink_petals:"rgb(0, 124, 0)",moss_block:"rgb(102, 127, 51)",big_dripleaf:"rgb(0, 124, 0)",big_dripleaf_stem:"rgb(0, 124, 0)",small_dripleaf:"rgb(0, 124, 0)",hanging_roots:"rgb(151, 109, 77)",rooted_dirt:"rgb(151, 109, 77)",mud:"rgb(87, 92, 92)",deepslate:"rgb(100, 100, 100)",infested_deepslate:"rgb(100, 100, 100)",raw_iron_block:"rgb(216, 175, 147)",raw_copper_block:"rgb(216, 127, 51)",raw_gold_block:"rgb(250, 238, 77)",ochre_froglight:"rgb(247, 233, 163)",verdant_froglight:"rgb(127, 167, 150)",pearlescent_froglight:"rgb(242, 127, 165)",frogspawn:"rgb(64, 64, 255)",reinforced_deepslate:"rgb(100, 100, 100)",decorated_pot:"rgb(142, 60, 46)"},invisibleBlocks:{air:!0,void_air:!0,cave_air:!0,barrier:!0,light:!0,moving_piston:!0},hasSemiTransparentTextuersRegex:{_stained_glass$:!0,_stained_glass_pane$:!0,"^ice$":!0,"^tinted_glass$":!0,"^slime_block$":!0,"^honey_block$":!0}};var Xa=new Map,h8=new Set(["water","flowing_water","lava","flowing_lava","grass","short_grass","tall_grass"]);function qi(n){let e=Xa.get(n);if(e)return e;let t=d8(n),r=u8(n),i=new Set(Object.keys(Ki.noOcclusions)),s=new Set(t.blocksArray.filter(a=>Ki.invisibleBlocks[a.name]).map(a=>a.name)),o=0;for(let a of Object.keys(t.blocksByStateId))o=Math.max(o,Number(a));let l=new Uint8Array(o+1);for(let a of Object.keys(t.blocksByStateId)){let v=Number(a);if(!v)continue;let c=r.fromStateId(v,0);c&&(s.has(c.name)||i.has(c.name)||h8.has(c.name)||c.boundingBox!=="empty"&&(c.transparent&&c.boundingBox!=="block"||!c.shapes||c.shapes.length===0||(l[v]=1)))}return Xa.set(n,l),l}function Ji(n,e){return n>0&&n<e.length&&e[n]===1}var Y5=128,m8=Y5*4,W5=(n,e,t)=>`${n},${e},${t}`,kt=n=>Math.floor(n/16)*16,j5=n=>(n%16+16)%16,Xi=(n,e,t)=>n+t*16+e*256,p8=(n,e)=>{let t=e>>>5;return(n[t]&1<<(e&31))!==0},Zi=(n,e,t)=>{let r=e>>>5,i=1<<(e&31);t?n[r]|=i:n[r]&=~i},g8=n=>{for(let e=0;e<Y5;e++)if(n[e])return!1;return!0},Q5=class{constructor(e){d(this,"sections",new Map);d(this,"Chunk");d(this,"solidityTable");d(this,"worldMinY",0);d(this,"worldMaxY",256);this.Chunk=Za(e),this.solidityTable=qi(e)}setVersion(e){this.Chunk=Za(e),this.solidityTable=qi(e),this.sections.clear()}setWorldBounds(e,t){this.worldMinY===e&&this.worldMaxY===t||(this.worldMinY=e,this.worldMaxY=t,this.sections.clear())}clear(){this.sections.clear()}getAllocatedSectionCount(){return this.sections.size}getAllocatedBytes(){return this.sections.size*m8}removeColumn(e,t){let r=kt(this.worldMinY);for(let i=r;i<this.worldMaxY;i+=16)this.sections.delete(W5(e,i,t))}ingestColumn(e,t,r){let i=this.Chunk.fromJson(r),s=new f8(0,0,0);for(let o=this.worldMinY;o<this.worldMaxY;o++){s.y=o;let l=kt(o),a=o-l;for(let v=0;v<16;v++){s.z=v;let c=t+v,u=kt(c),h=c-u;for(let p=0;p<16;p++){s.x=p;let m=i.getBlockStateId(s)||0;if(!Ji(m,this.solidityTable))continue;let b=e+p,k=kt(b),_=W5(k,l,u),y=this.sections.get(_);y||(y=new Uint32Array(Y5),this.sections.set(_,y)),Zi(y,Xi(b-k,a,h),!0)}}}}setBlockStateId(e,t,r,i){if(t<this.worldMinY||t>=this.worldMaxY)return;let s=kt(e),o=kt(t),l=kt(r),a=W5(s,o,l),v=Xi(j5(e),t-o,j5(r));if(Ji(i,this.solidityTable)){let h=this.sections.get(a);h||(h=new Uint32Array(Y5),this.sections.set(a,h)),Zi(h,v,!0);return}let u=this.sections.get(a);u&&(Zi(u,v,!1),g8(u)&&this.sections.delete(a))}isSolidBlock(e,t,r){if(t<this.worldMinY||t>=this.worldMaxY)return!1;let i=this.sections.get(W5(kt(e),kt(t),kt(r)));return i?p8(i,Xi(j5(e),t-kt(t),j5(r))):!1}};function Gr(n,e){return(n%e+e)%e}var zt=class zt{constructor(e,t,r){this.resourcesManager=e;this.displayOptions=t;this.initOptions=r;d(this,"worldReadyResolvers",Promise.withResolvers());d(this,"worldReadyPromise",this.worldReadyResolvers.promise);d(this,"timeOfTheDay",0);d(this,"lastMesherSkyLight",15);d(this,"worldSizeParams",{minY:0,worldHeight:256});d(this,"cameraCollisionBlockCache");d(this,"reactiveDebugParams",b8({stopRendering:!1,chunksRenderAboveOverride:void 0,chunksRenderAboveEnabled:!1,chunksRenderBelowOverride:void 0,chunksRenderBelowEnabled:!1,chunksRenderDistanceOverride:void 0,chunksRenderDistanceEnabled:!1,disableEntities:!1,caveCullingDebug:!1,smartCull:!1}));d(this,"active",!1);d(this,"loadedChunks",{});d(this,"finishedChunks",{});d(this,"finishedSections",{});d(this,"sectionsWaiting",new Map);d(this,"queuedChunks",new Set);d(this,"queuedFunctions",[]);d(this,"renderUpdateEmitter",new m0);d(this,"customTexturesDataUrl");d(this,"workers",[]);d(this,"viewerChunkPosition");d(this,"lastViewerChunkGridX");d(this,"lastViewerChunkGridZ");d(this,"lastCamUpdate",0);d(this,"droppedFpsPercentage",0);d(this,"initialChunkLoadWasStartedIn");d(this,"initialChunksLoad",!0);d(this,"enableChunksLoadDelay",!1);d(this,"texturesVersion");d(this,"viewDistance",-1);d(this,"onRenderDistanceChanged");d(this,"chunksLength",0);d(this,"allChunksFinished",!1);d(this,"messageQueue",[]);d(this,"isProcessingQueue",!1);d(this,"ONMESSAGE_TIME_LIMIT",30);d(this,"handleResize",()=>{});d(this,"highestBlocksByChunks",new Map);d(this,"blockEntities",{});d(this,"workersProcessAverageTime",0);d(this,"workersProcessAverageTimeCount",0);d(this,"maxWorkersProcessTime",0);d(this,"workersPreAverageTime",0);d(this,"workersWasmAverageTime",0);d(this,"workersPostAverageTime",0);d(this,"workersPhaseSampleCount",0);d(this,"workersPreTargetConvertAverageTime",0);d(this,"workersPreNeighborConvertAverageTime",0);d(this,"workersPreNeighborCountAverage",0);d(this,"workersPreTypedArrayBuildAverageTime",0);d(this,"workersPreOtherAverageTime",0);d(this,"workersPreCacheHitsTotal",0);d(this,"workersPreCacheMissesTotal",0);d(this,"geometryReceiveCount",{});d(this,"allLoadedIn");d(this,"onWorldSwitched",[]);d(this,"renderTimeMax",0);d(this,"renderTimeAvg",0);d(this,"renderTimeAvgCount",0);d(this,"edgeChunks",{});d(this,"lastAddChunk",null);d(this,"neighborChunkUpdates",!0);d(this,"lastChunkDistance",0);d(this,"debugStopGeometryUpdate",!1);d(this,"protocolCustomBlocks",new Map);d(this,"mesherPoolSnapshot",{mesherWorkers:-1,wasmMesher:!1,dedicatedChangeWorker:!1});d(this,"mesherReconfigureQueue",Promise.resolve());d(this,"heightmapDebounceTimers",new Map);d(this,"sectionDirtyCount",new Map);d(this,"sectionDirtyTimers",new Map);d(this,"sectionDirtyPendingArgs",new Map);d(this,"blockStateModelInfo",new Map);d(this,"worldBlockProvider");d(this,"soundSystem");d(this,"worldRendererConfig");d(this,"playerStateReactive");d(this,"playerStateUtils");d(this,"reactiveState");d(this,"mesherLogReader");d(this,"forceCallFromMesherReplayer",!1);d(this,"stopMesherMessagesProcessing",!1);d(this,"abortController",new AbortController);d(this,"valtioUnsubs",[]);d(this,"lastRendered",0);d(this,"renderingActive",!0);d(this,"geometryReceiveCountPerSec",0);d(this,"mesherLogger",{contents:[],active:new URL(location.href).searchParams.get("mesherlog")==="true"});d(this,"currentRenderedFrames",0);d(this,"fpsAverage",0);d(this,"lastFps",0);d(this,"fpsWorst");d(this,"fpsSamples",0);d(this,"backendInfoReport","-");d(this,"chunksFullInfo","-");d(this,"workerCustomHandleTime",0);d(this,"queueAwaited",!1);d(this,"toWorkerMessagesQueue",{});this.cameraCollisionBlockCache=new Q5(this.displayOptions.version),this.snapshotInitialValues(),this.worldRendererConfig=t.inWorldRenderingConfig,this.playerStateReactive=t.playerStateReactive,this.playerStateUtils=ia(this.playerStateReactive),this.reactiveState=t.rendererState,this.renderUpdateEmitter.on("update",()=>{let o=Object.keys(this.finishedChunks).length;Qi("loaded-chunks",`${o}/${this.chunksLength} chunks (${this.lastChunkDistance}/${this.viewDistance})`)}),T0("downloaded-chunks",100,140,20,{className:S0}),this.connect(this.displayOptions.worldView);let i=setInterval(()=>{this.geometryReceiveCountPerSec=Object.values(this.geometryReceiveCount).reduce((o,l)=>o+l,0),this.geometryReceiveCount={},Ka(this.displayAdvancedStats),this.updateChunksStats()},500),s=setInterval(()=>{this.fpsUpdate()},1e3);this.abortController.signal.addEventListener("abort",()=>{clearInterval(i),clearInterval(s)})}anyModuleRequiresHeightmap(){return!1}isShaderCubeBlocksEnabled(){return this.worldRendererConfig.shaderCubeBlocks===!0}shaderCubeBlocksEnabled(){return this.isShaderCubeBlocksEnabled()}get version(){return this.displayOptions.version}get displayAdvancedStats(){return(this.initOptions.config.statsVisible??0)>1}fpsUpdate(){this.fpsSamples++,this.fpsAverage=(this.fpsAverage*(this.fpsSamples-1)+this.currentRenderedFrames)/this.fpsSamples,this.fpsWorst===void 0?this.fpsWorst=this.currentRenderedFrames:this.fpsWorst=Math.min(this.fpsWorst,this.currentRenderedFrames),this.lastFps=this.currentRenderedFrames,this.displayOptions.nonReactiveState.fps=this.currentRenderedFrames,this.displayOptions.nonReactiveState.worstRenderTime=this.renderTimeMax,this.displayOptions.nonReactiveState.avgRenderTime=this.renderTimeAvg,this.currentRenderedFrames=0}logWorkerWork(e){this.mesherLogger.active&&this.mesherLogger.contents.push(typeof e=="function"?e():e)}async init(){if(this.active)throw new Error("WorldRendererCommon is already initialized");await Promise.all([this.resetWorkers(),(async()=>{this.resourcesManager.currentResources?.allReady&&await this.updateAssetsData()})()]);let e=async()=>{this.active&&await this.updateAssetsData()};Ja(this.resourcesManager,"assetsTexturesUpdated",e,this.abortController.signal),this.watchReactivePlayerState(),this.watchReactiveConfig(),this.watchMesherPoolConfig(),this.worldReadyResolvers.resolve()}snapshotInitialValues(){}wasChunkSentToWorker(e){return this.loadedChunks[e]}async getHighestBlocks(e){return this.highestBlocksByChunks.get(e)}updateCustomBlock(e,t,r){if(this.protocolCustomBlocks.set(e,{...this.protocolCustomBlocks.get(e),[t]:r}),this.logWorkerWork(()=>`-> updateCustomBlock ${e} ${t} ${r} ${this.wasChunkSentToWorker(e)}`),this.wasChunkSentToWorker(e)){let[i,s,o]=t.split(",").map(Number);this.setBlockStateId(new Vr(i,s,o),void 0)}}async getBlockInfo(e,t){let i=`${Math.floor(e.x/16)*16},${Math.floor(e.z/16)*16}`,s=this.protocolCustomBlocks.get(i)?.[`${e.x},${e.y},${e.z}`],o=Ya(t,s),l=this.blockStateModelInfo.get(o);return{customBlockName:s,modelInfo:l}}getMesherWorkerScript(){return this.worldRendererConfig.wasmMesher?"wasm":"legacy"}createMesherWorker(){let e=this.getMesherWorkerScript();return _8(t=>{Array.isArray(t)?this.messageQueue.push(...t):this.messageQueue.push(t),this.processMessageQueue("worker")},e==="wasm"?"mesherWasm.js":"mesher.js")}initWorkers(e=this.worldRendererConfig.mesherWorkers){for(let t=0;t<e;t++)this.workers.push(this.createMesherWorker())}syncMesherPoolSnapshot(){this.mesherPoolSnapshot={mesherWorkers:this.worldRendererConfig.mesherWorkers,wasmMesher:this.worldRendererConfig.wasmMesher,dedicatedChangeWorker:this.worldRendererConfig.dedicatedChangeWorker}}watchMesherPoolConfig(){this.syncMesherPoolSnapshot();let e=()=>{let t=this.worldRendererConfig,r=this.mesherPoolSnapshot;t.mesherWorkers===r.mesherWorkers&&t.wasmMesher===r.wasmMesher&&t.dedicatedChangeWorker===r.dedicatedChangeWorker||(this.syncMesherPoolSnapshot(),this.enqueueMesherWorkersReconfigure())};for(let t of["mesherWorkers","wasmMesher","dedicatedChangeWorker"])this.valtioUnsubs.push(this.onReactiveConfigUpdated(t,e,!1))}enqueueMesherWorkersReconfigure(){this.mesherReconfigureQueue=this.mesherReconfigureQueue.then(()=>this.reconfigureMesherWorkers()).catch(e=>{})}clearMesherPendingState(){this.sectionsWaiting.clear(),this.toWorkerMessagesQueue={},this.queueAwaited=!1,this.messageQueue=[],this.isProcessingQueue=!1;for(let e of this.sectionDirtyTimers.values())clearTimeout(e);this.sectionDirtyTimers.clear(),this.sectionDirtyCount.clear(),this.sectionDirtyPendingArgs.clear(),this.reactiveState.world.mesherWork=!1}terminateAllMesherWorkers(){for(let e of this.workers)e.terminate();this.workers=[]}async bootstrapMesherWorkers(){this.workers.length!==0&&(this.sendMesherMcData(),await this.updateAssetsData(),this.logWorkerWork("# mesher workers bootstrapped"))}async reconfigureMesherWorkers(){this.active&&(this.clearMesherPendingState(),this.terminateAllMesherWorkers(),this.initWorkers(),await this.bootstrapMesherWorkers(),this.active&&await this.requestLoadedChunksReload())}async requestLoadedChunksReload(){try{let e=this.displayOptions.worldView;if(typeof e.reloadLoadedChunks=="function"){await e.reloadLoadedChunks();return}let t=globalThis;typeof t.WorkerGlobalScope<"u"&&globalThis instanceof t.WorkerGlobalScope&&self.postMessage({type:"reloadLoadedChunks"})}catch{}}onReactivePlayerStateUpdated(e,t,r=!0){return r&&t(this.playerStateReactive[e]),$i(this.playerStateReactive,e,t)}onReactiveConfigUpdated(e,t,r=!0){return r&&t(this.worldRendererConfig[e]),e==="*"?y8(this.worldRendererConfig,t):$i(this.worldRendererConfig,e,t)}onReactiveDebugUpdated(e,t){t(this.reactiveDebugParams[e]),$i(this.reactiveDebugParams,e,t)}watchReactivePlayerState(){this.valtioUnsubs.push(this.onReactivePlayerStateUpdated("backgroundColor",e=>{this.changeBackgroundColor(e)})),this.valtioUnsubs.push(this.onReactivePlayerStateUpdated("cardinalLight",e=>{this.changeCardinalLight(e)}))}watchReactiveConfig(){this.valtioUnsubs.push(this.onReactiveConfigUpdated("fetchPlayerSkins",e=>{U5({apiEnabled:e})}))}async processMessageQueue(e){if(this.isProcessingQueue||this.messageQueue.length===0)return;if(this.logWorkerWork(`# ${e} processing queue`),this.lastRendered&&performance.now()-this.lastRendered>this.ONMESSAGE_TIME_LIMIT&&this.worldRendererConfig._experimentalSmoothChunkLoading&&this.renderingActive){let i=performance.now();await new Promise(s=>{requestAnimationFrame(s)}),this.logWorkerWork(`# processing got delayed by ${performance.now()-i}ms`)}this.isProcessingQueue=!0;let t=performance.now(),r=0;for(;this.messageQueue.length>0;){let i=this.stopMesherMessagesProcessing;if(!i){let s=this.messageQueue.shift();this.handleMessage(s),r++}if(i||performance.now()-t>this.ONMESSAGE_TIME_LIMIT&&this.renderingActive&&this.worldRendererConfig._experimentalSmoothChunkLoading){if(this.messageQueue.length>0){requestAnimationFrame(async()=>{this.isProcessingQueue=!1,this.processMessageQueue("queue-delay")});return}break}}this.isProcessingQueue=!1}handleMessage(e){var r,i;let t=e;if(this.active){if(this.mesherLogReader?.workerMessageReceived(t.type,t),t.type!=="geometry"||!this.debugStopGeometryUpdate){let s=performance.now();this.handleWorkerMessage(t),this.workerCustomHandleTime+=performance.now()-s}if(t.type==="geometry"){this.logWorkerWork(()=>`-> ${t.workerIndex} geometry ${t.key} ${JSON.stringify({dataSize:JSON.stringify(t).length})}`),(r=this.geometryReceiveCount)[i=t.workerIndex]??(r[i]=0),this.geometryReceiveCount[t.workerIndex]++;let s=t.key.split(",").map(Number);this.lastChunkDistance=Math.max(...this.getDistance(new Vr(s[0],0,s[2])))}if(t.type==="sectionFinished"){if(this.logWorkerWork(`<- ${t.workerIndex} sectionFinished ${t.key} ${JSON.stringify({processTime:t.processTime})}`),!this.sectionsWaiting.has(t.key))return;this.sectionsWaiting.set(t.key,this.sectionsWaiting.get(t.key)-1),this.sectionsWaiting.get(t.key)===0&&(this.sectionsWaiting.delete(t.key),this.finishedSections[t.key]=!0);let s=t.key.split(",").map(Number),o=`${s[0]},${s[2]}`;if(this.loadedChunks[o]){let l=!0,a=this.getSectionHeight();for(let v=this.worldMinYRender;v<this.worldSizeParams.worldHeight;v+=a)if(!this.finishedSections[`${s[0]},${v},${s[2]}`]){l=!1;break}if(l){this.finishedChunks[o]=!0;let v=16,c=`${Math.floor(s[0]/v)},${Math.floor(s[2]/v)}`;this.reactiveState.world.chunksLoaded[c]=!0,this.renderUpdateEmitter.emit("chunkFinished",`${s[0]},${s[2]}`),this.checkAllFinished()}}if(this.renderUpdateEmitter.emit("update"),t.processTime&&(this.workersProcessAverageTimeCount++,this.workersProcessAverageTime=(this.workersProcessAverageTime*(this.workersProcessAverageTimeCount-1)+t.processTime)/this.workersProcessAverageTimeCount,this.maxWorkersProcessTime=Math.max(this.maxWorkersProcessTime,t.processTime)),typeof t.pre=="number"&&typeof t.wasm=="number"&&typeof t.post=="number"&&(t.pre>0||t.wasm>0||t.post>0)){let l=++this.workersPhaseSampleCount;this.workersPreAverageTime=(this.workersPreAverageTime*(l-1)+t.pre)/l,this.workersWasmAverageTime=(this.workersWasmAverageTime*(l-1)+t.wasm)/l,this.workersPostAverageTime=(this.workersPostAverageTime*(l-1)+t.post)/l;let a=typeof t.preTargetConvert=="number"?t.preTargetConvert:0,v=typeof t.preNeighborConvert=="number"?t.preNeighborConvert:0,c=typeof t.preNeighborCount=="number"?t.preNeighborCount:0,u=typeof t.preTypedArrayBuild=="number"?t.preTypedArrayBuild:0,h=typeof t.preOther=="number"?t.preOther:0,p=typeof t.preCacheHits=="number"?t.preCacheHits:0,m=typeof t.preCacheMisses=="number"?t.preCacheMisses:0;if(this.workersPreTargetConvertAverageTime=(this.workersPreTargetConvertAverageTime*(l-1)+a)/l,this.workersPreNeighborConvertAverageTime=(this.workersPreNeighborConvertAverageTime*(l-1)+v)/l,this.workersPreNeighborCountAverage=(this.workersPreNeighborCountAverage*(l-1)+c)/l,this.workersPreTypedArrayBuildAverageTime=(this.workersPreTypedArrayBuildAverageTime*(l-1)+u)/l,this.workersPreOtherAverageTime=(this.workersPreOtherAverageTime*(l-1)+h)/l,this.workersPreCacheHitsTotal+=p,this.workersPreCacheMissesTotal+=m,this.worldRendererConfig.debugWasmPerf&&l%zt.PHASE_PERF_LOG_INTERVAL===0){let b=this.workersPreAverageTime+this.workersWasmAverageTime+this.workersPostAverageTime,k=b>0?this.workersPreAverageTime/b*100:0,_=b>0?this.workersWasmAverageTime/b*100:0,y=b>0?this.workersPostAverageTime/b*100:0,M=this.workersPreAverageTime,T=M>0?this.workersPreTargetConvertAverageTime/M*100:0,S=M>0?this.workersPreNeighborConvertAverageTime/M*100:0,B=M>0?this.workersPreTypedArrayBuildAverageTime/M*100:0,P=M>0?this.workersPreOtherAverageTime/M*100:0,H=this.workersPreNeighborCountAverage,V=H>0?this.workersPreNeighborConvertAverageTime/H:0,z=this.workersPreCacheHitsTotal+this.workersPreCacheMissesTotal,N=z>0?this.workersPreCacheHitsTotal/z*100:0}}}if(t.type==="blockStateModelInfo")for(let[s,o]of Object.entries(t.info))this.blockStateModelInfo.set(s,o);if(t.type==="heightmap"){let s=new Int16Array(t.heightmap);this.reactiveState.world.heightmaps[t.key]=s}if(t.type==="neighborDataArrived"){let s=this.getSectionHeight();for(let o=this.worldMinYRender;o<this.worldSizeParams.worldHeight;o+=s)this.setSectionDirty(new Vr(t.x,o,t.z))}}}downloadMesherLog(){let e=document.createElement("a");e.href="data:text/plain;charset=utf-8,"+encodeURIComponent(this.mesherLogger.contents.join(`
330
+ `)),e.download="mesher.log",e.click()}checkAllFinished(){this.sectionsWaiting.size===0&&(this.reactiveState.world.mesherWork=!1),Object.keys(this.finishedChunks).length>=this.chunksLength&&(this.allChunksLoaded?.(),this.allChunksFinished=!0,this.allLoadedIn??(this.allLoadedIn=Date.now()-this.initialChunkLoadWasStartedIn)),this.updateChunksStats()}changeHandSwingingState(e,t){}updateViewerPosition(e){this.viewerChunkPosition=e;for(let[i,s]of Object.entries(this.loadedChunks))s&&this.updatePosDataChunk?.(i);let t=Math.floor(e.x/16),r=Math.floor(e.z/16);(t!==this.lastViewerChunkGridX||r!==this.lastViewerChunkGridZ)&&(this.lastViewerChunkGridX=t,this.lastViewerChunkGridZ=r,this.onViewerChunkPositionChanged())}onViewerChunkPositionChanged(){}sendWorkers(e){for(let t of this.workers)t.postMessage(e)}getDistance(e){let[t,r]=Va(this.viewerChunkPosition),i=16,s=Math.abs(t-Math.floor(e.x/i)),o=Math.abs(r-Math.floor(e.z/i));return[s,o]}resetWorld(){for(let e of this.workers)e.terminate();this.workers=[]}async resetWorkers(){this.resetWorld(),typeof document<"u"&&document?.readyState==="loading"&&await new Promise(e=>{document.addEventListener("DOMContentLoaded",e)}),this.initWorkers(),this.active=!0,this.syncMesherPoolSnapshot(),this.sendMesherMcData()}getMesherConfig(){let e=this.timeOfTheDay,t=e<0||e>24e3?15:Ft(e);return{version:this.version,enableLighting:this.worldRendererConfig.enableLighting,skyLight:t,smoothLighting:this.worldRendererConfig.smoothLighting,shadingTheme:this.worldRendererConfig.shadingTheme,cardinalLight:this.worldRendererConfig.cardinalLight,outputFormat:this.outputFormat,debugModelVariant:this.worldRendererConfig.debugModelVariant,clipWorldBelowY:this.worldRendererConfig.clipWorldBelowY,disableBlockEntityTextures:!this.worldRendererConfig.extraBlockRenderers,worldMinY:this.worldMinYRender,worldMaxY:this.worldMinYRender+this.worldSizeParams.worldHeight,disableConversionCache:this.worldRendererConfig.disableMesherConversionCache,computeWireframeEdges:this.worldRendererConfig.futuristicReveal===!0,shaderCubeBlocks:this.isShaderCubeBlocksEnabled()}}sendMesherMcData(){let e=this.resourcesManager.currentResources.mcData;e2(this.workers,this.version,k0,e),this.logWorkerWork("# mcData sent")}async updateAssetsData(){let e=this.resourcesManager.currentResources;if(this.workers.length===0)throw new Error("workers not initialized yet");for(let[t,r]of this.workers.entries()){let{blockstatesModels:i}=e;r.postMessage({type:"mesherData",workerIndex:t,blocksAtlas:{latest:e.blocksAtlasJson},blockstatesModels:i,config:this.getMesherConfig()})}this.logWorkerWork("# mesherData sent")}getSectionHeight(){return ja}get worldMinYRender(){let e=this.getSectionHeight();return Math.floor(Math.max(this.worldSizeParams.minY,this.worldRendererConfig.clipWorldBelowY??-1/0)/e)*e}updateChunksStats(){let e=Object.keys(this.finishedChunks);this.displayOptions.nonReactiveState.world.chunksLoadedCount=e.length,this.displayOptions.nonReactiveState.world.chunksTotalNumber=this.chunksLength,this.reactiveState.world.allChunksLoaded=this.allChunksFinished;let t=`Q: ${this.messageQueue.length} ${Object.keys(this.loadedChunks).length}/${Object.keys(this.finishedChunks).length}/${this.chunksLength} chunks (${this.workers.length}:${this.workersProcessAverageTime.toFixed(0)}ms/${this.geometryReceiveCountPerSec}ss/${this.allLoadedIn?.toFixed(1)??"-"}s)`;this.chunksFullInfo=t,this.displayOptions.nonReactiveState.world.chunksFullInfo=t,Qi("downloaded-chunks",t)}addColumn(e,t,r,i){if(!this.active)return;if(this.workers.length===0)throw new Error("workers not initialized yet");this.initialChunksLoad=!1,this.initialChunkLoadWasStartedIn??(this.initialChunkLoadWasStartedIn=Date.now()),this.loadedChunks[`${e},${t}`]=!0,this.updateChunksStats();let s=`${e},${t}`,o=this.protocolCustomBlocks.get(s);for(let v of this.workers)v.postMessage({type:"chunk",x:e,z:t,chunk:r,customBlockModels:o||void 0});this.worldRendererConfig.wasmMesher||this.workers[0].postMessage({type:"getHeightmap",x:e,z:t}),this.logWorkerWork(()=>`-> chunk ${JSON.stringify({x:e,z:t,chunkLength:r.length,customBlockModelsLength:o?Object.keys(o).length:0})}`),this.mesherLogReader?.chunkReceived(e,t,r.length),this.cameraCollisionBlockCache.ingestColumn(e,t,r);let l=this.getSectionHeight(),a=16;for(let v=this.worldMinYRender;v<this.worldSizeParams.worldHeight;v+=l){let c=new Vr(e,v,t);this.setSectionDirty(c),this.neighborChunkUpdates&&(!i||this.worldRendererConfig.smoothLighting)&&(this.setSectionDirty(c.offset(-a,0,0)),this.setSectionDirty(c.offset(a,0,0)),this.setSectionDirty(c.offset(0,0,-a)),this.setSectionDirty(c.offset(0,0,a)))}}markAsLoaded(e,t){this.loadedChunks[`${e},${t}`]=!0,this.finishedChunks[`${e},${t}`]=!0,this.logWorkerWork(`-> markAsLoaded ${JSON.stringify({x:e,z:t})}`),this.renderUpdateEmitter.emit("chunkFinished",`${e},${t}`),this.checkAllFinished()}removeColumn(e,t){var l;delete this.loadedChunks[`${e},${t}`];let r=`${e},${t}`,i=this.heightmapDebounceTimers.get(r);i&&(clearTimeout(i),this.heightmapDebounceTimers.delete(r));for(let[a,v]of this.sectionDirtyTimers)a.startsWith(`${e},`)&&a.endsWith(`,${t}`)&&(clearTimeout(v),this.sectionDirtyTimers.delete(a),this.sectionDirtyCount.delete(a),this.sectionDirtyPendingArgs.delete(a));for(let a=0;a<this.workers.length;a++)(l=this.toWorkerMessagesQueue)[a]??(l[a]=[]),this.toWorkerMessagesQueue[a].push({type:"unloadChunk",x:e,z:t});this.dispatchMessages(),this.logWorkerWork(`-> unloadChunk ${JSON.stringify({x:e,z:t})}`),delete this.finishedChunks[`${e},${t}`],this.allChunksFinished=Object.keys(this.finishedChunks).length===this.chunksLength,Object.keys(this.finishedChunks).length===0&&(this.allLoadedIn=void 0,this.initialChunkLoadWasStartedIn=void 0);let s=this.getSectionHeight();for(let a=this.worldMinYRender;a<this.worldSizeParams.worldHeight;a+=s){let v=`${e},${a},${t}`,c=this.sectionsWaiting.get(v);c!==void 0&&c>0,this.sectionsWaiting.delete(v),delete this.finishedSections[v]}this.highestBlocksByChunks.delete(`${e},${t}`),this.cameraCollisionBlockCache.removeColumn(e,t);let o=`${Math.floor(e/16)},${Math.floor(t/16)}`;delete this.reactiveState.world.heightmaps[o],this.updateChunksStats(),Object.keys(this.loadedChunks).length===0&&(this.mesherLogger.contents=[],this.logWorkerWork("# all chunks unloaded. New log started"),this.mesherLogReader?.maybeStartReplay())}setBlockStateId(e,t,r=!0){(async()=>{let o=Math.floor(e.x/16)*16,l=Math.floor(e.z/16)*16;this.queuedChunks.has(`${o},${l}`)&&await new Promise(a=>{this.queuedFunctions.push(()=>{a()})}),this.loadedChunks[`${o},${l}`],this.setBlockStateIdInner(e,t,r)})()}updateEntity(e,t=!1){}lightUpdate(e,t){}connect(e){let t=e,r=this.abortController.signal;Je(t,"entity",s=>{this.updateEntity(s,!1)},r),Je(t,"entityMoved",s=>{this.updateEntity(s,!0)},r),Je(t,"playerEntity",s=>{this.updatePlayerEntity?.(s)},r);let i=null;Je(t,"loadChunk",({x:s,z:o,chunk:l,worldConfig:a,isLightUpdate:v})=>{this.worldSizeParams=a,this.cameraCollisionBlockCache.setWorldBounds(a.minY,a.worldHeight),this.queuedChunks.add(`${s},${o}`);let c=[s,o,l,v];i||(i={data:[],timeout:setTimeout(()=>{for(let u of i.data)this.queuedChunks.delete(`${u[0]},${u[1]}`),this.addColumn(...u);for(let u of this.queuedFunctions)u();this.queuedFunctions=[],i=null},this.worldRendererConfig.addChunksBatchWaitTime)}),i.data.push(c)},r),Je(t,"blockEntities",s=>{this.blockEntities=s},r),Je(t,"unloadChunk",({x:s,z:o})=>{this.removeColumn(s,o)},r),Je(t,"blockUpdate",({pos:s,stateId:o})=>{this.setBlockStateId(new Vr(s.x,s.y,s.z),o)},r),Je(t,"chunkPosUpdate",({pos:s})=>{this.updateViewerPosition(s)},r),Je(t,"end",()=>{this.worldStop?.()},r),Je(t,"renderDistance",s=>{this.viewDistance=s,this.chunksLength=s===0?1:Tr(s).length,this.allChunksFinished=Object.keys(this.finishedChunks).length===this.chunksLength,this.onRenderDistanceChanged?.(s)},r),Je(t,"markAsLoaded",({x:s,z:o})=>{this.markAsLoaded(s,o)},r),Je(t,"updateLight",({pos:s})=>{this.lightUpdate(s.x,s.z)},r),Je(t,"onWorldSwitch",()=>{this.cameraCollisionBlockCache.clear();for(let s of this.onWorldSwitched)try{s()}catch(o){setTimeout(()=>{throw o},0)}},r),Je(t,"time",s=>{if(!this.worldRendererConfig.dayCycle)return;this.timeUpdated?.(s),this.timeOfTheDay=s;let o=s<0||s>24e3?15:Ft(s);this.lastMesherSkyLight!==o&&(this.lastMesherSkyLight=o,this.workers.length>0&&this.sendWorkers({config:{skyLight:o}}),this.onDayCycleSkyLightChanged?.(o))},r),Je(t,"biomeUpdate",({biome:s})=>{this.biomeUpdated?.(s)},r),Je(t,"biomeReset",()=>{this.biomeReset?.()},r)}setBlockStateIdInner(e,t,r=!0){let s=`${Math.floor(e.x/16)*16},${Math.floor(e.z/16)*16}`,o=`${e.x},${e.y},${e.z}`,l=this.protocolCustomBlocks.get(s)||{};for(let a of this.workers)a.postMessage({type:"blockUpdate",pos:e,stateId:t,customBlockModels:l});if(this.anyModuleRequiresHeightmap()){let a=Math.floor(e.x/16)*16,v=Math.floor(e.z/16)*16,c=`${a},${v}`;if(!this.worldRendererConfig.wasmMesher){let u=this.heightmapDebounceTimers.get(c);u&&clearTimeout(u),this.heightmapDebounceTimers.set(c,setTimeout(()=>{this.heightmapDebounceTimers.delete(c),this.workers[0]?.postMessage({type:"getHeightmap",x:a,z:v})},100))}}if(this.logWorkerWork(`-> blockUpdate ${JSON.stringify({pos:e,stateId:t,customBlockModels:l})}`),t!==void 0&&this.cameraCollisionBlockCache.setBlockStateId(e.x,e.y,e.z,t),this.setSectionDirty(e,!0,!0),this.neighborChunkUpdates){let v=this.getSectionHeight();e.x&15||this.setSectionDirty(e.offset(-16,0,0),!0,!0),(e.x&15)===15&&this.setSectionDirty(e.offset(16,0,0),!0,!0),e.y&v-1||this.setSectionDirty(e.offset(0,-v,0),!0,!0),(e.y&v-1)===v-1&&this.setSectionDirty(e.offset(0,v,0),!0,!0),e.z&15||this.setSectionDirty(e.offset(0,0,-16),!0,!0),(e.z&15)===15&&this.setSectionDirty(e.offset(0,0,16),!0,!0),r&&(!(e.x&15)&&!(e.z&15)&&this.setSectionDirty(e.offset(-16,0,-16),!0,!0),(e.x&15)===15&&!(e.z&15)&&this.setSectionDirty(e.offset(16,0,-16),!0,!0),!(e.x&15)&&(e.z&15)===15&&this.setSectionDirty(e.offset(-16,0,16),!0,!0),(e.x&15)===15&&(e.z&15)===15&&this.setSectionDirty(e.offset(16,0,16),!0,!0),!(e.x&15)&&!(e.y&v-1)&&this.setSectionDirty(e.offset(-16,-v,0),!0,!0),(e.x&15)===15&&!(e.y&v-1)&&this.setSectionDirty(e.offset(16,-v,0),!0,!0),!(e.z&15)&&!(e.y&v-1)&&this.setSectionDirty(e.offset(0,-v,-16),!0,!0),(e.z&15)===15&&!(e.y&v-1)&&this.setSectionDirty(e.offset(0,-v,16),!0,!0),!(e.y&v-1)&&!(e.x&15)&&!(e.z&15)&&this.setSectionDirty(e.offset(-16,-v,-16),!0,!0),!(e.y&v-1)&&(e.x&15)===15&&!(e.z&15)&&this.setSectionDirty(e.offset(16,-v,-16),!0,!0),!(e.y&v-1)&&!(e.x&15)&&(e.z&15)===15&&this.setSectionDirty(e.offset(-16,-v,16),!0,!0),!(e.y&v-1)&&(e.x&15)===15&&(e.z&15)===15&&this.setSectionDirty(e.offset(16,-v,16),!0,!0))}}getWorkerNumber(e,t=!1){let i=this.getSectionHeight();if(this.worldRendererConfig.dedicatedChangeWorker&&this.workers.length>1){if(this.worldRendererConfig.wasmMesher)return Gr(Math.floor(e.x/16)+Math.floor(e.z/16),this.workers.length);if(t){let l=`${Math.floor(e.x/16)*16},${Math.floor(e.y/i)*i},${Math.floor(e.z/16)*16}`;if(this.sectionsWaiting.get(l)&&!this.finishedSections[l]){let v=this.workers.length-1;return Gr(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),v)}return this.workers.length-1}let o=this.workers.length-1;return Gr(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),o)}if(this.worldRendererConfig.wasmMesher)return Gr(Math.floor(e.x/16)+Math.floor(e.z/16),this.workers.length);if(t){let o=`${Math.floor(e.x/16)*16},${Math.floor(e.y/i)*i},${Math.floor(e.z/16)*16}`;if(!(this.sectionsWaiting.get(o)&&!this.finishedSections[o]))return 0}return Gr(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),this.workers.length)}async debugGetWorkerCustomBlockModel(e){let t=[];for(let r of this.workers)t.push(new Promise(i=>{r.addEventListener("message",s=>{s.data.type==="customBlockModel"&&i(s.data.customBlockModel)})})),r.postMessage({type:"getCustomBlockModel",pos:e});return Promise.all(t)}setSectionDirty(e,t=!0,r=!1){if(!this.forceCallFromMesherReplayer&&this.mesherLogReader)return;if(this.viewDistance===-1)throw new Error("viewDistance not set");let i=this.getDistance(e);if(!this.workers.length||i[0]>this.viewDistance||i[1]>this.viewDistance)return;if(!t){this._dispatchDirtyImmediate(e,t,r);return}let s=16,o=this.getSectionHeight(),l=`${Math.floor(e.x/s)*s},${Math.floor(e.y/o)*o},${Math.floor(e.z/s)*s}`,a=(this.sectionDirtyCount.get(l)??0)+1;this.sectionDirtyCount.set(l,a),a<=zt.GEOMETRY_THROTTLE_THRESHOLD?(this._dispatchDirtyImmediate(e,t,r),this.sectionDirtyTimers.has(l)||this.sectionDirtyTimers.set(l,setTimeout(()=>{let v=this.sectionDirtyPendingArgs.get(l);this.sectionDirtyCount.delete(l),this.sectionDirtyTimers.delete(l),this.sectionDirtyPendingArgs.delete(l),v&&this._dispatchDirtyImmediate(v.pos,v.value,v.useChangeWorker)},zt.GEOMETRY_THROTTLE_DELAY))):(this.sectionDirtyPendingArgs.set(l,{pos:e,value:t,useChangeWorker:r}),this.sectionDirtyTimers.has(l)||this.sectionDirtyTimers.set(l,setTimeout(()=>{let v=this.sectionDirtyPendingArgs.get(l);this.sectionDirtyCount.delete(l),this.sectionDirtyTimers.delete(l),this.sectionDirtyPendingArgs.delete(l),v&&this._dispatchDirtyImmediate(v.pos,v.value,v.useChangeWorker)},zt.GEOMETRY_THROTTLE_DELAY)))}_dispatchDirtyImmediate(e,t,r){var a;this.reactiveState.world.mesherWork=!0;let i=16,s=this.getSectionHeight(),o=`${Math.floor(e.x/i)*i},${Math.floor(e.y/s)*s},${Math.floor(e.z/i)*i}`;this.renderUpdateEmitter.emit("dirty",e,t);let l=this.getWorkerNumber(e,r&&(this.mesherLogger.active||this.worldRendererConfig.dedicatedChangeWorker));this.sectionsWaiting.set(o,(this.sectionsWaiting.get(o)??0)+1),this.forceCallFromMesherReplayer?this.workers[l].postMessage({type:"dirty",x:e.x,y:e.y,z:e.z,value:t,config:this.getMesherConfig()}):((a=this.toWorkerMessagesQueue)[l]??(a[l]=[]),this.toWorkerMessagesQueue[l].push({type:"dirty",x:e.x,y:e.y,z:e.z,value:t,config:this.getMesherConfig()}),this.dispatchMessages())}dispatchMessages(){this.queueAwaited||(this.queueAwaited=!0,setTimeout(()=>{for(let e in this.toWorkerMessagesQueue){let t=this.workers[Number(e)],r=this.toWorkerMessagesQueue[e];t.postMessage(r);for(let i of r)this.logWorkerWork(`-> ${e} dispatchMessages ${i.type} ${JSON.stringify({x:i.x,y:i.y,z:i.z,value:i.value})}`)}this.toWorkerMessagesQueue={},this.queueAwaited=!1}))}async waitForChunksToRender(){return new Promise((e,t)=>{if([...this.sectionsWaiting].length===0){e();return}let r=()=>{this.sectionsWaiting.size===0&&(this.renderUpdateEmitter.removeListener("update",r),e())};this.renderUpdateEmitter.on("update",r)})}async waitForChunkToLoad(e){return new Promise((t,r)=>{let s=`${Math.floor(e.x/16)*16},${Math.floor(e.z/16)*16}`;if(this.loadedChunks[s]){t();return}let o=()=>{this.loadedChunks[s]&&(this.renderUpdateEmitter.removeListener("update",o),t())};this.renderUpdateEmitter.on("update",o)})}destroy(){for(let e of this.valtioUnsubs)e();this.valtioUnsubs=[];for(let e of this.heightmapDebounceTimers.values())clearTimeout(e);this.heightmapDebounceTimers.clear();for(let e of this.sectionDirtyTimers.values())clearTimeout(e);this.sectionDirtyTimers.clear(),this.sectionDirtyCount.clear(),this.sectionDirtyPendingArgs.clear();for(let e of this.workers)e.terminate();this.workers=[],this.soundSystem&&(this.soundSystem.destroy(),this.soundSystem=void 0),this.active=!1,this.loadedChunks={},this.finishedChunks={},this.finishedSections={},this.sectionsWaiting.clear(),this.queuedChunks.clear(),this.blockStateModelInfo.clear(),this.renderUpdateEmitter.removeAllListeners(),this.abortController.abort(),qa()}};d(zt,"PHASE_PERF_LOG_INTERVAL",64),d(zt,"GEOMETRY_THROTTLE_THRESHOLD",1),d(zt,"GEOMETRY_THROTTLE_DELAY",100);var K5=zt,_8=(n,e="mesher.js")=>{let t;if(L.env.SINGLE_FILE_BUILD){let r=document.getElementById("mesher-worker-code").textContent,i=new Blob([r],{type:"text/javascript"});t=new Worker(window.URL.createObjectURL(i))}else t=new Worker(e);return t.onmessage=({data:r})=>{n(r)},t.on&&t.on("message",r=>{t.onmessage({data:r})}),t},$a=!1,e2=(n,e,t=k0,r)=>{let i={version:JSON.parse(JSON.stringify(r.version)),...Wa(r)};for(let[s,o]of Object.entries(t))i[s]=r[o];"tints"in t&&!i.tints&&!$a&&($a=!0);for(let s of n)s.postMessage({type:"mcData",mcData:i})},e1=(n,e,t=k0,r,i=1e4)=>Promise.all(n.map(s=>new Promise((o,l)=>{let a=setTimeout(()=>{s.removeEventListener("message",v),l(new Error(`mcData transfer timeout (${i}ms)`))},i),v=({data:c})=>{c?.type==="mcDataApplied"&&(clearTimeout(a),s.removeEventListener("message",v),o())};s.addEventListener("message",v),e2([s],e,t,r)}))).then(()=>{});N5();A();E();R();x();import{Vec3 as w8}from"vec3";import*as mt from"three";A();E();R();x();function J5(n,e){let t=e/180*Math.PI,r=Math.cos(t),i=Math.sin(t),s={x:0,y:1,z:2}[n],o=(s+1)%3,l=(s+2)%3,a=[[0,0,0],[0,0,0],[0,0,0]];return a[s][s]=1,a[o][o]=r,a[o][l]=-i,a[l][o]=+i,a[l][l]=r,a}function t1(n,e){return e?[n[0]+e[0],n[1]+e[1],n[2]+e[2]]:n}function q5(n,e){return e?[n[0]-e[0],n[1]-e[1],n[2]-e[2]]:n}function M0(n,e){return n?[n[0][0]*e[0]+n[0][1]*e[1]+n[0][2]*e[2],n[1][0]*e[0]+n[1][1]*e[1]+n[1][2]*e[2],n[2][0]*e[0]+n[2][1]*e[1]+n[2][2]*e[2]]:e}function r1(n,e){let t=[[0,0,0],[0,0,0],[0,0,0]],r=n[0][0],i=n[1][0],s=n[2][0],o=n[0][1],l=n[1][1],a=n[2][1],v=n[0][2],c=n[1][2],u=n[2][2],h=e[0][0],p=e[1][0],m=e[2][0],b=e[0][1],k=e[1][1],_=e[2][1],y=e[0][2],M=e[1][2],T=e[2][2];return t[0][0]=r*h+i*b+s*y,t[1][0]=r*p+i*k+s*M,t[2][0]=r*m+i*_+s*T,t[0][1]=o*h+l*b+a*y,t[1][1]=o*p+l*k+a*M,t[2][1]=o*m+l*_+a*T,t[0][2]=v*h+c*b+u*y,t[1][2]=v*p+c*k+u*M,t[2][2]=v*m+c*_+u*T,t}function t2(n){let e=J5(n.axis,n.angle),t=q5(n.origin,M0(e,n.origin));if(n.rescale){let r=2-Math.sqrt(2),i=n.angle*Math.PI/180,s=Math.abs(Math.sin(i))*r,o=n.axis==="x"?1:0,l=n.axis==="y"?1:0,a=n.axis==="z"?1:0,v=[[(1-o)*s+1,0,0],[0,(1-l)*s+1,0],[0,0,(1-a)*s+1]];e=r1(e,v),t=q5(n.origin,M0(e,n.origin))}return{localMatrix:e,localShift:t}}var n1={up:{dir:[0,1,0],mask1:[1,1,0],mask2:[0,1,1],corners:[[0,1,1,0,1],[1,1,1,1,1],[0,1,0,0,0],[1,1,0,1,0]]},down:{dir:[0,-1,0],mask1:[1,1,0],mask2:[0,1,1],corners:[[1,0,1,0,1],[0,0,1,1,1],[1,0,0,0,0],[0,0,0,1,0]]},east:{dir:[1,0,0],mask1:[1,1,0],mask2:[1,0,1],corners:[[1,1,1,0,0],[1,0,1,0,1],[1,1,0,1,0],[1,0,0,1,1]]},west:{dir:[-1,0,0],mask1:[1,1,0],mask2:[1,0,1],corners:[[0,1,0,0,0],[0,0,0,0,1],[0,1,1,1,0],[0,0,1,1,1]]},north:{dir:[0,0,-1],mask1:[1,0,1],mask2:[0,1,1],corners:[[1,0,0,1,1],[0,0,0,0,1],[1,1,0,1,0],[0,1,0,0,0]]},south:{dir:[0,0,1],mask1:[1,0,1],mask2:[0,1,1],corners:[[0,0,1,0,1],[1,0,1,1,1],[0,1,1,0,0],[1,1,1,1,0]]}};function A8(n,e,t,r,i,s,o,l){let a=new w8(0,0,0);for(let v in n.faces){let c=n.faces[v],{corners:u,mask1:h,mask2:p}=n1[v],m=M0(r,n1[v].dir);if(c.cullface&&l[v])continue;let b=n.from[0],k=n.from[1],_=n.from[2],y=n.to[0],M=n.to[1],T=n.to[2],S=c.texture,{u:B}=S,{v:P}=S,{su:H}=S,{sv:V}=S,z=Math.floor(t.positions.length/3),N=[1,1,1];c.tintindex!==void 0&&c.tintindex===0&&(N=[.5686274509803921,.7411764705882353,.34901960784313724]);let Y=c.rotation||0,q=Math.cos(Y*Math.PI/180),J=-Math.sin(Y*Math.PI/180),te=null,se=null;n.rotation&&({localMatrix:te,localShift:se}=t2(n.rotation));let he=[],fe=1;for(let pe of u){let oe=[pe[0]?y:b,pe[1]?M:k,pe[2]?T:_];oe=t1(M0(te,oe),se),oe=t1(M0(r,oe),i),oe=oe.map(qe=>qe/16),t.positions.push(oe[0],oe[1],oe[2]),t.normals.push(...m);let Q=(pe[3]-.5)*q-(pe[4]-.5)*J+.5,ce=(pe[3]-.5)*J+(pe[4]-.5)*q+.5;t.uvs.push(Q*H+B,ce*V+P);let be=1;e&&(be=4/4*(15/15),he.push(3)),t.colors.push(fe*N[0]*be,fe*N[1]*be,fe*N[2]*be)}e&&he[0]+he[3]>=he[1]+he[2]?t.indices.push(z,z+3,z+2,z,z+1,z+3):t.indices.push(z,z+1,z+2,z+2,z+1,z+3)}}var E8=(n,e,t,r,i=[],s={})=>{let v={sx:.5,sy:.5,sz:.5,positions:[],normals:[],colors:[],uvs:[],t_positions:[],t_normals:[],t_colors:[],t_uvs:[],indices:[],tiles:{}};for(let[u,h]of n.entries()){let p=h[i[u]]??h[0];if(!p)continue;let m=null,b=null;for(let _ of["x","y","z"])_ in p&&(m?m=r1(m,J5(_,-(p[_]??0))):m=J5(_,-(p[_]??0)));m&&(b=[8,8,8],b=q5(b,M0(m,b)));let k=p.ao??!0;for(let _ of p.elements??[])A8(_,k,v,m,b,e,t,s)}let c=v.positions.length/3;for(let u=0;u<v.t_positions.length/12;u++)v.indices.push(c,c+1,c+2,c+2,c+1,c+3,c,c+2,c+1,c+2,c+3,c+1),c+=4;return v.positions.push(...v.t_positions),v.normals.push(...v.t_normals),v.colors.push(...v.t_colors),v.uvs.push(...v.t_uvs),delete v.t_positions,delete v.t_normals,delete v.t_colors,delete v.t_uvs,v.positions=new Float32Array(v.positions),v.normals=new Float32Array(v.normals),v.colors=new Float32Array(v.colors),v.uvs=new Float32Array(v.uvs),v},x8=(...n)=>{let t={geometry:E8(...n)},r=new mt.BufferGeometry;return r.setAttribute("position",new mt.BufferAttribute(t.geometry.positions,3)),r.setAttribute("normal",new mt.BufferAttribute(t.geometry.normals,3)),r.setAttribute("color",new mt.BufferAttribute(t.geometry.colors,3)),r.setAttribute("uv",new mt.BufferAttribute(t.geometry.uvs,2)),r.setIndex(t.geometry.indices),r.name="block-geometry",r},i1=(n,...e)=>{let t=x8(...e),r=new mt.Mesh(t,n);r.position.set(-.5,-.5,-.5);let i=new mt.Group;return i.add(r),i.rotation.set(0,-mt.MathUtils.degToRad(90),0,"ZYX"),globalThis.mesh=i,i},r2=(n,e)=>{n.position.set(e.x+.5,e.y+.5,e.z+.5)};A();E();R();x();import*as We from"three";var Nr=async(n,e)=>{let t;if(!n&&!e){let{canvas:v}=await Bt(lt);t=new We.CanvasTexture(v)}else{if(n||(n=await Jt(e,"skin")),!n)return;let{canvas:v}=await Bt(n);t=new We.CanvasTexture(v)}t.magFilter=We.NearestFilter,t.minFilter=We.NearestFilter;let r=!1,s=R8(40,16,r?-2:-3,-2,-2,r?3:4,12,4,64,64),o=new We.MeshStandardMaterial;o.map=t,o.needsUpdate=!0;let l=new We.Mesh(s,o),a=new We.Group;return a.add(l),a};function R8(n,e,t,r,i,s,o,l,a,v,c=!1){let u=t/16,h=r/16,p=i/16,m=(t+s)/16,b=(r+o)/16,k=(i+l)/16;c&&([u,m]=[m,u]);let _=[[u,h,p],[m,h,p],[m,b,p],[u,b,p],[u,h,k],[m,h,k],[m,b,k],[u,b,k]],y=n,M=n+l,T=n+l+s,S=n+l+s+s,B=n+l+s+l,P=n+l+s+l+s,H=e,V=e+l,z=e+l+o,N=[{vi:[5,4,0,1],uv:[M,H,T,V],n:[0,-1,0]},{vi:[2,3,7,6],uv:[T,V,S,H],n:[0,1,0]},{vi:[0,4,7,3],uv:[y,V,M,z],n:[-1,0,0]},{vi:[1,0,3,2],uv:[M,V,T,z],n:[0,0,-1]},{vi:[5,1,2,6],uv:[T,V,B,z],n:[1,0,0]},{vi:[4,5,6,7],uv:[B,V,P,z],n:[0,0,1]}],Y=[],q=[],J=[],te=[];for(let he=0;he<N.length;he++){let fe=N[he],pe=he*4,[oe,Q,ce,be]=fe.uv,qe=[[ce/a,1-Q/v],[oe/a,1-Q/v],[oe/a,1-be/v],[ce/a,1-be/v]],Re=c?[3,2,1,0]:[0,1,2,3],at=c?-fe.n[0]:fe.n[0];for(let ye=0;ye<4;ye++){let ut=_[fe.vi[Re[ye]]];Y.push(ut[0],ut[1],ut[2]),q.push(qe[ye][0],qe[ye][1]),J.push(at,fe.n[1],fe.n[2])}te.push(pe,pe+1,pe+2,pe,pe+2,pe+3)}let se=new We.BufferGeometry;return se.setAttribute("position",new We.Float32BufferAttribute(Y,3)),se.setAttribute("uv",new We.Float32BufferAttribute(q,2)),se.setAttribute("normal",new We.Float32BufferAttribute(J,3)),se.setIndex(te),se}A();E();R();x();A();E();R();x();import*as He from"three";A();E();R();x();A();E();R();x();var Xt=class n{constructor(e,t,r,i,s="div"){this.parent=e,this.object=t,this.property=r,this._disabled=!1,this._hidden=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(i),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id=`lil-gui-name-${++n.nextNameID}`,this.$widget=document.createElement(s),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.domElement.addEventListener("keydown",o=>o.stopPropagation()),this.domElement.addEventListener("keyup",o=>o.stopPropagation()),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(r)}name(e){return this._name=e,this.$name.innerHTML=e,this}onChange(e){return this._onChange=e,this}_callOnChange(){this.parent._callOnChange(this),this._onChange!==void 0&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),this._onFinishChange!==void 0&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(e=!0){return this.disable(!e)}disable(e=!0){return e===this._disabled?this:(this._disabled=e,this.domElement.classList.toggle("disabled",e),this.$disable.toggleAttribute("disabled",e),this)}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}options(e){let t=this.parent.add(this.object,this.property,e);return t.name(this._name),this.destroy(),t}min(e){return this}max(e){return this}step(e){return this}decimals(e){return this}listen(e=!0){return this._listening=e,this._listenCallbackID!==void 0&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);let e=this.save();e!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=e}getValue(){return this.object[this.property]}setValue(e){return this.object[this.property]=e,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(e){return this.setValue(e),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}},s1=class extends Xt{constructor(e,t,r){super(e,t,r,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}};function o1(n){let e,t;return(e=n.match(/(#|0x)?([a-f0-9]{6})/i))?t=e[2]:(e=n.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?t=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=n.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(t=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),t?"#"+t:!1}var k8={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:o1,toHexString:o1},jr={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},S8={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,t=1){let r=jr.fromHexString(n);e[0]=(r>>16&255)/255*t,e[1]=(r>>8&255)/255*t,e[2]=(r&255)/255*t},toHexString([n,e,t],r=1){r=255/r;let i=n*r<<16^e*r<<8^t*r<<0;return jr.toHexString(i)}},T8={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,t=1){let r=jr.fromHexString(n);e.r=(r>>16&255)/255*t,e.g=(r>>8&255)/255*t,e.b=(r&255)/255*t},toHexString({r:n,g:e,b:t},r=1){r=255/r;let i=n*r<<16^e*r<<8^t*r<<0;return jr.toHexString(i)}},M8=[k8,jr,S8,T8];function C8(n){return M8.find(e=>e.match(n))}var a1=class extends Xt{constructor(e,t,r,i){super(e,t,r,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=C8(this.initialValue),this._rgbScale=i,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{let s=o1(this.$text.value);s&&this._setValueFromHexString(s)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(e){if(this._format.isPrimitive){let t=this._format.fromHexString(e);this.setValue(t)}else this._format.fromHexString(e,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(e){return this._setValueFromHexString(e),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}},Wr=class extends Xt{constructor(e,t,r){super(e,t,r,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",i=>{i.preventDefault(),this.getValue().call(this.object),this._callOnChange()}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}},l1=class extends Xt{constructor(e,t,r,i,s,o){super(e,t,r,"number"),this._initInput(),this.min(i),this.max(s);let l=o!==void 0;this.step(l?o:this._getImplicitStep(),l),this.updateDisplay()}decimals(e){return this._decimals=e,this.updateDisplay(),this}min(e){return this._min=e,this._onUpdateMinMax(),this}max(e){return this._max=e,this._onUpdateMinMax(),this}step(e,t=!0){return this._step=e,this._stepExplicit=t,this}updateDisplay(){let e=this.getValue();if(this._hasSlider){let t=(e-this._min)/(this._max-this._min);t=Math.max(0,Math.min(t,1)),this.$fill.style.width=t*100+"%"}return this._inputFocused||(this.$input.value=this._decimals===void 0?e:e.toFixed(this._decimals)),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),window.matchMedia("(pointer: coarse)").matches&&(this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any")),this.$widget.appendChild(this.$input),this.$disable=this.$input;let t=()=>{let y=parseFloat(this.$input.value);isNaN(y)||(this._stepExplicit&&(y=this._snap(y)),this.setValue(this._clamp(y)))},r=y=>{let M=parseFloat(this.$input.value);isNaN(M)||(this._snapClampSetValue(M+y),this.$input.value=this.getValue())},i=y=>{y.key==="Enter"&&this.$input.blur(),y.code==="ArrowUp"&&(y.preventDefault(),r(this._step*this._arrowKeyMultiplier(y))),y.code==="ArrowDown"&&(y.preventDefault(),r(this._step*this._arrowKeyMultiplier(y)*-1))},s=y=>{this._inputFocused&&(y.preventDefault(),r(this._step*this._normalizeMouseWheel(y)))},o=!1,l,a,v,c,u,h=5,p=y=>{l=y.clientX,a=v=y.clientY,o=!0,c=this.getValue(),u=0,window.addEventListener("mousemove",m),window.addEventListener("mouseup",b)},m=y=>{if(o){let M=y.clientX-l,T=y.clientY-a;Math.abs(T)>h?(y.preventDefault(),this.$input.blur(),o=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(M)>h&&b()}if(!o){let M=y.clientY-v;u-=M*this._step*this._arrowKeyMultiplier(y),c+u>this._max?u=this._max-c:c+u<this._min&&(u=this._min-c),this._snapClampSetValue(c+u)}v=y.clientY},b=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",b)},k=()=>{this._inputFocused=!0},_=()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()};this.$input.addEventListener("input",t),this.$input.addEventListener("keydown",i),this.$input.addEventListener("wheel",s,{passive:!1}),this.$input.addEventListener("mousedown",p),this.$input.addEventListener("focus",k),this.$input.addEventListener("blur",_)}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");let e=(_,y,M,T,S)=>(_-y)/(M-y)*(S-T)+T,t=_=>{let y=this.$slider.getBoundingClientRect(),M=e(_,y.left,y.right,this._min,this._max);this._snapClampSetValue(M)},r=_=>{this._setDraggingStyle(!0),t(_.clientX),window.addEventListener("mousemove",i),window.addEventListener("mouseup",s)},i=_=>{t(_.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",s)},o=!1,l,a,v=_=>{_.preventDefault(),this._setDraggingStyle(!0),t(_.touches[0].clientX),o=!1},c=_=>{_.touches.length>1||(this._hasScrollBar?(l=_.touches[0].clientX,a=_.touches[0].clientY,o=!0):v(_),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",h))},u=_=>{if(o){let y=_.touches[0].clientX-l,M=_.touches[0].clientY-a;Math.abs(y)>Math.abs(M)?v(_):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",h))}else _.preventDefault(),t(_.touches[0].clientX)},h=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",h)},p=this._callOnFinishChange.bind(this),m=400,b,k=_=>{if(Math.abs(_.deltaX)<Math.abs(_.deltaY)&&this._hasScrollBar)return;_.preventDefault();let M=this._normalizeMouseWheel(_)*this._step;this._snapClampSetValue(this.getValue()+M),this.$input.value=this.getValue(),clearTimeout(b),b=setTimeout(p,m)};this.$slider.addEventListener("mousedown",r),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",k,{passive:!1})}_setDraggingStyle(e,t="horizontal"){this.$slider&&this.$slider.classList.toggle("active",e),document.body.classList.toggle("lil-gui-dragging",e),document.body.classList.toggle(`lil-gui-${t}`,e)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(e){let{deltaX:t,deltaY:r}=e;return Math.floor(e.deltaY)!==e.deltaY&&e.wheelDelta&&(t=0,r=-e.wheelDelta/120,r*=this._stepExplicit?1:10),t+-r}_arrowKeyMultiplier(e){let t=this._stepExplicit?1:10;return e.shiftKey?t*=10:e.altKey&&(t/=10),t}_snap(e){let t=Math.round(e/this._step)*this._step;return parseFloat(t.toPrecision(15))}_clamp(e){return e<this._min&&(e=this._min),e>this._max&&(e=this._max),e}_snapClampSetValue(e){this.setValue(this._clamp(this._snap(e)))}get _hasScrollBar(){let e=this.parent.root.$children;return e.scrollHeight>e.clientHeight}get _hasMin(){return this._min!==void 0}get _hasMax(){return this._max!==void 0}},v1=class extends Xt{constructor(e,t,r,i){super(e,t,r,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this._values=Array.isArray(i)?i:Object.values(i),this._names=Array.isArray(i)?i:Object.keys(i),this._names.forEach(s=>{let o=document.createElement("option");o.innerHTML=s,this.$select.appendChild(o)}),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.updateDisplay()}updateDisplay(){let e=this.getValue(),t=this._values.indexOf(e);return this.$select.selectedIndex=t,this.$display.innerHTML=t===-1?e:this._names[t],this}},c1=class extends Xt{constructor(e,t,r){super(e,t,r,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",i=>{i.code==="Enter"&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}},B8=`.lil-gui {
331
331
  font-family: var(--font-family);
332
332
  font-size: var(--font-size);
333
333
  line-height: 1;
@@ -758,16 +758,16 @@ void main() {
758
758
  @font-face {
759
759
  font-family: "lil-gui";
760
760
  src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKd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ement("style");e.innerHTML=n;let t=document.querySelector("head link[rel=stylesheet], head style");t?document.head.insertBefore(e,t):document.head.appendChild(e)}var e2=!1,d1=class n{constructor({parent:e,autoPlace:t=e===void 0,container:r,width:i,title:s="Controls",closeFolders:o=!1,injectStyles:l=!0,touchStyles:a=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",v=>{(v.code==="Enter"||v.code==="Space")&&(v.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(s),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),a&&this.domElement.classList.add("allow-touch-styles"),!e2&&l&&(S8(k8),e2=!0),r?r.appendChild(this.domElement):t&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),i&&this.domElement.style.setProperty("--width",i+"px"),this._closeFolders=o}add(e,t,r,i,s){if(Object(r)===r)return new v1(this,e,t,r);switch(typeof e[t]){case"number":return new l1(this,e,t,r,i,s);case"boolean":return new s1(this,e,t);case"string":return new c1(this,e,t);case"function":return new Wr(this,e,t)}}addColor(e,t,r=1){return new a1(this,e,t,r)}addFolder(e){let t=new n({parent:this,title:e});return this.root._closeFolders&&t.close(),t}load(e,t=!0){return e.controllers&&this.controllers.forEach(r=>{r instanceof Wr||r._name in e.controllers&&r.load(e.controllers[r._name])}),t&&e.folders&&this.folders.forEach(r=>{r._title in e.folders&&r.load(e.folders[r._title])}),this}save(e=!0){let t={controllers:{},folders:{}};return this.controllers.forEach(r=>{if(!(r instanceof Wr)){if(r._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${r._name}"`);t.controllers[r._name]=r.save()}}),e&&this.folders.forEach(r=>{if(r._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${r._title}"`);t.folders[r._title]=r.save()}),t}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("transition");let r=s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",r))};this.$children.addEventListener("transitionend",r);let i=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=i+"px"})}),this}title(e){return this._title=e,this.$title.innerHTML=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(r=>r.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),this._onOpenClose!==void 0&&this._onOpenClose.call(this,e)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(t=>{e=e.concat(t.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(t=>{e=e.concat(t.foldersRecursive())}),e}},u1=d1;var Ut=class{constructor(e,t,r,i){d(this,"gui",null);d(this,"storageKey","");d(this,"target");d(this,"params",[]);d(this,"paramsMeta",{});d(this,"_visible",!1);d(this,"initialValues",{});d(this,"initialized",!1);if(!de){this.gui=new u1,this.storageKey=`debug_params_${e}`,this.target=t,this.paramsMeta=i??{},this.params=r??Object.keys(t);for(let s of this.params)this.initialValues[s]=t[s];this.gui.domElement.style.display="none"}}activate(){return de?this:(!this.initialized&&this.gui&&(this.loadSavedValues(),this.setupControls(),this.initialized=!0),this.show(),this)}get visible(){return de?!1:this._visible}set visible(e){de||!this.gui||(this._visible=e,this.gui.domElement.style.display=e?"block":"none",this.saveVisibility())}loadSavedValues(){if(!de)try{let e=localStorage.getItem(this.storageKey);if(e){let t=JSON.parse(e);for(let r of this.params)if(r in t){let i=t[r];i!==null&&(this.target[r]=i)}}}catch{}}saveValues(e=!1){if(!de)try{let t={};for(let r of this.params)t[r]=this.target[r];e?localStorage.removeItem(this.storageKey):localStorage.setItem(this.storageKey,JSON.stringify(t))}catch{}}saveVisibility(){if(!de)try{localStorage.setItem(`${this.storageKey}_visible`,this._visible.toString())}catch{}}setupControls(){if(!(de||!this.gui)){this.gui.add(this,"visible").name("Show Controls"),this.gui.add({resetAll:()=>{if(this.gui){for(let e of this.params)this.target[e]=this.initialValues[e];this.saveValues(!0),this.gui.destroy(),this.gui=new u1,this.setupControls()}}},"resetAll").name("Reset All Parameters");for(let e of this.params){let t=this.target[e],r=this.paramsMeta[e]??{};if(typeof t=="number"){let i=r.min??t-Math.abs(t*2),s=r.max??t+Math.abs(t*2),o=r.step??Math.abs(t)/100;this.gui.add(this.target,e,i,s,o).onChange(()=>this.saveValues())}else if(typeof t=="boolean")this.gui.add(this.target,e).onChange(()=>this.saveValues());else if(typeof t=="string"&&["x","y","z"].includes(e)){let i=r.min??-10,s=r.max??10,o=r.step??.1;this.gui.add(this.target,e,i,s,o).onChange(()=>this.saveValues())}else Array.isArray(t)&&this.gui.add(this.target,e,t).onChange(()=>this.saveValues())}}}save(){de||(this.saveValues(),this.saveVisibility())}destroy(){de||!this.gui||(this.saveVisibility(),this.gui.destroy())}toggle(){this.visible=!this.visible}show(){this.visible=!0}hide(){this.visible=!1}};A();E();R();x();A();E();R();x();var X5=class{constructor(){d(this,"currentAnimation",null);d(this,"isAnimating",!1);d(this,"cancelRequested",!1);d(this,"completionCallbacks",[]);d(this,"currentCancelCallback",null)}async startAnimation(e,t){return this.isAnimating&&await this.cancelCurrentAnimation(),new Promise(r=>{this.isAnimating=!0,this.cancelRequested=!1,this.currentCancelCallback=t??null,this.currentAnimation=e(),this.completionCallbacks.push(()=>{this.isAnimating=!1,this.currentAnimation=null,r()})})}async cancelCurrentAnimation(){if(this.isAnimating){if(this.currentCancelCallback){let e=this.currentCancelCallback;this.currentCancelCallback=null,e()}return new Promise(e=>{this.cancelRequested=!0,this.completionCallbacks.push(()=>{e()})})}}animationCycleFinish(){this.cancelRequested&&this.forceFinish()}forceFinish(e=!0){if(!this.isAnimating)return;if(this.currentAnimation){for(let r of this.currentAnimation.getAll())r.stop();this.currentAnimation.removeAll(),this.currentAnimation=null}this.isAnimating=!1,this.cancelRequested=!1;let t=[...this.completionCallbacks];if(this.completionCallbacks=[],e)for(let r of t)r()}update(){this.currentAnimation&&this.currentAnimation.update()}get isActive(){return this.isAnimating}get shouldCancel(){return this.cancelRequested}};var T8={x:3e3,y:3e3,z:3e3,rotation:Math.PI,scale:1,default:3e3},C0=class{constructor(e,t,r){this.getState=e;this.setState=t;d(this,"animationController",new X5);d(this,"defaultState");d(this,"speeds");d(this,"currentStateName","");d(this,"transitioningToStateName","");this.speeds={...T8},r&&Object.assign(this.speeds,r),this.defaultState=this.getState()}calculateDuration(e){let t=0,r=this.getState();for(let[i,s]of Object.entries(e)){let o=r[i],l=Math.abs(s-o),a=this.getPropertySpeed(i),v=l/a*1e3;t=Math.max(t,v)}return Math.min(Math.max(t,200),2e3)}getPropertySpeed(e){return e in this.speeds?this.speeds[e]:e.toLowerCase().includes("rotation")?this.speeds.rotation:e.toLowerCase().includes("scale")?this.speeds.scale:e.toLowerCase()==="x"||e.toLowerCase()==="y"||e.toLowerCase()==="z"?this.speeds[e]:this.speeds.default}startTransition(e,t,r,i=Fe.Linear.None,s){this.isTransitioning&&this.animationController.forceFinish(!1),this.transitioningToStateName=t??"";let o=this.getState(),l=this.calculateDuration(e);this.animationController.startAnimation(()=>{let a=new q0;return new Ge(o,a).to(e,l).easing(i).onUpdate(v=>{for(let c of Object.keys(v))this.setState(c,v[c])}).onComplete(()=>{this.animationController.forceFinish(),this.currentStateName=this.transitioningToStateName,this.transitioningToStateName="",r?.()}).start(),a},s)}reset(){this.startTransition(this.defaultState)}update(){this.animationController.update()}forceFinish(){this.animationController.forceFinish()}transitionTo(e,t,r,i){this.startTransition(e,t,r,Fe.Linear.None,i)}getCurrentValue(e){return this.getState()[e]}get isTransitioning(){return this.animationController.isActive}};A();E();R();x();import{subscribeKey as M8}from"valtio/utils";function Z5(n,e,t,r,i){let s=0,o,l=async()=>{let a=++s,v=await n(e[t]);a===s?(o&&i?.(o),r(v),o=v):i?.(v)};return l(),M8(e,t,l)}A();E();R();x();var t2=Math.PI/180;function $5(n){let{walkDist:e,prevWalkDist:t,bob:r,prevBob:i,partialTick:s}=n,o=e-t,l=-(e+o*s),a=i+(r-i)*s,v=Math.sin(l*Math.PI),c=Math.cos(l*Math.PI);return{position:{x:v*a*.5,y:-Math.abs(c*a)},rotation:{x:Math.abs(Math.cos(l*Math.PI-.2)*a)*5*t2,z:v*a*3*t2}}}A();E();R();x();var en=n=>({"minecraft:display_context":"firstperson","minecraft:use_duration":n.playerStateReactive.itemUsageTicks,"minecraft:using_item":!!n.playerStateReactive.itemUsageTicks}),C8=()=>({"minecraft:display_context":"firstperson"}),$0=(n,e)=>{if(!e)return"empty";if(e.type==="hand")return"hand";let t=e.name??(e.id!==void 0?`#${e.id}`:"unknown");if(!n.resourcesManager.currentResources)return`${e.type}:${t}`;let r=n.getItemRenderData({...e.fullItem,itemId:e.id},C8());return`${e.type}:${t}:${r.modelName}`};var $e=new He.Matrix4,r2=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function B8(n,e){let t=new He.Matrix4,r=1,i=Math.sqrt(n),s=-.3*Math.sin(i*Math.PI),o=.4*Math.sin(i*2*Math.PI),l=-.4*Math.sin(n*Math.PI);return t.multiply($e.makeTranslation(r*(s+.64),o-.6+e*-.6,l-.72)),t.multiply($e.makeRotationY(r*45*Math.PI/180)),t.multiply($e.makeRotationY(r*Math.sin(i*Math.PI)*70*Math.PI/180)),t.multiply($e.makeRotationZ(r*Math.sin(n*n*Math.PI)*-20*Math.PI/180)),t.multiply($e.makeTranslation(r*-1,3.6,3.5)),t.multiply($e.makeRotationZ(r*120*Math.PI/180)),t.multiply($e.makeRotationX(200*Math.PI/180)),t.multiply($e.makeRotationY(r*-135*Math.PI/180)),t.multiply($e.makeTranslation(r*5.6,0,0)),t.multiply($e.makeTranslation(r*-5/16,2/16,0)),t}function P8(n,e){let t=new He.Matrix4,r=1,i=Math.sqrt(n),s=-.4*Math.sin(i*Math.PI),o=.2*Math.sin(i*2*Math.PI),l=-.2*Math.sin(n*Math.PI);t.multiply($e.makeTranslation(r*s,o,l)),t.multiply($e.makeTranslation(r*.56,-.52+e*-.6,-.72));let a=Math.sin(n*n*Math.PI),v=Math.sin(i*Math.PI);return t.multiply($e.makeRotationY(r*(45+a*-20)*Math.PI/180)),t.multiply($e.makeRotationZ(r*v*-20*Math.PI/180)),t.multiply($e.makeRotationX(v*-80*Math.PI/180)),t.multiply($e.makeRotationY(r*-45*Math.PI/180)),t}var Yr=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;d(this,"holdingBlock");d(this,"blockSwapAnimation");d(this,"cameraGroup",new He.Mesh);d(this,"armTransformGroup",new He.Group);d(this,"camera",new He.PerspectiveCamera(70,1,.05,100));d(this,"equipProgress",0);d(this,"stopUpdate",!1);d(this,"lastHeldItem");d(this,"lastHeldItemRenderKey");d(this,"currentDisplayType","hand");d(this,"isSwinging",!1);d(this,"nextIterStopCallbacks");d(this,"idleAnimator");d(this,"ready",!1);d(this,"lastUpdate",0);d(this,"xBob",0);d(this,"yBob",0);d(this,"lastBobUpdateTime",0);d(this,"lastBobWalkDist",0);d(this,"lastBobTickTime",0);d(this,"playerHand");d(this,"offHandDisplay",!1);d(this,"offHandModeLegacy",!1);d(this,"swingAnimator");d(this,"config");d(this,"disposed",!1);d(this,"unsubs",[]);d(this,"lastItemModelName");d(this,"switchRequest",0);this.initCameraGroup(),this.swingAnimator=new h1,this.unsubs.push(this.worldRenderer.onReactivePlayerStateUpdated("heldItemMain",()=>{this.offHand||this.updateItem()},!1),this.worldRenderer.onReactivePlayerStateUpdated("heldItemOff",()=>{this.offHand&&this.updateItem()},!1)),this.config=e.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||Nr().then(r=>{this.disposed||(this.playerHand=r,this.updateItem())}).then(()=>{if(this.disposed)return;let r=Z5(async()=>Nr(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",i=>{i&&(this.playerHand=i,this.updateItem())},i=>{Me(i,!0)});this.unsubs.push(r)})}dispose(){this.disposed=!0,this.unsubs.forEach(e=>e()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,Me(this.cameraGroup,!0),this.holdingBlock&&this.holdingBlock!==this.playerHand&&Me(this.holdingBlock,!0),this.holdingBlock=void 0,this.playerHand&&(Me(this.playerHand,!0),this.playerHand=void 0),this.ready=!1}updateItem(){if(!this.ready)return;let e=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;e?this.setNewItem(e):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new He.Mesh,this.armTransformGroup=new He.Group,this.armTransformGroup.matrixAutoUpdate=!1,this.cameraGroup.add(this.armTransformGroup)}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(e,t,r,i){if(!this.lastHeldItem)return;let s=performance.now();this.lastUpdate&&s-this.lastUpdate>50&&this.replaceItemModel(this.lastHeldItem),(this.swingAnimator?.isCurrentlySwinging()||this.swingAnimator?.debugParams.animationStage)&&this.swingAnimator?.update(),this.blockSwapAnimation?.switcher.update();let o=new He.Scene;o.add(this.cameraGroup);let l=t.getSize(new He.Vector2),a=l.height>l.width;a?this.camera.aspect!==1&&(this.camera.aspect=1,this.camera.updateProjectionMatrix()):this.camera.aspect!==e.aspect&&(this.camera.aspect=e.aspect,this.camera.updateProjectionMatrix()),this.updateCameraGroup(),o.add(r.clone()),o.add(i.clone());let{offHandDisplay:v}=this;if(v&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),a){let c=Math.min(l.width,l.height);v?t.setViewport(0,0,c,c):t.setViewport(l.width-c,0,c,c)}t.render(o,this.camera),a&&t.setViewport(0,0,l.width,l.height),v&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new C0(()=>({progress:this.equipProgress}),(i,s)=>{i==="progress"&&(this.equipProgress=s)},{progress:4})});let t=e==="disappeared"?1:0,r=!1;return new Promise(i=>{this.blockSwapAnimation.switcher.transitionTo({progress:t},e,()=>{r||i(!0)},()=>{r=!0,i(!1)})})}isDifferentItem(e){return this.lastHeldItemRenderKey!==$0(this.worldRenderer,e)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:e}=this,t=performance.now(),r=this.worldRenderer.cameraShake.getBaseRotation(),i=r.pitch,s=r.yaw;if(this.lastBobUpdateTime===0)this.xBob=i,this.yBob=s;else{let h=Math.min((t-this.lastBobUpdateTime)/1e3,.1),p=1-Math.pow(.5,h*28),m=1-Math.pow(.5,h*36);this.xBob+=(i-this.xBob)*p,this.yBob+=r2(s-this.yBob)*m}this.lastBobUpdateTime=t;let o=(i-this.xBob)*-.05,l=r2(s-this.yBob)*-.035;if(this.cameraGroup.position.copy(e.position),this.cameraGroup.rotation.copy(e.rotation),this.worldRenderer.displayOptions.inWorldRenderingConfig.viewBobbing){let h=this.worldRenderer.playerStateReactive;h.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=t,this.lastBobWalkDist=h.walkDist);let p=Math.min((t-this.lastBobTickTime)/50,1),m=1.8,b=$5({walkDist:h.walkDist*m,prevWalkDist:h.prevWalkDist*m,bob:h.bob,prevBob:h.prevBob,partialTick:p});this.cameraGroup.position.x+=b.position.x,this.cameraGroup.position.y+=b.position.y,this.cameraGroup.rotation.z+=b.rotation.z,this.cameraGroup.rotation.x+=b.rotation.x}this.cameraGroup.rotation.x+=o,this.cameraGroup.rotation.y+=l;let v=this.currentDisplayType,c=this.swingAnimator?.getSwingProgress()??0,u;v==="hand"?u=B8(c,this.equipProgress):u=P8(c,this.equipProgress),this.armTransformGroup.matrix.copy(u),this.armTransformGroup.matrixWorldNeedsUpdate=!0}async createItemModel(e){if(this.lastUpdate=performance.now(),!e||e.type==="hand"&&!this.playerHand)return;let t;if(e.type==="item"||e.type==="block"){let r=this.worldRenderer.entities.getItemMesh({...e.fullItem,itemId:e.id},en(this.worldRenderer),!1,this.lastItemModelName);if(r){let{mesh:i,isBlock:s,modelName:o}=r;s?(t=i,e.type="block"):(t=i,e.type="item"),this.lastItemModelName=o}}else t=this.playerHand;if(t){if(e.type==="item"||e.type==="block"){let r=new He.Group;r.name="displayTransform",e.type==="item"?(r.position.set(1.13/16,3.2/16,1.13/16),r.rotation.set(0,He.MathUtils.degToRad(-90),He.MathUtils.degToRad(25),"XYZ"),r.scale.set(.68,.68,.68)):(r.rotation.set(0,He.MathUtils.degToRad(45),0,"XYZ"),r.scale.set(.4,.4,.4)),r.add(t),t=r}return t.name="holdingBlock",{model:t,type:e.type}}}async replaceItemModel(e){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!e){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.currentDisplayType="hand";let r=this.swingAnimator;r?.stopSwing(),r&&(r.type="hand"),this.idleAnimator=void 0;return}let t=await this.createItemModel(e);t&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=t.model,this.currentDisplayType=t.type,this.armTransformGroup.add(t.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}async setNewItem(e){let t=$0(this.worldRenderer,e),r=this.lastHeldItemRenderKey!==t;if(this.lastHeldItem=e,!r)return;this.lastHeldItemRenderKey=t,this.lastItemModelName=void 0;let i=++this.switchRequest,s=!1;if(this.holdingBlock){if(s=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock.removeFromParent(),this.holdingBlock!==this.playerHand&&Me(this.holdingBlock,!1),this.holdingBlock=void 0}if(!e){this.currentDisplayType="hand";let a=this.swingAnimator;a?.stopSwing(),a&&(a.type="hand"),this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(i!==this.switchRequest)return;let o=await this.createItemModel(e);if(!o||i!==this.switchRequest)return;this.holdingBlock=o.model,this.currentDisplayType=o.type,this.armTransformGroup.add(this.holdingBlock),s&&await this.playBlockSwapAnimation("appeared");let l=this.swingAnimator;l&&(l.type=o.type),this.idleAnimator=void 0}};var h1=class{constructor(){d(this,"animationTimer",0);d(this,"lastTime",0);d(this,"isAnimating",!1);d(this,"stopRequested",!1);d(this,"swingProgress",0);d(this,"type","hand");d(this,"debugParams",{animationTime:250,animationStage:0});d(this,"debugGui");this.debugGui=new Ut("hand_animator",this.debugParams,void 0,{animationStage:{min:0,max:1,step:.01}})}update(){if(!this.isAnimating&&!this.debugParams.animationStage){this.swingProgress=0;return}let e=performance.now(),t=(e-this.lastTime)/1e3;this.lastTime=e,this.animationTimer+=t*1e3;let r=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(r>=1){if(this.stopRequested){this.isAnimating=!1,this.stopRequested=!1,this.animationTimer=0,this.swingProgress=0;return}this.animationTimer=0,this.swingProgress=0;return}this.swingProgress=r}getSwingProgress(){return this.swingProgress}startSwing(){this.stopRequested=!1,!this.isAnimating&&(this.isAnimating=!0,this.animationTimer=0,this.lastTime=performance.now())}stopSwing(){this.isAnimating&&(this.stopRequested=!0)}isCurrentlySwinging(){return this.isAnimating}},n2=(n,e,t,r,i)=>{let s=r.transformModel(e,{name:t,properties:{}});return i1(n,[[s]],void 0,"plains",i)};A();E();R();x();import*as me from"three";import{subscribeKey as q6}from"valtio/utils";A();E();R();x();import*as Ye from"three";A();E();R();x();import Y1 from"prismarine-nbt";import*as j from"three";A();E();R();x();A();E();R();x();import{BoxGeometry as et,DoubleSide as y1,FrontSide as s2,Group as _t,Mesh as Xe,MeshStandardMaterial as Qr,Vector2 as tn}from"three";function _1(n,e,t,r,i,s,o,l){let a=(P,H,V,z)=>[new tn(P/o,1-z/l),new tn(V/o,1-z/l),new tn(V/o,1-H/l),new tn(P/o,1-H/l)],v=a(e+s,t,e+r+s,t+s),c=a(e+r+s,t,e+r*2+s,t+s),u=a(e,t+s,e+s,t+s+i),h=a(e+s,t+s,e+r+s,t+s+i),p=a(e+r+s,t+s,e+r+s*2,t+i+s),m=a(e+r+s*2,t+s,e+r*2+s*2,t+i+s),b=n.attributes.uv,k=[p[3],p[2],p[0],p[1]],_=[u[3],u[2],u[0],u[1]],y=[v[3],v[2],v[0],v[1]],M=[c[0],c[1],c[3],c[2]],T=[h[3],h[2],h[0],h[1]],S=[m[3],m[2],m[0],m[1]],B=[];for(let P of[k,_,y,M,T,S])for(let H of P)B.push(H.x,H.y);b.set(new Float32Array(B)),b.needsUpdate=!0}function yt(n,e,t,r,i,s){_1(n,e,t,r,i,s,64,64)}function f1(n,e,t,r,i,s){_1(n,e,t,r,i,s,64,32)}var Vt=class extends _t{constructor(e,t){super(),Object.defineProperty(this,"innerLayer",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"outerLayer",{enumerable:!0,configurable:!0,writable:!0,value:t}),e.name="inner",t.name="outer"}},m1=class extends _t{constructor(){super(),Object.defineProperty(this,"head",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rightArm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"leftArm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rightLeg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"leftLeg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modelListeners",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slim",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"layer1Material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"layer1MaterialBiased",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"layer2Material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"layer2MaterialBiased",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.layer1Material=new Qr({side:s2}),this.layer2Material=new Qr({side:y1,transparent:!0,alphaTest:1e-5}),this.layer1MaterialBiased=this.layer1Material.clone(),this.layer1MaterialBiased.polygonOffset=!0,this.layer1MaterialBiased.polygonOffsetFactor=1,this.layer1MaterialBiased.polygonOffsetUnits=1,this.layer2MaterialBiased=this.layer2Material.clone(),this.layer2MaterialBiased.polygonOffset=!0,this.layer2MaterialBiased.polygonOffsetFactor=1,this.layer2MaterialBiased.polygonOffsetUnits=1;let e=new et(8,8,8);yt(e,0,0,8,8,8);let t=new Xe(e,this.layer1Material),r=new et(9,9,9);yt(r,32,0,8,8,8);let i=new Xe(r,this.layer2Material);this.head=new Vt(t,i),this.head.name="head",this.head.add(t,i),t.position.y=4,i.position.y=4,this.add(this.head);let s=new et(8,12,4);yt(s,16,16,8,12,4);let o=new Xe(s,this.layer1Material),l=new et(8.5,12.5,4.5);yt(l,16,32,8,12,4);let a=new Xe(l,this.layer2Material);this.body=new Vt(o,a),this.body.name="body",this.body.add(o,a),this.body.position.y=-6,this.add(this.body);let v=new et,c=new Xe(v,this.layer1MaterialBiased);this.modelListeners.push(()=>{c.scale.x=this.slim?3:4,c.scale.y=12,c.scale.z=4,yt(v,40,16,this.slim?3:4,12,4)});let u=new et,h=new Xe(u,this.layer2MaterialBiased);this.modelListeners.push(()=>{h.scale.x=this.slim?3.5:4.5,h.scale.y=12.5,h.scale.z=4.5,yt(u,40,32,this.slim?3:4,12,4)});let p=new _t;p.add(c,h),this.modelListeners.push(()=>{p.position.x=this.slim?-.5:-1}),p.position.y=-4,this.rightArm=new Vt(c,h),this.rightArm.name="rightArm",this.rightArm.add(p),this.rightArm.position.x=-5,this.rightArm.position.y=-2,this.add(this.rightArm);let m=new et,b=new Xe(m,this.layer1MaterialBiased);this.modelListeners.push(()=>{b.scale.x=this.slim?3:4,b.scale.y=12,b.scale.z=4,yt(m,32,48,this.slim?3:4,12,4)});let k=new et,_=new Xe(k,this.layer2MaterialBiased);this.modelListeners.push(()=>{_.scale.x=this.slim?3.5:4.5,_.scale.y=12.5,_.scale.z=4.5,yt(k,48,48,this.slim?3:4,12,4)});let y=new _t;y.add(b,_),this.modelListeners.push(()=>{y.position.x=this.slim?.5:1}),y.position.y=-4,this.leftArm=new Vt(b,_),this.leftArm.name="leftArm",this.leftArm.add(y),this.leftArm.position.x=5,this.leftArm.position.y=-2,this.add(this.leftArm);let M=new et(4,12,4);yt(M,0,16,4,12,4);let T=new Xe(M,this.layer1MaterialBiased),S=new et(4.5,12.5,4.5);yt(S,0,32,4,12,4);let B=new Xe(S,this.layer2MaterialBiased),P=new _t;P.add(T,B),P.position.y=-6,this.rightLeg=new Vt(T,B),this.rightLeg.name="rightLeg",this.rightLeg.add(P),this.rightLeg.position.x=-1.9,this.rightLeg.position.y=-12,this.rightLeg.position.z=-.1,this.add(this.rightLeg);let H=new et(4,12,4);yt(H,16,48,4,12,4);let V=new Xe(H,this.layer1MaterialBiased),z=new et(4.5,12.5,4.5);yt(z,0,48,4,12,4);let N=new Xe(z,this.layer2MaterialBiased),Y=new _t;Y.add(V,N),Y.position.y=-6,this.leftLeg=new Vt(V,N),this.leftLeg.name="leftLeg",this.leftLeg.add(Y),this.leftLeg.position.x=1.9,this.leftLeg.position.y=-12,this.leftLeg.position.z=-.1,this.add(this.leftLeg),this.modelType="default"}get map(){return this._map}set map(e){this._map=e,this.layer1Material.map=e,this.layer1Material.needsUpdate=!0,this.layer1MaterialBiased.map=e,this.layer1MaterialBiased.needsUpdate=!0,this.layer2Material.map=e,this.layer2Material.needsUpdate=!0,this.layer2MaterialBiased.map=e,this.layer2MaterialBiased.needsUpdate=!0}get modelType(){return this.slim?"slim":"default"}set modelType(e){this.slim=e==="slim",this.modelListeners.forEach(t=>t())}getBodyParts(){return this.children.filter(e=>e instanceof Vt)}setInnerLayerVisible(e){this.getBodyParts().forEach(t=>t.innerLayer.visible=e)}setOuterLayerVisible(e){this.getBodyParts().forEach(t=>t.outerLayer.visible=e)}resetJoints(){this.head.rotation.set(0,0,0),this.leftArm.rotation.set(0,0,0),this.rightArm.rotation.set(0,0,0),this.leftLeg.rotation.set(0,0,0),this.rightLeg.rotation.set(0,0,0),this.body.rotation.set(0,0,0),this.head.position.y=0,this.body.position.y=-6,this.body.position.z=0,this.rightArm.position.x=-5,this.rightArm.position.y=-2,this.rightArm.position.z=0,this.leftArm.position.x=5,this.leftArm.position.y=-2,this.leftArm.position.z=0,this.rightLeg.position.x=-1.9,this.rightLeg.position.y=-12,this.rightLeg.position.z=-.1,this.leftLeg.position.x=1.9,this.leftLeg.position.y=-12,this.leftLeg.position.z=-.1}},p1=class extends _t{constructor(){super(),Object.defineProperty(this,"cape",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.material=new Qr({side:y1,transparent:!0,alphaTest:1e-5});let e=new et(10,16,1);f1(e,0,0,10,16,1),this.cape=new Xe(e,this.material),this.cape.position.y=-8,this.cape.position.z=.5,this.add(this.cape)}get map(){return this.material.map}set map(e){this.material.map=e,this.material.needsUpdate=!0}},g1=class extends _t{constructor(){super(),Object.defineProperty(this,"leftWing",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rightWing",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.material=new Qr({side:y1,transparent:!0,alphaTest:1e-5});let e=new et(12,22,4);f1(e,22,0,10,20,2);let t=new Xe(e,this.material);t.position.x=-5,t.position.y=-10,t.position.z=-1,this.leftWing=new _t,this.leftWing.add(t),this.add(this.leftWing);let r=new et(12,22,4);f1(r,22,0,10,20,2);let i=new Xe(r,this.material);i.scale.x=-1,i.position.x=5,i.position.y=-10,i.position.z=-1,this.rightWing=new _t,this.rightWing.add(i),this.add(this.rightWing),this.leftWing.position.x=5,this.leftWing.rotation.x=.2617994,this.resetJoints()}resetJoints(){this.leftWing.rotation.y=.01,this.leftWing.rotation.z=.2617994,this.updateRightWing()}updateRightWing(){this.rightWing.position.x=-this.leftWing.position.x,this.rightWing.position.y=this.leftWing.position.y,this.rightWing.rotation.x=this.leftWing.rotation.x,this.rightWing.rotation.y=-this.leftWing.rotation.y,this.rightWing.rotation.z=-this.leftWing.rotation.z}get map(){return this.material.map}set map(e){this.material.map=e,this.material.needsUpdate=!0}},b1=class extends _t{constructor(){super(),Object.defineProperty(this,"rightEar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"leftEar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.material=new Qr({side:s2});let e=new et(8,8,4/3);_1(e,0,0,6,6,1,14,7),this.rightEar=new Xe(e,this.material),this.rightEar.name="rightEar",this.rightEar.position.x=-6,this.add(this.rightEar),this.leftEar=new Xe(e,this.material),this.leftEar.name="leftEar",this.leftEar.position.x=6,this.add(this.leftEar)}get map(){return this.material.map}set map(e){this.material.map=e,this.material.needsUpdate=!0}},i2=10.8*Math.PI/180,er=class extends _t{constructor(){super(),Object.defineProperty(this,"skin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cape",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"elytra",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ears",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.skin=new m1,this.skin.name="skin",this.skin.position.y=8,this.add(this.skin),this.cape=new p1,this.cape.name="cape",this.cape.position.y=8,this.cape.position.z=-2,this.cape.rotation.x=i2,this.cape.rotation.y=Math.PI,this.add(this.cape),this.elytra=new g1,this.elytra.name="elytra",this.elytra.position.y=8,this.elytra.position.z=-2,this.elytra.visible=!1,this.add(this.elytra),this.ears=new b1,this.ears.name="ears",this.ears.position.y=10,this.ears.position.z=2/3,this.ears.visible=!1,this.skin.head.add(this.ears)}get backEquipment(){return this.cape.visible?"cape":this.elytra.visible?"elytra":null}set backEquipment(e){this.cape.visible=e==="cape",this.elytra.visible=e==="elytra"}resetJoints(){this.skin.resetJoints(),this.cape.rotation.x=i2,this.cape.position.y=8,this.cape.position.z=-2,this.elytra.position.y=8,this.elytra.position.z=-2,this.elytra.rotation.x=0,this.elytra.resetJoints()}};A();E();R();x();import{Color as Jw,PointLight as Xw,EquirectangularReflectionMapping as Zw,Group as $w,NearestFilter as eA,PerspectiveCamera as tA,Scene as rA,Texture as nA,Vector2 as iA,WebGLRenderer as sA,AmbientLight as oA,CanvasTexture as aA,WebGLRenderTarget as lA,FloatType as vA,DepthTexture as cA,Clock as dA,Object3D as uA,ColorManagement as hA}from"three";import{OrbitControls as mA}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as gA}from"three/examples/jsm/postprocessing/EffectComposer.js";import"three/examples/jsm/postprocessing/Pass.js";import{RenderPass as wA}from"three/examples/jsm/postprocessing/RenderPass.js";import{ShaderPass as EA}from"three/examples/jsm/postprocessing/ShaderPass.js";import{FXAAShader as RA}from"three/examples/jsm/shaders/FXAAShader.js";A();E();R();x();var rn=class{constructor(){Object.defineProperty(this,"speed",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"progress",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"currentId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"progress0",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"animationObjects",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}update(e,t){if(this.paused)return;let r=t*this.speed;this.animate(e,r),this.animationObjects.forEach((i,s)=>{let o=this.progress0.get(s);i(e,this.progress-o,s)}),this.progress+=r}addAnimation(e){let t=this.currentId++;return this.progress0.set(t,this.progress),this.animationObjects.set(t,e),t}removeAnimation(e){e!=null&&(this.animationObjects.delete(e),this.progress0.delete(e))}};A();E();R();x();import{CanvasTexture as Lw,NearestFilter as Ow,Sprite as Dw,SpriteMaterial as Fw}from"three";A();E();R();x();var I8=Object.defineProperty,H8=(n,e,t)=>e in n?I8(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ee=(n,e,t)=>(H8(n,typeof e!="symbol"?e+"":e,t),t);function w1(n){let e=[n];if(n.extra&&n.extra.length!==0)for(let t of n.extra)e.push(...w1(t));return e}var $=class{constructor(n,e,t,r,i,s){this.key=n,this.value=e,this.name=t,this.code=r,this.cssForeground=i,this.cssBackground=s}applyToStyle(n){n[this.key]=this.value}matchStyle(n){return n[this.key]===this.value}static fromCode(n){let t="0123456789abcdefklmnor".indexOf(n);if(t)return this.list[t]}toString(){return`${$.CONTROL_STRING}${this.code}`}},xe=$;Ee(xe,"CONTROL_STRING","\xA7");Ee(xe,"BLACK",new $("color","black","BLACK","0",{color:"#000000"},{color:"#000000"}));Ee(xe,"DARK_BLUE",new $("color","dark_blue","DARK_BLUE","1",{color:"#0000AA"},{color:"#00002A"}));Ee(xe,"DARK_GREEN",new $("color","dark_green","DARK_GREEN","2",{color:"#00AA00"},{color:"#002A00"}));Ee(xe,"DARK_AQUA",new $("color","dark_aqua","DARK_AQUA","3",{color:"#00AAAA"},{color:"#002A2A"}));Ee(xe,"DARK_RED",new $("color","dark_red","DARK_RED","4",{color:"#AA0000"},{color:"#2A0000"}));Ee(xe,"DARK_PURPLE",new $("color","dark_purple","DARK_PURPLE","5",{color:"#AA00AA"},{color:"#2A002A"}));Ee(xe,"GOLD",new $("color","gold","GOLD","6",{color:"#FFAA00"},{color:"#2A2A00"}));Ee(xe,"GRAY",new $("color","gray","GRAY","7",{color:"#AAAAAA"},{color:"#2A2A2A"}));Ee(xe,"DARK_GRAY",new $("color","dark_gray","DARK_GRAY","8",{color:"#555555"},{color:"#151515"}));Ee(xe,"BLUE",new $("color","blue","BLUE","9",{color:"#5555FF"},{color:"#15153F"}));Ee(xe,"GREEN",new $("color","green","GREEN","a",{color:"#55FF55"},{color:"#153F15"}));Ee(xe,"AQUA",new $("color","aqua","AQUA","b",{color:"#55FFFF"},{color:"#153F3F"}));Ee(xe,"RED",new $("color","red","RED","c",{color:"#FF5555"},{color:"#3F1515"}));Ee(xe,"LIGHT_PURPLE",new $("color","light_purple","LIGHT_PURPLE","d",{color:"#FF55FF"},{color:"#3F153F"}));Ee(xe,"YELLOW",new $("color","yellow","YELLOW","e",{color:"#FFFF55"},{color:"#3F3F15"}));Ee(xe,"WHITE",new $("color","white","WHITE","f",{color:"#FFFFFF"},{color:"#3F3F3F"}));Ee(xe,"OBFUSCATED",new $("obfuscated",!0,"OBFUSCATED","k",{}));Ee(xe,"BOLD",new $("bold",!0,"BOLD","l",{"font-weight":"bold"}));Ee(xe,"STRIKETHROUGH",new $("strikethrough",!0,"STRIKETHROUGH","m",{"text-decoration":"line-through"}));Ee(xe,"UNDERLINE",new $("underlined",!0,"UNDERLINE","n",{"text-decoration":"underline"}));Ee(xe,"ITALIC",new $("italic",!0,"ITALIC","o",{"font-style":"italic"}));Ee(xe,"RESET",{name:"RESET",code:"r",applyToStyle(n){n.bold=!1,n.strikethrough=!1,n.underlined=!1,n.italic=!1,n.obfuscated=!1,n.color=void 0},matchStyle(n){return!1},cssBackground:{},cssForeground:{},toString(){return`${$.CONTROL_STRING}r`}});Ee(xe,"list",[$.BLACK,$.DARK_BLUE,$.DARK_GREEN,$.DARK_AQUA,$.DARK_RED,$.DARK_PURPLE,$.GOLD,$.GRAY,$.DARK_GRAY,$.BLUE,$.GREEN,$.AQUA,$.RED,$.LIGHT_PURPLE,$.YELLOW,$.WHITE,$.OBFUSCATED,$.BOLD,$.STRIKETHROUGH,$.UNDERLINE,$.ITALIC,$.RESET]);var n5=xr(A1(),1);k1();var W6=xr(C2(),1);import j6 from"prismarine-chat";A();E();R();x();var y4=(n,e)=>{try{return JSON.parse(n)}catch{return null}},_4={black:"#000000",dark_blue:"#0000AA",dark_green:"#00AA00",dark_aqua:"#00AAAA",dark_red:"#AA0000",dark_purple:"#AA00AA",gold:"#FFAA00",gray:"#AAAAAA",dark_gray:"#555555",blue:"#5555FF",green:"#55FF55",aqua:"#55FFFF",red:"#FF5555",light_purple:"#FF55FF",yellow:"#FFFF55",white:"#FFFFFF"},B2=(n,e,t,r=s=>{},i=(s,o)=>Ne(s,o))=>{let l=[16,9],a=l[0]-l[1],v=a/16,c="front_text"in n?n.front_text.messages:[n.Text1,n.Text2,n.Text3,n.Text4];if(!c.some(m=>m!=="null"))return;let u=i(16*40,a*40),h=u.getContext("2d");r(h);let p=("front_text"in n?n.front_text.color:n.Color)||"black";for(let[m,b]of c.slice(0,4).entries())b!=="null"&&S1(b,t,u,64,p,64*(m+1)+(e?0:-8));return u},S1=(n,e,t,r,i,s=0)=>{let o=!1,l=typeof n=="string"&&(n?.startsWith("{")||n?.startsWith('"'))?y4(n??'""',"sign text"):n;if(!l||typeof l!="object"&&typeof l!="string")return;let a=t.getContext("2d");if(!a)throw new Error("Could not get 2d context");a.imageSmoothingEnabled=!1,a.font=`${r}px mojangles`;let v=new e(l),c=[],u=!1,h="",p=s,m=[],b=(M,T)=>{M.text!==null&&M.text!==void 0&&M.text;let S=M.text===null||M.text===void 0?void 0:String(M.text),B={color:M.color??T?.color,underlined:M.underlined??T?.underlined,strikethrough:M.strikethrough??T?.strikethrough,bold:M.bold??T?.bold,italic:M.italic??T?.italic};if(u=u||B.underlined||B.strikethrough||!1,S?.includes(`
761
+ }`;function P8(n){let e=document.createElement("style");e.innerHTML=n;let t=document.querySelector("head link[rel=stylesheet], head style");t?document.head.insertBefore(e,t):document.head.appendChild(e)}var n2=!1,d1=class n{constructor({parent:e,autoPlace:t=e===void 0,container:r,width:i,title:s="Controls",closeFolders:o=!1,injectStyles:l=!0,touchStyles:a=!0}={}){if(this.parent=e,this.root=e?e.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",v=>{(v.code==="Enter"||v.code==="Space")&&(v.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(s),this.parent){this.parent.children.push(this),this.parent.folders.push(this),this.parent.$children.appendChild(this.domElement);return}this.domElement.classList.add("root"),a&&this.domElement.classList.add("allow-touch-styles"),!n2&&l&&(P8(B8),n2=!0),r?r.appendChild(this.domElement):t&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),i&&this.domElement.style.setProperty("--width",i+"px"),this._closeFolders=o}add(e,t,r,i,s){if(Object(r)===r)return new v1(this,e,t,r);switch(typeof e[t]){case"number":return new l1(this,e,t,r,i,s);case"boolean":return new s1(this,e,t);case"string":return new c1(this,e,t);case"function":return new Wr(this,e,t)}}addColor(e,t,r=1){return new a1(this,e,t,r)}addFolder(e){let t=new n({parent:this,title:e});return this.root._closeFolders&&t.close(),t}load(e,t=!0){return e.controllers&&this.controllers.forEach(r=>{r instanceof Wr||r._name in e.controllers&&r.load(e.controllers[r._name])}),t&&e.folders&&this.folders.forEach(r=>{r._title in e.folders&&r.load(e.folders[r._title])}),this}save(e=!0){let t={controllers:{},folders:{}};return this.controllers.forEach(r=>{if(!(r instanceof Wr)){if(r._name in t.controllers)throw new Error(`Cannot save GUI with duplicate property "${r._name}"`);t.controllers[r._name]=r.save()}}),e&&this.folders.forEach(r=>{if(r._title in t.folders)throw new Error(`Cannot save GUI with duplicate folder "${r._title}"`);t.folders[r._title]=r.save()}),t}open(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}_setClosed(e){this._closed!==e&&(this._closed=e,this._callOnOpenClose(this))}show(e=!0){return this._hidden=!e,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(e=!0){return this._setClosed(!e),this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{let t=this.$children.clientHeight;this.$children.style.height=t+"px",this.domElement.classList.add("transition");let r=s=>{s.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",r))};this.$children.addEventListener("transitionend",r);let i=e?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!e),requestAnimationFrame(()=>{this.$children.style.height=i+"px"})}),this}title(e){return this._title=e,this.$title.innerHTML=e,this}reset(e=!0){return(e?this.controllersRecursive():this.controllers).forEach(r=>r.reset()),this}onChange(e){return this._onChange=e,this}_callOnChange(e){this.parent&&this.parent._callOnChange(e),this._onChange!==void 0&&this._onChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onFinishChange(e){return this._onFinishChange=e,this}_callOnFinishChange(e){this.parent&&this.parent._callOnFinishChange(e),this._onFinishChange!==void 0&&this._onFinishChange.call(this,{object:e.object,property:e.property,value:e.getValue(),controller:e})}onOpenClose(e){return this._onOpenClose=e,this}_callOnOpenClose(e){this.parent&&this.parent._callOnOpenClose(e),this._onOpenClose!==void 0&&this._onOpenClose.call(this,e)}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(e=>e.destroy())}controllersRecursive(){let e=Array.from(this.controllers);return this.folders.forEach(t=>{e=e.concat(t.controllersRecursive())}),e}foldersRecursive(){let e=Array.from(this.folders);return this.folders.forEach(t=>{e=e.concat(t.foldersRecursive())}),e}},u1=d1;var Ut=class{constructor(e,t,r,i){d(this,"gui",null);d(this,"storageKey","");d(this,"target");d(this,"params",[]);d(this,"paramsMeta",{});d(this,"_visible",!1);d(this,"initialValues",{});d(this,"initialized",!1);if(!de){this.gui=new u1,this.storageKey=`debug_params_${e}`,this.target=t,this.paramsMeta=i??{},this.params=r??Object.keys(t);for(let s of this.params)this.initialValues[s]=t[s];this.gui.domElement.style.display="none"}}activate(){return de?this:(!this.initialized&&this.gui&&(this.loadSavedValues(),this.setupControls(),this.initialized=!0),this.show(),this)}get visible(){return de?!1:this._visible}set visible(e){de||!this.gui||(this._visible=e,this.gui.domElement.style.display=e?"block":"none",this.saveVisibility())}loadSavedValues(){if(!de)try{let e=localStorage.getItem(this.storageKey);if(e){let t=JSON.parse(e);for(let r of this.params)if(r in t){let i=t[r];i!==null&&(this.target[r]=i)}}}catch{}}saveValues(e=!1){if(!de)try{let t={};for(let r of this.params)t[r]=this.target[r];e?localStorage.removeItem(this.storageKey):localStorage.setItem(this.storageKey,JSON.stringify(t))}catch{}}saveVisibility(){if(!de)try{localStorage.setItem(`${this.storageKey}_visible`,this._visible.toString())}catch{}}setupControls(){if(!(de||!this.gui)){this.gui.add(this,"visible").name("Show Controls"),this.gui.add({resetAll:()=>{if(this.gui){for(let e of this.params)this.target[e]=this.initialValues[e];this.saveValues(!0),this.gui.destroy(),this.gui=new u1,this.setupControls()}}},"resetAll").name("Reset All Parameters");for(let e of this.params){let t=this.target[e],r=this.paramsMeta[e]??{};if(typeof t=="number"){let i=r.min??t-Math.abs(t*2),s=r.max??t+Math.abs(t*2),o=r.step??Math.abs(t)/100;this.gui.add(this.target,e,i,s,o).onChange(()=>this.saveValues())}else if(typeof t=="boolean")this.gui.add(this.target,e).onChange(()=>this.saveValues());else if(typeof t=="string"&&["x","y","z"].includes(e)){let i=r.min??-10,s=r.max??10,o=r.step??.1;this.gui.add(this.target,e,i,s,o).onChange(()=>this.saveValues())}else Array.isArray(t)&&this.gui.add(this.target,e,t).onChange(()=>this.saveValues())}}}save(){de||(this.saveValues(),this.saveVisibility())}destroy(){de||!this.gui||(this.saveVisibility(),this.gui.destroy())}toggle(){this.visible=!this.visible}show(){this.visible=!0}hide(){this.visible=!1}};A();E();R();x();A();E();R();x();var X5=class{constructor(){d(this,"currentAnimation",null);d(this,"isAnimating",!1);d(this,"cancelRequested",!1);d(this,"completionCallbacks",[]);d(this,"currentCancelCallback",null)}async startAnimation(e,t){return this.isAnimating&&await this.cancelCurrentAnimation(),new Promise(r=>{this.isAnimating=!0,this.cancelRequested=!1,this.currentCancelCallback=t??null,this.currentAnimation=e(),this.completionCallbacks.push(()=>{this.isAnimating=!1,this.currentAnimation=null,r()})})}async cancelCurrentAnimation(){if(this.isAnimating){if(this.currentCancelCallback){let e=this.currentCancelCallback;this.currentCancelCallback=null,e()}return new Promise(e=>{this.cancelRequested=!0,this.completionCallbacks.push(()=>{e()})})}}animationCycleFinish(){this.cancelRequested&&this.forceFinish()}forceFinish(e=!0){if(!this.isAnimating)return;if(this.currentAnimation){for(let r of this.currentAnimation.getAll())r.stop();this.currentAnimation.removeAll(),this.currentAnimation=null}this.isAnimating=!1,this.cancelRequested=!1;let t=[...this.completionCallbacks];if(this.completionCallbacks=[],e)for(let r of t)r()}update(){this.currentAnimation&&this.currentAnimation.update()}get isActive(){return this.isAnimating}get shouldCancel(){return this.cancelRequested}};var I8={x:3e3,y:3e3,z:3e3,rotation:Math.PI,scale:1,default:3e3},C0=class{constructor(e,t,r){this.getState=e;this.setState=t;d(this,"animationController",new X5);d(this,"defaultState");d(this,"speeds");d(this,"currentStateName","");d(this,"transitioningToStateName","");this.speeds={...I8},r&&Object.assign(this.speeds,r),this.defaultState=this.getState()}calculateDuration(e){let t=0,r=this.getState();for(let[i,s]of Object.entries(e)){let o=r[i],l=Math.abs(s-o),a=this.getPropertySpeed(i),v=l/a*1e3;t=Math.max(t,v)}return Math.min(Math.max(t,200),2e3)}getPropertySpeed(e){return e in this.speeds?this.speeds[e]:e.toLowerCase().includes("rotation")?this.speeds.rotation:e.toLowerCase().includes("scale")?this.speeds.scale:e.toLowerCase()==="x"||e.toLowerCase()==="y"||e.toLowerCase()==="z"?this.speeds[e]:this.speeds.default}startTransition(e,t,r,i=Fe.Linear.None,s){this.isTransitioning&&this.animationController.forceFinish(!1),this.transitioningToStateName=t??"";let o=this.getState(),l=this.calculateDuration(e);this.animationController.startAnimation(()=>{let a=new q0;return new Ge(o,a).to(e,l).easing(i).onUpdate(v=>{for(let c of Object.keys(v))this.setState(c,v[c])}).onComplete(()=>{this.animationController.forceFinish(),this.currentStateName=this.transitioningToStateName,this.transitioningToStateName="",r?.()}).start(),a},s)}reset(){this.startTransition(this.defaultState)}update(){this.animationController.update()}forceFinish(){this.animationController.forceFinish()}transitionTo(e,t,r,i){this.startTransition(e,t,r,Fe.Linear.None,i)}getCurrentValue(e){return this.getState()[e]}get isTransitioning(){return this.animationController.isActive}};A();E();R();x();import{subscribeKey as H8}from"valtio/utils";function Z5(n,e,t,r,i){let s=0,o,l=async()=>{let a=++s,v=await n(e[t]);a===s?(o&&i?.(o),r(v),o=v):i?.(v)};return l(),H8(e,t,l)}A();E();R();x();var i2=Math.PI/180;function $5(n){let{walkDist:e,prevWalkDist:t,bob:r,prevBob:i,partialTick:s}=n,o=e-t,l=-(e+o*s),a=i+(r-i)*s,v=Math.sin(l*Math.PI),c=Math.cos(l*Math.PI);return{position:{x:v*a*.5,y:-Math.abs(c*a)},rotation:{x:Math.abs(Math.cos(l*Math.PI-.2)*a)*5*i2,z:v*a*3*i2}}}A();E();R();x();var en=n=>({"minecraft:display_context":"firstperson","minecraft:use_duration":n.playerStateReactive.itemUsageTicks,"minecraft:using_item":!!n.playerStateReactive.itemUsageTicks}),L8=()=>({"minecraft:display_context":"firstperson"}),$0=(n,e)=>{if(!e)return"empty";if(e.type==="hand")return"hand";let t=e.name??(e.id!==void 0?`#${e.id}`:"unknown");if(!n.resourcesManager.currentResources)return`${e.type}:${t}`;let r=n.getItemRenderData({...e.fullItem,itemId:e.id},L8());return`${e.type}:${t}:${r.modelName}`};var $e=new He.Matrix4,s2=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function O8(n,e){let t=new He.Matrix4,r=1,i=Math.sqrt(n),s=-.3*Math.sin(i*Math.PI),o=.4*Math.sin(i*2*Math.PI),l=-.4*Math.sin(n*Math.PI);return t.multiply($e.makeTranslation(r*(s+.64),o-.6+e*-.6,l-.72)),t.multiply($e.makeRotationY(r*45*Math.PI/180)),t.multiply($e.makeRotationY(r*Math.sin(i*Math.PI)*70*Math.PI/180)),t.multiply($e.makeRotationZ(r*Math.sin(n*n*Math.PI)*-20*Math.PI/180)),t.multiply($e.makeTranslation(r*-1,3.6,3.5)),t.multiply($e.makeRotationZ(r*120*Math.PI/180)),t.multiply($e.makeRotationX(200*Math.PI/180)),t.multiply($e.makeRotationY(r*-135*Math.PI/180)),t.multiply($e.makeTranslation(r*5.6,0,0)),t.multiply($e.makeTranslation(r*-5/16,2/16,0)),t}function D8(n,e){let t=new He.Matrix4,r=1,i=Math.sqrt(n),s=-.4*Math.sin(i*Math.PI),o=.2*Math.sin(i*2*Math.PI),l=-.2*Math.sin(n*Math.PI);t.multiply($e.makeTranslation(r*s,o,l)),t.multiply($e.makeTranslation(r*.56,-.52+e*-.6,-.72));let a=Math.sin(n*n*Math.PI),v=Math.sin(i*Math.PI);return t.multiply($e.makeRotationY(r*(45+a*-20)*Math.PI/180)),t.multiply($e.makeRotationZ(r*v*-20*Math.PI/180)),t.multiply($e.makeRotationX(v*-80*Math.PI/180)),t.multiply($e.makeRotationY(r*-45*Math.PI/180)),t}var Yr=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;d(this,"holdingBlock");d(this,"blockSwapAnimation");d(this,"cameraGroup",new He.Mesh);d(this,"armTransformGroup",new He.Group);d(this,"camera",new He.PerspectiveCamera(70,1,.05,100));d(this,"equipProgress",0);d(this,"stopUpdate",!1);d(this,"lastHeldItem");d(this,"lastHeldItemRenderKey");d(this,"currentDisplayType","hand");d(this,"isSwinging",!1);d(this,"nextIterStopCallbacks");d(this,"idleAnimator");d(this,"ready",!1);d(this,"lastUpdate",0);d(this,"xBob",0);d(this,"yBob",0);d(this,"lastBobUpdateTime",0);d(this,"lastBobWalkDist",0);d(this,"lastBobTickTime",0);d(this,"playerHand");d(this,"offHandDisplay",!1);d(this,"offHandModeLegacy",!1);d(this,"swingAnimator");d(this,"config");d(this,"disposed",!1);d(this,"unsubs",[]);d(this,"lastItemModelName");d(this,"switchRequest",0);this.initCameraGroup(),this.swingAnimator=new h1,this.unsubs.push(this.worldRenderer.onReactivePlayerStateUpdated("heldItemMain",()=>{this.offHand||this.updateItem()},!1),this.worldRenderer.onReactivePlayerStateUpdated("heldItemOff",()=>{this.offHand&&this.updateItem()},!1)),this.config=e.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||Nr().then(r=>{this.disposed||(this.playerHand=r,this.updateItem())}).then(()=>{if(this.disposed)return;let r=Z5(async()=>Nr(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",i=>{i&&(this.playerHand=i,this.updateItem())},i=>{Me(i,!0)});this.unsubs.push(r)})}dispose(){this.disposed=!0,this.unsubs.forEach(e=>e()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,Me(this.cameraGroup,!0),this.holdingBlock&&this.holdingBlock!==this.playerHand&&Me(this.holdingBlock,!0),this.holdingBlock=void 0,this.playerHand&&(Me(this.playerHand,!0),this.playerHand=void 0),this.ready=!1}updateItem(){if(!this.ready)return;let e=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;e?this.setNewItem(e):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new He.Mesh,this.armTransformGroup=new He.Group,this.armTransformGroup.matrixAutoUpdate=!1,this.cameraGroup.add(this.armTransformGroup)}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(e,t,r,i){if(!this.lastHeldItem)return;let s=performance.now();this.lastUpdate&&s-this.lastUpdate>50&&this.replaceItemModel(this.lastHeldItem),(this.swingAnimator?.isCurrentlySwinging()||this.swingAnimator?.debugParams.animationStage)&&this.swingAnimator?.update(),this.blockSwapAnimation?.switcher.update();let o=new He.Scene;o.add(this.cameraGroup);let l=t.getSize(new He.Vector2),a=l.height>l.width;a?this.camera.aspect!==1&&(this.camera.aspect=1,this.camera.updateProjectionMatrix()):this.camera.aspect!==e.aspect&&(this.camera.aspect=e.aspect,this.camera.updateProjectionMatrix()),this.updateCameraGroup(),o.add(r.clone()),o.add(i.clone());let{offHandDisplay:v}=this;if(v&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),a){let c=Math.min(l.width,l.height);v?t.setViewport(0,0,c,c):t.setViewport(l.width-c,0,c,c)}t.render(o,this.camera),a&&t.setViewport(0,0,l.width,l.height),v&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new C0(()=>({progress:this.equipProgress}),(i,s)=>{i==="progress"&&(this.equipProgress=s)},{progress:4})});let t=e==="disappeared"?1:0,r=!1;return new Promise(i=>{this.blockSwapAnimation.switcher.transitionTo({progress:t},e,()=>{r||i(!0)},()=>{r=!0,i(!1)})})}isDifferentItem(e){return this.lastHeldItemRenderKey!==$0(this.worldRenderer,e)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:e}=this,t=performance.now(),r=this.worldRenderer.cameraShake.getBaseRotation(),i=r.pitch,s=r.yaw;if(this.lastBobUpdateTime===0)this.xBob=i,this.yBob=s;else{let h=Math.min((t-this.lastBobUpdateTime)/1e3,.1),p=1-Math.pow(.5,h*28),m=1-Math.pow(.5,h*36);this.xBob+=(i-this.xBob)*p,this.yBob+=s2(s-this.yBob)*m}this.lastBobUpdateTime=t;let o=(i-this.xBob)*-.05,l=s2(s-this.yBob)*-.035;if(this.cameraGroup.position.copy(e.position),this.cameraGroup.rotation.copy(e.rotation),this.worldRenderer.displayOptions.inWorldRenderingConfig.viewBobbing){let h=this.worldRenderer.playerStateReactive;h.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=t,this.lastBobWalkDist=h.walkDist);let p=Math.min((t-this.lastBobTickTime)/50,1),m=1.8,b=$5({walkDist:h.walkDist*m,prevWalkDist:h.prevWalkDist*m,bob:h.bob,prevBob:h.prevBob,partialTick:p});this.cameraGroup.position.x+=b.position.x,this.cameraGroup.position.y+=b.position.y,this.cameraGroup.rotation.z+=b.rotation.z,this.cameraGroup.rotation.x+=b.rotation.x}this.cameraGroup.rotation.x+=o,this.cameraGroup.rotation.y+=l;let v=this.currentDisplayType,c=this.swingAnimator?.getSwingProgress()??0,u;v==="hand"?u=O8(c,this.equipProgress):u=D8(c,this.equipProgress),this.armTransformGroup.matrix.copy(u),this.armTransformGroup.matrixWorldNeedsUpdate=!0}async createItemModel(e){if(this.lastUpdate=performance.now(),!e||e.type==="hand"&&!this.playerHand)return;let t;if(e.type==="item"||e.type==="block"){let r=this.worldRenderer.entities.getItemMesh({...e.fullItem,itemId:e.id},en(this.worldRenderer),!1,this.lastItemModelName);if(r){let{mesh:i,isBlock:s,modelName:o}=r;s?(t=i,e.type="block"):(t=i,e.type="item"),this.lastItemModelName=o}}else t=this.playerHand;if(t){if(e.type==="item"||e.type==="block"){let r=new He.Group;r.name="displayTransform",e.type==="item"?(r.position.set(1.13/16,3.2/16,1.13/16),r.rotation.set(0,He.MathUtils.degToRad(-90),He.MathUtils.degToRad(25),"XYZ"),r.scale.set(.68,.68,.68)):(r.rotation.set(0,He.MathUtils.degToRad(45),0,"XYZ"),r.scale.set(.4,.4,.4)),r.add(t),t=r}return t.name="holdingBlock",{model:t,type:e.type}}}async replaceItemModel(e){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!e){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.currentDisplayType="hand";let r=this.swingAnimator;r?.stopSwing(),r&&(r.type="hand"),this.idleAnimator=void 0;return}let t=await this.createItemModel(e);t&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=t.model,this.currentDisplayType=t.type,this.armTransformGroup.add(t.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}async setNewItem(e){let t=$0(this.worldRenderer,e),r=this.lastHeldItemRenderKey!==t;if(this.lastHeldItem=e,!r)return;this.lastHeldItemRenderKey=t,this.lastItemModelName=void 0;let i=++this.switchRequest,s=!1;if(this.holdingBlock){if(s=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock.removeFromParent(),this.holdingBlock!==this.playerHand&&Me(this.holdingBlock,!1),this.holdingBlock=void 0}if(!e){this.currentDisplayType="hand";let a=this.swingAnimator;a?.stopSwing(),a&&(a.type="hand"),this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(i!==this.switchRequest)return;let o=await this.createItemModel(e);if(!o||i!==this.switchRequest)return;this.holdingBlock=o.model,this.currentDisplayType=o.type,this.armTransformGroup.add(this.holdingBlock),s&&await this.playBlockSwapAnimation("appeared");let l=this.swingAnimator;l&&(l.type=o.type),this.idleAnimator=void 0}};var h1=class{constructor(){d(this,"animationTimer",0);d(this,"lastTime",0);d(this,"isAnimating",!1);d(this,"stopRequested",!1);d(this,"swingProgress",0);d(this,"type","hand");d(this,"debugParams",{animationTime:250,animationStage:0});d(this,"debugGui");this.debugGui=new Ut("hand_animator",this.debugParams,void 0,{animationStage:{min:0,max:1,step:.01}})}update(){if(!this.isAnimating&&!this.debugParams.animationStage){this.swingProgress=0;return}let e=performance.now(),t=(e-this.lastTime)/1e3;this.lastTime=e,this.animationTimer+=t*1e3;let r=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(r>=1){if(this.stopRequested){this.isAnimating=!1,this.stopRequested=!1,this.animationTimer=0,this.swingProgress=0;return}this.animationTimer=0,this.swingProgress=0;return}this.swingProgress=r}getSwingProgress(){return this.swingProgress}startSwing(){this.stopRequested=!1,!this.isAnimating&&(this.isAnimating=!0,this.animationTimer=0,this.lastTime=performance.now())}stopSwing(){this.isAnimating&&(this.stopRequested=!0)}isCurrentlySwinging(){return this.isAnimating}},o2=(n,e,t,r,i)=>{let s=r.transformModel(e,{name:t,properties:{}});return i1(n,[[s]],void 0,"plains",i)};A();E();R();x();import*as me from"three";import{subscribeKey as Z6}from"valtio/utils";A();E();R();x();import*as Ye from"three";A();E();R();x();import Y1 from"prismarine-nbt";import*as j from"three";A();E();R();x();A();E();R();x();import{BoxGeometry as et,DoubleSide as y1,FrontSide as l2,Group as _t,Mesh as Xe,MeshStandardMaterial as Qr,Vector2 as tn}from"three";function _1(n,e,t,r,i,s,o,l){let a=(P,H,V,z)=>[new tn(P/o,1-z/l),new tn(V/o,1-z/l),new tn(V/o,1-H/l),new tn(P/o,1-H/l)],v=a(e+s,t,e+r+s,t+s),c=a(e+r+s,t,e+r*2+s,t+s),u=a(e,t+s,e+s,t+s+i),h=a(e+s,t+s,e+r+s,t+s+i),p=a(e+r+s,t+s,e+r+s*2,t+i+s),m=a(e+r+s*2,t+s,e+r*2+s*2,t+i+s),b=n.attributes.uv,k=[p[3],p[2],p[0],p[1]],_=[u[3],u[2],u[0],u[1]],y=[v[3],v[2],v[0],v[1]],M=[c[0],c[1],c[3],c[2]],T=[h[3],h[2],h[0],h[1]],S=[m[3],m[2],m[0],m[1]],B=[];for(let P of[k,_,y,M,T,S])for(let H of P)B.push(H.x,H.y);b.set(new Float32Array(B)),b.needsUpdate=!0}function yt(n,e,t,r,i,s){_1(n,e,t,r,i,s,64,64)}function f1(n,e,t,r,i,s){_1(n,e,t,r,i,s,64,32)}var Vt=class extends _t{constructor(e,t){super(),Object.defineProperty(this,"innerLayer",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"outerLayer",{enumerable:!0,configurable:!0,writable:!0,value:t}),e.name="inner",t.name="outer"}},m1=class extends _t{constructor(){super(),Object.defineProperty(this,"head",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rightArm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"leftArm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rightLeg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"leftLeg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modelListeners",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slim",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"layer1Material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"layer1MaterialBiased",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"layer2Material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"layer2MaterialBiased",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.layer1Material=new Qr({side:l2}),this.layer2Material=new Qr({side:y1,transparent:!0,alphaTest:1e-5}),this.layer1MaterialBiased=this.layer1Material.clone(),this.layer1MaterialBiased.polygonOffset=!0,this.layer1MaterialBiased.polygonOffsetFactor=1,this.layer1MaterialBiased.polygonOffsetUnits=1,this.layer2MaterialBiased=this.layer2Material.clone(),this.layer2MaterialBiased.polygonOffset=!0,this.layer2MaterialBiased.polygonOffsetFactor=1,this.layer2MaterialBiased.polygonOffsetUnits=1;let e=new et(8,8,8);yt(e,0,0,8,8,8);let t=new Xe(e,this.layer1Material),r=new et(9,9,9);yt(r,32,0,8,8,8);let i=new Xe(r,this.layer2Material);this.head=new Vt(t,i),this.head.name="head",this.head.add(t,i),t.position.y=4,i.position.y=4,this.add(this.head);let s=new et(8,12,4);yt(s,16,16,8,12,4);let o=new Xe(s,this.layer1Material),l=new et(8.5,12.5,4.5);yt(l,16,32,8,12,4);let a=new Xe(l,this.layer2Material);this.body=new Vt(o,a),this.body.name="body",this.body.add(o,a),this.body.position.y=-6,this.add(this.body);let v=new et,c=new Xe(v,this.layer1MaterialBiased);this.modelListeners.push(()=>{c.scale.x=this.slim?3:4,c.scale.y=12,c.scale.z=4,yt(v,40,16,this.slim?3:4,12,4)});let u=new et,h=new Xe(u,this.layer2MaterialBiased);this.modelListeners.push(()=>{h.scale.x=this.slim?3.5:4.5,h.scale.y=12.5,h.scale.z=4.5,yt(u,40,32,this.slim?3:4,12,4)});let p=new _t;p.add(c,h),this.modelListeners.push(()=>{p.position.x=this.slim?-.5:-1}),p.position.y=-4,this.rightArm=new Vt(c,h),this.rightArm.name="rightArm",this.rightArm.add(p),this.rightArm.position.x=-5,this.rightArm.position.y=-2,this.add(this.rightArm);let m=new et,b=new Xe(m,this.layer1MaterialBiased);this.modelListeners.push(()=>{b.scale.x=this.slim?3:4,b.scale.y=12,b.scale.z=4,yt(m,32,48,this.slim?3:4,12,4)});let k=new et,_=new Xe(k,this.layer2MaterialBiased);this.modelListeners.push(()=>{_.scale.x=this.slim?3.5:4.5,_.scale.y=12.5,_.scale.z=4.5,yt(k,48,48,this.slim?3:4,12,4)});let y=new _t;y.add(b,_),this.modelListeners.push(()=>{y.position.x=this.slim?.5:1}),y.position.y=-4,this.leftArm=new Vt(b,_),this.leftArm.name="leftArm",this.leftArm.add(y),this.leftArm.position.x=5,this.leftArm.position.y=-2,this.add(this.leftArm);let M=new et(4,12,4);yt(M,0,16,4,12,4);let T=new Xe(M,this.layer1MaterialBiased),S=new et(4.5,12.5,4.5);yt(S,0,32,4,12,4);let B=new Xe(S,this.layer2MaterialBiased),P=new _t;P.add(T,B),P.position.y=-6,this.rightLeg=new Vt(T,B),this.rightLeg.name="rightLeg",this.rightLeg.add(P),this.rightLeg.position.x=-1.9,this.rightLeg.position.y=-12,this.rightLeg.position.z=-.1,this.add(this.rightLeg);let H=new et(4,12,4);yt(H,16,48,4,12,4);let V=new Xe(H,this.layer1MaterialBiased),z=new et(4.5,12.5,4.5);yt(z,0,48,4,12,4);let N=new Xe(z,this.layer2MaterialBiased),Y=new _t;Y.add(V,N),Y.position.y=-6,this.leftLeg=new Vt(V,N),this.leftLeg.name="leftLeg",this.leftLeg.add(Y),this.leftLeg.position.x=1.9,this.leftLeg.position.y=-12,this.leftLeg.position.z=-.1,this.add(this.leftLeg),this.modelType="default"}get map(){return this._map}set map(e){this._map=e,this.layer1Material.map=e,this.layer1Material.needsUpdate=!0,this.layer1MaterialBiased.map=e,this.layer1MaterialBiased.needsUpdate=!0,this.layer2Material.map=e,this.layer2Material.needsUpdate=!0,this.layer2MaterialBiased.map=e,this.layer2MaterialBiased.needsUpdate=!0}get modelType(){return this.slim?"slim":"default"}set modelType(e){this.slim=e==="slim",this.modelListeners.forEach(t=>t())}getBodyParts(){return this.children.filter(e=>e instanceof Vt)}setInnerLayerVisible(e){this.getBodyParts().forEach(t=>t.innerLayer.visible=e)}setOuterLayerVisible(e){this.getBodyParts().forEach(t=>t.outerLayer.visible=e)}resetJoints(){this.head.rotation.set(0,0,0),this.leftArm.rotation.set(0,0,0),this.rightArm.rotation.set(0,0,0),this.leftLeg.rotation.set(0,0,0),this.rightLeg.rotation.set(0,0,0),this.body.rotation.set(0,0,0),this.head.position.y=0,this.body.position.y=-6,this.body.position.z=0,this.rightArm.position.x=-5,this.rightArm.position.y=-2,this.rightArm.position.z=0,this.leftArm.position.x=5,this.leftArm.position.y=-2,this.leftArm.position.z=0,this.rightLeg.position.x=-1.9,this.rightLeg.position.y=-12,this.rightLeg.position.z=-.1,this.leftLeg.position.x=1.9,this.leftLeg.position.y=-12,this.leftLeg.position.z=-.1}},p1=class extends _t{constructor(){super(),Object.defineProperty(this,"cape",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.material=new Qr({side:y1,transparent:!0,alphaTest:1e-5});let e=new et(10,16,1);f1(e,0,0,10,16,1),this.cape=new Xe(e,this.material),this.cape.position.y=-8,this.cape.position.z=.5,this.add(this.cape)}get map(){return this.material.map}set map(e){this.material.map=e,this.material.needsUpdate=!0}},g1=class extends _t{constructor(){super(),Object.defineProperty(this,"leftWing",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rightWing",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.material=new Qr({side:y1,transparent:!0,alphaTest:1e-5});let e=new et(12,22,4);f1(e,22,0,10,20,2);let t=new Xe(e,this.material);t.position.x=-5,t.position.y=-10,t.position.z=-1,this.leftWing=new _t,this.leftWing.add(t),this.add(this.leftWing);let r=new et(12,22,4);f1(r,22,0,10,20,2);let i=new Xe(r,this.material);i.scale.x=-1,i.position.x=5,i.position.y=-10,i.position.z=-1,this.rightWing=new _t,this.rightWing.add(i),this.add(this.rightWing),this.leftWing.position.x=5,this.leftWing.rotation.x=.2617994,this.resetJoints()}resetJoints(){this.leftWing.rotation.y=.01,this.leftWing.rotation.z=.2617994,this.updateRightWing()}updateRightWing(){this.rightWing.position.x=-this.leftWing.position.x,this.rightWing.position.y=this.leftWing.position.y,this.rightWing.rotation.x=this.leftWing.rotation.x,this.rightWing.rotation.y=-this.leftWing.rotation.y,this.rightWing.rotation.z=-this.leftWing.rotation.z}get map(){return this.material.map}set map(e){this.material.map=e,this.material.needsUpdate=!0}},b1=class extends _t{constructor(){super(),Object.defineProperty(this,"rightEar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"leftEar",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"material",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.material=new Qr({side:l2});let e=new et(8,8,4/3);_1(e,0,0,6,6,1,14,7),this.rightEar=new Xe(e,this.material),this.rightEar.name="rightEar",this.rightEar.position.x=-6,this.add(this.rightEar),this.leftEar=new Xe(e,this.material),this.leftEar.name="leftEar",this.leftEar.position.x=6,this.add(this.leftEar)}get map(){return this.material.map}set map(e){this.material.map=e,this.material.needsUpdate=!0}},a2=10.8*Math.PI/180,er=class extends _t{constructor(){super(),Object.defineProperty(this,"skin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cape",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"elytra",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ears",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.skin=new m1,this.skin.name="skin",this.skin.position.y=8,this.add(this.skin),this.cape=new p1,this.cape.name="cape",this.cape.position.y=8,this.cape.position.z=-2,this.cape.rotation.x=a2,this.cape.rotation.y=Math.PI,this.add(this.cape),this.elytra=new g1,this.elytra.name="elytra",this.elytra.position.y=8,this.elytra.position.z=-2,this.elytra.visible=!1,this.add(this.elytra),this.ears=new b1,this.ears.name="ears",this.ears.position.y=10,this.ears.position.z=2/3,this.ears.visible=!1,this.skin.head.add(this.ears)}get backEquipment(){return this.cape.visible?"cape":this.elytra.visible?"elytra":null}set backEquipment(e){this.cape.visible=e==="cape",this.elytra.visible=e==="elytra"}resetJoints(){this.skin.resetJoints(),this.cape.rotation.x=a2,this.cape.position.y=8,this.cape.position.z=-2,this.elytra.position.y=8,this.elytra.position.z=-2,this.elytra.rotation.x=0,this.elytra.resetJoints()}};A();E();R();x();import{Color as cA,PointLight as dA,EquirectangularReflectionMapping as uA,Group as hA,NearestFilter as fA,PerspectiveCamera as mA,Scene as pA,Texture as gA,Vector2 as bA,WebGLRenderer as yA,AmbientLight as _A,CanvasTexture as wA,WebGLRenderTarget as AA,FloatType as EA,DepthTexture as xA,Clock as RA,Object3D as kA,ColorManagement as SA}from"three";import{OrbitControls as MA}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as BA}from"three/examples/jsm/postprocessing/EffectComposer.js";import"three/examples/jsm/postprocessing/Pass.js";import{RenderPass as LA}from"three/examples/jsm/postprocessing/RenderPass.js";import{ShaderPass as DA}from"three/examples/jsm/postprocessing/ShaderPass.js";import{FXAAShader as zA}from"three/examples/jsm/shaders/FXAAShader.js";A();E();R();x();var rn=class{constructor(){Object.defineProperty(this,"speed",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"progress",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"currentId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"progress0",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"animationObjects",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}update(e,t){if(this.paused)return;let r=t*this.speed;this.animate(e,r),this.animationObjects.forEach((i,s)=>{let o=this.progress0.get(s);i(e,this.progress-o,s)}),this.progress+=r}addAnimation(e){let t=this.currentId++;return this.progress0.set(t,this.progress),this.animationObjects.set(t,e),t}removeAnimation(e){e!=null&&(this.animationObjects.delete(e),this.progress0.delete(e))}};A();E();R();x();import{CanvasTexture as qw,NearestFilter as Jw,Sprite as Xw,SpriteMaterial as Zw}from"three";A();E();R();x();var F8=Object.defineProperty,z8=(n,e,t)=>e in n?F8(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ee=(n,e,t)=>(z8(n,typeof e!="symbol"?e+"":e,t),t);function w1(n){let e=[n];if(n.extra&&n.extra.length!==0)for(let t of n.extra)e.push(...w1(t));return e}var $=class{constructor(n,e,t,r,i,s){this.key=n,this.value=e,this.name=t,this.code=r,this.cssForeground=i,this.cssBackground=s}applyToStyle(n){n[this.key]=this.value}matchStyle(n){return n[this.key]===this.value}static fromCode(n){let t="0123456789abcdefklmnor".indexOf(n);if(t)return this.list[t]}toString(){return`${$.CONTROL_STRING}${this.code}`}},xe=$;Ee(xe,"CONTROL_STRING","\xA7");Ee(xe,"BLACK",new $("color","black","BLACK","0",{color:"#000000"},{color:"#000000"}));Ee(xe,"DARK_BLUE",new $("color","dark_blue","DARK_BLUE","1",{color:"#0000AA"},{color:"#00002A"}));Ee(xe,"DARK_GREEN",new $("color","dark_green","DARK_GREEN","2",{color:"#00AA00"},{color:"#002A00"}));Ee(xe,"DARK_AQUA",new $("color","dark_aqua","DARK_AQUA","3",{color:"#00AAAA"},{color:"#002A2A"}));Ee(xe,"DARK_RED",new $("color","dark_red","DARK_RED","4",{color:"#AA0000"},{color:"#2A0000"}));Ee(xe,"DARK_PURPLE",new $("color","dark_purple","DARK_PURPLE","5",{color:"#AA00AA"},{color:"#2A002A"}));Ee(xe,"GOLD",new $("color","gold","GOLD","6",{color:"#FFAA00"},{color:"#2A2A00"}));Ee(xe,"GRAY",new $("color","gray","GRAY","7",{color:"#AAAAAA"},{color:"#2A2A2A"}));Ee(xe,"DARK_GRAY",new $("color","dark_gray","DARK_GRAY","8",{color:"#555555"},{color:"#151515"}));Ee(xe,"BLUE",new $("color","blue","BLUE","9",{color:"#5555FF"},{color:"#15153F"}));Ee(xe,"GREEN",new $("color","green","GREEN","a",{color:"#55FF55"},{color:"#153F15"}));Ee(xe,"AQUA",new $("color","aqua","AQUA","b",{color:"#55FFFF"},{color:"#153F3F"}));Ee(xe,"RED",new $("color","red","RED","c",{color:"#FF5555"},{color:"#3F1515"}));Ee(xe,"LIGHT_PURPLE",new $("color","light_purple","LIGHT_PURPLE","d",{color:"#FF55FF"},{color:"#3F153F"}));Ee(xe,"YELLOW",new $("color","yellow","YELLOW","e",{color:"#FFFF55"},{color:"#3F3F15"}));Ee(xe,"WHITE",new $("color","white","WHITE","f",{color:"#FFFFFF"},{color:"#3F3F3F"}));Ee(xe,"OBFUSCATED",new $("obfuscated",!0,"OBFUSCATED","k",{}));Ee(xe,"BOLD",new $("bold",!0,"BOLD","l",{"font-weight":"bold"}));Ee(xe,"STRIKETHROUGH",new $("strikethrough",!0,"STRIKETHROUGH","m",{"text-decoration":"line-through"}));Ee(xe,"UNDERLINE",new $("underlined",!0,"UNDERLINE","n",{"text-decoration":"underline"}));Ee(xe,"ITALIC",new $("italic",!0,"ITALIC","o",{"font-style":"italic"}));Ee(xe,"RESET",{name:"RESET",code:"r",applyToStyle(n){n.bold=!1,n.strikethrough=!1,n.underlined=!1,n.italic=!1,n.obfuscated=!1,n.color=void 0},matchStyle(n){return!1},cssBackground:{},cssForeground:{},toString(){return`${$.CONTROL_STRING}r`}});Ee(xe,"list",[$.BLACK,$.DARK_BLUE,$.DARK_GREEN,$.DARK_AQUA,$.DARK_RED,$.DARK_PURPLE,$.GOLD,$.GRAY,$.DARK_GRAY,$.BLUE,$.GREEN,$.AQUA,$.RED,$.LIGHT_PURPLE,$.YELLOW,$.WHITE,$.OBFUSCATED,$.BOLD,$.STRIKETHROUGH,$.UNDERLINE,$.ITALIC,$.RESET]);var n5=xr(A1(),1);k1();var Q6=xr(I2(),1);import K6 from"prismarine-chat";A();E();R();x();var x4=(n,e)=>{try{return JSON.parse(n)}catch{return null}},R4={black:"#000000",dark_blue:"#0000AA",dark_green:"#00AA00",dark_aqua:"#00AAAA",dark_red:"#AA0000",dark_purple:"#AA00AA",gold:"#FFAA00",gray:"#AAAAAA",dark_gray:"#555555",blue:"#5555FF",green:"#55FF55",aqua:"#55FFFF",red:"#FF5555",light_purple:"#FF55FF",yellow:"#FFFF55",white:"#FFFFFF"},H2=(n,e,t,r=s=>{},i=(s,o)=>Ne(s,o))=>{let l=[16,9],a=l[0]-l[1],v=a/16,c="front_text"in n?n.front_text.messages:[n.Text1,n.Text2,n.Text3,n.Text4];if(!c.some(m=>m!=="null"))return;let u=i(16*40,a*40),h=u.getContext("2d");r(h);let p=("front_text"in n?n.front_text.color:n.Color)||"black";for(let[m,b]of c.slice(0,4).entries())b!=="null"&&S1(b,t,u,64,p,64*(m+1)+(e?0:-8));return u},S1=(n,e,t,r,i,s=0)=>{let o=!1,l=typeof n=="string"&&(n?.startsWith("{")||n?.startsWith('"'))?x4(n??'""',"sign text"):n;if(!l||typeof l!="object"&&typeof l!="string")return;let a=t.getContext("2d");if(!a)throw new Error("Could not get 2d context");a.imageSmoothingEnabled=!1,a.font=`${r}px mojangles`;let v=new e(l),c=[],u=!1,h="",p=s,m=[],b=(M,T)=>{M.text!==null&&M.text!==void 0&&M.text;let S=M.text===null||M.text===void 0?void 0:String(M.text),B={color:M.color??T?.color,underlined:M.underlined??T?.underlined,strikethrough:M.strikethrough??T?.strikethrough,bold:M.bold??T?.bold,italic:M.italic??T?.italic};if(u=u||B.underlined||B.strikethrough||!1,S?.includes(`
762
762
  `))for(let P of S.split(`
763
- `))k(P,B),p+=r,h="";else S&&k(S,B);if(M.extra)for(let P of M.extra)b(P,B)},k=(M,T)=>{o||(o=M.trim()!==""),h+=M,m[p]=a.measureText(h).width;let S=T.color??i;S.startsWith("#")||(S=_4[S.toLowerCase()]||S),c.push({fontStyle:`${T.bold?"bold":""} ${T.italic?"italic":""}`,fillStyle:S,underlineStyle:T.underlined??!1,strikeStyle:T.strikethrough??!1,offset:p,text:M})};if(b(v),!u&&!v.toString().trim())return;let _=0,y=0;for(let{fillStyle:M,fontStyle:T,underlineStyle:S,strikeStyle:B,offset:P,text:H}of c){y!==P&&(_=0),y=P,a.fillStyle=M,a.textRendering="optimizeLegibility",a.font=`${T} ${r}px mojangles`;let V=m[P]??a.measureText(H).width,z=(t.width-V)/2+_;a.fillText(H,z,P),B&&(a.lineWidth=r/8,a.strokeStyle=M,a.beginPath(),a.moveTo(z,P-a.lineWidth*2.5),a.lineTo(z+a.measureText(H).width,P-a.lineWidth*2.5),a.stroke()),S&&(a.lineWidth=r/8,a.strokeStyle=M,a.beginPath(),a.moveTo(z,P+a.lineWidth),a.lineTo(z+a.measureText(H).width,P+a.lineWidth),a.stroke()),_+=a.measureText(H).width}return o};A();E();R();x();import*as T1 from"three";A();E();R();x();var w4=n=>Math.max(0,Math.min(1,n)),A4=(n,e,t)=>n+(e-n)*t;function E4(n){let e=n?.elytra;if(!e)return;if(typeof e.updateRightWing=="function"){e.updateRightWing();return}if(typeof e.updateRightWingRotation=="function"){e.updateRightWingRotation();return}let t=e.leftWing,r=e.rightWing;!t?.rotation||!r?.rotation||typeof r.rotation.copy=="function"&&(r.rotation.copy(t.rotation),r.rotation.z*=-1)}var Zr=class extends rn{constructor(){super(...arguments);d(this,"switchAnimationCallback");d(this,"isRunning",!1);d(this,"isMoving",!0);d(this,"isCrouched",!1);d(this,"isRiding",!1);d(this,"_dt",0);d(this,"_phase",0);d(this,"_moveBlend",0);d(this,"_swingTime",null);d(this,"_swingDuration",.25);d(this,"_defaults",null)}update(t,r){this._dt=r,super.update(t,r)}swingArm(){(this._swingTime===null||this._swingTime>=this._swingDuration/2)&&(this._swingTime=0)}_captureDefaults(t){this._defaults={bodyPos:t.skin.body.position.clone(),bodyRot:t.skin.body.rotation.clone(),leftArmPos:t.skin.leftArm.position.clone(),leftArmRot:t.skin.leftArm.rotation.clone(),rightArmPos:t.skin.rightArm.position.clone(),rightArmRot:t.skin.rightArm.rotation.clone(),leftLegPos:t.skin.leftLeg.position.clone(),leftLegRot:t.skin.leftLeg.rotation.clone(),rightLegPos:t.skin.rightLeg.position.clone(),rightLegRot:t.skin.rightLeg.rotation.clone(),headPos:t.skin.head.position.clone(),headRot:t.skin.head.rotation.clone(),capePos:t.cape.position.clone(),capeRot:t.cape.rotation.clone(),elytraPos:t.elytra.position.clone(),elytraRot:t.elytra.rotation.clone()}}_applyDefaults(t){let r=this._defaults;r&&(t.skin.body.position.copy(r.bodyPos),t.skin.body.rotation.copy(r.bodyRot),t.skin.leftArm.position.copy(r.leftArmPos),t.skin.leftArm.rotation.copy(r.leftArmRot),t.skin.rightArm.position.copy(r.rightArmPos),t.skin.rightArm.rotation.copy(r.rightArmRot),t.skin.leftLeg.position.copy(r.leftLegPos),t.skin.leftLeg.rotation.copy(r.leftLegRot),t.skin.rightLeg.position.copy(r.rightLegPos),t.skin.rightLeg.rotation.copy(r.rightLegRot),t.skin.head.position.copy(r.headPos),t.skin.head.rotation.copy(r.headRot),t.cape.position.copy(r.capePos),t.cape.rotation.copy(r.capeRot),t.elytra.position.copy(r.elytraPos),t.elytra.rotation.copy(r.elytraRot))}animate(t){let r=this._dt||0;this._defaults||this._captureDefaults(t),this._applyDefaults(t);let i=this.isRiding?0:this.isMoving?1:0,s=Math.min(1,r*20);this._moveBlend+=(i-this._moveBlend)*s;let o=this.isRunning?10:8;this._phase+=r*o*this._moveBlend;let l=this._phase+(this.isRunning?Math.PI*.5:0),a=!1;if(R4(t,this.isCrouched?1:0),this.isRiding)t.skin.rightArm.rotation.x-=Math.PI/5,t.skin.leftArm.rotation.x-=Math.PI/5,t.skin.rightLeg.rotation.set(-1.4137167,-Math.PI/10,-Math.PI/40,"ZYX"),t.skin.leftLeg.rotation.set(-1.4137167,Math.PI/10,Math.PI/40,"ZYX");else{let v=this.isRunning?Math.cos(l):Math.sin(l);if(Math.abs(v)<.02&&this.switchAnimationCallback&&(a=!0),this.isRunning?(t.skin.leftLeg.rotation.x+=Math.cos(l+Math.PI)*1.3*this._moveBlend,t.skin.rightLeg.rotation.x+=Math.cos(l)*1.3*this._moveBlend):(t.skin.leftLeg.rotation.x+=Math.sin(l)*.5*this._moveBlend,t.skin.rightLeg.rotation.x+=Math.sin(l+Math.PI)*.5*this._moveBlend),this.isRunning){t.skin.leftArm.rotation.x+=Math.cos(l)*1.5*this._moveBlend,t.skin.rightArm.rotation.x+=Math.cos(l+Math.PI)*1.5*this._moveBlend;let c=Math.PI*.1;t.skin.leftArm.rotation.z+=(Math.cos(l)*.1+c)*this._moveBlend,t.skin.rightArm.rotation.z+=(Math.cos(l+Math.PI)*.1-c)*this._moveBlend}else{t.skin.leftArm.rotation.x+=Math.sin(l+Math.PI)*.5*this._moveBlend,t.skin.rightArm.rotation.x+=Math.sin(l)*.5*this._moveBlend;let c=Math.PI*.02;t.skin.leftArm.rotation.z+=(Math.cos(l)*.03+c)*this._moveBlend,t.skin.rightArm.rotation.z+=(Math.cos(l+Math.PI)*.03-c)*this._moveBlend}}if(this._swingTime!==null){this._swingTime+=r;let v=Math.min(this._swingTime/this._swingDuration,1);x4.animate(v,t,this.isMoving),v>=1&&(this._swingTime=null)}if(this.isRunning&&(t.rotation.z=Math.cos(l+Math.PI)*.01*this._moveBlend),this.isRunning){let v=Math.PI*.3;t.cape.rotation.x+=(Math.sin(l*2)*.1+v)*this._moveBlend}else{let v=Math.PI*.06;t.cape.rotation.x+=(Math.sin(l/1.5)*.06+v)*this._moveBlend}if(a){let v=this.switchAnimationCallback;this.switchAnimationCallback=null,v?.()}}},x4={animate(n,e,t){if(!e?.skin?.rightArm?.rotation)return;let r=Math.sin(n*Math.PI);if(e.skin.rightArm.rotation.x=-.4537860552*2-2*r*.3,!t){let i=.01*Math.PI+.06;e.skin.rightArm.rotation.z=-r*.403+i,e.skin.body.rotation.y=-r*.06,e.skin.leftArm.rotation.x=-r*.077,e.skin.leftArm.rotation.z=-r*.015+.13-.05,e.skin.leftArm.position.z=r*.3,e.skin.leftArm.position.x=5-r*.05}}};function R4(n,e){let t=n?.skin,r=n?.cape,i=n?.elytra;if(!t||!r)return;let s=w4(e),o=Math.abs(Math.sin(s*Math.PI/2));if(o<=1e-6)return;t.body.rotation.x+=.4537860552*o,t.body.position.z+=(1.3256181-3.4500310377)*o,t.body.position.y+=-2.103677462*o,r.position.y+=-1.851236166577372*o,r.rotation.x+=.294220265771*o,r.position.z+=(3.786619432-3.4500310377)*o,i?.position&&i.position.copy(r.position),i?.rotation&&i.rotation.copy(r.rotation),i?.rotation&&(i.rotation.x-=10.8*Math.PI/180),i?.leftWing?.rotation&&(i.leftWing.rotation.z=A4(.72,.26179944+.4582006,o)),E4(n),t.head.position.y+=-3.618325234674*o;let l=.1*o,a=(3.618325234674-3.4500310377)*o,v=-2.53943318*o;t.leftArm.position.z+=a,t.rightArm.position.z+=a,t.leftArm.rotation.x+=.410367746202*o,t.rightArm.rotation.x+=.410367746202*o,t.leftArm.rotation.z+=l,t.rightArm.rotation.z+=-l,t.leftArm.position.y+=v,t.rightArm.position.y+=v,t.rightLeg.position.z+=-3.4500310377*o,t.leftLeg.position.z+=-3.4500310377*o}var k4=-2e-4;function S4(n){n.uniforms.uLogDepthBias={value:k4},n.fragmentShader=n.fragmentShader.replace("#include <logdepthbuf_pars_fragment>",`#include <logdepthbuf_pars_fragment>
763
+ `))k(P,B),p+=r,h="";else S&&k(S,B);if(M.extra)for(let P of M.extra)b(P,B)},k=(M,T)=>{o||(o=M.trim()!==""),h+=M,m[p]=a.measureText(h).width;let S=T.color??i;S.startsWith("#")||(S=R4[S.toLowerCase()]||S),c.push({fontStyle:`${T.bold?"bold":""} ${T.italic?"italic":""}`,fillStyle:S,underlineStyle:T.underlined??!1,strikeStyle:T.strikethrough??!1,offset:p,text:M})};if(b(v),!u&&!v.toString().trim())return;let _=0,y=0;for(let{fillStyle:M,fontStyle:T,underlineStyle:S,strikeStyle:B,offset:P,text:H}of c){y!==P&&(_=0),y=P,a.fillStyle=M,a.textRendering="optimizeLegibility",a.font=`${T} ${r}px mojangles`;let V=m[P]??a.measureText(H).width,z=(t.width-V)/2+_;a.fillText(H,z,P),B&&(a.lineWidth=r/8,a.strokeStyle=M,a.beginPath(),a.moveTo(z,P-a.lineWidth*2.5),a.lineTo(z+a.measureText(H).width,P-a.lineWidth*2.5),a.stroke()),S&&(a.lineWidth=r/8,a.strokeStyle=M,a.beginPath(),a.moveTo(z,P+a.lineWidth),a.lineTo(z+a.measureText(H).width,P+a.lineWidth),a.stroke()),_+=a.measureText(H).width}return o};A();E();R();x();import*as T1 from"three";A();E();R();x();var k4=n=>Math.max(0,Math.min(1,n)),S4=(n,e,t)=>n+(e-n)*t;function T4(n){let e=n?.elytra;if(!e)return;if(typeof e.updateRightWing=="function"){e.updateRightWing();return}if(typeof e.updateRightWingRotation=="function"){e.updateRightWingRotation();return}let t=e.leftWing,r=e.rightWing;!t?.rotation||!r?.rotation||typeof r.rotation.copy=="function"&&(r.rotation.copy(t.rotation),r.rotation.z*=-1)}var Zr=class extends rn{constructor(){super(...arguments);d(this,"switchAnimationCallback");d(this,"isRunning",!1);d(this,"isMoving",!0);d(this,"isCrouched",!1);d(this,"isRiding",!1);d(this,"_dt",0);d(this,"_phase",0);d(this,"_moveBlend",0);d(this,"_swingTime",null);d(this,"_swingDuration",.25);d(this,"_defaults",null)}update(t,r){this._dt=r,super.update(t,r)}swingArm(){(this._swingTime===null||this._swingTime>=this._swingDuration/2)&&(this._swingTime=0)}_captureDefaults(t){this._defaults={bodyPos:t.skin.body.position.clone(),bodyRot:t.skin.body.rotation.clone(),leftArmPos:t.skin.leftArm.position.clone(),leftArmRot:t.skin.leftArm.rotation.clone(),rightArmPos:t.skin.rightArm.position.clone(),rightArmRot:t.skin.rightArm.rotation.clone(),leftLegPos:t.skin.leftLeg.position.clone(),leftLegRot:t.skin.leftLeg.rotation.clone(),rightLegPos:t.skin.rightLeg.position.clone(),rightLegRot:t.skin.rightLeg.rotation.clone(),headPos:t.skin.head.position.clone(),headRot:t.skin.head.rotation.clone(),capePos:t.cape.position.clone(),capeRot:t.cape.rotation.clone(),elytraPos:t.elytra.position.clone(),elytraRot:t.elytra.rotation.clone()}}_applyDefaults(t){let r=this._defaults;r&&(t.skin.body.position.copy(r.bodyPos),t.skin.body.rotation.copy(r.bodyRot),t.skin.leftArm.position.copy(r.leftArmPos),t.skin.leftArm.rotation.copy(r.leftArmRot),t.skin.rightArm.position.copy(r.rightArmPos),t.skin.rightArm.rotation.copy(r.rightArmRot),t.skin.leftLeg.position.copy(r.leftLegPos),t.skin.leftLeg.rotation.copy(r.leftLegRot),t.skin.rightLeg.position.copy(r.rightLegPos),t.skin.rightLeg.rotation.copy(r.rightLegRot),t.skin.head.position.copy(r.headPos),t.skin.head.rotation.copy(r.headRot),t.cape.position.copy(r.capePos),t.cape.rotation.copy(r.capeRot),t.elytra.position.copy(r.elytraPos),t.elytra.rotation.copy(r.elytraRot))}animate(t){let r=this._dt||0;this._defaults||this._captureDefaults(t),this._applyDefaults(t);let i=this.isRiding?0:this.isMoving?1:0,s=Math.min(1,r*20);this._moveBlend+=(i-this._moveBlend)*s;let o=this.isRunning?10:8;this._phase+=r*o*this._moveBlend;let l=this._phase+(this.isRunning?Math.PI*.5:0),a=!1;if(C4(t,this.isCrouched?1:0),this.isRiding)t.skin.rightArm.rotation.x-=Math.PI/5,t.skin.leftArm.rotation.x-=Math.PI/5,t.skin.rightLeg.rotation.set(-1.4137167,-Math.PI/10,-Math.PI/40,"ZYX"),t.skin.leftLeg.rotation.set(-1.4137167,Math.PI/10,Math.PI/40,"ZYX");else{let v=this.isRunning?Math.cos(l):Math.sin(l);if(Math.abs(v)<.02&&this.switchAnimationCallback&&(a=!0),this.isRunning?(t.skin.leftLeg.rotation.x+=Math.cos(l+Math.PI)*1.3*this._moveBlend,t.skin.rightLeg.rotation.x+=Math.cos(l)*1.3*this._moveBlend):(t.skin.leftLeg.rotation.x+=Math.sin(l)*.5*this._moveBlend,t.skin.rightLeg.rotation.x+=Math.sin(l+Math.PI)*.5*this._moveBlend),this.isRunning){t.skin.leftArm.rotation.x+=Math.cos(l)*1.5*this._moveBlend,t.skin.rightArm.rotation.x+=Math.cos(l+Math.PI)*1.5*this._moveBlend;let c=Math.PI*.1;t.skin.leftArm.rotation.z+=(Math.cos(l)*.1+c)*this._moveBlend,t.skin.rightArm.rotation.z+=(Math.cos(l+Math.PI)*.1-c)*this._moveBlend}else{t.skin.leftArm.rotation.x+=Math.sin(l+Math.PI)*.5*this._moveBlend,t.skin.rightArm.rotation.x+=Math.sin(l)*.5*this._moveBlend;let c=Math.PI*.02;t.skin.leftArm.rotation.z+=(Math.cos(l)*.03+c)*this._moveBlend,t.skin.rightArm.rotation.z+=(Math.cos(l+Math.PI)*.03-c)*this._moveBlend}}if(this._swingTime!==null){this._swingTime+=r;let v=Math.min(this._swingTime/this._swingDuration,1);M4.animate(v,t,this.isMoving),v>=1&&(this._swingTime=null)}if(this.isRunning&&(t.rotation.z=Math.cos(l+Math.PI)*.01*this._moveBlend),this.isRunning){let v=Math.PI*.3;t.cape.rotation.x+=(Math.sin(l*2)*.1+v)*this._moveBlend}else{let v=Math.PI*.06;t.cape.rotation.x+=(Math.sin(l/1.5)*.06+v)*this._moveBlend}if(a){let v=this.switchAnimationCallback;this.switchAnimationCallback=null,v?.()}}},M4={animate(n,e,t){if(!e?.skin?.rightArm?.rotation)return;let r=Math.sin(n*Math.PI);if(e.skin.rightArm.rotation.x=-.4537860552*2-2*r*.3,!t){let i=.01*Math.PI+.06;e.skin.rightArm.rotation.z=-r*.403+i,e.skin.body.rotation.y=-r*.06,e.skin.leftArm.rotation.x=-r*.077,e.skin.leftArm.rotation.z=-r*.015+.13-.05,e.skin.leftArm.position.z=r*.3,e.skin.leftArm.position.x=5-r*.05}}};function C4(n,e){let t=n?.skin,r=n?.cape,i=n?.elytra;if(!t||!r)return;let s=k4(e),o=Math.abs(Math.sin(s*Math.PI/2));if(o<=1e-6)return;t.body.rotation.x+=.4537860552*o,t.body.position.z+=(1.3256181-3.4500310377)*o,t.body.position.y+=-2.103677462*o,r.position.y+=-1.851236166577372*o,r.rotation.x+=.294220265771*o,r.position.z+=(3.786619432-3.4500310377)*o,i?.position&&i.position.copy(r.position),i?.rotation&&i.rotation.copy(r.rotation),i?.rotation&&(i.rotation.x-=10.8*Math.PI/180),i?.leftWing?.rotation&&(i.leftWing.rotation.z=S4(.72,.26179944+.4582006,o)),T4(n),t.head.position.y+=-3.618325234674*o;let l=.1*o,a=(3.618325234674-3.4500310377)*o,v=-2.53943318*o;t.leftArm.position.z+=a,t.rightArm.position.z+=a,t.leftArm.rotation.x+=.410367746202*o,t.rightArm.rotation.x+=.410367746202*o,t.leftArm.rotation.z+=l,t.rightArm.rotation.z+=-l,t.leftArm.position.y+=v,t.rightArm.position.y+=v,t.rightLeg.position.z+=-3.4500310377*o,t.leftLeg.position.z+=-3.4500310377*o}var B4=-2e-4;function P4(n){n.uniforms.uLogDepthBias={value:B4},n.fragmentShader=n.fragmentShader.replace("#include <logdepthbuf_pars_fragment>",`#include <logdepthbuf_pars_fragment>
764
764
  uniform float uLogDepthBias;`),n.fragmentShader=n.fragmentShader.replace("#include <logdepthbuf_fragment>",`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
765
765
  gl_FragDepth = log2( vFragDepth ) * logDepthBufFC * 0.5 + uLogDepthBias;
766
- #endif`)}function P2(n){n.userData.logDepthBiasApplied||(n.userData.logDepthBiasApplied=!0,n.onBeforeCompile=S4,n.needsUpdate=!0)}function M1(n){let e=n.skin,t=[e.layer1Material,e.layer1MaterialBiased,e.layer2Material,e.layer2MaterialBiased];for(let r of t)r.transparent=!1,r.alphaTest=.1,r.depthWrite=!0;P2(e.layer1MaterialBiased),P2(e.layer2MaterialBiased)}A();E();R();x();import*as ae from"three";function T4(n,e){if(typeof document<"u"){let t=document.createElement("canvas");return t.width=n,t.height=e,t}return new OffscreenCanvas(n,e)}function M4(n,e){let{depth:t,pixelSize:r}=e;if(n.width<=0||n.height<=0)throw new Error(`Invalid canvas dimensions: ${n.width}x${n.height}`);let s=n.getContext("2d").getImageData(0,0,n.width,n.height),{data:o}=s,l=n.width,a=n.height,v=t/2,c=r??1/Math.max(l,a),u=(P,H)=>{if(P<0||H<0||P>=l||H>=a)return!1;let V=(H*l+P)*4;return o[V+3]>128},h=[],p=[],m=[],b=[],k=0,_=(P,H,V,z,N,Y,q,J)=>(h.push(P,H,V),m.push(z,N),b.push(Y,q,J),k++),y=(P,H,V,z)=>{p.push(P,H,V,P,V,z)},M=(P,H)=>{let V=(P/l-.5)*c*l,z=-(H/a-.5)*c*a;return{x:V,y:z}},T=Array.from({length:a+1},()=>Array.from({length:l+1},()=>null)),S=Array.from({length:a+1},()=>Array.from({length:l+1},()=>null));for(let P=0;P<=a;P++)for(let H=0;H<=l;H++){let{x:V,y:z}=M(H-.5,P-.5),N=H/l,Y=P/a,q=!1,J=[[H-1,P-1],[H,P-1],[H-1,P],[H,P]];for(let[te,se]of J)if(u(te,se)){q=!0;break}q&&(T[P][H]=_(V,z,v,N,Y,0,0,1),S[P][H]=_(V,z,-v,N,Y,0,0,-1))}for(let P=0;P<a;P++)for(let H=0;H<l;H++){if(!u(H,P))continue;let V=T[P][H],z=T[P][H+1],N=T[P+1][H+1],Y=T[P+1][H],q=S[P][H],J=S[P][H+1],te=S[P+1][H+1],se=S[P+1][H];V!==null&&z!==null&&N!==null&&Y!==null&&y(V,z,N,Y),q!==null&&J!==null&&te!==null&&se!==null&&y(J,q,se,te)}for(let P=0;P<a;P++)for(let H=0;H<l;H++){if(!u(H,P))continue;let V=(H+.5)/l,z=(P+.5)/a;if(!u(H-1,P)){let N=T[P][H],Y=T[P+1][H],q=S[P][H],J=S[P+1][H];if(N!==null&&Y!==null&&q!==null&&J!==null){let te=_(h[N*3],h[N*3+1],h[N*3+2],V,z,-1,0,0),se=_(h[Y*3],h[Y*3+1],h[Y*3+2],V,z,-1,0,0),he=_(h[J*3],h[J*3+1],h[J*3+2],V,z,-1,0,0),fe=_(h[q*3],h[q*3+1],h[q*3+2],V,z,-1,0,0);y(te,se,he,fe)}}if(!u(H+1,P)){let N=T[P+1][H+1],Y=T[P][H+1],q=S[P+1][H+1],J=S[P][H+1];if(N!==null&&Y!==null&&q!==null&&J!==null){let te=_(h[N*3],h[N*3+1],h[N*3+2],V,z,1,0,0),se=_(h[Y*3],h[Y*3+1],h[Y*3+2],V,z,1,0,0),he=_(h[J*3],h[J*3+1],h[J*3+2],V,z,1,0,0),fe=_(h[q*3],h[q*3+1],h[q*3+2],V,z,1,0,0);y(te,se,he,fe)}}if(!u(H,P-1)){let N=T[P][H],Y=T[P][H+1],q=S[P][H],J=S[P][H+1];if(N!==null&&Y!==null&&q!==null&&J!==null){let te=_(h[N*3],h[N*3+1],h[N*3+2],V,z,0,-1,0),se=_(h[Y*3],h[Y*3+1],h[Y*3+2],V,z,0,-1,0),he=_(h[J*3],h[J*3+1],h[J*3+2],V,z,0,-1,0),fe=_(h[q*3],h[q*3+1],h[q*3+2],V,z,0,-1,0);y(te,se,he,fe)}}if(!u(H,P+1)){let N=T[P+1][H+1],Y=T[P+1][H],q=S[P+1][H+1],J=S[P+1][H];if(N!==null&&Y!==null&&q!==null&&J!==null){let te=_(h[N*3],h[N*3+1],h[N*3+2],V,z,0,1,0),se=_(h[Y*3],h[Y*3+1],h[Y*3+2],V,z,0,1,0),he=_(h[J*3],h[J*3+1],h[J*3+2],V,z,0,1,0),fe=_(h[q*3],h[q*3+1],h[q*3+2],V,z,0,1,0);y(te,se,he,fe)}}}let B=new ae.BufferGeometry;return B.setAttribute("position",new ae.Float32BufferAttribute(h,3)),B.setAttribute("uv",new ae.Float32BufferAttribute(m,2)),B.setAttribute("normal",new ae.Float32BufferAttribute(b,3)),B.setIndex(p),B.computeVertexNormals(),{geometry:B,totalVertices:k,totalTriangles:p.length/3}}function C4(n,e){let{u:t,v:r,sizeX:i,sizeY:s}=e,o=Math.max(1,Math.floor(i*n.image.width)),l=Math.max(1,Math.floor(s*n.image.height)),a=T4(o,l),v=a.getContext("2d");if(!v)throw new Error("Failed to get 2d context for item texture canvas");return v.imageSmoothingEnabled=!1,v.drawImage(n.image,t*n.image.width,r*n.image.height,i*n.image.width,s*n.image.height,0,0,a.width,a.height),a}function I2(n,e,t={}){let{faceCamera:r=!1,use3D:i=!0,depth:s=.04}=t,{u:o,v:l,sizeX:a,sizeY:v}=e;if(r){let b=n.clone();b.flipY=!0,b.offset.set(o,1-l-v),b.repeat.set(a,v),b.needsUpdate=!0,b.magFilter=ae.NearestFilter,b.minFilter=ae.NearestFilter;let k=new ae.SpriteMaterial({map:b,transparent:!0,alphaTest:.1});return{mesh:new ae.Sprite(k),itemsTexture:b,cleanup(){b.dispose()}}}if(i)try{let b=C4(n,e),{geometry:k}=M4(b,{depth:s}),_=new ae.CanvasTexture(b);_.magFilter=ae.NearestFilter,_.minFilter=ae.NearestFilter,_.wrapS=_.wrapT=ae.ClampToEdgeWrapping,_.flipY=!1,_.needsUpdate=!0;let y=new ae.MeshStandardMaterial({map:_,side:ae.DoubleSide,transparent:!0,alphaTest:.1});return{mesh:new ae.Mesh(k,y),itemsTexture:_,cleanup(){_.dispose(),k.dispose(),y.map&&y.map.dispose(),y.dispose()}}}catch{}let c=n.clone();c.flipY=!0,c.offset.set(o,1-l-v),c.repeat.set(a,v),c.needsUpdate=!0,c.magFilter=ae.NearestFilter,c.minFilter=ae.NearestFilter;let u=c.clone();u.repeat.x*=-1,u.needsUpdate=!0,u.offset.set(o+a,1-l-v);let h=new ae.MeshStandardMaterial({map:c,transparent:!0,alphaTest:.1}),p=new ae.MeshStandardMaterial({map:u,transparent:!0,alphaTest:.1});return{mesh:new ae.Mesh(new ae.BoxGeometry(1,1,0),[new ae.MeshBasicMaterial({color:0}),new ae.MeshBasicMaterial({color:0}),new ae.MeshBasicMaterial({color:0}),new ae.MeshBasicMaterial({color:0}),h,p]),itemsTexture:c,itemsTextureFlipped:u,cleanup(){c.dispose(),u.dispose(),h.dispose(),p.dispose()}}}A();E();R();x();import*as re from"three";A();E();R();x();A();E();R();x();import{REVISION as B4}from"three";var H2=parseInt(B4.replace(/\D+/g,""));A();E();R();x();import{Loader as P4,FileLoader as I4,Group as H4,BufferGeometry as L2,Float32BufferAttribute as or,LineBasicMaterial as C1,Material as O2,PointsMaterial as cn,MeshPhongMaterial as L4,LineSegments as D2,Points as B1,Mesh as F2,Vector3 as $r}from"three";var O4=/^[og]\s*(.+)?/,D4=/^mtllib /,F4=/^usemtl /,z4=/^usemap /,z2=new $r,P1=new $r,U2=new $r,V2=new $r,wt=new $r;function U4(){let n={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}let r=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(i,s){let o=this._finalize(!1);o&&(o.inherited||o.groupCount<=0)&&this.materials.splice(o.index,1);let l={index:this.materials.length,name:i||"",mtllib:Array.isArray(s)&&s.length>0?s[s.length-1]:"",smooth:o!==void 0?o.smooth:this.smooth,groupStart:o!==void 0?o.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(a){let v={index:typeof a=="number"?a:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return v.clone=this.clone.bind(v),v}};return this.materials.push(l),l},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){let s=this.currentMaterial();if(s&&s.groupEnd===-1&&(s.groupEnd=this.geometry.vertices.length/3,s.groupCount=s.groupEnd-s.groupStart,s.inherited=!1),i&&this.materials.length>1)for(let o=this.materials.length-1;o>=0;o--)this.materials[o].groupCount<=0&&this.materials.splice(o,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),s}},r&&r.name&&typeof r.clone=="function"){let i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){let r=parseInt(e,10);return(r>=0?r-1:r+t/3)*3},parseNormalIndex:function(e,t){let r=parseInt(e,10);return(r>=0?r-1:r+t/3)*3},parseUVIndex:function(e,t){let r=parseInt(e,10);return(r>=0?r-1:r+t/2)*2},addVertex:function(e,t,r){let i=this.vertices,s=this.object.geometry.vertices;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[r+0],i[r+1],i[r+2])},addVertexPoint:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){let i=this.normals,s=this.object.geometry.normals;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[r+0],i[r+1],i[r+2])},addFaceNormal:function(e,t,r){let i=this.vertices,s=this.object.geometry.normals;z2.fromArray(i,e),P1.fromArray(i,t),U2.fromArray(i,r),wt.subVectors(U2,P1),V2.subVectors(z2,P1),wt.cross(V2),wt.normalize(),s.push(wt.x,wt.y,wt.z),s.push(wt.x,wt.y,wt.z),s.push(wt.x,wt.y,wt.z)},addColor:function(e,t,r){let i=this.colors,s=this.object.geometry.colors;i[e]!==void 0&&s.push(i[e+0],i[e+1],i[e+2]),i[t]!==void 0&&s.push(i[t+0],i[t+1],i[t+2]),i[r]!==void 0&&s.push(i[r+0],i[r+1],i[r+2])},addUV:function(e,t,r){let i=this.uvs,s=this.object.geometry.uvs;s.push(i[e+0],i[e+1]),s.push(i[t+0],i[t+1]),s.push(i[r+0],i[r+1])},addDefaultUV:function(){let e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,i,s,o,l,a,v){let c=this.vertices.length,u=this.parseVertexIndex(e,c),h=this.parseVertexIndex(t,c),p=this.parseVertexIndex(r,c);if(this.addVertex(u,h,p),this.addColor(u,h,p),l!==void 0&&l!==""){let m=this.normals.length;u=this.parseNormalIndex(l,m),h=this.parseNormalIndex(a,m),p=this.parseNormalIndex(v,m),this.addNormal(u,h,p)}else this.addFaceNormal(u,h,p);if(i!==void 0&&i!==""){let m=this.uvs.length;u=this.parseUVIndex(i,m),h=this.parseUVIndex(s,m),p=this.parseUVIndex(o,m),this.addUV(u,h,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";let t=this.vertices.length;for(let r=0,i=e.length;r<i;r++){let s=this.parseVertexIndex(e[r],t);this.addVertexPoint(s),this.addColor(s)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";let r=this.vertices.length,i=this.uvs.length;for(let s=0,o=e.length;s<o;s++)this.addVertexLine(this.parseVertexIndex(e[s],r));for(let s=0,o=t.length;s<o;s++)this.addUVLine(this.parseUVIndex(t[s],i))}};return n.startObject("",!1),n}var ar=class extends P4{constructor(e){super(e),this.materials=null}load(e,t,r,i){let s=this,o=new I4(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(l))}catch(a){i&&i(a),s.manager.itemError(e)}},r,i)}setMaterials(e){return this.materials=e,this}parse(e){let t=new U4;e.indexOf(`\r
766
+ #endif`)}function L2(n){n.userData.logDepthBiasApplied||(n.userData.logDepthBiasApplied=!0,n.onBeforeCompile=P4,n.needsUpdate=!0)}function M1(n){let e=n.skin,t=[e.layer1Material,e.layer1MaterialBiased,e.layer2Material,e.layer2MaterialBiased];for(let r of t)r.transparent=!1,r.alphaTest=.1,r.depthWrite=!0;L2(e.layer1MaterialBiased),L2(e.layer2MaterialBiased)}A();E();R();x();import*as ae from"three";function I4(n,e){if(typeof document<"u"){let t=document.createElement("canvas");return t.width=n,t.height=e,t}return new OffscreenCanvas(n,e)}function H4(n,e){let{depth:t,pixelSize:r}=e;if(n.width<=0||n.height<=0)throw new Error(`Invalid canvas dimensions: ${n.width}x${n.height}`);let s=n.getContext("2d").getImageData(0,0,n.width,n.height),{data:o}=s,l=n.width,a=n.height,v=t/2,c=r??1/Math.max(l,a),u=(P,H)=>{if(P<0||H<0||P>=l||H>=a)return!1;let V=(H*l+P)*4;return o[V+3]>128},h=[],p=[],m=[],b=[],k=0,_=(P,H,V,z,N,Y,q,J)=>(h.push(P,H,V),m.push(z,N),b.push(Y,q,J),k++),y=(P,H,V,z)=>{p.push(P,H,V,P,V,z)},M=(P,H)=>{let V=(P/l-.5)*c*l,z=-(H/a-.5)*c*a;return{x:V,y:z}},T=Array.from({length:a+1},()=>Array.from({length:l+1},()=>null)),S=Array.from({length:a+1},()=>Array.from({length:l+1},()=>null));for(let P=0;P<=a;P++)for(let H=0;H<=l;H++){let{x:V,y:z}=M(H-.5,P-.5),N=H/l,Y=P/a,q=!1,J=[[H-1,P-1],[H,P-1],[H-1,P],[H,P]];for(let[te,se]of J)if(u(te,se)){q=!0;break}q&&(T[P][H]=_(V,z,v,N,Y,0,0,1),S[P][H]=_(V,z,-v,N,Y,0,0,-1))}for(let P=0;P<a;P++)for(let H=0;H<l;H++){if(!u(H,P))continue;let V=T[P][H],z=T[P][H+1],N=T[P+1][H+1],Y=T[P+1][H],q=S[P][H],J=S[P][H+1],te=S[P+1][H+1],se=S[P+1][H];V!==null&&z!==null&&N!==null&&Y!==null&&y(V,z,N,Y),q!==null&&J!==null&&te!==null&&se!==null&&y(J,q,se,te)}for(let P=0;P<a;P++)for(let H=0;H<l;H++){if(!u(H,P))continue;let V=(H+.5)/l,z=(P+.5)/a;if(!u(H-1,P)){let N=T[P][H],Y=T[P+1][H],q=S[P][H],J=S[P+1][H];if(N!==null&&Y!==null&&q!==null&&J!==null){let te=_(h[N*3],h[N*3+1],h[N*3+2],V,z,-1,0,0),se=_(h[Y*3],h[Y*3+1],h[Y*3+2],V,z,-1,0,0),he=_(h[J*3],h[J*3+1],h[J*3+2],V,z,-1,0,0),fe=_(h[q*3],h[q*3+1],h[q*3+2],V,z,-1,0,0);y(te,se,he,fe)}}if(!u(H+1,P)){let N=T[P+1][H+1],Y=T[P][H+1],q=S[P+1][H+1],J=S[P][H+1];if(N!==null&&Y!==null&&q!==null&&J!==null){let te=_(h[N*3],h[N*3+1],h[N*3+2],V,z,1,0,0),se=_(h[Y*3],h[Y*3+1],h[Y*3+2],V,z,1,0,0),he=_(h[J*3],h[J*3+1],h[J*3+2],V,z,1,0,0),fe=_(h[q*3],h[q*3+1],h[q*3+2],V,z,1,0,0);y(te,se,he,fe)}}if(!u(H,P-1)){let N=T[P][H],Y=T[P][H+1],q=S[P][H],J=S[P][H+1];if(N!==null&&Y!==null&&q!==null&&J!==null){let te=_(h[N*3],h[N*3+1],h[N*3+2],V,z,0,-1,0),se=_(h[Y*3],h[Y*3+1],h[Y*3+2],V,z,0,-1,0),he=_(h[J*3],h[J*3+1],h[J*3+2],V,z,0,-1,0),fe=_(h[q*3],h[q*3+1],h[q*3+2],V,z,0,-1,0);y(te,se,he,fe)}}if(!u(H,P+1)){let N=T[P+1][H+1],Y=T[P+1][H],q=S[P+1][H+1],J=S[P+1][H];if(N!==null&&Y!==null&&q!==null&&J!==null){let te=_(h[N*3],h[N*3+1],h[N*3+2],V,z,0,1,0),se=_(h[Y*3],h[Y*3+1],h[Y*3+2],V,z,0,1,0),he=_(h[J*3],h[J*3+1],h[J*3+2],V,z,0,1,0),fe=_(h[q*3],h[q*3+1],h[q*3+2],V,z,0,1,0);y(te,se,he,fe)}}}let B=new ae.BufferGeometry;return B.setAttribute("position",new ae.Float32BufferAttribute(h,3)),B.setAttribute("uv",new ae.Float32BufferAttribute(m,2)),B.setAttribute("normal",new ae.Float32BufferAttribute(b,3)),B.setIndex(p),B.computeVertexNormals(),{geometry:B,totalVertices:k,totalTriangles:p.length/3}}function L4(n,e){let{u:t,v:r,sizeX:i,sizeY:s}=e,o=Math.max(1,Math.floor(i*n.image.width)),l=Math.max(1,Math.floor(s*n.image.height)),a=I4(o,l),v=a.getContext("2d");if(!v)throw new Error("Failed to get 2d context for item texture canvas");return v.imageSmoothingEnabled=!1,v.drawImage(n.image,t*n.image.width,r*n.image.height,i*n.image.width,s*n.image.height,0,0,a.width,a.height),a}function O2(n,e,t={}){let{faceCamera:r=!1,use3D:i=!0,depth:s=.04}=t,{u:o,v:l,sizeX:a,sizeY:v}=e;if(r){let b=n.clone();b.flipY=!0,b.offset.set(o,1-l-v),b.repeat.set(a,v),b.needsUpdate=!0,b.magFilter=ae.NearestFilter,b.minFilter=ae.NearestFilter;let k=new ae.SpriteMaterial({map:b,transparent:!0,alphaTest:.1});return{mesh:new ae.Sprite(k),itemsTexture:b,cleanup(){b.dispose()}}}if(i)try{let b=L4(n,e),{geometry:k}=H4(b,{depth:s}),_=new ae.CanvasTexture(b);_.magFilter=ae.NearestFilter,_.minFilter=ae.NearestFilter,_.wrapS=_.wrapT=ae.ClampToEdgeWrapping,_.flipY=!1,_.needsUpdate=!0;let y=new ae.MeshStandardMaterial({map:_,side:ae.DoubleSide,transparent:!0,alphaTest:.1});return{mesh:new ae.Mesh(k,y),itemsTexture:_,cleanup(){_.dispose(),k.dispose(),y.map&&y.map.dispose(),y.dispose()}}}catch{}let c=n.clone();c.flipY=!0,c.offset.set(o,1-l-v),c.repeat.set(a,v),c.needsUpdate=!0,c.magFilter=ae.NearestFilter,c.minFilter=ae.NearestFilter;let u=c.clone();u.repeat.x*=-1,u.needsUpdate=!0,u.offset.set(o+a,1-l-v);let h=new ae.MeshStandardMaterial({map:c,transparent:!0,alphaTest:.1}),p=new ae.MeshStandardMaterial({map:u,transparent:!0,alphaTest:.1});return{mesh:new ae.Mesh(new ae.BoxGeometry(1,1,0),[new ae.MeshBasicMaterial({color:0}),new ae.MeshBasicMaterial({color:0}),new ae.MeshBasicMaterial({color:0}),new ae.MeshBasicMaterial({color:0}),h,p]),itemsTexture:c,itemsTextureFlipped:u,cleanup(){c.dispose(),u.dispose(),h.dispose(),p.dispose()}}}A();E();R();x();import*as re from"three";A();E();R();x();A();E();R();x();import{REVISION as O4}from"three";var D2=parseInt(O4.replace(/\D+/g,""));A();E();R();x();import{Loader as D4,FileLoader as F4,Group as z4,BufferGeometry as F2,Float32BufferAttribute as or,LineBasicMaterial as C1,Material as z2,PointsMaterial as cn,MeshPhongMaterial as U4,LineSegments as U2,Points as B1,Mesh as V2,Vector3 as $r}from"three";var V4=/^[og]\s*(.+)?/,G4=/^mtllib /,N4=/^usemtl /,W4=/^usemap /,G2=new $r,P1=new $r,N2=new $r,W2=new $r,wt=new $r;function j4(){let n={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}let r=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(i,s){let o=this._finalize(!1);o&&(o.inherited||o.groupCount<=0)&&this.materials.splice(o.index,1);let l={index:this.materials.length,name:i||"",mtllib:Array.isArray(s)&&s.length>0?s[s.length-1]:"",smooth:o!==void 0?o.smooth:this.smooth,groupStart:o!==void 0?o.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(a){let v={index:typeof a=="number"?a:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return v.clone=this.clone.bind(v),v}};return this.materials.push(l),l},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){let s=this.currentMaterial();if(s&&s.groupEnd===-1&&(s.groupEnd=this.geometry.vertices.length/3,s.groupCount=s.groupEnd-s.groupStart,s.inherited=!1),i&&this.materials.length>1)for(let o=this.materials.length-1;o>=0;o--)this.materials[o].groupCount<=0&&this.materials.splice(o,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),s}},r&&r.name&&typeof r.clone=="function"){let i=r.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){let r=parseInt(e,10);return(r>=0?r-1:r+t/3)*3},parseNormalIndex:function(e,t){let r=parseInt(e,10);return(r>=0?r-1:r+t/3)*3},parseUVIndex:function(e,t){let r=parseInt(e,10);return(r>=0?r-1:r+t/2)*2},addVertex:function(e,t,r){let i=this.vertices,s=this.object.geometry.vertices;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[r+0],i[r+1],i[r+2])},addVertexPoint:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){let i=this.normals,s=this.object.geometry.normals;s.push(i[e+0],i[e+1],i[e+2]),s.push(i[t+0],i[t+1],i[t+2]),s.push(i[r+0],i[r+1],i[r+2])},addFaceNormal:function(e,t,r){let i=this.vertices,s=this.object.geometry.normals;G2.fromArray(i,e),P1.fromArray(i,t),N2.fromArray(i,r),wt.subVectors(N2,P1),W2.subVectors(G2,P1),wt.cross(W2),wt.normalize(),s.push(wt.x,wt.y,wt.z),s.push(wt.x,wt.y,wt.z),s.push(wt.x,wt.y,wt.z)},addColor:function(e,t,r){let i=this.colors,s=this.object.geometry.colors;i[e]!==void 0&&s.push(i[e+0],i[e+1],i[e+2]),i[t]!==void 0&&s.push(i[t+0],i[t+1],i[t+2]),i[r]!==void 0&&s.push(i[r+0],i[r+1],i[r+2])},addUV:function(e,t,r){let i=this.uvs,s=this.object.geometry.uvs;s.push(i[e+0],i[e+1]),s.push(i[t+0],i[t+1]),s.push(i[r+0],i[r+1])},addDefaultUV:function(){let e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,i,s,o,l,a,v){let c=this.vertices.length,u=this.parseVertexIndex(e,c),h=this.parseVertexIndex(t,c),p=this.parseVertexIndex(r,c);if(this.addVertex(u,h,p),this.addColor(u,h,p),l!==void 0&&l!==""){let m=this.normals.length;u=this.parseNormalIndex(l,m),h=this.parseNormalIndex(a,m),p=this.parseNormalIndex(v,m),this.addNormal(u,h,p)}else this.addFaceNormal(u,h,p);if(i!==void 0&&i!==""){let m=this.uvs.length;u=this.parseUVIndex(i,m),h=this.parseUVIndex(s,m),p=this.parseUVIndex(o,m),this.addUV(u,h,p),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";let t=this.vertices.length;for(let r=0,i=e.length;r<i;r++){let s=this.parseVertexIndex(e[r],t);this.addVertexPoint(s),this.addColor(s)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";let r=this.vertices.length,i=this.uvs.length;for(let s=0,o=e.length;s<o;s++)this.addVertexLine(this.parseVertexIndex(e[s],r));for(let s=0,o=t.length;s<o;s++)this.addUVLine(this.parseUVIndex(t[s],i))}};return n.startObject("",!1),n}var ar=class extends D4{constructor(e){super(e),this.materials=null}load(e,t,r,i){let s=this,o=new F4(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(s.parse(l))}catch(a){i&&i(a),s.manager.itemError(e)}},r,i)}setMaterials(e){return this.materials=e,this}parse(e){let t=new j4;e.indexOf(`\r
767
767
  `)!==-1&&(e=e.replace(/\r\n/g,`
768
768
  `)),e.indexOf(`\\
769
769
  `)!==-1&&(e=e.replace(/\\\n/g,""));let r=e.split(`
770
- `),i="",s="",o=0,l=[],a=typeof"".trimLeft=="function";for(let u=0,h=r.length;u<h;u++)if(i=r[u],i=a?i.trimLeft():i.trim(),o=i.length,o!==0&&(s=i.charAt(0),s!=="#")){if(s==="v"){let p=i.split(/\s+/);switch(p[0]){case"v":t.vertices.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3])),p.length>=7?t.colors.push(parseFloat(p[4]),parseFloat(p[5]),parseFloat(p[6])):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3]));break;case"vt":t.uvs.push(parseFloat(p[1]),parseFloat(p[2]));break}}else if(s==="f"){let m=i.substr(1).trim().split(/\s+/),b=[];for(let _=0,y=m.length;_<y;_++){let M=m[_];if(M.length>0){let T=M.split("/");b.push(T)}}let k=b[0];for(let _=1,y=b.length-1;_<y;_++){let M=b[_],T=b[_+1];t.addFace(k[0],M[0],T[0],k[1],M[1],T[1],k[2],M[2],T[2])}}else if(s==="l"){let p=i.substring(1).trim().split(" "),m=[],b=[];if(i.indexOf("/")===-1)m=p;else for(let k=0,_=p.length;k<_;k++){let y=p[k].split("/");y[0]!==""&&m.push(y[0]),y[1]!==""&&b.push(y[1])}t.addLineGeometry(m,b)}else if(s==="p"){let m=i.substr(1).trim().split(" ");t.addPointGeometry(m)}else if((l=O4.exec(i))!==null){let p=(" "+l[0].substr(1).trim()).substr(1);t.startObject(p)}else if(F4.test(i))t.object.startMaterial(i.substring(7).trim(),t.materialLibraries);else if(D4.test(i))t.materialLibraries.push(i.substring(7).trim());else if(!z4.test(i)){if(s==="s"){if(l=i.split(" "),l.length>1){let m=l[1].trim().toLowerCase();t.object.smooth=m!=="0"&&m!=="off"}else t.object.smooth=!0;let p=t.object.currentMaterial();p&&(p.smooth=t.object.smooth)}else if(i==="\0")continue}}t.finalize();let v=new H4;if(v.materialLibraries=[].concat(t.materialLibraries),!(t.objects.length===1&&t.objects[0].geometry.vertices.length===0)===!0)for(let u=0,h=t.objects.length;u<h;u++){let p=t.objects[u],m=p.geometry,b=p.materials,k=m.type==="Line",_=m.type==="Points",y=!1;if(m.vertices.length===0)continue;let M=new L2;M.setAttribute("position",new or(m.vertices,3)),m.normals.length>0&&M.setAttribute("normal",new or(m.normals,3)),m.colors.length>0&&(y=!0,M.setAttribute("color",new or(m.colors,3))),m.hasUVIndices===!0&&M.setAttribute("uv",new or(m.uvs,2));let T=[];for(let B=0,P=b.length;B<P;B++){let H=b[B],V=H.name+"_"+H.smooth+"_"+y,z=t.materials[V];if(this.materials!==null){if(z=this.materials.create(H.name),k&&z&&!(z instanceof C1)){let N=new C1;O2.prototype.copy.call(N,z),N.color.copy(z.color),z=N}else if(_&&z&&!(z instanceof cn)){let N=new cn({size:10,sizeAttenuation:!1});O2.prototype.copy.call(N,z),N.color.copy(z.color),N.map=z.map,z=N}}z===void 0&&(k?z=new C1:_?z=new cn({size:1,sizeAttenuation:!1}):z=new L4,z.name=H.name,z.flatShading=!H.smooth,z.vertexColors=y,t.materials[V]=z),T.push(z)}let S;if(T.length>1){for(let B=0,P=b.length;B<P;B++){let H=b[B];M.addGroup(H.groupStart,H.groupCount,B)}k?S=new D2(M,T):_?S=new B1(M,T):S=new F2(M,T)}else k?S=new D2(M,T[0]):_?S=new B1(M,T[0]):S=new F2(M,T[0]);S.name=p.name,v.add(S)}else if(t.vertices.length>0){let u=new cn({size:1,sizeAttenuation:!1}),h=new L2;h.setAttribute("position",new or(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0&&(h.setAttribute("color",new or(t.colors,3)),u.vertexColors=!0);let p=new B1(h,u);v.add(p)}return v}};A();E();R();x();import{InstancedBufferGeometry as V4,Float32BufferAttribute as G2,InstancedInterleavedBuffer as N2,InterleavedBufferAttribute as dn,WireframeGeometry as G4,Box3 as j2,Sphere as N4,Vector3 as W4}from"three";var W2=new j2,un=new W4,I0=class extends V4{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";let e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],r=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(r),this.setAttribute("position",new G2(e,3)),this.setAttribute("uv",new G2(t,2))}applyMatrix4(e){let t=this.attributes.instanceStart,r=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),r.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let r=new N2(t,6,1);return this.setAttribute("instanceStart",new dn(r,3,0)),this.setAttribute("instanceEnd",new dn(r,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let r;e instanceof Float32Array?r=e:Array.isArray(e)&&(r=new Float32Array(e));let i=new N2(r,t*2,1);return this.setAttribute("instanceColorStart",new dn(i,t,0)),this.setAttribute("instanceColorEnd",new dn(i,t,t)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new G4(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new j2);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),W2.setFromBufferAttribute(t),this.boundingBox.union(W2))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new N4),this.boundingBox===null&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){let r=this.boundingSphere.center;this.boundingBox.getCenter(r);let i=0;for(let s=0,o=e.count;s<o;s++)un.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(un)),un.fromBufferAttribute(t,s),i=Math.max(i,r.distanceToSquared(un));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)}}toJSON(){}applyMatrix(e){return this.applyMatrix4(e)}};A();E();R();x();import{Mesh as Q4,InstancedInterleavedBuffer as K4,InterleavedBufferAttribute as K2,Vector3 as X2,Vector4 as q4}from"three";A();E();R();x();import{ShaderMaterial as j4,UniformsUtils as Y2,UniformsLib as Q2,Vector2 as Y4}from"three";var H0=class extends j4{constructor(e){super({type:"LineMaterial",uniforms:Y2.clone(Y2.merge([Q2.common,Q2.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Y4(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
770
+ `),i="",s="",o=0,l=[],a=typeof"".trimLeft=="function";for(let u=0,h=r.length;u<h;u++)if(i=r[u],i=a?i.trimLeft():i.trim(),o=i.length,o!==0&&(s=i.charAt(0),s!=="#")){if(s==="v"){let p=i.split(/\s+/);switch(p[0]){case"v":t.vertices.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3])),p.length>=7?t.colors.push(parseFloat(p[4]),parseFloat(p[5]),parseFloat(p[6])):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3]));break;case"vt":t.uvs.push(parseFloat(p[1]),parseFloat(p[2]));break}}else if(s==="f"){let m=i.substr(1).trim().split(/\s+/),b=[];for(let _=0,y=m.length;_<y;_++){let M=m[_];if(M.length>0){let T=M.split("/");b.push(T)}}let k=b[0];for(let _=1,y=b.length-1;_<y;_++){let M=b[_],T=b[_+1];t.addFace(k[0],M[0],T[0],k[1],M[1],T[1],k[2],M[2],T[2])}}else if(s==="l"){let p=i.substring(1).trim().split(" "),m=[],b=[];if(i.indexOf("/")===-1)m=p;else for(let k=0,_=p.length;k<_;k++){let y=p[k].split("/");y[0]!==""&&m.push(y[0]),y[1]!==""&&b.push(y[1])}t.addLineGeometry(m,b)}else if(s==="p"){let m=i.substr(1).trim().split(" ");t.addPointGeometry(m)}else if((l=V4.exec(i))!==null){let p=(" "+l[0].substr(1).trim()).substr(1);t.startObject(p)}else if(N4.test(i))t.object.startMaterial(i.substring(7).trim(),t.materialLibraries);else if(G4.test(i))t.materialLibraries.push(i.substring(7).trim());else if(!W4.test(i)){if(s==="s"){if(l=i.split(" "),l.length>1){let m=l[1].trim().toLowerCase();t.object.smooth=m!=="0"&&m!=="off"}else t.object.smooth=!0;let p=t.object.currentMaterial();p&&(p.smooth=t.object.smooth)}else if(i==="\0")continue}}t.finalize();let v=new z4;if(v.materialLibraries=[].concat(t.materialLibraries),!(t.objects.length===1&&t.objects[0].geometry.vertices.length===0)===!0)for(let u=0,h=t.objects.length;u<h;u++){let p=t.objects[u],m=p.geometry,b=p.materials,k=m.type==="Line",_=m.type==="Points",y=!1;if(m.vertices.length===0)continue;let M=new F2;M.setAttribute("position",new or(m.vertices,3)),m.normals.length>0&&M.setAttribute("normal",new or(m.normals,3)),m.colors.length>0&&(y=!0,M.setAttribute("color",new or(m.colors,3))),m.hasUVIndices===!0&&M.setAttribute("uv",new or(m.uvs,2));let T=[];for(let B=0,P=b.length;B<P;B++){let H=b[B],V=H.name+"_"+H.smooth+"_"+y,z=t.materials[V];if(this.materials!==null){if(z=this.materials.create(H.name),k&&z&&!(z instanceof C1)){let N=new C1;z2.prototype.copy.call(N,z),N.color.copy(z.color),z=N}else if(_&&z&&!(z instanceof cn)){let N=new cn({size:10,sizeAttenuation:!1});z2.prototype.copy.call(N,z),N.color.copy(z.color),N.map=z.map,z=N}}z===void 0&&(k?z=new C1:_?z=new cn({size:1,sizeAttenuation:!1}):z=new U4,z.name=H.name,z.flatShading=!H.smooth,z.vertexColors=y,t.materials[V]=z),T.push(z)}let S;if(T.length>1){for(let B=0,P=b.length;B<P;B++){let H=b[B];M.addGroup(H.groupStart,H.groupCount,B)}k?S=new U2(M,T):_?S=new B1(M,T):S=new V2(M,T)}else k?S=new U2(M,T[0]):_?S=new B1(M,T[0]):S=new V2(M,T[0]);S.name=p.name,v.add(S)}else if(t.vertices.length>0){let u=new cn({size:1,sizeAttenuation:!1}),h=new F2;h.setAttribute("position",new or(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0&&(h.setAttribute("color",new or(t.colors,3)),u.vertexColors=!0);let p=new B1(h,u);v.add(p)}return v}};A();E();R();x();import{InstancedBufferGeometry as Y4,Float32BufferAttribute as j2,InstancedInterleavedBuffer as Y2,InterleavedBufferAttribute as dn,WireframeGeometry as Q4,Box3 as K2,Sphere as K4,Vector3 as q4}from"three";var Q2=new K2,un=new q4,I0=class extends Y4{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";let e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],r=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(r),this.setAttribute("position",new j2(e,3)),this.setAttribute("uv",new j2(t,2))}applyMatrix4(e){let t=this.attributes.instanceStart,r=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),r.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let r=new Y2(t,6,1);return this.setAttribute("instanceStart",new dn(r,3,0)),this.setAttribute("instanceEnd",new dn(r,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let r;e instanceof Float32Array?r=e:Array.isArray(e)&&(r=new Float32Array(e));let i=new Y2(r,t*2,1);return this.setAttribute("instanceColorStart",new dn(i,t,0)),this.setAttribute("instanceColorEnd",new dn(i,t,t)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new Q4(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new K2);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Q2.setFromBufferAttribute(t),this.boundingBox.union(Q2))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new K4),this.boundingBox===null&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){let r=this.boundingSphere.center;this.boundingBox.getCenter(r);let i=0;for(let s=0,o=e.count;s<o;s++)un.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(un)),un.fromBufferAttribute(t,s),i=Math.max(i,r.distanceToSquared(un));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)}}toJSON(){}applyMatrix(e){return this.applyMatrix4(e)}};A();E();R();x();import{Mesh as Z4,InstancedInterleavedBuffer as $4,InterleavedBufferAttribute as X2,Vector3 as e3,Vector4 as ec}from"three";A();E();R();x();import{ShaderMaterial as J4,UniformsUtils as q2,UniformsLib as J2,Vector2 as X4}from"three";var H0=class extends J4{constructor(e){super({type:"LineMaterial",uniforms:q2.clone(q2.merge([J2.common,J2.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new X4(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
771
771
  #include <common>
772
772
  #include <fog_pars_vertex>
773
773
  #include <logdepthbuf_pars_vertex>
@@ -1170,12 +1170,12 @@ uniform float uLogDepthBias;`),n.fragmentShader=n.fragmentShader.replace("#inclu
1170
1170
  gl_FragColor = diffuseColor;
1171
1171
 
1172
1172
  #include <tonemapping_fragment>
1173
- #include <${H2>=154?"colorspace_fragment":"encodings_fragment"}>
1173
+ #include <${D2>=154?"colorspace_fragment":"encodings_fragment"}>
1174
1174
  #include <fog_fragment>
1175
1175
  #include <premultiplied_alpha_fragment>
1176
1176
 
1177
1177
  }
1178
- `,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(t){!!t!="USE_DASH"in this.defines&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(t){!!t!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),t===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}};var q2=new X2,J2=new X2,I1=new q4,e5=class extends Q4{constructor(e=new I0,t=new H0({color:Math.random()*16777215})){super(e,t),this.isWireframe=!0,this.type="Wireframe"}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let o=0,l=0,a=t.count;o<a;o++,l+=2)q2.fromBufferAttribute(t,o),J2.fromBufferAttribute(r,o),i[l]=l===0?0:i[l-1],i[l+1]=i[l]+q2.distanceTo(J2);let s=new K4(i,2,1);return e.setAttribute("instanceDistanceStart",new K2(s,1,0)),e.setAttribute("instanceDistanceEnd",new K2(s,1,1)),this}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(I1),this.material.uniforms.resolution.value.set(I1.z,I1.w))}};import{GLTFLoader as r9}from"three/examples/jsm/loaders/GLTFLoader.js";import n9 from"mc-assets/dist/other-textures/latest/entity/zombie/husk.png";import{Vec3 as hn}from"vec3";import i9 from"mc-assets/dist/other-textures/latest/entity/cat/ocelot.png";import s9 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/arrow.png";import o9 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/spectral_arrow.png";import a9 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/tipped_arrow.png";var Z2={armor_stand:{identifier:"minecraft:armor_stand",min_engine_version:"1.8.0",materials:{default:"armor_stand"},textures:{default:"textures/entity/armorstand/wood"},geometry:{default:{bones:[{name:"baseplate",parent:"waist",cubes:[{origin:[-6,0,-6],size:[12,1,12],uv:[0,32]}]},{name:"waist",pivot:[0,12,0]},{name:"body",parent:"waist",pivot:[0,13,0],cubes:[{origin:[-6,21,-1.5],size:[12,3,3],uv:[0,26]},{origin:[-3,14,-1],size:[2,7,2],uv:[16,0]},{origin:[1,14,-1],size:[2,7,2],uv:[48,16]},{origin:[-4,12,-1],size:[8,2,2],uv:[0,48]}]},{name:"head",parent:"waist",pivot:[0,12,0],cubes:[{origin:[-1,24,-1],size:[2,7,2],uv:[0,0]}]},{name:"hat",parent:"head",pivot:[0,12,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0]}]},{name:"leftarm",parent:"waist",mirror:!0,pivot:[5,10,0],cubes:[{origin:[5,12,-1],size:[2,12,2],uv:[32,16]}]},{name:"leftitem",parent:"leftarm",pivot:[1,-9,-5]},{name:"leftleg",parent:"waist",mirror:!0,pivot:[1.9,1,0],cubes:[{origin:[.9,1,-1],size:[2,11,2],uv:[40,16]}]},{name:"rightarm",parent:"waist",pivot:[-5,10,0],cubes:[{origin:[-7,12,-1],size:[2,12,2],uv:[24,0]}]},{name:"rightitem",parent:"rightarm",pivot:[-1,-9,-5]},{name:"rightleg",parent:"waist",pivot:[-1.9,1,0],cubes:[{origin:[-2.9,1,-1],size:[2,11,2],uv:[8,0]}]}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64}},render_controllers:["controller.render.armor_stand"],enable_attachables:!0},arrow:{identifier:"minecraft:arrow",materials:{default:"arrow"},textures:{default:"textures/entity/arrow"},geometry:{default:{bones:[{name:"body",pivot:[0,1,0],cubes:[{origin:[0,-2.5,-3],rotation:[0,0,45],size:[0,5,16],uv:{east:{uv:[0,0]}}},{origin:[0,-2.5,-3],rotation:[0,0,-45],size:[0,5,16],uv:{east:{uv:[0,0]}}},{origin:[-2.5,-2.5,12],rotation:[0,0,45],size:[5,5,0],uv:{south:{uv:[0,5]}}}]}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.arrow"]},bat:{_comment:"Wing tip mirror flags are swapped vs vanilla Bedrock model: our addCube() mirror implementation flips UVs in the opposite direction, so rightWingTip needs mirror=true and leftWingTip needs mirror=false to render correctly.",identifier:"minecraft:bat",materials:{default:"bat"},textures:{default:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAALHSURBVHja7VrBSiQxFJybHvci6G1gF2TBwyoKelnWy55kWYS9ePDmD+in+KcevLb7GgpqipeeTkzPpGdewSNJmx6nKtXJS3oWiwTOv33pbs6Ou9vr731YHddQ5/ZiAHa/9cXnjLln62DyLALIL48P+4AIQ+RZAP2cnO909/PH4uvRQcdh1zSqwCMPIiDPIqwT8uHufMVJuDfnOxnhq9OT7vHPZR9WZxEgSjUBUi7IcQBG++XpphfB6rgvVwCQ//f7og8WAeL8F6Kr6oD7X8s+PPuOmQNYAAsIUOIAkDeSLIK1LeCMagIweZQ8iRkBlJuYl5gwSlxjZ2R9KM/2XBphsyxEQGhfOCEVNQXQ0UZdo2i21+edR57DmxjZFRpTCaD2/7QAXsAFcEKq3zYEGHJBtgCeC97f3vtnG0uY1e1aavQ3/QgMuaBoDtCsDyWv3yqSlxhpTClAygXZArAILIaS8ezOo52TIJVA1/sqAswRnhCfEoAnuqGkZwpbZxJfyflTQuysAN7GxxNiZ62fEoCFMBGqpcK8h8ckqIkRoiU3VPkHIM/2R4rMaTLK0pGr9oVrw9v7Iy/QDLFEAH5umxTAW9utreTHOuD1+e/KaQ4mrGrb1ykE0L07HODFmKMsJs1b2GYfAc0MdYPEThiTvIA8DjWayNxSs3pJePPDOvJNCKDL27r22L95AlRJXaewuh57cVuPx7Acen1VlNkIoKR0++udCer84PXn42wj660EW38BooS99rqTn1R/FkCTnibyAH3l5bW9GOqjx+Wa8TWVCXpn/NzW63oIote1bH6HlSKUK0BKkFkIgDSX01+taz9+vTV0X/MC6Hu+1OFmSb9tHp6MRopIrQgBAjMDtr2bfOvb3KTIP2vZy9HnvH6vXJD6ZdheOYAJl/yOZ/YCMOFYygKBQCAQCAQCgUAgEAgEAoFAIBDYKXwAXSs8dJ1Ggb4AAAAASUVORK5CYII="},geometry:{default:{texturewidth:64,textureheight:64,visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],bones:[{name:"head",pivot:[0,24,0],cubes:[{origin:[-3,21,-3],size:[6,6,6],uv:[0,0]}]},{name:"rightEar",pivot:[0,24,0],cubes:[{origin:[-4,26,-2],size:[3,4,1],uv:[24,0]}],parent:"head"},{name:"leftEar",mirror:!0,pivot:[0,24,0],cubes:[{origin:[1,26,-2],size:[3,4,1],uv:[24,0]}],parent:"head"},{name:"body",pivot:[0,24,0],cubes:[{origin:[-3,8,-3],size:[6,12,6],uv:[0,16]},{origin:[-5,-8,0],size:[10,16,1],uv:[0,34]}]},{name:"rightWing",pivot:[0,24,0],cubes:[{origin:[-12,7,1.5],size:[10,16,1],uv:[42,0]}],parent:"body"},{name:"rightWingTip",mirror:!0,pivot:[-12,23,1.5],cubes:[{origin:[-20,10,1.5],size:[8,12,1],uv:[24,16]}],parent:"rightWing"},{name:"leftWing",mirror:!0,pivot:[0,24,0],cubes:[{origin:[2,7,1.5],size:[10,16,1],uv:[42,0]}],parent:"body"},{name:"leftWingTip",pivot:[12,23,1.5],cubes:[{origin:[12,10,1.5],size:[8,12,1],uv:[24,16]}],parent:"leftWing"}]}},render_controllers:["controller.render.bat"],spawn_egg:{texture:"spawn_egg",texture_index:18}},bee:{identifier:"minecraft:bee",materials:{default:"bee"},textures:{default:"textures/entity/bee/bee",angry:"textures/entity/bee/bee_angry",nectar:"textures/entity/bee/bee_nectar",angry_nectar:"textures/entity/bee/bee_angry_nectar"},geometry:{default:{texturewidth:64,textureheight:64,visible_bounds_width:1.5,visible_bounds_height:1.5,visible_bounds_offset:[0,.25,0],bones:[{name:"body",pivot:[.5,5,0],cubes:[{origin:[-3,2,-5],size:[7,7,10],uv:[0,0]},{origin:[2,7,-8],size:[1,2,3],uv:[2,0]},{origin:[-2,7,-8],size:[1,2,3],uv:[2,3]}],locators:{lead:[0,4,-1]}},{name:"stinger",parent:"body",pivot:[.5,6,1],cubes:[{origin:[.5,5,5],size:[0,1,2],uv:[26,7]}]},{name:"rightwing_bone",parent:"body",pivot:[-1,9,-3],rotation:[15,-15,0],cubes:[{origin:[-10,9,-3],size:[9,0,6],uv:[0,18]}]},{name:"leftwing_bone",parent:"body",pivot:[2,9,-3],rotation:[15,15,0],cubes:[{origin:[2,9,-3],size:[9,0,6],uv:[9,24]}]},{name:"leg_front",parent:"body",pivot:[2,2,-2],cubes:[{origin:[-3,0,-2],size:[7,2,0],uv:[26,1]}]},{name:"leg_mid",parent:"body",pivot:[2,2,0],cubes:[{origin:[-3,0,0],size:[7,2,0],uv:[26,3]}]},{name:"leg_back",parent:"body",pivot:[2,2,2],cubes:[{origin:[-3,0,2],size:[7,2,0],uv:[26,5]}]}]}},particle_effects:{nectar_dripping:"minecraft:nectar_drip_particle"},render_controllers:["controller.render.bee"],spawn_egg:{texture:"egg_bee",texture_index:0}},cave_spider:{identifier:"minecraft:cave_spider",min_engine_version:"1.8.0",materials:{default:"spider",invisible:"spider_invisible"},textures:{default:"textures/entity/spider/cave_spider"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"head",pivot:[0,9,-3],cubes:[{origin:[-4,5,-11],size:[8,8,8],uv:[32,4]}],parent:"body0"},{name:"body0",pivot:[0,9,0],cubes:[{origin:[-3,6,-3],size:[6,6,6],uv:[0,0]}]},{name:"body1",pivot:[0,9,9],cubes:[{origin:[-5,5,3],size:[10,8,12],uv:[0,12]}],parent:"body0"},{name:"leg0",pivot:[-4,9,2],cubes:[{origin:[-19,8,1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg1",pivot:[4,9,2],cubes:[{origin:[3,8,1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg2",pivot:[-4,9,1],cubes:[{origin:[-19,8,0],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg3",pivot:[4,9,1],cubes:[{origin:[3,8,0],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg4",pivot:[-4,9,0],cubes:[{origin:[-19,8,-1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg5",pivot:[4,9,0],cubes:[{origin:[3,8,-1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg6",pivot:[-4,9,-1],cubes:[{origin:[-19,8,-2],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg7",pivot:[4,9,-1],cubes:[{origin:[3,8,-2],size:[16,2,2],uv:[18,0]}],parent:"body0"}]}},render_controllers:["controller.render.spider"],spawn_egg:{texture:"spawn_egg",texture_index:22}},chest_minecart:{identifier:"minecraft:chest_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},command_block_minecart:{identifier:"minecraft:command_block_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},cow:{identifier:"minecraft:cow",min_engine_version:"1.8.0",materials:{default:"cow"},textures:{default:"textures/entity/cow/cow"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1.75,visible_bounds_offset:[0,.75,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-6,11,-5],size:[12,18,10],uv:[18,4]},{origin:[-2,11,-6],size:[4,6,1],uv:[52,0]}]},{name:"head",parent:"body",pivot:[0,20,-8],locators:{lead:[0,20,-8]},cubes:[{origin:[-4,16,-14],size:[8,8,6],uv:[0,0]},{origin:[-5,22,-12],size:[1,3,1],uv:[22,0]},{origin:[4,22,-12],size:[1,3,1],uv:[22,0]}]},{name:"leg0",parent:"body",pivot:[-4,12,7],cubes:[{origin:[-6,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[4,12,7],cubes:[{origin:[2,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-4,12,-6],cubes:[{origin:[-6,0,-7],size:[4,12,4],uv:[0,16]}]},{name:"leg3",parent:"body",mirror:!0,pivot:[4,12,-6],cubes:[{origin:[2,0,-7],size:[4,12,4],uv:[0,16]}]}]}},render_controllers:["controller.render.cow"],spawn_egg:{texture:"spawn_egg",texture_index:1}},dragon_fireball:{identifier:"minecraft:dragon_fireball",materials:{default:"fireball"},textures:{default:"textures/entity/enderdragon/dragon_fireball"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-4,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.fireball"]},drowned:{identifier:"minecraft:drowned",min_engine_version:"1.16.0",materials:{default:"drowned"},textures:{default:"textures/entity/zombie/drowned"},geometry:{default:{bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}]},{name:"jacket",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,32],inflate:.5}]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0],inflate:.5}]},{name:"hat",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:1}]},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-7,12,-2],size:[4,12,4],uv:[0,16]}]},{name:"leftArm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16],mirror:!0}]},{name:"rightSleeve",parent:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-7,12,-2],size:[4,12,4],uv:[48,48],inflate:.5}]},{name:"leftSleeve",parent:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,32],inflate:.5,mirror:!0}]},{name:"rightLeg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-4.05,0,-2],size:[4,12,4],uv:[16,48]}]},{name:"leftLeg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[.05,0,-2],size:[4,12,4],uv:[32,48],mirror:!0}]},{name:"rightPants",parent:"rightLeg",pivot:[-1.9,12,0],cubes:[{origin:[-4.25,0,-2],size:[4,12,4],uv:[0,48],inflate:.25}]},{name:"leftPants",parent:"leftLeg",pivot:[1.9,12,0],cubes:[{origin:[.25,0,-2],size:[4,12,4],uv:[0,32],inflate:.25,mirror:!0}]},{name:"waist",parent:"body",pivot:[0,12,0]},{name:"rightItem",parent:"rightArm",pivot:[-1,-45,-5]},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5]}],visible_bounds_width:2.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:64}},render_controllers:["controller.render.drowned"],enable_attachables:!0,spawn_egg:{texture:"spawn_egg",texture_index:48}},egg:{identifier:"minecraft:egg",materials:{default:"egg"},textures:{default:"textures/items/egg"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},elder_guardian:{identifier:"minecraft:elder_guardian",min_engine_version:"1.8.0",materials:{default:"guardian",ghost:"guardian_ghost"},textures:{default:"textures/entity/guardian",elder:"textures/entity/guardian_elder",beam:"textures/entity/guardian_beam"},geometry:{default:{visible_bounds_width:3.5,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"head",pivot:[0,0,0],mirror:!0,cubes:[{mirror:!1,origin:[-6,2,-8],size:[12,12,16],uv:[0,0]},{mirror:!1,origin:[-8,2,-6],size:[2,12,12],uv:[0,28]},{origin:[6,2,-6],size:[2,12,12],uv:[0,28]},{origin:[-6,14,-6],size:[12,2,12],uv:[16,40]},{origin:[-6,0,-6],size:[12,2,12],uv:[16,40]}]},{name:"eye",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,6,0],size:[2,2,1],uv:[8,0]}]},{name:"tailpart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-2,6,7],size:[4,4,8],uv:[40,0]}]},{name:"tailpart1",parent:"tailpart0",pivot:[0,24,0],cubes:[{origin:[0,7,0],size:[3,3,7],uv:[0,54]}]},{name:"tailpart2",parent:"tailpart1",pivot:[0,24,0],cubes:[{origin:[0,8,0],size:[2,2,6],uv:[41,32]},{origin:[1,4.5,3],size:[1,9,9],uv:[25,19]}]},{name:"spikepart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart1",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart2",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart3",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart4",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart5",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart6",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart7",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart8",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart9",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart10",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart11",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]}]},ghost:{visible_bounds_width:3.5,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"head",pivot:[0,24,0],mirror:!0,cubes:[{mirror:!1,origin:[-6,2,-8],size:[12,12,16],uv:[0,0]},{mirror:!1,origin:[-8,2,-6],size:[2,12,12],uv:[0,28]},{origin:[6,2,-6],size:[2,12,12],uv:[0,28]},{origin:[-6,14,-6],size:[12,2,12],uv:[16,40]},{origin:[-6,0,-6],size:[12,2,12],uv:[16,40]}]},{name:"eye",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,7,0],size:[2,2,1],uv:[8,0]}]},{name:"tailpart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-2,6,7],size:[4,4,8],uv:[40,0]}]},{name:"tailpart1",parent:"tailpart0",pivot:[0,24,0],cubes:[{origin:[0,7,0],size:[3,3,7],uv:[0,54]}]},{name:"tailpart2",parent:"tailpart1",pivot:[0,24,0],cubes:[{origin:[0,8,0],size:[2,2,6],uv:[41,32]},{origin:[1,4.5,3],size:[1,9,9],uv:[25,19]}]},{name:"spikepart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart1",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart2",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart3",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart4",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart5",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart6",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart7",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart8",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart9",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart10",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart11",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]}]}},render_controllers:["controller.render.guardian"],spawn_egg:{texture:"spawn_egg",texture_index:36}},eye_of_ender:{identifier:"minecraft:eye_of_ender_signal",materials:{default:"eye_of_ender_signal"},textures:{default:"textures/items/ender_eye"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},ender_pearl:{identifier:"minecraft:ender_pearl",materials:{default:"ender_pearl"},textures:{default:"textures/items/ender_pearl"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},evoker_fangs:{identifier:"minecraft:evocation_fang",materials:{default:"fang"},textures:{default:"textures/entity/illager/evoker_fangs"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:64,textureheight:32,bones:[{name:"upper_jaw",parent:"base",pivot:[0,11,0],cubes:[{origin:[-1.5,0,-4],size:[4,14,8],uv:[40,0],inflate:.01}]},{name:"lower_jaw",parent:"base",pivot:[0,11,0],bind_pose_rotation:[0,180,0],cubes:[{origin:[-1.5,0,-4],size:[4,14,8],uv:[40,0]}]},{name:"base",pivot:[0,0,0],bind_pose_rotation:[0,90,0],cubes:[{origin:[-5,0,-5],size:[10,12,10],uv:[0,0]}]}]}},render_controllers:["controller.render.evocation_fang"]},evoker:{identifier:"minecraft:evocation_illager",min_engine_version:"1.8.0",materials:{default:"evoker"},textures:{default:"textures/entity/illager/evoker"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[0,0]}]},{name:"nose",parent:"head",pivot:[0,26,0],cubes:[{origin:[-1,23,-6],size:[2,4,2],uv:[24,0]}]},{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-3],size:[8,12,6],uv:[16,20]},{origin:[-4,6,-3],size:[8,18,6],uv:[0,38],inflate:.5}]},{name:"arms",parent:"body",pivot:[0,22,0],cubes:[{origin:[-8,16,-2],size:[4,8,4],uv:[44,22]},{origin:[4,16,-2],size:[4,8,4],uv:[44,22]},{origin:[-4,16,-2],size:[8,4,4],uv:[40,38]}]},{name:"leg0",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"leg1",parent:"body",pivot:[2,12,0],mirror:!0,cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"rightArm",parent:"body",pivot:[-5,22,0],locators:{right_hand:[-6,12,0]},cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,46]}]},{name:"rightItem",pivot:[-5.5,16,.5],neverRender:!0,parent:"rightArm"},{name:"leftArm",parent:"body",pivot:[5,22,0],locators:{left_hand:[6,12,0]},mirror:!0,cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,46]}]}]}},particle_effects:{spell:"minecraft:evoker_spell"},render_controllers:["controller.render.evoker"],spawn_egg:{texture:"spawn_egg",texture_index:40}},experience_bottle:{identifier:"minecraft:xp_bottle",materials:{default:"xp_bottle"},textures:{default:"textures/items/experience_bottle",enchanted:"textures/misc/enchanted_item_glint"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.experience_bottle"]},experience_orb:{identifier:"minecraft:xp_orb",materials:{default:"experience_orb"},textures:{default:"textures/entity/experience_orb"},geometry:{default:{bones:[{name:"body",pivot:[8,8,0],cubes:[{origin:[0,0,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:64,textureheight:64}},render_controllers:["controller.render.experience_orb"]},fireball:{identifier:"minecraft:fireball",materials:{default:"fireball"},textures:{default:"textures/items/fire_charge"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-4,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.fireball"]},firework_rocket:{identifier:"minecraft:fireworks_rocket",materials:{default:"fireworks_rocket"},textures:{default:"textures/entity/fireworks"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],rotation:[0,90,0],size:[16,16,0],uv:{north:{uv:[0,0]}}},{origin:[-8,-8,0],rotation:[90,90,0],size:[16,16,0],uv:{north:{uv:[0,0]}}}]}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.fireworks_rocket"]},fishing_bobber:{identifier:"minecraft:fishing_hook",materials:{default:"fishing_hook"},textures:{default:"textures/entity/fishing_hook"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-1.5,-1.5,-1.5],size:[3,3,3],rotation:[0,0,180],uv:{up:{uv:[0,0]},down:{uv:[3,0]},south:{uv:[9,0],uv_size:[-3,3]},north:{uv:[9,0]},east:{uv:[12,0]},west:{uv:[15,0]}}},{origin:[0,-4.5,-.5],size:[0,3,3],uv:{east:{uv:[18,0]}}},{origin:[0,1.5,-1.5],size:[0,3,3],uv:{east:{uv:[21,0]}}},{origin:[-1.5,1.5,0],size:[3,3,0],uv:{north:{uv:[21,0]}}}]}],texturewidth:24,textureheight:3}},render_controllers:["controller.render.fishing_hook"]},hoglin:{identifier:"minecraft:hoglin",materials:{default:"hoglin"},textures:{default:"textures/entity/hoglin/hoglin"},geometry:{default:{bones:[{name:"body",pivot:[0,19,-3],cubes:[{origin:[-8,11,-7],size:[16,14,26],inflate:.02,uv:[1,1]},{origin:[0,22,-10],size:[0,10,19],inflate:.02,uv:[90,33]}],locators:{lead:[0,20,-5]}},{name:"head",parent:"body",pivot:[0,22,-5],rotation:[50,0,0],cubes:[{origin:[-7,21,-24],size:[14,6,19],uv:[61,1]},{origin:[-8,22,-19],size:[2,11,2],uv:[1,13]},{origin:[6,22,-19],size:[2,11,2],uv:[1,13]}]},{name:"right_ear",parent:"head",pivot:[-7,27,-7],rotation:[0,0,-50],cubes:[{origin:[-13,26,-10],size:[6,1,4],uv:[1,1]}]},{name:"left_ear",parent:"head",pivot:[7,27,-7],rotation:[0,0,50],cubes:[{origin:[7,26,-10],size:[6,1,4],uv:[1,6]}]},{name:"leg_back_right",pivot:[6,8,17],cubes:[{origin:[-8,0,13],size:[5,11,5],uv:[21,45]}]},{name:"leg_back_left",pivot:[-6,8,17],cubes:[{origin:[3,0,13],size:[5,11,5],uv:[0,45]}]},{name:"leg_front_right",pivot:[-6,12,-3],cubes:[{origin:[-8,0,-6],size:[6,14,6],uv:[66,42]}]},{name:"leg_front_left",pivot:[6,12,-3],cubes:[{origin:[2,0,-6],size:[6,14,6],uv:[41,42]}]}],visible_bounds_width:4,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:128,textureheight:64}},spawn_egg:{base_color:"#C66E55",overlay_color:"#5f6464"},render_controllers:["controller.render.hoglin"]},hopper_minecart:{identifier:"minecraft:hopper_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},husk:{identifier:"minecraft:husk",min_engine_version:"1.8.0",materials:{default:"husk"},textures:{default:"textures/entity/zombie/husk"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",neverRender:!0,pivot:[0,12,0]},{name:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-1.9,12,0],cubes:[{origin:[-3.9,0,-2],size:[4,12,4],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[1.9,12,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16]}],mirror:!0,parent:"body"}]}},scripts:{pre_animation:["variable.tcos0 = (Math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed / variable.gliding_speed_value) * 57.3;"]},animations:{humanoid_big_head:{loop:!0,bones:{head:{scale:1.4}}},look_at_target_default:{loop:!0,bones:{head:{relative_to:{rotation:"entity"},rotation:["query.target_x_rotation","query.target_y_rotation",0]}}},look_at_target_gliding:{loop:!0,bones:{head:{rotation:[-45,"query.target_y_rotation",0]}}},look_at_target_swimming:{loop:!0,bones:{head:{rotation:["math.lerp(query.target_x_rotation, -45.0, variable.swim_amount)","query.target_y_rotation",0]}}},move:{loop:!0,bones:{leftarm:{rotation:["variable.tcos0",0,0]},leftleg:{rotation:["variable.tcos0 * -1.4",0,0]},rightarm:{rotation:["-variable.tcos0",0,0]},rightleg:{rotation:["variable.tcos0 * 1.4",0,0]}}},"riding.arms":{loop:!0,bones:{leftarm:{rotation:[-36,0,0]},rightarm:{rotation:[-36,0,0]}}},"riding.legs":{loop:!0,bones:{leftleg:{rotation:["-72.0 - this","-18.0 - this","-this"]},rightleg:{rotation:["-72.0 - this","18.0 - this","-this"]}}},holding:{loop:!0,bones:{leftarm:{rotation:["variable.is_holding_left ? (-this * 0.5 - 18.0) : 0.0",0,0]},rightarm:{rotation:["variable.is_holding_right ? (-this * 0.5 - 18.0) : 0.0",0,0]}}},brandish_spear:{loop:!0,bones:{rightarm:{rotation:["this * -0.5 - 157.5 - 22.5 * variable.charge_amount","-this",0]}}},charging:{loop:!0,bones:{rightarm:{rotation:["22.5 * variable.charge_amount - this","-this",0]}}},"attack.rotations":{loop:!0,bones:{body:{rotation:[0,"math.sin(math.sqrt(variable.attack_time) * 360) * 11.46 - this",0]},leftarm:{rotation:["math.sin(math.sqrt(variable.attack_time) * 360) * 11.46",0,0]},rightarm:{rotation:["math.sin(1.0 - math.pow(1.0 - variable.attack_time, 3.0) * 180.0) * (variable.is_brandishing_spear ? -1.0 : 1.0 )","variable.is_brandishing_spear ? 0.0 : (math.sin(math.sqrt(variable.attack_time) * 360) * 11.46) * 2.0",0]}}},sneaking:{loop:!0,bones:{body:{rotation:["0.5 - this",0,0]},head:{position:[0,1,0]},leftarm:{rotation:[72,0,0]},leftleg:{position:[0,-3,4]},rightarm:{rotation:[72,0,0]},rightleg:{position:[0,-3,4]}}},bob:{loop:!0,bones:{leftarm:{rotation:[0,0,"((math.cos(query.life_time * 103.2) * 2.865) + 2.865) *-1.0"]},rightarm:{rotation:[0,0,"(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},damage_nearby_mobs:{loop:!0,bones:{leftarm:{rotation:["-45.0-this","-this","-this"]},leftleg:{rotation:["45.0-this","-this","-this"]},rightarm:{rotation:["45.0-this","-this","-this"]},rightleg:{rotation:["-45.0-this","-this","-this"]}}},bow_and_arrow:{loop:!0,bones:{leftarm:{rotation:["query.target_x_rotation - 90.0 - math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation + 28.65","-(math.cos(query.life_time * 103.2) * 2.865) - 2.865"]},rightarm:{rotation:["query.target_x_rotation - 90.0 + math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation - 5.73","(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},use_item_progress:{loop:!0,bones:{rightarm:{rotation:["variable.use_item_startup_progress * -60.0 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -22.5 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -5.625 + variable.use_item_interval_progress * 11.25"]}}},zombie_attack_bare_hand:{loop:!0,bones:{leftarm:{rotation:["-90.0 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) - (math.sin(query.life_time * 76.776372) * 2.865) - this","5.73 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 0.6) - this","math.cos(query.life_time * 103.13244) * -2.865 - 2.865 - this"]},rightarm:{rotation:["90.0 * (variable.is_brandishing_spear - 1.0) - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) + (math.sin(query.life_time * 76.776372) * 2.865) - this","(math.sin(variable.attack_time * 180.0) * 57.3) * 0.6 - 5.73 - this","math.cos(query.life_time * 103.13244) * 2.865 + 2.865 - this"]}}},swimming:{loop:!0,bones:{body:{position:[0,"variable.swim_amount * -10.0 - this","variable.swim_amount * 9.0 - this"],rotation:["variable.swim_amount * (90.0 + query.target_x_rotation)",0,0]},leftarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) - (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, 14.325, variable.swim_amount) - (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},leftleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0 + 180.0) * 0.3, variable.swim_amount)",0,0]},rightarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) + (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, -14.325, variable.swim_amount) + (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},rightleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0) * 0.3, variable.swim_amount)",0,0]}}}},animation_controllers:{humanoid_baby_big_head:{initial_state:"default",states:{baby:{animations:["humanoid_big_head"],transitions:[{default:"!query.is_baby"}]},default:{transitions:[{baby:"query.is_baby"}]}}},look_at_target:{initial_state:"default",states:{default:{animations:["look_at_target_default"],transitions:[{gliding:"query.is_gliding"},{swimming:"query.is_swimming"}]},gliding:{animations:["look_at_target_gliding"],transitions:[{swimming:"query.is_swimming"},{default:"!query.is_gliding"}]},swimming:{animations:["look_at_target_swimming"],transitions:[{gliding:"query.is_gliding"},{default:"!query.is_swimming"}]}}},move:{initial_state:"default",states:{default:{animations:["move"]}}},riding:{initial_state:"default",states:{default:{transitions:[{riding:"query.is_riding"}]},riding:{animations:["riding.arms","riding.legs"],transitions:[{default:"!query.is_riding"}]}}},holding:{initial_state:"default",states:{default:{animations:["holding"]}}},brandish_spear:{initial_state:"default",states:{brandish_spear:{animations:["brandish_spear"],transitions:[{default:"!variable.is_brandishing_spear"}]},default:{transitions:[{brandish_spear:"variable.is_brandishing_spear"}]}}},charging:{initial_state:"default",states:{charging:{animations:["charging"],transitions:[{default:"!query.is_charging"}]},default:{transitions:[{charging:"query.is_charging"}]}}},attack:{initial_state:"default",states:{attacking:{animations:["attack.rotations"],transitions:[{default:"variable.attack_time < 0.0"}]},default:{transitions:[{attacking:"variable.attack_time >= 0.0"}]}}},sneaking:{initial_state:"default",states:{default:{transitions:[{sneaking:"query.is_sneaking"}]},sneaking:{animations:["sneaking"],transitions:[{default:"!query.is_sneaking"}]}}},bob:{initial_state:"default",states:{default:{animations:["bob"]}}},damage_nearby_mobs:{initial_state:"default",states:{damage_nearby_mobs:{animations:["damage_nearby_mobs"],transitions:[{default:"!variable.damage_nearby_mobs"}]},default:{transitions:[{damage_nearby_mobs:"variable.damage_nearby_mobs"}]}}},bow_and_arrow:{initial_state:"default",states:{bow_and_arrow:{animations:["bow_and_arrow"],transitions:[{default:"!query.has_target"}]},default:{transitions:[{bow_and_arrow:"query.has_target"}]}}},use_item_progress:{initial_state:"default",states:{default:{transitions:[{use_item_progress:"( variable.use_item_interval_progress > 0.0 ) || ( variable.use_item_startup_progress > 0.0 )"}]},use_item_progress:{animations:["use_item_progress"],transitions:[{default:"( variable.use_item_interval_progress <= 0.0 ) && ( variable.use_item_startup_progress <= 0.0 )"}]}}},zombie_attack_bare_hand:{initial_state:"default",states:{default:{transitions:[{is_bare_hand:"variable.is_holding_left != 1.0"}]},is_bare_hand:{animations:["zombie_attack_bare_hand"],transitions:[{default:"variable.is_holding_left == 1.0"}]}}},swimming:{initial_state:"default",states:{default:{transitions:[{is_swimming:"variable.swim_amount > 0.0"}]},is_swimming:{animations:["swimming"],transitions:[{default:"variable.swim_amount <= 0.0"}]}}}},render_controllers:["controller.render.husk"],enable_attachables:!0,spawn_egg:{texture:"spawn_egg",texture_index:28}},iron_golem:{identifier:"minecraft:iron_golem",materials:{default:"iron_golem"},textures:{default:"textures/entity/iron_golem/iron_golem"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:128,textureheight:128,bones:[{name:"body",pivot:[0,31,0],cubes:[{origin:[-9,21,-6],size:[18,12,11],uv:[0,40]},{origin:[-4.5,16,-3],size:[9,5,6],uv:[0,70],inflate:.5}]},{name:"head",parent:"body",pivot:[0,31,-2],locators:{lead:[0,31,-2]},cubes:[{origin:[-4,33,-7.5],size:[8,10,8],uv:[0,0]},{origin:[-1,32,-9.5],size:[2,4,2],uv:[24,0]}]},{name:"arm0",parent:"body",pivot:[0,31,0],cubes:[{origin:[-13,3.5,-3],size:[4,30,6],uv:[60,21]}]},{name:"arm1",parent:"body",pivot:[0,31,0],cubes:[{origin:[9,3.5,-3],size:[4,30,6],uv:[60,58]}]},{name:"leg0",parent:"body",pivot:[-4,13,0],cubes:[{origin:[-7.5,0,-3],size:[6,16,5],uv:[37,0]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[5,13,0],cubes:[{origin:[1.5,0,-3],size:[6,16,5],uv:[60,0]}]}]}},render_controllers:["controller.render.iron_golem"]},item_frame:{identifier:"minecraft:item_frame",materials:{default:"item_frame"},textures:{background:"block:item_frame",frame:"block:oak_planks"},geometry:{background:{bones:[{name:"base"},{name:"background",parent:"base",rotation:[0,180,0],pivot:[0,0,0],cubes:[{origin:[-5,-5,-8],size:[10,10,.5],uv:[3,3]}]}],texturewidth:16,textureheight:16},frame:{bones:[{name:"frame",parent:"base",rotation:[0,180,0],pivot:[0,0,0],cubes:[{origin:[-6,-6,-8],size:[12,1,1],uv:[2,2]},{origin:[-6,5,-8],size:[12,1,1],uv:[2,13]},{origin:[-6,-5,-8],size:[1,10,1],uv:[2,3]},{origin:[5,-5,-8],size:[1,10,1],uv:[13,3]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_frame"]},leash_knot:{identifier:"minecraft:leash_knot",materials:{default:"leash_knot"},textures:{default:"textures/entity/lead_knot"},geometry:{default:{bones:[{name:"knot",rotation:[0,180,0],cubes:[{origin:[5,6,5],size:[6,8,6],uv:[0,0]}]}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.leash_knot"]},llama_spit:{identifier:"minecraft:llama_spit",materials:{default:"llama_spit"},textures:{default:"textures/entity/llama/spit"},geometry:{default:{visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,22,0],size:[2,2,2],uv:[0,0]},{origin:[0,26,0],size:[2,2,2],uv:[0,0]},{origin:[0,22,-4],size:[2,2,2],uv:[0,0]},{origin:[0,22,0],size:[2,2,2],uv:[0,0]},{origin:[2,22,0],size:[2,2,2],uv:[0,0]},{origin:[0,20,0],size:[2,2,2],uv:[0,0]},{origin:[0,22,2],size:[2,2,2],uv:[0,0]}]}]}},render_controllers:["controller.render.llama_spit"]},magma_cube:{identifier:"minecraft:magma_cube",materials:{default:"magma_cube"},textures:{default:"textures/entity/slime/magmacube"},geometry:{default:{visible_bounds_width:2.5,visible_bounds_height:5,visible_bounds_offset:[0,2.5,0],texturewidth:64,textureheight:32,bones:[{name:"bodyCube_0",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,7,-4],size:[8,1,8],uv:[0,0]}]},{name:"bodyCube_1",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,6,-4],size:[8,1,8],uv:[0,1]}]},{name:"bodyCube_2",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,5,-4],size:[8,1,8],uv:[24,10]}]},{name:"bodyCube_3",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,4,-4],size:[8,1,8],uv:[24,19]}]},{name:"bodyCube_4",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,3,-4],size:[8,1,8],uv:[0,4]}]},{name:"bodyCube_5",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,2,-4],size:[8,1,8],uv:[0,5]}]},{name:"bodyCube_6",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,1,-4],size:[8,1,8],uv:[0,6]}]},{name:"bodyCube_7",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,0,-4],size:[8,1,8],uv:[0,7]}]},{name:"insideCube",pivot:[0,0,0],cubes:[{origin:[-2,2,-2],size:[4,4,4],uv:[0,16]}]}]}},render_controllers:["controller.render.magma_cube"],spawn_egg:{texture:"spawn_egg",texture_index:20}},mooshroom:{identifier:"minecraft:mooshroom",min_engine_version:"1.8.0",materials:{default:"mooshroom"},textures:{default:"textures/entity/cow/red_mooshroom",brown:"textures/entity/cow/brown_mooshroom"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-6,11,-5],size:[12,18,10],uv:[18,4]},{origin:[-2,11,-6],size:[4,6,1],uv:[52,0]}]},{name:"head",pivot:[0,20,-8],locators:{lead:[0,20,-8]},cubes:[{origin:[-4,16,-14],size:[8,8,6],uv:[0,0]},{origin:[-5,22,-12],size:[1,3,1],uv:[22,0]},{origin:[4,22,-12],size:[1,3,1],uv:[22,0]}]},{name:"leg0",parent:"body",pivot:[-4,12,7],cubes:[{origin:[-6,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[4,12,7],cubes:[{origin:[2,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-4,12,-6],cubes:[{origin:[-6,0,-7],size:[4,12,4],uv:[0,16]}]},{name:"leg3",parent:"body",mirror:!0,pivot:[4,12,-6],cubes:[{origin:[2,0,-7],size:[4,12,4],uv:[0,16]}]}]}},render_controllers:["controller.render.mooshroom"],spawn_egg:{texture:"spawn_egg",texture_index:5}},panda:{identifier:"minecraft:panda",materials:{default:"panda"},textures:{default:"textures/entity/panda/panda",lazy:"textures/entity/panda/lazy_panda",worried:"textures/entity/panda/worried_panda",playful:"textures/entity/panda/playful_panda",brown:"textures/entity/panda/brown_panda",weak:"textures/entity/panda/weak_panda",aggressive:"textures/entity/panda/aggressive_panda"},geometry:{default:{texturewidth:64,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,12.5,-17],locators:{lead:[0,14,-16]},cubes:[{origin:[-6.5,7.5,-21],size:[13,10,9],uv:[0,6]},{origin:[-3.5,7.5,-23],size:[7,5,2],uv:[45,16]},{origin:[-8.5,16.5,-18],size:[5,4,1],uv:[52,25]},{origin:[3.5,16.5,-18],size:[5,4,1],uv:[52,25]}]},{name:"body",pivot:[0,14,0],bind_pose_rotation:[90,0,0],cubes:[{origin:[-9.5,1,-6.5],size:[19,26,13],uv:[0,25]}]},{name:"leg0",parent:"body",pivot:[-5.5,9,9],cubes:[{origin:[-8.5,0,6],size:[6,9,6],uv:[40,0]}]},{name:"leg1",parent:"body",pivot:[5.5,9,9],cubes:[{origin:[2.5,0,6],size:[6,9,6],uv:[40,0]}]},{name:"leg2",parent:"body",pivot:[-5.5,9,-9],cubes:[{origin:[-8.5,0,-12],size:[6,9,6],uv:[40,0]}]},{name:"leg3",parent:"body",pivot:[5.5,9,-9],cubes:[{origin:[2.5,0,-12],size:[6,9,6],uv:[40,0]}]}]}},render_controllers:["controller.render.panda"],spawn_egg:{texture:"spawn_egg",texture_index:54}},phantom:{identifier:"minecraft:phantom",materials:{default:"phantom",invisible:"phantom_invisible"},textures:{default:"textures/entity/phantom"},geometry:{default:{texturewidth:64,textureheight:64,bones:[{name:"body",pivot:[0,24,0],bind_pose_rotation:[0,0,0],cubes:[{origin:[-3,23,-8],size:[5,3,9],uv:[0,8]}]},{name:"wing0",pivot:[2,26,-8],bind_pose_rotation:[0,0,5.7],cubes:[{origin:[2,24,-8],size:[6,2,9],uv:[23,12]}],parent:"body"},{name:"wingtip0",pivot:[8,26,-8],bind_pose_rotation:[0,0,5.7],locators:{left_wing:[21,26,0]},cubes:[{origin:[8,25,-8],size:[13,1,9],uv:[16,24]}],parent:"wing0"},{name:"wing1",pivot:[-3,26,-8],bind_pose_rotation:[0,0,-5.7],mirror:!0,cubes:[{origin:[-9,24,-8],size:[6,2,9],uv:[23,12]}],parent:"body"},{name:"wingtip1",pivot:[-9,24,-8],bind_pose_rotation:[0,0,-5.7],locators:{right_wing:[-22,24,0]},mirror:!0,cubes:[{origin:[-22,25,-8],size:[13,1,9],uv:[16,24]}],parent:"wing1"},{name:"head",pivot:[0,23,-7],bind_pose_rotation:[11.5,0,0],cubes:[{origin:[-4,22,-12],size:[7,3,5],uv:[0,0]}],parent:"body"},{name:"tail",pivot:[0,26,1],bind_pose_rotation:[0,0,0],cubes:[{origin:[-2,24,1],size:[3,2,6],uv:[3,20]}],parent:"body"},{name:"tailtip",pivot:[0,25.5,7],bind_pose_rotation:[0,0,0],cubes:[{origin:[-1,24.5,7],size:[1,1,6],uv:[4,29]}],parent:"tail"}]}},particle_effects:{wing_dust:"minecraft:phantom_trail_particle"},sound_effects:{flap:"mob.phantom.flap"},render_controllers:["controller.render.phantom"],spawn_egg:{texture:"spawn_egg",texture_index:51}},pig:{identifier:"minecraft:pig",min_engine_version:"1.8.0",materials:{default:"pig"},textures:{default:"textures/entity/pig/pig",saddled:"textures/entity/pig/pig_saddle"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,13,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-5,7,-5],size:[10,16,8],uv:[28,8]}]},{name:"head",parent:"body",pivot:[0,12,-6],locators:{lead:[0,14,-6]},cubes:[{origin:[-4,8,-14],size:[8,8,8],uv:[0,0]},{origin:[-2,9,-15],size:[4,3,1],uv:[16,16]}]},{name:"leg0",parent:"body",pivot:[-3,6,7],cubes:[{origin:[-5,0,5],size:[4,6,4],uv:[0,16]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[3,6,7],cubes:[{origin:[1,0,5],size:[4,6,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-3,6,-5],cubes:[{origin:[-5,0,-7],size:[4,6,4],uv:[0,16]}]},{name:"leg3",parent:"body",mirror:!0,pivot:[3,6,-5],cubes:[{origin:[1,0,-7],size:[4,6,4],uv:[0,16]}]}]}},render_controllers:["controller.render.pig"],spawn_egg:{texture:"spawn_egg",texture_index:2}},piglin_brute:{identifier:"minecraft:piglin_brute",materials:{default:"piglin_brute"},textures:{default:"textures/entity/piglin/piglin_brute"},geometry:{default:{bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]},{origin:[-4,12,-2],size:[8,12,4],uv:[16,32],inflate:.25}]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-5,24,-4],size:[10,8,8],uv:[0,0],inflate:-.02},{origin:[-2,24,-5],size:[4,4,1],uv:[31,1]},{origin:[2,24,-5],size:[1,2,1],uv:[2,4]},{origin:[-3,24,-5],size:[1,2,1],uv:[2,0]}],inflate:-.02},{name:"leftear",parent:"head",pivot:[5,30,0],rotation:[0,0,-30],cubes:[{origin:[4,25,-2],size:[1,5,4],uv:[51,6]}]},{name:"rightear",parent:"head",pivot:[-5,30,0],rotation:[0,0,30],cubes:[{origin:[-5,25,-2],size:[1,5,4],uv:[39,6]}]},{name:"hat",parent:"head",pivot:[0,24,0]},{name:"rightarm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]},{origin:[-8,12,-2],size:[4,12,4],uv:[40,32],inflate:.25}]},{name:"rightItem",parent:"rightarm",pivot:[-1,-45,-5]},{name:"leftarm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[32,48]},{origin:[4,12,-2],size:[4,12,4],uv:[48,48],inflate:.25}]},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5]},{name:"rightleg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,16]},{origin:[-4,0,-2],size:[4,12,4],uv:[0,32],inflate:.25}]},{name:"leftleg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[16,48]},{origin:[0,0,-2],size:[4,12,4],uv:[0,48],inflate:.25}]}],visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:64}},spawn_egg:{base_color:"#592A10",overlay_color:"#F9F3A4"},render_controllers:["controller.render.piglin_brute"],enable_attachables:!0},polar_bear:{identifier:"minecraft:polar_bear",materials:{default:"polar_bear"},textures:{default:"textures/entity/bear/polarbear"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:128,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,14,-16],locators:{lead:[0,14,-16]},mirror:!0,cubes:[{mirror:!1,origin:[-3.5,10,-19],size:[7,7,7],uv:[0,0]},{mirror:!1,origin:[-2.5,10,-22],size:[5,3,3],uv:[0,44]},{mirror:!1,origin:[-4.5,16,-17],size:[2,2,1],uv:[26,0]},{origin:[2.5,16,-17],size:[2,2,1],uv:[26,0]}]},{name:"body",pivot:[-2,15,12],bind_pose_rotation:[90,0,0],cubes:[{origin:[-7,14,5],size:[14,14,11],uv:[0,19]},{origin:[-6,28,5],size:[12,12,10],uv:[39,0]}]},{name:"leg0",parent:"body",pivot:[-4.5,10,6],cubes:[{origin:[-6.5,0,4],size:[4,10,8],uv:[50,22]}]},{name:"leg1",parent:"body",pivot:[4.5,10,6],cubes:[{origin:[2.5,0,4],size:[4,10,8],uv:[50,22]}]},{name:"leg2",parent:"body",pivot:[-3.5,10,-8],cubes:[{origin:[-5.5,0,-10],size:[4,10,6],uv:[50,40]}]},{name:"leg3",parent:"body",pivot:[3.5,10,-8],cubes:[{origin:[1.5,0,-10],size:[4,10,6],uv:[50,40]}]}]}},render_controllers:["controller.render.polarbear"],spawn_egg:{texture:"spawn_egg",texture_index:37}},pufferfish:{identifier:"minecraft:pufferfish",min_engine_version:"1.8.0",materials:{default:"pufferfish"},textures:{default:"textures/entity/fish/pufferfish"},geometry:{default:{visible_bounds_width:.5,visible_bounds_height:.5,texturewidth:32,textureheight:32,bones:[{name:"body",cubes:[{origin:[-1.5,0,-1.5],size:[3,2,3],uv:[0,27]},{origin:[.5,2,-1.5],size:[1,1,1],uv:[24,6]},{origin:[-1.5,2,-1.5],size:[1,1,1],uv:[28,6]}],locators:{lead:[0,0,0]}},{name:"tailfin",parent:"body",cubes:[{origin:[-1.5,1,1.5],size:[3,0,3],uv:[-3,0]}]},{name:"leftFin",parent:"body",pivot:[6.5,5,.5],cubes:[{origin:[1.5,0,-1.5],size:[1,1,2],uv:[25,0],mirror:!0}]},{name:"rightFin",parent:"body",pivot:[-6.5,5,.5],cubes:[{origin:[-2.5,0,-1.5],size:[1,1,2],uv:[25,0]}]}]},mid:{visible_bounds_width:.5,visible_bounds_height:.5,texturewidth:32,textureheight:32,bones:[{name:"body",cubes:[{origin:[-2.5,1,-2.5],size:[5,5,5],uv:[12,22]}]},{name:"leftFin",parent:"body",pivot:[2.5,5,.5],cubes:[{origin:[2.5,4,-1.5],size:[2,1,2],uv:[24,3]}]},{name:"rightFin",parent:"body",pivot:[-2.5,5,.5],cubes:[{origin:[-4.5,4,-1.5],size:[2,1,2],uv:[24,0]}]},{name:"spines_top_front",parent:"body",bind_pose_rotation:[45,0,0],pivot:[0,6,-2.5],cubes:[{origin:[-2.5,6,-2.5],size:[5,1,0],uv:[19,17]}]},{name:"spines_top_back",parent:"body",bind_pose_rotation:[-45,0,0],pivot:[0,6,2.5],cubes:[{origin:[-2.5,6,2.5],size:[5,1,0],uv:[11,17]}]},{name:"spines_bottom_front",parent:"body",bind_pose_rotation:[-45,0,0],pivot:[0,1,-2.5],cubes:[{origin:[-2.5,0,-2.5],size:[5,1,0],uv:[18,20]}]},{name:"spines_bottom_back",parent:"body",bind_pose_rotation:[45,0,0],pivot:[0,1,2.5],rotation:[45,0,0],cubes:[{origin:[-2.5,0,2.5],size:[5,1,0],uv:[18,20]}]},{name:"spines_left_front",parent:"body",bind_pose_rotation:[0,45,0],pivot:[2.5,0,-2.5],rotation:[0,45,0],cubes:[{origin:[2.5,1,-2.5],size:[1,5,0],uv:[1,17]}]},{name:"spines_left_back",parent:"body",bind_pose_rotation:[0,-45,0],pivot:[2.5,0,2.5],rotation:[0,-45,0],cubes:[{origin:[2.5,1,2.5],size:[1,5,0],uv:[1,17]}]},{name:"spines_right_front",parent:"body",bind_pose_rotation:[0,-45,0],pivot:[-2.5,0,-2.5],rotation:[0,-45,0],cubes:[{origin:[-3.5,1,-2.5],size:[1,5,0],uv:[5,17]}]},{name:"spines_right_back",parent:"body",bind_pose_rotation:[0,45,0],pivot:[-2.5,0,2.5],rotation:[0,45,0],cubes:[{origin:[-3.5,1,2.5],size:[1,5,0],uv:[9,17]}]}]},large:{visible_bounds_width:.5,visible_bounds_height:.5,texturewidth:32,textureheight:32,bones:[{name:"body",cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,0]}]},{name:"leftFin",parent:"body",pivot:[4,7,1],cubes:[{origin:[4,6,-2.9904],size:[2,1,2],uv:[24,3]}]},{name:"rightFin",parent:"body",pivot:[-4,7,1],cubes:[{origin:[-5.9968,6,-2.992],size:[2,1,2],uv:[24,0]}]},{name:"spines_top_front",parent:"body",pivot:[-4,8,-4],bind_pose_rotation:[45,0,0],cubes:[{origin:[-4,8,-4],size:[8,1,1],uv:[14,16]}]},{name:"spines_top_mid",parent:"body",pivot:[0,8,0],cubes:[{origin:[-4,8,0],size:[8,1,1],uv:[14,16]}]},{name:"spines_top_back",parent:"body",pivot:[0,8,4],bind_pose_rotation:[-45,0,0],cubes:[{origin:[-4,8,4],size:[8,1,1],uv:[14,16]}]},{name:"spines_bottom_front",parent:"body",pivot:[0,0,-4],bind_pose_rotation:[-45,0,0],cubes:[{origin:[-4,-1,-4],size:[8,1,1],uv:[14,19]}]},{name:"spines_bottom_mid",parent:"body",pivot:[0,-1,0],cubes:[{origin:[-4,-1,0],size:[8,1,1],uv:[14,19]}]},{name:"spines_bottom_back",parent:"body",pivot:[0,0,4],bind_pose_rotation:[45,0,0],cubes:[{origin:[-4,-1,4],size:[8,1,1],uv:[14,19]}]},{name:"spines_left_front",parent:"body",pivot:[4,0,-4],bind_pose_rotation:[0,45,0],cubes:[{origin:[4,0,-4],size:[1,8,1],uv:[0,16]}]},{name:"spines_left_mid",parent:"body",pivot:[4,0,0],cubes:[{origin:[4,0,0],size:[1,8,1],uv:[4,16],mirror:!0}]},{name:"spines_left_back",parent:"body",pivot:[4,0,4],bind_pose_rotation:[0,-45,0],cubes:[{origin:[4,0,4],size:[1,8,1],uv:[8,16],mirror:!0}]},{name:"spines_right_front",parent:"body",pivot:[-4,0,-4],bind_pose_rotation:[0,-45,0],cubes:[{origin:[-5,0,-4],size:[1,8,1],uv:[4,16]}]},{name:"spines_right_mid",parent:"body",pivot:[-4,0,0],cubes:[{origin:[-5,0,0],size:[1,8,1],uv:[8,16]}]},{name:"spines_right_back",parent:"body",pivot:[-4,0,4],bind_pose_rotation:[0,45,0],cubes:[{origin:[-5,0,4],size:[1,8,1],uv:[8,16]}]}]}},render_controllers:[{"controller.render.pufferfish.small":"query.variant == 0"},{"controller.render.pufferfish.medium":"query.variant == 1"},{"controller.render.pufferfish.large":"query.variant == 2"}],spawn_egg:{texture:"spawn_egg",texture_index:46}},rabbit:{identifier:"minecraft:rabbit",min_engine_version:"1.8.0",materials:{default:"rabbit"},textures:{brown:"textures/entity/rabbit/brown",white:"textures/entity/rabbit/white",black:"textures/entity/rabbit/black",white_splotched:"textures/entity/rabbit/white_splotched",gold:"textures/entity/rabbit/gold",salt:"textures/entity/rabbit/salt",toast:"textures/entity/rabbit/toast"},geometry:{default:{visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"rearFootLeft",pivot:[3,6.5,3.7],mirror:!0,parent:"body",cubes:[{origin:[2,0,0],size:[2,1,7],uv:[8,24]}]},{name:"rearFootRight",pivot:[-3,6.5,3.7],mirror:!0,parent:"body",cubes:[{origin:[-4,0,0],size:[2,1,7],uv:[26,24]}]},{name:"haunchLeft",pivot:[3,6.5,3.7],bind_pose_rotation:[-20,0,0],mirror:!0,parent:"body",cubes:[{origin:[2,2.5,3.7],size:[2,4,5],uv:[16,15]}]},{name:"haunchRight",pivot:[-3,6.5,3.7],bind_pose_rotation:[-20,0,0],mirror:!0,parent:"body",cubes:[{origin:[-4,2.5,3.7],size:[2,4,5],uv:[30,15]}]},{name:"body",pivot:[0,5,8],bind_pose_rotation:[-20,0,0],mirror:!0,cubes:[{origin:[-3,2,-2],size:[6,5,10],uv:[0,0]}]},{name:"frontLegLeft",pivot:[3,7,-1],bind_pose_rotation:[-10,0,0],mirror:!0,parent:"body",cubes:[{origin:[2,0,-2],size:[2,7,2],uv:[8,15]}]},{name:"frontLegRight",pivot:[-3,7,-1],bind_pose_rotation:[-10,0,0],mirror:!0,parent:"body",cubes:[{origin:[-4,0,-2],size:[2,7,2],uv:[0,15]}]},{name:"head",pivot:[0,8,-1],locators:{lead:[0,8,-1]},mirror:!0,parent:"body",cubes:[{origin:[-2.5,8,-6],size:[5,4,5],uv:[32,0]}]},{name:"earRight",pivot:[0,8,-1],bind_pose_rotation:[0,-15,0],mirror:!0,parent:"body",cubes:[{origin:[-2.5,12,-2],size:[2,5,1],uv:[58,0]}]},{name:"earLeft",pivot:[0,8,-1],bind_pose_rotation:[0,15,0],mirror:!0,parent:"body",cubes:[{origin:[.5,12,-2],size:[2,5,1],uv:[52,0]}]},{name:"tail",pivot:[0,4,7],bind_pose_rotation:[-20,0,0],mirror:!0,parent:"body",cubes:[{origin:[-1.5,2.5,7],size:[3,3,2],uv:[52,6]}]},{name:"nose",pivot:[0,8,-1],mirror:!0,parent:"body",cubes:[{origin:[-.5,9.5,-6.5],size:[1,1,1],uv:[32,9]}]}]}},render_controllers:["controller.render.rabbit"],spawn_egg:{texture:"spawn_egg",texture_index:24}},ravager:{identifier:"minecraft:ravager",textures:{default:"textures/entity/illager/ravager"},materials:{default:"ravager"},geometry:{default:{bones:[{pivot:[0,19,2],rotation:[90,0,0],cubes:[{origin:[-7,10,-2],size:[14,16,20],uv:[0,55]},{origin:[-6,-3,-2],size:[12,13,18],uv:[0,91]}],name:"body"},{pivot:[0,15,-10],cubes:[{origin:[-8,13,-24],size:[16,3,16],uv:[0,36]}],name:"mouth",parent:"head"},{pivot:[0,20,-20],cubes:[{origin:[-5,21,-10],size:[10,10,18],uv:[68,73]}],name:"neck"},{locators:{stun:[0,32,-15]},pivot:[0,28,-10],cubes:[{origin:[-8,14,-24],size:[16,20,16],uv:[0,0]},{origin:[-2,12,-28],size:[4,8,4],uv:[0,0]}],name:"head",parent:"neck"},{pivot:[-12,30,22],cubes:[{origin:[-12,0,17],size:[8,37,8],uv:[96,0]}],name:"leg0"},{pivot:[4,30,22],cubes:[{origin:[4,0,17],size:[8,37,8],uv:[96,0]}],name:"leg1"},{pivot:[-4,26,-4],cubes:[{origin:[-12,0,-8],size:[8,37,8],uv:[64,0]}],name:"leg2"},{pivot:[-4,26,-4],cubes:[{origin:[4,0,-8],size:[8,37,8],uv:[64,0]}],name:"leg3"},{pivot:[-5,27,-19],rotation:[60,0,0],cubes:[{origin:[-10,27,-20],size:[2,14,4],uv:[74,55]},{origin:[8,27,-20],size:[2,14,4],uv:[74,55]}],name:"horns",parent:"head"}],texturewidth:128,textureheight:128,visible_bounds_width:4,visible_bounds_height:3.5,visible_bounds_offset:[0,1.25,0]}},render_controllers:["controller.render.ravager"],spawn_egg:{texture:"spawn_egg",texture_index:57},particle_effects:{stun_particles:"minecraft:stunned_emitter"}},salmon:{identifier:"minecraft:salmon",materials:{default:"salmon"},textures:{default:"textures/entity/fish/salmon"},geometry:{default:{visible_bounds_width:.5,visible_bounds_height:.5,visible_bounds_offset:[0,.5,0],texturewidth:32,textureheight:32,bones:[{name:"body_front",pivot:[0,0,-4],cubes:[{origin:[-1.5,3.5,-4],size:[3,5,8],uv:[0,0]}]},{name:"body_back",parent:"body_front",pivot:[0,0,4],cubes:[{origin:[-1.5,3.5,4],size:[3,5,8],uv:[0,13]}]},{name:"dorsal_front",parent:"body_front",pivot:[0,5,2],cubes:[{origin:[0,8.5,2],size:[0,2,2],uv:[4,2]}]},{name:"dorsal_back",parent:"body_back",pivot:[0,5,4],cubes:[{origin:[0,8.5,4],size:[0,2,3],uv:[2,3]}]},{name:"tailfin",parent:"body_back",pivot:[0,0,12],cubes:[{origin:[0,3.5,12],size:[0,5,6],uv:[20,10]}]},{name:"head",parent:"body_front",pivot:[0,3,-4],locators:{lead:[0,3,-4]},cubes:[{origin:[-1,4.5,-7],size:[2,4,3],uv:[22,0]}]},{name:"leftFin",parent:"body_front",pivot:[1.5,1,-4],rotation:[0,0,35],cubes:[{origin:[-.50752,3.86703,-4],size:[2,0,2],uv:[2,0]}]},{name:"rightFin",parent:"body_front",pivot:[-1.5,1,-4],rotation:[0,0,-35],cubes:[{origin:[-1.49258,3.86703,-4],size:[2,0,2],uv:[-2,0]}]}]}},render_controllers:["controller.render.salmon"],spawn_egg:{texture:"spawn_egg",texture_index:47}},sheep:{identifier:"minecraft:sheep",materials:{default:"sheep"},textures:{default:"textures/entity/sheep/sheep",wool:"textures/entity/sheep/sheep_fur"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1.75,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-4,13,-5],size:[8,16,6],uv:[28,8]}]},{name:"head",pivot:[0,18,-8],cubes:[{origin:[-3,16,-14],size:[6,6,8],uv:[0,0]}]},{name:"leg0",parent:"body",pivot:[-3,12,7],cubes:[{origin:[-5,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg1",parent:"body",pivot:[3,12,7],cubes:[{origin:[1,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-3,12,-5],cubes:[{origin:[-5,0,-7],size:[4,12,4],uv:[0,16]}]},{name:"leg3",parent:"body",pivot:[3,12,-5],cubes:[{origin:[1,0,-7],size:[4,12,4],uv:[0,16]}]}]},wool:{visible_bounds_width:2,visible_bounds_height:1.75,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"head",pivot:[0,18,-8],cubes:[{origin:[-3,16,-12],size:[6,6,6],uv:[0,32],inflate:.6}]},{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-4,13,-5],size:[8,16,6],uv:[28,40],inflate:1.75}]},{name:"leg0",parent:"body",pivot:[-3,12,7],cubes:[{origin:[-5,6,5],size:[4,6,4],uv:[0,48],inflate:.5}]},{name:"leg1",parent:"body",pivot:[3,12,7],cubes:[{origin:[1,6,5],size:[4,6,4],uv:[0,48],inflate:.5}]},{name:"leg2",parent:"body",pivot:[-3,12,-5],cubes:[{origin:[-5,6,-7],size:[4,6,4],uv:[0,48],inflate:.5}]},{name:"leg3",parent:"body",pivot:[3,12,-5],cubes:[{origin:[1,6,-7],size:[4,6,4],uv:[0,48],inflate:.5}]}]}}},shulker_bullet:{identifier:"minecraft:shulker_bullet",materials:{default:"shulker_bullet"},textures:{default:"textures/entity/shulker/spark"},geometry:{default:{texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-4,-4,-1],size:[8,8,2],uv:[0,0]},{origin:[-1,-4,-4],size:[2,8,8],uv:[0,10]},{origin:[-4,-1,-4],size:[8,2,8],uv:[20,0]}]}]}},render_controllers:["controller.render.shulker_bullet"]},silverfish:{identifier:"minecraft:silverfish",materials:{default:"silverfish",body_layer:"silverfish_layers"},textures:{default:"textures/entity/silverfish"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"bodyPart_0",parent:"bodyPart_2",pivot:[0,2,-3.5],cubes:[{origin:[-1.5,0,-4.5],size:[3,2,2],uv:[0,0]}]},{name:"bodyPart_1",parent:"bodyPart_2",pivot:[0,3,-1.5],cubes:[{origin:[-2,0,-2.5],size:[4,3,2],uv:[0,4]}]},{name:"bodyPart_2",pivot:[0,4,1],cubes:[{origin:[-3,0,-.5],size:[6,4,3],uv:[0,9]}]},{name:"bodyPart_3",parent:"bodyPart_2",pivot:[0,3,4],cubes:[{origin:[-1.5,0,2.5],size:[3,3,3],uv:[0,16]}]},{name:"bodyPart_4",parent:"bodyPart_2",pivot:[0,2,7],cubes:[{origin:[-1,0,5.5],size:[2,2,3],uv:[0,22]}]},{name:"bodyPart_5",parent:"bodyPart_2",pivot:[0,1,9.5],cubes:[{origin:[-1,0,8.5],size:[2,1,2],uv:[11,0]}]},{name:"bodyPart_6",parent:"bodyPart_2",pivot:[0,1,11.5],cubes:[{origin:[-.5,0,10.5],size:[1,1,2],uv:[13,4]}]},{name:"bodyLayer_0",parent:"bodyPart_2",pivot:[0,8,1],cubes:[{origin:[-5,0,-.5],size:[10,8,3],uv:[20,0]}]},{name:"bodyLayer_1",parent:"bodyPart_4",pivot:[0,4,7],cubes:[{origin:[-3,0,5.5],size:[6,4,3],uv:[20,11]}]},{name:"bodyLayer_2",parent:"bodyPart_1",pivot:[0,5,-1.5],cubes:[{origin:[-3,0,-3],size:[6,5,2],uv:[20,18]}]}]}},render_controllers:["controller.render.silverfish"],spawn_egg:{texture:"spawn_egg",texture_index:8}},skeleton:{identifier:"minecraft:skeleton",min_engine_version:"1.8.0",materials:{default:"skeleton"},textures:{default:"textures/entity/skeleton/skeleton"},geometry:{default:{texturewidth:64,textureheight:32,visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",pivot:[0,12,0]},{name:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-6,12,-1],size:[2,12,2],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-1],size:[2,12,2],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-2,12,0],cubes:[{origin:[-3,0,-1],size:[2,12,2],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[2,12,0],cubes:[{origin:[1,0,-1],size:[2,12,2],uv:[0,16]}],mirror:!0,parent:"body"}]}},spawn_egg:{texture:"spawn_egg",texture_index:9},render_controllers:["controller.render.skeleton"],enable_attachables:!0},skeleton_horse:{identifier:"minecraft:skeleton_horse",textures:{base_brown:"textures/entity/horse/horse_brown",base_white:"textures/entity/horse/horse_white",base_chestnut:"textures/entity/horse/horse_chestnut",base_creamy:"textures/entity/horse/horse_creamy",base_black:"textures/entity/horse/horse_black",base_gray:"textures/entity/horse/horse_gray",base_darkbrown:"textures/entity/horse/horse_darkbrown",markings_none:"textures/entity/horse/horse_markings_none",markings_white:"textures/entity/horse/horse_markings_white",markings_whitefield:"textures/entity/horse/horse_markings_whitefield",markings_whitedots:"textures/entity/horse/horse_markings_whitedots",markings_blackdots:"textures/entity/horse/horse_markings_blackdots",mule:"textures/entity/horse/mule",donkey:"textures/entity/horse/donkey",skeleton:"textures/entity/horse/horse_skeleton",zombie:"textures/entity/horse/horse_zombie",armor_none:"textures/entity/horse/armor/horse_armor_none",armor_leather:"textures/entity/horse/armor/horse_armor_leather",armor_iron:"textures/entity/horse/armor/horse_armor_iron",armor_gold:"textures/entity/horse/armor/horse_armor_gold",armor_diamond:"textures/entity/horse/armor/horse_armor_diamond"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:3,visible_bounds_offset:[0,1,0],texturewidth:128,textureheight:128,bones:[{name:"Body",pivot:[0,13,9],rotation:[0,0,0],cubes:[{origin:[-5,11,-10],size:[10,10,24],uv:[0,34]}]},{name:"TailA",pivot:[0,21,14],rotation:[-65,0,0],cubes:[{origin:[-1,20,14],size:[2,2,3],uv:[44,0]}]},{name:"TailB",pivot:[0,21,14],rotation:[-65,0,0],cubes:[{origin:[-1.5,19,17],size:[3,4,7],uv:[38,7]}]},{name:"TailC",pivot:[0,21,14],rotation:[-80.34,0,0],cubes:[{origin:[-1.5,21.5,23],size:[3,4,7],uv:[24,3]}]},{name:"Leg1A",pivot:[4,15,11],rotation:[0,0,0],cubes:[{origin:[1.5,8,8.5],size:[4,9,5],uv:[78,29]}]},{name:"Leg1B",pivot:[4,8,11],rotation:[0,0,0],cubes:[{origin:[2,3,9.5],size:[3,5,3],uv:[78,43]}]},{name:"Leg1C",pivot:[4,8,11],rotation:[0,0,0],cubes:[{origin:[1.5,-.1,9],size:[4,3,4],uv:[78,51]}]},{name:"Leg2A",pivot:[-4,15,11],rotation:[0,0,0],cubes:[{origin:[-5.5,8,8.5],size:[4,9,5],uv:[96,29]}]},{name:"Leg2B",pivot:[-4,8,11],rotation:[0,0,0],cubes:[{origin:[-5,3,9.5],size:[3,5,3],uv:[96,43]}]},{name:"Leg2C",pivot:[-4,8,11],rotation:[0,0,0],cubes:[{origin:[-5.5,-.1,9],size:[4,3,4],uv:[96,51]}]},{name:"Leg3A",pivot:[4,15,-8],rotation:[0,0,0],cubes:[{origin:[2.1,8,-10.1],size:[3,8,4],uv:[44,29]}]},{name:"Leg3B",pivot:[4,8,-8],rotation:[0,0,0],cubes:[{origin:[2.1,3,-9.6],size:[3,5,3],uv:[44,41]}]},{name:"Leg3C",pivot:[4,8,-8],rotation:[0,0,0],cubes:[{origin:[1.6,-.1,-10.1],size:[4,3,4],uv:[44,51]}]},{name:"Leg4A",pivot:[-4,15,-8],rotation:[0,0,0],cubes:[{origin:[-5.1,8,-10.1],size:[3,8,4],uv:[60,29]}]},{name:"Leg4B",pivot:[-4,8,-8],rotation:[0,0,0],cubes:[{origin:[-5.1,3,-9.6],size:[3,5,3],uv:[60,41]}]},{name:"Leg4C",pivot:[-4,8,-8],rotation:[0,0,0],cubes:[{origin:[-5.6,-.1,-10.1],size:[4,3,4],uv:[60,51]}]},{name:"Head",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.5,25,-11.5],size:[5,5,7],uv:[0,0]}]},{name:"UMouth",pivot:[0,20.05,-10],rotation:[30,0,0],cubes:[{origin:[-2,27.05,-17],size:[4,3,6],uv:[24,18]}]},{name:"LMouth",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2,25,-16.5],size:[4,2,5],uv:[24,27]}]},{name:"Ear1",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[.45,29,-6],size:[2,3,1],uv:[0,0]}]},{name:"Ear2",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.45,29,-6],size:[2,3,1],uv:[0,0]}]},{name:"MuleEarL",pivot:[0,20,-10],rotation:[30,0,15],cubes:[{origin:[-2,29,-6],size:[2,7,1],uv:[0,12]}]},{name:"MuleEarR",pivot:[0,20,-10],rotation:[30,0,-15],cubes:[{origin:[0,29,-6],size:[2,7,1],uv:[0,12]}]},{name:"Neck",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.05,15.8,-12],size:[4,14,8],uv:[0,12]}]},{name:"Bag1",pivot:[-7.5,21,10],rotation:[0,90,0],cubes:[{origin:[-10.5,13,10],size:[8,8,3],uv:[0,34]}]},{name:"Bag2",pivot:[4.5,21,10],rotation:[0,90,0],cubes:[{origin:[1.5,13,10],size:[8,8,3],uv:[0,47]}]},{name:"Saddle",pivot:[0,22,2],rotation:[0,0,0],cubes:[{origin:[-5,21,-1],size:[10,1,8],uv:[80,0]}]},{name:"SaddleB",pivot:[0,22,2],rotation:[0,0,0],cubes:[{origin:[-1.5,22,-1],size:[3,1,2],uv:[106,9]}]},{name:"SaddleC",pivot:[0,22,2],rotation:[0,0,0],cubes:[{origin:[-4,22,5],size:[8,1,2],uv:[80,9]}]},{name:"SaddleL2",pivot:[5,21,2],rotation:[0,0,0],cubes:[{origin:[4.5,13,1],size:[1,2,2],uv:[74,0]}]},{name:"SaddleL",pivot:[5,21,2],rotation:[0,0,0],cubes:[{origin:[4.5,15,1.5],size:[1,6,1],uv:[70,0]}]},{name:"SaddleR2",pivot:[-5,21,2],rotation:[0,0,0],cubes:[{origin:[-5.5,13,1],size:[1,2,2],uv:[74,4]}]},{name:"SaddleR",pivot:[-5,21,2],rotation:[0,0,0],cubes:[{origin:[-5.5,15,1.5],size:[1,6,1],uv:[80,0]}]},{name:"SaddleMouthL",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[1.5,26,-14],size:[1,2,2],uv:[74,13]}]},{name:"SaddleMouthR",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.5,26,-14],size:[1,2,2],uv:[74,13]}]},{name:"SaddleMouthLine",pivot:[0,20,-10],rotation:[0,0,0],cubes:[{origin:[2.6,23,-16],size:[0,3,16],uv:[44,10]}]},{name:"SaddleMouthLineR",pivot:[0,20,-10],rotation:[0,0,0],cubes:[{origin:[-2.6,23,-16],size:[0,3,16],uv:[44,5]}]},{name:"Mane",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-1,15.5,-5],size:[2,16,4],uv:[58,0]}]},{name:"HeadSaddle",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.5,25.1,-17],size:[5,5,12],uv:[80,12],inflate:.05}]}]}},spawn_egg:{texture:"spawn_egg",texture_index:32}},slime:{identifier:"minecraft:slime",materials:{default:"slime",outer:"slime_outer"},textures:{default:"textures/entity/slime/slime"},geometry:{default:{visible_bounds_width:5,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"cube",pivot:[0,24,0],cubes:[{origin:[-3,1,-3],size:[6,6,6],uv:[0,16]}]},{name:"eye0",parent:"cube",pivot:[0,24,0],cubes:[{origin:[-3.3,4,-3.5],size:[2,2,2],uv:[32,0]}]},{name:"eye1",parent:"cube",pivot:[0,24,0],cubes:[{origin:[1.3,4,-3.5],size:[2,2,2],uv:[32,4]}]},{name:"mouth",parent:"cube",pivot:[0,24,0],cubes:[{origin:[0,2,-3.5],size:[1,1,1],uv:[32,8]}]}]},armor:{visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"cube",pivot:[0,24,0],cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,0]}]},{name:"eye0",parent:"cube",pivot:[0,24,0],cubes:[{origin:[-3.3,4,-3.5],size:[2,2,2],uv:[32,0]}]},{name:"eye1",parent:"cube",pivot:[0,24,0],cubes:[{origin:[1.3,4,-3.5],size:[2,2,2],uv:[32,4]}]},{name:"mouth",parent:"cube",pivot:[0,24,0],cubes:[{origin:[0,2,-3.5],size:[1,1,1],uv:[32,8]}]}]}},render_controllers:["controller.render.slime","controller.render.slime_armor"],spawn_egg:{texture:"spawn_egg",texture_index:10}},small_fireball:{identifier:"minecraft:small_fireball",materials:{default:"fireball"},textures:{default:"textures/items/fire_charge"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-4,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.fireball"]},snow_golem:{identifier:"minecraft:snow_golem",min_engine_version:"1.8.0",materials:{default:"snow_golem",head:"snow_golem_pumpkin"},textures:{default:"textures/entity/snow_golem"},geometry:{default:{visible_bounds_width:1,visible_bounds_height:2,visible_bounds_offset:[0,1,0],bones:[{name:"head",parent:"piece1",pivot:[0,20,0],locators:{lead:[0,20,0]},cubes:[{origin:[-4,20,-4],size:[8,8,8],uv:[0,0],inflate:-.5}]},{name:"arm1",parent:"piece1",pivot:[0,18,0],bind_pose_rotation:[0,0,57.3],cubes:[{origin:[1,20,-1],size:[12,2,2],uv:[32,0],inflate:-.5}]},{name:"arm2",parent:"piece1",pivot:[0,18,0],bind_pose_rotation:[0,180,-57.3],cubes:[{origin:[1,20,-1],size:[12,2,2],uv:[32,0],inflate:-.5}]},{name:"piece1",parent:"piece2",pivot:[0,11,0],cubes:[{origin:[-5,11,-5],size:[10,10,10],uv:[0,16],inflate:-.5}]},{name:"piece2",pivot:[0,0,0],cubes:[{origin:[-6,0,-6],size:[12,12,12],uv:[0,36],inflate:-.5}]}]}},render_controllers:["controller.render.snowgolem"]},snowball:{identifier:"minecraft:snowball",materials:{default:"snowball"},textures:{default:"textures/items/snowball"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},potion:{identifier:"minecraft:splash_potion",materials:{default:"splash_potion_enchanted"},textures:{moveSlowdown:"textures/items/potion_bottle_splash_moveSlowdown",moveSpeed:"textures/items/potion_bottle_splash_moveSpeed",digSlowdown:"textures/items/potion_bottle_splash_digSlowdown",digSpeed:"textures/items/potion_bottle_splash_digSpeed",damageBoost:"textures/items/potion_bottle_splash_damageBoost",heal:"textures/items/potion_bottle_splash_heal",harm:"textures/items/potion_bottle_splash_harm",jump:"textures/items/potion_bottle_splash_jump",confusion:"textures/items/potion_bottle_splash_confusion",regeneration:"textures/items/potion_bottle_splash_regeneration",resistance:"textures/items/potion_bottle_splash_resistance",fireResistance:"textures/items/potion_bottle_splash_fireResistance",waterBreathing:"textures/items/potion_bottle_splash_waterBreathing",invisibility:"textures/items/potion_bottle_splash_invisibility",blindness:"textures/items/potion_bottle_splash_blindness",nightVision:"textures/items/potion_bottle_splash_nightVision",hunger:"textures/items/potion_bottle_splash_hunger",weakness:"textures/items/potion_bottle_splash_weakness",poison:"textures/items/potion_bottle_splash_poison",wither:"textures/items/potion_bottle_splash_wither",healthBoost:"textures/items/potion_bottle_splash_healthBoost",absorption:"textures/items/potion_bottle_splash_absorption",saturation:"textures/items/potion_bottle_splash_saturation",levitation:"textures/items/potion_bottle_splash_levitation",turtleMaster:"textures/items/potion_bottle_splash_turtleMaster",slowFall:"textures/items/potion_bottle_splash_slowFall",default:"textures/items/potion_bottle_splash",enchanted:"textures/misc/enchanted_item_glint"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.splash_potion"]},squid:{identifier:"minecraft:squid",materials:{default:"squid"},textures:{default:"textures/entity/squid"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"body",cubes:[{origin:[-6,-8,-6],size:[12,16,12],uv:[0,0]}]},{name:"tentacle1",parent:"body",pivot:[5,-7,0],cubes:[{origin:[4,-25,-1],size:[2,18,2],uv:[48,0]}],rotation:[0,90,0]},{name:"tentacle2",parent:"body",pivot:[3.5,-7,3.5],cubes:[{origin:[2.5,-25,2.5],size:[2,18,2],uv:[48,0]}],rotation:[0,45,0]},{name:"tentacle3",parent:"body",pivot:[0,-7,5],cubes:[{origin:[-1,-25,4],size:[2,18,2],uv:[48,0]}],rotation:[0,0,0]},{name:"tentacle4",parent:"body",pivot:[-3.5,-7,3.5],cubes:[{origin:[-4.5,-25,2.5],size:[2,18,2],uv:[48,0]}],rotation:[0,-45,0]},{name:"tentacle5",parent:"body",pivot:[-5,-7,0],cubes:[{origin:[-6,-25,-1],size:[2,18,2],uv:[48,0]}],rotation:[0,-90,0]},{name:"tentacle6",parent:"body",pivot:[-3.5,-7,-3.5],cubes:[{origin:[-4.5,-25,-4.5],size:[2,18,2],uv:[48,0]}],rotation:[0,-135,0]},{name:"tentacle7",parent:"body",pivot:[0,-7,-5],cubes:[{origin:[-1,-25,-6],size:[2,18,2],uv:[48,0]}],rotation:[0,-180,0]},{name:"tentacle8",parent:"body",pivot:[3.5,-7,-3.5],cubes:[{origin:[2.5,-25,-4.5],size:[2,18,2],uv:[48,0]}],rotation:[0,-225,0]}]}},render_controllers:["controller.render.squid"],spawn_egg:{texture:"spawn_egg",texture_index:15}},stray:{identifier:"minecraft:stray",min_engine_version:"1.8.0",materials:{default:"stray",overlay:"stray_clothes"},textures:{default:"textures/entity/skeleton/stray",overlay:"textures/entity/skeleton/stray_overlay"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",pivot:[0,12,0]},{name:"head",pivot:[0,24,0],locators:{lead:[0,24,0]},cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-6,12,-1],size:[2,12,2],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-1],size:[2,12,2],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-2,12,0],cubes:[{origin:[-3,0,-1],size:[2,12,2],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[2,12,0],cubes:[{origin:[1,0,-1],size:[2,12,2],uv:[0,16]}],mirror:!0,parent:"body"}]},overlay:{visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",parent:"waist",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],inflate:.25},{name:"waist",neverRender:!0,pivot:[0,12,0]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],inflate:.25},{name:"hat",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]}],inflate:.25},{name:"rightItem",parent:"rightArm",pivot:[-6,15,1],neverRender:!0},{name:"leftArm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16]}],mirror:!0,inflate:.25},{name:"rightLeg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-3.9,0,-2],size:[4,12,4],uv:[0,16]}],inflate:.25},{name:"leftLeg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16]}],inflate:.25,mirror:!0}]}},spawn_egg:{texture:"spawn_egg",texture_index:27},render_controllers:["controller.render.stray_clothes","controller.render.stray"],enable_attachables:!0},strider:{identifier:"minecraft:strider",materials:{default:"strider"},textures:{default:"textures/entity/strider/strider",saddled:"textures/entity/strider/strider",suffocated:"textures/entity/strider/strider_cold",suffocated_saddled:"textures/entity/strider/strider_cold"},geometry:{default:{bones:[{name:"right_leg",pivot:[-4,16,0],cubes:[{origin:[-6,0,-2],size:[4,16,4],uv:[0,32]}]},{name:"left_leg",pivot:[4,16,0],cubes:[{origin:[2,0,-2],size:[4,16,4],uv:[0,55]}]},{name:"body",pivot:[0,16,0],cubes:[{origin:[-8,14,-8],size:[16,14,16],uv:[0,0]}],locators:{lead:[0,15,-1]}},{name:"bristle5",parent:"body",pivot:[8,19,0],cubes:[{origin:[8,19,-8],size:[12,0,16],pivot:[8,19,0],rotation:[0,0,70],uv:[16,65]}]},{name:"bristle4",parent:"body",pivot:[8,24,0],cubes:[{origin:[8,24,-8],size:[12,0,16],pivot:[8,24,0],rotation:[0,0,65],uv:[16,49]}]},{name:"bristle3",parent:"body",pivot:[8,28,0],cubes:[{origin:[8,28,-8],size:[12,0,16],pivot:[8,28,0],rotation:[0,0,50],uv:[16,33]}]},{name:"bristle2",parent:"body",pivot:[-8,28,0],cubes:[{origin:[-20,28,-8],size:[12,0,16],pivot:[-8,28,0],rotation:[0,0,-50],uv:[16,33],mirror:!0}]},{name:"bristle1",parent:"body",pivot:[-8,24,0],cubes:[{origin:[-20,24,-8],size:[12,0,16],pivot:[-8,24,0],rotation:[0,0,-65],uv:[16,49],mirror:!0}]},{name:"bristle0",parent:"body",pivot:[-8,19,0],cubes:[{origin:[-20,19,-8],size:[12,0,16],pivot:[-8,19,0],rotation:[0,0,-70],uv:[16,65],mirror:!0}]}],visible_bounds_width:3,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:128}},spawn_egg:{base_color:"#9c3436",overlay_color:"#4d494d"},render_controllers:["controller.render.strider"]},text_display:{identifier:"minecraft:text_display",geometry:{}},trident:{identifier:"minecraft:thrown_trident",textures:{default:"textures/entity/trident",loyalty_rope:"textures/entity/lead_knot"},geometry:{default:{texturewidth:32,textureheight:32,bones:[{name:"pole",pivot:[0,24,0],cubes:[{origin:[-.5,-3,-.5],size:[1,31,1],inflate:.01,uv:[0,0]},{origin:[-1.5,22,-.5],size:[3,2,1],uv:[4,0]},{origin:[-2.5,23,-.5],size:[1,4,1],uv:[4,3]},{origin:[1.5,23,-.5],size:[1,4,1],uv:[4,3]}]}]}}},tnt_minecart:{identifier:"minecraft:tnt_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},tropical_fish:{identifier:"minecraft:tropicalfish",materials:{default:"tropicalfish"},textures:{typeA:"textures/entity/fish/tropical_a",typeB:"textures/entity/fish/tropical_b",aPattern1:"textures/entity/fish/tropical_a_pattern_1",aPattern2:"textures/entity/fish/tropical_a_pattern_2",aPattern3:"textures/entity/fish/tropical_a_pattern_3",aPattern4:"textures/entity/fish/tropical_a_pattern_4",aPattern5:"textures/entity/fish/tropical_a_pattern_5",aPattern6:"textures/entity/fish/tropical_a_pattern_6",bPattern1:"textures/entity/fish/tropical_b_pattern_1",bPattern2:"textures/entity/fish/tropical_b_pattern_2",bPattern3:"textures/entity/fish/tropical_b_pattern_3",bPattern4:"textures/entity/fish/tropical_b_pattern_4",bPattern5:"textures/entity/fish/tropical_b_pattern_5",bPattern6:"textures/entity/fish/tropical_b_pattern_6"},geometry:{typeA:{visible_bounds_width:.5,visible_bounds_height:.5,bones:[{pivot:[-.5,0,0],cubes:[{origin:[-1,0,-3],size:[2,3,6],uv:[0,0]},{origin:[0,3,-2.9992],size:[0,4,6],uv:[10,-6]}],name:"body"},{pivot:[0,0,3],cubes:[{origin:[0,0,3],size:[0,3,4],uv:[24,-4]}],name:"tailfin",parent:"body"},{pivot:[.5,0,1],bind_pose_rotation:[0,-35,0],cubes:[{origin:[.336,0,-.10594],size:[2,2,0],uv:[2,12]}],name:"leftFin",parent:"body"},{pivot:[-.5,0,1],bind_pose_rotation:[0,35,0],cubes:[{origin:[-2.336,0,-.10594],size:[2,2,0],uv:[2,16]}],name:"rightFin",parent:"body"}],texturewidth:32,textureheight:32},typeB:{visible_bounds_width:.5,visible_bounds_height:.5,bones:[{pivot:[-.5,0,0],cubes:[{origin:[-1,0,-8e-4],size:[2,6,6],uv:[0,20]},{origin:[0,-5,-8e-4],size:[0,5,6],uv:[20,21]},{origin:[0,6,-8e-4],size:[0,5,6],uv:[20,10]}],name:"body"},{pivot:[0,0,6],cubes:[{origin:[0,8e-4,6],size:[0,6,5],uv:[21,16]}],name:"tailfin",parent:"body"},{pivot:[.5,0,1],bind_pose_rotation:[0,-35,0],cubes:[{origin:[2.05673,0,2.35152],size:[2,2,0],uv:[2,12]}],name:"leftFin",parent:"body"},{pivot:[-.5,0,1],bind_pose_rotation:[0,35,0],cubes:[{origin:[-4.05673,0,2.35152],size:[2,2,0],uv:[2,16]}],name:"rightFin",parent:"body"}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.tropicalfish"],spawn_egg:{texture:"spawn_egg",texture_index:44}},vindicator:{identifier:"minecraft:vindicator",min_engine_version:"1.8.0",materials:{default:"vindicator"},textures:{default:"textures/entity/illager/vindicator"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[0,0]}]},{name:"nose",parent:"head",pivot:[0,26,0],cubes:[{origin:[-1,23,-6],size:[2,4,2],uv:[24,0]}]},{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-3],size:[8,12,6],uv:[16,20]},{origin:[-4,6,-3],size:[8,18,6],uv:[0,38],inflate:.5}]},{name:"arms",parent:"body",pivot:[0,22,0],cubes:[{origin:[-8,16,-2],size:[4,8,4],uv:[44,22]},{origin:[4,16,-2],size:[4,8,4],uv:[44,22]},{origin:[-4,16,-2],size:[8,4,4],uv:[40,38]}]},{name:"leg0",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"leg1",parent:"body",pivot:[2,12,0],mirror:!0,cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,46]}]},{name:"rightItem",pivot:[-5.5,16,.5],neverRender:!0,parent:"rightArm"},{name:"leftArm",parent:"body",pivot:[5,22,0],mirror:!0,cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,46]}]}]}},spawn_egg:{texture:"spawn_egg",texture_index:39},render_controllers:["controller.render.vindicator"],enable_attachables:!0},wandering_trader:{identifier:"minecraft:wandering_trader",materials:{default:"wandering_trader"},textures:{default:"textures/entity/wandering_trader"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],bones:[{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[0,0]}]},{name:"helmet",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[32,0],inflate:.5}]},{name:"brim",parent:"head",pivot:[0,24,0],bind_pose_rotation:[-90,0,0],cubes:[{origin:[-8,16,-6],size:[16,16,1],uv:[30,47],inflate:.1}]},{name:"nose",parent:"head",pivot:[0,26,0],cubes:[{origin:[-1,23,-6],size:[2,4,2],uv:[24,0]}]},{name:"body",locators:{lead_hold:[0,40,0]},cubes:[{origin:[-4,12,-3],size:[8,12,6],uv:[16,20]},{origin:[-4,6,-3],size:[8,18,6],uv:[0,38],inflate:.5}]},{name:"arms",parent:"body",pivot:[0,22,0],cubes:[{origin:[-4,16,-2],size:[8,4,4],uv:[40,38]},{origin:[-8,16,-2],size:[4,8,4],uv:[44,22]},{origin:[4,16,-2],size:[4,8,4],uv:[44,22],mirror:!0}]},{name:"held_item",parent:"arms",pivot:[0,0,0]},{name:"leg0",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"leg1",parent:"body",pivot:[2,12,0],cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[0,22],mirror:!0}]}]}},render_controllers:["controller.render.wandering_trader"],spawn_egg:{texture:"spawn_egg_wandering_trader"}},wither:{identifier:"minecraft:wither",min_engine_version:"1.8.0",materials:{default:"wither_boss",armor:"wither_boss_armor"},textures:{default:"textures/entity/wither/wither",armor_white:"textures/entity/wither/wither_armor",armor_blue:"textures/entity/wither/wither_armor",invulnerable:"textures/entity/wither/wither_invulnerable"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:4,visible_bounds_offset:[0,2,0],texturewidth:64,textureheight:64,bones:[{name:"upperBodyPart1",cubes:[{origin:[-10,17.1,-.5],size:[20,3,3],uv:[0,16]}]},{name:"upperBodyPart2",parent:"upperBodyPart1",pivot:[-2,17.1,-.5],cubes:[{origin:[-2,7.1,-.5],size:[3,10,3],uv:[0,22]},{origin:[-6,13.6,0],size:[11,2,2],uv:[24,22]},{origin:[-6,11.1,0],size:[11,2,2],uv:[24,22]},{origin:[-6,8.6,0],size:[11,2,2],uv:[24,22]}]},{name:"upperBodyPart3",parent:"upperBodyPart2",pivot:[0,24,0],cubes:[{origin:[0,18,0],size:[3,6,3],uv:[12,22]}]},{name:"head1",parent:"upperBodyPart1",pivot:[0,20,0],cubes:[{origin:[-4,20,-4],size:[8,8,8],uv:[0,0]}]},{name:"head2",parent:"upperBodyPart1",pivot:[-9,18,-1],cubes:[{origin:[-12,18,-4],size:[6,6,6],uv:[32,0]}]},{name:"head3",parent:"upperBodyPart1",pivot:[9,18,-1],cubes:[{origin:[6,18,-4],size:[6,6,6],uv:[32,0]}]}]},armor:{visible_bounds_width:3,visible_bounds_height:4,visible_bounds_offset:[0,2,0],texturewidth:64,textureheight:64,bones:[{name:"upperBodyPart1",cubes:[{origin:[-10,17.1,-.5],size:[20,3,3],uv:[0,16]}],inflate:2},{name:"upperBodyPart2",parent:"upperBodyPart1",pivot:[-2,17.1,-.5],cubes:[{origin:[-2,7.1,-.5],size:[3,10,3],uv:[0,22]},{origin:[-6,13.6,0],size:[11,2,2],uv:[24,22]},{origin:[-6,11.1,0],size:[11,2,2],uv:[24,22]},{origin:[-6,8.6,0],size:[11,2,2],uv:[24,22]}],inflate:2},{name:"upperBodyPart3",parent:"upperBodyPart2",pivot:[0,24,0],cubes:[{origin:[0,18,0],size:[3,6,3],uv:[12,22]}],inflate:2},{name:"head1",parent:"upperBodyPart1",pivot:[0,20,0],cubes:[{origin:[-4,20,-4],size:[8,8,8],uv:[0,0]}],inflate:2},{name:"head2",parent:"upperBodyPart1",pivot:[-9,18,-1],cubes:[{origin:[-12,18,-4],size:[6,6,6],uv:[32,0]}],inflate:2},{name:"head3",parent:"upperBodyPart1",pivot:[9,18,-1],cubes:[{origin:[6,18,-4],size:[6,6,6],uv:[32,0]}],inflate:2}]}},render_controllers:["controller.render.wither_boss","controller.render.wither_boss_armor_white","controller.render.wither_boss_armor_blue"]},wither_skeleton:{identifier:"minecraft:wither_skeleton",min_engine_version:"1.8.0",materials:{default:"skeleton"},textures:{default:"textures/entity/skeleton/wither_skeleton"},geometry:{default:{texturewidth:64,textureheight:32,visible_bounds_width:1.5,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],bones:[{name:"body",parent:"waist",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}]},{name:"waist",pivot:[0,12,0]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}]},{name:"hat",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-6,12,-1],size:[2,12,2],uv:[40,16]}]},{name:"rightItem",parent:"rightArm",pivot:[-1,-45,-5],neverRender:!0},{name:"leftArm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-1],size:[2,12,2],uv:[40,16]}],mirror:!0},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5],neverRender:!0},{name:"rightLeg",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-3,0,-1],size:[2,12,2],uv:[0,16]}]},{name:"leftLeg",parent:"body",pivot:[2,12,0],cubes:[{origin:[1,0,-1],size:[2,12,2],uv:[0,16]}],mirror:!0}]}},render_controllers:["controller.render.wither_skeleton"],enable_attachables:!0,spawn_egg:{texture:"spawn_egg",texture_index:29}},wither_skull:{identifier:"minecraft:wither_skull",materials:{default:"wither_skull"},textures:{default:"textures/entity/wither/wither"},geometry:{default:{bones:[{name:"head",cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,35]}]}],visible_bounds_width:1,visible_bounds_height:1,texturewidth:64,textureheight:64}},render_controllers:["controller.render.wither_skull"]},zoglin:{identifier:"minecraft:zoglin",materials:{default:"zoglin"},textures:{default:"textures/entity/hoglin/zoglin"},geometry:{default:{bones:[{name:"body",pivot:[0,19,-3],cubes:[{origin:[-8,11,-7],size:[16,14,26],inflate:.02,uv:[1,1]},{origin:[0,22,-10],size:[0,10,19],inflate:.02,uv:[90,33]}],locators:{lead:[0,20,-5]}},{name:"head",parent:"body",pivot:[0,22,-5],rotation:[50,0,0],cubes:[{origin:[-7,21,-24],size:[14,6,19],uv:[61,1]},{origin:[-8,22,-19],size:[2,11,2],uv:[1,13]},{origin:[6,22,-19],size:[2,11,2],uv:[1,13]}]},{name:"right_ear",parent:"head",pivot:[-7,27,-7],rotation:[0,0,-50],cubes:[{origin:[-13,26,-10],size:[6,1,4],uv:[1,1]}]},{name:"left_ear",parent:"head",pivot:[7,27,-7],rotation:[0,0,50],cubes:[{origin:[7,26,-10],size:[6,1,4],uv:[1,6]}]},{name:"leg_back_right",pivot:[6,8,17],cubes:[{origin:[-8,0,13],size:[5,11,5],uv:[21,45]}]},{name:"leg_back_left",pivot:[-6,8,17],cubes:[{origin:[3,0,13],size:[5,11,5],uv:[0,45]}]},{name:"leg_front_right",pivot:[-6,12,-3],cubes:[{origin:[-8,0,-6],size:[6,14,6],uv:[66,42]}]},{name:"leg_front_left",pivot:[6,12,-3],cubes:[{origin:[2,0,-6],size:[6,14,6],uv:[41,42]}]}],visible_bounds_width:4,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:128,textureheight:64}},spawn_egg:{base_color:"#c66e55",overlay_color:"#e6e6e6"},render_controllers:["controller.render.zoglin"]},zombie:{identifier:"minecraft:zombie",min_engine_version:"1.8.0",materials:{default:"zombie"},textures:{default:"textures/entity/zombie/zombie"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",neverRender:!0,pivot:[0,12,0]},{name:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-1.9,12,0],cubes:[{origin:[-3.9,0,-2],size:[4,12,4],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[1.9,12,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16]}],mirror:!0,parent:"body"}]}},spawn_egg:{texture:"spawn_egg",texture_index:12},scripts:{pre_animation:["variable.tcos0 = (Math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed / variable.gliding_speed_value) * 57.3;"]},animations:{humanoid_big_head:{loop:!0,bones:{head:{scale:1.4}}},look_at_target_default:{loop:!0,bones:{head:{relative_to:{rotation:"entity"},rotation:["query.target_x_rotation","query.target_y_rotation",0]}}},look_at_target_gliding:{loop:!0,bones:{head:{rotation:[-45,"query.target_y_rotation",0]}}},look_at_target_swimming:{loop:!0,bones:{head:{rotation:["math.lerp(query.target_x_rotation, -45.0, variable.swim_amount)","query.target_y_rotation",0]}}},move:{loop:!0,bones:{leftarm:{rotation:["variable.tcos0",0,0]},leftleg:{rotation:["variable.tcos0 * -1.4",0,0]},rightarm:{rotation:["-variable.tcos0",0,0]},rightleg:{rotation:["variable.tcos0 * 1.4",0,0]}}},"riding.arms":{loop:!0,bones:{leftarm:{rotation:[-36,0,0]},rightarm:{rotation:[-36,0,0]}}},"riding.legs":{loop:!0,bones:{leftleg:{rotation:["-72.0 - this","-18.0 - this","-this"]},rightleg:{rotation:["-72.0 - this","18.0 - this","-this"]}}},holding:{loop:!0,bones:{leftarm:{rotation:["variable.is_holding_left ? (-this * 0.5 - 18.0) : 0.0",0,0]},rightarm:{rotation:["variable.is_holding_right ? (-this * 0.5 - 18.0) : 0.0",0,0]}}},brandish_spear:{loop:!0,bones:{rightarm:{rotation:["this * -0.5 - 157.5 - 22.5 * variable.charge_amount","-this",0]}}},charging:{loop:!0,bones:{rightarm:{rotation:["22.5 * variable.charge_amount - this","-this",0]}}},"attack.rotations":{loop:!0,bones:{body:{rotation:[0,"math.sin(math.sqrt(variable.attack_time) * 360) * 11.46 - this",0]},leftarm:{rotation:["math.sin(math.sqrt(variable.attack_time) * 360) * 11.46",0,0]},rightarm:{rotation:["math.sin(1.0 - math.pow(1.0 - variable.attack_time, 3.0) * 180.0) * (variable.is_brandishing_spear ? -1.0 : 1.0 )","variable.is_brandishing_spear ? 0.0 : (math.sin(math.sqrt(variable.attack_time) * 360) * 11.46) * 2.0",0]}}},sneaking:{loop:!0,bones:{body:{rotation:["0.5 - this",0,0]},head:{position:[0,1,0]},leftarm:{rotation:[72,0,0]},leftleg:{position:[0,-3,4]},rightarm:{rotation:[72,0,0]},rightleg:{position:[0,-3,4]}}},bob:{loop:!0,bones:{leftarm:{rotation:[0,0,"((math.cos(query.life_time * 103.2) * 2.865) + 2.865) *-1.0"]},rightarm:{rotation:[0,0,"(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},damage_nearby_mobs:{loop:!0,bones:{leftarm:{rotation:["-45.0-this","-this","-this"]},leftleg:{rotation:["45.0-this","-this","-this"]},rightarm:{rotation:["45.0-this","-this","-this"]},rightleg:{rotation:["-45.0-this","-this","-this"]}}},bow_and_arrow:{loop:!0,bones:{leftarm:{rotation:["query.target_x_rotation - 90.0 - math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation + 28.65","-(math.cos(query.life_time * 103.2) * 2.865) - 2.865"]},rightarm:{rotation:["query.target_x_rotation - 90.0 + math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation - 5.73","(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},use_item_progress:{loop:!0,bones:{rightarm:{rotation:["variable.use_item_startup_progress * -60.0 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -22.5 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -5.625 + variable.use_item_interval_progress * 11.25"]}}},zombie_attack_bare_hand:{loop:!0,bones:{leftarm:{rotation:["-90.0 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) - (math.sin(query.life_time * 76.776372) * 2.865) - this","5.73 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 0.6) - this","math.cos(query.life_time * 103.13244) * -2.865 - 2.865 - this"]},rightarm:{rotation:["90.0 * (variable.is_brandishing_spear - 1.0) - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) + (math.sin(query.life_time * 76.776372) * 2.865) - this","(math.sin(variable.attack_time * 180.0) * 57.3) * 0.6 - 5.73 - this","math.cos(query.life_time * 103.13244) * 2.865 + 2.865 - this"]}}},swimming:{loop:!0,bones:{body:{position:[0,"variable.swim_amount * -10.0 - this","variable.swim_amount * 9.0 - this"],rotation:["variable.swim_amount * (90.0 + query.target_x_rotation)",0,0]},leftarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) - (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, 14.325, variable.swim_amount) - (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},leftleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0 + 180.0) * 0.3, variable.swim_amount)",0,0]},rightarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) + (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, -14.325, variable.swim_amount) + (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},rightleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0) * 0.3, variable.swim_amount)",0,0]}}}},animation_controllers:{humanoid_baby_big_head:{initial_state:"default",states:{baby:{animations:["humanoid_big_head"],transitions:[{default:"!query.is_baby"}]},default:{transitions:[{baby:"query.is_baby"}]}}},look_at_target:{initial_state:"default",states:{default:{animations:["look_at_target_default"],transitions:[{gliding:"query.is_gliding"},{swimming:"query.is_swimming"}]},gliding:{animations:["look_at_target_gliding"],transitions:[{swimming:"query.is_swimming"},{default:"!query.is_gliding"}]},swimming:{animations:["look_at_target_swimming"],transitions:[{gliding:"query.is_gliding"},{default:"!query.is_swimming"}]}}},move:{initial_state:"default",states:{default:{animations:["move"]}}},riding:{initial_state:"default",states:{default:{transitions:[{riding:"query.is_riding"}]},riding:{animations:["riding.arms","riding.legs"],transitions:[{default:"!query.is_riding"}]}}},holding:{initial_state:"default",states:{default:{animations:["holding"]}}},brandish_spear:{initial_state:"default",states:{brandish_spear:{animations:["brandish_spear"],transitions:[{default:"!variable.is_brandishing_spear"}]},default:{transitions:[{brandish_spear:"variable.is_brandishing_spear"}]}}},charging:{initial_state:"default",states:{charging:{animations:["charging"],transitions:[{default:"!query.is_charging"}]},default:{transitions:[{charging:"query.is_charging"}]}}},attack:{initial_state:"default",states:{attacking:{animations:["attack.rotations"],transitions:[{default:"variable.attack_time < 0.0"}]},default:{transitions:[{attacking:"variable.attack_time >= 0.0"}]}}},sneaking:{initial_state:"default",states:{default:{transitions:[{sneaking:"query.is_sneaking"}]},sneaking:{animations:["sneaking"],transitions:[{default:"!query.is_sneaking"}]}}},bob:{initial_state:"default",states:{default:{animations:["bob"]}}},damage_nearby_mobs:{initial_state:"default",states:{damage_nearby_mobs:{animations:["damage_nearby_mobs"],transitions:[{default:"!variable.damage_nearby_mobs"}]},default:{transitions:[{damage_nearby_mobs:"variable.damage_nearby_mobs"}]}}},bow_and_arrow:{initial_state:"default",states:{bow_and_arrow:{animations:["bow_and_arrow"],transitions:[{default:"!query.has_target"}]},default:{transitions:[{bow_and_arrow:"query.has_target"}]}}},use_item_progress:{initial_state:"default",states:{default:{transitions:[{use_item_progress:"( variable.use_item_interval_progress > 0.0 ) || ( variable.use_item_startup_progress > 0.0 )"}]},use_item_progress:{animations:["use_item_progress"],transitions:[{default:"( variable.use_item_interval_progress <= 0.0 ) && ( variable.use_item_startup_progress <= 0.0 )"}]}}},zombie_attack_bare_hand:{initial_state:"default",states:{default:{transitions:[{is_bare_hand:"variable.is_holding_left != 1.0"}]},is_bare_hand:{animations:["zombie_attack_bare_hand"],transitions:[{default:"variable.is_holding_left == 1.0"}]}}},swimming:{initial_state:"default",states:{default:{transitions:[{is_swimming:"variable.swim_amount > 0.0"}]},is_swimming:{animations:["swimming"],transitions:[{default:"variable.swim_amount <= 0.0"}]}}}},render_controllers:["controller.render.zombie"],enable_attachables:!0},zombified_piglin:{identifier:"minecraft:zombie_pigman",min_engine_version:"1.8.0",materials:{default:"zombie"},textures:{default:"textures/entity/piglin/zombified_piglin"},geometry:{default:{bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]},{origin:[-4,12,-2],size:[8,12,4],uv:[16,32],inflate:.25}]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-5,24,-4],size:[10,8,8],uv:[0,0],inflate:-.02},{origin:[-2,24,-5],size:[4,4,1],uv:[31,1]},{origin:[2,24,-5],size:[1,2,1],uv:[2,4]},{origin:[-3,24,-5],size:[1,2,1],uv:[2,0]}],inflate:-.02},{name:"leftear",parent:"head",pivot:[5,30,0],rotation:[0,0,-30],cubes:[{origin:[4,25,-2],size:[1,5,4],uv:[51,6]}]},{name:"rightear",parent:"head",pivot:[-5,30,0],rotation:[0,0,30],cubes:[{origin:[-5,25,-2],size:[1,5,4],uv:[39,6]}]},{name:"hat",parent:"head",pivot:[0,24,0]},{name:"rightarm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]},{origin:[-8,12,-2],size:[4,12,4],uv:[40,32],inflate:.25}]},{name:"rightItem",parent:"rightarm",pivot:[-1,-45,-5]},{name:"leftarm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[32,48]},{origin:[4,12,-2],size:[4,12,4],uv:[48,48],inflate:.25}]},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5]},{name:"rightleg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,16]},{origin:[-4,0,-2],size:[4,12,4],uv:[0,32],inflate:.25}]},{name:"leftleg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[16,48]},{origin:[0,0,-2],size:[4,12,4],uv:[0,48],inflate:.25}]}],visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:64}},spawn_egg:{texture:"spawn_egg",texture_index:13},render_controllers:["controller.render.zombie_pigman"],enable_attachables:!0}};A();E();R();x();var lr={};R5(lr,{allay:()=>$2,arrow:()=>E3,axolotl:()=>e3,blaze:()=>t3,boat:()=>L3,camel:()=>r3,cat:()=>n3,chicken:()=>i3,cod:()=>s3,creeper:()=>o3,dolphin:()=>a3,ender_dragon:()=>l3,enderman:()=>v3,endermite:()=>c3,fox:()=>d3,frog:()=>u3,ghast:()=>h3,goat:()=>f3,guardian:()=>m3,horse:()=>p3,llama:()=>g3,minecart:()=>b3,parrot:()=>y3,piglin:()=>_3,pillager:()=>w3,rabbit:()=>A3,shulker:()=>x3,sniffer:()=>R3,spider:()=>k3,tadpole:()=>S3,turtle:()=>T3,vex:()=>M3,villager:()=>C3,warden:()=>B3,witch:()=>P3,wolf:()=>I3,zombie_villager:()=>H3});A();E();R();x();var $2=`# Made in Blockbench 4.9.4
1178
+ `,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(t){t===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(t){!!t!="USE_DASH"in this.defines&&(this.needsUpdate=!0),t===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(t){!!t!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),t===!0?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}};var Z2=new e3,$2=new e3,I1=new ec,e5=class extends Z4{constructor(e=new I0,t=new H0({color:Math.random()*16777215})){super(e,t),this.isWireframe=!0,this.type="Wireframe"}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,r=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let o=0,l=0,a=t.count;o<a;o++,l+=2)Z2.fromBufferAttribute(t,o),$2.fromBufferAttribute(r,o),i[l]=l===0?0:i[l-1],i[l+1]=i[l]+Z2.distanceTo($2);let s=new $4(i,2,1);return e.setAttribute("instanceDistanceStart",new X2(s,1,0)),e.setAttribute("instanceDistanceEnd",new X2(s,1,1)),this}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(I1),this.material.uniforms.resolution.value.set(I1.z,I1.w))}};import{GLTFLoader as a9}from"three/examples/jsm/loaders/GLTFLoader.js";import l9 from"mc-assets/dist/other-textures/latest/entity/zombie/husk.png";import{Vec3 as hn}from"vec3";import v9 from"mc-assets/dist/other-textures/latest/entity/cat/ocelot.png";import c9 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/arrow.png";import d9 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/spectral_arrow.png";import u9 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/tipped_arrow.png";var t3={armor_stand:{identifier:"minecraft:armor_stand",min_engine_version:"1.8.0",materials:{default:"armor_stand"},textures:{default:"textures/entity/armorstand/wood"},geometry:{default:{bones:[{name:"baseplate",parent:"waist",cubes:[{origin:[-6,0,-6],size:[12,1,12],uv:[0,32]}]},{name:"waist",pivot:[0,12,0]},{name:"body",parent:"waist",pivot:[0,13,0],cubes:[{origin:[-6,21,-1.5],size:[12,3,3],uv:[0,26]},{origin:[-3,14,-1],size:[2,7,2],uv:[16,0]},{origin:[1,14,-1],size:[2,7,2],uv:[48,16]},{origin:[-4,12,-1],size:[8,2,2],uv:[0,48]}]},{name:"head",parent:"waist",pivot:[0,12,0],cubes:[{origin:[-1,24,-1],size:[2,7,2],uv:[0,0]}]},{name:"hat",parent:"head",pivot:[0,12,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0]}]},{name:"leftarm",parent:"waist",mirror:!0,pivot:[5,10,0],cubes:[{origin:[5,12,-1],size:[2,12,2],uv:[32,16]}]},{name:"leftitem",parent:"leftarm",pivot:[1,-9,-5]},{name:"leftleg",parent:"waist",mirror:!0,pivot:[1.9,1,0],cubes:[{origin:[.9,1,-1],size:[2,11,2],uv:[40,16]}]},{name:"rightarm",parent:"waist",pivot:[-5,10,0],cubes:[{origin:[-7,12,-1],size:[2,12,2],uv:[24,0]}]},{name:"rightitem",parent:"rightarm",pivot:[-1,-9,-5]},{name:"rightleg",parent:"waist",pivot:[-1.9,1,0],cubes:[{origin:[-2.9,1,-1],size:[2,11,2],uv:[8,0]}]}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64}},render_controllers:["controller.render.armor_stand"],enable_attachables:!0},arrow:{identifier:"minecraft:arrow",materials:{default:"arrow"},textures:{default:"textures/entity/arrow"},geometry:{default:{bones:[{name:"body",pivot:[0,1,0],cubes:[{origin:[0,-2.5,-3],rotation:[0,0,45],size:[0,5,16],uv:{east:{uv:[0,0]}}},{origin:[0,-2.5,-3],rotation:[0,0,-45],size:[0,5,16],uv:{east:{uv:[0,0]}}},{origin:[-2.5,-2.5,12],rotation:[0,0,45],size:[5,5,0],uv:{south:{uv:[0,5]}}}]}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.arrow"]},bat:{_comment:"Wing tip mirror flags are swapped vs vanilla Bedrock model: our addCube() mirror implementation flips UVs in the opposite direction, so rightWingTip needs mirror=true and leftWingTip needs mirror=false to render correctly.",identifier:"minecraft:bat",materials:{default:"bat"},textures:{default:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAALHSURBVHja7VrBSiQxFJybHvci6G1gF2TBwyoKelnWy55kWYS9ePDmD+in+KcevLb7GgpqipeeTkzPpGdewSNJmx6nKtXJS3oWiwTOv33pbs6Ou9vr731YHddQ5/ZiAHa/9cXnjLln62DyLALIL48P+4AIQ+RZAP2cnO909/PH4uvRQcdh1zSqwCMPIiDPIqwT8uHufMVJuDfnOxnhq9OT7vHPZR9WZxEgSjUBUi7IcQBG++XpphfB6rgvVwCQ//f7og8WAeL8F6Kr6oD7X8s+PPuOmQNYAAsIUOIAkDeSLIK1LeCMagIweZQ8iRkBlJuYl5gwSlxjZ2R9KM/2XBphsyxEQGhfOCEVNQXQ0UZdo2i21+edR57DmxjZFRpTCaD2/7QAXsAFcEKq3zYEGHJBtgCeC97f3vtnG0uY1e1aavQ3/QgMuaBoDtCsDyWv3yqSlxhpTClAygXZArAILIaS8ezOo52TIJVA1/sqAswRnhCfEoAnuqGkZwpbZxJfyflTQuysAN7GxxNiZ62fEoCFMBGqpcK8h8ckqIkRoiU3VPkHIM/2R4rMaTLK0pGr9oVrw9v7Iy/QDLFEAH5umxTAW9utreTHOuD1+e/KaQ4mrGrb1ykE0L07HODFmKMsJs1b2GYfAc0MdYPEThiTvIA8DjWayNxSs3pJePPDOvJNCKDL27r22L95AlRJXaewuh57cVuPx7Acen1VlNkIoKR0++udCer84PXn42wj660EW38BooS99rqTn1R/FkCTnibyAH3l5bW9GOqjx+Wa8TWVCXpn/NzW63oIote1bH6HlSKUK0BKkFkIgDSX01+taz9+vTV0X/MC6Hu+1OFmSb9tHp6MRopIrQgBAjMDtr2bfOvb3KTIP2vZy9HnvH6vXJD6ZdheOYAJl/yOZ/YCMOFYygKBQCAQCAQCgUAgEAgEAoFAIBDYKXwAXSs8dJ1Ggb4AAAAASUVORK5CYII="},geometry:{default:{texturewidth:64,textureheight:64,visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],bones:[{name:"head",pivot:[0,24,0],cubes:[{origin:[-3,21,-3],size:[6,6,6],uv:[0,0]}]},{name:"rightEar",pivot:[0,24,0],cubes:[{origin:[-4,26,-2],size:[3,4,1],uv:[24,0]}],parent:"head"},{name:"leftEar",mirror:!0,pivot:[0,24,0],cubes:[{origin:[1,26,-2],size:[3,4,1],uv:[24,0]}],parent:"head"},{name:"body",pivot:[0,24,0],cubes:[{origin:[-3,8,-3],size:[6,12,6],uv:[0,16]},{origin:[-5,-8,0],size:[10,16,1],uv:[0,34]}]},{name:"rightWing",pivot:[0,24,0],cubes:[{origin:[-12,7,1.5],size:[10,16,1],uv:[42,0]}],parent:"body"},{name:"rightWingTip",mirror:!0,pivot:[-12,23,1.5],cubes:[{origin:[-20,10,1.5],size:[8,12,1],uv:[24,16]}],parent:"rightWing"},{name:"leftWing",mirror:!0,pivot:[0,24,0],cubes:[{origin:[2,7,1.5],size:[10,16,1],uv:[42,0]}],parent:"body"},{name:"leftWingTip",pivot:[12,23,1.5],cubes:[{origin:[12,10,1.5],size:[8,12,1],uv:[24,16]}],parent:"leftWing"}]}},render_controllers:["controller.render.bat"],spawn_egg:{texture:"spawn_egg",texture_index:18}},bee:{identifier:"minecraft:bee",materials:{default:"bee"},textures:{default:"textures/entity/bee/bee",angry:"textures/entity/bee/bee_angry",nectar:"textures/entity/bee/bee_nectar",angry_nectar:"textures/entity/bee/bee_angry_nectar"},geometry:{default:{texturewidth:64,textureheight:64,visible_bounds_width:1.5,visible_bounds_height:1.5,visible_bounds_offset:[0,.25,0],bones:[{name:"body",pivot:[.5,5,0],cubes:[{origin:[-3,2,-5],size:[7,7,10],uv:[0,0]},{origin:[2,7,-8],size:[1,2,3],uv:[2,0]},{origin:[-2,7,-8],size:[1,2,3],uv:[2,3]}],locators:{lead:[0,4,-1]}},{name:"stinger",parent:"body",pivot:[.5,6,1],cubes:[{origin:[.5,5,5],size:[0,1,2],uv:[26,7]}]},{name:"rightwing_bone",parent:"body",pivot:[-1,9,-3],rotation:[15,-15,0],cubes:[{origin:[-10,9,-3],size:[9,0,6],uv:[0,18]}]},{name:"leftwing_bone",parent:"body",pivot:[2,9,-3],rotation:[15,15,0],cubes:[{origin:[2,9,-3],size:[9,0,6],uv:[9,24]}]},{name:"leg_front",parent:"body",pivot:[2,2,-2],cubes:[{origin:[-3,0,-2],size:[7,2,0],uv:[26,1]}]},{name:"leg_mid",parent:"body",pivot:[2,2,0],cubes:[{origin:[-3,0,0],size:[7,2,0],uv:[26,3]}]},{name:"leg_back",parent:"body",pivot:[2,2,2],cubes:[{origin:[-3,0,2],size:[7,2,0],uv:[26,5]}]}]}},particle_effects:{nectar_dripping:"minecraft:nectar_drip_particle"},render_controllers:["controller.render.bee"],spawn_egg:{texture:"egg_bee",texture_index:0}},cave_spider:{identifier:"minecraft:cave_spider",min_engine_version:"1.8.0",materials:{default:"spider",invisible:"spider_invisible"},textures:{default:"textures/entity/spider/cave_spider"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"head",pivot:[0,9,-3],cubes:[{origin:[-4,5,-11],size:[8,8,8],uv:[32,4]}],parent:"body0"},{name:"body0",pivot:[0,9,0],cubes:[{origin:[-3,6,-3],size:[6,6,6],uv:[0,0]}]},{name:"body1",pivot:[0,9,9],cubes:[{origin:[-5,5,3],size:[10,8,12],uv:[0,12]}],parent:"body0"},{name:"leg0",pivot:[-4,9,2],cubes:[{origin:[-19,8,1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg1",pivot:[4,9,2],cubes:[{origin:[3,8,1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg2",pivot:[-4,9,1],cubes:[{origin:[-19,8,0],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg3",pivot:[4,9,1],cubes:[{origin:[3,8,0],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg4",pivot:[-4,9,0],cubes:[{origin:[-19,8,-1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg5",pivot:[4,9,0],cubes:[{origin:[3,8,-1],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg6",pivot:[-4,9,-1],cubes:[{origin:[-19,8,-2],size:[16,2,2],uv:[18,0]}],parent:"body0"},{name:"leg7",pivot:[4,9,-1],cubes:[{origin:[3,8,-2],size:[16,2,2],uv:[18,0]}],parent:"body0"}]}},render_controllers:["controller.render.spider"],spawn_egg:{texture:"spawn_egg",texture_index:22}},chest_minecart:{identifier:"minecraft:chest_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},command_block_minecart:{identifier:"minecraft:command_block_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},cow:{identifier:"minecraft:cow",min_engine_version:"1.8.0",materials:{default:"cow"},textures:{default:"textures/entity/cow/cow"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1.75,visible_bounds_offset:[0,.75,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-6,11,-5],size:[12,18,10],uv:[18,4]},{origin:[-2,11,-6],size:[4,6,1],uv:[52,0]}]},{name:"head",parent:"body",pivot:[0,20,-8],locators:{lead:[0,20,-8]},cubes:[{origin:[-4,16,-14],size:[8,8,6],uv:[0,0]},{origin:[-5,22,-12],size:[1,3,1],uv:[22,0]},{origin:[4,22,-12],size:[1,3,1],uv:[22,0]}]},{name:"leg0",parent:"body",pivot:[-4,12,7],cubes:[{origin:[-6,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[4,12,7],cubes:[{origin:[2,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-4,12,-6],cubes:[{origin:[-6,0,-7],size:[4,12,4],uv:[0,16]}]},{name:"leg3",parent:"body",mirror:!0,pivot:[4,12,-6],cubes:[{origin:[2,0,-7],size:[4,12,4],uv:[0,16]}]}]}},render_controllers:["controller.render.cow"],spawn_egg:{texture:"spawn_egg",texture_index:1}},dragon_fireball:{identifier:"minecraft:dragon_fireball",materials:{default:"fireball"},textures:{default:"textures/entity/enderdragon/dragon_fireball"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-4,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.fireball"]},drowned:{identifier:"minecraft:drowned",min_engine_version:"1.16.0",materials:{default:"drowned"},textures:{default:"textures/entity/zombie/drowned"},geometry:{default:{bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}]},{name:"jacket",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,32],inflate:.5}]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0],inflate:.5}]},{name:"hat",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:1}]},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-7,12,-2],size:[4,12,4],uv:[0,16]}]},{name:"leftArm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16],mirror:!0}]},{name:"rightSleeve",parent:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-7,12,-2],size:[4,12,4],uv:[48,48],inflate:.5}]},{name:"leftSleeve",parent:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,32],inflate:.5,mirror:!0}]},{name:"rightLeg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-4.05,0,-2],size:[4,12,4],uv:[16,48]}]},{name:"leftLeg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[.05,0,-2],size:[4,12,4],uv:[32,48],mirror:!0}]},{name:"rightPants",parent:"rightLeg",pivot:[-1.9,12,0],cubes:[{origin:[-4.25,0,-2],size:[4,12,4],uv:[0,48],inflate:.25}]},{name:"leftPants",parent:"leftLeg",pivot:[1.9,12,0],cubes:[{origin:[.25,0,-2],size:[4,12,4],uv:[0,32],inflate:.25,mirror:!0}]},{name:"waist",parent:"body",pivot:[0,12,0]},{name:"rightItem",parent:"rightArm",pivot:[-1,-45,-5]},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5]}],visible_bounds_width:2.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:64}},render_controllers:["controller.render.drowned"],enable_attachables:!0,spawn_egg:{texture:"spawn_egg",texture_index:48}},egg:{identifier:"minecraft:egg",materials:{default:"egg"},textures:{default:"textures/items/egg"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},elder_guardian:{identifier:"minecraft:elder_guardian",min_engine_version:"1.8.0",materials:{default:"guardian",ghost:"guardian_ghost"},textures:{default:"textures/entity/guardian",elder:"textures/entity/guardian_elder",beam:"textures/entity/guardian_beam"},geometry:{default:{visible_bounds_width:3.5,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"head",pivot:[0,0,0],mirror:!0,cubes:[{mirror:!1,origin:[-6,2,-8],size:[12,12,16],uv:[0,0]},{mirror:!1,origin:[-8,2,-6],size:[2,12,12],uv:[0,28]},{origin:[6,2,-6],size:[2,12,12],uv:[0,28]},{origin:[-6,14,-6],size:[12,2,12],uv:[16,40]},{origin:[-6,0,-6],size:[12,2,12],uv:[16,40]}]},{name:"eye",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,6,0],size:[2,2,1],uv:[8,0]}]},{name:"tailpart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-2,6,7],size:[4,4,8],uv:[40,0]}]},{name:"tailpart1",parent:"tailpart0",pivot:[0,24,0],cubes:[{origin:[0,7,0],size:[3,3,7],uv:[0,54]}]},{name:"tailpart2",parent:"tailpart1",pivot:[0,24,0],cubes:[{origin:[0,8,0],size:[2,2,6],uv:[41,32]},{origin:[1,4.5,3],size:[1,9,9],uv:[25,19]}]},{name:"spikepart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart1",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart2",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart3",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart4",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart5",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart6",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart7",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart8",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart9",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart10",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart11",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]}]},ghost:{visible_bounds_width:3.5,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"head",pivot:[0,24,0],mirror:!0,cubes:[{mirror:!1,origin:[-6,2,-8],size:[12,12,16],uv:[0,0]},{mirror:!1,origin:[-8,2,-6],size:[2,12,12],uv:[0,28]},{origin:[6,2,-6],size:[2,12,12],uv:[0,28]},{origin:[-6,14,-6],size:[12,2,12],uv:[16,40]},{origin:[-6,0,-6],size:[12,2,12],uv:[16,40]}]},{name:"eye",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,7,0],size:[2,2,1],uv:[8,0]}]},{name:"tailpart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-2,6,7],size:[4,4,8],uv:[40,0]}]},{name:"tailpart1",parent:"tailpart0",pivot:[0,24,0],cubes:[{origin:[0,7,0],size:[3,3,7],uv:[0,54]}]},{name:"tailpart2",parent:"tailpart1",pivot:[0,24,0],cubes:[{origin:[0,8,0],size:[2,2,6],uv:[41,32]},{origin:[1,4.5,3],size:[1,9,9],uv:[25,19]}]},{name:"spikepart0",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart1",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart2",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart3",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart4",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart5",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart6",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart7",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart8",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart9",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart10",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]},{name:"spikepart11",parent:"head",pivot:[0,24,0],cubes:[{origin:[-1,19.5,-1],size:[2,9,2],uv:[0,0]}]}]}},render_controllers:["controller.render.guardian"],spawn_egg:{texture:"spawn_egg",texture_index:36}},eye_of_ender:{identifier:"minecraft:eye_of_ender_signal",materials:{default:"eye_of_ender_signal"},textures:{default:"textures/items/ender_eye"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},ender_pearl:{identifier:"minecraft:ender_pearl",materials:{default:"ender_pearl"},textures:{default:"textures/items/ender_pearl"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},evoker_fangs:{identifier:"minecraft:evocation_fang",materials:{default:"fang"},textures:{default:"textures/entity/illager/evoker_fangs"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:64,textureheight:32,bones:[{name:"upper_jaw",parent:"base",pivot:[0,11,0],cubes:[{origin:[-1.5,0,-4],size:[4,14,8],uv:[40,0],inflate:.01}]},{name:"lower_jaw",parent:"base",pivot:[0,11,0],bind_pose_rotation:[0,180,0],cubes:[{origin:[-1.5,0,-4],size:[4,14,8],uv:[40,0]}]},{name:"base",pivot:[0,0,0],bind_pose_rotation:[0,90,0],cubes:[{origin:[-5,0,-5],size:[10,12,10],uv:[0,0]}]}]}},render_controllers:["controller.render.evocation_fang"]},evoker:{identifier:"minecraft:evocation_illager",min_engine_version:"1.8.0",materials:{default:"evoker"},textures:{default:"textures/entity/illager/evoker"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[0,0]}]},{name:"nose",parent:"head",pivot:[0,26,0],cubes:[{origin:[-1,23,-6],size:[2,4,2],uv:[24,0]}]},{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-3],size:[8,12,6],uv:[16,20]},{origin:[-4,6,-3],size:[8,18,6],uv:[0,38],inflate:.5}]},{name:"arms",parent:"body",pivot:[0,22,0],cubes:[{origin:[-8,16,-2],size:[4,8,4],uv:[44,22]},{origin:[4,16,-2],size:[4,8,4],uv:[44,22]},{origin:[-4,16,-2],size:[8,4,4],uv:[40,38]}]},{name:"leg0",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"leg1",parent:"body",pivot:[2,12,0],mirror:!0,cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"rightArm",parent:"body",pivot:[-5,22,0],locators:{right_hand:[-6,12,0]},cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,46]}]},{name:"rightItem",pivot:[-5.5,16,.5],neverRender:!0,parent:"rightArm"},{name:"leftArm",parent:"body",pivot:[5,22,0],locators:{left_hand:[6,12,0]},mirror:!0,cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,46]}]}]}},particle_effects:{spell:"minecraft:evoker_spell"},render_controllers:["controller.render.evoker"],spawn_egg:{texture:"spawn_egg",texture_index:40}},experience_bottle:{identifier:"minecraft:xp_bottle",materials:{default:"xp_bottle"},textures:{default:"textures/items/experience_bottle",enchanted:"textures/misc/enchanted_item_glint"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.experience_bottle"]},experience_orb:{identifier:"minecraft:xp_orb",materials:{default:"experience_orb"},textures:{default:"textures/entity/experience_orb"},geometry:{default:{bones:[{name:"body",pivot:[8,8,0],cubes:[{origin:[0,0,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:64,textureheight:64}},render_controllers:["controller.render.experience_orb"]},fireball:{identifier:"minecraft:fireball",materials:{default:"fireball"},textures:{default:"textures/items/fire_charge"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-4,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.fireball"]},firework_rocket:{identifier:"minecraft:fireworks_rocket",materials:{default:"fireworks_rocket"},textures:{default:"textures/entity/fireworks"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],rotation:[0,90,0],size:[16,16,0],uv:{north:{uv:[0,0]}}},{origin:[-8,-8,0],rotation:[90,90,0],size:[16,16,0],uv:{north:{uv:[0,0]}}}]}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.fireworks_rocket"]},fishing_bobber:{identifier:"minecraft:fishing_hook",materials:{default:"fishing_hook"},textures:{default:"textures/entity/fishing_hook"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-1.5,-1.5,-1.5],size:[3,3,3],rotation:[0,0,180],uv:{up:{uv:[0,0]},down:{uv:[3,0]},south:{uv:[9,0],uv_size:[-3,3]},north:{uv:[9,0]},east:{uv:[12,0]},west:{uv:[15,0]}}},{origin:[0,-4.5,-.5],size:[0,3,3],uv:{east:{uv:[18,0]}}},{origin:[0,1.5,-1.5],size:[0,3,3],uv:{east:{uv:[21,0]}}},{origin:[-1.5,1.5,0],size:[3,3,0],uv:{north:{uv:[21,0]}}}]}],texturewidth:24,textureheight:3}},render_controllers:["controller.render.fishing_hook"]},hoglin:{identifier:"minecraft:hoglin",materials:{default:"hoglin"},textures:{default:"textures/entity/hoglin/hoglin"},geometry:{default:{bones:[{name:"body",pivot:[0,19,-3],cubes:[{origin:[-8,11,-7],size:[16,14,26],inflate:.02,uv:[1,1]},{origin:[0,22,-10],size:[0,10,19],inflate:.02,uv:[90,33]}],locators:{lead:[0,20,-5]}},{name:"head",parent:"body",pivot:[0,22,-5],rotation:[50,0,0],cubes:[{origin:[-7,21,-24],size:[14,6,19],uv:[61,1]},{origin:[-8,22,-19],size:[2,11,2],uv:[1,13]},{origin:[6,22,-19],size:[2,11,2],uv:[1,13]}]},{name:"right_ear",parent:"head",pivot:[-7,27,-7],rotation:[0,0,-50],cubes:[{origin:[-13,26,-10],size:[6,1,4],uv:[1,1]}]},{name:"left_ear",parent:"head",pivot:[7,27,-7],rotation:[0,0,50],cubes:[{origin:[7,26,-10],size:[6,1,4],uv:[1,6]}]},{name:"leg_back_right",pivot:[6,8,17],cubes:[{origin:[-8,0,13],size:[5,11,5],uv:[21,45]}]},{name:"leg_back_left",pivot:[-6,8,17],cubes:[{origin:[3,0,13],size:[5,11,5],uv:[0,45]}]},{name:"leg_front_right",pivot:[-6,12,-3],cubes:[{origin:[-8,0,-6],size:[6,14,6],uv:[66,42]}]},{name:"leg_front_left",pivot:[6,12,-3],cubes:[{origin:[2,0,-6],size:[6,14,6],uv:[41,42]}]}],visible_bounds_width:4,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:128,textureheight:64}},spawn_egg:{base_color:"#C66E55",overlay_color:"#5f6464"},render_controllers:["controller.render.hoglin"]},hopper_minecart:{identifier:"minecraft:hopper_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},husk:{identifier:"minecraft:husk",min_engine_version:"1.8.0",materials:{default:"husk"},textures:{default:"textures/entity/zombie/husk"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",neverRender:!0,pivot:[0,12,0]},{name:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-1.9,12,0],cubes:[{origin:[-3.9,0,-2],size:[4,12,4],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[1.9,12,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16]}],mirror:!0,parent:"body"}]}},scripts:{pre_animation:["variable.tcos0 = (Math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed / variable.gliding_speed_value) * 57.3;"]},animations:{humanoid_big_head:{loop:!0,bones:{head:{scale:1.4}}},look_at_target_default:{loop:!0,bones:{head:{relative_to:{rotation:"entity"},rotation:["query.target_x_rotation","query.target_y_rotation",0]}}},look_at_target_gliding:{loop:!0,bones:{head:{rotation:[-45,"query.target_y_rotation",0]}}},look_at_target_swimming:{loop:!0,bones:{head:{rotation:["math.lerp(query.target_x_rotation, -45.0, variable.swim_amount)","query.target_y_rotation",0]}}},move:{loop:!0,bones:{leftarm:{rotation:["variable.tcos0",0,0]},leftleg:{rotation:["variable.tcos0 * -1.4",0,0]},rightarm:{rotation:["-variable.tcos0",0,0]},rightleg:{rotation:["variable.tcos0 * 1.4",0,0]}}},"riding.arms":{loop:!0,bones:{leftarm:{rotation:[-36,0,0]},rightarm:{rotation:[-36,0,0]}}},"riding.legs":{loop:!0,bones:{leftleg:{rotation:["-72.0 - this","-18.0 - this","-this"]},rightleg:{rotation:["-72.0 - this","18.0 - this","-this"]}}},holding:{loop:!0,bones:{leftarm:{rotation:["variable.is_holding_left ? (-this * 0.5 - 18.0) : 0.0",0,0]},rightarm:{rotation:["variable.is_holding_right ? (-this * 0.5 - 18.0) : 0.0",0,0]}}},brandish_spear:{loop:!0,bones:{rightarm:{rotation:["this * -0.5 - 157.5 - 22.5 * variable.charge_amount","-this",0]}}},charging:{loop:!0,bones:{rightarm:{rotation:["22.5 * variable.charge_amount - this","-this",0]}}},"attack.rotations":{loop:!0,bones:{body:{rotation:[0,"math.sin(math.sqrt(variable.attack_time) * 360) * 11.46 - this",0]},leftarm:{rotation:["math.sin(math.sqrt(variable.attack_time) * 360) * 11.46",0,0]},rightarm:{rotation:["math.sin(1.0 - math.pow(1.0 - variable.attack_time, 3.0) * 180.0) * (variable.is_brandishing_spear ? -1.0 : 1.0 )","variable.is_brandishing_spear ? 0.0 : (math.sin(math.sqrt(variable.attack_time) * 360) * 11.46) * 2.0",0]}}},sneaking:{loop:!0,bones:{body:{rotation:["0.5 - this",0,0]},head:{position:[0,1,0]},leftarm:{rotation:[72,0,0]},leftleg:{position:[0,-3,4]},rightarm:{rotation:[72,0,0]},rightleg:{position:[0,-3,4]}}},bob:{loop:!0,bones:{leftarm:{rotation:[0,0,"((math.cos(query.life_time * 103.2) * 2.865) + 2.865) *-1.0"]},rightarm:{rotation:[0,0,"(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},damage_nearby_mobs:{loop:!0,bones:{leftarm:{rotation:["-45.0-this","-this","-this"]},leftleg:{rotation:["45.0-this","-this","-this"]},rightarm:{rotation:["45.0-this","-this","-this"]},rightleg:{rotation:["-45.0-this","-this","-this"]}}},bow_and_arrow:{loop:!0,bones:{leftarm:{rotation:["query.target_x_rotation - 90.0 - math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation + 28.65","-(math.cos(query.life_time * 103.2) * 2.865) - 2.865"]},rightarm:{rotation:["query.target_x_rotation - 90.0 + math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation - 5.73","(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},use_item_progress:{loop:!0,bones:{rightarm:{rotation:["variable.use_item_startup_progress * -60.0 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -22.5 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -5.625 + variable.use_item_interval_progress * 11.25"]}}},zombie_attack_bare_hand:{loop:!0,bones:{leftarm:{rotation:["-90.0 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) - (math.sin(query.life_time * 76.776372) * 2.865) - this","5.73 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 0.6) - this","math.cos(query.life_time * 103.13244) * -2.865 - 2.865 - this"]},rightarm:{rotation:["90.0 * (variable.is_brandishing_spear - 1.0) - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) + (math.sin(query.life_time * 76.776372) * 2.865) - this","(math.sin(variable.attack_time * 180.0) * 57.3) * 0.6 - 5.73 - this","math.cos(query.life_time * 103.13244) * 2.865 + 2.865 - this"]}}},swimming:{loop:!0,bones:{body:{position:[0,"variable.swim_amount * -10.0 - this","variable.swim_amount * 9.0 - this"],rotation:["variable.swim_amount * (90.0 + query.target_x_rotation)",0,0]},leftarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) - (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, 14.325, variable.swim_amount) - (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},leftleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0 + 180.0) * 0.3, variable.swim_amount)",0,0]},rightarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) + (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, -14.325, variable.swim_amount) + (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},rightleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0) * 0.3, variable.swim_amount)",0,0]}}}},animation_controllers:{humanoid_baby_big_head:{initial_state:"default",states:{baby:{animations:["humanoid_big_head"],transitions:[{default:"!query.is_baby"}]},default:{transitions:[{baby:"query.is_baby"}]}}},look_at_target:{initial_state:"default",states:{default:{animations:["look_at_target_default"],transitions:[{gliding:"query.is_gliding"},{swimming:"query.is_swimming"}]},gliding:{animations:["look_at_target_gliding"],transitions:[{swimming:"query.is_swimming"},{default:"!query.is_gliding"}]},swimming:{animations:["look_at_target_swimming"],transitions:[{gliding:"query.is_gliding"},{default:"!query.is_swimming"}]}}},move:{initial_state:"default",states:{default:{animations:["move"]}}},riding:{initial_state:"default",states:{default:{transitions:[{riding:"query.is_riding"}]},riding:{animations:["riding.arms","riding.legs"],transitions:[{default:"!query.is_riding"}]}}},holding:{initial_state:"default",states:{default:{animations:["holding"]}}},brandish_spear:{initial_state:"default",states:{brandish_spear:{animations:["brandish_spear"],transitions:[{default:"!variable.is_brandishing_spear"}]},default:{transitions:[{brandish_spear:"variable.is_brandishing_spear"}]}}},charging:{initial_state:"default",states:{charging:{animations:["charging"],transitions:[{default:"!query.is_charging"}]},default:{transitions:[{charging:"query.is_charging"}]}}},attack:{initial_state:"default",states:{attacking:{animations:["attack.rotations"],transitions:[{default:"variable.attack_time < 0.0"}]},default:{transitions:[{attacking:"variable.attack_time >= 0.0"}]}}},sneaking:{initial_state:"default",states:{default:{transitions:[{sneaking:"query.is_sneaking"}]},sneaking:{animations:["sneaking"],transitions:[{default:"!query.is_sneaking"}]}}},bob:{initial_state:"default",states:{default:{animations:["bob"]}}},damage_nearby_mobs:{initial_state:"default",states:{damage_nearby_mobs:{animations:["damage_nearby_mobs"],transitions:[{default:"!variable.damage_nearby_mobs"}]},default:{transitions:[{damage_nearby_mobs:"variable.damage_nearby_mobs"}]}}},bow_and_arrow:{initial_state:"default",states:{bow_and_arrow:{animations:["bow_and_arrow"],transitions:[{default:"!query.has_target"}]},default:{transitions:[{bow_and_arrow:"query.has_target"}]}}},use_item_progress:{initial_state:"default",states:{default:{transitions:[{use_item_progress:"( variable.use_item_interval_progress > 0.0 ) || ( variable.use_item_startup_progress > 0.0 )"}]},use_item_progress:{animations:["use_item_progress"],transitions:[{default:"( variable.use_item_interval_progress <= 0.0 ) && ( variable.use_item_startup_progress <= 0.0 )"}]}}},zombie_attack_bare_hand:{initial_state:"default",states:{default:{transitions:[{is_bare_hand:"variable.is_holding_left != 1.0"}]},is_bare_hand:{animations:["zombie_attack_bare_hand"],transitions:[{default:"variable.is_holding_left == 1.0"}]}}},swimming:{initial_state:"default",states:{default:{transitions:[{is_swimming:"variable.swim_amount > 0.0"}]},is_swimming:{animations:["swimming"],transitions:[{default:"variable.swim_amount <= 0.0"}]}}}},render_controllers:["controller.render.husk"],enable_attachables:!0,spawn_egg:{texture:"spawn_egg",texture_index:28}},iron_golem:{identifier:"minecraft:iron_golem",materials:{default:"iron_golem"},textures:{default:"textures/entity/iron_golem/iron_golem"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:128,textureheight:128,bones:[{name:"body",pivot:[0,31,0],cubes:[{origin:[-9,21,-6],size:[18,12,11],uv:[0,40]},{origin:[-4.5,16,-3],size:[9,5,6],uv:[0,70],inflate:.5}]},{name:"head",parent:"body",pivot:[0,31,-2],locators:{lead:[0,31,-2]},cubes:[{origin:[-4,33,-7.5],size:[8,10,8],uv:[0,0]},{origin:[-1,32,-9.5],size:[2,4,2],uv:[24,0]}]},{name:"arm0",parent:"body",pivot:[0,31,0],cubes:[{origin:[-13,3.5,-3],size:[4,30,6],uv:[60,21]}]},{name:"arm1",parent:"body",pivot:[0,31,0],cubes:[{origin:[9,3.5,-3],size:[4,30,6],uv:[60,58]}]},{name:"leg0",parent:"body",pivot:[-4,13,0],cubes:[{origin:[-7.5,0,-3],size:[6,16,5],uv:[37,0]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[5,13,0],cubes:[{origin:[1.5,0,-3],size:[6,16,5],uv:[60,0]}]}]}},render_controllers:["controller.render.iron_golem"]},item_frame:{identifier:"minecraft:item_frame",materials:{default:"item_frame"},textures:{background:"block:item_frame",frame:"block:oak_planks"},geometry:{background:{bones:[{name:"base"},{name:"background",parent:"base",rotation:[0,180,0],pivot:[0,0,0],cubes:[{origin:[-5,-5,-8],size:[10,10,.5],uv:[3,3]}]}],texturewidth:16,textureheight:16},frame:{bones:[{name:"frame",parent:"base",rotation:[0,180,0],pivot:[0,0,0],cubes:[{origin:[-6,-6,-8],size:[12,1,1],uv:[2,2]},{origin:[-6,5,-8],size:[12,1,1],uv:[2,13]},{origin:[-6,-5,-8],size:[1,10,1],uv:[2,3]},{origin:[5,-5,-8],size:[1,10,1],uv:[13,3]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_frame"]},leash_knot:{identifier:"minecraft:leash_knot",materials:{default:"leash_knot"},textures:{default:"textures/entity/lead_knot"},geometry:{default:{bones:[{name:"knot",rotation:[0,180,0],cubes:[{origin:[5,6,5],size:[6,8,6],uv:[0,0]}]}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.leash_knot"]},llama_spit:{identifier:"minecraft:llama_spit",materials:{default:"llama_spit"},textures:{default:"textures/entity/llama/spit"},geometry:{default:{visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,22,0],size:[2,2,2],uv:[0,0]},{origin:[0,26,0],size:[2,2,2],uv:[0,0]},{origin:[0,22,-4],size:[2,2,2],uv:[0,0]},{origin:[0,22,0],size:[2,2,2],uv:[0,0]},{origin:[2,22,0],size:[2,2,2],uv:[0,0]},{origin:[0,20,0],size:[2,2,2],uv:[0,0]},{origin:[0,22,2],size:[2,2,2],uv:[0,0]}]}]}},render_controllers:["controller.render.llama_spit"]},magma_cube:{identifier:"minecraft:magma_cube",materials:{default:"magma_cube"},textures:{default:"textures/entity/slime/magmacube"},geometry:{default:{visible_bounds_width:2.5,visible_bounds_height:5,visible_bounds_offset:[0,2.5,0],texturewidth:64,textureheight:32,bones:[{name:"bodyCube_0",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,7,-4],size:[8,1,8],uv:[0,0]}]},{name:"bodyCube_1",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,6,-4],size:[8,1,8],uv:[0,1]}]},{name:"bodyCube_2",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,5,-4],size:[8,1,8],uv:[24,10]}]},{name:"bodyCube_3",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,4,-4],size:[8,1,8],uv:[24,19]}]},{name:"bodyCube_4",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,3,-4],size:[8,1,8],uv:[0,4]}]},{name:"bodyCube_5",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,2,-4],size:[8,1,8],uv:[0,5]}]},{name:"bodyCube_6",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,1,-4],size:[8,1,8],uv:[0,6]}]},{name:"bodyCube_7",parent:"insideCube",pivot:[0,24,0],cubes:[{origin:[-4,0,-4],size:[8,1,8],uv:[0,7]}]},{name:"insideCube",pivot:[0,0,0],cubes:[{origin:[-2,2,-2],size:[4,4,4],uv:[0,16]}]}]}},render_controllers:["controller.render.magma_cube"],spawn_egg:{texture:"spawn_egg",texture_index:20}},mooshroom:{identifier:"minecraft:mooshroom",min_engine_version:"1.8.0",materials:{default:"mooshroom"},textures:{default:"textures/entity/cow/red_mooshroom",brown:"textures/entity/cow/brown_mooshroom"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-6,11,-5],size:[12,18,10],uv:[18,4]},{origin:[-2,11,-6],size:[4,6,1],uv:[52,0]}]},{name:"head",pivot:[0,20,-8],locators:{lead:[0,20,-8]},cubes:[{origin:[-4,16,-14],size:[8,8,6],uv:[0,0]},{origin:[-5,22,-12],size:[1,3,1],uv:[22,0]},{origin:[4,22,-12],size:[1,3,1],uv:[22,0]}]},{name:"leg0",parent:"body",pivot:[-4,12,7],cubes:[{origin:[-6,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[4,12,7],cubes:[{origin:[2,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-4,12,-6],cubes:[{origin:[-6,0,-7],size:[4,12,4],uv:[0,16]}]},{name:"leg3",parent:"body",mirror:!0,pivot:[4,12,-6],cubes:[{origin:[2,0,-7],size:[4,12,4],uv:[0,16]}]}]}},render_controllers:["controller.render.mooshroom"],spawn_egg:{texture:"spawn_egg",texture_index:5}},panda:{identifier:"minecraft:panda",materials:{default:"panda"},textures:{default:"textures/entity/panda/panda",lazy:"textures/entity/panda/lazy_panda",worried:"textures/entity/panda/worried_panda",playful:"textures/entity/panda/playful_panda",brown:"textures/entity/panda/brown_panda",weak:"textures/entity/panda/weak_panda",aggressive:"textures/entity/panda/aggressive_panda"},geometry:{default:{texturewidth:64,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,12.5,-17],locators:{lead:[0,14,-16]},cubes:[{origin:[-6.5,7.5,-21],size:[13,10,9],uv:[0,6]},{origin:[-3.5,7.5,-23],size:[7,5,2],uv:[45,16]},{origin:[-8.5,16.5,-18],size:[5,4,1],uv:[52,25]},{origin:[3.5,16.5,-18],size:[5,4,1],uv:[52,25]}]},{name:"body",pivot:[0,14,0],bind_pose_rotation:[90,0,0],cubes:[{origin:[-9.5,1,-6.5],size:[19,26,13],uv:[0,25]}]},{name:"leg0",parent:"body",pivot:[-5.5,9,9],cubes:[{origin:[-8.5,0,6],size:[6,9,6],uv:[40,0]}]},{name:"leg1",parent:"body",pivot:[5.5,9,9],cubes:[{origin:[2.5,0,6],size:[6,9,6],uv:[40,0]}]},{name:"leg2",parent:"body",pivot:[-5.5,9,-9],cubes:[{origin:[-8.5,0,-12],size:[6,9,6],uv:[40,0]}]},{name:"leg3",parent:"body",pivot:[5.5,9,-9],cubes:[{origin:[2.5,0,-12],size:[6,9,6],uv:[40,0]}]}]}},render_controllers:["controller.render.panda"],spawn_egg:{texture:"spawn_egg",texture_index:54}},phantom:{identifier:"minecraft:phantom",materials:{default:"phantom",invisible:"phantom_invisible"},textures:{default:"textures/entity/phantom"},geometry:{default:{texturewidth:64,textureheight:64,bones:[{name:"body",pivot:[0,24,0],bind_pose_rotation:[0,0,0],cubes:[{origin:[-3,23,-8],size:[5,3,9],uv:[0,8]}]},{name:"wing0",pivot:[2,26,-8],bind_pose_rotation:[0,0,5.7],cubes:[{origin:[2,24,-8],size:[6,2,9],uv:[23,12]}],parent:"body"},{name:"wingtip0",pivot:[8,26,-8],bind_pose_rotation:[0,0,5.7],locators:{left_wing:[21,26,0]},cubes:[{origin:[8,25,-8],size:[13,1,9],uv:[16,24]}],parent:"wing0"},{name:"wing1",pivot:[-3,26,-8],bind_pose_rotation:[0,0,-5.7],mirror:!0,cubes:[{origin:[-9,24,-8],size:[6,2,9],uv:[23,12]}],parent:"body"},{name:"wingtip1",pivot:[-9,24,-8],bind_pose_rotation:[0,0,-5.7],locators:{right_wing:[-22,24,0]},mirror:!0,cubes:[{origin:[-22,25,-8],size:[13,1,9],uv:[16,24]}],parent:"wing1"},{name:"head",pivot:[0,23,-7],bind_pose_rotation:[11.5,0,0],cubes:[{origin:[-4,22,-12],size:[7,3,5],uv:[0,0]}],parent:"body"},{name:"tail",pivot:[0,26,1],bind_pose_rotation:[0,0,0],cubes:[{origin:[-2,24,1],size:[3,2,6],uv:[3,20]}],parent:"body"},{name:"tailtip",pivot:[0,25.5,7],bind_pose_rotation:[0,0,0],cubes:[{origin:[-1,24.5,7],size:[1,1,6],uv:[4,29]}],parent:"tail"}]}},particle_effects:{wing_dust:"minecraft:phantom_trail_particle"},sound_effects:{flap:"mob.phantom.flap"},render_controllers:["controller.render.phantom"],spawn_egg:{texture:"spawn_egg",texture_index:51}},pig:{identifier:"minecraft:pig",min_engine_version:"1.8.0",materials:{default:"pig"},textures:{default:"textures/entity/pig/pig",saddled:"textures/entity/pig/pig_saddle"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,13,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-5,7,-5],size:[10,16,8],uv:[28,8]}]},{name:"head",parent:"body",pivot:[0,12,-6],locators:{lead:[0,14,-6]},cubes:[{origin:[-4,8,-14],size:[8,8,8],uv:[0,0]},{origin:[-2,9,-15],size:[4,3,1],uv:[16,16]}]},{name:"leg0",parent:"body",pivot:[-3,6,7],cubes:[{origin:[-5,0,5],size:[4,6,4],uv:[0,16]}]},{name:"leg1",parent:"body",mirror:!0,pivot:[3,6,7],cubes:[{origin:[1,0,5],size:[4,6,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-3,6,-5],cubes:[{origin:[-5,0,-7],size:[4,6,4],uv:[0,16]}]},{name:"leg3",parent:"body",mirror:!0,pivot:[3,6,-5],cubes:[{origin:[1,0,-7],size:[4,6,4],uv:[0,16]}]}]}},render_controllers:["controller.render.pig"],spawn_egg:{texture:"spawn_egg",texture_index:2}},piglin_brute:{identifier:"minecraft:piglin_brute",materials:{default:"piglin_brute"},textures:{default:"textures/entity/piglin/piglin_brute"},geometry:{default:{bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]},{origin:[-4,12,-2],size:[8,12,4],uv:[16,32],inflate:.25}]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-5,24,-4],size:[10,8,8],uv:[0,0],inflate:-.02},{origin:[-2,24,-5],size:[4,4,1],uv:[31,1]},{origin:[2,24,-5],size:[1,2,1],uv:[2,4]},{origin:[-3,24,-5],size:[1,2,1],uv:[2,0]}],inflate:-.02},{name:"leftear",parent:"head",pivot:[5,30,0],rotation:[0,0,-30],cubes:[{origin:[4,25,-2],size:[1,5,4],uv:[51,6]}]},{name:"rightear",parent:"head",pivot:[-5,30,0],rotation:[0,0,30],cubes:[{origin:[-5,25,-2],size:[1,5,4],uv:[39,6]}]},{name:"hat",parent:"head",pivot:[0,24,0]},{name:"rightarm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]},{origin:[-8,12,-2],size:[4,12,4],uv:[40,32],inflate:.25}]},{name:"rightItem",parent:"rightarm",pivot:[-1,-45,-5]},{name:"leftarm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[32,48]},{origin:[4,12,-2],size:[4,12,4],uv:[48,48],inflate:.25}]},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5]},{name:"rightleg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,16]},{origin:[-4,0,-2],size:[4,12,4],uv:[0,32],inflate:.25}]},{name:"leftleg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[16,48]},{origin:[0,0,-2],size:[4,12,4],uv:[0,48],inflate:.25}]}],visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:64}},spawn_egg:{base_color:"#592A10",overlay_color:"#F9F3A4"},render_controllers:["controller.render.piglin_brute"],enable_attachables:!0},polar_bear:{identifier:"minecraft:polar_bear",materials:{default:"polar_bear"},textures:{default:"textures/entity/bear/polarbear"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:128,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,14,-16],locators:{lead:[0,14,-16]},mirror:!0,cubes:[{mirror:!1,origin:[-3.5,10,-19],size:[7,7,7],uv:[0,0]},{mirror:!1,origin:[-2.5,10,-22],size:[5,3,3],uv:[0,44]},{mirror:!1,origin:[-4.5,16,-17],size:[2,2,1],uv:[26,0]},{origin:[2.5,16,-17],size:[2,2,1],uv:[26,0]}]},{name:"body",pivot:[-2,15,12],bind_pose_rotation:[90,0,0],cubes:[{origin:[-7,14,5],size:[14,14,11],uv:[0,19]},{origin:[-6,28,5],size:[12,12,10],uv:[39,0]}]},{name:"leg0",parent:"body",pivot:[-4.5,10,6],cubes:[{origin:[-6.5,0,4],size:[4,10,8],uv:[50,22]}]},{name:"leg1",parent:"body",pivot:[4.5,10,6],cubes:[{origin:[2.5,0,4],size:[4,10,8],uv:[50,22]}]},{name:"leg2",parent:"body",pivot:[-3.5,10,-8],cubes:[{origin:[-5.5,0,-10],size:[4,10,6],uv:[50,40]}]},{name:"leg3",parent:"body",pivot:[3.5,10,-8],cubes:[{origin:[1.5,0,-10],size:[4,10,6],uv:[50,40]}]}]}},render_controllers:["controller.render.polarbear"],spawn_egg:{texture:"spawn_egg",texture_index:37}},pufferfish:{identifier:"minecraft:pufferfish",min_engine_version:"1.8.0",materials:{default:"pufferfish"},textures:{default:"textures/entity/fish/pufferfish"},geometry:{default:{visible_bounds_width:.5,visible_bounds_height:.5,texturewidth:32,textureheight:32,bones:[{name:"body",cubes:[{origin:[-1.5,0,-1.5],size:[3,2,3],uv:[0,27]},{origin:[.5,2,-1.5],size:[1,1,1],uv:[24,6]},{origin:[-1.5,2,-1.5],size:[1,1,1],uv:[28,6]}],locators:{lead:[0,0,0]}},{name:"tailfin",parent:"body",cubes:[{origin:[-1.5,1,1.5],size:[3,0,3],uv:[-3,0]}]},{name:"leftFin",parent:"body",pivot:[6.5,5,.5],cubes:[{origin:[1.5,0,-1.5],size:[1,1,2],uv:[25,0],mirror:!0}]},{name:"rightFin",parent:"body",pivot:[-6.5,5,.5],cubes:[{origin:[-2.5,0,-1.5],size:[1,1,2],uv:[25,0]}]}]},mid:{visible_bounds_width:.5,visible_bounds_height:.5,texturewidth:32,textureheight:32,bones:[{name:"body",cubes:[{origin:[-2.5,1,-2.5],size:[5,5,5],uv:[12,22]}]},{name:"leftFin",parent:"body",pivot:[2.5,5,.5],cubes:[{origin:[2.5,4,-1.5],size:[2,1,2],uv:[24,3]}]},{name:"rightFin",parent:"body",pivot:[-2.5,5,.5],cubes:[{origin:[-4.5,4,-1.5],size:[2,1,2],uv:[24,0]}]},{name:"spines_top_front",parent:"body",bind_pose_rotation:[45,0,0],pivot:[0,6,-2.5],cubes:[{origin:[-2.5,6,-2.5],size:[5,1,0],uv:[19,17]}]},{name:"spines_top_back",parent:"body",bind_pose_rotation:[-45,0,0],pivot:[0,6,2.5],cubes:[{origin:[-2.5,6,2.5],size:[5,1,0],uv:[11,17]}]},{name:"spines_bottom_front",parent:"body",bind_pose_rotation:[-45,0,0],pivot:[0,1,-2.5],cubes:[{origin:[-2.5,0,-2.5],size:[5,1,0],uv:[18,20]}]},{name:"spines_bottom_back",parent:"body",bind_pose_rotation:[45,0,0],pivot:[0,1,2.5],rotation:[45,0,0],cubes:[{origin:[-2.5,0,2.5],size:[5,1,0],uv:[18,20]}]},{name:"spines_left_front",parent:"body",bind_pose_rotation:[0,45,0],pivot:[2.5,0,-2.5],rotation:[0,45,0],cubes:[{origin:[2.5,1,-2.5],size:[1,5,0],uv:[1,17]}]},{name:"spines_left_back",parent:"body",bind_pose_rotation:[0,-45,0],pivot:[2.5,0,2.5],rotation:[0,-45,0],cubes:[{origin:[2.5,1,2.5],size:[1,5,0],uv:[1,17]}]},{name:"spines_right_front",parent:"body",bind_pose_rotation:[0,-45,0],pivot:[-2.5,0,-2.5],rotation:[0,-45,0],cubes:[{origin:[-3.5,1,-2.5],size:[1,5,0],uv:[5,17]}]},{name:"spines_right_back",parent:"body",bind_pose_rotation:[0,45,0],pivot:[-2.5,0,2.5],rotation:[0,45,0],cubes:[{origin:[-3.5,1,2.5],size:[1,5,0],uv:[9,17]}]}]},large:{visible_bounds_width:.5,visible_bounds_height:.5,texturewidth:32,textureheight:32,bones:[{name:"body",cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,0]}]},{name:"leftFin",parent:"body",pivot:[4,7,1],cubes:[{origin:[4,6,-2.9904],size:[2,1,2],uv:[24,3]}]},{name:"rightFin",parent:"body",pivot:[-4,7,1],cubes:[{origin:[-5.9968,6,-2.992],size:[2,1,2],uv:[24,0]}]},{name:"spines_top_front",parent:"body",pivot:[-4,8,-4],bind_pose_rotation:[45,0,0],cubes:[{origin:[-4,8,-4],size:[8,1,1],uv:[14,16]}]},{name:"spines_top_mid",parent:"body",pivot:[0,8,0],cubes:[{origin:[-4,8,0],size:[8,1,1],uv:[14,16]}]},{name:"spines_top_back",parent:"body",pivot:[0,8,4],bind_pose_rotation:[-45,0,0],cubes:[{origin:[-4,8,4],size:[8,1,1],uv:[14,16]}]},{name:"spines_bottom_front",parent:"body",pivot:[0,0,-4],bind_pose_rotation:[-45,0,0],cubes:[{origin:[-4,-1,-4],size:[8,1,1],uv:[14,19]}]},{name:"spines_bottom_mid",parent:"body",pivot:[0,-1,0],cubes:[{origin:[-4,-1,0],size:[8,1,1],uv:[14,19]}]},{name:"spines_bottom_back",parent:"body",pivot:[0,0,4],bind_pose_rotation:[45,0,0],cubes:[{origin:[-4,-1,4],size:[8,1,1],uv:[14,19]}]},{name:"spines_left_front",parent:"body",pivot:[4,0,-4],bind_pose_rotation:[0,45,0],cubes:[{origin:[4,0,-4],size:[1,8,1],uv:[0,16]}]},{name:"spines_left_mid",parent:"body",pivot:[4,0,0],cubes:[{origin:[4,0,0],size:[1,8,1],uv:[4,16],mirror:!0}]},{name:"spines_left_back",parent:"body",pivot:[4,0,4],bind_pose_rotation:[0,-45,0],cubes:[{origin:[4,0,4],size:[1,8,1],uv:[8,16],mirror:!0}]},{name:"spines_right_front",parent:"body",pivot:[-4,0,-4],bind_pose_rotation:[0,-45,0],cubes:[{origin:[-5,0,-4],size:[1,8,1],uv:[4,16]}]},{name:"spines_right_mid",parent:"body",pivot:[-4,0,0],cubes:[{origin:[-5,0,0],size:[1,8,1],uv:[8,16]}]},{name:"spines_right_back",parent:"body",pivot:[-4,0,4],bind_pose_rotation:[0,45,0],cubes:[{origin:[-5,0,4],size:[1,8,1],uv:[8,16]}]}]}},render_controllers:[{"controller.render.pufferfish.small":"query.variant == 0"},{"controller.render.pufferfish.medium":"query.variant == 1"},{"controller.render.pufferfish.large":"query.variant == 2"}],spawn_egg:{texture:"spawn_egg",texture_index:46}},rabbit:{identifier:"minecraft:rabbit",min_engine_version:"1.8.0",materials:{default:"rabbit"},textures:{brown:"textures/entity/rabbit/brown",white:"textures/entity/rabbit/white",black:"textures/entity/rabbit/black",white_splotched:"textures/entity/rabbit/white_splotched",gold:"textures/entity/rabbit/gold",salt:"textures/entity/rabbit/salt",toast:"textures/entity/rabbit/toast"},geometry:{default:{visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"rearFootLeft",pivot:[3,6.5,3.7],mirror:!0,parent:"body",cubes:[{origin:[2,0,0],size:[2,1,7],uv:[8,24]}]},{name:"rearFootRight",pivot:[-3,6.5,3.7],mirror:!0,parent:"body",cubes:[{origin:[-4,0,0],size:[2,1,7],uv:[26,24]}]},{name:"haunchLeft",pivot:[3,6.5,3.7],bind_pose_rotation:[-20,0,0],mirror:!0,parent:"body",cubes:[{origin:[2,2.5,3.7],size:[2,4,5],uv:[16,15]}]},{name:"haunchRight",pivot:[-3,6.5,3.7],bind_pose_rotation:[-20,0,0],mirror:!0,parent:"body",cubes:[{origin:[-4,2.5,3.7],size:[2,4,5],uv:[30,15]}]},{name:"body",pivot:[0,5,8],bind_pose_rotation:[-20,0,0],mirror:!0,cubes:[{origin:[-3,2,-2],size:[6,5,10],uv:[0,0]}]},{name:"frontLegLeft",pivot:[3,7,-1],bind_pose_rotation:[-10,0,0],mirror:!0,parent:"body",cubes:[{origin:[2,0,-2],size:[2,7,2],uv:[8,15]}]},{name:"frontLegRight",pivot:[-3,7,-1],bind_pose_rotation:[-10,0,0],mirror:!0,parent:"body",cubes:[{origin:[-4,0,-2],size:[2,7,2],uv:[0,15]}]},{name:"head",pivot:[0,8,-1],locators:{lead:[0,8,-1]},mirror:!0,parent:"body",cubes:[{origin:[-2.5,8,-6],size:[5,4,5],uv:[32,0]}]},{name:"earRight",pivot:[0,8,-1],bind_pose_rotation:[0,-15,0],mirror:!0,parent:"body",cubes:[{origin:[-2.5,12,-2],size:[2,5,1],uv:[58,0]}]},{name:"earLeft",pivot:[0,8,-1],bind_pose_rotation:[0,15,0],mirror:!0,parent:"body",cubes:[{origin:[.5,12,-2],size:[2,5,1],uv:[52,0]}]},{name:"tail",pivot:[0,4,7],bind_pose_rotation:[-20,0,0],mirror:!0,parent:"body",cubes:[{origin:[-1.5,2.5,7],size:[3,3,2],uv:[52,6]}]},{name:"nose",pivot:[0,8,-1],mirror:!0,parent:"body",cubes:[{origin:[-.5,9.5,-6.5],size:[1,1,1],uv:[32,9]}]}]}},render_controllers:["controller.render.rabbit"],spawn_egg:{texture:"spawn_egg",texture_index:24}},ravager:{identifier:"minecraft:ravager",textures:{default:"textures/entity/illager/ravager"},materials:{default:"ravager"},geometry:{default:{bones:[{pivot:[0,19,2],rotation:[90,0,0],cubes:[{origin:[-7,10,-2],size:[14,16,20],uv:[0,55]},{origin:[-6,-3,-2],size:[12,13,18],uv:[0,91]}],name:"body"},{pivot:[0,15,-10],cubes:[{origin:[-8,13,-24],size:[16,3,16],uv:[0,36]}],name:"mouth",parent:"head"},{pivot:[0,20,-20],cubes:[{origin:[-5,21,-10],size:[10,10,18],uv:[68,73]}],name:"neck"},{locators:{stun:[0,32,-15]},pivot:[0,28,-10],cubes:[{origin:[-8,14,-24],size:[16,20,16],uv:[0,0]},{origin:[-2,12,-28],size:[4,8,4],uv:[0,0]}],name:"head",parent:"neck"},{pivot:[-12,30,22],cubes:[{origin:[-12,0,17],size:[8,37,8],uv:[96,0]}],name:"leg0"},{pivot:[4,30,22],cubes:[{origin:[4,0,17],size:[8,37,8],uv:[96,0]}],name:"leg1"},{pivot:[-4,26,-4],cubes:[{origin:[-12,0,-8],size:[8,37,8],uv:[64,0]}],name:"leg2"},{pivot:[-4,26,-4],cubes:[{origin:[4,0,-8],size:[8,37,8],uv:[64,0]}],name:"leg3"},{pivot:[-5,27,-19],rotation:[60,0,0],cubes:[{origin:[-10,27,-20],size:[2,14,4],uv:[74,55]},{origin:[8,27,-20],size:[2,14,4],uv:[74,55]}],name:"horns",parent:"head"}],texturewidth:128,textureheight:128,visible_bounds_width:4,visible_bounds_height:3.5,visible_bounds_offset:[0,1.25,0]}},render_controllers:["controller.render.ravager"],spawn_egg:{texture:"spawn_egg",texture_index:57},particle_effects:{stun_particles:"minecraft:stunned_emitter"}},salmon:{identifier:"minecraft:salmon",materials:{default:"salmon"},textures:{default:"textures/entity/fish/salmon"},geometry:{default:{visible_bounds_width:.5,visible_bounds_height:.5,visible_bounds_offset:[0,.5,0],texturewidth:32,textureheight:32,bones:[{name:"body_front",pivot:[0,0,-4],cubes:[{origin:[-1.5,3.5,-4],size:[3,5,8],uv:[0,0]}]},{name:"body_back",parent:"body_front",pivot:[0,0,4],cubes:[{origin:[-1.5,3.5,4],size:[3,5,8],uv:[0,13]}]},{name:"dorsal_front",parent:"body_front",pivot:[0,5,2],cubes:[{origin:[0,8.5,2],size:[0,2,2],uv:[4,2]}]},{name:"dorsal_back",parent:"body_back",pivot:[0,5,4],cubes:[{origin:[0,8.5,4],size:[0,2,3],uv:[2,3]}]},{name:"tailfin",parent:"body_back",pivot:[0,0,12],cubes:[{origin:[0,3.5,12],size:[0,5,6],uv:[20,10]}]},{name:"head",parent:"body_front",pivot:[0,3,-4],locators:{lead:[0,3,-4]},cubes:[{origin:[-1,4.5,-7],size:[2,4,3],uv:[22,0]}]},{name:"leftFin",parent:"body_front",pivot:[1.5,1,-4],rotation:[0,0,35],cubes:[{origin:[-.50752,3.86703,-4],size:[2,0,2],uv:[2,0]}]},{name:"rightFin",parent:"body_front",pivot:[-1.5,1,-4],rotation:[0,0,-35],cubes:[{origin:[-1.49258,3.86703,-4],size:[2,0,2],uv:[-2,0]}]}]}},render_controllers:["controller.render.salmon"],spawn_egg:{texture:"spawn_egg",texture_index:47}},sheep:{identifier:"minecraft:sheep",materials:{default:"sheep"},textures:{default:"textures/entity/sheep/sheep",wool:"textures/entity/sheep/sheep_fur"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:1.75,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-4,13,-5],size:[8,16,6],uv:[28,8]}]},{name:"head",pivot:[0,18,-8],cubes:[{origin:[-3,16,-14],size:[6,6,8],uv:[0,0]}]},{name:"leg0",parent:"body",pivot:[-3,12,7],cubes:[{origin:[-5,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg1",parent:"body",pivot:[3,12,7],cubes:[{origin:[1,0,5],size:[4,12,4],uv:[0,16]}]},{name:"leg2",parent:"body",pivot:[-3,12,-5],cubes:[{origin:[-5,0,-7],size:[4,12,4],uv:[0,16]}]},{name:"leg3",parent:"body",pivot:[3,12,-5],cubes:[{origin:[1,0,-7],size:[4,12,4],uv:[0,16]}]}]},wool:{visible_bounds_width:2,visible_bounds_height:1.75,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:64,bones:[{name:"head",pivot:[0,18,-8],cubes:[{origin:[-3,16,-12],size:[6,6,6],uv:[0,32],inflate:.6}]},{name:"body",pivot:[0,19,2],bind_pose_rotation:[90,0,0],cubes:[{origin:[-4,13,-5],size:[8,16,6],uv:[28,40],inflate:1.75}]},{name:"leg0",parent:"body",pivot:[-3,12,7],cubes:[{origin:[-5,6,5],size:[4,6,4],uv:[0,48],inflate:.5}]},{name:"leg1",parent:"body",pivot:[3,12,7],cubes:[{origin:[1,6,5],size:[4,6,4],uv:[0,48],inflate:.5}]},{name:"leg2",parent:"body",pivot:[-3,12,-5],cubes:[{origin:[-5,6,-7],size:[4,6,4],uv:[0,48],inflate:.5}]},{name:"leg3",parent:"body",pivot:[3,12,-5],cubes:[{origin:[1,6,-7],size:[4,6,4],uv:[0,48],inflate:.5}]}]}}},shulker_bullet:{identifier:"minecraft:shulker_bullet",materials:{default:"shulker_bullet"},textures:{default:"textures/entity/shulker/spark"},geometry:{default:{texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-4,-4,-1],size:[8,8,2],uv:[0,0]},{origin:[-1,-4,-4],size:[2,8,8],uv:[0,10]},{origin:[-4,-1,-4],size:[8,2,8],uv:[20,0]}]}]}},render_controllers:["controller.render.shulker_bullet"]},silverfish:{identifier:"minecraft:silverfish",materials:{default:"silverfish",body_layer:"silverfish_layers"},textures:{default:"textures/entity/silverfish"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"bodyPart_0",parent:"bodyPart_2",pivot:[0,2,-3.5],cubes:[{origin:[-1.5,0,-4.5],size:[3,2,2],uv:[0,0]}]},{name:"bodyPart_1",parent:"bodyPart_2",pivot:[0,3,-1.5],cubes:[{origin:[-2,0,-2.5],size:[4,3,2],uv:[0,4]}]},{name:"bodyPart_2",pivot:[0,4,1],cubes:[{origin:[-3,0,-.5],size:[6,4,3],uv:[0,9]}]},{name:"bodyPart_3",parent:"bodyPart_2",pivot:[0,3,4],cubes:[{origin:[-1.5,0,2.5],size:[3,3,3],uv:[0,16]}]},{name:"bodyPart_4",parent:"bodyPart_2",pivot:[0,2,7],cubes:[{origin:[-1,0,5.5],size:[2,2,3],uv:[0,22]}]},{name:"bodyPart_5",parent:"bodyPart_2",pivot:[0,1,9.5],cubes:[{origin:[-1,0,8.5],size:[2,1,2],uv:[11,0]}]},{name:"bodyPart_6",parent:"bodyPart_2",pivot:[0,1,11.5],cubes:[{origin:[-.5,0,10.5],size:[1,1,2],uv:[13,4]}]},{name:"bodyLayer_0",parent:"bodyPart_2",pivot:[0,8,1],cubes:[{origin:[-5,0,-.5],size:[10,8,3],uv:[20,0]}]},{name:"bodyLayer_1",parent:"bodyPart_4",pivot:[0,4,7],cubes:[{origin:[-3,0,5.5],size:[6,4,3],uv:[20,11]}]},{name:"bodyLayer_2",parent:"bodyPart_1",pivot:[0,5,-1.5],cubes:[{origin:[-3,0,-3],size:[6,5,2],uv:[20,18]}]}]}},render_controllers:["controller.render.silverfish"],spawn_egg:{texture:"spawn_egg",texture_index:8}},skeleton:{identifier:"minecraft:skeleton",min_engine_version:"1.8.0",materials:{default:"skeleton"},textures:{default:"textures/entity/skeleton/skeleton"},geometry:{default:{texturewidth:64,textureheight:32,visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",pivot:[0,12,0]},{name:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-6,12,-1],size:[2,12,2],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-1],size:[2,12,2],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-2,12,0],cubes:[{origin:[-3,0,-1],size:[2,12,2],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[2,12,0],cubes:[{origin:[1,0,-1],size:[2,12,2],uv:[0,16]}],mirror:!0,parent:"body"}]}},spawn_egg:{texture:"spawn_egg",texture_index:9},render_controllers:["controller.render.skeleton"],enable_attachables:!0},skeleton_horse:{identifier:"minecraft:skeleton_horse",textures:{base_brown:"textures/entity/horse/horse_brown",base_white:"textures/entity/horse/horse_white",base_chestnut:"textures/entity/horse/horse_chestnut",base_creamy:"textures/entity/horse/horse_creamy",base_black:"textures/entity/horse/horse_black",base_gray:"textures/entity/horse/horse_gray",base_darkbrown:"textures/entity/horse/horse_darkbrown",markings_none:"textures/entity/horse/horse_markings_none",markings_white:"textures/entity/horse/horse_markings_white",markings_whitefield:"textures/entity/horse/horse_markings_whitefield",markings_whitedots:"textures/entity/horse/horse_markings_whitedots",markings_blackdots:"textures/entity/horse/horse_markings_blackdots",mule:"textures/entity/horse/mule",donkey:"textures/entity/horse/donkey",skeleton:"textures/entity/horse/horse_skeleton",zombie:"textures/entity/horse/horse_zombie",armor_none:"textures/entity/horse/armor/horse_armor_none",armor_leather:"textures/entity/horse/armor/horse_armor_leather",armor_iron:"textures/entity/horse/armor/horse_armor_iron",armor_gold:"textures/entity/horse/armor/horse_armor_gold",armor_diamond:"textures/entity/horse/armor/horse_armor_diamond"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:3,visible_bounds_offset:[0,1,0],texturewidth:128,textureheight:128,bones:[{name:"Body",pivot:[0,13,9],rotation:[0,0,0],cubes:[{origin:[-5,11,-10],size:[10,10,24],uv:[0,34]}]},{name:"TailA",pivot:[0,21,14],rotation:[-65,0,0],cubes:[{origin:[-1,20,14],size:[2,2,3],uv:[44,0]}]},{name:"TailB",pivot:[0,21,14],rotation:[-65,0,0],cubes:[{origin:[-1.5,19,17],size:[3,4,7],uv:[38,7]}]},{name:"TailC",pivot:[0,21,14],rotation:[-80.34,0,0],cubes:[{origin:[-1.5,21.5,23],size:[3,4,7],uv:[24,3]}]},{name:"Leg1A",pivot:[4,15,11],rotation:[0,0,0],cubes:[{origin:[1.5,8,8.5],size:[4,9,5],uv:[78,29]}]},{name:"Leg1B",pivot:[4,8,11],rotation:[0,0,0],cubes:[{origin:[2,3,9.5],size:[3,5,3],uv:[78,43]}]},{name:"Leg1C",pivot:[4,8,11],rotation:[0,0,0],cubes:[{origin:[1.5,-.1,9],size:[4,3,4],uv:[78,51]}]},{name:"Leg2A",pivot:[-4,15,11],rotation:[0,0,0],cubes:[{origin:[-5.5,8,8.5],size:[4,9,5],uv:[96,29]}]},{name:"Leg2B",pivot:[-4,8,11],rotation:[0,0,0],cubes:[{origin:[-5,3,9.5],size:[3,5,3],uv:[96,43]}]},{name:"Leg2C",pivot:[-4,8,11],rotation:[0,0,0],cubes:[{origin:[-5.5,-.1,9],size:[4,3,4],uv:[96,51]}]},{name:"Leg3A",pivot:[4,15,-8],rotation:[0,0,0],cubes:[{origin:[2.1,8,-10.1],size:[3,8,4],uv:[44,29]}]},{name:"Leg3B",pivot:[4,8,-8],rotation:[0,0,0],cubes:[{origin:[2.1,3,-9.6],size:[3,5,3],uv:[44,41]}]},{name:"Leg3C",pivot:[4,8,-8],rotation:[0,0,0],cubes:[{origin:[1.6,-.1,-10.1],size:[4,3,4],uv:[44,51]}]},{name:"Leg4A",pivot:[-4,15,-8],rotation:[0,0,0],cubes:[{origin:[-5.1,8,-10.1],size:[3,8,4],uv:[60,29]}]},{name:"Leg4B",pivot:[-4,8,-8],rotation:[0,0,0],cubes:[{origin:[-5.1,3,-9.6],size:[3,5,3],uv:[60,41]}]},{name:"Leg4C",pivot:[-4,8,-8],rotation:[0,0,0],cubes:[{origin:[-5.6,-.1,-10.1],size:[4,3,4],uv:[60,51]}]},{name:"Head",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.5,25,-11.5],size:[5,5,7],uv:[0,0]}]},{name:"UMouth",pivot:[0,20.05,-10],rotation:[30,0,0],cubes:[{origin:[-2,27.05,-17],size:[4,3,6],uv:[24,18]}]},{name:"LMouth",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2,25,-16.5],size:[4,2,5],uv:[24,27]}]},{name:"Ear1",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[.45,29,-6],size:[2,3,1],uv:[0,0]}]},{name:"Ear2",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.45,29,-6],size:[2,3,1],uv:[0,0]}]},{name:"MuleEarL",pivot:[0,20,-10],rotation:[30,0,15],cubes:[{origin:[-2,29,-6],size:[2,7,1],uv:[0,12]}]},{name:"MuleEarR",pivot:[0,20,-10],rotation:[30,0,-15],cubes:[{origin:[0,29,-6],size:[2,7,1],uv:[0,12]}]},{name:"Neck",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.05,15.8,-12],size:[4,14,8],uv:[0,12]}]},{name:"Bag1",pivot:[-7.5,21,10],rotation:[0,90,0],cubes:[{origin:[-10.5,13,10],size:[8,8,3],uv:[0,34]}]},{name:"Bag2",pivot:[4.5,21,10],rotation:[0,90,0],cubes:[{origin:[1.5,13,10],size:[8,8,3],uv:[0,47]}]},{name:"Saddle",pivot:[0,22,2],rotation:[0,0,0],cubes:[{origin:[-5,21,-1],size:[10,1,8],uv:[80,0]}]},{name:"SaddleB",pivot:[0,22,2],rotation:[0,0,0],cubes:[{origin:[-1.5,22,-1],size:[3,1,2],uv:[106,9]}]},{name:"SaddleC",pivot:[0,22,2],rotation:[0,0,0],cubes:[{origin:[-4,22,5],size:[8,1,2],uv:[80,9]}]},{name:"SaddleL2",pivot:[5,21,2],rotation:[0,0,0],cubes:[{origin:[4.5,13,1],size:[1,2,2],uv:[74,0]}]},{name:"SaddleL",pivot:[5,21,2],rotation:[0,0,0],cubes:[{origin:[4.5,15,1.5],size:[1,6,1],uv:[70,0]}]},{name:"SaddleR2",pivot:[-5,21,2],rotation:[0,0,0],cubes:[{origin:[-5.5,13,1],size:[1,2,2],uv:[74,4]}]},{name:"SaddleR",pivot:[-5,21,2],rotation:[0,0,0],cubes:[{origin:[-5.5,15,1.5],size:[1,6,1],uv:[80,0]}]},{name:"SaddleMouthL",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[1.5,26,-14],size:[1,2,2],uv:[74,13]}]},{name:"SaddleMouthR",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.5,26,-14],size:[1,2,2],uv:[74,13]}]},{name:"SaddleMouthLine",pivot:[0,20,-10],rotation:[0,0,0],cubes:[{origin:[2.6,23,-16],size:[0,3,16],uv:[44,10]}]},{name:"SaddleMouthLineR",pivot:[0,20,-10],rotation:[0,0,0],cubes:[{origin:[-2.6,23,-16],size:[0,3,16],uv:[44,5]}]},{name:"Mane",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-1,15.5,-5],size:[2,16,4],uv:[58,0]}]},{name:"HeadSaddle",pivot:[0,20,-10],rotation:[30,0,0],cubes:[{origin:[-2.5,25.1,-17],size:[5,5,12],uv:[80,12],inflate:.05}]}]}},spawn_egg:{texture:"spawn_egg",texture_index:32}},slime:{identifier:"minecraft:slime",materials:{default:"slime",outer:"slime_outer"},textures:{default:"textures/entity/slime/slime"},geometry:{default:{visible_bounds_width:5,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"cube",pivot:[0,24,0],cubes:[{origin:[-3,1,-3],size:[6,6,6],uv:[0,16]}]},{name:"eye0",parent:"cube",pivot:[0,24,0],cubes:[{origin:[-3.3,4,-3.5],size:[2,2,2],uv:[32,0]}]},{name:"eye1",parent:"cube",pivot:[0,24,0],cubes:[{origin:[1.3,4,-3.5],size:[2,2,2],uv:[32,4]}]},{name:"mouth",parent:"cube",pivot:[0,24,0],cubes:[{origin:[0,2,-3.5],size:[1,1,1],uv:[32,8]}]}]},armor:{visible_bounds_width:1,visible_bounds_height:1,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"cube",pivot:[0,24,0],cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,0]}]},{name:"eye0",parent:"cube",pivot:[0,24,0],cubes:[{origin:[-3.3,4,-3.5],size:[2,2,2],uv:[32,0]}]},{name:"eye1",parent:"cube",pivot:[0,24,0],cubes:[{origin:[1.3,4,-3.5],size:[2,2,2],uv:[32,4]}]},{name:"mouth",parent:"cube",pivot:[0,24,0],cubes:[{origin:[0,2,-3.5],size:[1,1,1],uv:[32,8]}]}]}},render_controllers:["controller.render.slime","controller.render.slime_armor"],spawn_egg:{texture:"spawn_egg",texture_index:10}},small_fireball:{identifier:"minecraft:small_fireball",materials:{default:"fireball"},textures:{default:"textures/items/fire_charge"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-4,0],size:[16,16,0],uv:{south:{uv:[0,0]}}}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.fireball"]},snow_golem:{identifier:"minecraft:snow_golem",min_engine_version:"1.8.0",materials:{default:"snow_golem",head:"snow_golem_pumpkin"},textures:{default:"textures/entity/snow_golem"},geometry:{default:{visible_bounds_width:1,visible_bounds_height:2,visible_bounds_offset:[0,1,0],bones:[{name:"head",parent:"piece1",pivot:[0,20,0],locators:{lead:[0,20,0]},cubes:[{origin:[-4,20,-4],size:[8,8,8],uv:[0,0],inflate:-.5}]},{name:"arm1",parent:"piece1",pivot:[0,18,0],bind_pose_rotation:[0,0,57.3],cubes:[{origin:[1,20,-1],size:[12,2,2],uv:[32,0],inflate:-.5}]},{name:"arm2",parent:"piece1",pivot:[0,18,0],bind_pose_rotation:[0,180,-57.3],cubes:[{origin:[1,20,-1],size:[12,2,2],uv:[32,0],inflate:-.5}]},{name:"piece1",parent:"piece2",pivot:[0,11,0],cubes:[{origin:[-5,11,-5],size:[10,10,10],uv:[0,16],inflate:-.5}]},{name:"piece2",pivot:[0,0,0],cubes:[{origin:[-6,0,-6],size:[12,12,12],uv:[0,36],inflate:-.5}]}]}},render_controllers:["controller.render.snowgolem"]},snowball:{identifier:"minecraft:snowball",materials:{default:"snowball"},textures:{default:"textures/items/snowball"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.item_sprite"]},potion:{identifier:"minecraft:splash_potion",materials:{default:"splash_potion_enchanted"},textures:{moveSlowdown:"textures/items/potion_bottle_splash_moveSlowdown",moveSpeed:"textures/items/potion_bottle_splash_moveSpeed",digSlowdown:"textures/items/potion_bottle_splash_digSlowdown",digSpeed:"textures/items/potion_bottle_splash_digSpeed",damageBoost:"textures/items/potion_bottle_splash_damageBoost",heal:"textures/items/potion_bottle_splash_heal",harm:"textures/items/potion_bottle_splash_harm",jump:"textures/items/potion_bottle_splash_jump",confusion:"textures/items/potion_bottle_splash_confusion",regeneration:"textures/items/potion_bottle_splash_regeneration",resistance:"textures/items/potion_bottle_splash_resistance",fireResistance:"textures/items/potion_bottle_splash_fireResistance",waterBreathing:"textures/items/potion_bottle_splash_waterBreathing",invisibility:"textures/items/potion_bottle_splash_invisibility",blindness:"textures/items/potion_bottle_splash_blindness",nightVision:"textures/items/potion_bottle_splash_nightVision",hunger:"textures/items/potion_bottle_splash_hunger",weakness:"textures/items/potion_bottle_splash_weakness",poison:"textures/items/potion_bottle_splash_poison",wither:"textures/items/potion_bottle_splash_wither",healthBoost:"textures/items/potion_bottle_splash_healthBoost",absorption:"textures/items/potion_bottle_splash_absorption",saturation:"textures/items/potion_bottle_splash_saturation",levitation:"textures/items/potion_bottle_splash_levitation",turtleMaster:"textures/items/potion_bottle_splash_turtleMaster",slowFall:"textures/items/potion_bottle_splash_slowFall",default:"textures/items/potion_bottle_splash",enchanted:"textures/misc/enchanted_item_glint"},geometry:{default:{bones:[{name:"body",pivot:[0,0,0],cubes:[{origin:[-8,-8,0],size:[16,16,0],uv:[0,0],rotation:[0,0,0]}]}],texturewidth:16,textureheight:16}},render_controllers:["controller.render.splash_potion"]},squid:{identifier:"minecraft:squid",materials:{default:"squid"},textures:{default:"textures/entity/squid"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:2,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32,bones:[{name:"body",cubes:[{origin:[-6,-8,-6],size:[12,16,12],uv:[0,0]}]},{name:"tentacle1",parent:"body",pivot:[5,-7,0],cubes:[{origin:[4,-25,-1],size:[2,18,2],uv:[48,0]}],rotation:[0,90,0]},{name:"tentacle2",parent:"body",pivot:[3.5,-7,3.5],cubes:[{origin:[2.5,-25,2.5],size:[2,18,2],uv:[48,0]}],rotation:[0,45,0]},{name:"tentacle3",parent:"body",pivot:[0,-7,5],cubes:[{origin:[-1,-25,4],size:[2,18,2],uv:[48,0]}],rotation:[0,0,0]},{name:"tentacle4",parent:"body",pivot:[-3.5,-7,3.5],cubes:[{origin:[-4.5,-25,2.5],size:[2,18,2],uv:[48,0]}],rotation:[0,-45,0]},{name:"tentacle5",parent:"body",pivot:[-5,-7,0],cubes:[{origin:[-6,-25,-1],size:[2,18,2],uv:[48,0]}],rotation:[0,-90,0]},{name:"tentacle6",parent:"body",pivot:[-3.5,-7,-3.5],cubes:[{origin:[-4.5,-25,-4.5],size:[2,18,2],uv:[48,0]}],rotation:[0,-135,0]},{name:"tentacle7",parent:"body",pivot:[0,-7,-5],cubes:[{origin:[-1,-25,-6],size:[2,18,2],uv:[48,0]}],rotation:[0,-180,0]},{name:"tentacle8",parent:"body",pivot:[3.5,-7,-3.5],cubes:[{origin:[2.5,-25,-4.5],size:[2,18,2],uv:[48,0]}],rotation:[0,-225,0]}]}},render_controllers:["controller.render.squid"],spawn_egg:{texture:"spawn_egg",texture_index:15}},stray:{identifier:"minecraft:stray",min_engine_version:"1.8.0",materials:{default:"stray",overlay:"stray_clothes"},textures:{default:"textures/entity/skeleton/stray",overlay:"textures/entity/skeleton/stray_overlay"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",pivot:[0,12,0]},{name:"head",pivot:[0,24,0],locators:{lead:[0,24,0]},cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-6,12,-1],size:[2,12,2],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-1],size:[2,12,2],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-2,12,0],cubes:[{origin:[-3,0,-1],size:[2,12,2],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[2,12,0],cubes:[{origin:[1,0,-1],size:[2,12,2],uv:[0,16]}],mirror:!0,parent:"body"}]},overlay:{visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",parent:"waist",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],inflate:.25},{name:"waist",neverRender:!0,pivot:[0,12,0]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],inflate:.25},{name:"hat",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]}],inflate:.25},{name:"rightItem",parent:"rightArm",pivot:[-6,15,1],neverRender:!0},{name:"leftArm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16]}],mirror:!0,inflate:.25},{name:"rightLeg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-3.9,0,-2],size:[4,12,4],uv:[0,16]}],inflate:.25},{name:"leftLeg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16]}],inflate:.25,mirror:!0}]}},spawn_egg:{texture:"spawn_egg",texture_index:27},render_controllers:["controller.render.stray_clothes","controller.render.stray"],enable_attachables:!0},strider:{identifier:"minecraft:strider",materials:{default:"strider"},textures:{default:"textures/entity/strider/strider",saddled:"textures/entity/strider/strider",suffocated:"textures/entity/strider/strider_cold",suffocated_saddled:"textures/entity/strider/strider_cold"},geometry:{default:{bones:[{name:"right_leg",pivot:[-4,16,0],cubes:[{origin:[-6,0,-2],size:[4,16,4],uv:[0,32]}]},{name:"left_leg",pivot:[4,16,0],cubes:[{origin:[2,0,-2],size:[4,16,4],uv:[0,55]}]},{name:"body",pivot:[0,16,0],cubes:[{origin:[-8,14,-8],size:[16,14,16],uv:[0,0]}],locators:{lead:[0,15,-1]}},{name:"bristle5",parent:"body",pivot:[8,19,0],cubes:[{origin:[8,19,-8],size:[12,0,16],pivot:[8,19,0],rotation:[0,0,70],uv:[16,65]}]},{name:"bristle4",parent:"body",pivot:[8,24,0],cubes:[{origin:[8,24,-8],size:[12,0,16],pivot:[8,24,0],rotation:[0,0,65],uv:[16,49]}]},{name:"bristle3",parent:"body",pivot:[8,28,0],cubes:[{origin:[8,28,-8],size:[12,0,16],pivot:[8,28,0],rotation:[0,0,50],uv:[16,33]}]},{name:"bristle2",parent:"body",pivot:[-8,28,0],cubes:[{origin:[-20,28,-8],size:[12,0,16],pivot:[-8,28,0],rotation:[0,0,-50],uv:[16,33],mirror:!0}]},{name:"bristle1",parent:"body",pivot:[-8,24,0],cubes:[{origin:[-20,24,-8],size:[12,0,16],pivot:[-8,24,0],rotation:[0,0,-65],uv:[16,49],mirror:!0}]},{name:"bristle0",parent:"body",pivot:[-8,19,0],cubes:[{origin:[-20,19,-8],size:[12,0,16],pivot:[-8,19,0],rotation:[0,0,-70],uv:[16,65],mirror:!0}]}],visible_bounds_width:3,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:128}},spawn_egg:{base_color:"#9c3436",overlay_color:"#4d494d"},render_controllers:["controller.render.strider"]},text_display:{identifier:"minecraft:text_display",geometry:{}},trident:{identifier:"minecraft:thrown_trident",textures:{default:"textures/entity/trident",loyalty_rope:"textures/entity/lead_knot"},geometry:{default:{texturewidth:32,textureheight:32,bones:[{name:"pole",pivot:[0,24,0],cubes:[{origin:[-.5,-3,-.5],size:[1,31,1],inflate:.01,uv:[0,0]},{origin:[-1.5,22,-.5],size:[3,2,1],uv:[4,0]},{origin:[-2.5,23,-.5],size:[1,4,1],uv:[4,3]},{origin:[1.5,23,-.5],size:[1,4,1],uv:[4,3]}]}]}}},tnt_minecart:{identifier:"minecraft:tnt_minecart",min_engine_version:"1.8.0",materials:{default:"minecart"},textures:{default:"textures/entity/minecart"},geometry:{default:{bones:[{name:"bottom",pivot:[0,6,0],cubes:[{origin:[-10,-6.5,-1],size:[20,16,2],rotation:[90,0,0],uv:[0,10]}]},{name:"back",pivot:[0,0,0],cubes:[{origin:[-17,2.5,-1],size:[16,8,2],rotation:[0,270,0],uv:[0,0]}],parent:"bottom"},{name:"front",pivot:[0,0,0],cubes:[{origin:[1,2.5,-1],size:[16,8,2],rotation:[0,90,0],uv:[0,0]}],parent:"bottom"},{name:"right",pivot:[0,0,0],cubes:[{origin:[-8,2.5,-8],size:[16,8,2],rotation:[0,180,0],uv:[0,0]}],parent:"bottom"},{name:"left",pivot:[0,0,0],cubes:[{origin:[-8,2.5,6],size:[16,8,2],uv:[0,0]}],parent:"bottom"}],texturewidth:64,textureheight:32}},render_controllers:["controller.render.minecart"]},tropical_fish:{identifier:"minecraft:tropicalfish",materials:{default:"tropicalfish"},textures:{typeA:"textures/entity/fish/tropical_a",typeB:"textures/entity/fish/tropical_b",aPattern1:"textures/entity/fish/tropical_a_pattern_1",aPattern2:"textures/entity/fish/tropical_a_pattern_2",aPattern3:"textures/entity/fish/tropical_a_pattern_3",aPattern4:"textures/entity/fish/tropical_a_pattern_4",aPattern5:"textures/entity/fish/tropical_a_pattern_5",aPattern6:"textures/entity/fish/tropical_a_pattern_6",bPattern1:"textures/entity/fish/tropical_b_pattern_1",bPattern2:"textures/entity/fish/tropical_b_pattern_2",bPattern3:"textures/entity/fish/tropical_b_pattern_3",bPattern4:"textures/entity/fish/tropical_b_pattern_4",bPattern5:"textures/entity/fish/tropical_b_pattern_5",bPattern6:"textures/entity/fish/tropical_b_pattern_6"},geometry:{typeA:{visible_bounds_width:.5,visible_bounds_height:.5,bones:[{pivot:[-.5,0,0],cubes:[{origin:[-1,0,-3],size:[2,3,6],uv:[0,0]},{origin:[0,3,-2.9992],size:[0,4,6],uv:[10,-6]}],name:"body"},{pivot:[0,0,3],cubes:[{origin:[0,0,3],size:[0,3,4],uv:[24,-4]}],name:"tailfin",parent:"body"},{pivot:[.5,0,1],bind_pose_rotation:[0,-35,0],cubes:[{origin:[.336,0,-.10594],size:[2,2,0],uv:[2,12]}],name:"leftFin",parent:"body"},{pivot:[-.5,0,1],bind_pose_rotation:[0,35,0],cubes:[{origin:[-2.336,0,-.10594],size:[2,2,0],uv:[2,16]}],name:"rightFin",parent:"body"}],texturewidth:32,textureheight:32},typeB:{visible_bounds_width:.5,visible_bounds_height:.5,bones:[{pivot:[-.5,0,0],cubes:[{origin:[-1,0,-8e-4],size:[2,6,6],uv:[0,20]},{origin:[0,-5,-8e-4],size:[0,5,6],uv:[20,21]},{origin:[0,6,-8e-4],size:[0,5,6],uv:[20,10]}],name:"body"},{pivot:[0,0,6],cubes:[{origin:[0,8e-4,6],size:[0,6,5],uv:[21,16]}],name:"tailfin",parent:"body"},{pivot:[.5,0,1],bind_pose_rotation:[0,-35,0],cubes:[{origin:[2.05673,0,2.35152],size:[2,2,0],uv:[2,12]}],name:"leftFin",parent:"body"},{pivot:[-.5,0,1],bind_pose_rotation:[0,35,0],cubes:[{origin:[-4.05673,0,2.35152],size:[2,2,0],uv:[2,16]}],name:"rightFin",parent:"body"}],texturewidth:32,textureheight:32}},render_controllers:["controller.render.tropicalfish"],spawn_egg:{texture:"spawn_egg",texture_index:44}},vindicator:{identifier:"minecraft:vindicator",min_engine_version:"1.8.0",materials:{default:"vindicator"},textures:{default:"textures/entity/illager/vindicator"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],texturewidth:64,textureheight:64,bones:[{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[0,0]}]},{name:"nose",parent:"head",pivot:[0,26,0],cubes:[{origin:[-1,23,-6],size:[2,4,2],uv:[24,0]}]},{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-3],size:[8,12,6],uv:[16,20]},{origin:[-4,6,-3],size:[8,18,6],uv:[0,38],inflate:.5}]},{name:"arms",parent:"body",pivot:[0,22,0],cubes:[{origin:[-8,16,-2],size:[4,8,4],uv:[44,22]},{origin:[4,16,-2],size:[4,8,4],uv:[44,22]},{origin:[-4,16,-2],size:[8,4,4],uv:[40,38]}]},{name:"leg0",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"leg1",parent:"body",pivot:[2,12,0],mirror:!0,cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,46]}]},{name:"rightItem",pivot:[-5.5,16,.5],neverRender:!0,parent:"rightArm"},{name:"leftArm",parent:"body",pivot:[5,22,0],mirror:!0,cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,46]}]}]}},spawn_egg:{texture:"spawn_egg",texture_index:39},render_controllers:["controller.render.vindicator"],enable_attachables:!0},wandering_trader:{identifier:"minecraft:wandering_trader",materials:{default:"wandering_trader"},textures:{default:"textures/entity/wandering_trader"},geometry:{default:{visible_bounds_width:1.5,visible_bounds_height:2.5,visible_bounds_offset:[0,1.25,0],bones:[{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[0,0]}]},{name:"helmet",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,10,8],uv:[32,0],inflate:.5}]},{name:"brim",parent:"head",pivot:[0,24,0],bind_pose_rotation:[-90,0,0],cubes:[{origin:[-8,16,-6],size:[16,16,1],uv:[30,47],inflate:.1}]},{name:"nose",parent:"head",pivot:[0,26,0],cubes:[{origin:[-1,23,-6],size:[2,4,2],uv:[24,0]}]},{name:"body",locators:{lead_hold:[0,40,0]},cubes:[{origin:[-4,12,-3],size:[8,12,6],uv:[16,20]},{origin:[-4,6,-3],size:[8,18,6],uv:[0,38],inflate:.5}]},{name:"arms",parent:"body",pivot:[0,22,0],cubes:[{origin:[-4,16,-2],size:[8,4,4],uv:[40,38]},{origin:[-8,16,-2],size:[4,8,4],uv:[44,22]},{origin:[4,16,-2],size:[4,8,4],uv:[44,22],mirror:!0}]},{name:"held_item",parent:"arms",pivot:[0,0,0]},{name:"leg0",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,22]}]},{name:"leg1",parent:"body",pivot:[2,12,0],cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[0,22],mirror:!0}]}]}},render_controllers:["controller.render.wandering_trader"],spawn_egg:{texture:"spawn_egg_wandering_trader"}},wither:{identifier:"minecraft:wither",min_engine_version:"1.8.0",materials:{default:"wither_boss",armor:"wither_boss_armor"},textures:{default:"textures/entity/wither/wither",armor_white:"textures/entity/wither/wither_armor",armor_blue:"textures/entity/wither/wither_armor",invulnerable:"textures/entity/wither/wither_invulnerable"},geometry:{default:{visible_bounds_width:3,visible_bounds_height:4,visible_bounds_offset:[0,2,0],texturewidth:64,textureheight:64,bones:[{name:"upperBodyPart1",cubes:[{origin:[-10,17.1,-.5],size:[20,3,3],uv:[0,16]}]},{name:"upperBodyPart2",parent:"upperBodyPart1",pivot:[-2,17.1,-.5],cubes:[{origin:[-2,7.1,-.5],size:[3,10,3],uv:[0,22]},{origin:[-6,13.6,0],size:[11,2,2],uv:[24,22]},{origin:[-6,11.1,0],size:[11,2,2],uv:[24,22]},{origin:[-6,8.6,0],size:[11,2,2],uv:[24,22]}]},{name:"upperBodyPart3",parent:"upperBodyPart2",pivot:[0,24,0],cubes:[{origin:[0,18,0],size:[3,6,3],uv:[12,22]}]},{name:"head1",parent:"upperBodyPart1",pivot:[0,20,0],cubes:[{origin:[-4,20,-4],size:[8,8,8],uv:[0,0]}]},{name:"head2",parent:"upperBodyPart1",pivot:[-9,18,-1],cubes:[{origin:[-12,18,-4],size:[6,6,6],uv:[32,0]}]},{name:"head3",parent:"upperBodyPart1",pivot:[9,18,-1],cubes:[{origin:[6,18,-4],size:[6,6,6],uv:[32,0]}]}]},armor:{visible_bounds_width:3,visible_bounds_height:4,visible_bounds_offset:[0,2,0],texturewidth:64,textureheight:64,bones:[{name:"upperBodyPart1",cubes:[{origin:[-10,17.1,-.5],size:[20,3,3],uv:[0,16]}],inflate:2},{name:"upperBodyPart2",parent:"upperBodyPart1",pivot:[-2,17.1,-.5],cubes:[{origin:[-2,7.1,-.5],size:[3,10,3],uv:[0,22]},{origin:[-6,13.6,0],size:[11,2,2],uv:[24,22]},{origin:[-6,11.1,0],size:[11,2,2],uv:[24,22]},{origin:[-6,8.6,0],size:[11,2,2],uv:[24,22]}],inflate:2},{name:"upperBodyPart3",parent:"upperBodyPart2",pivot:[0,24,0],cubes:[{origin:[0,18,0],size:[3,6,3],uv:[12,22]}],inflate:2},{name:"head1",parent:"upperBodyPart1",pivot:[0,20,0],cubes:[{origin:[-4,20,-4],size:[8,8,8],uv:[0,0]}],inflate:2},{name:"head2",parent:"upperBodyPart1",pivot:[-9,18,-1],cubes:[{origin:[-12,18,-4],size:[6,6,6],uv:[32,0]}],inflate:2},{name:"head3",parent:"upperBodyPart1",pivot:[9,18,-1],cubes:[{origin:[6,18,-4],size:[6,6,6],uv:[32,0]}],inflate:2}]}},render_controllers:["controller.render.wither_boss","controller.render.wither_boss_armor_white","controller.render.wither_boss_armor_blue"]},wither_skeleton:{identifier:"minecraft:wither_skeleton",min_engine_version:"1.8.0",materials:{default:"skeleton"},textures:{default:"textures/entity/skeleton/wither_skeleton"},geometry:{default:{texturewidth:64,textureheight:32,visible_bounds_width:1.5,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],bones:[{name:"body",parent:"waist",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}]},{name:"waist",pivot:[0,12,0]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}]},{name:"hat",parent:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0},{name:"rightArm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-6,12,-1],size:[2,12,2],uv:[40,16]}]},{name:"rightItem",parent:"rightArm",pivot:[-1,-45,-5],neverRender:!0},{name:"leftArm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-1],size:[2,12,2],uv:[40,16]}],mirror:!0},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5],neverRender:!0},{name:"rightLeg",parent:"body",pivot:[-2,12,0],cubes:[{origin:[-3,0,-1],size:[2,12,2],uv:[0,16]}]},{name:"leftLeg",parent:"body",pivot:[2,12,0],cubes:[{origin:[1,0,-1],size:[2,12,2],uv:[0,16]}],mirror:!0}]}},render_controllers:["controller.render.wither_skeleton"],enable_attachables:!0,spawn_egg:{texture:"spawn_egg",texture_index:29}},wither_skull:{identifier:"minecraft:wither_skull",materials:{default:"wither_skull"},textures:{default:"textures/entity/wither/wither"},geometry:{default:{bones:[{name:"head",cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,35]}]}],visible_bounds_width:1,visible_bounds_height:1,texturewidth:64,textureheight:64}},render_controllers:["controller.render.wither_skull"]},zoglin:{identifier:"minecraft:zoglin",materials:{default:"zoglin"},textures:{default:"textures/entity/hoglin/zoglin"},geometry:{default:{bones:[{name:"body",pivot:[0,19,-3],cubes:[{origin:[-8,11,-7],size:[16,14,26],inflate:.02,uv:[1,1]},{origin:[0,22,-10],size:[0,10,19],inflate:.02,uv:[90,33]}],locators:{lead:[0,20,-5]}},{name:"head",parent:"body",pivot:[0,22,-5],rotation:[50,0,0],cubes:[{origin:[-7,21,-24],size:[14,6,19],uv:[61,1]},{origin:[-8,22,-19],size:[2,11,2],uv:[1,13]},{origin:[6,22,-19],size:[2,11,2],uv:[1,13]}]},{name:"right_ear",parent:"head",pivot:[-7,27,-7],rotation:[0,0,-50],cubes:[{origin:[-13,26,-10],size:[6,1,4],uv:[1,1]}]},{name:"left_ear",parent:"head",pivot:[7,27,-7],rotation:[0,0,50],cubes:[{origin:[7,26,-10],size:[6,1,4],uv:[1,6]}]},{name:"leg_back_right",pivot:[6,8,17],cubes:[{origin:[-8,0,13],size:[5,11,5],uv:[21,45]}]},{name:"leg_back_left",pivot:[-6,8,17],cubes:[{origin:[3,0,13],size:[5,11,5],uv:[0,45]}]},{name:"leg_front_right",pivot:[-6,12,-3],cubes:[{origin:[-8,0,-6],size:[6,14,6],uv:[66,42]}]},{name:"leg_front_left",pivot:[6,12,-3],cubes:[{origin:[2,0,-6],size:[6,14,6],uv:[41,42]}]}],visible_bounds_width:4,visible_bounds_height:3,visible_bounds_offset:[0,1.5,0],texturewidth:128,textureheight:64}},spawn_egg:{base_color:"#c66e55",overlay_color:"#e6e6e6"},render_controllers:["controller.render.zoglin"]},zombie:{identifier:"minecraft:zombie",min_engine_version:"1.8.0",materials:{default:"zombie"},textures:{default:"textures/entity/zombie/zombie"},geometry:{default:{visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:32,bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]}],parent:"waist"},{name:"waist",neverRender:!0,pivot:[0,12,0]},{name:"head",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[0,0]}],parent:"body"},{name:"hat",pivot:[0,24,0],cubes:[{origin:[-4,24,-4],size:[8,8,8],uv:[32,0],inflate:.5}],neverRender:!0,parent:"head"},{name:"rightArm",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]}],parent:"body"},{name:"rightItem",pivot:[-1,-45,-5],neverRender:!0,parent:"rightArm"},{name:"leftArm",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16]}],mirror:!0,parent:"body"},{name:"leftItem",pivot:[1,-45,-5],neverRender:!0,parent:"leftArm"},{name:"rightLeg",pivot:[-1.9,12,0],cubes:[{origin:[-3.9,0,-2],size:[4,12,4],uv:[0,16]}],parent:"body"},{name:"leftLeg",pivot:[1.9,12,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16]}],mirror:!0,parent:"body"}]}},spawn_egg:{texture:"spawn_egg",texture_index:12},scripts:{pre_animation:["variable.tcos0 = (Math.cos(query.modified_distance_moved * 38.17) * query.modified_move_speed / variable.gliding_speed_value) * 57.3;"]},animations:{humanoid_big_head:{loop:!0,bones:{head:{scale:1.4}}},look_at_target_default:{loop:!0,bones:{head:{relative_to:{rotation:"entity"},rotation:["query.target_x_rotation","query.target_y_rotation",0]}}},look_at_target_gliding:{loop:!0,bones:{head:{rotation:[-45,"query.target_y_rotation",0]}}},look_at_target_swimming:{loop:!0,bones:{head:{rotation:["math.lerp(query.target_x_rotation, -45.0, variable.swim_amount)","query.target_y_rotation",0]}}},move:{loop:!0,bones:{leftarm:{rotation:["variable.tcos0",0,0]},leftleg:{rotation:["variable.tcos0 * -1.4",0,0]},rightarm:{rotation:["-variable.tcos0",0,0]},rightleg:{rotation:["variable.tcos0 * 1.4",0,0]}}},"riding.arms":{loop:!0,bones:{leftarm:{rotation:[-36,0,0]},rightarm:{rotation:[-36,0,0]}}},"riding.legs":{loop:!0,bones:{leftleg:{rotation:["-72.0 - this","-18.0 - this","-this"]},rightleg:{rotation:["-72.0 - this","18.0 - this","-this"]}}},holding:{loop:!0,bones:{leftarm:{rotation:["variable.is_holding_left ? (-this * 0.5 - 18.0) : 0.0",0,0]},rightarm:{rotation:["variable.is_holding_right ? (-this * 0.5 - 18.0) : 0.0",0,0]}}},brandish_spear:{loop:!0,bones:{rightarm:{rotation:["this * -0.5 - 157.5 - 22.5 * variable.charge_amount","-this",0]}}},charging:{loop:!0,bones:{rightarm:{rotation:["22.5 * variable.charge_amount - this","-this",0]}}},"attack.rotations":{loop:!0,bones:{body:{rotation:[0,"math.sin(math.sqrt(variable.attack_time) * 360) * 11.46 - this",0]},leftarm:{rotation:["math.sin(math.sqrt(variable.attack_time) * 360) * 11.46",0,0]},rightarm:{rotation:["math.sin(1.0 - math.pow(1.0 - variable.attack_time, 3.0) * 180.0) * (variable.is_brandishing_spear ? -1.0 : 1.0 )","variable.is_brandishing_spear ? 0.0 : (math.sin(math.sqrt(variable.attack_time) * 360) * 11.46) * 2.0",0]}}},sneaking:{loop:!0,bones:{body:{rotation:["0.5 - this",0,0]},head:{position:[0,1,0]},leftarm:{rotation:[72,0,0]},leftleg:{position:[0,-3,4]},rightarm:{rotation:[72,0,0]},rightleg:{position:[0,-3,4]}}},bob:{loop:!0,bones:{leftarm:{rotation:[0,0,"((math.cos(query.life_time * 103.2) * 2.865) + 2.865) *-1.0"]},rightarm:{rotation:[0,0,"(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},damage_nearby_mobs:{loop:!0,bones:{leftarm:{rotation:["-45.0-this","-this","-this"]},leftleg:{rotation:["45.0-this","-this","-this"]},rightarm:{rotation:["45.0-this","-this","-this"]},rightleg:{rotation:["-45.0-this","-this","-this"]}}},bow_and_arrow:{loop:!0,bones:{leftarm:{rotation:["query.target_x_rotation - 90.0 - math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation + 28.65","-(math.cos(query.life_time * 103.2) * 2.865) - 2.865"]},rightarm:{rotation:["query.target_x_rotation - 90.0 + math.sin(query.life_time * 76.8) * 2.865 - this","query.target_y_rotation - 5.73","(math.cos(query.life_time * 103.2) * 2.865) + 2.865"]}}},use_item_progress:{loop:!0,bones:{rightarm:{rotation:["variable.use_item_startup_progress * -60.0 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -22.5 + variable.use_item_interval_progress * 11.25","variable.use_item_startup_progress * -5.625 + variable.use_item_interval_progress * 11.25"]}}},zombie_attack_bare_hand:{loop:!0,bones:{leftarm:{rotation:["-90.0 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) - (math.sin(query.life_time * 76.776372) * 2.865) - this","5.73 - ((math.sin(variable.attack_time * 180.0) * 57.3) * 0.6) - this","math.cos(query.life_time * 103.13244) * -2.865 - 2.865 - this"]},rightarm:{rotation:["90.0 * (variable.is_brandishing_spear - 1.0) - ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4) + (math.sin(query.life_time * 76.776372) * 2.865) - this","(math.sin(variable.attack_time * 180.0) * 57.3) * 0.6 - 5.73 - this","math.cos(query.life_time * 103.13244) * 2.865 + 2.865 - this"]}}},swimming:{loop:!0,bones:{body:{position:[0,"variable.swim_amount * -10.0 - this","variable.swim_amount * 9.0 - this"],rotation:["variable.swim_amount * (90.0 + query.target_x_rotation)",0,0]},leftarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) - (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, 14.325, variable.swim_amount) - (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},leftleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0 + 180.0) * 0.3, variable.swim_amount)",0,0]},rightarm:{rotation:["math.lerp(this, -180.0, variable.swim_amount) - (variable.swim_amount * ((math.sin(variable.attack_time * 180.0) * 57.3) * 1.2 - (math.sin((1.0 - (1.0 - variable.attack_time) * (1.0 - variable.attack_time)) * 180.0) * 57.3) * 0.4)) + (variable.swim_amount * (math.sin(query.life_time * 76.776372) * 2.865)) - this","math.lerp(this, 14.325, variable.swim_amount) - this","math.lerp(this, -14.325, variable.swim_amount) + (variable.swim_amount * (math.cos(query.life_time * 103.13244) * 2.865 + 2.865)) - this"]},rightleg:{rotation:["math.lerp(this, math.cos(query.life_time * 390.0) * 0.3, variable.swim_amount)",0,0]}}}},animation_controllers:{humanoid_baby_big_head:{initial_state:"default",states:{baby:{animations:["humanoid_big_head"],transitions:[{default:"!query.is_baby"}]},default:{transitions:[{baby:"query.is_baby"}]}}},look_at_target:{initial_state:"default",states:{default:{animations:["look_at_target_default"],transitions:[{gliding:"query.is_gliding"},{swimming:"query.is_swimming"}]},gliding:{animations:["look_at_target_gliding"],transitions:[{swimming:"query.is_swimming"},{default:"!query.is_gliding"}]},swimming:{animations:["look_at_target_swimming"],transitions:[{gliding:"query.is_gliding"},{default:"!query.is_swimming"}]}}},move:{initial_state:"default",states:{default:{animations:["move"]}}},riding:{initial_state:"default",states:{default:{transitions:[{riding:"query.is_riding"}]},riding:{animations:["riding.arms","riding.legs"],transitions:[{default:"!query.is_riding"}]}}},holding:{initial_state:"default",states:{default:{animations:["holding"]}}},brandish_spear:{initial_state:"default",states:{brandish_spear:{animations:["brandish_spear"],transitions:[{default:"!variable.is_brandishing_spear"}]},default:{transitions:[{brandish_spear:"variable.is_brandishing_spear"}]}}},charging:{initial_state:"default",states:{charging:{animations:["charging"],transitions:[{default:"!query.is_charging"}]},default:{transitions:[{charging:"query.is_charging"}]}}},attack:{initial_state:"default",states:{attacking:{animations:["attack.rotations"],transitions:[{default:"variable.attack_time < 0.0"}]},default:{transitions:[{attacking:"variable.attack_time >= 0.0"}]}}},sneaking:{initial_state:"default",states:{default:{transitions:[{sneaking:"query.is_sneaking"}]},sneaking:{animations:["sneaking"],transitions:[{default:"!query.is_sneaking"}]}}},bob:{initial_state:"default",states:{default:{animations:["bob"]}}},damage_nearby_mobs:{initial_state:"default",states:{damage_nearby_mobs:{animations:["damage_nearby_mobs"],transitions:[{default:"!variable.damage_nearby_mobs"}]},default:{transitions:[{damage_nearby_mobs:"variable.damage_nearby_mobs"}]}}},bow_and_arrow:{initial_state:"default",states:{bow_and_arrow:{animations:["bow_and_arrow"],transitions:[{default:"!query.has_target"}]},default:{transitions:[{bow_and_arrow:"query.has_target"}]}}},use_item_progress:{initial_state:"default",states:{default:{transitions:[{use_item_progress:"( variable.use_item_interval_progress > 0.0 ) || ( variable.use_item_startup_progress > 0.0 )"}]},use_item_progress:{animations:["use_item_progress"],transitions:[{default:"( variable.use_item_interval_progress <= 0.0 ) && ( variable.use_item_startup_progress <= 0.0 )"}]}}},zombie_attack_bare_hand:{initial_state:"default",states:{default:{transitions:[{is_bare_hand:"variable.is_holding_left != 1.0"}]},is_bare_hand:{animations:["zombie_attack_bare_hand"],transitions:[{default:"variable.is_holding_left == 1.0"}]}}},swimming:{initial_state:"default",states:{default:{transitions:[{is_swimming:"variable.swim_amount > 0.0"}]},is_swimming:{animations:["swimming"],transitions:[{default:"variable.swim_amount <= 0.0"}]}}}},render_controllers:["controller.render.zombie"],enable_attachables:!0},zombified_piglin:{identifier:"minecraft:zombie_pigman",min_engine_version:"1.8.0",materials:{default:"zombie"},textures:{default:"textures/entity/piglin/zombified_piglin"},geometry:{default:{bones:[{name:"body",pivot:[0,24,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16]},{origin:[-4,12,-2],size:[8,12,4],uv:[16,32],inflate:.25}]},{name:"head",parent:"body",pivot:[0,24,0],cubes:[{origin:[-5,24,-4],size:[10,8,8],uv:[0,0],inflate:-.02},{origin:[-2,24,-5],size:[4,4,1],uv:[31,1]},{origin:[2,24,-5],size:[1,2,1],uv:[2,4]},{origin:[-3,24,-5],size:[1,2,1],uv:[2,0]}],inflate:-.02},{name:"leftear",parent:"head",pivot:[5,30,0],rotation:[0,0,-30],cubes:[{origin:[4,25,-2],size:[1,5,4],uv:[51,6]}]},{name:"rightear",parent:"head",pivot:[-5,30,0],rotation:[0,0,30],cubes:[{origin:[-5,25,-2],size:[1,5,4],uv:[39,6]}]},{name:"hat",parent:"head",pivot:[0,24,0]},{name:"rightarm",parent:"body",pivot:[-5,22,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16]},{origin:[-8,12,-2],size:[4,12,4],uv:[40,32],inflate:.25}]},{name:"rightItem",parent:"rightarm",pivot:[-1,-45,-5]},{name:"leftarm",parent:"body",pivot:[5,22,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[32,48]},{origin:[4,12,-2],size:[4,12,4],uv:[48,48],inflate:.25}]},{name:"leftItem",parent:"leftArm",pivot:[1,-45,-5]},{name:"rightleg",parent:"body",pivot:[-1.9,12,0],cubes:[{origin:[-4,0,-2],size:[4,12,4],uv:[0,16]},{origin:[-4,0,-2],size:[4,12,4],uv:[0,32],inflate:.25}]},{name:"leftleg",parent:"body",pivot:[1.9,12,0],cubes:[{origin:[0,0,-2],size:[4,12,4],uv:[16,48]},{origin:[0,0,-2],size:[4,12,4],uv:[0,48],inflate:.25}]}],visible_bounds_width:2,visible_bounds_height:2,visible_bounds_offset:[0,1,0],texturewidth:64,textureheight:64}},spawn_egg:{texture:"spawn_egg",texture_index:13},render_controllers:["controller.render.zombie_pigman"],enable_attachables:!0}};A();E();R();x();var lr={};R5(lr,{allay:()=>r3,arrow:()=>k3,axolotl:()=>n3,blaze:()=>i3,boat:()=>F3,camel:()=>s3,cat:()=>o3,chicken:()=>a3,cod:()=>l3,creeper:()=>v3,dolphin:()=>c3,ender_dragon:()=>d3,enderman:()=>u3,endermite:()=>h3,fox:()=>f3,frog:()=>m3,ghast:()=>p3,goat:()=>g3,guardian:()=>b3,horse:()=>y3,llama:()=>_3,minecart:()=>w3,parrot:()=>A3,piglin:()=>E3,pillager:()=>x3,rabbit:()=>R3,shulker:()=>S3,sniffer:()=>T3,spider:()=>M3,tadpole:()=>C3,turtle:()=>B3,vex:()=>P3,villager:()=>I3,warden:()=>H3,witch:()=>L3,wolf:()=>O3,zombie_villager:()=>D3});A();E();R();x();var r3=`# Made in Blockbench 4.9.4
1179
1179
  mtllib materials.mtl
1180
1180
 
1181
1181
  o head
@@ -1499,7 +1499,7 @@ f 51/152/38 52/151/38 50/150/38 49/149/38
1499
1499
  f 56/156/39 51/155/39 49/154/39 54/153/39
1500
1500
  f 55/160/40 56/159/40 54/158/40 53/157/40
1501
1501
  f 54/164/41 49/163/41 50/162/41 53/161/41
1502
- f 55/168/42 52/167/42 51/166/42 56/165/42`;var e3=`# Made in Blockbench 4.9.4
1502
+ f 55/168/42 52/167/42 51/166/42 56/165/42`;var n3=`# Made in Blockbench 4.9.4
1503
1503
  mtllib materials.mtl
1504
1504
 
1505
1505
  o body
@@ -2007,7 +2007,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
2007
2007
  f 88/252/63 83/251/63 81/250/63 86/249/63
2008
2008
  f 87/256/64 88/255/64 86/254/64 85/253/64
2009
2009
  f 86/260/65 81/259/65 82/258/65 85/257/65
2010
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var t3=`# Made in Blockbench 4.9.4
2010
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var i3=`# Made in Blockbench 4.9.4
2011
2011
  mtllib materials.mtl
2012
2012
 
2013
2013
  o upperBodyParts0
@@ -2607,7 +2607,7 @@ f 99/296/74 100/295/74 98/294/74 97/293/74
2607
2607
  f 104/300/75 99/299/75 97/298/75 102/297/75
2608
2608
  f 103/304/76 104/303/76 102/302/76 101/301/76
2609
2609
  f 102/308/77 97/307/77 98/306/77 101/305/77
2610
- f 103/312/78 100/311/78 99/310/78 104/309/78`;var r3=`# Made in Blockbench 4.9.4
2610
+ f 103/312/78 100/311/78 99/310/78 104/309/78`;var s3=`# Made in Blockbench 4.9.4
2611
2611
  mtllib materials.mtl
2612
2612
 
2613
2613
  o body
@@ -3667,7 +3667,7 @@ f 179/536/134 180/535/134 178/534/134 177/533/134
3667
3667
  f 184/540/135 179/539/135 177/538/135 182/537/135
3668
3668
  f 183/544/136 184/543/136 182/542/136 181/541/136
3669
3669
  f 182/548/137 177/547/137 178/546/137 181/545/137
3670
- f 183/552/138 180/551/138 179/550/138 184/549/138`;var n3=`# Made in Blockbench 4.9.4
3670
+ f 183/552/138 180/551/138 179/550/138 184/549/138`;var o3=`# Made in Blockbench 4.9.4
3671
3671
  mtllib materials.mtl
3672
3672
 
3673
3673
  o body
@@ -4175,7 +4175,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
4175
4175
  f 88/252/63 83/251/63 81/250/63 86/249/63
4176
4176
  f 87/256/64 88/255/64 86/254/64 85/253/64
4177
4177
  f 86/260/65 81/259/65 82/258/65 85/257/65
4178
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var i3=`# Made in Blockbench 4.9.4
4178
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var a3=`# Made in Blockbench 4.9.4
4179
4179
  mtllib materials.mtl
4180
4180
 
4181
4181
  o body
@@ -4545,7 +4545,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
4545
4545
  f 64/180/45 59/179/45 57/178/45 62/177/45
4546
4546
  f 63/184/46 64/183/46 62/182/46 61/181/46
4547
4547
  f 62/188/47 57/187/47 58/186/47 61/185/47
4548
- f 63/192/48 60/191/48 59/190/48 64/189/48`;var s3=`# Made in Blockbench 4.9.4
4548
+ f 63/192/48 60/191/48 59/190/48 64/189/48`;var l3=`# Made in Blockbench 4.9.4
4549
4549
  mtllib materials.mtl
4550
4550
 
4551
4551
  o body
@@ -4915,7 +4915,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
4915
4915
  f 64/180/45 59/179/45 57/178/45 62/177/45
4916
4916
  f 63/184/46 64/183/46 62/182/46 61/181/46
4917
4917
  f 62/188/47 57/187/47 58/186/47 61/185/47
4918
- f 63/192/48 60/191/48 59/190/48 64/189/48`;var o3=`# Made in Blockbench 4.9.4
4918
+ f 63/192/48 60/191/48 59/190/48 64/189/48`;var v3=`# Made in Blockbench 4.9.4
4919
4919
  mtllib materials.mtl
4920
4920
 
4921
4921
  o Body
@@ -5193,7 +5193,7 @@ f 43/128/32 44/127/32 42/126/32 41/125/32
5193
5193
  f 48/132/33 43/131/33 41/130/33 46/129/33
5194
5194
  f 47/136/34 48/135/34 46/134/34 45/133/34
5195
5195
  f 46/140/35 41/139/35 42/138/35 45/137/35
5196
- f 47/144/36 44/143/36 43/142/36 48/141/36`;var a3=`# Made in Blockbench 4.9.4
5196
+ f 47/144/36 44/143/36 43/142/36 48/141/36`;var c3=`# Made in Blockbench 4.9.4
5197
5197
  mtllib materials.mtl
5198
5198
 
5199
5199
  o body
@@ -5563,7 +5563,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
5563
5563
  f 64/180/45 59/179/45 57/178/45 62/177/45
5564
5564
  f 63/184/46 64/183/46 62/182/46 61/181/46
5565
5565
  f 62/188/47 57/187/47 58/186/47 61/185/47
5566
- f 63/192/48 60/191/48 59/190/48 64/189/48`;var l3=`# Made in Blockbench 4.9.4
5566
+ f 63/192/48 60/191/48 59/190/48 64/189/48`;var d3=`# Made in Blockbench 4.9.4
5567
5567
  mtllib materials.mtl
5568
5568
 
5569
5569
  o neck
@@ -8555,7 +8555,7 @@ f 515/1544/386 516/1543/386 514/1542/386 513/1541/386
8555
8555
  f 520/1548/387 515/1547/387 513/1546/387 518/1545/387
8556
8556
  f 519/1552/388 520/1551/388 518/1550/388 517/1549/388
8557
8557
  f 518/1556/389 513/1555/389 514/1554/389 517/1553/389
8558
- f 519/1560/390 516/1559/390 515/1558/390 520/1557/390`;var v3=`# Made in Blockbench 4.9.4
8558
+ f 519/1560/390 516/1559/390 515/1558/390 520/1557/390`;var u3=`# Made in Blockbench 4.9.4
8559
8559
  mtllib materials.mtl
8560
8560
 
8561
8561
  o Head
@@ -8879,7 +8879,7 @@ f 51/152/38 52/151/38 50/150/38 49/149/38
8879
8879
  f 56/156/39 51/155/39 49/154/39 54/153/39
8880
8880
  f 55/160/40 56/159/40 54/158/40 53/157/40
8881
8881
  f 54/164/41 49/163/41 50/162/41 53/161/41
8882
- f 55/168/42 52/167/42 51/166/42 56/165/42`;var c3=`# Made in Blockbench 4.9.4
8882
+ f 55/168/42 52/167/42 51/166/42 56/165/42`;var h3=`# Made in Blockbench 4.9.4
8883
8883
  mtllib materials.mtl
8884
8884
 
8885
8885
  o section_2
@@ -9065,7 +9065,7 @@ f 27/80/20 28/79/20 26/78/20 25/77/20
9065
9065
  f 32/84/21 27/83/21 25/82/21 30/81/21
9066
9066
  f 31/88/22 32/87/22 30/86/22 29/85/22
9067
9067
  f 30/92/23 25/91/23 26/90/23 29/89/23
9068
- f 31/96/24 28/95/24 27/94/24 32/93/24`;var d3=`# Made in Blockbench 4.9.4
9068
+ f 31/96/24 28/95/24 27/94/24 32/93/24`;var f3=`# Made in Blockbench 4.9.4
9069
9069
  mtllib materials.mtl
9070
9070
 
9071
9071
  o body
@@ -9527,7 +9527,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
9527
9527
  f 80/228/57 75/227/57 73/226/57 78/225/57
9528
9528
  f 79/232/58 80/231/58 78/230/58 77/229/58
9529
9529
  f 78/236/59 73/235/59 74/234/59 77/233/59
9530
- f 79/240/60 76/239/60 75/238/60 80/237/60`;var u3=`# Made in Blockbench 4.9.4
9530
+ f 79/240/60 76/239/60 75/238/60 80/237/60`;var m3=`# Made in Blockbench 4.9.4
9531
9531
  mtllib materials.mtl
9532
9532
 
9533
9533
  o body
@@ -10265,7 +10265,7 @@ f 123/368/92 124/367/92 122/366/92 121/365/92
10265
10265
  f 128/372/93 123/371/93 121/370/93 126/369/93
10266
10266
  f 127/376/94 128/375/94 126/374/94 125/373/94
10267
10267
  f 126/380/95 121/379/95 122/378/95 125/377/95
10268
- f 127/384/96 124/383/96 123/382/96 128/381/96`;var h3=`# Made in Blockbench 4.9.4
10268
+ f 127/384/96 124/383/96 123/382/96 128/381/96`;var p3=`# Made in Blockbench 4.9.4
10269
10269
  mtllib materials.mtl
10270
10270
 
10271
10271
  o body
@@ -10727,7 +10727,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
10727
10727
  f 80/228/57 75/227/57 73/226/57 78/225/57
10728
10728
  f 79/232/58 80/231/58 78/230/58 77/229/58
10729
10729
  f 78/236/59 73/235/59 74/234/59 77/233/59
10730
- f 79/240/60 76/239/60 75/238/60 80/237/60`;var f3=`# Made in Blockbench 4.9.4
10730
+ f 79/240/60 76/239/60 75/238/60 80/237/60`;var g3=`# Made in Blockbench 4.9.4
10731
10731
  mtllib materials.mtl
10732
10732
 
10733
10733
  o left_back_leg
@@ -11327,7 +11327,7 @@ f 99/296/74 100/295/74 98/294/74 97/293/74
11327
11327
  f 104/300/75 99/299/75 97/298/75 102/297/75
11328
11328
  f 103/304/76 104/303/76 102/302/76 101/301/76
11329
11329
  f 102/308/77 97/307/77 98/306/77 101/305/77
11330
- f 103/312/78 100/311/78 99/310/78 104/309/78`;var m3=`# Made in Blockbench 4.9.4
11330
+ f 103/312/78 100/311/78 99/310/78 104/309/78`;var b3=`# Made in Blockbench 4.9.4
11331
11331
  mtllib materials.mtl
11332
11332
 
11333
11333
  o head
@@ -12341,7 +12341,7 @@ f 171/512/128 172/511/128 170/510/128 169/509/128
12341
12341
  f 176/516/129 171/515/129 169/514/129 174/513/129
12342
12342
  f 175/520/130 176/519/130 174/518/130 173/517/130
12343
12343
  f 174/524/131 169/523/131 170/522/131 173/521/131
12344
- f 175/528/132 172/527/132 171/526/132 176/525/132`;var p3=`# Made in Blockbench 4.9.4
12344
+ f 175/528/132 172/527/132 171/526/132 176/525/132`;var y3=`# Made in Blockbench 4.9.4
12345
12345
  mtllib materials.mtl
12346
12346
 
12347
12347
  o Body
@@ -13401,7 +13401,7 @@ f 179/536/134 180/535/134 178/534/134 177/533/134
13401
13401
  f 184/540/135 179/539/135 177/538/135 182/537/135
13402
13402
  f 183/544/136 184/543/136 182/542/136 181/541/136
13403
13403
  f 182/548/137 177/547/137 178/546/137 181/545/137
13404
- f 183/552/138 180/551/138 179/550/138 184/549/138`;var g3=`# Made in Blockbench 4.9.4
13404
+ f 183/552/138 180/551/138 179/550/138 184/549/138`;var _3=`# Made in Blockbench 4.9.4
13405
13405
  mtllib materials.mtl
13406
13406
 
13407
13407
  o head
@@ -13909,7 +13909,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
13909
13909
  f 88/252/63 83/251/63 81/250/63 86/249/63
13910
13910
  f 87/256/64 88/255/64 86/254/64 85/253/64
13911
13911
  f 86/260/65 81/259/65 82/258/65 85/257/65
13912
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var b3=`# Made in Blockbench 4.9.4
13912
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var w3=`# Made in Blockbench 4.9.4
13913
13913
  mtllib materials.mtl
13914
13914
 
13915
13915
  o bottom
@@ -14141,7 +14141,7 @@ f 35/104/26 36/103/26 34/102/26 33/101/26
14141
14141
  f 40/108/27 35/107/27 33/106/27 38/105/27
14142
14142
  f 39/112/28 40/111/28 38/110/28 37/109/28
14143
14143
  f 38/116/29 33/115/29 34/114/29 37/113/29
14144
- f 39/120/30 36/119/30 35/118/30 40/117/30`;var y3=`# Made in Blockbench 4.9.4
14144
+ f 39/120/30 36/119/30 35/118/30 40/117/30`;var A3=`# Made in Blockbench 4.9.4
14145
14145
  mtllib materials.mtl
14146
14146
 
14147
14147
  o body
@@ -14649,7 +14649,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
14649
14649
  f 88/252/63 83/251/63 81/250/63 86/249/63
14650
14650
  f 87/256/64 88/255/64 86/254/64 85/253/64
14651
14651
  f 86/260/65 81/259/65 82/258/65 85/257/65
14652
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var _3=`# Made in Blockbench 4.9.4
14652
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var E3=`# Made in Blockbench 4.9.4
14653
14653
  mtllib materials.mtl
14654
14654
 
14655
14655
  o Body
@@ -15387,7 +15387,7 @@ f 123/368/92 124/367/92 122/366/92 121/365/92
15387
15387
  f 128/372/93 123/371/93 121/370/93 126/369/93
15388
15388
  f 127/376/94 128/375/94 126/374/94 125/373/94
15389
15389
  f 126/380/95 121/379/95 122/378/95 125/377/95
15390
- f 127/384/96 124/383/96 123/382/96 128/381/96`;var w3=`# Made in Blockbench 4.9.4
15390
+ f 127/384/96 124/383/96 123/382/96 128/381/96`;var x3=`# Made in Blockbench 4.9.4
15391
15391
  mtllib materials.mtl
15392
15392
 
15393
15393
  o Body
@@ -15757,7 +15757,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
15757
15757
  f 64/180/45 59/179/45 57/178/45 62/177/45
15758
15758
  f 63/184/46 64/183/46 62/182/46 61/181/46
15759
15759
  f 62/188/47 57/187/47 58/186/47 61/185/47
15760
- f 63/192/48 60/191/48 59/190/48 64/189/48`;var A3=`# Made in Blockbench 4.9.4
15760
+ f 63/192/48 60/191/48 59/190/48 64/189/48`;var R3=`# Made in Blockbench 4.9.4
15761
15761
  mtllib materials.mtl
15762
15762
 
15763
15763
  o rearFootLeft
@@ -16311,7 +16311,7 @@ f 91/272/68 92/271/68 90/270/68 89/269/68
16311
16311
  f 96/276/69 91/275/69 89/274/69 94/273/69
16312
16312
  f 95/280/70 96/279/70 94/278/70 93/277/70
16313
16313
  f 94/284/71 89/283/71 90/282/71 93/281/71
16314
- f 95/288/72 92/287/72 91/286/72 96/285/72`;var E3=`# Aspose.3D Wavefront OBJ Exporter
16314
+ f 95/288/72 92/287/72 91/286/72 96/285/72`;var k3=`# Aspose.3D Wavefront OBJ Exporter
16315
16315
  # Copyright 2004-2024 Aspose Pty Ltd.
16316
16316
  # File created: 02/12/2025 20:01:28
16317
16317
 
@@ -16371,7 +16371,7 @@ f 5/8/5 6/4/6 8/3/7 7/5/8
16371
16371
  f 9/11/9 10/7/10 12/6/11 11/12/12
16372
16372
  #3 polygons
16373
16373
 
16374
- `;var x3=`# Made in Blockbench 4.9.4
16374
+ `;var S3=`# Made in Blockbench 4.9.4
16375
16375
  mtllib materials.mtl
16376
16376
 
16377
16377
  o base
@@ -16511,7 +16511,7 @@ f 19/56/14 20/55/14 18/54/14 17/53/14
16511
16511
  f 24/60/15 19/59/15 17/58/15 22/57/15
16512
16512
  f 23/64/16 24/63/16 22/62/16 21/61/16
16513
16513
  f 22/68/17 17/67/17 18/66/17 21/65/17
16514
- f 23/72/18 20/71/18 19/70/18 24/69/18`;var R3=`# Made in Blockbench 4.9.4
16514
+ f 23/72/18 20/71/18 19/70/18 24/69/18`;var T3=`# Made in Blockbench 4.9.4
16515
16515
  mtllib materials.mtl
16516
16516
 
16517
16517
  o body
@@ -17203,7 +17203,7 @@ f 115/344/86 116/343/86 114/342/86 113/341/86
17203
17203
  f 120/348/87 115/347/87 113/346/87 118/345/87
17204
17204
  f 119/352/88 120/351/88 118/350/88 117/349/88
17205
17205
  f 118/356/89 113/355/89 114/354/89 117/353/89
17206
- f 119/360/90 116/359/90 115/358/90 120/357/90`;var k3=`# Made in Blockbench 4.9.4
17206
+ f 119/360/90 116/359/90 115/358/90 120/357/90`;var M3=`# Made in Blockbench 4.9.4
17207
17207
  mtllib materials.mtl
17208
17208
 
17209
17209
  o head
@@ -17711,7 +17711,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
17711
17711
  f 88/252/63 83/251/63 81/250/63 86/249/63
17712
17712
  f 87/256/64 88/255/64 86/254/64 85/253/64
17713
17713
  f 86/260/65 81/259/65 82/258/65 85/257/65
17714
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var S3=`# Made in Blockbench 4.9.4
17714
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var C3=`# Made in Blockbench 4.9.4
17715
17715
  mtllib materials.mtl
17716
17716
 
17717
17717
  o body
@@ -17805,7 +17805,7 @@ f 11/32/8 12/31/8 10/30/8 9/29/8
17805
17805
  f 16/36/9 11/35/9 9/34/9 14/33/9
17806
17806
  f 15/40/10 16/39/10 14/38/10 13/37/10
17807
17807
  f 14/44/11 9/43/11 10/42/11 13/41/11
17808
- f 15/48/12 12/47/12 11/46/12 16/45/12`;var T3=`# Made in Blockbench 4.9.4
17808
+ f 15/48/12 12/47/12 11/46/12 16/45/12`;var B3=`# Made in Blockbench 4.9.4
17809
17809
  mtllib materials.mtl
17810
17810
 
17811
17811
  o body
@@ -18175,7 +18175,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
18175
18175
  f 64/180/45 59/179/45 57/178/45 62/177/45
18176
18176
  f 63/184/46 64/183/46 62/182/46 61/181/46
18177
18177
  f 62/188/47 57/187/47 58/186/47 61/185/47
18178
- f 63/192/48 60/191/48 59/190/48 64/189/48`;var M3=`# Made in Blockbench 4.9.4
18178
+ f 63/192/48 60/191/48 59/190/48 64/189/48`;var P3=`# Made in Blockbench 4.9.4
18179
18179
  mtllib materials.mtl
18180
18180
 
18181
18181
  o body
@@ -18499,7 +18499,7 @@ f 51/152/38 52/151/38 50/150/38 49/149/38
18499
18499
  f 56/156/39 51/155/39 49/154/39 54/153/39
18500
18500
  f 55/160/40 56/159/40 54/158/40 53/157/40
18501
18501
  f 54/164/41 49/163/41 50/162/41 53/161/41
18502
- f 55/168/42 52/167/42 51/166/42 56/165/42`;var C3=`# Made in Blockbench 4.9.4
18502
+ f 55/168/42 52/167/42 51/166/42 56/165/42`;var I3=`# Made in Blockbench 4.9.4
18503
18503
  mtllib materials.mtl
18504
18504
 
18505
18505
  o body
@@ -19007,7 +19007,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
19007
19007
  f 88/252/63 83/251/63 81/250/63 86/249/63
19008
19008
  f 87/256/64 88/255/64 86/254/64 85/253/64
19009
19009
  f 86/260/65 81/259/65 82/258/65 85/257/65
19010
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var B3=`# Made in Blockbench 4.9.4
19010
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var H3=`# Made in Blockbench 4.9.4
19011
19011
  mtllib materials.mtl
19012
19012
 
19013
19013
  o body
@@ -19469,7 +19469,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
19469
19469
  f 80/228/57 75/227/57 73/226/57 78/225/57
19470
19470
  f 79/232/58 80/231/58 78/230/58 77/229/58
19471
19471
  f 78/236/59 73/235/59 74/234/59 77/233/59
19472
- f 79/240/60 76/239/60 75/238/60 80/237/60`;var P3=`# Made in Blockbench 4.9.4
19472
+ f 79/240/60 76/239/60 75/238/60 80/237/60`;var L3=`# Made in Blockbench 4.9.4
19473
19473
  mtllib materials.mtl
19474
19474
 
19475
19475
  o head
@@ -20115,7 +20115,7 @@ f 107/320/80 108/319/80 106/318/80 105/317/80
20115
20115
  f 112/324/81 107/323/81 105/322/81 110/321/81
20116
20116
  f 111/328/82 112/327/82 110/326/82 109/325/82
20117
20117
  f 110/332/83 105/331/83 106/330/83 109/329/83
20118
- f 111/336/84 108/335/84 107/334/84 112/333/84`;var I3=`# Made in Blockbench 4.9.4
20118
+ f 111/336/84 108/335/84 107/334/84 112/333/84`;var O3=`# Made in Blockbench 4.9.4
20119
20119
  mtllib materials.mtl
20120
20120
 
20121
20121
  o head
@@ -20623,7 +20623,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
20623
20623
  f 88/252/63 83/251/63 81/250/63 86/249/63
20624
20624
  f 87/256/64 88/255/64 86/254/64 85/253/64
20625
20625
  f 86/260/65 81/259/65 82/258/65 85/257/65
20626
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var H3=`# Made in Blockbench 4.9.4
20626
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var D3=`# Made in Blockbench 4.9.4
20627
20627
  mtllib materials.mtl
20628
20628
 
20629
20629
  o Body
@@ -21085,7 +21085,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
21085
21085
  f 80/228/57 75/227/57 73/226/57 78/225/57
21086
21086
  f 79/232/58 80/231/58 78/230/58 77/229/58
21087
21087
  f 78/236/59 73/235/59 74/234/59 77/233/59
21088
- f 79/240/60 76/239/60 75/238/60 80/237/60`;var L3=`# Made in Blockbench 4.9.4
21088
+ f 79/240/60 76/239/60 75/238/60 80/237/60`;var F3=`# Made in Blockbench 4.9.4
21089
21089
  mtllib materials.mtl
21090
21090
 
21091
21091
  o bottom
@@ -21501,9 +21501,9 @@ f 67/200/50 68/199/50 66/198/50 65/197/50
21501
21501
  f 72/204/51 67/203/51 65/202/51 70/201/51
21502
21502
  f 71/208/52 72/207/52 70/206/52 69/205/52
21503
21503
  f 70/212/53 65/211/53 66/210/53 69/209/53
21504
- f 71/216/54 68/215/54 67/214/54 72/213/54`;var H1={allay:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAV1BMVEUAAAA4jNkuh9Ypg9FBnNpCm9r///+c/P+A/P9k+/9N8/hM6f9Q2f8+5eo94PdG0P821+4s1ewiz/8syf8ox/8bxPNNq+wQwf8os+hCnNpCm9oep9s0h8D7j8AOAAAABnRSTlMAoKCg3PODq/XXAAAA60lEQVR42tWP0W7DIAxFb9OtwdA6xQ3rzZL//84BD0nRljzsZdqxZCx8hLio3Lz4GwtYMWLDi4jnPM+vwogNKTTC43Elr6vgRMQ1wvM5ktsbvRPXN38wGxKHMmnI9M65vgxavwsg2WCpCvlSg6iqlCF4ceKbFEGZVC+5NFFXYUtxZzILl1xmiffoxUcA5DUHKULZp6iqsQzU6KN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OX616XBsFUt+vUwbmf6M5ZtI6rYHgwqpfrQ4BUhb6eanv0rpba5dS32G8GwdOT1+f5iYjjQG/PvmHTwE/o5/Q5EFWhVnUNnc9FxBCfChgUd91/et7gDGu9AjgyNHnm8833wIQvgDoe7+A6to9CnQQvgQYgDwCmLqmGwhjS1Bh4scAMiQPgCZnse2zdmqbiHkS2Qm2URG11iEict47T6gAbRObaNvYNjhpbIyxzIsw42War8a4U/M8Nod5vQdibNs4DC0MGzNgpzGlJEiTLfMQUIwYNo68I3WexO2BdgCgQ3awNVlJuzrcGpP5FVkhckCIRLGLuwVaTaopJLyBGuK9gPmptRbfNFMc1qozZfFCglQKoIgDOeagA7Ym3zEOXa7MN1gASBBRlQwZQ96JOBwF4MCeidg5puQ4YMELPNgO5UeXsWVEgAYVJlMALkIBKIAAwHnH0SI8FE2xybddYr5tmzZFJAwAeWYIorcACzE5KC4wBwDLYVgu24gwPeR57KlFHpN1XRsiZgehACKz2wUJ+xnOF7uu/1pcL77Kq6caZUD2/0ZFAk9zM9XrfYvrb1L1TPXvNbFnhwqQEPOKZbVKaZW0aWIpvy+bZVOypUYT7vFx9tGz9zOcFuDN/+gIHIEjcASOwBH44cB/1lQM4ZNhKecAAAAASUVORK5CYII="};A();E();R();x();import*as je from"three";var L1=class{constructor(e,t){this.object=e;this.animations=t;d(this,"timer",new je.Timer);d(this,"animatedObjects",new Set);d(this,"state")}createAnimationState(){let e=new je.AnimationMixer(this.object),t=new Map;for(let r of this.animations)t.set(r.name,e.clipAction(r));return this.state={mixer:e,animations:this.animations,actions:t,speed:1,loop:!0},this.object.traverse(r=>{if(r instanceof je.Mesh||r instanceof je.Line||r instanceof je.Points||r instanceof je.Sprite){let i=r.onBeforeRender;r.onBeforeRender=(s,o,l,a,v,c)=>{this.timer.update(performance.now());let u=this.timer.getDelta();e.update(u),i?.(s,o,l,a,v,c)}}}),this.animatedObjects.add(this.object),this.state}playAnimation(e,t,r){let i=this.state.actions.get(e);if(!i)return!1;this.state.mixer.stopAllAction();let s=t??this.state.loop;return i.setLoop(s?je.LoopRepeat:je.LoopOnce,1/0),i.clampWhenFinished=!s,r===void 0?i.timeScale=this.state.speed:i.timeScale=r,i.reset().fadeIn(.1).play(),!0}updateAnimationParams(e,t){e!==void 0&&(this.state.speed=e),t!==void 0&&(this.state.loop=t);for(let r of this.state.actions.values())e!==void 0&&(r.timeScale=e),t!==void 0&&(r.setLoop(t?je.LoopRepeat:je.LoopOnce,1/0),r.clampWhenFinished=!t)}stopAnimations(){this.state.mixer.stopAllAction()}getDelta(){return this.timer.update(performance.now()),this.timer.getDelta()}};function O3(n,e){let t=new L1(n,e);return t.createAnimationState(),t}A();E();R();x();import*as ze from"three";A();E();R();x();var D3=-Math.PI/2;function Pt(n){if(!n)return!1;let e=n.toLowerCase();return e==="boat"||e==="chest_boat"?!0:e.endsWith("_boat")||e.endsWith("_raft")}function F3(n){return Pt(n)?D3:null}var Lc=28/16,Oc=3/16,Dc=16/16,V3=-1.125,Fc=1.59375,zc=0;var Uc=0,Vc=1,D1="boat_water_patch",G3="boat_paddle_pivot_left",N3="boat_paddle_pivot_right",Gc=new ze.Vector3(3/16,28/16,9/16),Nc=new ze.Vector3(3/16,28/16,-9/16),Nk=new ze.Vector3(-6/16,1/16,0),Wc=new ze.Vector3(-3/16,29/16,9/16),jc=new ze.Vector3(-3/16,29/16,-9/16);var O1=new ze.Vector3;function Yc(n,e){O1.set(0,0,0);let t=n;for(;t&&t!==e;)O1.add(t.position),t=t.parent;return O1}function z3(n,e,t,r,i){if(i.length===0)return;let s=new ze.Object3D;s.name=e,s.position.copy(r),n.add(s);for(let o of i){let l=o.parent;if(!l)continue;let a=Yc(o,n);l.remove(o),o.position.copy(a).sub(t),s.add(o)}return s}function U3(n,e){let t=[];return n.traverse(r=>{r!==n&&r.name!==D1&&(r.name===G3||r.name===N3||r.name===e&&t.push(r))}),t}function Qc(n){if(n.userData.boatPaddleLeftPivot||n.userData.boatPaddleRightPivot)return{leftPivot:n.userData.boatPaddleLeftPivot,rightPivot:n.userData.boatPaddleRightPivot};let e=z3(n,G3,Gc,Wc,U3(n,"paddle_left")),t=z3(n,N3,Nc,jc,U3(n,"paddle_right"));return e&&(n.userData.boatPaddleLeftPivot=e),t&&(n.userData.boatPaddleRightPivot=t),{leftPivot:e,rightPivot:t}}function Kc(){return new ze.BoxGeometry(Lc,Oc,Dc)}function qc(){return new ze.MeshBasicMaterial({colorWrite:!1,depthWrite:!0,depthTest:!0})}function Jc(){let n=new ze.Mesh(Kc(),qc());return n.name=D1,n.position.set(0,Fc,zc),n.renderOrder=Vc,n}function Xc(n){n.traverse(e=>{if(!(e instanceof ze.Mesh)||e.name===D1)return;let t=Array.isArray(e.material)?e.material:[e.material];for(let r of t)r instanceof ze.Material&&(r.transparent=!1,r.depthWrite=!0,r.depthTest=!0,"alphaTest"in r&&(r.alphaTest=Math.max(r.alphaTest??0,.1)),r.needsUpdate=!0);e.renderOrder=Uc})}function W3(n){Xc(n),Qc(n);let e=n.userData.boatWaterPatch;return e||(e=Jc(),e.visible=!1,n.add(e),n.userData.boatWaterPatch=e),{waterPatch:e}}function j3(n){let e=n.userData.boatWaterPatch;e&&(e.geometry.dispose(),e.material instanceof ze.Material&&e.material.dispose(),delete n.userData.boatWaterPatch)}A();E();R();x();var Y3={horse:1.1,donkey:.87,mule:.92,skeleton_horse:1,zombie_horse:1};A();E();R();x();import*as vr from"three";var F1={x:0,y:1.25,z:-.75},Q3=vr.MathUtils.degToRad(20),t5=.05,Zc=new Set(["Head","UMouth","Ear1","Ear2","MuleEarL","MuleEarR","Neck","Mane","SaddleMouthL","SaddleMouthR","SaddleMouthLine","SaddleMouthLineR","HeadSaddle"]),Zt="_horseHeadRig",r5="_horseHeadAnimation";function K3(n){let e=n.userData[Zt];if(e)return e;let t=[];n.traverse(i=>{i!==n&&Zc.has(i.name)&&t.push(i)});let r=new vr.Group;r.name="horse_head_rig",r.position.set(F1.x,F1.y,F1.z),r.userData.horseHeadParts=t,n.add(r);for(let i of t)r.attach(i);return n.userData[Zt]=r,r}function $c(n,e){let t=Math.PI*2,r=((e-n+Math.PI)%t+t)%t-Math.PI;return r===-Math.PI?Math.PI:r}function q3(n){let{entityPitch:e,headYaw:t,bodyYaw:r,limbSwing:i,limbSwingAmount:s}=n,o=Number.isFinite(s)?Math.max(0,s):0,l=o>.2?Math.cos(i*.4)*.15*o:0,a=vr.MathUtils.clamp($c(r,t),-Q3,Q3);return{pitch:(Number.isFinite(e)?e:0)-l,yaw:a}}function J3(){return{prevLimbSwing:0,limbSwing:0,prevLimbSwingAmount:0,limbSwingAmount:0,elapsedSeconds:t5,tickAccumulatorSeconds:0}}function X3(n,e){n.pendingPosition={x:e.x,z:e.z}}function e9(n,e){n.prevLimbSwing=n.limbSwing,n.prevLimbSwingAmount=n.limbSwingAmount;let t=n.lastPosition==null?0:Math.hypot(e.x-n.lastPosition.x,e.z-n.lastPosition.z),r=Math.min(1,t*4);n.limbSwingAmount+=(r-n.limbSwingAmount)*.4,n.limbSwing+=n.limbSwingAmount,n.lastPosition={x:e.x,z:e.z}}function t9(n,e){let t=vr.MathUtils.clamp(e,0,1);return{limbSwing:n.prevLimbSwing+(n.limbSwing-n.prevLimbSwing)*t,limbSwingAmount:n.prevLimbSwingAmount+(n.limbSwingAmount-n.prevLimbSwingAmount)*t}}function Z3(n,e){let t=Math.max(0,e);for(n.elapsedSeconds=Math.min(t5,n.elapsedSeconds+t),n.tickAccumulatorSeconds+=t;n.tickAccumulatorSeconds>=t5;){let r=n.pendingPosition??n.lastPosition;r&&e9(n,r),n.pendingPosition=void 0,n.tickAccumulatorSeconds-=t5}return n.elapsedSeconds=n.tickAccumulatorSeconds,t9(n,n.elapsedSeconds/t5)}function $3(n,e){n.rotation.set(e.pitch,e.yaw,0)}function l9(n){return"parts"in n&&Array.isArray(n.parts)?n.parts:[n]}var v9={up:{dir:[0,1,0],u0:[0,0,1],v0:[0,0,0],u1:[1,0,1],v1:[0,0,1],corners:[[0,1,1,0,0],[1,1,1,1,0],[0,1,0,0,1],[1,1,0,1,1]]},down:{dir:[0,-1,0],u0:[1,0,1],v0:[0,0,0],u1:[2,0,1],v1:[0,0,1],corners:[[1,0,1,0,0],[0,0,1,1,0],[1,0,0,0,1],[0,0,0,1,1]]},east:{dir:[1,0,0],u0:[0,0,0],v0:[0,0,1],u1:[0,0,1],v1:[0,1,1],corners:[[1,1,1,0,0],[1,0,1,0,1],[1,1,0,1,0],[1,0,0,1,1]]},west:{dir:[-1,0,0],u0:[1,0,1],v0:[0,0,1],u1:[1,0,2],v1:[0,1,1],corners:[[0,1,0,0,0],[0,0,0,0,1],[0,1,1,1,0],[0,0,1,1,1]]},north:{dir:[0,0,-1],u0:[0,0,1],v0:[0,0,1],u1:[1,0,1],v1:[0,1,1],corners:[[1,0,0,0,1],[0,0,0,1,1],[1,1,0,0,0],[0,1,0,1,0]]},south:{dir:[0,0,1],u0:[1,0,2],v0:[0,0,1],u1:[2,0,2],v1:[0,1,1],corners:[[0,0,1,0,1],[1,0,1,1,1],[0,1,1,0,0],[1,1,1,1,0]]}};function e6(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function c9(n,e,t,r,i=!1,s=64,o=64,l=!1,a=[]){let v=new re.Euler(0,0,0);r.rotation&&(v.x=-r.rotation[0]*Math.PI/180,v.y=-r.rotation[1]*Math.PI/180,v.z=-r.rotation[2]*Math.PI/180);for(let{dir:c,corners:u,u0:h,v0:p,u1:m,v1:b}of Object.values(v9)){let k=Math.floor(n.positions.length/3),_=c[0]!==0,y=[];for(let M of u){let T,S;i?(T=(r.uv[0]+M[3]*r.size[0])/s,S=(r.uv[1]+M[4]*r.size[1])/o):(T=(r.uv[0]+e6(M[3]?m:h,r.size))/s,S=(r.uv[1]+e6(M[4]?b:p,r.size))/o);let B=_&&l?M[0]^1:M[0],P=M[1],H=_&&l?M[2]^1:M[2],V=r.inflate??0,z=new re.Vector3(r.origin[0]+B*r.size[0]+(B?V:-V),r.origin[1]+P*r.size[1]+(P?V:-V),r.origin[2]+H*r.size[2]+(H?V:-V));z=z.applyEuler(v),z=z.sub(t.position),z=z.applyEuler(t.rotation),z=z.add(t.position),n.positions.push(z.x,z.y,z.z),n.normals.push(c[0],c[1],c[2]),y.push(T,S),n.skinIndices.push(e,0,0,0),n.skinWeights.push(1,0,0,0)}if(l)for(let M=0;M+1<u.length;M+=2){let T=M*2,S=y.slice(T,T+4);y[T]=S[2],y[T+1]=S[_?1:3],y[T+2]=S[0],y[T+3]=S[_?3:1]}n.uvs.push(...y),n.indices.push(k,k+1,k+2,k+2,k+1,k+3)}}function $t(n,e,t,r={},i={}){let s=t.texturewidth??64,o=t.textureheight??64,l,a=e.startsWith("block:"),v=n?.material.map;if(a){if(!n)throw new Error("worldRenderer is required for block textures");let y=e.slice(6),M=n.resourcesManager.currentResources.blocksAtlasJson.textures[y];M&&(s=v?.image.width??s,o=v?.image.height??o,l=[M.u,M.v])}let c={},u={positions:[],normals:[],uvs:[],indices:[],skinIndices:[],skinWeights:[]},h=0;for(let y of t.bones){let M=new re.Bone;if(y.pivot&&(M.position.x=y.pivot[0],M.position.y=y.pivot[1],M.position.z=y.pivot[2]),y.bind_pose_rotation?(M.rotation.x=-y.bind_pose_rotation[0]*Math.PI/180,M.rotation.y=-y.bind_pose_rotation[1]*Math.PI/180,M.rotation.z=-y.bind_pose_rotation[2]*Math.PI/180):y.rotation&&(M.rotation.x=-y.rotation[0]*Math.PI/180,M.rotation.y=-y.rotation[1]*Math.PI/180,M.rotation.z=-y.rotation[2]*Math.PI/180),r.rotation?.[y.name]&&(M.rotation.x-=(r.rotation[y.name].x??0)*Math.PI/180,M.rotation.y-=(r.rotation[y.name].y??0)*Math.PI/180,M.rotation.z-=(r.rotation[y.name].z??0)*Math.PI/180),M.name=`bone_${y.name}`,c[y.name]=M,y.cubes)for(let T of y.cubes){let S=[];c9(u,h,M,T,a,s,o,y.mirror,S),S.length&&(i.errors??(i.errors=[]),i.errors.push(...S.map(B=>`Bone ${y.name}: ${B}`)))}h++}let p=[];for(let y of t.bones)y.parent&&c[y.parent]?c[y.parent].add(c[y.name]):p.push(c[y.name]);let m=new re.Skeleton(Object.values(c)),b=new re.BufferGeometry;b.setAttribute("position",new re.Float32BufferAttribute(u.positions,3)),b.setAttribute("normal",new re.Float32BufferAttribute(u.normals,3)),b.setAttribute("uv",new re.Float32BufferAttribute(u.uvs,2)),b.setAttribute("skinIndex",new re.Uint16BufferAttribute(u.skinIndices,4)),b.setAttribute("skinWeight",new re.Float32BufferAttribute(u.skinWeights,4)),b.setIndex(u.indices);let k=new re.MeshLambertMaterial({transparent:!0,alphaTest:.1,side:re.DoubleSide}),_=new re.SkinnedMesh(b,k);if(_.add(...p),_.bind(m),_.scale.set(1/16,1/16,1/16),l){let y=v.clone();y.offset.set(l[0],l[1]),y.needsUpdate=!0,k.map=y}else z5(e,y=>{k.map||(y.magFilter=re.NearestFilter,y.minFilter=re.NearestFilter,y.flipY=!1,y.wrapS=re.RepeatWrapping,y.wrapT=re.RepeatWrapping,k.map=y)},()=>{let y=k.map;if(!y)return;let M=y.image.width;M&&s!==M&&(y.repeat.x=s/M);let T=y.image.height;T&&o!==T&&(y.repeat.y=o/T),k.needsUpdate=!0});return _}var d9=[{pattern:"furnace_minecart",target:"minecart"},{pattern:"spawner_minecart",target:"minecart"},{pattern:"chest_minecart",target:"minecart"},{pattern:"hopper_minecart",target:"minecart"},{pattern:"command_block_minecart",target:"minecart"},{pattern:"tnt_minecart",target:"minecart"},{pattern:"glow_item_frame",target:"item_frame"},{pattern:"glow_squid",target:"squid"},{pattern:"trader_llama",target:"llama"},{pattern:"chest_boat",target:"boat"},{pattern:"spectral_arrow",target:"arrow"},{pattern:"husk",target:"zombie"},{pattern:"zombie_horse",target:"horse"},{pattern:"donkey",target:"horse"},{pattern:"skeleton_horse",target:"horse"},{pattern:"mule",target:"horse"},{pattern:"ocelot",target:"cat"},{pattern:/_minecraft$/,target:"minecraft"},{pattern:/_boat$/,target:"boat"},{pattern:/_raft$/,target:"boat"},{pattern:/_horse$/,target:"horse"},{pattern:/_zombie$/,target:"zombie"},{pattern:/_arrow$/,target:"zombie"}];function t6(n){for(let e of d9)if(typeof e.pattern=="string"){if(e.pattern===n)return e.target}else if(e.pattern.test(n))return e.target}var r6=n=>Z2[n],n6={...Y3,zombie:1.85,husk:1.85,arrow:.0025},i6={zombie:new hn(0,1,0),husk:new hn(0,1,0),boat:new hn(0,V3,0),arrow:new hn(0,-.9,0)},Gt=class{constructor(e,t,r,i={},s={}){d(this,"mesh");d(this,"animations");d(this,"animationControllers",[]);let o=t,l=t6(t);if(l&&(t=l,s.tempMap=l),i.customModel){let v=l9(i.customModel);this.mesh=new re.Object3D;for(let c=0;c<v.length;c++){let{modelPath:u,modelType:h,metadata:p}=v[c],m=new re.Object3D;switch(m.name=`custom_part_${c}`,h){case"gltf":{new r9().parseAsync(u,"").then(k=>{if(m.add(k.scene),p?.scale){let _=p.scale;m.scale.set(_,_,_)}if(p?.offset){let{x:_=0,y=0,z:M=0}=p.offset;m.position.set(_,y,M)}if(p?.texture){let _=Z0(p.texture);m.traverse(y=>{y instanceof re.Mesh&&(y.material=new re.MeshBasicMaterial({map:_,transparent:!0,alphaTest:.1}))})}if(k.animations?.length){this.animations=[...this.animations??[],...k.animations];let _=O3(m,k.animations);this.animationControllers.push(_);let y=p?.animation,M=p?.animationLoop??!0;y?_.playAnimation(y,M):_.playAnimation(k.animations[0].name,M)}}).catch(k=>{});break}case"obj":{let k=new ar().parse(u);if(p?.scale){let{scale:_}=p;k.scale.set(_,_,_)}if(p?.offset){let{x:_=0,y=0,z:M=0}=p.offset;k.position.set(_,y,M)}if(p?.texture){let _=Z0(p.texture),y=new re.MeshBasicMaterial({map:_,transparent:!0,alphaTest:.1});k.traverse(M=>{M instanceof re.Mesh&&(M.material=y)})}m.add(k);break}case"bedrock":{let b=JSON.parse(u);if(p?.scale&&m.scale.set(p.scale,p.scale,p.scale),p?.offset){let{x:k=0,y:_=0,z:y=0}=p.offset;m.position.set(k,_,y)}for(let[k,_]of Object.entries(b.geometry)){let y=p?.textures?.[k]??b.textures?.[k];if(!y)continue;let M=$t(r,y.endsWith(".png")||y.startsWith("data:image/")||y.startsWith("block:")?y:y+".png",_,i,s);M.name=`geometry_${k}`,m.add(M)}break}}this.mesh.add(m)}s.type=v.length===1?v[0].modelType:"special";return}if(lr[t]){let v=new ar,c={zombie_horse:`textures/${e}/entity/horse/horse_zombie.png`,husk:n9,skeleton_horse:`textures/${e}/entity/horse/horse_skeleton.png`,donkey:`textures/${e}/entity/horse/donkey.png`,mule:`textures/${e}/entity/horse/mule.png`,ocelot:i9,arrow:s9,spectral_arrow:o9,tipped_arrow:a9},u=c[o]||c[t];u&&(s.textureMap=!0);let h=u||H1[t];if(H1[t]&&(s.isHardcodedTexture=!0),!h)throw new Error(`No texture for ${t}`);let p=Z0(h),m=new re.MeshBasicMaterial({map:p,transparent:!0,alphaTest:.1}),b=v.parse(lr[t]),k=n6[o]||n6[t];k&&b.scale.set(k,k,k);let _=i6[o]??i6[t];_&&b.position.set(_.x,_.y,_.z),b.traverse(y=>{y instanceof re.Mesh&&(y.material=m,y.name==="Head layer"&&(y.visible=!1),t!=="horse"&&y.name==="Head"&&i.rotation?.head&&(y.rotation.x-=(i.rotation.head.x??0)*Math.PI/180,y.rotation.y-=(i.rotation.head.y??0)*Math.PI/180,y.rotation.z-=(i.rotation.head.z??0)*Math.PI/180))}),t==="horse"&&K3(b),this.mesh=b,s.type="obj";return}let a=r6(t);if(a){this.mesh=new re.Object3D;for(let[v,c]of Object.entries(a.geometry)){let u=i.textures?.[v]??a.textures[v];if(!u)continue;let h=$t(r,u.endsWith(".png")||u.startsWith("data:image/")||u.startsWith("block:")?u:u+".png",c,i,s);h.name=`geometry_${v}`,this.mesh.add(h)}s.type="bedrock"}}playAnimation(e,t=!1){if(!this.animationControllers.length)return;let r=!1;for(let i of this.animationControllers)i.playAnimation(e,t)&&(r=!0)}update(e){}static getStaticData(e){if(e=t6(e)||e,lr[e])return{boneNames:[]};let t=r6(e);if(!t)throw new Error(`Unknown entity ${e}`);return{boneNames:Object.values(t.geometry).flatMap(r=>r.name)}}};globalThis.EntityMesh=Gt;A();E();R();x();var s6=105*Math.PI/180;function o6(n,e){let t=e-n;for(;t>Math.PI;)t-=Math.PI*2;for(;t<-Math.PI;)t+=Math.PI*2;return t}function h9(n){return o6(0,n)}function f9(n){return Math.max(-s6,Math.min(s6,n))}function fn(n){let{cameraYaw:e,cameraPitch:t,vehicleYaw:r}=n,i=o6(r,e),s=f9(i),o=h9(r+s);return{bodyYaw:r,headYaw:s,headPitch:-t,effectiveCameraYaw:o}}function z1(n){return n.isAnchoredPassenger&&Pt(n.vehicleName)&&typeof n.vehicleYaw=="number"&&Number.isFinite(n.vehicleYaw)}function a6(n){return n.isThirdPerson&&z1(n)}A();E();R();x();import*as cr from"three";var m9=Math.PI/8,p9=20,g9=m9*p9;function h6(){return{current:new cr.Quaternion,rest:new cr.Quaternion,delta:new cr.Quaternion,euler:new cr.Euler(0,0,0,"ZYX")}}function f6(){return{leftActive:!1,rightActive:!1,leftPhase:0,rightPhase:0}}function l6(n,e,t){return n+(e-n)*t}function v6(n,e,t){if(!e)return 0;let r=Number.isFinite(t)&&t>=0?t:0,i=Math.PI*2;return(n+r*g9)%i}function c6(n,e){let t=l6(-Math.PI/3,-Math.PI/12,(Math.sin(-n)+1)/2),r=l6(-Math.PI/4,Math.PI/4,(Math.sin(-n+1)+1)/2);e===1&&(r=Math.PI-r);let i=Math.PI/16;return{xRot:t,yRot:r,zRot:i}}function d6(n,e,t){return t.set(-n.xRot,n.yRot,-n.zRot,"ZYX"),e.setFromEuler(t)}function b9(n,e,t){return n===0?t.delta.identity():(d6(c6(n,e),t.current,t.euler),d6(c6(0,e),t.rest,t.euler),t.delta.copy(t.current).multiply(t.rest.invert()))}function u6(n,e,t,r){n.quaternion.copy(b9(e,t,r))}function m6(n,e,t){n.leftActive!==e&&(n.leftActive=e,n.leftPhase=0),n.rightActive!==t&&(n.rightActive=t,n.rightPhase=0)}function p6(n,e,t,r,i){n.leftPhase=v6(n.leftPhase,n.leftActive,e),n.rightPhase=v6(n.rightPhase,n.rightActive,e),t&&u6(t,n.leftPhase,0,i),r&&u6(r,n.rightPhase,1,i)}A();E();R();x();function g6(n){return n==="horse"}function mn(n){return n!=null&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z)}function b6(n,e,t){var r;mn(e)&&(n.userData._posTween?.stop(),n.userData._posTween=void 0,(r=n.userData)._tweenTarget??(r._tweenTarget={...e}),Object.assign(n.userData._tweenTarget,e),n.position.set(e.x,e.y,e.z),n.userData._passengerVehicleId=t,delete n.userData._boatPassengerVehicleId)}function pn(n,e,t){var i;return(n.userData._passengerVehicleId??n.userData._boatPassengerVehicleId)!==e?!1:(n.userData._posTween?.stop(),n.userData._posTween=void 0,t&&((i=n.userData)._tweenTarget??(i._tweenTarget={...t}),Object.assign(n.userData._tweenTarget,t)),delete n.userData._passengerVehicleId,delete n.userData._boatPassengerVehicleId,!0)}A();E();R();x();A();E();R();x();var y9=50,U1=120,_9=150,w9=1e-4;function V1(n){return!!n?.renderHints?.localVehicle}function y6(n){return n?.localVehicleYawLock==="horse"}function _6(n,e){return Number.isFinite(e)?(n.rotation.y=e,n.userData._horseBodyYaw=e,n.userData._horseHeadYaw=e,!0):!1}function G1(n,e){return e||V1(n)?0:U1}function w6(n,e){return G1(n,e)}function A9(n,e,t=w9){return Math.abs(n.x-e.x)<t&&Math.abs(n.y-e.y)<t&&Math.abs(n.z-e.z)<t}function A6(n,e=!1){if(e)return 0;switch(n){case"spectating":return _9;case"server-vehicle":return U1;case"local-player":default:return y9}}function E6(n){return n.instant||n.currentTarget==null||n.movementMode!==n.previousMovementMode?!0:!A9(n.target,n.currentTarget)}function E9(n,e){return{x:n.x,y:e,z:n.z}}function x6(n){let{cameraWorldPos:e,rawVehicleY:t,eyeHeight:r,vehicleName:i,vehicleHeight:s,verticalCameraLock:o}=n;if(o==="horse"){let l=e.y-r-M6(i,s);if(Number.isFinite(l))return{x:e.x,y:l,z:e.z}}return E9(e,t)}var x9=new Set(["minecart","chest_minecart","furnace_minecart","hopper_minecart","tnt_minecart","spawner_minecart","command_block_minecart"]),R9=new Set(["horse","donkey","mule","skeleton_horse","zombie_horse"]);function R6(n){return n?R9.has(n):!1}function gn(n){return n?x9.has(n):!1}function k9(n,e){return e<=1?0:n===0?.2:-.6}var S9=.5625,T9=.7,M9=-.35,C9=-.1,B9=0,P9=-.6,I9=.1875,H9=1/3,L9=.8888889;function k6(n,e,t,r){let i=Number.isFinite(r)?r:n==="boat"?S9:T9;if(zi(e)>=zi("1.20.2")){let o=typeof t=="string"&&t.toLowerCase().endsWith("_raft");return(n==="boat"?i*(o?L9:H9):I9)+P9}return(n==="boat"?C9:B9)+M9}function S6(n,e,t,r,i,s,o){let l=k9(t,r);return{x:n.x-Math.sin(e)*l,y:n.y+k6("boat",i,s,o),z:n.z+Math.cos(e)*l}}function T6(n,e,t,r){return{x:n.x,y:n.y+k6("minecart",e,t,r),z:n.z}}function M6(n,e){let t=0;return n==="donkey"||n==="mule"?t=.25:n==="skeleton_horse"&&(t=.1875),e*.75-t-.35}function C6(n,e,t=1.6){return{x:n.x,y:n.y+M6(e,t),z:n.z}}function B6(n){let e=new Set;for(let t of Object.values(n.entities)){let r=t,i=r.userData.renderHints,s=i?.passengerIds??i?.boatPassengerIds;if(!Array.isArray(s)||s.length===0)continue;let o=r.realName??r.originalEntity.name,l=i?.passengerLayout??(Pt(o)?"boat":void 0);if(l!=="boat"&&l!=="minecart"&&l!=="horse"||l==="boat"&&!Pt(o)||l==="minecart"&&!gn(o)||l==="horse"&&!R6(o))continue;let a=n.getWorldPosition(r);if(!mn(a))continue;let v=String(r.originalEntity.id);for(let[c,u]of s.entries()){let p=u===n.localPlayer?.originalEntity.id?n.localPlayer:n.entities[u];if(!p?.playerObject||p===n.localPlayer&&g6(l))continue;let m=l==="minecart"?T6(a,n.version,o,r.originalEntity.height):l==="horse"?C6(a,o,r.originalEntity.height??1.6):S6(a,r.rotation.y,c,s.length,n.version,o,r.originalEntity.height);mn(m)&&(b6(p,m,v),e.add(p))}}for(let t of[...Object.values(n.entities),...n.localPlayer?[n.localPlayer]:[]]){let r=t.userData._passengerVehicleId??t.userData._boatPassengerVehicleId;r===void 0||e.has(t)||pn(t,r,n.getWorldPosition(t))}return e}A();E();R();x();function P6(n,e){typeof e=="number"&&Number.isFinite(e)&&(n._networkHeadPitch=e)}function N1(n,e,t){if(typeof e=="number"&&Number.isFinite(e)){n._networkHeadYaw=e;return}typeof t=="number"&&Number.isFinite(t)&&(n._networkHeadYaw=t)}function I6(n){let e=n._networkHeadPitch;return typeof e=="number"&&Number.isFinite(e)?e:0}function bn(n,e){let t=e._networkHeadPitch;typeof t!="number"||!Number.isFinite(t)||(n.skin.head.rotation.y=0,n.skin.head.rotation.x=-t)}function H6(n,e){n.skin.head.rotation.y=0,bn(n,e)}A();E();R();x();function L6(n){return n._passengerVehicleId??n._boatPassengerVehicleId}function O6(n){n._rotTween?.stop(),n._rotTween=void 0}function O9(n){let{passenger:e,networkHeadYaw:t,vehicleYaw:r}=n,i=e.playerObject;if(!i)return;O6(e.userData);let s=fn({cameraYaw:t,cameraPitch:I6(e.userData),vehicleYaw:r});e.rotation.set(0,s.bodyYaw,0),i.skin.head.rotation.set(s.headPitch,s.headYaw,0),e.userData._remoteBoatRotationApplied=!0}function D9(n){let e=n.playerObject;if(!e)return;O6(n.userData);let t=n.userData._networkHeadYaw;typeof t=="number"&&Number.isFinite(t)&&n.rotation.set(0,t,0),H6(e,n.userData),n.userData._remoteBoatRotationApplied=!1}function F9(n){let{passenger:e,vehicle:t,syncArmor:r}=n;if(!e.playerObject)return;let i=e.userData,s=i._remoteBoatRotationApplied===!0,o=L6(i),l=t?.realName??t?.originalEntity.name,a=t?.rotation.y;if(!z1({isAnchoredPassenger:o!=null&&t!=null,vehicleName:l,vehicleYaw:a})){s&&(D9(e),r?.());return}let c=i._networkHeadYaw;typeof c!="number"||!Number.isFinite(c)||(O9({passenger:e,vehicle:t,vehicleYaw:a,networkHeadYaw:c}),r?.())}function D6(n){for(let e of Object.values(n.entities)){if(!e?.playerObject)continue;let t=L6(e.userData),r=t!=null?n.entities[t]:void 0;F9({passenger:e,vehicle:r,syncArmor:e.visible?()=>n.syncArmor(e):void 0})}}A();E();R();x();import{default as U9}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_1.png";import{default as V9}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_2.png";import{default as G9}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_1.png";import{default as N9}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_2.png";import{default as W9}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_1.png";import{default as j9}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_2.png";import{default as Y9}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_1.png";import{default as Q9}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_2.png";import{default as K9}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1.png";import{default as q9}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1_overlay.png";import{default as J9}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2.png";import{default as X9}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2_overlay.png";import{default as Z9}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_1.png";import{default as $9}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_2.png";import{default as ed}from"mc-assets/dist/other-textures/latest/models/armor/turtle_layer_1.png";import{default as z6}from"mc-assets/dist/other-textures/latest/entity/elytra.png";var e0={skull:{bones:[{name:"head",pivot:[0,12,0],cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,0],inflate:1}]},{name:"overlay",parent:"head",pivot:[0,12,0],cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[32,0],inflate:1.2}]}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},head:{bones:[{name:"armor",pivot:[0,12,0]},{name:"head",parent:"armor",pivot:[0,12,0],cubes:[{origin:[-4,23,-4],size:[8,8,8],uv:[0,0],inflate:1}]},{name:"overlay",parent:"head",pivot:[0,12,0],cubes:[{origin:[-4,23,-4],size:[8,8,8],uv:[32,0],inflate:1.2}]}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},chest:{bones:[{name:"armor",pivot:[0,12,0]},{name:"body",parent:"armor",pivot:[0,13,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16],inflate:1}]},{name:"leftarm",parent:"armor",pivot:[5,10,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16],inflate:.85}]},{name:"rightarm",parent:"armor",pivot:[-5,10,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16],inflate:.85}],mirror:!0}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},legs:{bones:[{name:"armor",pivot:[0,12,0]},{name:"body",parent:"armor",pivot:[0,13,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16],inflate:.5}]},{name:"leftleg",parent:"armor",pivot:[1.9,1,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16],inflate:.5}]},{name:"rightleg",parent:"armor",pivot:[-1.9,1,0],cubes:[{origin:[-3.9,0,-2.01],size:[4,12,4],uv:[0,16],inflate:.5}],mirror:!0}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},feet:{bones:[{name:"armor",pivot:[0,12,0]},{name:"leftleg",parent:"armor",pivot:[1.9,1,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16],inflate:.8}]},{name:"rightleg",parent:"armor",pivot:[-1.9,1,0],cubes:[{origin:[-3.9,.01,-2.01],size:[4,12,4],uv:[0,16],inflate:.8}],mirror:!0}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32}};var F6={leather_layer_1:K9,leather_layer_1_overlay:q9,leather_layer_2:J9,leather_layer_2_overlay:X9,chainmail_layer_1:U9,chainmail_layer_2:V9,iron_layer_1:Y9,iron_layer_2:Q9,diamond_layer_1:G9,diamond_layer_2:N9,golden_layer_1:W9,golden_layer_2:j9,netherite_layer_1:Z9,netherite_layer_2:$9,turtle_layer_1:ed};var Y6=X0(lt);var W1=n=>n*(Math.PI/180);function td(n){return n<0&&(n=4294967295+n+1>>>0),n.toString(16)}function rd(n){if(n===void 0)return;if(parseInt(n,10)===0)return"rgba(0, 0, 0, 0)";let e=td(parseInt(n,10));return e.length===8?`#${e.slice(2,8)}${e.slice(0,2)}`:`#${e}`}function U6(n,e){return n===void 0?e:n instanceof j.Quaternion?n:Array.isArray(n)?new j.Quaternion(n[0],n[1],n[2],n[3]):new j.Quaternion(n.x,n.y,n.z,n.w)}function It(n,e){return n===void 0?e??new j.Euler:n instanceof j.Euler?n:n.yaw!==void 0&&n.pitch!==void 0&&n.roll!==void 0?new j.Euler(-W1(n.pitch),-W1(n.yaw),W1(n.roll),"ZYX"):n.x!==void 0&&n.y!==void 0&&n.z!==void 0?new j.Euler(n.z,n.y,n.x,"ZYX"):Array.isArray(n)?new j.Euler(n[0],n[1],n[2]):e??new j.Euler}var yn=Math.PI*2;function nd(n,e){let t=((e-n)%yn+yn)%yn;return t>Math.PI?t-yn:t}function id(n,e,t,r,i){let s=e==="speaking"?"#3ddc47":e==="muted"?"#ff5555":"#cfcfcf";n.save(),n.translate(t,r),n.fillStyle=s,n.strokeStyle=s,n.lineWidth=Math.max(1.5,i*.09),n.lineCap="round";let o=i*.22,l=i*.34,a=i*.24,v=-i*.44;n.beginPath(),n.moveTo(v,-l/2),n.lineTo(v+o,-l/2),n.lineTo(v+o+a,-i*.5),n.lineTo(v+o+a,i*.5),n.lineTo(v+o,l/2),n.lineTo(v,l/2),n.closePath(),n.fill();let c=v+o+a;e==="speaking"&&(n.beginPath(),n.arc(c+i*.06,0,i*.16,-Math.PI*.32,Math.PI*.32),n.stroke(),n.beginPath(),n.arc(c+i*.06,0,i*.28,-Math.PI*.28,Math.PI*.28),n.stroke()),e==="muted"&&(n.beginPath(),n.moveTo(-i*.46,-i*.46),n.lineTo(i*.46,i*.46),n.stroke()),n.restore()}function Q6({username:n,nameTagBackgroundColor:e="rgba(0, 0, 0, 0.3)",nameTagTextOpacity:t=255,voiceState:r},{fontFamily:i="mojangles"},s){let o=Ne(64,64),l=j6(s),a=o.getContext("2d");if(!a)throw new Error("Could not get 2d context");let v=48,c=5;a.font=`${v}px ${i}`;let u=String(typeof n=="string"?n:new l(n).toString()).split(`
21505
- `),h=0;for(let S of u){let B=a.measureText(S).width+c*2;B>h&&(h=B)}let p=(v+c)*u.length,m=Ne(h,p),b=m.getContext("2d");if(!b)throw new Error("Could not get 2d context");if(b.globalAlpha=t/255,!S1(n,l,m,v,"white",-c+v))return;b.globalAlpha=1;let _=v*.85,y=r?_+c*2.5:0,M=Ne(y*2+h,p),T=M.getContext("2d");if(!T)throw new Error("Could not get 2d context");return T.fillStyle=e,T.fillRect(0,0,y+h,M.height),r&&id(T,r,y/2,M.height/2,_),T.drawImage(m,y,0),M}globalThis.getUsernameTexture=Q6;var s5=(n,e,t,r)=>{for(let a of t.children)a.name==="nametag"&&a.removeFromParent();if(n.username===void 0||n.username===null||(typeof n.username=="string"?n.username:new(j6(r))(n.username).toString()).startsWith("EMPTY"))return;let s=Q6(n,e,r);if(!s)return;let o=new j.Texture(s);o.needsUpdate=!0;let l;if(n.nameTagFixed){let a=new j.PlaneGeometry,v=new j.MeshBasicMaterial({map:o});v.transparent=!0,l=new j.Mesh(a,v),l.rotation.set(n.pitch,j.MathUtils.degToRad(n.yaw+180),0),l.position.y+=n.height+.3}else{let a=new j.SpriteMaterial({map:o});l=new j.Sprite(a),l.position.y+=n.height+.6}return l.renderOrder=1e3,l.scale.set(s.width*.005,s.height*.005,1),n.nameTagRotationRight&&l.applyQuaternion(n.nameTagRotationRight),n.nameTagScale&&l.scale.multiply(n.nameTagScale),n.nameTagRotationLeft&&l.applyQuaternion(n.nameTagRotationLeft),n.nameTagTranslation&&l.position.add(n.nameTagTranslation),l.name="nametag",t.add(l),l};function V6(n,e){n&&(n.position.y=e.position.y+e.scale.y*16+3,n.scale.multiplyScalar(12))}var G6={},sd=n=>n.charAt(0)===n.charAt(0).toUpperCase();function N6(n){if(n!=null){if(Array.isArray(n))return n;if(typeof n=="object"){let e=n,t=Object.keys(e).filter(r=>/^\d+$/.test(r)).map(Number).sort((r,i)=>r-i);if(t.length&&t[0]===0&&t.every((r,i)=>r===i))return t.map(r=>e[String(r)])}}}function od(n,e,t,r,i){if(e.name)try{let v=(sd(e.name)?R1(e.name):e.name).toLowerCase(),c=new Gt("1.16.4",v,t,i);if(c.mesh)return s5(e,r,c.mesh,t.version),c.mesh}catch(v){reportError?.(v)}if(!n||!(0,W6.isEntityAttackable)(n,e))return;let s=new j.BoxGeometry(e.width,e.height,e.width);s.translate(0,e.height/2,0);let o=new j.MeshBasicMaterial({color:16711935}),l=new j.Mesh(s,o);return(G6[e.name]=(G6[e.name]||0)+1)<6&&s5({username:e.name,height:e.height},r,l,t.version),l}var wn=class{constructor(e,t){this.worldRenderer=e;this.mcData=t;d(this,"entities",{});d(this,"playerEntity",null);d(this,"entitiesOptions",{fontFamily:"mojangles"});d(this,"debugMode");d(this,"onSkinUpdate");d(this,"clock",new j.Timer);d(this,"currentlyRendering",!0);d(this,"cachedMapsImages",{});d(this,"itemFrameMaps",{});d(this,"pendingModelOverrides",new Map);d(this,"boatPaddleScratch",h6());d(this,"playerVoiceStates",{});d(this,"uuidPerSkinUrlsCache",{});d(this,"currentSkinUrls",{});d(this,"loadedSkinEntityIds",new Set);this.debugMode="none",this.onSkinUpdate=()=>{},this.watchResourcesUpdates()}get entitiesByName(){let e={};for(let t of Object.values(this.entities))t.realName&&(e[t.realName]=e[t.realName]||[],e[t.realName].push(t));return e}get entitiesRenderingCount(){return Object.values(this.entities).filter(e=>e.visible).length}getDebugString(){let e=Object.keys(this.entities).length,t=this.entitiesRenderingCount,r=Object.values(this.entities).filter(s=>s.playerObject),i=r.filter(s=>s.visible);return`${t}/${e} ${i.length}/${r.length}`}handlePlayerEntity(e){if(this.isRenderingAllowed()){if(!this.playerEntity){let t=new j.Group;t.originalEntity={...e,name:"player"};let r=new j.Group,i=this.setupPlayerObject(e,r,{});t.playerObject=i,t.add(r),t.name="player_entity",this.playerEntity=t,this.syncSceneAttachment(t),this.updatePlayerSkin(e.id,e.username,e.uuid??void 0,lt)}this.playerEntity.originalEntity={...e,name:"player"},e.position&&(this.worldRenderer.sceneOrigin.getWorldPosition(this.playerEntity)||this.worldRenderer.sceneOrigin.track(this.playerEntity),this.playerEntity.position.set(e.position.x,e.position.y,e.position.z)),e.yaw!==void 0&&(this.playerEntity.rotation.y=e.yaw),this.updateEntityEquipment(this.playerEntity,e)}}clear(){for(let e of Object.values(this.entities))this.worldRenderer.sceneOrigin.removeAndUntrack(e),Me(e);this.entities={},this.currentSkinUrls={},this.playerVoiceStates={},this.playerEntity&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.playerEntity),Me(this.playerEntity),this.playerEntity=null)}reloadEntities(){for(let e of Object.values(this.entities))this.update({...e.originalEntity,delete:!0},{}),this.update(e.originalEntity,{})}watchResourcesUpdates(){this.worldRenderer.resourcesManager.on("assetsTexturesUpdated",()=>this.reloadEntities()),this.worldRenderer.resourcesManager.on("assetsInventoryReady",()=>this.reloadEntities())}setDebugMode(e,t=null){this.debugMode=e;for(let r of t?[t]:Object.values(this.entities)){let i=r.children.find(s=>s.name==="debug");i.visible=!1,this.debugMode==="basic"&&(i.visible=!0)}}setRendering(e,t=null){this.currentlyRendering=e&&this.isRenderingAllowed(),this.setSceneAttached(this.currentlyRendering,t)}isRenderingAllowed(){return this.worldRenderer.worldRendererConfig.renderEntities!==!1&&!this.worldRenderer.reactiveDebugParams.disableEntities}syncSceneAttachment(e=null){let t=this.isRenderingAllowed();this.currentlyRendering=t,this.setSceneAttached(t,e)}setSceneAttached(e,t=null){let r=t?[t]:[...Object.values(this.entities),...this.playerEntity?[this.playerEntity]:[]];for(let i of r)e?this.worldRenderer.scene.children.includes(i)||this.worldRenderer.scene.add(i):this.worldRenderer.scene.remove(i)}playEntityModelAnimation(e,t,r=!1){let i=this.entities[e];i&&i.traverse(s=>{s instanceof Gt&&s.playAnimation(t,r)})}render(){if(this.syncSceneAttachment(),!this.isRenderingAllowed())return;this.clock.update(performance.now());let e=Math.min(this.clock.getDelta(),1/30),t=this.worldRenderer.viewerChunkPosition,r=10*10;for(let[i,s]of[...Object.entries(this.entities),["player_entity",this.playerEntity]]){if(!s)continue;let o=i==="player_entity";if(o){let c=this.worldRenderer.playerStateUtils.isThirdPerson();s.visible=c;let u=s.userData._passengerVehicleId!=null||s.userData._boatPassengerVehicleId!=null;if(c&&!u){let h=this.worldRenderer.playerStateReactive.eyeHeight;s.position.set(this.worldRenderer.cameraWorldPos.x,this.worldRenderer.cameraWorldPos.y-h,this.worldRenderer.cameraWorldPos.z)}}let{playerObject:l}=s;if(l?.animation&&l.animation.update(l,e),!o){let c=s.userData.renderHints;y6(c)&&_6(s,this.worldRenderer.cameraShake.getBaseRotation().yaw)}let a=s.userData[Zt],v=s.userData[r5];if(a&&v){let c=Z3(v,e),u=q3({entityPitch:s.userData._horseHeadPitch??0,headYaw:s.userData._horseHeadYaw??s.userData._horseBodyYaw??0,bodyYaw:s.userData._horseBodyYaw??0,limbSwing:c.limbSwing,limbSwingAmount:c.limbSwingAmount});$3(a,u)}if(!o&&l&&bn(l,s.userData),s.traverse(c=>{c instanceof Gt&&c.update(e)}),!o&&t&&s.position){let c=s.position.x-t.x,u=s.position.y-t.y,h=s.position.z-t.z,p=c*c+u*u+h*h,m=this.worldRenderer.entitySectionKey(s.position.x,s.position.y,s.position.z),b=this.worldRenderer.isSectionOcclusionVisible(m);s.visible=!!((p<r||this.worldRenderer.shouldObjectVisible(s))&&b),this.maybeRenderPlayerSkin(i)}if(s.userData.renderHints?.localVehicle){let c=this.resolveLocalVehicleRenderWorldPos(s);s.position.set(c.x,c.y,c.z)}s.visible&&!o&&this.syncArmorPositions(s)}this.updateVehiclePassengerPositions(),this.applyRemoteBoatPassengerRotations(),this.applyLocalThirdPersonPlayerRotation(),this.updateBoatPaddleAnimations(e)}applyRemoteBoatPassengerRotations(){D6({entities:this.entities,syncArmor:e=>this.syncArmorPositions(e)})}updateBoatPaddleAnimations(e){for(let t of Object.values(this.entities)){if(!t||!Pt(t.realName))continue;let r=t.children.find(s=>s.name==="mesh");if(!r)continue;let i=r.userData.boatPaddleAnimation;i&&p6(i,e,r.userData.boatPaddleLeftPivot,r.userData.boatPaddleRightPivot,this.boatPaddleScratch)}}applyLocalThirdPersonPlayerRotation(){let e=this.playerEntity;if(!e?.visible||!e.playerObject)return;let t=this.worldRenderer.cameraShake.getBaseRotation(),r=e.userData._passengerVehicleId!=null||e.userData._boatPassengerVehicleId!=null,i=e.userData._passengerVehicleId??e.userData._boatPassengerVehicleId,s=i!=null?this.entities[i]:void 0,o=s?.realName??s?.originalEntity.name,l=s?.rotation.y;if(a6({isThirdPerson:!0,isAnchoredPassenger:r,vehicleName:o,vehicleYaw:l})){let a=fn({cameraYaw:t.yaw,cameraPitch:t.pitch,vehicleYaw:l});e.rotation.set(0,a.bodyYaw,0),e.traverse(v=>{v.name==="head"&&v.rotation.set(a.headPitch,a.headYaw,0)})}else e.rotation.set(0,t.yaw,0),e.traverse(a=>{a.name==="head"&&a.rotation.set(-t.pitch,0,0)});this.syncArmorPositions(e)}resolvePassengerEntity(e){return this.playerEntity?.originalEntity.id===e?this.playerEntity:this.entities[e]}resolveLocalVehicleRenderWorldPos(e){let t=e.originalEntity,r=e.userData.renderHints,i=e.userData._localVehicleY??t.position?.y??e.position.y;return x6({cameraWorldPos:this.worldRenderer.cameraWorldPos,rawVehicleY:i,eyeHeight:this.worldRenderer.playerStateReactive.eyeHeight,vehicleName:e.realName??t.name,vehicleHeight:t.height??1.6,verticalCameraLock:r?.localVehicleVerticalCameraLock})}updateVehiclePassengerPositions(){B6({entities:this.entities,localPlayer:this.playerEntity,getWorldPosition:e=>this.worldRenderer.sceneOrigin.getWorldPosition(e),version:this.worldRenderer.version})}updateBoatPassengerPositions(){this.updateVehiclePassengerPositions()}syncArmorPositions(e){e.playerObject&&e.traverse(t=>{if(!t.name.startsWith("geometry_armor_"))return;let{skin:r}=e.playerObject;switch(t.name){case"geometry_armor_head":t.children[0]?.children[0]&&t.children[0].children[0].rotation.set(-r.head.rotation.x,r.head.rotation.y,r.head.rotation.z,r.head.rotation.order);break;case"geometry_armor_legs":t.children[0]&&(t.children[0].children[2]&&t.children[0].children[2].rotation.set(-r.leftLeg.rotation.x,r.leftLeg.rotation.y,r.leftLeg.rotation.z,r.leftLeg.rotation.order),t.children[0].children[1]&&t.children[0].children[1].rotation.set(-r.rightLeg.rotation.x,r.rightLeg.rotation.y,r.rightLeg.rotation.z,r.rightLeg.rotation.order));break;case"geometry_armor_feet":t.children[0]&&(t.children[0].children[0]&&t.children[0].children[0].rotation.set(-r.rightLeg.rotation.x,r.rightLeg.rotation.y,r.rightLeg.rotation.z,r.rightLeg.rotation.order),t.children[0].children[1]&&t.children[0].children[1].rotation.set(-r.leftLeg.rotation.x,r.leftLeg.rotation.y,-r.leftLeg.rotation.z,r.leftLeg.rotation.order));break}})}getPlayerObject(e){return this.playerEntity?.originalEntity.id===e?this.playerEntity?.playerObject:this.entities[e]?.playerObject}setPlayerVoiceState(e,t,r){let i=String(e);r?this.playerVoiceStates[i]=r:delete this.playerVoiceStates[i];let s=this.entities[e],o=s?.playerObject;if(!s||!o)return;let l=s.children.find(v=>v.name==="mesh");if(!l)return;let a=s5({username:t,voiceState:r},this.entitiesOptions,l,this.worldRenderer.version);V6(a,o)}isCanvasBlank(e){return!e.getContext("2d")?.getImageData(0,0,e.width,e.height).data.some(r=>r!==0)}async updatePlayerSkin(e,t,r,i,s=void 0){i!==lt&&this.loadedSkinEntityIds.add(String(e)),r&&((typeof i=="string"||typeof s=="string")&&(this.uuidPerSkinUrlsCache[r]={}),typeof i=="string"&&(this.uuidPerSkinUrlsCache[r].skinUrl=i),typeof s=="string"&&(this.uuidPerSkinUrlsCache[r].capeUrl=s),i===!0&&(i=this.uuidPerSkinUrlsCache[r]?.skinUrl??i),s??(s=this.uuidPerSkinUrlsCache[r]?.capeUrl));let l=this.getPlayerObject(e);if(!l)return;if(i===!0){if(!t)return;let v=await Jt(t,"skin");if(!this.getPlayerObject(e)||!v)return;i=v}if(typeof i!="string")throw new Error("Invalid skin url");if(this.currentSkinUrls[String(e)]===i){if(s){if(s===!0&&t){let v=await Jt(t,"cape");if(!this.getPlayerObject(e)||!v)return;s=v}typeof s=="string"&&this.loadAndApplyCape(e,s)}return}i!==lt&&(this.currentSkinUrls[String(e)]=i);let a=this.worldRenderer.worldRendererConfig.renderEars||t==="deadmau5";this.loadAndApplySkin(e,i,a).then(async()=>{if(s){if(s===!0&&t){let v=await Jt(t,"cape");if(!this.getPlayerObject(e)||!v)return;s=v}typeof s=="string"&&this.loadAndApplyCape(e,s)}}),l.cape.visible=!1,s||(l.backEquipment=null,l.elytra.map=null,l.cape.map&&l.cape.map.dispose(),l.cape.map=null)}async applyTemporaryPlayerSkinOverride(e,t,r,i){this.worldRenderer.playerStateReactive.playerSkin=e,await this.updatePlayerSkin(t,r,i,e,void 0)}async loadAndApplySkin(e,t,r){let i=this.getPlayerObject(e);if(i)try{let s;if(i=this.getPlayerObject(e),!i)return;let o,l;if(t===lt){let v=await Bt(lt);s=v.image,o=new j.CanvasTexture(v.canvas),l=v.canvas}else{let{canvas:v,image:c}=await Bt(t);s=c,o=new j.CanvasTexture(v),l=v}o.magFilter=j.NearestFilter,o.minFilter=j.NearestFilter,o.needsUpdate=!0,i.skin.map=o,i.skin.modelType=Di(l),i.skin.isCustom=t!==lt,M1(i);let a;if(s?r&&(a=Ne(64,64),Fi(a,s),r=!this.isCanvasBlank(a)):r=!1,r){let v=new j.CanvasTexture(a);v.magFilter=j.NearestFilter,v.minFilter=j.NearestFilter,v.needsUpdate=!0,i.ears.map=v,i.ears.visible=!0}else i.ears.map=null,i.ears.visible=!1;this.onSkinUpdate?.()}catch{}}async loadAndApplyCape(e,t){let r=this.getPlayerObject(e);if(r)try{let{canvas:i,image:s}=await Bt(t);if(r=this.getPlayerObject(e),!r)return;Oi(i,s);let o=new j.CanvasTexture(i);o.magFilter=j.NearestFilter,o.minFilter=j.NearestFilter,o.needsUpdate=!0,r.cape.map=o,r.cape.visible=!0,r.elytra.map=o,this.onSkinUpdate?.(),r.backEquipment||(r.backEquipment="cape")}catch{}}debugSwingArm(){let e=Object.values(this.entities).find(r=>r.playerObject?.animation);if(!e||!e.playerObject?.animation)return;let t=e.playerObject.animation;t.swingArm&&t.swingArm()}applyMovementAnimation(e,t){let r=e.animation;if(r){if(t==="oneSwing"){r.swingArm();return}if(r.switchAnimationCallback=null,t==="riding"){r.isMoving=!1,r.isRunning=!1,r.isCrouched=!1,r.isRiding=!0;return}r.isRiding=!1,r.isMoving=t==="walking"||t==="running"||t==="crouchWalking",r.isRunning=t==="running",r.isCrouched=t==="crouch"||t==="crouchWalking"}}playAnimation(e,t){let r=e==="player_entity"?this.playerEntity?.playerObject:this.getPlayerObject(e)??this.playerEntity?.playerObject;r&&this.applyMovementAnimation(r,t)}parseEntityLabel(e){if(e)try{if(e.type==="string")return e.value;let t=typeof e=="string"?n5.default.simplify(n5.default.parse(e)):Y1.simplify(e);return w1(t).map(this.textFromComponent).join("")}catch{return e}}textFromComponent(e){return typeof e=="string"?e:e.text??""}getItemMesh(e,t,r=!1,i){!e.nbt&&e.nbtData&&(e.nbt=e.nbtData);let s=this.worldRenderer.getItemRenderData(e,t);if(!(i&&i===s?.modelName)){if(s&&"resolvedModel"in s){let o=n2(this.worldRenderer.material,s.resolvedModel,s.modelName,this.worldRenderer.resourcesManager.currentResources.worldBlockProvider,this.worldRenderer.resourcesManager.currentResources.mcData),l=1;t["minecraft:display_context"]==="ground"?l=.5:t["minecraft:display_context"]==="thirdperson"&&(l=6),o.scale.set(l,l,l);let a=new j.Group;return a.add(o),{mesh:a,isBlock:!0,modelName:s.modelName}}if(s){let o=s.renderInfo?.texture==="blocks"?this.worldRenderer.material.map:this.worldRenderer.itemsTexture,{u:l,v:a,su:v,sv:c}=s,p=I2(o,{u:l,v:a,sizeX:v??1,sizeY:c??1},{faceCamera:r,use3D:!r}),m=1;return t["minecraft:display_context"]==="ground"?m=.5:t["minecraft:display_context"]==="thirdperson"&&(m=6),p.mesh.scale.set(m,m,m),{mesh:p.mesh,isBlock:!1,modelName:s.modelName,cleanup:p.cleanup}}}}setVisible(e,t){t?e.scale.set(1,1,1):e.scale.set(0,0,0)}update(e,t){let r=e.name==="player";(e.name==="zombie_villager"||e.name==="husk")&&(t.texture=`textures/1.16.4/entity/${e.name==="zombie_villager"?"zombie_villager/zombie_villager.png":`zombie/${e.name}.png`}`),e.name==="glow_item_frame"&&(t.textures||(t.textures=[]),t.textures.background="block:glow_item_frame");let i=this.entities[e.id],s=!i;if(e.delete){if(!i)return;i.userData._posTween?.stop(),i.userData._rotTween?.stop(),i.userData[r5]=void 0,i.userData[Zt]=void 0;let m=i.children.find(b=>b.name==="mesh");m&&j3(m),i.additionalCleanup&&i.additionalCleanup(),i.traverse(b=>{b.additionalCleanup&&b.additionalCleanup()}),this.onRemoveEntity(e),this.worldRenderer.sceneOrigin.removeAndUntrack(i),Me(i),delete this.entities[e.id],delete this.playerVoiceStates[String(e.id)];return}if(!this.isRenderingAllowed())return;let o;if(i===void 0){this.beforeEntityAdded(e);let m=new j.Group;if(m.originalEntity=e,e.name==="item"||e.name==="tnt"||e.name==="falling_block"||e.name==="snowball"||e.name==="egg"||e.name==="ender_pearl"||e.name==="experience_bottle"||e.name==="splash_potion"||e.name==="lingering_potion"){let M=e.name==="tnt"||e.type==="projectile"?{name:e.name}:e.name==="falling_block"?{blockState:e.objectData}:N6(e.metadata)?.find(T=>typeof T=="object"&&T?.itemCount);if(M){let T=this.getItemMesh(M,{"minecraft:display_context":"ground"},e.type==="projectile");if(T){if(o=T.mesh,e.name==="item"||e.type==="projectile"?(o.scale.set(.5,.5,.5),o.position.set(0,e.name==="item"?.2:.1,0)):(o.scale.set(2,2,2),o.position.set(0,.5,0)),e.name==="item"){let S=new j.Timer;o.onBeforeRender=()=>{S.update(performance.now());let B=S.getDelta();o.rotation.y+=B}}m.additionalCleanup=()=>{T.cleanup&&T.cleanup()}}}}else if(r){let M=new j.Group,T=this.setupPlayerObject(e,M,t);if(m.playerObject=T,o=M,e.username){let S=s5({...e,voiceState:this.playerVoiceStates[e.id]},{fontFamily:"mojangles"},M,this.worldRenderer.version);V6(S,T)}}else o=od(this.mcData,e,this.worldRenderer,this.entitiesOptions,{...t,customModel:e.customModel});if(!o)return;o.name="mesh";let b=F3(e.name);b!=null&&(o.rotation.y=b,W3(o));let k=e.pos??e.position;this.worldRenderer.sceneOrigin.track(m),m.position.set(k.x,k.y,k.z);let _=new j.BoxHelper(o,e.type==="hostile"?16711680:e.type==="mob"?65280:e.type==="player"?255:16753920);_.name="debug",m.add(o),m.add(_),_.visible=!1,i=m,i.name="entity",i.realName=e.name,this.entities[e.id]=i,r&&this.updatePlayerSkin(e.id,e.username,t?.texture?e.uuid:void 0,t?.texture||lt),this.setDebugMode(this.debugMode,m),this.syncSceneAttachment(m),this.afterAddEntity(e);let y=o.userData[Zt];y&&(i.userData[Zt]=y,i.userData[r5]=J3())}else o=i.children.find(m=>m.name==="mesh"),e.renderHints&&(i.originalEntity.renderHints=e.renderHints);this.applyEntityRenderHints(i,e),this.updateEntityEquipment(i,e);let l=K6(e,this.mcData),v=(N6(e.metadata)?.[0]??e.metadata?.[0]??0)&32||this.worldRenderer.playerStateReactive.cameraSpectatingEntity===e.id&&this.worldRenderer.playerStateUtils.isSpectator();for(let m of o.children??[])m.name!=="nametag"&&(m.visible=!v);l.baby?i.scale.set(.5,.5,.5):i.scale.set(1,1,1);let c=_n("text_display",e,this.mcData),u=c?.text||l.custom_name_visible&&l.custom_name;if(e.name!=="player"&&u){let m=c&&(c.billboard_render_constraints==="fixed"||!c.billboard_render_constraints),b=c&&!(parseInt(c.style_flags,10)&4)?rd(c.background_color):void 0,k;if(c?.text_opacity){let _=parseInt(c?.text_opacity,10);k=_>0?_:256-_}s5({...e,username:typeof u=="string"?n5.default.simplify(n5.default.parse(u)):Y1.simplify(u),nameTagBackgroundColor:b,nameTagTextOpacity:k,nameTagFixed:m,nameTagScale:c?.scale,nameTagTranslation:c&&(c.translation||new j.Vector3(0,0,0)),nameTagRotationLeft:U6(c?.left_rotation),nameTagRotationRight:U6(c?.right_rotation)},this.entitiesOptions,o,this.worldRenderer.version)}let h=_n("armor_stand",e,this.mcData);if(h){let m=(parseInt(h.client_flags,10)&1)!==0,b=(parseInt(h.client_flags,10)&4)!==0,k=(parseInt(h.client_flags,10)&8)===0,_=(parseInt(h.client_flags,10)&16)!==0;o.castShadow=!_,o.receiveShadow=!_,m?i.scale.set(.5,.5,.5):i.scale.set(1,1,1),i.traverse(y=>{switch(y.name){case"bone_baseplate":this.setVisible(y,k),y.rotation.y=-i.rotation.y;break;case"bone_head":h.head_pose&&y.setRotationFromEuler(It(h.head_pose));break;case"bone_body":h.body_pose&&y.setRotationFromEuler(It(h.body_pose));break;case"bone_rightarm":y.parent?.name!=="bone_armor"&&this.setVisible(y,b),h.left_arm_pose?y.setRotationFromEuler(It(h.left_arm_pose)):y.setRotationFromEuler(It({yaw:-10,pitch:-10,roll:0}));break;case"bone_leftarm":y.parent?.name!=="bone_armor"&&this.setVisible(y,b),h.right_arm_pose?y.setRotationFromEuler(It(h.right_arm_pose)):y.setRotationFromEuler(It({yaw:10,pitch:-10,roll:0}));break;case"bone_rightleg":h.left_leg_pose?y.setRotationFromEuler(It(h.left_leg_pose)):y.setRotationFromEuler(It({yaw:-1,pitch:-1,roll:0}));break;case"bone_leftleg":h.right_leg_pose?y.setRotationFromEuler(It(h.right_leg_pose)):y.setRotationFromEuler(It({yaw:1,pitch:1,roll:0}));break}})}let p=_n("item_frame",e,this.mcData);if(p||(p=_n("glow_item_frame",e,this.mcData)),p){let m=p?.item??e.metadata?.[8];if(o.scale.set(1,1,1),o.position.set(0,0,-.5),i.rotation.x=-e.pitch,i.children.find(b=>{if(b.name.startsWith("map_")){Me(b);let k=parseInt(b.name.split("_")[1],10);return this.itemFrameMaps[k]=this.itemFrameMaps[k]?.filter(_=>_!==b),b instanceof j.Mesh&&b.material?.map?.dispose(),!0}else if(b.name==="item")return Me(b),!0;return!1})?.removeFromParent(),m&&(m.itemId??m.blockId??0)!==0){let b=p.rotation??0,k=m.nbtData?.value?.map?.value??m.components?.find(_=>_.type==="map_id")?.data;if(k)o.scale.set(16/12,16/12,1),this.addMapModel(i,k,b);else{let _=this.getItemMesh(m,{"minecraft:display_context":"fixed"});_&&(_.mesh.position.set(0,0,-.05),_.isBlock?_.mesh.scale.set(.25,.25,.25):_.mesh.scale.set(.5,.5,.5),_.mesh.rotateY(Math.PI),_.mesh.rotateZ(-b*Math.PI/4),_.mesh.name="item",i.add(_.mesh))}}}e.username!==void 0&&(i.username=e.username),this.updateNameTagVisibility(i),this.updateEntityPosition(e,s,t)}applyEntityRenderHints(e,t){if(t.renderHints){let v=t.renderHints,c=new Set(v.passengerIds??v.boatPassengerIds??[]),u=e.userData.renderHints?.passengerIds??e.userData.renderHints?.boatPassengerIds??[];if(Pt(t.name)||gn(t.name))for(let p of u){if(c.has(p))continue;let m=this.resolvePassengerEntity(p);m&&pn(m,String(t.id),this.worldRenderer.sceneOrigin.getWorldPosition(m))}e.userData.renderHints=t.renderHints}if(!Pt(t.name))return;let r=e.children.find(v=>v.name==="mesh");if(!r)return;let i=r.userData.boatWaterPatch;i&&(i.visible=t.renderHints?.boatWaterPatchVisible===!0);let s=e.userData.renderHints??t.renderHints,o=s?.boatPaddleLeft===!0,l=s?.boatPaddleRight===!0,a=r.userData.boatPaddleAnimation;a||(a=f6(),r.userData.boatPaddleAnimation=a),m6(a,o,l)}updateEntityPosition(e,t,r,i=!1){let s=this.entities[e.id];if(!s)return;if(this.applyEntityRenderHints(s,e),s.userData[Zt]){s.userData._horseHeadPitch=typeof e.pitch=="number"&&Number.isFinite(e.pitch)?e.pitch:0;let v=e.headYaw;s.userData._horseHeadYaw=typeof v=="number"&&Number.isFinite(v)?v:e.yaw,s.userData._horseBodyYaw=typeof e.yaw=="number"&&Number.isFinite(e.yaw)?e.yaw:0}let o=V1(e);if(e.position){if(o){s.userData._localVehicleY=e.position.y,s.userData._posTween?.stop(),s.userData._posTween=void 0;let c=this.resolveLocalVehicleRenderWorldPos(s);s.position.set(c.x,c.y,c.z)}else{let c=G1(e,t),u=this.worldRenderer.sceneOrigin.getWorldPosition(s)??{x:e.position.x,y:e.position.y,z:e.position.z};s.userData._tweenTarget||(s.userData._tweenTarget={x:u.x,y:u.y,z:u.z}),s.userData._posTween?.stop(),s.userData._posTween=new Ge(s.userData._tweenTarget).to({x:e.position.x,y:e.position.y,z:e.position.z},c).onUpdate(()=>{s.position.set(s.userData._tweenTarget.x,s.userData._tweenTarget.y,s.userData._tweenTarget.z)}).start()}let v=s.userData[r5];!i&&v&&Number.isFinite(e.position.x)&&Number.isFinite(e.position.z)&&X3(v,e.position)}let l=w6(e,t),a;if(s.playerObject&&r?.rotation?.head){let v=r.rotation.head.y,c=typeof v=="number"&&Number.isFinite(v)?v:e.yaw;typeof c=="number"&&Number.isFinite(c)&&(a=c)}else typeof e.yaw=="number"&&Number.isFinite(e.yaw)&&(a=e.yaw);if(typeof a=="number"&&Number.isFinite(a)){s.userData._rotTween?.stop(),s.userData._rotTween=void 0;let v=Number.isFinite(s.rotation.y)?s.rotation.y:0,c=nd(v,a);l===0?s.rotation.y=v+c:s.userData._rotTween=new Ge(s.rotation).to({y:v+c},l).start()}if(s?.playerObject&&r?.rotation?.head){let{playerObject:v}=s,c=r.rotation.head.y;N1(s.userData,c,e.yaw),v.skin.head.rotation.y=0;let u=r.rotation.head.x;P6(s.userData,u),bn(v,s.userData)}else s?.playerObject&&typeof e.yaw=="number"&&Number.isFinite(e.yaw)&&N1(s.userData,void 0,e.yaw)}afterAddEntity(e){}beforeEntityAdded(e){let t=this.pendingModelOverrides.get(e.id.toString());if(t){let{parts:r}=t;e.customModel=r.length===1?r[0]:{parts:r},this.pendingModelOverrides.delete(e.id.toString())}}maybeRenderPlayerSkin(e){let t=this.entities[e];if(e==="player_entity"&&(t=this.playerEntity,e=this.playerEntity?.originalEntity.id),!t||!t.playerObject||!t.visible)return;let r=128,i=this.worldRenderer.getCameraPosition(),s=this.worldRenderer.sceneOrigin.getWorldPosition(t),l=(s?new j.Vector3(s.x,s.y,s.z):t.position.clone().add(new j.Vector3(this.worldRenderer.sceneOrigin.x,this.worldRenderer.sceneOrigin.y,this.worldRenderer.sceneOrigin.z))).distanceTo(i);if(l<r&&l<this.worldRenderer.viewDistance*16){if(this.loadedSkinEntityIds.has(String(e)))return;this.updatePlayerSkin(e,t.playerObject.realUsername,t.playerObject.realPlayerUuid,!0,!0)}}onRemoveEntity(e){this.loadedSkinEntityIds.delete(e.id.toString()),delete this.currentSkinUrls[e.id.toString()]}updateMap(e,t){this.cachedMapsImages[e]=t;let r=this.itemFrameMaps[e];if(r&&(r=r.filter(i=>i.parent),this.itemFrameMaps[e]=r,r))for(let i of r)i.material.map=this.loadMap(t),i.material.needsUpdate=!0,i.visible=!0}updateNameTagVisibility(e){let t=this.worldRenderer.playerStateReactive.team,r=e.originalEntity.team,i=r?.nameTagVisibility||"always",s=i==="always"||i==="hideForOwnTeam"&&r?.team!==t?.team||i==="hideForOtherTeams"&&(r?.team===t?.team||t===void 0);e.traverse(o=>{o.name==="nametag"&&(o.visible=s)})}addMapModel(e,t,r){let i=this.cachedMapsImages?.[t],s=null;i&&(s=this.loadMap(i));let o={transparent:!0,alphaTest:.1};s&&(o.map=s);let l=new j.MeshLambertMaterial(o),a=new j.Mesh(new j.PlaneGeometry(1,1),l);a.rotation.set(0,Math.PI,0),e.add(a);let v=!0;e.traverseVisible(c=>{c.name==="geometry_frame"&&(v=!1)}),v?a.position.set(0,0,.499):a.position.set(0,0,.437),a.rotateZ(Math.PI*2-r*Math.PI/2),a.name=`map_${t}`,s||(a.visible=!1),this.itemFrameMaps[t]||(this.itemFrameMaps[t]=[]),this.itemFrameMaps[t].push(a)}loadMap(e){let t=Z0(e);return t.needsUpdate=!0,t}addItemModel(e,t,r,i=!1){let s=`bone_${t}item`,o=`custom_item_${t}`;if(e.traverse(a=>{a.name===o&&(a.removeFromParent(),a.additionalCleanup&&a.additionalCleanup())}),!r)return;let l=this.getItemMesh(r,{"minecraft:display_context":"thirdperson"});l?.mesh&&e.traverse(a=>{if(a.name.toLowerCase()===s||a.name===`${t}Arm`){let v=new j.Object3D;v.additionalCleanup=()=>{l.cleanup&&l.cleanup()};let c=l.mesh;v.rotation.z=-Math.PI/16,l.isBlock?v.rotation.y=Math.PI/4:(c.rotation.z=-Math.PI/4,v.rotation.y=Math.PI/2,v.scale.multiplyScalar(2)),i&&(v.position.y=-8,v.position.z=5,v.position.x=t==="left"?1:-1,v.rotation.x=Math.PI),v.add(c),v.name=o,a.add(v)}})}handleDamageEvent(e,t){let r=this.entities[e]?.children.find(i=>i.name==="mesh");r&&r.traverse(i=>{if(i instanceof j.Mesh&&i.material.clone){i.material.clone().dispose(),i.material=i.material.clone();let o=i.material.color.clone();i.material.color.set(16711680),new Ge(i.material.color).to(o,500).start()}})}raycastSceneDebug(){let e=new j.Raycaster;return e.setFromCamera(new j.Vector2(0,0),this.worldRenderer.camera),e.intersectObjects(this.worldRenderer.scene.children)[0]?.object}updateEntityModel(e,t,r,i){let s=Array.isArray(t)?t:[{modelPath:t,modelType:r,metadata:i}];this.pendingModelOverrides.set(e,{parts:s});let o=this.entities[e];o&&(this.update({...o.originalEntity,delete:!0},{}),this.update(o.originalEntity,{}))}setupPlayerObject(e,t,r){let i=new er;i.realPlayerUuid=e.uuid??"",i.realUsername=e.username??"",i.position.set(0,16,0),M1(i),t.add(i);let s=1/16;return t.scale.set(s,s,s),t.rotation.set(0,Math.PI,0),i.animation=new Zr,i.animation.isMoving=!1,i}updateEntityEquipment(e,t){if(!e||!t.equipment)return;let r=t.type==="player";if(this.addItemModel(e,r?"right":"left",t.equipment[0],r),this.addItemModel(e,r?"left":"right",t.equipment[1],r),i5(this.worldRenderer,e,"feet",t.equipment[2]),i5(this.worldRenderer,e,"legs",t.equipment[3],2),i5(this.worldRenderer,e,"chest",t.equipment[4]),i5(this.worldRenderer,e,"head",t.equipment[5]),r&&e.playerObject){let{playerObject:i}=e;i.backEquipment=t.equipment.some(s=>s?.name==="elytra")?"elytra":"cape",i.backEquipment==="elytra"&&this.loadAndApplyCape(t.id,z6),i.cape.map===null&&(i.cape.visible=!1)}}};function K6(n,e){let t=e?.entitiesByName[n.name];return new Proxy({},{get(r,i,s){if(typeof i!="string"||!t)return;let o=t.metadataKeys?.indexOf(i);return n.metadata?.[o??-1]}})}function _n(n,e,t){if(e.name===n)return K6(e,t)}function i5(n,e,t,r,i=1,s=!1){if(!r){j1(e,t);return}let o=r.name.split("_"),l,a=t==="head"&&r.name==="player_head";if(a)if(j1(e,t),r.nbt){let m=Y1.simplify(r.nbt);try{let b;if(m.SkullOwner?b=m.SkullOwner.Properties.textures[0]?.Value:b=m["minecraft:profile"]?.Properties?.find(k=>k.name==="textures")?.value,b){l=JSON.parse(O.from(b,"base64").toString()).textures?.SKIN?.url;let{skinTexturesProxy:_}=n.worldRendererConfig;_&&(l=l?.replace("http://textures.minecraft.net/",_).replace("https://textures.minecraft.net/",_))}}catch{}}else l=lt;let v=o[0];if(!l){let m=`${v}_layer_${i}${s?"_overlay":""}`;l=n.resourcesManager.currentResources.customTextures.armor?.textures[m]?.src??F6[m]}if(!l||!e0[t]){j1(e,t);return}let c=`geometry_armor_${t}${s?"_overlay":""}`,u=e.children.findLast(m=>m.name===c),h;if(u?(h=u.material,z5(l,m=>{m.magFilter=j.NearestFilter,m.minFilter=j.NearestFilter,m.flipY=!1,m.wrapS=j.MirroredRepeatWrapping,m.wrapT=j.MirroredRepeatWrapping,h.map=m})):(u=$t(n,l,e0[t]),t==="head"&&(u.children[0].position.y+=.01),u.name=c,h=u.material,a||(h.side=j.DoubleSide)),v==="leather"&&!s){let m=r.nbt?.value?.display?.value?.color?.value;if(m){let b=m>>16&255,k=m>>8&255,_=m&255;h.color.setRGB(b/255,k/255,_/255)}else h.color.setHex(11890001);i5(n,e,t,r,i,!0)}else h.color.setHex(16777215);let p=new j.Object3D;p.name=`armor_${t}${s?"_overlay":""}`,p.add(u),e.add(u)}function j1(n,e){for(let t of n.children)(t.name===`geometry_armor_${e}`||t.name===`geometry_armor_${e}_overlay`)&&t.removeFromParent()}var Q1=async(n,e)=>{let t;if(!n&&!e)t=await Y6;else{if(n||(n=await Jt(e,"skin")),!n)return;let{canvas:a}=await Bt(n);t=new Ye.CanvasTexture(a)}t.magFilter=Ye.NearestFilter,t.minFilter=Ye.NearestFilter;let r=new Ye.BoxGeometry,i=new Ye.MeshStandardMaterial,s=!1,o=new Ye.Mesh(r,i);o.scale.x=s?3:4,o.scale.y=12,o.scale.z=4,ld(r,40,16,s?3:4,12,4),i.map=t,i.needsUpdate=!0;let l=new Ye.Group;return l.add(o),l.scale.set(.1,.1,.1),o.rotation.z=Math.PI,l};function ad(n,e,t,r,i,s,o,l){let a=(P,H,V,z)=>[new Ye.Vector2(P/o,1-z/l),new Ye.Vector2(V/o,1-z/l),new Ye.Vector2(V/o,1-H/l),new Ye.Vector2(P/o,1-H/l)],v=a(e+s,t,e+r+s,t+s),c=a(e+r+s,t,e+r*2+s,t+s),u=a(e,t+s,e+s,t+s+i),h=a(e+s,t+s,e+r+s,t+s+i),p=a(e+r+s,t+s,e+r+s*2,t+i+s),m=a(e+r+s*2,t+s,e+r*2+s*2,t+i+s),b=n.attributes.uv,k=[p[3],p[2],p[0],p[1]],_=[u[3],u[2],u[0],u[1]],y=[v[3],v[2],v[0],v[1]],M=[c[0],c[1],c[3],c[2]],T=[h[3],h[2],h[0],h[1]],S=[m[3],m[2],m[0],m[1]],B=[];for(let P of[k,_,y,M,T,S])for(let H of P)B.push(H.x,H.y);b.set(new Float32Array(B)),b.needsUpdate=!0}function ld(n,e,t,r,i,s){ad(n,e,t,r,i,s,64,64)}var J6={itemRight:{rotation:[0,-90,25],translation:[1.13,3.2,1.13],scale:[.68,.68,.68]},itemLeft:{rotation:[0,90,-25],translation:[1.13,3.2,1.13],scale:[.68,.68,.68]},blockRight:{rotation:[0,45,0],translation:[0,0,0],scale:[.4,.4,.4]},blockLeft:{rotation:[0,225,0],translation:[0,0,0],scale:[.4,.4,.4]}},o5=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;d(this,"holdingBlock");d(this,"blockSwapAnimation");d(this,"cameraGroup",new me.Mesh);d(this,"objectOuterGroup",new me.Group);d(this,"objectInnerGroup",new me.Group);d(this,"holdingBlockInnerGroup",new me.Group);d(this,"camera",new me.PerspectiveCamera(75,1,.1,100));d(this,"stopUpdate",!1);d(this,"lastHeldItem");d(this,"lastHeldItemRenderKey");d(this,"isSwinging",!1);d(this,"nextIterStopCallbacks");d(this,"idleAnimator");d(this,"ready",!1);d(this,"lastUpdate",0);d(this,"playerHand");d(this,"offHandDisplay",!1);d(this,"offHandModeLegacy",!1);d(this,"swingAnimator");d(this,"config");d(this,"disposed",!1);d(this,"unsubs",[]);d(this,"lastItemModelName");d(this,"switchRequest",0);this.initCameraGroup(),this.unsubs.push(q6(this.worldRenderer.playerStateReactive,"heldItemMain",()=>{this.offHand||this.updateItem()})),this.unsubs.push(q6(this.worldRenderer.playerStateReactive,"heldItemOff",()=>{this.offHand&&this.updateItem()})),this.config=e.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||Q1().then(r=>{this.disposed||(this.playerHand=r,this.updateItem())}).then(()=>{if(this.disposed)return;let r=Z5(async()=>Q1(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",i=>{i&&(this.playerHand=i,this.updateItem())},i=>{Me(i,!0)});this.unsubs.push(r)})}updateItem(){if(!this.ready)return;let e=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;e?this.setNewItem(e):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new me.Mesh}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(e,t,r,i){if(!this.lastHeldItem)return;let s=performance.now();this.lastUpdate&&s-this.lastUpdate>50&&this.replaceItemModel(this.lastHeldItem),this.swingAnimator?.isCurrentlySwinging()||this.swingAnimator?.debugParams.animationStage?this.swingAnimator?.update():this.idleAnimator?.update(),this.blockSwapAnimation?.switcher.update();let o=new me.Scene;o.add(this.cameraGroup),this.updateCameraGroup(),o.add(r.clone()),o.add(i.clone());let l=t.getSize(new me.Vector2),a=Math.min(l.width,l.height),v=l.width-a,{offHandDisplay:c}=this;if(c&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),this.offHandDisplay)t.setViewport(0,0,a,a);else{let u=l.width-a;t.setViewport(u,0,a,a)}t.render(o,this.camera),t.setViewport(0,0,l.width,l.height),c&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new C0(()=>({y:this.objectInnerGroup.position.y}),(s,o)=>{s==="y"&&(this.objectInnerGroup.position.y=o)},{y:16})});let t=e,r=this.objectInnerGroup.position.y+this.objectInnerGroup.scale.y*1.5*(t==="appeared"?1:-1),i=!1;return new Promise(s=>{this.blockSwapAnimation.switcher.transitionTo({y:r},t,()=>{i||s(!0)},()=>{i=!0,s(!1)})})}isDifferentItem(e){return this.lastHeldItemRenderKey!==$0(this.worldRenderer,e)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:e}=this;this.cameraGroup.position.copy(e.position),this.cameraGroup.rotation.copy(e.rotation);let t=1,{position:r,scale:i}=this.getHandHeld3d(),s=-r.z,o=this.offHandModeLegacy?-1:1;this.objectOuterGroup.position.set(s*r.x*t*o,s*r.y,-s);let l=i*2.22*.2;this.objectOuterGroup.scale.set(l,l,l)}async createItemModel(e){if(this.lastUpdate=performance.now(),!e||e.type==="hand"&&!this.playerHand)return;let t;if(e.type==="item"||e.type==="block"){let i=this.worldRenderer.entities.getItemMesh({...e.fullItem,itemId:e.id},en(this.worldRenderer),!1,this.lastItemModelName);if(i){let{mesh:s,isBlock:o,modelName:l}=i;o?(t=s,e.type="block"):(s.position.set(.5,.5,.5),t=s,e.type="item"),this.lastItemModelName=l}}else t=this.playerHand;if(!t)return;t.name="holdingBlock";let r=this.getHandHeld3d().rotation;return t.rotation.x=me.MathUtils.degToRad(r.x),t.rotation.y=me.MathUtils.degToRad(r.y),t.rotation.z=me.MathUtils.degToRad(r.z),{model:t,type:e.type}}async replaceItemModel(e){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!e){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0;return}let t=await this.createItemModel(e);t&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=t.model,this.holdingBlockInnerGroup.add(t.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}async setNewItem(e){let t=$0(this.worldRenderer,e),r=this.lastHeldItemRenderKey!==t;if(this.lastHeldItem=e,!r)return;this.lastHeldItemRenderKey=t,this.lastItemModelName=void 0;let i=++this.switchRequest,s=!1;if(this.holdingBlock){if(s=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0}if(!e){this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(i!==this.switchRequest)return;let o=await this.createItemModel(e);if(!o||i!==this.switchRequest)return;let l=new me.Group;this.holdingBlockInnerGroup.removeFromParent(),this.holdingBlockInnerGroup=new me.Group,this.holdingBlockInnerGroup.add(o.model),l.add(this.holdingBlockInnerGroup),this.holdingBlock=o.model,this.objectInnerGroup=new me.Group,this.objectInnerGroup.add(l),this.objectInnerGroup.position.set(-.5,-.5,-.5),s&&(this.objectInnerGroup.position.y-=this.objectInnerGroup.scale.y*1.5),Object.assign(l.position,{x:.5,y:.5,z:.5}),this.objectOuterGroup=new me.Group,this.objectOuterGroup.add(this.objectInnerGroup),this.cameraGroup.add(this.objectOuterGroup);let a=this.getHandHeld3d().rotation;this.objectOuterGroup.rotation.y=me.MathUtils.degToRad(a.yOuter),s&&await this.playBlockSwapAnimation("appeared"),this.swingAnimator??(this.swingAnimator=new q1(this.holdingBlockInnerGroup)),this.swingAnimator.setHandMesh(this.holdingBlockInnerGroup),this.swingAnimator.type=o.type,this.config.viewBobbing&&(this.idleAnimator=new K1(this.holdingBlockInnerGroup,this.worldRenderer.playerStateReactive))}getHandHeld3d(){let e=this.lastHeldItem?.type??"hand",t=this.offHandModeLegacy?"Left":"Right",r=.8*1.15,i={x:.4,y:-.7,z:-.45},s={x:-32.4,y:42.8,z:-41.3,yOuter:0};if(e==="item"){let o=J6[`item${t}`];i={x:-.05,y:-.7,z:-.45},s={x:o.rotation[0],y:o.rotation[1],z:o.rotation[2],yOuter:0},r=o.scale[0]*1.15}else if(e==="block"){let o=J6[`block${t}`];i={x:.4,y:-.7,z:-.45},s={x:o.rotation[0],y:o.rotation[1],z:o.rotation[2],yOuter:0},r=o.scale[0]*1.15}return{rotation:s,position:i,scale:r}}dispose(){this.disposed=!0,this.ready=!1,this.unsubs.forEach(e=>e()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,Me(this.cameraGroup,!0),Me(this.objectOuterGroup,!0),Me(this.objectInnerGroup,!0),Me(this.holdingBlockInnerGroup,!0),this.holdingBlock=void 0,this.playerHand&&(Me(this.playerHand,!0),this.playerHand=void 0)}},K1=class{constructor(e,t){this.handMesh=e;this.playerState=t;d(this,"globalTime",0);d(this,"lastTime",0);d(this,"currentState");d(this,"targetState");d(this,"defaultPosition");d(this,"idleOffset",{y:0,rotationZ:0});d(this,"tween",new q0);d(this,"idleTween",null);d(this,"stateSwitcher");d(this,"debugParams",{walkingSpeed:8,sprintingSpeed:16,walkingAmplitude:{x:1/30,y:1/10,rotationZ:.25},sprintingAmplitude:{x:1/30,y:1/10,rotationZ:.4}});d(this,"debugGui");d(this,"updated",!1);this.handMesh=e,this.globalTime=0,this.currentState="NOT_MOVING",this.targetState="NOT_MOVING",this.defaultPosition={x:e.position.x,y:e.position.y,z:e.position.z,rotationX:e.rotation.x,rotationY:e.rotation.y,rotationZ:e.rotation.z},this.stateSwitcher=new C0(()=>({x:this.handMesh.position.x,y:this.handMesh.position.y,z:this.handMesh.position.z,rotationX:this.handMesh.rotation.x,rotationY:this.handMesh.rotation.y,rotationZ:this.handMesh.rotation.z}),(r,i)=>{switch(r){case"x":this.handMesh.position.x=i;break;case"y":this.handMesh.position.y=i;break;case"z":this.handMesh.position.z=i;break;case"rotationX":this.handMesh.rotation.x=i;break;case"rotationY":this.handMesh.rotation.y=i;break;case"rotationZ":this.handMesh.rotation.z=i;break}},{x:2,y:2,z:2,rotation:Math.PI}),this.debugGui=new Ut("idle_animator",this.debugParams)}startIdleAnimation(){this.idleTween&&this.idleTween.stop(),this.idleOffset.y=this.handMesh.position.y-this.defaultPosition.y,this.idleOffset.rotationZ=this.handMesh.rotation.z-this.defaultPosition.rotationZ,this.idleTween=new Ge(this.idleOffset,this.tween).to({y:.05,rotationZ:.05},3e3).easing(Fe.Sinusoidal.InOut).yoyo(!0).repeat(1/0).start()}stopIdleAnimation(){this.idleTween&&(this.idleTween.stop(),this.idleOffset.y=0,this.idleOffset.rotationZ=0)}getStateTransform(e,t){switch(e){case"NOT_MOVING":case"SNEAKING":return{x:this.defaultPosition.x,y:this.defaultPosition.y,z:this.defaultPosition.z,rotationX:this.defaultPosition.rotationX,rotationY:this.defaultPosition.rotationY,rotationZ:this.defaultPosition.rotationZ};case"WALKING":case"SPRINTING":{let r=e==="SPRINTING"?this.debugParams.sprintingSpeed:this.debugParams.walkingSpeed,i=e==="SPRINTING"?this.debugParams.sprintingAmplitude:this.debugParams.walkingAmplitude;return{x:this.defaultPosition.x+Math.sin(t*r)*i.x,y:this.defaultPosition.y-Math.abs(Math.cos(t*r))*i.y,z:this.defaultPosition.z,rotationX:this.defaultPosition.rotationX,rotationY:this.defaultPosition.rotationY,rotationZ:this.defaultPosition.rotationZ}}}}setState(e){if(e===this.targetState)return;this.targetState=e;let t=!1;if(this.currentState!==e){if(this.stopIdleAnimation(),!t){let r=this.getStateTransform(e,this.globalTime);this.stateSwitcher.transitionTo(r,e)}this.currentState=e}}update(){this.stateSwitcher.update();let e=performance.now(),t=(e-this.lastTime)/1e3;if(this.lastTime=e,!this.stateSwitcher.isTransitioning)switch(this.currentState){case"NOT_MOVING":case"SNEAKING":this.globalTime=Math.PI/4;break;case"SPRINTING":case"WALKING":this.globalTime+=t;break}if(this.playerState){let r=this.playerState.movementState;r!==this.targetState&&this.setState(r)}if(!this.stateSwitcher.isTransitioning&&(this.currentState==="NOT_MOVING"||this.currentState==="SNEAKING")&&(this.idleTween?.isPlaying()||this.startIdleAnimation(),this.tween.update(),this.handMesh.position.y=this.defaultPosition.y+this.idleOffset.y,this.handMesh.rotation.z=this.defaultPosition.rotationZ+this.idleOffset.rotationZ),!this.stateSwitcher.isTransitioning&&(this.currentState==="WALKING"||this.currentState==="SPRINTING")){let r=this.getStateTransform(this.currentState,this.globalTime);Object.assign(this.handMesh.position,r),Object.assign(this.handMesh.rotation,{x:r.rotationX,y:r.rotationY,z:r.rotationZ})}}getCurrentState(){return this.currentState}destroy(){this.stopIdleAnimation(),this.stateSwitcher.forceFinish()}},q1=class{constructor(e){this.handMesh=e;d(this,"PI",Math.PI);d(this,"animationTimer",0);d(this,"lastTime",0);d(this,"isAnimating",!1);d(this,"stopRequested",!1);d(this,"originalRotation");d(this,"originalPosition");d(this,"originalScale");d(this,"debugParams",{animationTime:250,animationStage:0,useClassicSwing:!0,itemSwingXPosScale:-.8,itemSwingYPosScale:.2,itemSwingZPosScale:-.2,itemHeightScale:-.6,itemPreswingRotY:45,itemSwingXRotAmount:-30,itemSwingYRotAmount:-35,itemSwingZRotAmount:-5,armSwingXPosScale:-.3,armSwingYPosScale:.4,armSwingZPosScale:-.4,armSwingYRotAmount:70,armSwingZRotAmount:-20,armHeightScale:-.6});d(this,"debugGui");d(this,"type","hand");this.handMesh=e,this.originalRotation=e.rotation.clone(),this.originalPosition=e.position.clone(),this.originalScale=e.scale.clone(),this.debugGui=new Ut("hand_animator",this.debugParams,void 0,{animationStage:{min:0,max:1,step:.01},itemSwingXPosScale:{min:-2,max:2,step:.1},itemSwingYPosScale:{min:-2,max:2,step:.1},itemSwingZPosScale:{min:-2,max:2,step:.1},itemHeightScale:{min:-2,max:2,step:.1},itemPreswingRotY:{min:-180,max:180,step:5},itemSwingXRotAmount:{min:-180,max:180,step:5},itemSwingYRotAmount:{min:-180,max:180,step:5},itemSwingZRotAmount:{min:-180,max:180,step:5},armSwingXPosScale:{min:-2,max:2,step:.1},armSwingYPosScale:{min:-2,max:2,step:.1},armSwingZPosScale:{min:-2,max:2,step:.1},armSwingYRotAmount:{min:-180,max:180,step:5},armSwingZRotAmount:{min:-180,max:180,step:5},armHeightScale:{min:-2,max:2,step:.1}})}setHandMesh(e){this.handMesh=e,this.originalRotation.copy(e.rotation),this.originalPosition.copy(e.position),this.originalScale.copy(e.scale)}update(){if(!this.isAnimating&&!this.debugParams.animationStage){this.handMesh.rotation.copy(this.originalRotation),this.handMesh.position.copy(this.originalPosition),this.handMesh.scale.copy(this.originalScale);return}let e=performance.now(),t=(e-this.lastTime)/1e3;this.lastTime=e,this.animationTimer+=t*1e3;let r=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(r>=1){if(this.stopRequested){this.isAnimating=!1,this.stopRequested=!1,this.animationTimer=0,this.handMesh.rotation.copy(this.originalRotation),this.handMesh.position.copy(this.originalPosition),this.handMesh.scale.copy(this.originalScale);return}this.animationTimer=0;return}this.handMesh.rotation.copy(this.originalRotation),this.handMesh.position.copy(this.originalPosition),this.handMesh.scale.copy(this.originalScale);let i=r,s=Math.sqrt(i),o=Math.sin(i*this.PI),l=Math.sin(s*this.PI);if(this.type==="hand"){let a=this.debugParams.armSwingXPosScale*l,v=this.debugParams.armSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.armSwingZPosScale*o;this.handMesh.position.x+=a,this.handMesh.position.y+=v+this.debugParams.armHeightScale*i,this.handMesh.position.z+=c,this.handMesh.rotation.y+=me.MathUtils.degToRad(this.debugParams.armSwingYRotAmount*l),this.handMesh.rotation.z+=me.MathUtils.degToRad(this.debugParams.armSwingZRotAmount*o)}else{let a=this.debugParams.itemSwingXPosScale*l,v=this.debugParams.itemSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.itemSwingZPosScale*o;this.handMesh.position.x+=a,this.handMesh.position.y+=v+this.debugParams.itemHeightScale*i,this.handMesh.position.z+=c,this.handMesh.rotation.y+=me.MathUtils.degToRad(this.debugParams.itemPreswingRotY),this.handMesh.rotation.x+=me.MathUtils.degToRad(this.debugParams.itemSwingXRotAmount*o),this.handMesh.rotation.y+=me.MathUtils.degToRad(this.debugParams.itemSwingYRotAmount*l),this.handMesh.rotation.z+=me.MathUtils.degToRad(this.debugParams.itemSwingZRotAmount*o)}}startSwing(){this.stopRequested=!1,!this.isAnimating&&(this.isAnimating=!0,this.animationTimer=0,this.lastTime=performance.now())}stopSwing(){this.isAnimating&&(this.stopRequested=!0)}isCurrentlySwinging(){return this.isAnimating}};function a5(n,e=!1){return n.displayOptions.inWorldRenderingConfig.handRenderer==="legacy"?new o5(n,e):new Yr(n,e)}A();E();R();x();function X6(n){let e=typeof n.pitch=="number"&&Number.isFinite(n.pitch)?n.pitch:0,t=typeof n.headYaw=="number"&&Number.isFinite(n.headYaw)?n.headYaw:typeof n.yaw=="number"&&Number.isFinite(n.yaw)?n.yaw:0;return{pitch:e,headYaw:t}}A();E();R();x();import*as tt from"three";import{Vec3 as J1}from"vec3";var Z6="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAALUlEQVR42mP4//8/IyWYYdSAwW6Ara3tf4oMmD179n9ChhD0AsiQ0Wgc7AYAAOqH+zNQ3r9kAAAAAElFTkSuQmCC";var $6="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAOklEQVR42mP4//8/IyWYYdQA3AbY2tr+H1gDZs+e/R9mCD7D8IYBzBAQTXYgEvIKQQPw2T6aEqlkAADEA/W3ycLXvwAAAABJRU5ErkJggg==";var e7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAQklEQVR42mP4//8/IyWYYRgbYGtr+39wGQDiYzMUpwGzZ8+GawDRID4IkxSIMEOwaSQ6FgiFBW0NIOR8osJgBOQFALo37sVTOo/LAAAAAElFTkSuQmCC";var t7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAWElEQVR42mP4//8/IyWYYXAbYGtr+59sA0CaZ8+eTZkBhNg4DQApQlYIcglMDN1VWA0AKYJpQvYONi/hDUSYIfjCgmA0EooJ2hmAK9CINgBXoA2xvEAMBgBGPud3dYZtOQAAAABJRU5ErkJggg==";var r7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAYklEQVR42r1TQQrAMAxyD8tL89iMHgQJoQxHewi0UsWYFFX1/CkcF4iIsgUWOTM9ASV3F3rHF+v9rK4wEVnEFoFYbwmTbRZFFN9m0B9QZBfk2THaAhqktQdTkHYL9iZe+40vs7nda+BuVOMAAAAASUVORK5CYII=";var n7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAcElEQVR42rWTWwpAIQhEbWGu1MUaXRgQcXpyP8SIPI1jibu3l5DfAKrqyFgfAczsKxx5xJUCFGYFUZXMpOe9CAa8BOS+0U5UVbYQ6Siqbi0BFT0auTSRHZqNkE6BGXgEYKYtAczIbQAz8ukzXT3l3egz49IXvXQCVAAAAABJRU5ErkJggg==";var i7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAeElEQVQ4jaWSQQ4AIQgD9WG8tI/tnkgaUgmuBw8YHcqERXK/nOUuI4JPAABMSESwA1qAQgAQwBygnfNjTaCpWoBzUlNZQJ07x9FUdgSlV5FaW4Cjq8isW8BJ2GgPtEuVdr0HKvLXHjiRI0An8jTKqo9dF000cnBzPgKuxXtbq/m1AAAAAElFTkSuQmCC";var s7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhUlEQVR42qWTSRKAMAgE8WF5KY/FygEL2yEp9cAhCz0wJBYRx58wbowxYsZngLvHjITsgNYpJySBrPIBUMqZSHhdSw+oQlgVa01U7VRQ7huTk67aUWZaVyaNZFsSQBCTVBW3KahLyo/lQ6KR1Y+2BTUyGqke1AXoxsSzpYlU3FW0/Exv1ie0hq53Bf15aAAAAABJRU5ErkJggg==";var o7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAmklEQVR42o2SYQ6FMAiDeQfbSXdYXjSpqd869QeZQiilpbr7l2KM0cc75+xUV77YpGCjAPUqitMU3uCAXrsAlPSCcgJMbG4M0mQ1Etz/i0KlXQnmwyqpv1uH4h7fiws7ISneTYNEk0ImCxcAArGJrE4AXhypPtl7AqTdeJG8k3gHb0L6QfmK9WQTa59cSFdHRssKFHHngteV/wPDepaHIu0QVAAAAABJRU5ErkJggg==";var a7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAoUlEQVR42n2Tyw3AIAxD3cGYlGFTUSmV+2o4IEEAf2JQVV1rjDGq576ec5avWVdfWIW12aMPEJBEImoPv+CAvvcCODsVNWBS8wA4A5ndv1/ytciQvBLMyeTSHD3ZYXPXXH7Y0ZMdJvCxQJls5O6tKHlPPWGEfU58WZR6ive1kKSleFNC2kXGRnrcDqhTTOmPeP3pAZnTq6Oin4X0oXbfnNZu626Io6lqGCwAAAAASUVORK5CYII=";var An=class{constructor(e){this.worldRenderer=e;d(this,"_cursorLinesHidden",!1);d(this,"cursorLineMaterial");d(this,"interactionLines",null);d(this,"prevColor");d(this,"blockBreakMesh");d(this,"breakTextures",[]);let t=[Z6,$6,e7,t7,r7,n7,i7,s7,o7,a7];for(let i=0;i<10;i++)X0(t[i]).then(s=>{s.magFilter=tt.NearestFilter,s.minFilter=tt.NearestFilter,this.breakTextures.push(s)});let r=new tt.MeshBasicMaterial({transparent:!0,blending:tt.MultiplyBlending,premultipliedAlpha:!0,alphaTest:.5});this.blockBreakMesh=new tt.Mesh(new tt.BoxGeometry(1,1,1),r),this.blockBreakMesh.visible=!1,this.blockBreakMesh.renderOrder=999,this.blockBreakMesh.name="blockBreakMesh",this.worldRenderer.sceneOrigin.addAndTrack(this.blockBreakMesh),this.worldRenderer.onReactivePlayerStateUpdated("gameMode",()=>{this.updateLineMaterial()}),setTimeout(()=>{this.updateLineMaterial(),this.interactionLines&&this.setHighlightCursorBlock(this.interactionLines.blockPos,this.interactionLines.shapePositions,!0)})}get cursorLinesHidden(){return this._cursorLinesHidden}set cursorLinesHidden(e){this.interactionLines&&(this.interactionLines.mesh.visible=!e),this._cursorLinesHidden=e}updateLineMaterial(){let e=this.worldRenderer.playerStateReactive.gameMode==="creative",t=this.worldRenderer.renderer.getPixelRatio();this.cursorLineMaterial&&this.cursorLineMaterial.dispose(),this.cursorLineMaterial=new H0({color:(()=>{switch(this.worldRenderer.worldRendererConfig.highlightBlockColor){case"blue":return 4227327;case"classic":return 0;default:return e?4227327:0}})(),linewidth:Math.max(t*.7,1)*2}),this.prevColor=this.worldRenderer.worldRendererConfig.highlightBlockColor}updateBreakAnimation(e,t,r){if(this.hideBreakAnimation(),t===null||!e||!r)return;let{position:i,width:s,height:o,depth:l}=r,a=new J1(i.x,i.y,i.z);this.blockBreakMesh.scale.set(s*1.001,o*1.001,l*1.001),a.add(new J1(e.x,e.y,e.z)),this.blockBreakMesh.position.set(a.x,a.y,a.z),this.blockBreakMesh.visible=!0,this.blockBreakMesh.material.map=this.breakTextures[t]??this.breakTextures.at(-1),this.blockBreakMesh.material.needsUpdate=!0}hideBreakAnimation(){this.blockBreakMesh&&(this.blockBreakMesh.visible=!1)}updateDisplay(){if(this.cursorLineMaterial){let{renderer:e}=this.worldRenderer;this.cursorLineMaterial.resolution.set(e.domElement.width,e.domElement.height),this.cursorLineMaterial.dashOffset=performance.now()/750}}setHighlightCursorBlock(e,t,r=!1){if(e&&this.interactionLines&&e.equals(this.interactionLines.blockPos)&&yd(t??[],this.interactionLines.shapePositions??[])&&!r||(this.interactionLines!==null&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.interactionLines.mesh),this.interactionLines=null),e===null))return;let i=new tt.Group;for(let{position:s,width:o,height:l,depth:a}of t??[]){let v=new J1(s.x,s.y,s.z),c=[1.0001*o,1.0001*l,1.0001*a],u=new tt.BoxGeometry(...c),h=new I0().fromEdgesGeometry(new tt.EdgesGeometry(u)),p=new e5(h,this.cursorLineMaterial);p.position.set(v.x,v.y,v.z),p.computeLineDistances(),i.add(p)}this.worldRenderer.sceneOrigin.addAndTrack(i),i.position.set(e.x,e.y,e.z),i.visible=!this.cursorLinesHidden,this.interactionLines={blockPos:e,mesh:i,shapePositions:t}}render(){this.prevColor!==this.worldRenderer.worldRendererConfig.highlightBlockColor&&this.updateLineMaterial(),this.updateDisplay()}},yd=(n,e)=>{if(n.length!==e.length)return!1;for(let[t,r]of n.entries())if(r!==e[t])return!1;return!0};A();E();R();x();A();E();R();x();var _d=xr(A1(),1);import l7 from"prismarine-nbt";import{getItemDefinition as wd}from"mc-assets/dist/itemDefinitions";var Ad=(n,e)=>{let t,r,i=n.name;i.includes(":")||(i=`minecraft:${i}`);let s=e.currentResources?.customItemModelNames[i];if(n.components){let o=new Map;for(let c of n.components)o.set(c.type,c);let l=o.get("custom_name")||o.get("item_name");l&&(t=typeof l.data=="string"?l.data:l7.simplify(l.data));let a=o.get("item_model");if(a&&(r=a.data),s){let c=o.get("custom_model_data");if(c?.data){let u;typeof c.data=="number"?u=c.data:typeof c.data=="object"&&"floats"in c.data&&Array.isArray(c.data.floats)&&c.data.floats.length>0&&(u=c.data.floats[0]),u&&s[u]&&(r=s[u])}}let v=o.get("lore");v&&(t??(t=n.displayName??n.name),t+=`
21506
- ${JSON.stringify(v.data)}`)}if(n.nbt){let o=l7.simplify(n.nbt),l=o.display?.Name;l&&(t=l),s&&o.CustomModelData&&s[o.CustomModelData]&&(r=s[o.CustomModelData])}return{customText:t,customModel:r}};var v7=(n,e,t,r)=>{let i=n.name,{customModel:s}=Ad(n,t);s&&(i=s);let o=Ca(r,{...e}),l=t.currentResources,a=wd(ba(l),{name:i,version:l.version,properties:o})?.model;return(a==="minecraft:special"?void 0:a)??i};A();E();R();x();var m7=xr(h7(),1);import{versionToNumber as f7}from"mc-assets/dist/utils";var p7=(n,e,t=!1,r=!1)=>{let i=n.modelName,s=globalThis.loadedData.itemsByName[i];f7(e.currentResources.version)<f7("1.13")&&(i=(0,m7.getRenamedData)(s?"items":"blocks",i,e.currentResources.version,"1.13.1"));let o;if(!r){let a=e.currentResources?.guiAtlas?.json,v=u=>u&&a?.textures[u.replace("minecraft:","").replace("block/","").replace("blocks/","").replace("item/","").replace("items/","").replace("_inventory","")],c=v(i)??v(n.originalItemName);if(c){let u=c.u*a.width,h=c.v*a.height;return{texture:"gui",slice:[u,h,a.tileSize,a.tileSize],scale:.25,blockData:null,modelName:null}}}let l=a=>a.top??a;try{if(!e.currentResources?.itemsRenderer)throw new Error("Items renderer is not available");o=e.currentResources.itemsRenderer.getItemTexture(i,{},!1,r)??(n.originalItemName?e.currentResources.itemsRenderer.getItemTexture(n.originalItemName,{},!1,r):void 0)??e.currentResources.itemsRenderer.getItemTexture("item/missing_texture")}catch(a){reportError?.(`Failed to render item ${i} (original: ${n.originalItemName}) on ${e.currentResources.version} (resourcepack: TODO!): ${a.stack}`),o=l(e.currentResources.itemsRenderer.getItemTexture("errored"))}return o??(o=l(e.currentResources.itemsRenderer.getItemTexture("unknown"))),"type"in o?{texture:o.type,slice:o.slice,modelName:i,blockData:null,scale:null}:{texture:"blocks",blockData:o,modelName:i,slice:null,scale:null}};var g7=(n,e,t,r)=>{let i=t.currentResources;if(!i)throw new Error("Resources not loaded");let s=n.itemId??n.blockId??n.name,{blockState:o}=n;try{let l=o?globalThis.loadedData.blocksByStateId[o]?.name:typeof s=="number"?globalThis.loadedData.items[s]?.name:s;if(!l)throw new Error(`Item not found: ${s}`);let a=v7({...n,name:l},e,t,r),v=p7({modelName:a},t,!1,!0);if(!v)throw new Error(`Failed to get render info for item ${l}`);let c=v.texture==="blocks"?i.blocksAtlasImage:i.itemsAtlasImage;if(v.blockData)return{resolvedModel:v.blockData.resolvedModel,modelName:v.modelName};if(v.slice){let[u,h,p,m]=v.slice,[b,k,_,y]=[u/c.width,h/c.height,p/c.width,m/c.height];return{u:b,v:k,su:_,sv:y,renderInfo:v,modelName:v.modelName}}throw new Error(`Invalid render info for item ${l}`)}catch(l){return reportError?.(l),{u:0,v:0,su:16/i.blocksAtlasImage.width,sv:16/i.blocksAtlasImage.width,modelName:"missing"}}};A();E();R();x();import*as St from"three";A();E();R();x();function Sd(n){return Math.min(Math.max(n,0),1)}function b7(n,e){return{individualGain:Sd(n),maxDistance:Math.max(n,1)*e}}function y7(n,e){n.distanceModel="linear",n.refDistance=0,n.rolloffFactor=1,n.maxDistance=e}function _7(n,e,t,r,i){let s=e.currentTime;n.positionX?(n.positionX.setValueAtTime(t,s),n.positionY.setValueAtTime(r,s),n.positionZ.setValueAtTime(i,s)):n.setPosition(t,r,i)}var xn=new St.Vector3,Md=new St.Quaternion,Cd=new St.Vector3,Rn=class{constructor(e){this.worldRenderer=e;d(this,"audioListener");d(this,"activeSounds",new Set);d(this,"audioContext");d(this,"soundVolumes",new Map);d(this,"baseVolume",1);e.onWorldSwitched.push(()=>{this.stopAll()}),e.onReactiveConfigUpdated("volume",t=>{this.changeVolume(t)})}initAudioListener(){this.audioListener||(this.audioListener=new St.AudioListener,this.worldRenderer.camera.add(this.audioListener))}playSound(e,t,r=1,i=1,s=500,o=16){this.initAudioListener();let l=new St.PositionalAudio(this.audioListener);this.activeSounds.add(l);let{individualGain:a,maxDistance:v}=b7(r,o);this.soundVolumes.set(l,a);let c=new St.AudioLoader,u=Date.now();c.loadAsync(t).then(h=>{if(Date.now()-u>s){this.activeSounds.delete(l),this.soundVolumes.delete(l);return}l.setBuffer(h),y7(l.panner,v),l.setVolume(a*this.baseVolume),l.setPlaybackRate(i),this.worldRenderer.sceneOrigin.addAndTrack(l),l.position.set(e.x,e.y,e.z),l.updateMatrixWorld(!0),l.matrixWorld.decompose(xn,Md,Cd),_7(l.panner,this.audioListener.context,xn.x,xn.y,xn.z),l.onEnded=()=>{this.worldRenderer.sceneOrigin.removeAndUntrack(l),l.source&&l.disconnect(),this.activeSounds.delete(l),this.soundVolumes.delete(l),c.manager.itemEnd(t)},l.play()})}stopAll(){for(let e of this.activeSounds)e&&(e.stop(),e.source&&e.disconnect(),this.worldRenderer.sceneOrigin.removeAndUntrack(e));this.activeSounds.clear(),this.soundVolumes.clear()}changeVolume(e){this.baseVolume=e;for(let[t,r]of this.soundVolumes)t.setVolume(r*this.baseVolume)}destroy(){this.stopAll(),this.audioListener&&(this.audioListener.removeFromParent(),this.audioListener=void 0)}playTestSound(){let{x:e,y:t,z:r}=this.worldRenderer.cameraWorldPos;this.playSound({x:e,y:t,z:r},"/sound.mp3")}};A();E();R();x();import*as Qe from"three";var kn=class{constructor(e,t){this.worldRenderer=e;this.onRenderCallbacks=t;d(this,"rollAngle",0);d(this,"rollAnimation");d(this,"basePitch",0);d(this,"baseYaw",0);d(this,"cameraBobInput",null);t.push(()=>{this.update()})}get damageRollAmount(){return 5}get damageAnimDuration(){return 200}setCameraBobInput(e){this.cameraBobInput=e}setBaseRotation(e,t){this.basePitch=e,this.baseYaw=t,this.update()}getBaseRotation(){return{pitch:this.basePitch,yaw:this.baseYaw}}shakeFromDamage(e){let t=this.rollAngle,r=t+(e??(Math.random()<.5?-1:1))*this.damageRollAmount;this.rollAnimation={startTime:performance.now(),startRoll:t,targetRoll:r,duration:this.damageAnimDuration/2}}update(){if(this.worldRenderer.playerStateUtils.isSpectatingEntity()&&(this.rollAngle=0,this.rollAnimation=void 0),this.rollAnimation){let t=performance.now(),r=t-this.rollAnimation.startTime,i=Math.min(r/this.rollAnimation.duration,1);this.rollAnimation.returnToZero?(this.rollAngle=this.rollAnimation.startRoll*(1-this.easeInOut(i)),i===1&&(this.rollAnimation=void 0)):(this.rollAngle=this.rollAnimation.startRoll+(this.rollAnimation.targetRoll-this.rollAnimation.startRoll)*this.easeOut(i),i===1&&(this.rollAnimation={startTime:t,startRoll:this.rollAngle,targetRoll:0,duration:this.damageAnimDuration/2,returnToZero:!0}))}let e=this.worldRenderer.cameraObject;if(this.worldRenderer.cameraGroupVr){let t=new Qe.Quaternion().setFromAxisAngle(new Qe.Vector3(0,1,0),this.baseYaw);e.setRotationFromQuaternion(t)}else{let t=this.addAntiZfightingOffset(this.basePitch),r=this.addAntiZfightingOffset(this.baseYaw),i=new Qe.Quaternion().setFromAxisAngle(new Qe.Vector3(1,0,0),t),s=new Qe.Quaternion().setFromAxisAngle(new Qe.Vector3(0,1,0),r),o=new Qe.Quaternion().setFromAxisAngle(new Qe.Vector3(0,0,1),Qe.MathUtils.degToRad(this.rollAngle)),l=new Qe.Quaternion,a=new Qe.Quaternion,v=this.worldRenderer.playerStateReactive.perspective;if(this.cameraBobInput){let u=$5(this.cameraBobInput);l=new Qe.Quaternion().setFromAxisAngle(new Qe.Vector3(0,0,1),u.rotation.z),a=new Qe.Quaternion().setFromAxisAngle(new Qe.Vector3(1,0,0),u.rotation.x),v==="first_person"&&this.worldRenderer.camera.position.set(u.position.x,u.position.y,0)}else v==="first_person"&&this.worldRenderer.camera.position.set(0,0,0);let c=s.multiply(i).multiply(o).multiply(l).multiply(a);e.setRotationFromQuaternion(c)}}easeOut(e){return 1-(1-e)*(1-e)}easeInOut(e){return e<.5?2*e*e:1-(-2*e+2)**2/2}addAntiZfightingOffset(e){let r=(e%(Math.PI*2)+Math.PI*2)%(Math.PI*2),i=.01;return Math.abs(r)<i||Math.abs(r-Math.PI/2)<i||Math.abs(r-Math.PI)<i||Math.abs(r-3*Math.PI/2)<i?e+.001:e}};A();E();R();x();import*as K from"three";var Sn=class{constructor(e){this.worldRenderer=e;d(this,"customMedia",new Map);d(this,"lastCheck",0);d(this,"THROTTLE_TIME",100);this.worldRenderer.onWorldSwitched.push(()=>{this.onWorldGone()}),this.worldRenderer.onRender.push(()=>{this.render()}),this.worldRenderer.onReactiveConfigUpdated("volume",()=>{let{volume:t}=this.worldRenderer.worldRendererConfig;for(let[r,i]of this.customMedia.entries())i.positionalAudio&&i.positionalAudio.setVolume((i.props.volume??1)*t)})}onWorldGone(){for(let[e,t]of this.customMedia.entries())this.destroyMedia(e)}onWorldStop(){for(let[e,t]of this.customMedia.entries())this.setVideoPlaying(e,!1)}createErrorTexture(e,t,r=16777215,i="Failed to load"){let s=new OffscreenCanvas(100,100),o=100;s.width=o,s.height=o;let l=s.getContext("2d");if(!l)return new K.CanvasTexture(s);l.clearRect(0,0,s.width,s.height),l.fillStyle=`rgba(${r>>16&255}, ${r>>8&255}, ${r&255}, 1)`,l.fillRect(0,0,s.width,s.height),l.fillStyle="#ff0000",l.font="bold 10px sans-serif",l.textAlign="center",l.textBaseline="middle",l.fillText(i,s.width/2,s.height/2,s.width);let a=new K.CanvasTexture(s);return a.minFilter=K.LinearFilter,a.magFilter=K.LinearFilter,a}createBackgroundTexture(e,t,r=0,i=1){let s=new OffscreenCanvas(1,1);s.width=1,s.height=1;let o=s.getContext("2d");if(!o)return new K.CanvasTexture(s);let l=r>>16&255,a=r>>8&255,v=r&255;o.fillStyle=`rgba(${l}, ${a}, ${v}, ${i})`,o.fillRect(0,0,1,1);let c=new K.CanvasTexture(s);return c.minFilter=K.NearestFilter,c.magFilter=K.NearestFilter,c}validateOrigin(e,t){if(t===!0)return!0;if(t===!1)return!1;let r=new URL(e);return t.some(i=>r.origin.endsWith(i))}onPageInteraction(){for(let[e,t]of this.customMedia.entries())t.hadAutoPlayError&&(t.hadAutoPlayError=!1,this.playVideo(e))}addMedia(e,t){let r=structuredClone(t);this.destroyMedia(e);let i=!1;t.src.startsWith("https://disk.yandex.ru/i/")&&(i=!0,t.src=`/ya-image?url=${t.src}`);let{scene:s}=this.worldRenderer;t.allowOrigins!==void 0&&!this.validateOrigin(t.src,t.allowOrigins)&&(t.src="");let l=t.src.endsWith(".png")||t.src.endsWith(".jpg")||t.src.endsWith(".jpeg")||t.imageOverride;i&&!t.imageOverride&&fetch(t.src,{method:"HEAD"}).then(S=>{S.headers.get("content-type")?.startsWith("image/")&&(this.destroyMedia(e),this.addMedia(e,{...r,src:t.src,imageOverride:!0}))}).catch(console.error);let a,v,c=de&&!l;if(!l&&!c){a=document.createElement("video"),a.src=t.src.endsWith(".gif")?t.src.replace(".gif",".mp4"):t.src,a.loop=t.loop??!0;let S=(t.volume??1)*this.worldRenderer.worldRendererConfig.volume;a.volume=Math.min(S,1),a.playsInline=!0,a.crossOrigin="anonymous";let B=this.worldRenderer.soundSystem;if(B.initAudioListener(),!B.audioListener)throw new Error("Audio listener not initialized");v=new K.PositionalAudio(B.audioListener),v.setRefDistance(6),v.setVolume(S),this.worldRenderer.sceneOrigin.addAndTrack(v),v.position.set(t.position.x,t.position.y,t.position.z),v.setMediaElementSource(a),v.connect(),a.addEventListener("pause",()=>{v?.pause(),globalThis.tempSendVideoStop?.(e,"paused",a.currentTime)}),a.addEventListener("play",()=>{v?.play(),globalThis.tempSendVideoPlay?.(e)}),a.addEventListener("seeked",()=>{v&&a&&(v.offset=a.currentTime)}),a.addEventListener("stalled",()=>{globalThis.tempSendVideoStop?.(e,"stalled",a.currentTime)}),a.addEventListener("waiting",()=>{globalThis.tempSendVideoStop?.(e,"waiting",a.currentTime)}),a.addEventListener("error",({error:P})=>{globalThis.tempSendVideoStop?.(e,`error: ${P}`,a.currentTime)}),a.addEventListener("ended",()=>{globalThis.tempSendVideoStop?.(e,"ended",a.currentTime),t.loop||(a.currentTime=0,T.ended=!0)})}let u=this.createBackgroundTexture(t.size.width,t.size.height,t.background),h=S=>{let B=this.createErrorTexture(t.size.width,t.size.height,t.background,S);b.map=B,b.needsUpdate=!0},p=new K.PlaneGeometry(1,1),m=t.allowLighting?K.MeshLambertMaterial:K.MeshBasicMaterial,b=new m({map:u,transparent:!0,side:t.doubleSide?K.DoubleSide:K.FrontSide,alphaTest:.1}),k;if(a)k=new K.VideoTexture(a);else if(c)k=this.createErrorTexture(t.size.width,t.size.height,t.background,"Video unavailable (multi-thread)");else if(de){let S=Or(t.src);k=S.texture,k.minFilter=K.NearestFilter,k.magFilter=K.NearestFilter,S.promise.then(()=>{this.customMedia.get(e)?.texture===k&&(b.map=k,b.needsUpdate=!0)}).catch(()=>h())}else k=new K.TextureLoader().load(t.src,()=>{this.customMedia.get(e)?.texture===k&&(b.map=k,b.needsUpdate=!0)},void 0,()=>h());k.minFilter=K.NearestFilter,k.magFilter=K.NearestFilter,k.generateMipmaps=!1;let _=new K.Mesh(p,b),{mesh:y}=this.positionMeshExact(_,K.MathUtils.degToRad((t.rotation??0)*90),t.position,t.size.width,t.size.height);s.add(y),a&&(_.onBeforeRender=()=>{a.readyState===a.HAVE_ENOUGH_DATA&&(!a.paused||!T?.hadAutoPlayError)&&(b.map!==k&&(b.map=k,b.needsUpdate=!0),k.needsUpdate=!0,v&&(v.position.copy(y.position),v.rotation.copy(y.rotation)))});let M=S=>{let B=p.attributes.uv.array;B[0]=S.startU,B[1]=S.startV,B[2]=S.endU,B[3]=S.startV,B[4]=S.endU,B[5]=S.endV,B[6]=S.startU,B[7]=S.endV,p.attributes.uv.needsUpdate=!0};t.uvMapping&&M(t.uvMapping);let T={mesh:y,video:a,texture:k,updateUVMapping:M,positionalAudio:v,props:r,hadAutoPlayError:!1,pausedBecuaseHidden:!1,ended:!1,handleError(S){if(T.destroyed)return;let B=P=>P;h(S.name==="NotAllowedError"||S.name==="AbortError"?B("Waiting for user interaction"):B("Failed to auto play"))}};return this.customMedia.set(e,T),a&&t.autoPlay&&this.playVideo(e,!0),e}playVideo(e,t=!1){let r=this.customMedia.get(e);if(r?.video){if(!t&&r.positionalAudio&&r.video.currentTime<1){let i=r.video.currentTime;this.addMedia(e,r.props),r.video.currentTime=i,r.props.autoPlay||this.playVideo(e,!0);return}r.video.play().then(()=>{r.hadAutoPlayError=!1}).catch(i=>{r.pausedBecuaseHidden||((i.name==="NotAllowedError"||i.name==="AbortError"||i.message?.includes("not allowed")&&!r.pausedBecuaseHidden)&&(r.hadAutoPlayError=!0),r.handleError(i))})}}render(){for(let[e,t]of this.customMedia.entries()){let r=t.mesh.visible;t.mesh.visible=this.worldRenderer.shouldObjectVisible(t.mesh)&&!t.mesh.forceHide,r!==t.mesh.visible&&t.video&&(t.mesh.visible?t.pausedBecuaseHidden&&(this.playVideo(e),t.pausedBecuaseHidden=!1):t.video.paused||(t.video.pause(),t.pausedBecuaseHidden=!0))}}setVideoPlaying(e,t){let r=this.customMedia.get(e);r?.video&&(t?this.playVideo(e):r.video.pause())}setVideoSeeking(e,t){let r=this.customMedia.get(e);r?.video&&(r.video.currentTime=t)}setVideoVolume(e,t){let r=this.customMedia.get(e);r?.video&&(r.video.volume=t)}setVideoSpeed(e,t){let r=this.customMedia.get(e);r?.video&&(r.video.playbackRate=t)}setControlMode(e,t,r){let i=this.customMedia.get(e);i?.video&&(i.props.controlMode={mouseButton:t,controlMode:r})}destroyMedia(e){let{scene:t}=this.worldRenderer,r=this.customMedia.get(e);if(r){r.destroyed=!0,r.video&&(r.video.pause(),r.video.src="",r.video.remove()),r.positionalAudio&&this.worldRenderer.sceneOrigin.removeAndUntrack(r.positionalAudio),this.worldRenderer.sceneOrigin.removeAndUntrack(r.mesh),r.texture.dispose();let i=r.mesh.children[0];i&&(i.geometry.dispose(),i.material instanceof K.Material&&i.material.dispose()),this.customMedia.delete(e)}}positionMeshExact(e,t,r,i,s,o=1){t===0&&(r.z+=.001),t===Math.PI/2&&(r.x-=.001),t===Math.PI&&(r.z-=.001),t===3*Math.PI/2&&(r.x+=.001),t===0&&(r.z+=1),t===Math.PI&&(r.x+=1),t===3*Math.PI/2&&(r.z+=1,r.x+=1),e.matrix.identity(),e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1),e.rotateY(t),(t===Math.PI/2||t===3*Math.PI/2)&&(e.rotateZ(-Math.PI),e.rotateX(-Math.PI)),e.scale.set(i,s,o),e.geometry.translate(.5,.5,0),e.geometry.attributes.position.needsUpdate=!0,this.worldRenderer.sceneOrigin.track(e),e.position.set(r.x,r.y,r.z);let l=new K.Group;l.add(e);let a=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711680}));a.position.set(r.x,r.y,r.z),l.add(a);let v=r.x+Math.cos(t)*i,c=r.z+Math.sin(t)*i,u=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:255}));u.position.set(r.x,r.y+s,r.z),l.add(u);let h=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16776960}));h.position.set(v,r.y,c),l.add(h);let p=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711935}));p.position.set(v,r.y+s,c),l.add(p);let m=new K.Vector3(this.worldRenderer.sceneOrigin.toSceneX(r.x),this.worldRenderer.sceneOrigin.toSceneY(r.y),this.worldRenderer.sceneOrigin.toSceneZ(r.z)),b=new K.ArrowHelper(new K.Vector3(Math.cos(t),0,Math.sin(t)),m,1,16711680);return l.add(b),{mesh:e,debugGroup:l}}createTestCanvasTexture(){let e=new OffscreenCanvas(100,100);e.width=100,e.height=100;let t=e.getContext("2d");return t?(t.font="10px Arial",t.fillStyle="red",t.fillText("Hello World",0,10),new K.CanvasTexture(e)):null}tryIntersectMedia(){if(Date.now()-this.lastCheck<this.THROTTLE_TIME)return;if(this.customMedia.size===0){this.worldRenderer.reactiveState.world.intersectMedia=null,this.worldRenderer.debugVideo=null,this.worldRenderer.cursorBlock.cursorLinesHidden=!1;return}this.lastCheck=Date.now();let{camera:e,scene:t}=this.worldRenderer,r=new K.Raycaster,i=new K.Vector2(0,0);r.setFromCamera(i,e);let s=r.intersectObjects(t.children,!0);if(s.length>0){let o=s[0],l=o.object;for(let[a,v]of this.customMedia.entries())if(l===v.mesh||v.mesh.children.includes(l)){let{uv:c}=o;if(c){let u={id:a,x:c.x,y:c.y};this.worldRenderer.reactiveState.world.intersectMedia=u,this.worldRenderer.debugVideo=v,this.worldRenderer.cursorBlock.cursorLinesHidden=!0;return}}}this.worldRenderer.reactiveState.world.intersectMedia=null,this.worldRenderer.debugVideo=null,this.worldRenderer.cursorBlock.cursorLinesHidden=!1}handleUserClick(e){let t=this.worldRenderer.reactiveState.world.intersectMedia;if(t){let{id:r,x:i,y:s}=t,o=this.customMedia.get(r),l=o?.props.controlMode;if(o?.video&&(l?.mouseButton==="both"||l?.mouseButton===e))switch(l?.controlMode){case"play_pause":{this.setVideoPlaying(r,o.video.paused);break}case"play_if_ended":{o.ended&&this.setVideoPlaying(r,!0);break}case"toggle_mute":{o.video.muted=!o.video.muted;break}}}}};A();E();R();x();import*as r0 from"three";A();E();R();x();import*as Ce from"three";var Bd=1,w7=10,Tt={TARGET_SCREEN_PX:150,CANVAS_SIZE:256,LAYOUT:{DOT_Y:.3,NAME_Y:.45,DISTANCE_Y:.55},CANVAS_SCALE:2,ARROW:{enabledDefault:!1,pixelSize:50,paddingPx:50},DEFAULT_VISUAL_SCALE:1,DEFAULT_OPACITY:1};function E7(n){let e=n.color??16711680,t=n.depthTest??!1,r=n.visualScale??n.metadata?.visualScale??(typeof window>"u"?void 0:window.serverMetadata?.waypointVisualScale)??Tt.DEFAULT_VISUAL_SCALE,i=n.opacity??n.metadata?.opacity??(typeof window>"u"?void 0:window.serverMetadata?.waypointOpacity)??Tt.DEFAULT_OPACITY,s=Ne(A7(),A7());Tn(s,e,n.label??"","0m",r);let o=new Ce.CanvasTexture(s);o.anisotropy=1,o.magFilter=Ce.LinearFilter,o.minFilter=Ce.LinearFilter;let l=new Ce.SpriteMaterial({map:o,transparent:!0,opacity:1,depthTest:t,depthWrite:!1}),a=new Ce.Sprite(l);a.position.set(0,0,0),a.renderOrder=10,a.material.opacity=i;let v=n.label??"",c="0m",u=Number.NaN,h,p,m,b,k=null,_=Tt.ARROW.enabledDefault,y=new Ce.Group;y.add(a);let{x:M,y:T,z:S}=n.position;y.position.set(M,T,S);function B(){o.needsUpdate=!0}function P(){if(!p||!m)return;let Q=p.width;m.clearRect(0,0,Q,Q),m.beginPath(),m.moveTo(Q*.15,Q*.5),m.lineTo(Q*.85,Q*.5),m.lineTo(Q*.5,Q*.15),m.closePath();let ce=`#${e.toString(16).padStart(6,"0")}`;m.lineWidth=6,m.strokeStyle="black",m.stroke(),m.fillStyle=ce,m.fill(),b&&(b.needsUpdate=!0)}function H(Q){e=Q,c="0m",u=0,Tn(s,e,v,"0m",r),B(),h&&P()}function V(Q){v=Q??"",Tn(s,e,v,c,r),B()}function z(Q,ce){ce!==c&&(c=ce,Tn(s,e,Q,ce,r),B())}function N(Q){a.visible=Q}function Y(Q,ce,be){y.position.set(Q,ce,be)}function q(Q,ce,be,qe){let Re=ce*Math.PI/180,ye=Math.tan(Re/2)*2*be*(Tt.TARGET_SCREEN_PX*r/qe);a.scale.set(ye,ye,1)}function J(){if(h)return;let Q=128;p=Ne(Q,Q),m=p.getContext("2d"),P(),b=new Ce.CanvasTexture(p),b.anisotropy=1,b.magFilter=Ce.LinearFilter,b.minFilter=Ce.LinearFilter;let ce=new Ce.SpriteMaterial({map:b,transparent:!0,depthTest:!1,depthWrite:!1,opacity:i});h=new Ce.Sprite(ce),h.renderOrder=12,h.visible=!1,k&&k.add(h)}function te(Q){_=Q,!Q&&h&&(h.visible=!1)}function se(Q){h?.parent&&h.parent.remove(h),k=Q,h&&Q&&Q.add(h)}function he(Q,ce,be){if(!_||(J(),!h))return!0;let qe=n.metadata?.onlyLeftRight===!0,Re=new Ce.Vector3;Q.getWorldDirection(Re);let at=Q.up.clone().normalize(),ye=new Ce.Vector3().copy(Re).cross(at).normalize(),ut=new Ce.Vector3().copy(ye).cross(Re).normalize(),_r=new Ce.Vector3().setFromMatrixPosition(Q.matrixWorld),wr=new Ce.Vector3(y.position.x,y.position.y,y.position.z).sub(_r),l0=wr.dot(Re),jt=wr.dot(ye),v0=wr.dot(ut),A5=ce/be,c0=Q.fov*Math.PI/180,G0=2*Math.atan(Math.tan(c0/2)*A5),E5=Math.atan2(jt,l0),x5=Math.atan2(v0,l0);if(l0>0&&Math.abs(E5)<=G0/2&&Math.abs(x5)<=c0/2)return h.visible=!1,!0;let st=E5/(G0/2),Ie=x5/(c0/2);l0<=0&&(Math.abs(st)>Math.abs(Ie)?(st=Math.sign(st),Ie=0):(st=0,Ie=Math.sign(Ie))),qe&&(Math.abs(st)>Math.abs(Ie)||(st=st>=0?1:-1),Ie=0);let N0=Math.max(Math.abs(st),Math.abs(Ie))||1,Ar=st/N0,gt=Ie/N0,W0=Tt.ARROW.paddingPx,w=(Ar+1)*.5*ce,f=(1-gt)*.5*be,g=Math.min(Math.max(w,W0),ce-W0),C=Math.min(Math.max(f,W0),be-W0);Ar=g/ce*2-1,gt=-(C/be)*2+1;let I=Math.max(2,Q.near*4),U=Math.tan(c0/2)*I,G=U*A5,ie=_r.clone().add(Re.clone().multiplyScalar(I)).add(ye.clone().multiplyScalar(Ar*G)).add(ut.clone().multiplyScalar(gt*U));h.visible=!0,h.position.copy(ie);let Ae=Math.atan2(Ie,st);h.material.rotation=Ae-Math.PI/2;let we=Math.tan(c0/2)*2*I*(Tt.ARROW.pixelSize*r/be);return h.scale.set(we,we,1),!1}function fe(Q){return Q.distanceTo(y.position)}function pe(Q,ce,be,qe){let Re=fe(Q);q(Q,ce.fov,Re,qe);let at=Math.round(Re/w7)*w7;at!==u&&(u=at,z(v,`${Math.max(0,at)}m`));let ye=he(ce,be,qe);return N(ye),ye}function oe(){let Q=a.material;if(Q.map?.dispose(),Q.dispose(),h){h.parent&&h.parent.remove(h);let ce=h.material;ce.map?.dispose(),ce.dispose()}h=void 0,p=void 0,m=void 0,b=void 0}return{group:y,sprite:a,enableOffscreenArrow:te,setArrowParent:se,updateForCamera:pe,setColor:H,setLabel:V,updateDistanceText:z,setVisible:N,setPosition:Y,dispose:oe}}function x7(){let n=globalThis.devicePixelRatio||1,e=Math.min(n,Bd);return Tt.CANVAS_SCALE*e}function A7(){return Math.round(Tt.CANVAS_SIZE*x7())}function Tn(n,e,t,r,i){let s=n.width,o=x7(),l=n.getContext("2d");l.clearRect(0,0,s,s);let a=s/2,v=Math.round(s*Tt.LAYOUT.DOT_Y),c=Math.round(s*.05*i),u=Math.max(2,Math.round(4*o*i)),h=c+u;l.beginPath(),l.arc(a,v,h,0,Math.PI*2),l.fillStyle=`#${e.toString(16).padStart(6,"0")}`,l.fill(),l.textAlign="center",l.textBaseline="middle";let p=Math.round(s*.08*i),m=Math.round(s*.06*i);l.font=`800 ${p}px mojangles`,l.lineWidth=Math.max(2,Math.round(3*o*i));let b=Math.round(s*Tt.LAYOUT.NAME_Y);l.strokeStyle="black",l.strokeText(t,a,b),l.fillStyle="white",l.fillText(t,a,b),l.font=`800 ${m}px mojangles`,l.lineWidth=Math.max(2,Math.round(2*o*i));let k=Math.round(s*Tt.LAYOUT.DISTANCE_Y);l.strokeStyle="black",l.strokeText(r,a,k),l.fillStyle="#CCCCCC",l.fillText(r,a,k)}var Mn=class{constructor(e){this.worldRenderer=e;d(this,"waypoints",new Map);d(this,"waypointScene",new r0.Scene);d(this,"lastCameraPosition",new r0.Vector3);d(this,"lastUpdateTime",0);d(this,"UPDATE_THROTTLE_MS",16)}updateWaypoints(){let e=performance.now(),t=this.worldRenderer.getCameraPosition(),r=this.lastCameraPosition.distanceTo(t)>.5,i=e-this.lastUpdateTime>this.UPDATE_THROTTLE_MS;if(!r&&!i)return;this.lastCameraPosition.copy(t),this.lastUpdateTime=e;let s=this.worldRenderer.renderer.getSize(new r0.Vector2);for(let o of this.waypoints.values()){let l=new r0.Vector3(o.x,o.y,o.z),a=t.distanceTo(l),v=(!o.minDistance||a>=o.minDistance)&&(o.maxDistance===1/0||a<=o.maxDistance);o.sprite.setVisible(v),v&&(o.sprite.setPosition(this.worldRenderer.sceneOrigin.toSceneX(o.x),this.worldRenderer.sceneOrigin.toSceneY(o.y),this.worldRenderer.sceneOrigin.toSceneZ(o.z)),o.sprite.updateForCamera(this.worldRenderer.getCameraPosition(),this.worldRenderer.camera,s.width,s.height))}}render(){this.waypoints.size!==0&&(this.updateWaypoints(),this.worldRenderer.renderer.render(this.waypointScene,this.worldRenderer.camera))}addWaypoint(e,t,r,i,s={}){this.removeWaypoint(e);let o=s.color??16711680,{label:l,metadata:a}=s,v=s.minDistance??0,c=s.maxDistance??1/0,u=E7({position:new r0.Vector3(t,r,i),color:o,label:l||e,metadata:a});u.enableOffscreenArrow(!0),u.setArrowParent(this.waypointScene),this.waypointScene.add(u.group),this.waypoints.set(e,{id:e,x:t+.5,y:r+.5,z:i+.5,minDistance:v,maxDistance:c,color:o,label:l,sprite:u})}removeWaypoint(e){let t=this.waypoints.get(e);t&&(this.waypointScene.remove(t.sprite.group),t.sprite.dispose(),this.waypoints.delete(e))}clear(){for(let e of this.waypoints.keys())this.removeWaypoint(e)}testWaypoint(){this.addWaypoint("Test Point",0,70,0,{color:65280,label:"Test Point"}),this.addWaypoint("Spawn",0,64,0,{color:16776960,label:"Spawn"}),this.addWaypoint("Far Point",100,70,100,{color:255,label:"Far Point"}),this.addWaypoint("Far Point 2",180,170,100,{color:255,label:"Far Point 2"}),this.addWaypoint("Far Point 3",1e3,100,1e3,{color:255,label:"Far Point 3"})}getWaypoint(e){return this.waypoints.get(e)}getAllWaypoints(){return[...this.waypoints.values()]}setWaypointColor(e,t){let r=this.waypoints.get(e);r&&(r.sprite.setColor(t),r.color=t)}setWaypointLabel(e,t){let r=this.waypoints.get(e);r&&(r.label=t,r.sprite.setLabel(t))}};A();E();R();x();import*as Se from"three";import{Vec3 as l5}from"vec3";var ke=class ke{constructor(e){this.worldRenderer=e;d(this,"explosions",new Map);d(this,"particleGeometry");d(this,"particleMaterials",[]);d(this,"testModeTimer");d(this,"explosionCounter",0);this.particleGeometry=new Se.BoxGeometry(ke.DEFAULT_PARTICLE_SIZE,ke.DEFAULT_PARTICLE_SIZE,ke.DEFAULT_PARTICLE_SIZE),this.createParticleMaterials()}createParticleMaterials(){let e=[16711680,65280,255,16776960,16711935,65535,16753920,8388736,16761035,16777215];for(let t of e){let r=new Se.MeshBasicMaterial({color:t,transparent:!0,opacity:1});this.particleMaterials.push(r)}}getRandomMaterial(){return this.particleMaterials[Math.floor(Math.random()*this.particleMaterials.length)]}createExplosion(e,t=1,r,i=ke.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],l=Math.floor(ke.DEFAULT_PARTICLE_COUNT*t),a;if(ke.DEBUG_SHOW_EXPLOSION_CENTER){let c=.5*t,u=new Se.SphereGeometry(c,8,8),h=new Se.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});a=new Se.Mesh(u,h),a.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(a),a.position.set(e.x,e.y,e.z)}for(let c=0;c<l;c++){let u=Math.random()*Math.PI*2,h=Math.sqrt(Math.random())*ke.VELOCITY_FACTOR*t,p=new l5(h*Math.cos(u),Math.random()*.5-.25,h*Math.sin(u));c<5;let m=r===void 0?this.getRandomMaterial().clone():new Se.MeshBasicMaterial({color:r,transparent:!0,opacity:1}),b=new Se.Mesh(this.particleGeometry,m);b.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(b),b.position.set(e.x,e.y,e.z),c<5;let k={position:e.clone(),velocity:p,color:new Se.Color(m.color),life:1,maxLife:1,mesh:b};o.push(k)}let v={id:s,position:e.clone(),particles:o,startTime:Date.now(),duration:i,size:t,debugSphere:a};return this.explosions.set(s,v),v}createExplosionFacingCamera(e,t=1,r,i=ke.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],l=Math.floor(ke.DEFAULT_PARTICLE_COUNT*t),a;if(ke.DEBUG_SHOW_EXPLOSION_CENTER){let h=.5*t,p=new Se.SphereGeometry(h,8,8),m=new Se.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});a=new Se.Mesh(p,m),a.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(a),a.position.set(e.x,e.y,e.z)}let v=this.worldRenderer.getCameraPosition(),c=new l5(v.x-e.x,v.y-e.y,v.z-e.z).normalize();for(let h=0;h<l;h++){let p=Math.random()*Math.PI*2,m=Math.sqrt(Math.random())*ke.VELOCITY_FACTOR*t,b=new l5(m*Math.cos(p),m*Math.sin(p),0),k=new l5(b.x*c.x-b.z*c.z,b.y,b.x*c.z+b.z*c.x);h<5;let _=r===void 0?this.getRandomMaterial().clone():new Se.MeshBasicMaterial({color:r,transparent:!0,opacity:1}),y=new Se.Mesh(this.particleGeometry,_);y.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(y),y.position.set(e.x,e.y,e.z);let M={position:e.clone(),velocity:k,color:new Se.Color(_.color),life:1,maxLife:1,mesh:y};o.push(M)}let u={id:s,position:e.clone(),particles:o,startTime:Date.now(),duration:i,size:t,debugSphere:a};return this.explosions.set(s,u),u}explode(e,t=1,r,i){return this.createExplosion(e,t,r,i).id}explodeFacingCamera(e,t=1,r,i){return this.createExplosionFacingCamera(e,t,r,i).id}startTestMode(){let e=this.worldRenderer.getCameraPosition(),t=new l5(e.x,e.y+10,e.z);this.testModeTimer=setInterval(()=>{let r=.8+Math.random()*.4,i=[16711680,65280,255,16776960,16711935,65535,16753920],s=i[Math.floor(Math.random()*i.length)];this.explodeFacingCamera(t,r,s)},ke.TEST_INTERVAL)}updateParticle(e,t,r){let i=e.mesh.position.x===e.position.x&&e.mesh.position.y===e.position.y&&e.mesh.position.z===e.position.z;i&&e.life>.95,e.velocity.y+=ke.GRAVITY;let s=e.position.clone(),o=t/1e3;e.position.add(e.velocity.scaled(o)),e.mesh.position.set(e.position.x,e.position.y,e.position.z);let l=e.life;e.life-=t/r;let a=Math.max(0,e.life);if(e.mesh.material instanceof Se.MeshBasicMaterial&&(e.mesh.material.opacity=a),i&&l>.95){let v=e.position.distanceTo(s)}return e.life>0}render(){let e=Date.now(),t=16.67;this.explosions.size>0&&Math.random()<.01;for(let[r,i]of this.explosions.entries()){let s=e-i.startTime;if(s>=i.duration){this.removeExplosion(r);continue}s%2e3<16,i.particles=i.particles.filter(o=>this.updateParticle(o,t,i.duration)),i.particles.length===0&&this.removeExplosion(r)}}removeExplosion(e){let t=this.explosions.get(e);if(t){for(let r of t.particles)this.worldRenderer.sceneOrigin.removeAndUntrack(r.mesh),r.mesh.material instanceof Se.Material&&r.mesh.material.dispose();t.debugSphere&&(this.worldRenderer.sceneOrigin.removeAndUntrack(t.debugSphere),t.debugSphere.geometry.dispose(),t.debugSphere.material instanceof Se.Material&&t.debugSphere.material.dispose()),this.explosions.delete(e)}}stopTestMode(){this.testModeTimer&&(clearInterval(this.testModeTimer),this.testModeTimer=void 0)}destroy(){this.stopTestMode();for(let e of this.explosions.keys())this.removeExplosion(e);for(let e of this.particleMaterials)e.dispose();this.particleGeometry.dispose()}};d(ke,"DEFAULT_PARTICLE_COUNT",50),d(ke,"DEFAULT_PARTICLE_SIZE",.05),d(ke,"DEFAULT_EXPLOSION_DURATION",6e3),d(ke,"GRAVITY",-.005),d(ke,"VELOCITY_FACTOR",1.5),d(ke,"TEST_INTERVAL",1e3),d(ke,"DEBUG_SHOW_EXPLOSION_CENTER",!0),d(ke,"DEBUG_SHOW_PARTICLE_TRAILS",!1);var Cn=ke;A();E();R();x();import*as L0 from"three";import{Vec3 as X1}from"vec3";var Bn=class n{constructor(e,t,r,i){this.worldRenderer=e;this.updateCamera=t;this.updateFov=r;this.getInitialState=i;d(this,"isRunning",!1);d(this,"currentScript",null);d(this,"currentPointIndex",0);d(this,"currentTweens",[]);d(this,"startTime",0);d(this,"totalDuration",0);d(this,"currentPosition",{x:0,y:0,z:0});d(this,"currentRotation",{yaw:0,pitch:0});d(this,"currentFov",75)}startScript(e){if(this.isRunning||!e.points||e.points.length===0)return!1;this.currentScript=e,this.isRunning=!0,this.currentPointIndex=0,this.startTime=performance.now(),this.totalDuration=e.points.reduce((r,i)=>r+i.duration,0);let t=this.getInitialState();return this.currentPosition={x:t.position.x,y:t.position.y,z:t.position.z},this.currentRotation={yaw:t.yaw,pitch:t.pitch},this.currentFov=t.fov,this.moveToPoint(0),!0}stopScript(){if(this.isRunning){for(let e of this.currentTweens)e.stop();this.currentTweens=[],this.isRunning=!1,this.currentScript=null,this.currentPointIndex=0}}runExampleScripts(e){let t=this.worldRenderer.getCameraPosition(),r=new X1(t.x,t.y,t.z),i=n.createCircularFlyby(r,30,20,15e3),s=n.createSpiralDescent(r.offset(0,50,0),r,3,12e3),o=n.createBuildingTour([{pos:r.offset(-20,10,-20),lookAt:r,duration:3e3},{pos:r.offset(20,15,-20),lookAt:r,duration:3e3},{pos:r.offset(20,20,20),lookAt:r,duration:3e3},{pos:r.offset(-20,25,20),lookAt:r,duration:3e3}]),l=[i,s,o];return this.startScript(l[e]),{circular:i,spiral:s,buildingTour:o}}moveToPoint(e){if(!this.currentScript||e>=this.currentScript.points.length){this.handleScriptComplete();return}let t=this.currentScript.points[e],{duration:r}=t,i={x:t.x,y:t.y,z:t.z},s={yaw:t.yaw,pitch:t.pitch},o=t.fov??this.currentFov;if(t.lookAt){let u=new L0.Vector3(t.lookAt.x,t.lookAt.y,t.lookAt.z),h=new L0.Vector3(t.x,t.y,t.z),p=u.sub(h).normalize();s.yaw=Math.atan2(-p.x,-p.z),s.pitch=Math.asin(p.y)}let l=this.getEasingFunction(t.easing||"easeInOut"),a=new Ge(this.currentPosition).to(i,r).easing(l).onUpdate(()=>{this.updateCamera(new X1(this.currentPosition.x,this.currentPosition.y,this.currentPosition.z),this.currentRotation.yaw,this.currentRotation.pitch)}),v=new Ge(this.currentRotation).to(this.wrapRotation(s),r).easing(l).onUpdate(()=>{this.updateCamera(new X1(this.currentPosition.x,this.currentPosition.y,this.currentPosition.z),this.currentRotation.yaw,this.currentRotation.pitch)}),c=null;if(Math.abs(o-this.currentFov)>.1){let u={fov:this.currentFov};c=new Ge(u).to({fov:o},r).easing(l).onUpdate(()=>{this.currentFov=u.fov,this.updateFov(this.currentFov)})}this.currentTweens=[a,v],c&&this.currentTweens.push(c),a.start(),v.start(),c?.start(),a.onComplete(()=>{this.currentPointIndex++,this.currentScript?.onPointReached?.(e,t),this.isRunning&&this.moveToPoint(this.currentPointIndex)})}wrapRotation(e){let t=e.yaw,r=t-this.currentRotation.yaw;r>Math.PI?t-=2*Math.PI:r<-Math.PI&&(t+=2*Math.PI);let i=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,e.pitch));return{yaw:t,pitch:i}}getEasingFunction(e){switch(e){case"linear":return Fe.Linear.None;case"easeIn":return Fe.Quadratic.In;case"easeOut":return Fe.Quadratic.Out;case"easeInOut":return Fe.Quadratic.InOut;case"smoothstep":return Fe.Cubic.InOut;case"bounce":return Fe.Bounce.Out;default:return Fe.Quadratic.InOut}}handleScriptComplete(){if(!this.currentScript)return;let e=this.currentScript;e.loop?(this.currentPointIndex=0,this.moveToPoint(0)):(e.onComplete?.(),this.stopScript())}get running(){return this.isRunning}get progress(){if(!this.isRunning||this.totalDuration===0)return 0;let e=performance.now()-this.startTime;return Math.min(e/this.totalDuration,1)}get currentScriptName(){return this.currentScript?.name}static createCircularFlyby(e,t,r,i){let s=[];for(let l=0;l<=8;l++){let a=l/8*Math.PI*2,v=e.x+Math.cos(a)*t,c=e.z+Math.sin(a)*t,u=e.y+r;s.push({x:v,y:u,z:c,yaw:a+Math.PI/2,pitch:-.2,duration:i/8,easing:"smoothstep",lookAt:{x:e.x,y:e.y,z:e.z}})}return{name:"Circular Flyby",points:s,loop:!1}}static createSpiralDescent(e,t,r,i){let s=[],o=r*8,l=20;for(let a=0;a<=o;a++){let v=a/o,c=v*r*Math.PI*2,u=L0.MathUtils.lerp(e.x,t.x,v)+Math.cos(c)*l*(1-v),h=L0.MathUtils.lerp(e.z,t.z,v)+Math.sin(c)*l*(1-v),p=L0.MathUtils.lerp(e.y,t.y,v);s.push({x:u,y:p,z:h,yaw:c+Math.PI/2,pitch:-.3*v,duration:i/o,easing:"easeInOut"})}return{name:"Spiral Descent",points:s,loop:!1}}static createBuildingTour(e){return{name:"Building Tour",points:e.map((r,i)=>({x:r.pos.x,y:r.pos.y,z:r.pos.z,yaw:0,pitch:0,duration:r.duration||3e3,easing:"smoothstep",lookAt:r.lookAt?{x:r.lookAt.x,y:r.lookAt.y,z:r.lookAt.z}:void 0})),loop:!1}}};A();E();R();x();import*as ee from"three";var Z1=.75,Pn=class{constructor(e,t,r){this.scene=e;this.defaultSkybox=t;this.initialImage=r;d(this,"texture",null);d(this,"mesh",null);d(this,"skyMesh",null);d(this,"voidMesh",null);d(this,"worldTime",0);d(this,"partialTicks",0);d(this,"viewDistance",4);d(this,"temperature",Z1);d(this,"inWater",!1);d(this,"waterBreathing",!1);d(this,"fogBrightness",0);d(this,"prevFogBrightness",0);d(this,"fogOrangeness",0);d(this,"distanceFactor",2.7);d(this,"brightnessAtPosition",1);d(this,"debugGui");this.debugGui=new Ut("skybox_renderer",this,["temperature","worldTime","inWater","waterBreathing","fogOrangeness","brightnessAtPosition","distanceFactor"],{brightnessAtPosition:{min:0,max:1,step:.01},temperature:{min:0,max:1,step:.01},worldTime:{min:0,max:24e3,step:1},fogOrangeness:{min:-1,max:1,step:.01},distanceFactor:{min:0,max:5,step:.01}}),r||this.createGradientSky()}async init(){this.initialImage&&await this.setSkyboxImage(this.initialImage)}async setSkyboxImage(e){this.texture&&this.texture.dispose();let t=new ee.TextureLoader;if(this.texture=await new Promise(r=>{t.load(e,i=>{i.mapping=ee.EquirectangularReflectionMapping,i.colorSpace=ee.SRGBColorSpace,i.minFilter=ee.NearestFilter,i.magFilter=ee.NearestFilter,i.needsUpdate=!0,r(i)})}),this.mesh)this.mesh.material.map=this.texture,this.mesh.material.needsUpdate=!0;else{let r=new ee.SphereGeometry(500,60,40);r.scale(-1,1,1);let i=new ee.MeshBasicMaterial({map:this.texture,side:ee.FrontSide});this.mesh=new ee.Mesh(r,i),this.scene.add(this.mesh)}}update(e,t){t!==this.viewDistance&&(this.viewDistance=t,this.updateSkyColors()),this.mesh?this.mesh.position.set(0,0,0):this.skyMesh&&(this.skyMesh.position.set(0,0,0),this.voidMesh?.position.set(0,0,0),this.updateSkyColors())}updateTime(e,t=0){this.debugGui.visible||(this.worldTime=e,this.partialTicks=t,this.updateSkyColors())}updateViewDistance(e){this.viewDistance=e,this.updateSkyColors()}updateTemperature(e){this.debugGui.visible||(this.temperature=e,this.updateSkyColors())}updateWaterState(e,t){this.debugGui.visible||(this.inWater=e,this.waterBreathing=t,this.updateSkyColors())}updateDefaultSkybox(e){this.debugGui.visible||(this.defaultSkybox=e,this.updateSkyColors())}createGradientSky(){{let r=new ee.PlaneGeometry(768,768);r.rotateX(-Math.PI/2),r.translate(0,16,0);let i=new ee.MeshBasicMaterial({color:16777215,side:ee.DoubleSide,depthTest:!1});this.skyMesh=new ee.Mesh(r,i),this.scene.add(this.skyMesh)}{let r=new ee.PlaneGeometry(768,768);r.rotateX(-Math.PI/2),r.translate(0,-16,0);let i=new ee.MeshBasicMaterial({color:16777215,side:ee.DoubleSide,depthTest:!1});this.voidMesh=new ee.Mesh(r,i),this.scene.add(this.voidMesh)}this.updateSkyColors()}getFogColor(e=0){let t=this.getCelestialAngle(e),r=Math.cos(t*Math.PI*2)*2+.5;r=Math.max(0,Math.min(1,r));let i=.7529412,s=.84705883,o=1;return i*=r*.94+.06,s*=r*.94+.06,o*=r*.91+.09,new ee.Vector3(i,s,o)}getSkyColor(e=0,t=0,r=0){let i=this.getCelestialAngle(r),s=Math.cos(i*3.141593*2)*2+.5;s<0&&(s=0),s>1&&(s=1);let o=this.getTemperature(e,t),l=this.getSkyColorByTemp(o),a=(l>>16&255)/255,v=(l>>8&255)/255,c=(l&255)/255;return new ee.Vector3(a*s,v*s,c*s)}calculateCelestialAngle(e,t){let i=(e%24e3+t)/24e3-.25;return i<0&&i++,i>1&&i--,i=1-(Math.cos(i*Math.PI)+1)/2,i+=(i-i)/3,i}getCelestialAngle(e){return this.calculateCelestialAngle(this.worldTime,e)}getTemperature(e,t){return this.temperature}getSkyColorByTemp(e){e/=3,e<-1&&(e=-1),e>1&&(e=1);let t=.6222222-e*.05,i=this.fogOrangeness>0?t+(.12-t)*this.fogOrangeness*.8:t+this.fogOrangeness*.1,s=.5+e*.1+Math.abs(this.fogOrangeness)*.3;return this.hsbToRgb(i,s,1)}hsbToRgb(e,t,r){let i=0,s=0,o=0;if(t===0)i=s=o=Math.floor(r*255+.5);else{let l=(e-Math.floor(e))*6,a=l-Math.floor(l),v=r*(1-t),c=r*(1-t*a),u=r*(1-t*(1-a));switch(Math.floor(l)){case 0:i=Math.floor(r*255+.5),s=Math.floor(u*255+.5),o=Math.floor(v*255+.5);break;case 1:i=Math.floor(c*255+.5),s=Math.floor(r*255+.5),o=Math.floor(v*255+.5);break;case 2:i=Math.floor(v*255+.5),s=Math.floor(r*255+.5),o=Math.floor(u*255+.5);break;case 3:i=Math.floor(v*255+.5),s=Math.floor(c*255+.5),o=Math.floor(r*255+.5);break;case 4:i=Math.floor(u*255+.5),s=Math.floor(v*255+.5),o=Math.floor(r*255+.5);break;case 5:i=Math.floor(r*255+.5),s=Math.floor(v*255+.5),o=Math.floor(c*255+.5);break}}return 4278190080|i<<16|s<<8|Math.trunc(o)}updateSkyColors(){if(!this.skyMesh||!this.voidMesh)return;if(!this.defaultSkybox){this.skyMesh.visible=!1,this.voidMesh.visible=!1,this.mesh&&(this.mesh.visible=!1);return}this.skyMesh.visible=!0,this.voidMesh.visible=!0,this.mesh&&(this.mesh.visible=!0),this.prevFogBrightness=this.fogBrightness;let e=this.viewDistance/32,t=this.brightnessAtPosition*(1-e)+e;if(this.fogBrightness+=(t-this.fogBrightness)*.1,this.inWater){let m=this.waterBreathing?100:5;this.scene.fog=new ee.Fog(new ee.Color(0,0,1),.0025,m),this.scene.background=new ee.Color(0,0,1),this.skyMesh.material.color.set(new ee.Color(0,0,1)),this.voidMesh.material.color.set(new ee.Color(0,0,.6));return}let r=this.viewDistance*16,i=1-(.25+.75*this.viewDistance/32)**.25,s=this.getCelestialAngle(this.partialTicks),o=this.getSkyColor(0,0,this.partialTicks),l=this.getFogColor(this.partialTicks),a=Math.cos(s*Math.PI*2)*2+.5,v=Math.max(0,Math.min(1,a)),c=this.prevFogBrightness+(this.fogBrightness-this.prevFogBrightness)*this.partialTicks,u=(l.x+(o.x-l.x)*i)*v*c,h=(l.y+(o.y-l.y)*i)*v*c,p=(l.z+(o.z-l.z)*i)*v*c;this.scene.background=new ee.Color(u,h,p),this.scene.fog=new ee.Fog(new ee.Color(u,h,p),.0025,r*this.distanceFactor),this.skyMesh.material.color.set(new ee.Color(o.x,o.y,o.z)),this.voidMesh.material.color.set(new ee.Color(o.x*.2+.04,o.y*.2+.04,o.z*.6+.1))}dispose(){this.texture&&this.texture.dispose(),this.mesh&&(this.mesh.geometry.dispose(),this.mesh.material.dispose(),this.scene.remove(this.mesh)),this.skyMesh&&(this.skyMesh.geometry.dispose(),this.skyMesh.material.dispose(),this.scene.remove(this.skyMesh)),this.voidMesh&&(this.voidMesh.geometry.dispose(),this.voidMesh.material.dispose(),this.scene.remove(this.voidMesh))}};A();E();R();x();import*as ne from"three";var Pd=`
21504
+ f 71/216/54 68/215/54 67/214/54 72/213/54`;var H1={allay:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAV1BMVEUAAAA4jNkuh9Ypg9FBnNpCm9r///+c/P+A/P9k+/9N8/hM6f9Q2f8+5eo94PdG0P821+4s1ewiz/8syf8ox/8bxPNNq+wQwf8os+hCnNpCm9oep9s0h8D7j8AOAAAABnRSTlMAoKCg3PODq/XXAAAA60lEQVR42tWP0W7DIAxFb9OtwdA6xQ3rzZL//84BD0nRljzsZdqxZCx8hLio3Lz4GwtYMWLDi4jnPM+vwogNKTTC43Elr6vgRMQ1wvM5ktsbvRPXN38wGxKHMmnI9M65vgxavwsg2WCpCvlSg6iqlCF4ceKbFEGZVC+5NFFXYUtxZzILl1xmiffoxUcA5DUHKULZp6iqsQzU6KNWYcxBUMnp8A2mwWxAhTPR0qRYFs6sDT+zTMZpWj5pO8L0wamexJ9xXvm10J27rrQ94dSdOqC0PSFXPV4JRuwRzIxGHMB38O14j4N9Wf4/vgDzpRGDwkNeQQAAAABJRU5ErkJggg==",axolotl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAP1BMVEUAAACvsv+zsPmmqv+nn/+GkPXWhCt+iOyBb+d1b/9odutodOyTWuRbb+NlZfS0W0xsV+JpVuNNWc82QZ86AGw+Ir4cAAAAAXRSTlMAQObYZgAAAUdJREFUeNrtk9FugzAMRXG4twFS1jbl/791cbJUQnuAmE2VKk5cKpDukeNA9zeAhP4mwDlgahdAEoDm1dAukIzmlXaB/HBcUGbQJCBkBejgkMrt3j5WeYGD0iAglkXkehVZFlBQ2b0FkKjtE2CjI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pkBtQWAWNAzTRfm/djzsgvsgbPaX5EyHm9CHCnwMOYd3uB/Ov600EOuHJee4VFvGx4GbDb2ImTq5eBWAHp8kkR5bzGBcDqOJqtYGcYhzSSXRjQvAbpvMaFW7h8NAW+kTVwRBfOnEkN0nldCPB5YCQAW3Th5ylQcQGKpr0EmtMapMCXogZPJFCQghXsR2kbD4blANmFeUB0IRgQ26FnndclAdkFKwdAdiH44YyQSD6JpSK70NjNa9DciTlnpBtFAe2UB8YwXcF9CTCxggErD8RvADLgkXiZRjzsMkK7jJcFVuN/5l7nm3icRCFjL4fJRdkuXPfngCi54uxP1hEzonQX4v7sRMLnMefhfpIwXrAFhXyw4P7/kgmYSeJwxJwAAAAASUVORK5CYII=",vex:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAMFBMVEUAAABthJtgeY9Ta4H////z+Pzg6fHG2eqivNWUrMOGn7eCl6t5kqp6j6RthJtgcoMKluMvAAAABHRSTlMAoKCgEjok+wAAAPlJREFUeNq1yL1Kw1AAhuE3hxYrRYm5gmivQL0Hwa1LnAtCFpdOjuKY4KBjfnYhIUPWEnIBhgxZRSjHC8hp3KWxkg5ndfD5pu8FDqNAKQkwKXIE9Fuj3zCQjECYDCaPs4tOQP9pDME4B1MAbIwTgJEwv2yixPcCPw2igGkcljlZ3YfP33WSJTB9yhG25HaJPLUBtkCdvl5fpVlVVRy3ntdQZW+eX6e77UIcNqAke0eq+JCgGvam4apoUGqtHtC067K9Q1O+l2WMJl9RvPAnl7+0L5Ao9NBB16GxZpZloTGFeWYC47l7DzrXcUF3sHTQjW9YoHMW4zn/5QeNK1xt8XQSVQAAAABJRU5ErkJggg==",villager:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAbFBMVEX///++iGy3gnKze2J6enpra2thYWFUVFRUU1NISElMODM9LSkAAAD///++iGy3gnKUj4m1e2eze2KBfXl/e3eja01vbWqQXkNjYmAAlhF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zZFJAwAeWYIorcACzE5KC4wBwDLYVgu24gwPeR57KlFHpN1XRsiZgehACKz2wUJ+xnOF7uu/1pcL77Kq6caZUD2/0ZFAk9zM9XrfYvrb1L1TPXvNbFnhwqQEPOKZbVKaZW0aWIpvy+bZVOypUYT7vFx9tGz9zOcFuDN/+gIHIEjcASOwBH44cB/1lQM4ZNhKecAAAAASUVORK5CYII="};A();E();R();x();import*as je from"three";var L1=class{constructor(e,t){this.object=e;this.animations=t;d(this,"timer",new je.Timer);d(this,"animatedObjects",new Set);d(this,"state")}createAnimationState(){let e=new je.AnimationMixer(this.object),t=new Map;for(let r of this.animations)t.set(r.name,e.clipAction(r));return this.state={mixer:e,animations:this.animations,actions:t,speed:1,loop:!0},this.object.traverse(r=>{if(r instanceof je.Mesh||r instanceof je.Line||r instanceof je.Points||r instanceof je.Sprite){let i=r.onBeforeRender;r.onBeforeRender=(s,o,l,a,v,c)=>{this.timer.update(performance.now());let u=this.timer.getDelta();e.update(u),i?.(s,o,l,a,v,c)}}}),this.animatedObjects.add(this.object),this.state}playAnimation(e,t,r){let i=this.state.actions.get(e);if(!i)return!1;this.state.mixer.stopAllAction();let s=t??this.state.loop;return i.setLoop(s?je.LoopRepeat:je.LoopOnce,1/0),i.clampWhenFinished=!s,r===void 0?i.timeScale=this.state.speed:i.timeScale=r,i.reset().fadeIn(.1).play(),!0}updateAnimationParams(e,t){e!==void 0&&(this.state.speed=e),t!==void 0&&(this.state.loop=t);for(let r of this.state.actions.values())e!==void 0&&(r.timeScale=e),t!==void 0&&(r.setLoop(t?je.LoopRepeat:je.LoopOnce,1/0),r.clampWhenFinished=!t)}stopAnimations(){this.state.mixer.stopAllAction()}getDelta(){return this.timer.update(performance.now()),this.timer.getDelta()}};function z3(n,e){let t=new L1(n,e);return t.createAnimationState(),t}A();E();R();x();import*as ze from"three";A();E();R();x();var U3=-Math.PI/2;function Pt(n){if(!n)return!1;let e=n.toLowerCase();return e==="boat"||e==="chest_boat"?!0:e.endsWith("_boat")||e.endsWith("_raft")}function V3(n){return Pt(n)?U3:null}var Uc=28/16,Vc=3/16,Gc=16/16,W3=-1.125,Nc=1.59375,Wc=0;var jc=0,Yc=1,D1="boat_water_patch",j3="boat_paddle_pivot_left",Y3="boat_paddle_pivot_right",Qc=new ze.Vector3(3/16,28/16,9/16),Kc=new ze.Vector3(3/16,28/16,-9/16),nS=new ze.Vector3(-6/16,1/16,0),qc=new ze.Vector3(-3/16,29/16,9/16),Jc=new ze.Vector3(-3/16,29/16,-9/16);var O1=new ze.Vector3;function Xc(n,e){O1.set(0,0,0);let t=n;for(;t&&t!==e;)O1.add(t.position),t=t.parent;return O1}function G3(n,e,t,r,i){if(i.length===0)return;let s=new ze.Object3D;s.name=e,s.position.copy(r),n.add(s);for(let o of i){let l=o.parent;if(!l)continue;let a=Xc(o,n);l.remove(o),o.position.copy(a).sub(t),s.add(o)}return s}function N3(n,e){let t=[];return n.traverse(r=>{r!==n&&r.name!==D1&&(r.name===j3||r.name===Y3||r.name===e&&t.push(r))}),t}function Zc(n){if(n.userData.boatPaddleLeftPivot||n.userData.boatPaddleRightPivot)return{leftPivot:n.userData.boatPaddleLeftPivot,rightPivot:n.userData.boatPaddleRightPivot};let e=G3(n,j3,Qc,qc,N3(n,"paddle_left")),t=G3(n,Y3,Kc,Jc,N3(n,"paddle_right"));return e&&(n.userData.boatPaddleLeftPivot=e),t&&(n.userData.boatPaddleRightPivot=t),{leftPivot:e,rightPivot:t}}function $c(){return new ze.BoxGeometry(Uc,Vc,Gc)}function e9(){return new ze.MeshBasicMaterial({colorWrite:!1,depthWrite:!0,depthTest:!0})}function t9(){let n=new ze.Mesh($c(),e9());return n.name=D1,n.position.set(0,Nc,Wc),n.renderOrder=Yc,n}function r9(n){n.traverse(e=>{if(!(e instanceof ze.Mesh)||e.name===D1)return;let t=Array.isArray(e.material)?e.material:[e.material];for(let r of t)r instanceof ze.Material&&(r.transparent=!1,r.depthWrite=!0,r.depthTest=!0,"alphaTest"in r&&(r.alphaTest=Math.max(r.alphaTest??0,.1)),r.needsUpdate=!0);e.renderOrder=jc})}function Q3(n){r9(n),Zc(n);let e=n.userData.boatWaterPatch;return e||(e=t9(),e.visible=!1,n.add(e),n.userData.boatWaterPatch=e),{waterPatch:e}}function K3(n){let e=n.userData.boatWaterPatch;e&&(e.geometry.dispose(),e.material instanceof ze.Material&&e.material.dispose(),delete n.userData.boatWaterPatch)}A();E();R();x();var q3={horse:1.1,donkey:.87,mule:.92,skeleton_horse:1,zombie_horse:1};A();E();R();x();import*as vr from"three";var F1={x:0,y:1.25,z:-.75},J3=vr.MathUtils.degToRad(20),t5=.05,n9=new Set(["Head","UMouth","Ear1","Ear2","MuleEarL","MuleEarR","Neck","Mane","SaddleMouthL","SaddleMouthR","SaddleMouthLine","SaddleMouthLineR","HeadSaddle"]),Zt="_horseHeadRig",r5="_horseHeadAnimation";function X3(n){let e=n.userData[Zt];if(e)return e;let t=[];n.traverse(i=>{i!==n&&n9.has(i.name)&&t.push(i)});let r=new vr.Group;r.name="horse_head_rig",r.position.set(F1.x,F1.y,F1.z),r.userData.horseHeadParts=t,n.add(r);for(let i of t)r.attach(i);return n.userData[Zt]=r,r}function i9(n,e){let t=Math.PI*2,r=((e-n+Math.PI)%t+t)%t-Math.PI;return r===-Math.PI?Math.PI:r}function Z3(n){let{entityPitch:e,headYaw:t,bodyYaw:r,limbSwing:i,limbSwingAmount:s}=n,o=Number.isFinite(s)?Math.max(0,s):0,l=o>.2?Math.cos(i*.4)*.15*o:0,a=vr.MathUtils.clamp(i9(r,t),-J3,J3);return{pitch:(Number.isFinite(e)?e:0)-l,yaw:a}}function $3(){return{prevLimbSwing:0,limbSwing:0,prevLimbSwingAmount:0,limbSwingAmount:0,elapsedSeconds:t5,tickAccumulatorSeconds:0}}function e6(n,e){n.pendingPosition={x:e.x,z:e.z}}function s9(n,e){n.prevLimbSwing=n.limbSwing,n.prevLimbSwingAmount=n.limbSwingAmount;let t=n.lastPosition==null?0:Math.hypot(e.x-n.lastPosition.x,e.z-n.lastPosition.z),r=Math.min(1,t*4);n.limbSwingAmount+=(r-n.limbSwingAmount)*.4,n.limbSwing+=n.limbSwingAmount,n.lastPosition={x:e.x,z:e.z}}function o9(n,e){let t=vr.MathUtils.clamp(e,0,1);return{limbSwing:n.prevLimbSwing+(n.limbSwing-n.prevLimbSwing)*t,limbSwingAmount:n.prevLimbSwingAmount+(n.limbSwingAmount-n.prevLimbSwingAmount)*t}}function t6(n,e){let t=Math.max(0,e);for(n.elapsedSeconds=Math.min(t5,n.elapsedSeconds+t),n.tickAccumulatorSeconds+=t;n.tickAccumulatorSeconds>=t5;){let r=n.pendingPosition??n.lastPosition;r&&s9(n,r),n.pendingPosition=void 0,n.tickAccumulatorSeconds-=t5}return n.elapsedSeconds=n.tickAccumulatorSeconds,o9(n,n.elapsedSeconds/t5)}function r6(n,e){n.rotation.set(e.pitch,e.yaw,0)}function h9(n){return"parts"in n&&Array.isArray(n.parts)?n.parts:[n]}var f9={up:{dir:[0,1,0],u0:[0,0,1],v0:[0,0,0],u1:[1,0,1],v1:[0,0,1],corners:[[0,1,1,0,0],[1,1,1,1,0],[0,1,0,0,1],[1,1,0,1,1]]},down:{dir:[0,-1,0],u0:[1,0,1],v0:[0,0,0],u1:[2,0,1],v1:[0,0,1],corners:[[1,0,1,0,0],[0,0,1,1,0],[1,0,0,0,1],[0,0,0,1,1]]},east:{dir:[1,0,0],u0:[0,0,0],v0:[0,0,1],u1:[0,0,1],v1:[0,1,1],corners:[[1,1,1,0,0],[1,0,1,0,1],[1,1,0,1,0],[1,0,0,1,1]]},west:{dir:[-1,0,0],u0:[1,0,1],v0:[0,0,1],u1:[1,0,2],v1:[0,1,1],corners:[[0,1,0,0,0],[0,0,0,0,1],[0,1,1,1,0],[0,0,1,1,1]]},north:{dir:[0,0,-1],u0:[0,0,1],v0:[0,0,1],u1:[1,0,1],v1:[0,1,1],corners:[[1,0,0,0,1],[0,0,0,1,1],[1,1,0,0,0],[0,1,0,1,0]]},south:{dir:[0,0,1],u0:[1,0,2],v0:[0,0,1],u1:[2,0,2],v1:[0,1,1],corners:[[0,0,1,0,1],[1,0,1,1,1],[0,1,1,0,0],[1,1,1,1,0]]}};function n6(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function m9(n,e,t,r,i=!1,s=64,o=64,l=!1,a=[]){let v=new re.Euler(0,0,0);r.rotation&&(v.x=-r.rotation[0]*Math.PI/180,v.y=-r.rotation[1]*Math.PI/180,v.z=-r.rotation[2]*Math.PI/180);for(let{dir:c,corners:u,u0:h,v0:p,u1:m,v1:b}of Object.values(f9)){let k=Math.floor(n.positions.length/3),_=c[0]!==0,y=[];for(let M of u){let T,S;i?(T=(r.uv[0]+M[3]*r.size[0])/s,S=(r.uv[1]+M[4]*r.size[1])/o):(T=(r.uv[0]+n6(M[3]?m:h,r.size))/s,S=(r.uv[1]+n6(M[4]?b:p,r.size))/o);let B=_&&l?M[0]^1:M[0],P=M[1],H=_&&l?M[2]^1:M[2],V=r.inflate??0,z=new re.Vector3(r.origin[0]+B*r.size[0]+(B?V:-V),r.origin[1]+P*r.size[1]+(P?V:-V),r.origin[2]+H*r.size[2]+(H?V:-V));z=z.applyEuler(v),z=z.sub(t.position),z=z.applyEuler(t.rotation),z=z.add(t.position),n.positions.push(z.x,z.y,z.z),n.normals.push(c[0],c[1],c[2]),y.push(T,S),n.skinIndices.push(e,0,0,0),n.skinWeights.push(1,0,0,0)}if(l)for(let M=0;M+1<u.length;M+=2){let T=M*2,S=y.slice(T,T+4);y[T]=S[2],y[T+1]=S[_?1:3],y[T+2]=S[0],y[T+3]=S[_?3:1]}n.uvs.push(...y),n.indices.push(k,k+1,k+2,k+2,k+1,k+3)}}function $t(n,e,t,r={},i={}){let s=t.texturewidth??64,o=t.textureheight??64,l,a=e.startsWith("block:"),v=n?.material.map;if(a){if(!n)throw new Error("worldRenderer is required for block textures");let y=e.slice(6),M=n.resourcesManager.currentResources.blocksAtlasJson.textures[y];M&&(s=v?.image.width??s,o=v?.image.height??o,l=[M.u,M.v])}let c={},u={positions:[],normals:[],uvs:[],indices:[],skinIndices:[],skinWeights:[]},h=0;for(let y of t.bones){let M=new re.Bone;if(y.pivot&&(M.position.x=y.pivot[0],M.position.y=y.pivot[1],M.position.z=y.pivot[2]),y.bind_pose_rotation?(M.rotation.x=-y.bind_pose_rotation[0]*Math.PI/180,M.rotation.y=-y.bind_pose_rotation[1]*Math.PI/180,M.rotation.z=-y.bind_pose_rotation[2]*Math.PI/180):y.rotation&&(M.rotation.x=-y.rotation[0]*Math.PI/180,M.rotation.y=-y.rotation[1]*Math.PI/180,M.rotation.z=-y.rotation[2]*Math.PI/180),r.rotation?.[y.name]&&(M.rotation.x-=(r.rotation[y.name].x??0)*Math.PI/180,M.rotation.y-=(r.rotation[y.name].y??0)*Math.PI/180,M.rotation.z-=(r.rotation[y.name].z??0)*Math.PI/180),M.name=`bone_${y.name}`,c[y.name]=M,y.cubes)for(let T of y.cubes){let S=[];m9(u,h,M,T,a,s,o,y.mirror,S),S.length&&(i.errors??(i.errors=[]),i.errors.push(...S.map(B=>`Bone ${y.name}: ${B}`)))}h++}let p=[];for(let y of t.bones)y.parent&&c[y.parent]?c[y.parent].add(c[y.name]):p.push(c[y.name]);let m=new re.Skeleton(Object.values(c)),b=new re.BufferGeometry;b.setAttribute("position",new re.Float32BufferAttribute(u.positions,3)),b.setAttribute("normal",new re.Float32BufferAttribute(u.normals,3)),b.setAttribute("uv",new re.Float32BufferAttribute(u.uvs,2)),b.setAttribute("skinIndex",new re.Uint16BufferAttribute(u.skinIndices,4)),b.setAttribute("skinWeight",new re.Float32BufferAttribute(u.skinWeights,4)),b.setIndex(u.indices);let k=new re.MeshLambertMaterial({transparent:!0,alphaTest:.1,side:re.DoubleSide}),_=new re.SkinnedMesh(b,k);if(_.add(...p),_.bind(m),_.scale.set(1/16,1/16,1/16),l){let y=v.clone();y.offset.set(l[0],l[1]),y.needsUpdate=!0,k.map=y}else z5(e,y=>{k.map||(y.magFilter=re.NearestFilter,y.minFilter=re.NearestFilter,y.flipY=!1,y.wrapS=re.RepeatWrapping,y.wrapT=re.RepeatWrapping,k.map=y)},()=>{let y=k.map;if(!y)return;let M=y.image.width;M&&s!==M&&(y.repeat.x=s/M);let T=y.image.height;T&&o!==T&&(y.repeat.y=o/T),k.needsUpdate=!0});return _}var p9=[{pattern:"furnace_minecart",target:"minecart"},{pattern:"spawner_minecart",target:"minecart"},{pattern:"chest_minecart",target:"minecart"},{pattern:"hopper_minecart",target:"minecart"},{pattern:"command_block_minecart",target:"minecart"},{pattern:"tnt_minecart",target:"minecart"},{pattern:"glow_item_frame",target:"item_frame"},{pattern:"glow_squid",target:"squid"},{pattern:"trader_llama",target:"llama"},{pattern:"chest_boat",target:"boat"},{pattern:"spectral_arrow",target:"arrow"},{pattern:"husk",target:"zombie"},{pattern:"zombie_horse",target:"horse"},{pattern:"donkey",target:"horse"},{pattern:"skeleton_horse",target:"horse"},{pattern:"mule",target:"horse"},{pattern:"ocelot",target:"cat"},{pattern:/_minecraft$/,target:"minecraft"},{pattern:/_boat$/,target:"boat"},{pattern:/_raft$/,target:"boat"},{pattern:/_horse$/,target:"horse"},{pattern:/_zombie$/,target:"zombie"},{pattern:/_arrow$/,target:"zombie"}];function i6(n){for(let e of p9)if(typeof e.pattern=="string"){if(e.pattern===n)return e.target}else if(e.pattern.test(n))return e.target}var s6=n=>t3[n],o6={...q3,zombie:1.85,husk:1.85,arrow:.0025},a6={zombie:new hn(0,1,0),husk:new hn(0,1,0),boat:new hn(0,W3,0),arrow:new hn(0,-.9,0)},Gt=class{constructor(e,t,r,i={},s={}){d(this,"mesh");d(this,"animations");d(this,"animationControllers",[]);let o=t,l=i6(t);if(l&&(t=l,s.tempMap=l),i.customModel){let v=h9(i.customModel);this.mesh=new re.Object3D;for(let c=0;c<v.length;c++){let{modelPath:u,modelType:h,metadata:p}=v[c],m=new re.Object3D;switch(m.name=`custom_part_${c}`,h){case"gltf":{new a9().parseAsync(u,"").then(k=>{if(m.add(k.scene),p?.scale){let _=p.scale;m.scale.set(_,_,_)}if(p?.offset){let{x:_=0,y=0,z:M=0}=p.offset;m.position.set(_,y,M)}if(p?.texture){let _=Z0(p.texture);m.traverse(y=>{y instanceof re.Mesh&&(y.material=new re.MeshBasicMaterial({map:_,transparent:!0,alphaTest:.1}))})}if(k.animations?.length){this.animations=[...this.animations??[],...k.animations];let _=z3(m,k.animations);this.animationControllers.push(_);let y=p?.animation,M=p?.animationLoop??!0;y?_.playAnimation(y,M):_.playAnimation(k.animations[0].name,M)}}).catch(k=>{});break}case"obj":{let k=new ar().parse(u);if(p?.scale){let{scale:_}=p;k.scale.set(_,_,_)}if(p?.offset){let{x:_=0,y=0,z:M=0}=p.offset;k.position.set(_,y,M)}if(p?.texture){let _=Z0(p.texture),y=new re.MeshBasicMaterial({map:_,transparent:!0,alphaTest:.1});k.traverse(M=>{M instanceof re.Mesh&&(M.material=y)})}m.add(k);break}case"bedrock":{let b=JSON.parse(u);if(p?.scale&&m.scale.set(p.scale,p.scale,p.scale),p?.offset){let{x:k=0,y:_=0,z:y=0}=p.offset;m.position.set(k,_,y)}for(let[k,_]of Object.entries(b.geometry)){let y=p?.textures?.[k]??b.textures?.[k];if(!y)continue;let M=$t(r,y.endsWith(".png")||y.startsWith("data:image/")||y.startsWith("block:")?y:y+".png",_,i,s);M.name=`geometry_${k}`,m.add(M)}break}}this.mesh.add(m)}s.type=v.length===1?v[0].modelType:"special";return}if(lr[t]){let v=new ar,c={zombie_horse:`textures/${e}/entity/horse/horse_zombie.png`,husk:l9,skeleton_horse:`textures/${e}/entity/horse/horse_skeleton.png`,donkey:`textures/${e}/entity/horse/donkey.png`,mule:`textures/${e}/entity/horse/mule.png`,ocelot:v9,arrow:c9,spectral_arrow:d9,tipped_arrow:u9},u=c[o]||c[t];u&&(s.textureMap=!0);let h=u||H1[t];if(H1[t]&&(s.isHardcodedTexture=!0),!h)throw new Error(`No texture for ${t}`);let p=Z0(h),m=new re.MeshBasicMaterial({map:p,transparent:!0,alphaTest:.1}),b=v.parse(lr[t]),k=o6[o]||o6[t];k&&b.scale.set(k,k,k);let _=a6[o]??a6[t];_&&b.position.set(_.x,_.y,_.z),b.traverse(y=>{y instanceof re.Mesh&&(y.material=m,y.name==="Head layer"&&(y.visible=!1),t!=="horse"&&y.name==="Head"&&i.rotation?.head&&(y.rotation.x-=(i.rotation.head.x??0)*Math.PI/180,y.rotation.y-=(i.rotation.head.y??0)*Math.PI/180,y.rotation.z-=(i.rotation.head.z??0)*Math.PI/180))}),t==="horse"&&X3(b),this.mesh=b,s.type="obj";return}let a=s6(t);if(a){this.mesh=new re.Object3D;for(let[v,c]of Object.entries(a.geometry)){let u=i.textures?.[v]??a.textures[v];if(!u)continue;let h=$t(r,u.endsWith(".png")||u.startsWith("data:image/")||u.startsWith("block:")?u:u+".png",c,i,s);h.name=`geometry_${v}`,this.mesh.add(h)}s.type="bedrock"}}playAnimation(e,t=!1){if(!this.animationControllers.length)return;let r=!1;for(let i of this.animationControllers)i.playAnimation(e,t)&&(r=!0)}update(e){}static getStaticData(e){if(e=i6(e)||e,lr[e])return{boneNames:[]};let t=s6(e);if(!t)throw new Error(`Unknown entity ${e}`);return{boneNames:Object.values(t.geometry).flatMap(r=>r.name)}}};globalThis.EntityMesh=Gt;A();E();R();x();var l6=105*Math.PI/180;function v6(n,e){let t=e-n;for(;t>Math.PI;)t-=Math.PI*2;for(;t<-Math.PI;)t+=Math.PI*2;return t}function b9(n){return v6(0,n)}function y9(n){return Math.max(-l6,Math.min(l6,n))}function fn(n){let{cameraYaw:e,cameraPitch:t,vehicleYaw:r}=n,i=v6(r,e),s=y9(i),o=b9(r+s);return{bodyYaw:r,headYaw:s,headPitch:-t,effectiveCameraYaw:o}}function z1(n){return n.isAnchoredPassenger&&Pt(n.vehicleName)&&typeof n.vehicleYaw=="number"&&Number.isFinite(n.vehicleYaw)}function c6(n){return n.isThirdPerson&&z1(n)}A();E();R();x();import*as cr from"three";var _9=Math.PI/8,w9=20,A9=_9*w9;function p6(){return{current:new cr.Quaternion,rest:new cr.Quaternion,delta:new cr.Quaternion,euler:new cr.Euler(0,0,0,"ZYX")}}function g6(){return{leftActive:!1,rightActive:!1,leftPhase:0,rightPhase:0}}function d6(n,e,t){return n+(e-n)*t}function u6(n,e,t){if(!e)return 0;let r=Number.isFinite(t)&&t>=0?t:0,i=Math.PI*2;return(n+r*A9)%i}function h6(n,e){let t=d6(-Math.PI/3,-Math.PI/12,(Math.sin(-n)+1)/2),r=d6(-Math.PI/4,Math.PI/4,(Math.sin(-n+1)+1)/2);e===1&&(r=Math.PI-r);let i=Math.PI/16;return{xRot:t,yRot:r,zRot:i}}function f6(n,e,t){return t.set(-n.xRot,n.yRot,-n.zRot,"ZYX"),e.setFromEuler(t)}function E9(n,e,t){return n===0?t.delta.identity():(f6(h6(n,e),t.current,t.euler),f6(h6(0,e),t.rest,t.euler),t.delta.copy(t.current).multiply(t.rest.invert()))}function m6(n,e,t,r){n.quaternion.copy(E9(e,t,r))}function b6(n,e,t){n.leftActive!==e&&(n.leftActive=e,n.leftPhase=0),n.rightActive!==t&&(n.rightActive=t,n.rightPhase=0)}function y6(n,e,t,r,i){n.leftPhase=u6(n.leftPhase,n.leftActive,e),n.rightPhase=u6(n.rightPhase,n.rightActive,e),t&&m6(t,n.leftPhase,0,i),r&&m6(r,n.rightPhase,1,i)}A();E();R();x();function _6(n){return n==="horse"}function mn(n){return n!=null&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z)}function w6(n,e,t){var r;mn(e)&&(n.userData._posTween?.stop(),n.userData._posTween=void 0,(r=n.userData)._tweenTarget??(r._tweenTarget={...e}),Object.assign(n.userData._tweenTarget,e),n.position.set(e.x,e.y,e.z),n.userData._passengerVehicleId=t,delete n.userData._boatPassengerVehicleId)}function pn(n,e,t){var i;return(n.userData._passengerVehicleId??n.userData._boatPassengerVehicleId)!==e?!1:(n.userData._posTween?.stop(),n.userData._posTween=void 0,t&&((i=n.userData)._tweenTarget??(i._tweenTarget={...t}),Object.assign(n.userData._tweenTarget,t)),delete n.userData._passengerVehicleId,delete n.userData._boatPassengerVehicleId,!0)}A();E();R();x();A();E();R();x();var x9=50,U1=120,R9=150,k9=1e-4;function V1(n){return!!n?.renderHints?.localVehicle}function A6(n){return n?.localVehicleYawLock==="horse"}function E6(n,e){return Number.isFinite(e)?(n.rotation.y=e,n.userData._horseBodyYaw=e,n.userData._horseHeadYaw=e,!0):!1}function G1(n,e){return e||V1(n)?0:U1}function x6(n,e){return G1(n,e)}function S9(n,e,t=k9){return Math.abs(n.x-e.x)<t&&Math.abs(n.y-e.y)<t&&Math.abs(n.z-e.z)<t}function R6(n,e=!1){if(e)return 0;switch(n){case"spectating":return R9;case"server-vehicle":return U1;case"local-player":default:return x9}}function k6(n){return n.instant||n.currentTarget==null||n.movementMode!==n.previousMovementMode?!0:!S9(n.target,n.currentTarget)}function T9(n,e){return{x:n.x,y:e,z:n.z}}function S6(n){let{cameraWorldPos:e,rawVehicleY:t,eyeHeight:r,vehicleName:i,vehicleHeight:s,verticalCameraLock:o}=n;if(o==="horse"){let l=e.y-r-P6(i,s);if(Number.isFinite(l))return{x:e.x,y:l,z:e.z}}return T9(e,t)}var M9=new Set(["minecart","chest_minecart","furnace_minecart","hopper_minecart","tnt_minecart","spawner_minecart","command_block_minecart"]),C9=new Set(["horse","donkey","mule","skeleton_horse","zombie_horse"]);function T6(n){return n?C9.has(n):!1}function gn(n){return n?M9.has(n):!1}function B9(n,e){return e<=1?0:n===0?.2:-.6}var P9=.5625,I9=.7,H9=-.35,L9=-.1,O9=0,D9=-.6,F9=.1875,z9=1/3,U9=.8888889;function M6(n,e,t,r){let i=Number.isFinite(r)?r:n==="boat"?P9:I9;if(zi(e)>=zi("1.20.2")){let o=typeof t=="string"&&t.toLowerCase().endsWith("_raft");return(n==="boat"?i*(o?U9:z9):F9)+D9}return(n==="boat"?L9:O9)+H9}function C6(n,e,t,r,i,s,o){let l=B9(t,r);return{x:n.x-Math.sin(e)*l,y:n.y+M6("boat",i,s,o),z:n.z+Math.cos(e)*l}}function B6(n,e,t,r){return{x:n.x,y:n.y+M6("minecart",e,t,r),z:n.z}}function P6(n,e){let t=0;return n==="donkey"||n==="mule"?t=.25:n==="skeleton_horse"&&(t=.1875),e*.75-t-.35}function I6(n,e,t=1.6){return{x:n.x,y:n.y+P6(e,t),z:n.z}}function H6(n){let e=new Set;for(let t of Object.values(n.entities)){let r=t,i=r.userData.renderHints,s=i?.passengerIds??i?.boatPassengerIds;if(!Array.isArray(s)||s.length===0)continue;let o=r.realName??r.originalEntity.name,l=i?.passengerLayout??(Pt(o)?"boat":void 0);if(l!=="boat"&&l!=="minecart"&&l!=="horse"||l==="boat"&&!Pt(o)||l==="minecart"&&!gn(o)||l==="horse"&&!T6(o))continue;let a=n.getWorldPosition(r);if(!mn(a))continue;let v=String(r.originalEntity.id);for(let[c,u]of s.entries()){let p=u===n.localPlayer?.originalEntity.id?n.localPlayer:n.entities[u];if(!p?.playerObject||p===n.localPlayer&&_6(l))continue;let m=l==="minecart"?B6(a,n.version,o,r.originalEntity.height):l==="horse"?I6(a,o,r.originalEntity.height??1.6):C6(a,r.rotation.y,c,s.length,n.version,o,r.originalEntity.height);mn(m)&&(w6(p,m,v),e.add(p))}}for(let t of[...Object.values(n.entities),...n.localPlayer?[n.localPlayer]:[]]){let r=t.userData._passengerVehicleId??t.userData._boatPassengerVehicleId;r===void 0||e.has(t)||pn(t,r,n.getWorldPosition(t))}return e}A();E();R();x();function L6(n,e){typeof e=="number"&&Number.isFinite(e)&&(n._networkHeadPitch=e)}function N1(n,e,t){if(typeof e=="number"&&Number.isFinite(e)){n._networkHeadYaw=e;return}typeof t=="number"&&Number.isFinite(t)&&(n._networkHeadYaw=t)}function O6(n){let e=n._networkHeadPitch;return typeof e=="number"&&Number.isFinite(e)?e:0}function bn(n,e){let t=e._networkHeadPitch;typeof t!="number"||!Number.isFinite(t)||(n.skin.head.rotation.y=0,n.skin.head.rotation.x=-t)}function D6(n,e){n.skin.head.rotation.y=0,bn(n,e)}A();E();R();x();function F6(n){return n._passengerVehicleId??n._boatPassengerVehicleId}function z6(n){n._rotTween?.stop(),n._rotTween=void 0}function V9(n){let{passenger:e,networkHeadYaw:t,vehicleYaw:r}=n,i=e.playerObject;if(!i)return;z6(e.userData);let s=fn({cameraYaw:t,cameraPitch:O6(e.userData),vehicleYaw:r});e.rotation.set(0,s.bodyYaw,0),i.skin.head.rotation.set(s.headPitch,s.headYaw,0),e.userData._remoteBoatRotationApplied=!0}function G9(n){let e=n.playerObject;if(!e)return;z6(n.userData);let t=n.userData._networkHeadYaw;typeof t=="number"&&Number.isFinite(t)&&n.rotation.set(0,t,0),D6(e,n.userData),n.userData._remoteBoatRotationApplied=!1}function N9(n){let{passenger:e,vehicle:t,syncArmor:r}=n;if(!e.playerObject)return;let i=e.userData,s=i._remoteBoatRotationApplied===!0,o=F6(i),l=t?.realName??t?.originalEntity.name,a=t?.rotation.y;if(!z1({isAnchoredPassenger:o!=null&&t!=null,vehicleName:l,vehicleYaw:a})){s&&(G9(e),r?.());return}let c=i._networkHeadYaw;typeof c!="number"||!Number.isFinite(c)||(V9({passenger:e,vehicle:t,vehicleYaw:a,networkHeadYaw:c}),r?.())}function U6(n){for(let e of Object.values(n.entities)){if(!e?.playerObject)continue;let t=F6(e.userData),r=t!=null?n.entities[t]:void 0;N9({passenger:e,vehicle:r,syncArmor:e.visible?()=>n.syncArmor(e):void 0})}}A();E();R();x();import{default as j9}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_1.png";import{default as Y9}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_2.png";import{default as Q9}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_1.png";import{default as K9}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_2.png";import{default as q9}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_1.png";import{default as J9}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_2.png";import{default as X9}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_1.png";import{default as Z9}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_2.png";import{default as $9}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1.png";import{default as ed}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1_overlay.png";import{default as td}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2.png";import{default as rd}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2_overlay.png";import{default as nd}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_1.png";import{default as id}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_2.png";import{default as sd}from"mc-assets/dist/other-textures/latest/models/armor/turtle_layer_1.png";import{default as G6}from"mc-assets/dist/other-textures/latest/entity/elytra.png";var e0={skull:{bones:[{name:"head",pivot:[0,12,0],cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[0,0],inflate:1}]},{name:"overlay",parent:"head",pivot:[0,12,0],cubes:[{origin:[-4,0,-4],size:[8,8,8],uv:[32,0],inflate:1.2}]}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},head:{bones:[{name:"armor",pivot:[0,12,0]},{name:"head",parent:"armor",pivot:[0,12,0],cubes:[{origin:[-4,23,-4],size:[8,8,8],uv:[0,0],inflate:1}]},{name:"overlay",parent:"head",pivot:[0,12,0],cubes:[{origin:[-4,23,-4],size:[8,8,8],uv:[32,0],inflate:1.2}]}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},chest:{bones:[{name:"armor",pivot:[0,12,0]},{name:"body",parent:"armor",pivot:[0,13,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16],inflate:1}]},{name:"leftarm",parent:"armor",pivot:[5,10,0],cubes:[{origin:[4,12,-2],size:[4,12,4],uv:[40,16],inflate:.85}]},{name:"rightarm",parent:"armor",pivot:[-5,10,0],cubes:[{origin:[-8,12,-2],size:[4,12,4],uv:[40,16],inflate:.85}],mirror:!0}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},legs:{bones:[{name:"armor",pivot:[0,12,0]},{name:"body",parent:"armor",pivot:[0,13,0],cubes:[{origin:[-4,12,-2],size:[8,12,4],uv:[16,16],inflate:.5}]},{name:"leftleg",parent:"armor",pivot:[1.9,1,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16],inflate:.5}]},{name:"rightleg",parent:"armor",pivot:[-1.9,1,0],cubes:[{origin:[-3.9,0,-2.01],size:[4,12,4],uv:[0,16],inflate:.5}],mirror:!0}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32},feet:{bones:[{name:"armor",pivot:[0,12,0]},{name:"leftleg",parent:"armor",pivot:[1.9,1,0],cubes:[{origin:[-.1,0,-2],size:[4,12,4],uv:[0,16],inflate:.8}]},{name:"rightleg",parent:"armor",pivot:[-1.9,1,0],cubes:[{origin:[-3.9,.01,-2.01],size:[4,12,4],uv:[0,16],inflate:.8}],mirror:!0}],visible_bounds_width:1.5,visible_bounds_offset:[0,.5,0],texturewidth:64,textureheight:32}};var V6={leather_layer_1:$9,leather_layer_1_overlay:ed,leather_layer_2:td,leather_layer_2_overlay:rd,chainmail_layer_1:j9,chainmail_layer_2:Y9,iron_layer_1:X9,iron_layer_2:Z9,diamond_layer_1:Q9,diamond_layer_2:K9,golden_layer_1:q9,golden_layer_2:J9,netherite_layer_1:nd,netherite_layer_2:id,turtle_layer_1:sd};var q6=X0(lt);var W1=n=>n*(Math.PI/180);function od(n){return n<0&&(n=4294967295+n+1>>>0),n.toString(16)}function ad(n){if(n===void 0)return;if(parseInt(n,10)===0)return"rgba(0, 0, 0, 0)";let e=od(parseInt(n,10));return e.length===8?`#${e.slice(2,8)}${e.slice(0,2)}`:`#${e}`}function N6(n,e){return n===void 0?e:n instanceof j.Quaternion?n:Array.isArray(n)?new j.Quaternion(n[0],n[1],n[2],n[3]):new j.Quaternion(n.x,n.y,n.z,n.w)}function It(n,e){return n===void 0?e??new j.Euler:n instanceof j.Euler?n:n.yaw!==void 0&&n.pitch!==void 0&&n.roll!==void 0?new j.Euler(-W1(n.pitch),-W1(n.yaw),W1(n.roll),"ZYX"):n.x!==void 0&&n.y!==void 0&&n.z!==void 0?new j.Euler(n.z,n.y,n.x,"ZYX"):Array.isArray(n)?new j.Euler(n[0],n[1],n[2]):e??new j.Euler}var yn=Math.PI*2;function ld(n,e){let t=((e-n)%yn+yn)%yn;return t>Math.PI?t-yn:t}function vd(n,e,t,r,i){let s=e==="speaking"?"#3ddc47":e==="muted"?"#ff5555":"#cfcfcf";n.save(),n.translate(t,r),n.fillStyle=s,n.strokeStyle=s,n.lineWidth=Math.max(1.5,i*.09),n.lineCap="round";let o=i*.22,l=i*.34,a=i*.24,v=-i*.44;n.beginPath(),n.moveTo(v,-l/2),n.lineTo(v+o,-l/2),n.lineTo(v+o+a,-i*.5),n.lineTo(v+o+a,i*.5),n.lineTo(v+o,l/2),n.lineTo(v,l/2),n.closePath(),n.fill();let c=v+o+a;e==="speaking"&&(n.beginPath(),n.arc(c+i*.06,0,i*.16,-Math.PI*.32,Math.PI*.32),n.stroke(),n.beginPath(),n.arc(c+i*.06,0,i*.28,-Math.PI*.28,Math.PI*.28),n.stroke()),e==="muted"&&(n.beginPath(),n.moveTo(-i*.46,-i*.46),n.lineTo(i*.46,i*.46),n.stroke()),n.restore()}function J6({username:n,nameTagBackgroundColor:e="rgba(0, 0, 0, 0.3)",nameTagTextOpacity:t=255,voiceState:r},{fontFamily:i="mojangles"},s){let o=Ne(64,64),l=K6(s),a=o.getContext("2d");if(!a)throw new Error("Could not get 2d context");let v=48,c=5;a.font=`${v}px ${i}`;let u=String(typeof n=="string"?n:new l(n).toString()).split(`
21505
+ `),h=0;for(let S of u){let B=a.measureText(S).width+c*2;B>h&&(h=B)}let p=(v+c)*u.length,m=Ne(h,p),b=m.getContext("2d");if(!b)throw new Error("Could not get 2d context");if(b.globalAlpha=t/255,!S1(n,l,m,v,"white",-c+v))return;b.globalAlpha=1;let _=v*.85,y=r?_+c*2.5:0,M=Ne(y*2+h,p),T=M.getContext("2d");if(!T)throw new Error("Could not get 2d context");return T.fillStyle=e,T.fillRect(0,0,y+h,M.height),r&&vd(T,r,y/2,M.height/2,_),T.drawImage(m,y,0),M}globalThis.getUsernameTexture=J6;var s5=(n,e,t,r)=>{for(let a of t.children)a.name==="nametag"&&a.removeFromParent();if(n.username===void 0||n.username===null||(typeof n.username=="string"?n.username:new(K6(r))(n.username).toString()).startsWith("EMPTY"))return;let s=J6(n,e,r);if(!s)return;let o=new j.Texture(s);o.needsUpdate=!0;let l;if(n.nameTagFixed){let a=new j.PlaneGeometry,v=new j.MeshBasicMaterial({map:o});v.transparent=!0,l=new j.Mesh(a,v),l.rotation.set(n.pitch,j.MathUtils.degToRad(n.yaw+180),0),l.position.y+=n.height+.3}else{let a=new j.SpriteMaterial({map:o});l=new j.Sprite(a),l.position.y+=n.height+.6}return l.renderOrder=1e3,l.scale.set(s.width*.005,s.height*.005,1),n.nameTagRotationRight&&l.applyQuaternion(n.nameTagRotationRight),n.nameTagScale&&l.scale.multiply(n.nameTagScale),n.nameTagRotationLeft&&l.applyQuaternion(n.nameTagRotationLeft),n.nameTagTranslation&&l.position.add(n.nameTagTranslation),l.name="nametag",t.add(l),l};function W6(n,e){n&&(n.position.y=e.position.y+e.scale.y*16+3,n.scale.multiplyScalar(12))}var j6={},cd=n=>n.charAt(0)===n.charAt(0).toUpperCase();function Y6(n){if(n!=null){if(Array.isArray(n))return n;if(typeof n=="object"){let e=n,t=Object.keys(e).filter(r=>/^\d+$/.test(r)).map(Number).sort((r,i)=>r-i);if(t.length&&t[0]===0&&t.every((r,i)=>r===i))return t.map(r=>e[String(r)])}}}function dd(n,e,t,r,i){if(e.name)try{let v=(cd(e.name)?R1(e.name):e.name).toLowerCase(),c=new Gt("1.16.4",v,t,i);if(c.mesh)return s5(e,r,c.mesh,t.version),c.mesh}catch(v){reportError?.(v)}if(!n||!(0,Q6.isEntityAttackable)(n,e))return;let s=new j.BoxGeometry(e.width,e.height,e.width);s.translate(0,e.height/2,0);let o=new j.MeshBasicMaterial({color:16711935}),l=new j.Mesh(s,o);return(j6[e.name]=(j6[e.name]||0)+1)<6&&s5({username:e.name,height:e.height},r,l,t.version),l}var wn=class{constructor(e,t){this.worldRenderer=e;this.mcData=t;d(this,"entities",{});d(this,"playerEntity",null);d(this,"entitiesOptions",{fontFamily:"mojangles"});d(this,"debugMode");d(this,"onSkinUpdate");d(this,"clock",new j.Timer);d(this,"currentlyRendering",!0);d(this,"cachedMapsImages",{});d(this,"itemFrameMaps",{});d(this,"pendingModelOverrides",new Map);d(this,"boatPaddleScratch",p6());d(this,"playerVoiceStates",{});d(this,"uuidPerSkinUrlsCache",{});d(this,"currentSkinUrls",{});d(this,"loadedSkinEntityIds",new Set);this.debugMode="none",this.onSkinUpdate=()=>{},this.watchResourcesUpdates()}get entitiesByName(){let e={};for(let t of Object.values(this.entities))t.realName&&(e[t.realName]=e[t.realName]||[],e[t.realName].push(t));return e}get entitiesRenderingCount(){return Object.values(this.entities).filter(e=>e.visible).length}getDebugString(){let e=Object.keys(this.entities).length,t=this.entitiesRenderingCount,r=Object.values(this.entities).filter(s=>s.playerObject),i=r.filter(s=>s.visible);return`${t}/${e} ${i.length}/${r.length}`}handlePlayerEntity(e){if(this.isRenderingAllowed()){if(!this.playerEntity){let t=new j.Group;t.originalEntity={...e,name:"player"};let r=new j.Group,i=this.setupPlayerObject(e,r,{});t.playerObject=i,t.add(r),t.name="player_entity",this.playerEntity=t,this.syncSceneAttachment(t),this.updatePlayerSkin(e.id,e.username,e.uuid??void 0,lt)}this.playerEntity.originalEntity={...e,name:"player"},e.position&&(this.worldRenderer.sceneOrigin.getWorldPosition(this.playerEntity)||this.worldRenderer.sceneOrigin.track(this.playerEntity),this.playerEntity.position.set(e.position.x,e.position.y,e.position.z)),e.yaw!==void 0&&(this.playerEntity.rotation.y=e.yaw),this.updateEntityEquipment(this.playerEntity,e)}}clear(){for(let e of Object.values(this.entities))this.worldRenderer.sceneOrigin.removeAndUntrack(e),Me(e);this.entities={},this.currentSkinUrls={},this.playerVoiceStates={},this.playerEntity&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.playerEntity),Me(this.playerEntity),this.playerEntity=null)}reloadEntities(){for(let e of Object.values(this.entities))this.update({...e.originalEntity,delete:!0},{}),this.update(e.originalEntity,{})}watchResourcesUpdates(){this.worldRenderer.resourcesManager.on("assetsTexturesUpdated",()=>this.reloadEntities()),this.worldRenderer.resourcesManager.on("assetsInventoryReady",()=>this.reloadEntities())}setDebugMode(e,t=null){this.debugMode=e;for(let r of t?[t]:Object.values(this.entities)){let i=r.children.find(s=>s.name==="debug");i.visible=!1,this.debugMode==="basic"&&(i.visible=!0)}}setRendering(e,t=null){this.currentlyRendering=e&&this.isRenderingAllowed(),this.setSceneAttached(this.currentlyRendering,t)}isRenderingAllowed(){return this.worldRenderer.worldRendererConfig.renderEntities!==!1&&!this.worldRenderer.reactiveDebugParams.disableEntities}syncSceneAttachment(e=null){let t=this.isRenderingAllowed();this.currentlyRendering=t,this.setSceneAttached(t,e)}setSceneAttached(e,t=null){let r=t?[t]:[...Object.values(this.entities),...this.playerEntity?[this.playerEntity]:[]];for(let i of r)e?this.worldRenderer.scene.children.includes(i)||this.worldRenderer.scene.add(i):this.worldRenderer.scene.remove(i)}playEntityModelAnimation(e,t,r=!1){let i=this.entities[e];i&&i.traverse(s=>{s instanceof Gt&&s.playAnimation(t,r)})}render(){if(this.syncSceneAttachment(),!this.isRenderingAllowed())return;this.clock.update(performance.now());let e=Math.min(this.clock.getDelta(),1/30),t=this.worldRenderer.viewerChunkPosition,r=10*10;for(let[i,s]of[...Object.entries(this.entities),["player_entity",this.playerEntity]]){if(!s)continue;let o=i==="player_entity";if(o){let c=this.worldRenderer.playerStateUtils.isThirdPerson();s.visible=c;let u=s.userData._passengerVehicleId!=null||s.userData._boatPassengerVehicleId!=null;if(c&&!u){let h=this.worldRenderer.playerStateReactive.eyeHeight;s.position.set(this.worldRenderer.cameraWorldPos.x,this.worldRenderer.cameraWorldPos.y-h,this.worldRenderer.cameraWorldPos.z)}}let{playerObject:l}=s;if(l?.animation&&l.animation.update(l,e),!o){let c=s.userData.renderHints;A6(c)&&E6(s,this.worldRenderer.cameraShake.getBaseRotation().yaw)}let a=s.userData[Zt],v=s.userData[r5];if(a&&v){let c=t6(v,e),u=Z3({entityPitch:s.userData._horseHeadPitch??0,headYaw:s.userData._horseHeadYaw??s.userData._horseBodyYaw??0,bodyYaw:s.userData._horseBodyYaw??0,limbSwing:c.limbSwing,limbSwingAmount:c.limbSwingAmount});r6(a,u)}if(!o&&l&&bn(l,s.userData),s.traverse(c=>{c instanceof Gt&&c.update(e)}),!o&&t&&s.position){let c=s.position.x-t.x,u=s.position.y-t.y,h=s.position.z-t.z,p=c*c+u*u+h*h,m=this.worldRenderer.entitySectionKey(s.position.x,s.position.y,s.position.z),b=this.worldRenderer.isSectionOcclusionVisible(m);s.visible=!!((p<r||this.worldRenderer.shouldObjectVisible(s))&&b),this.maybeRenderPlayerSkin(i)}if(s.userData.renderHints?.localVehicle){let c=this.resolveLocalVehicleRenderWorldPos(s);s.position.set(c.x,c.y,c.z)}s.visible&&!o&&this.syncArmorPositions(s)}this.updateVehiclePassengerPositions(),this.applyRemoteBoatPassengerRotations(),this.applyLocalThirdPersonPlayerRotation(),this.updateBoatPaddleAnimations(e)}applyRemoteBoatPassengerRotations(){U6({entities:this.entities,syncArmor:e=>this.syncArmorPositions(e)})}updateBoatPaddleAnimations(e){for(let t of Object.values(this.entities)){if(!t||!Pt(t.realName))continue;let r=t.children.find(s=>s.name==="mesh");if(!r)continue;let i=r.userData.boatPaddleAnimation;i&&y6(i,e,r.userData.boatPaddleLeftPivot,r.userData.boatPaddleRightPivot,this.boatPaddleScratch)}}applyLocalThirdPersonPlayerRotation(){let e=this.playerEntity;if(!e?.visible||!e.playerObject)return;let t=this.worldRenderer.cameraShake.getBaseRotation(),r=e.userData._passengerVehicleId!=null||e.userData._boatPassengerVehicleId!=null,i=e.userData._passengerVehicleId??e.userData._boatPassengerVehicleId,s=i!=null?this.entities[i]:void 0,o=s?.realName??s?.originalEntity.name,l=s?.rotation.y;if(c6({isThirdPerson:!0,isAnchoredPassenger:r,vehicleName:o,vehicleYaw:l})){let a=fn({cameraYaw:t.yaw,cameraPitch:t.pitch,vehicleYaw:l});e.rotation.set(0,a.bodyYaw,0),e.traverse(v=>{v.name==="head"&&v.rotation.set(a.headPitch,a.headYaw,0)})}else e.rotation.set(0,t.yaw,0),e.traverse(a=>{a.name==="head"&&a.rotation.set(-t.pitch,0,0)});this.syncArmorPositions(e)}resolvePassengerEntity(e){return this.playerEntity?.originalEntity.id===e?this.playerEntity:this.entities[e]}resolveLocalVehicleRenderWorldPos(e){let t=e.originalEntity,r=e.userData.renderHints,i=e.userData._localVehicleY??t.position?.y??e.position.y;return S6({cameraWorldPos:this.worldRenderer.cameraWorldPos,rawVehicleY:i,eyeHeight:this.worldRenderer.playerStateReactive.eyeHeight,vehicleName:e.realName??t.name,vehicleHeight:t.height??1.6,verticalCameraLock:r?.localVehicleVerticalCameraLock})}updateVehiclePassengerPositions(){H6({entities:this.entities,localPlayer:this.playerEntity,getWorldPosition:e=>this.worldRenderer.sceneOrigin.getWorldPosition(e),version:this.worldRenderer.version})}updateBoatPassengerPositions(){this.updateVehiclePassengerPositions()}syncArmorPositions(e){e.playerObject&&e.traverse(t=>{if(!t.name.startsWith("geometry_armor_"))return;let{skin:r}=e.playerObject;switch(t.name){case"geometry_armor_head":t.children[0]?.children[0]&&t.children[0].children[0].rotation.set(-r.head.rotation.x,r.head.rotation.y,r.head.rotation.z,r.head.rotation.order);break;case"geometry_armor_legs":t.children[0]&&(t.children[0].children[2]&&t.children[0].children[2].rotation.set(-r.leftLeg.rotation.x,r.leftLeg.rotation.y,r.leftLeg.rotation.z,r.leftLeg.rotation.order),t.children[0].children[1]&&t.children[0].children[1].rotation.set(-r.rightLeg.rotation.x,r.rightLeg.rotation.y,r.rightLeg.rotation.z,r.rightLeg.rotation.order));break;case"geometry_armor_feet":t.children[0]&&(t.children[0].children[0]&&t.children[0].children[0].rotation.set(-r.rightLeg.rotation.x,r.rightLeg.rotation.y,r.rightLeg.rotation.z,r.rightLeg.rotation.order),t.children[0].children[1]&&t.children[0].children[1].rotation.set(-r.leftLeg.rotation.x,r.leftLeg.rotation.y,-r.leftLeg.rotation.z,r.leftLeg.rotation.order));break}})}getPlayerObject(e){return this.playerEntity?.originalEntity.id===e?this.playerEntity?.playerObject:this.entities[e]?.playerObject}setPlayerVoiceState(e,t,r){let i=String(e);r?this.playerVoiceStates[i]=r:delete this.playerVoiceStates[i];let s=this.entities[e],o=s?.playerObject;if(!s||!o)return;let l=s.children.find(v=>v.name==="mesh");if(!l)return;let a=s5({username:t,voiceState:r},this.entitiesOptions,l,this.worldRenderer.version);W6(a,o)}isCanvasBlank(e){return!e.getContext("2d")?.getImageData(0,0,e.width,e.height).data.some(r=>r!==0)}async updatePlayerSkin(e,t,r,i,s=void 0){i!==lt&&this.loadedSkinEntityIds.add(String(e)),r&&((typeof i=="string"||typeof s=="string")&&(this.uuidPerSkinUrlsCache[r]={}),typeof i=="string"&&(this.uuidPerSkinUrlsCache[r].skinUrl=i),typeof s=="string"&&(this.uuidPerSkinUrlsCache[r].capeUrl=s),i===!0&&(i=this.uuidPerSkinUrlsCache[r]?.skinUrl??i),s??(s=this.uuidPerSkinUrlsCache[r]?.capeUrl));let l=this.getPlayerObject(e);if(!l)return;if(i===!0){if(!t)return;let v=await Jt(t,"skin");if(!this.getPlayerObject(e)||!v)return;i=v}if(typeof i!="string")throw new Error("Invalid skin url");if(this.currentSkinUrls[String(e)]===i){if(s){if(s===!0&&t){let v=await Jt(t,"cape");if(!this.getPlayerObject(e)||!v)return;s=v}typeof s=="string"&&this.loadAndApplyCape(e,s)}return}i!==lt&&(this.currentSkinUrls[String(e)]=i);let a=this.worldRenderer.worldRendererConfig.renderEars||t==="deadmau5";this.loadAndApplySkin(e,i,a).then(async()=>{if(s){if(s===!0&&t){let v=await Jt(t,"cape");if(!this.getPlayerObject(e)||!v)return;s=v}typeof s=="string"&&this.loadAndApplyCape(e,s)}}),l.cape.visible=!1,s||(l.backEquipment=null,l.elytra.map=null,l.cape.map&&l.cape.map.dispose(),l.cape.map=null)}async applyTemporaryPlayerSkinOverride(e,t,r,i){this.worldRenderer.playerStateReactive.playerSkin=e,await this.updatePlayerSkin(t,r,i,e,void 0)}async loadAndApplySkin(e,t,r){let i=this.getPlayerObject(e);if(i)try{let s;if(i=this.getPlayerObject(e),!i)return;let o,l;if(t===lt){let v=await Bt(lt);s=v.image,o=new j.CanvasTexture(v.canvas),l=v.canvas}else{let{canvas:v,image:c}=await Bt(t);s=c,o=new j.CanvasTexture(v),l=v}o.magFilter=j.NearestFilter,o.minFilter=j.NearestFilter,o.needsUpdate=!0,i.skin.map=o,i.skin.modelType=Di(l),i.skin.isCustom=t!==lt,M1(i);let a;if(s?r&&(a=Ne(64,64),Fi(a,s),r=!this.isCanvasBlank(a)):r=!1,r){let v=new j.CanvasTexture(a);v.magFilter=j.NearestFilter,v.minFilter=j.NearestFilter,v.needsUpdate=!0,i.ears.map=v,i.ears.visible=!0}else i.ears.map=null,i.ears.visible=!1;this.onSkinUpdate?.()}catch{}}async loadAndApplyCape(e,t){let r=this.getPlayerObject(e);if(r)try{let{canvas:i,image:s}=await Bt(t);if(r=this.getPlayerObject(e),!r)return;Oi(i,s);let o=new j.CanvasTexture(i);o.magFilter=j.NearestFilter,o.minFilter=j.NearestFilter,o.needsUpdate=!0,r.cape.map=o,r.cape.visible=!0,r.elytra.map=o,this.onSkinUpdate?.(),r.backEquipment||(r.backEquipment="cape")}catch{}}debugSwingArm(){let e=Object.values(this.entities).find(r=>r.playerObject?.animation);if(!e||!e.playerObject?.animation)return;let t=e.playerObject.animation;t.swingArm&&t.swingArm()}applyMovementAnimation(e,t){let r=e.animation;if(r){if(t==="oneSwing"){r.swingArm();return}if(r.switchAnimationCallback=null,t==="riding"){r.isMoving=!1,r.isRunning=!1,r.isCrouched=!1,r.isRiding=!0;return}r.isRiding=!1,r.isMoving=t==="walking"||t==="running"||t==="crouchWalking",r.isRunning=t==="running",r.isCrouched=t==="crouch"||t==="crouchWalking"}}playAnimation(e,t){let r=e==="player_entity"?this.playerEntity?.playerObject:this.getPlayerObject(e)??this.playerEntity?.playerObject;r&&this.applyMovementAnimation(r,t)}parseEntityLabel(e){if(e)try{if(e.type==="string")return e.value;let t=typeof e=="string"?n5.default.simplify(n5.default.parse(e)):Y1.simplify(e);return w1(t).map(this.textFromComponent).join("")}catch{return e}}textFromComponent(e){return typeof e=="string"?e:e.text??""}getItemMesh(e,t,r=!1,i){!e.nbt&&e.nbtData&&(e.nbt=e.nbtData);let s=this.worldRenderer.getItemRenderData(e,t);if(!(i&&i===s?.modelName)){if(s&&"resolvedModel"in s){let o=o2(this.worldRenderer.material,s.resolvedModel,s.modelName,this.worldRenderer.resourcesManager.currentResources.worldBlockProvider,this.worldRenderer.resourcesManager.currentResources.mcData),l=1;t["minecraft:display_context"]==="ground"?l=.5:t["minecraft:display_context"]==="thirdperson"&&(l=6),o.scale.set(l,l,l);let a=new j.Group;return a.add(o),{mesh:a,isBlock:!0,modelName:s.modelName}}if(s){let o=s.renderInfo?.texture==="blocks"?this.worldRenderer.material.map:this.worldRenderer.itemsTexture,{u:l,v:a,su:v,sv:c}=s,p=O2(o,{u:l,v:a,sizeX:v??1,sizeY:c??1},{faceCamera:r,use3D:!r}),m=1;return t["minecraft:display_context"]==="ground"?m=.5:t["minecraft:display_context"]==="thirdperson"&&(m=6),p.mesh.scale.set(m,m,m),{mesh:p.mesh,isBlock:!1,modelName:s.modelName,cleanup:p.cleanup}}}}setVisible(e,t){t?e.scale.set(1,1,1):e.scale.set(0,0,0)}update(e,t){let r=e.name==="player";(e.name==="zombie_villager"||e.name==="husk")&&(t.texture=`textures/1.16.4/entity/${e.name==="zombie_villager"?"zombie_villager/zombie_villager.png":`zombie/${e.name}.png`}`),e.name==="glow_item_frame"&&(t.textures||(t.textures=[]),t.textures.background="block:glow_item_frame");let i=this.entities[e.id],s=!i;if(e.delete){if(!i)return;i.userData._posTween?.stop(),i.userData._rotTween?.stop(),i.userData[r5]=void 0,i.userData[Zt]=void 0;let m=i.children.find(b=>b.name==="mesh");m&&K3(m),i.additionalCleanup&&i.additionalCleanup(),i.traverse(b=>{b.additionalCleanup&&b.additionalCleanup()}),this.onRemoveEntity(e),this.worldRenderer.sceneOrigin.removeAndUntrack(i),Me(i),delete this.entities[e.id],delete this.playerVoiceStates[String(e.id)];return}if(!this.isRenderingAllowed())return;let o;if(i===void 0){this.beforeEntityAdded(e);let m=new j.Group;if(m.originalEntity=e,e.name==="item"||e.name==="tnt"||e.name==="falling_block"||e.name==="snowball"||e.name==="egg"||e.name==="ender_pearl"||e.name==="experience_bottle"||e.name==="splash_potion"||e.name==="lingering_potion"){let M=e.name==="tnt"||e.type==="projectile"?{name:e.name}:e.name==="falling_block"?{blockState:e.objectData}:Y6(e.metadata)?.find(T=>typeof T=="object"&&T?.itemCount);if(M){let T=this.getItemMesh(M,{"minecraft:display_context":"ground"},e.type==="projectile");if(T){if(o=T.mesh,e.name==="item"||e.type==="projectile"?(o.scale.set(.5,.5,.5),o.position.set(0,e.name==="item"?.2:.1,0)):(o.scale.set(2,2,2),o.position.set(0,.5,0)),e.name==="item"){let S=new j.Timer;o.onBeforeRender=()=>{S.update(performance.now());let B=S.getDelta();o.rotation.y+=B}}m.additionalCleanup=()=>{T.cleanup&&T.cleanup()}}}}else if(r){let M=new j.Group,T=this.setupPlayerObject(e,M,t);if(m.playerObject=T,o=M,e.username){let S=s5({...e,voiceState:this.playerVoiceStates[e.id]},{fontFamily:"mojangles"},M,this.worldRenderer.version);W6(S,T)}}else o=dd(this.mcData,e,this.worldRenderer,this.entitiesOptions,{...t,customModel:e.customModel});if(!o)return;o.name="mesh";let b=V3(e.name);b!=null&&(o.rotation.y=b,Q3(o));let k=e.pos??e.position;this.worldRenderer.sceneOrigin.track(m),m.position.set(k.x,k.y,k.z);let _=new j.BoxHelper(o,e.type==="hostile"?16711680:e.type==="mob"?65280:e.type==="player"?255:16753920);_.name="debug",m.add(o),m.add(_),_.visible=!1,i=m,i.name="entity",i.realName=e.name,this.entities[e.id]=i,r&&this.updatePlayerSkin(e.id,e.username,t?.texture?e.uuid:void 0,t?.texture||lt),this.setDebugMode(this.debugMode,m),this.syncSceneAttachment(m),this.afterAddEntity(e);let y=o.userData[Zt];y&&(i.userData[Zt]=y,i.userData[r5]=$3())}else o=i.children.find(m=>m.name==="mesh"),e.renderHints&&(i.originalEntity.renderHints=e.renderHints);this.applyEntityRenderHints(i,e),this.updateEntityEquipment(i,e);let l=X6(e,this.mcData),v=(Y6(e.metadata)?.[0]??e.metadata?.[0]??0)&32||this.worldRenderer.playerStateReactive.cameraSpectatingEntity===e.id&&this.worldRenderer.playerStateUtils.isSpectator();for(let m of o.children??[])m.name!=="nametag"&&(m.visible=!v);l.baby?i.scale.set(.5,.5,.5):i.scale.set(1,1,1);let c=_n("text_display",e,this.mcData),u=c?.text||l.custom_name_visible&&l.custom_name;if(e.name!=="player"&&u){let m=c&&(c.billboard_render_constraints==="fixed"||!c.billboard_render_constraints),b=c&&!(parseInt(c.style_flags,10)&4)?ad(c.background_color):void 0,k;if(c?.text_opacity){let _=parseInt(c?.text_opacity,10);k=_>0?_:256-_}s5({...e,username:typeof u=="string"?n5.default.simplify(n5.default.parse(u)):Y1.simplify(u),nameTagBackgroundColor:b,nameTagTextOpacity:k,nameTagFixed:m,nameTagScale:c?.scale,nameTagTranslation:c&&(c.translation||new j.Vector3(0,0,0)),nameTagRotationLeft:N6(c?.left_rotation),nameTagRotationRight:N6(c?.right_rotation)},this.entitiesOptions,o,this.worldRenderer.version)}let h=_n("armor_stand",e,this.mcData);if(h){let m=(parseInt(h.client_flags,10)&1)!==0,b=(parseInt(h.client_flags,10)&4)!==0,k=(parseInt(h.client_flags,10)&8)===0,_=(parseInt(h.client_flags,10)&16)!==0;o.castShadow=!_,o.receiveShadow=!_,m?i.scale.set(.5,.5,.5):i.scale.set(1,1,1),i.traverse(y=>{switch(y.name){case"bone_baseplate":this.setVisible(y,k),y.rotation.y=-i.rotation.y;break;case"bone_head":h.head_pose&&y.setRotationFromEuler(It(h.head_pose));break;case"bone_body":h.body_pose&&y.setRotationFromEuler(It(h.body_pose));break;case"bone_rightarm":y.parent?.name!=="bone_armor"&&this.setVisible(y,b),h.left_arm_pose?y.setRotationFromEuler(It(h.left_arm_pose)):y.setRotationFromEuler(It({yaw:-10,pitch:-10,roll:0}));break;case"bone_leftarm":y.parent?.name!=="bone_armor"&&this.setVisible(y,b),h.right_arm_pose?y.setRotationFromEuler(It(h.right_arm_pose)):y.setRotationFromEuler(It({yaw:10,pitch:-10,roll:0}));break;case"bone_rightleg":h.left_leg_pose?y.setRotationFromEuler(It(h.left_leg_pose)):y.setRotationFromEuler(It({yaw:-1,pitch:-1,roll:0}));break;case"bone_leftleg":h.right_leg_pose?y.setRotationFromEuler(It(h.right_leg_pose)):y.setRotationFromEuler(It({yaw:1,pitch:1,roll:0}));break}})}let p=_n("item_frame",e,this.mcData);if(p||(p=_n("glow_item_frame",e,this.mcData)),p){let m=p?.item??e.metadata?.[8];if(o.scale.set(1,1,1),o.position.set(0,0,-.5),i.rotation.x=-e.pitch,i.children.find(b=>{if(b.name.startsWith("map_")){Me(b);let k=parseInt(b.name.split("_")[1],10);return this.itemFrameMaps[k]=this.itemFrameMaps[k]?.filter(_=>_!==b),b instanceof j.Mesh&&b.material?.map?.dispose(),!0}else if(b.name==="item")return Me(b),!0;return!1})?.removeFromParent(),m&&(m.itemId??m.blockId??0)!==0){let b=p.rotation??0,k=m.nbtData?.value?.map?.value??m.components?.find(_=>_.type==="map_id")?.data;if(k)o.scale.set(16/12,16/12,1),this.addMapModel(i,k,b);else{let _=this.getItemMesh(m,{"minecraft:display_context":"fixed"});_&&(_.mesh.position.set(0,0,-.05),_.isBlock?_.mesh.scale.set(.25,.25,.25):_.mesh.scale.set(.5,.5,.5),_.mesh.rotateY(Math.PI),_.mesh.rotateZ(-b*Math.PI/4),_.mesh.name="item",i.add(_.mesh))}}}e.username!==void 0&&(i.username=e.username),this.updateNameTagVisibility(i),this.updateEntityPosition(e,s,t)}applyEntityRenderHints(e,t){if(t.renderHints){let v=t.renderHints,c=new Set(v.passengerIds??v.boatPassengerIds??[]),u=e.userData.renderHints?.passengerIds??e.userData.renderHints?.boatPassengerIds??[];if(Pt(t.name)||gn(t.name))for(let p of u){if(c.has(p))continue;let m=this.resolvePassengerEntity(p);m&&pn(m,String(t.id),this.worldRenderer.sceneOrigin.getWorldPosition(m))}e.userData.renderHints=t.renderHints}if(!Pt(t.name))return;let r=e.children.find(v=>v.name==="mesh");if(!r)return;let i=r.userData.boatWaterPatch;i&&(i.visible=t.renderHints?.boatWaterPatchVisible===!0);let s=e.userData.renderHints??t.renderHints,o=s?.boatPaddleLeft===!0,l=s?.boatPaddleRight===!0,a=r.userData.boatPaddleAnimation;a||(a=g6(),r.userData.boatPaddleAnimation=a),b6(a,o,l)}updateEntityPosition(e,t,r,i=!1){let s=this.entities[e.id];if(!s)return;if(this.applyEntityRenderHints(s,e),s.userData[Zt]){s.userData._horseHeadPitch=typeof e.pitch=="number"&&Number.isFinite(e.pitch)?e.pitch:0;let v=e.headYaw;s.userData._horseHeadYaw=typeof v=="number"&&Number.isFinite(v)?v:e.yaw,s.userData._horseBodyYaw=typeof e.yaw=="number"&&Number.isFinite(e.yaw)?e.yaw:0}let o=V1(e);if(e.position){if(o){s.userData._localVehicleY=e.position.y,s.userData._posTween?.stop(),s.userData._posTween=void 0;let c=this.resolveLocalVehicleRenderWorldPos(s);s.position.set(c.x,c.y,c.z)}else{let c=G1(e,t),u=this.worldRenderer.sceneOrigin.getWorldPosition(s)??{x:e.position.x,y:e.position.y,z:e.position.z};s.userData._tweenTarget||(s.userData._tweenTarget={x:u.x,y:u.y,z:u.z}),s.userData._posTween?.stop(),s.userData._posTween=new Ge(s.userData._tweenTarget).to({x:e.position.x,y:e.position.y,z:e.position.z},c).onUpdate(()=>{s.position.set(s.userData._tweenTarget.x,s.userData._tweenTarget.y,s.userData._tweenTarget.z)}).start()}let v=s.userData[r5];!i&&v&&Number.isFinite(e.position.x)&&Number.isFinite(e.position.z)&&e6(v,e.position)}let l=x6(e,t),a;if(s.playerObject&&r?.rotation?.head){let v=r.rotation.head.y,c=typeof v=="number"&&Number.isFinite(v)?v:e.yaw;typeof c=="number"&&Number.isFinite(c)&&(a=c)}else typeof e.yaw=="number"&&Number.isFinite(e.yaw)&&(a=e.yaw);if(typeof a=="number"&&Number.isFinite(a)){s.userData._rotTween?.stop(),s.userData._rotTween=void 0;let v=Number.isFinite(s.rotation.y)?s.rotation.y:0,c=ld(v,a);l===0?s.rotation.y=v+c:s.userData._rotTween=new Ge(s.rotation).to({y:v+c},l).start()}if(s?.playerObject&&r?.rotation?.head){let{playerObject:v}=s,c=r.rotation.head.y;N1(s.userData,c,e.yaw),v.skin.head.rotation.y=0;let u=r.rotation.head.x;L6(s.userData,u),bn(v,s.userData)}else s?.playerObject&&typeof e.yaw=="number"&&Number.isFinite(e.yaw)&&N1(s.userData,void 0,e.yaw)}afterAddEntity(e){}beforeEntityAdded(e){let t=this.pendingModelOverrides.get(e.id.toString());if(t){let{parts:r}=t;e.customModel=r.length===1?r[0]:{parts:r},this.pendingModelOverrides.delete(e.id.toString())}}maybeRenderPlayerSkin(e){let t=this.entities[e];if(e==="player_entity"&&(t=this.playerEntity,e=this.playerEntity?.originalEntity.id),!t||!t.playerObject||!t.visible)return;let r=128,i=this.worldRenderer.getCameraPosition(),s=this.worldRenderer.sceneOrigin.getWorldPosition(t),l=(s?new j.Vector3(s.x,s.y,s.z):t.position.clone().add(new j.Vector3(this.worldRenderer.sceneOrigin.x,this.worldRenderer.sceneOrigin.y,this.worldRenderer.sceneOrigin.z))).distanceTo(i);if(l<r&&l<this.worldRenderer.viewDistance*16){if(this.loadedSkinEntityIds.has(String(e)))return;this.updatePlayerSkin(e,t.playerObject.realUsername,t.playerObject.realPlayerUuid,!0,!0)}}onRemoveEntity(e){this.loadedSkinEntityIds.delete(e.id.toString()),delete this.currentSkinUrls[e.id.toString()]}updateMap(e,t){this.cachedMapsImages[e]=t;let r=this.itemFrameMaps[e];if(r&&(r=r.filter(i=>i.parent),this.itemFrameMaps[e]=r,r))for(let i of r)i.material.map=this.loadMap(t),i.material.needsUpdate=!0,i.visible=!0}updateNameTagVisibility(e){let t=this.worldRenderer.playerStateReactive.team,r=e.originalEntity.team,i=r?.nameTagVisibility||"always",s=i==="always"||i==="hideForOwnTeam"&&r?.team!==t?.team||i==="hideForOtherTeams"&&(r?.team===t?.team||t===void 0);e.traverse(o=>{o.name==="nametag"&&(o.visible=s)})}addMapModel(e,t,r){let i=this.cachedMapsImages?.[t],s=null;i&&(s=this.loadMap(i));let o={transparent:!0,alphaTest:.1};s&&(o.map=s);let l=new j.MeshLambertMaterial(o),a=new j.Mesh(new j.PlaneGeometry(1,1),l);a.rotation.set(0,Math.PI,0),e.add(a);let v=!0;e.traverseVisible(c=>{c.name==="geometry_frame"&&(v=!1)}),v?a.position.set(0,0,.499):a.position.set(0,0,.437),a.rotateZ(Math.PI*2-r*Math.PI/2),a.name=`map_${t}`,s||(a.visible=!1),this.itemFrameMaps[t]||(this.itemFrameMaps[t]=[]),this.itemFrameMaps[t].push(a)}loadMap(e){let t=Z0(e);return t.needsUpdate=!0,t}addItemModel(e,t,r,i=!1){let s=`bone_${t}item`,o=`custom_item_${t}`;if(e.traverse(a=>{a.name===o&&(a.removeFromParent(),a.additionalCleanup&&a.additionalCleanup())}),!r)return;let l=this.getItemMesh(r,{"minecraft:display_context":"thirdperson"});l?.mesh&&e.traverse(a=>{if(a.name.toLowerCase()===s||a.name===`${t}Arm`){let v=new j.Object3D;v.additionalCleanup=()=>{l.cleanup&&l.cleanup()};let c=l.mesh;v.rotation.z=-Math.PI/16,l.isBlock?v.rotation.y=Math.PI/4:(c.rotation.z=-Math.PI/4,v.rotation.y=Math.PI/2,v.scale.multiplyScalar(2)),i&&(v.position.y=-8,v.position.z=5,v.position.x=t==="left"?1:-1,v.rotation.x=Math.PI),v.add(c),v.name=o,a.add(v)}})}handleDamageEvent(e,t){let r=this.entities[e]?.children.find(i=>i.name==="mesh");r&&r.traverse(i=>{if(i instanceof j.Mesh&&i.material.clone){i.material.clone().dispose(),i.material=i.material.clone();let o=i.material.color.clone();i.material.color.set(16711680),new Ge(i.material.color).to(o,500).start()}})}raycastSceneDebug(){let e=new j.Raycaster;return e.setFromCamera(new j.Vector2(0,0),this.worldRenderer.camera),e.intersectObjects(this.worldRenderer.scene.children)[0]?.object}updateEntityModel(e,t,r,i){let s=Array.isArray(t)?t:[{modelPath:t,modelType:r,metadata:i}];this.pendingModelOverrides.set(e,{parts:s});let o=this.entities[e];o&&(this.update({...o.originalEntity,delete:!0},{}),this.update(o.originalEntity,{}))}setupPlayerObject(e,t,r){let i=new er;i.realPlayerUuid=e.uuid??"",i.realUsername=e.username??"",i.position.set(0,16,0),M1(i),t.add(i);let s=1/16;return t.scale.set(s,s,s),t.rotation.set(0,Math.PI,0),i.animation=new Zr,i.animation.isMoving=!1,i}updateEntityEquipment(e,t){if(!e||!t.equipment)return;let r=t.type==="player";if(this.addItemModel(e,r?"right":"left",t.equipment[0],r),this.addItemModel(e,r?"left":"right",t.equipment[1],r),i5(this.worldRenderer,e,"feet",t.equipment[2]),i5(this.worldRenderer,e,"legs",t.equipment[3],2),i5(this.worldRenderer,e,"chest",t.equipment[4]),i5(this.worldRenderer,e,"head",t.equipment[5]),r&&e.playerObject){let{playerObject:i}=e;i.backEquipment=t.equipment.some(s=>s?.name==="elytra")?"elytra":"cape",i.backEquipment==="elytra"&&this.loadAndApplyCape(t.id,G6),i.cape.map===null&&(i.cape.visible=!1)}}};function X6(n,e){let t=e?.entitiesByName[n.name];return new Proxy({},{get(r,i,s){if(typeof i!="string"||!t)return;let o=t.metadataKeys?.indexOf(i);return n.metadata?.[o??-1]}})}function _n(n,e,t){if(e.name===n)return X6(e,t)}function i5(n,e,t,r,i=1,s=!1){if(!r){j1(e,t);return}let o=r.name.split("_"),l,a=t==="head"&&r.name==="player_head";if(a)if(j1(e,t),r.nbt){let m=Y1.simplify(r.nbt);try{let b;if(m.SkullOwner?b=m.SkullOwner.Properties.textures[0]?.Value:b=m["minecraft:profile"]?.Properties?.find(k=>k.name==="textures")?.value,b){l=JSON.parse(O.from(b,"base64").toString()).textures?.SKIN?.url;let{skinTexturesProxy:_}=n.worldRendererConfig;_&&(l=l?.replace("http://textures.minecraft.net/",_).replace("https://textures.minecraft.net/",_))}}catch{}}else l=lt;let v=o[0];if(!l){let m=`${v}_layer_${i}${s?"_overlay":""}`;l=n.resourcesManager.currentResources.customTextures.armor?.textures[m]?.src??V6[m]}if(!l||!e0[t]){j1(e,t);return}let c=`geometry_armor_${t}${s?"_overlay":""}`,u=e.children.findLast(m=>m.name===c),h;if(u?(h=u.material,z5(l,m=>{m.magFilter=j.NearestFilter,m.minFilter=j.NearestFilter,m.flipY=!1,m.wrapS=j.MirroredRepeatWrapping,m.wrapT=j.MirroredRepeatWrapping,h.map=m})):(u=$t(n,l,e0[t]),t==="head"&&(u.children[0].position.y+=.01),u.name=c,h=u.material,a||(h.side=j.DoubleSide)),v==="leather"&&!s){let m=r.nbt?.value?.display?.value?.color?.value;if(m){let b=m>>16&255,k=m>>8&255,_=m&255;h.color.setRGB(b/255,k/255,_/255)}else h.color.setHex(11890001);i5(n,e,t,r,i,!0)}else h.color.setHex(16777215);let p=new j.Object3D;p.name=`armor_${t}${s?"_overlay":""}`,p.add(u),e.add(u)}function j1(n,e){for(let t of n.children)(t.name===`geometry_armor_${e}`||t.name===`geometry_armor_${e}_overlay`)&&t.removeFromParent()}var Q1=async(n,e)=>{let t;if(!n&&!e)t=await q6;else{if(n||(n=await Jt(e,"skin")),!n)return;let{canvas:a}=await Bt(n);t=new Ye.CanvasTexture(a)}t.magFilter=Ye.NearestFilter,t.minFilter=Ye.NearestFilter;let r=new Ye.BoxGeometry,i=new Ye.MeshStandardMaterial,s=!1,o=new Ye.Mesh(r,i);o.scale.x=s?3:4,o.scale.y=12,o.scale.z=4,hd(r,40,16,s?3:4,12,4),i.map=t,i.needsUpdate=!0;let l=new Ye.Group;return l.add(o),l.scale.set(.1,.1,.1),o.rotation.z=Math.PI,l};function ud(n,e,t,r,i,s,o,l){let a=(P,H,V,z)=>[new Ye.Vector2(P/o,1-z/l),new Ye.Vector2(V/o,1-z/l),new Ye.Vector2(V/o,1-H/l),new Ye.Vector2(P/o,1-H/l)],v=a(e+s,t,e+r+s,t+s),c=a(e+r+s,t,e+r*2+s,t+s),u=a(e,t+s,e+s,t+s+i),h=a(e+s,t+s,e+r+s,t+s+i),p=a(e+r+s,t+s,e+r+s*2,t+i+s),m=a(e+r+s*2,t+s,e+r*2+s*2,t+i+s),b=n.attributes.uv,k=[p[3],p[2],p[0],p[1]],_=[u[3],u[2],u[0],u[1]],y=[v[3],v[2],v[0],v[1]],M=[c[0],c[1],c[3],c[2]],T=[h[3],h[2],h[0],h[1]],S=[m[3],m[2],m[0],m[1]],B=[];for(let P of[k,_,y,M,T,S])for(let H of P)B.push(H.x,H.y);b.set(new Float32Array(B)),b.needsUpdate=!0}function hd(n,e,t,r,i,s){ud(n,e,t,r,i,s,64,64)}var $6={itemRight:{rotation:[0,-90,25],translation:[1.13,3.2,1.13],scale:[.68,.68,.68]},itemLeft:{rotation:[0,90,-25],translation:[1.13,3.2,1.13],scale:[.68,.68,.68]},blockRight:{rotation:[0,45,0],translation:[0,0,0],scale:[.4,.4,.4]},blockLeft:{rotation:[0,225,0],translation:[0,0,0],scale:[.4,.4,.4]}},o5=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;d(this,"holdingBlock");d(this,"blockSwapAnimation");d(this,"cameraGroup",new me.Mesh);d(this,"objectOuterGroup",new me.Group);d(this,"objectInnerGroup",new me.Group);d(this,"holdingBlockInnerGroup",new me.Group);d(this,"camera",new me.PerspectiveCamera(75,1,.1,100));d(this,"stopUpdate",!1);d(this,"lastHeldItem");d(this,"lastHeldItemRenderKey");d(this,"isSwinging",!1);d(this,"nextIterStopCallbacks");d(this,"idleAnimator");d(this,"ready",!1);d(this,"lastUpdate",0);d(this,"playerHand");d(this,"offHandDisplay",!1);d(this,"offHandModeLegacy",!1);d(this,"swingAnimator");d(this,"config");d(this,"disposed",!1);d(this,"unsubs",[]);d(this,"lastItemModelName");d(this,"switchRequest",0);this.initCameraGroup(),this.unsubs.push(Z6(this.worldRenderer.playerStateReactive,"heldItemMain",()=>{this.offHand||this.updateItem()})),this.unsubs.push(Z6(this.worldRenderer.playerStateReactive,"heldItemOff",()=>{this.offHand&&this.updateItem()})),this.config=e.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||Q1().then(r=>{this.disposed||(this.playerHand=r,this.updateItem())}).then(()=>{if(this.disposed)return;let r=Z5(async()=>Q1(this.worldRenderer.playerStateReactive.playerSkin,this.worldRenderer.playerStateReactive.onlineMode?this.worldRenderer.playerStateReactive.username:void 0),this.worldRenderer.playerStateReactive,"playerSkin",i=>{i&&(this.playerHand=i,this.updateItem())},i=>{Me(i,!0)});this.unsubs.push(r)})}updateItem(){if(!this.ready)return;let e=this.offHand?this.worldRenderer.playerStateReactive.heldItemOff:this.worldRenderer.playerStateReactive.heldItemMain;e?this.setNewItem(e):this.offHand?this.setNewItem():this.setNewItem({type:"hand"})}initCameraGroup(){this.cameraGroup=new me.Mesh}startSwing(){this.swingAnimator?.startSwing()}stopSwing(){this.swingAnimator?.stopSwing()}render(e,t,r,i){if(!this.lastHeldItem)return;let s=performance.now();this.lastUpdate&&s-this.lastUpdate>50&&this.replaceItemModel(this.lastHeldItem),this.swingAnimator?.isCurrentlySwinging()||this.swingAnimator?.debugParams.animationStage?this.swingAnimator?.update():this.idleAnimator?.update(),this.blockSwapAnimation?.switcher.update();let o=new me.Scene;o.add(this.cameraGroup),this.updateCameraGroup(),o.add(r.clone()),o.add(i.clone());let l=t.getSize(new me.Vector2),a=Math.min(l.width,l.height),v=l.width-a,{offHandDisplay:c}=this;if(c&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),this.offHandDisplay)t.setViewport(0,0,a,a);else{let u=l.width-a;t.setViewport(u,0,a,a)}t.render(o,this.camera),t.setViewport(0,0,l.width,l.height),c&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new C0(()=>({y:this.objectInnerGroup.position.y}),(s,o)=>{s==="y"&&(this.objectInnerGroup.position.y=o)},{y:16})});let t=e,r=this.objectInnerGroup.position.y+this.objectInnerGroup.scale.y*1.5*(t==="appeared"?1:-1),i=!1;return new Promise(s=>{this.blockSwapAnimation.switcher.transitionTo({y:r},t,()=>{i||s(!0)},()=>{i=!0,s(!1)})})}isDifferentItem(e){return this.lastHeldItemRenderKey!==$0(this.worldRenderer,e)}updateCameraGroup(){if(this.stopUpdate)return;let{camera:e}=this;this.cameraGroup.position.copy(e.position),this.cameraGroup.rotation.copy(e.rotation);let t=1,{position:r,scale:i}=this.getHandHeld3d(),s=-r.z,o=this.offHandModeLegacy?-1:1;this.objectOuterGroup.position.set(s*r.x*t*o,s*r.y,-s);let l=i*2.22*.2;this.objectOuterGroup.scale.set(l,l,l)}async createItemModel(e){if(this.lastUpdate=performance.now(),!e||e.type==="hand"&&!this.playerHand)return;let t;if(e.type==="item"||e.type==="block"){let i=this.worldRenderer.entities.getItemMesh({...e.fullItem,itemId:e.id},en(this.worldRenderer),!1,this.lastItemModelName);if(i){let{mesh:s,isBlock:o,modelName:l}=i;o?(t=s,e.type="block"):(s.position.set(.5,.5,.5),t=s,e.type="item"),this.lastItemModelName=l}}else t=this.playerHand;if(!t)return;t.name="holdingBlock";let r=this.getHandHeld3d().rotation;return t.rotation.x=me.MathUtils.degToRad(r.x),t.rotation.y=me.MathUtils.degToRad(r.y),t.rotation.z=me.MathUtils.degToRad(r.z),{model:t,type:e.type}}async replaceItemModel(e){if(this.blockSwapAnimation?.switcher.isTransitioning)return;if(!e){this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0;return}let t=await this.createItemModel(e);t&&(this.holdingBlock?.removeFromParent(),this.holdingBlock=t.model,this.holdingBlockInnerGroup.add(t.model))}testUnknownBlockSwitch(){this.setNewItem({type:"item",name:"minecraft:some-unknown-block",id:0,fullItem:{}})}async setNewItem(e){let t=$0(this.worldRenderer,e),r=this.lastHeldItemRenderKey!==t;if(this.lastHeldItem=e,!r)return;this.lastHeldItemRenderKey=t,this.lastItemModelName=void 0;let i=++this.switchRequest,s=!1;if(this.holdingBlock){if(s=!0,!await this.playBlockSwapAnimation("disappeared"))return;this.holdingBlock?.removeFromParent(),this.holdingBlock=void 0}if(!e){this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.idleAnimator=void 0,this.blockSwapAnimation=void 0;return}if(i!==this.switchRequest)return;let o=await this.createItemModel(e);if(!o||i!==this.switchRequest)return;let l=new me.Group;this.holdingBlockInnerGroup.removeFromParent(),this.holdingBlockInnerGroup=new me.Group,this.holdingBlockInnerGroup.add(o.model),l.add(this.holdingBlockInnerGroup),this.holdingBlock=o.model,this.objectInnerGroup=new me.Group,this.objectInnerGroup.add(l),this.objectInnerGroup.position.set(-.5,-.5,-.5),s&&(this.objectInnerGroup.position.y-=this.objectInnerGroup.scale.y*1.5),Object.assign(l.position,{x:.5,y:.5,z:.5}),this.objectOuterGroup=new me.Group,this.objectOuterGroup.add(this.objectInnerGroup),this.cameraGroup.add(this.objectOuterGroup);let a=this.getHandHeld3d().rotation;this.objectOuterGroup.rotation.y=me.MathUtils.degToRad(a.yOuter),s&&await this.playBlockSwapAnimation("appeared"),this.swingAnimator??(this.swingAnimator=new q1(this.holdingBlockInnerGroup)),this.swingAnimator.setHandMesh(this.holdingBlockInnerGroup),this.swingAnimator.type=o.type,this.config.viewBobbing&&(this.idleAnimator=new K1(this.holdingBlockInnerGroup,this.worldRenderer.playerStateReactive))}getHandHeld3d(){let e=this.lastHeldItem?.type??"hand",t=this.offHandModeLegacy?"Left":"Right",r=.8*1.15,i={x:.4,y:-.7,z:-.45},s={x:-32.4,y:42.8,z:-41.3,yOuter:0};if(e==="item"){let o=$6[`item${t}`];i={x:-.05,y:-.7,z:-.45},s={x:o.rotation[0],y:o.rotation[1],z:o.rotation[2],yOuter:0},r=o.scale[0]*1.15}else if(e==="block"){let o=$6[`block${t}`];i={x:.4,y:-.7,z:-.45},s={x:o.rotation[0],y:o.rotation[1],z:o.rotation[2],yOuter:0},r=o.scale[0]*1.15}return{rotation:s,position:i,scale:r}}dispose(){this.disposed=!0,this.ready=!1,this.unsubs.forEach(e=>e()),this.unsubs=[],this.idleAnimator?.destroy(),this.idleAnimator=void 0,this.swingAnimator?.stopSwing(),this.swingAnimator=void 0,this.blockSwapAnimation?.switcher.forceFinish(),this.blockSwapAnimation=void 0,Me(this.cameraGroup,!0),Me(this.objectOuterGroup,!0),Me(this.objectInnerGroup,!0),Me(this.holdingBlockInnerGroup,!0),this.holdingBlock=void 0,this.playerHand&&(Me(this.playerHand,!0),this.playerHand=void 0)}},K1=class{constructor(e,t){this.handMesh=e;this.playerState=t;d(this,"globalTime",0);d(this,"lastTime",0);d(this,"currentState");d(this,"targetState");d(this,"defaultPosition");d(this,"idleOffset",{y:0,rotationZ:0});d(this,"tween",new q0);d(this,"idleTween",null);d(this,"stateSwitcher");d(this,"debugParams",{walkingSpeed:8,sprintingSpeed:16,walkingAmplitude:{x:1/30,y:1/10,rotationZ:.25},sprintingAmplitude:{x:1/30,y:1/10,rotationZ:.4}});d(this,"debugGui");d(this,"updated",!1);this.handMesh=e,this.globalTime=0,this.currentState="NOT_MOVING",this.targetState="NOT_MOVING",this.defaultPosition={x:e.position.x,y:e.position.y,z:e.position.z,rotationX:e.rotation.x,rotationY:e.rotation.y,rotationZ:e.rotation.z},this.stateSwitcher=new C0(()=>({x:this.handMesh.position.x,y:this.handMesh.position.y,z:this.handMesh.position.z,rotationX:this.handMesh.rotation.x,rotationY:this.handMesh.rotation.y,rotationZ:this.handMesh.rotation.z}),(r,i)=>{switch(r){case"x":this.handMesh.position.x=i;break;case"y":this.handMesh.position.y=i;break;case"z":this.handMesh.position.z=i;break;case"rotationX":this.handMesh.rotation.x=i;break;case"rotationY":this.handMesh.rotation.y=i;break;case"rotationZ":this.handMesh.rotation.z=i;break}},{x:2,y:2,z:2,rotation:Math.PI}),this.debugGui=new Ut("idle_animator",this.debugParams)}startIdleAnimation(){this.idleTween&&this.idleTween.stop(),this.idleOffset.y=this.handMesh.position.y-this.defaultPosition.y,this.idleOffset.rotationZ=this.handMesh.rotation.z-this.defaultPosition.rotationZ,this.idleTween=new Ge(this.idleOffset,this.tween).to({y:.05,rotationZ:.05},3e3).easing(Fe.Sinusoidal.InOut).yoyo(!0).repeat(1/0).start()}stopIdleAnimation(){this.idleTween&&(this.idleTween.stop(),this.idleOffset.y=0,this.idleOffset.rotationZ=0)}getStateTransform(e,t){switch(e){case"NOT_MOVING":case"SNEAKING":return{x:this.defaultPosition.x,y:this.defaultPosition.y,z:this.defaultPosition.z,rotationX:this.defaultPosition.rotationX,rotationY:this.defaultPosition.rotationY,rotationZ:this.defaultPosition.rotationZ};case"WALKING":case"SPRINTING":{let r=e==="SPRINTING"?this.debugParams.sprintingSpeed:this.debugParams.walkingSpeed,i=e==="SPRINTING"?this.debugParams.sprintingAmplitude:this.debugParams.walkingAmplitude;return{x:this.defaultPosition.x+Math.sin(t*r)*i.x,y:this.defaultPosition.y-Math.abs(Math.cos(t*r))*i.y,z:this.defaultPosition.z,rotationX:this.defaultPosition.rotationX,rotationY:this.defaultPosition.rotationY,rotationZ:this.defaultPosition.rotationZ}}}}setState(e){if(e===this.targetState)return;this.targetState=e;let t=!1;if(this.currentState!==e){if(this.stopIdleAnimation(),!t){let r=this.getStateTransform(e,this.globalTime);this.stateSwitcher.transitionTo(r,e)}this.currentState=e}}update(){this.stateSwitcher.update();let e=performance.now(),t=(e-this.lastTime)/1e3;if(this.lastTime=e,!this.stateSwitcher.isTransitioning)switch(this.currentState){case"NOT_MOVING":case"SNEAKING":this.globalTime=Math.PI/4;break;case"SPRINTING":case"WALKING":this.globalTime+=t;break}if(this.playerState){let r=this.playerState.movementState;r!==this.targetState&&this.setState(r)}if(!this.stateSwitcher.isTransitioning&&(this.currentState==="NOT_MOVING"||this.currentState==="SNEAKING")&&(this.idleTween?.isPlaying()||this.startIdleAnimation(),this.tween.update(),this.handMesh.position.y=this.defaultPosition.y+this.idleOffset.y,this.handMesh.rotation.z=this.defaultPosition.rotationZ+this.idleOffset.rotationZ),!this.stateSwitcher.isTransitioning&&(this.currentState==="WALKING"||this.currentState==="SPRINTING")){let r=this.getStateTransform(this.currentState,this.globalTime);Object.assign(this.handMesh.position,r),Object.assign(this.handMesh.rotation,{x:r.rotationX,y:r.rotationY,z:r.rotationZ})}}getCurrentState(){return this.currentState}destroy(){this.stopIdleAnimation(),this.stateSwitcher.forceFinish()}},q1=class{constructor(e){this.handMesh=e;d(this,"PI",Math.PI);d(this,"animationTimer",0);d(this,"lastTime",0);d(this,"isAnimating",!1);d(this,"stopRequested",!1);d(this,"originalRotation");d(this,"originalPosition");d(this,"originalScale");d(this,"debugParams",{animationTime:250,animationStage:0,useClassicSwing:!0,itemSwingXPosScale:-.8,itemSwingYPosScale:.2,itemSwingZPosScale:-.2,itemHeightScale:-.6,itemPreswingRotY:45,itemSwingXRotAmount:-30,itemSwingYRotAmount:-35,itemSwingZRotAmount:-5,armSwingXPosScale:-.3,armSwingYPosScale:.4,armSwingZPosScale:-.4,armSwingYRotAmount:70,armSwingZRotAmount:-20,armHeightScale:-.6});d(this,"debugGui");d(this,"type","hand");this.handMesh=e,this.originalRotation=e.rotation.clone(),this.originalPosition=e.position.clone(),this.originalScale=e.scale.clone(),this.debugGui=new Ut("hand_animator",this.debugParams,void 0,{animationStage:{min:0,max:1,step:.01},itemSwingXPosScale:{min:-2,max:2,step:.1},itemSwingYPosScale:{min:-2,max:2,step:.1},itemSwingZPosScale:{min:-2,max:2,step:.1},itemHeightScale:{min:-2,max:2,step:.1},itemPreswingRotY:{min:-180,max:180,step:5},itemSwingXRotAmount:{min:-180,max:180,step:5},itemSwingYRotAmount:{min:-180,max:180,step:5},itemSwingZRotAmount:{min:-180,max:180,step:5},armSwingXPosScale:{min:-2,max:2,step:.1},armSwingYPosScale:{min:-2,max:2,step:.1},armSwingZPosScale:{min:-2,max:2,step:.1},armSwingYRotAmount:{min:-180,max:180,step:5},armSwingZRotAmount:{min:-180,max:180,step:5},armHeightScale:{min:-2,max:2,step:.1}})}setHandMesh(e){this.handMesh=e,this.originalRotation.copy(e.rotation),this.originalPosition.copy(e.position),this.originalScale.copy(e.scale)}update(){if(!this.isAnimating&&!this.debugParams.animationStage){this.handMesh.rotation.copy(this.originalRotation),this.handMesh.position.copy(this.originalPosition),this.handMesh.scale.copy(this.originalScale);return}let e=performance.now(),t=(e-this.lastTime)/1e3;this.lastTime=e,this.animationTimer+=t*1e3;let r=this.debugParams.animationStage||Math.min(this.animationTimer/this.debugParams.animationTime,1);if(r>=1){if(this.stopRequested){this.isAnimating=!1,this.stopRequested=!1,this.animationTimer=0,this.handMesh.rotation.copy(this.originalRotation),this.handMesh.position.copy(this.originalPosition),this.handMesh.scale.copy(this.originalScale);return}this.animationTimer=0;return}this.handMesh.rotation.copy(this.originalRotation),this.handMesh.position.copy(this.originalPosition),this.handMesh.scale.copy(this.originalScale);let i=r,s=Math.sqrt(i),o=Math.sin(i*this.PI),l=Math.sin(s*this.PI);if(this.type==="hand"){let a=this.debugParams.armSwingXPosScale*l,v=this.debugParams.armSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.armSwingZPosScale*o;this.handMesh.position.x+=a,this.handMesh.position.y+=v+this.debugParams.armHeightScale*i,this.handMesh.position.z+=c,this.handMesh.rotation.y+=me.MathUtils.degToRad(this.debugParams.armSwingYRotAmount*l),this.handMesh.rotation.z+=me.MathUtils.degToRad(this.debugParams.armSwingZRotAmount*o)}else{let a=this.debugParams.itemSwingXPosScale*l,v=this.debugParams.itemSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.itemSwingZPosScale*o;this.handMesh.position.x+=a,this.handMesh.position.y+=v+this.debugParams.itemHeightScale*i,this.handMesh.position.z+=c,this.handMesh.rotation.y+=me.MathUtils.degToRad(this.debugParams.itemPreswingRotY),this.handMesh.rotation.x+=me.MathUtils.degToRad(this.debugParams.itemSwingXRotAmount*o),this.handMesh.rotation.y+=me.MathUtils.degToRad(this.debugParams.itemSwingYRotAmount*l),this.handMesh.rotation.z+=me.MathUtils.degToRad(this.debugParams.itemSwingZRotAmount*o)}}startSwing(){this.stopRequested=!1,!this.isAnimating&&(this.isAnimating=!0,this.animationTimer=0,this.lastTime=performance.now())}stopSwing(){this.isAnimating&&(this.stopRequested=!0)}isCurrentlySwinging(){return this.isAnimating}};function a5(n,e=!1){return n.displayOptions.inWorldRenderingConfig.handRenderer==="legacy"?new o5(n,e):new Yr(n,e)}A();E();R();x();function e7(n){let e=typeof n.pitch=="number"&&Number.isFinite(n.pitch)?n.pitch:0,t=typeof n.headYaw=="number"&&Number.isFinite(n.headYaw)?n.headYaw:typeof n.yaw=="number"&&Number.isFinite(n.yaw)?n.yaw:0;return{pitch:e,headYaw:t}}A();E();R();x();import*as tt from"three";import{Vec3 as J1}from"vec3";var t7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAALUlEQVR42mP4//8/IyWYYdSAwW6Ara3tf4oMmD179n9ChhD0AsiQ0Wgc7AYAAOqH+zNQ3r9kAAAAAElFTkSuQmCC";var r7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAOklEQVR42mP4//8/IyWYYdQA3AbY2tr+H1gDZs+e/R9mCD7D8IYBzBAQTXYgEvIKQQPw2T6aEqlkAADEA/W3ycLXvwAAAABJRU5ErkJggg==";var n7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAQklEQVR42mP4//8/IyWYYRgbYGtr+39wGQDiYzMUpwGzZ8+GawDRID4IkxSIMEOwaSQ6FgiFBW0NIOR8osJgBOQFALo37sVTOo/LAAAAAElFTkSuQmCC";var i7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAWElEQVR42mP4//8/IyWYYXAbYGtr+59sA0CaZ8+eTZkBhNg4DQApQlYIcglMDN1VWA0AKYJpQvYONi/hDUSYIfjCgmA0EooJ2hmAK9CINgBXoA2xvEAMBgBGPud3dYZtOQAAAABJRU5ErkJggg==";var s7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAYklEQVR42r1TQQrAMAxyD8tL89iMHgQJoQxHewi0UsWYFFX1/CkcF4iIsgUWOTM9ASV3F3rHF+v9rK4wEVnEFoFYbwmTbRZFFN9m0B9QZBfk2THaAhqktQdTkHYL9iZe+40vs7nda+BuVOMAAAAASUVORK5CYII=";var o7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAcElEQVR42rWTWwpAIQhEbWGu1MUaXRgQcXpyP8SIPI1jibu3l5DfAKrqyFgfAczsKxx5xJUCFGYFUZXMpOe9CAa8BOS+0U5UVbYQ6Siqbi0BFT0auTSRHZqNkE6BGXgEYKYtAczIbQAz8ukzXT3l3egz49IXvXQCVAAAAABJRU5ErkJggg==";var a7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAeElEQVQ4jaWSQQ4AIQgD9WG8tI/tnkgaUgmuBw8YHcqERXK/nOUuI4JPAABMSESwA1qAQgAQwBygnfNjTaCpWoBzUlNZQJ07x9FUdgSlV5FaW4Cjq8isW8BJ2GgPtEuVdr0HKvLXHjiRI0An8jTKqo9dF000cnBzPgKuxXtbq/m1AAAAAElFTkSuQmCC";var l7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhUlEQVR42qWTSRKAMAgE8WF5KY/FygEL2yEp9cAhCz0wJBYRx58wbowxYsZngLvHjITsgNYpJySBrPIBUMqZSHhdSw+oQlgVa01U7VRQ7huTk67aUWZaVyaNZFsSQBCTVBW3KahLyo/lQ6KR1Y+2BTUyGqke1AXoxsSzpYlU3FW0/Exv1ie0hq53Bf15aAAAAABJRU5ErkJggg==";var v7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAmklEQVR42o2SYQ6FMAiDeQfbSXdYXjSpqd869QeZQiilpbr7l2KM0cc75+xUV77YpGCjAPUqitMU3uCAXrsAlPSCcgJMbG4M0mQ1Etz/i0KlXQnmwyqpv1uH4h7fiws7ISneTYNEk0ImCxcAArGJrE4AXhypPtl7AqTdeJG8k3gHb0L6QfmK9WQTa59cSFdHRssKFHHngteV/wPDepaHIu0QVAAAAABJRU5ErkJggg==";var c7="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAoUlEQVR42n2Tyw3AIAxD3cGYlGFTUSmV+2o4IEEAf2JQVV1rjDGq576ec5avWVdfWIW12aMPEJBEImoPv+CAvvcCODsVNWBS8wA4A5ndv1/ytciQvBLMyeTSHD3ZYXPXXH7Y0ZMdJvCxQJls5O6tKHlPPWGEfU58WZR6ive1kKSleFNC2kXGRnrcDqhTTOmPeP3pAZnTq6Oin4X0oXbfnNZu626Io6lqGCwAAAAASUVORK5CYII=";var An=class{constructor(e){this.worldRenderer=e;d(this,"_cursorLinesHidden",!1);d(this,"cursorLineMaterial");d(this,"interactionLines",null);d(this,"prevColor");d(this,"blockBreakMesh");d(this,"breakTextures",[]);let t=[t7,r7,n7,i7,s7,o7,a7,l7,v7,c7];for(let i=0;i<10;i++)X0(t[i]).then(s=>{s.magFilter=tt.NearestFilter,s.minFilter=tt.NearestFilter,this.breakTextures.push(s)});let r=new tt.MeshBasicMaterial({transparent:!0,blending:tt.MultiplyBlending,premultipliedAlpha:!0,alphaTest:.5});this.blockBreakMesh=new tt.Mesh(new tt.BoxGeometry(1,1,1),r),this.blockBreakMesh.visible=!1,this.blockBreakMesh.renderOrder=999,this.blockBreakMesh.name="blockBreakMesh",this.worldRenderer.sceneOrigin.addAndTrack(this.blockBreakMesh),this.worldRenderer.onReactivePlayerStateUpdated("gameMode",()=>{this.updateLineMaterial()}),setTimeout(()=>{this.updateLineMaterial(),this.interactionLines&&this.setHighlightCursorBlock(this.interactionLines.blockPos,this.interactionLines.shapePositions,!0)})}get cursorLinesHidden(){return this._cursorLinesHidden}set cursorLinesHidden(e){this.interactionLines&&(this.interactionLines.mesh.visible=!e),this._cursorLinesHidden=e}updateLineMaterial(){let e=this.worldRenderer.playerStateReactive.gameMode==="creative",t=this.worldRenderer.renderer.getPixelRatio();this.cursorLineMaterial&&this.cursorLineMaterial.dispose(),this.cursorLineMaterial=new H0({color:(()=>{switch(this.worldRenderer.worldRendererConfig.highlightBlockColor){case"blue":return 4227327;case"classic":return 0;default:return e?4227327:0}})(),linewidth:Math.max(t*.7,1)*2}),this.prevColor=this.worldRenderer.worldRendererConfig.highlightBlockColor}updateBreakAnimation(e,t,r){if(this.hideBreakAnimation(),t===null||!e||!r)return;let{position:i,width:s,height:o,depth:l}=r,a=new J1(i.x,i.y,i.z);this.blockBreakMesh.scale.set(s*1.001,o*1.001,l*1.001),a.add(new J1(e.x,e.y,e.z)),this.blockBreakMesh.position.set(a.x,a.y,a.z),this.blockBreakMesh.visible=!0,this.blockBreakMesh.material.map=this.breakTextures[t]??this.breakTextures.at(-1),this.blockBreakMesh.material.needsUpdate=!0}hideBreakAnimation(){this.blockBreakMesh&&(this.blockBreakMesh.visible=!1)}updateDisplay(){if(this.cursorLineMaterial){let{renderer:e}=this.worldRenderer;this.cursorLineMaterial.resolution.set(e.domElement.width,e.domElement.height),this.cursorLineMaterial.dashOffset=performance.now()/750}}setHighlightCursorBlock(e,t,r=!1){if(e&&this.interactionLines&&e.equals(this.interactionLines.blockPos)&&xd(t??[],this.interactionLines.shapePositions??[])&&!r||(this.interactionLines!==null&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.interactionLines.mesh),this.interactionLines=null),e===null))return;let i=new tt.Group;for(let{position:s,width:o,height:l,depth:a}of t??[]){let v=new J1(s.x,s.y,s.z),c=[1.0001*o,1.0001*l,1.0001*a],u=new tt.BoxGeometry(...c),h=new I0().fromEdgesGeometry(new tt.EdgesGeometry(u)),p=new e5(h,this.cursorLineMaterial);p.position.set(v.x,v.y,v.z),p.computeLineDistances(),i.add(p)}this.worldRenderer.sceneOrigin.addAndTrack(i),i.position.set(e.x,e.y,e.z),i.visible=!this.cursorLinesHidden,this.interactionLines={blockPos:e,mesh:i,shapePositions:t}}render(){this.prevColor!==this.worldRenderer.worldRendererConfig.highlightBlockColor&&this.updateLineMaterial(),this.updateDisplay()}},xd=(n,e)=>{if(n.length!==e.length)return!1;for(let[t,r]of n.entries())if(r!==e[t])return!1;return!0};A();E();R();x();A();E();R();x();var Rd=xr(A1(),1);import d7 from"prismarine-nbt";import{getItemDefinition as kd}from"mc-assets/dist/itemDefinitions";var Sd=(n,e)=>{let t,r,i=n.name;i.includes(":")||(i=`minecraft:${i}`);let s=e.currentResources?.customItemModelNames[i];if(n.components){let o=new Map;for(let c of n.components)o.set(c.type,c);let l=o.get("custom_name")||o.get("item_name");l&&(t=typeof l.data=="string"?l.data:d7.simplify(l.data));let a=o.get("item_model");if(a&&(r=a.data),s){let c=o.get("custom_model_data");if(c?.data){let u;typeof c.data=="number"?u=c.data:typeof c.data=="object"&&"floats"in c.data&&Array.isArray(c.data.floats)&&c.data.floats.length>0&&(u=c.data.floats[0]),u&&s[u]&&(r=s[u])}}let v=o.get("lore");v&&(t??(t=n.displayName??n.name),t+=`
21506
+ ${JSON.stringify(v.data)}`)}if(n.nbt){let o=d7.simplify(n.nbt),l=o.display?.Name;l&&(t=l),s&&o.CustomModelData&&s[o.CustomModelData]&&(r=s[o.CustomModelData])}return{customText:t,customModel:r}};var u7=(n,e,t,r)=>{let i=n.name,{customModel:s}=Sd(n,t);s&&(i=s);let o=Ca(r,{...e}),l=t.currentResources,a=kd(ba(l),{name:i,version:l.version,properties:o})?.model;return(a==="minecraft:special"?void 0:a)??i};A();E();R();x();var b7=xr(p7(),1);import{versionToNumber as g7}from"mc-assets/dist/utils";var y7=(n,e,t=!1,r=!1)=>{let i=n.modelName,s=globalThis.loadedData.itemsByName[i];g7(e.currentResources.version)<g7("1.13")&&(i=(0,b7.getRenamedData)(s?"items":"blocks",i,e.currentResources.version,"1.13.1"));let o;if(!r){let a=e.currentResources?.guiAtlas?.json,v=u=>u&&a?.textures[u.replace("minecraft:","").replace("block/","").replace("blocks/","").replace("item/","").replace("items/","").replace("_inventory","")],c=v(i)??v(n.originalItemName);if(c){let u=c.u*a.width,h=c.v*a.height;return{texture:"gui",slice:[u,h,a.tileSize,a.tileSize],scale:.25,blockData:null,modelName:null}}}let l=a=>a.top??a;try{if(!e.currentResources?.itemsRenderer)throw new Error("Items renderer is not available");o=e.currentResources.itemsRenderer.getItemTexture(i,{},!1,r)??(n.originalItemName?e.currentResources.itemsRenderer.getItemTexture(n.originalItemName,{},!1,r):void 0)??e.currentResources.itemsRenderer.getItemTexture("item/missing_texture")}catch(a){reportError?.(`Failed to render item ${i} (original: ${n.originalItemName}) on ${e.currentResources.version} (resourcepack: TODO!): ${a.stack}`),o=l(e.currentResources.itemsRenderer.getItemTexture("errored"))}return o??(o=l(e.currentResources.itemsRenderer.getItemTexture("unknown"))),"type"in o?{texture:o.type,slice:o.slice,modelName:i,blockData:null,scale:null}:{texture:"blocks",blockData:o,modelName:i,slice:null,scale:null}};var _7=(n,e,t,r)=>{let i=t.currentResources;if(!i)throw new Error("Resources not loaded");let s=n.itemId??n.blockId??n.name,{blockState:o}=n;try{let l=o?globalThis.loadedData.blocksByStateId[o]?.name:typeof s=="number"?globalThis.loadedData.items[s]?.name:s;if(!l)throw new Error(`Item not found: ${s}`);let a=u7({...n,name:l},e,t,r),v=y7({modelName:a},t,!1,!0);if(!v)throw new Error(`Failed to get render info for item ${l}`);let c=v.texture==="blocks"?i.blocksAtlasImage:i.itemsAtlasImage;if(v.blockData)return{resolvedModel:v.blockData.resolvedModel,modelName:v.modelName};if(v.slice){let[u,h,p,m]=v.slice,[b,k,_,y]=[u/c.width,h/c.height,p/c.width,m/c.height];return{u:b,v:k,su:_,sv:y,renderInfo:v,modelName:v.modelName}}throw new Error(`Invalid render info for item ${l}`)}catch(l){return reportError?.(l),{u:0,v:0,su:16/i.blocksAtlasImage.width,sv:16/i.blocksAtlasImage.width,modelName:"missing"}}};A();E();R();x();import*as St from"three";A();E();R();x();function Pd(n){return Math.min(Math.max(n,0),1)}function w7(n,e){return{individualGain:Pd(n),maxDistance:Math.max(n,1)*e}}function A7(n,e){n.distanceModel="linear",n.refDistance=0,n.rolloffFactor=1,n.maxDistance=e}function E7(n,e,t,r,i){let s=e.currentTime;n.positionX?(n.positionX.setValueAtTime(t,s),n.positionY.setValueAtTime(r,s),n.positionZ.setValueAtTime(i,s)):n.setPosition(t,r,i)}var xn=new St.Vector3,Hd=new St.Quaternion,Ld=new St.Vector3,Rn=class{constructor(e){this.worldRenderer=e;d(this,"audioListener");d(this,"activeSounds",new Set);d(this,"audioContext");d(this,"soundVolumes",new Map);d(this,"baseVolume",1);e.onWorldSwitched.push(()=>{this.stopAll()}),e.onReactiveConfigUpdated("volume",t=>{this.changeVolume(t)})}initAudioListener(){this.audioListener||(this.audioListener=new St.AudioListener,this.worldRenderer.camera.add(this.audioListener))}playSound(e,t,r=1,i=1,s=500,o=16){this.initAudioListener();let l=new St.PositionalAudio(this.audioListener);this.activeSounds.add(l);let{individualGain:a,maxDistance:v}=w7(r,o);this.soundVolumes.set(l,a);let c=new St.AudioLoader,u=Date.now();c.loadAsync(t).then(h=>{if(Date.now()-u>s){this.activeSounds.delete(l),this.soundVolumes.delete(l);return}l.setBuffer(h),A7(l.panner,v),l.setVolume(a*this.baseVolume),l.setPlaybackRate(i),this.worldRenderer.sceneOrigin.addAndTrack(l),l.position.set(e.x,e.y,e.z),l.updateMatrixWorld(!0),l.matrixWorld.decompose(xn,Hd,Ld),E7(l.panner,this.audioListener.context,xn.x,xn.y,xn.z),l.onEnded=()=>{this.worldRenderer.sceneOrigin.removeAndUntrack(l),l.source&&l.disconnect(),this.activeSounds.delete(l),this.soundVolumes.delete(l),c.manager.itemEnd(t)},l.play()})}stopAll(){for(let e of this.activeSounds)e&&(e.stop(),e.source&&e.disconnect(),this.worldRenderer.sceneOrigin.removeAndUntrack(e));this.activeSounds.clear(),this.soundVolumes.clear()}changeVolume(e){this.baseVolume=e;for(let[t,r]of this.soundVolumes)t.setVolume(r*this.baseVolume)}destroy(){this.stopAll(),this.audioListener&&(this.audioListener.removeFromParent(),this.audioListener=void 0)}playTestSound(){let{x:e,y:t,z:r}=this.worldRenderer.cameraWorldPos;this.playSound({x:e,y:t,z:r},"/sound.mp3")}};A();E();R();x();import*as Qe from"three";var kn=class{constructor(e,t){this.worldRenderer=e;this.onRenderCallbacks=t;d(this,"rollAngle",0);d(this,"rollAnimation");d(this,"basePitch",0);d(this,"baseYaw",0);d(this,"cameraBobInput",null);t.push(()=>{this.update()})}get damageRollAmount(){return 5}get damageAnimDuration(){return 200}setCameraBobInput(e){this.cameraBobInput=e}setBaseRotation(e,t){this.basePitch=e,this.baseYaw=t,this.update()}getBaseRotation(){return{pitch:this.basePitch,yaw:this.baseYaw}}shakeFromDamage(e){let t=this.rollAngle,r=t+(e??(Math.random()<.5?-1:1))*this.damageRollAmount;this.rollAnimation={startTime:performance.now(),startRoll:t,targetRoll:r,duration:this.damageAnimDuration/2}}update(){if(this.worldRenderer.playerStateUtils.isSpectatingEntity()&&(this.rollAngle=0,this.rollAnimation=void 0),this.rollAnimation){let t=performance.now(),r=t-this.rollAnimation.startTime,i=Math.min(r/this.rollAnimation.duration,1);this.rollAnimation.returnToZero?(this.rollAngle=this.rollAnimation.startRoll*(1-this.easeInOut(i)),i===1&&(this.rollAnimation=void 0)):(this.rollAngle=this.rollAnimation.startRoll+(this.rollAnimation.targetRoll-this.rollAnimation.startRoll)*this.easeOut(i),i===1&&(this.rollAnimation={startTime:t,startRoll:this.rollAngle,targetRoll:0,duration:this.damageAnimDuration/2,returnToZero:!0}))}let e=this.worldRenderer.cameraObject;if(this.worldRenderer.cameraGroupVr){let t=new Qe.Quaternion().setFromAxisAngle(new Qe.Vector3(0,1,0),this.baseYaw);e.setRotationFromQuaternion(t)}else{let t=this.addAntiZfightingOffset(this.basePitch),r=this.addAntiZfightingOffset(this.baseYaw),i=new Qe.Quaternion().setFromAxisAngle(new Qe.Vector3(1,0,0),t),s=new Qe.Quaternion().setFromAxisAngle(new Qe.Vector3(0,1,0),r),o=new Qe.Quaternion().setFromAxisAngle(new Qe.Vector3(0,0,1),Qe.MathUtils.degToRad(this.rollAngle)),l=new Qe.Quaternion,a=new Qe.Quaternion,v=this.worldRenderer.playerStateReactive.perspective;if(this.cameraBobInput){let u=$5(this.cameraBobInput);l=new Qe.Quaternion().setFromAxisAngle(new Qe.Vector3(0,0,1),u.rotation.z),a=new Qe.Quaternion().setFromAxisAngle(new Qe.Vector3(1,0,0),u.rotation.x),v==="first_person"&&this.worldRenderer.camera.position.set(u.position.x,u.position.y,0)}else v==="first_person"&&this.worldRenderer.camera.position.set(0,0,0);let c=s.multiply(i).multiply(o).multiply(l).multiply(a);e.setRotationFromQuaternion(c)}}easeOut(e){return 1-(1-e)*(1-e)}easeInOut(e){return e<.5?2*e*e:1-(-2*e+2)**2/2}addAntiZfightingOffset(e){let r=(e%(Math.PI*2)+Math.PI*2)%(Math.PI*2),i=.01;return Math.abs(r)<i||Math.abs(r-Math.PI/2)<i||Math.abs(r-Math.PI)<i||Math.abs(r-3*Math.PI/2)<i?e+.001:e}};A();E();R();x();import*as K from"three";var Sn=class{constructor(e){this.worldRenderer=e;d(this,"customMedia",new Map);d(this,"lastCheck",0);d(this,"THROTTLE_TIME",100);this.worldRenderer.onWorldSwitched.push(()=>{this.onWorldGone()}),this.worldRenderer.onRender.push(()=>{this.render()}),this.worldRenderer.onReactiveConfigUpdated("volume",()=>{let{volume:t}=this.worldRenderer.worldRendererConfig;for(let[r,i]of this.customMedia.entries())i.positionalAudio&&i.positionalAudio.setVolume((i.props.volume??1)*t)})}onWorldGone(){for(let[e,t]of this.customMedia.entries())this.destroyMedia(e)}onWorldStop(){for(let[e,t]of this.customMedia.entries())this.setVideoPlaying(e,!1)}createErrorTexture(e,t,r=16777215,i="Failed to load"){let s=new OffscreenCanvas(100,100),o=100;s.width=o,s.height=o;let l=s.getContext("2d");if(!l)return new K.CanvasTexture(s);l.clearRect(0,0,s.width,s.height),l.fillStyle=`rgba(${r>>16&255}, ${r>>8&255}, ${r&255}, 1)`,l.fillRect(0,0,s.width,s.height),l.fillStyle="#ff0000",l.font="bold 10px sans-serif",l.textAlign="center",l.textBaseline="middle",l.fillText(i,s.width/2,s.height/2,s.width);let a=new K.CanvasTexture(s);return a.minFilter=K.LinearFilter,a.magFilter=K.LinearFilter,a}createBackgroundTexture(e,t,r=0,i=1){let s=new OffscreenCanvas(1,1);s.width=1,s.height=1;let o=s.getContext("2d");if(!o)return new K.CanvasTexture(s);let l=r>>16&255,a=r>>8&255,v=r&255;o.fillStyle=`rgba(${l}, ${a}, ${v}, ${i})`,o.fillRect(0,0,1,1);let c=new K.CanvasTexture(s);return c.minFilter=K.NearestFilter,c.magFilter=K.NearestFilter,c}validateOrigin(e,t){if(t===!0)return!0;if(t===!1)return!1;let r=new URL(e);return t.some(i=>r.origin.endsWith(i))}onPageInteraction(){for(let[e,t]of this.customMedia.entries())t.hadAutoPlayError&&(t.hadAutoPlayError=!1,this.playVideo(e))}addMedia(e,t){let r=structuredClone(t);this.destroyMedia(e);let i=!1;t.src.startsWith("https://disk.yandex.ru/i/")&&(i=!0,t.src=`/ya-image?url=${t.src}`);let{scene:s}=this.worldRenderer;t.allowOrigins!==void 0&&!this.validateOrigin(t.src,t.allowOrigins)&&(t.src="");let l=t.src.endsWith(".png")||t.src.endsWith(".jpg")||t.src.endsWith(".jpeg")||t.imageOverride;i&&!t.imageOverride&&fetch(t.src,{method:"HEAD"}).then(S=>{S.headers.get("content-type")?.startsWith("image/")&&(this.destroyMedia(e),this.addMedia(e,{...r,src:t.src,imageOverride:!0}))}).catch(console.error);let a,v,c=de&&!l;if(!l&&!c){a=document.createElement("video"),a.src=t.src.endsWith(".gif")?t.src.replace(".gif",".mp4"):t.src,a.loop=t.loop??!0;let S=(t.volume??1)*this.worldRenderer.worldRendererConfig.volume;a.volume=Math.min(S,1),a.playsInline=!0,a.crossOrigin="anonymous";let B=this.worldRenderer.soundSystem;if(B.initAudioListener(),!B.audioListener)throw new Error("Audio listener not initialized");v=new K.PositionalAudio(B.audioListener),v.setRefDistance(6),v.setVolume(S),this.worldRenderer.sceneOrigin.addAndTrack(v),v.position.set(t.position.x,t.position.y,t.position.z),v.setMediaElementSource(a),v.connect(),a.addEventListener("pause",()=>{v?.pause(),globalThis.tempSendVideoStop?.(e,"paused",a.currentTime)}),a.addEventListener("play",()=>{v?.play(),globalThis.tempSendVideoPlay?.(e)}),a.addEventListener("seeked",()=>{v&&a&&(v.offset=a.currentTime)}),a.addEventListener("stalled",()=>{globalThis.tempSendVideoStop?.(e,"stalled",a.currentTime)}),a.addEventListener("waiting",()=>{globalThis.tempSendVideoStop?.(e,"waiting",a.currentTime)}),a.addEventListener("error",({error:P})=>{globalThis.tempSendVideoStop?.(e,`error: ${P}`,a.currentTime)}),a.addEventListener("ended",()=>{globalThis.tempSendVideoStop?.(e,"ended",a.currentTime),t.loop||(a.currentTime=0,T.ended=!0)})}let u=this.createBackgroundTexture(t.size.width,t.size.height,t.background),h=S=>{let B=this.createErrorTexture(t.size.width,t.size.height,t.background,S);b.map=B,b.needsUpdate=!0},p=new K.PlaneGeometry(1,1),m=t.allowLighting?K.MeshLambertMaterial:K.MeshBasicMaterial,b=new m({map:u,transparent:!0,side:t.doubleSide?K.DoubleSide:K.FrontSide,alphaTest:.1}),k;if(a)k=new K.VideoTexture(a);else if(c)k=this.createErrorTexture(t.size.width,t.size.height,t.background,"Video unavailable (multi-thread)");else if(de){let S=Or(t.src);k=S.texture,k.minFilter=K.NearestFilter,k.magFilter=K.NearestFilter,S.promise.then(()=>{this.customMedia.get(e)?.texture===k&&(b.map=k,b.needsUpdate=!0)}).catch(()=>h())}else k=new K.TextureLoader().load(t.src,()=>{this.customMedia.get(e)?.texture===k&&(b.map=k,b.needsUpdate=!0)},void 0,()=>h());k.minFilter=K.NearestFilter,k.magFilter=K.NearestFilter,k.generateMipmaps=!1;let _=new K.Mesh(p,b),{mesh:y}=this.positionMeshExact(_,K.MathUtils.degToRad((t.rotation??0)*90),t.position,t.size.width,t.size.height);s.add(y),a&&(_.onBeforeRender=()=>{a.readyState===a.HAVE_ENOUGH_DATA&&(!a.paused||!T?.hadAutoPlayError)&&(b.map!==k&&(b.map=k,b.needsUpdate=!0),k.needsUpdate=!0,v&&(v.position.copy(y.position),v.rotation.copy(y.rotation)))});let M=S=>{let B=p.attributes.uv.array;B[0]=S.startU,B[1]=S.startV,B[2]=S.endU,B[3]=S.startV,B[4]=S.endU,B[5]=S.endV,B[6]=S.startU,B[7]=S.endV,p.attributes.uv.needsUpdate=!0};t.uvMapping&&M(t.uvMapping);let T={mesh:y,video:a,texture:k,updateUVMapping:M,positionalAudio:v,props:r,hadAutoPlayError:!1,pausedBecuaseHidden:!1,ended:!1,handleError(S){if(T.destroyed)return;let B=P=>P;h(S.name==="NotAllowedError"||S.name==="AbortError"?B("Waiting for user interaction"):B("Failed to auto play"))}};return this.customMedia.set(e,T),a&&t.autoPlay&&this.playVideo(e,!0),e}playVideo(e,t=!1){let r=this.customMedia.get(e);if(r?.video){if(!t&&r.positionalAudio&&r.video.currentTime<1){let i=r.video.currentTime;this.addMedia(e,r.props),r.video.currentTime=i,r.props.autoPlay||this.playVideo(e,!0);return}r.video.play().then(()=>{r.hadAutoPlayError=!1}).catch(i=>{r.pausedBecuaseHidden||((i.name==="NotAllowedError"||i.name==="AbortError"||i.message?.includes("not allowed")&&!r.pausedBecuaseHidden)&&(r.hadAutoPlayError=!0),r.handleError(i))})}}render(){for(let[e,t]of this.customMedia.entries()){let r=t.mesh.visible;t.mesh.visible=this.worldRenderer.shouldObjectVisible(t.mesh)&&!t.mesh.forceHide,r!==t.mesh.visible&&t.video&&(t.mesh.visible?t.pausedBecuaseHidden&&(this.playVideo(e),t.pausedBecuaseHidden=!1):t.video.paused||(t.video.pause(),t.pausedBecuaseHidden=!0))}}setVideoPlaying(e,t){let r=this.customMedia.get(e);r?.video&&(t?this.playVideo(e):r.video.pause())}setVideoSeeking(e,t){let r=this.customMedia.get(e);r?.video&&(r.video.currentTime=t)}setVideoVolume(e,t){let r=this.customMedia.get(e);r?.video&&(r.video.volume=t)}setVideoSpeed(e,t){let r=this.customMedia.get(e);r?.video&&(r.video.playbackRate=t)}setControlMode(e,t,r){let i=this.customMedia.get(e);i?.video&&(i.props.controlMode={mouseButton:t,controlMode:r})}destroyMedia(e){let{scene:t}=this.worldRenderer,r=this.customMedia.get(e);if(r){r.destroyed=!0,r.video&&(r.video.pause(),r.video.src="",r.video.remove()),r.positionalAudio&&this.worldRenderer.sceneOrigin.removeAndUntrack(r.positionalAudio),this.worldRenderer.sceneOrigin.removeAndUntrack(r.mesh),r.texture.dispose();let i=r.mesh.children[0];i&&(i.geometry.dispose(),i.material instanceof K.Material&&i.material.dispose()),this.customMedia.delete(e)}}positionMeshExact(e,t,r,i,s,o=1){t===0&&(r.z+=.001),t===Math.PI/2&&(r.x-=.001),t===Math.PI&&(r.z-=.001),t===3*Math.PI/2&&(r.x+=.001),t===0&&(r.z+=1),t===Math.PI&&(r.x+=1),t===3*Math.PI/2&&(r.z+=1,r.x+=1),e.matrix.identity(),e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1),e.rotateY(t),(t===Math.PI/2||t===3*Math.PI/2)&&(e.rotateZ(-Math.PI),e.rotateX(-Math.PI)),e.scale.set(i,s,o),e.geometry.translate(.5,.5,0),e.geometry.attributes.position.needsUpdate=!0,this.worldRenderer.sceneOrigin.track(e),e.position.set(r.x,r.y,r.z);let l=new K.Group;l.add(e);let a=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711680}));a.position.set(r.x,r.y,r.z),l.add(a);let v=r.x+Math.cos(t)*i,c=r.z+Math.sin(t)*i,u=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:255}));u.position.set(r.x,r.y+s,r.z),l.add(u);let h=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16776960}));h.position.set(v,r.y,c),l.add(h);let p=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711935}));p.position.set(v,r.y+s,c),l.add(p);let m=new K.Vector3(this.worldRenderer.sceneOrigin.toSceneX(r.x),this.worldRenderer.sceneOrigin.toSceneY(r.y),this.worldRenderer.sceneOrigin.toSceneZ(r.z)),b=new K.ArrowHelper(new K.Vector3(Math.cos(t),0,Math.sin(t)),m,1,16711680);return l.add(b),{mesh:e,debugGroup:l}}createTestCanvasTexture(){let e=new OffscreenCanvas(100,100);e.width=100,e.height=100;let t=e.getContext("2d");return t?(t.font="10px Arial",t.fillStyle="red",t.fillText("Hello World",0,10),new K.CanvasTexture(e)):null}tryIntersectMedia(){if(Date.now()-this.lastCheck<this.THROTTLE_TIME)return;if(this.customMedia.size===0){this.worldRenderer.reactiveState.world.intersectMedia=null,this.worldRenderer.debugVideo=null,this.worldRenderer.cursorBlock.cursorLinesHidden=!1;return}this.lastCheck=Date.now();let{camera:e,scene:t}=this.worldRenderer,r=new K.Raycaster,i=new K.Vector2(0,0);r.setFromCamera(i,e);let s=r.intersectObjects(t.children,!0);if(s.length>0){let o=s[0],l=o.object;for(let[a,v]of this.customMedia.entries())if(l===v.mesh||v.mesh.children.includes(l)){let{uv:c}=o;if(c){let u={id:a,x:c.x,y:c.y};this.worldRenderer.reactiveState.world.intersectMedia=u,this.worldRenderer.debugVideo=v,this.worldRenderer.cursorBlock.cursorLinesHidden=!0;return}}}this.worldRenderer.reactiveState.world.intersectMedia=null,this.worldRenderer.debugVideo=null,this.worldRenderer.cursorBlock.cursorLinesHidden=!1}handleUserClick(e){let t=this.worldRenderer.reactiveState.world.intersectMedia;if(t){let{id:r,x:i,y:s}=t,o=this.customMedia.get(r),l=o?.props.controlMode;if(o?.video&&(l?.mouseButton==="both"||l?.mouseButton===e))switch(l?.controlMode){case"play_pause":{this.setVideoPlaying(r,o.video.paused);break}case"play_if_ended":{o.ended&&this.setVideoPlaying(r,!0);break}case"toggle_mute":{o.video.muted=!o.video.muted;break}}}}};A();E();R();x();import*as r0 from"three";A();E();R();x();import*as Ce from"three";var Od=1,x7=10,Tt={TARGET_SCREEN_PX:150,CANVAS_SIZE:256,LAYOUT:{DOT_Y:.3,NAME_Y:.45,DISTANCE_Y:.55},CANVAS_SCALE:2,ARROW:{enabledDefault:!1,pixelSize:50,paddingPx:50},DEFAULT_VISUAL_SCALE:1,DEFAULT_OPACITY:1};function k7(n){let e=n.color??16711680,t=n.depthTest??!1,r=n.visualScale??n.metadata?.visualScale??(typeof window>"u"?void 0:window.serverMetadata?.waypointVisualScale)??Tt.DEFAULT_VISUAL_SCALE,i=n.opacity??n.metadata?.opacity??(typeof window>"u"?void 0:window.serverMetadata?.waypointOpacity)??Tt.DEFAULT_OPACITY,s=Ne(R7(),R7());Tn(s,e,n.label??"","0m",r);let o=new Ce.CanvasTexture(s);o.anisotropy=1,o.magFilter=Ce.LinearFilter,o.minFilter=Ce.LinearFilter;let l=new Ce.SpriteMaterial({map:o,transparent:!0,opacity:1,depthTest:t,depthWrite:!1}),a=new Ce.Sprite(l);a.position.set(0,0,0),a.renderOrder=10,a.material.opacity=i;let v=n.label??"",c="0m",u=Number.NaN,h,p,m,b,k=null,_=Tt.ARROW.enabledDefault,y=new Ce.Group;y.add(a);let{x:M,y:T,z:S}=n.position;y.position.set(M,T,S);function B(){o.needsUpdate=!0}function P(){if(!p||!m)return;let Q=p.width;m.clearRect(0,0,Q,Q),m.beginPath(),m.moveTo(Q*.15,Q*.5),m.lineTo(Q*.85,Q*.5),m.lineTo(Q*.5,Q*.15),m.closePath();let ce=`#${e.toString(16).padStart(6,"0")}`;m.lineWidth=6,m.strokeStyle="black",m.stroke(),m.fillStyle=ce,m.fill(),b&&(b.needsUpdate=!0)}function H(Q){e=Q,c="0m",u=0,Tn(s,e,v,"0m",r),B(),h&&P()}function V(Q){v=Q??"",Tn(s,e,v,c,r),B()}function z(Q,ce){ce!==c&&(c=ce,Tn(s,e,Q,ce,r),B())}function N(Q){a.visible=Q}function Y(Q,ce,be){y.position.set(Q,ce,be)}function q(Q,ce,be,qe){let Re=ce*Math.PI/180,ye=Math.tan(Re/2)*2*be*(Tt.TARGET_SCREEN_PX*r/qe);a.scale.set(ye,ye,1)}function J(){if(h)return;let Q=128;p=Ne(Q,Q),m=p.getContext("2d"),P(),b=new Ce.CanvasTexture(p),b.anisotropy=1,b.magFilter=Ce.LinearFilter,b.minFilter=Ce.LinearFilter;let ce=new Ce.SpriteMaterial({map:b,transparent:!0,depthTest:!1,depthWrite:!1,opacity:i});h=new Ce.Sprite(ce),h.renderOrder=12,h.visible=!1,k&&k.add(h)}function te(Q){_=Q,!Q&&h&&(h.visible=!1)}function se(Q){h?.parent&&h.parent.remove(h),k=Q,h&&Q&&Q.add(h)}function he(Q,ce,be){if(!_||(J(),!h))return!0;let qe=n.metadata?.onlyLeftRight===!0,Re=new Ce.Vector3;Q.getWorldDirection(Re);let at=Q.up.clone().normalize(),ye=new Ce.Vector3().copy(Re).cross(at).normalize(),ut=new Ce.Vector3().copy(ye).cross(Re).normalize(),_r=new Ce.Vector3().setFromMatrixPosition(Q.matrixWorld),wr=new Ce.Vector3(y.position.x,y.position.y,y.position.z).sub(_r),l0=wr.dot(Re),jt=wr.dot(ye),v0=wr.dot(ut),A5=ce/be,c0=Q.fov*Math.PI/180,G0=2*Math.atan(Math.tan(c0/2)*A5),E5=Math.atan2(jt,l0),x5=Math.atan2(v0,l0);if(l0>0&&Math.abs(E5)<=G0/2&&Math.abs(x5)<=c0/2)return h.visible=!1,!0;let st=E5/(G0/2),Ie=x5/(c0/2);l0<=0&&(Math.abs(st)>Math.abs(Ie)?(st=Math.sign(st),Ie=0):(st=0,Ie=Math.sign(Ie))),qe&&(Math.abs(st)>Math.abs(Ie)||(st=st>=0?1:-1),Ie=0);let N0=Math.max(Math.abs(st),Math.abs(Ie))||1,Ar=st/N0,gt=Ie/N0,W0=Tt.ARROW.paddingPx,w=(Ar+1)*.5*ce,f=(1-gt)*.5*be,g=Math.min(Math.max(w,W0),ce-W0),C=Math.min(Math.max(f,W0),be-W0);Ar=g/ce*2-1,gt=-(C/be)*2+1;let I=Math.max(2,Q.near*4),U=Math.tan(c0/2)*I,G=U*A5,ie=_r.clone().add(Re.clone().multiplyScalar(I)).add(ye.clone().multiplyScalar(Ar*G)).add(ut.clone().multiplyScalar(gt*U));h.visible=!0,h.position.copy(ie);let Ae=Math.atan2(Ie,st);h.material.rotation=Ae-Math.PI/2;let we=Math.tan(c0/2)*2*I*(Tt.ARROW.pixelSize*r/be);return h.scale.set(we,we,1),!1}function fe(Q){return Q.distanceTo(y.position)}function pe(Q,ce,be,qe){let Re=fe(Q);q(Q,ce.fov,Re,qe);let at=Math.round(Re/x7)*x7;at!==u&&(u=at,z(v,`${Math.max(0,at)}m`));let ye=he(ce,be,qe);return N(ye),ye}function oe(){let Q=a.material;if(Q.map?.dispose(),Q.dispose(),h){h.parent&&h.parent.remove(h);let ce=h.material;ce.map?.dispose(),ce.dispose()}h=void 0,p=void 0,m=void 0,b=void 0}return{group:y,sprite:a,enableOffscreenArrow:te,setArrowParent:se,updateForCamera:pe,setColor:H,setLabel:V,updateDistanceText:z,setVisible:N,setPosition:Y,dispose:oe}}function S7(){let n=globalThis.devicePixelRatio||1,e=Math.min(n,Od);return Tt.CANVAS_SCALE*e}function R7(){return Math.round(Tt.CANVAS_SIZE*S7())}function Tn(n,e,t,r,i){let s=n.width,o=S7(),l=n.getContext("2d");l.clearRect(0,0,s,s);let a=s/2,v=Math.round(s*Tt.LAYOUT.DOT_Y),c=Math.round(s*.05*i),u=Math.max(2,Math.round(4*o*i)),h=c+u;l.beginPath(),l.arc(a,v,h,0,Math.PI*2),l.fillStyle=`#${e.toString(16).padStart(6,"0")}`,l.fill(),l.textAlign="center",l.textBaseline="middle";let p=Math.round(s*.08*i),m=Math.round(s*.06*i);l.font=`800 ${p}px mojangles`,l.lineWidth=Math.max(2,Math.round(3*o*i));let b=Math.round(s*Tt.LAYOUT.NAME_Y);l.strokeStyle="black",l.strokeText(t,a,b),l.fillStyle="white",l.fillText(t,a,b),l.font=`800 ${m}px mojangles`,l.lineWidth=Math.max(2,Math.round(2*o*i));let k=Math.round(s*Tt.LAYOUT.DISTANCE_Y);l.strokeStyle="black",l.strokeText(r,a,k),l.fillStyle="#CCCCCC",l.fillText(r,a,k)}var Mn=class{constructor(e){this.worldRenderer=e;d(this,"waypoints",new Map);d(this,"waypointScene",new r0.Scene);d(this,"lastCameraPosition",new r0.Vector3);d(this,"lastUpdateTime",0);d(this,"UPDATE_THROTTLE_MS",16)}updateWaypoints(){let e=performance.now(),t=this.worldRenderer.getCameraPosition(),r=this.lastCameraPosition.distanceTo(t)>.5,i=e-this.lastUpdateTime>this.UPDATE_THROTTLE_MS;if(!r&&!i)return;this.lastCameraPosition.copy(t),this.lastUpdateTime=e;let s=this.worldRenderer.renderer.getSize(new r0.Vector2);for(let o of this.waypoints.values()){let l=new r0.Vector3(o.x,o.y,o.z),a=t.distanceTo(l),v=(!o.minDistance||a>=o.minDistance)&&(o.maxDistance===1/0||a<=o.maxDistance);o.sprite.setVisible(v),v&&(o.sprite.setPosition(this.worldRenderer.sceneOrigin.toSceneX(o.x),this.worldRenderer.sceneOrigin.toSceneY(o.y),this.worldRenderer.sceneOrigin.toSceneZ(o.z)),o.sprite.updateForCamera(this.worldRenderer.getCameraPosition(),this.worldRenderer.camera,s.width,s.height))}}render(){this.waypoints.size!==0&&(this.updateWaypoints(),this.worldRenderer.renderer.render(this.waypointScene,this.worldRenderer.camera))}addWaypoint(e,t,r,i,s={}){this.removeWaypoint(e);let o=s.color??16711680,{label:l,metadata:a}=s,v=s.minDistance??0,c=s.maxDistance??1/0,u=k7({position:new r0.Vector3(t,r,i),color:o,label:l||e,metadata:a});u.enableOffscreenArrow(!0),u.setArrowParent(this.waypointScene),this.waypointScene.add(u.group),this.waypoints.set(e,{id:e,x:t+.5,y:r+.5,z:i+.5,minDistance:v,maxDistance:c,color:o,label:l,sprite:u})}removeWaypoint(e){let t=this.waypoints.get(e);t&&(this.waypointScene.remove(t.sprite.group),t.sprite.dispose(),this.waypoints.delete(e))}clear(){for(let e of this.waypoints.keys())this.removeWaypoint(e)}testWaypoint(){this.addWaypoint("Test Point",0,70,0,{color:65280,label:"Test Point"}),this.addWaypoint("Spawn",0,64,0,{color:16776960,label:"Spawn"}),this.addWaypoint("Far Point",100,70,100,{color:255,label:"Far Point"}),this.addWaypoint("Far Point 2",180,170,100,{color:255,label:"Far Point 2"}),this.addWaypoint("Far Point 3",1e3,100,1e3,{color:255,label:"Far Point 3"})}getWaypoint(e){return this.waypoints.get(e)}getAllWaypoints(){return[...this.waypoints.values()]}setWaypointColor(e,t){let r=this.waypoints.get(e);r&&(r.sprite.setColor(t),r.color=t)}setWaypointLabel(e,t){let r=this.waypoints.get(e);r&&(r.label=t,r.sprite.setLabel(t))}};A();E();R();x();import*as Se from"three";import{Vec3 as l5}from"vec3";var ke=class ke{constructor(e){this.worldRenderer=e;d(this,"explosions",new Map);d(this,"particleGeometry");d(this,"particleMaterials",[]);d(this,"testModeTimer");d(this,"explosionCounter",0);this.particleGeometry=new Se.BoxGeometry(ke.DEFAULT_PARTICLE_SIZE,ke.DEFAULT_PARTICLE_SIZE,ke.DEFAULT_PARTICLE_SIZE),this.createParticleMaterials()}createParticleMaterials(){let e=[16711680,65280,255,16776960,16711935,65535,16753920,8388736,16761035,16777215];for(let t of e){let r=new Se.MeshBasicMaterial({color:t,transparent:!0,opacity:1});this.particleMaterials.push(r)}}getRandomMaterial(){return this.particleMaterials[Math.floor(Math.random()*this.particleMaterials.length)]}createExplosion(e,t=1,r,i=ke.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],l=Math.floor(ke.DEFAULT_PARTICLE_COUNT*t),a;if(ke.DEBUG_SHOW_EXPLOSION_CENTER){let c=.5*t,u=new Se.SphereGeometry(c,8,8),h=new Se.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});a=new Se.Mesh(u,h),a.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(a),a.position.set(e.x,e.y,e.z)}for(let c=0;c<l;c++){let u=Math.random()*Math.PI*2,h=Math.sqrt(Math.random())*ke.VELOCITY_FACTOR*t,p=new l5(h*Math.cos(u),Math.random()*.5-.25,h*Math.sin(u));c<5;let m=r===void 0?this.getRandomMaterial().clone():new Se.MeshBasicMaterial({color:r,transparent:!0,opacity:1}),b=new Se.Mesh(this.particleGeometry,m);b.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(b),b.position.set(e.x,e.y,e.z),c<5;let k={position:e.clone(),velocity:p,color:new Se.Color(m.color),life:1,maxLife:1,mesh:b};o.push(k)}let v={id:s,position:e.clone(),particles:o,startTime:Date.now(),duration:i,size:t,debugSphere:a};return this.explosions.set(s,v),v}createExplosionFacingCamera(e,t=1,r,i=ke.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],l=Math.floor(ke.DEFAULT_PARTICLE_COUNT*t),a;if(ke.DEBUG_SHOW_EXPLOSION_CENTER){let h=.5*t,p=new Se.SphereGeometry(h,8,8),m=new Se.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});a=new Se.Mesh(p,m),a.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(a),a.position.set(e.x,e.y,e.z)}let v=this.worldRenderer.getCameraPosition(),c=new l5(v.x-e.x,v.y-e.y,v.z-e.z).normalize();for(let h=0;h<l;h++){let p=Math.random()*Math.PI*2,m=Math.sqrt(Math.random())*ke.VELOCITY_FACTOR*t,b=new l5(m*Math.cos(p),m*Math.sin(p),0),k=new l5(b.x*c.x-b.z*c.z,b.y,b.x*c.z+b.z*c.x);h<5;let _=r===void 0?this.getRandomMaterial().clone():new Se.MeshBasicMaterial({color:r,transparent:!0,opacity:1}),y=new Se.Mesh(this.particleGeometry,_);y.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(y),y.position.set(e.x,e.y,e.z);let M={position:e.clone(),velocity:k,color:new Se.Color(_.color),life:1,maxLife:1,mesh:y};o.push(M)}let u={id:s,position:e.clone(),particles:o,startTime:Date.now(),duration:i,size:t,debugSphere:a};return this.explosions.set(s,u),u}explode(e,t=1,r,i){return this.createExplosion(e,t,r,i).id}explodeFacingCamera(e,t=1,r,i){return this.createExplosionFacingCamera(e,t,r,i).id}startTestMode(){let e=this.worldRenderer.getCameraPosition(),t=new l5(e.x,e.y+10,e.z);this.testModeTimer=setInterval(()=>{let r=.8+Math.random()*.4,i=[16711680,65280,255,16776960,16711935,65535,16753920],s=i[Math.floor(Math.random()*i.length)];this.explodeFacingCamera(t,r,s)},ke.TEST_INTERVAL)}updateParticle(e,t,r){let i=e.mesh.position.x===e.position.x&&e.mesh.position.y===e.position.y&&e.mesh.position.z===e.position.z;i&&e.life>.95,e.velocity.y+=ke.GRAVITY;let s=e.position.clone(),o=t/1e3;e.position.add(e.velocity.scaled(o)),e.mesh.position.set(e.position.x,e.position.y,e.position.z);let l=e.life;e.life-=t/r;let a=Math.max(0,e.life);if(e.mesh.material instanceof Se.MeshBasicMaterial&&(e.mesh.material.opacity=a),i&&l>.95){let v=e.position.distanceTo(s)}return e.life>0}render(){let e=Date.now(),t=16.67;this.explosions.size>0&&Math.random()<.01;for(let[r,i]of this.explosions.entries()){let s=e-i.startTime;if(s>=i.duration){this.removeExplosion(r);continue}s%2e3<16,i.particles=i.particles.filter(o=>this.updateParticle(o,t,i.duration)),i.particles.length===0&&this.removeExplosion(r)}}removeExplosion(e){let t=this.explosions.get(e);if(t){for(let r of t.particles)this.worldRenderer.sceneOrigin.removeAndUntrack(r.mesh),r.mesh.material instanceof Se.Material&&r.mesh.material.dispose();t.debugSphere&&(this.worldRenderer.sceneOrigin.removeAndUntrack(t.debugSphere),t.debugSphere.geometry.dispose(),t.debugSphere.material instanceof Se.Material&&t.debugSphere.material.dispose()),this.explosions.delete(e)}}stopTestMode(){this.testModeTimer&&(clearInterval(this.testModeTimer),this.testModeTimer=void 0)}destroy(){this.stopTestMode();for(let e of this.explosions.keys())this.removeExplosion(e);for(let e of this.particleMaterials)e.dispose();this.particleGeometry.dispose()}};d(ke,"DEFAULT_PARTICLE_COUNT",50),d(ke,"DEFAULT_PARTICLE_SIZE",.05),d(ke,"DEFAULT_EXPLOSION_DURATION",6e3),d(ke,"GRAVITY",-.005),d(ke,"VELOCITY_FACTOR",1.5),d(ke,"TEST_INTERVAL",1e3),d(ke,"DEBUG_SHOW_EXPLOSION_CENTER",!0),d(ke,"DEBUG_SHOW_PARTICLE_TRAILS",!1);var Cn=ke;A();E();R();x();import*as L0 from"three";import{Vec3 as X1}from"vec3";var Bn=class n{constructor(e,t,r,i){this.worldRenderer=e;this.updateCamera=t;this.updateFov=r;this.getInitialState=i;d(this,"isRunning",!1);d(this,"currentScript",null);d(this,"currentPointIndex",0);d(this,"currentTweens",[]);d(this,"startTime",0);d(this,"totalDuration",0);d(this,"currentPosition",{x:0,y:0,z:0});d(this,"currentRotation",{yaw:0,pitch:0});d(this,"currentFov",75)}startScript(e){if(this.isRunning||!e.points||e.points.length===0)return!1;this.currentScript=e,this.isRunning=!0,this.currentPointIndex=0,this.startTime=performance.now(),this.totalDuration=e.points.reduce((r,i)=>r+i.duration,0);let t=this.getInitialState();return this.currentPosition={x:t.position.x,y:t.position.y,z:t.position.z},this.currentRotation={yaw:t.yaw,pitch:t.pitch},this.currentFov=t.fov,this.moveToPoint(0),!0}stopScript(){if(this.isRunning){for(let e of this.currentTweens)e.stop();this.currentTweens=[],this.isRunning=!1,this.currentScript=null,this.currentPointIndex=0}}runExampleScripts(e){let t=this.worldRenderer.getCameraPosition(),r=new X1(t.x,t.y,t.z),i=n.createCircularFlyby(r,30,20,15e3),s=n.createSpiralDescent(r.offset(0,50,0),r,3,12e3),o=n.createBuildingTour([{pos:r.offset(-20,10,-20),lookAt:r,duration:3e3},{pos:r.offset(20,15,-20),lookAt:r,duration:3e3},{pos:r.offset(20,20,20),lookAt:r,duration:3e3},{pos:r.offset(-20,25,20),lookAt:r,duration:3e3}]),l=[i,s,o];return this.startScript(l[e]),{circular:i,spiral:s,buildingTour:o}}moveToPoint(e){if(!this.currentScript||e>=this.currentScript.points.length){this.handleScriptComplete();return}let t=this.currentScript.points[e],{duration:r}=t,i={x:t.x,y:t.y,z:t.z},s={yaw:t.yaw,pitch:t.pitch},o=t.fov??this.currentFov;if(t.lookAt){let u=new L0.Vector3(t.lookAt.x,t.lookAt.y,t.lookAt.z),h=new L0.Vector3(t.x,t.y,t.z),p=u.sub(h).normalize();s.yaw=Math.atan2(-p.x,-p.z),s.pitch=Math.asin(p.y)}let l=this.getEasingFunction(t.easing||"easeInOut"),a=new Ge(this.currentPosition).to(i,r).easing(l).onUpdate(()=>{this.updateCamera(new X1(this.currentPosition.x,this.currentPosition.y,this.currentPosition.z),this.currentRotation.yaw,this.currentRotation.pitch)}),v=new Ge(this.currentRotation).to(this.wrapRotation(s),r).easing(l).onUpdate(()=>{this.updateCamera(new X1(this.currentPosition.x,this.currentPosition.y,this.currentPosition.z),this.currentRotation.yaw,this.currentRotation.pitch)}),c=null;if(Math.abs(o-this.currentFov)>.1){let u={fov:this.currentFov};c=new Ge(u).to({fov:o},r).easing(l).onUpdate(()=>{this.currentFov=u.fov,this.updateFov(this.currentFov)})}this.currentTweens=[a,v],c&&this.currentTweens.push(c),a.start(),v.start(),c?.start(),a.onComplete(()=>{this.currentPointIndex++,this.currentScript?.onPointReached?.(e,t),this.isRunning&&this.moveToPoint(this.currentPointIndex)})}wrapRotation(e){let t=e.yaw,r=t-this.currentRotation.yaw;r>Math.PI?t-=2*Math.PI:r<-Math.PI&&(t+=2*Math.PI);let i=Math.max(-Math.PI/2+.01,Math.min(Math.PI/2-.01,e.pitch));return{yaw:t,pitch:i}}getEasingFunction(e){switch(e){case"linear":return Fe.Linear.None;case"easeIn":return Fe.Quadratic.In;case"easeOut":return Fe.Quadratic.Out;case"easeInOut":return Fe.Quadratic.InOut;case"smoothstep":return Fe.Cubic.InOut;case"bounce":return Fe.Bounce.Out;default:return Fe.Quadratic.InOut}}handleScriptComplete(){if(!this.currentScript)return;let e=this.currentScript;e.loop?(this.currentPointIndex=0,this.moveToPoint(0)):(e.onComplete?.(),this.stopScript())}get running(){return this.isRunning}get progress(){if(!this.isRunning||this.totalDuration===0)return 0;let e=performance.now()-this.startTime;return Math.min(e/this.totalDuration,1)}get currentScriptName(){return this.currentScript?.name}static createCircularFlyby(e,t,r,i){let s=[];for(let l=0;l<=8;l++){let a=l/8*Math.PI*2,v=e.x+Math.cos(a)*t,c=e.z+Math.sin(a)*t,u=e.y+r;s.push({x:v,y:u,z:c,yaw:a+Math.PI/2,pitch:-.2,duration:i/8,easing:"smoothstep",lookAt:{x:e.x,y:e.y,z:e.z}})}return{name:"Circular Flyby",points:s,loop:!1}}static createSpiralDescent(e,t,r,i){let s=[],o=r*8,l=20;for(let a=0;a<=o;a++){let v=a/o,c=v*r*Math.PI*2,u=L0.MathUtils.lerp(e.x,t.x,v)+Math.cos(c)*l*(1-v),h=L0.MathUtils.lerp(e.z,t.z,v)+Math.sin(c)*l*(1-v),p=L0.MathUtils.lerp(e.y,t.y,v);s.push({x:u,y:p,z:h,yaw:c+Math.PI/2,pitch:-.3*v,duration:i/o,easing:"easeInOut"})}return{name:"Spiral Descent",points:s,loop:!1}}static createBuildingTour(e){return{name:"Building Tour",points:e.map((r,i)=>({x:r.pos.x,y:r.pos.y,z:r.pos.z,yaw:0,pitch:0,duration:r.duration||3e3,easing:"smoothstep",lookAt:r.lookAt?{x:r.lookAt.x,y:r.lookAt.y,z:r.lookAt.z}:void 0})),loop:!1}}};A();E();R();x();import*as ee from"three";var Z1=.75,Pn=class{constructor(e,t,r){this.scene=e;this.defaultSkybox=t;this.initialImage=r;d(this,"texture",null);d(this,"mesh",null);d(this,"skyMesh",null);d(this,"voidMesh",null);d(this,"worldTime",0);d(this,"partialTicks",0);d(this,"viewDistance",4);d(this,"temperature",Z1);d(this,"inWater",!1);d(this,"waterBreathing",!1);d(this,"fogBrightness",0);d(this,"prevFogBrightness",0);d(this,"fogOrangeness",0);d(this,"distanceFactor",2.7);d(this,"brightnessAtPosition",1);d(this,"debugGui");this.debugGui=new Ut("skybox_renderer",this,["temperature","worldTime","inWater","waterBreathing","fogOrangeness","brightnessAtPosition","distanceFactor"],{brightnessAtPosition:{min:0,max:1,step:.01},temperature:{min:0,max:1,step:.01},worldTime:{min:0,max:24e3,step:1},fogOrangeness:{min:-1,max:1,step:.01},distanceFactor:{min:0,max:5,step:.01}}),r||this.createGradientSky()}async init(){this.initialImage&&await this.setSkyboxImage(this.initialImage)}async setSkyboxImage(e){this.texture&&this.texture.dispose();let t=new ee.TextureLoader;if(this.texture=await new Promise(r=>{t.load(e,i=>{i.mapping=ee.EquirectangularReflectionMapping,i.colorSpace=ee.SRGBColorSpace,i.minFilter=ee.NearestFilter,i.magFilter=ee.NearestFilter,i.needsUpdate=!0,r(i)})}),this.mesh)this.mesh.material.map=this.texture,this.mesh.material.needsUpdate=!0;else{let r=new ee.SphereGeometry(500,60,40);r.scale(-1,1,1);let i=new ee.MeshBasicMaterial({map:this.texture,side:ee.FrontSide});this.mesh=new ee.Mesh(r,i),this.scene.add(this.mesh)}}update(e,t){t!==this.viewDistance&&(this.viewDistance=t,this.updateSkyColors()),this.mesh?this.mesh.position.set(0,0,0):this.skyMesh&&(this.skyMesh.position.set(0,0,0),this.voidMesh?.position.set(0,0,0),this.updateSkyColors())}updateTime(e,t=0){this.debugGui.visible||(this.worldTime=e,this.partialTicks=t,this.updateSkyColors())}updateViewDistance(e){this.viewDistance=e,this.updateSkyColors()}updateTemperature(e){this.debugGui.visible||(this.temperature=e,this.updateSkyColors())}updateWaterState(e,t){this.debugGui.visible||(this.inWater=e,this.waterBreathing=t,this.updateSkyColors())}updateDefaultSkybox(e){this.debugGui.visible||(this.defaultSkybox=e,this.updateSkyColors())}createGradientSky(){{let r=new ee.PlaneGeometry(768,768);r.rotateX(-Math.PI/2),r.translate(0,16,0);let i=new ee.MeshBasicMaterial({color:16777215,side:ee.DoubleSide,depthTest:!1});this.skyMesh=new ee.Mesh(r,i),this.scene.add(this.skyMesh)}{let r=new ee.PlaneGeometry(768,768);r.rotateX(-Math.PI/2),r.translate(0,-16,0);let i=new ee.MeshBasicMaterial({color:16777215,side:ee.DoubleSide,depthTest:!1});this.voidMesh=new ee.Mesh(r,i),this.scene.add(this.voidMesh)}this.updateSkyColors()}getFogColor(e=0){let t=this.getCelestialAngle(e),r=Math.cos(t*Math.PI*2)*2+.5;r=Math.max(0,Math.min(1,r));let i=.7529412,s=.84705883,o=1;return i*=r*.94+.06,s*=r*.94+.06,o*=r*.91+.09,new ee.Vector3(i,s,o)}getSkyColor(e=0,t=0,r=0){let i=this.getCelestialAngle(r),s=Math.cos(i*3.141593*2)*2+.5;s<0&&(s=0),s>1&&(s=1);let o=this.getTemperature(e,t),l=this.getSkyColorByTemp(o),a=(l>>16&255)/255,v=(l>>8&255)/255,c=(l&255)/255;return new ee.Vector3(a*s,v*s,c*s)}calculateCelestialAngle(e,t){let i=(e%24e3+t)/24e3-.25;return i<0&&i++,i>1&&i--,i=1-(Math.cos(i*Math.PI)+1)/2,i+=(i-i)/3,i}getCelestialAngle(e){return this.calculateCelestialAngle(this.worldTime,e)}getTemperature(e,t){return this.temperature}getSkyColorByTemp(e){e/=3,e<-1&&(e=-1),e>1&&(e=1);let t=.6222222-e*.05,i=this.fogOrangeness>0?t+(.12-t)*this.fogOrangeness*.8:t+this.fogOrangeness*.1,s=.5+e*.1+Math.abs(this.fogOrangeness)*.3;return this.hsbToRgb(i,s,1)}hsbToRgb(e,t,r){let i=0,s=0,o=0;if(t===0)i=s=o=Math.floor(r*255+.5);else{let l=(e-Math.floor(e))*6,a=l-Math.floor(l),v=r*(1-t),c=r*(1-t*a),u=r*(1-t*(1-a));switch(Math.floor(l)){case 0:i=Math.floor(r*255+.5),s=Math.floor(u*255+.5),o=Math.floor(v*255+.5);break;case 1:i=Math.floor(c*255+.5),s=Math.floor(r*255+.5),o=Math.floor(v*255+.5);break;case 2:i=Math.floor(v*255+.5),s=Math.floor(r*255+.5),o=Math.floor(u*255+.5);break;case 3:i=Math.floor(v*255+.5),s=Math.floor(c*255+.5),o=Math.floor(r*255+.5);break;case 4:i=Math.floor(u*255+.5),s=Math.floor(v*255+.5),o=Math.floor(r*255+.5);break;case 5:i=Math.floor(r*255+.5),s=Math.floor(v*255+.5),o=Math.floor(c*255+.5);break}}return 4278190080|i<<16|s<<8|Math.trunc(o)}updateSkyColors(){if(!this.skyMesh||!this.voidMesh)return;if(!this.defaultSkybox){this.skyMesh.visible=!1,this.voidMesh.visible=!1,this.mesh&&(this.mesh.visible=!1);return}this.skyMesh.visible=!0,this.voidMesh.visible=!0,this.mesh&&(this.mesh.visible=!0),this.prevFogBrightness=this.fogBrightness;let e=this.viewDistance/32,t=this.brightnessAtPosition*(1-e)+e;if(this.fogBrightness+=(t-this.fogBrightness)*.1,this.inWater){let m=this.waterBreathing?100:5;this.scene.fog=new ee.Fog(new ee.Color(0,0,1),.0025,m),this.scene.background=new ee.Color(0,0,1),this.skyMesh.material.color.set(new ee.Color(0,0,1)),this.voidMesh.material.color.set(new ee.Color(0,0,.6));return}let r=this.viewDistance*16,i=1-(.25+.75*this.viewDistance/32)**.25,s=this.getCelestialAngle(this.partialTicks),o=this.getSkyColor(0,0,this.partialTicks),l=this.getFogColor(this.partialTicks),a=Math.cos(s*Math.PI*2)*2+.5,v=Math.max(0,Math.min(1,a)),c=this.prevFogBrightness+(this.fogBrightness-this.prevFogBrightness)*this.partialTicks,u=(l.x+(o.x-l.x)*i)*v*c,h=(l.y+(o.y-l.y)*i)*v*c,p=(l.z+(o.z-l.z)*i)*v*c;this.scene.background=new ee.Color(u,h,p),this.scene.fog=new ee.Fog(new ee.Color(u,h,p),.0025,r*this.distanceFactor),this.skyMesh.material.color.set(new ee.Color(o.x,o.y,o.z)),this.voidMesh.material.color.set(new ee.Color(o.x*.2+.04,o.y*.2+.04,o.z*.6+.1))}dispose(){this.texture&&this.texture.dispose(),this.mesh&&(this.mesh.geometry.dispose(),this.mesh.material.dispose(),this.scene.remove(this.mesh)),this.skyMesh&&(this.skyMesh.geometry.dispose(),this.skyMesh.material.dispose(),this.scene.remove(this.skyMesh)),this.voidMesh&&(this.voidMesh.geometry.dispose(),this.voidMesh.material.dispose(),this.scene.remove(this.voidMesh))}};A();E();R();x();import*as ne from"three";var Dd=`
21507
21507
  precision highp float;
21508
21508
  attribute vec3 position;
21509
21509
  attribute vec4 color;
@@ -21523,7 +21523,7 @@ void main() {
21523
21523
  gl_PointSize = size * adjustSize * (300.0 / length(mvPosition.xyz));
21524
21524
  gl_Position = projectionMatrix * mvPosition;
21525
21525
  }
21526
- `,Id=`
21526
+ `,Fd=`
21527
21527
  precision highp float;
21528
21528
  uniform sampler2D texture;
21529
21529
  varying vec4 vColor;
@@ -21532,7 +21532,7 @@ void main() {
21532
21532
  vec4 texColor = texture2D(texture, gl_PointCoord);
21533
21533
  gl_FragColor = vColor * texColor;
21534
21534
  }
21535
- `,rt={textureSize:128,gravity:new ne.Vector3(0,-.005,0),friction:.998,defaultParticleSize:300,maxActiveFireworks:5},v5=n=>{let t=n*3;return{x:t,y:t+1,z:t+2}},c5=n=>{let t=n*4;return{r:t,g:t+1,b:t+2,a:t+3}},O0=(n=0,e=0)=>Math.floor(Math.random()*(n+1-e))+e,Hd=(n,e,t,r)=>{n.save();let i=n.createRadialGradient(e,e,0,e,e,e);i.addColorStop(0,"rgba(255,255,255,1.0)"),i.addColorStop(.5,"rgba(255,255,255,0.5)"),i.addColorStop(1,"rgba(255,255,255,0)"),n.fillStyle=i,n.fillRect(0,0,t,r),n.restore()},Ld=()=>{let n=rt.textureSize,e=Ne(n,n),t=e.getContext("2d"),r=n/2;Hd(t,r,e.width,e.height);let i=new ne.Texture(e);return i.needsUpdate=!0,i},Od=(n,e,t,r,i=rt.defaultParticleSize)=>{let s=new ne.BufferGeometry,o=[],l=[],a=[],v=[],c=[],u=Math.random()>.3?"single":"multiple",h=O0(100,20)*.01,p=()=>O0(100,1)*.01,m="red",b=Math.random();b>.66?m="red":b>.33?m="green":m="blue";for(let _=0;_<n;_++){let y=new ne.Vector3(0,0,0);if(o.push(y.x,y.y,y.z),l.push(e[_].x,e[_].y,e[_].z),t==="seed"){let M=e[_].y**2*.04;_===0&&(M*=1.1),v.push(M),c.push(M*.017),a.push(1,1,1,1)}else if(t==="trail"){let M=Math.random()*.1+.1;v.push(M),c.push(M*.017),a.push(1,1,1,1)}else{let M=O0(i,10)*.001;if(v.push(M),c.push(M*.017),u==="multiple")a.push(p(),p(),p(),1);else switch(m){case"red":a.push(h,.1,.1,1);break;case"green":a.push(.1,h,.1,1);break;case"blue":a.push(.1,.1,h,1);break}}}s.setAttribute("position",new ne.Float32BufferAttribute(o,3)),s.setAttribute("velocity",new ne.Float32BufferAttribute(l,3)),s.setAttribute("color",new ne.Float32BufferAttribute(a,4)),s.setAttribute("adjustSize",new ne.Float32BufferAttribute(v,1)),s.setAttribute("mass",new ne.Float32BufferAttribute(c,1));let k=new ne.RawShaderMaterial({uniforms:{size:{value:rt.textureSize},texture:{value:r}},transparent:!0,depthWrite:!1,blending:ne.AdditiveBlending,vertexShader:Pd,fragmentShader:Id});return new ne.Points(s,k)},d5=class{constructor(e,t,r,i,s){d(this,"particleNum");d(this,"timerStartFading");d(this,"mesh");this.particleNum=e,this.timerStartFading=10,this.mesh=Od(e,t,r,i,s)}update(e){this.timerStartFading>0&&(this.timerStartFading-=.3);let t=this.mesh.geometry.attributes.position,r=this.mesh.geometry.attributes.velocity,i=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.5?.98:.96,l=a=>Math.random()>.5?0:(1-a)*.1;for(let a=0;a<this.particleNum;a++){let{x:v,y:c,z:u}=v5(a);r.array[c]+=e.y-s.array[a],r.array[v]*=rt.friction,r.array[u]*=rt.friction,r.array[c]*=rt.friction,t.array[v]+=r.array[v],t.array[c]+=r.array[c],t.array[u]+=r.array[u];let{a:h}=c5(a);this.timerStartFading<=0&&(i.array[h]*=o()-l(i.array[h]),i.array[h]<.001&&(i.array[h]=0))}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}disposeAll(){this.mesh.geometry.dispose(),this.mesh.material.dispose()}},$1=class extends d5{constructor(e,t,r){super(e,t,"seed",r)}update(e){let t=this.mesh.geometry.attributes.position,r=this.mesh.geometry.attributes.velocity,i=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.3?.99:.96,l=u=>Math.random()>.3?0:(1-u)*.1,a=()=>Math.random()>.5?.05:-.05,v=()=>Math.random()>.1,c=rt.friction*.98;for(let u=0;u<this.particleNum;u++){let{x:h,y:p,z:m}=v5(u);r.array[p]+=e.y-s.array[u],r.array[h]*=c,r.array[m]*=c,r.array[p]*=c,t.array[h]+=r.array[h],t.array[p]+=r.array[p],t.array[m]+=r.array[m],v()&&(t.array[h]+=a()),v()&&(t.array[m]+=a());let{a:b}=c5(u);i.array[b]*=o()-l(i.array[b]),i.array[b]<.001&&(i.array[b]=0)}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},es=class extends d5{constructor(e,t,r){super(e,t,"trail",r)}update(e){let t=this.mesh.geometry.attributes.position,r=this.mesh.geometry.attributes.velocity,i=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.3?.98:.95,l=()=>Math.random()>.5?.05:-.05,a=()=>Math.random()>.2;for(let v=0;v<this.particleNum;v++){let{x:c,y:u,z:h}=v5(v);r.array[u]+=e.y-s.array[v],r.array[c]*=rt.friction,r.array[h]*=rt.friction,r.array[u]*=rt.friction,t.array[c]+=r.array[c],t.array[u]+=r.array[u],t.array[h]+=r.array[h],a()&&(t.array[c]+=l()),a()&&(t.array[h]+=l());let{a:p}=c5(v);i.array[p]*=o(),i.array[p]<.001&&(i.array[p]=0)}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},u5=class{constructor(e,t=rt.defaultParticleSize,r){d(this,"meshGroup");d(this,"isExplode");d(this,"petalsNum");d(this,"life");d(this,"seed");d(this,"flowerSizeRate");d(this,"flower");d(this,"texture");d(this,"particleSize");this.meshGroup=new ne.Group,this.isExplode=!1,this.texture=e,this.particleSize=t;let i=400,s=150;this.petalsNum=O0(i,s),this.life=150,this.seed=this.getSeed(r),this.meshGroup.add(this.seed.mesh),this.flowerSizeRate=ne.MathUtils.mapLinear(this.petalsNum,s,i,.4,.7)}getSeed(e){let r=[];for(let s=0;s<40;s++){let l=s===0?Math.random()*2.5+.9:Math.random()*2+.4,a=0;r.push(new ne.Vector3(0,l,a))}let i=new $1(40,r,this.texture);if(e)i.mesh.position.set(0,0,0);else{let s=Math.random()*80-40,o=-50,l=Math.random()*80-40;i.mesh.position.set(s,o,l)}return i}explode(e){this.isExplode=!0,this.flower=this.getFlower(e),this.meshGroup.add(this.flower.mesh),this.meshGroup.remove(this.seed.mesh),this.seed.disposeAll()}getFlower(e){let t=this.petalsNum,r=[],i;if(Math.random()>.5)for(let l=0;l<t;l++){i=O0(120,60)*.01;let a=ne.MathUtils.degToRad(Math.random()*180),v=ne.MathUtils.degToRad(Math.random()*360),c=Math.sin(a)*Math.cos(v)*i,u=Math.sin(a)*Math.sin(v)*i,h=Math.cos(a)*i,p=new ne.Vector3(c,u,h);p.multiplyScalar(this.flowerSizeRate),r.push(p)}else{let l=180/t,a=360*(Math.random()*20+1)/t,v=a,c=a;i=O0(120,60)*.01;for(let u=0;u<t;u++){let h=Math.sin(ne.MathUtils.degToRad(l*u)),p=Math.cos(ne.MathUtils.degToRad(l*u))*i,m=Math.cos(ne.MathUtils.degToRad(v*u))*h*i,b=Math.sin(ne.MathUtils.degToRad(c*u))*h*i,k=new ne.Vector3(m,b,p);k.multiplyScalar(this.flowerSizeRate),r.push(k)}}let o=new d5(t,r,"default",this.texture,this.particleSize);return o.mesh.position.set(e.x,e.y,e.z),o}update(e){this.isExplode?(this.flower.update(e),this.life>0&&(this.life-=1)):this.drawTail()}drawTail(){this.seed.update(rt.gravity);let e=this.seed.mesh.geometry.attributes.position,t=this.seed.mesh.geometry.attributes.velocity,r=0;for(let u=0,h=t.array.length;u<h;u++){let p=t.array[u];u%3===1&&p>0&&r++}if(!(r===0))return;let{x:s,y:o,z:l}=this.seed.mesh.position,a=new ne.Vector3(s,o,l),v=0,c;for(let u=0,h=e.array.length;u<h;u++){let p=e.array[u];u%3===1&&p>v&&(v=p,c=new ne.Vector3(e.array[u-1],p,e.array[u+2]))}c&&(a.add(c),this.explode(a))}},ur=class extends u5{constructor(t,r=rt.defaultParticleSize,i){super(t,r,i);d(this,"tailMeshGroup");d(this,"tails");let s=150,o=100;this.petalsNum=O0(s,o),this.flowerSizeRate=ne.MathUtils.mapLinear(this.petalsNum,o,s,.4,.7),this.tailMeshGroup=new ne.Group,this.tails=[]}explode(t){this.isExplode=!0,this.flower=this.getFlower(t),this.tails=this.getTail(),this.meshGroup.add(this.flower.mesh),this.meshGroup.add(this.tailMeshGroup)}getTail(){let t=[],i=this.flower.mesh.geometry.attributes.color;for(let s=0;s<this.petalsNum;s++){let o=[];for(let S=0;S<20;S++)o.push(new ne.Vector3(0,0,0));let l=new es(20,o,this.texture),{r:a,g:v,b:c,a:u}=c5(s),h=i.array[a],p=i.array[v],m=i.array[c],b=i.array[u],k=l.mesh.geometry.attributes.position,_=l.mesh.geometry.attributes.color;for(let S=0;S<k.count;S++){let B=c5(S);_.array[B.r]=h,_.array[B.g]=p,_.array[B.b]=m,_.array[B.a]=b}let{x:y,y:M,z:T}=this.flower.mesh.position;l.mesh.position.set(y,M,T),t.push(l),this.tailMeshGroup.add(l.mesh)}return t}update(t){if(this.isExplode){this.flower.update(t);let r=this.flower.mesh.geometry.attributes.position;for(let i=0,s=this.tails.length;i<s;i++){let o=this.tails[i];o.update(t);let{x:l,y:a,z:v}=v5(i),c=new ne.Vector3(r.array[l],r.array[a],r.array[v]),u=o.mesh.geometry.attributes.position,h=o.mesh.geometry.attributes.velocity;for(let p=0;p<u.count;p++){let m=v5(p),b=new ne.Vector3,k=new ne.Vector3(u.array[m.x],u.array[m.y],u.array[m.z]),_=new ne.Vector3(h.array[m.x],h.array[m.y],h.array[m.z]);b.subVectors(c,k);let y=b.sub(_);y.normalize(),y.multiplyScalar(Math.random()*3e-4*this.life),h.array[m.x]+=y.x,h.array[m.y]+=y.y,h.array[m.z]+=y.z}h.needsUpdate=!0}this.life>0&&(this.life-=1.2)}else this.drawTail()}},In=class{constructor(e,t,r){d(this,"fireworksInstances");d(this,"scene");d(this,"sceneOrigin");d(this,"texture");d(this,"particleSize");d(this,"maxFireworks");this.fireworksInstances=[],this.scene=e,this.sceneOrigin=t,this.texture=Ld(),this.particleSize=r?.defaultParticleSize??rt.defaultParticleSize,this.maxFireworks=r?.maxActiveFireworks??rt.maxActiveFireworks}launchFirework(e){if(this.fireworksInstances.length>=this.maxFireworks)return;let t=e?.particleSize??this.particleSize,r=e?.position,i;e?.forceRich?i=new ur(this.texture,t,r):e?.forceBasic?i=new u5(this.texture,t,r):i=Math.random()>.5?new u5(this.texture,t,r):new ur(this.texture,t,r),this.fireworksInstances.push(i),r?(this.sceneOrigin.addAndTrack(i.meshGroup),i.meshGroup.position.set(r.x,r.y,r.z)):this.scene.add(i.meshGroup)}repositionAll(){}update(){let e=[];for(let t=this.fireworksInstances.length-1;t>=0;t--){let r=this.fireworksInstances[t];r.update(rt.gravity),r.isExplode&&e.push(t)}for(let t=0,r=e.length;t<r;t++){let i=e[t],s=this.fireworksInstances[i];if(s&&(s.meshGroup.remove(s.seed.mesh),s.seed.disposeAll(),s.life<=0)){if(this.sceneOrigin.removeAndUntrack(s.meshGroup),s instanceof ur&&s.tailMeshGroup)for(let o of s.tails)o.disposeAll();s.flower?.disposeAll(),this.fireworksInstances.splice(i,1)}}}clear(){for(let e of this.fireworksInstances)if(this.sceneOrigin.removeAndUntrack(e.meshGroup),e.seed.disposeAll(),e.flower&&e.flower.disposeAll(),e instanceof ur)for(let t of e.tails)t.disposeAll();this.fireworksInstances=[]}dispose(){this.clear(),this.texture.dispose()}};A();E();R();x();var R7=Symbol("tracked-proxy"),Dd=new Set(["add","addScalar","addScaledVector","addVectors","sub","subScalar","subVectors","multiply","multiplyScalar","multiplyVectors","divide","divideScalar","applyEuler","applyAxisAngle","applyMatrix3","applyMatrix4","applyNormalMatrix","applyQuaternion","negate","floor","ceil","round","roundToZero","min","max","clamp","clampLength","clampScalar","project","unproject","reflect","lerp","lerpVectors","cross","crossVectors","setFromMatrixPosition","setFromMatrixColumn","setFromMatrix3Column","setFromEuler","setFromSpherical","setFromSphericalCoords","setFromCylindrical","fromArray","fromBufferAttribute","setComponent","randomDirection","random"]),Hn=class{constructor(e){d(this,"scene");d(this,"_x",0);d(this,"_y",0);d(this,"_z",0);d(this,"_tracked",new Set);d(this,"_worldCoords",new WeakMap);d(this,"_originalPositions",new WeakMap);d(this,"_trackOptions",new WeakMap);this.scene=e}get x(){return this._x}get y(){return this._y}get z(){return this._z}update(e,t,r){this._x=e,this._y=t,this._z=r;for(let i of this._tracked){let s=this._worldCoords.get(i);this._originalPositions.get(i).set(s.x-e,s.y-t,s.z-r),this._trackOptions.get(i)?.updateMatrix&&i.updateMatrix()}}track(e,t){let r=this._originalPositions.get(e)??e.position,i={x:0,y:0,z:0};this._originalPositions.set(e,r),this._worldCoords.set(e,i),t?this._trackOptions.set(e,t):this._trackOptions.delete(e);let s=this,o=t,l=new Proxy(r,{get(a,v,c){if(v===R7)return i;if(v==="set")return(h,p,m)=>(i.x=h,i.y=p,i.z=m,a.set(h-s._x,p-s._y,m-s._z),o?.updateMatrix&&e.updateMatrix(),c);if(v==="copy")return h=>{let p=h[R7],m=p?p.x:h.x,b=p?p.y:h.y,k=p?p.z:h.z;return i.x=m,i.y=b,i.z=k,a.set(m-s._x,b-s._y,k-s._z),o?.updateMatrix&&e.updateMatrix(),c};if(v==="setX")return h=>(i.x=h,a.x=h-s._x,o?.updateMatrix&&e.updateMatrix(),c);if(v==="setY")return h=>(i.y=h,a.y=h-s._y,o?.updateMatrix&&e.updateMatrix(),c);if(v==="setZ")return h=>(i.z=h,a.z=h-s._z,o?.updateMatrix&&e.updateMatrix(),c);if(typeof v=="string"&&Dd.has(v))return()=>{throw new Error(`Cannot call position.${v}() on a tracked object. Use position.set(x, y, z) instead.`)};let u=a[v];return typeof u=="function"?u.bind(a):u},set(a,v,c){return v==="x"?(i.x=c,a.x=c-s._x,o?.updateMatrix&&e.updateMatrix(),!0):v==="y"?(i.y=c,a.y=c-s._y,o?.updateMatrix&&e.updateMatrix(),!0):v==="z"?(i.z=c,a.z=c-s._z,o?.updateMatrix&&e.updateMatrix(),!0):(a[v]=c,!0)}});Object.defineProperty(e,"position",{value:l,configurable:!0,enumerable:!0}),this._tracked.add(e)}untrack(e){let t=this._originalPositions.get(e);t&&(Object.defineProperty(e,"position",{value:t,configurable:!0,enumerable:!0}),this._tracked.delete(e),this._worldCoords.delete(e),this._originalPositions.delete(e),this._trackOptions.delete(e))}addAndTrack(e,t){this.track(e,t),this.scene.add(e)}removeAndUntrack(e){this.untrack(e),e.removeFromParent()}removeAndUntrackAll(e){e.traverse(t=>{this.untrack(t)}),e.removeFromParent()}getWorldPosition(e){let t=this._worldCoords.get(e);return t?{x:t.x,y:t.y,z:t.z}:void 0}clear(){for(let e of this._tracked)this.untrack(e)}get trackedCount(){return this._tracked.size}toSceneX(e){return e-this._x}toSceneY(e){return e-this._y}toSceneZ(e){return e-this._z}toWorldX(e){return e+this._x}toWorldY(e){return e+this._y}toWorldZ(e){return e+this._z}};vs();A();E();R();x();hr();n0();import*as X from"three";import*as ii from"prismarine-nbt";import{Vec3 as ps}from"vec3";A();E();R();x();Fn();import*as Ue from"three";function F0(n,e,t,r){let i=Math.floor(e),s=Math.floor(t),o=Math.floor(r);return{originDelta:{x:n.x-i,y:n.y-s,z:n.z-o},cameraOriginFrac:{x:e-i,y:t-s,z:r-o}}}var Zd=`
21535
+ `,rt={textureSize:128,gravity:new ne.Vector3(0,-.005,0),friction:.998,defaultParticleSize:300,maxActiveFireworks:5},v5=n=>{let t=n*3;return{x:t,y:t+1,z:t+2}},c5=n=>{let t=n*4;return{r:t,g:t+1,b:t+2,a:t+3}},O0=(n=0,e=0)=>Math.floor(Math.random()*(n+1-e))+e,zd=(n,e,t,r)=>{n.save();let i=n.createRadialGradient(e,e,0,e,e,e);i.addColorStop(0,"rgba(255,255,255,1.0)"),i.addColorStop(.5,"rgba(255,255,255,0.5)"),i.addColorStop(1,"rgba(255,255,255,0)"),n.fillStyle=i,n.fillRect(0,0,t,r),n.restore()},Ud=()=>{let n=rt.textureSize,e=Ne(n,n),t=e.getContext("2d"),r=n/2;zd(t,r,e.width,e.height);let i=new ne.Texture(e);return i.needsUpdate=!0,i},Vd=(n,e,t,r,i=rt.defaultParticleSize)=>{let s=new ne.BufferGeometry,o=[],l=[],a=[],v=[],c=[],u=Math.random()>.3?"single":"multiple",h=O0(100,20)*.01,p=()=>O0(100,1)*.01,m="red",b=Math.random();b>.66?m="red":b>.33?m="green":m="blue";for(let _=0;_<n;_++){let y=new ne.Vector3(0,0,0);if(o.push(y.x,y.y,y.z),l.push(e[_].x,e[_].y,e[_].z),t==="seed"){let M=e[_].y**2*.04;_===0&&(M*=1.1),v.push(M),c.push(M*.017),a.push(1,1,1,1)}else if(t==="trail"){let M=Math.random()*.1+.1;v.push(M),c.push(M*.017),a.push(1,1,1,1)}else{let M=O0(i,10)*.001;if(v.push(M),c.push(M*.017),u==="multiple")a.push(p(),p(),p(),1);else switch(m){case"red":a.push(h,.1,.1,1);break;case"green":a.push(.1,h,.1,1);break;case"blue":a.push(.1,.1,h,1);break}}}s.setAttribute("position",new ne.Float32BufferAttribute(o,3)),s.setAttribute("velocity",new ne.Float32BufferAttribute(l,3)),s.setAttribute("color",new ne.Float32BufferAttribute(a,4)),s.setAttribute("adjustSize",new ne.Float32BufferAttribute(v,1)),s.setAttribute("mass",new ne.Float32BufferAttribute(c,1));let k=new ne.RawShaderMaterial({uniforms:{size:{value:rt.textureSize},texture:{value:r}},transparent:!0,depthWrite:!1,blending:ne.AdditiveBlending,vertexShader:Dd,fragmentShader:Fd});return new ne.Points(s,k)},d5=class{constructor(e,t,r,i,s){d(this,"particleNum");d(this,"timerStartFading");d(this,"mesh");this.particleNum=e,this.timerStartFading=10,this.mesh=Vd(e,t,r,i,s)}update(e){this.timerStartFading>0&&(this.timerStartFading-=.3);let t=this.mesh.geometry.attributes.position,r=this.mesh.geometry.attributes.velocity,i=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.5?.98:.96,l=a=>Math.random()>.5?0:(1-a)*.1;for(let a=0;a<this.particleNum;a++){let{x:v,y:c,z:u}=v5(a);r.array[c]+=e.y-s.array[a],r.array[v]*=rt.friction,r.array[u]*=rt.friction,r.array[c]*=rt.friction,t.array[v]+=r.array[v],t.array[c]+=r.array[c],t.array[u]+=r.array[u];let{a:h}=c5(a);this.timerStartFading<=0&&(i.array[h]*=o()-l(i.array[h]),i.array[h]<.001&&(i.array[h]=0))}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}disposeAll(){this.mesh.geometry.dispose(),this.mesh.material.dispose()}},$1=class extends d5{constructor(e,t,r){super(e,t,"seed",r)}update(e){let t=this.mesh.geometry.attributes.position,r=this.mesh.geometry.attributes.velocity,i=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.3?.99:.96,l=u=>Math.random()>.3?0:(1-u)*.1,a=()=>Math.random()>.5?.05:-.05,v=()=>Math.random()>.1,c=rt.friction*.98;for(let u=0;u<this.particleNum;u++){let{x:h,y:p,z:m}=v5(u);r.array[p]+=e.y-s.array[u],r.array[h]*=c,r.array[m]*=c,r.array[p]*=c,t.array[h]+=r.array[h],t.array[p]+=r.array[p],t.array[m]+=r.array[m],v()&&(t.array[h]+=a()),v()&&(t.array[m]+=a());let{a:b}=c5(u);i.array[b]*=o()-l(i.array[b]),i.array[b]<.001&&(i.array[b]=0)}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},es=class extends d5{constructor(e,t,r){super(e,t,"trail",r)}update(e){let t=this.mesh.geometry.attributes.position,r=this.mesh.geometry.attributes.velocity,i=this.mesh.geometry.attributes.color,s=this.mesh.geometry.attributes.mass,o=()=>Math.random()>.3?.98:.95,l=()=>Math.random()>.5?.05:-.05,a=()=>Math.random()>.2;for(let v=0;v<this.particleNum;v++){let{x:c,y:u,z:h}=v5(v);r.array[u]+=e.y-s.array[v],r.array[c]*=rt.friction,r.array[h]*=rt.friction,r.array[u]*=rt.friction,t.array[c]+=r.array[c],t.array[u]+=r.array[u],t.array[h]+=r.array[h],a()&&(t.array[c]+=l()),a()&&(t.array[h]+=l());let{a:p}=c5(v);i.array[p]*=o(),i.array[p]<.001&&(i.array[p]=0)}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},u5=class{constructor(e,t=rt.defaultParticleSize,r){d(this,"meshGroup");d(this,"isExplode");d(this,"petalsNum");d(this,"life");d(this,"seed");d(this,"flowerSizeRate");d(this,"flower");d(this,"texture");d(this,"particleSize");this.meshGroup=new ne.Group,this.isExplode=!1,this.texture=e,this.particleSize=t;let i=400,s=150;this.petalsNum=O0(i,s),this.life=150,this.seed=this.getSeed(r),this.meshGroup.add(this.seed.mesh),this.flowerSizeRate=ne.MathUtils.mapLinear(this.petalsNum,s,i,.4,.7)}getSeed(e){let r=[];for(let s=0;s<40;s++){let l=s===0?Math.random()*2.5+.9:Math.random()*2+.4,a=0;r.push(new ne.Vector3(0,l,a))}let i=new $1(40,r,this.texture);if(e)i.mesh.position.set(0,0,0);else{let s=Math.random()*80-40,o=-50,l=Math.random()*80-40;i.mesh.position.set(s,o,l)}return i}explode(e){this.isExplode=!0,this.flower=this.getFlower(e),this.meshGroup.add(this.flower.mesh),this.meshGroup.remove(this.seed.mesh),this.seed.disposeAll()}getFlower(e){let t=this.petalsNum,r=[],i;if(Math.random()>.5)for(let l=0;l<t;l++){i=O0(120,60)*.01;let a=ne.MathUtils.degToRad(Math.random()*180),v=ne.MathUtils.degToRad(Math.random()*360),c=Math.sin(a)*Math.cos(v)*i,u=Math.sin(a)*Math.sin(v)*i,h=Math.cos(a)*i,p=new ne.Vector3(c,u,h);p.multiplyScalar(this.flowerSizeRate),r.push(p)}else{let l=180/t,a=360*(Math.random()*20+1)/t,v=a,c=a;i=O0(120,60)*.01;for(let u=0;u<t;u++){let h=Math.sin(ne.MathUtils.degToRad(l*u)),p=Math.cos(ne.MathUtils.degToRad(l*u))*i,m=Math.cos(ne.MathUtils.degToRad(v*u))*h*i,b=Math.sin(ne.MathUtils.degToRad(c*u))*h*i,k=new ne.Vector3(m,b,p);k.multiplyScalar(this.flowerSizeRate),r.push(k)}}let o=new d5(t,r,"default",this.texture,this.particleSize);return o.mesh.position.set(e.x,e.y,e.z),o}update(e){this.isExplode?(this.flower.update(e),this.life>0&&(this.life-=1)):this.drawTail()}drawTail(){this.seed.update(rt.gravity);let e=this.seed.mesh.geometry.attributes.position,t=this.seed.mesh.geometry.attributes.velocity,r=0;for(let u=0,h=t.array.length;u<h;u++){let p=t.array[u];u%3===1&&p>0&&r++}if(!(r===0))return;let{x:s,y:o,z:l}=this.seed.mesh.position,a=new ne.Vector3(s,o,l),v=0,c;for(let u=0,h=e.array.length;u<h;u++){let p=e.array[u];u%3===1&&p>v&&(v=p,c=new ne.Vector3(e.array[u-1],p,e.array[u+2]))}c&&(a.add(c),this.explode(a))}},ur=class extends u5{constructor(t,r=rt.defaultParticleSize,i){super(t,r,i);d(this,"tailMeshGroup");d(this,"tails");let s=150,o=100;this.petalsNum=O0(s,o),this.flowerSizeRate=ne.MathUtils.mapLinear(this.petalsNum,o,s,.4,.7),this.tailMeshGroup=new ne.Group,this.tails=[]}explode(t){this.isExplode=!0,this.flower=this.getFlower(t),this.tails=this.getTail(),this.meshGroup.add(this.flower.mesh),this.meshGroup.add(this.tailMeshGroup)}getTail(){let t=[],i=this.flower.mesh.geometry.attributes.color;for(let s=0;s<this.petalsNum;s++){let o=[];for(let S=0;S<20;S++)o.push(new ne.Vector3(0,0,0));let l=new es(20,o,this.texture),{r:a,g:v,b:c,a:u}=c5(s),h=i.array[a],p=i.array[v],m=i.array[c],b=i.array[u],k=l.mesh.geometry.attributes.position,_=l.mesh.geometry.attributes.color;for(let S=0;S<k.count;S++){let B=c5(S);_.array[B.r]=h,_.array[B.g]=p,_.array[B.b]=m,_.array[B.a]=b}let{x:y,y:M,z:T}=this.flower.mesh.position;l.mesh.position.set(y,M,T),t.push(l),this.tailMeshGroup.add(l.mesh)}return t}update(t){if(this.isExplode){this.flower.update(t);let r=this.flower.mesh.geometry.attributes.position;for(let i=0,s=this.tails.length;i<s;i++){let o=this.tails[i];o.update(t);let{x:l,y:a,z:v}=v5(i),c=new ne.Vector3(r.array[l],r.array[a],r.array[v]),u=o.mesh.geometry.attributes.position,h=o.mesh.geometry.attributes.velocity;for(let p=0;p<u.count;p++){let m=v5(p),b=new ne.Vector3,k=new ne.Vector3(u.array[m.x],u.array[m.y],u.array[m.z]),_=new ne.Vector3(h.array[m.x],h.array[m.y],h.array[m.z]);b.subVectors(c,k);let y=b.sub(_);y.normalize(),y.multiplyScalar(Math.random()*3e-4*this.life),h.array[m.x]+=y.x,h.array[m.y]+=y.y,h.array[m.z]+=y.z}h.needsUpdate=!0}this.life>0&&(this.life-=1.2)}else this.drawTail()}},In=class{constructor(e,t,r){d(this,"fireworksInstances");d(this,"scene");d(this,"sceneOrigin");d(this,"texture");d(this,"particleSize");d(this,"maxFireworks");this.fireworksInstances=[],this.scene=e,this.sceneOrigin=t,this.texture=Ud(),this.particleSize=r?.defaultParticleSize??rt.defaultParticleSize,this.maxFireworks=r?.maxActiveFireworks??rt.maxActiveFireworks}launchFirework(e){if(this.fireworksInstances.length>=this.maxFireworks)return;let t=e?.particleSize??this.particleSize,r=e?.position,i;e?.forceRich?i=new ur(this.texture,t,r):e?.forceBasic?i=new u5(this.texture,t,r):i=Math.random()>.5?new u5(this.texture,t,r):new ur(this.texture,t,r),this.fireworksInstances.push(i),r?(this.sceneOrigin.addAndTrack(i.meshGroup),i.meshGroup.position.set(r.x,r.y,r.z)):this.scene.add(i.meshGroup)}repositionAll(){}update(){let e=[];for(let t=this.fireworksInstances.length-1;t>=0;t--){let r=this.fireworksInstances[t];r.update(rt.gravity),r.isExplode&&e.push(t)}for(let t=0,r=e.length;t<r;t++){let i=e[t],s=this.fireworksInstances[i];if(s&&(s.meshGroup.remove(s.seed.mesh),s.seed.disposeAll(),s.life<=0)){if(this.sceneOrigin.removeAndUntrack(s.meshGroup),s instanceof ur&&s.tailMeshGroup)for(let o of s.tails)o.disposeAll();s.flower?.disposeAll(),this.fireworksInstances.splice(i,1)}}}clear(){for(let e of this.fireworksInstances)if(this.sceneOrigin.removeAndUntrack(e.meshGroup),e.seed.disposeAll(),e.flower&&e.flower.disposeAll(),e instanceof ur)for(let t of e.tails)t.disposeAll();this.fireworksInstances=[]}dispose(){this.clear(),this.texture.dispose()}};A();E();R();x();var T7=Symbol("tracked-proxy"),Gd=new Set(["add","addScalar","addScaledVector","addVectors","sub","subScalar","subVectors","multiply","multiplyScalar","multiplyVectors","divide","divideScalar","applyEuler","applyAxisAngle","applyMatrix3","applyMatrix4","applyNormalMatrix","applyQuaternion","negate","floor","ceil","round","roundToZero","min","max","clamp","clampLength","clampScalar","project","unproject","reflect","lerp","lerpVectors","cross","crossVectors","setFromMatrixPosition","setFromMatrixColumn","setFromMatrix3Column","setFromEuler","setFromSpherical","setFromSphericalCoords","setFromCylindrical","fromArray","fromBufferAttribute","setComponent","randomDirection","random"]),Hn=class{constructor(e){d(this,"scene");d(this,"_x",0);d(this,"_y",0);d(this,"_z",0);d(this,"_tracked",new Set);d(this,"_worldCoords",new WeakMap);d(this,"_originalPositions",new WeakMap);d(this,"_trackOptions",new WeakMap);this.scene=e}get x(){return this._x}get y(){return this._y}get z(){return this._z}update(e,t,r){this._x=e,this._y=t,this._z=r;for(let i of this._tracked){let s=this._worldCoords.get(i);this._originalPositions.get(i).set(s.x-e,s.y-t,s.z-r),this._trackOptions.get(i)?.updateMatrix&&i.updateMatrix()}}track(e,t){let r=this._originalPositions.get(e)??e.position,i={x:0,y:0,z:0};this._originalPositions.set(e,r),this._worldCoords.set(e,i),t?this._trackOptions.set(e,t):this._trackOptions.delete(e);let s=this,o=t,l=new Proxy(r,{get(a,v,c){if(v===T7)return i;if(v==="set")return(h,p,m)=>(i.x=h,i.y=p,i.z=m,a.set(h-s._x,p-s._y,m-s._z),o?.updateMatrix&&e.updateMatrix(),c);if(v==="copy")return h=>{let p=h[T7],m=p?p.x:h.x,b=p?p.y:h.y,k=p?p.z:h.z;return i.x=m,i.y=b,i.z=k,a.set(m-s._x,b-s._y,k-s._z),o?.updateMatrix&&e.updateMatrix(),c};if(v==="setX")return h=>(i.x=h,a.x=h-s._x,o?.updateMatrix&&e.updateMatrix(),c);if(v==="setY")return h=>(i.y=h,a.y=h-s._y,o?.updateMatrix&&e.updateMatrix(),c);if(v==="setZ")return h=>(i.z=h,a.z=h-s._z,o?.updateMatrix&&e.updateMatrix(),c);if(typeof v=="string"&&Gd.has(v))return()=>{throw new Error(`Cannot call position.${v}() on a tracked object. Use position.set(x, y, z) instead.`)};let u=a[v];return typeof u=="function"?u.bind(a):u},set(a,v,c){return v==="x"?(i.x=c,a.x=c-s._x,o?.updateMatrix&&e.updateMatrix(),!0):v==="y"?(i.y=c,a.y=c-s._y,o?.updateMatrix&&e.updateMatrix(),!0):v==="z"?(i.z=c,a.z=c-s._z,o?.updateMatrix&&e.updateMatrix(),!0):(a[v]=c,!0)}});Object.defineProperty(e,"position",{value:l,configurable:!0,enumerable:!0}),this._tracked.add(e)}untrack(e){let t=this._originalPositions.get(e);t&&(Object.defineProperty(e,"position",{value:t,configurable:!0,enumerable:!0}),this._tracked.delete(e),this._worldCoords.delete(e),this._originalPositions.delete(e),this._trackOptions.delete(e))}addAndTrack(e,t){this.track(e,t),this.scene.add(e)}removeAndUntrack(e){this.untrack(e),e.removeFromParent()}removeAndUntrackAll(e){e.traverse(t=>{this.untrack(t)}),e.removeFromParent()}getWorldPosition(e){let t=this._worldCoords.get(e);return t?{x:t.x,y:t.y,z:t.z}:void 0}clear(){for(let e of this._tracked)this.untrack(e)}get trackedCount(){return this._tracked.size}toSceneX(e){return e-this._x}toSceneY(e){return e-this._y}toSceneZ(e){return e-this._z}toWorldX(e){return e+this._x}toWorldY(e){return e+this._y}toWorldZ(e){return e+this._z}};vs();A();E();R();x();hr();n0();import*as X from"three";import*as ii from"prismarine-nbt";import{Vec3 as ps}from"vec3";A();E();R();x();Fn();import*as Ue from"three";function F0(n,e,t,r){let i=Math.floor(e),s=Math.floor(t),o=Math.floor(r);return{originDelta:{x:n.x-i,y:n.y-s,z:n.z-o},cameraOriginFrac:{x:e-i,y:t-s,z:r-o}}}var nu=`
21536
21536
  precision highp float;
21537
21537
 
21538
21538
  uniform vec3 u_originDelta;
@@ -21639,7 +21639,7 @@ void main() {
21639
21639
  applyFog();
21640
21640
  writeLogDepth();
21641
21641
  }
21642
- `,G7=`
21642
+ `,j7=`
21643
21643
  precision highp float;
21644
21644
 
21645
21645
  uniform vec3 u_originDelta;
@@ -21681,7 +21681,7 @@ void main() {
21681
21681
  vFogDepth = -mvPosition.z;
21682
21682
  #endif
21683
21683
  }
21684
- `,ds={u_atlas:{value:null},u_originDelta:{value:new Ue.Vector3},u_cameraOriginFrac:{value:new Ue.Vector3},u_skyLevel:{value:1},u_lightCurve:{value:nt.curve},u_minBrightness:{value:nt.minBrightness},u_lightGamma:{value:nt.gamma}};function N7(){return new Ue.ShaderMaterial({vertexShader:Zd,fragmentShader:cs,uniforms:Ue.UniformsUtils.merge([Ue.UniformsLib.fog,ds]),transparent:!0,depthWrite:!0,depthTest:!0,vertexColors:!0,glslVersion:Ue.GLSL3,fog:!0})}function W7(){return new Ue.ShaderMaterial({vertexShader:G7,fragmentShader:cs,uniforms:Ue.UniformsUtils.merge([Ue.UniformsLib.fog,ds]),transparent:!1,depthWrite:!0,depthTest:!0,vertexColors:!0,glslVersion:Ue.GLSL3,fog:!0})}function j7(){return new Ue.ShaderMaterial({vertexShader:G7,fragmentShader:cs,uniforms:Ue.UniformsUtils.merge([Ue.UniformsLib.fog,ds]),transparent:!0,depthWrite:!1,depthTest:!0,vertexColors:!0,glslVersion:Ue.GLSL3,fog:!0})}function Qn(n,e,t,r,i){let{originDelta:s,cameraOriginFrac:o}=F0(e,t,r,i),l=n.uniforms.u_originDelta;l?.value?.set&&l.value.set(s.x,s.y,s.z);let a=n.uniforms.u_cameraOriginFrac;a?.value?.set&&a.value.set(o.x,o.y,o.z)}function Kn(n,e){let t=n.uniforms.u_skyLevel;t&&(t.value=e)}function qn(n,e){if(e.curve!==void 0){let t=n.uniforms.u_lightCurve;t&&(t.value=e.curve)}if(e.minBrightness!==void 0){let t=n.uniforms.u_minBrightness;t&&(t.value=e.minBrightness)}if(e.gamma!==void 0){let t=n.uniforms.u_lightGamma;t&&(t.value=e.gamma)}}A();E();R();x();var $d=8,eu=.01;function us(n,e,t,r,i){n.matrix.makeTranslation(e-i.x,t-i.y,r-i.z),n.matrixWorldNeedsUpdate=!0,n.frustumCulled=!1}function Jn(n,e,t,r,i,s,o,l,a,v){let c=n-r,u=e-i,h=t-s,p=$d+eu;return a.set(c-p,u-p,h-p),v.set(c+p,u+p,h+p),l.set(a,v),{visible:o.intersectsBox(l),distSq:c*c+u*u+h*h}}function Y7(n,e,t,r,i,s,o,l,a,v,c){let{visible:u,distSq:h}=Jn(e,t,r,i,s,o,l,a,v,c);n.visible=u,n.renderOrder=-h}as();A();E();R();x();import*as Et from"three";A();E();R();x();A();E();R();x();A();E();R();x();import*as Ke from"three";A();E();R();x();function K7(){return{counts:new Int32Array(Wt),offsets:new Int32Array(Wt)}}function tu(n,e){if(n.counts.length>=e)return;let t=n.counts.length;for(;t<e;)t*=2;n.counts=new Int32Array(t),n.offsets=new Int32Array(t)}function q7(n){let e=n.getExtension("WEBGL_multi_draw");return e?{tier:"A",ext:e}:{tier:"B",ext:null}}var Q7=!1;function J7(n,e){Q7||!e||(Q7=!0)}function X7(n,e,t,r){let i=t.length;if(i===0)return;tu(r,i);let s=n.TRIANGLES,o=n.UNSIGNED_INT;for(let l=0;l<i;l++){let a=t[l];r.counts[l]=a.indexCount,r.offsets[l]=a.indexStart*4}if(e.tier==="A"&&e.ext){e.ext.multiDrawElementsWEBGL(s,r.counts,0,o,r.offsets,0,i);return}for(let l=0;l<i;l++)n.drawElements(s,r.counts[l],o,r.offsets[l])}var Te=4,le=6,ve=3,pt=2,De=1,ru=128e3,nu=128e3,hs=5e3,iu=.25,Z7=Te*(ve*3+De*2+pt)*4+le*4,fs=.75,Wt=64;function Xn(n,e){if(e.length===0)return n;let t=[];for(let r of n){let i=[r];for(let s of e){let o=[];for(let l of i){let a=l.start+l.count-1;if(s.end<l.start||s.start>a){o.push(l);continue}s.start>l.start&&o.push({start:l.start,count:s.start-l.start}),s.end<a&&o.push({start:s.end+1,count:a-s.end})}i=o}t.push(...i)}return t.filter(r=>r.count>0)}var f5=class{constructor(e,t,r){d(this,"mesh");d(this,"material");d(this,"growthIncrementQuads");d(this,"blendSort");d(this,"capacityQuads");d(this,"positions");d(this,"colors");d(this,"skyLights");d(this,"blockLights");d(this,"uvs");d(this,"aOrigin");d(this,"indices");d(this,"quadCentroids");d(this,"quadIndexTemplate");d(this,"sectionSlots",new Map);d(this,"freeList",[]);d(this,"highWatermark",0);d(this,"pendingRanges",[]);d(this,"indexPendingRanges",[]);d(this,"_spanScratch",[]);d(this,"renderOrigin",{x:0,y:0,z:0});d(this,"layoutVersion",0);d(this,"pendingMove",null);d(this,"pendingReplace",new Map);d(this,"uploadEpoch",0);d(this,"visibleIndexSpans",[]);d(this,"_drawScratch",K7());d(this,"_sortOrder",new Uint32Array(0));d(this,"_sortDistSq",new Float64Array(0));d(this,"multiDrawCaps",null);d(this,"debugOverlay",!1);d(this,"_camX",0);d(this,"_camY",0);d(this,"_camZ",0);d(this,"_camInitialized",!1);this.material=e,this.growthIncrementQuads=r?.growthIncrementQuads??nu,this.blendSort=r?.sortBlend??!1,this.capacityQuads=r?.initialCapacityQuads??ru;let i=this.capacityQuads*Te;this.positions=new Float32Array(i*ve),this.colors=new Float32Array(i*ve),this.skyLights=new Float32Array(i*De),this.blockLights=new Float32Array(i*De),this.uvs=new Float32Array(i*pt),this.aOrigin=new Float32Array(i*ve),this.indices=new Uint32Array(this.capacityQuads*le),this.quadCentroids=new Float32Array(this.capacityQuads*3),this.quadIndexTemplate=new Uint8Array(this.capacityQuads*le);let s=new Ke.BufferGeometry,o=(a,v,c)=>{let u=new Ke.BufferAttribute(a,v);return u.setUsage(Ke.DynamicDrawUsage),s.setAttribute(c,u),u};o(this.positions,ve,"position"),o(this.colors,ve,"color"),o(this.skyLights,De,"a_skyLight"),o(this.blockLights,De,"a_blockLight"),o(this.uvs,pt,"uv"),o(this.aOrigin,ve,"a_origin");let l=new Ke.BufferAttribute(this.indices,1);l.setUsage(Ke.DynamicDrawUsage),s.setIndex(l),s.setDrawRange(0,0),s.boundingSphere=new Ke.Sphere(new Ke.Vector3,1/0),this.mesh=new Ke.Mesh(s,[e]),this.mesh.name=r?.name??"globalLegacyOpaque",this.mesh.frustumCulled=!1,this.mesh.matrixAutoUpdate=!1,this.mesh.matrix.identity(),this.mesh.position.set(0,0,0),t.add(this.mesh),this.syncDefaultDrawGroups(),this.mesh.onAfterRender=(a,v,c,u,h)=>{if(this.visibleIndexSpans.length===0)return;let p=a.getContext();this.multiDrawCaps||(this.multiDrawCaps=q7(p),J7(this.multiDrawCaps.tier,this.debugOverlay)),X7(p,this.multiDrawCaps,this.visibleIndexSpans,this._drawScratch)}}setDebugOverlay(e){this.debugOverlay=e}suppressThreeDraw(){this.mesh.geometry.setDrawRange(0,3)}setVisibleIndexSpans(e){this.visibleIndexSpans=e}getVisibleIndexSpans(){return this.visibleIndexSpans}getVisibleQuadCount(){let e=0;for(let t of this.visibleIndexSpans)e+=t.indexCount;return e/le}syncDefaultDrawGroups(){let e=this.mesh.geometry;e.clearGroups();let t=this.highWatermark*le;t>0&&e.addGroup(0,t,0),e.setDrawRange(0,t)}addSection(e,t,r,i,s){let o=t.positions.length/ve,l=o/Te;if(o===0||l*Te!==o)return this.removeSection(e),!1;if(t.indices.length%le!==0||t.indices.length/le!==l)return!1;let a=this.sectionSlots.has(e),v;if(a){let S=this.sectionSlots.get(e),B=this.pendingReplace.get(e),P=this.pendingMove?.key===e?this.pendingMove:void 0;B?(this.zeroAndFreeSlot(S.start,S.count),v={start:B.oldStart,count:B.oldCount},this.pendingReplace.delete(e)):P?(this.zeroAndFreeSlot(S.start,S.count),v={start:P.oldStart,count:P.count},this.pendingMove=null):v=S}l>this.capacityQuads&&this.growCapacity(l);let c=this.takeFreeSlot(l);c||(this.highWatermark+l>this.capacityQuads&&this.growCapacity(this.highWatermark+l),c={start:this.highWatermark,count:l},this.highWatermark+=l);let u=c.start*Te,h=u*ve,p=u*pt,m=u*De;this.positions.set(t.positions,h),this.colors.set(t.colors,h),this.skyLights.set(t.skyLights,m),this.blockLights.set(t.blockLights,m),this.uvs.set(t.uvs,p);let b=h,k=r-this.renderOrigin.x,_=i-this.renderOrigin.y,y=s-this.renderOrigin.z;for(let S=0;S<o;S++){let B=b+S*ve;this.aOrigin[B]=k,this.aOrigin[B+1]=_,this.aOrigin[B+2]=y}let M=c.start*le,T=u;for(let S=0;S<t.indices.length;S++)this.indices[M+S]=t.indices[S]+T;for(let S=0;S<l;S++){let B=c.start+S,P=S*Te,H=P*ve,V=0,z=0,N=0;for(let te=0;te<Te;te++){let se=H+te*ve;V+=t.positions[se],z+=t.positions[se+1],N+=t.positions[se+2]}let Y=B*3;this.quadCentroids[Y]=V/Te,this.quadCentroids[Y+1]=z/Te,this.quadCentroids[Y+2]=N/Te;let q=S*le,J=B*le;for(let te=0;te<le;te++)this.quadIndexTemplate[J+te]=t.indices[q+te]-P}return this.sectionSlots.set(e,c),a&&v&&this.pendingReplace.set(e,{oldStart:v.start,oldCount:v.count}),this.blendSort&&this._camInitialized&&l>=2&&this.applyBlendSort(c.start,l,this._camX,this._camY,this._camZ),this.markDirty(c.start,c.start+l-1),this.syncDefaultDrawGroups(),this.layoutVersion++,!0}getLayoutVersion(){return this.layoutVersion}getUploadEpoch(){return this.uploadEpoch}hasPendingReplace(){return this.pendingReplace.size>0}canUseFullDrawShortcut(){return this.pendingRanges.length===0&&this.interiorFreeQuads()===0&&this.pendingMove===null&&this.pendingReplace.size===0}isRangeFullyUploaded(e,t){return this.rangeFullyUploaded(e,t)}getPendingDirtyRanges(){return this.pendingRanges}getSectionDrawStart(e){let t=this.sectionSlots.get(e);if(!t)return;if(this.pendingMove?.key===e)return this.pendingMove.oldStart;let r=this.pendingReplace.get(e);if(r)return r.oldStart;if(this.rangeFullyUploaded(t.start,t.start+t.count-1))return t.start}getSectionDrawCount(e){let t=this.sectionSlots.get(e);if(!t)return;if(this.pendingMove?.key===e)return this.pendingMove.count;let r=this.pendingReplace.get(e);if(r)return r.oldCount;if(this.rangeFullyUploaded(t.start,t.start+t.count-1))return t.count}getPendingMove(){return this.pendingMove}compactStep(){if(this.pendingMove){let{newStart:l,count:a}=this.pendingMove;this.rangeFullyUploaded(l,l+a-1)&&this.finalizePendingMove();return}for(let l of[...this.pendingReplace.keys()]){let a=this.sectionSlots.get(l);a&&this.rangeFullyUploaded(a.start,a.start+a.count-1)&&this.finalizePendingReplace(l)}if(this.highWatermark===0||this.interiorFreeQuads()/this.highWatermark<=iu)return;let t=this.findMovableSection(hs);if(!t)return;let r=this.findLowestInteriorHole(t.start,t.count);if(!r)return;let i=this.reserveFreeSlotAt(r.index,t.count),s=t.start,o=i.start;this.copySectionRange(s,o,t.count),this.sectionSlots.set(t.key,{start:o,count:t.count}),this.markDirty(o,o+t.count-1),this.pendingMove={key:t.key,oldStart:s,newStart:o,count:t.count},this.layoutVersion++}updateDrawSpans(e,t){if(this.visibleIndexSpans=[],this.highWatermark===0)return;let r=this._spanScratch;r.length=0;let i=0;for(let o of e){let l=this.getSectionDrawStart(o.key),a=this.getSectionDrawCount(o.key),v=this.sectionSlots.get(o.key);l===void 0||a===void 0||!v||(r.push({start:l,count:a}),i+=a)}if(r.length===0)return;let s=(o,l)=>{this.visibleIndexSpans.push({indexStart:o*le,indexCount:l*le})};if(t==="opaque"){let o;this.canUseFullDrawShortcut()&&i>=this.highWatermark*fs?o=[{start:0,count:this.highWatermark}]:(r.sort((a,v)=>a.start-v.start),this.mergeOpaqueSpans(r),o=r),o=Xn(o,this.pendingRanges);for(let a of o)s(a.start,a.count)}else{e.sort((o,l)=>l.distSq-o.distSq);for(let o of e){let l=this.getSectionDrawStart(o.key),a=this.getSectionDrawCount(o.key);l===void 0||a===void 0||s(l,a)}}}mergeOpaqueSpans(e){if(e.length<2)return;let t=0;for(;t<e.length-1;){let r=e[t],i=e[t+1];r.start+r.count===i.start?(r.count=i.start+i.count-r.start,e.splice(t+1,1)):t++}}hasSection(e){return this.sectionSlots.has(e)}getSectionSlot(e){return this.sectionSlots.get(e)}takeSectionData(e){let t=this.getSectionGeometryData(e);if(t)return this.removeSection(e),t}getSectionGeometryData(e){let t=this.sectionSlots.get(e);if(!t)return;let r=t.count*Te,i=t.start*Te,s=i*ve,o=i*pt,l=t.start*le,a=t.count*le,v=i*De,c=this.positions.slice(s,s+r*ve),u=this.colors.slice(s,s+r*ve),h=this.skyLights.slice(v,v+r*De),p=this.blockLights.slice(v,v+r*De),m=this.uvs.slice(o,o+r*pt),b=this.indices.slice(l,l+a),k=i;for(let T=0;T<b.length;T++)b[T]=b[T]-k;let _=this.aOrigin[s]+this.renderOrigin.x,y=this.aOrigin[s+1]+this.renderOrigin.y,M=this.aOrigin[s+2]+this.renderOrigin.z;return{positions:c,colors:u,skyLights:h,blockLights:p,uvs:m,indices:b,sx:_,sy:y,sz:M}}removeSection(e){let t=this.sectionSlots.get(e);if(!t)return;if(this.pendingReplace.has(e)){let s=this.pendingReplace.get(e);this.zeroAndFreeSlot(s.oldStart,s.oldCount),this.pendingReplace.delete(e)}if(this.pendingMove?.key===e){let{oldStart:s,count:o}=this.pendingMove;this.zeroAndFreeSlot(s,o),this.pendingMove=null}let r=t.start*le,i=t.count*le;for(let s=0;s<i;s++)this.indices[r+s]=0;this.markDirty(t.start,t.start+t.count-1),this.sectionSlots.delete(e),this.insertFreeSlot(t),this.shrinkHighWatermark(),this.syncDefaultDrawGroups(),this.layoutVersion++}hasPendingUploads(){return this.pendingRanges.length>0}hasPendingIndexUploads(){return this.indexPendingRanges.length>0}reorderSectionBlendIndices(e,t,r,i){let s=this.sectionSlots.get(e);return!s||this.pendingMove?.key===e||this.pendingReplace.has(e)||!this.rangeFullyUploaded(s.start,s.start+s.count-1)||s.count<2?!1:(this.applyBlendSort(s.start,s.count,t,r,i),this.markIndexDirty(s.start,s.start+s.count-1),!0)}applyBlendSort(e,t,r,i,s){let o=e*Te*ve,l=this.aOrigin[o]+this.renderOrigin.x,a=this.aOrigin[o+1]+this.renderOrigin.y,v=this.aOrigin[o+2]+this.renderOrigin.z;this._sortOrder.length<t&&(this._sortOrder=new Uint32Array(t),this._sortDistSq=new Float64Array(t));let c=this._sortOrder,u=this._sortDistSq;for(let p=0;p<t;p++){c[p]=p;let b=(e+p)*3,k=l+this.quadCentroids[b],_=a+this.quadCentroids[b+1],y=v+this.quadCentroids[b+2],M=k-r,T=_-i,S=y-s;u[p]=M*M+T*T+S*S}let h=c.subarray(0,t);h.sort((p,m)=>{let b=u[m]-u[p];return b!==0?b:p-m});for(let p=0;p<t;p++){let m=h[p],b=(e+m)*Te,k=(e+p)*le,_=(e+m)*le;for(let y=0;y<le;y++)this.indices[k+y]=b+this.quadIndexTemplate[_+y]}}uploadDirtyRange(){let e=this.pendingRanges[0];if(!e)return;let t=e.start,r=Math.min(e.end-e.start+1,hs),i=t*Te,s=r*Te,o=t*le,l=r*le,a=this.mesh.geometry,v=a.getAttribute("position");v.clearUpdateRanges(),v.addUpdateRange(i*ve,s*ve),v.needsUpdate=!0;let c=a.getAttribute("color");c.clearUpdateRanges(),c.addUpdateRange(i*ve,s*ve),c.needsUpdate=!0;let u=a.getAttribute("a_skyLight");u.clearUpdateRanges(),u.addUpdateRange(i*De,s*De),u.needsUpdate=!0;let h=a.getAttribute("a_blockLight");h.clearUpdateRanges(),h.addUpdateRange(i*De,s*De),h.needsUpdate=!0;let p=a.getAttribute("uv");p.clearUpdateRanges(),p.addUpdateRange(i*pt,s*pt),p.needsUpdate=!0;let m=a.getAttribute("a_origin");m.clearUpdateRanges(),m.addUpdateRange(i*ve,s*ve),m.needsUpdate=!0;let b=a.index;b.clearUpdateRanges(),b.addUpdateRange(o,l),b.needsUpdate=!0,t+r>e.end?this.pendingRanges.shift():e.start=t+r,this.uploadEpoch++}uploadDirtyIndexRange(){let e=this.indexPendingRanges[0];if(!e)return;let t=e.start,r=Math.min(e.end-e.start+1,hs),i=t*le,s=r*le,o=this.mesh.geometry.index;o.clearUpdateRanges(),o.addUpdateRange(i,s),o.needsUpdate=!0,t+r>e.end?this.indexPendingRanges.shift():e.start=t+r}setRenderOrigin(e){this.renderOrigin={...e}}rebase(e){if(this.highWatermark!==0){for(let t of this.sectionSlots.values()){let r=t.start*Te,i=t.count*Te,s=r*ve;for(let o=0;o<i;o++){let l=s+o*ve;this.aOrigin[l]-=e.x,this.aOrigin[l+1]-=e.y,this.aOrigin[l+2]-=e.z}}this.markDirty(0,this.highWatermark-1),this.renderOrigin.x+=e.x,this.renderOrigin.y+=e.y,this.renderOrigin.z+=e.z}}setCameraOrigin(e,t,r){this._camX=e,this._camY=t,this._camZ=r,this._camInitialized=!0;let{originDelta:i,cameraOriginFrac:s}=F0(this.renderOrigin,e,t,r),o=this.material.uniforms.u_originDelta;o?.value?.set&&o.value.set(i.x,i.y,i.z);let l=this.material.uniforms.u_cameraOriginFrac;l?.value?.set&&l.value.set(s.x,s.y,s.z)}getHighWatermark(){return this.highWatermark}getCapacityQuads(){return this.capacityQuads}getSectionCount(){return this.sectionSlots.size}getMemoryBytes(){return this.capacityQuads*Z7}getUsedMemoryBytes(){return this.highWatermark*Z7}reset(){this.sectionSlots.clear(),this.freeList.length=0,this.highWatermark=0,this.pendingRanges.length=0,this.indexPendingRanges.length=0,this.pendingMove=null,this.pendingReplace.clear(),this.uploadEpoch=0,this.visibleIndexSpans=[],this.syncDefaultDrawGroups()}dispose(){this.mesh.parent?.remove(this.mesh),this.mesh.geometry.dispose(),this.reset()}markDirty(e,t){this.pendingRanges.push({start:e,end:t}),this.pendingRanges.sort((r,i)=>r.start-i.start),this.mergePendingRanges()}markIndexDirty(e,t){this.indexPendingRanges.push({start:e,end:t}),this.indexPendingRanges.sort((r,i)=>r.start-i.start),this.mergeIndexPendingRanges()}mergeIndexPendingRanges(){if(this.indexPendingRanges.length<2)return;let e=[],t=this.indexPendingRanges[0];for(let r=1;r<this.indexPendingRanges.length;r++){let i=this.indexPendingRanges[r];i.start<=t.end+1?t={start:t.start,end:Math.max(t.end,i.end)}:(e.push(t),t=i)}e.push(t),this.indexPendingRanges=e}mergePendingRanges(){if(this.pendingRanges.length<2)return;let e=[],t=this.pendingRanges[0];for(let r=1;r<this.pendingRanges.length;r++){let i=this.pendingRanges[r];i.start<=t.end+1?t={start:t.start,end:Math.max(t.end,i.end)}:(e.push(t),t=i)}e.push(t),this.pendingRanges=e}takeFreeSlot(e){for(let t=0;t<this.freeList.length;t++){let r=this.freeList[t];if(r.count>=e){if(this.freeList.splice(t,1),r.count===e)return r;let i={start:r.start,count:e};return this.insertFreeSlot({start:r.start+e,count:r.count-e}),i}}}insertFreeSlot(e){this.freeList.push(e),this.freeList.sort((t,r)=>t.start-r.start),this.mergeFreeList()}mergeFreeList(){if(this.freeList.length<2)return;let e=[],t=this.freeList[0];for(let r=1;r<this.freeList.length;r++){let i=this.freeList[r];t.start+t.count===i.start?t={start:t.start,count:t.count+i.count}:(e.push(t),t=i)}e.push(t),this.freeList=e}shrinkHighWatermark(){for(;this.highWatermark>0;){let e=this.highWatermark-1,t=this.freeList.find(i=>i.start<=e&&i.start+i.count>e);if(!t||t.start+t.count!==this.highWatermark)break;this.highWatermark=t.start;let r=this.freeList.indexOf(t);this.freeList.splice(r,1)}}interiorFreeQuads(){let e=0;for(let t of this.freeList)t.start<this.highWatermark&&(e+=t.count);return e}findMovableSection(e){let t=[];for(let[s,o]of this.sectionSlots)t.push({key:s,start:o.start,count:o.count});if(t.length===0)return;t.sort((s,o)=>o.start!==s.start?o.start-s.start:o.start+o.count-(s.start+s.count));let r=t[0];if(r.count<=e&&this.findLowestInteriorHole(r.start,r.count))return r;let i=t.filter(s=>s.count<=e).sort((s,o)=>o.count-s.count);for(let s of i)if(this.findLowestInteriorHole(s.start,s.count))return s}findLowestInteriorHole(e,t){for(let r=0;r<this.freeList.length;r++){let i=this.freeList[r];if(i.start<e&&i.count>=t)return{start:i.start,count:i.count,index:r}}}reserveFreeSlotAt(e,t){let r=this.freeList[e];if(this.freeList.splice(e,1),r.count===t)return{start:r.start,count:t};let i={start:r.start,count:t};return this.insertFreeSlot({start:r.start+t,count:r.count-t}),i}copySectionRange(e,t,r){let i=e*Te,s=t*Te,o=r*Te,l=s-i,a=i*ve,v=s*ve,c=o*ve;this.positions.copyWithin(v,a,a+c),this.colors.copyWithin(v,a,a+c),this.aOrigin.copyWithin(v,a,a+c);let u=i*De,h=s*De,p=o*De;this.skyLights.copyWithin(h,u,u+p),this.blockLights.copyWithin(h,u,u+p);let m=i*pt,b=s*pt,k=o*pt;this.uvs.copyWithin(b,m,m+k);let _=e*le,y=t*le,M=r*le;for(let H=0;H<M;H++)this.indices[y+H]=this.indices[_+H]+l;let T=e*3,S=t*3;this.quadCentroids.copyWithin(S,T,T+r*3);let B=e*le,P=t*le;this.quadIndexTemplate.copyWithin(P,B,B+r*le)}rangeFullyUploaded(e,t){for(let r of this.pendingRanges)if(r.start<=t&&r.end>=e)return!1;return!0}zeroAndFreeSlot(e,t){let r=e*le,i=t*le;for(let s=0;s<i;s++)this.indices[r+s]=0;this.markDirty(e,e+t-1),this.insertFreeSlot({start:e,count:t})}finalizePendingReplace(e){let t=this.pendingReplace.get(e);t&&(this.zeroAndFreeSlot(t.oldStart,t.oldCount),this.pendingReplace.delete(e),this.shrinkHighWatermark(),this.syncDefaultDrawGroups(),this.layoutVersion++,this.uploadEpoch++)}finalizePendingMove(){let e=this.pendingMove;if(!e)return;let{oldStart:t,count:r}=e;this.zeroAndFreeSlot(t,r),this.shrinkHighWatermark(),this.syncDefaultDrawGroups(),this.pendingMove=null,this.layoutVersion++,this.uploadEpoch++}growCapacity(e){this.pendingMove&&this.finalizePendingMove();for(let y of[...this.pendingReplace.keys()])this.finalizePendingReplace(y);let t=this.capacityQuads;for(;t<e;)t+=this.growthIncrementQuads;let r=this.capacityQuads*Te,i=t*Te,s=new Float32Array(i*ve),o=new Float32Array(i*ve),l=new Float32Array(i*De),a=new Float32Array(i*De),v=new Float32Array(i*pt),c=new Float32Array(i*ve),u=new Uint32Array(t*le),h=new Float32Array(t*3),p=new Uint8Array(t*le);s.set(this.positions),o.set(this.colors),l.set(this.skyLights),a.set(this.blockLights),v.set(this.uvs),c.set(this.aOrigin),u.set(this.indices),h.set(this.quadCentroids),p.set(this.quadIndexTemplate),this.positions=s,this.colors=o,this.skyLights=l,this.blockLights=a,this.uvs=v,this.aOrigin=c,this.indices=u,this.quadCentroids=h,this.quadIndexTemplate=p,this.capacityQuads=t;let m=this.mesh.geometry,b=(y,M,T)=>{m.getAttribute(T)&&m.deleteAttribute(T);let B=new Ke.BufferAttribute(y,M);B.setUsage(Ke.DynamicDrawUsage),m.setAttribute(T,B)};b(this.positions,ve,"position"),b(this.colors,ve,"color"),b(this.skyLights,De,"a_skyLight"),b(this.blockLights,De,"a_blockLight"),b(this.uvs,pt,"uv"),b(this.aOrigin,ve,"a_origin"),m.index&&m.setIndex(null);let _=new Ke.BufferAttribute(this.indices,1);_.setUsage(Ke.DynamicDrawUsage),m.setIndex(_),this.pendingRanges.length=0,this.indexPendingRanges.length=0}};function su(n){if(n.length<2)return;let e=0;for(;e<n.length-1;){let t=n[e],r=n[e+1];t.start+t.count===r.start?(t.count=r.start+r.count-t.start,n.splice(e+1,1)):e++}}function $7(n,e,t=!0,r,i=[]){if(n.length===0||e===0)return[];let s=0;for(let a of n)s+=a.count;let o;if(t&&s>=e*fs)o=[{start:0,count:e}];else return o=n.map(a=>({start:a.start,count:a.count})),o.sort((a,v)=>a.start-v.start),su(o),o=Xn(o,i),o;return Xn(o,i)}n0();function tl(){return{firsts:new Int32Array(Wt),counts:new Int32Array(Wt),instanceCounts:new Int32Array(Wt),baseInstances:new Int32Array(Wt)}}function ou(n,e){if(n.counts.length>=e)return;let t=n.counts.length;for(;t<e;)t*=2;n.firsts=new Int32Array(t),n.counts=new Int32Array(t),n.instanceCounts=new Int32Array(t),n.baseInstances=new Int32Array(t)}function rl(n){let e=n.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");if(e)return{tier:"A",ext:e};let t=n.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");return t?{tier:"B",ext:t}:{tier:"C",ext:null}}var el=!1;function nl(n,e){el||!e||(el=!0)}function il(n,e,t,r,i){let s=t.length;if(s===0)return;let o=n.TRIANGLES;if(e.tier==="A"&&e.ext){let l=e.ext;ou(r,s);for(let a=0;a<s;a++){let v=t[a];r.firsts[a]=0,r.counts[a]=Nt,r.instanceCounts[a]=v.count,r.baseInstances[a]=v.start}l.multiDrawArraysInstancedBaseInstanceWEBGL(o,r.firsts,0,r.counts,0,r.instanceCounts,0,r.baseInstances,0,s);return}if(e.tier==="B"&&e.ext){let l=e.ext;for(let a=0;a<s;a++){let v=t[a];l.drawArraysInstancedBaseInstanceWEBGL(o,0,Nt,v.count,v.start)}return}i?.(n,t)}n0();hr();var au=512e3,lu=1e6,sl=15e3,vu=.25,m5=H7(),ol=16,Zn=class{constructor(e,t){d(this,"mesh");d(this,"capacityFaces");d(this,"w0");d(this,"w1");d(this,"w2");d(this,"w3");d(this,"sectionSlots",new Map);d(this,"freeList",[]);d(this,"highWatermark",0);d(this,"pendingRanges",[]);d(this,"pendingMove",null);d(this,"pendingReplace",new Map);d(this,"uploadEpoch",0);d(this,"visibleSpans",[]);d(this,"_drawScratch",tl());d(this,"multiDrawCaps",null);d(this,"tierCVao",null);d(this,"tierCAttrs",null);d(this,"tierCGl",null);d(this,"debugOverlay",!1);d(this,"layoutVersion",0);this.capacityFaces=au,this.w0=new Uint32Array(this.capacityFaces),this.w1=new Uint32Array(this.capacityFaces),this.w2=new Uint32Array(this.capacityFaces),this.w3=new Uint32Array(this.capacityFaces),this.w2.fill(m5);let r=new Et.InstancedBufferGeometry,i=new Float32Array(Nt*3);r.setAttribute("position",new Et.BufferAttribute(i,3));let s=o=>{let l=new Et.InstancedBufferAttribute(o,1);return l.setUsage(Et.DynamicDrawUsage),l};r.setAttribute("a_w0",s(this.w0)),r.setAttribute("a_w1",s(this.w1)),r.setAttribute("a_w2",s(this.w2)),r.setAttribute("a_w3",s(this.w3)),r.instanceCount=0,this.mesh=new Et.Mesh(r,e),this.mesh.name="globalShaderCubes",this.mesh.frustumCulled=!1,this.mesh.matrixAutoUpdate=!1,this.mesh.matrix.identity(),this.mesh.position.set(0,0,0),t.add(this.mesh),this.mesh.onAfterRender=(o,l,a,v,c)=>{if(this.visibleSpans.length===0)return;let u=c,h=o.getContext();this.multiDrawCaps||(this.multiDrawCaps=rl(h),nl(this.multiDrawCaps.tier,this.debugOverlay)),il(h,this.multiDrawCaps,this.visibleSpans,this._drawScratch,this.multiDrawCaps.tier==="C"?(p,m)=>this.drawTierCSpans(p,m,o,u):void 0)}}setDebugOverlay(e){this.debugOverlay=e}suppressThreeDraw(){let e=this.mesh.geometry;e.setDrawRange(0,Nt),e.instanceCount=0}setVisibleSpans(e){this.visibleSpans=e}getVisibleSpans(){return this.visibleSpans}getVisibleFaceCount(){let e=0;for(let t of this.visibleSpans)e+=t.count;return e}forEachSectionSlot(e){for(let[t,r]of this.sectionSlots)e(t,r)}getSectionDrawStart(e){let t=this.sectionSlots.get(e);if(!t)return;if(this.pendingMove?.key===e)return this.pendingMove.oldStart;let r=this.pendingReplace.get(e);if(r)return r.oldStart;if(this.rangeFullyUploaded(t.start,t.start+t.count-1))return t.start}getSectionDrawCount(e){let t=this.sectionSlots.get(e);if(!t)return;if(this.pendingMove?.key===e)return this.pendingMove.count;let r=this.pendingReplace.get(e);if(r)return r.oldCount;if(this.rangeFullyUploaded(t.start,t.start+t.count-1))return t.count}getUploadEpoch(){return this.uploadEpoch}hasPendingReplace(){return this.pendingReplace.size>0}canUseFullDrawShortcut(){return this.pendingRanges.length===0&&this.interiorFreeFaces()===0&&this.pendingMove===null&&this.pendingReplace.size===0}isRangeFullyUploaded(e,t){return this.rangeFullyUploaded(e,t)}getPendingDirtyRanges(){return this.pendingRanges}getHighWatermark(){return this.highWatermark}getCapacityFaces(){return this.capacityFaces}getSectionCount(){return this.sectionSlots.size}getMemoryBytes(){return this.capacityFaces*ol}getUsedMemoryBytes(){return this.highWatermark*ol}hasPendingUploads(){return this.pendingRanges.length>0}getPendingMove(){return this.pendingMove}addSection(e,t,r){if(r<=0){this.removeSection(e);return}let i=this.sectionSlots.has(e),s;if(i){let a=this.sectionSlots.get(e),v=this.pendingReplace.get(e),c=this.pendingMove?.key===e?this.pendingMove:void 0;v?(this.zeroAndFreeSlot(a.start,a.count),s={start:v.oldStart,count:v.oldCount},this.pendingReplace.delete(e)):c?(this.zeroAndFreeSlot(a.start,a.count),s={start:c.oldStart,count:c.count},this.pendingMove=null):s=a}r>this.capacityFaces&&this.growCapacity(r);let o=this.takeFreeSlot(r);o||(this.highWatermark+r>this.capacityFaces&&this.growCapacity(this.highWatermark+r),o={start:this.highWatermark,count:r},this.highWatermark+=r);let l=4;for(let a=0;a<r;a++){let v=o.start+a,c=a*l;this.w0[v]=t[c],this.w1[v]=t[c+1],this.w2[v]=t[c+2],this.w3[v]=t[c+3]}this.sectionSlots.set(e,o),i&&s&&this.pendingReplace.set(e,{oldStart:s.start,oldCount:s.count}),this.markDirty(o.start,o.start+r-1),this.mesh.geometry.instanceCount=this.highWatermark,this.layoutVersion++}getLayoutVersion(){return this.layoutVersion}hasSection(e){return this.sectionSlots.has(e)}getSectionSlot(e){return this.sectionSlots.get(e)}getW0(){return this.w0}takeSectionData(e){let t=this.sectionSlots.get(e);if(!t)return;let r=4,i=new Uint32Array(t.count*r);for(let s=0;s<t.count;s++){let o=t.start+s,l=s*r;i[l]=this.w0[o],i[l+1]=this.w1[o],i[l+2]=this.w2[o],i[l+3]=this.w3[o]}return this.removeSection(e),{words:i,count:t.count}}removeSection(e){let t=this.sectionSlots.get(e);if(t){if(this.pendingReplace.has(e)){let r=this.pendingReplace.get(e);this.zeroAndFreeSlot(r.oldStart,r.oldCount),this.pendingReplace.delete(e)}if(this.pendingMove?.key===e){let{oldStart:r,count:i}=this.pendingMove;this.zeroAndFreeSlot(r,i),this.pendingMove=null}for(let r=t.start;r<t.start+t.count;r++)this.w0[r]=0,this.w1[r]=0,this.w2[r]=m5,this.w3[r]=0;this.markDirty(t.start,t.start+t.count-1),this.sectionSlots.delete(e),this.insertFreeSlot(t),this.shrinkHighWatermark(),this.mesh.geometry.instanceCount=this.highWatermark,this.layoutVersion++}}compactStep(){if(this.pendingMove){let{newStart:l,count:a}=this.pendingMove;this.rangeFullyUploaded(l,l+a-1)&&this.finalizePendingMove();return}for(let l of[...this.pendingReplace.keys()]){let a=this.sectionSlots.get(l);a&&this.rangeFullyUploaded(a.start,a.start+a.count-1)&&this.finalizePendingReplace(l)}if(this.highWatermark===0||this.interiorFreeFaces()/this.highWatermark<=vu)return;let t=this.findMovableSection(sl);if(!t)return;let r=this.findLowestInteriorHole(t.start,t.count);if(!r)return;let i=this.reserveFreeSlotAt(r.index,t.count),s=t.start,o=i.start;this.copySectionRange(s,o,t.count),this.sectionSlots.set(t.key,{start:o,count:t.count}),this.markDirty(o,o+t.count-1),this.pendingMove={key:t.key,oldStart:s,newStart:o,count:t.count},this.layoutVersion++}uploadDirtyRange(){let e=this.pendingRanges[0];if(!e)return;let t=e.start,r=Math.min(e.end-e.start+1,sl),i=this.mesh.geometry;for(let s of["a_w0","a_w1","a_w2","a_w3"]){let o=i.getAttribute(s);o.clearUpdateRanges(),o.addUpdateRange(t,r),o.needsUpdate=!0}t+r>e.end?this.pendingRanges.shift():e.start=t+r,this.uploadEpoch++}setCameraOrigin(e,t,r,i){let{originDelta:s,cameraOriginFrac:o}=F0(e,t,r,i),l=Vn(e),a=this.mesh.material.uniforms.u_originDelta;a?.value?.set&&a.value.set(s.x,s.y,s.z);let v=this.mesh.material.uniforms.u_cameraOriginFrac;v?.value?.set&&v.value.set(o.x,o.y,o.z);let c=this.mesh.material.uniforms.u_sectionOriginRel;c?.value?.set&&c.value.set(l.x,l.y,l.z)}reset(){this.sectionSlots.clear(),this.freeList.length=0,this.highWatermark=0,this.pendingRanges.length=0,this.pendingMove=null,this.pendingReplace.clear(),this.uploadEpoch=0,this.visibleSpans=[],this.w0.fill(0),this.w1.fill(0),this.w2.fill(m5),this.w3.fill(0),this.mesh.geometry.instanceCount=0,this.invalidateTierCVao()}dispose(){this.invalidateTierCVao(),this.mesh.parent?.remove(this.mesh),this.mesh.geometry.dispose(),this.reset()}invalidateTierCVao(){this.tierCVao&&this.tierCGl&&this.tierCGl.deleteVertexArray(this.tierCVao),this.tierCVao=null,this.tierCAttrs=null}drawTierCSpans(e,t,r,i){if(this.ensureTierCVao(e,r,i),!this.tierCVao||!this.tierCAttrs)return;let s=this.tierCAttrs;e.bindVertexArray(this.tierCVao);for(let o of t){let l=o.start*4,a=v=>{e.bindBuffer(e.ARRAY_BUFFER,v.buffer),e.vertexAttribIPointer(v.loc,1,e.UNSIGNED_INT,4,l)};a(s.w0),a(s.w1),a(s.w2),a(s.w3),e.drawArraysInstanced(e.TRIANGLES,0,Nt,o.count)}e.bindVertexArray(null)}ensureTierCVao(e,t,r){this.tierCGl=e;let o=t.properties.get(r).currentProgram.program,l=e.getAttribLocation(o,"a_w0"),a=e.getAttribLocation(o,"a_w1"),v=e.getAttribLocation(o,"a_w2"),c=e.getAttribLocation(o,"a_w3"),u=M=>M<0?null:e.getVertexAttrib(M,e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING),h=u(l);if(this.tierCVao&&this.tierCAttrs&&h&&this.tierCAttrs.w0.buffer!==h&&this.invalidateTierCVao(),this.tierCVao)return;let p=u(l),m=u(a),b=u(v),k=u(c);if(!p||!m||!b||!k)return;let _=e.createVertexArray();if(!_)return;e.bindVertexArray(_);let y=(M,T)=>{e.enableVertexAttribArray(M),e.bindBuffer(e.ARRAY_BUFFER,T),e.vertexAttribIPointer(M,1,e.UNSIGNED_INT,4,0),e.vertexAttribDivisor(M,1)};y(l,p),y(a,m),y(v,b),y(c,k),e.bindVertexArray(null),this.tierCVao=_,this.tierCAttrs={w0:{loc:l,buffer:p},w1:{loc:a,buffer:m},w2:{loc:v,buffer:b},w3:{loc:c,buffer:k}}}markDirty(e,t){this.pendingRanges.push({start:e,end:t}),this.pendingRanges.sort((r,i)=>r.start-i.start),this.mergePendingRanges()}mergePendingRanges(){if(this.pendingRanges.length<2)return;let e=[],t=this.pendingRanges[0];for(let r=1;r<this.pendingRanges.length;r++){let i=this.pendingRanges[r];i.start<=t.end+1?t={start:t.start,end:Math.max(t.end,i.end)}:(e.push(t),t=i)}e.push(t),this.pendingRanges=e}takeFreeSlot(e){for(let t=0;t<this.freeList.length;t++){let r=this.freeList[t];if(r.count>=e){if(this.freeList.splice(t,1),r.count===e)return r;let i={start:r.start,count:e};return this.insertFreeSlot({start:r.start+e,count:r.count-e}),i}}}insertFreeSlot(e){this.freeList.push(e),this.freeList.sort((t,r)=>t.start-r.start),this.mergeFreeList()}mergeFreeList(){if(this.freeList.length<2)return;let e=[],t=this.freeList[0];for(let r=1;r<this.freeList.length;r++){let i=this.freeList[r];t.start+t.count===i.start?t={start:t.start,count:t.count+i.count}:(e.push(t),t=i)}e.push(t),this.freeList=e}interiorFreeFaces(){let e=0;for(let t of this.freeList)t.start<this.highWatermark&&(e+=t.count);return e}findMovableSection(e){let t=[];for(let[s,o]of this.sectionSlots)t.push({key:s,start:o.start,count:o.count});if(t.length===0)return;t.sort((s,o)=>o.start!==s.start?o.start-s.start:o.start+o.count-(s.start+s.count));let r=t[0];if(r.count<=e&&this.findLowestInteriorHole(r.start,r.count))return r;let i=t.filter(s=>s.count<=e).sort((s,o)=>o.count-s.count);for(let s of i)if(this.findLowestInteriorHole(s.start,s.count))return s}findLowestInteriorHole(e,t){for(let r=0;r<this.freeList.length;r++){let i=this.freeList[r];if(i.start<e&&i.count>=t)return{start:i.start,count:i.count,index:r}}}reserveFreeSlotAt(e,t){let r=this.freeList[e];if(this.freeList.splice(e,1),r.count===t)return{start:r.start,count:t};let i={start:r.start,count:t};return this.insertFreeSlot({start:r.start+t,count:r.count-t}),i}copySectionRange(e,t,r){this.w0.copyWithin(t,e,e+r),this.w1.copyWithin(t,e,e+r),this.w2.copyWithin(t,e,e+r),this.w3.copyWithin(t,e,e+r)}rangeFullyUploaded(e,t){for(let r of this.pendingRanges)if(r.start<=t&&r.end>=e)return!1;return!0}zeroAndFreeSlot(e,t){for(let r=e;r<e+t;r++)this.w0[r]=0,this.w1[r]=0,this.w2[r]=m5,this.w3[r]=0;this.markDirty(e,e+t-1),this.insertFreeSlot({start:e,count:t})}finalizePendingReplace(e){let t=this.pendingReplace.get(e);t&&(this.zeroAndFreeSlot(t.oldStart,t.oldCount),this.pendingReplace.delete(e),this.shrinkHighWatermark(),this.mesh.geometry.instanceCount=this.highWatermark,this.layoutVersion++,this.uploadEpoch++)}finalizePendingMove(){let e=this.pendingMove;if(!e)return;let{oldStart:t,count:r}=e;this.zeroAndFreeSlot(t,r),this.shrinkHighWatermark(),this.mesh.geometry.instanceCount=this.highWatermark,this.pendingMove=null,this.layoutVersion++,this.uploadEpoch++}shrinkHighWatermark(){for(;this.highWatermark>0;){let e=this.highWatermark-1,t=this.freeList.find(i=>i.start<=e&&i.start+i.count>e);if(!t||t.start+t.count!==this.highWatermark)break;this.highWatermark=t.start;let r=this.freeList.indexOf(t);this.freeList.splice(r,1)}}growCapacity(e){this.pendingMove&&this.finalizePendingMove();for(let v of[...this.pendingReplace.keys()])this.finalizePendingReplace(v);let t=this.capacityFaces;for(;t<e;)t+=lu;let r=new Uint32Array(t),i=new Uint32Array(t),s=new Uint32Array(t),o=new Uint32Array(t);r.set(this.w0),i.set(this.w1),s.set(this.w2),o.set(this.w3),s.fill(m5,this.w0.length),this.w0=r,this.w1=i,this.w2=s,this.w3=o,this.capacityFaces=t;let l=this.mesh.geometry,a=(v,c)=>{let u=l.getAttribute(c);u&&(l.deleteAttribute(c),"dispose"in u&&typeof u.dispose=="function"&&u.dispose());let h=new Et.InstancedBufferAttribute(v,1);h.setUsage(Et.DynamicDrawUsage),l.setAttribute(c,h)};a(this.w0,"a_w0"),a(this.w1,"a_w1"),a(this.w2,"a_w2"),a(this.w3,"a_w3"),this.pendingRanges.length=0,this.invalidateTierCVao()}};A();E();R();x();hr();n0();function al(n,e,t,r,i){if(e<=0)return;let s=t-8,o=r-8,l=i-8,a=4,v=16,c=16,u=16,h=-1,p=-1,m=-1;for(let S=0;S<e;S++){let B=n[S*a],P=B&(1<<D0.LX_BITS)-1,H=B>>D0.LY_SHIFT&(1<<D0.LY_BITS)-1,V=B>>D0.LZ_SHIFT&(1<<D0.LZ_BITS)-1;P<v&&(v=P),H<c&&(c=H),V<u&&(u=V),P>h&&(h=P),H>p&&(p=H),V>m&&(m=V)}if(h<0)return;let b=s+v,k=o+c,_=l+u,y=s+h+1,M=o+p+1,T=l+m+1;return{minX:b,minY:k,minZ:_,maxX:y,maxY:M,maxZ:T,cx:(b+y)*.5,cy:(k+M)*.5,cz:(_+T)*.5}}function cu(n,e,t,r,i,s,o,l,a){return n>=r&&n<=o&&e>=i&&e<=l&&t>=s&&t<=a}function ll(n,e,t,r,i,s,o,l,a,v,c,u,h){if(cu(n,e,t,o,l,a,v,c,u))return;let p=0,m=h;if(Math.abs(r)<1e-8){if(n<o||n>v)return}else{let b=1/r,k=(o-n)*b,_=(v-n)*b;if(k>_){let y=k;k=_,_=y}if(p=Math.max(p,k),m=Math.min(m,_),p>m)return}if(Math.abs(i)<1e-8){if(e<l||e>c)return}else{let b=1/i,k=(l-e)*b,_=(c-e)*b;if(k>_){let y=k;k=_,_=y}if(p=Math.max(p,k),m=Math.min(m,_),p>m)return}if(Math.abs(s)<1e-8){if(t<a||t>u)return}else{let b=1/s,k=(a-t)*b,_=(u-t)*b;if(k>_){let y=k;k=_,_=y}if(p=Math.max(p,k),m=Math.min(m,_),p>m)return}return p<=m&&p>=0?p:void 0}function vl(n,e,t,r,i,s,o,l,a,v,c,u,h){let p=h;if(Math.abs(r)>=1e-8){let m=r>0?(v-n)/r:(o-n)/r;m>1e-6&&(p=Math.min(p,m))}else if(n<o||n>v)return;if(Math.abs(i)>=1e-8){let m=i>0?(c-e)/i:(l-e)/i;m>1e-6&&(p=Math.min(p,m))}else if(e<l||e>c)return;if(Math.abs(s)>=1e-8){let m=s>0?(u-t)/s:(a-t)/s;m>1e-6&&(p=Math.min(p,m))}else if(t<a||t>u)return;return p<=h?p:void 0}A();E();R();x();import*as ot from"three";A();E();R();x();Fn();var $n=class{constructor(){d(this,"entries",new Set);d(this,"skyLevel",1);d(this,"lightmapParams",{...nt})}register(e){this.entries.add(e),this.applyBrightness(e)}unregister(e){for(let t of this.entries)if(t.material===e){this.entries.delete(t);break}}setSkyLevel(e){this.skyLevel=e,this.refreshAll()}setLightmapParams(e){this.lightmapParams={...this.lightmapParams,...e},this.refreshAll()}getSkyLevel(){return this.skyLevel}refreshAll(){for(let e of this.entries)this.applyBrightness(e)}applyBrightness(e){let t=ts(e.blockLightNorm,e.skyLightNorm,this.skyLevel,this.lightmapParams);e.material.color.setScalar(t)}};function cl(n,e,t,r,i=nt){let s=ts(e,t,r,i);return n.color.setScalar(s),s}var dl=20,ul=40,du={white_banner:15,orange_banner:14,magenta_banner:13,light_blue_banner:12,yellow_banner:11,lime_banner:10,pink_banner:9,gray_banner:8,light_gray_banner:7,cyan_banner:6,purple_banner:5,blue_banner:4,brown_banner:3,green_banner:2,red_banner:1,black_banner:0},hl={0:"#1d1d21",1:"#b02e26",2:"#5e7c16",3:"#835432",4:"#3c44aa",5:"#8932b8",6:"#169c9c",7:"#9d9d97",8:"#474f52",9:"#f38baa",10:"#80c71f",11:"#fed83d",12:"#3ab3da",13:"#c74ebd",14:"#f9801d",15:"#f9fffe"};function uu(n){let e=n.replace("_wall_banner","_banner");return du[e]??15}var hu=(n,e,t,r,i,s,o)=>{switch(n.fillStyle=t,e){case"bs":n.fillRect(r,i,s,o);break;case"ls":n.fillRect(r,i,s/3,o);break;case"rs":n.fillRect(r+s*2/3,i,s/3,o);break;case"ts":n.fillRect(r,i,s,o/3);break;case"ms":n.fillRect(r,i+o/3,s,o/3);break;case"drs":n.fillRect(r,i,s/2,o/2);break;case"dls":n.fillRect(r+s/2,i,s/2,o/2);break;case"ss":for(let l=0;l<s;l+=2)n.fillRect(r+l,i,1,o);break;case"cr":n.fillRect(r,i+o/3,s,o/3),n.fillRect(r+s/3,i,s/3,o);break;case"sc":n.fillRect(r,i+o/2-1,s,2),n.fillRect(r+s/2-1,i,2,o);break;default:n.fillRect(r,i,s,o)}};function fu(n,e){if(!e||e.length===0)return`banner_${n}_empty`;let t=e.map(r=>`${r.Pattern??"bs"}_${r.Color??0}`).join(",");return`banner_${n}_${t}`}var mu=(n,e,t=(r,i)=>Ne(r,i))=>{let i=t(dl*1,ul*1),s=i.getContext("2d");if(s){if(s.imageSmoothingEnabled=!1,e?.Patterns&&e.Patterns.length>0)for(let o of e.Patterns){let l=o.Color??0,a=o.Pattern??"bs",v=hl[l]||hl[0];hu(s,a,v,0,0,dl*1,ul*1)}return i}},ei=new Map;function fl(n,e,t){let r=uu(e),i=fu(r,t?.Patterns),s=ei.get(i);if(s)return s.refCount++,s.texture;let o=mu(r,t);if(!o)return;let l=new ot.Texture(o);return l.magFilter=ot.NearestFilter,l.minFilter=ot.NearestFilter,l.needsUpdate=!0,ei.set(i,{texture:l,refCount:1}),l}function ml(n){for(let[e,t]of ei.entries())if(t.texture===n){t.refCount--,t.refCount<=0&&(t.texture.dispose(),ei.delete(e));return}}function pl(n,e,t,r,i=0,s=1,o=1){let c,u,h;t?(c=(-14.6+13.4)/2/16-.5,u=1-14.75/16-.5,h=1/2):(c=(1.4+29.4)/2/16,u=1-7.25/16-.5,h=0);let p=new ot.MeshBasicMaterial({map:r,transparent:!0});cl(p,i,s,o);let m=new ot.Mesh(new ot.PlaneGeometry(.85,1.75),p);m.renderOrder=999;let b=.5/16,k=.25/16;t?m.position.set(0,c,u+k+.004):m.position.set(0,c,u+b/2+.004);let _=new ot.Group;return _.rotation.set(0,-ot.MathUtils.degToRad(e*(t?90:45/2)),0),_.add(m),_.bannerTexture=r,_.bannerMaterial=p,_.position.set(n.x+.5,n.y+h,n.z+.5),_}A();E();R();x();import*as p5 from"three";import pu from"prismarine-chat";var fr=new Map;function gu(n,e,t){let r,i;return n&&"front_text"in n?(r=n.front_text?.messages??[],i=n.front_text?.color||"black"):(r=[n?.Text1,n?.Text2,n?.Text3,n?.Text4],i=n?.Color||"black"),`${e?1:0}|${t?1:0}|${i}|${r.join("\0")}`}function gl(n,e,t,r=!1){let i=gu(e,t,r),s=fr.get(i);if(s)return s.refCount++,s.texture;let o=pu(n.version),l=B2(e,t,o);if(!l)return;let a=new p5.Texture(l);return a.magFilter=p5.NearestFilter,a.minFilter=p5.NearestFilter,a.needsUpdate=!0,fr.set(i,{texture:a,refCount:1}),a}function bl(n){for(let[e,t]of fr.entries())if(t.texture===n){t.refCount--,t.refCount<=0&&(t.texture.dispose(),fr.delete(e));return}}function yl(){for(let[,n]of fr)n.texture.dispose();fr.clear()}A();E();R();x();A();E();R();x();import{Vec3 as wl}from"vec3";A();E();R();x();var g5=[0,1,2,3,4,5],bu=g5.length,ti=2**36-1;function _l(n,e,t){let r=e+t*bu;return Math.floor(n/2**r)%2===1}function ms(n){switch(n){case 0:return 1;case 1:return 0;case 2:return 3;case 3:return 2;case 4:return 5;case 5:return 4;default:return n}}var b5=class{constructor(e,t,r){d(this,"sectionKey");d(this,"sourceDirections",0);d(this,"directions",0);d(this,"step");this.sectionKey=e,this.step=r,t!=null&&this.addSourceDirection(t)}setDirections(e,t){this.directions=(e|this.directions|1<<t)>>>0}hasDirection(e){return(this.directions&1<<e)!==0}addSourceDirection(e){this.sourceDirections=(this.sourceDirections|1<<e)>>>0}hasSourceDirection(e){return(this.sourceDirections&1<<e)!==0}hasSourceDirections(){return this.sourceDirections!==0}};function i0(n,e,t){return`${n},${e},${t}`}function y5(n){let[e,t,r]=n.split(",").map(Number);return{x:e,y:t,z:r}}function yu(n,e,t){let{x:r,y:i,z:s}=y5(n);switch(e){case 0:return i0(r,i-t,s);case 1:return i0(r,i+t,s);case 2:return i0(r,i,s-16);case 3:return i0(r,i,s+16);case 4:return i0(r-16,i,s);case 5:return i0(r+16,i,s);default:return n}}function Al(n,e,t,r){let i=y5(n),s=y5(e),o=Math.floor(i.x/16),l=Math.floor(i.z/16),a=Math.floor(s.x/16),v=Math.floor(s.z/16);if(Math.abs(a-o)>t||Math.abs(v-l)>t)return!1;let c=Math.floor(i.y/r),u=Math.floor(s.y/r);return Math.abs(u-c)<=t}var ri=class{constructor(){d(this,"sections",new Map);d(this,"nodeByKey",new Map);d(this,"visibleKeys",new Set);d(this,"stepByKey",new Map);d(this,"needsFullUpdate",!0);d(this,"lastCameraKey","")}registerSection(e,t){this.sections.set(e,t),this.needsFullUpdate=!0}unregisterSection(e){this.sections.delete(e)&&(this.needsFullUpdate=!0),this.nodeByKey.delete(e),this.visibleKeys.delete(e),this.stepByKey.delete(e)}invalidate(){this.needsFullUpdate=!0}getVisibleKeys(){return this.visibleKeys}getStep(e){return this.stepByKey.get(e)}isVisible(e){return this.visibleKeys.has(e)}update(e){let t=i0(Math.floor(e.cameraWorldX/16)*16,Math.floor(e.cameraWorldY/e.sectionHeight)*e.sectionHeight,Math.floor(e.cameraWorldZ/16)*16);if(t!==this.lastCameraKey&&(this.needsFullUpdate=!0,this.lastCameraKey=t),!e.smartCull){this.visibleKeys=new Set(this.sections.keys()),this.stepByKey.clear();for(let r of this.visibleKeys)this.stepByKey.set(r,0);return this.visibleKeys}return this.needsFullUpdate&&(this.runFullUpdate(t,e),this.needsFullUpdate=!1),this.visibleKeys}runFullUpdate(e,t){this.nodeByKey.clear(),this.visibleKeys=new Set,this.stepByKey.clear();let r=[];for(this.initializeQueueForFullUpdate(e,r,t);r.length>0;){let i=r.shift(),s=i.sectionKey;if(!this.sections.has(s))continue;this.visibleKeys.add(s),this.stepByKey.set(s,i.step);let o=this.sections.get(s)?.visibilitySet??ti;for(let l of g5){let a=yu(s,l,t.sectionHeight);if(!this.sections.has(a)||!Al(e,a,t.viewDistance,t.sectionHeight)||i.hasDirection(ms(l)))continue;if(i.hasSourceDirections()){let c=!1;for(let u=0;u<g5.length;u++)if(i.hasSourceDirection(u)&&_l(o,ms(g5[u]),l)){c=!0;break}if(!c)continue}let v=this.nodeByKey.get(a);if(v)v.addSourceDirection(l);else{let c=new b5(a,l,i.step+1);c.setDirections(i.directions,l),this.nodeByKey.set(a,c),r.push(c)}}}}initializeQueueForFullUpdate(e,t,r){if(this.sections.has(e)){let m=new b5(e,null,0);this.nodeByKey.set(e,m),t.push(m);return}let i=y5(e),s=Math.floor(i.y/r.sectionHeight),o=Math.floor(r.worldMinY/r.sectionHeight),l=Math.floor((r.worldMaxY-1)/r.sectionHeight),a=s<o,c=(a?o:l)*r.sectionHeight,u=Math.floor(i.x/16),h=Math.floor(i.z/16),p=[];for(let m=-r.viewDistance;m<=r.viewDistance;m++)for(let b=-r.viewDistance;b<=r.viewDistance;b++){let k=i0((u+m)*16,c,(h+b)*16);if(!this.sections.has(k)||!Al(e,k,r.viewDistance,r.sectionHeight))continue;let _=a?1:0,y=new b5(k,_,0);y.setDirections(0,_),m>0?y.setDirections(y.directions,5):m<0&&y.setDirections(y.directions,4),b>0?y.setDirections(y.directions,3):b<0&&y.setDirections(y.directions,2);let M=new wl(i.x+8,i.y+8,i.z+8),T=y5(k),S=M.distanceTo(new wl(T.x+8,T.y+8,T.z+8));p.push({node:y,distSq:S})}p.sort((m,b)=>m.distSq-b.distSq);for(let m of p)this.nodeByKey.set(m.node.sectionKey,m.node),t.push(m.node)}};var ni=class{constructor(){d(this,"graph",new ri);d(this,"registered",new Set);d(this,"lastVisible",new Set)}registerSection(e,t,r,i,s){this.registered.add(e),this.graph.registerSection(e,{visibilitySet:t??ti,worldX:r,worldY:i,worldZ:s})}unregisterSection(e){this.registered.delete(e),this.graph.unregisterSection(e)}invalidate(){this.graph.invalidate()}update(e){return this.lastVisible=this.graph.update(e),this.lastVisible}isSectionVisible(e){return this.registered.has(e)?this.lastVisible.has(e):!0}hasRegisteredSection(e){return this.registered.has(e)}getVisibleKeys(){return this.lastVisible}getStep(e){return this.graph.getStep(e)}getGraph(){return this.graph}};function El(n){let t=n%50/50*6,r=.9,i=r*(1-Math.abs(t%2-1)),s=0,o=0,l=0;t<1?(s=r,o=i):t<2?(s=i,o=r):t<3?(o=r,l=i):t<4?(o=i,l=r):t<5?(s=i,l=r):(s=r,l=i);let a=.1,v=Math.round((s+a)*255),c=Math.round((o+a)*255),u=Math.round((l+a)*255);return v<<16|c<<8|u}var dt=class dt{constructor(e,t,r,i,s=3){this.worldRenderer=e;this.scene=t;this.material=r;this.worldHeight=i;d(this,"renderOrigin",{x:0,y:0,z:0});d(this,"meshPool",[]);d(this,"activeSections",new Map);d(this,"sectionObjects",{});d(this,"waitingChunksToDisplay",{});d(this,"pendingNearReveal",new Map);d(this,"nearRevealTimers",new Map);d(this,"nearRevealGraceTimers",new Map);d(this,"poolSize");d(this,"maxPoolSize");d(this,"minPoolSize");d(this,"signHeadsRenderer");d(this,"blockEntityLightRegistry",new $n);d(this,"chunkBoxMaterial",new X.MeshBasicMaterial({color:0,transparent:!0,opacity:0}));d(this,"cubeShaderMaterial",null);d(this,"legacyShaderMaterial",null);d(this,"globalLegacyShaderMaterial",null);d(this,"globalLegacyBlendShaderMaterial",null);d(this,"_legacyCullFrustum",new X.Frustum);d(this,"_legacyCullProjScreen",new X.Matrix4);d(this,"_legacyCullBox",new X.Box3);d(this,"_legacyCullBoxMin",new X.Vector3);d(this,"_legacyCullBoxMax",new X.Vector3);d(this,"_visibleSectionSpans",[]);d(this,"legacyCullSections",new Map);d(this,"_lastCullFingerprint","");d(this,"lastBufferStateKey","");d(this,"cullDirty",!0);d(this,"_lastCullCamPos",new X.Vector3);d(this,"_lastCullCamQuat",new X.Quaternion);d(this,"_cullViewQuat",new X.Quaternion);d(this,"_cullCamInitialized",!1);d(this,"_visibleBlendKeys",[]);d(this,"_lastBlendSortPos",new X.Vector3);d(this,"_lastBlendSortLayoutVersion",-1);d(this,"_blendSortPosInitialized",!1);d(this,"globalBlockBuffer",null);d(this,"globalLegacyBuffer",null);d(this,"globalLegacyBlendBuffer",null);d(this,"shaderSectionRaycastBoxes",new Map);d(this,"sectionOcclusionCull",new ni);d(this,"_lastOcclusionVisibleKeys","");d(this,"_lastSmartCullEnabled");d(this,"hits",0);d(this,"misses",0);d(this,"bypassPooling",!1);d(this,"renderTimes",[]);d(this,"maxRenderTimeSamples",30);d(this,"_performanceOverrideDistance");d(this,"lastPerformanceCheck",0);d(this,"performanceCheckInterval",2e3);this.updateViewDistance(s),this.signHeadsRenderer=new gs(e),this.initializePool()}get performanceOverrideDistance(){return this._performanceOverrideDistance??0}set performanceOverrideDistance(e){this._performanceOverrideDistance=e,this.updateSectionsVisibility()}initializePool(){for(let e=0;e<this.poolSize;e++){let t=new X.BufferGeometry,r=new X.Mesh(t,this.getLegacyShaderMaterial());r.visible=!1,r.matrixAutoUpdate=!1,r.name="pooled-section-mesh";let i={mesh:r,inUse:!1,lastUsedTime:0};this.meshPool.push(i)}}sectionHasRenderableContent(e){return e.positions.length>0||(e.blend?.positions.length??0)>0?!0:this.isShaderCubesGpuEnabled()?(e.shaderCubes?.count??0)>0:!1}isShaderCubesGpuEnabled(){return this.worldRenderer.shaderCubeBlocksEnabled()}syncCubeShaderUniforms(){if(!this.isShaderCubesGpuEnabled())return;let e=this.cubeShaderMaterial??this.getCubeShaderMaterial();if(!e)return;let t=this.material.map??null;e.uniforms.u_atlas.value=t;let r=jn();if(!r)return;let{tintPalette:i}=r;i.isReady()||i.createTexture(),e.uniforms.u_tintPalette.value=i.getTexture(),e.uniforms.u_debugMode.value=this.worldRenderer.worldRendererConfig.shaderCubeDebugMode??0,e.needsUpdate=!0}syncLegacyShaderUniforms(){let e=this.material.map??null;this.legacyShaderMaterial&&(this.legacyShaderMaterial.uniforms.u_atlas.value=e,this.legacyShaderMaterial.needsUpdate=!0),this.globalLegacyShaderMaterial&&(this.globalLegacyShaderMaterial.uniforms.u_atlas.value=e,this.globalLegacyShaderMaterial.needsUpdate=!0),this.globalLegacyBlendShaderMaterial&&(this.globalLegacyBlendShaderMaterial.uniforms.u_atlas.value=e,this.globalLegacyBlendShaderMaterial.needsUpdate=!0)}setSkyLevel(e){let t=this.cubeShaderMaterial??(this.isShaderCubesGpuEnabled()?this.getCubeShaderMaterial():null);t&&Un(t,e),this.legacyShaderMaterial&&Kn(this.legacyShaderMaterial,e),this.globalLegacyShaderMaterial&&Kn(this.globalLegacyShaderMaterial,e),this.globalLegacyBlendShaderMaterial&&Kn(this.globalLegacyBlendShaderMaterial,e),this.blockEntityLightRegistry.setSkyLevel(e)}setShadingTheme(e,t){let r=this.cubeShaderMaterial??(this.isShaderCubesGpuEnabled()?this.getCubeShaderMaterial():null);r&&rs(r,e,t)}setBlockLightmapParams(e){let t=this.cubeShaderMaterial??(this.isShaderCubesGpuEnabled()?this.getCubeShaderMaterial():null);t&&T7(t,e),this.legacyShaderMaterial&&qn(this.legacyShaderMaterial,e),this.globalLegacyShaderMaterial&&qn(this.globalLegacyShaderMaterial,e),this.globalLegacyBlendShaderMaterial&&qn(this.globalLegacyBlendShaderMaterial,e),this.blockEntityLightRegistry.setLightmapParams(e)}getLegacyShaderMaterial(){return this.legacyShaderMaterial||(this.legacyShaderMaterial=N7(),this.syncLegacyShaderUniforms()),this.legacyShaderMaterial}getGlobalLegacyShaderMaterial(){return this.globalLegacyShaderMaterial||(this.globalLegacyShaderMaterial=W7(),this.syncLegacyShaderUniforms()),this.globalLegacyShaderMaterial}getGlobalLegacyBuffer(){return this.globalLegacyBuffer||(this.globalLegacyBuffer=new f5(this.getGlobalLegacyShaderMaterial(),this.scene),this.globalLegacyBuffer.setRenderOrigin(this.renderOrigin)),this.globalLegacyBuffer}getGlobalLegacyBlendShaderMaterial(){return this.globalLegacyBlendShaderMaterial||(this.globalLegacyBlendShaderMaterial=j7(),this.syncLegacyShaderUniforms()),this.globalLegacyBlendShaderMaterial}getGlobalLegacyBlendBuffer(){return this.globalLegacyBlendBuffer||(this.globalLegacyBlendBuffer=new f5(this.getGlobalLegacyBlendShaderMaterial(),this.scene,{name:"globalLegacyBlend",initialCapacityQuads:32e3,growthIncrementQuads:32e3,sortBlend:!0}),this.globalLegacyBlendBuffer.setRenderOrigin(this.renderOrigin)),this.globalLegacyBlendBuffer}getRenderOrigin(){return this.renderOrigin}maybeRebase(e){let t=this.renderOrigin;if(Math.abs(e.x-t.x)<=dt.REBASE_THRESHOLD&&Math.abs(e.y-t.y)<=dt.REBASE_THRESHOLD&&Math.abs(e.z-t.z)<=dt.REBASE_THRESHOLD)return;let r={x:Math.round(e.x/16)*16,y:Math.round(e.y/16)*16,z:Math.round(e.z/16)*16},i={x:r.x-t.x,y:r.y-t.y,z:r.z-t.z};this.globalLegacyBuffer?.rebase(i),this.globalLegacyBlendBuffer?.rebase(i);for(let s of this.activeSections.values()){let o=s.sectionKey;if(!o)continue;let l=this.sectionObjects[o];l&&us(s.mesh,l.worldX??0,l.worldY??0,l.worldZ??0,r)}this.renderOrigin=r,this.globalLegacyBuffer?.setRenderOrigin(r),this.globalLegacyBlendBuffer?.setRenderOrigin(r)}sectionUsesPooledLegacyMesh(e){return this.activeSections.has(e)}registerLegacyCullSection(e,t,r,i){this.legacyCullSections.set(e,{worldX:t,worldY:r,worldZ:i})}maybeUnregisterLegacyCullSection(e){let t=this.globalLegacyBuffer?.hasSection(e)??!1,r=this.globalLegacyBlendBuffer?.hasSection(e)??!1;!t&&!r&&this.legacyCullSections.delete(e)}updatePooledLegacyCullState(e,t,r,i,s){for(let o of this.activeSections.values()){let l=o.sectionKey;if(!l)continue;let a=this.sectionObjects[l];a&&(Y7(o.mesh,a.worldX??0,a.worldY??0,a.worldZ??0,e,t,r,this._legacyCullFrustum,this._legacyCullBox,this._legacyCullBoxMin,this._legacyCullBoxMax),i&&!s.has(l)&&(o.mesh.visible=!1))}}isSectionOcclusionVisible(e){return this.sectionOcclusionCull.isSectionVisible(e)}notifySmartCullChanged(e){this._lastSmartCullEnabled!==e&&(this._lastSmartCullEnabled=e,this.sectionOcclusionCull.invalidate(),this.markCullDirty())}updateSectionCullAndSort(e,t,r,i,s){this._legacyCullProjScreen.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._legacyCullFrustum.setFromProjectionMatrix(this._legacyCullProjScreen);let o=this.worldRenderer.getSectionHeight?.()??16,l=this.worldRenderer.worldSizeParams??{minY:0,worldHeight:256},a=this.sectionOcclusionCull.update({smartCull:s,cameraWorldX:t,cameraWorldY:r,cameraWorldZ:i,viewDistance:this.worldRenderer.viewDistance,sectionHeight:o,worldMinY:l.minY,worldMaxY:l.minY+l.worldHeight}),v=this._visibleSectionSpans;v.length=0;for(let[T]of this.legacyCullSections){let S=this.sectionObjects[T];if(!S?.visible||S.worldX===void 0)continue;let{visible:B,distSq:P}=Jn(S.worldX,S.worldY??0,S.worldZ??0,t,r,i,this._legacyCullFrustum,this._legacyCullBox,this._legacyCullBoxMin,this._legacyCullBoxMax);B&&v.push({key:T,distSq:P})}if(s)for(let T=v.length-1;T>=0;T--)a.has(v[T].key)||v.splice(T,1);let c=this.globalLegacyBuffer,u=this.globalLegacyBlendBuffer,h=this.globalBlockBuffer,p=[];for(let T of v)c?.hasSection(T.key)&&p.push(T.key);p.sort();let m=v.filter(T=>u?.hasSection(T.key));m.sort((T,S)=>S.distSq-T.distSq);let b=m.map(T=>T.key);this._visibleBlendKeys=b;let k=[],_=[];h&&h.forEachSectionSlot((T,S)=>{if(!this.sectionObjects[T]?.visible)return;let P=this.shaderSectionRaycastBoxes.get(T);if(!P)return;let{visible:H}=Jn(P.sectionCenterX,P.sectionCenterY,P.sectionCenterZ,t,r,i,this._legacyCullFrustum,this._legacyCullBox,this._legacyCullBoxMin,this._legacyCullBoxMax);if(!H||s&&!a.has(T))return;k.push(T);let V=h.getSectionDrawStart(T),z=h.getSectionDrawCount(T);V!==void 0&&z!==void 0&&_.push({start:V,count:z})}),k.sort();let y=s?[...a].sort().join(","):"off",M=[p.join(","),b.join(","),k.join(","),y,s?"1":"0",c?.getLayoutVersion()??0,u?.getLayoutVersion()??0,h?.getLayoutVersion()??0,c?.getUploadEpoch()??0,u?.getUploadEpoch()??0,h?.getUploadEpoch()??0].join("|");if(M===this._lastCullFingerprint&&!this.hasPendingBufferWork()){this.updatePooledLegacyCullState(t,r,i,s,a),this._lastOcclusionVisibleKeys=y;return}if(this._lastCullFingerprint=M,this._lastOcclusionVisibleKeys=y,c?.updateDrawSpans(v,"opaque"),u?.updateDrawSpans(v,"sortedBlend"),h){let T=$7(_,h.getHighWatermark(),h.canUseFullDrawShortcut(),(S,B)=>h.isRangeFullyUploaded(S,B),h.getPendingDirtyRanges());h.setVisibleSpans(T)}this.lastBufferStateKey=this.bufferStateKey(),this.updatePooledLegacyCullState(t,r,i,s,a)}sortVisibleBlendSections(e,t,r){let i=this.globalLegacyBlendBuffer;if(!i||this._visibleBlendKeys.length===0)return;let s=i.getLayoutVersion(),o=s!==this._lastBlendSortLayoutVersion;if(this._blendSortPosInitialized&&!o){let l=e-this._lastBlendSortPos.x,a=t-this._lastBlendSortPos.y,v=r-this._lastBlendSortPos.z;if(l*l+a*a+v*v<dt.BLEND_RESORT_DISTANCE*dt.BLEND_RESORT_DISTANCE)return}for(let l of this._visibleBlendKeys)i.reorderSectionBlendIndices(l,e,t,r);this._lastBlendSortPos.set(e,t,r),this._blendSortPosInitialized=!0,this._lastBlendSortLayoutVersion=s}bufferStateKey(){let e=this.globalBlockBuffer,t=this.globalLegacyBuffer,r=this.globalLegacyBlendBuffer;return[t?.getLayoutVersion()??0,t?.getUploadEpoch()??0,r?.getLayoutVersion()??0,r?.getUploadEpoch()??0,e?.getLayoutVersion()??0,e?.getUploadEpoch()??0].join("|")}markCullDirtyIfBufferStateChanged(){this.bufferStateKey()!==this.lastBufferStateKey&&this.markCullDirty()}markCullDirty(){this.cullDirty=!0}hasPendingBufferWork(){return[this.globalLegacyBuffer,this.globalLegacyBlendBuffer,this.globalBlockBuffer].some(t=>t!=null&&(t.hasPendingUploads()||t.hasPendingReplace()||t.getPendingMove()!=null))}updateCullDirtyFromCamera(e,t,r,i){if(e.getWorldQuaternion(this._cullViewQuat),!this._cullCamInitialized){this._lastCullCamPos.set(t,r,i),this._lastCullCamQuat.copy(this._cullViewQuat),this._cullCamInitialized=!0,this.cullDirty=!0;return}let s=this._lastCullCamPos.x!==t||this._lastCullCamPos.y!==r||this._lastCullCamPos.z!==i,o=this._lastCullCamQuat.x!==this._cullViewQuat.x||this._lastCullCamQuat.y!==this._cullViewQuat.y||this._lastCullCamQuat.z!==this._cullViewQuat.z||this._lastCullCamQuat.w!==this._cullViewQuat.w;(s||o)&&(this._lastCullCamPos.set(t,r,i),this._lastCullCamQuat.copy(this._cullViewQuat),this.markCullDirty())}clearCullDirty(){this.cullDirty=!1}setLegacyCameraOrigin(e,t,r){let i=this.renderOrigin;Qn(this.getLegacyShaderMaterial(),i,e,t,r),Qn(this.getGlobalLegacyShaderMaterial(),i,e,t,r),Qn(this.getGlobalLegacyBlendShaderMaterial(),i,e,t,r),this.globalLegacyBuffer?.setCameraOrigin(e,t,r),this.globalLegacyBlendBuffer?.setCameraOrigin(e,t,r);let s=this.cubeShaderMaterial;if(s){let{originDelta:o,cameraOriginFrac:l}=F0(i,e,t,r),a=Vn(i),v=s.uniforms.u_originDelta;v?.value?.set&&v.value.set(o.x,o.y,o.z);let c=s.uniforms.u_cameraOriginFrac;c?.value?.set&&c.value.set(l.x,l.y,l.z);let u=s.uniforms.u_sectionOriginRel;u?.value?.set&&u.value.set(a.x,a.y,a.z)}}getCubeShaderMaterial(){if(!this.isShaderCubesGpuEnabled())return null;if(!this.cubeShaderMaterial){this.cubeShaderMaterial=zn(),this.syncCubeShaderUniforms();let e=this.worldRenderer.worldRendererConfig;rs(this.cubeShaderMaterial,e.shadingTheme,e.cardinalLight)}return this.cubeShaderMaterial}getGlobalBlockBuffer(){let e=this.getCubeShaderMaterial();return e?(this.globalBlockBuffer||(this.globalBlockBuffer=new Zn(e,this.scene)),this.globalBlockBuffer):null}shouldDeferLegacyOpaqueToPerSection(e){return this.shouldDeferShaderToPerSection(e)}shouldDeferShaderToPerSection(e){return this.worldRenderer.getModule("futuristicReveal")?.shouldDeferSectionGeometry?.(e)===!0}migrateDeferredShaderToGlobal(e){let t=this.sectionObjects[e];if(!t?.deferredShaderCubes)return;let{words:r,count:i}=t.deferredShaderCubes,s=t.worldX,o=t.worldY,l=t.worldZ;s!==void 0&&o!==void 0&&l!==void 0&&this.registerShaderSectionRaycastBox(e,r,i,s,o,l),this.getGlobalBlockBuffer()?.addSection(e,r,i),this.markCullDirty();let v=t.mesh===t.shaderMesh;t.shaderMesh&&(os(t.shaderMesh),t.remove(t.shaderMesh),t.shaderMesh=void 0),delete t.deferredShaderCubes,v&&(t.mesh=void 0)}migrateDeferredLegacyToGlobal(e){let t=this.sectionObjects[e];if(t){if(t.deferredLegacyOpaque){let{positions:r,colors:i,skyLights:s,blockLights:o,uvs:l,indices:a}=t.deferredLegacyOpaque,v=t.worldX,c=t.worldY,u=t.worldZ;v!==void 0&&c!==void 0&&u!==void 0&&this.getGlobalLegacyBuffer().addSection(e,{positions:r,colors:i,skyLights:s,blockLights:o,uvs:l,indices:a},v,c,u)&&this.registerLegacyCullSection(e,v,c,u),delete t.deferredLegacyOpaque}if(t.deferredLegacyBlend){let{positions:r,colors:i,skyLights:s,blockLights:o,uvs:l,indices:a}=t.deferredLegacyBlend,v=t.worldX,c=t.worldY,u=t.worldZ;v!==void 0&&c!==void 0&&u!==void 0&&this.getGlobalLegacyBlendBuffer().addSection(e,{positions:r,colors:i,skyLights:s,blockLights:o,uvs:l,indices:a},v,c,u)&&this.registerLegacyCullSection(e,v,c,u),delete t.deferredLegacyBlend,t.hasBlendMesh=!1}if(!t.hasBlendMesh){let r=t.mesh===this.activeSections.get(e)?.mesh;this.releasePooledMesh(e),r&&(t.mesh=t.shaderMesh??void 0)}this.markCullDirty()}}registerShaderSectionRaycastBox(e,t,r,i,s,o){let l=al(t,r,i,s,o);l?this.shaderSectionRaycastBoxes.set(e,{box:l,sectionCenterX:i,sectionCenterY:s,sectionCenterZ:o}):this.shaderSectionRaycastBoxes.delete(e)}unregisterShaderSectionRaycastBox(e){this.shaderSectionRaycastBoxes.delete(e)}uploadLegacyPooledMesh(e,t,r,i,s){let{mesh:o}=e,l=t;return this.updateGeometryAttribute(o.geometry,"position",l.positions,3),this.updateGeometryAttribute(o.geometry,"normal",l.normals,3),this.updateGeometryAttribute(o.geometry,"color",l.colors,3),this.updateGeometryAttribute(o.geometry,"a_skyLight",l.skyLights,1),this.updateGeometryAttribute(o.geometry,"a_blockLight",l.blockLights,1),this.updateGeometryAttribute(o.geometry,"uv",l.uvs,2),o.geometry.index=new X.BufferAttribute(l.indices,1),o.geometry.boundingBox=new X.Box3(new X.Vector3(-8,-8,-8),new X.Vector3(8,8,8)),o.geometry.boundingSphere=new X.Sphere(new X.Vector3(0,0,0),Math.sqrt(3*8**2)),us(o,r,i,s,this.renderOrigin),o.visible=!1,o.name="mesh",e.lastUsedTime=performance.now(),o}acquirePooledSectionMesh(e){let t=this.activeSections.get(e);if(!t){if(t=this.acquireMesh(),!t)return null;this.activeSections.set(e,t),t.sectionKey=e}return t}updateSection(e,t){let r=t.positions.length>0,i=(t.blend?.positions.length??0)>0,s=r||i,o=t.shaderCubes,l=this.isShaderCubesGpuEnabled()&&(o?.count??0)>0,a=r&&this.shouldDeferLegacyOpaqueToPerSection(e),v=i&&this.shouldDeferLegacyOpaqueToPerSection(e),c=l&&this.shouldDeferShaderToPerSection(e),u=r&&!a,h=i&&!v,p=l&&!!o&&!c;if(!s&&!l)return this.releaseSection(e),null;let m=this.sectionObjects[e],b=m!=null;m&&this.cleanupSection(e,{forRemesh:!0}),b&&(p||this.globalBlockBuffer?.removeSection(e),u||this.globalLegacyBuffer?.removeSection(e),h||this.globalLegacyBlendBuffer?.removeSection(e),l&&o||this.unregisterShaderSectionRaycastBox(e),!u&&!h&&this.maybeUnregisterLegacyCullSection(e)),i||this.releasePooledMesh(e);let k,_,y,M=!1;if(r){let N={positions:t.positions,colors:t.colors,skyLights:t.skyLights,blockLights:t.blockLights,uvs:t.uvs,indices:t.indices};if(a){if(_={positions:new Float32Array(N.positions),colors:new Float32Array(N.colors),skyLights:new Float32Array(N.skyLights),blockLights:new Float32Array(N.blockLights),uvs:new Float32Array(N.uvs),indices:N.indices instanceof Uint32Array?new Uint32Array(N.indices):new Uint16Array(N.indices)},!i){let Y=this.acquirePooledSectionMesh(e);if(!Y)return null;k=this.uploadLegacyPooledMesh(Y,t,t.sx,t.sy,t.sz)}}else if(this.getGlobalLegacyBuffer().addSection(e,N,t.sx,t.sy,t.sz))this.registerLegacyCullSection(e,t.sx,t.sy,t.sz);else{let q=this.acquirePooledSectionMesh(e);if(!q)return null;k=this.uploadLegacyPooledMesh(q,t,t.sx,t.sy,t.sz)}}if(i&&t.blend){let N={positions:t.blend.positions,colors:t.blend.colors,skyLights:t.blend.skyLights,blockLights:t.blend.blockLights,uvs:t.blend.uvs,indices:t.blend.indices};if(v){y={positions:new Float32Array(N.positions),colors:new Float32Array(N.colors),skyLights:new Float32Array(N.skyLights),blockLights:new Float32Array(N.blockLights),uvs:new Float32Array(N.uvs),indices:N.indices instanceof Uint32Array?new Uint32Array(N.indices):new Uint16Array(N.indices)};let Y=this.acquirePooledSectionMesh(e);if(!Y)return null;let q=this.uploadLegacyPooledMesh(Y,t.blend,t.sx,t.sy,t.sz);k=k??q,M=!0}else if(this.getGlobalLegacyBlendBuffer().addSection(e,N,t.sx,t.sy,t.sz))this.registerLegacyCullSection(e,t.sx,t.sy,t.sz);else{let q=this.acquirePooledSectionMesh(e);if(!q)return null;let J=this.uploadLegacyPooledMesh(q,t.blend,t.sx,t.sy,t.sz);k=k??J,M=!0}}let T=l?this.getCubeShaderMaterial():null,S;l&&o&&(c&&T?(S=Yn(o,T),S.visible=!0):this.getGlobalBlockBuffer()?.addSection(e,o.words,o.count)),m=new X.Group,k&&(m.add(k),m.mesh=k),S&&(m.add(S),m.shaderMesh=S,o&&(m.deferredShaderCubes={words:o.words,count:o.count}),m.mesh||(m.mesh=S)),_&&(m.deferredLegacyOpaque=_),y&&(m.deferredLegacyBlend=y),l&&o&&this.registerShaderSectionRaycastBox(e,o.words,o.count,t.sx,t.sy,t.sz);let B=0;r&&(B+=t.positions.length/3/4),i&&t.blend&&(B+=t.blend.positions.length/3/4),l&&o&&(B+=o.count),m.tilesCount=B,m.hasBlendMesh=M,m.blocksCount=t.blocksCount,m.worldX=t.sx,m.worldY=t.sy,m.worldZ=t.sz,m.visibilitySet=t.visibilitySet,this.sectionOcclusionCull.registerSection(e,t.visibilitySet,t.sx,t.sy,t.sz),m.sectionKey=e,m.name="chunk";try{if(Object.keys(t.signs).length>0){let N=new X.Group;N.name="signs";for(let[Y,{isWall:q,isHanging:J,rotation:te}]of Object.entries(t.signs)){let se=this.worldRenderer.blockEntities[Y];if(!se)continue;let[he,fe,pe]=Y.split(","),oe=this.signHeadsRenderer.renderSign(new ps(+he,+fe,+pe),te,q,J,ii.simplify(se));oe&&N.add(oe)}m.add(N),m.signsContainer=N}if(Object.keys(t.heads).length>0){let N=new X.Group;N.name="heads";for(let[Y,{isWall:q,rotation:J}]of Object.entries(t.heads)){let te=this.worldRenderer.blockEntities[Y];if(!te)continue;let[se,he,fe]=Y.split(","),pe=this.signHeadsRenderer.renderHead(new ps(+se,+he,+fe),J,q,ii.simplify(te));pe&&N.add(pe)}m.add(N),m.headsContainer=N}if(Object.keys(t.banners).length>0){let N=new X.Group;N.name="banners",m.bannersContainer=N,m.add(N);for(let[Y,q]of Object.entries(t.banners)){let{isWall:J,rotation:te,blockName:se,blockLightNorm:he=0,skyLightNorm:fe=1}=q,pe=this.worldRenderer.blockEntities[Y];if(!pe)continue;let[oe,Q,ce]=Y.split(","),be=fl(this.worldRenderer,se,ii.simplify(pe));if(!be)continue;let qe=this.blockEntityLightRegistry.getSkyLevel(),Re=pl(new ps(+oe,+Q,+ce),te,J,be,he,fe,qe);Re.bannerMaterial&&this.blockEntityLightRegistry.register({material:Re.bannerMaterial,blockLightNorm:he,skyLightNorm:fe});let{x:at,y:ye,z:ut}=Re.position;this.worldRenderer.sceneOrigin.track(Re),Re.position.set(at,ye,ut),N.add(Re)}}}catch{}this.sectionObjects[e]=m,this.scene.add(m),m.matrixAutoUpdate=!1,this.worldRenderer.displayOptions?.inWorldRenderingConfig?.showChunkBorders&&this.updateBoxHelper(e,!0);let P=e.split(","),H=`${P[0]},${P[2]}`,V=!!this.worldRenderer.displayOptions?.inWorldRenderingConfig?._renderByChunks,z=!!this.worldRenderer.worldRendererConfig?.wasmMesher;if((V||z)&&!this.worldRenderer.finishedChunks[H]){m.visible=!1,m._waitingForChunkDisplay=!0;let N=this.waitingChunksToDisplay[H]??(this.waitingChunksToDisplay[H]=[]);N.includes(e)||N.push(e)}return this.markCullDirty(),m}finishChunkDisplay(e){if(!this.waitingChunksToDisplay[e]){this.tryRevealPending();return}if(this.isWasmGateActive()&&this.isBlockedByNearer(e,0)){this.pendingNearReveal.set(e,Date.now()),this.armNearRevealTimer(e),this.armExpectedGraceTimer(e),this.tryRevealPending();return}this.flushChunkDisplay(e),this.tryRevealPending()}flushChunkDisplay(e){let t=this.waitingChunksToDisplay[e];if(this.pendingNearReveal.delete(e),this.clearNearRevealTimer(e),this.clearExpectedGraceTimer(e),!!t){for(let r of t){let i=this.sectionObjects[r];i&&(i._waitingForChunkDisplay=!1,i.visible=!0)}delete this.waitingChunksToDisplay[e],this.markCullDirty()}}tryRevealPending(){if(this.pendingNearReveal.size===0)return;let e=Date.now();for(let[t,r]of[...this.pendingNearReveal])this.isBlockedByNearer(t,e-r)||this.flushChunkDisplay(t)}onChunkRemovedFromGate(e){this.pendingNearReveal.delete(e),this.clearNearRevealTimer(e),this.clearExpectedGraceTimer(e),delete this.waitingChunksToDisplay[e],this.tryRevealPending()}isWasmGateActive(){return!!this.worldRenderer.worldRendererConfig?.wasmMesher}isBlockedByNearer(e,t){let r=this.worldRenderer.viewerChunkPosition;if(!r)return!1;let i=e.split(",");if(i.length!==2)return!1;let s=Number(i[0]),o=Number(i[1]),l=Math.floor(r.x/16),a=Math.floor(r.z/16),v=(s>>4)-l,c=(o>>4)-a,u=v*v+c*c;if(u===0)return!1;let h=this.worldRenderer.finishedChunks,p=this.worldRenderer.loadedChunks,m=this.worldRenderer.viewDistance;if(t<dt.EXPECTED_NEAR_GRACE_MS&&m>0){let k=m*m,_=Math.min(m,Math.ceil(Math.sqrt(Math.max(0,u-1))));for(let y=-_;y<=_;y++)for(let M=-_;M<=_;M++){let T=y*y+M*M;if(T>=u||T>k)continue;let S=l+y<<4,B=a+M<<4,P=`${S},${B}`;if(P!==e&&p[P]&&!h[P])return!0}return!1}for(let k in p){if(k===e||h[k])continue;let _=k.split(",");if(_.length!==2)continue;let y=(Number(_[0])>>4)-l,M=(Number(_[1])>>4)-a;if(y*y+M*M<u)return!0}return!1}armNearRevealTimer(e){if(this.nearRevealTimers.has(e))return;let t=setTimeout(()=>{this.nearRevealTimers.delete(e),this.pendingNearReveal.has(e)&&(this.flushChunkDisplay(e),this.tryRevealPending())},dt.NEAR_REVEAL_TIMEOUT_MS);this.nearRevealTimers.set(e,t)}clearNearRevealTimer(e){let t=this.nearRevealTimers.get(e);t&&(clearTimeout(t),this.nearRevealTimers.delete(e))}armExpectedGraceTimer(e){if(this.nearRevealGraceTimers.has(e))return;let t=setTimeout(()=>{this.nearRevealGraceTimers.delete(e),this.pendingNearReveal.has(e)&&this.tryRevealPending()},dt.EXPECTED_NEAR_GRACE_MS+50);this.nearRevealGraceTimers.set(e,t)}clearExpectedGraceTimer(e){let t=this.nearRevealGraceTimers.get(e);t&&(clearTimeout(t),this.nearRevealGraceTimers.delete(e))}cleanupSection(e,t){let r=this.sectionObjects[e];if(r){if(r._waitingForChunkDisplay){let i=e.split(","),s=`${i[0]},${i[2]}`,o=this.waitingChunksToDisplay[s];if(o){let l=o.indexOf(e);l!==-1&&o.splice(l,1),o.length===0&&delete this.waitingChunksToDisplay[s]}}if(r.bannersContainer){for(let i of r.bannersContainer.children){let s=i;s.bannerMaterial&&this.blockEntityLightRegistry.unregister(s.bannerMaterial),s.bannerTexture&&ml(s.bannerTexture)}this.disposeContainer(r.bannersContainer)}if(t?.forRemesh||(this.globalBlockBuffer?.removeSection(e),this.globalLegacyBuffer?.removeSection(e),this.globalLegacyBlendBuffer?.removeSection(e),this.maybeUnregisterLegacyCullSection(e),this.unregisterShaderSectionRaycastBox(e),this.sectionOcclusionCull.unregisterSection(e)),this.markCullDirty(),delete r.deferredLegacyOpaque,delete r.deferredLegacyBlend,r.shaderMesh&&(os(r.shaderMesh),r.shaderMesh=void 0),delete r.deferredShaderCubes,r.signsContainer){for(let i of r.signsContainer.children){let s=i;s.signTexture&&bl(s.signTexture)}this.disposeContainer(r.signsContainer,!1)}if(r.headsContainer&&this.disposeContainer(r.headsContainer),this.worldRenderer.sceneOrigin.removeAndUntrackAll(r),this.scene.remove(r),r.boxHelper){this.worldRenderer.sceneOrigin.removeAndUntrack(r.boxHelper),this.scene.remove(r.boxHelper),r.boxHelper.geometry.dispose();let i=r.boxHelper.material;if(Array.isArray(i))for(let s of i)s.dispose();else i.dispose();r.boxHelper=void 0}delete this.sectionObjects[e],t?.forRemesh||this.worldRenderer.getModule("futuristicReveal")?.onSectionRemoved?.(e)}}releasePooledMesh(e){let t=this.activeSections.get(e);t&&(t.mesh.visible=!1,t.inUse=!1,t.sectionKey=void 0,t.lastUsedTime=0,this.clearGeometry(t.mesh.geometry),this.activeSections.delete(e),this.cleanupExcessMeshes())}releaseSection(e){this.cleanupSection(e);let t=this.activeSections.get(e);return t?(t.mesh.visible=!1,t.inUse=!1,t.sectionKey=void 0,t.lastUsedTime=0,this.clearGeometry(t.mesh.geometry),this.activeSections.delete(e),this.cleanupExcessMeshes(),!0):!1}getSectionObject(e){return this.sectionObjects[e]}updateBoxHelper(e,t,r=this.chunkBoxMaterial){let i=this.sectionObjects[e];if(i)if(t){if(!i.boxHelper){let s=new X.Mesh(new X.BoxGeometry(16,16,16),r),o=new X.BoxHelper(s,16776960);o.name="helper";let l=i.worldX??0,a=i.worldY??0,v=i.worldZ??0;this.worldRenderer.sceneOrigin.track(o,{updateMatrix:!0}),o.position.set(l,a,v),o.updateMatrix(),this.scene.add(o),i.boxHelper=o}i.boxHelper.visible=!0}else i.boxHelper&&(i.boxHelper.visible=!1)}updateAllBoxHelpers(e){for(let t of Object.keys(this.sectionObjects))this.updateBoxHelper(t,e)}updateCaveCullingDebug(e,t){if(!e){for(let r of Object.keys(this.sectionObjects)){let i=this.sectionObjects[r];i?.boxHelper&&!this.worldRenderer.displayOptions?.inWorldRenderingConfig?.showChunkBorders&&(i.boxHelper.visible=!1)}return}for(let[r,i]of Object.entries(this.sectionObjects)){if(!i)continue;i.boxHelper||this.updateBoxHelper(r,!0);let s=i.boxHelper;if(!s)continue;s.visible=!0;let o=t?this.sectionOcclusionCull.isSectionVisible(r)?El(this.sectionOcclusionCull.getStep(r)??0):16711680:65280;s.material.color.setHex(o)}}getSectionMesh(e){return this.activeSections.get(e)?.mesh}hasSection(e){return this.activeSections.has(e)}updateViewDistance(e){let t=(e*2+1)**2,r=this.worldHeight/16,i=5;if(this.minPoolSize=Math.floor(t*i),this.maxPoolSize=Math.floor(t*r)+1,this.poolSize??(this.poolSize=this.minPoolSize),this.minPoolSize>this.poolSize){let s=Math.min(this.minPoolSize,this.maxPoolSize);this.expandPool(s)}}getGlobalBufferStats(){let e=r=>r?{used:r.getHighWatermark(),capacity:r.getCapacityQuads(),sections:r.getSectionCount(),usedBytes:r.getUsedMemoryBytes(),capacityBytes:r.getMemoryBytes()}:null,t=this.globalBlockBuffer;return{shaderFaces:t?{used:t.getHighWatermark(),capacity:t.getCapacityFaces(),sections:t.getSectionCount(),usedBytes:t.getUsedMemoryBytes(),capacityBytes:t.getMemoryBytes()}:null,legacyOpaque:e(this.globalLegacyBuffer),legacyBlend:e(this.globalLegacyBlendBuffer)}}getDrawnStats(){return{cubeFaces:this.globalBlockBuffer?.getVisibleFaceCount()??0,legacyOpaqueQuads:this.globalLegacyBuffer?.getVisibleQuadCount()??0,legacyBlendQuads:this.globalLegacyBlendBuffer?.getVisibleQuadCount()??0}}getStats(){let e=this.meshPool.filter(i=>!i.inUse).length,t=this.hits+this.misses>0?(this.hits/(this.hits+this.misses)*100).toFixed(1):"0",r=this.getEstimatedMemoryUsage();return{poolSize:this.poolSize,activeCount:this.activeSections.size,freeCount:e,hitRate:`${t}%`,hits:this.hits,misses:this.misses,memoryUsage:r}}getTotalTiles(){return Object.values(this.sectionObjects).reduce((e,t)=>e+(t.tilesCount||0),0)}getTotalBlocks(){return Object.values(this.sectionObjects).reduce((e,t)=>e+(t.blocksCount||0),0)}getEstimatedMemoryUsage(){let e=0,t=0,r=0,i=0,s=0,o=0,l=0,a=this.globalBlockBuffer?.mesh.geometry;if(a)for(let h of["a_w0","a_w1","a_w2","a_w3"]){let p=a.getAttribute(h);if(p){let m=p.array.byteLength;l+=m,e+=m}}let v=this.globalLegacyBuffer?.getMemoryBytes()??0,c=this.globalLegacyBlendBuffer?.getMemoryBytes()??0;e+=v+c,t+=v+c;for(let h of Object.values(this.sectionObjects)){let p=h.shaderMesh?.geometry;if(p)for(let m of["a_w0","a_w1","a_w2","a_w3"]){let b=p.getAttribute(m);if(b){let k=b.array.byteLength;l+=k,e+=k}}}for(let h of this.meshPool)if(h.inUse&&h.mesh.geometry){let{geometry:p}=h.mesh,m=p.getAttribute("position");if(m){let y=m.array.byteLength;t+=y,e+=y}let b=p.getAttribute("normal");if(b){let y=b.array.byteLength;r+=y,e+=y}let k=p.getAttribute("color");if(k){let y=k.array.byteLength;i+=y,e+=y}let _=p.getAttribute("uv");if(_){let y=_.array.byteLength;s+=y,e+=y}if(p.index){let y=p.index.array.byteLength;o+=y,e+=y}}return{total:`${(e/(1024*1024)).toFixed(2)} MB`,breakdown:{position:`${(t/(1024*1024)).toFixed(2)} MB`,normal:`${(r/(1024*1024)).toFixed(2)} MB`,color:`${(i/(1024*1024)).toFixed(2)} MB`,uv:`${(s/(1024*1024)).toFixed(2)} MB`,index:`${(o/(1024*1024)).toFixed(2)} MB`,shaderInstances:`${(l/(1024*1024)).toFixed(2)} MB`}}}dispose(){let e=[...this.activeSections.keys()];for(let t of e)this.releaseSection(t);this.signHeadsRenderer.dispose();for(let t of this.meshPool)t.mesh.geometry.dispose();this.meshPool.length=0,this.activeSections.clear(),this.chunkBoxMaterial.dispose(),this.shaderSectionRaycastBoxes.clear(),this.lastBufferStateKey="",this.globalBlockBuffer?.dispose(),this.globalBlockBuffer=null,this.globalLegacyBuffer?.dispose(),this.globalLegacyBuffer=null,this.globalLegacyBlendBuffer?.dispose(),this.globalLegacyBlendBuffer=null,this.cubeShaderMaterial?.dispose(),this.cubeShaderMaterial=null,this.legacyShaderMaterial?.dispose(),this.legacyShaderMaterial=null,this.globalLegacyShaderMaterial?.dispose(),this.globalLegacyShaderMaterial=null,this.globalLegacyBlendShaderMaterial?.dispose(),this.globalLegacyBlendShaderMaterial=null,this.pendingNearReveal.clear();for(let t of this.nearRevealTimers.values())clearTimeout(t);this.nearRevealTimers.clear();for(let t of this.nearRevealGraceTimers.values())clearTimeout(t);this.nearRevealGraceTimers.clear()}acquireMesh(){if(this.bypassPooling){let t={mesh:new X.Mesh(new X.BufferGeometry,this.getLegacyShaderMaterial()),inUse:!0,lastUsedTime:performance.now()};return this.meshPool.push(t),this.poolSize++,t}for(let t of this.meshPool)if(!t.inUse)return t.inUse=!0,t.lastUsedTime=performance.now(),this.hits++,t;this.misses++;let e=Math.min(this.poolSize+16,this.maxPoolSize);e<=this.meshPool.length&&(e=this.meshPool.length+8,this.maxPoolSize=e),this.expandPool(e);for(let t=this.meshPool.length-1;t>=0;t--){let r=this.meshPool[t];if(!r.inUse)return r.inUse=!0,r.lastUsedTime=performance.now(),r}throw new Error("ChunkMeshManager: Failed to acquire mesh after pool expansion")}expandPool(e){let t=this.meshPool.length;this.poolSize=e;for(let r=t;r<e;r++){let i=new X.BufferGeometry,s=new X.Mesh(i,this.getLegacyShaderMaterial());s.visible=!1,s.matrixAutoUpdate=!1,s.name="pooled-section-mesh";let o={mesh:s,inUse:!1,lastUsedTime:0};this.meshPool.push(o)}}updateGeometryAttribute(e,t,r,i){let s=e.getAttribute(t);s&&s.count===r.length/i?(s.array.set(r),s.needsUpdate=!0):e.setAttribute(t,new X.BufferAttribute(r,i))}clearGeometry(e){let t=["position","normal","color","a_skyLight","a_blockLight","uv"];for(let r of t)e.hasAttribute(r)&&e.deleteAttribute(r);e.index&&e.setIndex(null),e.boundingBox=null,e.boundingSphere=null}cleanupExcessMeshes(){if(this.poolSize>this.maxPoolSize){let e=this.meshPool.filter(t=>!t.inUse).length;if(e>0){let t=Math.min(this.poolSize-this.maxPoolSize,e);for(let r=0;r<t;r++){let i=this.meshPool.findIndex(s=>!s.inUse);i!==-1&&(this.meshPool[i].mesh.geometry.dispose(),this.meshPool.splice(i,1),this.poolSize--)}}}}disposeContainer(e,t=!0){Me(e,t)}recordRenderTime(e){this.renderTimes.push(e),this.renderTimes.length>this.maxRenderTimeSamples&&this.renderTimes.shift();let t=performance.now();t-this.lastPerformanceCheck>this.performanceCheckInterval&&(this.checkPerformance(),this.lastPerformanceCheck=t)}getEffectiveRenderDistance(){return this.performanceOverrideDistance||this.worldRenderer.viewDistance}resetPerformanceOverride(){this.performanceOverrideDistance=void 0,this.renderTimes.length=0}getAverageRenderTime(){return this.renderTimes.length===0?0:this.renderTimes.reduce((e,t)=>e+t,0)/this.renderTimes.length}checkPerformance(){if(this.renderTimes.length<this.maxRenderTimeSamples)return;let e=this.getAverageRenderTime(),t=16.67,r=t*1.5;if(e>r){let i=this.worldRenderer.viewDistance,s=Math.max(1,Math.floor(i*.8));(!this.performanceOverrideDistance||s<this.performanceOverrideDistance)&&(this.performanceOverrideDistance=s)}else if(this.performanceOverrideDistance&&e<t*1.1){let i=this.worldRenderer.viewDistance,s=Math.min(i,this.performanceOverrideDistance+1);s!==this.performanceOverrideDistance&&(this.performanceOverrideDistance=s>=i?void 0:s)}}updateSectionsVisibility(){let e=this.worldRenderer.cameraSectionPos;for(let[t,r]of Object.entries(this.sectionObjects)){if(r._waitingForChunkDisplay){r.visible=!1;continue}if(!this.performanceOverrideDistance){r.visible=!0;continue}let[i,s,o]=t.split(",").map(Number),l={x:i/16,y:s/16,z:o/16},a=l.x-e.x,v=l.z-e.z,c=Math.floor(Math.hypot(a,v));r.visible=c<=this.performanceOverrideDistance}}};d(dt,"REBASE_THRESHOLD",65536),d(dt,"NEAR_REVEAL_TIMEOUT_MS",5e3),d(dt,"EXPECTED_NEAR_GRACE_MS",1500),d(dt,"BLEND_RESORT_DISTANCE",1);var _5=dt,gs=class{constructor(e){this.worldRendererThree=e}dispose(){yl()}renderHead(e,t,r,i){let s;if(i.SkullOwner?s=i.SkullOwner.Properties?.textures?.[0]?.Value:s=i.profile?.properties?.find(o=>o.name==="textures")?.value,!!s)try{let l=JSON.parse(O.from(s,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:a}=this.worldRendererThree.worldRendererConfig;a&&(l=l?.replace("http://textures.minecraft.net/",a).replace("https://textures.minecraft.net/",a));let v=$t(this.worldRendererThree,l,e0.head),c=new X.Group;return r&&v.position.set(0,.3125,.3125),v.position.y-=23/16,c.add(v),this.worldRendererThree.sceneOrigin.track(c),c.position.set(e.x+.5,e.y+.045,e.z+.5),c.rotation.set(0,-X.MathUtils.degToRad(t*(r?90:45/2)),0),c.scale.set(.8,.8,.8),c}catch{}}renderSign(e,t,r,i,s){let o=gl(this.worldRendererThree,s,i);if(!o)return;let l=new X.Mesh(new X.PlaneGeometry(1,1),new X.MeshBasicMaterial({map:o,transparent:!0}));l.renderOrder=999;let a=7/16,v=i?1.3:1;l.scale.set(1*v,a*v,1*v);let c=(i?2:1.5)/16,u=.25/16;r&&!i?l.position.set(0,0,-.5+c+u+1e-4):l.position.set(0,0,c/2+1e-4);let h=new X.Group;h.rotation.set(0,-X.MathUtils.degToRad(t*(r?90:45/2)),0),h.add(l),h.signTexture=o;let p=(i?10:8)/16,m=(i?0:r?4.333:9.333)/16,b=p/2+m;return this.worldRendererThree.sceneOrigin.track(h),h.position.set(e.x+.5,e.y+b,e.z+.5),h}};A();E();R();x();var si=(n,e)=>e===0?1/0:e<0?si(-n,-e):(1-(n-Math.floor(n)))/e,_u=(n,e,t,r,i,s,o,l,a,v,c,u)=>{let h=o-c,p=l-c,m=a-c,b=o+1+c,k=l+1+c,_=a+1+c,y=ll(n,e,t,r,i,s,h,p,m,b,k,_,v);if(y===void 0&&(y=vl(n,e,t,r,i,s,h,p,m,b,k,_,v)),y!==void 0)return Math.max(u,y)};function xl(n,e,t,r,i,s,o,l,a,v){if(o<=0)return;let c=Math.floor(n),u=Math.floor(e),h=Math.floor(t),p=r>0?1:r<0?-1:0,m=i>0?1:i<0?-1:0,b=s>0?1:s<0?-1:0,k=p!==0?Math.abs(1/r):1/0,_=m!==0?Math.abs(1/i):1/0,y=b!==0?Math.abs(1/s):1/0,M=p!==0?si(n,r):1/0,T=m!==0?si(e,i):1/0,S=b!==0?si(t,s):1/0,B=(V,z,N)=>{if(!v(V,z,N))return;let Y=_u(n,e,t,r,i,s,V,z,N,o,l,a);if(!(Y===void 0||Y>o))return{distance:Y,blockX:V,blockY:z,blockZ:N}},P=B(c,u,h);if(P)return P;let H=0;for(;H<=o&&(M<T?M<S?(c+=p,H=M,M+=k):(h+=b,H=S,S+=y):T<S?(u+=m,H=T,T+=_):(h+=b,H=S,S+=y),!(H>o));)if(P=B(c,u,h),P)return P}A();E();R();x();A();E();R();x();import*as s0 from"three";var oi={},Rl=!1;function wu(){if(Rl)return;let n=globalThis.loadedData?.tints;if(n){for(let e of Object.keys(n))oi[e]=Au(n[e]);Rl=!0}}function Au(n){let e={},t=kl(n.default??16777215);if(n.data)for(let r of n.data){let i=kl(r.color);for(let s of r.keys)e[s]=i}return new Proxy(e,{get(r,i){return r[i]??t}})}function kl(n){return[(n>>16&255)/255,(n>>8&255)/255,(n&255)/255]}function Sl(n,e){return wu(),n==="grass_block"?[1,1,1]:n==="redstone_wire"?[1,1,1]:n==="birch_leaves"||n==="spruce_leaves"||n==="lily_pad"?oi.constant?.[n]??[1,1,1]:n.includes("leaves")||n==="vine"?oi.foliage?.[e]??[1,1,1]:["short_grass","tall_grass","fern","large_fern","sugar_cane","grass"].includes(n)?oi.grass?.[e]??[1,1,1]:[1,1,1]}var Eu=512,bs=1/20,ys=class{constructor(e){this.worldRenderer=e;d(this,"particles",[]);d(this,"sharedMaterial");d(this,"enabled",!1);d(this,"tickAccumulator",0);d(this,"nextParticleIndex",0);d(this,"render",e=>{if(!this.enabled)return;for(this.tickAccumulator+=e;this.tickAccumulator>=bs;)this.tickAccumulator-=bs,this.tickPhysics();let t=this.tickAccumulator/bs;this.updateVisuals(t)})}enable(){this.enabled||(this.enabled=!0,this.ensureMaterial())}disable(){this.enabled&&(this.enabled=!1)}dispose(){for(let e of this.particles)e.active&&this.worldRenderer.sceneOrigin.removeAndUntrack(e.mesh),e.mesh.geometry.dispose();this.particles=[],this.sharedMaterial?.dispose(),this.sharedMaterial=void 0,this.nextParticleIndex=0}spawnBlockBreakParticles(e,t,r,i,s,o="plains"){if(!this.enabled)return;let l=this.resolveBlockTexture(i);if(!l)return;let a=Sl(i,o);for(let v=0;v<4;v++)for(let c=0;c<4;c++)for(let u=0;u<4;u++){let h=e+(v+.5)/4,p=t+(c+.5)/4,m=r+(u+.5)/4,b=h-e-.5,k=p-t-.5,_=m-r-.5;b+=(Math.random()*2-1)*.4,k+=(Math.random()*2-1)*.4,_+=(Math.random()*2-1)*.4;let y=(Math.random()+Math.random()+1)*.15,M=Math.sqrt(b*b+k*k+_*_),T=b/M*y*.4,S=k/M*y*.4+.1,B=_/M*y*.4,P=Math.floor(4/(Math.random()*.9+.1));this.createParticle(h,p,m,T,S,B,P,l,s,e,r,1,a)}}tickPhysics(){for(let e of this.particles){if(!e.active)continue;if(e.prevX=e.x,e.prevY=e.y,e.prevZ=e.z,e.age++,e.age>=e.maxAge){this.deactivateParticle(e);continue}e.yd-=.04,e.x+=e.xd,e.y+=e.yd,e.z+=e.zd;let t=this.getFloorY(e);e.y<=t?(e.y=t,e.yd=0,e.onGround=!0):e.onGround=!1,e.xd*=.98,e.yd*=.98,e.zd*=.98,e.onGround&&(e.xd*=.7,e.zd*=.7)}}updateVisuals(e){let t=this.worldRenderer.camera.position;for(let r of this.particles){if(!r.active)continue;let i=r.prevX+(r.x-r.prevX)*e,s=r.prevY+(r.y-r.prevY)*e,o=r.prevZ+(r.z-r.prevZ)*e;r.mesh.position.set(i,s,o),r.mesh.lookAt(t.x,t.y,t.z)}}spawnCrackParticle(e,t,r,i,s,o,l="plains"){if(!this.enabled)return;let a=this.resolveBlockTexture(s);if(!a)return;let v=Sl(s,l),c=e+Math.random()*.8+.1,u=t+Math.random()*.8+.1,h=r+Math.random()*.8+.1;switch(i){case 0:u=t-.1;break;case 1:u=t+1+.1;break;case 2:h=r-.1;break;case 3:h=r+1+.1;break;case 4:c=e-.1;break;case 5:c=e+1+.1;break}let p=(Math.random()*2-1)*.4*.2,m=(Math.random()*2-1)*.4*.2+.1*.2,b=(Math.random()*2-1)*.4*.2,k=Math.floor(4/(Math.random()*.9+.1));this.createParticle(c,u,h,p,m,b,k,a,o,e,r,.6,v)}createParticle(e,t,r,i,s,o,l,a,v,c,u,h=1,p=[1,1,1]){this.ensureMaterial();let m=this.findInactiveParticle();m||(this.particles.length<Eu?m=this.allocateParticle():m=this.recycleOldest());let b=Math.floor(Math.random()*4),k=Math.floor(Math.random()*4),_=a.u+b/4*a.su,y=a.v+k/4*a.sv,M=a.su/4,T=a.sv/4;this.setGeometryUVs(m.mesh.geometry,_,y,M,T),m.active=!0,m.x=e,m.y=t,m.z=r,m.prevX=e,m.prevY=t,m.prevZ=r,m.xd=i,m.yd=s,m.zd=o,m.age=0,m.maxAge=l,m.onGround=!1,m.floorMap=v,m.blockX=Math.floor(c),m.blockZ=Math.floor(u);let S=.1*(.5+Math.random()*.5)*2*h;m.mesh.scale.set(S,S,S),m.mesh.position.set(e,t,r),m.mesh.visible=!0;let B=.6*p[0],P=.6*p[1],H=.6*p[2],V=new Float32Array([B,P,H,B,P,H,B,P,H,B,P,H]),z=m.mesh.geometry.getAttribute("color");z?(z.set(V),z.needsUpdate=!0):m.mesh.geometry.setAttribute("color",new s0.Float32BufferAttribute(V,3)),this.worldRenderer.sceneOrigin.addAndTrack(m.mesh)}allocateParticle(){let e=new s0.PlaneGeometry(1,1),t=new s0.Mesh(e,this.sharedMaterial);t.visible=!1;let r={mesh:t,active:!1,x:0,y:0,z:0,prevX:0,prevY:0,prevZ:0,xd:0,yd:0,zd:0,age:0,maxAge:0,onGround:!1,floorMap:[],blockX:0,blockZ:0};return this.particles.push(r),r}findInactiveParticle(){for(let e=0;e<this.particles.length;e++){let t=(this.nextParticleIndex+e)%this.particles.length;if(!this.particles[t].active)return this.nextParticleIndex=(t+1)%this.particles.length,this.particles[t]}}recycleOldest(){let e=this.particles[0];for(let t of this.particles)t.age>e.age&&(e=t);return this.deactivateParticle(e),e}deactivateParticle(e){e.active&&(e.active=!1,e.mesh.visible=!1,this.worldRenderer.sceneOrigin.removeAndUntrack(e.mesh))}getFloorY(e){let t=Math.floor(e.x)-e.blockX,r=Math.floor(e.z)-e.blockZ;return t=Math.max(-2,Math.min(2,t)),r=Math.max(-2,Math.min(2,r)),e.floorMap[(r+2)*5+(t+2)]}resolveBlockTexture(e){let t=this.worldRenderer.resourcesManager.currentResources;if(!t)return null;let r=t.blocksAtlasJson,i=r.textures;if(i[e])return this.extractUV(i[e],r);for(let s of["_side","_top","_front","_0",""]){let o=e+s;if(i[o])return this.extractUV(i[o],r)}for(let s of Object.keys(i))if(s.startsWith(e))return this.extractUV(i[s],r);return null}extractUV(e,t){return{u:e.u,v:e.v,su:e.su??t.suSv,sv:e.sv??t.suSv}}setGeometryUVs(e,t,r,i,s){let o=e.getAttribute("uv");o.setXY(0,t,r),o.setXY(1,t+i,r),o.setXY(2,t,r+s),o.setXY(3,t+i,r+s),o.needsUpdate=!0}ensureMaterial(){if(this.sharedMaterial)return;let e=this.worldRenderer.material.map;e&&(this.sharedMaterial=new s0.MeshBasicMaterial({map:e,vertexColors:!0,transparent:!0,alphaTest:.1}))}},Tl={id:"blockBreakParticles",controller:ys,enabledDefault:!0,cannotBeDisabled:!0,requiresHeightmap:!1};A();E();R();x();var _s=class{constructor(e){this.worldRenderer=e;d(this,"enabled",!1);d(this,"lastBobWalkDist",0);d(this,"lastBobTickTime",0);d(this,"render",()=>{if(!this.enabled)return;let e=this.worldRenderer.displayOptions.inWorldRenderingConfig,{perspective:t}=this.worldRenderer.playerStateReactive;if(e.viewBobbing&&t==="first_person"&&!this.worldRenderer.playerStateUtils.isSpectator()){this.worldRenderer.playerStateReactive.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=performance.now(),this.lastBobWalkDist=this.worldRenderer.playerStateReactive.walkDist);let i=Math.min((performance.now()-this.lastBobTickTime)/50,1);this.worldRenderer.cameraShake.setCameraBobInput({walkDist:this.worldRenderer.playerStateReactive.walkDist,prevWalkDist:this.worldRenderer.playerStateReactive.prevWalkDist,bob:this.worldRenderer.playerStateReactive.bob,prevBob:this.worldRenderer.playerStateReactive.prevBob,partialTick:i})}else this.worldRenderer.cameraShake.setCameraBobInput(null)})}enable(){this.enabled=!0}disable(){this.enabled=!1,this.worldRenderer.cameraShake.setCameraBobInput(null);let{perspective:e}=this.worldRenderer.playerStateReactive;e==="first_person"&&this.worldRenderer.camera.position.set(0,0,0)}dispose(){this.disable()}},Ml={id:"cameraBobbing",controller:_s,enabledDefault:!0,cannotBeDisabled:!0};A();E();R();x();import*as it from"three";var ws=2e3,Cl=32,Bl=32,ai=12,Pl=24,li=1.2,xu=-5,As=class{constructor(e){this.worldRenderer=e;d(this,"instancedMesh");d(this,"geometry");d(this,"material");d(this,"particles",[]);d(this,"enabled",!1);d(this,"dummy",new it.Matrix4);d(this,"tempPosition",new it.Vector3);d(this,"tempQuaternion",new it.Quaternion);d(this,"tempScale",new it.Vector3);d(this,"configUnsubs",[]);d(this,"render",e=>{if(!this.enabled||!this.instancedMesh||!this.material)return;let t=this.worldRenderer.getCameraPosition();this.instancedMesh.position.set(0,0,0);let r=this.worldRenderer.reactiveState.world.heightmaps,{dummy:i,tempPosition:s,tempQuaternion:o,tempScale:l}=this,a=NaN,v=NaN,c;for(let u=0;u<ws;u++){let h=this.particles[u];this.instancedMesh.getMatrixAt(u,i),i.decompose(s,o,l),s.addScaledVector(h.velocity,e);let p=s.y,m=Math.sqrt(s.x*s.x+s.z*s.z),b=t.x+s.x,k=t.y+s.y,_=t.z+s.z,y=Math.floor(b/16),M=Math.floor(_/16);(y!==a||M!==v)&&(c=r[`${y},${M}`],a=y,v=M);let T=(Math.floor(b)%16+16)%16,S=(Math.floor(_)%16+16)%16,B=c?.[S*16+T];if(m>Cl||B!==void 0&&B!==-32768&&k<=B+1+h.despawnOffset||p<xu){this.respawnParticle(s);let H=ai+Math.random()*(Pl-ai);h.velocity.set((Math.random()-.5)*li,-H,(Math.random()-.5)*li),h.despawnOffset=Math.random()*.5}i.compose(s,o,l),this.instancedMesh.setMatrixAt(u,i)}this.instancedMesh.instanceMatrix.needsUpdate=!0});this.configUnsubs.push(this.worldRenderer.onReactiveConfigUpdated("rainColor",()=>this.syncRainAppearance()),this.worldRenderer.onReactiveConfigUpdated("rainOpacity",()=>this.syncRainAppearance()))}enable(){this.enabled||(this.enabled=!0,this.instancedMesh?(this.instancedMesh.visible=!0,this.syncRainAppearance()):this.createRain())}disable(){this.enabled&&(this.enabled=!1,this.instancedMesh&&(this.instancedMesh.visible=!1))}autoEnableCheck(){return this.worldRenderer.worldRendererConfig.isRaining===!0}dispose(){for(let e of this.configUnsubs)e();this.configUnsubs.length=0,this.instancedMesh&&this.worldRenderer.scene.remove(this.instancedMesh),this.geometry?.dispose(),this.material?.dispose(),this.instancedMesh=void 0,this.geometry=void 0,this.material=void 0,this.particles=[]}syncRainAppearance(){if(!this.material)return;let{rainColor:e,rainOpacity:t}=this.worldRenderer.worldRendererConfig;this.material.color.set(e),this.material.opacity=Math.max(0,Math.min(1,t)),this.material.needsUpdate=!0}createRain(){let{rainColor:e,rainOpacity:t}=this.worldRenderer.worldRendererConfig;this.geometry=new it.BoxGeometry(.03,.3,.03),this.material=new it.MeshBasicMaterial({color:e,transparent:!0,opacity:Math.max(0,Math.min(1,t)),depthWrite:!0,fog:!1}),this.instancedMesh=new it.InstancedMesh(this.geometry,this.material,ws),this.instancedMesh.name="rain-particles",this.instancedMesh.frustumCulled=!1;let r=new it.Matrix4,i=new it.Vector3;for(let s=0;s<ws;s++){this.respawnParticle(i),i.y=Math.random()*Bl,r.setPosition(i),this.instancedMesh.setMatrixAt(s,r);let o=ai+Math.random()*(Pl-ai);this.particles.push({velocity:new it.Vector3((Math.random()-.5)*li,-o,(Math.random()-.5)*li),age:0,despawnOffset:Math.random()*.5})}this.instancedMesh.instanceMatrix.needsUpdate=!0,this.worldRenderer.scene.add(this.instancedMesh)}respawnParticle(e){let t=Math.random()*Math.PI*2,r=Math.random()*Cl;e.set(Math.cos(t)*r,Bl,Math.sin(t)*r)}},Il={id:"rain",controller:As,enabledDefault:!1,requiresHeightmap:!0};A();E();R();x();import*as Be from"three";var Hl=new Be.Color(13/255,234/255,238/255),Ru=9,ku=12e3,Su=1500,Tu=1e4,Mu=350,Cu=650,Ll=120,Ol=280,Es=class{constructor(e){this.worldRenderer=e;d(this,"enabled",!0);d(this,"sections",new Map);d(this,"completed",new Set);d(this,"globalWaveStarted",!1);d(this,"globalWaveStartMs",0);d(this,"finishedChunkCount",0);d(this,"firstQueuedMs",null);d(this,"pulseTime",0);d(this,"wireframeMaterial",new Be.LineBasicMaterial({color:Hl,transparent:!0,opacity:1,blending:Be.AdditiveBlending,depthWrite:!1}));d(this,"wireframeGlowMaterial",new Be.LineBasicMaterial({color:Hl,transparent:!0,opacity:.55,blending:Be.AdditiveBlending,depthWrite:!1}));e.worldRendererConfig.futuristicReveal!==!0&&(this.enabled=!1)}autoEnableCheck(){return this.worldRenderer.worldRendererConfig.futuristicReveal===!0}enable(){this.autoEnableCheck()&&this.setEnabled(!0)}disable(){this.setEnabled(!1)}dispose(){this.reset(),this.wireframeMaterial.dispose(),this.wireframeGlowMaterial.dispose()}shouldDeferSectionGeometry(e){return this.enabled&&!this.completed.has(e)}onSectionMeshed(e,t,r){let i=r.children.find(s=>s.name==="mesh");i instanceof Be.Mesh&&this.onSectionMeshedMesh(e,t,i)}onChunkFinished(){this.enabled&&(this.finishedChunkCount++,this.tryStartGlobalWave(performance.now()))}onSectionRemoved(e){this.cancelSection(e,!0),this.completed.delete(e)}onWorldSwitched(){this.reset()}tick(e,t=performance.now()){if(!this.enabled||(this.tryStartGlobalWave(t),!this.globalWaveStarted&&this.firstQueuedMs!==null&&this.sections.size>0&&t-this.firstQueuedMs>=ku&&this.startGlobalWave(t),this.sections.size===0))return;this.pulseTime+=e*.001;let r=[];for(let i of this.sections.values()){if(t-i.phaseStartMs>Tu){r.push(i);continue}if(i.phase==="queued"){this.globalWaveStarted&&t>=i.revealAtMs&&this.beginWireframe(i,t);continue}let s=t-i.phaseStartMs;if(i.phase==="wireframe"){this.animateWireframe(i,s),s>=i.wireframeMs&&this.beginFade(i,t);continue}if(i.phase==="fade"){let o=Math.min(1,s/i.fadeMs);this.animateFade(i,o),o>=1&&r.push(i)}}for(let i of r)this.finishSection(i)}setEnabled(e){e!==this.enabled&&(this.enabled=e,e||this.forceFinishAll())}onSectionMeshedMesh(e,t,r){if(!this.enabled||!t.positions?.length||this.completed.has(e))return;let i=this.sections.get(e);if(i){i.mesh=r,i.geometry=t,(i.phase==="wireframe"||i.phase==="fade")&&this.finishSection(i);return}let s=performance.now();this.firstQueuedMs===null&&(this.firstQueuedMs=s);let o=this.globalWaveStarted;this.sections.set(e,{key:e,geometry:t,phase:"queued",phaseStartMs:s,revealAtMs:this.globalWaveStarted?s:0,wireframeMs:o?Ll:Mu,fadeMs:o?Ol:Cu,wireframeGroup:null,mesh:r,savedMaterial:null,pulseOffset:Math.random()*Math.PI*2}),r.visible=!1,this.setShaderMeshesVisible(e,!1),this.tryStartGlobalWave(s)}reset(){this.forceFinishAll(),this.sections.clear(),this.completed.clear(),this.globalWaveStarted=!1,this.globalWaveStartMs=0,this.finishedChunkCount=0,this.firstQueuedMs=null,this.pulseTime=0}forceFinishAll(){for(let e of[...this.sections.values()])this.finishSection(e);this.sections.clear(),this.unhideAllSectionMeshes()}tryStartGlobalWave(e){if(!this.globalWaveStarted&&this.sections.size!==0){if(this.finishedChunkCount>=Ru){this.startGlobalWave(e);return}this.worldRenderer.allChunksFinished&&this.startGlobalWave(e)}}startGlobalWave(e){if(this.globalWaveStarted)return;this.globalWaveStarted=!0,this.globalWaveStartMs=e;let t=this.worldRenderer.getCameraPosition(),r=1,i=new Map;for(let[s,o]of this.sections){if(o.phase!=="queued")continue;let{sx:l,sy:a,sz:v}=o.geometry,c=Math.hypot(l-t.x,a-t.y,v-t.z);i.set(s,c),r=Math.max(r,c)}for(let[,s]of this.sections){if(s.phase!=="queued")continue;let o=i.get(s.key)??0;s.revealAtMs=e+o/r*Su,s.wireframeMs=Ll,s.fadeMs=Ol}}beginWireframe(e,t){let r=e.mesh??this.getSectionMesh(e.key);if(e.mesh=r,!r){this.sections.delete(e.key);return}let i=this.createWireframeGeometry(e.geometry),s=new Be.LineSegments(i,this.wireframeMaterial.clone());this.worldRenderer.sceneOrigin.track(s),s.position.set(e.geometry.sx,e.geometry.sy,e.geometry.sz),s.name="scifi-wireframe",s.renderOrder=1e3;let o=new Be.LineSegments(i.clone(),this.wireframeGlowMaterial.clone());this.worldRenderer.sceneOrigin.track(o),o.position.copy(s.position),o.scale.setScalar(1.02),o.name="scifi-glow",o.renderOrder=999;let l=new Be.Group;l.name="scifi-reveal-group",l.add(s,o),this.worldRenderer.realScene.add(l),r.visible=!1,this.setShaderMeshesVisible(e.key,!1),e.wireframeGroup=l,e.phase="wireframe",e.phaseStartMs=t}beginFade(e,t){let r=e.mesh??this.getSectionMesh(e.key);if(e.mesh=r,r){r.visible=!0;let i=r.material;if(!Array.isArray(i)&&i&&typeof i.clone=="function"){e.savedMaterial=i;let s=i.clone();s.transparent=!0,s.opacity=0,s.needsUpdate=!0,r.material=s}}this.setShaderMeshesVisible(e.key,!0),e.phase="fade",e.phaseStartMs=t}animateWireframe(e,t){if(!e.wireframeGroup)return;let r=e.wireframeGroup.children[0],i=e.wireframeGroup.children[1],s=.6+.4*Math.sin(this.pulseTime*4+e.pulseOffset);if(r?.material){let o=r.material;o.opacity=s;let l=.85+.15*Math.sin(this.pulseTime*6+t*.002);o.color.setRGB(13/255*l,234/255*l,238/255*l)}i?.material&&(i.material.opacity=s*.4)}animateFade(e,t){let r=1-(1-t)**3;if(e.wireframeGroup){let s=e.wireframeGroup.children[0],o=e.wireframeGroup.children[1];s?.material&&(s.material.opacity=1-r),o?.material&&(o.material.opacity=(1-r)*.55)}let i=e.mesh;i&&e.savedMaterial&&!Array.isArray(i.material)&&(i.material.opacity=r),this.setShaderMeshesVisible(e.key,r>.001)}finishSection(e){let t=e.mesh??this.getSectionMesh(e.key);if(t){if(e.savedMaterial){let i=t.material;t.material=e.savedMaterial,i.dispose(),e.savedMaterial=null}t.visible=!0}this.setShaderMeshesVisible(e.key,!0);let{chunkMeshManager:r}=this.worldRenderer;r.migrateDeferredShaderToGlobal(e.key),r.migrateDeferredLegacyToGlobal(e.key),e.wireframeGroup&&(this.disposeWireframeGroup(e.wireframeGroup),e.wireframeGroup=null),this.sections.delete(e.key),this.completed.add(e.key)}cancelSection(e,t){let r=this.sections.get(e);if(r){if(r.wireframeGroup&&this.disposeWireframeGroup(r.wireframeGroup),t){let i=r.mesh??this.getSectionMesh(e);if(i){if(r.savedMaterial){let s=i.material;i.material=r.savedMaterial,s.dispose()}i.visible=!0}this.setShaderMeshesVisible(e,!0)}this.sections.delete(e)}}getSectionMesh(e){let t=this.worldRenderer.chunkMeshManager.sectionObjects[e];if(!t)return null;let r=t.children.find(i=>i.name==="mesh");return r instanceof Be.Mesh?r:null}getShaderMesh(e){let t=this.worldRenderer.chunkMeshManager.sectionObjects[e];if(!t)return null;let r=t.children.find(i=>i.name==="shaderMesh");return r instanceof Be.Mesh?r:null}setShaderMeshesVisible(e,t){let r=this.getShaderMesh(e);r&&(r.visible=t)}unhideAllSectionMeshes(){for(let e of Object.values(this.worldRenderer.chunkMeshManager.sectionObjects))e&&e.traverse(t=>{t instanceof Be.Mesh&&(t.name==="mesh"||t.name==="shaderMesh")&&(t.visible=!0)})}disposeWireframeGroup(e){this.worldRenderer.sceneOrigin.removeAndUntrackAll(e),this.worldRenderer.realScene.remove(e),e.traverse(t=>{let r=t;r.geometry?.dispose();let i=r.material;Array.isArray(i)?i.forEach(s=>s.dispose()):i?.dispose()}),e.clear()}createWireframeGeometry(e){let t=e.positions,r=e.indices,i=[],s=new Set;for(let l=0;l<r.length;l+=3){let a=r[l],v=r[l+1],c=r[l+2];this.addEdge(t,a,v,i,s),this.addEdge(t,v,c,i,s),this.addEdge(t,c,a,i,s)}let o=new Be.BufferGeometry;return o.setAttribute("position",new Be.Float32BufferAttribute(i,3)),o}addEdge(e,t,r,i,s){let o=Math.min(t,r),l=Math.max(t,r),a=`${o}-${l}`;s.has(a)||(s.add(a),i.push(e[t*3],e[t*3+1],e[t*3+2],e[r*3],e[r*3+1],e[r*3+2]))}},Dl={id:"futuristicReveal",controller:Es,enabledDefault:!0};A();E();R();x();import*as Pe from"three";var Bu=parseInt(Pe.REVISION.replaceAll(/\D+/g,""),10),xs=class extends Pe.ShaderMaterial{constructor(){super({uniforms:{time:{value:0}},vertexShader:`
21684
+ `,ds={u_atlas:{value:null},u_originDelta:{value:new Ue.Vector3},u_cameraOriginFrac:{value:new Ue.Vector3},u_skyLevel:{value:1},u_lightCurve:{value:nt.curve},u_minBrightness:{value:nt.minBrightness},u_lightGamma:{value:nt.gamma}};function Y7(){return new Ue.ShaderMaterial({vertexShader:nu,fragmentShader:cs,uniforms:Ue.UniformsUtils.merge([Ue.UniformsLib.fog,ds]),transparent:!0,depthWrite:!0,depthTest:!0,vertexColors:!0,glslVersion:Ue.GLSL3,fog:!0})}function Q7(){return new Ue.ShaderMaterial({vertexShader:j7,fragmentShader:cs,uniforms:Ue.UniformsUtils.merge([Ue.UniformsLib.fog,ds]),transparent:!1,depthWrite:!0,depthTest:!0,vertexColors:!0,glslVersion:Ue.GLSL3,fog:!0})}function K7(){return new Ue.ShaderMaterial({vertexShader:j7,fragmentShader:cs,uniforms:Ue.UniformsUtils.merge([Ue.UniformsLib.fog,ds]),transparent:!0,depthWrite:!1,depthTest:!0,vertexColors:!0,glslVersion:Ue.GLSL3,fog:!0})}function Qn(n,e,t,r,i){let{originDelta:s,cameraOriginFrac:o}=F0(e,t,r,i),l=n.uniforms.u_originDelta;l?.value?.set&&l.value.set(s.x,s.y,s.z);let a=n.uniforms.u_cameraOriginFrac;a?.value?.set&&a.value.set(o.x,o.y,o.z)}function Kn(n,e){let t=n.uniforms.u_skyLevel;t&&(t.value=e)}function qn(n,e){if(e.curve!==void 0){let t=n.uniforms.u_lightCurve;t&&(t.value=e.curve)}if(e.minBrightness!==void 0){let t=n.uniforms.u_minBrightness;t&&(t.value=e.minBrightness)}if(e.gamma!==void 0){let t=n.uniforms.u_lightGamma;t&&(t.value=e.gamma)}}A();E();R();x();var iu=8,su=.01;function us(n,e,t,r,i){n.matrix.makeTranslation(e-i.x,t-i.y,r-i.z),n.matrixWorldNeedsUpdate=!0,n.frustumCulled=!1}function Jn(n,e,t,r,i,s,o,l,a,v){let c=n-r,u=e-i,h=t-s,p=iu+su;return a.set(c-p,u-p,h-p),v.set(c+p,u+p,h+p),l.set(a,v),{visible:o.intersectsBox(l),distSq:c*c+u*u+h*h}}function q7(n,e,t,r,i,s,o,l,a,v,c){let{visible:u,distSq:h}=Jn(e,t,r,i,s,o,l,a,v,c);n.visible=u,n.renderOrder=-h}as();A();E();R();x();import*as Et from"three";A();E();R();x();A();E();R();x();A();E();R();x();import*as Ke from"three";A();E();R();x();function X7(){return{counts:new Int32Array(Wt),offsets:new Int32Array(Wt)}}function ou(n,e){if(n.counts.length>=e)return;let t=n.counts.length;for(;t<e;)t*=2;n.counts=new Int32Array(t),n.offsets=new Int32Array(t)}function Z7(n){let e=n.getExtension("WEBGL_multi_draw");return e?{tier:"A",ext:e}:{tier:"B",ext:null}}var J7=!1;function $7(n,e){J7||!e||(J7=!0)}function el(n,e,t,r){let i=t.length;if(i===0)return;ou(r,i);let s=n.TRIANGLES,o=n.UNSIGNED_INT;for(let l=0;l<i;l++){let a=t[l];r.counts[l]=a.indexCount,r.offsets[l]=a.indexStart*4}if(e.tier==="A"&&e.ext){e.ext.multiDrawElementsWEBGL(s,r.counts,0,o,r.offsets,0,i);return}for(let l=0;l<i;l++)n.drawElements(s,r.counts[l],o,r.offsets[l])}var Te=4,le=6,ve=3,pt=2,De=1,au=128e3,lu=128e3,hs=5e3,vu=.25,tl=Te*(ve*3+De*2+pt)*4+le*4,fs=.75,Wt=64;function Xn(n,e){if(e.length===0)return n;let t=[];for(let r of n){let i=[r];for(let s of e){let o=[];for(let l of i){let a=l.start+l.count-1;if(s.end<l.start||s.start>a){o.push(l);continue}s.start>l.start&&o.push({start:l.start,count:s.start-l.start}),s.end<a&&o.push({start:s.end+1,count:a-s.end})}i=o}t.push(...i)}return t.filter(r=>r.count>0)}var f5=class{constructor(e,t,r){d(this,"mesh");d(this,"material");d(this,"growthIncrementQuads");d(this,"blendSort");d(this,"capacityQuads");d(this,"positions");d(this,"colors");d(this,"skyLights");d(this,"blockLights");d(this,"uvs");d(this,"aOrigin");d(this,"indices");d(this,"quadCentroids");d(this,"quadIndexTemplate");d(this,"sectionSlots",new Map);d(this,"freeList",[]);d(this,"highWatermark",0);d(this,"pendingRanges",[]);d(this,"indexPendingRanges",[]);d(this,"_spanScratch",[]);d(this,"renderOrigin",{x:0,y:0,z:0});d(this,"layoutVersion",0);d(this,"pendingMove",null);d(this,"pendingReplace",new Map);d(this,"uploadEpoch",0);d(this,"visibleIndexSpans",[]);d(this,"_drawScratch",X7());d(this,"_sortOrder",new Uint32Array(0));d(this,"_sortDistSq",new Float64Array(0));d(this,"multiDrawCaps",null);d(this,"debugOverlay",!1);d(this,"_camX",0);d(this,"_camY",0);d(this,"_camZ",0);d(this,"_camInitialized",!1);this.material=e,this.growthIncrementQuads=r?.growthIncrementQuads??lu,this.blendSort=r?.sortBlend??!1,this.capacityQuads=r?.initialCapacityQuads??au;let i=this.capacityQuads*Te;this.positions=new Float32Array(i*ve),this.colors=new Float32Array(i*ve),this.skyLights=new Float32Array(i*De),this.blockLights=new Float32Array(i*De),this.uvs=new Float32Array(i*pt),this.aOrigin=new Float32Array(i*ve),this.indices=new Uint32Array(this.capacityQuads*le),this.quadCentroids=new Float32Array(this.capacityQuads*3),this.quadIndexTemplate=new Uint8Array(this.capacityQuads*le);let s=new Ke.BufferGeometry,o=(a,v,c)=>{let u=new Ke.BufferAttribute(a,v);return u.setUsage(Ke.DynamicDrawUsage),s.setAttribute(c,u),u};o(this.positions,ve,"position"),o(this.colors,ve,"color"),o(this.skyLights,De,"a_skyLight"),o(this.blockLights,De,"a_blockLight"),o(this.uvs,pt,"uv"),o(this.aOrigin,ve,"a_origin");let l=new Ke.BufferAttribute(this.indices,1);l.setUsage(Ke.DynamicDrawUsage),s.setIndex(l),s.setDrawRange(0,0),s.boundingSphere=new Ke.Sphere(new Ke.Vector3,1/0),this.mesh=new Ke.Mesh(s,[e]),this.mesh.name=r?.name??"globalLegacyOpaque",this.mesh.frustumCulled=!1,this.mesh.matrixAutoUpdate=!1,this.mesh.matrix.identity(),this.mesh.position.set(0,0,0),t.add(this.mesh),this.syncDefaultDrawGroups(),this.mesh.onAfterRender=(a,v,c,u,h)=>{if(this.visibleIndexSpans.length===0)return;let p=a.getContext();this.multiDrawCaps||(this.multiDrawCaps=Z7(p),$7(this.multiDrawCaps.tier,this.debugOverlay)),el(p,this.multiDrawCaps,this.visibleIndexSpans,this._drawScratch)}}setDebugOverlay(e){this.debugOverlay=e}suppressThreeDraw(){this.mesh.geometry.setDrawRange(0,3)}setVisibleIndexSpans(e){this.visibleIndexSpans=e}getVisibleIndexSpans(){return this.visibleIndexSpans}getVisibleQuadCount(){let e=0;for(let t of this.visibleIndexSpans)e+=t.indexCount;return e/le}syncDefaultDrawGroups(){let e=this.mesh.geometry;e.clearGroups();let t=this.highWatermark*le;t>0&&e.addGroup(0,t,0),e.setDrawRange(0,t)}addSection(e,t,r,i,s){let o=t.positions.length/ve,l=o/Te;if(o===0||l*Te!==o)return this.removeSection(e),!1;if(t.indices.length%le!==0||t.indices.length/le!==l)return!1;let a=this.sectionSlots.has(e),v;if(a){let S=this.sectionSlots.get(e),B=this.pendingReplace.get(e),P=this.pendingMove?.key===e?this.pendingMove:void 0;B?(this.zeroAndFreeSlot(S.start,S.count),v={start:B.oldStart,count:B.oldCount},this.pendingReplace.delete(e)):P?(this.zeroAndFreeSlot(S.start,S.count),v={start:P.oldStart,count:P.count},this.pendingMove=null):v=S}l>this.capacityQuads&&this.growCapacity(l);let c=this.takeFreeSlot(l);c||(this.highWatermark+l>this.capacityQuads&&this.growCapacity(this.highWatermark+l),c={start:this.highWatermark,count:l},this.highWatermark+=l);let u=c.start*Te,h=u*ve,p=u*pt,m=u*De;this.positions.set(t.positions,h),this.colors.set(t.colors,h),this.skyLights.set(t.skyLights,m),this.blockLights.set(t.blockLights,m),this.uvs.set(t.uvs,p);let b=h,k=r-this.renderOrigin.x,_=i-this.renderOrigin.y,y=s-this.renderOrigin.z;for(let S=0;S<o;S++){let B=b+S*ve;this.aOrigin[B]=k,this.aOrigin[B+1]=_,this.aOrigin[B+2]=y}let M=c.start*le,T=u;for(let S=0;S<t.indices.length;S++)this.indices[M+S]=t.indices[S]+T;for(let S=0;S<l;S++){let B=c.start+S,P=S*Te,H=P*ve,V=0,z=0,N=0;for(let te=0;te<Te;te++){let se=H+te*ve;V+=t.positions[se],z+=t.positions[se+1],N+=t.positions[se+2]}let Y=B*3;this.quadCentroids[Y]=V/Te,this.quadCentroids[Y+1]=z/Te,this.quadCentroids[Y+2]=N/Te;let q=S*le,J=B*le;for(let te=0;te<le;te++)this.quadIndexTemplate[J+te]=t.indices[q+te]-P}return this.sectionSlots.set(e,c),a&&v&&this.pendingReplace.set(e,{oldStart:v.start,oldCount:v.count}),this.blendSort&&this._camInitialized&&l>=2&&this.applyBlendSort(c.start,l,this._camX,this._camY,this._camZ),this.markDirty(c.start,c.start+l-1),this.syncDefaultDrawGroups(),this.layoutVersion++,!0}getLayoutVersion(){return this.layoutVersion}getUploadEpoch(){return this.uploadEpoch}hasPendingReplace(){return this.pendingReplace.size>0}canUseFullDrawShortcut(){return this.pendingRanges.length===0&&this.interiorFreeQuads()===0&&this.pendingMove===null&&this.pendingReplace.size===0}isRangeFullyUploaded(e,t){return this.rangeFullyUploaded(e,t)}getPendingDirtyRanges(){return this.pendingRanges}getSectionDrawStart(e){let t=this.sectionSlots.get(e);if(!t)return;if(this.pendingMove?.key===e)return this.pendingMove.oldStart;let r=this.pendingReplace.get(e);if(r)return r.oldStart;if(this.rangeFullyUploaded(t.start,t.start+t.count-1))return t.start}getSectionDrawCount(e){let t=this.sectionSlots.get(e);if(!t)return;if(this.pendingMove?.key===e)return this.pendingMove.count;let r=this.pendingReplace.get(e);if(r)return r.oldCount;if(this.rangeFullyUploaded(t.start,t.start+t.count-1))return t.count}getPendingMove(){return this.pendingMove}compactStep(){if(this.pendingMove){let{newStart:l,count:a}=this.pendingMove;this.rangeFullyUploaded(l,l+a-1)&&this.finalizePendingMove();return}for(let l of[...this.pendingReplace.keys()]){let a=this.sectionSlots.get(l);a&&this.rangeFullyUploaded(a.start,a.start+a.count-1)&&this.finalizePendingReplace(l)}if(this.highWatermark===0||this.interiorFreeQuads()/this.highWatermark<=vu)return;let t=this.findMovableSection(hs);if(!t)return;let r=this.findLowestInteriorHole(t.start,t.count);if(!r)return;let i=this.reserveFreeSlotAt(r.index,t.count),s=t.start,o=i.start;this.copySectionRange(s,o,t.count),this.sectionSlots.set(t.key,{start:o,count:t.count}),this.markDirty(o,o+t.count-1),this.pendingMove={key:t.key,oldStart:s,newStart:o,count:t.count},this.layoutVersion++}updateDrawSpans(e,t){if(this.visibleIndexSpans=[],this.highWatermark===0)return;let r=this._spanScratch;r.length=0;let i=0;for(let o of e){let l=this.getSectionDrawStart(o.key),a=this.getSectionDrawCount(o.key),v=this.sectionSlots.get(o.key);l===void 0||a===void 0||!v||(r.push({start:l,count:a}),i+=a)}if(r.length===0)return;let s=(o,l)=>{this.visibleIndexSpans.push({indexStart:o*le,indexCount:l*le})};if(t==="opaque"){let o;this.canUseFullDrawShortcut()&&i>=this.highWatermark*fs?o=[{start:0,count:this.highWatermark}]:(r.sort((a,v)=>a.start-v.start),this.mergeOpaqueSpans(r),o=r),o=Xn(o,this.pendingRanges);for(let a of o)s(a.start,a.count)}else{e.sort((o,l)=>l.distSq-o.distSq);for(let o of e){let l=this.getSectionDrawStart(o.key),a=this.getSectionDrawCount(o.key);l===void 0||a===void 0||s(l,a)}}}mergeOpaqueSpans(e){if(e.length<2)return;let t=0;for(;t<e.length-1;){let r=e[t],i=e[t+1];r.start+r.count===i.start?(r.count=i.start+i.count-r.start,e.splice(t+1,1)):t++}}hasSection(e){return this.sectionSlots.has(e)}getSectionSlot(e){return this.sectionSlots.get(e)}takeSectionData(e){let t=this.getSectionGeometryData(e);if(t)return this.removeSection(e),t}getSectionGeometryData(e){let t=this.sectionSlots.get(e);if(!t)return;let r=t.count*Te,i=t.start*Te,s=i*ve,o=i*pt,l=t.start*le,a=t.count*le,v=i*De,c=this.positions.slice(s,s+r*ve),u=this.colors.slice(s,s+r*ve),h=this.skyLights.slice(v,v+r*De),p=this.blockLights.slice(v,v+r*De),m=this.uvs.slice(o,o+r*pt),b=this.indices.slice(l,l+a),k=i;for(let T=0;T<b.length;T++)b[T]=b[T]-k;let _=this.aOrigin[s]+this.renderOrigin.x,y=this.aOrigin[s+1]+this.renderOrigin.y,M=this.aOrigin[s+2]+this.renderOrigin.z;return{positions:c,colors:u,skyLights:h,blockLights:p,uvs:m,indices:b,sx:_,sy:y,sz:M}}removeSection(e){let t=this.sectionSlots.get(e);if(!t)return;if(this.pendingReplace.has(e)){let s=this.pendingReplace.get(e);this.zeroAndFreeSlot(s.oldStart,s.oldCount),this.pendingReplace.delete(e)}if(this.pendingMove?.key===e){let{oldStart:s,count:o}=this.pendingMove;this.zeroAndFreeSlot(s,o),this.pendingMove=null}let r=t.start*le,i=t.count*le;for(let s=0;s<i;s++)this.indices[r+s]=0;this.markDirty(t.start,t.start+t.count-1),this.sectionSlots.delete(e),this.insertFreeSlot(t),this.shrinkHighWatermark(),this.syncDefaultDrawGroups(),this.layoutVersion++}hasPendingUploads(){return this.pendingRanges.length>0}hasPendingIndexUploads(){return this.indexPendingRanges.length>0}reorderSectionBlendIndices(e,t,r,i){let s=this.sectionSlots.get(e);return!s||this.pendingMove?.key===e||this.pendingReplace.has(e)||!this.rangeFullyUploaded(s.start,s.start+s.count-1)||s.count<2?!1:(this.applyBlendSort(s.start,s.count,t,r,i),this.markIndexDirty(s.start,s.start+s.count-1),!0)}applyBlendSort(e,t,r,i,s){let o=e*Te*ve,l=this.aOrigin[o]+this.renderOrigin.x,a=this.aOrigin[o+1]+this.renderOrigin.y,v=this.aOrigin[o+2]+this.renderOrigin.z;this._sortOrder.length<t&&(this._sortOrder=new Uint32Array(t),this._sortDistSq=new Float64Array(t));let c=this._sortOrder,u=this._sortDistSq;for(let p=0;p<t;p++){c[p]=p;let b=(e+p)*3,k=l+this.quadCentroids[b],_=a+this.quadCentroids[b+1],y=v+this.quadCentroids[b+2],M=k-r,T=_-i,S=y-s;u[p]=M*M+T*T+S*S}let h=c.subarray(0,t);h.sort((p,m)=>{let b=u[m]-u[p];return b!==0?b:p-m});for(let p=0;p<t;p++){let m=h[p],b=(e+m)*Te,k=(e+p)*le,_=(e+m)*le;for(let y=0;y<le;y++)this.indices[k+y]=b+this.quadIndexTemplate[_+y]}}uploadDirtyRange(){let e=this.pendingRanges[0];if(!e)return;let t=e.start,r=Math.min(e.end-e.start+1,hs),i=t*Te,s=r*Te,o=t*le,l=r*le,a=this.mesh.geometry,v=a.getAttribute("position");v.clearUpdateRanges(),v.addUpdateRange(i*ve,s*ve),v.needsUpdate=!0;let c=a.getAttribute("color");c.clearUpdateRanges(),c.addUpdateRange(i*ve,s*ve),c.needsUpdate=!0;let u=a.getAttribute("a_skyLight");u.clearUpdateRanges(),u.addUpdateRange(i*De,s*De),u.needsUpdate=!0;let h=a.getAttribute("a_blockLight");h.clearUpdateRanges(),h.addUpdateRange(i*De,s*De),h.needsUpdate=!0;let p=a.getAttribute("uv");p.clearUpdateRanges(),p.addUpdateRange(i*pt,s*pt),p.needsUpdate=!0;let m=a.getAttribute("a_origin");m.clearUpdateRanges(),m.addUpdateRange(i*ve,s*ve),m.needsUpdate=!0;let b=a.index;b.clearUpdateRanges(),b.addUpdateRange(o,l),b.needsUpdate=!0,t+r>e.end?this.pendingRanges.shift():e.start=t+r,this.uploadEpoch++}uploadDirtyIndexRange(){let e=this.indexPendingRanges[0];if(!e)return;let t=e.start,r=Math.min(e.end-e.start+1,hs),i=t*le,s=r*le,o=this.mesh.geometry.index;o.clearUpdateRanges(),o.addUpdateRange(i,s),o.needsUpdate=!0,t+r>e.end?this.indexPendingRanges.shift():e.start=t+r}setRenderOrigin(e){this.renderOrigin={...e}}rebase(e){if(this.highWatermark!==0){for(let t of this.sectionSlots.values()){let r=t.start*Te,i=t.count*Te,s=r*ve;for(let o=0;o<i;o++){let l=s+o*ve;this.aOrigin[l]-=e.x,this.aOrigin[l+1]-=e.y,this.aOrigin[l+2]-=e.z}}this.markDirty(0,this.highWatermark-1),this.renderOrigin.x+=e.x,this.renderOrigin.y+=e.y,this.renderOrigin.z+=e.z}}setCameraOrigin(e,t,r){this._camX=e,this._camY=t,this._camZ=r,this._camInitialized=!0;let{originDelta:i,cameraOriginFrac:s}=F0(this.renderOrigin,e,t,r),o=this.material.uniforms.u_originDelta;o?.value?.set&&o.value.set(i.x,i.y,i.z);let l=this.material.uniforms.u_cameraOriginFrac;l?.value?.set&&l.value.set(s.x,s.y,s.z)}getHighWatermark(){return this.highWatermark}getCapacityQuads(){return this.capacityQuads}getSectionCount(){return this.sectionSlots.size}getMemoryBytes(){return this.capacityQuads*tl}getUsedMemoryBytes(){return this.highWatermark*tl}reset(){this.sectionSlots.clear(),this.freeList.length=0,this.highWatermark=0,this.pendingRanges.length=0,this.indexPendingRanges.length=0,this.pendingMove=null,this.pendingReplace.clear(),this.uploadEpoch=0,this.visibleIndexSpans=[],this.syncDefaultDrawGroups()}dispose(){this.mesh.parent?.remove(this.mesh),this.mesh.geometry.dispose(),this.reset()}markDirty(e,t){this.pendingRanges.push({start:e,end:t}),this.pendingRanges.sort((r,i)=>r.start-i.start),this.mergePendingRanges()}markIndexDirty(e,t){this.indexPendingRanges.push({start:e,end:t}),this.indexPendingRanges.sort((r,i)=>r.start-i.start),this.mergeIndexPendingRanges()}mergeIndexPendingRanges(){if(this.indexPendingRanges.length<2)return;let e=[],t=this.indexPendingRanges[0];for(let r=1;r<this.indexPendingRanges.length;r++){let i=this.indexPendingRanges[r];i.start<=t.end+1?t={start:t.start,end:Math.max(t.end,i.end)}:(e.push(t),t=i)}e.push(t),this.indexPendingRanges=e}mergePendingRanges(){if(this.pendingRanges.length<2)return;let e=[],t=this.pendingRanges[0];for(let r=1;r<this.pendingRanges.length;r++){let i=this.pendingRanges[r];i.start<=t.end+1?t={start:t.start,end:Math.max(t.end,i.end)}:(e.push(t),t=i)}e.push(t),this.pendingRanges=e}takeFreeSlot(e){for(let t=0;t<this.freeList.length;t++){let r=this.freeList[t];if(r.count>=e){if(this.freeList.splice(t,1),r.count===e)return r;let i={start:r.start,count:e};return this.insertFreeSlot({start:r.start+e,count:r.count-e}),i}}}insertFreeSlot(e){this.freeList.push(e),this.freeList.sort((t,r)=>t.start-r.start),this.mergeFreeList()}mergeFreeList(){if(this.freeList.length<2)return;let e=[],t=this.freeList[0];for(let r=1;r<this.freeList.length;r++){let i=this.freeList[r];t.start+t.count===i.start?t={start:t.start,count:t.count+i.count}:(e.push(t),t=i)}e.push(t),this.freeList=e}shrinkHighWatermark(){for(;this.highWatermark>0;){let e=this.highWatermark-1,t=this.freeList.find(i=>i.start<=e&&i.start+i.count>e);if(!t||t.start+t.count!==this.highWatermark)break;this.highWatermark=t.start;let r=this.freeList.indexOf(t);this.freeList.splice(r,1)}}interiorFreeQuads(){let e=0;for(let t of this.freeList)t.start<this.highWatermark&&(e+=t.count);return e}findMovableSection(e){let t=[];for(let[s,o]of this.sectionSlots)t.push({key:s,start:o.start,count:o.count});if(t.length===0)return;t.sort((s,o)=>o.start!==s.start?o.start-s.start:o.start+o.count-(s.start+s.count));let r=t[0];if(r.count<=e&&this.findLowestInteriorHole(r.start,r.count))return r;let i=t.filter(s=>s.count<=e).sort((s,o)=>o.count-s.count);for(let s of i)if(this.findLowestInteriorHole(s.start,s.count))return s}findLowestInteriorHole(e,t){for(let r=0;r<this.freeList.length;r++){let i=this.freeList[r];if(i.start<e&&i.count>=t)return{start:i.start,count:i.count,index:r}}}reserveFreeSlotAt(e,t){let r=this.freeList[e];if(this.freeList.splice(e,1),r.count===t)return{start:r.start,count:t};let i={start:r.start,count:t};return this.insertFreeSlot({start:r.start+t,count:r.count-t}),i}copySectionRange(e,t,r){let i=e*Te,s=t*Te,o=r*Te,l=s-i,a=i*ve,v=s*ve,c=o*ve;this.positions.copyWithin(v,a,a+c),this.colors.copyWithin(v,a,a+c),this.aOrigin.copyWithin(v,a,a+c);let u=i*De,h=s*De,p=o*De;this.skyLights.copyWithin(h,u,u+p),this.blockLights.copyWithin(h,u,u+p);let m=i*pt,b=s*pt,k=o*pt;this.uvs.copyWithin(b,m,m+k);let _=e*le,y=t*le,M=r*le;for(let H=0;H<M;H++)this.indices[y+H]=this.indices[_+H]+l;let T=e*3,S=t*3;this.quadCentroids.copyWithin(S,T,T+r*3);let B=e*le,P=t*le;this.quadIndexTemplate.copyWithin(P,B,B+r*le)}rangeFullyUploaded(e,t){for(let r of this.pendingRanges)if(r.start<=t&&r.end>=e)return!1;return!0}zeroAndFreeSlot(e,t){let r=e*le,i=t*le;for(let s=0;s<i;s++)this.indices[r+s]=0;this.markDirty(e,e+t-1),this.insertFreeSlot({start:e,count:t})}finalizePendingReplace(e){let t=this.pendingReplace.get(e);t&&(this.zeroAndFreeSlot(t.oldStart,t.oldCount),this.pendingReplace.delete(e),this.shrinkHighWatermark(),this.syncDefaultDrawGroups(),this.layoutVersion++,this.uploadEpoch++)}finalizePendingMove(){let e=this.pendingMove;if(!e)return;let{oldStart:t,count:r}=e;this.zeroAndFreeSlot(t,r),this.shrinkHighWatermark(),this.syncDefaultDrawGroups(),this.pendingMove=null,this.layoutVersion++,this.uploadEpoch++}growCapacity(e){this.pendingMove&&this.finalizePendingMove();for(let y of[...this.pendingReplace.keys()])this.finalizePendingReplace(y);let t=this.capacityQuads;for(;t<e;)t+=this.growthIncrementQuads;let r=this.capacityQuads*Te,i=t*Te,s=new Float32Array(i*ve),o=new Float32Array(i*ve),l=new Float32Array(i*De),a=new Float32Array(i*De),v=new Float32Array(i*pt),c=new Float32Array(i*ve),u=new Uint32Array(t*le),h=new Float32Array(t*3),p=new Uint8Array(t*le);s.set(this.positions),o.set(this.colors),l.set(this.skyLights),a.set(this.blockLights),v.set(this.uvs),c.set(this.aOrigin),u.set(this.indices),h.set(this.quadCentroids),p.set(this.quadIndexTemplate),this.positions=s,this.colors=o,this.skyLights=l,this.blockLights=a,this.uvs=v,this.aOrigin=c,this.indices=u,this.quadCentroids=h,this.quadIndexTemplate=p,this.capacityQuads=t;let m=this.mesh.geometry,b=(y,M,T)=>{m.getAttribute(T)&&m.deleteAttribute(T);let B=new Ke.BufferAttribute(y,M);B.setUsage(Ke.DynamicDrawUsage),m.setAttribute(T,B)};b(this.positions,ve,"position"),b(this.colors,ve,"color"),b(this.skyLights,De,"a_skyLight"),b(this.blockLights,De,"a_blockLight"),b(this.uvs,pt,"uv"),b(this.aOrigin,ve,"a_origin"),m.index&&m.setIndex(null);let _=new Ke.BufferAttribute(this.indices,1);_.setUsage(Ke.DynamicDrawUsage),m.setIndex(_),this.pendingRanges.length=0,this.indexPendingRanges.length=0}};function cu(n){if(n.length<2)return;let e=0;for(;e<n.length-1;){let t=n[e],r=n[e+1];t.start+t.count===r.start?(t.count=r.start+r.count-t.start,n.splice(e+1,1)):e++}}function rl(n,e,t=!0,r,i=[]){if(n.length===0||e===0)return[];let s=0;for(let a of n)s+=a.count;let o;if(t&&s>=e*fs)o=[{start:0,count:e}];else return o=n.map(a=>({start:a.start,count:a.count})),o.sort((a,v)=>a.start-v.start),cu(o),o=Xn(o,i),o;return Xn(o,i)}n0();function il(){return{firsts:new Int32Array(Wt),counts:new Int32Array(Wt),instanceCounts:new Int32Array(Wt),baseInstances:new Int32Array(Wt)}}function du(n,e){if(n.counts.length>=e)return;let t=n.counts.length;for(;t<e;)t*=2;n.firsts=new Int32Array(t),n.counts=new Int32Array(t),n.instanceCounts=new Int32Array(t),n.baseInstances=new Int32Array(t)}function sl(n){let e=n.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance");if(e)return{tier:"A",ext:e};let t=n.getExtension("WEBGL_draw_instanced_base_vertex_base_instance");return t?{tier:"B",ext:t}:{tier:"C",ext:null}}var nl=!1;function ol(n,e){nl||!e||(nl=!0)}function al(n,e,t,r,i){let s=t.length;if(s===0)return;let o=n.TRIANGLES;if(e.tier==="A"&&e.ext){let l=e.ext;du(r,s);for(let a=0;a<s;a++){let v=t[a];r.firsts[a]=0,r.counts[a]=Nt,r.instanceCounts[a]=v.count,r.baseInstances[a]=v.start}l.multiDrawArraysInstancedBaseInstanceWEBGL(o,r.firsts,0,r.counts,0,r.instanceCounts,0,r.baseInstances,0,s);return}if(e.tier==="B"&&e.ext){let l=e.ext;for(let a=0;a<s;a++){let v=t[a];l.drawArraysInstancedBaseInstanceWEBGL(o,0,Nt,v.count,v.start)}return}i?.(n,t)}n0();hr();var uu=512e3,hu=1e6,ll=15e3,fu=.25,m5=D7(),vl=16,Zn=class{constructor(e,t){d(this,"mesh");d(this,"capacityFaces");d(this,"w0");d(this,"w1");d(this,"w2");d(this,"w3");d(this,"sectionSlots",new Map);d(this,"freeList",[]);d(this,"highWatermark",0);d(this,"pendingRanges",[]);d(this,"pendingMove",null);d(this,"pendingReplace",new Map);d(this,"uploadEpoch",0);d(this,"visibleSpans",[]);d(this,"_drawScratch",il());d(this,"multiDrawCaps",null);d(this,"tierCVao",null);d(this,"tierCAttrs",null);d(this,"tierCGl",null);d(this,"debugOverlay",!1);d(this,"layoutVersion",0);this.capacityFaces=uu,this.w0=new Uint32Array(this.capacityFaces),this.w1=new Uint32Array(this.capacityFaces),this.w2=new Uint32Array(this.capacityFaces),this.w3=new Uint32Array(this.capacityFaces),this.w2.fill(m5);let r=new Et.InstancedBufferGeometry,i=new Float32Array(Nt*3);r.setAttribute("position",new Et.BufferAttribute(i,3));let s=o=>{let l=new Et.InstancedBufferAttribute(o,1);return l.setUsage(Et.DynamicDrawUsage),l};r.setAttribute("a_w0",s(this.w0)),r.setAttribute("a_w1",s(this.w1)),r.setAttribute("a_w2",s(this.w2)),r.setAttribute("a_w3",s(this.w3)),r.instanceCount=0,this.mesh=new Et.Mesh(r,e),this.mesh.name="globalShaderCubes",this.mesh.frustumCulled=!1,this.mesh.matrixAutoUpdate=!1,this.mesh.matrix.identity(),this.mesh.position.set(0,0,0),t.add(this.mesh),this.mesh.onAfterRender=(o,l,a,v,c)=>{if(this.visibleSpans.length===0)return;let u=c,h=o.getContext();this.multiDrawCaps||(this.multiDrawCaps=sl(h),ol(this.multiDrawCaps.tier,this.debugOverlay)),al(h,this.multiDrawCaps,this.visibleSpans,this._drawScratch,this.multiDrawCaps.tier==="C"?(p,m)=>this.drawTierCSpans(p,m,o,u):void 0)}}setDebugOverlay(e){this.debugOverlay=e}suppressThreeDraw(){let e=this.mesh.geometry;e.setDrawRange(0,Nt),e.instanceCount=0}setVisibleSpans(e){this.visibleSpans=e}getVisibleSpans(){return this.visibleSpans}getVisibleFaceCount(){let e=0;for(let t of this.visibleSpans)e+=t.count;return e}forEachSectionSlot(e){for(let[t,r]of this.sectionSlots)e(t,r)}getSectionDrawStart(e){let t=this.sectionSlots.get(e);if(!t)return;if(this.pendingMove?.key===e)return this.pendingMove.oldStart;let r=this.pendingReplace.get(e);if(r)return r.oldStart;if(this.rangeFullyUploaded(t.start,t.start+t.count-1))return t.start}getSectionDrawCount(e){let t=this.sectionSlots.get(e);if(!t)return;if(this.pendingMove?.key===e)return this.pendingMove.count;let r=this.pendingReplace.get(e);if(r)return r.oldCount;if(this.rangeFullyUploaded(t.start,t.start+t.count-1))return t.count}getUploadEpoch(){return this.uploadEpoch}hasPendingReplace(){return this.pendingReplace.size>0}canUseFullDrawShortcut(){return this.pendingRanges.length===0&&this.interiorFreeFaces()===0&&this.pendingMove===null&&this.pendingReplace.size===0}isRangeFullyUploaded(e,t){return this.rangeFullyUploaded(e,t)}getPendingDirtyRanges(){return this.pendingRanges}getHighWatermark(){return this.highWatermark}getCapacityFaces(){return this.capacityFaces}getSectionCount(){return this.sectionSlots.size}getMemoryBytes(){return this.capacityFaces*vl}getUsedMemoryBytes(){return this.highWatermark*vl}hasPendingUploads(){return this.pendingRanges.length>0}getPendingMove(){return this.pendingMove}addSection(e,t,r){if(r<=0){this.removeSection(e);return}let i=this.sectionSlots.has(e),s;if(i){let a=this.sectionSlots.get(e),v=this.pendingReplace.get(e),c=this.pendingMove?.key===e?this.pendingMove:void 0;v?(this.zeroAndFreeSlot(a.start,a.count),s={start:v.oldStart,count:v.oldCount},this.pendingReplace.delete(e)):c?(this.zeroAndFreeSlot(a.start,a.count),s={start:c.oldStart,count:c.count},this.pendingMove=null):s=a}r>this.capacityFaces&&this.growCapacity(r);let o=this.takeFreeSlot(r);o||(this.highWatermark+r>this.capacityFaces&&this.growCapacity(this.highWatermark+r),o={start:this.highWatermark,count:r},this.highWatermark+=r);let l=4;for(let a=0;a<r;a++){let v=o.start+a,c=a*l;this.w0[v]=t[c],this.w1[v]=t[c+1],this.w2[v]=t[c+2],this.w3[v]=t[c+3]}this.sectionSlots.set(e,o),i&&s&&this.pendingReplace.set(e,{oldStart:s.start,oldCount:s.count}),this.markDirty(o.start,o.start+r-1),this.mesh.geometry.instanceCount=this.highWatermark,this.layoutVersion++}getLayoutVersion(){return this.layoutVersion}hasSection(e){return this.sectionSlots.has(e)}getSectionSlot(e){return this.sectionSlots.get(e)}getW0(){return this.w0}takeSectionData(e){let t=this.sectionSlots.get(e);if(!t)return;let r=4,i=new Uint32Array(t.count*r);for(let s=0;s<t.count;s++){let o=t.start+s,l=s*r;i[l]=this.w0[o],i[l+1]=this.w1[o],i[l+2]=this.w2[o],i[l+3]=this.w3[o]}return this.removeSection(e),{words:i,count:t.count}}removeSection(e){let t=this.sectionSlots.get(e);if(t){if(this.pendingReplace.has(e)){let r=this.pendingReplace.get(e);this.zeroAndFreeSlot(r.oldStart,r.oldCount),this.pendingReplace.delete(e)}if(this.pendingMove?.key===e){let{oldStart:r,count:i}=this.pendingMove;this.zeroAndFreeSlot(r,i),this.pendingMove=null}for(let r=t.start;r<t.start+t.count;r++)this.w0[r]=0,this.w1[r]=0,this.w2[r]=m5,this.w3[r]=0;this.markDirty(t.start,t.start+t.count-1),this.sectionSlots.delete(e),this.insertFreeSlot(t),this.shrinkHighWatermark(),this.mesh.geometry.instanceCount=this.highWatermark,this.layoutVersion++}}compactStep(){if(this.pendingMove){let{newStart:l,count:a}=this.pendingMove;this.rangeFullyUploaded(l,l+a-1)&&this.finalizePendingMove();return}for(let l of[...this.pendingReplace.keys()]){let a=this.sectionSlots.get(l);a&&this.rangeFullyUploaded(a.start,a.start+a.count-1)&&this.finalizePendingReplace(l)}if(this.highWatermark===0||this.interiorFreeFaces()/this.highWatermark<=fu)return;let t=this.findMovableSection(ll);if(!t)return;let r=this.findLowestInteriorHole(t.start,t.count);if(!r)return;let i=this.reserveFreeSlotAt(r.index,t.count),s=t.start,o=i.start;this.copySectionRange(s,o,t.count),this.sectionSlots.set(t.key,{start:o,count:t.count}),this.markDirty(o,o+t.count-1),this.pendingMove={key:t.key,oldStart:s,newStart:o,count:t.count},this.layoutVersion++}uploadDirtyRange(){let e=this.pendingRanges[0];if(!e)return;let t=e.start,r=Math.min(e.end-e.start+1,ll),i=this.mesh.geometry;for(let s of["a_w0","a_w1","a_w2","a_w3"]){let o=i.getAttribute(s);o.clearUpdateRanges(),o.addUpdateRange(t,r),o.needsUpdate=!0}t+r>e.end?this.pendingRanges.shift():e.start=t+r,this.uploadEpoch++}setCameraOrigin(e,t,r,i){let{originDelta:s,cameraOriginFrac:o}=F0(e,t,r,i),l=Vn(e),a=this.mesh.material.uniforms.u_originDelta;a?.value?.set&&a.value.set(s.x,s.y,s.z);let v=this.mesh.material.uniforms.u_cameraOriginFrac;v?.value?.set&&v.value.set(o.x,o.y,o.z);let c=this.mesh.material.uniforms.u_sectionOriginRel;c?.value?.set&&c.value.set(l.x,l.y,l.z)}reset(){this.sectionSlots.clear(),this.freeList.length=0,this.highWatermark=0,this.pendingRanges.length=0,this.pendingMove=null,this.pendingReplace.clear(),this.uploadEpoch=0,this.visibleSpans=[],this.w0.fill(0),this.w1.fill(0),this.w2.fill(m5),this.w3.fill(0),this.mesh.geometry.instanceCount=0,this.invalidateTierCVao()}dispose(){this.invalidateTierCVao(),this.mesh.parent?.remove(this.mesh),this.mesh.geometry.dispose(),this.reset()}invalidateTierCVao(){this.tierCVao&&this.tierCGl&&this.tierCGl.deleteVertexArray(this.tierCVao),this.tierCVao=null,this.tierCAttrs=null}drawTierCSpans(e,t,r,i){if(this.ensureTierCVao(e,r,i),!this.tierCVao||!this.tierCAttrs)return;let s=this.tierCAttrs;e.bindVertexArray(this.tierCVao);for(let o of t){let l=o.start*4,a=v=>{e.bindBuffer(e.ARRAY_BUFFER,v.buffer),e.vertexAttribIPointer(v.loc,1,e.UNSIGNED_INT,4,l)};a(s.w0),a(s.w1),a(s.w2),a(s.w3),e.drawArraysInstanced(e.TRIANGLES,0,Nt,o.count)}e.bindVertexArray(null)}ensureTierCVao(e,t,r){this.tierCGl=e;let o=t.properties.get(r).currentProgram.program,l=e.getAttribLocation(o,"a_w0"),a=e.getAttribLocation(o,"a_w1"),v=e.getAttribLocation(o,"a_w2"),c=e.getAttribLocation(o,"a_w3"),u=M=>M<0?null:e.getVertexAttrib(M,e.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING),h=u(l);if(this.tierCVao&&this.tierCAttrs&&h&&this.tierCAttrs.w0.buffer!==h&&this.invalidateTierCVao(),this.tierCVao)return;let p=u(l),m=u(a),b=u(v),k=u(c);if(!p||!m||!b||!k)return;let _=e.createVertexArray();if(!_)return;e.bindVertexArray(_);let y=(M,T)=>{e.enableVertexAttribArray(M),e.bindBuffer(e.ARRAY_BUFFER,T),e.vertexAttribIPointer(M,1,e.UNSIGNED_INT,4,0),e.vertexAttribDivisor(M,1)};y(l,p),y(a,m),y(v,b),y(c,k),e.bindVertexArray(null),this.tierCVao=_,this.tierCAttrs={w0:{loc:l,buffer:p},w1:{loc:a,buffer:m},w2:{loc:v,buffer:b},w3:{loc:c,buffer:k}}}markDirty(e,t){this.pendingRanges.push({start:e,end:t}),this.pendingRanges.sort((r,i)=>r.start-i.start),this.mergePendingRanges()}mergePendingRanges(){if(this.pendingRanges.length<2)return;let e=[],t=this.pendingRanges[0];for(let r=1;r<this.pendingRanges.length;r++){let i=this.pendingRanges[r];i.start<=t.end+1?t={start:t.start,end:Math.max(t.end,i.end)}:(e.push(t),t=i)}e.push(t),this.pendingRanges=e}takeFreeSlot(e){for(let t=0;t<this.freeList.length;t++){let r=this.freeList[t];if(r.count>=e){if(this.freeList.splice(t,1),r.count===e)return r;let i={start:r.start,count:e};return this.insertFreeSlot({start:r.start+e,count:r.count-e}),i}}}insertFreeSlot(e){this.freeList.push(e),this.freeList.sort((t,r)=>t.start-r.start),this.mergeFreeList()}mergeFreeList(){if(this.freeList.length<2)return;let e=[],t=this.freeList[0];for(let r=1;r<this.freeList.length;r++){let i=this.freeList[r];t.start+t.count===i.start?t={start:t.start,count:t.count+i.count}:(e.push(t),t=i)}e.push(t),this.freeList=e}interiorFreeFaces(){let e=0;for(let t of this.freeList)t.start<this.highWatermark&&(e+=t.count);return e}findMovableSection(e){let t=[];for(let[s,o]of this.sectionSlots)t.push({key:s,start:o.start,count:o.count});if(t.length===0)return;t.sort((s,o)=>o.start!==s.start?o.start-s.start:o.start+o.count-(s.start+s.count));let r=t[0];if(r.count<=e&&this.findLowestInteriorHole(r.start,r.count))return r;let i=t.filter(s=>s.count<=e).sort((s,o)=>o.count-s.count);for(let s of i)if(this.findLowestInteriorHole(s.start,s.count))return s}findLowestInteriorHole(e,t){for(let r=0;r<this.freeList.length;r++){let i=this.freeList[r];if(i.start<e&&i.count>=t)return{start:i.start,count:i.count,index:r}}}reserveFreeSlotAt(e,t){let r=this.freeList[e];if(this.freeList.splice(e,1),r.count===t)return{start:r.start,count:t};let i={start:r.start,count:t};return this.insertFreeSlot({start:r.start+t,count:r.count-t}),i}copySectionRange(e,t,r){this.w0.copyWithin(t,e,e+r),this.w1.copyWithin(t,e,e+r),this.w2.copyWithin(t,e,e+r),this.w3.copyWithin(t,e,e+r)}rangeFullyUploaded(e,t){for(let r of this.pendingRanges)if(r.start<=t&&r.end>=e)return!1;return!0}zeroAndFreeSlot(e,t){for(let r=e;r<e+t;r++)this.w0[r]=0,this.w1[r]=0,this.w2[r]=m5,this.w3[r]=0;this.markDirty(e,e+t-1),this.insertFreeSlot({start:e,count:t})}finalizePendingReplace(e){let t=this.pendingReplace.get(e);t&&(this.zeroAndFreeSlot(t.oldStart,t.oldCount),this.pendingReplace.delete(e),this.shrinkHighWatermark(),this.mesh.geometry.instanceCount=this.highWatermark,this.layoutVersion++,this.uploadEpoch++)}finalizePendingMove(){let e=this.pendingMove;if(!e)return;let{oldStart:t,count:r}=e;this.zeroAndFreeSlot(t,r),this.shrinkHighWatermark(),this.mesh.geometry.instanceCount=this.highWatermark,this.pendingMove=null,this.layoutVersion++,this.uploadEpoch++}shrinkHighWatermark(){for(;this.highWatermark>0;){let e=this.highWatermark-1,t=this.freeList.find(i=>i.start<=e&&i.start+i.count>e);if(!t||t.start+t.count!==this.highWatermark)break;this.highWatermark=t.start;let r=this.freeList.indexOf(t);this.freeList.splice(r,1)}}growCapacity(e){this.pendingMove&&this.finalizePendingMove();for(let v of[...this.pendingReplace.keys()])this.finalizePendingReplace(v);let t=this.capacityFaces;for(;t<e;)t+=hu;let r=new Uint32Array(t),i=new Uint32Array(t),s=new Uint32Array(t),o=new Uint32Array(t);r.set(this.w0),i.set(this.w1),s.set(this.w2),o.set(this.w3),s.fill(m5,this.w0.length),this.w0=r,this.w1=i,this.w2=s,this.w3=o,this.capacityFaces=t;let l=this.mesh.geometry,a=(v,c)=>{let u=l.getAttribute(c);u&&(l.deleteAttribute(c),"dispose"in u&&typeof u.dispose=="function"&&u.dispose());let h=new Et.InstancedBufferAttribute(v,1);h.setUsage(Et.DynamicDrawUsage),l.setAttribute(c,h)};a(this.w0,"a_w0"),a(this.w1,"a_w1"),a(this.w2,"a_w2"),a(this.w3,"a_w3"),this.pendingRanges.length=0,this.invalidateTierCVao()}};A();E();R();x();hr();n0();function cl(n,e,t,r,i){if(e<=0)return;let s=t-8,o=r-8,l=i-8,a=4,v=16,c=16,u=16,h=-1,p=-1,m=-1;for(let S=0;S<e;S++){let B=n[S*a],P=B&(1<<D0.LX_BITS)-1,H=B>>D0.LY_SHIFT&(1<<D0.LY_BITS)-1,V=B>>D0.LZ_SHIFT&(1<<D0.LZ_BITS)-1;P<v&&(v=P),H<c&&(c=H),V<u&&(u=V),P>h&&(h=P),H>p&&(p=H),V>m&&(m=V)}if(h<0)return;let b=s+v,k=o+c,_=l+u,y=s+h+1,M=o+p+1,T=l+m+1;return{minX:b,minY:k,minZ:_,maxX:y,maxY:M,maxZ:T,cx:(b+y)*.5,cy:(k+M)*.5,cz:(_+T)*.5}}function mu(n,e,t,r,i,s,o,l,a){return n>=r&&n<=o&&e>=i&&e<=l&&t>=s&&t<=a}function dl(n,e,t,r,i,s,o,l,a,v,c,u,h){if(mu(n,e,t,o,l,a,v,c,u))return;let p=0,m=h;if(Math.abs(r)<1e-8){if(n<o||n>v)return}else{let b=1/r,k=(o-n)*b,_=(v-n)*b;if(k>_){let y=k;k=_,_=y}if(p=Math.max(p,k),m=Math.min(m,_),p>m)return}if(Math.abs(i)<1e-8){if(e<l||e>c)return}else{let b=1/i,k=(l-e)*b,_=(c-e)*b;if(k>_){let y=k;k=_,_=y}if(p=Math.max(p,k),m=Math.min(m,_),p>m)return}if(Math.abs(s)<1e-8){if(t<a||t>u)return}else{let b=1/s,k=(a-t)*b,_=(u-t)*b;if(k>_){let y=k;k=_,_=y}if(p=Math.max(p,k),m=Math.min(m,_),p>m)return}return p<=m&&p>=0?p:void 0}function ul(n,e,t,r,i,s,o,l,a,v,c,u,h){let p=h;if(Math.abs(r)>=1e-8){let m=r>0?(v-n)/r:(o-n)/r;m>1e-6&&(p=Math.min(p,m))}else if(n<o||n>v)return;if(Math.abs(i)>=1e-8){let m=i>0?(c-e)/i:(l-e)/i;m>1e-6&&(p=Math.min(p,m))}else if(e<l||e>c)return;if(Math.abs(s)>=1e-8){let m=s>0?(u-t)/s:(a-t)/s;m>1e-6&&(p=Math.min(p,m))}else if(t<a||t>u)return;return p<=h?p:void 0}A();E();R();x();import*as ot from"three";A();E();R();x();Fn();var $n=class{constructor(){d(this,"entries",new Set);d(this,"skyLevel",1);d(this,"lightmapParams",{...nt})}register(e){this.entries.add(e),this.applyBrightness(e)}unregister(e){for(let t of this.entries)if(t.material===e){this.entries.delete(t);break}}setSkyLevel(e){this.skyLevel=e,this.refreshAll()}setLightmapParams(e){this.lightmapParams={...this.lightmapParams,...e},this.refreshAll()}getSkyLevel(){return this.skyLevel}refreshAll(){for(let e of this.entries)this.applyBrightness(e)}applyBrightness(e){let t=ts(e.blockLightNorm,e.skyLightNorm,this.skyLevel,this.lightmapParams);e.material.color.setScalar(t)}};function hl(n,e,t,r,i=nt){let s=ts(e,t,r,i);return n.color.setScalar(s),s}var fl=20,ml=40,pu={white_banner:15,orange_banner:14,magenta_banner:13,light_blue_banner:12,yellow_banner:11,lime_banner:10,pink_banner:9,gray_banner:8,light_gray_banner:7,cyan_banner:6,purple_banner:5,blue_banner:4,brown_banner:3,green_banner:2,red_banner:1,black_banner:0},pl={0:"#1d1d21",1:"#b02e26",2:"#5e7c16",3:"#835432",4:"#3c44aa",5:"#8932b8",6:"#169c9c",7:"#9d9d97",8:"#474f52",9:"#f38baa",10:"#80c71f",11:"#fed83d",12:"#3ab3da",13:"#c74ebd",14:"#f9801d",15:"#f9fffe"};function gu(n){let e=n.replace("_wall_banner","_banner");return pu[e]??15}var bu=(n,e,t,r,i,s,o)=>{switch(n.fillStyle=t,e){case"bs":n.fillRect(r,i,s,o);break;case"ls":n.fillRect(r,i,s/3,o);break;case"rs":n.fillRect(r+s*2/3,i,s/3,o);break;case"ts":n.fillRect(r,i,s,o/3);break;case"ms":n.fillRect(r,i+o/3,s,o/3);break;case"drs":n.fillRect(r,i,s/2,o/2);break;case"dls":n.fillRect(r+s/2,i,s/2,o/2);break;case"ss":for(let l=0;l<s;l+=2)n.fillRect(r+l,i,1,o);break;case"cr":n.fillRect(r,i+o/3,s,o/3),n.fillRect(r+s/3,i,s/3,o);break;case"sc":n.fillRect(r,i+o/2-1,s,2),n.fillRect(r+s/2-1,i,2,o);break;default:n.fillRect(r,i,s,o)}};function yu(n,e){if(!e||e.length===0)return`banner_${n}_empty`;let t=e.map(r=>`${r.Pattern??"bs"}_${r.Color??0}`).join(",");return`banner_${n}_${t}`}var _u=(n,e,t=(r,i)=>Ne(r,i))=>{let i=t(fl*1,ml*1),s=i.getContext("2d");if(s){if(s.imageSmoothingEnabled=!1,e?.Patterns&&e.Patterns.length>0)for(let o of e.Patterns){let l=o.Color??0,a=o.Pattern??"bs",v=pl[l]||pl[0];bu(s,a,v,0,0,fl*1,ml*1)}return i}},ei=new Map;function gl(n,e,t){let r=gu(e),i=yu(r,t?.Patterns),s=ei.get(i);if(s)return s.refCount++,s.texture;let o=_u(r,t);if(!o)return;let l=new ot.Texture(o);return l.magFilter=ot.NearestFilter,l.minFilter=ot.NearestFilter,l.needsUpdate=!0,ei.set(i,{texture:l,refCount:1}),l}function bl(n){for(let[e,t]of ei.entries())if(t.texture===n){t.refCount--,t.refCount<=0&&(t.texture.dispose(),ei.delete(e));return}}function yl(n,e,t,r,i=0,s=1,o=1){let c,u,h;t?(c=(-14.6+13.4)/2/16-.5,u=1-14.75/16-.5,h=1/2):(c=(1.4+29.4)/2/16,u=1-7.25/16-.5,h=0);let p=new ot.MeshBasicMaterial({map:r,transparent:!0});hl(p,i,s,o);let m=new ot.Mesh(new ot.PlaneGeometry(.85,1.75),p);m.renderOrder=999;let b=.5/16,k=.25/16;t?m.position.set(0,c,u+k+.004):m.position.set(0,c,u+b/2+.004);let _=new ot.Group;return _.rotation.set(0,-ot.MathUtils.degToRad(e*(t?90:45/2)),0),_.add(m),_.bannerTexture=r,_.bannerMaterial=p,_.position.set(n.x+.5,n.y+h,n.z+.5),_}A();E();R();x();import*as p5 from"three";import wu from"prismarine-chat";var fr=new Map;function Au(n,e,t){let r,i;return n&&"front_text"in n?(r=n.front_text?.messages??[],i=n.front_text?.color||"black"):(r=[n?.Text1,n?.Text2,n?.Text3,n?.Text4],i=n?.Color||"black"),`${e?1:0}|${t?1:0}|${i}|${r.join("\0")}`}function _l(n,e,t,r=!1){let i=Au(e,t,r),s=fr.get(i);if(s)return s.refCount++,s.texture;let o=wu(n.version),l=H2(e,t,o);if(!l)return;let a=new p5.Texture(l);return a.magFilter=p5.NearestFilter,a.minFilter=p5.NearestFilter,a.needsUpdate=!0,fr.set(i,{texture:a,refCount:1}),a}function wl(n){for(let[e,t]of fr.entries())if(t.texture===n){t.refCount--,t.refCount<=0&&(t.texture.dispose(),fr.delete(e));return}}function Al(){for(let[,n]of fr)n.texture.dispose();fr.clear()}A();E();R();x();A();E();R();x();import{Vec3 as xl}from"vec3";A();E();R();x();var g5=[0,1,2,3,4,5],Eu=g5.length,ti=2**36-1;function El(n,e,t){let r=e+t*Eu;return Math.floor(n/2**r)%2===1}function ms(n){switch(n){case 0:return 1;case 1:return 0;case 2:return 3;case 3:return 2;case 4:return 5;case 5:return 4;default:return n}}var b5=class{constructor(e,t,r){d(this,"sectionKey");d(this,"sourceDirections",0);d(this,"directions",0);d(this,"step");this.sectionKey=e,this.step=r,t!=null&&this.addSourceDirection(t)}setDirections(e,t){this.directions=(e|this.directions|1<<t)>>>0}hasDirection(e){return(this.directions&1<<e)!==0}addSourceDirection(e){this.sourceDirections=(this.sourceDirections|1<<e)>>>0}hasSourceDirection(e){return(this.sourceDirections&1<<e)!==0}hasSourceDirections(){return this.sourceDirections!==0}};function i0(n,e,t){return`${n},${e},${t}`}function y5(n){let[e,t,r]=n.split(",").map(Number);return{x:e,y:t,z:r}}function xu(n,e,t){let{x:r,y:i,z:s}=y5(n);switch(e){case 0:return i0(r,i-t,s);case 1:return i0(r,i+t,s);case 2:return i0(r,i,s-16);case 3:return i0(r,i,s+16);case 4:return i0(r-16,i,s);case 5:return i0(r+16,i,s);default:return n}}function Rl(n,e,t,r){let i=y5(n),s=y5(e),o=Math.floor(i.x/16),l=Math.floor(i.z/16),a=Math.floor(s.x/16),v=Math.floor(s.z/16);if(Math.abs(a-o)>t||Math.abs(v-l)>t)return!1;let c=Math.floor(i.y/r),u=Math.floor(s.y/r);return Math.abs(u-c)<=t}var ri=class{constructor(){d(this,"sections",new Map);d(this,"nodeByKey",new Map);d(this,"visibleKeys",new Set);d(this,"stepByKey",new Map);d(this,"needsFullUpdate",!0);d(this,"lastCameraKey","")}registerSection(e,t){this.sections.set(e,t),this.needsFullUpdate=!0}unregisterSection(e){this.sections.delete(e)&&(this.needsFullUpdate=!0),this.nodeByKey.delete(e),this.visibleKeys.delete(e),this.stepByKey.delete(e)}invalidate(){this.needsFullUpdate=!0}getVisibleKeys(){return this.visibleKeys}getStep(e){return this.stepByKey.get(e)}isVisible(e){return this.visibleKeys.has(e)}update(e){let t=i0(Math.floor(e.cameraWorldX/16)*16,Math.floor(e.cameraWorldY/e.sectionHeight)*e.sectionHeight,Math.floor(e.cameraWorldZ/16)*16);if(t!==this.lastCameraKey&&(this.needsFullUpdate=!0,this.lastCameraKey=t),!e.smartCull){this.visibleKeys=new Set(this.sections.keys()),this.stepByKey.clear();for(let r of this.visibleKeys)this.stepByKey.set(r,0);return this.visibleKeys}return this.needsFullUpdate&&(this.runFullUpdate(t,e),this.needsFullUpdate=!1),this.visibleKeys}runFullUpdate(e,t){this.nodeByKey.clear(),this.visibleKeys=new Set,this.stepByKey.clear();let r=[];for(this.initializeQueueForFullUpdate(e,r,t);r.length>0;){let i=r.shift(),s=i.sectionKey;if(!this.sections.has(s))continue;this.visibleKeys.add(s),this.stepByKey.set(s,i.step);let o=this.sections.get(s)?.visibilitySet??ti;for(let l of g5){let a=xu(s,l,t.sectionHeight);if(!this.sections.has(a)||!Rl(e,a,t.viewDistance,t.sectionHeight)||i.hasDirection(ms(l)))continue;if(i.hasSourceDirections()){let c=!1;for(let u=0;u<g5.length;u++)if(i.hasSourceDirection(u)&&El(o,ms(g5[u]),l)){c=!0;break}if(!c)continue}let v=this.nodeByKey.get(a);if(v)v.addSourceDirection(l);else{let c=new b5(a,l,i.step+1);c.setDirections(i.directions,l),this.nodeByKey.set(a,c),r.push(c)}}}}initializeQueueForFullUpdate(e,t,r){if(this.sections.has(e)){let m=new b5(e,null,0);this.nodeByKey.set(e,m),t.push(m);return}let i=y5(e),s=Math.floor(i.y/r.sectionHeight),o=Math.floor(r.worldMinY/r.sectionHeight),l=Math.floor((r.worldMaxY-1)/r.sectionHeight),a=s<o,c=(a?o:l)*r.sectionHeight,u=Math.floor(i.x/16),h=Math.floor(i.z/16),p=[];for(let m=-r.viewDistance;m<=r.viewDistance;m++)for(let b=-r.viewDistance;b<=r.viewDistance;b++){let k=i0((u+m)*16,c,(h+b)*16);if(!this.sections.has(k)||!Rl(e,k,r.viewDistance,r.sectionHeight))continue;let _=a?1:0,y=new b5(k,_,0);y.setDirections(0,_),m>0?y.setDirections(y.directions,5):m<0&&y.setDirections(y.directions,4),b>0?y.setDirections(y.directions,3):b<0&&y.setDirections(y.directions,2);let M=new xl(i.x+8,i.y+8,i.z+8),T=y5(k),S=M.distanceTo(new xl(T.x+8,T.y+8,T.z+8));p.push({node:y,distSq:S})}p.sort((m,b)=>m.distSq-b.distSq);for(let m of p)this.nodeByKey.set(m.node.sectionKey,m.node),t.push(m.node)}};var ni=class{constructor(){d(this,"graph",new ri);d(this,"registered",new Set);d(this,"lastVisible",new Set)}registerSection(e,t,r,i,s){this.registered.add(e),this.graph.registerSection(e,{visibilitySet:t??ti,worldX:r,worldY:i,worldZ:s})}unregisterSection(e){this.registered.delete(e),this.graph.unregisterSection(e)}invalidate(){this.graph.invalidate()}update(e){return this.lastVisible=this.graph.update(e),this.lastVisible}isSectionVisible(e){return this.registered.has(e)?this.lastVisible.has(e):!0}hasRegisteredSection(e){return this.registered.has(e)}getVisibleKeys(){return this.lastVisible}getStep(e){return this.graph.getStep(e)}getGraph(){return this.graph}};function kl(n){let t=n%50/50*6,r=.9,i=r*(1-Math.abs(t%2-1)),s=0,o=0,l=0;t<1?(s=r,o=i):t<2?(s=i,o=r):t<3?(o=r,l=i):t<4?(o=i,l=r):t<5?(s=i,l=r):(s=r,l=i);let a=.1,v=Math.round((s+a)*255),c=Math.round((o+a)*255),u=Math.round((l+a)*255);return v<<16|c<<8|u}var dt=class dt{constructor(e,t,r,i,s=3){this.worldRenderer=e;this.scene=t;this.material=r;this.worldHeight=i;d(this,"renderOrigin",{x:0,y:0,z:0});d(this,"meshPool",[]);d(this,"activeSections",new Map);d(this,"sectionObjects",{});d(this,"waitingChunksToDisplay",{});d(this,"pendingNearReveal",new Map);d(this,"nearRevealTimers",new Map);d(this,"nearRevealGraceTimers",new Map);d(this,"poolSize");d(this,"maxPoolSize");d(this,"minPoolSize");d(this,"signHeadsRenderer");d(this,"blockEntityLightRegistry",new $n);d(this,"chunkBoxMaterial",new X.MeshBasicMaterial({color:0,transparent:!0,opacity:0}));d(this,"cubeShaderMaterial",null);d(this,"legacyShaderMaterial",null);d(this,"globalLegacyShaderMaterial",null);d(this,"globalLegacyBlendShaderMaterial",null);d(this,"_legacyCullFrustum",new X.Frustum);d(this,"_legacyCullProjScreen",new X.Matrix4);d(this,"_legacyCullBox",new X.Box3);d(this,"_legacyCullBoxMin",new X.Vector3);d(this,"_legacyCullBoxMax",new X.Vector3);d(this,"_visibleSectionSpans",[]);d(this,"legacyCullSections",new Map);d(this,"_lastCullFingerprint","");d(this,"lastBufferStateKey","");d(this,"cullDirty",!0);d(this,"_lastCullCamPos",new X.Vector3);d(this,"_lastCullCamQuat",new X.Quaternion);d(this,"_cullViewQuat",new X.Quaternion);d(this,"_cullCamInitialized",!1);d(this,"_visibleBlendKeys",[]);d(this,"_lastBlendSortPos",new X.Vector3);d(this,"_lastBlendSortLayoutVersion",-1);d(this,"_blendSortPosInitialized",!1);d(this,"globalBlockBuffer",null);d(this,"globalLegacyBuffer",null);d(this,"globalLegacyBlendBuffer",null);d(this,"shaderSectionRaycastBoxes",new Map);d(this,"sectionOcclusionCull",new ni);d(this,"_lastOcclusionVisibleKeys","");d(this,"_lastSmartCullEnabled");d(this,"hits",0);d(this,"misses",0);d(this,"bypassPooling",!1);d(this,"renderTimes",[]);d(this,"maxRenderTimeSamples",30);d(this,"_performanceOverrideDistance");d(this,"lastPerformanceCheck",0);d(this,"performanceCheckInterval",2e3);this.updateViewDistance(s),this.signHeadsRenderer=new gs(e),this.initializePool()}get performanceOverrideDistance(){return this._performanceOverrideDistance??0}set performanceOverrideDistance(e){this._performanceOverrideDistance=e,this.updateSectionsVisibility()}initializePool(){for(let e=0;e<this.poolSize;e++){let t=new X.BufferGeometry,r=new X.Mesh(t,this.getLegacyShaderMaterial());r.visible=!1,r.matrixAutoUpdate=!1,r.name="pooled-section-mesh";let i={mesh:r,inUse:!1,lastUsedTime:0};this.meshPool.push(i)}}sectionHasRenderableContent(e){return e.positions.length>0||(e.blend?.positions.length??0)>0?!0:this.isShaderCubesGpuEnabled()?(e.shaderCubes?.count??0)>0:!1}isShaderCubesGpuEnabled(){return this.worldRenderer.shaderCubeBlocksEnabled()}syncCubeShaderUniforms(){if(!this.isShaderCubesGpuEnabled())return;let e=this.cubeShaderMaterial??this.getCubeShaderMaterial();if(!e)return;let t=this.material.map??null;e.uniforms.u_atlas.value=t;let r=jn();if(!r)return;let{tintPalette:i}=r;i.isReady()||i.createTexture(),e.uniforms.u_tintPalette.value=i.getTexture(),e.uniforms.u_debugMode.value=this.worldRenderer.worldRendererConfig.shaderCubeDebugMode??0,e.needsUpdate=!0}syncLegacyShaderUniforms(){let e=this.material.map??null;this.legacyShaderMaterial&&(this.legacyShaderMaterial.uniforms.u_atlas.value=e,this.legacyShaderMaterial.needsUpdate=!0),this.globalLegacyShaderMaterial&&(this.globalLegacyShaderMaterial.uniforms.u_atlas.value=e,this.globalLegacyShaderMaterial.needsUpdate=!0),this.globalLegacyBlendShaderMaterial&&(this.globalLegacyBlendShaderMaterial.uniforms.u_atlas.value=e,this.globalLegacyBlendShaderMaterial.needsUpdate=!0)}setSkyLevel(e){let t=this.cubeShaderMaterial??(this.isShaderCubesGpuEnabled()?this.getCubeShaderMaterial():null);t&&Un(t,e),this.legacyShaderMaterial&&Kn(this.legacyShaderMaterial,e),this.globalLegacyShaderMaterial&&Kn(this.globalLegacyShaderMaterial,e),this.globalLegacyBlendShaderMaterial&&Kn(this.globalLegacyBlendShaderMaterial,e),this.blockEntityLightRegistry.setSkyLevel(e)}setShadingTheme(e,t){let r=this.cubeShaderMaterial??(this.isShaderCubesGpuEnabled()?this.getCubeShaderMaterial():null);r&&rs(r,e,t)}setBlockLightmapParams(e){let t=this.cubeShaderMaterial??(this.isShaderCubesGpuEnabled()?this.getCubeShaderMaterial():null);t&&B7(t,e),this.legacyShaderMaterial&&qn(this.legacyShaderMaterial,e),this.globalLegacyShaderMaterial&&qn(this.globalLegacyShaderMaterial,e),this.globalLegacyBlendShaderMaterial&&qn(this.globalLegacyBlendShaderMaterial,e),this.blockEntityLightRegistry.setLightmapParams(e)}getLegacyShaderMaterial(){return this.legacyShaderMaterial||(this.legacyShaderMaterial=Y7(),this.syncLegacyShaderUniforms()),this.legacyShaderMaterial}getGlobalLegacyShaderMaterial(){return this.globalLegacyShaderMaterial||(this.globalLegacyShaderMaterial=Q7(),this.syncLegacyShaderUniforms()),this.globalLegacyShaderMaterial}getGlobalLegacyBuffer(){return this.globalLegacyBuffer||(this.globalLegacyBuffer=new f5(this.getGlobalLegacyShaderMaterial(),this.scene),this.globalLegacyBuffer.setRenderOrigin(this.renderOrigin)),this.globalLegacyBuffer}getGlobalLegacyBlendShaderMaterial(){return this.globalLegacyBlendShaderMaterial||(this.globalLegacyBlendShaderMaterial=K7(),this.syncLegacyShaderUniforms()),this.globalLegacyBlendShaderMaterial}getGlobalLegacyBlendBuffer(){return this.globalLegacyBlendBuffer||(this.globalLegacyBlendBuffer=new f5(this.getGlobalLegacyBlendShaderMaterial(),this.scene,{name:"globalLegacyBlend",initialCapacityQuads:32e3,growthIncrementQuads:32e3,sortBlend:!0}),this.globalLegacyBlendBuffer.setRenderOrigin(this.renderOrigin)),this.globalLegacyBlendBuffer}getRenderOrigin(){return this.renderOrigin}maybeRebase(e){let t=this.renderOrigin;if(Math.abs(e.x-t.x)<=dt.REBASE_THRESHOLD&&Math.abs(e.y-t.y)<=dt.REBASE_THRESHOLD&&Math.abs(e.z-t.z)<=dt.REBASE_THRESHOLD)return;let r={x:Math.round(e.x/16)*16,y:Math.round(e.y/16)*16,z:Math.round(e.z/16)*16},i={x:r.x-t.x,y:r.y-t.y,z:r.z-t.z};this.globalLegacyBuffer?.rebase(i),this.globalLegacyBlendBuffer?.rebase(i);for(let s of this.activeSections.values()){let o=s.sectionKey;if(!o)continue;let l=this.sectionObjects[o];l&&us(s.mesh,l.worldX??0,l.worldY??0,l.worldZ??0,r)}this.renderOrigin=r,this.globalLegacyBuffer?.setRenderOrigin(r),this.globalLegacyBlendBuffer?.setRenderOrigin(r)}sectionUsesPooledLegacyMesh(e){return this.activeSections.has(e)}registerLegacyCullSection(e,t,r,i){this.legacyCullSections.set(e,{worldX:t,worldY:r,worldZ:i})}maybeUnregisterLegacyCullSection(e){let t=this.globalLegacyBuffer?.hasSection(e)??!1,r=this.globalLegacyBlendBuffer?.hasSection(e)??!1;!t&&!r&&this.legacyCullSections.delete(e)}updatePooledLegacyCullState(e,t,r,i,s){for(let o of this.activeSections.values()){let l=o.sectionKey;if(!l)continue;let a=this.sectionObjects[l];a&&(q7(o.mesh,a.worldX??0,a.worldY??0,a.worldZ??0,e,t,r,this._legacyCullFrustum,this._legacyCullBox,this._legacyCullBoxMin,this._legacyCullBoxMax),i&&!s.has(l)&&(o.mesh.visible=!1))}}isSectionOcclusionVisible(e){return this.sectionOcclusionCull.isSectionVisible(e)}notifySmartCullChanged(e){this._lastSmartCullEnabled!==e&&(this._lastSmartCullEnabled=e,this.sectionOcclusionCull.invalidate(),this.markCullDirty())}updateSectionCullAndSort(e,t,r,i,s){this._legacyCullProjScreen.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._legacyCullFrustum.setFromProjectionMatrix(this._legacyCullProjScreen);let o=this.worldRenderer.getSectionHeight?.()??16,l=this.worldRenderer.worldSizeParams??{minY:0,worldHeight:256},a=this.sectionOcclusionCull.update({smartCull:s,cameraWorldX:t,cameraWorldY:r,cameraWorldZ:i,viewDistance:this.worldRenderer.viewDistance,sectionHeight:o,worldMinY:l.minY,worldMaxY:l.minY+l.worldHeight}),v=this._visibleSectionSpans;v.length=0;for(let[T]of this.legacyCullSections){let S=this.sectionObjects[T];if(!S?.visible||S.worldX===void 0)continue;let{visible:B,distSq:P}=Jn(S.worldX,S.worldY??0,S.worldZ??0,t,r,i,this._legacyCullFrustum,this._legacyCullBox,this._legacyCullBoxMin,this._legacyCullBoxMax);B&&v.push({key:T,distSq:P})}if(s)for(let T=v.length-1;T>=0;T--)a.has(v[T].key)||v.splice(T,1);let c=this.globalLegacyBuffer,u=this.globalLegacyBlendBuffer,h=this.globalBlockBuffer,p=[];for(let T of v)c?.hasSection(T.key)&&p.push(T.key);p.sort();let m=v.filter(T=>u?.hasSection(T.key));m.sort((T,S)=>S.distSq-T.distSq);let b=m.map(T=>T.key);this._visibleBlendKeys=b;let k=[],_=[];h&&h.forEachSectionSlot((T,S)=>{if(!this.sectionObjects[T]?.visible)return;let P=this.shaderSectionRaycastBoxes.get(T);if(!P)return;let{visible:H}=Jn(P.sectionCenterX,P.sectionCenterY,P.sectionCenterZ,t,r,i,this._legacyCullFrustum,this._legacyCullBox,this._legacyCullBoxMin,this._legacyCullBoxMax);if(!H||s&&!a.has(T))return;k.push(T);let V=h.getSectionDrawStart(T),z=h.getSectionDrawCount(T);V!==void 0&&z!==void 0&&_.push({start:V,count:z})}),k.sort();let y=s?[...a].sort().join(","):"off",M=[p.join(","),b.join(","),k.join(","),y,s?"1":"0",c?.getLayoutVersion()??0,u?.getLayoutVersion()??0,h?.getLayoutVersion()??0,c?.getUploadEpoch()??0,u?.getUploadEpoch()??0,h?.getUploadEpoch()??0].join("|");if(M===this._lastCullFingerprint&&!this.hasPendingBufferWork()){this.updatePooledLegacyCullState(t,r,i,s,a),this._lastOcclusionVisibleKeys=y;return}if(this._lastCullFingerprint=M,this._lastOcclusionVisibleKeys=y,c?.updateDrawSpans(v,"opaque"),u?.updateDrawSpans(v,"sortedBlend"),h){let T=rl(_,h.getHighWatermark(),h.canUseFullDrawShortcut(),(S,B)=>h.isRangeFullyUploaded(S,B),h.getPendingDirtyRanges());h.setVisibleSpans(T)}this.lastBufferStateKey=this.bufferStateKey(),this.updatePooledLegacyCullState(t,r,i,s,a)}sortVisibleBlendSections(e,t,r){let i=this.globalLegacyBlendBuffer;if(!i||this._visibleBlendKeys.length===0)return;let s=i.getLayoutVersion(),o=s!==this._lastBlendSortLayoutVersion;if(this._blendSortPosInitialized&&!o){let l=e-this._lastBlendSortPos.x,a=t-this._lastBlendSortPos.y,v=r-this._lastBlendSortPos.z;if(l*l+a*a+v*v<dt.BLEND_RESORT_DISTANCE*dt.BLEND_RESORT_DISTANCE)return}for(let l of this._visibleBlendKeys)i.reorderSectionBlendIndices(l,e,t,r);this._lastBlendSortPos.set(e,t,r),this._blendSortPosInitialized=!0,this._lastBlendSortLayoutVersion=s}bufferStateKey(){let e=this.globalBlockBuffer,t=this.globalLegacyBuffer,r=this.globalLegacyBlendBuffer;return[t?.getLayoutVersion()??0,t?.getUploadEpoch()??0,r?.getLayoutVersion()??0,r?.getUploadEpoch()??0,e?.getLayoutVersion()??0,e?.getUploadEpoch()??0].join("|")}markCullDirtyIfBufferStateChanged(){this.bufferStateKey()!==this.lastBufferStateKey&&this.markCullDirty()}markCullDirty(){this.cullDirty=!0}hasPendingBufferWork(){return[this.globalLegacyBuffer,this.globalLegacyBlendBuffer,this.globalBlockBuffer].some(t=>t!=null&&(t.hasPendingUploads()||t.hasPendingReplace()||t.getPendingMove()!=null))}updateCullDirtyFromCamera(e,t,r,i){if(e.getWorldQuaternion(this._cullViewQuat),!this._cullCamInitialized){this._lastCullCamPos.set(t,r,i),this._lastCullCamQuat.copy(this._cullViewQuat),this._cullCamInitialized=!0,this.cullDirty=!0;return}let s=this._lastCullCamPos.x!==t||this._lastCullCamPos.y!==r||this._lastCullCamPos.z!==i,o=this._lastCullCamQuat.x!==this._cullViewQuat.x||this._lastCullCamQuat.y!==this._cullViewQuat.y||this._lastCullCamQuat.z!==this._cullViewQuat.z||this._lastCullCamQuat.w!==this._cullViewQuat.w;(s||o)&&(this._lastCullCamPos.set(t,r,i),this._lastCullCamQuat.copy(this._cullViewQuat),this.markCullDirty())}clearCullDirty(){this.cullDirty=!1}setLegacyCameraOrigin(e,t,r){let i=this.renderOrigin;Qn(this.getLegacyShaderMaterial(),i,e,t,r),Qn(this.getGlobalLegacyShaderMaterial(),i,e,t,r),Qn(this.getGlobalLegacyBlendShaderMaterial(),i,e,t,r),this.globalLegacyBuffer?.setCameraOrigin(e,t,r),this.globalLegacyBlendBuffer?.setCameraOrigin(e,t,r);let s=this.cubeShaderMaterial;if(s){let{originDelta:o,cameraOriginFrac:l}=F0(i,e,t,r),a=Vn(i),v=s.uniforms.u_originDelta;v?.value?.set&&v.value.set(o.x,o.y,o.z);let c=s.uniforms.u_cameraOriginFrac;c?.value?.set&&c.value.set(l.x,l.y,l.z);let u=s.uniforms.u_sectionOriginRel;u?.value?.set&&u.value.set(a.x,a.y,a.z)}}getCubeShaderMaterial(){if(!this.isShaderCubesGpuEnabled())return null;if(!this.cubeShaderMaterial){this.cubeShaderMaterial=zn(),this.syncCubeShaderUniforms();let e=this.worldRenderer.worldRendererConfig;rs(this.cubeShaderMaterial,e.shadingTheme,e.cardinalLight)}return this.cubeShaderMaterial}getGlobalBlockBuffer(){let e=this.getCubeShaderMaterial();return e?(this.globalBlockBuffer||(this.globalBlockBuffer=new Zn(e,this.scene)),this.globalBlockBuffer):null}shouldDeferLegacyOpaqueToPerSection(e){return this.shouldDeferShaderToPerSection(e)}shouldDeferShaderToPerSection(e){return this.worldRenderer.getModule("futuristicReveal")?.shouldDeferSectionGeometry?.(e)===!0}migrateDeferredShaderToGlobal(e){let t=this.sectionObjects[e];if(!t?.deferredShaderCubes)return;let{words:r,count:i}=t.deferredShaderCubes,s=t.worldX,o=t.worldY,l=t.worldZ;s!==void 0&&o!==void 0&&l!==void 0&&this.registerShaderSectionRaycastBox(e,r,i,s,o,l),this.getGlobalBlockBuffer()?.addSection(e,r,i),this.markCullDirty();let v=t.mesh===t.shaderMesh;t.shaderMesh&&(os(t.shaderMesh),t.remove(t.shaderMesh),t.shaderMesh=void 0),delete t.deferredShaderCubes,v&&(t.mesh=void 0)}migrateDeferredLegacyToGlobal(e){let t=this.sectionObjects[e];if(t){if(t.deferredLegacyOpaque){let{positions:r,colors:i,skyLights:s,blockLights:o,uvs:l,indices:a}=t.deferredLegacyOpaque,v=t.worldX,c=t.worldY,u=t.worldZ;v!==void 0&&c!==void 0&&u!==void 0&&this.getGlobalLegacyBuffer().addSection(e,{positions:r,colors:i,skyLights:s,blockLights:o,uvs:l,indices:a},v,c,u)&&this.registerLegacyCullSection(e,v,c,u),delete t.deferredLegacyOpaque}if(t.deferredLegacyBlend){let{positions:r,colors:i,skyLights:s,blockLights:o,uvs:l,indices:a}=t.deferredLegacyBlend,v=t.worldX,c=t.worldY,u=t.worldZ;v!==void 0&&c!==void 0&&u!==void 0&&this.getGlobalLegacyBlendBuffer().addSection(e,{positions:r,colors:i,skyLights:s,blockLights:o,uvs:l,indices:a},v,c,u)&&this.registerLegacyCullSection(e,v,c,u),delete t.deferredLegacyBlend,t.hasBlendMesh=!1}if(!t.hasBlendMesh){let r=t.mesh===this.activeSections.get(e)?.mesh;this.releasePooledMesh(e),r&&(t.mesh=t.shaderMesh??void 0)}this.markCullDirty()}}registerShaderSectionRaycastBox(e,t,r,i,s,o){let l=cl(t,r,i,s,o);l?this.shaderSectionRaycastBoxes.set(e,{box:l,sectionCenterX:i,sectionCenterY:s,sectionCenterZ:o}):this.shaderSectionRaycastBoxes.delete(e)}unregisterShaderSectionRaycastBox(e){this.shaderSectionRaycastBoxes.delete(e)}uploadLegacyPooledMesh(e,t,r,i,s){let{mesh:o}=e,l=t;return this.updateGeometryAttribute(o.geometry,"position",l.positions,3),this.updateGeometryAttribute(o.geometry,"normal",l.normals,3),this.updateGeometryAttribute(o.geometry,"color",l.colors,3),this.updateGeometryAttribute(o.geometry,"a_skyLight",l.skyLights,1),this.updateGeometryAttribute(o.geometry,"a_blockLight",l.blockLights,1),this.updateGeometryAttribute(o.geometry,"uv",l.uvs,2),o.geometry.index=new X.BufferAttribute(l.indices,1),o.geometry.boundingBox=new X.Box3(new X.Vector3(-8,-8,-8),new X.Vector3(8,8,8)),o.geometry.boundingSphere=new X.Sphere(new X.Vector3(0,0,0),Math.sqrt(3*8**2)),us(o,r,i,s,this.renderOrigin),o.visible=!1,o.name="mesh",e.lastUsedTime=performance.now(),o}acquirePooledSectionMesh(e){let t=this.activeSections.get(e);if(!t){if(t=this.acquireMesh(),!t)return null;this.activeSections.set(e,t),t.sectionKey=e}return t}updateSection(e,t){let r=t.positions.length>0,i=(t.blend?.positions.length??0)>0,s=r||i,o=t.shaderCubes,l=this.isShaderCubesGpuEnabled()&&(o?.count??0)>0,a=r&&this.shouldDeferLegacyOpaqueToPerSection(e),v=i&&this.shouldDeferLegacyOpaqueToPerSection(e),c=l&&this.shouldDeferShaderToPerSection(e),u=r&&!a,h=i&&!v,p=l&&!!o&&!c;if(!s&&!l)return this.releaseSection(e),null;let m=this.sectionObjects[e],b=m!=null;m&&this.cleanupSection(e,{forRemesh:!0}),b&&(p||this.globalBlockBuffer?.removeSection(e),u||this.globalLegacyBuffer?.removeSection(e),h||this.globalLegacyBlendBuffer?.removeSection(e),l&&o||this.unregisterShaderSectionRaycastBox(e),!u&&!h&&this.maybeUnregisterLegacyCullSection(e)),i||this.releasePooledMesh(e);let k,_,y,M=!1;if(r){let N={positions:t.positions,colors:t.colors,skyLights:t.skyLights,blockLights:t.blockLights,uvs:t.uvs,indices:t.indices};if(a){if(_={positions:new Float32Array(N.positions),colors:new Float32Array(N.colors),skyLights:new Float32Array(N.skyLights),blockLights:new Float32Array(N.blockLights),uvs:new Float32Array(N.uvs),indices:N.indices instanceof Uint32Array?new Uint32Array(N.indices):new Uint16Array(N.indices)},!i){let Y=this.acquirePooledSectionMesh(e);if(!Y)return null;k=this.uploadLegacyPooledMesh(Y,t,t.sx,t.sy,t.sz)}}else if(this.getGlobalLegacyBuffer().addSection(e,N,t.sx,t.sy,t.sz))this.registerLegacyCullSection(e,t.sx,t.sy,t.sz);else{let q=this.acquirePooledSectionMesh(e);if(!q)return null;k=this.uploadLegacyPooledMesh(q,t,t.sx,t.sy,t.sz)}}if(i&&t.blend){let N={positions:t.blend.positions,colors:t.blend.colors,skyLights:t.blend.skyLights,blockLights:t.blend.blockLights,uvs:t.blend.uvs,indices:t.blend.indices};if(v){y={positions:new Float32Array(N.positions),colors:new Float32Array(N.colors),skyLights:new Float32Array(N.skyLights),blockLights:new Float32Array(N.blockLights),uvs:new Float32Array(N.uvs),indices:N.indices instanceof Uint32Array?new Uint32Array(N.indices):new Uint16Array(N.indices)};let Y=this.acquirePooledSectionMesh(e);if(!Y)return null;let q=this.uploadLegacyPooledMesh(Y,t.blend,t.sx,t.sy,t.sz);k=k??q,M=!0}else if(this.getGlobalLegacyBlendBuffer().addSection(e,N,t.sx,t.sy,t.sz))this.registerLegacyCullSection(e,t.sx,t.sy,t.sz);else{let q=this.acquirePooledSectionMesh(e);if(!q)return null;let J=this.uploadLegacyPooledMesh(q,t.blend,t.sx,t.sy,t.sz);k=k??J,M=!0}}let T=l?this.getCubeShaderMaterial():null,S;l&&o&&(c&&T?(S=Yn(o,T),S.visible=!0):this.getGlobalBlockBuffer()?.addSection(e,o.words,o.count)),m=new X.Group,k&&(m.add(k),m.mesh=k),S&&(m.add(S),m.shaderMesh=S,o&&(m.deferredShaderCubes={words:o.words,count:o.count}),m.mesh||(m.mesh=S)),_&&(m.deferredLegacyOpaque=_),y&&(m.deferredLegacyBlend=y),l&&o&&this.registerShaderSectionRaycastBox(e,o.words,o.count,t.sx,t.sy,t.sz);let B=0;r&&(B+=t.positions.length/3/4),i&&t.blend&&(B+=t.blend.positions.length/3/4),l&&o&&(B+=o.count),m.tilesCount=B,m.hasBlendMesh=M,m.blocksCount=t.blocksCount,m.worldX=t.sx,m.worldY=t.sy,m.worldZ=t.sz,m.visibilitySet=t.visibilitySet,this.sectionOcclusionCull.registerSection(e,t.visibilitySet,t.sx,t.sy,t.sz),m.sectionKey=e,m.name="chunk";try{if(Object.keys(t.signs).length>0){let N=new X.Group;N.name="signs";for(let[Y,{isWall:q,isHanging:J,rotation:te}]of Object.entries(t.signs)){let se=this.worldRenderer.blockEntities[Y];if(!se)continue;let[he,fe,pe]=Y.split(","),oe=this.signHeadsRenderer.renderSign(new ps(+he,+fe,+pe),te,q,J,ii.simplify(se));oe&&N.add(oe)}m.add(N),m.signsContainer=N}if(Object.keys(t.heads).length>0){let N=new X.Group;N.name="heads";for(let[Y,{isWall:q,rotation:J}]of Object.entries(t.heads)){let te=this.worldRenderer.blockEntities[Y];if(!te)continue;let[se,he,fe]=Y.split(","),pe=this.signHeadsRenderer.renderHead(new ps(+se,+he,+fe),J,q,ii.simplify(te));pe&&N.add(pe)}m.add(N),m.headsContainer=N}if(Object.keys(t.banners).length>0){let N=new X.Group;N.name="banners",m.bannersContainer=N,m.add(N);for(let[Y,q]of Object.entries(t.banners)){let{isWall:J,rotation:te,blockName:se,blockLightNorm:he=0,skyLightNorm:fe=1}=q,pe=this.worldRenderer.blockEntities[Y];if(!pe)continue;let[oe,Q,ce]=Y.split(","),be=gl(this.worldRenderer,se,ii.simplify(pe));if(!be)continue;let qe=this.blockEntityLightRegistry.getSkyLevel(),Re=yl(new ps(+oe,+Q,+ce),te,J,be,he,fe,qe);Re.bannerMaterial&&this.blockEntityLightRegistry.register({material:Re.bannerMaterial,blockLightNorm:he,skyLightNorm:fe});let{x:at,y:ye,z:ut}=Re.position;this.worldRenderer.sceneOrigin.track(Re),Re.position.set(at,ye,ut),N.add(Re)}}}catch{}this.sectionObjects[e]=m,this.scene.add(m),m.matrixAutoUpdate=!1,this.worldRenderer.displayOptions?.inWorldRenderingConfig?.showChunkBorders&&this.updateBoxHelper(e,!0);let P=e.split(","),H=`${P[0]},${P[2]}`,V=!!this.worldRenderer.displayOptions?.inWorldRenderingConfig?._renderByChunks,z=!!this.worldRenderer.worldRendererConfig?.wasmMesher;if((V||z)&&!this.worldRenderer.finishedChunks[H]){m.visible=!1,m._waitingForChunkDisplay=!0;let N=this.waitingChunksToDisplay[H]??(this.waitingChunksToDisplay[H]=[]);N.includes(e)||N.push(e)}return this.markCullDirty(),m}finishChunkDisplay(e){if(!this.waitingChunksToDisplay[e]){this.tryRevealPending();return}if(this.isWasmGateActive()&&this.isBlockedByNearer(e,0)){this.pendingNearReveal.set(e,Date.now()),this.armNearRevealTimer(e),this.armExpectedGraceTimer(e),this.tryRevealPending();return}this.flushChunkDisplay(e),this.tryRevealPending()}flushChunkDisplay(e){let t=this.waitingChunksToDisplay[e];if(this.pendingNearReveal.delete(e),this.clearNearRevealTimer(e),this.clearExpectedGraceTimer(e),!!t){for(let r of t){let i=this.sectionObjects[r];i&&(i._waitingForChunkDisplay=!1,i.visible=!0)}delete this.waitingChunksToDisplay[e],this.markCullDirty()}}tryRevealPending(){if(this.pendingNearReveal.size===0)return;let e=Date.now();for(let[t,r]of[...this.pendingNearReveal])this.isBlockedByNearer(t,e-r)||this.flushChunkDisplay(t)}onChunkRemovedFromGate(e){this.pendingNearReveal.delete(e),this.clearNearRevealTimer(e),this.clearExpectedGraceTimer(e),delete this.waitingChunksToDisplay[e],this.tryRevealPending()}isWasmGateActive(){return!!this.worldRenderer.worldRendererConfig?.wasmMesher}isBlockedByNearer(e,t){let r=this.worldRenderer.viewerChunkPosition;if(!r)return!1;let i=e.split(",");if(i.length!==2)return!1;let s=Number(i[0]),o=Number(i[1]),l=Math.floor(r.x/16),a=Math.floor(r.z/16),v=(s>>4)-l,c=(o>>4)-a,u=v*v+c*c;if(u===0)return!1;let h=this.worldRenderer.finishedChunks,p=this.worldRenderer.loadedChunks,m=this.worldRenderer.viewDistance;if(t<dt.EXPECTED_NEAR_GRACE_MS&&m>0){let k=m*m,_=Math.min(m,Math.ceil(Math.sqrt(Math.max(0,u-1))));for(let y=-_;y<=_;y++)for(let M=-_;M<=_;M++){let T=y*y+M*M;if(T>=u||T>k)continue;let S=l+y<<4,B=a+M<<4,P=`${S},${B}`;if(P!==e&&p[P]&&!h[P])return!0}return!1}for(let k in p){if(k===e||h[k])continue;let _=k.split(",");if(_.length!==2)continue;let y=(Number(_[0])>>4)-l,M=(Number(_[1])>>4)-a;if(y*y+M*M<u)return!0}return!1}armNearRevealTimer(e){if(this.nearRevealTimers.has(e))return;let t=setTimeout(()=>{this.nearRevealTimers.delete(e),this.pendingNearReveal.has(e)&&(this.flushChunkDisplay(e),this.tryRevealPending())},dt.NEAR_REVEAL_TIMEOUT_MS);this.nearRevealTimers.set(e,t)}clearNearRevealTimer(e){let t=this.nearRevealTimers.get(e);t&&(clearTimeout(t),this.nearRevealTimers.delete(e))}armExpectedGraceTimer(e){if(this.nearRevealGraceTimers.has(e))return;let t=setTimeout(()=>{this.nearRevealGraceTimers.delete(e),this.pendingNearReveal.has(e)&&this.tryRevealPending()},dt.EXPECTED_NEAR_GRACE_MS+50);this.nearRevealGraceTimers.set(e,t)}clearExpectedGraceTimer(e){let t=this.nearRevealGraceTimers.get(e);t&&(clearTimeout(t),this.nearRevealGraceTimers.delete(e))}cleanupSection(e,t){let r=this.sectionObjects[e];if(r){if(r._waitingForChunkDisplay){let i=e.split(","),s=`${i[0]},${i[2]}`,o=this.waitingChunksToDisplay[s];if(o){let l=o.indexOf(e);l!==-1&&o.splice(l,1),o.length===0&&delete this.waitingChunksToDisplay[s]}}if(r.bannersContainer){for(let i of r.bannersContainer.children){let s=i;s.bannerMaterial&&this.blockEntityLightRegistry.unregister(s.bannerMaterial),s.bannerTexture&&bl(s.bannerTexture)}this.disposeContainer(r.bannersContainer)}if(t?.forRemesh||(this.globalBlockBuffer?.removeSection(e),this.globalLegacyBuffer?.removeSection(e),this.globalLegacyBlendBuffer?.removeSection(e),this.maybeUnregisterLegacyCullSection(e),this.unregisterShaderSectionRaycastBox(e),this.sectionOcclusionCull.unregisterSection(e)),this.markCullDirty(),delete r.deferredLegacyOpaque,delete r.deferredLegacyBlend,r.shaderMesh&&(os(r.shaderMesh),r.shaderMesh=void 0),delete r.deferredShaderCubes,r.signsContainer){for(let i of r.signsContainer.children){let s=i;s.signTexture&&wl(s.signTexture)}this.disposeContainer(r.signsContainer,!1)}if(r.headsContainer&&this.disposeContainer(r.headsContainer),this.worldRenderer.sceneOrigin.removeAndUntrackAll(r),this.scene.remove(r),r.boxHelper){this.worldRenderer.sceneOrigin.removeAndUntrack(r.boxHelper),this.scene.remove(r.boxHelper),r.boxHelper.geometry.dispose();let i=r.boxHelper.material;if(Array.isArray(i))for(let s of i)s.dispose();else i.dispose();r.boxHelper=void 0}delete this.sectionObjects[e],t?.forRemesh||this.worldRenderer.getModule("futuristicReveal")?.onSectionRemoved?.(e)}}releasePooledMesh(e){let t=this.activeSections.get(e);t&&(t.mesh.visible=!1,t.inUse=!1,t.sectionKey=void 0,t.lastUsedTime=0,this.clearGeometry(t.mesh.geometry),this.activeSections.delete(e),this.cleanupExcessMeshes())}releaseSection(e){this.cleanupSection(e);let t=this.activeSections.get(e);return t?(t.mesh.visible=!1,t.inUse=!1,t.sectionKey=void 0,t.lastUsedTime=0,this.clearGeometry(t.mesh.geometry),this.activeSections.delete(e),this.cleanupExcessMeshes(),!0):!1}getSectionObject(e){return this.sectionObjects[e]}updateBoxHelper(e,t,r=this.chunkBoxMaterial){let i=this.sectionObjects[e];if(i)if(t){if(!i.boxHelper){let s=new X.Mesh(new X.BoxGeometry(16,16,16),r),o=new X.BoxHelper(s,16776960);o.name="helper";let l=i.worldX??0,a=i.worldY??0,v=i.worldZ??0;this.worldRenderer.sceneOrigin.track(o,{updateMatrix:!0}),o.position.set(l,a,v),o.updateMatrix(),this.scene.add(o),i.boxHelper=o}i.boxHelper.visible=!0}else i.boxHelper&&(i.boxHelper.visible=!1)}updateAllBoxHelpers(e){for(let t of Object.keys(this.sectionObjects))this.updateBoxHelper(t,e)}updateCaveCullingDebug(e,t){if(!e){for(let r of Object.keys(this.sectionObjects)){let i=this.sectionObjects[r];i?.boxHelper&&!this.worldRenderer.displayOptions?.inWorldRenderingConfig?.showChunkBorders&&(i.boxHelper.visible=!1)}return}for(let[r,i]of Object.entries(this.sectionObjects)){if(!i)continue;i.boxHelper||this.updateBoxHelper(r,!0);let s=i.boxHelper;if(!s)continue;s.visible=!0;let o=t?this.sectionOcclusionCull.isSectionVisible(r)?kl(this.sectionOcclusionCull.getStep(r)??0):16711680:65280;s.material.color.setHex(o)}}getSectionMesh(e){return this.activeSections.get(e)?.mesh}hasSection(e){return this.activeSections.has(e)}updateViewDistance(e){let t=(e*2+1)**2,r=this.worldHeight/16,i=5;if(this.minPoolSize=Math.floor(t*i),this.maxPoolSize=Math.floor(t*r)+1,this.poolSize??(this.poolSize=this.minPoolSize),this.minPoolSize>this.poolSize){let s=Math.min(this.minPoolSize,this.maxPoolSize);this.expandPool(s)}}getGlobalBufferStats(){let e=r=>r?{used:r.getHighWatermark(),capacity:r.getCapacityQuads(),sections:r.getSectionCount(),usedBytes:r.getUsedMemoryBytes(),capacityBytes:r.getMemoryBytes()}:null,t=this.globalBlockBuffer;return{shaderFaces:t?{used:t.getHighWatermark(),capacity:t.getCapacityFaces(),sections:t.getSectionCount(),usedBytes:t.getUsedMemoryBytes(),capacityBytes:t.getMemoryBytes()}:null,legacyOpaque:e(this.globalLegacyBuffer),legacyBlend:e(this.globalLegacyBlendBuffer)}}getDrawnStats(){return{cubeFaces:this.globalBlockBuffer?.getVisibleFaceCount()??0,legacyOpaqueQuads:this.globalLegacyBuffer?.getVisibleQuadCount()??0,legacyBlendQuads:this.globalLegacyBlendBuffer?.getVisibleQuadCount()??0}}getStats(){let e=this.meshPool.filter(i=>!i.inUse).length,t=this.hits+this.misses>0?(this.hits/(this.hits+this.misses)*100).toFixed(1):"0",r=this.getEstimatedMemoryUsage();return{poolSize:this.poolSize,activeCount:this.activeSections.size,freeCount:e,hitRate:`${t}%`,hits:this.hits,misses:this.misses,memoryUsage:r}}getTotalTiles(){return Object.values(this.sectionObjects).reduce((e,t)=>e+(t.tilesCount||0),0)}getTotalBlocks(){return Object.values(this.sectionObjects).reduce((e,t)=>e+(t.blocksCount||0),0)}getEstimatedMemoryUsage(){let e=0,t=0,r=0,i=0,s=0,o=0,l=0,a=this.globalBlockBuffer?.mesh.geometry;if(a)for(let h of["a_w0","a_w1","a_w2","a_w3"]){let p=a.getAttribute(h);if(p){let m=p.array.byteLength;l+=m,e+=m}}let v=this.globalLegacyBuffer?.getMemoryBytes()??0,c=this.globalLegacyBlendBuffer?.getMemoryBytes()??0;e+=v+c,t+=v+c;for(let h of Object.values(this.sectionObjects)){let p=h.shaderMesh?.geometry;if(p)for(let m of["a_w0","a_w1","a_w2","a_w3"]){let b=p.getAttribute(m);if(b){let k=b.array.byteLength;l+=k,e+=k}}}for(let h of this.meshPool)if(h.inUse&&h.mesh.geometry){let{geometry:p}=h.mesh,m=p.getAttribute("position");if(m){let y=m.array.byteLength;t+=y,e+=y}let b=p.getAttribute("normal");if(b){let y=b.array.byteLength;r+=y,e+=y}let k=p.getAttribute("color");if(k){let y=k.array.byteLength;i+=y,e+=y}let _=p.getAttribute("uv");if(_){let y=_.array.byteLength;s+=y,e+=y}if(p.index){let y=p.index.array.byteLength;o+=y,e+=y}}return{total:`${(e/(1024*1024)).toFixed(2)} MB`,breakdown:{position:`${(t/(1024*1024)).toFixed(2)} MB`,normal:`${(r/(1024*1024)).toFixed(2)} MB`,color:`${(i/(1024*1024)).toFixed(2)} MB`,uv:`${(s/(1024*1024)).toFixed(2)} MB`,index:`${(o/(1024*1024)).toFixed(2)} MB`,shaderInstances:`${(l/(1024*1024)).toFixed(2)} MB`}}}dispose(){let e=[...this.activeSections.keys()];for(let t of e)this.releaseSection(t);this.signHeadsRenderer.dispose();for(let t of this.meshPool)t.mesh.geometry.dispose();this.meshPool.length=0,this.activeSections.clear(),this.chunkBoxMaterial.dispose(),this.shaderSectionRaycastBoxes.clear(),this.lastBufferStateKey="",this.globalBlockBuffer?.dispose(),this.globalBlockBuffer=null,this.globalLegacyBuffer?.dispose(),this.globalLegacyBuffer=null,this.globalLegacyBlendBuffer?.dispose(),this.globalLegacyBlendBuffer=null,this.cubeShaderMaterial?.dispose(),this.cubeShaderMaterial=null,this.legacyShaderMaterial?.dispose(),this.legacyShaderMaterial=null,this.globalLegacyShaderMaterial?.dispose(),this.globalLegacyShaderMaterial=null,this.globalLegacyBlendShaderMaterial?.dispose(),this.globalLegacyBlendShaderMaterial=null,this.pendingNearReveal.clear();for(let t of this.nearRevealTimers.values())clearTimeout(t);this.nearRevealTimers.clear();for(let t of this.nearRevealGraceTimers.values())clearTimeout(t);this.nearRevealGraceTimers.clear()}acquireMesh(){if(this.bypassPooling){let t={mesh:new X.Mesh(new X.BufferGeometry,this.getLegacyShaderMaterial()),inUse:!0,lastUsedTime:performance.now()};return this.meshPool.push(t),this.poolSize++,t}for(let t of this.meshPool)if(!t.inUse)return t.inUse=!0,t.lastUsedTime=performance.now(),this.hits++,t;this.misses++;let e=Math.min(this.poolSize+16,this.maxPoolSize);e<=this.meshPool.length&&(e=this.meshPool.length+8,this.maxPoolSize=e),this.expandPool(e);for(let t=this.meshPool.length-1;t>=0;t--){let r=this.meshPool[t];if(!r.inUse)return r.inUse=!0,r.lastUsedTime=performance.now(),r}throw new Error("ChunkMeshManager: Failed to acquire mesh after pool expansion")}expandPool(e){let t=this.meshPool.length;this.poolSize=e;for(let r=t;r<e;r++){let i=new X.BufferGeometry,s=new X.Mesh(i,this.getLegacyShaderMaterial());s.visible=!1,s.matrixAutoUpdate=!1,s.name="pooled-section-mesh";let o={mesh:s,inUse:!1,lastUsedTime:0};this.meshPool.push(o)}}updateGeometryAttribute(e,t,r,i){let s=e.getAttribute(t);s&&s.count===r.length/i?(s.array.set(r),s.needsUpdate=!0):e.setAttribute(t,new X.BufferAttribute(r,i))}clearGeometry(e){let t=["position","normal","color","a_skyLight","a_blockLight","uv"];for(let r of t)e.hasAttribute(r)&&e.deleteAttribute(r);e.index&&e.setIndex(null),e.boundingBox=null,e.boundingSphere=null}cleanupExcessMeshes(){if(this.poolSize>this.maxPoolSize){let e=this.meshPool.filter(t=>!t.inUse).length;if(e>0){let t=Math.min(this.poolSize-this.maxPoolSize,e);for(let r=0;r<t;r++){let i=this.meshPool.findIndex(s=>!s.inUse);i!==-1&&(this.meshPool[i].mesh.geometry.dispose(),this.meshPool.splice(i,1),this.poolSize--)}}}}disposeContainer(e,t=!0){Me(e,t)}recordRenderTime(e){this.renderTimes.push(e),this.renderTimes.length>this.maxRenderTimeSamples&&this.renderTimes.shift();let t=performance.now();t-this.lastPerformanceCheck>this.performanceCheckInterval&&(this.checkPerformance(),this.lastPerformanceCheck=t)}getEffectiveRenderDistance(){return this.performanceOverrideDistance||this.worldRenderer.viewDistance}resetPerformanceOverride(){this.performanceOverrideDistance=void 0,this.renderTimes.length=0}getAverageRenderTime(){return this.renderTimes.length===0?0:this.renderTimes.reduce((e,t)=>e+t,0)/this.renderTimes.length}checkPerformance(){if(this.renderTimes.length<this.maxRenderTimeSamples)return;let e=this.getAverageRenderTime(),t=16.67,r=t*1.5;if(e>r){let i=this.worldRenderer.viewDistance,s=Math.max(1,Math.floor(i*.8));(!this.performanceOverrideDistance||s<this.performanceOverrideDistance)&&(this.performanceOverrideDistance=s)}else if(this.performanceOverrideDistance&&e<t*1.1){let i=this.worldRenderer.viewDistance,s=Math.min(i,this.performanceOverrideDistance+1);s!==this.performanceOverrideDistance&&(this.performanceOverrideDistance=s>=i?void 0:s)}}updateSectionsVisibility(){let e=this.worldRenderer.cameraSectionPos;for(let[t,r]of Object.entries(this.sectionObjects)){if(r._waitingForChunkDisplay){r.visible=!1;continue}if(!this.performanceOverrideDistance){r.visible=!0;continue}let[i,s,o]=t.split(",").map(Number),l={x:i/16,y:s/16,z:o/16},a=l.x-e.x,v=l.z-e.z,c=Math.floor(Math.hypot(a,v));r.visible=c<=this.performanceOverrideDistance}}};d(dt,"REBASE_THRESHOLD",65536),d(dt,"NEAR_REVEAL_TIMEOUT_MS",5e3),d(dt,"EXPECTED_NEAR_GRACE_MS",1500),d(dt,"BLEND_RESORT_DISTANCE",1);var _5=dt,gs=class{constructor(e){this.worldRendererThree=e}dispose(){Al()}renderHead(e,t,r,i){let s;if(i.SkullOwner?s=i.SkullOwner.Properties?.textures?.[0]?.Value:s=i.profile?.properties?.find(o=>o.name==="textures")?.value,!!s)try{let l=JSON.parse(O.from(s,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:a}=this.worldRendererThree.worldRendererConfig;a&&(l=l?.replace("http://textures.minecraft.net/",a).replace("https://textures.minecraft.net/",a));let v=$t(this.worldRendererThree,l,e0.head),c=new X.Group;return r&&v.position.set(0,.3125,.3125),v.position.y-=23/16,c.add(v),this.worldRendererThree.sceneOrigin.track(c),c.position.set(e.x+.5,e.y+.045,e.z+.5),c.rotation.set(0,-X.MathUtils.degToRad(t*(r?90:45/2)),0),c.scale.set(.8,.8,.8),c}catch{}}renderSign(e,t,r,i,s){let o=_l(this.worldRendererThree,s,i);if(!o)return;let l=new X.Mesh(new X.PlaneGeometry(1,1),new X.MeshBasicMaterial({map:o,transparent:!0}));l.renderOrder=999;let a=7/16,v=i?1.3:1;l.scale.set(1*v,a*v,1*v);let c=(i?2:1.5)/16,u=.25/16;r&&!i?l.position.set(0,0,-.5+c+u+1e-4):l.position.set(0,0,c/2+1e-4);let h=new X.Group;h.rotation.set(0,-X.MathUtils.degToRad(t*(r?90:45/2)),0),h.add(l),h.signTexture=o;let p=(i?10:8)/16,m=(i?0:r?4.333:9.333)/16,b=p/2+m;return this.worldRendererThree.sceneOrigin.track(h),h.position.set(e.x+.5,e.y+b,e.z+.5),h}};A();E();R();x();var si=(n,e)=>e===0?1/0:e<0?si(-n,-e):(1-(n-Math.floor(n)))/e,Ru=(n,e,t,r,i,s,o,l,a,v,c,u)=>{let h=o-c,p=l-c,m=a-c,b=o+1+c,k=l+1+c,_=a+1+c,y=dl(n,e,t,r,i,s,h,p,m,b,k,_,v);if(y===void 0&&(y=ul(n,e,t,r,i,s,h,p,m,b,k,_,v)),y!==void 0)return Math.max(u,y)};function Sl(n,e,t,r,i,s,o,l,a,v){if(o<=0)return;let c=Math.floor(n),u=Math.floor(e),h=Math.floor(t),p=r>0?1:r<0?-1:0,m=i>0?1:i<0?-1:0,b=s>0?1:s<0?-1:0,k=p!==0?Math.abs(1/r):1/0,_=m!==0?Math.abs(1/i):1/0,y=b!==0?Math.abs(1/s):1/0,M=p!==0?si(n,r):1/0,T=m!==0?si(e,i):1/0,S=b!==0?si(t,s):1/0,B=(V,z,N)=>{if(!v(V,z,N))return;let Y=Ru(n,e,t,r,i,s,V,z,N,o,l,a);if(!(Y===void 0||Y>o))return{distance:Y,blockX:V,blockY:z,blockZ:N}},P=B(c,u,h);if(P)return P;let H=0;for(;H<=o&&(M<T?M<S?(c+=p,H=M,M+=k):(h+=b,H=S,S+=y):T<S?(u+=m,H=T,T+=_):(h+=b,H=S,S+=y),!(H>o));)if(P=B(c,u,h),P)return P}A();E();R();x();A();E();R();x();import*as s0 from"three";var oi={},Tl=!1;function ku(){if(Tl)return;let n=globalThis.loadedData?.tints;if(n){for(let e of Object.keys(n))oi[e]=Su(n[e]);Tl=!0}}function Su(n){let e={},t=Ml(n.default??16777215);if(n.data)for(let r of n.data){let i=Ml(r.color);for(let s of r.keys)e[s]=i}return new Proxy(e,{get(r,i){return r[i]??t}})}function Ml(n){return[(n>>16&255)/255,(n>>8&255)/255,(n&255)/255]}function Cl(n,e){return ku(),n==="grass_block"?[1,1,1]:n==="redstone_wire"?[1,1,1]:n==="birch_leaves"||n==="spruce_leaves"||n==="lily_pad"?oi.constant?.[n]??[1,1,1]:n.includes("leaves")||n==="vine"?oi.foliage?.[e]??[1,1,1]:["short_grass","tall_grass","fern","large_fern","sugar_cane","grass"].includes(n)?oi.grass?.[e]??[1,1,1]:[1,1,1]}var Tu=512,bs=1/20,ys=class{constructor(e){this.worldRenderer=e;d(this,"particles",[]);d(this,"sharedMaterial");d(this,"enabled",!1);d(this,"tickAccumulator",0);d(this,"nextParticleIndex",0);d(this,"render",e=>{if(!this.enabled)return;for(this.tickAccumulator+=e;this.tickAccumulator>=bs;)this.tickAccumulator-=bs,this.tickPhysics();let t=this.tickAccumulator/bs;this.updateVisuals(t)})}enable(){this.enabled||(this.enabled=!0,this.ensureMaterial())}disable(){this.enabled&&(this.enabled=!1)}dispose(){for(let e of this.particles)e.active&&this.worldRenderer.sceneOrigin.removeAndUntrack(e.mesh),e.mesh.geometry.dispose();this.particles=[],this.sharedMaterial?.dispose(),this.sharedMaterial=void 0,this.nextParticleIndex=0}spawnBlockBreakParticles(e,t,r,i,s,o="plains"){if(!this.enabled)return;let l=this.resolveBlockTexture(i);if(!l)return;let a=Cl(i,o);for(let v=0;v<4;v++)for(let c=0;c<4;c++)for(let u=0;u<4;u++){let h=e+(v+.5)/4,p=t+(c+.5)/4,m=r+(u+.5)/4,b=h-e-.5,k=p-t-.5,_=m-r-.5;b+=(Math.random()*2-1)*.4,k+=(Math.random()*2-1)*.4,_+=(Math.random()*2-1)*.4;let y=(Math.random()+Math.random()+1)*.15,M=Math.sqrt(b*b+k*k+_*_),T=b/M*y*.4,S=k/M*y*.4+.1,B=_/M*y*.4,P=Math.floor(4/(Math.random()*.9+.1));this.createParticle(h,p,m,T,S,B,P,l,s,e,r,1,a)}}tickPhysics(){for(let e of this.particles){if(!e.active)continue;if(e.prevX=e.x,e.prevY=e.y,e.prevZ=e.z,e.age++,e.age>=e.maxAge){this.deactivateParticle(e);continue}e.yd-=.04,e.x+=e.xd,e.y+=e.yd,e.z+=e.zd;let t=this.getFloorY(e);e.y<=t?(e.y=t,e.yd=0,e.onGround=!0):e.onGround=!1,e.xd*=.98,e.yd*=.98,e.zd*=.98,e.onGround&&(e.xd*=.7,e.zd*=.7)}}updateVisuals(e){let t=this.worldRenderer.camera.position;for(let r of this.particles){if(!r.active)continue;let i=r.prevX+(r.x-r.prevX)*e,s=r.prevY+(r.y-r.prevY)*e,o=r.prevZ+(r.z-r.prevZ)*e;r.mesh.position.set(i,s,o),r.mesh.lookAt(t.x,t.y,t.z)}}spawnCrackParticle(e,t,r,i,s,o,l="plains"){if(!this.enabled)return;let a=this.resolveBlockTexture(s);if(!a)return;let v=Cl(s,l),c=e+Math.random()*.8+.1,u=t+Math.random()*.8+.1,h=r+Math.random()*.8+.1;switch(i){case 0:u=t-.1;break;case 1:u=t+1+.1;break;case 2:h=r-.1;break;case 3:h=r+1+.1;break;case 4:c=e-.1;break;case 5:c=e+1+.1;break}let p=(Math.random()*2-1)*.4*.2,m=(Math.random()*2-1)*.4*.2+.1*.2,b=(Math.random()*2-1)*.4*.2,k=Math.floor(4/(Math.random()*.9+.1));this.createParticle(c,u,h,p,m,b,k,a,o,e,r,.6,v)}createParticle(e,t,r,i,s,o,l,a,v,c,u,h=1,p=[1,1,1]){this.ensureMaterial();let m=this.findInactiveParticle();m||(this.particles.length<Tu?m=this.allocateParticle():m=this.recycleOldest());let b=Math.floor(Math.random()*4),k=Math.floor(Math.random()*4),_=a.u+b/4*a.su,y=a.v+k/4*a.sv,M=a.su/4,T=a.sv/4;this.setGeometryUVs(m.mesh.geometry,_,y,M,T),m.active=!0,m.x=e,m.y=t,m.z=r,m.prevX=e,m.prevY=t,m.prevZ=r,m.xd=i,m.yd=s,m.zd=o,m.age=0,m.maxAge=l,m.onGround=!1,m.floorMap=v,m.blockX=Math.floor(c),m.blockZ=Math.floor(u);let S=.1*(.5+Math.random()*.5)*2*h;m.mesh.scale.set(S,S,S),m.mesh.position.set(e,t,r),m.mesh.visible=!0;let B=.6*p[0],P=.6*p[1],H=.6*p[2],V=new Float32Array([B,P,H,B,P,H,B,P,H,B,P,H]),z=m.mesh.geometry.getAttribute("color");z?(z.set(V),z.needsUpdate=!0):m.mesh.geometry.setAttribute("color",new s0.Float32BufferAttribute(V,3)),this.worldRenderer.sceneOrigin.addAndTrack(m.mesh)}allocateParticle(){let e=new s0.PlaneGeometry(1,1),t=new s0.Mesh(e,this.sharedMaterial);t.visible=!1;let r={mesh:t,active:!1,x:0,y:0,z:0,prevX:0,prevY:0,prevZ:0,xd:0,yd:0,zd:0,age:0,maxAge:0,onGround:!1,floorMap:[],blockX:0,blockZ:0};return this.particles.push(r),r}findInactiveParticle(){for(let e=0;e<this.particles.length;e++){let t=(this.nextParticleIndex+e)%this.particles.length;if(!this.particles[t].active)return this.nextParticleIndex=(t+1)%this.particles.length,this.particles[t]}}recycleOldest(){let e=this.particles[0];for(let t of this.particles)t.age>e.age&&(e=t);return this.deactivateParticle(e),e}deactivateParticle(e){e.active&&(e.active=!1,e.mesh.visible=!1,this.worldRenderer.sceneOrigin.removeAndUntrack(e.mesh))}getFloorY(e){let t=Math.floor(e.x)-e.blockX,r=Math.floor(e.z)-e.blockZ;return t=Math.max(-2,Math.min(2,t)),r=Math.max(-2,Math.min(2,r)),e.floorMap[(r+2)*5+(t+2)]}resolveBlockTexture(e){let t=this.worldRenderer.resourcesManager.currentResources;if(!t)return null;let r=t.blocksAtlasJson,i=r.textures;if(i[e])return this.extractUV(i[e],r);for(let s of["_side","_top","_front","_0",""]){let o=e+s;if(i[o])return this.extractUV(i[o],r)}for(let s of Object.keys(i))if(s.startsWith(e))return this.extractUV(i[s],r);return null}extractUV(e,t){return{u:e.u,v:e.v,su:e.su??t.suSv,sv:e.sv??t.suSv}}setGeometryUVs(e,t,r,i,s){let o=e.getAttribute("uv");o.setXY(0,t,r),o.setXY(1,t+i,r),o.setXY(2,t,r+s),o.setXY(3,t+i,r+s),o.needsUpdate=!0}ensureMaterial(){if(this.sharedMaterial)return;let e=this.worldRenderer.material.map;e&&(this.sharedMaterial=new s0.MeshBasicMaterial({map:e,vertexColors:!0,transparent:!0,alphaTest:.1}))}},Bl={id:"blockBreakParticles",controller:ys,enabledDefault:!0,cannotBeDisabled:!0,requiresHeightmap:!1};A();E();R();x();var _s=class{constructor(e){this.worldRenderer=e;d(this,"enabled",!1);d(this,"lastBobWalkDist",0);d(this,"lastBobTickTime",0);d(this,"render",()=>{if(!this.enabled)return;let e=this.worldRenderer.displayOptions.inWorldRenderingConfig,{perspective:t}=this.worldRenderer.playerStateReactive;if(e.viewBobbing&&t==="first_person"&&!this.worldRenderer.playerStateUtils.isSpectator()){this.worldRenderer.playerStateReactive.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=performance.now(),this.lastBobWalkDist=this.worldRenderer.playerStateReactive.walkDist);let i=Math.min((performance.now()-this.lastBobTickTime)/50,1);this.worldRenderer.cameraShake.setCameraBobInput({walkDist:this.worldRenderer.playerStateReactive.walkDist,prevWalkDist:this.worldRenderer.playerStateReactive.prevWalkDist,bob:this.worldRenderer.playerStateReactive.bob,prevBob:this.worldRenderer.playerStateReactive.prevBob,partialTick:i})}else this.worldRenderer.cameraShake.setCameraBobInput(null)})}enable(){this.enabled=!0}disable(){this.enabled=!1,this.worldRenderer.cameraShake.setCameraBobInput(null);let{perspective:e}=this.worldRenderer.playerStateReactive;e==="first_person"&&this.worldRenderer.camera.position.set(0,0,0)}dispose(){this.disable()}},Pl={id:"cameraBobbing",controller:_s,enabledDefault:!0,cannotBeDisabled:!0};A();E();R();x();import*as it from"three";var ws=2e3,Il=32,Hl=32,ai=12,Ll=24,li=1.2,Mu=-5,As=class{constructor(e){this.worldRenderer=e;d(this,"instancedMesh");d(this,"geometry");d(this,"material");d(this,"particles",[]);d(this,"enabled",!1);d(this,"dummy",new it.Matrix4);d(this,"tempPosition",new it.Vector3);d(this,"tempQuaternion",new it.Quaternion);d(this,"tempScale",new it.Vector3);d(this,"configUnsubs",[]);d(this,"render",e=>{if(!this.enabled||!this.instancedMesh||!this.material)return;let t=this.worldRenderer.getCameraPosition();this.instancedMesh.position.set(0,0,0);let r=this.worldRenderer.reactiveState.world.heightmaps,{dummy:i,tempPosition:s,tempQuaternion:o,tempScale:l}=this,a=NaN,v=NaN,c;for(let u=0;u<ws;u++){let h=this.particles[u];this.instancedMesh.getMatrixAt(u,i),i.decompose(s,o,l),s.addScaledVector(h.velocity,e);let p=s.y,m=Math.sqrt(s.x*s.x+s.z*s.z),b=t.x+s.x,k=t.y+s.y,_=t.z+s.z,y=Math.floor(b/16),M=Math.floor(_/16);(y!==a||M!==v)&&(c=r[`${y},${M}`],a=y,v=M);let T=(Math.floor(b)%16+16)%16,S=(Math.floor(_)%16+16)%16,B=c?.[S*16+T];if(m>Il||B!==void 0&&B!==-32768&&k<=B+1+h.despawnOffset||p<Mu){this.respawnParticle(s);let H=ai+Math.random()*(Ll-ai);h.velocity.set((Math.random()-.5)*li,-H,(Math.random()-.5)*li),h.despawnOffset=Math.random()*.5}i.compose(s,o,l),this.instancedMesh.setMatrixAt(u,i)}this.instancedMesh.instanceMatrix.needsUpdate=!0});this.configUnsubs.push(this.worldRenderer.onReactiveConfigUpdated("rainColor",()=>this.syncRainAppearance()),this.worldRenderer.onReactiveConfigUpdated("rainOpacity",()=>this.syncRainAppearance()))}enable(){this.enabled||(this.enabled=!0,this.instancedMesh?(this.instancedMesh.visible=!0,this.syncRainAppearance()):this.createRain())}disable(){this.enabled&&(this.enabled=!1,this.instancedMesh&&(this.instancedMesh.visible=!1))}autoEnableCheck(){return this.worldRenderer.worldRendererConfig.isRaining===!0}dispose(){for(let e of this.configUnsubs)e();this.configUnsubs.length=0,this.instancedMesh&&this.worldRenderer.scene.remove(this.instancedMesh),this.geometry?.dispose(),this.material?.dispose(),this.instancedMesh=void 0,this.geometry=void 0,this.material=void 0,this.particles=[]}syncRainAppearance(){if(!this.material)return;let{rainColor:e,rainOpacity:t}=this.worldRenderer.worldRendererConfig;this.material.color.set(e),this.material.opacity=Math.max(0,Math.min(1,t)),this.material.needsUpdate=!0}createRain(){let{rainColor:e,rainOpacity:t}=this.worldRenderer.worldRendererConfig;this.geometry=new it.BoxGeometry(.03,.3,.03),this.material=new it.MeshBasicMaterial({color:e,transparent:!0,opacity:Math.max(0,Math.min(1,t)),depthWrite:!0,fog:!1}),this.instancedMesh=new it.InstancedMesh(this.geometry,this.material,ws),this.instancedMesh.name="rain-particles",this.instancedMesh.frustumCulled=!1;let r=new it.Matrix4,i=new it.Vector3;for(let s=0;s<ws;s++){this.respawnParticle(i),i.y=Math.random()*Hl,r.setPosition(i),this.instancedMesh.setMatrixAt(s,r);let o=ai+Math.random()*(Ll-ai);this.particles.push({velocity:new it.Vector3((Math.random()-.5)*li,-o,(Math.random()-.5)*li),age:0,despawnOffset:Math.random()*.5})}this.instancedMesh.instanceMatrix.needsUpdate=!0,this.worldRenderer.scene.add(this.instancedMesh)}respawnParticle(e){let t=Math.random()*Math.PI*2,r=Math.random()*Il;e.set(Math.cos(t)*r,Hl,Math.sin(t)*r)}},Ol={id:"rain",controller:As,enabledDefault:!1,requiresHeightmap:!0};A();E();R();x();import*as Be from"three";var Dl=new Be.Color(13/255,234/255,238/255),Cu=9,Bu=12e3,Pu=1500,Iu=1e4,Hu=350,Lu=650,Fl=120,zl=280,Es=class{constructor(e){this.worldRenderer=e;d(this,"enabled",!0);d(this,"sections",new Map);d(this,"completed",new Set);d(this,"globalWaveStarted",!1);d(this,"globalWaveStartMs",0);d(this,"finishedChunkCount",0);d(this,"firstQueuedMs",null);d(this,"pulseTime",0);d(this,"wireframeMaterial",new Be.LineBasicMaterial({color:Dl,transparent:!0,opacity:1,blending:Be.AdditiveBlending,depthWrite:!1}));d(this,"wireframeGlowMaterial",new Be.LineBasicMaterial({color:Dl,transparent:!0,opacity:.55,blending:Be.AdditiveBlending,depthWrite:!1}));e.worldRendererConfig.futuristicReveal!==!0&&(this.enabled=!1)}autoEnableCheck(){return this.worldRenderer.worldRendererConfig.futuristicReveal===!0}enable(){this.autoEnableCheck()&&this.setEnabled(!0)}disable(){this.setEnabled(!1)}dispose(){this.reset(),this.wireframeMaterial.dispose(),this.wireframeGlowMaterial.dispose()}shouldDeferSectionGeometry(e){return this.enabled&&!this.completed.has(e)}onSectionMeshed(e,t,r){let i=r.children.find(s=>s.name==="mesh");i instanceof Be.Mesh&&this.onSectionMeshedMesh(e,t,i)}onChunkFinished(){this.enabled&&(this.finishedChunkCount++,this.tryStartGlobalWave(performance.now()))}onSectionRemoved(e){this.cancelSection(e,!0),this.completed.delete(e)}onWorldSwitched(){this.reset()}tick(e,t=performance.now()){if(!this.enabled||(this.tryStartGlobalWave(t),!this.globalWaveStarted&&this.firstQueuedMs!==null&&this.sections.size>0&&t-this.firstQueuedMs>=Bu&&this.startGlobalWave(t),this.sections.size===0))return;this.pulseTime+=e*.001;let r=[];for(let i of this.sections.values()){if(t-i.phaseStartMs>Iu){r.push(i);continue}if(i.phase==="queued"){this.globalWaveStarted&&t>=i.revealAtMs&&this.beginWireframe(i,t);continue}let s=t-i.phaseStartMs;if(i.phase==="wireframe"){this.animateWireframe(i,s),s>=i.wireframeMs&&this.beginFade(i,t);continue}if(i.phase==="fade"){let o=Math.min(1,s/i.fadeMs);this.animateFade(i,o),o>=1&&r.push(i)}}for(let i of r)this.finishSection(i)}setEnabled(e){e!==this.enabled&&(this.enabled=e,e||this.forceFinishAll())}onSectionMeshedMesh(e,t,r){if(!this.enabled||!t.positions?.length||this.completed.has(e))return;let i=this.sections.get(e);if(i){i.mesh=r,i.geometry=t,(i.phase==="wireframe"||i.phase==="fade")&&this.finishSection(i);return}let s=performance.now();this.firstQueuedMs===null&&(this.firstQueuedMs=s);let o=this.globalWaveStarted;this.sections.set(e,{key:e,geometry:t,phase:"queued",phaseStartMs:s,revealAtMs:this.globalWaveStarted?s:0,wireframeMs:o?Fl:Hu,fadeMs:o?zl:Lu,wireframeGroup:null,mesh:r,savedMaterial:null,pulseOffset:Math.random()*Math.PI*2}),r.visible=!1,this.setShaderMeshesVisible(e,!1),this.tryStartGlobalWave(s)}reset(){this.forceFinishAll(),this.sections.clear(),this.completed.clear(),this.globalWaveStarted=!1,this.globalWaveStartMs=0,this.finishedChunkCount=0,this.firstQueuedMs=null,this.pulseTime=0}forceFinishAll(){for(let e of[...this.sections.values()])this.finishSection(e);this.sections.clear(),this.unhideAllSectionMeshes()}tryStartGlobalWave(e){if(!this.globalWaveStarted&&this.sections.size!==0){if(this.finishedChunkCount>=Cu){this.startGlobalWave(e);return}this.worldRenderer.allChunksFinished&&this.startGlobalWave(e)}}startGlobalWave(e){if(this.globalWaveStarted)return;this.globalWaveStarted=!0,this.globalWaveStartMs=e;let t=this.worldRenderer.getCameraPosition(),r=1,i=new Map;for(let[s,o]of this.sections){if(o.phase!=="queued")continue;let{sx:l,sy:a,sz:v}=o.geometry,c=Math.hypot(l-t.x,a-t.y,v-t.z);i.set(s,c),r=Math.max(r,c)}for(let[,s]of this.sections){if(s.phase!=="queued")continue;let o=i.get(s.key)??0;s.revealAtMs=e+o/r*Pu,s.wireframeMs=Fl,s.fadeMs=zl}}beginWireframe(e,t){let r=e.mesh??this.getSectionMesh(e.key);if(e.mesh=r,!r){this.sections.delete(e.key);return}let i=this.createWireframeGeometry(e.geometry),s=new Be.LineSegments(i,this.wireframeMaterial.clone());this.worldRenderer.sceneOrigin.track(s),s.position.set(e.geometry.sx,e.geometry.sy,e.geometry.sz),s.name="scifi-wireframe",s.renderOrder=1e3;let o=new Be.LineSegments(i.clone(),this.wireframeGlowMaterial.clone());this.worldRenderer.sceneOrigin.track(o),o.position.copy(s.position),o.scale.setScalar(1.02),o.name="scifi-glow",o.renderOrder=999;let l=new Be.Group;l.name="scifi-reveal-group",l.add(s,o),this.worldRenderer.realScene.add(l),r.visible=!1,this.setShaderMeshesVisible(e.key,!1),e.wireframeGroup=l,e.phase="wireframe",e.phaseStartMs=t}beginFade(e,t){let r=e.mesh??this.getSectionMesh(e.key);if(e.mesh=r,r){r.visible=!0;let i=r.material;if(!Array.isArray(i)&&i&&typeof i.clone=="function"){e.savedMaterial=i;let s=i.clone();s.transparent=!0,s.opacity=0,s.needsUpdate=!0,r.material=s}}this.setShaderMeshesVisible(e.key,!0),e.phase="fade",e.phaseStartMs=t}animateWireframe(e,t){if(!e.wireframeGroup)return;let r=e.wireframeGroup.children[0],i=e.wireframeGroup.children[1],s=.6+.4*Math.sin(this.pulseTime*4+e.pulseOffset);if(r?.material){let o=r.material;o.opacity=s;let l=.85+.15*Math.sin(this.pulseTime*6+t*.002);o.color.setRGB(13/255*l,234/255*l,238/255*l)}i?.material&&(i.material.opacity=s*.4)}animateFade(e,t){let r=1-(1-t)**3;if(e.wireframeGroup){let s=e.wireframeGroup.children[0],o=e.wireframeGroup.children[1];s?.material&&(s.material.opacity=1-r),o?.material&&(o.material.opacity=(1-r)*.55)}let i=e.mesh;i&&e.savedMaterial&&!Array.isArray(i.material)&&(i.material.opacity=r),this.setShaderMeshesVisible(e.key,r>.001)}finishSection(e){let t=e.mesh??this.getSectionMesh(e.key);if(t){if(e.savedMaterial){let i=t.material;t.material=e.savedMaterial,i.dispose(),e.savedMaterial=null}t.visible=!0}this.setShaderMeshesVisible(e.key,!0);let{chunkMeshManager:r}=this.worldRenderer;r.migrateDeferredShaderToGlobal(e.key),r.migrateDeferredLegacyToGlobal(e.key),e.wireframeGroup&&(this.disposeWireframeGroup(e.wireframeGroup),e.wireframeGroup=null),this.sections.delete(e.key),this.completed.add(e.key)}cancelSection(e,t){let r=this.sections.get(e);if(r){if(r.wireframeGroup&&this.disposeWireframeGroup(r.wireframeGroup),t){let i=r.mesh??this.getSectionMesh(e);if(i){if(r.savedMaterial){let s=i.material;i.material=r.savedMaterial,s.dispose()}i.visible=!0}this.setShaderMeshesVisible(e,!0)}this.sections.delete(e)}}getSectionMesh(e){let t=this.worldRenderer.chunkMeshManager.sectionObjects[e];if(!t)return null;let r=t.children.find(i=>i.name==="mesh");return r instanceof Be.Mesh?r:null}getShaderMesh(e){let t=this.worldRenderer.chunkMeshManager.sectionObjects[e];if(!t)return null;let r=t.children.find(i=>i.name==="shaderMesh");return r instanceof Be.Mesh?r:null}setShaderMeshesVisible(e,t){let r=this.getShaderMesh(e);r&&(r.visible=t)}unhideAllSectionMeshes(){for(let e of Object.values(this.worldRenderer.chunkMeshManager.sectionObjects))e&&e.traverse(t=>{t instanceof Be.Mesh&&(t.name==="mesh"||t.name==="shaderMesh")&&(t.visible=!0)})}disposeWireframeGroup(e){this.worldRenderer.sceneOrigin.removeAndUntrackAll(e),this.worldRenderer.realScene.remove(e),e.traverse(t=>{let r=t;r.geometry?.dispose();let i=r.material;Array.isArray(i)?i.forEach(s=>s.dispose()):i?.dispose()}),e.clear()}createWireframeGeometry(e){let t=e.positions,r=e.indices,i=[],s=new Set;for(let l=0;l<r.length;l+=3){let a=r[l],v=r[l+1],c=r[l+2];this.addEdge(t,a,v,i,s),this.addEdge(t,v,c,i,s),this.addEdge(t,c,a,i,s)}let o=new Be.BufferGeometry;return o.setAttribute("position",new Be.Float32BufferAttribute(i,3)),o}addEdge(e,t,r,i,s){let o=Math.min(t,r),l=Math.max(t,r),a=`${o}-${l}`;s.has(a)||(s.add(a),i.push(e[t*3],e[t*3+1],e[t*3+2],e[r*3],e[r*3+1],e[r*3+2]))}},Ul={id:"futuristicReveal",controller:Es,enabledDefault:!0};A();E();R();x();import*as Pe from"three";var Ou=parseInt(Pe.REVISION.replaceAll(/\D+/g,""),10),xs=class extends Pe.ShaderMaterial{constructor(){super({uniforms:{time:{value:0}},vertexShader:`
21685
21685
  uniform float time;
21686
21686
  attribute float size;
21687
21687
  varying vec3 vColor;
@@ -21698,8 +21698,8 @@ void main() {
21698
21698
  gl_FragColor = vec4(vColor, 1.0);
21699
21699
 
21700
21700
  #include <tonemapping_fragment>
21701
- #include <${Bu>=154?"colorspace_fragment":"encodings_fragment"}>
21702
- }`})}},Rs=class{constructor(e){this.worldRenderer=e;d(this,"points");d(this,"timer",new Pe.Timer);d(this,"enabled",!1);d(this,"currentTime");d(this,"enablementCheck",()=>this.currentTime?this.currentTime>13500&&this.currentTime<23e3:!1);d(this,"render",()=>{if(!this.points)return;this.points.position.set(0,0,0);let e=this.points.material;this.timer.update(performance.now()),e.uniforms.time.value=this.timer.getElapsed()*.2})}enable(){this.enabled||(this.enabled=!0,this.updateVisibility())}disable(){this.enabled&&(this.enabled=!1,this.removeStars())}toggle(){return this.enabled?this.disable():this.enable(),this.enabled}updateTimeOfDay(e){this.currentTime=e,this.enabled&&this.updateVisibility()}updateVisibility(){if(!this.enabled)return;let e=this.enablementCheck?.()??!1;e&&!this.points?this.createStars():!e&&this.points&&this.removeStars()}createStars(){if(this.points)return;let e=80,t=50,r=7e3,i=7,s=10,o=new Pe.BufferGeometry,l=b=>new Pe.Vector3().setFromSpherical(new Pe.Spherical(b,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),a=[],v=[],c=Array.from({length:r},()=>(.5+.5*Math.random())*i),u=new Pe.Color,h=e+t,p=t/r;for(let b=0;b<r;b++)h-=p*Math.random(),a.push(...l(h).toArray()),u.setHSL(b/r,s,.9),v.push(u.r,u.g,u.b);o.setAttribute("position",new Pe.Float32BufferAttribute(a,3)),o.setAttribute("color",new Pe.Float32BufferAttribute(v,3)),o.setAttribute("size",new Pe.Float32BufferAttribute(c,1));let m=new xs;m.blending=Pe.AdditiveBlending,m.depthTest=!0,m.depthWrite=!1,m.transparent=!0,this.points=new Pe.Points(o,m),this.points.renderOrder=-1,this.worldRenderer.scene.add(this.points)}dispose(){this.removeStars()}removeStars(){this.points&&(this.points.geometry.dispose(),this.points.material.dispose(),this.worldRenderer.scene.remove(this.points),this.points=void 0)}},Fl={id:"starfield",controller:Rs,enabledDefault:!0,cannotBeDisabled:!0};var zl={starfield:Fl,futuristicReveal:Dl,rain:Il,cameraBobbing:Ml,blockBreakParticles:Tl};var xt=class xt extends K5{constructor(t,r,i){if(!i.resourcesManager)throw new Error("resourcesManager is required in displayOptions");super(i.resourcesManager,i,r);this.renderer=t;this.initOptions=r;this.displayOptions=i;d(this,"outputFormat","threeJs");d(this,"chunkMeshManager");d(this,"cameraSectionPos",new o0(0,0,0));d(this,"holdingBlock");d(this,"holdingBlockLeft");d(this,"scene",new Z.Scene);d(this,"ambientLight",new Z.AmbientLight(13421772,xt.LEGACY_TO_PHYSICAL_LIGHT));d(this,"directionalLight",new Z.DirectionalLight(16777215,.5*xt.LEGACY_TO_PHYSICAL_LIGHT));d(this,"entities",new wn(this,globalThis.mcData));d(this,"performanceMonitor");d(this,"cameraGroupVr");d(this,"material",new Z.MeshBasicMaterial({vertexColors:!0,transparent:!0,alphaTest:.1}));d(this,"itemsTexture");d(this,"cursorBlock");d(this,"onRender",[]);d(this,"lastRenderTime",0);d(this,"lastSciFiTickMs",0);d(this,"animatedFov",0);d(this,"lastFovAnimTime",0);d(this,"cameraShake");d(this,"cameraContainer");d(this,"media");d(this,"waypoints");d(this,"cinimaticScript");d(this,"camera");d(this,"renderTimeAvg",0);d(this,"pendingSectionUpdates",new Map);d(this,"pendingSectionBufferStartTimes",new Map);d(this,"modules",{});d(this,"sectionsOffsetsAnimations",{});d(this,"fountains",[]);d(this,"fireworksLegacy");d(this,"DEBUG_RAYCAST",!1);d(this,"skyboxRenderer");d(this,"fireworks");d(this,"sceneOrigin",new Hn(this.scene));d(this,"cameraWorldPos",{x:0,y:0,z:0});d(this,"_cameraPositionAccessWarned",!1);d(this,"_tmpCameraPos",new Z.Vector3);d(this,"currentPosTween");d(this,"currentRotTween");d(this,"currentCameraTarget",null);d(this,"currentCameraMovementMode",null);d(this,"_tpDirection",new Z.Vector3);d(this,"_tpPitchQuat",new Z.Quaternion);d(this,"_tpYawQuat",new Z.Quaternion);d(this,"_tpFinalQuat",new Z.Quaternion);d(this,"_tpScenePos",new Z.Vector3);d(this,"_tpAxisX",new Z.Vector3(1,0,0));d(this,"_tpAxisY",new Z.Vector3(0,1,0));d(this,"_tpChunkWorldPos",new Z.Vector3);d(this,"debugOverlayAdded",!1);d(this,"debugRaycastHelper");d(this,"debugHitPoint");d(this,"prevFramePerspective",null);this.performanceMonitor=new kr(this.reactiveState.world.instabilityFactors),this.renderer=t;let s=xt.getRendererInfo(t)??"...";i.rendererState.renderer=s,this.chunkMeshManager=new _5(this,this.scene,this.material,this.worldSizeParams.worldHeight,this.viewDistance),this.onRenderDistanceChanged=o=>{this.chunkMeshManager.updateViewDistance(o)},typeof window<"u"&&(window.setBlockLightmap=o=>{this.chunkMeshManager.setBlockLightmapParams(o)}),this.syncSkyLevelFromTime(this.timeOfTheDay),this.cursorBlock=new An(this),this.holdingBlock=a5(this),this.holdingBlockLeft=a5(this,!0);for(let o of Object.values(zl))this.registerModule(o);this.skyboxRenderer=new Pn(this.realScene,!1,null),this.skyboxRenderer.init(),this.addDebugOverlay(),this.resetScene(),this.init(),this.soundSystem=new Rn(this),this.cameraShake=new kn(this,this.onRender),this.media=new Sn(this),this.fireworksLegacy=new Cn(this),this.waypoints=new Mn(this),this.cinimaticScript=new Bn(this,(o,l,a)=>this.setCinimaticCamera(o,l,a),o=>this.setCinimaticFov(o),()=>({position:new o0(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),yaw:this.cameraShake.getBaseRotation().yaw,pitch:this.cameraShake.getBaseRotation().pitch,fov:this.camera.fov})),this.fireworks=new In(this.realScene,this.sceneOrigin),this.renderUpdateEmitter.on("chunkFinished",o=>{this.finishChunk(o)}),this.worldSwitchActions(),this.initializeModules()}isShaderCubeBlocksEnabled(){return this.worldRendererConfig.shaderCubeBlocks===!0&&!!this.renderer?.capabilities?.isWebGL2}isSmartCullEnabled(){return this.worldRendererConfig.smartCull!==!1&&this.reactiveDebugParams.smartCull!==!1&&this.playerStateReactive.gameMode!=="spectator"}isSectionOcclusionVisible(t){return this.isSmartCullEnabled()?this.chunkMeshManager.isSectionOcclusionVisible(t):!0}entitySectionKey(t,r,i){let s=this.getSectionHeight(),o=Math.floor(t/16)*16,l=Math.floor(r/s)*s,a=Math.floor(i/16)*16;return`${o},${l},${a}`}get sectionObjects(){return this.chunkMeshManager.sectionObjects}get realScene(){return this.scene}get waitingChunksToDisplay(){return this.chunkMeshManager.waitingChunksToDisplay}get estimatedMemoryUsage(){return this.chunkMeshManager.getEstimatedMemoryUsage().total}get tilesRendered(){return this.chunkMeshManager.getTotalTiles()}get blocksRendered(){return this.chunkMeshManager.getTotalBlocks()}registerModule(t){if(t.id in this.modules)return;let r=new t.controller(this),i={manifest:t,controller:r,enabled:!1,toggle:()=>this.toggleModule(t.id)};this.modules[t.id]=i,t.enabledDefault&&this.toggleModule(t.id,!0)}enableModule(t){let r=this.modules[t];r&&(r.enabled||(r.enabled=!0,r.controller.enable(),r.controller.render&&this.onRender.push(r.controller.render)))}disableModule(t){let r=this.modules[t];if(r&&!r.manifest.cannotBeDisabled&&r.enabled&&(r.enabled=!1,r.controller.disable(),r.controller.render)){let i=this.onRender.indexOf(r.controller.render);i>-1&&this.onRender.splice(i,1)}}toggleModule(t,r){let i=this.modules[t];if(!i)return!1;let s=r!==void 0?r:!i.enabled;if(s===i.enabled)return i.enabled;if(!s&&i.manifest.cannotBeDisabled)return!0;if(i.enabled=s,s)i.controller.enable(),i.controller.render&&!this.onRender.includes(i.controller.render)&&this.onRender.push(i.controller.render);else if(i.controller.disable(),i.controller.render){let o=this.onRender.indexOf(i.controller.render);o>-1&&this.onRender.splice(o,1)}return s}setRain(t){this.worldRendererConfig.isRaining=t,this.toggleModule("rain",t)}disposeModules(){for(let t of Object.values(this.modules))t.controller.dispose();this.modules={}}initializeModules(){this.updateModulesFromConfig()}getModule(t){return this.modules[t]?.controller}anyModuleRequiresHeightmap(){return Object.values(this.modules).some(t=>t.enabled&&t.manifest.requiresHeightmap)}get cameraObject(){return this.cameraGroupVr??this.cameraContainer}_wrapCameraPositionWithWarning(){let t=this.camera.position,r=this,i=20,s=(a,v,c)=>Math.abs(a)>i||Math.abs(v)>i||Math.abs(c)>i,o=()=>{!r._cameraPositionAccessWarned&&typeof L<"u"},l=new Proxy(t,{set(a,v,c){return(v==="x"||v==="y"||v==="z")&&typeof c=="number"&&Math.abs(c)>i&&o(),a[v]=c,!0},get(a,v,c){let u=a[v];return v==="set"?function(h,p,m){return s(h,p,m)&&o(),a.set(h,p,m)}:v==="setX"||v==="setY"||v==="setZ"?function(h){return Math.abs(h)>i&&o(),a[v](h)}:v==="copy"?function(h){return s(h.x,h.y,h.z)&&o(),a.copy(h)}:typeof u=="function"?u.bind(a):u}});Object.defineProperty(this.camera,"position",{value:l,configurable:!0,enumerable:!0})}worldSwitchActions(){this.onWorldSwitched.push(()=>{this.getModule("futuristicReveal")?.onWorldSwitched?.(),this.protocolCustomBlocks.clear(),this.sectionsOffsetsAnimations={},this.waypoints.clear(),this.cinimaticScript.stopScript(),this.fireworks.clear(),this.syncSkyLevelFromTime(this.timeOfTheDay)})}downloadWorldGeometry(){ls(this,new Z.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.cameraShake.getBaseRotation(),"world-geometry.json")}updateEntity(t,r=!1){let i=X6(t),s={rotation:{head:{x:i.pitch,y:i.headYaw,z:0}}};r?this.entities.updateEntityPosition(t,!1,s,t.headRotationOnly===!0):this.entities.update(t,s)}updatePlayerEntity(t){this.entities.handlePlayerEntity(t)}resetScene(){this.sceneOrigin.update(0,0,0),this.cameraWorldPos.x=0,this.cameraWorldPos.y=0,this.cameraWorldPos.z=0,this.scene.matrixAutoUpdate=!1,this.scene.background=new Z.Color(this.initOptions.config.sceneBackground),this.scene.add(this.ambientLight),this.directionalLight.position.set(1,1,.5).normalize(),this.directionalLight.castShadow=!0,this.scene.add(this.directionalLight);let t=this.renderer.getSize(new Z.Vector2);this.camera=new Z.PerspectiveCamera(75,t.x/t.y,.1,1e3),this._wrapCameraPositionWithWarning(),this.cameraContainer=new Z.Object3D,this.cameraContainer.add(this.camera),this.scene.add(this.cameraContainer)}watchReactivePlayerState(){super.watchReactivePlayerState(),this.onReactivePlayerStateUpdated("inWater",t=>{this.skyboxRenderer.updateWaterState(t,this.playerStateReactive.waterBreathing)}),this.onReactivePlayerStateUpdated("waterBreathing",t=>{this.skyboxRenderer.updateWaterState(this.playerStateReactive.inWater,t)}),this.onReactivePlayerStateUpdated("ambientLight",t=>{t&&(this.ambientLight.intensity=t*xt.LEGACY_TO_PHYSICAL_LIGHT)}),this.onReactivePlayerStateUpdated("directionalLight",t=>{t&&(this.directionalLight.intensity=t*xt.LEGACY_TO_PHYSICAL_LIGHT)}),this.onReactivePlayerStateUpdated("lookingAtBlock",t=>{this.cursorBlock.setHighlightCursorBlock(t?new o0(t.x,t.y,t.z):null,t?.shapes)}),this.onReactivePlayerStateUpdated("diggingBlock",t=>{this.cursorBlock.updateBreakAnimation(t?{x:t.x,y:t.y,z:t.z}:void 0,t?.stage??null,t?.mergedShape)}),this.onReactivePlayerStateUpdated("perspective",t=>{let r=new o0(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z);this.updateCamera(r,this.cameraShake.getBaseRotation().yaw,this.cameraShake.getBaseRotation().pitch)})}watchReactiveConfig(){super.watchReactiveConfig(),this.onReactiveConfigUpdated("showChunkBorders",i=>{this.updateShowChunksBorder(i)}),this.onReactiveConfigUpdated("defaultSkybox",i=>{this.skyboxRenderer.updateDefaultSkybox(i)}),this.onReactiveConfigUpdated("shaderCubeDebugMode",()=>{this.chunkMeshManager.syncCubeShaderUniforms(),this.chunkMeshManager.syncLegacyShaderUniforms()});let t=()=>{let i=this.worldRendererConfig;this.chunkMeshManager.setShadingTheme(i.shadingTheme,i.cardinalLight)};this.onReactiveConfigUpdated("shadingTheme",t),this.onReactiveConfigUpdated("cardinalLight",t),this.onReactiveConfigUpdated("futuristicReveal",()=>{this.updateModulesFromConfig()}),this.onReactiveDebugUpdated("disableEntities",()=>{this.entities.syncSceneAttachment()});let r=this.displayOptions.inWorldRenderingConfig.handRenderer;this.onReactiveConfigUpdated("handRenderer",i=>{if(i===r)return;r=i;let s=this.holdingBlock.ready,o=this.holdingBlockLeft.ready;this.holdingBlock.dispose(),this.holdingBlockLeft.dispose(),this.holdingBlock=a5(this),this.holdingBlockLeft=a5(this,!0),s&&(this.holdingBlock.ready=!0,this.holdingBlock.updateItem()),o&&(this.holdingBlockLeft.ready=!0,this.holdingBlockLeft.updateItem())}),this.onReactiveConfigUpdated("*",()=>{this.updateModulesFromConfig()}),this.updateModulesFromConfig()}updateModulesFromConfig(){let{moduleStates:t}=this.worldRendererConfig;for(let[r,i]of Object.entries(this.modules)){let s=t[r];if(s==="enabled"){i.enabled||this.toggleModule(r,!0);continue}if(s==="disabled"){i.enabled&&!i.manifest.cannotBeDisabled&&this.toggleModule(r,!1);continue}if(s==="auto"||s===void 0)if(i.controller.autoEnableCheck){let o=i.controller.autoEnableCheck();o&&!i.enabled?this.toggleModule(r,!0):!o&&i.enabled&&!i.manifest.cannotBeDisabled&&this.toggleModule(r,!1)}else{let o=i.manifest.enabledDefault??!1;o&&!i.enabled?this.toggleModule(r,!0):!o&&i.enabled&&!i.manifest.cannotBeDisabled&&this.toggleModule(r,!1)}}}changeHandSwingingState(t,r=!1){let i=r?this.holdingBlockLeft:this.holdingBlock;t?i.startSwing():i.stopSwing()}async updateAssetsData(){let t=this.resourcesManager.currentResources,r=this.material.map,i=this.itemsTexture,s=qt(t.blocksAtlasImage);s.needsUpdate=!0,s.flipY=!1,this.material.map=s,this.chunkMeshManager.syncCubeShaderUniforms(),this.chunkMeshManager.syncLegacyShaderUniforms();let o=qt(t.itemsAtlasImage);o.needsUpdate=!0,o.flipY=!1,this.itemsTexture=o,r&&r.dispose(),i&&i.dispose(),await super.updateAssetsData(),this.onAllTexturesLoaded(),Object.keys(this.loadedChunks).length>0&&this.rerenderAllChunks()}onAllTexturesLoaded(){this.holdingBlock.ready=!0,this.holdingBlock.updateItem(),this.holdingBlockLeft.ready=!0,this.holdingBlockLeft.updateItem()}changeBackgroundColor(t){this.realScene.background=new Z.Color(t[0],t[1],t[2])}changeCardinalLight(t){this.worldRendererConfig.cardinalLight=t}timeUpdated(t){let r=this.getModule("starfield");r?.updateTimeOfDay&&r.updateTimeOfDay(t),this.skyboxRenderer.updateTime(t),this.syncSkyLevelFromTime(t)}syncSkyLevelFromTime(t){let r=Ft(t)/15;this.chunkMeshManager.setSkyLevel(r)}onDayCycleSkyLightChanged(t){}biomeUpdated(t){t?.temperature!==void 0&&this.skyboxRenderer.updateTemperature(t.temperature)}biomeReset(){this.skyboxRenderer.updateTemperature(Z1)}getItemRenderData(t,r){return g7(t,r,this.resourcesManager,this.playerStateReactive)}async demoModel(){let t=cursorBlockRel(0,1,0).position,r=await Nr();$a(r,t);let i=new Z.BoxHelper(r,16776960);r.add(i),this.realScene.add(r)}demoItem(){let t=cursorBlockRel(0,1,0).position,{mesh:r}=this.entities.getItemMesh({itemId:541},{});r.position.set(t.x+.5,t.y+.5,t.z+.5);let i=new Z.BoxHelper(r,16776960);r.add(i),this.realScene.add(r)}addDebugOverlay(){if(this.debugOverlayAdded)return;this.debugOverlayAdded=!0;let t=T0("debug-overlay",80,0,void 0,{className:S0});setInterval(()=>{if(t.setVisibility(this.displayAdvancedStats),this.displayAdvancedStats){let r=c=>new Intl.NumberFormat("en-US",{}).format(c),i=c=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(c),s="";s+=`TE: ${r(this.renderer.info.memory.textures)} `;let o=this.chunkMeshManager.getGlobalBufferStats();if(o.shaderFaces){let c=o.shaderFaces;s+=`CUBE: ${i(c.used)}/${i(c.capacity)}f `}if(o.legacyOpaque){let c=o.legacyOpaque;s+=`LEG-O: ${i(c.used)}/${i(c.capacity)}q `}if(o.legacyBlend){let c=o.legacyBlend;s+=`LEG-B: ${i(c.used)}/${i(c.capacity)}q `}let l=this.chunkMeshManager.getDrawnStats();s+=`DRAWN: ${i(l.cubeFaces)}f ${i(l.legacyOpaqueQuads)}q ${i(l.legacyBlendQuads)}q `,s+=`MEM: ${this.chunkMeshManager.getEstimatedMemoryUsage().total} `;let a=this.cameraCollisionBlockCache.getAllocatedBytes();a>0&&(s+=`CAM: ${i(a)}b `);let v=wi(this.reactiveState.world.instabilityFactors);v&&(s+=`PF: ${v} `),t.updateText(s),this.backendInfoReport=s}},200)}updatePosDataChunk(t){let r=this.sectionObjects[t];if(!r)return;let[i,s,o]=t.split(",").map(c=>Math.floor(+c/16)),a=500-(Math.abs(i-this.cameraSectionPos.x)+Math.abs(s-this.cameraSectionPos.y)+Math.abs(o-this.cameraSectionPos.z)),v=r.mesh??r.shaderMesh??r.children.find(c=>c.name==="mesh"||c.name==="shaderMesh");v&&(v.renderOrder=a)}cameraSectionPositionUpdate(){for(let t in this.sectionObjects)this.sectionObjects[t]&&this.updatePosDataChunk(t)}getDir(t,r){return t===r?0:t<r?1:-1}finishChunk(t){this.chunkMeshManager.finishChunkDisplay(t),this.getModule("futuristicReveal")?.onChunkFinished?.()}applyPendingSectionUpdates(){if(this.pendingSectionUpdates.size===0)return;let t=performance.now(),r=this.getSectionHeight(),i=[];for(let s of this.pendingSectionUpdates.keys()){let o=this.pendingSectionBufferStartTimes.get(s)??t;if(t-o<xt.MAX_SECTION_UPDATE_BUFFER_MS){let[a,v,c]=s.split(",").map(Number),u=[`${a-16},${v},${c}`,`${a+16},${v},${c}`,`${a},${v-r},${c}`,`${a},${v+r},${c}`,`${a},${v},${c-16}`,`${a},${v},${c+16}`],h=!1;for(let p of u)if(this.sectionsWaiting.has(p)&&!this.pendingSectionUpdates.has(p)&&this.sectionObjects[p]){h=!0;break}if(h)continue}i.push(s)}if(i.length!==0)for(let s of i){let o=this.pendingSectionUpdates.get(s);this.pendingSectionUpdates.delete(s),this.pendingSectionBufferStartTimes.delete(s);let l=o.key.split(","),a=`${l[0]},${l[2]}`;if(!this.loadedChunks[a]||!this.active){this.chunkMeshManager.releaseSection(o.key);continue}if(!this.chunkMeshManager.sectionHasRenderableContent(o.geometry)){this.chunkMeshManager.releaseSection(o.key);continue}let v=this.chunkMeshManager.updateSection(o.key,o.geometry);this.updatePosDataChunk(o.key),v&&this.getModule("futuristicReveal")?.onSectionMeshed?.(o.key,o.geometry,v)}}clearPendingSectionUpdatesForChunk(t,r){for(let i of[...this.pendingSectionUpdates.keys()])i.startsWith(`${t},`)&&i.endsWith(`,${r}`)&&(this.pendingSectionUpdates.delete(i),this.pendingSectionBufferStartTimes.delete(i))}handleWorkerMessage(t){if(t.type==="geometry"){let r=t.key.split(","),i=`${r[0]},${r[2]}`;if(!this.loadedChunks[i]||!this.active){this.pendingSectionUpdates.delete(t.key),this.pendingSectionBufferStartTimes.delete(t.key);return}if(this.sectionObjects[t.key]){this.pendingSectionUpdates.set(t.key,t),this.pendingSectionBufferStartTimes.has(t.key)||this.pendingSectionBufferStartTimes.set(t.key,performance.now());return}if(!this.chunkMeshManager.sectionHasRenderableContent(t.geometry)){this.chunkMeshManager.releaseSection(t.key);return}let s=this.chunkMeshManager.updateSection(t.key,t.geometry);this.updatePosDataChunk(t.key),s&&this.getModule("futuristicReveal")?.onSectionMeshed?.(t.key,t.geometry,s)}}getCameraPosition(t){return(t??this._tmpCameraPos).set(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z)}getSectionCameraPosition(){let t=this.getCameraPosition();return new o0(Math.floor(t.x/16),Math.floor(t.y/16),Math.floor(t.z/16))}updateCameraSectionPos(){let t=this.getSectionCameraPosition();this.cameraSectionPos.equals(t)||(this.cameraSectionPos=t,this.cameraSectionPositionUpdate())}setFirstPersonCamera(t,r,i,s){let o=this.playerStateReactive.eyeHeight;this.updateCamera(t?.offset(0,o,0)??null,r,i,s),this.updateCameraSectionPos()}getThirdPersonCamera(t,r,i){t??(t=new Z.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z));let s=this.playerStateReactive.perspective==="third_person_back",o=4,l=this._tpDirection.set(0,0,-1),a=this._tpPitchQuat.setFromAxisAngle(this._tpAxisX,i),v=this._tpYawQuat.setFromAxisAngle(this._tpAxisY,r),c=this._tpFinalQuat.multiplyQuaternions(v,a);l.applyQuaternion(c),s&&l.multiplyScalar(-1),this.DEBUG_RAYCAST&&this.debugRaycast(t,l,o);let u=.25,h=.05,p=.4,m=this.cameraCollisionBlockCache,b=xl(t.x,t.y,t.z,l.x,l.y,l.z,o,u,h,(_,y,M)=>m.isSolidBlock(_,y,M)),k=o;return b!==void 0&&(k=Math.min(k,b.distance)),k<p&&(k=p),new o0(t.x+l.x*k,t.y+l.y*k,t.z+l.z*k)}debugRaycast(t,r,i){this.debugRaycastHelper&&(this.realScene.remove(this.debugRaycastHelper),this.debugRaycastHelper=void 0),this.debugHitPoint&&(this.realScene.remove(this.debugHitPoint),this.debugHitPoint=void 0);let s=new Z.Vector3(this.sceneOrigin.toSceneX(t.x),this.sceneOrigin.toSceneY(t.y),this.sceneOrigin.toSceneZ(t.z));this.debugRaycastHelper=new Z.ArrowHelper(r.clone().normalize(),s,i,16711680,i*.1,i*.05),this.realScene.add(this.debugRaycastHelper);let o=new Z.SphereGeometry(.2,8,8),l=new Z.MeshBasicMaterial({color:65280});this.debugHitPoint=new Z.Mesh(o,l),this.debugHitPoint.position.copy(s).add(r.clone().multiplyScalar(i)),this.realScene.add(this.debugHitPoint)}setCinimaticCamera(t,r,i){this.cameraWorldPos.x=t.x,this.cameraWorldPos.y=t.y,this.cameraWorldPos.z=t.z,this.sceneOrigin.update(t.x,t.y,t.z),this.cameraObject.position.set(0,0,0),this.cameraShake.setBaseRotation(i,r),this.updateCameraSectionPos()}setCinimaticFov(t){this.animatedFov=t,this.camera.fov=t,this.camera.updateProjectionMatrix()}updateSmoothFov(){if(this.cinimaticScript.running)return;let t=this.displayOptions.inWorldRenderingConfig.fov,r=this.playerStateReactive.fovMultiplier,i=t*(Number.isFinite(r)?r:1),s=performance.now();if(this.animatedFov===0&&(this.animatedFov=i),Math.abs(this.animatedFov-i)>=.01){let o=s-this.lastFovAnimTime,l=Math.min(o/xt.FOV_TRANSITION_MS,1),a=v=>1-(1-v)**3;this.animatedFov+=(i-this.animatedFov)*a(l),Math.abs(this.animatedFov-i)<.01&&(this.animatedFov=i)}else this.animatedFov=i;this.lastFovAnimTime=s,this.camera.fov!==this.animatedFov&&(this.camera.fov=this.animatedFov,this.camera.updateProjectionMatrix())}updateCamera(t,r,i,s){if(!this.cinimaticScript.running){if(t){this.renderer.xr.isPresenting&&(t.y-=this.camera.position.y);let o=this.playerStateUtils.isSpectatingEntity()?"spectating":s?.movementMode??"local-player",l=s?.instant===!0||this.displayOptions.inWorldRenderingConfig.instantCameraUpdate===!0,a={x:t.x,y:t.y,z:t.z},v=E6({target:a,currentTarget:this.currentCameraTarget,movementMode:o,previousMovementMode:this.currentCameraMovementMode,instant:l}),c=A6(o,l);v&&(this.currentCameraTarget={...a},this.currentCameraMovementMode=o,this.currentPosTween?.stop(),l||c===0?(this.cameraWorldPos.x=a.x,this.cameraWorldPos.y=a.y,this.cameraWorldPos.z=a.z,this.sceneOrigin.update(a.x,a.y,a.z),this.cameraObject.position.set(0,0,0),this.currentPosTween=void 0):this.currentPosTween=new Ge(this.cameraWorldPos).to(a,c).onUpdate(()=>{this.sceneOrigin.update(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.cameraObject.position.set(0,0,0)}).start())}if(this.playerStateUtils.isSpectatingEntity()){let o=this.cameraShake.getBaseRotation(),l=0,a=Math.PI/2;o.yaw<a&&r>Math.PI+a?l=-Math.PI*2:r<a&&o.yaw>Math.PI+a&&(l=Math.PI*2),this.currentRotTween?.stop(),this.currentRotTween=new Ge(o).to({pitch:i,yaw:r+l},100).onUpdate(v=>this.cameraShake.setBaseRotation(v.pitch,v.yaw-l)).start()}else{this.currentRotTween?.stop(),this.cameraShake.setBaseRotation(i,r);let{perspective:o}=this.playerStateReactive;if(o==="third_person_back"||o==="third_person_front"){let l=new Z.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),a=this.getThirdPersonCamera(l,r,i),v=l.distanceTo(new Z.Vector3(a.x,a.y,a.z)),c=o==="third_person_back"?v:-v;this.camera.position.set(0,0,c),o==="third_person_front"?this.camera.rotation.set(0,Math.PI,0):this.camera.rotation.set(0,0,0)}else this.camera.position.z=0,this.camera.rotation.set(0,0,0),this.debugRaycastHelper&&(this.realScene.remove(this.debugRaycastHelper),this.debugRaycastHelper=void 0),this.debugHitPoint&&(this.realScene.remove(this.debugHitPoint),this.debugHitPoint=void 0)}this.updateCameraSectionPos()}}debugChunksVisibilityOverride(){let{chunksRenderAboveOverride:t,chunksRenderBelowOverride:r,chunksRenderDistanceOverride:i,chunksRenderAboveEnabled:s,chunksRenderBelowEnabled:o,chunksRenderDistanceEnabled:l}=this.reactiveDebugParams,a=this.getSectionHeight(),v=this.cameraSectionPos.y*a;if(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay&&t!==void 0||r!==void 0||i!==void 0)for(let[c,u]of Object.entries(this.sectionObjects)){if(u._waitingForChunkDisplay)continue;let[h,p,m]=c.split(",").map(Number),b=s&&t!==void 0?p<=v+t:o&&r!==void 0?p>=v-r:l&&i!==void 0?Math.abs(p-v)<=i:!0;u.visible=b}else this.chunkMeshManager.updateSectionsVisibility()}render(t=!1){if(this.currentRenderedFrames++,this.reactiveDebugParams.stopRendering)return;this.debugChunksVisibilityOverride();let r=performance.now();this.lastRendered=performance.now();let i=this.lastRenderTime>0?Math.min(Math.max((r-this.lastRenderTime)/1e3,0),.1):1/60;this.lastRenderTime=r,this.cursorBlock.render(),this.updateSectionOffsets();let s=this.getCameraPosition();if(this.skyboxRenderer.update(s,this.viewDistance),this.updateSmoothFov(),t){let B=this.renderer.getSize(new Z.Vector2);this.camera.aspect=B.width/B.height,this.camera.updateProjectionMatrix()}let o=0,l=this.cameraGroupVr instanceof Z.Group?this.cameraGroupVr.children.find(B=>B instanceof Z.PerspectiveCamera):this.camera;this.applyPendingSectionUpdates();let a=performance.now(),v=a-this.lastSciFiTickMs;this.lastSciFiTickMs=a,this.getModule("futuristicReveal")?.tick?.(v,a);let c=this.cameraWorldPos.x,u=this.cameraWorldPos.y,h=this.cameraWorldPos.z;this.chunkMeshManager.maybeRebase({x:c,y:u,z:h});let p=this.chunkMeshManager.getRenderOrigin(),m=this.chunkMeshManager.globalBlockBuffer;m&&(m.setCameraOrigin(p,c,u,h),m.setDebugOverlay(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay),m.compactStep(),m.hasPendingUploads()&&m.uploadDirtyRange(),m.suppressThreeDraw());let b=this.chunkMeshManager.globalLegacyBuffer;b&&(b.setDebugOverlay(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay),b.compactStep(),b.hasPendingUploads()&&b.uploadDirtyRange(),b.suppressThreeDraw());let k=this.chunkMeshManager.globalLegacyBlendBuffer,_=!1;k&&(k.setDebugOverlay(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay),k.compactStep(),k.hasPendingUploads()&&(k.uploadDirtyRange(),_=!0),k.suppressThreeDraw()),this.chunkMeshManager.markCullDirtyIfBufferStateChanged(),this.chunkMeshManager.setLegacyCameraOrigin(c,u,h),this.chunkMeshManager.updateCullDirtyFromCamera(l,c,u,h);let y=this.isSmartCullEnabled();this.chunkMeshManager.notifySmartCullChanged(y),this.chunkMeshManager.cullDirty&&(this.chunkMeshManager.updateSectionCullAndSort(l,this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z,y),this.chunkMeshManager.clearCullDirty()),this.chunkMeshManager.updateCaveCullingDebug(this.reactiveDebugParams.caveCullingDebug,y);let M=performance.now();this.entities.render(),o=performance.now()-M,this.chunkMeshManager.sortVisibleBlendSections(c,u,h),!_&&k?.hasPendingIndexUploads()&&k.uploadDirtyIndexRange(),this.renderer.render(this.scene,l),this.displayOptions.inWorldRenderingConfig.showHand&&this.playerStateReactive.gameMode!=="spectator"&&this.playerStateReactive.perspective==="first_person"&&!this.renderer.xr.isPresenting&&(this.holdingBlock.render(this.camera,this.renderer,this.ambientLight,this.directionalLight),this.holdingBlockLeft.render(this.camera,this.renderer,this.ambientLight,this.directionalLight));for(let B of this.fountains)this.sectionObjects[B.sectionId]&&!this.sectionObjects[B.sectionId].foutain&&(B.createParticles(this.sectionObjects[B.sectionId]),this.sectionObjects[B.sectionId].foutain=!0),B.render();this.waypoints.render(),this.fireworks.update();for(let B of this.onRender)B(i);let S=performance.now()-r;this.worldRendererConfig.autoLowerRenderDistance&&this.chunkMeshManager.recordRenderTime(S),this.renderTimeAvgCount++,this.renderTimeAvg=(this.renderTimeAvg*(this.renderTimeAvgCount-1)+S)/this.renderTimeAvgCount,this.renderTimeMax=Math.max(this.renderTimeMax,S),this.performanceMonitor.onFrame({totalMs:S,entitiesMs:o,loadedTextureCount:this.renderer.info.memory.textures,fps:this.lastFps})}renderHead(t,r,i,s){let o;if(s.SkullOwner?o=s.SkullOwner.Properties?.textures?.[0]?.Value:o=s.profile?.properties?.find(l=>l.name==="textures")?.value,!!o)try{let a=JSON.parse(O.from(o,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:v}=this.worldRendererConfig;v&&(a=a?.replace("http://textures.minecraft.net/",v).replace("https://textures.minecraft.net/",v));let c=$t(this,a,e0.head),u=new Z.Group;return i&&c.position.set(0,.3125,.3125),c.position.y-=23/16,u.add(c),this.sceneOrigin.track(u),u.position.set(t.x+.5,t.y+.045,t.z+.5),u.rotation.set(0,-Z.MathUtils.degToRad(r*(i?90:45/2)),0),u.scale.set(.8,.8,.8),u}catch{}}lightUpdate(t,r){for(let i=this.worldSizeParams.minY;i<this.worldSizeParams.worldHeight;i+=16)this.setSectionDirty(new o0(t,i,r))}rerenderAllChunks(){for(let t of Object.keys(this.sectionObjects)){let[r,i,s]=t.split(",").map(Number);this.setSectionDirty(new o0(r,i,s))}}updateShowChunksBorder(t){this.chunkMeshManager.updateAllBoxHelpers(t)}resetWorld(){super.resetWorld(),this.pendingSectionUpdates.clear(),this.pendingSectionBufferStartTimes.clear(),this.chunkMeshManager.dispose(),this.chunkMeshManager=new _5(this,this.scene,this.material,this.worldSizeParams.worldHeight,this.viewDistance),this.debugRaycastHelper&&(this.realScene.remove(this.debugRaycastHelper),this.debugRaycastHelper=void 0),this.debugHitPoint&&(this.realScene.remove(this.debugHitPoint),this.debugHitPoint=void 0)}getLoadedChunksRelative(t,r=!1){let[i,s,o]=ji(t);return Object.fromEntries(Object.entries(this.sectionObjects).map(([l,a])=>{let[v,c,u]=l.split(",").map(Number),[h,p,m]=ji({x:v,y:c,z:u});return[r?`${h-i},${p-s},${m-o}`:`${h-i},${m-o}`,a]}))}readdChunks(){for(let t of Object.keys(this.sectionObjects))this.scene.remove(this.sectionObjects[t]);setTimeout(()=>{for(let t of Object.keys(this.sectionObjects))this.scene.add(this.sectionObjects[t])},500)}disableUpdates(t=this.scene.children){for(let r of t)r.matrixWorldNeedsUpdate=!1,this.disableUpdates(r.children??[])}removeColumn(t,r){super.removeColumn(t,r),this.clearPendingSectionUpdatesForChunk(t,r);let i=this.getSectionHeight(),s=this.worldMinYRender;for(let o=s;o<this.worldSizeParams.worldHeight;o+=i){let l=`${t},${o},${r}`;this.chunkMeshManager.sectionObjects[l]&&this.chunkMeshManager.releaseSection(l)}this.chunkMeshManager.onChunkRemovedFromGate(`${t},${r}`)}updateViewerPosition(t){super.updateViewerPosition(t),this.chunkMeshManager.pendingNearReveal.size>0&&this.chunkMeshManager.tryRevealPending()}onViewerChunkPositionChanged(){this.chunkMeshManager.tryRevealPending()}setSectionDirty(...t){super.setSectionDirty(...t)}static getRendererInfo(t){try{let r=t.getContext();return`${r.getParameter(r.getExtension("WEBGL_debug_renderer_info").UNMASKED_RENDERER_WEBGL)}`}catch{}}worldStop(){this.media.onWorldStop()}destroy(){this.performanceMonitor?.reset(),this.pendingSectionUpdates.clear(),this.pendingSectionBufferStartTimes.clear(),this.chunkMeshManager.dispose(),this.disposeModules(),this.fireworksLegacy.destroy(),super.destroy(),this.skyboxRenderer.dispose(),this.fireworks.dispose()}shouldObjectVisible(t){let i=this.getSectionHeight(),s,o,l,a=this.sceneOrigin.getWorldPosition(t);a?(s=a.x,o=a.y,l=a.z):(s=this.sceneOrigin.toWorldX(t.position.x),o=this.sceneOrigin.toWorldY(t.position.y),l=this.sceneOrigin.toWorldZ(t.position.z));let v=Math.floor(s/16)*16,c=Math.floor(l/16)*16,u=Math.floor(o/i)*i,h=`${v},${c}`,p=`${v},${u},${c}`;return!!this.finishedChunks[h]||!!this.sectionObjects[p]}handleUserClick(t){this.media.handleUserClick(t)}updateSectionOffsets(){let t=performance.now();for(let[r,i]of Object.entries(this.sectionsOffsetsAnimations)){let s=(t-i.time)/1e3;i.time=t,i.currentOffsetX+=i.speedX*s,i.currentOffsetY+=i.speedY*s,i.currentOffsetZ+=i.speedZ*s,i.limitX!==void 0&&(i.speedX>0?i.currentOffsetX=Math.min(i.currentOffsetX,i.limitX):i.currentOffsetX=Math.max(i.currentOffsetX,i.limitX)),i.limitY!==void 0&&(i.speedY>0?i.currentOffsetY=Math.min(i.currentOffsetY,i.limitY):i.currentOffsetY=Math.max(i.currentOffsetY,i.limitY)),i.limitZ!==void 0&&(i.speedZ>0?i.currentOffsetZ=Math.min(i.currentOffsetZ,i.limitZ):i.currentOffsetZ=Math.max(i.currentOffsetZ,i.limitZ));let o=this.sectionObjects[r];o&&(o.position.set(i.currentOffsetX,i.currentOffsetY,i.currentOffsetZ),o.updateMatrix())}}reloadWorld(){this.entities.reloadEntities()}};d(xt,"LEGACY_TO_PHYSICAL_LIGHT",Math.PI),d(xt,"FOV_TRANSITION_MS",200),d(xt,"MAX_SECTION_UPDATE_BUFFER_MS",500);var z0=xt;A();E();R();x();A();E();R();x();var a0="1.21.4";A();E();R();x();function U0(n,e){n.aspect=e.width/e.height,n.updateProjectionMatrix()}A();E();R();x();function ks(n,e=!1){return n?.mode?n.mode:e?"worldBlocks":Ct.mode}A();E();R();x();import*as ue from"three";A();E();R();x();function Ss(...n){let e=n.filter(r=>r.length>0).join("/"),t=typeof globalThis.location<"u"&&globalThis.location.href?globalThis.location.href:typeof import.meta<"u"&&import.meta.url?import.meta.url:`/${e}`;try{return new URL(e,t).href}catch{return`/${e}`}}var Ts=new Date,Ul=Ts.getMonth()===11&&Ts.getDate()>=24&&Ts.getDate()<=26,Pu=["panorama_3.webp","panorama_1.webp","panorama_4.webp","panorama_5.webp","panorama_0.webp","panorama_2.webp"],Iu=200,mr=class{constructor(e){this.documentRenderer=e;d(this,"scene");d(this,"camera");d(this,"startTimes",new Map);d(this,"time",0);d(this,"panoramaGroup",null);this.scene=new ue.Scene,this.scene.background=new ue.Color(3294568);let t=new ue.AmbientLight(13421772);this.scene.add(t);let r=new ue.DirectionalLight(16777215,.5);r.position.set(1,1,.5).normalize(),r.castShadow=!0,this.scene.add(r),this.camera=new ue.PerspectiveCamera(85,e.canvas.width/e.canvas.height,.05,1e3),this.camera.position.set(0,0,0),this.camera.rotation.set(0,0,0)}async init(){this.buildCubemap()}update(e,t){t&&U0(this.camera,this.documentRenderer.canvas)}dispose(){this.scene.clear(),this.panoramaGroup=null,this.startTimes.clear()}buildCubemap(){let e=new ue.BoxGeometry(1e3,1e3,1e3),t=[];for(let s of Pu)(async()=>{let l=Ss("background",Ul?"christmas":"",s),a=await x0(l),v=qt(a);v.matrixAutoUpdate=!1,v.matrix.set(-1,0,1,0,1,0,0,0,1),v.wrapS=ue.ClampToEdgeWrapping,v.wrapT=ue.ClampToEdgeWrapping,v.minFilter=ue.LinearFilter,v.magFilter=ue.LinearFilter;let c=new ue.MeshBasicMaterial({map:v,transparent:!0,side:ue.DoubleSide,depthWrite:!1,opacity:0});this.startTimes.set(c,Date.now()),t.push(c)})().catch(l=>{});let r=new ue.Mesh(e,t);r.onBeforeRender=()=>{this.time+=.01,r.rotation.y=Math.PI+this.time*.01,r.rotation.z=Math.sin(-this.time*.001)*.001;for(let s of t){let o=this.startTimes.get(s);if(o){let l=Date.now()-o;s.opacity=Math.min(1,l/Iu)}}};let i=new ue.Object3D;if(i.add(r),!Ul)for(let s=0;s<20;s++){let o=new Gt("1.16.4","squid").mesh;o.position.set(Math.random()*30-15,Math.random()*20-10,Math.random()*10-17),o.rotation.set(0,Math.PI+Math.random(),-Math.PI/4,"ZYX");let l=Math.random()*.01;o.children[0].onBeforeRender=()=>{o.rotation.y+=l,o.rotation.z=Math.cos(r.rotation.y*3)*Math.PI/4-Math.PI/2},i.add(o)}this.scene.add(i),this.panoramaGroup=i}async debugImageInFrontOfCamera(){let e=await x0(Ss("background","panorama_0.webp")),t=qt(e),r=new ue.Mesh(new ue.PlaneGeometry(1e3,1e3),new ue.MeshBasicMaterial({map:t}));r.position.set(0,0,-500),this.scene.add(r)}};A();E();R();x();import*as W from"three";var Vl=.1,Cs={mixed:["white_wool","cyan_wool","blue_wool","purple_wool","white_stained_glass","cyan_stained_glass","blue_stained_glass","purple_stained_glass","glowstone","sea_lantern","amethyst_block","copper_block","gold_block","diamond_block"],stainedGlass:["white_stained_glass","orange_stained_glass","magenta_stained_glass","light_blue_stained_glass","yellow_stained_glass","lime_stained_glass","pink_stained_glass","gray_stained_glass","light_gray_stained_glass","cyan_stained_glass","purple_stained_glass","blue_stained_glass","brown_stained_glass","green_stained_glass","red_stained_glass","black_stained_glass"],wool:["white_wool","orange_wool","magenta_wool","light_blue_wool","yellow_wool","lime_wool","pink_wool","gray_wool","light_gray_wool","cyan_wool","purple_wool","blue_wool","brown_wool","green_wool","red_wool","black_wool"],construction:["copper_block","exposed_copper","weathered_copper","oxidized_copper","cut_copper","exposed_cut_copper","weathered_cut_copper","oxidized_cut_copper","iron_block","gold_block","diamond_block","emerald_block","netherite_block","lapis_block","redstone_block","coal_block","quartz_block","amethyst_block","bricks","stone_bricks","deepslate_bricks","polished_blackstone"],glow:["glowstone","sea_lantern","shroomlight","ochre_froglight","verdant_froglight","pearlescent_froglight","redstone_lamp","beacon"],world:["grass_block","podzol","mycelium","dirt","coarse_dirt","rooted_dirt","mud","clay","stone","cobblestone","mossy_cobblestone","deepslate","cobbled_deepslate","tuff","calcite","sand","red_sand","gravel","snow_block","coal_ore","deepslate_coal_ore","iron_ore","deepslate_iron_ore","copper_ore","deepslate_copper_ore","gold_ore","deepslate_gold_ore","diamond_ore","deepslate_diamond_ore","emerald_ore","deepslate_emerald_ore","lapis_ore","deepslate_lapis_ore","redstone_ore","deepslate_redstone_ore","nether_gold_ore","ancient_debris","oak_log","birch_log","spruce_log","jungle_log","acacia_log","dark_oak_log","mangrove_log","cherry_log","netherrack","soul_sand","basalt","end_stone"]},Gl={galaxy:{bg:132114,fog:132114,fogD:.011,blocks:[61695,54527,47359,59647,2280703,43263],emit:[13158,8789,6724],nebula:[4403,1114146,4386],galFn:n=>new W.Color(n*.05,n*.2,n),ambient:264216,dir:3368703,pt1:43775,pt2:16729343,name:"GALAXY"},nether:{bg:917760,fog:917760,fogD:.016,blocks:[16720384,16737792,16750848,13373696,16729122,16755200],emit:[2230272,1114112,3346688],nebula:[1704960,851968,1705984],galFn:n=>new W.Color(n,n*.15,0),ambient:1573376,dir:16724736,pt1:16729088,pt2:16755200,name:"NETHER"},end:{bg:0,fog:0,fogD:.009,blocks:[7807658,11158732,5570679,14527231,3342421,12299007],emit:[655381,1572901,327696],nebula:[524312,851989,262158],galFn:n=>new W.Color(n*.4,0,n),ambient:393232,dir:10040319,pt1:11158783,pt2:4456618,name:"THE END"},cyber:{bg:792610,fog:792610,fogD:.008,blocks:[65535,4521932,11206468,6741503,8978278,65450],emit:[666163,668450,665656],nebula:[1192e3,1587240,1323588],galFn:n=>new W.Color(n*.15,n*.85,n*.95),ambient:1716288,dir:6750156,pt1:4521966,pt2:10092356,name:"CYBER",starColor:13431039,starOpacity:.75,galaxyOpacity:.62,nebulaOpacity:.36,edgeLineColor:4521949,blockOpacity:[.38,.54]},light:{bg:8951984,fog:7899296,fogD:.006,gradientBg:{top:14214392,mid:10531016,bottom:6846608,radial:!0},blocks:[15266559,13691135,12114175,10537208,8960240,7383272,10012927,12640511,15792383,7909608,14216447,14739711],emit:[6854864,8958176,11061488,12638456],nebula:[9480392,11059424,12637420,14215416,7901360],galFn:n=>{let e=new W.Color;return n<.4?e.lerpColors(new W.Color(16054527),new W.Color(14215423),n/.4):n<.75?e.lerpColors(new W.Color(14215423),new W.Color(11061488),(n-.4)/.35):e.lerpColors(new W.Color(11061488),new W.Color(9482464),(n-.75)/.25),e},ambient:7899296,dir:13688040,pt1:11061503,pt2:13162751,name:"LIGHT",starColor:15266047,starOpacity:.5,galaxyOpacity:.7,nebulaOpacity:.32,edgeLineColor:10010856,blockOpacity:[.42,.56]}},Hu={cruise:{pos:(n,e,t)=>({x:Math.sin(n*.28)*18+Math.cos(n*.11)*7+e*10,y:Math.sin(n*.19)*6+Math.cos(n*.31)*3+t*6,z:0}),look:(n,e,t)=>({x:Math.sin((n+.18)*.28)*18+e*8,y:Math.sin((n+.18)*.19)*6+t*4,z:-25}),roll:(n,e=0)=>e*.05+Math.sin(n*.22)*.015,spd:.18},barrel:{pos:(n,e,t)=>{let i=n*2.4;return{x:Math.cos(i)*10+e*4,y:Math.sin(i)*10+t*4,z:Math.sin(n*.4)*8}},look:n=>({x:Math.sin(n*.5)*5,y:Math.cos(n*.5)*5,z:-30}),roll:n=>n*2.4+Math.PI*.5,spd:.24},dive:{pos:(n,e,t)=>({x:Math.sin(n*.6)*30+e*8,y:Math.cos(n*.4)*18+t*6,z:Math.sin(n*.3)*12}),look:(n,e,t)=>({x:Math.sin(n*.6+.2)*30+e*6,y:Math.cos(n*.4+.2)*18-8+t*4,z:-35}),roll:(n,e=0)=>e*.08+Math.sin(n*.6)*.12,spd:.3},orbit:{pos:(n,e,t)=>({x:Math.cos(n*.5)*20+e*5,y:Math.sin(n*.25)*10+t*5,z:Math.sin(n*.5)*20}),look:()=>({x:0,y:0,z:-60}),roll:n=>Math.sin(n*.5)*.08,spd:.15},snake:{pos:(n,e,t)=>({x:Math.sin(n*1.1)*22+Math.sin(n*.37)*8+e*10,y:Math.sin(n*.7)*10+e*4+t*8,z:0}),look:(n,e,t)=>{let r=n+.12;return{x:Math.sin(r*1.1)*22+Math.sin(r*.37)*8+e*8,y:Math.sin(r*.7)*10+t*6,z:-22}},roll:(n,e=0)=>e*.1+Math.sin(n*1.1)*.06,spd:.22}},Lu={cruise:1,barrel:1.6,dive:2.2,orbit:.7,snake:1.4},Ou=250,vi=1e4,ci=3e3,pr=n=>n[Math.floor(Math.random()*n.length)],Ms=n=>"#"+n.toString(16).padStart(6,"0"),Nl=n=>{if(typeof document>"u")return null;let e=document.createElement("canvas");e.width=4,e.height=512;let t=e.getContext("2d");if(!t)return null;let r=e.width,i=e.height,s=n.radial?t.createRadialGradient(r/2,i*.32,0,r/2,i*.32,i*.85):t.createLinearGradient(0,0,0,i);s.addColorStop(0,Ms(n.top)),n.mid!=null&&s.addColorStop(.45,Ms(n.mid)),s.addColorStop(1,Ms(n.bottom)),t.fillStyle=s,t.fillRect(0,0,r,i);let o=new W.CanvasTexture(e);return o.needsUpdate=!0,o},V0=class{constructor(e,t={},r){this.documentRenderer=e;this.abortSignal=r;d(this,"scene");d(this,"camera");d(this,"ambient");d(this,"dir");d(this,"pt1");d(this,"pt2");d(this,"blocks",[]);d(this,"bGroup",new W.Group);d(this,"galaxy");d(this,"nebula");d(this,"stars");d(this,"galGeo");d(this,"nebGeo");d(this,"bGeo",new W.BoxGeometry(1,1,1));d(this,"eGeo",new W.EdgesGeometry(this.bGeo));d(this,"curScene");d(this,"curCam");d(this,"blockGroup");d(this,"cameraSpeed");d(this,"blockSpeed");d(this,"camT",0);d(this,"mx",0);d(this,"my",0);d(this,"tmx",0);d(this,"tmy",0);d(this,"transitioning",!1);d(this,"useMinecraftTextures",!1);d(this,"resourcesManager");d(this,"atlasTexture",null);d(this,"blockMaterialPool",new Map);d(this,"gradientSky",null);d(this,"gradientSkyTexture",null);d(this,"disposed",!1);d(this,"animTime",0);d(this,"texturesApplied",!1);d(this,"textureLoadInProgress",!1);d(this,"onAssetsTexturesUpdated");let i=Ct;this.curScene=t.initialScene??i.v2Scene,this.curCam=t.initialCamera??i.v2Camera,this.blockGroup=t.initialBlockGroup??i.v2BlockGroup,this.cameraSpeed=t.initialCameraSpeed??Lr.camera,this.blockSpeed=t.initialBlockSpeed??Lr.block,this.useMinecraftTextures=t.useMinecraftTextures??i.minecraftTextures,this.resourcesManager=t.resourcesManager;let s=Gl[this.curScene];this.scene=new W.Scene,this.scene.fog=new W.FogExp2(s.fog,s.fogD),this.applyScenePalette(s),this.camera=new W.PerspectiveCamera(80,this.documentRenderer.canvas.width/this.documentRenderer.canvas.height,.1,700),this.ambient=new W.AmbientLight(s.ambient,2.5),this.scene.add(this.ambient),this.dir=new W.DirectionalLight(s.dir,4),this.dir.position.set(1,1,0),this.scene.add(this.dir),this.pt1=new W.PointLight(s.pt1,5,100),this.scene.add(this.pt1),this.pt2=new W.PointLight(s.pt2,4,80),this.pt2.position.set(30,20,-30),this.scene.add(this.pt2);for(let h=0;h<Ou;h++)this.spawnBlock(s,!0);if(!this.useMinecraftTextures){let h=s.edgeLineColor??62975;for(let p=0;p<40;p++){let m=new W.LineBasicMaterial({color:h,transparent:!0,opacity:.25});pr(this.blocks).mesh.add(new W.LineSegments(this.eGeo,m))}}this.scene.add(this.bGroup);let o=new W.BufferGeometry,l=new Float32Array(5e3*3);for(let h=0;h<5e3*3;h++)l[h]=(Math.random()-.5)*500;o.setAttribute("position",new W.BufferAttribute(l,3)),this.stars=new W.Points(o,new W.PointsMaterial({color:s.starColor??16777215,size:.3,transparent:!0,opacity:s.starOpacity??.7,sizeAttenuation:!0})),this.scene.add(this.stars),this.galGeo=new W.BufferGeometry;let a=new Float32Array(vi*3),v=new Float32Array(vi*3);for(let h=0;h<vi;h++){let p=h%3,m=Math.random(),b=p/3*Math.PI*2+m*Math.PI*5,k=m*90+Math.random()*10,_=(1-m)*18;a[h*3]=Math.cos(b)*k+(Math.random()-.5)*_,a[h*3+1]=(Math.random()-.5)*7,a[h*3+2]=Math.sin(b)*k+(Math.random()-.5)*_-180;let y=.2+m*.8,M=s.galFn(y);v[h*3]=M.r,v[h*3+1]=M.g,v[h*3+2]=M.b}this.galGeo.setAttribute("position",new W.BufferAttribute(a,3)),this.galGeo.setAttribute("color",new W.BufferAttribute(v,3)),this.galaxy=new W.Points(this.galGeo,new W.PointsMaterial({size:.9,vertexColors:!0,transparent:!0,opacity:s.galaxyOpacity??.55,sizeAttenuation:!0})),this.scene.add(this.galaxy),this.nebGeo=new W.BufferGeometry;let c=new Float32Array(ci*3),u=new Float32Array(ci*3);for(let h=0;h<ci;h++){let p=25+Math.random()*110,m=Math.random()*Math.PI*2,b=(Math.random()-.5)*Math.PI*.5;c[h*3]=p*Math.cos(m)*Math.cos(b),c[h*3+1]=p*Math.sin(b)*.6,c[h*3+2]=p*Math.sin(m)*Math.cos(b)-80;let k=new W.Color(pr(s.nebula));u[h*3]=k.r,u[h*3+1]=k.g,u[h*3+2]=k.b}this.nebGeo.setAttribute("position",new W.BufferAttribute(c,3)),this.nebGeo.setAttribute("color",new W.BufferAttribute(u,3)),this.nebula=new W.Points(this.nebGeo,new W.PointsMaterial({size:3,vertexColors:!0,transparent:!0,opacity:s.nebulaOpacity??.3,sizeAttenuation:!0})),this.scene.add(this.nebula),this.addBackgroundTextPlane(),this.setupMouseTracking()}async init(){this.useMinecraftTextures&&this.scheduleMinecraftTextureLoad()}scheduleMinecraftTextureLoad(){!this.useMinecraftTextures||this.disposed||this.texturesApplied||this.textureLoadInProgress||this.tryApplyMinecraftTextures()}attachAssetsListener(){let e=this.resourcesManager;!e||this.onAssetsTexturesUpdated||(this.onAssetsTexturesUpdated=()=>this.scheduleMinecraftTextureLoad(),e.on("assetsTexturesUpdated",this.onAssetsTexturesUpdated))}detachAssetsListener(){let e=this.resourcesManager;!e||!this.onAssetsTexturesUpdated||(e.off("assetsTexturesUpdated",this.onAssetsTexturesUpdated),this.onAssetsTexturesUpdated=void 0)}hasBlockAtlas(e){let t=e.currentResources;return!!(t?.blocksAtlasImage&&t.blocksAtlasJson)}async ensureAtlasReady(e){if(await this.ensureMcDataLoaded(),this.hasBlockAtlas(e))return!0;if(typeof document>"u"&&e!==this.resourcesManager)return!1;e.currentConfig={...e.currentConfig,version:a0,noInventoryGui:!0};try{await e.updateAssetsData?.({})}catch{return!1}return this.hasBlockAtlas(e)}async tryApplyMinecraftTextures(){if(!(this.disposed||!this.useMinecraftTextures||this.texturesApplied)){this.textureLoadInProgress=!0;try{let e=this.resourcesManager??new Rt;if(!await this.ensureAtlasReady(e)){this.resourcesManager&&this.attachAssetsListener();return}if(this.disposed)return;this.applyMinecraftTexturesFromAtlas(e),this.texturesApplied=!0,this.detachAssetsListener()}catch{this.useMinecraftTextures=!1,this.detachAssetsListener()}finally{this.textureLoadInProgress=!1}}}applyScenePalette(e){if(this.documentRenderer.renderer.setClearColor(e.bg),e.gradientBg)if(this.scene.background=null,this.gradientSky){if(this.gradientSky.visible=!0,this.gradientSkyTexture&&e.gradientBg){let s=Nl(e.gradientBg);s&&(this.gradientSkyTexture.dispose(),this.gradientSkyTexture=s,this.gradientSky.material.map=s,this.gradientSky.material.needsUpdate=!0)}}else{let s=Nl(e.gradientBg);s?(this.gradientSkyTexture=s,this.gradientSky=new W.Mesh(new W.PlaneGeometry(900,700),new W.MeshBasicMaterial({map:s,depthWrite:!1,side:W.DoubleSide})),this.gradientSky.position.set(0,0,-280),this.gradientSky.renderOrder=-1e3,this.scene.add(this.gradientSky)):this.scene.background=new W.Color(e.bg)}else this.scene.background=new W.Color(e.bg),this.gradientSky&&(this.gradientSky.visible=!1);this.scene.fog instanceof W.FogExp2&&(this.scene.fog.color.set(e.fog),this.scene.fog.density=e.fogD);let t=this.stars?.material;t&&(t.color.set(e.starColor??16777215),t.opacity=e.starOpacity??.7);let r=this.galaxy?.material;r&&(r.opacity=e.galaxyOpacity??.55);let i=this.nebula?.material;i&&(i.opacity=e.nebulaOpacity??.3)}setupMouseTracking(){let e=r=>{let i=typeof window<"u"?window.innerWidth:this.documentRenderer.canvas.width,s=typeof window<"u"?window.innerHeight:this.documentRenderer.canvas.height;this.tmx=(r.clientX/i-.5)*2,this.tmy=-(r.clientY/s-.5)*2};(typeof document<"u"?document:void 0)?.addEventListener("mousemove",e,{signal:this.abortSignal})}addBackgroundTextPlane(){let r=typeof document<"u"?document.createElement("canvas"):null;if(!r)return;r.width=2048,r.height=768;let i=r.getContext("2d");if(!i)return;i.clearRect(0,0,2048,768),i.save(),i.font="bold 560px Orbitron, sans-serif",i.textAlign="center",i.textBaseline="middle",i.shadowColor="rgba(0,200,255,0.35)",i.shadowBlur=80,i.fillStyle="rgba(255,255,255,0.055)",i.fillText("V2",2048*.28,768*.5),i.restore(),i.save(),i.font="bold 148px Orbitron, sans-serif",i.textAlign="center",i.textBaseline="middle",i.shadowColor="rgba(0,200,255,0.2)",i.shadowBlur=40,i.fillStyle="rgba(255,255,255,0.038)",i.fillText("by ZARDOY",2048*.72,768*.52),i.restore();let s=new W.CanvasTexture(r),o=new W.Mesh(new W.PlaneGeometry(280,105),new W.MeshBasicMaterial({map:s,transparent:!0,opacity:1,depthWrite:!1,side:W.DoubleSide,blending:W.AdditiveBlending}));o.position.set(8,4,-320),this.scene.add(o)}spawnBlock(e,t,r){let i=this.createBlockMaterial(e,r),s=new W.Mesh(this.bGeo,i),o=.3+Math.random()*3;s.scale.setScalar(o),s.position.set((Math.random()-.5)*140,(Math.random()-.5)*70,t?-(Math.random()*140):-155-Math.random()*30),s.rotation.set(Math.random()*Math.PI*2,Math.random()*Math.PI*2,Math.random()*Math.PI*2);let l={mesh:s,spd:.04+Math.random()*.12,dx:(Math.random()-.5)*.012,dy:(Math.random()-.5)*.008,rx:(Math.random()-.5)*.012,ry:(Math.random()-.5)*.012,rz:(Math.random()-.5)*.01,minecraftBlockName:r};this.blocks.push(l),this.bGroup.add(s)}createBlockMaterial(e,t){if(this.useMinecraftTextures&&t){let s=this.blockMaterialPool.get(t);if(s)return s.clone()}let[r,i]=e.blockOpacity??[.32,.46];return new W.MeshBasicMaterial({color:pr(e.blocks),transparent:!0,opacity:r+Math.random()*(i-r),depthWrite:!1,blending:W.AdditiveBlending})}removeBlockEdgeLines(){for(let e of this.blocks){let t=e.mesh.children.filter(r=>r instanceof W.LineSegments);for(let r of t){e.mesh.remove(r),r.geometry?.dispose();let i=r.material;Array.isArray(i)?i.forEach(s=>s.dispose()):i.dispose()}}}async ensureMcDataLoaded(){let e=globalThis._LOAD_MC_DATA;e&&await e()}resolveBlockAtlasUv(e,t,r){let i=s=>{let o=t[s];return o?{u:o.u,v:o.v,su:o.su??r.suSv,sv:o.sv??r.suSv}:null};if(t[e])return i(e);for(let s of["_top","_side","_front","_0"]){let o=i(`${e}${s}`);if(o)return o}for(let s of Object.keys(t))if(s.startsWith(e))return i(s);return null}applyMinecraftTexturesFromAtlas(e){let t=e.currentResources;if(!t?.blocksAtlasImage||!t.blocksAtlasJson)throw new Error("Block atlas not available");let r=t.blocksAtlasJson,i=r.textures;this.atlasTexture=qt(t.blocksAtlasImage),this.atlasTexture.flipY=!1,this.atlasTexture.needsUpdate=!0;for(let s of Cs[this.blockGroup]){let o=this.resolveBlockAtlasUv(s,i,r);if(!o)continue;let l=this.atlasTexture.clone();l.flipY=!1,l.offset.set(o.u,o.v),l.repeat.set(o.su,o.sv),l.needsUpdate=!0;let a=s.includes("glass"),v=new W.MeshBasicMaterial({map:l,side:W.DoubleSide,transparent:a,opacity:a?.85:1,alphaTest:a?.08:0,depthWrite:!0,toneMapped:!1});this.blockMaterialPool.set(s,v)}if(this.blockMaterialPool.size===0)throw new Error("No block textures resolved from atlas (check block names vs atlas keys)");this.removeBlockEdgeLines();for(let s of this.blocks){let o=pr([...this.blockMaterialPool.keys()]);s.minecraftBlockName=o,s.mesh.material=this.blockMaterialPool.get(o).clone()}}setScene(e){if(!_0.includes(e)||e===this.curScene||this.transitioning)return;this.transitioning=!0,this.curScene=e;let t=Gl[e];setTimeout(()=>{if(this.disposed)return;this.applyScenePalette(t),this.ambient.color.set(t.ambient),this.dir.color.set(t.dir),this.pt1.color.set(t.pt1),this.pt2.color.set(t.pt2);for(let s of this.blocks)this.useMinecraftTextures&&s.minecraftBlockName||s.mesh.material instanceof W.MeshBasicMaterial&&s.mesh.material.color.set(pr(t.blocks));let r=this.nebGeo.attributes.color;for(let s=0;s<ci;s++){let o=new W.Color(pr(t.nebula));r.setXYZ(s,o.r,o.g,o.b)}r.needsUpdate=!0;let i=this.galGeo.attributes.color;for(let s=0;s<vi;s++){let o=.2+Math.random()*.8,l=t.galFn(o);i.setXYZ(s,l.r,l.g,l.b)}i.needsUpdate=!0,this.transitioning=!1},150)}setCamera(e){w0.includes(e)&&(this.curCam=e)}setCameraSpeed(e){this.cameraSpeed=Math.max(0,e)}setBlockSpeed(e){this.blockSpeed=Math.max(0,e)}async setBlockGroup(e){if(A0.includes(e)&&e!==this.blockGroup&&(this.blockGroup=e,!(!this.useMinecraftTextures||this.disposed))){for(let t of this.blockMaterialPool.values())t.map?.dispose(),t.dispose();this.blockMaterialPool.clear(),this.texturesApplied=!1,this.scheduleMinecraftTextureLoad()}}getSceneId(){return this.curScene}getCameraId(){return this.curCam}getBlockGroupId(){return this.blockGroup}update(e,t){t&&U0(this.camera,this.documentRenderer.canvas);let r=Hu[this.curCam],i=this.cameraSpeed,s=this.blockSpeed;this.camT+=e*r.spd*i,this.mx+=(this.tmx-this.mx)*.05,this.my+=(this.tmy-this.my)*.05;let o=this.mx*Vl,l=this.my*Vl,a=r.pos(this.camT,o,l),v=r.look(this.camT,o,l);this.camera.position.set(a.x,a.y,a.z),this.camera.lookAt(v.x,v.y,v.z),this.camera.rotation.z=r.roll(this.camT,o);let c=Lu[this.curCam]*s;this.animTime+=e*1e3*s;for(let u of this.blocks){if(u.mesh.position.z+=u.spd*c*60*e,u.mesh.position.x+=u.dx*60*e*s,u.mesh.position.y+=u.dy*60*e*s,u.mesh.rotation.x+=u.rx*c,u.mesh.rotation.y+=u.ry*c,u.mesh.rotation.z+=u.rz,!this.useMinecraftTextures&&u.mesh.material instanceof W.MeshBasicMaterial){let h=u.mesh.userData.baseOpacity??.38;u.mesh.userData.baseOpacity==null&&(u.mesh.userData.baseOpacity=h);let p=.88+Math.abs(Math.sin(this.animTime*8e-4+u.mesh.position.x*.3))*.12;u.mesh.material.opacity=h*p}u.mesh.position.z>this.camera.position.z+15&&u.mesh.position.set((Math.random()-.5)*140,(Math.random()-.5)*70,this.camera.position.z-155-Math.random()*30)}this.pt1.position.set(Math.sin(this.camT*.8)*25+this.camera.position.x,Math.cos(this.camT*.6)*12+this.camera.position.y,this.camera.position.z-18),this.pt2.position.set(Math.cos(this.camT*.5)*20+this.camera.position.x,Math.sin(this.camT*.9)*15+this.camera.position.y,this.camera.position.z-30),this.galaxy.rotation.y+=e*.006*s,this.nebula.rotation.y-=e*.003*s,this.stars.rotation.y+=e*4e-4*s}dispose(){this.disposed=!0,this.detachAssetsListener(),this.scene.clear(),this.bGeo.dispose(),this.eGeo.dispose(),this.galGeo.dispose(),this.nebGeo.dispose(),this.gradientSkyTexture?.dispose(),this.atlasTexture?.dispose();for(let e of this.blockMaterialPool.values())e.map?.dispose(),e.dispose();this.blockMaterialPool.clear()}};A();E();R();x();import*as br from"three";import{Vec3 as jl}from"vec3";A();E();R();x();import Du from"prismarine-world";import Fu from"prismarine-chunk";var Wl=n=>{let e=Du(n),t=Fu(n),r=new e(n).sync,i=zu(r);for(let s of i)if(s.startsWith("set")&&s!=="setColumn"){let o=r[s].bind(r);r[s]=(...l)=>{let a=l[0];a.x!==void 0&&!r.getColumnAt(a)&&r.setColumn(Math.floor(a.x/16),Math.floor(a.z/16),new t(void 0)),o(...l)}}return r};function zu(n){let e=new Set,t=n;do for(let r of Object.getOwnPropertyNames(t))typeof n[r]=="function"&&r!=="constructor"&&e.add(r);while(t=Object.getPrototypeOf(t));return[...e]}var gr=class{constructor(e,t,r){this.documentRenderer=e;this.options=t;this.abortSignal=r;d(this,"_scene");d(this,"_camera");d(this,"worldRenderer");d(this,"WorldRendererClass",z0);this._scene=new br.Scene,this._scene.background=new br.Color(3294568),this._camera=new br.PerspectiveCamera(85,e.canvas.width/e.canvas.height,.05,1e3),this.camera.position.set(0,0,0),this.camera.rotation.set(0,0,0)}get scene(){return this._scene}get camera(){return this._camera}async init(){let e=a0,t=new Rt;if(t.currentConfig={version:e,noInventoryGui:!0},await t.updateAssetsData?.({}),this.abortSignal.aborted)return;let r=Wl(e),s=rv("prismarine-block")(e),l=globalThis.mcData.blocksArray.filter(p=>{if(!p.name.includes("stained_glass"))return!1;let m=s.fromStateId(p.defaultState,0);if(m.shapes?.length!==1)return!1;let b=m.shapes[0];return b[0]===0&&b[1]===0&&b[2]===0&&b[3]===1&&b[4]===1&&b[5]===1}),a=-15,v=100,c=100;for(let p=-v;p<v;p++)for(let m=-c;m<c;m++){let b=l[Math.floor(Math.random()*l.length)];r.setBlockStateId(new jl(p,m,a),b.defaultState)}this._camera.updateProjectionMatrix(),this._camera.position.set(.5,c/2+.5,.5),this._camera.rotation.set(0,0,0);let u=new jl(...this._camera.position.toArray()),h=new b0(r,2,u);this.abortSignal.aborted||(this.worldRenderer=new this.WorldRendererClass(this.documentRenderer.renderer,this.options,{version:e,worldView:h,inWorldRenderingConfig:Sr,playerStateReactive:sa().reactive,rendererState:f0().reactive,nonReactiveState:f0().nonReactive,resourcesManager:t}),this.worldRenderer instanceof z0&&(this._scene=this.worldRenderer.realScene,this._camera=this.worldRenderer.camera),h.init(u),await this.worldRenderer.waitForChunksToRender(),!this.abortSignal.aborted&&this.setupMouseParallax())}update(e,t){t&&U0(this.camera,this.documentRenderer.canvas)}dispose(){this.worldRenderer?.destroy(),this.worldRenderer=void 0,this._scene.clear()}setupMouseParallax(){let e=this._camera,t=e.position.x,r=e.position.y,i;document.body.addEventListener("pointermove",s=>{if(s.pointerType!=="mouse")return;let o=.2,l=s.clientX/window.innerWidth-.5,a=-(s.clientY/window.innerHeight-.5);i?.stop(),i=new Ge(e.position).to({x:t+l*o,y:r+a*o},0),i.start(),e.updateProjectionMatrix()},{signal:this.abortSignal})}};A();E();R();x();import*as Yl from"three";var yr=class{constructor(e,t,r={},i=!1){this.documentRenderer=e;this.options=t;d(this,"active");d(this,"abortController",new AbortController);d(this,"mode");d(this,"lastFrameTime",0);this.mode=ks(r,i)}get v2(){return this.active instanceof V0?this.active:void 0}get scene(){return this.active?.scene}get camera(){return this.active?.camera}async start(e={}){this.active=this.createImplementation(e),await this.active.init(),this.active.scene.background instanceof Yl.Color&&this.documentRenderer.renderer.setClearColor(this.active.scene.background),this.lastFrameTime=performance.now(),this.documentRenderer.render=(t=!1)=>{let r=performance.now(),i=Math.min((r-this.lastFrameTime)/1e3,.05);this.lastFrameTime=r;let s=this.active;s&&(s.update(i,t),this.documentRenderer.renderer.render(s.scene,s.camera))}}createImplementation(e){switch(this.mode){case"v2":return new V0(this.documentRenderer,{useMinecraftTextures:e.useMinecraftTextures,initialScene:e.v2Scene,initialCamera:e.v2Camera,initialBlockGroup:e.v2BlockGroup,initialCameraSpeed:e.v2CameraSpeed,initialBlockSpeed:e.v2BlockSpeed,resourcesManager:e.resourcesManager},this.abortController.signal);case"worldBlocks":return new gr(this.documentRenderer,this.options,this.abortController.signal);default:return new mr(this.documentRenderer)}}dispose(){this.active?.dispose(),this.active=void 0,this.abortController.abort()}};w5.ColorManagement.enabled=!1;globalThis.THREE=w5;var Ql=n=>({updateMap:n.entities.updateMap.bind(n.entities),updateCustomBlock:n.updateCustomBlock.bind(n),getBlockInfo:n.getBlockInfo.bind(n),playEntityAnimation:n.entities.playAnimation.bind(n.entities),damageEntity:n.entities.handleDamageEvent.bind(n.entities),updatePlayerSkin:n.entities.updatePlayerSkin.bind(n.entities),setPlayerVoiceState:n.entities.setPlayerVoiceState.bind(n.entities),applyTemporaryPlayerSkinOverride:n.entities.applyTemporaryPlayerSkinOverride.bind(n.entities),changeHandSwingingState:n.changeHandSwingingState.bind(n),getHighestBlocks:n.getHighestBlocks.bind(n),reloadWorld:n.reloadWorld.bind(n),updateEntityModel:n.entities.updateEntityModel.bind(n.entities),playEntityModelAnimation:n.entities.playEntityModelAnimation.bind(n.entities),addMedia:n.media.addMedia.bind(n.media),destroyMedia:n.media.destroyMedia.bind(n.media),setControlMode:n.media.setControlMode.bind(n.media),setVideoPlaying:n.media.setVideoPlaying.bind(n.media),setVideoSeeking:n.media.setVideoSeeking.bind(n.media),setVideoVolume:n.media.setVideoVolume.bind(n.media),setVideoSpeed:n.media.setVideoSpeed.bind(n.media),handleUserClick:n.media.handleUserClick.bind(n.media),addSectionAnimation(e,t){n.sectionsOffsetsAnimations[e]=t},removeSectionAnimation(e){delete n.sectionsOffsetsAnimations[e]},shakeFromDamage:n.cameraShake.shakeFromDamage.bind(n.cameraShake),onPageInteraction:n.media.onPageInteraction.bind(n.media),downloadMesherLog:n.downloadMesherLog.bind(n),explodeFirework:n.fireworksLegacy.explode.bind(n.fireworksLegacy),explodeFireworkFacingCamera:n.fireworksLegacy.explodeFacingCamera.bind(n.fireworksLegacy),addWaypoint:n.waypoints.addWaypoint.bind(n.waypoints),removeWaypoint:n.waypoints.removeWaypoint.bind(n.waypoints),startCinimaticScript:n.cinimaticScript.startScript.bind(n.cinimaticScript),stopCinimaticScript:n.cinimaticScript.stopScript.bind(n.cinimaticScript),launchFirework:n.fireworks.launchFirework.bind(n.fireworks),setSkyboxImage:n.skyboxRenderer.setSkyboxImage.bind(n.skyboxRenderer),setRain:n.setRain.bind(n),spawnBlockBreakParticles(e,t,r,i,s,o){n.getModule("blockBreakParticles")?.spawnBlockBreakParticles(e,t,r,i,s,o)},spawnBlockCrackParticle(e,t,r,i,s,o,l){n.getModule("blockBreakParticles")?.spawnCrackParticle(e,t,r,i,s,o,l)},async loadGeometryExport(e){let{applyWorldGeometryExport:t}=await Promise.resolve().then(()=>(vs(),V7));return t(n,e)},feedChunkPacket(e){let{kind:t,...r}=e,i={type:t,...r};for(let s of n.workers)s.postMessage(i)},getChunksDebugState(){let e={};for(let t of Object.keys(n.sectionObjects)){let[r,,i]=t.split(",").map(Number);e[`${r},${i}`]=!0}return{loadedSectionsChunks:e,loadedChunks:{...n.loadedChunks},finishedChunks:{...n.finishedChunks}}}}),Vu=[],di=(n,...e)=>{for(let t of Object.values(globalThis.loadedMods??{}))try{t.threeJsBackendModule?.[n]?.(...e)}catch(r){let i=`[mod three.js] Error calling ${n} on ${t.name}: ${r}`;throw new Error(i)}},Kl=()=>{let n,e=null,t=null,r=null,i=null,s=(c,u)=>{c.hello,de?n=Ur(c,Vu,globalThis):n=c,e=new Br(n,u?.canvas),globalThis.renderer=e.renderer,globalThis.documentRenderer=e,globalThis.threeJsBackend=v,di("default",v)},o=async c=>{if(!e)throw new Error("Document renderer not initialized");r&&(r.destroy(),r=null,i=null,globalThis.world=void 0,globalThis.frameTimingCollector=void 0),t&&(t.dispose(),t=null);let u={...n.config.menuBackground,...c};t=new yr(e,{...n},u,!!L.env.SINGLE_FILE_BUILD_MODE),di("menuBackgroundCreated",t),await t.start(u),di("menuBackgroundReady",t)},l=async c=>{if(!e)throw new Error("Document renderer not initialized");t&&(t.dispose(),t=null),r&&(r.destroy(),r=null,i=null,globalThis.world=void 0,globalThis.frameTimingCollector=void 0);let h=de?Ur(c,[Rt,g0],globalThis):c;e.nonReactiveState=h.nonReactiveState,globalThis.resourcesManager=h.resourcesManager,r=new z0(e.renderer,n,h),await r.worldReadyPromise,i=h.inWorldRenderingConfig.enableDebugOverlay?new G5(h.nonReactiveState):null,globalThis.frameTimingCollector=i;let p=e.render;e.render=function(m){p.call(this,m),i?.markFrameStart(),h.inWorldRenderingConfig.paused||r?.render(m),i?.markFrameEnd(),i?.markFrameDisplay()},e.inWorldRenderingConfig=h.inWorldRenderingConfig,globalThis.world=r,di("worldReady",r)},a=()=>{t&&(t.dispose(),t=null),e&&e.dispose(),r&&(r.destroy(),r=null)},v={id:"threejs",displayName:`three.js ${w5.REVISION}`,startMenuBackground:o,startWorld:l,disconnect:a,setRendering(c){e.setPaused(!c),r&&(r.renderingActive=c)},getMenuBackground:()=>t??void 0,getDebugOverlay:()=>({get entitiesString(){return r?.entities.getDebugString()},get left(){return{"Geo Memory":r?.chunkMeshManager.getEstimatedMemoryUsage().total??"-"}}}),updateCamera(c,u,h,p){i?.markCameraUpdate(!c),r?.setFirstPersonCamera(c,u,h,p)},get soundSystem(){return r?.soundSystem},get backendMethods(){if(r)return Ql(r)}};return{main:{init:s,backend:v},workerProxy(){return Ha({init(c,u){s(c,{canvas:u})},updateSizeExternal(c,u,h){e?.updateSizeExternal(c,u,h)},startMenuBackground:o,startWorld:l,disconnect:a,setRendering:v.setRendering,updateCamera(c,u,h,p){let m=c?new Uu(c.x,c.y,c.z):null;i?.markCameraUpdate(!m),v.updateCamera(m,u,h,p)},async callBackendMethod(c,...u){if(!r)throw new Error("World renderer not initialized");let p=Ql(r)[c];if(!p)throw new Error(`Backend method ${String(c)} is unavailable`);return p(...u)}})}}};var ui=n=>{let{main:e}=Kl();return e.init(n),e.backend};ui.id="threejs";ui.displayName="three.js Blocking";ui.description="Simple, old and stable main thread graphics backend providing balanced performance on top of WebGL2.";A();E();R();x();import*as ql from"three";function Gu(n){let e="threeWorker.js",t;if(L.env.SINGLE_FILE_BUILD){let r=document.getElementById("three-worker-code").textContent,i=new Blob([r],{type:"text/javascript"});t=new Worker(window.URL.createObjectURL(i))}else t=new Worker(e);return t.onmessage=({data:r})=>{n(r)},t.on&&t.on("message",r=>{t.onmessage({data:r})}),t}var hi=async n=>{let e={onMessage:a=>{}},t=Gu(a=>{e.onMessage(a)}),r=La(t),i=Ci();i.onSizeChanged((a,v)=>{r.updateSizeExternal(a,v,window.devicePixelRatio||1)});let s=zr(n,t);try{r.init(s,i.canvas)}catch(a){throw R0(s),a}let o=new Proxy({},{get(a,v){if(typeof v=="string")return async(...c)=>r.callBackendMethod(v,...c)}});return{id:"threejs",displayName:`three.js ${ql.REVISION}`,async startMenuBackground(a){let v=a?.resourcesManager?.currentResources?.mcData;if(v){let u={...k0,items:"itemsArray",entities:"entitiesArray"};await e1([t],a0,u,v)}let c=zr(a??{},t);try{await r.startMenuBackground(structuredClone(c))}catch(u){throw R0(c),u}},async startWorld(a){let v=a.worldView;e.onMessage=m=>{m?.type==="reloadLoadedChunks"&&v.reloadLoadedChunks().catch(b=>{})};let c={...k0,items:"itemsArray",entities:"entitiesArray"};await e1([t],a.version,c,a.resourcesManager.currentResources.mcData),a.inWorldRenderingConfig.__syncToWorker=!0,a.playerStateReactive&&(a.playerStateReactive.__syncToWorker=!0),a.rendererState&&(a.rendererState.__syncFromWorker=!0),a.nonReactiveState&&(a.nonReactiveState.__syncFromWorker=!0),a.nonReactiveState.__syncFromWorkerInterval=200;let u=zr(a,t);try{await r.startWorld(structuredClone(u))}catch(m){throw R0(u),m}r.updateSizeExternal(i.size.width,i.size.height,window.devicePixelRatio||1);let h=T0("fps");setInterval(()=>{let{fps:m,avgRenderTime:b,worstRenderTime:k}=a.nonReactiveState;h.updateText(`FPS: ${m.toFixed(0)} (${b.toFixed(0)}ms/${k.toFixed(0)}ms)`),a.nonReactiveState.fps=0},1e3);let p=T0("downloaded-chunks",100,140,20,{className:S0});setInterval(()=>{let m=(n.config.statsVisible??0)>1;p.setVisibility(m),m&&p.updateText(a.nonReactiveState.world.chunksFullInfo)},200)},disconnect(){i.destroy(),r.disconnect(),t.terminate()},setRendering(a){r.setRendering(a)},updateCamera(a,v,c,u){r.updateCamera(a?{x:a.x,y:a.y,z:a.z}:null,v,c,u)},soundSystem:void 0,backendMethods:o}};hi.id="threejs-off-thread";hi.displayName="three.js Multi-thread EXPERIMENTAL";hi.description=["(UNSTABLE, DO NOT USE ON ANDROID).","Edge-cutting technology that uses a dedicated thread for graphics.","Slightly higher power and RAM usage.","More stable FPS (mid-range devices), but possible inputlag if TPS is low.","On low-end devices it might result in device throttling and stuttering."].join(" ");export{Aa as AppViewer,mr as ClassicMenuBackground,Br as DocumentRenderer,_i as HIGH_TEXTURE_COUNT,C5 as LONG_RENDER_TIME_MS,yi as LOW_FPS_THRESHOLD,J0 as LoadedResourcesTransferrable,S0 as MC_RENDERER_DEBUG_OVERLAY_CLASS,a0 as MENU_BACKGROUND_MC_VERSION,Lr as MENU_BACKGROUND_MOTION_DEFAULTS,Ct as MENU_BACKGROUND_OPTION_DEFAULTS,Cs as MINECRAFT_BLOCK_GROUPS,A0 as MINECRAFT_BLOCK_GROUP_IDS,Hr as MINECRAFT_BLOCK_GROUP_LABELS,yr as MenuBackgroundRenderer,kr as PerformanceMonitor,Ea as RENDERER_DEFAULT_OPTIONS,xa as RENDERER_OPTIONS_META,Ra as RENDERER_RENDER_GUI_SECTIONS,Rt as ResourcesManager,V0 as V2MenuBackground,w0 as V2_CAMERA_IDS,Ir as V2_CAMERA_LABELS,_0 as V2_SCENE_IDS,Pr as V2_SCENE_LABELS,gr as WorldBlocksMenuBackground,b0 as WorldView,g0 as WorldViewWorker,Ci as addCanvasForWorker,Fv as applyMenuBackgroundLiveOptions,Kg as applyRendererEnableLighting,Nv as applyRendererOptions,Yg as applyRendererWorldViewOptions,Q0 as chunkPos,hi as createGraphicsBackendOffThread,ui as createGraphicsBackendSingleThread,Xh as createWorldRendererConfig,na as defaultGraphicsBackendConfig,bi as defaultPerformanceInstabilityFactors,Sr as defaultWorldRendererConfig,aa as delayedIterator,wi as formatPerformanceFactorsDebug,f0 as getDefaultRendererState,Ma as getInitialPlayerState,Yv as getInitialPlayerStateRenderer,jv as getPlayerStateUtils,de as isWebWorker,jg as menuBackgroundOptionsFromStorage,Ot as menuBackgroundSpeedToMultiplier,Tv as migrateRendererOptions,Ii as rendererShaderCubeDebugModeToValue,mv as sectionPos,Qg as subscribeRendererOptions};
21701
+ #include <${Ou>=154?"colorspace_fragment":"encodings_fragment"}>
21702
+ }`})}},Rs=class{constructor(e){this.worldRenderer=e;d(this,"points");d(this,"timer",new Pe.Timer);d(this,"enabled",!1);d(this,"currentTime");d(this,"enablementCheck",()=>this.currentTime?this.currentTime>13500&&this.currentTime<23e3:!1);d(this,"render",()=>{if(!this.points)return;this.points.position.set(0,0,0);let e=this.points.material;this.timer.update(performance.now()),e.uniforms.time.value=this.timer.getElapsed()*.2})}enable(){this.enabled||(this.enabled=!0,this.updateVisibility())}disable(){this.enabled&&(this.enabled=!1,this.removeStars())}toggle(){return this.enabled?this.disable():this.enable(),this.enabled}updateTimeOfDay(e){this.currentTime=e,this.enabled&&this.updateVisibility()}updateVisibility(){if(!this.enabled)return;let e=this.enablementCheck?.()??!1;e&&!this.points?this.createStars():!e&&this.points&&this.removeStars()}createStars(){if(this.points)return;let e=80,t=50,r=7e3,i=7,s=10,o=new Pe.BufferGeometry,l=b=>new Pe.Vector3().setFromSpherical(new Pe.Spherical(b,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),a=[],v=[],c=Array.from({length:r},()=>(.5+.5*Math.random())*i),u=new Pe.Color,h=e+t,p=t/r;for(let b=0;b<r;b++)h-=p*Math.random(),a.push(...l(h).toArray()),u.setHSL(b/r,s,.9),v.push(u.r,u.g,u.b);o.setAttribute("position",new Pe.Float32BufferAttribute(a,3)),o.setAttribute("color",new Pe.Float32BufferAttribute(v,3)),o.setAttribute("size",new Pe.Float32BufferAttribute(c,1));let m=new xs;m.blending=Pe.AdditiveBlending,m.depthTest=!0,m.depthWrite=!1,m.transparent=!0,this.points=new Pe.Points(o,m),this.points.renderOrder=-1,this.worldRenderer.scene.add(this.points)}dispose(){this.removeStars()}removeStars(){this.points&&(this.points.geometry.dispose(),this.points.material.dispose(),this.worldRenderer.scene.remove(this.points),this.points=void 0)}},Vl={id:"starfield",controller:Rs,enabledDefault:!0,cannotBeDisabled:!0};var Gl={starfield:Vl,futuristicReveal:Ul,rain:Ol,cameraBobbing:Pl,blockBreakParticles:Bl};var xt=class xt extends K5{constructor(t,r,i){if(!i.resourcesManager)throw new Error("resourcesManager is required in displayOptions");super(i.resourcesManager,i,r);this.renderer=t;this.initOptions=r;this.displayOptions=i;d(this,"outputFormat","threeJs");d(this,"chunkMeshManager");d(this,"cameraSectionPos",new o0(0,0,0));d(this,"holdingBlock");d(this,"holdingBlockLeft");d(this,"scene",new Z.Scene);d(this,"ambientLight",new Z.AmbientLight(13421772,xt.LEGACY_TO_PHYSICAL_LIGHT));d(this,"directionalLight",new Z.DirectionalLight(16777215,.5*xt.LEGACY_TO_PHYSICAL_LIGHT));d(this,"entities",new wn(this,globalThis.mcData));d(this,"performanceMonitor");d(this,"cameraGroupVr");d(this,"material",new Z.MeshBasicMaterial({vertexColors:!0,transparent:!0,alphaTest:.1}));d(this,"itemsTexture");d(this,"cursorBlock");d(this,"onRender",[]);d(this,"lastRenderTime",0);d(this,"lastSciFiTickMs",0);d(this,"animatedFov",0);d(this,"lastFovAnimTime",0);d(this,"cameraShake");d(this,"cameraContainer");d(this,"media");d(this,"waypoints");d(this,"cinimaticScript");d(this,"camera");d(this,"renderTimeAvg",0);d(this,"pendingSectionUpdates",new Map);d(this,"pendingSectionBufferStartTimes",new Map);d(this,"modules",{});d(this,"sectionsOffsetsAnimations",{});d(this,"fountains",[]);d(this,"fireworksLegacy");d(this,"DEBUG_RAYCAST",!1);d(this,"skyboxRenderer");d(this,"fireworks");d(this,"sceneOrigin",new Hn(this.scene));d(this,"cameraWorldPos",{x:0,y:0,z:0});d(this,"_cameraPositionAccessWarned",!1);d(this,"_tmpCameraPos",new Z.Vector3);d(this,"currentPosTween");d(this,"currentRotTween");d(this,"currentCameraTarget",null);d(this,"currentCameraMovementMode",null);d(this,"_tpDirection",new Z.Vector3);d(this,"_tpPitchQuat",new Z.Quaternion);d(this,"_tpYawQuat",new Z.Quaternion);d(this,"_tpFinalQuat",new Z.Quaternion);d(this,"_tpScenePos",new Z.Vector3);d(this,"_tpAxisX",new Z.Vector3(1,0,0));d(this,"_tpAxisY",new Z.Vector3(0,1,0));d(this,"_tpChunkWorldPos",new Z.Vector3);d(this,"debugOverlayAdded",!1);d(this,"debugRaycastHelper");d(this,"debugHitPoint");d(this,"prevFramePerspective",null);this.performanceMonitor=new kr(this.reactiveState.world.instabilityFactors),this.renderer=t;let s=xt.getRendererInfo(t)??"...";i.rendererState.renderer=s,this.chunkMeshManager=new _5(this,this.scene,this.material,this.worldSizeParams.worldHeight,this.viewDistance),this.onRenderDistanceChanged=o=>{this.chunkMeshManager.updateViewDistance(o)},typeof window<"u"&&(window.setBlockLightmap=o=>{this.chunkMeshManager.setBlockLightmapParams(o)}),this.syncSkyLevelFromTime(this.timeOfTheDay),this.cursorBlock=new An(this),this.holdingBlock=a5(this),this.holdingBlockLeft=a5(this,!0);for(let o of Object.values(Gl))this.registerModule(o);this.skyboxRenderer=new Pn(this.realScene,!1,null),this.skyboxRenderer.init(),this.addDebugOverlay(),this.resetScene(),this.init(),this.soundSystem=new Rn(this),this.cameraShake=new kn(this,this.onRender),this.media=new Sn(this),this.fireworksLegacy=new Cn(this),this.waypoints=new Mn(this),this.cinimaticScript=new Bn(this,(o,l,a)=>this.setCinimaticCamera(o,l,a),o=>this.setCinimaticFov(o),()=>({position:new o0(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),yaw:this.cameraShake.getBaseRotation().yaw,pitch:this.cameraShake.getBaseRotation().pitch,fov:this.camera.fov})),this.fireworks=new In(this.realScene,this.sceneOrigin),this.renderUpdateEmitter.on("chunkFinished",o=>{this.finishChunk(o)}),this.worldSwitchActions(),this.initializeModules()}isShaderCubeBlocksEnabled(){return this.worldRendererConfig.shaderCubeBlocks===!0&&!!this.renderer?.capabilities?.isWebGL2}isSmartCullEnabled(){return this.worldRendererConfig.smartCull!==!1&&this.reactiveDebugParams.smartCull!==!1&&this.playerStateReactive.gameMode!=="spectator"}isSectionOcclusionVisible(t){return this.isSmartCullEnabled()?this.chunkMeshManager.isSectionOcclusionVisible(t):!0}entitySectionKey(t,r,i){let s=this.getSectionHeight(),o=Math.floor(t/16)*16,l=Math.floor(r/s)*s,a=Math.floor(i/16)*16;return`${o},${l},${a}`}get sectionObjects(){return this.chunkMeshManager.sectionObjects}get realScene(){return this.scene}get waitingChunksToDisplay(){return this.chunkMeshManager.waitingChunksToDisplay}get estimatedMemoryUsage(){return this.chunkMeshManager.getEstimatedMemoryUsage().total}get tilesRendered(){return this.chunkMeshManager.getTotalTiles()}get blocksRendered(){return this.chunkMeshManager.getTotalBlocks()}registerModule(t){if(t.id in this.modules)return;let r=new t.controller(this),i={manifest:t,controller:r,enabled:!1,toggle:()=>this.toggleModule(t.id)};this.modules[t.id]=i,t.enabledDefault&&this.toggleModule(t.id,!0)}enableModule(t){let r=this.modules[t];r&&(r.enabled||(r.enabled=!0,r.controller.enable(),r.controller.render&&this.onRender.push(r.controller.render)))}disableModule(t){let r=this.modules[t];if(r&&!r.manifest.cannotBeDisabled&&r.enabled&&(r.enabled=!1,r.controller.disable(),r.controller.render)){let i=this.onRender.indexOf(r.controller.render);i>-1&&this.onRender.splice(i,1)}}toggleModule(t,r){let i=this.modules[t];if(!i)return!1;let s=r!==void 0?r:!i.enabled;if(s===i.enabled)return i.enabled;if(!s&&i.manifest.cannotBeDisabled)return!0;if(i.enabled=s,s)i.controller.enable(),i.controller.render&&!this.onRender.includes(i.controller.render)&&this.onRender.push(i.controller.render);else if(i.controller.disable(),i.controller.render){let o=this.onRender.indexOf(i.controller.render);o>-1&&this.onRender.splice(o,1)}return s}setRain(t){this.worldRendererConfig.isRaining=t,this.toggleModule("rain",t)}disposeModules(){for(let t of Object.values(this.modules))t.controller.dispose();this.modules={}}initializeModules(){this.updateModulesFromConfig()}getModule(t){return this.modules[t]?.controller}anyModuleRequiresHeightmap(){return Object.values(this.modules).some(t=>t.enabled&&t.manifest.requiresHeightmap)}get cameraObject(){return this.cameraGroupVr??this.cameraContainer}_wrapCameraPositionWithWarning(){let t=this.camera.position,r=this,i=20,s=(a,v,c)=>Math.abs(a)>i||Math.abs(v)>i||Math.abs(c)>i,o=()=>{!r._cameraPositionAccessWarned&&typeof L<"u"},l=new Proxy(t,{set(a,v,c){return(v==="x"||v==="y"||v==="z")&&typeof c=="number"&&Math.abs(c)>i&&o(),a[v]=c,!0},get(a,v,c){let u=a[v];return v==="set"?function(h,p,m){return s(h,p,m)&&o(),a.set(h,p,m)}:v==="setX"||v==="setY"||v==="setZ"?function(h){return Math.abs(h)>i&&o(),a[v](h)}:v==="copy"?function(h){return s(h.x,h.y,h.z)&&o(),a.copy(h)}:typeof u=="function"?u.bind(a):u}});Object.defineProperty(this.camera,"position",{value:l,configurable:!0,enumerable:!0})}worldSwitchActions(){this.onWorldSwitched.push(()=>{this.getModule("futuristicReveal")?.onWorldSwitched?.(),this.protocolCustomBlocks.clear(),this.sectionsOffsetsAnimations={},this.waypoints.clear(),this.cinimaticScript.stopScript(),this.fireworks.clear(),this.syncSkyLevelFromTime(this.timeOfTheDay)})}downloadWorldGeometry(){ls(this,new Z.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.cameraShake.getBaseRotation(),"world-geometry.json")}updateEntity(t,r=!1){let i=e7(t),s={rotation:{head:{x:i.pitch,y:i.headYaw,z:0}}};r?this.entities.updateEntityPosition(t,!1,s,t.headRotationOnly===!0):this.entities.update(t,s)}updatePlayerEntity(t){this.entities.handlePlayerEntity(t)}resetScene(){this.sceneOrigin.update(0,0,0),this.cameraWorldPos.x=0,this.cameraWorldPos.y=0,this.cameraWorldPos.z=0,this.scene.matrixAutoUpdate=!1,this.scene.background=new Z.Color(this.initOptions.config.sceneBackground),this.scene.add(this.ambientLight),this.directionalLight.position.set(1,1,.5).normalize(),this.directionalLight.castShadow=!0,this.scene.add(this.directionalLight);let t=this.renderer.getSize(new Z.Vector2);this.camera=new Z.PerspectiveCamera(75,t.x/t.y,.1,1e3),this._wrapCameraPositionWithWarning(),this.cameraContainer=new Z.Object3D,this.cameraContainer.add(this.camera),this.scene.add(this.cameraContainer)}watchReactivePlayerState(){super.watchReactivePlayerState(),this.onReactivePlayerStateUpdated("inWater",t=>{this.skyboxRenderer.updateWaterState(t,this.playerStateReactive.waterBreathing)}),this.onReactivePlayerStateUpdated("waterBreathing",t=>{this.skyboxRenderer.updateWaterState(this.playerStateReactive.inWater,t)}),this.onReactivePlayerStateUpdated("ambientLight",t=>{t&&(this.ambientLight.intensity=t*xt.LEGACY_TO_PHYSICAL_LIGHT)}),this.onReactivePlayerStateUpdated("directionalLight",t=>{t&&(this.directionalLight.intensity=t*xt.LEGACY_TO_PHYSICAL_LIGHT)}),this.onReactivePlayerStateUpdated("lookingAtBlock",t=>{this.cursorBlock.setHighlightCursorBlock(t?new o0(t.x,t.y,t.z):null,t?.shapes)}),this.onReactivePlayerStateUpdated("diggingBlock",t=>{this.cursorBlock.updateBreakAnimation(t?{x:t.x,y:t.y,z:t.z}:void 0,t?.stage??null,t?.mergedShape)}),this.onReactivePlayerStateUpdated("perspective",t=>{let r=new o0(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z);this.updateCamera(r,this.cameraShake.getBaseRotation().yaw,this.cameraShake.getBaseRotation().pitch)})}watchReactiveConfig(){super.watchReactiveConfig(),this.onReactiveConfigUpdated("showChunkBorders",i=>{this.updateShowChunksBorder(i)}),this.onReactiveConfigUpdated("defaultSkybox",i=>{this.skyboxRenderer.updateDefaultSkybox(i)}),this.onReactiveConfigUpdated("shaderCubeDebugMode",()=>{this.chunkMeshManager.syncCubeShaderUniforms(),this.chunkMeshManager.syncLegacyShaderUniforms()});let t=()=>{let i=this.worldRendererConfig;this.chunkMeshManager.setShadingTheme(i.shadingTheme,i.cardinalLight)};this.onReactiveConfigUpdated("shadingTheme",t),this.onReactiveConfigUpdated("cardinalLight",t),this.onReactiveConfigUpdated("futuristicReveal",()=>{this.updateModulesFromConfig()}),this.onReactiveDebugUpdated("disableEntities",()=>{this.entities.syncSceneAttachment()});let r=this.displayOptions.inWorldRenderingConfig.handRenderer;this.onReactiveConfigUpdated("handRenderer",i=>{if(i===r)return;r=i;let s=this.holdingBlock.ready,o=this.holdingBlockLeft.ready;this.holdingBlock.dispose(),this.holdingBlockLeft.dispose(),this.holdingBlock=a5(this),this.holdingBlockLeft=a5(this,!0),s&&(this.holdingBlock.ready=!0,this.holdingBlock.updateItem()),o&&(this.holdingBlockLeft.ready=!0,this.holdingBlockLeft.updateItem())}),this.onReactiveConfigUpdated("*",()=>{this.updateModulesFromConfig()}),this.updateModulesFromConfig()}updateModulesFromConfig(){let{moduleStates:t}=this.worldRendererConfig;for(let[r,i]of Object.entries(this.modules)){let s=t[r];if(s==="enabled"){i.enabled||this.toggleModule(r,!0);continue}if(s==="disabled"){i.enabled&&!i.manifest.cannotBeDisabled&&this.toggleModule(r,!1);continue}if(s==="auto"||s===void 0)if(i.controller.autoEnableCheck){let o=i.controller.autoEnableCheck();o&&!i.enabled?this.toggleModule(r,!0):!o&&i.enabled&&!i.manifest.cannotBeDisabled&&this.toggleModule(r,!1)}else{let o=i.manifest.enabledDefault??!1;o&&!i.enabled?this.toggleModule(r,!0):!o&&i.enabled&&!i.manifest.cannotBeDisabled&&this.toggleModule(r,!1)}}}changeHandSwingingState(t,r=!1){let i=r?this.holdingBlockLeft:this.holdingBlock;t?i.startSwing():i.stopSwing()}async updateAssetsData(){let t=this.resourcesManager.currentResources,r=this.material.map,i=this.itemsTexture,s=qt(t.blocksAtlasImage);s.needsUpdate=!0,s.flipY=!1,this.material.map=s,this.chunkMeshManager.syncCubeShaderUniforms(),this.chunkMeshManager.syncLegacyShaderUniforms();let o=qt(t.itemsAtlasImage);o.needsUpdate=!0,o.flipY=!1,this.itemsTexture=o,r&&r.dispose(),i&&i.dispose(),await super.updateAssetsData(),this.onAllTexturesLoaded(),Object.keys(this.loadedChunks).length>0&&this.rerenderAllChunks()}onAllTexturesLoaded(){this.holdingBlock.ready=!0,this.holdingBlock.updateItem(),this.holdingBlockLeft.ready=!0,this.holdingBlockLeft.updateItem()}changeBackgroundColor(t){this.realScene.background=new Z.Color(t[0],t[1],t[2])}changeCardinalLight(t){this.worldRendererConfig.cardinalLight=t}timeUpdated(t){let r=this.getModule("starfield");r?.updateTimeOfDay&&r.updateTimeOfDay(t),this.skyboxRenderer.updateTime(t),this.syncSkyLevelFromTime(t)}syncSkyLevelFromTime(t){let r=Ft(t)/15;this.chunkMeshManager.setSkyLevel(r)}onDayCycleSkyLightChanged(t){}biomeUpdated(t){t?.temperature!==void 0&&this.skyboxRenderer.updateTemperature(t.temperature)}biomeReset(){this.skyboxRenderer.updateTemperature(Z1)}getItemRenderData(t,r){return _7(t,r,this.resourcesManager,this.playerStateReactive)}async demoModel(){let t=cursorBlockRel(0,1,0).position,r=await Nr();r2(r,t);let i=new Z.BoxHelper(r,16776960);r.add(i),this.realScene.add(r)}demoItem(){let t=cursorBlockRel(0,1,0).position,{mesh:r}=this.entities.getItemMesh({itemId:541},{});r.position.set(t.x+.5,t.y+.5,t.z+.5);let i=new Z.BoxHelper(r,16776960);r.add(i),this.realScene.add(r)}addDebugOverlay(){if(this.debugOverlayAdded)return;this.debugOverlayAdded=!0;let t=T0("debug-overlay",80,0,void 0,{className:S0});setInterval(()=>{if(t.setVisibility(this.displayAdvancedStats),this.displayAdvancedStats){let r=c=>new Intl.NumberFormat("en-US",{}).format(c),i=c=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(c),s="";s+=`TE: ${r(this.renderer.info.memory.textures)} `;let o=this.chunkMeshManager.getGlobalBufferStats();if(o.shaderFaces){let c=o.shaderFaces;s+=`CUBE: ${i(c.used)}/${i(c.capacity)}f `}if(o.legacyOpaque){let c=o.legacyOpaque;s+=`LEG-O: ${i(c.used)}/${i(c.capacity)}q `}if(o.legacyBlend){let c=o.legacyBlend;s+=`LEG-B: ${i(c.used)}/${i(c.capacity)}q `}let l=this.chunkMeshManager.getDrawnStats();s+=`DRAWN: ${i(l.cubeFaces)}f ${i(l.legacyOpaqueQuads)}q ${i(l.legacyBlendQuads)}q `,s+=`MEM: ${this.chunkMeshManager.getEstimatedMemoryUsage().total} `;let a=this.cameraCollisionBlockCache.getAllocatedBytes();a>0&&(s+=`CAM: ${i(a)}b `);let v=wi(this.reactiveState.world.instabilityFactors);v&&(s+=`PF: ${v} `),t.updateText(s),this.backendInfoReport=s}},200)}updatePosDataChunk(t){let r=this.sectionObjects[t];if(!r)return;let[i,s,o]=t.split(",").map(c=>Math.floor(+c/16)),a=500-(Math.abs(i-this.cameraSectionPos.x)+Math.abs(s-this.cameraSectionPos.y)+Math.abs(o-this.cameraSectionPos.z)),v=r.mesh??r.shaderMesh??r.children.find(c=>c.name==="mesh"||c.name==="shaderMesh");v&&(v.renderOrder=a)}cameraSectionPositionUpdate(){for(let t in this.sectionObjects)this.sectionObjects[t]&&this.updatePosDataChunk(t)}getDir(t,r){return t===r?0:t<r?1:-1}finishChunk(t){this.chunkMeshManager.finishChunkDisplay(t),this.getModule("futuristicReveal")?.onChunkFinished?.()}applyPendingSectionUpdates(){if(this.pendingSectionUpdates.size===0)return;let t=performance.now(),r=this.getSectionHeight(),i=[];for(let s of this.pendingSectionUpdates.keys()){let o=this.pendingSectionBufferStartTimes.get(s)??t;if(t-o<xt.MAX_SECTION_UPDATE_BUFFER_MS){let[a,v,c]=s.split(",").map(Number),u=[`${a-16},${v},${c}`,`${a+16},${v},${c}`,`${a},${v-r},${c}`,`${a},${v+r},${c}`,`${a},${v},${c-16}`,`${a},${v},${c+16}`],h=!1;for(let p of u)if(this.sectionsWaiting.has(p)&&!this.pendingSectionUpdates.has(p)&&this.sectionObjects[p]){h=!0;break}if(h)continue}i.push(s)}if(i.length!==0)for(let s of i){let o=this.pendingSectionUpdates.get(s);this.pendingSectionUpdates.delete(s),this.pendingSectionBufferStartTimes.delete(s);let l=o.key.split(","),a=`${l[0]},${l[2]}`;if(!this.loadedChunks[a]||!this.active){this.chunkMeshManager.releaseSection(o.key);continue}if(!this.chunkMeshManager.sectionHasRenderableContent(o.geometry)){this.chunkMeshManager.releaseSection(o.key);continue}let v=this.chunkMeshManager.updateSection(o.key,o.geometry);this.updatePosDataChunk(o.key),v&&this.getModule("futuristicReveal")?.onSectionMeshed?.(o.key,o.geometry,v)}}clearPendingSectionUpdatesForChunk(t,r){for(let i of[...this.pendingSectionUpdates.keys()])i.startsWith(`${t},`)&&i.endsWith(`,${r}`)&&(this.pendingSectionUpdates.delete(i),this.pendingSectionBufferStartTimes.delete(i))}handleWorkerMessage(t){if(t.type==="geometry"){let r=t.key.split(","),i=`${r[0]},${r[2]}`;if(!this.loadedChunks[i]||!this.active){this.pendingSectionUpdates.delete(t.key),this.pendingSectionBufferStartTimes.delete(t.key);return}if(this.sectionObjects[t.key]){this.pendingSectionUpdates.set(t.key,t),this.pendingSectionBufferStartTimes.has(t.key)||this.pendingSectionBufferStartTimes.set(t.key,performance.now());return}if(!this.chunkMeshManager.sectionHasRenderableContent(t.geometry)){this.chunkMeshManager.releaseSection(t.key);return}let s=this.chunkMeshManager.updateSection(t.key,t.geometry);this.updatePosDataChunk(t.key),s&&this.getModule("futuristicReveal")?.onSectionMeshed?.(t.key,t.geometry,s)}}getCameraPosition(t){return(t??this._tmpCameraPos).set(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z)}getSectionCameraPosition(){let t=this.getCameraPosition();return new o0(Math.floor(t.x/16),Math.floor(t.y/16),Math.floor(t.z/16))}updateCameraSectionPos(){let t=this.getSectionCameraPosition();this.cameraSectionPos.equals(t)||(this.cameraSectionPos=t,this.cameraSectionPositionUpdate())}setFirstPersonCamera(t,r,i,s){let o=this.playerStateReactive.eyeHeight;this.updateCamera(t?.offset(0,o,0)??null,r,i,s),this.updateCameraSectionPos()}getThirdPersonCamera(t,r,i){t??(t=new Z.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z));let s=this.playerStateReactive.perspective==="third_person_back",o=4,l=this._tpDirection.set(0,0,-1),a=this._tpPitchQuat.setFromAxisAngle(this._tpAxisX,i),v=this._tpYawQuat.setFromAxisAngle(this._tpAxisY,r),c=this._tpFinalQuat.multiplyQuaternions(v,a);l.applyQuaternion(c),s&&l.multiplyScalar(-1),this.DEBUG_RAYCAST&&this.debugRaycast(t,l,o);let u=.25,h=.05,p=.4,m=this.cameraCollisionBlockCache,b=Sl(t.x,t.y,t.z,l.x,l.y,l.z,o,u,h,(_,y,M)=>m.isSolidBlock(_,y,M)),k=o;return b!==void 0&&(k=Math.min(k,b.distance)),k<p&&(k=p),new o0(t.x+l.x*k,t.y+l.y*k,t.z+l.z*k)}debugRaycast(t,r,i){this.debugRaycastHelper&&(this.realScene.remove(this.debugRaycastHelper),this.debugRaycastHelper=void 0),this.debugHitPoint&&(this.realScene.remove(this.debugHitPoint),this.debugHitPoint=void 0);let s=new Z.Vector3(this.sceneOrigin.toSceneX(t.x),this.sceneOrigin.toSceneY(t.y),this.sceneOrigin.toSceneZ(t.z));this.debugRaycastHelper=new Z.ArrowHelper(r.clone().normalize(),s,i,16711680,i*.1,i*.05),this.realScene.add(this.debugRaycastHelper);let o=new Z.SphereGeometry(.2,8,8),l=new Z.MeshBasicMaterial({color:65280});this.debugHitPoint=new Z.Mesh(o,l),this.debugHitPoint.position.copy(s).add(r.clone().multiplyScalar(i)),this.realScene.add(this.debugHitPoint)}setCinimaticCamera(t,r,i){this.cameraWorldPos.x=t.x,this.cameraWorldPos.y=t.y,this.cameraWorldPos.z=t.z,this.sceneOrigin.update(t.x,t.y,t.z),this.cameraObject.position.set(0,0,0),this.cameraShake.setBaseRotation(i,r),this.updateCameraSectionPos()}setCinimaticFov(t){this.animatedFov=t,this.camera.fov=t,this.camera.updateProjectionMatrix()}updateSmoothFov(){if(this.cinimaticScript.running)return;let t=this.displayOptions.inWorldRenderingConfig.fov,r=this.playerStateReactive.fovMultiplier,i=t*(Number.isFinite(r)?r:1),s=performance.now();if(this.animatedFov===0&&(this.animatedFov=i),Math.abs(this.animatedFov-i)>=.01){let o=s-this.lastFovAnimTime,l=Math.min(o/xt.FOV_TRANSITION_MS,1),a=v=>1-(1-v)**3;this.animatedFov+=(i-this.animatedFov)*a(l),Math.abs(this.animatedFov-i)<.01&&(this.animatedFov=i)}else this.animatedFov=i;this.lastFovAnimTime=s,this.camera.fov!==this.animatedFov&&(this.camera.fov=this.animatedFov,this.camera.updateProjectionMatrix())}updateCamera(t,r,i,s){if(!this.cinimaticScript.running){if(t){this.renderer.xr.isPresenting&&(t.y-=this.camera.position.y);let o=this.playerStateUtils.isSpectatingEntity()?"spectating":s?.movementMode??"local-player",l=s?.instant===!0||this.displayOptions.inWorldRenderingConfig.instantCameraUpdate===!0,a={x:t.x,y:t.y,z:t.z},v=k6({target:a,currentTarget:this.currentCameraTarget,movementMode:o,previousMovementMode:this.currentCameraMovementMode,instant:l}),c=R6(o,l);v&&(this.currentCameraTarget={...a},this.currentCameraMovementMode=o,this.currentPosTween?.stop(),l||c===0?(this.cameraWorldPos.x=a.x,this.cameraWorldPos.y=a.y,this.cameraWorldPos.z=a.z,this.sceneOrigin.update(a.x,a.y,a.z),this.cameraObject.position.set(0,0,0),this.currentPosTween=void 0):this.currentPosTween=new Ge(this.cameraWorldPos).to(a,c).onUpdate(()=>{this.sceneOrigin.update(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.cameraObject.position.set(0,0,0)}).start())}if(this.playerStateUtils.isSpectatingEntity()){let o=this.cameraShake.getBaseRotation(),l=0,a=Math.PI/2;o.yaw<a&&r>Math.PI+a?l=-Math.PI*2:r<a&&o.yaw>Math.PI+a&&(l=Math.PI*2),this.currentRotTween?.stop(),this.currentRotTween=new Ge(o).to({pitch:i,yaw:r+l},100).onUpdate(v=>this.cameraShake.setBaseRotation(v.pitch,v.yaw-l)).start()}else{this.currentRotTween?.stop(),this.cameraShake.setBaseRotation(i,r);let{perspective:o}=this.playerStateReactive;if(o==="third_person_back"||o==="third_person_front"){let l=new Z.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),a=this.getThirdPersonCamera(l,r,i),v=l.distanceTo(new Z.Vector3(a.x,a.y,a.z)),c=o==="third_person_back"?v:-v;this.camera.position.set(0,0,c),o==="third_person_front"?this.camera.rotation.set(0,Math.PI,0):this.camera.rotation.set(0,0,0)}else this.camera.position.z=0,this.camera.rotation.set(0,0,0),this.debugRaycastHelper&&(this.realScene.remove(this.debugRaycastHelper),this.debugRaycastHelper=void 0),this.debugHitPoint&&(this.realScene.remove(this.debugHitPoint),this.debugHitPoint=void 0)}this.updateCameraSectionPos()}}debugChunksVisibilityOverride(){let{chunksRenderAboveOverride:t,chunksRenderBelowOverride:r,chunksRenderDistanceOverride:i,chunksRenderAboveEnabled:s,chunksRenderBelowEnabled:o,chunksRenderDistanceEnabled:l}=this.reactiveDebugParams,a=this.getSectionHeight(),v=this.cameraSectionPos.y*a;if(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay&&t!==void 0||r!==void 0||i!==void 0)for(let[c,u]of Object.entries(this.sectionObjects)){if(u._waitingForChunkDisplay)continue;let[h,p,m]=c.split(",").map(Number),b=s&&t!==void 0?p<=v+t:o&&r!==void 0?p>=v-r:l&&i!==void 0?Math.abs(p-v)<=i:!0;u.visible=b}else this.chunkMeshManager.updateSectionsVisibility()}render(t=!1){if(this.currentRenderedFrames++,this.reactiveDebugParams.stopRendering)return;this.debugChunksVisibilityOverride();let r=performance.now();this.lastRendered=performance.now();let i=this.lastRenderTime>0?Math.min(Math.max((r-this.lastRenderTime)/1e3,0),.1):1/60;this.lastRenderTime=r,this.cursorBlock.render(),this.updateSectionOffsets();let s=this.getCameraPosition();if(this.skyboxRenderer.update(s,this.viewDistance),this.updateSmoothFov(),t){let B=this.renderer.getSize(new Z.Vector2);this.camera.aspect=B.width/B.height,this.camera.updateProjectionMatrix()}let o=0,l=this.cameraGroupVr instanceof Z.Group?this.cameraGroupVr.children.find(B=>B instanceof Z.PerspectiveCamera):this.camera;this.applyPendingSectionUpdates();let a=performance.now(),v=a-this.lastSciFiTickMs;this.lastSciFiTickMs=a,this.getModule("futuristicReveal")?.tick?.(v,a);let c=this.cameraWorldPos.x,u=this.cameraWorldPos.y,h=this.cameraWorldPos.z;this.chunkMeshManager.maybeRebase({x:c,y:u,z:h});let p=this.chunkMeshManager.getRenderOrigin(),m=this.chunkMeshManager.globalBlockBuffer;m&&(m.setCameraOrigin(p,c,u,h),m.setDebugOverlay(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay),m.compactStep(),m.hasPendingUploads()&&m.uploadDirtyRange(),m.suppressThreeDraw());let b=this.chunkMeshManager.globalLegacyBuffer;b&&(b.setDebugOverlay(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay),b.compactStep(),b.hasPendingUploads()&&b.uploadDirtyRange(),b.suppressThreeDraw());let k=this.chunkMeshManager.globalLegacyBlendBuffer,_=!1;k&&(k.setDebugOverlay(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay),k.compactStep(),k.hasPendingUploads()&&(k.uploadDirtyRange(),_=!0),k.suppressThreeDraw()),this.chunkMeshManager.markCullDirtyIfBufferStateChanged(),this.chunkMeshManager.setLegacyCameraOrigin(c,u,h),this.chunkMeshManager.updateCullDirtyFromCamera(l,c,u,h);let y=this.isSmartCullEnabled();this.chunkMeshManager.notifySmartCullChanged(y),this.chunkMeshManager.cullDirty&&(this.chunkMeshManager.updateSectionCullAndSort(l,this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z,y),this.chunkMeshManager.clearCullDirty()),this.chunkMeshManager.updateCaveCullingDebug(this.reactiveDebugParams.caveCullingDebug,y);let M=performance.now();this.entities.render(),o=performance.now()-M,this.chunkMeshManager.sortVisibleBlendSections(c,u,h),!_&&k?.hasPendingIndexUploads()&&k.uploadDirtyIndexRange(),this.renderer.render(this.scene,l),this.displayOptions.inWorldRenderingConfig.showHand&&this.playerStateReactive.gameMode!=="spectator"&&this.playerStateReactive.perspective==="first_person"&&!this.renderer.xr.isPresenting&&(this.holdingBlock.render(this.camera,this.renderer,this.ambientLight,this.directionalLight),this.holdingBlockLeft.render(this.camera,this.renderer,this.ambientLight,this.directionalLight));for(let B of this.fountains)this.sectionObjects[B.sectionId]&&!this.sectionObjects[B.sectionId].foutain&&(B.createParticles(this.sectionObjects[B.sectionId]),this.sectionObjects[B.sectionId].foutain=!0),B.render();this.waypoints.render(),this.fireworks.update();for(let B of this.onRender)B(i);let S=performance.now()-r;this.worldRendererConfig.autoLowerRenderDistance&&this.chunkMeshManager.recordRenderTime(S),this.renderTimeAvgCount++,this.renderTimeAvg=(this.renderTimeAvg*(this.renderTimeAvgCount-1)+S)/this.renderTimeAvgCount,this.renderTimeMax=Math.max(this.renderTimeMax,S),this.performanceMonitor.onFrame({totalMs:S,entitiesMs:o,loadedTextureCount:this.renderer.info.memory.textures,fps:this.lastFps})}renderHead(t,r,i,s){let o;if(s.SkullOwner?o=s.SkullOwner.Properties?.textures?.[0]?.Value:o=s.profile?.properties?.find(l=>l.name==="textures")?.value,!!o)try{let a=JSON.parse(O.from(o,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:v}=this.worldRendererConfig;v&&(a=a?.replace("http://textures.minecraft.net/",v).replace("https://textures.minecraft.net/",v));let c=$t(this,a,e0.head),u=new Z.Group;return i&&c.position.set(0,.3125,.3125),c.position.y-=23/16,u.add(c),this.sceneOrigin.track(u),u.position.set(t.x+.5,t.y+.045,t.z+.5),u.rotation.set(0,-Z.MathUtils.degToRad(r*(i?90:45/2)),0),u.scale.set(.8,.8,.8),u}catch{}}lightUpdate(t,r){for(let i=this.worldSizeParams.minY;i<this.worldSizeParams.worldHeight;i+=16)this.setSectionDirty(new o0(t,i,r))}rerenderAllChunks(){for(let t of Object.keys(this.sectionObjects)){let[r,i,s]=t.split(",").map(Number);this.setSectionDirty(new o0(r,i,s))}}updateShowChunksBorder(t){this.chunkMeshManager.updateAllBoxHelpers(t)}resetWorld(){super.resetWorld(),this.pendingSectionUpdates.clear(),this.pendingSectionBufferStartTimes.clear(),this.chunkMeshManager.dispose(),this.chunkMeshManager=new _5(this,this.scene,this.material,this.worldSizeParams.worldHeight,this.viewDistance),this.debugRaycastHelper&&(this.realScene.remove(this.debugRaycastHelper),this.debugRaycastHelper=void 0),this.debugHitPoint&&(this.realScene.remove(this.debugHitPoint),this.debugHitPoint=void 0)}getLoadedChunksRelative(t,r=!1){let[i,s,o]=ji(t);return Object.fromEntries(Object.entries(this.sectionObjects).map(([l,a])=>{let[v,c,u]=l.split(",").map(Number),[h,p,m]=ji({x:v,y:c,z:u});return[r?`${h-i},${p-s},${m-o}`:`${h-i},${m-o}`,a]}))}readdChunks(){for(let t of Object.keys(this.sectionObjects))this.scene.remove(this.sectionObjects[t]);setTimeout(()=>{for(let t of Object.keys(this.sectionObjects))this.scene.add(this.sectionObjects[t])},500)}disableUpdates(t=this.scene.children){for(let r of t)r.matrixWorldNeedsUpdate=!1,this.disableUpdates(r.children??[])}removeColumn(t,r){super.removeColumn(t,r),this.clearPendingSectionUpdatesForChunk(t,r);let i=this.getSectionHeight(),s=this.worldMinYRender;for(let o=s;o<this.worldSizeParams.worldHeight;o+=i){let l=`${t},${o},${r}`;this.chunkMeshManager.sectionObjects[l]&&this.chunkMeshManager.releaseSection(l)}this.chunkMeshManager.onChunkRemovedFromGate(`${t},${r}`)}updateViewerPosition(t){super.updateViewerPosition(t),this.chunkMeshManager.pendingNearReveal.size>0&&this.chunkMeshManager.tryRevealPending()}onViewerChunkPositionChanged(){this.chunkMeshManager.tryRevealPending()}setSectionDirty(...t){super.setSectionDirty(...t)}static getRendererInfo(t){try{let r=t.getContext();return`${r.getParameter(r.getExtension("WEBGL_debug_renderer_info").UNMASKED_RENDERER_WEBGL)}`}catch{}}worldStop(){this.media.onWorldStop()}destroy(){this.performanceMonitor?.reset(),this.pendingSectionUpdates.clear(),this.pendingSectionBufferStartTimes.clear(),this.chunkMeshManager.dispose(),this.disposeModules(),this.fireworksLegacy.destroy(),super.destroy(),this.skyboxRenderer.dispose(),this.fireworks.dispose()}shouldObjectVisible(t){let i=this.getSectionHeight(),s,o,l,a=this.sceneOrigin.getWorldPosition(t);a?(s=a.x,o=a.y,l=a.z):(s=this.sceneOrigin.toWorldX(t.position.x),o=this.sceneOrigin.toWorldY(t.position.y),l=this.sceneOrigin.toWorldZ(t.position.z));let v=Math.floor(s/16)*16,c=Math.floor(l/16)*16,u=Math.floor(o/i)*i,h=`${v},${c}`,p=`${v},${u},${c}`;return!!this.finishedChunks[h]||!!this.sectionObjects[p]}handleUserClick(t){this.media.handleUserClick(t)}updateSectionOffsets(){let t=performance.now();for(let[r,i]of Object.entries(this.sectionsOffsetsAnimations)){let s=(t-i.time)/1e3;i.time=t,i.currentOffsetX+=i.speedX*s,i.currentOffsetY+=i.speedY*s,i.currentOffsetZ+=i.speedZ*s,i.limitX!==void 0&&(i.speedX>0?i.currentOffsetX=Math.min(i.currentOffsetX,i.limitX):i.currentOffsetX=Math.max(i.currentOffsetX,i.limitX)),i.limitY!==void 0&&(i.speedY>0?i.currentOffsetY=Math.min(i.currentOffsetY,i.limitY):i.currentOffsetY=Math.max(i.currentOffsetY,i.limitY)),i.limitZ!==void 0&&(i.speedZ>0?i.currentOffsetZ=Math.min(i.currentOffsetZ,i.limitZ):i.currentOffsetZ=Math.max(i.currentOffsetZ,i.limitZ));let o=this.sectionObjects[r];o&&(o.position.set(i.currentOffsetX,i.currentOffsetY,i.currentOffsetZ),o.updateMatrix())}}reloadWorld(){this.entities.reloadEntities()}};d(xt,"LEGACY_TO_PHYSICAL_LIGHT",Math.PI),d(xt,"FOV_TRANSITION_MS",200),d(xt,"MAX_SECTION_UPDATE_BUFFER_MS",500);var z0=xt;A();E();R();x();A();E();R();x();var a0="1.21.4";A();E();R();x();function U0(n,e){n.aspect=e.width/e.height,n.updateProjectionMatrix()}A();E();R();x();function ks(n,e=!1){return n?.mode?n.mode:e?"worldBlocks":Ct.mode}A();E();R();x();import*as ue from"three";A();E();R();x();function Ss(...n){let e=n.filter(r=>r.length>0).join("/"),t=typeof globalThis.location<"u"&&globalThis.location.href?globalThis.location.href:typeof import.meta<"u"&&import.meta.url?import.meta.url:`/${e}`;try{return new URL(e,t).href}catch{return`/${e}`}}var Ts=new Date,Nl=Ts.getMonth()===11&&Ts.getDate()>=24&&Ts.getDate()<=26,Du=["panorama_3.webp","panorama_1.webp","panorama_4.webp","panorama_5.webp","panorama_0.webp","panorama_2.webp"],Fu=200,mr=class{constructor(e){this.documentRenderer=e;d(this,"scene");d(this,"camera");d(this,"startTimes",new Map);d(this,"time",0);d(this,"panoramaGroup",null);this.scene=new ue.Scene,this.scene.background=new ue.Color(3294568);let t=new ue.AmbientLight(13421772);this.scene.add(t);let r=new ue.DirectionalLight(16777215,.5);r.position.set(1,1,.5).normalize(),r.castShadow=!0,this.scene.add(r),this.camera=new ue.PerspectiveCamera(85,e.canvas.width/e.canvas.height,.05,1e3),this.camera.position.set(0,0,0),this.camera.rotation.set(0,0,0)}async init(){this.buildCubemap()}update(e,t){t&&U0(this.camera,this.documentRenderer.canvas)}dispose(){this.scene.clear(),this.panoramaGroup=null,this.startTimes.clear()}buildCubemap(){let e=new ue.BoxGeometry(1e3,1e3,1e3),t=[];for(let s of Du)(async()=>{let l=Ss("background",Nl?"christmas":"",s),a=await x0(l),v=qt(a);v.matrixAutoUpdate=!1,v.matrix.set(-1,0,1,0,1,0,0,0,1),v.wrapS=ue.ClampToEdgeWrapping,v.wrapT=ue.ClampToEdgeWrapping,v.minFilter=ue.LinearFilter,v.magFilter=ue.LinearFilter;let c=new ue.MeshBasicMaterial({map:v,transparent:!0,side:ue.DoubleSide,depthWrite:!1,opacity:0});this.startTimes.set(c,Date.now()),t.push(c)})().catch(l=>{});let r=new ue.Mesh(e,t);r.onBeforeRender=()=>{this.time+=.01,r.rotation.y=Math.PI+this.time*.01,r.rotation.z=Math.sin(-this.time*.001)*.001;for(let s of t){let o=this.startTimes.get(s);if(o){let l=Date.now()-o;s.opacity=Math.min(1,l/Fu)}}};let i=new ue.Object3D;if(i.add(r),!Nl)for(let s=0;s<20;s++){let o=new Gt("1.16.4","squid").mesh;o.position.set(Math.random()*30-15,Math.random()*20-10,Math.random()*10-17),o.rotation.set(0,Math.PI+Math.random(),-Math.PI/4,"ZYX");let l=Math.random()*.01;o.children[0].onBeforeRender=()=>{o.rotation.y+=l,o.rotation.z=Math.cos(r.rotation.y*3)*Math.PI/4-Math.PI/2},i.add(o)}this.scene.add(i),this.panoramaGroup=i}async debugImageInFrontOfCamera(){let e=await x0(Ss("background","panorama_0.webp")),t=qt(e),r=new ue.Mesh(new ue.PlaneGeometry(1e3,1e3),new ue.MeshBasicMaterial({map:t}));r.position.set(0,0,-500),this.scene.add(r)}};A();E();R();x();import*as W from"three";var Wl=.1,Cs={mixed:["white_wool","cyan_wool","blue_wool","purple_wool","white_stained_glass","cyan_stained_glass","blue_stained_glass","purple_stained_glass","glowstone","sea_lantern","amethyst_block","copper_block","gold_block","diamond_block"],stainedGlass:["white_stained_glass","orange_stained_glass","magenta_stained_glass","light_blue_stained_glass","yellow_stained_glass","lime_stained_glass","pink_stained_glass","gray_stained_glass","light_gray_stained_glass","cyan_stained_glass","purple_stained_glass","blue_stained_glass","brown_stained_glass","green_stained_glass","red_stained_glass","black_stained_glass"],wool:["white_wool","orange_wool","magenta_wool","light_blue_wool","yellow_wool","lime_wool","pink_wool","gray_wool","light_gray_wool","cyan_wool","purple_wool","blue_wool","brown_wool","green_wool","red_wool","black_wool"],construction:["copper_block","exposed_copper","weathered_copper","oxidized_copper","cut_copper","exposed_cut_copper","weathered_cut_copper","oxidized_cut_copper","iron_block","gold_block","diamond_block","emerald_block","netherite_block","lapis_block","redstone_block","coal_block","quartz_block","amethyst_block","bricks","stone_bricks","deepslate_bricks","polished_blackstone"],glow:["glowstone","sea_lantern","shroomlight","ochre_froglight","verdant_froglight","pearlescent_froglight","redstone_lamp","beacon"],world:["grass_block","podzol","mycelium","dirt","coarse_dirt","rooted_dirt","mud","clay","stone","cobblestone","mossy_cobblestone","deepslate","cobbled_deepslate","tuff","calcite","sand","red_sand","gravel","snow_block","coal_ore","deepslate_coal_ore","iron_ore","deepslate_iron_ore","copper_ore","deepslate_copper_ore","gold_ore","deepslate_gold_ore","diamond_ore","deepslate_diamond_ore","emerald_ore","deepslate_emerald_ore","lapis_ore","deepslate_lapis_ore","redstone_ore","deepslate_redstone_ore","nether_gold_ore","ancient_debris","oak_log","birch_log","spruce_log","jungle_log","acacia_log","dark_oak_log","mangrove_log","cherry_log","netherrack","soul_sand","basalt","end_stone"]},jl={galaxy:{bg:132114,fog:132114,fogD:.011,blocks:[61695,54527,47359,59647,2280703,43263],emit:[13158,8789,6724],nebula:[4403,1114146,4386],galFn:n=>new W.Color(n*.05,n*.2,n),ambient:264216,dir:3368703,pt1:43775,pt2:16729343,name:"GALAXY"},nether:{bg:917760,fog:917760,fogD:.016,blocks:[16720384,16737792,16750848,13373696,16729122,16755200],emit:[2230272,1114112,3346688],nebula:[1704960,851968,1705984],galFn:n=>new W.Color(n,n*.15,0),ambient:1573376,dir:16724736,pt1:16729088,pt2:16755200,name:"NETHER"},end:{bg:0,fog:0,fogD:.009,blocks:[7807658,11158732,5570679,14527231,3342421,12299007],emit:[655381,1572901,327696],nebula:[524312,851989,262158],galFn:n=>new W.Color(n*.4,0,n),ambient:393232,dir:10040319,pt1:11158783,pt2:4456618,name:"THE END"},cyber:{bg:792610,fog:792610,fogD:.008,blocks:[65535,4521932,11206468,6741503,8978278,65450],emit:[666163,668450,665656],nebula:[1192e3,1587240,1323588],galFn:n=>new W.Color(n*.15,n*.85,n*.95),ambient:1716288,dir:6750156,pt1:4521966,pt2:10092356,name:"CYBER",starColor:13431039,starOpacity:.75,galaxyOpacity:.62,nebulaOpacity:.36,edgeLineColor:4521949,blockOpacity:[.38,.54]},light:{bg:8951984,fog:7899296,fogD:.006,gradientBg:{top:14214392,mid:10531016,bottom:6846608,radial:!0},blocks:[15266559,13691135,12114175,10537208,8960240,7383272,10012927,12640511,15792383,7909608,14216447,14739711],emit:[6854864,8958176,11061488,12638456],nebula:[9480392,11059424,12637420,14215416,7901360],galFn:n=>{let e=new W.Color;return n<.4?e.lerpColors(new W.Color(16054527),new W.Color(14215423),n/.4):n<.75?e.lerpColors(new W.Color(14215423),new W.Color(11061488),(n-.4)/.35):e.lerpColors(new W.Color(11061488),new W.Color(9482464),(n-.75)/.25),e},ambient:7899296,dir:13688040,pt1:11061503,pt2:13162751,name:"LIGHT",starColor:15266047,starOpacity:.5,galaxyOpacity:.7,nebulaOpacity:.32,edgeLineColor:10010856,blockOpacity:[.42,.56]}},zu={cruise:{pos:(n,e,t)=>({x:Math.sin(n*.28)*18+Math.cos(n*.11)*7+e*10,y:Math.sin(n*.19)*6+Math.cos(n*.31)*3+t*6,z:0}),look:(n,e,t)=>({x:Math.sin((n+.18)*.28)*18+e*8,y:Math.sin((n+.18)*.19)*6+t*4,z:-25}),roll:(n,e=0)=>e*.05+Math.sin(n*.22)*.015,spd:.18},barrel:{pos:(n,e,t)=>{let i=n*2.4;return{x:Math.cos(i)*10+e*4,y:Math.sin(i)*10+t*4,z:Math.sin(n*.4)*8}},look:n=>({x:Math.sin(n*.5)*5,y:Math.cos(n*.5)*5,z:-30}),roll:n=>n*2.4+Math.PI*.5,spd:.24},dive:{pos:(n,e,t)=>({x:Math.sin(n*.6)*30+e*8,y:Math.cos(n*.4)*18+t*6,z:Math.sin(n*.3)*12}),look:(n,e,t)=>({x:Math.sin(n*.6+.2)*30+e*6,y:Math.cos(n*.4+.2)*18-8+t*4,z:-35}),roll:(n,e=0)=>e*.08+Math.sin(n*.6)*.12,spd:.3},orbit:{pos:(n,e,t)=>({x:Math.cos(n*.5)*20+e*5,y:Math.sin(n*.25)*10+t*5,z:Math.sin(n*.5)*20}),look:()=>({x:0,y:0,z:-60}),roll:n=>Math.sin(n*.5)*.08,spd:.15},snake:{pos:(n,e,t)=>({x:Math.sin(n*1.1)*22+Math.sin(n*.37)*8+e*10,y:Math.sin(n*.7)*10+e*4+t*8,z:0}),look:(n,e,t)=>{let r=n+.12;return{x:Math.sin(r*1.1)*22+Math.sin(r*.37)*8+e*8,y:Math.sin(r*.7)*10+t*6,z:-22}},roll:(n,e=0)=>e*.1+Math.sin(n*1.1)*.06,spd:.22}},Uu={cruise:1,barrel:1.6,dive:2.2,orbit:.7,snake:1.4},Vu=250,vi=1e4,ci=3e3,pr=n=>n[Math.floor(Math.random()*n.length)],Ms=n=>"#"+n.toString(16).padStart(6,"0"),Yl=n=>{if(typeof document>"u")return null;let e=document.createElement("canvas");e.width=4,e.height=512;let t=e.getContext("2d");if(!t)return null;let r=e.width,i=e.height,s=n.radial?t.createRadialGradient(r/2,i*.32,0,r/2,i*.32,i*.85):t.createLinearGradient(0,0,0,i);s.addColorStop(0,Ms(n.top)),n.mid!=null&&s.addColorStop(.45,Ms(n.mid)),s.addColorStop(1,Ms(n.bottom)),t.fillStyle=s,t.fillRect(0,0,r,i);let o=new W.CanvasTexture(e);return o.needsUpdate=!0,o},V0=class{constructor(e,t={},r){this.documentRenderer=e;this.abortSignal=r;d(this,"scene");d(this,"camera");d(this,"ambient");d(this,"dir");d(this,"pt1");d(this,"pt2");d(this,"blocks",[]);d(this,"bGroup",new W.Group);d(this,"galaxy");d(this,"nebula");d(this,"stars");d(this,"galGeo");d(this,"nebGeo");d(this,"bGeo",new W.BoxGeometry(1,1,1));d(this,"eGeo",new W.EdgesGeometry(this.bGeo));d(this,"curScene");d(this,"curCam");d(this,"blockGroup");d(this,"cameraSpeed");d(this,"blockSpeed");d(this,"camT",0);d(this,"mx",0);d(this,"my",0);d(this,"tmx",0);d(this,"tmy",0);d(this,"transitioning",!1);d(this,"useMinecraftTextures",!1);d(this,"resourcesManager");d(this,"atlasTexture",null);d(this,"blockMaterialPool",new Map);d(this,"gradientSky",null);d(this,"gradientSkyTexture",null);d(this,"disposed",!1);d(this,"animTime",0);d(this,"texturesApplied",!1);d(this,"textureLoadInProgress",!1);d(this,"onAssetsTexturesUpdated");let i=Ct;this.curScene=t.initialScene??i.v2Scene,this.curCam=t.initialCamera??i.v2Camera,this.blockGroup=t.initialBlockGroup??i.v2BlockGroup,this.cameraSpeed=t.initialCameraSpeed??Lr.camera,this.blockSpeed=t.initialBlockSpeed??Lr.block,this.useMinecraftTextures=t.useMinecraftTextures??i.minecraftTextures,this.resourcesManager=t.resourcesManager;let s=jl[this.curScene];this.scene=new W.Scene,this.scene.fog=new W.FogExp2(s.fog,s.fogD),this.applyScenePalette(s),this.camera=new W.PerspectiveCamera(80,this.documentRenderer.canvas.width/this.documentRenderer.canvas.height,.1,700),this.ambient=new W.AmbientLight(s.ambient,2.5),this.scene.add(this.ambient),this.dir=new W.DirectionalLight(s.dir,4),this.dir.position.set(1,1,0),this.scene.add(this.dir),this.pt1=new W.PointLight(s.pt1,5,100),this.scene.add(this.pt1),this.pt2=new W.PointLight(s.pt2,4,80),this.pt2.position.set(30,20,-30),this.scene.add(this.pt2);for(let h=0;h<Vu;h++)this.spawnBlock(s,!0);if(!this.useMinecraftTextures){let h=s.edgeLineColor??62975;for(let p=0;p<40;p++){let m=new W.LineBasicMaterial({color:h,transparent:!0,opacity:.25});pr(this.blocks).mesh.add(new W.LineSegments(this.eGeo,m))}}this.scene.add(this.bGroup);let o=new W.BufferGeometry,l=new Float32Array(5e3*3);for(let h=0;h<5e3*3;h++)l[h]=(Math.random()-.5)*500;o.setAttribute("position",new W.BufferAttribute(l,3)),this.stars=new W.Points(o,new W.PointsMaterial({color:s.starColor??16777215,size:.3,transparent:!0,opacity:s.starOpacity??.7,sizeAttenuation:!0})),this.scene.add(this.stars),this.galGeo=new W.BufferGeometry;let a=new Float32Array(vi*3),v=new Float32Array(vi*3);for(let h=0;h<vi;h++){let p=h%3,m=Math.random(),b=p/3*Math.PI*2+m*Math.PI*5,k=m*90+Math.random()*10,_=(1-m)*18;a[h*3]=Math.cos(b)*k+(Math.random()-.5)*_,a[h*3+1]=(Math.random()-.5)*7,a[h*3+2]=Math.sin(b)*k+(Math.random()-.5)*_-180;let y=.2+m*.8,M=s.galFn(y);v[h*3]=M.r,v[h*3+1]=M.g,v[h*3+2]=M.b}this.galGeo.setAttribute("position",new W.BufferAttribute(a,3)),this.galGeo.setAttribute("color",new W.BufferAttribute(v,3)),this.galaxy=new W.Points(this.galGeo,new W.PointsMaterial({size:.9,vertexColors:!0,transparent:!0,opacity:s.galaxyOpacity??.55,sizeAttenuation:!0})),this.scene.add(this.galaxy),this.nebGeo=new W.BufferGeometry;let c=new Float32Array(ci*3),u=new Float32Array(ci*3);for(let h=0;h<ci;h++){let p=25+Math.random()*110,m=Math.random()*Math.PI*2,b=(Math.random()-.5)*Math.PI*.5;c[h*3]=p*Math.cos(m)*Math.cos(b),c[h*3+1]=p*Math.sin(b)*.6,c[h*3+2]=p*Math.sin(m)*Math.cos(b)-80;let k=new W.Color(pr(s.nebula));u[h*3]=k.r,u[h*3+1]=k.g,u[h*3+2]=k.b}this.nebGeo.setAttribute("position",new W.BufferAttribute(c,3)),this.nebGeo.setAttribute("color",new W.BufferAttribute(u,3)),this.nebula=new W.Points(this.nebGeo,new W.PointsMaterial({size:3,vertexColors:!0,transparent:!0,opacity:s.nebulaOpacity??.3,sizeAttenuation:!0})),this.scene.add(this.nebula),this.addBackgroundTextPlane(),this.setupMouseTracking()}async init(){this.useMinecraftTextures&&this.scheduleMinecraftTextureLoad()}scheduleMinecraftTextureLoad(){!this.useMinecraftTextures||this.disposed||this.texturesApplied||this.textureLoadInProgress||this.tryApplyMinecraftTextures()}attachAssetsListener(){let e=this.resourcesManager;!e||this.onAssetsTexturesUpdated||(this.onAssetsTexturesUpdated=()=>this.scheduleMinecraftTextureLoad(),e.on("assetsTexturesUpdated",this.onAssetsTexturesUpdated))}detachAssetsListener(){let e=this.resourcesManager;!e||!this.onAssetsTexturesUpdated||(e.off("assetsTexturesUpdated",this.onAssetsTexturesUpdated),this.onAssetsTexturesUpdated=void 0)}hasBlockAtlas(e){let t=e.currentResources;return!!(t?.blocksAtlasImage&&t.blocksAtlasJson)}async ensureAtlasReady(e){if(await this.ensureMcDataLoaded(),this.hasBlockAtlas(e))return!0;if(typeof document>"u"&&e!==this.resourcesManager)return!1;e.currentConfig={...e.currentConfig,version:a0,noInventoryGui:!0};try{await e.updateAssetsData?.({})}catch{return!1}return this.hasBlockAtlas(e)}async tryApplyMinecraftTextures(){if(!(this.disposed||!this.useMinecraftTextures||this.texturesApplied)){this.textureLoadInProgress=!0;try{let e=this.resourcesManager??new Rt;if(!await this.ensureAtlasReady(e)){this.resourcesManager&&this.attachAssetsListener();return}if(this.disposed)return;this.applyMinecraftTexturesFromAtlas(e),this.texturesApplied=!0,this.detachAssetsListener()}catch{this.useMinecraftTextures=!1,this.detachAssetsListener()}finally{this.textureLoadInProgress=!1}}}applyScenePalette(e){if(this.documentRenderer.renderer.setClearColor(e.bg),e.gradientBg)if(this.scene.background=null,this.gradientSky){if(this.gradientSky.visible=!0,this.gradientSkyTexture&&e.gradientBg){let s=Yl(e.gradientBg);s&&(this.gradientSkyTexture.dispose(),this.gradientSkyTexture=s,this.gradientSky.material.map=s,this.gradientSky.material.needsUpdate=!0)}}else{let s=Yl(e.gradientBg);s?(this.gradientSkyTexture=s,this.gradientSky=new W.Mesh(new W.PlaneGeometry(900,700),new W.MeshBasicMaterial({map:s,depthWrite:!1,side:W.DoubleSide})),this.gradientSky.position.set(0,0,-280),this.gradientSky.renderOrder=-1e3,this.scene.add(this.gradientSky)):this.scene.background=new W.Color(e.bg)}else this.scene.background=new W.Color(e.bg),this.gradientSky&&(this.gradientSky.visible=!1);this.scene.fog instanceof W.FogExp2&&(this.scene.fog.color.set(e.fog),this.scene.fog.density=e.fogD);let t=this.stars?.material;t&&(t.color.set(e.starColor??16777215),t.opacity=e.starOpacity??.7);let r=this.galaxy?.material;r&&(r.opacity=e.galaxyOpacity??.55);let i=this.nebula?.material;i&&(i.opacity=e.nebulaOpacity??.3)}setupMouseTracking(){let e=r=>{let i=typeof window<"u"?window.innerWidth:this.documentRenderer.canvas.width,s=typeof window<"u"?window.innerHeight:this.documentRenderer.canvas.height;this.tmx=(r.clientX/i-.5)*2,this.tmy=-(r.clientY/s-.5)*2};(typeof document<"u"?document:void 0)?.addEventListener("mousemove",e,{signal:this.abortSignal})}addBackgroundTextPlane(){let r=typeof document<"u"?document.createElement("canvas"):null;if(!r)return;r.width=2048,r.height=768;let i=r.getContext("2d");if(!i)return;i.clearRect(0,0,2048,768),i.save(),i.font="bold 560px Orbitron, sans-serif",i.textAlign="center",i.textBaseline="middle",i.shadowColor="rgba(0,200,255,0.35)",i.shadowBlur=80,i.fillStyle="rgba(255,255,255,0.055)",i.fillText("V2",2048*.28,768*.5),i.restore(),i.save(),i.font="bold 148px Orbitron, sans-serif",i.textAlign="center",i.textBaseline="middle",i.shadowColor="rgba(0,200,255,0.2)",i.shadowBlur=40,i.fillStyle="rgba(255,255,255,0.038)",i.fillText("by ZARDOY",2048*.72,768*.52),i.restore();let s=new W.CanvasTexture(r),o=new W.Mesh(new W.PlaneGeometry(280,105),new W.MeshBasicMaterial({map:s,transparent:!0,opacity:1,depthWrite:!1,side:W.DoubleSide,blending:W.AdditiveBlending}));o.position.set(8,4,-320),this.scene.add(o)}spawnBlock(e,t,r){let i=this.createBlockMaterial(e,r),s=new W.Mesh(this.bGeo,i),o=.3+Math.random()*3;s.scale.setScalar(o),s.position.set((Math.random()-.5)*140,(Math.random()-.5)*70,t?-(Math.random()*140):-155-Math.random()*30),s.rotation.set(Math.random()*Math.PI*2,Math.random()*Math.PI*2,Math.random()*Math.PI*2);let l={mesh:s,spd:.04+Math.random()*.12,dx:(Math.random()-.5)*.012,dy:(Math.random()-.5)*.008,rx:(Math.random()-.5)*.012,ry:(Math.random()-.5)*.012,rz:(Math.random()-.5)*.01,minecraftBlockName:r};this.blocks.push(l),this.bGroup.add(s)}createBlockMaterial(e,t){if(this.useMinecraftTextures&&t){let s=this.blockMaterialPool.get(t);if(s)return s.clone()}let[r,i]=e.blockOpacity??[.32,.46];return new W.MeshBasicMaterial({color:pr(e.blocks),transparent:!0,opacity:r+Math.random()*(i-r),depthWrite:!1,blending:W.AdditiveBlending})}removeBlockEdgeLines(){for(let e of this.blocks){let t=e.mesh.children.filter(r=>r instanceof W.LineSegments);for(let r of t){e.mesh.remove(r),r.geometry?.dispose();let i=r.material;Array.isArray(i)?i.forEach(s=>s.dispose()):i.dispose()}}}async ensureMcDataLoaded(){let e=globalThis._LOAD_MC_DATA;e&&await e()}resolveBlockAtlasUv(e,t,r){let i=s=>{let o=t[s];return o?{u:o.u,v:o.v,su:o.su??r.suSv,sv:o.sv??r.suSv}:null};if(t[e])return i(e);for(let s of["_top","_side","_front","_0"]){let o=i(`${e}${s}`);if(o)return o}for(let s of Object.keys(t))if(s.startsWith(e))return i(s);return null}applyMinecraftTexturesFromAtlas(e){let t=e.currentResources;if(!t?.blocksAtlasImage||!t.blocksAtlasJson)throw new Error("Block atlas not available");let r=t.blocksAtlasJson,i=r.textures;this.atlasTexture=qt(t.blocksAtlasImage),this.atlasTexture.flipY=!1,this.atlasTexture.needsUpdate=!0;for(let s of Cs[this.blockGroup]){let o=this.resolveBlockAtlasUv(s,i,r);if(!o)continue;let l=this.atlasTexture.clone();l.flipY=!1,l.offset.set(o.u,o.v),l.repeat.set(o.su,o.sv),l.needsUpdate=!0;let a=s.includes("glass"),v=new W.MeshBasicMaterial({map:l,side:W.DoubleSide,transparent:a,opacity:a?.85:1,alphaTest:a?.08:0,depthWrite:!0,toneMapped:!1});this.blockMaterialPool.set(s,v)}if(this.blockMaterialPool.size===0)throw new Error("No block textures resolved from atlas (check block names vs atlas keys)");this.removeBlockEdgeLines();for(let s of this.blocks){let o=pr([...this.blockMaterialPool.keys()]);s.minecraftBlockName=o,s.mesh.material=this.blockMaterialPool.get(o).clone()}}setScene(e){if(!_0.includes(e)||e===this.curScene||this.transitioning)return;this.transitioning=!0,this.curScene=e;let t=jl[e];setTimeout(()=>{if(this.disposed)return;this.applyScenePalette(t),this.ambient.color.set(t.ambient),this.dir.color.set(t.dir),this.pt1.color.set(t.pt1),this.pt2.color.set(t.pt2);for(let s of this.blocks)this.useMinecraftTextures&&s.minecraftBlockName||s.mesh.material instanceof W.MeshBasicMaterial&&s.mesh.material.color.set(pr(t.blocks));let r=this.nebGeo.attributes.color;for(let s=0;s<ci;s++){let o=new W.Color(pr(t.nebula));r.setXYZ(s,o.r,o.g,o.b)}r.needsUpdate=!0;let i=this.galGeo.attributes.color;for(let s=0;s<vi;s++){let o=.2+Math.random()*.8,l=t.galFn(o);i.setXYZ(s,l.r,l.g,l.b)}i.needsUpdate=!0,this.transitioning=!1},150)}setCamera(e){w0.includes(e)&&(this.curCam=e)}setCameraSpeed(e){this.cameraSpeed=Math.max(0,e)}setBlockSpeed(e){this.blockSpeed=Math.max(0,e)}async setBlockGroup(e){if(A0.includes(e)&&e!==this.blockGroup&&(this.blockGroup=e,!(!this.useMinecraftTextures||this.disposed))){for(let t of this.blockMaterialPool.values())t.map?.dispose(),t.dispose();this.blockMaterialPool.clear(),this.texturesApplied=!1,this.scheduleMinecraftTextureLoad()}}getSceneId(){return this.curScene}getCameraId(){return this.curCam}getBlockGroupId(){return this.blockGroup}update(e,t){t&&U0(this.camera,this.documentRenderer.canvas);let r=zu[this.curCam],i=this.cameraSpeed,s=this.blockSpeed;this.camT+=e*r.spd*i,this.mx+=(this.tmx-this.mx)*.05,this.my+=(this.tmy-this.my)*.05;let o=this.mx*Wl,l=this.my*Wl,a=r.pos(this.camT,o,l),v=r.look(this.camT,o,l);this.camera.position.set(a.x,a.y,a.z),this.camera.lookAt(v.x,v.y,v.z),this.camera.rotation.z=r.roll(this.camT,o);let c=Uu[this.curCam]*s;this.animTime+=e*1e3*s;for(let u of this.blocks){if(u.mesh.position.z+=u.spd*c*60*e,u.mesh.position.x+=u.dx*60*e*s,u.mesh.position.y+=u.dy*60*e*s,u.mesh.rotation.x+=u.rx*c,u.mesh.rotation.y+=u.ry*c,u.mesh.rotation.z+=u.rz,!this.useMinecraftTextures&&u.mesh.material instanceof W.MeshBasicMaterial){let h=u.mesh.userData.baseOpacity??.38;u.mesh.userData.baseOpacity==null&&(u.mesh.userData.baseOpacity=h);let p=.88+Math.abs(Math.sin(this.animTime*8e-4+u.mesh.position.x*.3))*.12;u.mesh.material.opacity=h*p}u.mesh.position.z>this.camera.position.z+15&&u.mesh.position.set((Math.random()-.5)*140,(Math.random()-.5)*70,this.camera.position.z-155-Math.random()*30)}this.pt1.position.set(Math.sin(this.camT*.8)*25+this.camera.position.x,Math.cos(this.camT*.6)*12+this.camera.position.y,this.camera.position.z-18),this.pt2.position.set(Math.cos(this.camT*.5)*20+this.camera.position.x,Math.sin(this.camT*.9)*15+this.camera.position.y,this.camera.position.z-30),this.galaxy.rotation.y+=e*.006*s,this.nebula.rotation.y-=e*.003*s,this.stars.rotation.y+=e*4e-4*s}dispose(){this.disposed=!0,this.detachAssetsListener(),this.scene.clear(),this.bGeo.dispose(),this.eGeo.dispose(),this.galGeo.dispose(),this.nebGeo.dispose(),this.gradientSkyTexture?.dispose(),this.atlasTexture?.dispose();for(let e of this.blockMaterialPool.values())e.map?.dispose(),e.dispose();this.blockMaterialPool.clear()}};A();E();R();x();import*as br from"three";import{Vec3 as Kl}from"vec3";A();E();R();x();import Gu from"prismarine-world";import Nu from"prismarine-chunk";var Ql=n=>{let e=Gu(n),t=Nu(n),r=new e(n).sync,i=Wu(r);for(let s of i)if(s.startsWith("set")&&s!=="setColumn"){let o=r[s].bind(r);r[s]=(...l)=>{let a=l[0];a.x!==void 0&&!r.getColumnAt(a)&&r.setColumn(Math.floor(a.x/16),Math.floor(a.z/16),new t(void 0)),o(...l)}}return r};function Wu(n){let e=new Set,t=n;do for(let r of Object.getOwnPropertyNames(t))typeof n[r]=="function"&&r!=="constructor"&&e.add(r);while(t=Object.getPrototypeOf(t));return[...e]}var gr=class{constructor(e,t,r){this.documentRenderer=e;this.options=t;this.abortSignal=r;d(this,"_scene");d(this,"_camera");d(this,"worldRenderer");d(this,"WorldRendererClass",z0);this._scene=new br.Scene,this._scene.background=new br.Color(3294568),this._camera=new br.PerspectiveCamera(85,e.canvas.width/e.canvas.height,.05,1e3),this.camera.position.set(0,0,0),this.camera.rotation.set(0,0,0)}get scene(){return this._scene}get camera(){return this._camera}async init(){let e=a0,t=new Rt;if(t.currentConfig={version:e,noInventoryGui:!0},await t.updateAssetsData?.({}),this.abortSignal.aborted)return;let r=Ql(e),s=sv("prismarine-block")(e),l=globalThis.mcData.blocksArray.filter(p=>{if(!p.name.includes("stained_glass"))return!1;let m=s.fromStateId(p.defaultState,0);if(m.shapes?.length!==1)return!1;let b=m.shapes[0];return b[0]===0&&b[1]===0&&b[2]===0&&b[3]===1&&b[4]===1&&b[5]===1}),a=-15,v=100,c=100;for(let p=-v;p<v;p++)for(let m=-c;m<c;m++){let b=l[Math.floor(Math.random()*l.length)];r.setBlockStateId(new Kl(p,m,a),b.defaultState)}this._camera.updateProjectionMatrix(),this._camera.position.set(.5,c/2+.5,.5),this._camera.rotation.set(0,0,0);let u=new Kl(...this._camera.position.toArray()),h=new b0(r,2,u);this.abortSignal.aborted||(this.worldRenderer=new this.WorldRendererClass(this.documentRenderer.renderer,this.options,{version:e,worldView:h,inWorldRenderingConfig:Sr,playerStateReactive:sa().reactive,rendererState:f0().reactive,nonReactiveState:f0().nonReactive,resourcesManager:t}),this.worldRenderer instanceof z0&&(this._scene=this.worldRenderer.realScene,this._camera=this.worldRenderer.camera),h.init(u),await this.worldRenderer.waitForChunksToRender(),!this.abortSignal.aborted&&this.setupMouseParallax())}update(e,t){t&&U0(this.camera,this.documentRenderer.canvas)}dispose(){this.worldRenderer?.destroy(),this.worldRenderer=void 0,this._scene.clear()}setupMouseParallax(){let e=this._camera,t=e.position.x,r=e.position.y,i;document.body.addEventListener("pointermove",s=>{if(s.pointerType!=="mouse")return;let o=.2,l=s.clientX/window.innerWidth-.5,a=-(s.clientY/window.innerHeight-.5);i?.stop(),i=new Ge(e.position).to({x:t+l*o,y:r+a*o},0),i.start(),e.updateProjectionMatrix()},{signal:this.abortSignal})}};A();E();R();x();import*as ql from"three";var yr=class{constructor(e,t,r={},i=!1){this.documentRenderer=e;this.options=t;d(this,"active");d(this,"abortController",new AbortController);d(this,"mode");d(this,"lastFrameTime",0);this.mode=ks(r,i)}get v2(){return this.active instanceof V0?this.active:void 0}get scene(){return this.active?.scene}get camera(){return this.active?.camera}async start(e={}){this.active=this.createImplementation(e),await this.active.init(),this.active.scene.background instanceof ql.Color&&this.documentRenderer.renderer.setClearColor(this.active.scene.background),this.lastFrameTime=performance.now(),this.documentRenderer.render=(t=!1)=>{let r=performance.now(),i=Math.min((r-this.lastFrameTime)/1e3,.05);this.lastFrameTime=r;let s=this.active;s&&(s.update(i,t),this.documentRenderer.renderer.render(s.scene,s.camera))}}createImplementation(e){switch(this.mode){case"v2":return new V0(this.documentRenderer,{useMinecraftTextures:e.useMinecraftTextures,initialScene:e.v2Scene,initialCamera:e.v2Camera,initialBlockGroup:e.v2BlockGroup,initialCameraSpeed:e.v2CameraSpeed,initialBlockSpeed:e.v2BlockSpeed,resourcesManager:e.resourcesManager},this.abortController.signal);case"worldBlocks":return new gr(this.documentRenderer,this.options,this.abortController.signal);default:return new mr(this.documentRenderer)}}dispose(){this.active?.dispose(),this.active=void 0,this.abortController.abort()}};w5.ColorManagement.enabled=!1;globalThis.THREE=w5;var Jl=n=>({updateMap:n.entities.updateMap.bind(n.entities),updateCustomBlock:n.updateCustomBlock.bind(n),getBlockInfo:n.getBlockInfo.bind(n),playEntityAnimation:n.entities.playAnimation.bind(n.entities),damageEntity:n.entities.handleDamageEvent.bind(n.entities),updatePlayerSkin:n.entities.updatePlayerSkin.bind(n.entities),setPlayerVoiceState:n.entities.setPlayerVoiceState.bind(n.entities),applyTemporaryPlayerSkinOverride:n.entities.applyTemporaryPlayerSkinOverride.bind(n.entities),changeHandSwingingState:n.changeHandSwingingState.bind(n),getHighestBlocks:n.getHighestBlocks.bind(n),reloadWorld:n.reloadWorld.bind(n),updateEntityModel:n.entities.updateEntityModel.bind(n.entities),playEntityModelAnimation:n.entities.playEntityModelAnimation.bind(n.entities),addMedia:n.media.addMedia.bind(n.media),destroyMedia:n.media.destroyMedia.bind(n.media),setControlMode:n.media.setControlMode.bind(n.media),setVideoPlaying:n.media.setVideoPlaying.bind(n.media),setVideoSeeking:n.media.setVideoSeeking.bind(n.media),setVideoVolume:n.media.setVideoVolume.bind(n.media),setVideoSpeed:n.media.setVideoSpeed.bind(n.media),handleUserClick:n.media.handleUserClick.bind(n.media),addSectionAnimation(e,t){n.sectionsOffsetsAnimations[e]=t},removeSectionAnimation(e){delete n.sectionsOffsetsAnimations[e]},shakeFromDamage:n.cameraShake.shakeFromDamage.bind(n.cameraShake),onPageInteraction:n.media.onPageInteraction.bind(n.media),downloadMesherLog:n.downloadMesherLog.bind(n),explodeFirework:n.fireworksLegacy.explode.bind(n.fireworksLegacy),explodeFireworkFacingCamera:n.fireworksLegacy.explodeFacingCamera.bind(n.fireworksLegacy),addWaypoint:n.waypoints.addWaypoint.bind(n.waypoints),removeWaypoint:n.waypoints.removeWaypoint.bind(n.waypoints),startCinimaticScript:n.cinimaticScript.startScript.bind(n.cinimaticScript),stopCinimaticScript:n.cinimaticScript.stopScript.bind(n.cinimaticScript),launchFirework:n.fireworks.launchFirework.bind(n.fireworks),setSkyboxImage:n.skyboxRenderer.setSkyboxImage.bind(n.skyboxRenderer),setRain:n.setRain.bind(n),spawnBlockBreakParticles(e,t,r,i,s,o){n.getModule("blockBreakParticles")?.spawnBlockBreakParticles(e,t,r,i,s,o)},spawnBlockCrackParticle(e,t,r,i,s,o,l){n.getModule("blockBreakParticles")?.spawnCrackParticle(e,t,r,i,s,o,l)},async loadGeometryExport(e){let{applyWorldGeometryExport:t}=await Promise.resolve().then(()=>(vs(),W7));return t(n,e)},feedChunkPacket(e){let{kind:t,...r}=e,i={type:t,...r};for(let s of n.workers)s.postMessage(i)},getChunksDebugState(){let e={};for(let t of Object.keys(n.sectionObjects)){let[r,,i]=t.split(",").map(Number);e[`${r},${i}`]=!0}return{loadedSectionsChunks:e,loadedChunks:{...n.loadedChunks},finishedChunks:{...n.finishedChunks}}}}),Yu=[],di=(n,...e)=>{for(let t of Object.values(globalThis.loadedMods??{}))try{t.threeJsBackendModule?.[n]?.(...e)}catch(r){let i=`[mod three.js] Error calling ${n} on ${t.name}: ${r}`;throw new Error(i)}},Xl=()=>{let n,e=null,t=null,r=null,i=null,s=(c,u)=>{c.hello,de?n=Ur(c,Yu,globalThis):n=c,e=new Br(n,u?.canvas),globalThis.renderer=e.renderer,globalThis.documentRenderer=e,globalThis.threeJsBackend=v,di("default",v)},o=async c=>{if(!e)throw new Error("Document renderer not initialized");r&&(r.destroy(),r=null,i=null,globalThis.world=void 0,globalThis.frameTimingCollector=void 0),t&&(t.dispose(),t=null);let u={...n.config.menuBackground,...c};t=new yr(e,{...n},u,!!L.env.SINGLE_FILE_BUILD_MODE),di("menuBackgroundCreated",t),await t.start(u),di("menuBackgroundReady",t)},l=async c=>{if(!e)throw new Error("Document renderer not initialized");t&&(t.dispose(),t=null),r&&(r.destroy(),r=null,i=null,globalThis.world=void 0,globalThis.frameTimingCollector=void 0);let h=de?Ur(c,[Rt,g0],globalThis):c;e.nonReactiveState=h.nonReactiveState,globalThis.resourcesManager=h.resourcesManager,r=new z0(e.renderer,n,h),await r.worldReadyPromise,i=h.inWorldRenderingConfig.enableDebugOverlay?new G5(h.nonReactiveState):null,globalThis.frameTimingCollector=i;let p=e.render;e.render=function(m){p.call(this,m),i?.markFrameStart(),h.inWorldRenderingConfig.paused||r?.render(m),i?.markFrameEnd(),i?.markFrameDisplay()},e.inWorldRenderingConfig=h.inWorldRenderingConfig,globalThis.world=r,di("worldReady",r)},a=()=>{t&&(t.dispose(),t=null),e&&e.dispose(),r&&(r.destroy(),r=null)},v={id:"threejs",displayName:`three.js ${w5.REVISION}`,startMenuBackground:o,startWorld:l,disconnect:a,setRendering(c){e.setPaused(!c),r&&(r.renderingActive=c)},getMenuBackground:()=>t??void 0,getDebugOverlay:()=>({get entitiesString(){return r?.entities.getDebugString()},get left(){return{"Geo Memory":r?.chunkMeshManager.getEstimatedMemoryUsage().total??"-"}}}),updateCamera(c,u,h,p){i?.markCameraUpdate(!c),r?.setFirstPersonCamera(c,u,h,p)},get soundSystem(){return r?.soundSystem},get backendMethods(){if(r)return Jl(r)}};return{main:{init:s,backend:v},workerProxy(){return Ha({init(c,u){s(c,{canvas:u})},updateSizeExternal(c,u,h){e?.updateSizeExternal(c,u,h)},startMenuBackground:o,startWorld:l,disconnect:a,setRendering:v.setRendering,updateCamera(c,u,h,p){let m=c?new ju(c.x,c.y,c.z):null;i?.markCameraUpdate(!m),v.updateCamera(m,u,h,p)},async callBackendMethod(c,...u){if(!r)throw new Error("World renderer not initialized");let p=Jl(r)[c];if(!p)throw new Error(`Backend method ${String(c)} is unavailable`);return p(...u)}})}}};var ui=n=>{let{main:e}=Xl();return e.init(n),e.backend};ui.id="threejs";ui.displayName="three.js Blocking";ui.description="Simple, old and stable main thread graphics backend providing balanced performance on top of WebGL2.";A();E();R();x();import*as Zl from"three";function Qu(n){let e="threeWorker.js",t;if(L.env.SINGLE_FILE_BUILD){let r=document.getElementById("three-worker-code").textContent,i=new Blob([r],{type:"text/javascript"});t=new Worker(window.URL.createObjectURL(i))}else t=new Worker(e);return t.onmessage=({data:r})=>{n(r)},t.on&&t.on("message",r=>{t.onmessage({data:r})}),t}var hi=async n=>{let e={onMessage:a=>{}},t=Qu(a=>{e.onMessage(a)}),r=La(t),i=Ci();i.onSizeChanged((a,v)=>{r.updateSizeExternal(a,v,window.devicePixelRatio||1)});let s=zr(n,t);try{r.init(s,i.canvas)}catch(a){throw R0(s),a}let o=new Proxy({},{get(a,v){if(typeof v=="string")return async(...c)=>r.callBackendMethod(v,...c)}});return{id:"threejs",displayName:`three.js ${Zl.REVISION}`,async startMenuBackground(a){let v=a?.resourcesManager?.currentResources?.mcData;if(v){let u={...k0,items:"itemsArray",entities:"entitiesArray"};await e1([t],a0,u,v)}let c=zr(a??{},t);try{await r.startMenuBackground(structuredClone(c))}catch(u){throw R0(c),u}},async startWorld(a){let v=a.worldView;e.onMessage=m=>{m?.type==="reloadLoadedChunks"&&v.reloadLoadedChunks().catch(b=>{})};let c={...k0,items:"itemsArray",entities:"entitiesArray"};await e1([t],a.version,c,a.resourcesManager.currentResources.mcData),a.inWorldRenderingConfig.__syncToWorker=!0,a.playerStateReactive&&(a.playerStateReactive.__syncToWorker=!0),a.rendererState&&(a.rendererState.__syncFromWorker=!0),a.nonReactiveState&&(a.nonReactiveState.__syncFromWorker=!0),a.nonReactiveState.__syncFromWorkerInterval=200;let u=zr(a,t);try{await r.startWorld(structuredClone(u))}catch(m){throw R0(u),m}r.updateSizeExternal(i.size.width,i.size.height,window.devicePixelRatio||1);let h=T0("fps");setInterval(()=>{let{fps:m,avgRenderTime:b,worstRenderTime:k}=a.nonReactiveState;h.updateText(`FPS: ${m.toFixed(0)} (${b.toFixed(0)}ms/${k.toFixed(0)}ms)`),a.nonReactiveState.fps=0},1e3);let p=T0("downloaded-chunks",100,140,20,{className:S0});setInterval(()=>{let m=(n.config.statsVisible??0)>1;p.setVisibility(m),m&&p.updateText(a.nonReactiveState.world.chunksFullInfo)},200)},disconnect(){i.destroy(),r.disconnect(),t.terminate()},setRendering(a){r.setRendering(a)},updateCamera(a,v,c,u){r.updateCamera(a?{x:a.x,y:a.y,z:a.z}:null,v,c,u)},soundSystem:void 0,backendMethods:o}};hi.id="threejs-off-thread";hi.displayName="three.js Multi-thread EXPERIMENTAL";hi.description=["(UNSTABLE, DO NOT USE ON ANDROID).","Edge-cutting technology that uses a dedicated thread for graphics.","Slightly higher power and RAM usage.","More stable FPS (mid-range devices), but possible inputlag if TPS is low.","On low-end devices it might result in device throttling and stuttering."].join(" ");export{Aa as AppViewer,mr as ClassicMenuBackground,Br as DocumentRenderer,_i as HIGH_TEXTURE_COUNT,C5 as LONG_RENDER_TIME_MS,yi as LOW_FPS_THRESHOLD,J0 as LoadedResourcesTransferrable,S0 as MC_RENDERER_DEBUG_OVERLAY_CLASS,a0 as MENU_BACKGROUND_MC_VERSION,Lr as MENU_BACKGROUND_MOTION_DEFAULTS,Ct as MENU_BACKGROUND_OPTION_DEFAULTS,Cs as MINECRAFT_BLOCK_GROUPS,A0 as MINECRAFT_BLOCK_GROUP_IDS,Hr as MINECRAFT_BLOCK_GROUP_LABELS,yr as MenuBackgroundRenderer,kr as PerformanceMonitor,Ea as RENDERER_DEFAULT_OPTIONS,xa as RENDERER_OPTIONS_META,Ra as RENDERER_RENDER_GUI_SECTIONS,Rt as ResourcesManager,V0 as V2MenuBackground,w0 as V2_CAMERA_IDS,Ir as V2_CAMERA_LABELS,_0 as V2_SCENE_IDS,Pr as V2_SCENE_LABELS,gr as WorldBlocksMenuBackground,b0 as WorldView,g0 as WorldViewWorker,Ci as addCanvasForWorker,Vv as applyMenuBackgroundLiveOptions,$g as applyRendererEnableLighting,Yv as applyRendererOptions,Xg as applyRendererWorldViewOptions,Q0 as chunkPos,hi as createGraphicsBackendOffThread,ui as createGraphicsBackendSingleThread,rf as createWorldRendererConfig,na as defaultGraphicsBackendConfig,bi as defaultPerformanceInstabilityFactors,Sr as defaultWorldRendererConfig,aa as delayedIterator,wi as formatPerformanceFactorsDebug,f0 as getDefaultRendererState,Ma as getInitialPlayerState,qv as getInitialPlayerStateRenderer,Kv as getPlayerStateUtils,de as isWebWorker,Jg as menuBackgroundOptionsFromStorage,Ot as menuBackgroundSpeedToMultiplier,Bv as migrateRendererOptions,Ii as rendererShaderCubeDebugModeToValue,bv as sectionPos,Zg as subscribeRendererOptions};
21703
21703
  /*! Bundled license information:
21704
21704
 
21705
21705
  @jspm/core/nodelibs/browser/chunk-DtuTasat.js: