minecraft-renderer 0.1.71 → 0.1.73

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.
Files changed (65) hide show
  1. package/README.md +3 -3
  2. package/dist/mesher.js +81 -81
  3. package/dist/mesher.js.map +3 -3
  4. package/dist/mesherWasm.js +1183 -943
  5. package/dist/minecraft-renderer.js +250 -79
  6. package/dist/minecraft-renderer.js.meta.json +1 -1
  7. package/dist/threeWorker.js +1732 -1001
  8. package/package.json +3 -3
  9. package/src/graphicsBackend/rendererDefaultOptions.ts +5 -10
  10. package/src/graphicsBackend/rendererOptionsSync.ts +1 -1
  11. package/src/lib/bakeLegacyLight.ts +17 -0
  12. package/src/lib/blockEntityLightRegistry.test.ts +18 -0
  13. package/src/lib/blockEntityLightRegistry.ts +75 -0
  14. package/src/lib/blockEntityLighting.test.ts +30 -0
  15. package/src/lib/blockEntityLighting.ts +53 -0
  16. package/src/lib/worldrendererCommon.reconfigure.test.ts +202 -0
  17. package/src/lib/worldrendererCommon.ts +152 -22
  18. package/src/mesher-shared/blockEntityMetadata.test.ts +33 -0
  19. package/src/mesher-shared/blockEntityMetadata.ts +19 -3
  20. package/src/mesher-shared/exportedGeometryTypes.ts +11 -0
  21. package/src/mesher-shared/models.ts +161 -92
  22. package/src/mesher-shared/shared.ts +15 -4
  23. package/src/mesher-shared/tests/liquidQuadInvariant.test.ts +40 -0
  24. package/src/mesher-shared/world.ts +12 -0
  25. package/src/mesher-shared/worldLighting.test.ts +54 -0
  26. package/src/playground/baseScene.ts +1 -1
  27. package/src/three/bannerRenderer.ts +10 -3
  28. package/src/three/chunkMeshManager.ts +663 -69
  29. package/src/three/cubeDrawSpans.ts +74 -0
  30. package/src/three/cubeMultiDraw.ts +119 -0
  31. package/src/three/documentRenderer.ts +0 -2
  32. package/src/three/entities.ts +5 -6
  33. package/src/three/entity/EntityMesh.ts +7 -5
  34. package/src/three/entity/gltfAnimationUtils.ts +5 -3
  35. package/src/three/globalBlockBuffer.ts +208 -12
  36. package/src/three/globalLegacyBuffer.ts +701 -0
  37. package/src/three/graphicsBackendOffThread.ts +16 -1
  38. package/src/three/itemMesh.ts +5 -2
  39. package/src/three/legacySectionCull.ts +85 -0
  40. package/src/three/modules/sciFiWorldReveal.ts +347 -703
  41. package/src/three/modules/starfield.ts +3 -2
  42. package/src/three/sectionRaycastAabb.ts +25 -0
  43. package/src/three/shaders/cubeBlockShader.ts +80 -17
  44. package/src/three/shaders/legacyBlockShader.ts +292 -0
  45. package/src/three/skyboxRenderer.ts +1 -1
  46. package/src/three/tests/chunkMeshManagerLegacy.test.ts +286 -0
  47. package/src/three/tests/cubeDrawSpans.test.ts +73 -0
  48. package/src/three/tests/globalLegacyBuffer.test.ts +360 -0
  49. package/src/three/tests/legacySectionCull.test.ts +80 -0
  50. package/src/three/tests/signTextureCache.test.ts +83 -0
  51. package/src/three/threeJsMedia.ts +2 -2
  52. package/src/three/waypointSprite.ts +2 -2
  53. package/src/three/world/cursorBlock.ts +1 -0
  54. package/src/three/world/vr.ts +2 -2
  55. package/src/three/worldGeometryExport.ts +83 -26
  56. package/src/three/worldRendererThree.ts +94 -25
  57. package/src/wasm-mesher/bridge/render-from-wasm.ts +214 -72
  58. package/src/wasm-mesher/bridge/shaderCubeBridge.ts +18 -6
  59. package/src/wasm-mesher/runtime-build/wasm_mesher_bg.wasm +0 -0
  60. package/src/wasm-mesher/tests/sectionRaycastAabb.test.ts +20 -0
  61. package/src/wasm-mesher/tests/shaderCubeInstances.test.ts +67 -5
  62. package/src/wasm-mesher/worker/mesherWasm.ts +70 -14
  63. package/src/wasm-mesher/worker/mesherWasmLightDirty.test.ts +11 -0
  64. package/src/wasm-mesher/worker/mesherWasmLightDirty.ts +15 -0
  65. package/src/worldView/worldView.ts +11 -0
@@ -1,16 +1,23 @@
1
- var Ya=Object.create;var o5=Object.defineProperty;var Qa=Object.getOwnPropertyDescriptor;var Ka=Object.getOwnPropertyNames;var Ja=Object.getPrototypeOf,Za=Object.prototype.hasOwnProperty;var qa=(n,e,t)=>e in n?o5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Xa=(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 Xe=(n,e)=>()=>(n&&(e=n(n=0)),e);var t0=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),q5=(n,e)=>{for(var t in e)o5(n,t,{get:e[t],enumerable:!0})},hn=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ka(e))!Za.call(n,i)&&i!==t&&o5(n,i,{get:()=>e[i],enumerable:!(r=Qa(e,i))||r.enumerable});return n};var a5=(n,e,t)=>(t=n!=null?Ya(Ja(n)):{},hn(e||!n||!n.__esModule?o5(t,"default",{value:n,enumerable:!0}):t,n)),$a=n=>hn(o5({},"__esModule",{value:!0}),n);var d=(n,e,t)=>(qa(n,typeof e!="symbol"?e+"":e,t),t);var E=Xe(()=>{});var x=Xe(()=>{});var D={};q5(D,{_debugEnd:()=>i2,_debugProcess:()=>r2,_events:()=>y2,_eventsCount:()=>_2,_exiting:()=>Fn,_fatalExceptions:()=>Xn,_getActiveHandles:()=>Gn,_getActiveRequests:()=>Un,_kill:()=>Wn,_linkedBinding:()=>On,_maxListeners:()=>b2,_preload_modules:()=>m2,_rawDebug:()=>In,_startProfilerIdleNotifier:()=>n2,_stopProfilerIdleNotifier:()=>s2,_tickCallback:()=>t2,abort:()=>l2,addListener:()=>w2,allowedNodeEnvironmentFlags:()=>Jn,arch:()=>yn,argv:()=>An,argv0:()=>h2,assert:()=>Zn,binding:()=>Tn,browser:()=>Pn,chdir:()=>Cn,config:()=>zn,cpuUsage:()=>e1,cwd:()=>Sn,debugPort:()=>f2,default:()=>C2,dlopen:()=>Ln,domain:()=>Dn,emit:()=>k2,emitWarning:()=>kn,env:()=>wn,execArgv:()=>En,execPath:()=>u2,exit:()=>Qn,features:()=>qn,hasUncaughtExceptionCaptureCallback:()=>e2,hrtime:()=>$5,kill:()=>Yn,listeners:()=>S2,memoryUsage:()=>jn,moduleLoadList:()=>Hn,nextTick:()=>pn,off:()=>E2,on:()=>A0,once:()=>A2,openStdin:()=>Kn,pid:()=>c2,platform:()=>_n,ppid:()=>d2,prependListener:()=>T2,prependOnceListener:()=>M2,reallyExit:()=>Nn,release:()=>Bn,removeAllListeners:()=>R2,removeListener:()=>x2,resourceUsage:()=>Vn,setSourceMapsEnabled:()=>p2,setUncaughtExceptionCaptureCallback:()=>$n,stderr:()=>a2,stdin:()=>v2,stdout:()=>o2,title:()=>bn,umask:()=>Mn,uptime:()=>g2,version:()=>xn,versions:()=>Rn});function yr(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function e6(){!kt||!Y0||(kt=!1,Y0.length?w0=Y0.concat(w0):X5=-1,w0.length&&mn())}function mn(){if(!kt){var n=setTimeout(e6,0);kt=!0;for(var e=w0.length;e;){for(Y0=w0,w0=[];++X5<e;)Y0&&Y0[X5].run();X5=-1,e=w0.length}Y0=null,kt=!1,clearTimeout(n)}}function pn(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];w0.push(new gn(n,e)),w0.length===1&&!kt&&setTimeout(mn,0)}function gn(n,e){this.fun=n,this.array=e}function We(){}function On(n){yr("_linkedBinding")}function Ln(n){yr("dlopen")}function Un(){return[]}function Gn(){return[]}function Zn(n,e){if(!n)throw new Error(e||"assertion error")}function e2(){return!1}function g2(){return C0.now()/1e3}function $5(n){var e=Math.floor((Date.now()-C0.now())*.001),t=C0.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+=br)),[r,i]}function A0(){return C2}function S2(n){return[]}var w0,kt,Y0,X5,bn,yn,_n,wn,An,En,xn,Rn,kn,Tn,Mn,Sn,Cn,Bn,Pn,In,Hn,Dn,Fn,zn,Nn,Wn,e1,Vn,jn,Yn,Qn,Kn,Jn,qn,Xn,$n,t2,r2,i2,n2,s2,o2,a2,v2,l2,c2,d2,u2,f2,h2,m2,p2,C0,gr,br,b2,y2,_2,w2,A2,E2,x2,R2,k2,T2,M2,C2,B2=Xe(()=>{E();x();k();R();w0=[],kt=!1,X5=-1;gn.prototype.run=function(){this.fun.apply(null,this.array)};bn="browser",yn="x64",_n="browser",wn={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},An=["/usr/bin/node"],En=[],xn="v16.8.0",Rn={},kn=function(n,e){},Tn=function(n){yr("binding")},Mn=function(n){return 0},Sn=function(){return"/"},Cn=function(n){},Bn={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};Pn=!0,In=We,Hn=[];Dn={},Fn=!1,zn={};Nn=We,Wn=We,e1=function(){return{}},Vn=e1,jn=e1,Yn=We,Qn=We,Kn=We,Jn={};qn={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Xn=We,$n=We;t2=We,r2=We,i2=We,n2=We,s2=We,o2=void 0,a2=void 0,v2=void 0,l2=We,c2=2,d2=1,u2="/bin/usr/node",f2=9229,h2="node",m2=[],p2=We,C0={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};C0.now===void 0&&(gr=Date.now(),C0.timing&&C0.timing.navigationStart&&(gr=C0.timing.navigationStart),C0.now=()=>Date.now()-gr);br=1e9;$5.bigint=function(n){var e=$5(n);return typeof BigInt>"u"?e[0]*br+e[1]:BigInt(e[0]*br)+BigInt(e[1])};b2=10,y2={},_2=0;w2=A0,A2=A0,E2=A0,x2=A0,R2=A0,k2=We,T2=A0,M2=A0;C2={version:xn,versions:Rn,arch:yn,platform:_n,browser:Pn,release:Bn,_rawDebug:In,moduleLoadList:Hn,binding:Tn,_linkedBinding:On,_events:y2,_eventsCount:_2,_maxListeners:b2,on:A0,addListener:w2,once:A2,off:E2,removeListener:x2,removeAllListeners:R2,emit:k2,prependListener:T2,prependOnceListener:M2,listeners:S2,domain:Dn,_exiting:Fn,config:zn,dlopen:Ln,uptime:g2,_getActiveRequests:Un,_getActiveHandles:Gn,reallyExit:Nn,_kill:Wn,cpuUsage:e1,resourceUsage:Vn,memoryUsage:jn,kill:Yn,exit:Qn,openStdin:Kn,allowedNodeEnvironmentFlags:Jn,assert:Zn,features:qn,_fatalExceptions:Xn,setUncaughtExceptionCaptureCallback:$n,hasUncaughtExceptionCaptureCallback:e2,emitWarning:kn,nextTick:pn,_tickCallback:t2,_debugProcess:r2,_debugEnd:i2,_startProfilerIdleNotifier:n2,_stopProfilerIdleNotifier:s2,stdout:o2,stdin:v2,stderr:a2,abort:l2,umask:Mn,chdir:Cn,cwd:Sn,env:wn,title:bn,argv:An,execArgv:En,pid:c2,ppid:d2,execPath:u2,debugPort:f2,hrtime:$5,argv0:h2,_preload_modules:m2,setSourceMapsEnabled:p2}});var R=Xe(()=>{B2()});function t6(){if(P2)return v5;P2=!0,v5.byteLength=a,v5.toByteArray=l,v5.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 g=p.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var y=p.indexOf("=");y===-1&&(y=g);var A=y===g?0:4-y%4;return[y,A]}function a(p){var g=o(p),y=g[0],A=g[1];return(y+A)*3/4-A}function v(p,g,y){return(g+y)*3/4-y}function l(p){var g,y=o(p),A=y[0],b=y[1],w=new t(v(p,A,b)),S=0,C=b>0?A-4:A,M;for(M=0;M<C;M+=4)g=e[p.charCodeAt(M)]<<18|e[p.charCodeAt(M+1)]<<12|e[p.charCodeAt(M+2)]<<6|e[p.charCodeAt(M+3)],w[S++]=g>>16&255,w[S++]=g>>8&255,w[S++]=g&255;return b===2&&(g=e[p.charCodeAt(M)]<<2|e[p.charCodeAt(M+1)]>>4,w[S++]=g&255),b===1&&(g=e[p.charCodeAt(M)]<<10|e[p.charCodeAt(M+1)]<<4|e[p.charCodeAt(M+2)]>>2,w[S++]=g>>8&255,w[S++]=g&255),w}function c(p){return n[p>>18&63]+n[p>>12&63]+n[p>>6&63]+n[p&63]}function u(p,g,y){for(var A,b=[],w=g;w<y;w+=3)A=(p[w]<<16&16711680)+(p[w+1]<<8&65280)+(p[w+2]&255),b.push(c(A));return b.join("")}function h(p){for(var g,y=p.length,A=y%3,b=[],w=16383,S=0,C=y-A;S<C;S+=w)b.push(u(p,S,S+w>C?C:S+w));return A===1?(g=p[y-1],b.push(n[g>>2]+n[g<<4&63]+"==")):A===2&&(g=(p[y-2]<<8)+p[y-1],b.push(n[g>>10]+n[g>>4&63]+n[g<<2&63]+"=")),b.join("")}return v5}function r6(){if(I2)return t1;I2=!0;return t1.read=function(n,e,t,r,i){var s,o,a=i*8-r-1,v=(1<<a)-1,l=v>>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+=a;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-l;else{if(s===v)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-l}return(p?-1:1)*o*Math.pow(2,s-r)},t1.write=function(n,e,t,r,i,s){var o,a,v,l=s*8-i-1,c=(1<<l)-1,u=c>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,g=r?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(v=Math.pow(2,-o))<1&&(o--,v*=2),o+u>=1?e+=h/v:e+=h*Math.pow(2,1-u),e*v>=2&&(o++,v/=2),o+u>=c?(a=0,o=c):o+u>=1?(a=(e*v-1)*Math.pow(2,i),o=o+u):(a=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;n[t+p]=a&255,p+=g,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;n[t+p]=o&255,p+=g,o/=256,l-=8);n[t+p-g]|=y*128},t1}function O2(){if(H2)return Q0;H2=!0;let n=t6(),e=r6(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Q0.Buffer=o,Q0.SlowBuffer=b,Q0.INSPECT_MAX_BYTES=50;let r=2147483647;Q0.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u";function i(){try{let _=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(_,f),_.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(_){if(_>r)throw new RangeError('The value "'+_+'" is invalid for option "size"');let f=new Uint8Array(_);return Object.setPrototypeOf(f,o.prototype),f}function o(_,f,m){if(typeof _=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(_)}return a(_,f,m)}o.poolSize=8192;function a(_,f,m){if(typeof _=="string")return u(_,f);if(ArrayBuffer.isView(_))return p(_);if(_==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _);if(Me(_,ArrayBuffer)||_&&Me(_.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Me(_,SharedArrayBuffer)||_&&Me(_.buffer,SharedArrayBuffer)))return g(_,f,m);if(typeof _=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let T=_.valueOf&&_.valueOf();if(T!=null&&T!==_)return o.from(T,f,m);let P=y(_);if(P)return P;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof _[Symbol.toPrimitive]=="function")return o.from(_[Symbol.toPrimitive]("string"),f,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _)}o.from=function(_,f,m){return a(_,f,m)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function v(_){if(typeof _!="number")throw new TypeError('"size" argument must be of type number');if(_<0)throw new RangeError('The value "'+_+'" is invalid for option "size"')}function l(_,f,m){return v(_),_<=0?s(_):f!==void 0?typeof m=="string"?s(_).fill(f,m):s(_).fill(f):s(_)}o.alloc=function(_,f,m){return l(_,f,m)};function c(_){return v(_),s(_<0?0:A(_)|0)}o.allocUnsafe=function(_){return c(_)},o.allocUnsafeSlow=function(_){return c(_)};function u(_,f){if((typeof f!="string"||f==="")&&(f="utf8"),!o.isEncoding(f))throw new TypeError("Unknown encoding: "+f);let m=w(_,f)|0,T=s(m),P=T.write(_,f);return P!==m&&(T=T.slice(0,P)),T}function h(_){let f=_.length<0?0:A(_.length)|0,m=s(f);for(let T=0;T<f;T+=1)m[T]=_[T]&255;return m}function p(_){if(Me(_,Uint8Array)){let f=new Uint8Array(_);return g(f.buffer,f.byteOffset,f.byteLength)}return h(_)}function g(_,f,m){if(f<0||_.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(_.byteLength<f+(m||0))throw new RangeError('"length" is outside of buffer bounds');let T;return f===void 0&&m===void 0?T=new Uint8Array(_):m===void 0?T=new Uint8Array(_,f):T=new Uint8Array(_,f,m),Object.setPrototypeOf(T,o.prototype),T}function y(_){if(o.isBuffer(_)){let f=A(_.length)|0,m=s(f);return m.length===0||_.copy(m,0,0,f),m}if(_.length!==void 0)return typeof _.length!="number"||xt(_.length)?s(0):h(_);if(_.type==="Buffer"&&Array.isArray(_.data))return h(_.data)}function A(_){if(_>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return _|0}function b(_){return+_!=_&&(_=0),o.alloc(+_)}o.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==o.prototype},o.compare=function(f,m){if(Me(f,Uint8Array)&&(f=o.from(f,f.offset,f.byteLength)),Me(m,Uint8Array)&&(m=o.from(m,m.offset,m.byteLength)),!o.isBuffer(f)||!o.isBuffer(m))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===m)return 0;let T=f.length,P=m.length;for(let F=0,N=Math.min(T,P);F<N;++F)if(f[F]!==m[F]){T=f[F],P=m[F];break}return T<P?-1:P<T?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,m){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return o.alloc(0);let T;if(m===void 0)for(m=0,T=0;T<f.length;++T)m+=f[T].length;let P=o.allocUnsafe(m),F=0;for(T=0;T<f.length;++T){let N=f[T];if(Me(N,Uint8Array))F+N.length>P.length?(o.isBuffer(N)||(N=o.from(N)),N.copy(P,F)):Uint8Array.prototype.set.call(P,N,F);else if(o.isBuffer(N))N.copy(P,F);else throw new TypeError('"list" argument must be an Array of Buffers');F+=N.length}return P};function w(_,f){if(o.isBuffer(_))return _.length;if(ArrayBuffer.isView(_)||Me(_,ArrayBuffer))return _.byteLength;if(typeof _!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof _);let m=_.length,T=arguments.length>2&&arguments[2]===!0;if(!T&&m===0)return 0;let P=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Et(_).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return pr(_).length;default:if(P)return T?-1:Et(_).length;f=(""+f).toLowerCase(),P=!0}}o.byteLength=w;function S(_,f,m){let T=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,f>>>=0,m<=f))return"";for(_||(_="utf8");;)switch(_){case"hex":return Ee(this,f,m);case"utf8":case"utf-8":return Z(this,f,m);case"ascii":return le(this,f,m);case"latin1":case"binary":return ce(this,f,m);case"base64":return J(this,f,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ie(this,f,m);default:if(T)throw new TypeError("Unknown encoding: "+_);_=(_+"").toLowerCase(),T=!0}}o.prototype._isBuffer=!0;function C(_,f,m){let T=_[f];_[f]=_[m],_[m]=T}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 m=0;m<f;m+=2)C(this,m,m+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 m=0;m<f;m+=4)C(this,m,m+3),C(this,m+1,m+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 m=0;m<f;m+=8)C(this,m,m+7),C(this,m+1,m+6),C(this,m+2,m+5),C(this,m+3,m+4);return this},o.prototype.toString=function(){let f=this.length;return f===0?"":arguments.length===0?Z(this,0,f):S.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="",m=Q0.INSPECT_MAX_BYTES;return f=this.toString("hex",0,m).replace(/(.{2})/g,"$1 ").trim(),this.length>m&&(f+=" ... "),"<Buffer "+f+">"},t&&(o.prototype[t]=o.prototype.inspect),o.prototype.compare=function(f,m,T,P,F){if(Me(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(m===void 0&&(m=0),T===void 0&&(T=f?f.length:0),P===void 0&&(P=0),F===void 0&&(F=this.length),m<0||T>f.length||P<0||F>this.length)throw new RangeError("out of range index");if(P>=F&&m>=T)return 0;if(P>=F)return-1;if(m>=T)return 1;if(m>>>=0,T>>>=0,P>>>=0,F>>>=0,this===f)return 0;let N=F-P,ie=T-m,pe=Math.min(N,ie),he=this.slice(P,F),me=f.slice(m,T);for(let fe=0;fe<pe;++fe)if(he[fe]!==me[fe]){N=he[fe],ie=me[fe];break}return N<ie?-1:ie<N?1:0};function M(_,f,m,T,P){if(_.length===0)return-1;if(typeof m=="string"?(T=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,xt(m)&&(m=P?0:_.length-1),m<0&&(m=_.length+m),m>=_.length){if(P)return-1;m=_.length-1}else if(m<0)if(P)m=0;else return-1;if(typeof f=="string"&&(f=o.from(f,T)),o.isBuffer(f))return f.length===0?-1:I(_,f,m,T,P);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?P?Uint8Array.prototype.indexOf.call(_,f,m):Uint8Array.prototype.lastIndexOf.call(_,f,m):I(_,[f],m,T,P);throw new TypeError("val must be string, number or Buffer")}function I(_,f,m,T,P){let F=1,N=_.length,ie=f.length;if(T!==void 0&&(T=String(T).toLowerCase(),T==="ucs2"||T==="ucs-2"||T==="utf16le"||T==="utf-16le")){if(_.length<2||f.length<2)return-1;F=2,N/=2,ie/=2,m/=2}function pe(me,fe){return F===1?me[fe]:me.readUInt16BE(fe*F)}let he;if(P){let me=-1;for(he=m;he<N;he++)if(pe(_,he)===pe(f,me===-1?0:he-me)){if(me===-1&&(me=he),he-me+1===ie)return me*F}else me!==-1&&(he-=he-me),me=-1}else for(m+ie>N&&(m=N-ie),he=m;he>=0;he--){let me=!0;for(let fe=0;fe<ie;fe++)if(pe(_,he+fe)!==pe(f,fe)){me=!1;break}if(me)return he}return-1}o.prototype.includes=function(f,m,T){return this.indexOf(f,m,T)!==-1},o.prototype.indexOf=function(f,m,T){return M(this,f,m,T,!0)},o.prototype.lastIndexOf=function(f,m,T){return M(this,f,m,T,!1)};function B(_,f,m,T){m=Number(m)||0;let P=_.length-m;T?(T=Number(T),T>P&&(T=P)):T=P;let F=f.length;T>F/2&&(T=F/2);let N;for(N=0;N<T;++N){let ie=parseInt(f.substr(N*2,2),16);if(xt(ie))return N;_[m+N]=ie}return N}function H(_,f,m,T){return Ze(Et(f,_.length-m),_,m,T)}function G(_,f,m,T){return Ze(J5(f),_,m,T)}function O(_,f,m,T){return Ze(pr(f),_,m,T)}function j(_,f,m,T){return Ze(Z5(f,_.length-m),_,m,T)}o.prototype.write=function(f,m,T,P){if(m===void 0)P="utf8",T=this.length,m=0;else if(T===void 0&&typeof m=="string")P=m,T=this.length,m=0;else if(isFinite(m))m=m>>>0,isFinite(T)?(T=T>>>0,P===void 0&&(P="utf8")):(P=T,T=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let F=this.length-m;if((T===void 0||T>F)&&(T=F),f.length>0&&(T<0||m<0)||m>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let N=!1;for(;;)switch(P){case"hex":return B(this,f,m,T);case"utf8":case"utf-8":return H(this,f,m,T);case"ascii":case"latin1":case"binary":return G(this,f,m,T);case"base64":return O(this,f,m,T);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,f,m,T);default:if(N)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),N=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function J(_,f,m){return f===0&&m===_.length?n.fromByteArray(_):n.fromByteArray(_.slice(f,m))}function Z(_,f,m){m=Math.min(_.length,m);let T=[],P=f;for(;P<m;){let F=_[P],N=null,ie=F>239?4:F>223?3:F>191?2:1;if(P+ie<=m){let pe,he,me,fe;switch(ie){case 1:F<128&&(N=F);break;case 2:pe=_[P+1],(pe&192)===128&&(fe=(F&31)<<6|pe&63,fe>127&&(N=fe));break;case 3:pe=_[P+1],he=_[P+2],(pe&192)===128&&(he&192)===128&&(fe=(F&15)<<12|(pe&63)<<6|he&63,fe>2047&&(fe<55296||fe>57343)&&(N=fe));break;case 4:pe=_[P+1],he=_[P+2],me=_[P+3],(pe&192)===128&&(he&192)===128&&(me&192)===128&&(fe=(F&15)<<18|(pe&63)<<12|(he&63)<<6|me&63,fe>65535&&fe<1114112&&(N=fe))}}N===null?(N=65533,ie=1):N>65535&&(N-=65536,T.push(N>>>10&1023|55296),N=56320|N&1023),T.push(N),P+=ie}return ue(T)}let $=4096;function ue(_){let f=_.length;if(f<=$)return String.fromCharCode.apply(String,_);let m="",T=0;for(;T<f;)m+=String.fromCharCode.apply(String,_.slice(T,T+=$));return m}function le(_,f,m){let T="";m=Math.min(_.length,m);for(let P=f;P<m;++P)T+=String.fromCharCode(_[P]&127);return T}function ce(_,f,m){let T="";m=Math.min(_.length,m);for(let P=f;P<m;++P)T+=String.fromCharCode(_[P]);return T}function Ee(_,f,m){let T=_.length;(!f||f<0)&&(f=0),(!m||m<0||m>T)&&(m=T);let P="";for(let F=f;F<m;++F)P+=s5[_[F]];return P}function Ie(_,f,m){let T=_.slice(f,m),P="";for(let F=0;F<T.length-1;F+=2)P+=String.fromCharCode(T[F]+T[F+1]*256);return P}o.prototype.slice=function(f,m){let T=this.length;f=~~f,m=m===void 0?T:~~m,f<0?(f+=T,f<0&&(f=0)):f>T&&(f=T),m<0?(m+=T,m<0&&(m=0)):m>T&&(m=T),m<f&&(m=f);let P=this.subarray(f,m);return Object.setPrototypeOf(P,o.prototype),P};function se(_,f,m){if(_%1!==0||_<0)throw new RangeError("offset is not uint");if(_+f>m)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(f,m,T){f=f>>>0,m=m>>>0,T||se(f,m,this.length);let P=this[f],F=1,N=0;for(;++N<m&&(F*=256);)P+=this[f+N]*F;return P},o.prototype.readUintBE=o.prototype.readUIntBE=function(f,m,T){f=f>>>0,m=m>>>0,T||se(f,m,this.length);let P=this[f+--m],F=1;for(;m>0&&(F*=256);)P+=this[f+--m]*F;return P},o.prototype.readUint8=o.prototype.readUInt8=function(f,m){return f=f>>>0,m||se(f,1,this.length),this[f]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(f,m){return f=f>>>0,m||se(f,2,this.length),this[f]|this[f+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(f,m){return f=f>>>0,m||se(f,2,this.length),this[f]<<8|this[f+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(f,m){return f=f>>>0,m||se(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,m){return f=f>>>0,m||se(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},o.prototype.readBigUInt64LE=s0(function(f){f=f>>>0,S0(f,"offset");let m=this[f],T=this[f+7];(m===void 0||T===void 0)&&V0(f,this.length-8);let P=m+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,F=this[++f]+this[++f]*2**8+this[++f]*2**16+T*2**24;return BigInt(P)+(BigInt(F)<<BigInt(32))}),o.prototype.readBigUInt64BE=s0(function(f){f=f>>>0,S0(f,"offset");let m=this[f],T=this[f+7];(m===void 0||T===void 0)&&V0(f,this.length-8);let P=m*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],F=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+T;return(BigInt(P)<<BigInt(32))+BigInt(F)}),o.prototype.readIntLE=function(f,m,T){f=f>>>0,m=m>>>0,T||se(f,m,this.length);let P=this[f],F=1,N=0;for(;++N<m&&(F*=256);)P+=this[f+N]*F;return F*=128,P>=F&&(P-=Math.pow(2,8*m)),P},o.prototype.readIntBE=function(f,m,T){f=f>>>0,m=m>>>0,T||se(f,m,this.length);let P=m,F=1,N=this[f+--P];for(;P>0&&(F*=256);)N+=this[f+--P]*F;return F*=128,N>=F&&(N-=Math.pow(2,8*m)),N},o.prototype.readInt8=function(f,m){return f=f>>>0,m||se(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},o.prototype.readInt16LE=function(f,m){f=f>>>0,m||se(f,2,this.length);let T=this[f]|this[f+1]<<8;return T&32768?T|4294901760:T},o.prototype.readInt16BE=function(f,m){f=f>>>0,m||se(f,2,this.length);let T=this[f+1]|this[f]<<8;return T&32768?T|4294901760:T},o.prototype.readInt32LE=function(f,m){return f=f>>>0,m||se(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},o.prototype.readInt32BE=function(f,m){return f=f>>>0,m||se(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},o.prototype.readBigInt64LE=s0(function(f){f=f>>>0,S0(f,"offset");let m=this[f],T=this[f+7];(m===void 0||T===void 0)&&V0(f,this.length-8);let P=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(T<<24);return(BigInt(P)<<BigInt(32))+BigInt(m+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),o.prototype.readBigInt64BE=s0(function(f){f=f>>>0,S0(f,"offset");let m=this[f],T=this[f+7];(m===void 0||T===void 0)&&V0(f,this.length-8);let P=(m<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(P)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+T)}),o.prototype.readFloatLE=function(f,m){return f=f>>>0,m||se(f,4,this.length),e.read(this,f,!0,23,4)},o.prototype.readFloatBE=function(f,m){return f=f>>>0,m||se(f,4,this.length),e.read(this,f,!1,23,4)},o.prototype.readDoubleLE=function(f,m){return f=f>>>0,m||se(f,8,this.length),e.read(this,f,!0,52,8)},o.prototype.readDoubleBE=function(f,m){return f=f>>>0,m||se(f,8,this.length),e.read(this,f,!1,52,8)};function Y(_,f,m,T,P,F){if(!o.isBuffer(_))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>P||f<F)throw new RangeError('"value" argument is out of bounds');if(m+T>_.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(f,m,T,P){if(f=+f,m=m>>>0,T=T>>>0,!P){let ie=Math.pow(2,8*T)-1;Y(this,f,m,T,ie,0)}let F=1,N=0;for(this[m]=f&255;++N<T&&(F*=256);)this[m+N]=f/F&255;return m+T},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(f,m,T,P){if(f=+f,m=m>>>0,T=T>>>0,!P){let ie=Math.pow(2,8*T)-1;Y(this,f,m,T,ie,0)}let F=T-1,N=1;for(this[m+F]=f&255;--F>=0&&(N*=256);)this[m+F]=f/N&255;return m+T},o.prototype.writeUint8=o.prototype.writeUInt8=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,1,255,0),this[m]=f&255,m+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,2,65535,0),this[m]=f&255,this[m+1]=f>>>8,m+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,2,65535,0),this[m]=f>>>8,this[m+1]=f&255,m+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,4,4294967295,0),this[m+3]=f>>>24,this[m+2]=f>>>16,this[m+1]=f>>>8,this[m]=f&255,m+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,4,4294967295,0),this[m]=f>>>24,this[m+1]=f>>>16,this[m+2]=f>>>8,this[m+3]=f&255,m+4};function oe(_,f,m,T,P){W0(f,T,P,_,m,7);let F=Number(f&BigInt(4294967295));_[m++]=F,F=F>>8,_[m++]=F,F=F>>8,_[m++]=F,F=F>>8,_[m++]=F;let N=Number(f>>BigInt(32)&BigInt(4294967295));return _[m++]=N,N=N>>8,_[m++]=N,N=N>>8,_[m++]=N,N=N>>8,_[m++]=N,m}function xe(_,f,m,T,P){W0(f,T,P,_,m,7);let F=Number(f&BigInt(4294967295));_[m+7]=F,F=F>>8,_[m+6]=F,F=F>>8,_[m+5]=F,F=F>>8,_[m+4]=F;let N=Number(f>>BigInt(32)&BigInt(4294967295));return _[m+3]=N,N=N>>8,_[m+2]=N,N=N>>8,_[m+1]=N,N=N>>8,_[m]=N,m+8}o.prototype.writeBigUInt64LE=s0(function(f,m=0){return oe(this,f,m,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=s0(function(f,m=0){return xe(this,f,m,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(f,m,T,P){if(f=+f,m=m>>>0,!P){let pe=Math.pow(2,8*T-1);Y(this,f,m,T,pe-1,-pe)}let F=0,N=1,ie=0;for(this[m]=f&255;++F<T&&(N*=256);)f<0&&ie===0&&this[m+F-1]!==0&&(ie=1),this[m+F]=(f/N>>0)-ie&255;return m+T},o.prototype.writeIntBE=function(f,m,T,P){if(f=+f,m=m>>>0,!P){let pe=Math.pow(2,8*T-1);Y(this,f,m,T,pe-1,-pe)}let F=T-1,N=1,ie=0;for(this[m+F]=f&255;--F>=0&&(N*=256);)f<0&&ie===0&&this[m+F+1]!==0&&(ie=1),this[m+F]=(f/N>>0)-ie&255;return m+T},o.prototype.writeInt8=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,1,127,-128),f<0&&(f=255+f+1),this[m]=f&255,m+1},o.prototype.writeInt16LE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,2,32767,-32768),this[m]=f&255,this[m+1]=f>>>8,m+2},o.prototype.writeInt16BE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,2,32767,-32768),this[m]=f>>>8,this[m+1]=f&255,m+2},o.prototype.writeInt32LE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,4,2147483647,-2147483648),this[m]=f&255,this[m+1]=f>>>8,this[m+2]=f>>>16,this[m+3]=f>>>24,m+4},o.prototype.writeInt32BE=function(f,m,T){return f=+f,m=m>>>0,T||Y(this,f,m,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[m]=f>>>24,this[m+1]=f>>>16,this[m+2]=f>>>8,this[m+3]=f&255,m+4},o.prototype.writeBigInt64LE=s0(function(f,m=0){return oe(this,f,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=s0(function(f,m=0){return xe(this,f,m,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Je(_,f,m,T,P,F){if(m+T>_.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function Ne(_,f,m,T,P){return f=+f,m=m>>>0,P||Je(_,f,m,4),e.write(_,f,m,T,23,4),m+4}o.prototype.writeFloatLE=function(f,m,T){return Ne(this,f,m,!0,T)},o.prototype.writeFloatBE=function(f,m,T){return Ne(this,f,m,!1,T)};function n0(_,f,m,T,P){return f=+f,m=m>>>0,P||Je(_,f,m,8),e.write(_,f,m,T,52,8),m+8}o.prototype.writeDoubleLE=function(f,m,T){return n0(this,f,m,!0,T)},o.prototype.writeDoubleBE=function(f,m,T){return n0(this,f,m,!1,T)},o.prototype.copy=function(f,m,T,P){if(!o.isBuffer(f))throw new TypeError("argument should be a Buffer");if(T||(T=0),!P&&P!==0&&(P=this.length),m>=f.length&&(m=f.length),m||(m=0),P>0&&P<T&&(P=T),P===T||f.length===0||this.length===0)return 0;if(m<0)throw new RangeError("targetStart out of bounds");if(T<0||T>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),f.length-m<P-T&&(P=f.length-m+T);let F=P-T;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(m,T,P):Uint8Array.prototype.set.call(f,this.subarray(T,P),m),F},o.prototype.fill=function(f,m,T,P){if(typeof f=="string"){if(typeof m=="string"?(P=m,m=0,T=this.length):typeof T=="string"&&(P=T,T=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!o.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(f.length===1){let N=f.charCodeAt(0);(P==="utf8"&&N<128||P==="latin1")&&(f=N)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(m<0||this.length<m||this.length<T)throw new RangeError("Out of range index");if(T<=m)return this;m=m>>>0,T=T===void 0?this.length:T>>>0,f||(f=0);let F;if(typeof f=="number")for(F=m;F<T;++F)this[F]=f;else{let N=o.isBuffer(f)?f:o.from(f,P),ie=N.length;if(ie===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(F=0;F<T-m;++F)this[F+m]=N[F%ie]}return this};let _e={};function f0(_,f,m){_e[_]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${_}]`,this.stack,delete this.name}get code(){return _}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${_}]: ${this.message}`}}}f0("ERR_BUFFER_OUT_OF_BOUNDS",function(_){return _?`${_} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),f0("ERR_INVALID_ARG_TYPE",function(_,f){return`The "${_}" argument must be of type number. Received type ${typeof f}`},TypeError),f0("ERR_OUT_OF_RANGE",function(_,f,m){let T=`The value of "${_}" is out of range.`,P=m;return Number.isInteger(m)&&Math.abs(m)>2**32?P=i5(String(m)):typeof m=="bigint"&&(P=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(P=i5(P)),P+="n"),T+=` It must be ${f}. Received ${P}`,T},RangeError);function i5(_){let f="",m=_.length,T=_[0]==="-"?1:0;for(;m>=T+4;m-=3)f=`_${_.slice(m-3,m)}${f}`;return`${_.slice(0,m)}${f}`}function n5(_,f,m){S0(f,"offset"),(_[f]===void 0||_[f+m]===void 0)&&V0(f,_.length-(m+1))}function W0(_,f,m,T,P,F){if(_>m||_<f){let N=typeof f=="bigint"?"n":"",ie;throw f===0||f===BigInt(0)?ie=`>= 0${N} and < 2${N} ** ${(F+1)*8}${N}`:ie=`>= -(2${N} ** ${(F+1)*8-1}${N}) and < 2 ** ${(F+1)*8-1}${N}`,new _e.ERR_OUT_OF_RANGE("value",ie,_)}n5(T,P,F)}function S0(_,f){if(typeof _!="number")throw new _e.ERR_INVALID_ARG_TYPE(f,"number",_)}function V0(_,f,m){throw Math.floor(_)!==_?(S0(_,m),new _e.ERR_OUT_OF_RANGE("offset","an integer",_)):f<0?new _e.ERR_BUFFER_OUT_OF_BOUNDS:new _e.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${f}`,_)}let K5=/[^+/0-9A-Za-z-_]/g;function j0(_){if(_=_.split("=")[0],_=_.trim().replace(K5,""),_.length<2)return"";for(;_.length%4!==0;)_=_+"=";return _}function Et(_,f){f=f||1/0;let m,T=_.length,P=null,F=[];for(let N=0;N<T;++N){if(m=_.charCodeAt(N),m>55295&&m<57344){if(!P){if(m>56319){(f-=3)>-1&&F.push(239,191,189);continue}else if(N+1===T){(f-=3)>-1&&F.push(239,191,189);continue}P=m;continue}if(m<56320){(f-=3)>-1&&F.push(239,191,189),P=m;continue}m=(P-55296<<10|m-56320)+65536}else P&&(f-=3)>-1&&F.push(239,191,189);if(P=null,m<128){if((f-=1)<0)break;F.push(m)}else if(m<2048){if((f-=2)<0)break;F.push(m>>6|192,m&63|128)}else if(m<65536){if((f-=3)<0)break;F.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((f-=4)<0)break;F.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return F}function J5(_){let f=[];for(let m=0;m<_.length;++m)f.push(_.charCodeAt(m)&255);return f}function Z5(_,f){let m,T,P,F=[];for(let N=0;N<_.length&&!((f-=2)<0);++N)m=_.charCodeAt(N),T=m>>8,P=m%256,F.push(P),F.push(T);return F}function pr(_){return n.toByteArray(j0(_))}function Ze(_,f,m,T){let P;for(P=0;P<T&&!(P+m>=f.length||P>=_.length);++P)f[P+m]=_[P];return P}function Me(_,f){return _ instanceof f||_!=null&&_.constructor!=null&&_.constructor.name!=null&&_.constructor.name===f.name}function xt(_){return _!==_}let s5=function(){let _="0123456789abcdef",f=new Array(256);for(let m=0;m<16;++m){let T=m*16;for(let P=0;P<16;++P)f[T+P]=_[m]+_[P]}return f}();function s0(_){return typeof BigInt>"u"?Rt:_}function Rt(){throw new Error("BigInt not supported")}return Q0}var v5,P2,t1,I2,Q0,H2,D2=Xe(()=>{E();x();k();R();v5={},P2=!1;t1={},I2=!1;Q0={},H2=!1});var K0,z,B9,P9,F2=Xe(()=>{E();x();k();R();D2();K0=O2();K0.Buffer;K0.SlowBuffer;K0.INSPECT_MAX_BYTES;K0.kMaxLength;z=K0.Buffer,B9=K0.INSPECT_MAX_BYTES,P9=K0.kMaxLength});var k=Xe(()=>{F2()});var V2=t0((kr,Tr)=>{E();x();k();R();(function(n,e){typeof kr=="object"&&typeof Tr<"u"?Tr.exports=e():typeof define=="function"&&define.amd?define(e):n.Stats=e()})(kr,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,a=0,v=e(new n.Panel("FPS","#0ff","#002")),l=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(){a++;var u=(performance||Date).now();if(l.update(u-s,200),u>o+1e3&&(v.update(1e3*a/(u-o),100),o=u,a=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,a=o(window.devicePixelRatio||1),v=80*a,l=48*a,c=3*a,u=2*a,h=3*a,p=15*a,g=74*a,y=30*a,A=document.createElement("canvas");A.width=v,A.height=l,A.style.cssText="width:80px;height:48px";var b=A.getContext("2d");return b.font="bold "+9*a+"px Helvetica,Arial,sans-serif",b.textBaseline="top",b.fillStyle=r,b.fillRect(0,0,v,l),b.fillStyle=t,b.fillText(e,c,u),b.fillRect(h,p,g,y),b.fillStyle=r,b.globalAlpha=.9,b.fillRect(h,p,g,y),{dom:A,update:function(w,S){i=Math.min(i,w),s=Math.max(s,w),b.fillStyle=r,b.globalAlpha=1,b.fillRect(0,0,v,p),b.fillStyle=t,b.fillText(o(w)+" "+e+" ("+o(i)+"-"+o(s)+")",c,u),b.drawImage(A,h+a,p,g-a,y,h,p,g-a,y),b.fillRect(h+g-a,p,a,y),b.fillStyle=r,b.globalAlpha=.9,b.fillRect(h+g-a,p,a,o((1-w/S)*y))}}},n})});var Us=t0((Ls,R1)=>{E();x();k();R();(function(n,e){typeof R1=="object"&&R1.exports?R1.exports=e():n.nearley=e()})(Ls,function(){function n(v,l,c){return this.id=++n.highestId,this.name=v,this.symbols=l,this.postprocess=c,this}n.highestId=0,n.prototype.toString=function(v){var l=typeof v>"u"?this.symbols.map(a).join(" "):this.symbols.slice(0,v).map(a).join(" ")+" \u25CF "+this.symbols.slice(v).map(a).join(" ");return this.name+" \u2192 "+l};function e(v,l,c,u){this.rule=v,this.dot=l,this.reference=c,this.data=[],this.wantedBy=u,this.isComplete=this.dot===v.symbols.length}e.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},e.prototype.nextState=function(v){var l=new e(this.rule,this.dot+1,this.reference,this.wantedBy);return l.left=this,l.right=v,l.isComplete&&(l.data=l.build(),l.right=void 0),l},e.prototype.build=function(){var v=[],l=this;do v.push(l.right.data),l=l.left;while(l.left);return v.reverse(),v},e.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,s.fail))};function t(v,l){this.grammar=v,this.index=l,this.states=[],this.wants={},this.scannable=[],this.completed={}}t.prototype.process=function(v){for(var l=this.states,c=this.wants,u=this.completed,h=0;h<l.length;h++){var p=l[h];if(p.isComplete){if(p.finish(),p.data!==s.fail){for(var g=p.wantedBy,y=g.length;y--;){var A=g[y];this.complete(A,p)}if(p.reference===this.index){var b=p.rule.name;(this.completed[b]=this.completed[b]||[]).push(p)}}}else{var b=p.rule.symbols[p.dot];if(typeof b!="string"){this.scannable.push(p);continue}if(c[b]){if(c[b].push(p),u.hasOwnProperty(b))for(var w=u[b],y=0;y<w.length;y++){var S=w[y];this.complete(p,S)}}else c[b]=[p],this.predict(b)}}},t.prototype.predict=function(v){for(var l=this.grammar.byName[v]||[],c=0;c<l.length;c++){var u=l[c],h=this.wants[v],p=new e(u,0,this.index,h);this.states.push(p)}},t.prototype.complete=function(v,l){var c=v.nextState(l);this.states.push(c)};function r(v,l){this.rules=v,this.start=l||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,l){var c=u.Lexer;u.ParserStart&&(l=u.ParserStart,u=u.ParserRules);var u=u.map(function(p){return new n(p.name,p.symbols,p.postprocess)}),h=new r(u,l);return h.lexer=c,h};function i(){this.reset("")}i.prototype.reset=function(v,l){this.buffer=v,this.index=0,this.line=l?l.line:1,this.lastLineBreak=l?-l.col:0},i.prototype.next=function(){if(this.index<this.buffer.length){var v=this.buffer[this.index++];return v===`
2
- `&&(this.line+=1,this.lastLineBreak=this.index),{value:v}}},i.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},i.prototype.formatError=function(v,l){var c=this.buffer;if(typeof c=="string"){var u=c.split(`
3
- `).slice(Math.max(0,this.line-5),this.line),h=c.indexOf(`
4
- `,this.index);h===-1&&(h=c.length);var p=this.index-this.lastLineBreak,g=String(this.line).length;return l+=" at line "+this.line+" col "+p+`:
1
+ var K6=Object.create;var b5=Object.defineProperty;var J6=Object.getOwnPropertyDescriptor;var q6=Object.getOwnPropertyNames;var X6=Object.getPrototypeOf,Z6=Object.prototype.hasOwnProperty;var $6=(n,e,t)=>e in n?b5(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var e7=(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 Ne=(n,e)=>()=>(n&&(e=n(n=0)),e);var lt=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),hr=(n,e)=>{for(var t in e)b5(n,t,{get:e[t],enumerable:!0})},Z1=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of q6(e))!Z6.call(n,i)&&i!==t&&b5(n,i,{get:()=>e[i],enumerable:!(r=J6(e,i))||r.enumerable});return n};var y5=(n,e,t)=>(t=n!=null?K6(X6(n)):{},Z1(e||!n||!n.__esModule?b5(t,"default",{value:n,enumerable:!0}):t,n)),t7=n=>Z1(b5({},"__esModule",{value:!0}),n);var d=(n,e,t)=>($6(n,typeof e!="symbol"?e+"":e,t),t);var E=Ne(()=>{});var x=Ne(()=>{});var O={};hr(O,{_debugEnd:()=>Gs,_debugProcess:()=>Us,_events:()=>i2,_eventsCount:()=>n2,_exiting:()=>ws,_fatalExceptions:()=>Os,_getActiveHandles:()=>Rs,_getActiveRequests:()=>xs,_kill:()=>Ts,_linkedBinding:()=>ys,_maxListeners:()=>r2,_preload_modules:()=>$s,_rawDebug:()=>gs,_startProfilerIdleNotifier:()=>Vs,_stopProfilerIdleNotifier:()=>Ws,_tickCallback:()=>zs,abort:()=>Ys,addListener:()=>s2,allowedNodeEnvironmentFlags:()=>Is,arch:()=>is,argv:()=>os,argv0:()=>Zs,assert:()=>Ls,binding:()=>ds,browser:()=>ps,chdir:()=>hs,config:()=>As,cpuUsage:()=>gr,cwd:()=>fs,debugPort:()=>Xs,default:()=>h2,dlopen:()=>Es,domain:()=>_s,emit:()=>c2,emitWarning:()=>cs,env:()=>ss,execArgv:()=>as,execPath:()=>qs,exit:()=>Bs,features:()=>Hs,hasUncaughtExceptionCaptureCallback:()=>Fs,hrtime:()=>pr,kill:()=>Cs,listeners:()=>f2,memoryUsage:()=>Ss,moduleLoadList:()=>bs,nextTick:()=>es,off:()=>a2,on:()=>Pt,once:()=>o2,openStdin:()=>Ps,pid:()=>Ks,platform:()=>ns,ppid:()=>Js,prependListener:()=>d2,prependOnceListener:()=>u2,reallyExit:()=>ks,release:()=>ms,removeAllListeners:()=>l2,removeListener:()=>v2,resourceUsage:()=>Ms,setSourceMapsEnabled:()=>e2,setUncaughtExceptionCaptureCallback:()=>Ds,stderr:()=>js,stdin:()=>Qs,stdout:()=>Ns,title:()=>rs,umask:()=>us,uptime:()=>t2,version:()=>vs,versions:()=>ls});function Yi(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function r7(){!D0||!s0||(D0=!1,s0.length?Bt=s0.concat(Bt):mr=-1,Bt.length&&$1())}function $1(){if(!D0){var n=setTimeout(r7,0);D0=!0;for(var e=Bt.length;e;){for(s0=Bt,Bt=[];++mr<e;)s0&&s0[mr].run();mr=-1,e=Bt.length}s0=null,D0=!1,clearTimeout(n)}}function es(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];Bt.push(new ts(n,e)),Bt.length===1&&!D0&&setTimeout($1,0)}function ts(n,e){this.fun=n,this.array=e}function Je(){}function ys(n){Yi("_linkedBinding")}function Es(n){Yi("dlopen")}function xs(){return[]}function Rs(){return[]}function Ls(n,e){if(!n)throw new Error(e||"assertion error")}function Fs(){return!1}function t2(){return Vt.now()/1e3}function pr(n){var e=Math.floor((Date.now()-Vt.now())*.001),t=Vt.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+=Qi)),[r,i]}function Pt(){return h2}function f2(n){return[]}var Bt,D0,s0,mr,rs,is,ns,ss,os,as,vs,ls,cs,ds,us,fs,hs,ms,ps,gs,bs,_s,ws,As,ks,Ts,gr,Ms,Ss,Cs,Bs,Ps,Is,Hs,Os,Ds,zs,Us,Gs,Vs,Ws,Ns,js,Qs,Ys,Ks,Js,qs,Xs,Zs,$s,e2,Vt,ji,Qi,r2,i2,n2,s2,o2,a2,v2,l2,c2,d2,u2,h2,m2=Ne(()=>{E();x();k();R();Bt=[],D0=!1,mr=-1;ts.prototype.run=function(){this.fun.apply(null,this.array)};rs="browser",is="x64",ns="browser",ss={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},os=["/usr/bin/node"],as=[],vs="v16.8.0",ls={},cs=function(n,e){},ds=function(n){Yi("binding")},us=function(n){return 0},fs=function(){return"/"},hs=function(n){},ms={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};ps=!0,gs=Je,bs=[];_s={},ws=!1,As={};ks=Je,Ts=Je,gr=function(){return{}},Ms=gr,Ss=gr,Cs=Je,Bs=Je,Ps=Je,Is={};Hs={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Os=Je,Ds=Je;zs=Je,Us=Je,Gs=Je,Vs=Je,Ws=Je,Ns=void 0,js=void 0,Qs=void 0,Ys=Je,Ks=2,Js=1,qs="/bin/usr/node",Xs=9229,Zs="node",$s=[],e2=Je,Vt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Vt.now===void 0&&(ji=Date.now(),Vt.timing&&Vt.timing.navigationStart&&(ji=Vt.timing.navigationStart),Vt.now=()=>Date.now()-ji);Qi=1e9;pr.bigint=function(n){var e=pr(n);return typeof BigInt>"u"?e[0]*Qi+e[1]:BigInt(e[0]*Qi)+BigInt(e[1])};r2=10,i2={},n2=0;s2=Pt,o2=Pt,a2=Pt,v2=Pt,l2=Pt,c2=Je,d2=Pt,u2=Pt;h2={version:vs,versions:ls,arch:is,platform:ns,browser:ps,release:ms,_rawDebug:gs,moduleLoadList:bs,binding:ds,_linkedBinding:ys,_events:i2,_eventsCount:n2,_maxListeners:r2,on:Pt,addListener:s2,once:o2,off:a2,removeListener:v2,removeAllListeners:l2,emit:c2,prependListener:d2,prependOnceListener:u2,listeners:f2,domain:_s,_exiting:ws,config:As,dlopen:Es,uptime:t2,_getActiveRequests:xs,_getActiveHandles:Rs,reallyExit:ks,_kill:Ts,cpuUsage:gr,resourceUsage:Ms,memoryUsage:Ss,kill:Cs,exit:Bs,openStdin:Ps,allowedNodeEnvironmentFlags:Is,assert:Ls,features:Hs,_fatalExceptions:Os,setUncaughtExceptionCaptureCallback:Ds,hasUncaughtExceptionCaptureCallback:Fs,emitWarning:cs,nextTick:es,_tickCallback:zs,_debugProcess:Us,_debugEnd:Gs,_startProfilerIdleNotifier:Vs,_stopProfilerIdleNotifier:Ws,stdout:Ns,stdin:Qs,stderr:js,abort:Ys,umask:us,chdir:hs,cwd:fs,env:ss,title:rs,argv:os,execArgv:as,pid:Ks,ppid:Js,execPath:qs,debugPort:Xs,hrtime:pr,argv0:Zs,_preload_modules:$s,setSourceMapsEnabled:e2}});var R=Ne(()=>{m2()});function i7(){if(p2)return _5;p2=!0,_5.byteLength=v,_5.toByteArray=l,_5.fromByteArray=f;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(m){var g=m.length;if(g%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=m.indexOf("=");b===-1&&(b=g);var A=b===g?0:4-b%4;return[b,A]}function v(m){var g=o(m),b=g[0],A=g[1];return(b+A)*3/4-A}function a(m,g,b){return(g+b)*3/4-b}function l(m){var g,b=o(m),A=b[0],y=b[1],_=new t(a(m,A,y)),M=0,C=y>0?A-4:A,T;for(T=0;T<C;T+=4)g=e[m.charCodeAt(T)]<<18|e[m.charCodeAt(T+1)]<<12|e[m.charCodeAt(T+2)]<<6|e[m.charCodeAt(T+3)],_[M++]=g>>16&255,_[M++]=g>>8&255,_[M++]=g&255;return y===2&&(g=e[m.charCodeAt(T)]<<2|e[m.charCodeAt(T+1)]>>4,_[M++]=g&255),y===1&&(g=e[m.charCodeAt(T)]<<10|e[m.charCodeAt(T+1)]<<4|e[m.charCodeAt(T+2)]>>2,_[M++]=g>>8&255,_[M++]=g&255),_}function c(m){return n[m>>18&63]+n[m>>12&63]+n[m>>6&63]+n[m&63]}function u(m,g,b){for(var A,y=[],_=g;_<b;_+=3)A=(m[_]<<16&16711680)+(m[_+1]<<8&65280)+(m[_+2]&255),y.push(c(A));return y.join("")}function f(m){for(var g,b=m.length,A=b%3,y=[],_=16383,M=0,C=b-A;M<C;M+=_)y.push(u(m,M,M+_>C?C:M+_));return A===1?(g=m[b-1],y.push(n[g>>2]+n[g<<4&63]+"==")):A===2&&(g=(m[b-2]<<8)+m[b-1],y.push(n[g>>10]+n[g>>4&63]+n[g<<2&63]+"=")),y.join("")}return _5}function n7(){if(g2)return br;g2=!0;return br.read=function(n,e,t,r,i){var s,o,v=i*8-r-1,a=(1<<v)-1,l=a>>1,c=-7,u=t?i-1:0,f=t?-1:1,m=n[e+u];for(u+=f,s=m&(1<<-c)-1,m>>=-c,c+=v;c>0;s=s*256+n[e+u],u+=f,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=r;c>0;o=o*256+n[e+u],u+=f,c-=8);if(s===0)s=1-l;else{if(s===a)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-l}return(m?-1:1)*o*Math.pow(2,s-r)},br.write=function(n,e,t,r,i,s){var o,v,a,l=s*8-i-1,c=(1<<l)-1,u=c>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:s-1,g=r?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(v=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+=f/a:e+=f*Math.pow(2,1-u),e*a>=2&&(o++,a/=2),o+u>=c?(v=0,o=c):o+u>=1?(v=(e*a-1)*Math.pow(2,i),o=o+u):(v=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;n[t+m]=v&255,m+=g,v/=256,i-=8);for(o=o<<i|v,l+=i;l>0;n[t+m]=o&255,m+=g,o/=256,l-=8);n[t+m-g]|=b*128},br}function y2(){if(b2)return o0;b2=!0;let n=i7(),e=n7(),t=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;o0.Buffer=o,o0.SlowBuffer=y,o0.INSPECT_MAX_BYTES=50;let r=2147483647;o0.kMaxLength=r,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u";function i(){try{let w=new Uint8Array(1),h={foo:function(){return 42}};return Object.setPrototypeOf(h,Uint8Array.prototype),Object.setPrototypeOf(w,h),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 h=new Uint8Array(w);return Object.setPrototypeOf(h,o.prototype),h}function o(w,h,p){if(typeof w=="number"){if(typeof h=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(w)}return v(w,h,p)}o.poolSize=8192;function v(w,h,p){if(typeof w=="string")return u(w,h);if(ArrayBuffer.isView(w))return m(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(Pe(w,ArrayBuffer)||w&&Pe(w.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Pe(w,SharedArrayBuffer)||w&&Pe(w.buffer,SharedArrayBuffer)))return g(w,h,p);if(typeof w=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let S=w.valueOf&&w.valueOf();if(S!=null&&S!==w)return o.from(S,h,p);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"),h,p);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,h,p){return v(w,h,p)},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 l(w,h,p){return a(w),w<=0?s(w):h!==void 0?typeof p=="string"?s(w).fill(h,p):s(w).fill(h):s(w)}o.alloc=function(w,h,p){return l(w,h,p)};function c(w){return a(w),s(w<0?0:A(w)|0)}o.allocUnsafe=function(w){return c(w)},o.allocUnsafeSlow=function(w){return c(w)};function u(w,h){if((typeof h!="string"||h==="")&&(h="utf8"),!o.isEncoding(h))throw new TypeError("Unknown encoding: "+h);let p=_(w,h)|0,S=s(p),I=S.write(w,h);return I!==p&&(S=S.slice(0,I)),S}function f(w){let h=w.length<0?0:A(w.length)|0,p=s(h);for(let S=0;S<h;S+=1)p[S]=w[S]&255;return p}function m(w){if(Pe(w,Uint8Array)){let h=new Uint8Array(w);return g(h.buffer,h.byteOffset,h.byteLength)}return f(w)}function g(w,h,p){if(h<0||w.byteLength<h)throw new RangeError('"offset" is outside of buffer bounds');if(w.byteLength<h+(p||0))throw new RangeError('"length" is outside of buffer bounds');let S;return h===void 0&&p===void 0?S=new Uint8Array(w):p===void 0?S=new Uint8Array(w,h):S=new Uint8Array(w,h,p),Object.setPrototypeOf(S,o.prototype),S}function b(w){if(o.isBuffer(w)){let h=A(w.length)|0,p=s(h);return p.length===0||w.copy(p,0,0,h),p}if(w.length!==void 0)return typeof w.length!="number"||H0(w.length)?s(0):f(w);if(w.type==="Buffer"&&Array.isArray(w.data))return f(w.data)}function A(w){if(w>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return w|0}function y(w){return+w!=w&&(w=0),o.alloc(+w)}o.isBuffer=function(h){return h!=null&&h._isBuffer===!0&&h!==o.prototype},o.compare=function(h,p){if(Pe(h,Uint8Array)&&(h=o.from(h,h.offset,h.byteLength)),Pe(p,Uint8Array)&&(p=o.from(p,p.offset,p.byteLength)),!o.isBuffer(h)||!o.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===p)return 0;let S=h.length,I=p.length;for(let U=0,V=Math.min(S,I);U<V;++U)if(h[U]!==p[U]){S=h[U],I=p[U];break}return S<I?-1:I<S?1:0},o.isEncoding=function(h){switch(String(h).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(h,p){if(!Array.isArray(h))throw new TypeError('"list" argument must be an Array of Buffers');if(h.length===0)return o.alloc(0);let S;if(p===void 0)for(p=0,S=0;S<h.length;++S)p+=h[S].length;let I=o.allocUnsafe(p),U=0;for(S=0;S<h.length;++S){let V=h[S];if(Pe(V,Uint8Array))U+V.length>I.length?(o.isBuffer(V)||(V=o.from(V)),V.copy(I,U)):Uint8Array.prototype.set.call(I,V,U);else if(o.isBuffer(V))V.copy(I,U);else throw new TypeError('"list" argument must be an Array of Buffers');U+=V.length}return I};function _(w,h){if(o.isBuffer(w))return w.length;if(ArrayBuffer.isView(w)||Pe(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 p=w.length,S=arguments.length>2&&arguments[2]===!0;if(!S&&p===0)return 0;let I=!1;for(;;)switch(h){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return L0(w).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return Ni(w).length;default:if(I)return S?-1:L0(w).length;h=(""+h).toLowerCase(),I=!0}}o.byteLength=_;function M(w,h,p){let S=!1;if((h===void 0||h<0)&&(h=0),h>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,h>>>=0,p<=h))return"";for(w||(w="utf8");;)switch(w){case"hex":return ye(this,h,p);case"utf8":case"utf-8":return q(this,h,p);case"ascii":return oe(this,h,p);case"latin1":case"binary":return le(this,h,p);case"base64":return Y(this,h,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,h,p);default:if(S)throw new TypeError("Unknown encoding: "+w);w=(w+"").toLowerCase(),S=!0}}o.prototype._isBuffer=!0;function C(w,h,p){let S=w[h];w[h]=w[p],w[p]=S}o.prototype.swap16=function(){let h=this.length;if(h%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<h;p+=2)C(this,p,p+1);return this},o.prototype.swap32=function(){let h=this.length;if(h%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<h;p+=4)C(this,p,p+3),C(this,p+1,p+2);return this},o.prototype.swap64=function(){let h=this.length;if(h%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<h;p+=8)C(this,p,p+7),C(this,p+1,p+6),C(this,p+2,p+5),C(this,p+3,p+4);return this},o.prototype.toString=function(){let h=this.length;return h===0?"":arguments.length===0?q(this,0,h):M.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(h){if(!o.isBuffer(h))throw new TypeError("Argument must be a Buffer");return this===h?!0:o.compare(this,h)===0},o.prototype.inspect=function(){let h="",p=o0.INSPECT_MAX_BYTES;return h=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(h+=" ... "),"<Buffer "+h+">"},t&&(o.prototype[t]=o.prototype.inspect),o.prototype.compare=function(h,p,S,I,U){if(Pe(h,Uint8Array)&&(h=o.from(h,h.offset,h.byteLength)),!o.isBuffer(h))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof h);if(p===void 0&&(p=0),S===void 0&&(S=h?h.length:0),I===void 0&&(I=0),U===void 0&&(U=this.length),p<0||S>h.length||I<0||U>this.length)throw new RangeError("out of range index");if(I>=U&&p>=S)return 0;if(I>=U)return-1;if(p>=S)return 1;if(p>>>=0,S>>>=0,I>>>=0,U>>>=0,this===h)return 0;let V=U-I,ie=S-p,_e=Math.min(V,ie),ge=this.slice(I,U),be=h.slice(p,S);for(let me=0;me<_e;++me)if(ge[me]!==be[me]){V=ge[me],ie=be[me];break}return V<ie?-1:ie<V?1:0};function T(w,h,p,S,I){if(w.length===0)return-1;if(typeof p=="string"?(S=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,H0(p)&&(p=I?0:w.length-1),p<0&&(p=w.length+p),p>=w.length){if(I)return-1;p=w.length-1}else if(p<0)if(I)p=0;else return-1;if(typeof h=="string"&&(h=o.from(h,S)),o.isBuffer(h))return h.length===0?-1:P(w,h,p,S,I);if(typeof h=="number")return h=h&255,typeof Uint8Array.prototype.indexOf=="function"?I?Uint8Array.prototype.indexOf.call(w,h,p):Uint8Array.prototype.lastIndexOf.call(w,h,p):P(w,[h],p,S,I);throw new TypeError("val must be string, number or Buffer")}function P(w,h,p,S,I){let U=1,V=w.length,ie=h.length;if(S!==void 0&&(S=String(S).toLowerCase(),S==="ucs2"||S==="ucs-2"||S==="utf16le"||S==="utf-16le")){if(w.length<2||h.length<2)return-1;U=2,V/=2,ie/=2,p/=2}function _e(be,me){return U===1?be[me]:be.readUInt16BE(me*U)}let ge;if(I){let be=-1;for(ge=p;ge<V;ge++)if(_e(w,ge)===_e(h,be===-1?0:ge-be)){if(be===-1&&(be=ge),ge-be+1===ie)return be*U}else be!==-1&&(ge-=ge-be),be=-1}else for(p+ie>V&&(p=V-ie),ge=p;ge>=0;ge--){let be=!0;for(let me=0;me<ie;me++)if(_e(w,ge+me)!==_e(h,me)){be=!1;break}if(be)return ge}return-1}o.prototype.includes=function(h,p,S){return this.indexOf(h,p,S)!==-1},o.prototype.indexOf=function(h,p,S){return T(this,h,p,S,!0)},o.prototype.lastIndexOf=function(h,p,S){return T(this,h,p,S,!1)};function B(w,h,p,S){p=Number(p)||0;let I=w.length-p;S?(S=Number(S),S>I&&(S=I)):S=I;let U=h.length;S>U/2&&(S=U/2);let V;for(V=0;V<S;++V){let ie=parseInt(h.substr(V*2,2),16);if(H0(ie))return V;w[p+V]=ie}return V}function L(w,h,p,S){return it(L0(h,w.length-p),w,p,S)}function G(w,h,p,S){return it(ur(h),w,p,S)}function H(w,h,p,S){return it(Ni(h),w,p,S)}function N(w,h,p,S){return it(fr(h,w.length-p),w,p,S)}o.prototype.write=function(h,p,S,I){if(p===void 0)I="utf8",S=this.length,p=0;else if(S===void 0&&typeof p=="string")I=p,S=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(S)?(S=S>>>0,I===void 0&&(I="utf8")):(I=S,S=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let U=this.length-p;if((S===void 0||S>U)&&(S=U),h.length>0&&(S<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");let V=!1;for(;;)switch(I){case"hex":return B(this,h,p,S);case"utf8":case"utf-8":return L(this,h,p,S);case"ascii":case"latin1":case"binary":return G(this,h,p,S);case"base64":return H(this,h,p,S);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,h,p,S);default:if(V)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),V=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Y(w,h,p){return h===0&&p===w.length?n.fromByteArray(w):n.fromByteArray(w.slice(h,p))}function q(w,h,p){p=Math.min(w.length,p);let S=[],I=h;for(;I<p;){let U=w[I],V=null,ie=U>239?4:U>223?3:U>191?2:1;if(I+ie<=p){let _e,ge,be,me;switch(ie){case 1:U<128&&(V=U);break;case 2:_e=w[I+1],(_e&192)===128&&(me=(U&31)<<6|_e&63,me>127&&(V=me));break;case 3:_e=w[I+1],ge=w[I+2],(_e&192)===128&&(ge&192)===128&&(me=(U&15)<<12|(_e&63)<<6|ge&63,me>2047&&(me<55296||me>57343)&&(V=me));break;case 4:_e=w[I+1],ge=w[I+2],be=w[I+3],(_e&192)===128&&(ge&192)===128&&(be&192)===128&&(me=(U&15)<<18|(_e&63)<<12|(ge&63)<<6|be&63,me>65535&&me<1114112&&(V=me))}}V===null?(V=65533,ie=1):V>65535&&(V-=65536,S.push(V>>>10&1023|55296),V=56320|V&1023),S.push(V),I+=ie}return ae(S)}let Z=4096;function ae(w){let h=w.length;if(h<=Z)return String.fromCharCode.apply(String,w);let p="",S=0;for(;S<h;)p+=String.fromCharCode.apply(String,w.slice(S,S+=Z));return p}function oe(w,h,p){let S="";p=Math.min(w.length,p);for(let I=h;I<p;++I)S+=String.fromCharCode(w[I]&127);return S}function le(w,h,p){let S="";p=Math.min(w.length,p);for(let I=h;I<p;++I)S+=String.fromCharCode(w[I]);return S}function ye(w,h,p){let S=w.length;(!h||h<0)&&(h=0),(!p||p<0||p>S)&&(p=S);let I="";for(let U=h;U<p;++U)I+=g5[w[U]];return I}function pe(w,h,p){let S=w.slice(h,p),I="";for(let U=0;U<S.length-1;U+=2)I+=String.fromCharCode(S[U]+S[U+1]*256);return I}o.prototype.slice=function(h,p){let S=this.length;h=~~h,p=p===void 0?S:~~p,h<0?(h+=S,h<0&&(h=0)):h>S&&(h=S),p<0?(p+=S,p<0&&(p=0)):p>S&&(p=S),p<h&&(p=h);let I=this.subarray(h,p);return Object.setPrototypeOf(I,o.prototype),I};function se(w,h,p){if(w%1!==0||w<0)throw new RangeError("offset is not uint");if(w+h>p)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(h,p,S){h=h>>>0,p=p>>>0,S||se(h,p,this.length);let I=this[h],U=1,V=0;for(;++V<p&&(U*=256);)I+=this[h+V]*U;return I},o.prototype.readUintBE=o.prototype.readUIntBE=function(h,p,S){h=h>>>0,p=p>>>0,S||se(h,p,this.length);let I=this[h+--p],U=1;for(;p>0&&(U*=256);)I+=this[h+--p]*U;return I},o.prototype.readUint8=o.prototype.readUInt8=function(h,p){return h=h>>>0,p||se(h,1,this.length),this[h]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(h,p){return h=h>>>0,p||se(h,2,this.length),this[h]|this[h+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(h,p){return h=h>>>0,p||se(h,2,this.length),this[h]<<8|this[h+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(h,p){return h=h>>>0,p||se(h,4,this.length),(this[h]|this[h+1]<<8|this[h+2]<<16)+this[h+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(h,p){return h=h>>>0,p||se(h,4,this.length),this[h]*16777216+(this[h+1]<<16|this[h+2]<<8|this[h+3])},o.prototype.readBigUInt64LE=ut(function(h){h=h>>>0,Gt(h,"offset");let p=this[h],S=this[h+7];(p===void 0||S===void 0)&&i0(h,this.length-8);let I=p+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24,U=this[++h]+this[++h]*2**8+this[++h]*2**16+S*2**24;return BigInt(I)+(BigInt(U)<<BigInt(32))}),o.prototype.readBigUInt64BE=ut(function(h){h=h>>>0,Gt(h,"offset");let p=this[h],S=this[h+7];(p===void 0||S===void 0)&&i0(h,this.length-8);let I=p*2**24+this[++h]*2**16+this[++h]*2**8+this[++h],U=this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+S;return(BigInt(I)<<BigInt(32))+BigInt(U)}),o.prototype.readIntLE=function(h,p,S){h=h>>>0,p=p>>>0,S||se(h,p,this.length);let I=this[h],U=1,V=0;for(;++V<p&&(U*=256);)I+=this[h+V]*U;return U*=128,I>=U&&(I-=Math.pow(2,8*p)),I},o.prototype.readIntBE=function(h,p,S){h=h>>>0,p=p>>>0,S||se(h,p,this.length);let I=p,U=1,V=this[h+--I];for(;I>0&&(U*=256);)V+=this[h+--I]*U;return U*=128,V>=U&&(V-=Math.pow(2,8*p)),V},o.prototype.readInt8=function(h,p){return h=h>>>0,p||se(h,1,this.length),this[h]&128?(255-this[h]+1)*-1:this[h]},o.prototype.readInt16LE=function(h,p){h=h>>>0,p||se(h,2,this.length);let S=this[h]|this[h+1]<<8;return S&32768?S|4294901760:S},o.prototype.readInt16BE=function(h,p){h=h>>>0,p||se(h,2,this.length);let S=this[h+1]|this[h]<<8;return S&32768?S|4294901760:S},o.prototype.readInt32LE=function(h,p){return h=h>>>0,p||se(h,4,this.length),this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24},o.prototype.readInt32BE=function(h,p){return h=h>>>0,p||se(h,4,this.length),this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]},o.prototype.readBigInt64LE=ut(function(h){h=h>>>0,Gt(h,"offset");let p=this[h],S=this[h+7];(p===void 0||S===void 0)&&i0(h,this.length-8);let I=this[h+4]+this[h+5]*2**8+this[h+6]*2**16+(S<<24);return(BigInt(I)<<BigInt(32))+BigInt(p+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24)}),o.prototype.readBigInt64BE=ut(function(h){h=h>>>0,Gt(h,"offset");let p=this[h],S=this[h+7];(p===void 0||S===void 0)&&i0(h,this.length-8);let I=(p<<24)+this[++h]*2**16+this[++h]*2**8+this[++h];return(BigInt(I)<<BigInt(32))+BigInt(this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+S)}),o.prototype.readFloatLE=function(h,p){return h=h>>>0,p||se(h,4,this.length),e.read(this,h,!0,23,4)},o.prototype.readFloatBE=function(h,p){return h=h>>>0,p||se(h,4,this.length),e.read(this,h,!1,23,4)},o.prototype.readDoubleLE=function(h,p){return h=h>>>0,p||se(h,8,this.length),e.read(this,h,!0,52,8)},o.prototype.readDoubleBE=function(h,p){return h=h>>>0,p||se(h,8,this.length),e.read(this,h,!1,52,8)};function Q(w,h,p,S,I,U){if(!o.isBuffer(w))throw new TypeError('"buffer" argument must be a Buffer instance');if(h>I||h<U)throw new RangeError('"value" argument is out of bounds');if(p+S>w.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(h,p,S,I){if(h=+h,p=p>>>0,S=S>>>0,!I){let ie=Math.pow(2,8*S)-1;Q(this,h,p,S,ie,0)}let U=1,V=0;for(this[p]=h&255;++V<S&&(U*=256);)this[p+V]=h/U&255;return p+S},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(h,p,S,I){if(h=+h,p=p>>>0,S=S>>>0,!I){let ie=Math.pow(2,8*S)-1;Q(this,h,p,S,ie,0)}let U=S-1,V=1;for(this[p+U]=h&255;--U>=0&&(V*=256);)this[p+U]=h/V&255;return p+S},o.prototype.writeUint8=o.prototype.writeUInt8=function(h,p,S){return h=+h,p=p>>>0,S||Q(this,h,p,1,255,0),this[p]=h&255,p+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(h,p,S){return h=+h,p=p>>>0,S||Q(this,h,p,2,65535,0),this[p]=h&255,this[p+1]=h>>>8,p+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(h,p,S){return h=+h,p=p>>>0,S||Q(this,h,p,2,65535,0),this[p]=h>>>8,this[p+1]=h&255,p+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(h,p,S){return h=+h,p=p>>>0,S||Q(this,h,p,4,4294967295,0),this[p+3]=h>>>24,this[p+2]=h>>>16,this[p+1]=h>>>8,this[p]=h&255,p+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(h,p,S){return h=+h,p=p>>>0,S||Q(this,h,p,4,4294967295,0),this[p]=h>>>24,this[p+1]=h>>>16,this[p+2]=h>>>8,this[p+3]=h&255,p+4};function ve(w,h,p,S,I){r0(h,S,I,w,p,7);let U=Number(h&BigInt(4294967295));w[p++]=U,U=U>>8,w[p++]=U,U=U>>8,w[p++]=U,U=U>>8,w[p++]=U;let V=Number(h>>BigInt(32)&BigInt(4294967295));return w[p++]=V,V=V>>8,w[p++]=V,V=V>>8,w[p++]=V,V=V>>8,w[p++]=V,p}function ke(w,h,p,S,I){r0(h,S,I,w,p,7);let U=Number(h&BigInt(4294967295));w[p+7]=U,U=U>>8,w[p+6]=U,U=U>>8,w[p+5]=U,U=U>>8,w[p+4]=U;let V=Number(h>>BigInt(32)&BigInt(4294967295));return w[p+3]=V,V=V>>8,w[p+2]=V,V=V>>8,w[p+1]=V,V=V>>8,w[p]=V,p+8}o.prototype.writeBigUInt64LE=ut(function(h,p=0){return ve(this,h,p,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=ut(function(h,p=0){return ke(this,h,p,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(h,p,S,I){if(h=+h,p=p>>>0,!I){let _e=Math.pow(2,8*S-1);Q(this,h,p,S,_e-1,-_e)}let U=0,V=1,ie=0;for(this[p]=h&255;++U<S&&(V*=256);)h<0&&ie===0&&this[p+U-1]!==0&&(ie=1),this[p+U]=(h/V>>0)-ie&255;return p+S},o.prototype.writeIntBE=function(h,p,S,I){if(h=+h,p=p>>>0,!I){let _e=Math.pow(2,8*S-1);Q(this,h,p,S,_e-1,-_e)}let U=S-1,V=1,ie=0;for(this[p+U]=h&255;--U>=0&&(V*=256);)h<0&&ie===0&&this[p+U+1]!==0&&(ie=1),this[p+U]=(h/V>>0)-ie&255;return p+S},o.prototype.writeInt8=function(h,p,S){return h=+h,p=p>>>0,S||Q(this,h,p,1,127,-128),h<0&&(h=255+h+1),this[p]=h&255,p+1},o.prototype.writeInt16LE=function(h,p,S){return h=+h,p=p>>>0,S||Q(this,h,p,2,32767,-32768),this[p]=h&255,this[p+1]=h>>>8,p+2},o.prototype.writeInt16BE=function(h,p,S){return h=+h,p=p>>>0,S||Q(this,h,p,2,32767,-32768),this[p]=h>>>8,this[p+1]=h&255,p+2},o.prototype.writeInt32LE=function(h,p,S){return h=+h,p=p>>>0,S||Q(this,h,p,4,2147483647,-2147483648),this[p]=h&255,this[p+1]=h>>>8,this[p+2]=h>>>16,this[p+3]=h>>>24,p+4},o.prototype.writeInt32BE=function(h,p,S){return h=+h,p=p>>>0,S||Q(this,h,p,4,2147483647,-2147483648),h<0&&(h=4294967295+h+1),this[p]=h>>>24,this[p+1]=h>>>16,this[p+2]=h>>>8,this[p+3]=h&255,p+4},o.prototype.writeBigInt64LE=ut(function(h,p=0){return ve(this,h,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=ut(function(h,p=0){return ke(this,h,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function rt(w,h,p,S,I,U){if(p+S>w.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function Ke(w,h,p,S,I){return h=+h,p=p>>>0,I||rt(w,h,p,4),e.write(w,h,p,S,23,4),p+4}o.prototype.writeFloatLE=function(h,p,S){return Ke(this,h,p,!0,S)},o.prototype.writeFloatBE=function(h,p,S){return Ke(this,h,p,!1,S)};function dt(w,h,p,S,I){return h=+h,p=p>>>0,I||rt(w,h,p,8),e.write(w,h,p,S,52,8),p+8}o.prototype.writeDoubleLE=function(h,p,S){return dt(this,h,p,!0,S)},o.prototype.writeDoubleBE=function(h,p,S){return dt(this,h,p,!1,S)},o.prototype.copy=function(h,p,S,I){if(!o.isBuffer(h))throw new TypeError("argument should be a Buffer");if(S||(S=0),!I&&I!==0&&(I=this.length),p>=h.length&&(p=h.length),p||(p=0),I>0&&I<S&&(I=S),I===S||h.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(S<0||S>=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),h.length-p<I-S&&(I=h.length-p+S);let U=I-S;return this===h&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,S,I):Uint8Array.prototype.set.call(h,this.subarray(S,I),p),U},o.prototype.fill=function(h,p,S,I){if(typeof h=="string"){if(typeof p=="string"?(I=p,p=0,S=this.length):typeof S=="string"&&(I=S,S=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(h.length===1){let V=h.charCodeAt(0);(I==="utf8"&&V<128||I==="latin1")&&(h=V)}}else typeof h=="number"?h=h&255:typeof h=="boolean"&&(h=Number(h));if(p<0||this.length<p||this.length<S)throw new RangeError("Out of range index");if(S<=p)return this;p=p>>>0,S=S===void 0?this.length:S>>>0,h||(h=0);let U;if(typeof h=="number")for(U=p;U<S;++U)this[U]=h;else{let V=o.isBuffer(h)?h:o.from(h,I),ie=V.length;if(ie===0)throw new TypeError('The value "'+h+'" is invalid for argument "value"');for(U=0;U<S-p;++U)this[U+p]=V[U%ie]}return this};let Ee={};function wt(w,h,p){Ee[w]=class extends p{constructor(){super(),Object.defineProperty(this,"message",{value:h.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}`}}}wt("ERR_BUFFER_OUT_OF_BOUNDS",function(w){return w?`${w} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),wt("ERR_INVALID_ARG_TYPE",function(w,h){return`The "${w}" argument must be of type number. Received type ${typeof h}`},TypeError),wt("ERR_OUT_OF_RANGE",function(w,h,p){let S=`The value of "${w}" is out of range.`,I=p;return Number.isInteger(p)&&Math.abs(p)>2**32?I=m5(String(p)):typeof p=="bigint"&&(I=String(p),(p>BigInt(2)**BigInt(32)||p<-(BigInt(2)**BigInt(32)))&&(I=m5(I)),I+="n"),S+=` It must be ${h}. Received ${I}`,S},RangeError);function m5(w){let h="",p=w.length,S=w[0]==="-"?1:0;for(;p>=S+4;p-=3)h=`_${w.slice(p-3,p)}${h}`;return`${w.slice(0,p)}${h}`}function p5(w,h,p){Gt(h,"offset"),(w[h]===void 0||w[h+p]===void 0)&&i0(h,w.length-(p+1))}function r0(w,h,p,S,I,U){if(w>p||w<h){let V=typeof h=="bigint"?"n":"",ie;throw h===0||h===BigInt(0)?ie=`>= 0${V} and < 2${V} ** ${(U+1)*8}${V}`:ie=`>= -(2${V} ** ${(U+1)*8-1}${V}) and < 2 ** ${(U+1)*8-1}${V}`,new Ee.ERR_OUT_OF_RANGE("value",ie,w)}p5(S,I,U)}function Gt(w,h){if(typeof w!="number")throw new Ee.ERR_INVALID_ARG_TYPE(h,"number",w)}function i0(w,h,p){throw Math.floor(w)!==w?(Gt(w,p),new Ee.ERR_OUT_OF_RANGE("offset","an integer",w)):h<0?new Ee.ERR_BUFFER_OUT_OF_BOUNDS:new Ee.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${h}`,w)}let dr=/[^+/0-9A-Za-z-_]/g;function n0(w){if(w=w.split("=")[0],w=w.trim().replace(dr,""),w.length<2)return"";for(;w.length%4!==0;)w=w+"=";return w}function L0(w,h){h=h||1/0;let p,S=w.length,I=null,U=[];for(let V=0;V<S;++V){if(p=w.charCodeAt(V),p>55295&&p<57344){if(!I){if(p>56319){(h-=3)>-1&&U.push(239,191,189);continue}else if(V+1===S){(h-=3)>-1&&U.push(239,191,189);continue}I=p;continue}if(p<56320){(h-=3)>-1&&U.push(239,191,189),I=p;continue}p=(I-55296<<10|p-56320)+65536}else I&&(h-=3)>-1&&U.push(239,191,189);if(I=null,p<128){if((h-=1)<0)break;U.push(p)}else if(p<2048){if((h-=2)<0)break;U.push(p>>6|192,p&63|128)}else if(p<65536){if((h-=3)<0)break;U.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((h-=4)<0)break;U.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return U}function ur(w){let h=[];for(let p=0;p<w.length;++p)h.push(w.charCodeAt(p)&255);return h}function fr(w,h){let p,S,I,U=[];for(let V=0;V<w.length&&!((h-=2)<0);++V)p=w.charCodeAt(V),S=p>>8,I=p%256,U.push(I),U.push(S);return U}function Ni(w){return n.toByteArray(n0(w))}function it(w,h,p,S){let I;for(I=0;I<S&&!(I+p>=h.length||I>=w.length);++I)h[I+p]=w[I];return I}function Pe(w,h){return w instanceof h||w!=null&&w.constructor!=null&&w.constructor.name!=null&&w.constructor.name===h.name}function H0(w){return w!==w}let g5=function(){let w="0123456789abcdef",h=new Array(256);for(let p=0;p<16;++p){let S=p*16;for(let I=0;I<16;++I)h[S+I]=w[p]+w[I]}return h}();function ut(w){return typeof BigInt>"u"?O0:w}function O0(){throw new Error("BigInt not supported")}return o0}var _5,p2,br,g2,o0,b2,_2=Ne(()=>{E();x();k();R();_5={},p2=!1;br={},g2=!1;o0={},b2=!1});var a0,D,Y9,K9,w2=Ne(()=>{E();x();k();R();_2();a0=y2();a0.Buffer;a0.SlowBuffer;a0.INSPECT_MAX_BYTES;a0.kMaxLength;D=a0.Buffer,Y9=a0.INSPECT_MAX_BYTES,K9=a0.kMaxLength});var k=Ne(()=>{w2()});var M2=lt((en,tn)=>{E();x();k();R();(function(n,e){typeof en=="object"&&typeof tn<"u"?tn.exports=e():typeof define=="function"&&define.amd?define(e):n.Stats=e()})(en,function(){var n=function(){function e(u){return i.appendChild(u.dom),u}function t(u){for(var f=0;f<i.children.length;f++)i.children[f].style.display=f===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,v=0,a=e(new n.Panel("FPS","#0ff","#002")),l=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(){v++;var u=(performance||Date).now();if(l.update(u-s,200),u>o+1e3&&(a.update(1e3*v/(u-o),100),o=u,v=0,c)){var f=performance.memory;c.update(f.usedJSHeapSize/1048576,f.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,v=o(window.devicePixelRatio||1),a=80*v,l=48*v,c=3*v,u=2*v,f=3*v,m=15*v,g=74*v,b=30*v,A=document.createElement("canvas");A.width=a,A.height=l,A.style.cssText="width:80px;height:48px";var y=A.getContext("2d");return y.font="bold "+9*v+"px Helvetica,Arial,sans-serif",y.textBaseline="top",y.fillStyle=r,y.fillRect(0,0,a,l),y.fillStyle=t,y.fillText(e,c,u),y.fillRect(f,m,g,b),y.fillStyle=r,y.globalAlpha=.9,y.fillRect(f,m,g,b),{dom:A,update:function(_,M){i=Math.min(i,_),s=Math.max(s,_),y.fillStyle=r,y.globalAlpha=1,y.fillRect(0,0,a,m),y.fillStyle=t,y.fillText(o(_)+" "+e+" ("+o(i)+"-"+o(s)+")",c,u),y.drawImage(A,f+v,m,g-v,b,f,m,g-v,b),y.fillRect(f+g-v,m,v,b),y.fillStyle=r,y.globalAlpha=.9,y.fillRect(f+g-v,m,v,o((1-_/M)*b))}}},n})});var r8,i8,Ht,n8,Ir=Ne(()=>{"use strict";E();x();k();R();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},i8=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))},Ht=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)}}},n8=()=>{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=i8(e),i=Ht(e)}};typeof window<"u"&&(window.debugSkyLight=n8)});var Ro=lt((xo,Wr)=>{E();x();k();R();(function(n,e){typeof Wr=="object"&&Wr.exports?Wr.exports=e():n.nearley=e()})(xo,function(){function n(a,l,c){return this.id=++n.highestId,this.name=a,this.symbols=l,this.postprocess=c,this}n.highestId=0,n.prototype.toString=function(a){var l=typeof a>"u"?this.symbols.map(v).join(" "):this.symbols.slice(0,a).map(v).join(" ")+" \u25CF "+this.symbols.slice(a).map(v).join(" ");return this.name+" \u2192 "+l};function e(a,l,c,u){this.rule=a,this.dot=l,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 l=new e(this.rule,this.dot+1,this.reference,this.wantedBy);return l.left=this,l.right=a,l.isComplete&&(l.data=l.build(),l.right=void 0),l},e.prototype.build=function(){var a=[],l=this;do a.push(l.right.data),l=l.left;while(l.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,l){this.grammar=a,this.index=l,this.states=[],this.wants={},this.scannable=[],this.completed={}}t.prototype.process=function(a){for(var l=this.states,c=this.wants,u=this.completed,f=0;f<l.length;f++){var m=l[f];if(m.isComplete){if(m.finish(),m.data!==s.fail){for(var g=m.wantedBy,b=g.length;b--;){var A=g[b];this.complete(A,m)}if(m.reference===this.index){var y=m.rule.name;(this.completed[y]=this.completed[y]||[]).push(m)}}}else{var y=m.rule.symbols[m.dot];if(typeof y!="string"){this.scannable.push(m);continue}if(c[y]){if(c[y].push(m),u.hasOwnProperty(y))for(var _=u[y],b=0;b<_.length;b++){var M=_[b];this.complete(m,M)}}else c[y]=[m],this.predict(y)}}},t.prototype.predict=function(a){for(var l=this.grammar.byName[a]||[],c=0;c<l.length;c++){var u=l[c],f=this.wants[a],m=new e(u,0,this.index,f);this.states.push(m)}},t.prototype.complete=function(a,l){var c=a.nextState(l);this.states.push(c)};function r(a,l){this.rules=a,this.start=l||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,l){var c=u.Lexer;u.ParserStart&&(l=u.ParserStart,u=u.ParserRules);var u=u.map(function(m){return new n(m.name,m.symbols,m.postprocess)}),f=new r(u,l);return f.lexer=c,f};function i(){this.reset("")}i.prototype.reset=function(a,l){this.buffer=a,this.index=0,this.line=l?l.line:1,this.lastLineBreak=l?-l.col:0},i.prototype.next=function(){if(this.index<this.buffer.length){var a=this.buffer[this.index++];return a===`
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,l){var c=this.buffer;if(typeof c=="string"){var u=c.split(`
3
+ `).slice(Math.max(0,this.line-5),this.line),f=c.indexOf(`
4
+ `,this.index);f===-1&&(f=c.length);var m=this.index-this.lastLineBreak,g=String(this.line).length;return l+=" at line "+this.line+" col "+m+`:
5
5
 
6
- `,l+=u.map(function(A,b){return y(this.line-u.length+b+1,g)+" "+A},this).join(`
6
+ `,l+=u.map(function(A,y){return b(this.line-u.length+y+1,g)+" "+A},this).join(`
7
7
  `),l+=`
8
- `+y("",g+p)+`^
9
- `,l}else return l+" at index "+(this.index-1);function y(A,b){var w=String(A);return Array(b-w.length+1).join(" ")+w}};function s(v,l,c){if(v instanceof r)var u=v,c=l;else var u=r.fromCompiled(v,l);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),g=this.table=[p];p.wants[u.start]=[],p.predict(u.start),p.process(),this.current=0}s.fail={},s.prototype.feed=function(v){var l=this.lexer;l.reset(v,this.lexerState);for(var c;;){try{if(c=l.next(),!c)break}catch(I){var g=new t(this.grammar,this.current+1);this.table.push(g);var u=new Error(this.reportLexerError(I));throw u.offset=this.current,u.token=I.token,u}var h=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var p=this.current+1,g=new t(this.grammar,p);this.table.push(g);for(var y=c.text!==void 0?c.text:c.value,A=l.constructor===i?c.value:c,b=h.scannable,w=b.length;w--;){var S=b[w],C=S.rule.symbols[S.dot];if(C.test?C.test(A):C.type?C.type===c.type:C.literal===y){var M=S.nextState({data:A,token:c,isToken:!0,reference:p-1});g.states.push(M)}}if(g.process(),g.states.length===0){var u=new Error(this.reportError(c));throw u.offset=this.current,u.token=c,u}this.options.keepHistory&&(h.lexerState=l.save()),this.current++}return h&&(this.lexerState=l.save()),this.results=this.finish(),this},s.prototype.reportLexerError=function(v){var l,c,u=v.token;return u?(l="input "+JSON.stringify(u.text[0])+" (lexer error)",c=this.lexer.formatError(u,"Syntax error")):(l="input (lexer error)",c=v.message),this.reportErrorCommon(c,l)},s.prototype.reportError=function(v){var l=(v.type?v.type+" token: ":"")+JSON.stringify(v.value!==void 0?v.value:v),c=this.lexer.formatError(v,"Syntax error");return this.reportErrorCommon(c,l)},s.prototype.reportErrorCommon=function(v,l){var c=[];c.push(v);var u=this.table.length-2,h=this.table[u],p=h.states.filter(function(y){var A=y.rule.symbols[y.dot];return A&&typeof A!="string"});if(p.length===0)c.push("Unexpected "+l+`. I did not expect any more input. Here is the state of my parse table:
10
- `),this.displayStateStack(h.states,c);else{c.push("Unexpected "+l+`. Instead, I was expecting to see one of the following:
11
- `);var g=p.map(function(y){return this.buildFirstStateStack(y,[])||[y]},this);g.forEach(function(y){var A=y[0],b=A.rule.symbols[A.dot],w=this.getSymbolDisplay(b);c.push("A "+w+" based on:"),this.displayStateStack(y,c)},this)}return c.push(""),c.join(`
12
- `)},s.prototype.displayStateStack=function(v,l){for(var c,u=0,h=0;h<v.length;h++){var p=v[h],g=p.rule.toString(p.dot);g===c?u++:(u>0&&l.push(" ^ "+u+" more lines identical to this"),u=0,l.push(" "+g)),c=g}},s.prototype.getSymbolDisplay=function(v){return o(v)},s.prototype.buildFirstStateStack=function(v,l){if(l.indexOf(v)!==-1)return null;if(v.wantedBy.length===0)return[v];var c=v.wantedBy[0],u=[v].concat(l),h=this.buildFirstStateStack(c,u);return h===null?null:[v].concat(h)},s.prototype.save=function(){var v=this.table[this.current];return v.lexerState=this.lexerState,v},s.prototype.restore=function(v){var l=v.index;this.current=l,this.table[l]=v,this.table.splice(l+1),this.lexerState=v.lexerState,this.results=this.finish()},s.prototype.rewind=function(v){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[v])},s.prototype.finish=function(){var v=[],l=this.grammar.start,c=this.table[this.table.length-1];return c.states.forEach(function(u){u.rule.name===l&&u.dot===u.rule.symbols.length&&u.reference===0&&u.data!==s.fail&&v.push(u)}),v.map(function(u){return u.data})};function o(v){var l=typeof v;if(l==="string")return v;if(l==="object"){if(v.literal)return JSON.stringify(v.literal);if(v instanceof RegExp)return"character matching "+v;if(v.type)return v.type+" token";if(v.test)return"token matching "+String(v.test);throw new Error("Unknown symbol type: "+v)}}function a(v){var l=typeof v;if(l==="string")return v;if(l==="object"){if(v.literal)return JSON.stringify(v.literal);if(v instanceof RegExp)return v.toString();if(v.type)return"%"+v.type;if(v.test)return"<"+String(v.test)+">";throw new Error("Unknown symbol type: "+v)}}return{Parser:s,Grammar:r,Rule:n}})});var Gs=t0((fb,k1)=>{E();x();k();R();(function(){function n(v){return v[0]}function e(v){if(v==="true")return{type:"boolean",value:!0};if(v==="false")return{type:"boolean",value:!1};let l="bslfdi",c={b:"byte",s:"short",l:"long",f:"float",d:"double",i:"int"},u=v.charAt(v.length-1).toLowerCase();if(l.indexOf(u)!==-1){let y=parseFloat(v.substring(0,v.length-1));return isNaN(y)?{value:v,type:"string"}:{value:y,type:c[u]}}let h=parseFloat(v),p=v.includes("."),g=h>>0===h;return!isNaN(v)&&(p||g)?{value:h,type:p?"double":"int"}:{value:v,type:"string"}}function t(v,l){v[0]!==void 0&&(l[v[0]]=v[1])}function r(v){let l={};t(v[2],l);for(let c in v[3])t(v[3][c][3],l);return{type:"compound",value:l}}function i(v){let l=[v[6]];for(let u in v[7])l.push(v[7][u][3]);return{type:{B:"byteArray",I:"intArray",L:"longArray"}[v[2]],value:{type:l[0].type,value:l.map(u=>u.value)}}}function s(v){let l=[v[2]];for(let c in v[3])l.push(v[3][c][3]);return{type:"list",value:{type:l[0].type,value:l.map(c=>c.value)}}}function o(v){let l=[];t(v[2],l);for(let c in v[3])t(v[3][c][3],l);return{type:"list",value:{type:l[0].type,value:l.map(c=>c.value)}}}var a={Lexer:void 0,ParserRules:[{name:"_$ebnf$1",symbols:[]},{name:"_$ebnf$1",symbols:["_$ebnf$1","wschar"],postprocess:function(l){return l[0].concat([l[1]])}},{name:"_",symbols:["_$ebnf$1"],postprocess:function(v){return null}},{name:"__$ebnf$1",symbols:["wschar"]},{name:"__$ebnf$1",symbols:["__$ebnf$1","wschar"],postprocess:function(l){return l[0].concat([l[1]])}},{name:"__",symbols:["__$ebnf$1"],postprocess:function(v){return null}},{name:"wschar",symbols:[/[ \t\n\v\f]/],postprocess:n},{name:"MAIN",symbols:["_","JVALUE","_"],postprocess:v=>v[1]},{name:"JVALUE",symbols:["JOBJECT"],postprocess:v=>v[0]},{name:"JVALUE",symbols:[{literal:"'"},"_","JOBJECT","_",{literal:"'"}],postprocess:v=>v[2]},{name:"JVALUE",symbols:["JARRAY"],postprocess:v=>v[0]},{name:"JVALUE",symbols:["STRING"],postprocess:v=>v[0]},{name:"JVALUE$string$1",symbols:[{literal:"n"},{literal:"u"},{literal:"l"},{literal:"l"}],postprocess:function(l){return l.join("")}},{name:"JVALUE",symbols:["JVALUE$string$1"],postprocess:v=>null},{name:"JOBJECT",symbols:[{literal:"{"},"_",{literal:"}"}],postprocess:v=>({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(l){return l[0].concat([l[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(v){return null}},{name:"JOBJECT",symbols:[{literal:"{"},"_","PAIR","JOBJECT$ebnf$1","JOBJECT$ebnf$2",{literal:"}"}],postprocess:r},{name:"JARRAY",symbols:[{literal:"["},"_",{literal:"]"}],postprocess:v=>({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(l){return l[0].concat([l[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(v){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(l){return l[0].concat([l[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(v){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(l){return l[0].concat([l[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(v){return null}},{name:"JARRAY",symbols:[{literal:"["},"_","PAIR","JARRAY$ebnf$5","JARRAY$ebnf$6","_",{literal:"]"}],postprocess:o},{name:"PAIR",symbols:["STRING","_",{literal:":"},"_","JVALUE"],postprocess:v=>[v[0].value,v[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(l){return l.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(l){return l[0].concat([l[1]])}},{name:"STRING",symbols:[{literal:'"'},"STRING$ebnf$1",{literal:'"'}],postprocess:v=>e(JSON.parse(v.flat(3).map(l=>l.replace(`
13
- `,"\\n")).join("")))},{name:"STRING$ebnf$2",symbols:[/[^\"\'}\]:;,\s]/]},{name:"STRING$ebnf$2",symbols:["STRING$ebnf$2",/[^\"\'}\]:;,\s]/],postprocess:function(l){return l[0].concat([l[1]])}},{name:"STRING",symbols:["STRING$ebnf$2"],postprocess:v=>e(v[0].join(""))}],ParserStart:"MAIN"};typeof k1<"u"&&typeof k1.exports<"u"?k1.exports=a:window.grammar=a})()});var _i=t0((bb,Qs)=>{E();x();k();R();var Ns=Us(),R7=Gs();function js(n){function e(t,r){return r==="compound"?Object.keys(t).reduce(function(i,s){return i[s]=js(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 T1({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],a=T1(i[s][1]);o==="string"&&(a=Ws(a)),r.push(`${o}:${a}`)}return`{${r.join(",")}}`}else{if(e==="list")return Array.isArray(n.value)?`[${Vs(n)}]`:"[]";if(e==="byteArray"||e==="intArray"||e==="longArray"){let r=T7(e),i=Vs(n);return`[${r}${i}]`}}let t=n+M7(n,e);return e==="string"&&(t=Ws(t)),t}function Ws(n){return n=n.replace(/"/g,'\\"'),(/'|{|}|\[|\]|:|;|,|\(|\)|§|=/g.test(n)||n==="")&&(n=`"${n}"`),n}function Vs({value:n,type:e}){let t=k7(n),r=[];for(let i=0;i<n.length;i++){let s=n[i];s!==void 0&&(s=T1({value:s,type:e}),t?r.push(`${i}:${s}`):r.push(s))}return r.join(",")}function k7(n){for(let e=0;e<n.length;e++)if(n[e]===void 0)return!0;return!1}var T7=n=>n.charAt(0).toUpperCase()+";";function M7(n,e){return e==="double"?n>>0===n?"d":"":{int:"",byte:"b",short:"s",float:"f",long:"l",string:""}[e]}function S7(n){return T1(Ys(n))}function Ys(n){try{let e=new Ns.Parser(Ns.Grammar.fromCompiled(R7));return e.feed(n),e.results[0]}catch(e){throw e.message=`Error parsing text '${n}'`,e}}Qs.exports={parse:Ys,simplify:js,stringify:T1,normalize:S7}});var Xs={};q5(Xs,{camelCase:()=>H7,capitalCase:()=>Ai,constantCase:()=>F7,dotCase:()=>z7,kebabCase:()=>L7,noCase:()=>C5,pascalCase:()=>O7,pascalSnakeCase:()=>D7,pathCase:()=>U7,sentenceCase:()=>G7,snakeCase:()=>Ei,split:()=>wi,splitSeparateNumbers:()=>Zs,trainCase:()=>N7});function wi(n){let e=n.trim();e=e.replace(C7,Ks).replace(B7,Ks),e=e.replace(I7,"\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 Zs(n){let e=wi(n);for(let t=0;t<e.length;t++){let r=e[t],i=P7.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 C5(n,e){let[t,r,i]=zt(n,e);return t+r.map(B5(e?.locale)).join(e?.delimiter??" ")+i}function H7(n,e){let[t,r,i]=zt(n,e),s=B5(e?.locale),o=P5(e?.locale),a=e?.mergeAmbiguousCharacters?M1(s,o):qs(s,o);return t+r.map((v,l)=>l===0?s(v):a(v,l)).join(e?.delimiter??"")+i}function O7(n,e){let[t,r,i]=zt(n,e),s=B5(e?.locale),o=P5(e?.locale),a=e?.mergeAmbiguousCharacters?M1(s,o):qs(s,o);return t+r.map(a).join(e?.delimiter??"")+i}function D7(n,e){return Ai(n,{delimiter:"_",...e})}function Ai(n,e){let[t,r,i]=zt(n,e),s=B5(e?.locale),o=P5(e?.locale);return t+r.map(M1(s,o)).join(e?.delimiter??" ")+i}function F7(n,e){let[t,r,i]=zt(n,e);return t+r.map(P5(e?.locale)).join(e?.delimiter??"_")+i}function z7(n,e){return C5(n,{delimiter:".",...e})}function L7(n,e){return C5(n,{delimiter:"-",...e})}function U7(n,e){return C5(n,{delimiter:"/",...e})}function G7(n,e){let[t,r,i]=zt(n,e),s=B5(e?.locale),o=P5(e?.locale),a=M1(s,o);return t+r.map((v,l)=>l===0?a(v):s(v)).join(e?.delimiter??" ")+i}function Ei(n,e){return C5(n,{delimiter:"_",...e})}function N7(n,e){return Ai(n,{delimiter:"-",...e})}function B5(n){return n===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(n)}function P5(n){return n===!1?e=>e.toUpperCase():e=>e.toLocaleUpperCase(n)}function M1(n,e){return t=>`${e(t[0])}${n(t.slice(1))}`}function qs(n,e){return(t,r)=>{let i=t[0];return(r>0&&i>="0"&&i<="9"?"_"+i:e(i))+n(t.slice(1))}}function zt(n,e={}){let t=e.split??(e.separateNumbers?Zs:wi),r=e.prefixCharacters??Js,i=e.suffixCharacters??Js,s=0,o=n.length;for(;s<n.length;){let a=n.charAt(s);if(!r.includes(a))break;s++}for(;o>s;){let a=o-1,v=n.charAt(a);if(!i.includes(v))break;o=a}return[n.slice(0,s),t(n.slice(s,o)),n.slice(o)]}var C7,B7,P7,I7,Ks,Js,xi=Xe(()=>{E();x();k();R();C7=/([\p{Ll}\d])(\p{Lu})/gu,B7=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,P7=/(\d)\p{Ll}|(\p{L})\d/u,I7=/[^\p{L}\d]+/giu,Ks="$1\0$2",Js=""});var $s=t0((Tb,W7)=>{W7.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 to=t0((Mb,eo)=>{E();x();k();R();var Lt=1e3,Ut=Lt*60,Gt=Ut*60,dt=Gt*24,V7=dt*7,j7=dt*365.25;eo.exports=function(n,e){e=e||{};var t=typeof n;if(t==="string"&&n.length>0)return Y7(n);if(t==="number"&&isFinite(n))return e.long?K7(n):Q7(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function Y7(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*j7;case"weeks":case"week":case"w":return t*V7;case"days":case"day":case"d":return t*dt;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Gt;case"minutes":case"minute":case"mins":case"min":case"m":return t*Ut;case"seconds":case"second":case"secs":case"sec":case"s":return t*Lt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Q7(n){var e=Math.abs(n);return e>=dt?Math.round(n/dt)+"d":e>=Gt?Math.round(n/Gt)+"h":e>=Ut?Math.round(n/Ut)+"m":e>=Lt?Math.round(n/Lt)+"s":n+"ms"}function K7(n){var e=Math.abs(n);return e>=dt?S1(n,e,dt,"day"):e>=Gt?S1(n,e,Gt,"hour"):e>=Ut?S1(n,e,Ut,"minute"):e>=Lt?S1(n,e,Lt,"second"):n+" ms"}function S1(n,e,t,r){var i=e>=t*1.5;return Math.round(n/t)+" "+r+(i?"s":"")}});var io=t0((Ib,ro)=>{E();x();k();R();function J7(n){t.debug=t,t.default=t,t.coerce=v,t.disable=o,t.enable=i,t.enabled=a,t.humanize=to(),t.destroy=l,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,g;function y(...A){if(!y.enabled)return;let b=y,w=Number(new Date),S=w-(u||w);b.diff=S,b.prev=u,b.curr=w,u=w,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let C=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(I,B)=>{if(I==="%%")return"%";C++;let H=t.formatters[B];if(typeof H=="function"){let G=A[C];I=H.call(b,G),A.splice(C,1),C--}return I}),t.formatArgs.call(b,A),(b.log||t.log).apply(b,A)}return y.namespace=c,y.useColors=t.useColors(),y.color=t.selectColor(c),y.extend=r,y.destroy=t.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==t.namespaces&&(p=t.namespaces,g=t.enabled(c)),g),set:A=>{h=A}}),typeof t.init=="function"&&t.init(y),y}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,g=-1,y=0;for(;h<c.length;)if(p<u.length&&(u[p]===c[h]||u[p]==="*"))u[p]==="*"?(g=p,y=h,p++):(h++,p++);else if(g!==-1)p=g+1,y++,h=y;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 a(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 v(c){return c instanceof Error?c.stack||c.message:c}function l(){}return t.enable(t.load()),t}ro.exports=J7});var no=t0((e0,C1)=>{E();x();k();R();e0.formatArgs=q7;e0.save=X7;e0.load=$7;e0.useColors=Z7;e0.storage=e8();e0.destroy=(()=>{let n=!1;return()=>{n||(n=!0)}})();e0.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 Z7(){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 q7(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+C1.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)}e0.log=console.debug||console.log||(()=>{});function X7(n){try{n?e0.storage.setItem("debug",n):e0.storage.removeItem("debug")}catch{}}function $7(){let n;try{n=e0.storage.getItem("debug")||e0.storage.getItem("DEBUG")}catch{}return!n&&typeof D<"u"&&"env"in D&&(n=D.env.DEBUG),n}function e8(){try{return localStorage}catch{}}C1.exports=io()(e0);var{formatters:t8}=C1.exports;t8.j=function(n){try{return JSON.stringify(n)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var so=t0(Nt=>{"use strict";E();x();k();R();var r8=Nt&&Nt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.debug=void 0;var i8=r8(no());Nt.debug=(0,i8.default)("mineflayer-mouse")});var lo=t0(ut=>{"use strict";E();x();k();R();var n8=ut&&ut.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ut,"__esModule",{value:!0});ut.isEntityAttackable=void 0;ut.isArmorStandAttackable=vo;var oo=(xi(),$a(Xs)),I5=n8($s()),s8=so(),ao=Object.fromEntries([...I5.default.attackable,...I5.default.notAttackable].map(n=>[n,!0])),o8=I5.default.attackable,a8=(n,e)=>{if(!e.name)throw new Error("Entity has no name");let t=n.entitiesByName[e.name],i=I5.default.entityRenames[e.name]||I5.default.entityRenames[(0,oo.snakeCase)(e.name)]||e.name;if(!ao[i]&&(i=(0,oo.snakeCase)(i),!ao[i]))return(0,s8.debug)(`Cannot find entity ${i} in entityData.json`),!1;let s=v8[i];return s?s(e,t):o8.includes(i)};ut.isEntityAttackable=a8;var v8={armor_stand:vo};function vo(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 W3=t0((mx,gv)=>{gv.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 V3=t0(U1=>{"use strict";E();x();k();R();Object.defineProperty(U1,"__esModule",{value:!0});U1.versionToNumber=void 0;var bv=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")}`};U1.versionToNumber=bv});var Y3=t0(Yt=>{"use strict";E();x();k();R();var yv=Yt&&Yt.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.getRenamedData=void 0;var j3=yv(W3()),z0=V3(),_v=(n,e,t,r)=>{let i=(0,z0.versionToNumber)(t),s=(0,z0.versionToNumber)(r),o=i<s?1:-1,a=o>0?1:0,v=e,l=Object.keys(j3.default).sort((h,p)=>o*((0,z0.versionToNumber)(h)-(0,z0.versionToNumber)(p))),c=o>0?s:i,u=o>0?i:s;for(let h of l.filter(p=>(0,z0.versionToNumber)(p)<=c&&(0,z0.versionToNumber)(p)>=u)){if(o>0&&(0,z0.versionToNumber)(h)>=c||o<0&&(0,z0.versionToNumber)(h)<=u)break;let p=j3.default[h][n];if(p)for(let g of p){let y=g[a],A=g[1-a];if(Array.isArray(v))v.includes(A)&&(v=v.map(b=>b===A?y:b));else if(v===A){v=y;break}}}return v};Yt.getRenamedData=_v});import*as i0 from"three";function q1(){return new i0.ShaderMaterial({vertexShader:Mv,fragmentShader:Sv,uniforms:i0.UniformsUtils.merge([i0.UniformsLib.fog,{u_atlas:{value:null},u_tintPalette:{value:null},u_debugMode:{value:0},u_cameraOrigin:{value:new i0.Vector3},u_cameraOriginFrac:{value:new i0.Vector3}}]),transparent:!1,depthWrite:!0,depthTest:!0,blending:i0.NoBlending,glslVersion:i0.GLSL3,fog:!0})}var Mv,Sv,X1,c0,ra,Cv,gt=Xe(()=>{"use strict";E();x();k();R();Mv=`
8
+ `+b("",g+m)+`^
9
+ `,l}else return l+" at index "+(this.index-1);function b(A,y){var _=String(A);return Array(y-_.length+1).join(" ")+_}};function s(a,l,c){if(a instanceof r)var u=a,c=l;else var u=r.fromCompiled(a,l);this.grammar=u,this.options={keepHistory:!1,lexer:u.lexer||new i};for(var f in c||{})this.options[f]=c[f];this.lexer=this.options.lexer,this.lexerState=void 0;var m=new t(u,0),g=this.table=[m];m.wants[u.start]=[],m.predict(u.start),m.process(),this.current=0}s.fail={},s.prototype.feed=function(a){var l=this.lexer;l.reset(a,this.lexerState);for(var c;;){try{if(c=l.next(),!c)break}catch(P){var g=new t(this.grammar,this.current+1);this.table.push(g);var u=new Error(this.reportLexerError(P));throw u.offset=this.current,u.token=P.token,u}var f=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var m=this.current+1,g=new t(this.grammar,m);this.table.push(g);for(var b=c.text!==void 0?c.text:c.value,A=l.constructor===i?c.value:c,y=f.scannable,_=y.length;_--;){var M=y[_],C=M.rule.symbols[M.dot];if(C.test?C.test(A):C.type?C.type===c.type:C.literal===b){var T=M.nextState({data:A,token:c,isToken:!0,reference:m-1});g.states.push(T)}}if(g.process(),g.states.length===0){var u=new Error(this.reportError(c));throw u.offset=this.current,u.token=c,u}this.options.keepHistory&&(f.lexerState=l.save()),this.current++}return f&&(this.lexerState=l.save()),this.results=this.finish(),this},s.prototype.reportLexerError=function(a){var l,c,u=a.token;return u?(l="input "+JSON.stringify(u.text[0])+" (lexer error)",c=this.lexer.formatError(u,"Syntax error")):(l="input (lexer error)",c=a.message),this.reportErrorCommon(c,l)},s.prototype.reportError=function(a){var l=(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,l)},s.prototype.reportErrorCommon=function(a,l){var c=[];c.push(a);var u=this.table.length-2,f=this.table[u],m=f.states.filter(function(b){var A=b.rule.symbols[b.dot];return A&&typeof A!="string"});if(m.length===0)c.push("Unexpected "+l+`. I did not expect any more input. Here is the state of my parse table:
10
+ `),this.displayStateStack(f.states,c);else{c.push("Unexpected "+l+`. Instead, I was expecting to see one of the following:
11
+ `);var g=m.map(function(b){return this.buildFirstStateStack(b,[])||[b]},this);g.forEach(function(b){var A=b[0],y=A.rule.symbols[A.dot],_=this.getSymbolDisplay(y);c.push("A "+_+" based on:"),this.displayStateStack(b,c)},this)}return c.push(""),c.join(`
12
+ `)},s.prototype.displayStateStack=function(a,l){for(var c,u=0,f=0;f<a.length;f++){var m=a[f],g=m.rule.toString(m.dot);g===c?u++:(u>0&&l.push(" ^ "+u+" more lines identical to this"),u=0,l.push(" "+g)),c=g}},s.prototype.getSymbolDisplay=function(a){return o(a)},s.prototype.buildFirstStateStack=function(a,l){if(l.indexOf(a)!==-1)return null;if(a.wantedBy.length===0)return[a];var c=a.wantedBy[0],u=[a].concat(l),f=this.buildFirstStateStack(c,u);return f===null?null:[a].concat(f)},s.prototype.save=function(){var a=this.table[this.current];return a.lexerState=this.lexerState,a},s.prototype.restore=function(a){var l=a.index;this.current=l,this.table[l]=a,this.table.splice(l+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=[],l=this.grammar.start,c=this.table[this.table.length-1];return c.states.forEach(function(u){u.rule.name===l&&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 l=typeof a;if(l==="string")return a;if(l==="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 v(a){var l=typeof a;if(l==="string")return a;if(l==="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 ko=lt((Sy,Nr)=>{E();x();k();R();(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 l="bslfdi",c={b:"byte",s:"short",l:"long",f:"float",d:"double",i:"int"},u=a.charAt(a.length-1).toLowerCase();if(l.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 f=parseFloat(a),m=a.includes("."),g=f>>0===f;return!isNaN(a)&&(m||g)?{value:f,type:m?"double":"int"}:{value:a,type:"string"}}function t(a,l){a[0]!==void 0&&(l[a[0]]=a[1])}function r(a){let l={};t(a[2],l);for(let c in a[3])t(a[3][c][3],l);return{type:"compound",value:l}}function i(a){let l=[a[6]];for(let u in a[7])l.push(a[7][u][3]);return{type:{B:"byteArray",I:"intArray",L:"longArray"}[a[2]],value:{type:l[0].type,value:l.map(u=>u.value)}}}function s(a){let l=[a[2]];for(let c in a[3])l.push(a[3][c][3]);return{type:"list",value:{type:l[0].type,value:l.map(c=>c.value)}}}function o(a){let l=[];t(a[2],l);for(let c in a[3])t(a[3][c][3],l);return{type:"list",value:{type:l[0].type,value:l.map(c=>c.value)}}}var v={Lexer:void 0,ParserRules:[{name:"_$ebnf$1",symbols:[]},{name:"_$ebnf$1",symbols:["_$ebnf$1","wschar"],postprocess:function(l){return l[0].concat([l[1]])}},{name:"_",symbols:["_$ebnf$1"],postprocess:function(a){return null}},{name:"__$ebnf$1",symbols:["wschar"]},{name:"__$ebnf$1",symbols:["__$ebnf$1","wschar"],postprocess:function(l){return l[0].concat([l[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(l){return l.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(l){return l[0].concat([l[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(l){return l[0].concat([l[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(l){return l[0].concat([l[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(l){return l[0].concat([l[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(l){return l.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(l){return l[0].concat([l[1]])}},{name:"STRING",symbols:[{literal:'"'},"STRING$ebnf$1",{literal:'"'}],postprocess:a=>e(JSON.parse(a.flat(3).map(l=>l.replace(`
13
+ `,"\\n")).join("")))},{name:"STRING$ebnf$2",symbols:[/[^\"\'}\]:;,\s]/]},{name:"STRING$ebnf$2",symbols:["STRING$ebnf$2",/[^\"\'}\]:;,\s]/],postprocess:function(l){return l[0].concat([l[1]])}},{name:"STRING",symbols:["STRING$ebnf$2"],postprocess:a=>e(a[0].join(""))}],ParserStart:"MAIN"};typeof Nr<"u"&&typeof Nr.exports<"u"?Nr.exports=v:window.grammar=v})()});var Kn=lt((Ly,Po)=>{E();x();k();R();var To=Ro(),T8=ko();function Co(n){function e(t,r){return r==="compound"?Object.keys(t).reduce(function(i,s){return i[s]=Co(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 jr({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],v=jr(i[s][1]);o==="string"&&(v=Mo(v)),r.push(`${o}:${v}`)}return`{${r.join(",")}}`}else{if(e==="list")return Array.isArray(n.value)?`[${So(n)}]`:"[]";if(e==="byteArray"||e==="intArray"||e==="longArray"){let r=S8(e),i=So(n);return`[${r}${i}]`}}let t=n+C8(n,e);return e==="string"&&(t=Mo(t)),t}function Mo(n){return n=n.replace(/"/g,'\\"'),(/'|{|}|\[|\]|:|;|,|\(|\)|§|=/g.test(n)||n==="")&&(n=`"${n}"`),n}function So({value:n,type:e}){let t=M8(n),r=[];for(let i=0;i<n.length;i++){let s=n[i];s!==void 0&&(s=jr({value:s,type:e}),t?r.push(`${i}:${s}`):r.push(s))}return r.join(",")}function M8(n){for(let e=0;e<n.length;e++)if(n[e]===void 0)return!0;return!1}var S8=n=>n.charAt(0).toUpperCase()+";";function C8(n,e){return e==="double"?n>>0===n?"d":"":{int:"",byte:"b",short:"s",float:"f",long:"l",string:""}[e]}function B8(n){return jr(Bo(n))}function Bo(n){try{let e=new To.Parser(To.Grammar.fromCompiled(T8));return e.feed(n),e.results[0]}catch(e){throw e.message=`Error parsing text '${n}'`,e}}Po.exports={parse:Bo,simplify:Co,stringify:jr,normalize:B8}});var Do={};hr(Do,{camelCase:()=>O8,capitalCase:()=>qn,constantCase:()=>z8,dotCase:()=>U8,kebabCase:()=>G8,noCase:()=>V5,pascalCase:()=>D8,pascalSnakeCase:()=>F8,pathCase:()=>V8,sentenceCase:()=>W8,snakeCase:()=>Xn,split:()=>Jn,splitSeparateNumbers:()=>Ho,trainCase:()=>N8});function Jn(n){let e=n.trim();e=e.replace(P8,Io).replace(I8,Io),e=e.replace(H8,"\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 Ho(n){let e=Jn(n);for(let t=0;t<e.length;t++){let r=e[t],i=L8.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 V5(n,e){let[t,r,i]=J0(n,e);return t+r.map(W5(e?.locale)).join(e?.delimiter??" ")+i}function O8(n,e){let[t,r,i]=J0(n,e),s=W5(e?.locale),o=N5(e?.locale),v=e?.mergeAmbiguousCharacters?Qr(s,o):Oo(s,o);return t+r.map((a,l)=>l===0?s(a):v(a,l)).join(e?.delimiter??"")+i}function D8(n,e){let[t,r,i]=J0(n,e),s=W5(e?.locale),o=N5(e?.locale),v=e?.mergeAmbiguousCharacters?Qr(s,o):Oo(s,o);return t+r.map(v).join(e?.delimiter??"")+i}function F8(n,e){return qn(n,{delimiter:"_",...e})}function qn(n,e){let[t,r,i]=J0(n,e),s=W5(e?.locale),o=N5(e?.locale);return t+r.map(Qr(s,o)).join(e?.delimiter??" ")+i}function z8(n,e){let[t,r,i]=J0(n,e);return t+r.map(N5(e?.locale)).join(e?.delimiter??"_")+i}function U8(n,e){return V5(n,{delimiter:".",...e})}function G8(n,e){return V5(n,{delimiter:"-",...e})}function V8(n,e){return V5(n,{delimiter:"/",...e})}function W8(n,e){let[t,r,i]=J0(n,e),s=W5(e?.locale),o=N5(e?.locale),v=Qr(s,o);return t+r.map((a,l)=>l===0?v(a):s(a)).join(e?.delimiter??" ")+i}function Xn(n,e){return V5(n,{delimiter:"_",...e})}function N8(n,e){return qn(n,{delimiter:"-",...e})}function W5(n){return n===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(n)}function N5(n){return n===!1?e=>e.toUpperCase():e=>e.toLocaleUpperCase(n)}function Qr(n,e){return t=>`${e(t[0])}${n(t.slice(1))}`}function Oo(n,e){return(t,r)=>{let i=t[0];return(r>0&&i>="0"&&i<="9"?"_"+i:e(i))+n(t.slice(1))}}function J0(n,e={}){let t=e.split??(e.separateNumbers?Ho:Jn),r=e.prefixCharacters??Lo,i=e.suffixCharacters??Lo,s=0,o=n.length;for(;s<n.length;){let v=n.charAt(s);if(!r.includes(v))break;s++}for(;o>s;){let v=o-1,a=n.charAt(v);if(!i.includes(a))break;o=v}return[n.slice(0,s),t(n.slice(s,o)),n.slice(o)]}var P8,I8,L8,H8,Io,Lo,Zn=Ne(()=>{E();x();k();R();P8=/([\p{Ll}\d])(\p{Lu})/gu,I8=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,L8=/(\d)\p{Ll}|(\p{L})\d/u,H8=/[^\p{L}\d]+/giu,Io="$1\0$2",Lo=""});var Fo=lt((Wy,j8)=>{j8.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 Uo=lt((Ny,zo)=>{E();x();k();R();var q0=1e3,X0=q0*60,Z0=X0*60,x0=Z0*24,Q8=x0*7,Y8=x0*365.25;zo.exports=function(n,e){e=e||{};var t=typeof n;if(t==="string"&&n.length>0)return K8(n);if(t==="number"&&isFinite(n))return e.long?q8(n):J8(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function K8(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*Y8;case"weeks":case"week":case"w":return t*Q8;case"days":case"day":case"d":return t*x0;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Z0;case"minutes":case"minute":case"mins":case"min":case"m":return t*X0;case"seconds":case"second":case"secs":case"sec":case"s":return t*q0;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function J8(n){var e=Math.abs(n);return e>=x0?Math.round(n/x0)+"d":e>=Z0?Math.round(n/Z0)+"h":e>=X0?Math.round(n/X0)+"m":e>=q0?Math.round(n/q0)+"s":n+"ms"}function q8(n){var e=Math.abs(n);return e>=x0?Yr(n,e,x0,"day"):e>=Z0?Yr(n,e,Z0,"hour"):e>=X0?Yr(n,e,X0,"minute"):e>=q0?Yr(n,e,q0,"second"):n+" ms"}function Yr(n,e,t,r){var i=e>=t*1.5;return Math.round(n/t)+" "+r+(i?"s":"")}});var Vo=lt((Jy,Go)=>{E();x();k();R();function X8(n){t.debug=t,t.default=t,t.coerce=a,t.disable=o,t.enable=i,t.enabled=v,t.humanize=Uo(),t.destroy=l,Object.keys(n).forEach(c=>{t[c]=n[c]}),t.names=[],t.skips=[],t.formatters={};function e(c){let u=0;for(let f=0;f<c.length;f++)u=(u<<5)-u+c.charCodeAt(f),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(c){let u,f=null,m,g;function b(...A){if(!b.enabled)return;let y=b,_=Number(new Date),M=_-(u||_);y.diff=M,y.prev=u,y.curr=_,u=_,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let C=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(P,B)=>{if(P==="%%")return"%";C++;let L=t.formatters[B];if(typeof L=="function"){let G=A[C];P=L.call(y,G),A.splice(C,1),C--}return P}),t.formatArgs.call(y,A),(y.log||t.log).apply(y,A)}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:()=>f!==null?f:(m!==t.namespaces&&(m=t.namespaces,g=t.enabled(c)),g),set:A=>{f=A}}),typeof t.init=="function"&&t.init(b),b}function r(c,u){let f=t(this.namespace+(typeof u>"u"?":":u)+c);return f.log=this.log,f}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 f of u)f[0]==="-"?t.skips.push(f.slice(1)):t.names.push(f)}function s(c,u){let f=0,m=0,g=-1,b=0;for(;f<c.length;)if(m<u.length&&(u[m]===c[f]||u[m]==="*"))u[m]==="*"?(g=m,b=f,m++):(f++,m++);else if(g!==-1)m=g+1,b++,f=b;else return!1;for(;m<u.length&&u[m]==="*";)m++;return m===u.length}function o(){let c=[...t.names,...t.skips.map(u=>"-"+u)].join(",");return t.enable(""),c}function v(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 l(){}return t.enable(t.load()),t}Go.exports=X8});var Wo=lt((ot,Kr)=>{E();x();k();R();ot.formatArgs=$8;ot.save=e4;ot.load=t4;ot.useColors=Z8;ot.storage=r4();ot.destroy=(()=>{let n=!1;return()=>{n||(n=!0)}})();ot.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 Z8(){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 $8(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Kr.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)}ot.log=console.debug||console.log||(()=>{});function e4(n){try{n?ot.storage.setItem("debug",n):ot.storage.removeItem("debug")}catch{}}function t4(){let n;try{n=ot.storage.getItem("debug")||ot.storage.getItem("DEBUG")}catch{}return!n&&typeof O<"u"&&"env"in O&&(n=O.env.DEBUG),n}function r4(){try{return localStorage}catch{}}Kr.exports=Vo()(ot);var{formatters:i4}=Kr.exports;i4.j=function(n){try{return JSON.stringify(n)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var No=lt($0=>{"use strict";E();x();k();R();var n4=$0&&$0.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty($0,"__esModule",{value:!0});$0.debug=void 0;var s4=n4(Wo());$0.debug=(0,s4.default)("mineflayer-mouse")});var Ko=lt(R0=>{"use strict";E();x();k();R();var o4=R0&&R0.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(R0,"__esModule",{value:!0});R0.isEntityAttackable=void 0;R0.isArmorStandAttackable=Yo;var jo=(Zn(),t7(Do)),j5=o4(Fo()),a4=No(),Qo=Object.fromEntries([...j5.default.attackable,...j5.default.notAttackable].map(n=>[n,!0])),v4=j5.default.attackable,l4=(n,e)=>{if(!e.name)throw new Error("Entity has no name");let t=n.entitiesByName[e.name],i=j5.default.entityRenames[e.name]||j5.default.entityRenames[(0,jo.snakeCase)(e.name)]||e.name;if(!Qo[i]&&(i=(0,jo.snakeCase)(i),!Qo[i]))return(0,a4.debug)(`Cannot find entity ${i} in entityData.json`),!1;let s=c4[i];return s?s(e,t):v4.includes(i)};R0.isEntityAttackable=l4;var c4={armor_stand:Yo};function Yo(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 T3=lt((BR,yl)=>{yl.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 M3=lt(ni=>{"use strict";E();x();k();R();Object.defineProperty(ni,"__esModule",{value:!0});ni.versionToNumber=void 0;var _l=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")}`};ni.versionToNumber=_l});var C3=lt(i5=>{"use strict";E();x();k();R();var wl=i5&&i5.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(i5,"__esModule",{value:!0});i5.getRenamedData=void 0;var S3=wl(T3()),qt=M3(),Al=(n,e,t,r)=>{let i=(0,qt.versionToNumber)(t),s=(0,qt.versionToNumber)(r),o=i<s?1:-1,v=o>0?1:0,a=e,l=Object.keys(S3.default).sort((f,m)=>o*((0,qt.versionToNumber)(f)-(0,qt.versionToNumber)(m))),c=o>0?s:i,u=o>0?i:s;for(let f of l.filter(m=>(0,qt.versionToNumber)(m)<=c&&(0,qt.versionToNumber)(m)>=u)){if(o>0&&(0,qt.versionToNumber)(f)>=c||o<0&&(0,qt.versionToNumber)(f)<=u)break;let m=S3.default[f][n];if(m)for(let g of m){let b=g[v],A=g[1-v];if(Array.isArray(a))a.includes(A)&&(a=a.map(y=>y===A?b:y));else if(a===A){a=b;break}}}return a};i5.getRenamedData=Al});function mi(n,e,t,r){let i=n.length/3,s=[];for(let o=0;o<i;o++){let v=Math.max(t[o]??0,Math.min(e[o]??1,r)),a=o*3;s.push(n[a]*v,n[a+1]*v,n[a+2]*v)}return s}var U3=Ne(()=>{"use strict";E();x();k();R()});function Cl(n,e=tt){let t=e.curve??tt.curve,r=e.minBrightness??tt.minBrightness,i=e.gamma??tt.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 Bl(n,e,t){return Math.max(n,Math.min(e,t))}function b1(n,e,t,r=tt){let i=Bl(n,e,t);return Cl(i,r)}var tt,pi,gi=Ne(()=>{"use strict";E();x();k();R();tt={curve:0,minBrightness:.12,gamma:1},pi=`
14
+ float applyLightmap(float L) {
15
+ float curved = L / (4.0 - 3.0 * L);
16
+ float shaped = mix(L, curved, u_lightCurve);
17
+ shaped = mix(u_minBrightness, 1.0, shaped);
18
+ return clamp(pow(shaped, u_lightGamma), 0.0, 1.0);
19
+ }
20
+ `});import*as at from"three";function bi(){return new at.ShaderMaterial({vertexShader:Pl,fragmentShader:Il,uniforms:at.UniformsUtils.merge([at.UniformsLib.fog,{u_atlas:{value:null},u_tintPalette:{value:null},u_debugMode:{value:0},u_skyLevel:{value:1},u_lightCurve:{value:tt.curve},u_minBrightness:{value:tt.minBrightness},u_lightGamma:{value:tt.gamma},u_sectionOriginRel:{value:new at.Vector3(0,0,0)},u_originDelta:{value:new at.Vector3},u_cameraOriginFrac:{value:new at.Vector3}}]),transparent:!1,depthWrite:!0,depthTest:!0,blending:at.NoBlending,glslVersion:at.GLSL3,fog:!0})}function yi(n,e){let t=n.uniforms.u_skyLevel;t&&(t.value=e)}function G3(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 _i(n){return{x:Math.round(n.x/16),y:Math.round(n.y/16),z:Math.round(n.z/16)}}var Pl,Il,Ut,gt,V3,Ll,Zt=Ne(()=>{"use strict";E();x();k();R();gi();Pl=`
14
21
  precision highp float;
15
22
  precision highp int;
16
23
 
@@ -20,17 +27,20 @@ layout(location = 2) in uint a_w2;
20
27
  layout(location = 3) in uint a_w3;
21
28
 
22
29
  // World camera position split for stable float32 subtraction (see relativePos below).
23
- uniform vec3 u_cameraOrigin;
30
+ uniform ivec3 u_sectionOriginRel;
31
+ uniform vec3 u_originDelta;
24
32
  uniform vec3 u_cameraOriginFrac;
33
+ uniform float u_skyLevel;
25
34
 
26
- out float v_light;
35
+ out float v_blockLight;
36
+ out float v_skyLight;
27
37
  out float v_ao;
28
38
  out vec2 v_uv;
29
39
  flat out int v_texIndex;
30
40
  flat out int v_tintIndex;
31
41
  flat out int v_faceId;
32
42
 
33
- // Logarithmic depth buffer support: Three.js injects USE_LOGDEPTHBUF when the
43
+ // Logarithmic depth buffer support: Three.js injects USE_LOGARITHMIC_DEPTH_BUFFER when the
34
44
  // renderer has logarithmicDepthBuffer: true. Standard Three.js shader chunks
35
45
  // rewrite gl_FragDepth via these varyings \u2014 if we don't, our linear gl_FragCoord.z
36
46
  // fails depth test vs sibling meshes that DO write log depth (we'd be invisible).
@@ -39,7 +49,7 @@ flat out int v_faceId;
39
49
  // issue where vIsPerspective lands on 0.9999\u2026 on some pixels and silently falls
40
50
  // back to linear gl_FragCoord.z, producing a white-noise z-fight pattern against
41
51
  // neighbouring meshes.
42
- #ifdef USE_LOGDEPTHBUF
52
+ #ifdef USE_LOGARITHMIC_DEPTH_BUFFER
43
53
  out float vFragDepth;
44
54
  #endif
45
55
 
@@ -131,9 +141,12 @@ void main() {
131
141
  uint aoLevel = (a_w0 >> uint(23 + vi * 2)) & 0x3u;
132
142
  v_ao = (float(aoLevel) + 1.0) / 4.0;
133
143
 
134
- // --- word1: combined smooth light (8 bits per corner) ---
144
+ // --- word1: sky (high nibble) + block (low nibble) light per corner ---
135
145
  uint lightRaw = (a_w1 >> uint(vi * 8)) & 0xFFu;
136
- v_light = float(lightRaw) / 255.0;
146
+ uint sky4 = (lightRaw >> 4u) & 0xFu;
147
+ uint block4 = lightRaw & 0xFu;
148
+ v_skyLight = float(sky4) / 15.0;
149
+ v_blockLight = float(block4) / 15.0;
137
150
 
138
151
  // --- word2: texture index ---
139
152
  v_texIndex = int(a_w2 & 0xFFFu);
@@ -158,15 +171,17 @@ void main() {
158
171
  int sX = int((a_w3 & 0xFFFFu) | (((a_w2 >> 19u) & 0x3Fu) << 16u)) - 2097152;
159
172
  int sZ = int(((a_w3 >> 16u) & 0xFFFFu) | (((a_w2 >> 25u) & 0x3Fu) << 16u)) - 2097152;
160
173
  int sY = int((a_w2 >> 13u) & 0x1Fu) - 4;
161
- vec3 sectionBase = vec3(float(sX * 16), float(sY * 16), float(sZ * 16));
174
+ int sXr = sX - u_sectionOriginRel.x;
175
+ int sYr = sY - u_sectionOriginRel.y;
176
+ int sZr = sZ - u_sectionOriginRel.z;
177
+ vec3 sectionBase = vec3(float(sXr * 16), float(sYr * 16), float(sZr * 16));
162
178
  vec3 facePos = BASE[faceId] + u * DU[faceId] + v * DV[faceId];
163
179
  vec3 blockLocal = vec3(float(lx), float(ly), float(lz));
164
- // (sectionBase - u_cameraOrigin) is exact in float32; add small terms after.
165
- vec3 relativePos = (sectionBase - u_cameraOrigin) + facePos + blockLocal - u_cameraOriginFrac;
180
+ vec3 relativePos = sectionBase + u_originDelta + facePos + blockLocal - u_cameraOriginFrac;
166
181
  vec4 mvPosition = modelViewMatrix * vec4(relativePos, 1.0);
167
182
  gl_Position = projectionMatrix * mvPosition;
168
183
 
169
- #ifdef USE_LOGDEPTHBUF
184
+ #ifdef USE_LOGARITHMIC_DEPTH_BUFFER
170
185
  // Mirrors three.js logdepthbuf_vertex chunk (EXT path: fragment writes gl_FragDepth).
171
186
  vFragDepth = 1.0 + gl_Position.w;
172
187
  #endif
@@ -176,7 +191,7 @@ void main() {
176
191
  vFogDepth = -mvPosition.z;
177
192
  #endif
178
193
  }
179
- `,Sv=`
194
+ `,Il=`
180
195
  precision highp float;
181
196
  precision highp int;
182
197
 
@@ -184,15 +199,20 @@ uniform sampler2D u_atlas;
184
199
  uniform sampler2D u_tintPalette;
185
200
  /** 0=normal 1=holes 2=tileIndex 3=faceId 4=atlasAlpha */
186
201
  uniform float u_debugMode;
202
+ uniform float u_skyLevel;
203
+ uniform float u_lightCurve;
204
+ uniform float u_minBrightness;
205
+ uniform float u_lightGamma;
187
206
 
188
- in float v_light;
207
+ in float v_blockLight;
208
+ in float v_skyLight;
189
209
  in float v_ao;
190
210
  in vec2 v_uv;
191
211
  flat in int v_texIndex;
192
212
  flat in int v_tintIndex;
193
213
  flat in int v_faceId;
194
214
 
195
- #ifdef USE_LOGDEPTHBUF
215
+ #ifdef USE_LOGARITHMIC_DEPTH_BUFFER
196
216
  uniform float logDepthBufFC;
197
217
  in float vFragDepth;
198
218
  #endif
@@ -211,7 +231,7 @@ uniform float fogFar;
211
231
  out vec4 FragColor;
212
232
 
213
233
  void writeLogDepth() {
214
- #ifdef USE_LOGDEPTHBUF
234
+ #ifdef USE_LOGARITHMIC_DEPTH_BUFFER
215
235
  // Camera is always perspective; skip the vIsPerspective branch from three.js
216
236
  // standard chunks to avoid float-precision z-fight against neighbouring meshes.
217
237
  gl_FragDepth = log2(vFragDepth) * logDepthBufFC * 0.5;
@@ -230,6 +250,8 @@ void applyFog() {
230
250
  #endif
231
251
  }
232
252
 
253
+ ${pi}
254
+
233
255
  void main() {
234
256
  // Atlas sample (pixelated, no filtering)
235
257
  ivec2 atlasSize = textureSize(u_atlas, 0);
@@ -274,19 +296,19 @@ void main() {
274
296
  // Tint from palette (256x1 RGBA texture, index 0 = white [1,1,1])
275
297
  vec3 tint = texelFetch(u_tintPalette, ivec2(v_tintIndex, 0), 0).rgb;
276
298
 
277
- // Combined light * AO, identity brightness curve (no mcBrightness) to match the
278
- // legacy CPU mesher output 1:1.
279
- float brightness = v_light * v_ao;
299
+ float L = max(v_blockLight, min(v_skyLight, u_skyLevel));
300
+ float Lm = applyLightmap(L);
301
+ float brightness = Lm * v_ao;
280
302
 
281
303
  // Opaque full cubes: always alpha 1 (legacy uses cutout material; avoids seeing blocks behind)
282
304
  FragColor = vec4(baseColor.rgb * tint * brightness, 1.0);
283
305
  applyFog();
284
306
  writeLogDepth();
285
307
  }
286
- `;X1=6,c0={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,TRANSPARENT_SHIFT:31},ra={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,SPARE_BITS:1},Cv={SECTION_BITS:22,SECTION_MASK:(1<<22)-1,LO_BITS:16,HI_BITS:6,SECTION_BIAS:2097152}});var $1,ia=Xe(()=>{"use strict";E();x();k();R();$1=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 d0 from"three";var er,na=Xe(()=>{"use strict";E();x();k();R();er=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),a=`${i}:${s}`,v=this.categoryBiomeToIndex.get(a);if(v!==void 0)return v;let l=this.colorToIndex.get(o);if(l!==void 0)return this.categoryBiomeToIndex.set(a,l),l;let c=this.entries.length;return this.entries.push({r:e,g:t,b:r}),this.colorToIndex.set(o,c),this.categoryBiomeToIndex.set(a,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 d0.DataTexture(e,256,1,d0.RGBAFormat,d0.FloatType);return t.minFilter=d0.NearestFilter,t.magFilter=d0.NearestFilter,t.wrapS=d0.ClampToEdgeWrapping,t.wrapT=d0.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,a=(i&255)/255;return[s,o,a]}if(e.grass){let i=r(e.grass.default);for(let{keys:s,color:o}of e.grass.data??[]){let a=r(o);for(let v of s)t.add(a[0],a[1],a[2],"grass",v)}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 a=r(o);for(let v of s)t.add(a[0],a[1],a[2],"foliage",v)}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 a=r(o);for(let v of s)t.add(a[0],a[1],a[2],"redstone",v)}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 a=r(o);for(let v of s)t.add(a[0],a[1],a[2],"constant",v)}t.add(i[0],i[1],i[2],"constant","default")}return t}}});import sa from"mc-assets/dist/blocksAtlases.json";function Bv(){let n=globalThis.loadedData?.tints;return n||(oa||(oa=!0),null)}function rr(){let n=Bv();if(!n)return null;if(tr||(tr=er.fromTintsData(n),tr.createTexture()),!Vi){let e=sa.latest??sa;Vi=new $1({width:e.width,height:e.height,tileSize:e.tileSize??16,suSv:e.suSv??16,textures:e.textures??{}})}return{tintPalette:tr,textureIndexMapping:Vi}}function aa(){return 1<<ra.EMPTY_SHIFT>>>0}var Jt,tr,Vi,oa,Zt=Xe(()=>{"use strict";E();x();k();R();gt();ia();na();Jt=4,tr=null,Vi=null,oa=!1});import*as Ce from"three";function Pv(n,e){let t=new Ce.InstancedBufferGeometry,r=new Float32Array(X1*3);t.setAttribute("position",new Ce.BufferAttribute(r,3));let i=new Uint32Array(e),s=new Uint32Array(e),o=new Uint32Array(e),a=new Uint32Array(e),v=Jt;for(let l=0;l<e;l++)i[l]=n[l*v],s[l]=n[l*v+1],o[l]=n[l*v+2],a[l]=n[l*v+3];return t.setAttribute("a_w0",new Ce.InstancedBufferAttribute(i,1)),t.setAttribute("a_w1",new Ce.InstancedBufferAttribute(s,1)),t.setAttribute("a_w2",new Ce.InstancedBufferAttribute(o,1)),t.setAttribute("a_w3",new Ce.InstancedBufferAttribute(a,1)),t.instanceCount=e,t.boundingBox=new Ce.Box3(new Ce.Vector3(-8,-8,-8),new Ce.Vector3(8,8,8)),t.boundingSphere=new Ce.Sphere(new Ce.Vector3(0,0,0),Math.sqrt(3*8**2)),t}function Iv(n){n.raycast=(e,t)=>{let{geometry:r}=n;if(!r.boundingBox||(va.copy(r.boundingBox).applyMatrix4(n.matrixWorld),!e.ray.intersectBox(va,ji)))return;let i=e.ray.origin.distanceTo(ji);t.push({distance:i,point:ji.clone(),object:n})}}function ir(n,e){let t=Pv(n.words,n.count),r=new Ce.Mesh(t,e);return r.name="shaderMesh",r.matrixAutoUpdate=!1,r.frustumCulled=!1,Iv(r),r}function Yi(n){n.geometry.dispose()}var va,ji,Qi=Xe(()=>{"use strict";E();x();k();R();gt();Zt();va=new Ce.Box3,ji=new Ce.Vector3});var ha={};q5(ha,{applyWorldGeometryExport:()=>Dv,createMeshesFromExport:()=>ua,downloadWorldGeometry:()=>Ki,exportWorldGeometry:()=>ca,loadTextureFromDataUrl:()=>fa,loadWorldGeometryFromUrl:()=>Hv});import*as Be from"three";function ca(n,e,t,r=!1){let i=[];for(let[o,a]of Object.entries(n.sectionObjects)){let v=a.children.find(A=>A.name==="mesh");if(!v?.geometry)continue;let{geometry:l}=v,c=l.getAttribute("position"),u=l.getAttribute("normal"),h=l.getAttribute("color"),p=l.getAttribute("uv"),g=l.index;if(!c||!g)continue;let y=n.sceneOrigin.getWorldPosition(v);i.push({key:o,position:{x:y?.x??n.sceneOrigin.toWorldX(v.position.x),y:y?.y??n.sceneOrigin.toWorldY(v.position.y),z:y?.z??n.sceneOrigin.toWorldZ(v.position.z)},geometry:{positions:[...c.array],normals:u?[...u.array]:[],colors:h?[...h.array]:[],uvs:p?[...p.array]:[],indices:[...g.array]}})}let s={version:n.version??"unknown",exportedAt:new Date().toISOString(),camera:{position:e,rotation:t},sections:i};if(r&&n.material.map){let o=document.createElement("canvas"),a=n.material.map,{image:v}=a;v&&(o.width=v.width,o.height=v.height,o.getContext("2d").drawImage(v,0,0),s.textureAtlasDataUrl=o.toDataURL("image/png"))}return s}function Ki(n,e,t,r="world-geometry.json",i=!1){let s=ca(n,e,t,i),o=JSON.stringify(s),a=new Blob([o],{type:"application/json"}),v=URL.createObjectURL(a),l=document.createElement("a");l.href=v,l.download=r,l.click(),URL.revokeObjectURL(v)}async function Hv(n){let e=await fetch(n);if(!e.ok)throw new Error(`Failed to fetch world geometry: ${e.statusText}`);return e.json()}function da(n){let e=n.map??n.map;if(!e)return null;let t=q1();t.uniforms.u_atlas.value=e;let r=rr();if(!r)return null;let{tintPalette:i}=r;return i.isReady()||i.createTexture(),t.uniforms.u_tintPalette.value=i.getTexture(),t}function ua(n,e,t){let r=[],i=t??da(e);for(let s of n.sections){let o=new Be.Group;if(o.name="chunk",s.geometry.positions.length>0&&s.geometry.indices.length>0){let l=new Be.BufferGeometry;l.setAttribute("position",new Be.Float32BufferAttribute(s.geometry.positions,3)),s.geometry.normals.length&&l.setAttribute("normal",new Be.Float32BufferAttribute(s.geometry.normals,3)),s.geometry.colors.length&&l.setAttribute("color",new Be.Float32BufferAttribute(s.geometry.colors,3)),s.geometry.uvs.length&&l.setAttribute("uv",new Be.Float32BufferAttribute(s.geometry.uvs,2));let u=Math.max(...s.geometry.indices)>65535?Uint32Array:Uint16Array;l.setIndex(new Be.BufferAttribute(new u(s.geometry.indices),1));let h=new Be.Mesh(l,e);h.position.set(s.position.x,s.position.y,s.position.z),h.name="mesh",o.add(h)}let v=s.shaderCubes;if(v&&v.count>0&&i){let l=ir(v,i);l.position.set(s.position.x,s.position.y,s.position.z),o.add(l)}o.children.length>0&&r.push(o)}return r}async function fa(n){return new Promise((e,t)=>{let r=new Image;r.onload=()=>{let i=new Be.Texture(r);i.magFilter=Be.NearestFilter,i.minFilter=Be.NearestFilter,i.needsUpdate=!0,i.flipY=!1,e(i)},r.onerror=t,r.src=n})}async function Dv(n,e){let{scene:t,renderUpdateEmitter:r,material:i}=n,s=t.getObjectByName(la);s&&(t.remove(s),Ov(s));let o=!!e.textureAtlasDataUrl,a;if(o&&e.textureAtlasDataUrl){let u=await fa(e.textureAtlasDataUrl);a=new Be.MeshLambertMaterial({map:u,vertexColors:!0,transparent:!0,alphaTest:.1}),a.name="geometry-export-material"}else a=i;let v=e.sections.some(u=>(u.shaderCubes?.count??0)>0)?da(a):null,l=ua(e,a,v),c=new Be.Group;c.name=la,o&&(c.userData.geometryExportMaterial=a);for(let u of l)c.add(u);return t.add(c),r.emit("update"),l.length}var la,Ov,Ji=Xe(()=>{"use strict";E();x();k();R();Zt();gt();Qi();la="geometry-export-root";Ov=n=>{n.traverse(t=>{t.isMesh&&t.geometry?.dispose()});let e=n.userData?.geometryExportMaterial;e&&(e.map?.dispose?.(),e.dispose?.())}});E();x();k();R();E();x();k();R();E();x();k();R();E();x();k();R();import{proxy as z2}from"valtio";E();x();k();R();E();x();k();R();var _r=()=>({longRenderTime:!1,constantLongRenderTime:!1,tooManyEntities:!1,tooManyTextures:!1,unknownReason:!1});E();x();k();R();var r1=30;var wr=45,Ar=100;E();x();k();R();var l5=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,a=s>=8&&o/s>=.65,v=e.loadedTextureCount>=100,l=t&&e.entitiesMs>=8&&r<=20,u=t&&!(i||a||l||v);this.factors.longRenderTime=i,this.factors.constantLongRenderTime=a,this.factors.tooManyEntities=l,this.factors.tooManyTextures=v,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}};E();x();k();R();var v6=[{key:"longRenderTime",code:"LR"},{key:"constantLongRenderTime",code:"CLR"},{key:"tooManyEntities",code:"ENT"},{key:"tooManyTextures",code:"TEX"},{key:"unknownReason",code:"UNK"}];function Er(n){let e=v6.filter(({key:t})=>n[t]).map(({code:t})=>t);return e.length>0?e.join("+"):""}var c5={paused:!1,showChunkBorders:!1,enableDebugOverlay:!1,debugWasmPerf:!1,debugModelVariant:void 0,futuristicReveal:!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,moduleStates:{}},L2={fpsLimit:void 0,sceneBackground:"lightblue",timeoutRendering:!1},El=(n={})=>z2({...c5,...n}),J0=()=>({reactive:z2({world:{chunksLoaded:{},heightmaps:{},allChunksLoaded:!1,mesherWork:!1,instabilityFactors:_r(),intersectMedia:null},renderer:"...",preventEscapeMenu:!1}),nonReactive:{fps:0,worstRenderTime:0,avgRenderTime:0,world:{chunksLoadedCount:0,chunksTotalNumber:0,chunksFullInfo:"-"},renderer:{timeline:{live:[],frozen:[],lastSecond:[]}}}});E();x();k();R();import{proxy as l6}from"valtio";var xr=()=>l6({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}),U2=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"}}),G2=()=>({reactive:xr()});E();x();k();R();import{Vec3 as A6}from"vec3";import{proxy as is}from"valtio";E();x();k();R();E();x();k();R();E();x();k();R();E();x();k();R();var i1={},N2=!1;function c6(){if(N2)return i1;N2=!0;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(M,I,B){return Function.prototype.apply.call(M,I,B)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:t=function(M){return Object.getOwnPropertyNames(M)};function r(C){}var i=Number.isNaN||function(M){return M!==M};function s(){s.init.call(this)}i1=s,i1.once=b,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");o=C}}),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(M){if(typeof M!="number"||M<0||i(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function v(C){return C._maxListeners===void 0?s.defaultMaxListeners:C._maxListeners}s.prototype.getMaxListeners=function(){return v(this)},s.prototype.emit=function(M){for(var I=[],B=1;B<arguments.length;B++)I.push(arguments[B]);var H=M==="error",G=this._events;if(G!==void 0)H=H&&G.error===void 0;else if(!H)return!1;if(H){var O;if(I.length>0&&(O=I[0]),O instanceof Error)throw O;var j=new Error("Unhandled error."+(O?" ("+O.message+")":""));throw j.context=O,j}var J=G[M];if(J===void 0)return!1;if(typeof J=="function")e(J,this,I);else for(var Z=J.length,$=g(J,Z),B=0;B<Z;++B)e($[B],this,I);return!0};function l(C,M,I,B){var H,G,O;if(a(I),G=C._events,G===void 0?(G=C._events=Object.create(null),C._eventsCount=0):(G.newListener!==void 0&&(C.emit("newListener",M,I.listener?I.listener:I),G=C._events),O=G[M]),O===void 0)O=G[M]=I,++C._eventsCount;else if(typeof O=="function"?O=G[M]=B?[I,O]:[O,I]:B?O.unshift(I):O.push(I),H=v(C),H>0&&O.length>H&&!O.warned){O.warned=!0;var j=new Error("Possible EventEmitter memory leak detected. "+O.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");j.name="MaxListenersExceededWarning",j.emitter=C,j.type=M,j.count=O.length}return C}s.prototype.addListener=function(M,I){return l(this,M,I,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(M,I){return l(this,M,I,!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(C,M,I){var B={fired:!1,wrapFn:void 0,target:C,type:M,listener:I},H=c.bind(B);return H.listener=I,B.wrapFn=H,H}s.prototype.once=function(M,I){return a(I),this.on(M,u(this,M,I)),this},s.prototype.prependOnceListener=function(M,I){return a(I),this.prependListener(M,u(this,M,I)),this},s.prototype.removeListener=function(M,I){var B,H,G,O,j;if(a(I),H=this._events,H===void 0)return this;if(B=H[M],B===void 0)return this;if(B===I||B.listener===I)--this._eventsCount===0?this._events=Object.create(null):(delete H[M],H.removeListener&&this.emit("removeListener",M,B.listener||I));else if(typeof B!="function"){for(G=-1,O=B.length-1;O>=0;O--)if(B[O]===I||B[O].listener===I){j=B[O].listener,G=O;break}if(G<0)return this;G===0?B.shift():y(B,G),B.length===1&&(H[M]=B[0]),H.removeListener!==void 0&&this.emit("removeListener",M,j||I)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(M){var I,B,H;if(B=this._events,B===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete B[M]),this;if(arguments.length===0){var G=Object.keys(B),O;for(H=0;H<G.length;++H)O=G[H],O!=="removeListener"&&this.removeAllListeners(O);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(I=B[M],typeof I=="function")this.removeListener(M,I);else if(I!==void 0)for(H=I.length-1;H>=0;H--)this.removeListener(M,I[H]);return this};function h(C,M,I){var B=C._events;if(B===void 0)return[];var H=B[M];return H===void 0?[]:typeof H=="function"?I?[H.listener||H]:[H]:I?A(H):g(H,H.length)}s.prototype.listeners=function(M){return h(this,M,!0)},s.prototype.rawListeners=function(M){return h(this,M,!1)},s.listenerCount=function(C,M){return typeof C.listenerCount=="function"?C.listenerCount(M):p.call(C,M)},s.prototype.listenerCount=p;function p(C){var M=this._events;if(M!==void 0){var I=M[C];if(typeof I=="function")return 1;if(I!==void 0)return I.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function g(C,M){for(var I=new Array(M),B=0;B<M;++B)I[B]=C[B];return I}function y(C,M){for(;M+1<C.length;M++)C[M]=C[M+1];C.pop()}function A(C){for(var M=new Array(C.length),I=0;I<M.length;++I)M[I]=C[I].listener||C[I];return M}function b(C,M){return new Promise(function(I,B){function H(O){C.removeListener(M,G),B(O)}function G(){typeof C.removeListener=="function"&&C.removeListener("error",H),I([].slice.call(arguments))}S(C,M,G,{once:!0}),M!=="error"&&w(C,H,{once:!0})})}function w(C,M,I){typeof C.on=="function"&&S(C,"error",M,I)}function S(C,M,I,B){if(typeof C.on=="function")B.once?C.once(M,I):C.on(M,I);else if(typeof C.addEventListener=="function")C.addEventListener(M,function H(G){B.once&&C.removeEventListener(M,H),I(G)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof C)}return i1}var n1=c6();n1.once;n1.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)})};n1.on=function(n,e){let t=[],r=[],i=null,s=!1,o={async next(){let l=t.shift();if(l)return createIterResult(l,!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,a),n.removeListener("error",v),s=!0;for(let l of r)l.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(l){i=l,n.removeListener(e,a),n.removeListener("error",v)},[Symbol.asyncIterator](){return this}};return n.on(e,a),n.on("error",v),o;function a(...l){let c=r.shift();c?c.resolve(createIterResult(l,!1)):t.push(l)}function v(l){s=!0;let c=r.shift();c?c.reject(l):i=l,o.return()}};var{EventEmitter:Z0,defaultMaxListeners:Ll,init:Ul,listenerCount:Gl,on:Nl,once:Wl}=n1;import{Vec3 as q0}from"vec3";E();x();k();R();function d5(n){let e=n*2+1;if(e<=0)return[];let t=[],r=0,i=0,s=0,o=-1;for(let a=0;a<e*e;a++){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 v=s;s=-o,o=v}r+=s,i+=o}return t}E();x();k();R();function Rr(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=>Rr(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=Rr(r[s],e+1);o!==void 0&&(i[s]=o)}return i}function s1(n){return n.map(e=>Rr(e))}var Mt=n=>[Math.floor(n.x/16),Math.floor(n.z/16)],d6=n=>[Math.floor(n.x/16),Math.floor(n.y/16),Math.floor(n.z/16)],W2=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)},Tt=new WeakMap,u5=class u5 extends Z0{static restoreTransferred(e,t){let r=new u5;if(!t)return r;let i=Tt.get(t);if(i)i.activeWorldView=r;else{let s=({data:o})=>{let v=Tt.get(t)?.activeWorldView;!v||o?.class!==u5.restorerName||o.type==="event"&&v.emit(o.eventName,...o.args)};t.addEventListener("message",s),i={activeWorldView:r,handler:s},Tt.set(t,i)}return r}static clearWorkerBridgeForTest(e){let t=Tt.get(e);t&&(e.removeEventListener("message",t.handler),Tt.delete(e))}static getWorkerBridgeListenerCountForTest(e){return Tt.has(e)?1:0}};d(u5,"restorerName","WorldViewWorker");var X0=u5,$0=class extends Z0{constructor(t,r,i=new q0(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 q0(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:X0.restorerName,type:"event",eventName:i,args:s1(s)})}}return{__restorer:X0.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]=Mt(t),o=d5(this.viewDistance).map(([a,v])=>new q0((i+a)*16,0,(s+v)*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 W2(t,this.addWaitTime,async o=>{!s||this.loadedChunks[`${o.x},${o.z}`]||(this.world.getColumnAt(o)||(s=await new Promise(a=>{this.waitingSpiralChunksLoad[`${o.x},${o.z}`]=a})),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 l,c;let[s,o]=Mt(this.lastPos),a=Math.abs(s-Math.floor(t.x/16)),v=Math.abs(o-Math.floor(t.z/16));if(a<=this.viewDistance&&v<=this.viewDistance){let u=await this.world.getColumnAt(t.y!==void 0?t:new q0(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,(l=this.debugChunksInfo)[c=`${t.x},${t.z}`]??(l[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})}}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[a,v,l]=s.split(",").map(Number);return t.world.getBlock(new q0(a,v,l))?.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]=Mt(this.lastPos),[a,v]=Mt(t);if(s!==a||o!==v||r){this.emit("chunkPosUpdate",{pos:t});let l=[],c=r?this.viewDistance:this.viewDistance+this.keepChunksDistance;for(let h of Object.keys(this.loadedChunks)){let[p,g]=h.split(",").map(Number),y=new q0(p,0,g),[A,b]=Mt(y),w=Math.abs(a-A),S=Math.abs(v-b);(w>c||S>c)&&l.push(y)}for(let h of l)this.unloadChunk(h);let u=d5(this.viewDistance).map(([h,p])=>{let g=new q0((a+h)*16,0,(v+p)*16);if(!this.loadedChunks[`${g.x},${g.z}`])return g}).filter(h=>!!h);this.lastPos.update(t),this._loadChunks(u,t)}else this.emit("chunkPosUpdate",{pos:t}),this.lastPos.update(t)}};E();x();k();R();E();x();k();R();import $2 from"minecraft-data";import u6 from"mc-assets/dist/blocksAtlases.json";import f6 from"mc-assets/dist/itemsAtlases.json";import Ir from"mc-assets/dist/itemDefinitions.json";import h6 from"mc-assets/dist/blocksAtlasLatest.png";import m6 from"mc-assets/dist/blocksAtlasLegacy.png";import p6 from"mc-assets/dist/itemsAtlasLatest.png";import g6 from"mc-assets/dist/itemsAtlasLegacy.png";import b6 from"mc-assets/dist/textureReplacements/christmas";import{AtlasParser as et}from"mc-assets/dist/atlasParser";import Z2 from"mc-assets/dist/worldBlockProvider";E();x();k();R();var Cr=a5(V2(),1);import*as v1 from"three";E();x();k();R();E();x();k();R();var o1=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,a=0;this.context&&(o=Math.min(o,e),a=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(a.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 j2=class a1{constructor({logsPerSecond:e=20,samplesLog:t=100,samplesGraph:r=10,precision:i=2,minimal:s=!1,horizontal:o=!0,mode:a=0}={}){this.mode=a,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 a1.Panel("FPS","#0ff","#002"),0),this.msPanel=this.addPanel(new a1.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",v=>{v.preventDefault(),this.showPanel(++this.mode%this.container.children.length)},!1),this.mode=a,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 a1.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 a=0;a<t.logs.length;a++)r+=t.logs[a],t.logs[a]>i&&(i=t.logs[a]);let s=0,o=.01;for(let a=0;a<t.graph.length;a++)s+=t.graph[a],t.graph[a]>o&&(o=t.graph[a]);e&&e.update(r/Math.min(t.logs.length,this.samplesLog),s/Math.min(t.graph.length,this.samplesGraph),i,o,this.precision)}}};j2.Panel=o1;var Y2=j2;E();x();k();R();var He=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-He.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?He.Bounce.In(n*2)*.5:He.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}}}}),f5=function(){return performance.now()},Ct=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=f5()),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}(),St={Linear:function(n,e){var t=n.length-1,r=t*e,i=Math.floor(r),s=St.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=St.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=St.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=St.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,a=i*i,v=i*a;return(2*e-2*t+s+o)*v+(-3*e+3*t-2*s-o)*a+s*i+e}}},Q2=function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n}(),Mr=new Ct,Oe=function(){function n(e,t){t===void 0&&(t=Mr),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=He.Linear.None,this._interpolationFunction=St.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Q2.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=f5()),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 a=e[o],v=Array.isArray(a),l=v?"array":typeof a,c=!v&&Array.isArray(r[o]);if(!(l==="undefined"||l==="function")){if(c){var u=r[o];if(u.length===0)continue;for(var h=[a],p=0,g=u.length;p<g;p+=1){var y=this._handleRelativeValue(a,u[p]);if(isNaN(y)){c=!1;break}h.push(y)}c&&(r[o]=h)}if((l==="object"||v)&&a&&!c){t[o]=v?[]:{};var A=a;for(var b in A)t[o][b]=A[b];i[o]=v?[]:{};var u=r[o];if(!this._isDynamic){var w={};for(var b in u)w[b]=u[b];r[o]=u=w}this._setupProperties(A,t[o],u,i[o],s)}else(typeof t[o]>"u"||s)&&(t[o]=a),v||(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=f5()),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=f5()),!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=Mr),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=He.Linear.None),this._easingFunction=e,this},n.prototype.interpolation=function(e){return e===void 0&&(e=St.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=f5()),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 a=0,v=this._chainedTweens.length;a<v;a++)this._chainedTweens[a].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,a=r[s],v=Array.isArray(e[s]),l=Array.isArray(a),c=!v&&l;c?e[s]=this._interpolationFunction(a,i):typeof a=="object"&&a?this._updateProperties(e[s],o,a,i):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(e[s]=o+(a-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 Fc=Q2.nextId,g0=Mr,zc=g0.getAll.bind(g0),Lc=g0.removeAll.bind(g0),Uc=g0.add.bind(g0),Gc=g0.remove.bind(g0),K2=g0.update.bind(g0);E();x();k();R();function Sr(n){if(n==="high-performance")return"high-performance";if(n==="low-power")return"low-power"}var ae=typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope,Br=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 Cr.default,this.stats2=new Cr.default,this.statsGl=new Y2({minimal:!0}),this.stats2.showPanel(2),this.denseMode=typeof D<"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()}},h5=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 v1.WebGLRenderer({canvas:this.canvas,preserveDrawingBuffer:!0,logarithmicDepthBuffer:!0,powerPreference:Sr(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.useLegacyLights=!0,this.renderer.outputColorSpace=v1.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&&!ae&&(this.stats=new Br(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=J2(),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(),K2(),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 J2(){let n=document.createElement("canvas");return n.id="viewer-canvas",document.body.appendChild(n),n}var Pr=()=>{let n=J2(),e=n.transferControlToOffscreen(),t=!1,r=(o,a)=>{},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 q2}from"mc-assets/dist/itemsRenderer";import{getLoadedItemDefinitionsStore as Hr}from"mc-assets/dist/stores";var l1=null;function es(n){return ae?((!l1||typeof l1.get!="function")&&(l1=Hr(Ir)),l1):(ts(n),n.itemsDefinitionsStore)}function ts(n){ae||typeof n.itemsDefinitionsStore?.get=="function"||(n.itemsDefinitionsStore=Hr(n.sourceItemDefinitionsJson??Ir))}var Bt=class{constructor(e){d(this,"sourceItemDefinitionsJson",Ir);d(this,"itemsDefinitionsStore",Hr(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),ts(this)}if(this.version){let t=globalThis.loadedData??globalThis.mcData;ae&&t?.entitiesByName?this.mcData=t:this.mcData=$2(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}},X2="1.21.4",P0=class P0 extends Z0{constructor(){super(...arguments);d(this,"sourceBlockStatesModels",null);d(this,"sourceBlocksAtlases",u6);d(this,"sourceItemsAtlases",f6);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(ae&&!(!t.version||!t.blockstatesModels||!t.blocksAtlasJson)){if(this.blocksAtlasParser=new et({latest:t.blocksAtlasJson},""),t.itemsAtlasJson)this.itemsAtlasParser=new et({latest:t.itemsAtlasJson},"");else if(!this.itemsAtlasParser?.atlas?.latest){if(!this.sourceItemsAtlases||Object.keys(this.sourceItemsAtlases).length===0)return;this.itemsAtlasParser=new et(this.sourceItemsAtlases,"")}t.itemsRenderer=new q2(t.version,t.blockstatesModels,this.itemsAtlasParser,this.blocksAtlasParser),t.worldBlockProvider=Z2(t.blockstatesModels,this.blocksAtlasParser.atlas,X2)}}static restoreTransferred(t,r){let i=new P0,s=o=>{i.currentResources=new Bt(o),i.rebuildWorkerRenderers(i.currentResources)};return s(t.currentResources),r&&r.addEventListener("message",({data:o})=>{o.class===P0.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:P0.restorerName,type:"event",eventName:i,args:s1(s)}),i==="assetsTexturesUpdated"||i==="assetsInventoryReady"){let o=this.enrichTransferSnapshot(this.currentResources?.prepareForTransfer());t.postMessage({class:P0.restorerName,type:"newResources",currentResources:o})}}}return{__restorer:P0.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 Bt}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 Bt;s.version=this.currentConfig.version,s.texturesVersion=this.currentConfig.texturesVersion??s.version,s.mcData=$2(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 q2(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,b6);let s=new et(this.sourceBlocksAtlases,h6,m6),o=Object.keys(t.customTextures.blocks?.textures??{}),{atlas:a,canvas:v}=await s.makeNewAtlas(t.texturesVersion,l=>{if(this.currentConfig.includeOnlyBlocks&&!this.currentConfig.includeOnlyBlocks.includes(l))return!1;let c=t.customTextures.blocks?.textures[l];return r[l]??c},void 0,void 0,o,{needHorizontalIndexes:!!this.currentConfig.includeOnlyBlocks});this.blocksAtlasParser=new et({latest:a},v.toDataURL()),t.blocksAtlasImage=await createImageBitmap(v),t.blocksAtlasJson=this.blocksAtlasParser.atlas.latest,t.worldBlockProvider=Z2(t.blockstatesModels,this.blocksAtlasParser.atlas,X2)}async recreateItemsAtlas(t=this.currentResources){let r=new et(this.sourceItemsAtlases,p6,g6),i=Object.keys(t.customTextures.items?.textures??{}),{atlas:s,canvas:o}=await r.makeNewAtlas(t.texturesVersion,a=>{let v=t.customTextures.items?.textures[a];if(v)return v},t.customTextures.items?.tileSize,void 0,i);this.itemsAtlasParser=new et({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(P0,"restorerName","ResourcesManager");var h0=P0;E();x();k();R();var o0=class extends Error{constructor(t,r){super(t);d(this,"failure");this.name="MesherWorkerPreloadError",this.failure=r}};function y6(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 _6=45e3,w6=1e4;async function rs(n){if(D.env.SINGLE_FILE_BUILD)return;let e=n?.fetchTimeoutMs??_6,t=n?.pingTimeoutMs??w6,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 o0(`Mesher script fetch timed out after ${e}ms (${i}).`,{phase:"fetch",code:"timeout"}):new o0(`Mesher script fetch failed (network): ${h?.message??u}. URL: ${i}`,{phase:"fetch",code:"network",detail:String(h?.message??u)})}if(!s.ok)throw new o0(`Mesher script HTTP ${s.status} ${s.statusText}: ${i}`,{phase:"fetch",code:"bad-status",status:s.status});let o=s.headers.get("content-type")??"",a=await s.arrayBuffer();if(a.byteLength===0)throw new o0(`Mesher script response was empty: ${i}`,{phase:"fetch",code:"invalid-body",hint:"empty"});let v=Math.min(1024,a.byteLength),l=new TextDecoder().decode(a.slice(0,v)).trimStart();if(l.startsWith("<!DOCTYPE")||l.startsWith("<html")||l.startsWith("<HTML"))throw new o0(`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 o0(`Could not construct Worker for mesher (${i}): ${h}`,{phase:"worker",code:"construct-failed",message:h})}await new Promise((u,h)=>{let p=!1,g=window.setTimeout(()=>{p||(p=!0,y(),h(new o0(`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),y=()=>{clearTimeout(g);let M=c;c=void 0,M&&(M.removeEventListener("message",w),M.removeEventListener("error",S),M.removeEventListener("messageerror",C),M.terminate())},A=()=>{p||(p=!0,y(),u())},b=M=>{p||(p=!0,y(),h(M))};function w(M){y6(M.data)&&A()}function S(M){b(new o0(`Mesher worker script failed to load or threw during startup: ${M.message||"unknown"} @ ${i}`,{phase:"worker",code:"script-error",message:M.message}))}function C(){b(new o0(`Mesher worker message channel error (structured clone / deserialization). URL: ${i}`,{phase:"ping",code:"messageerror"}))}c.addEventListener("message",w),c.addEventListener("error",S),c.addEventListener("messageerror",C);try{c.postMessage({type:"mc-web-ping",t:performance.now(),workerIndex:0})}catch(M){let I=M instanceof Error?M.message:String(M);b(new o0(`Failed to post mc-web-ping to mesher worker: ${I}`,{phase:"ping",code:"post-failed",detail:I}))}})}var ns=class{constructor(e={},t=new h0){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:xr()});d(this,"rendererState");d(this,"nonReactiveState");d(this,"worldReady");d(this,"resolveWorldReady");d(this,"lastCamUpdate",0);d(this,"getRendererOptions");this.config={...L2,...e.config},this.menuBackgroundOptions={...e.config?.menuBackground,...e.menuBackground},this.inWorldRenderingConfig=is({...c5,...e.rendererConfig});let r=J0();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 rs({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 A6(0,64,0);this.worldView=new $0(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 a;if(this.backend){let v=this.backend.startWorld(o);v&&typeof v.then=="function"&&(a=v)}return this.currentState={method:"startWorld",args:[o]},await a,this.resolveWorldReady(),this.onWorldStart?.(),!!a}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=is(J0().reactive),this.nonReactiveState=J0().nonReactive}updateCamera(e,t,r){this.backend?.updateCamera(e,t,r)}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)}};E();x();k();R();import{subscribe as I6}from"valtio/vanilla";E();x();k();R();E();x();k();R();var tt=["galaxy","nether","end","cyber","light"],rt=["cruise","barrel","dive","orbit","snake"],m5={galaxy:"Galaxy",nether:"Nether",end:"The End",cyber:"Cyber",light:"Light Space"},p5={cruise:"Cruise",barrel:"Barrel",dive:"Dive",orbit:"Orbit",snake:"Snake"},it=["mixed","stainedGlass","wool","construction","glow","world"],g5={mixed:"Mixed",stainedGlass:"Stained glass",wool:"Wool",construction:"Construction",glow:"Glow",world:"World (grass & ores)"};E();x();k();R();var b0={mode:"v2",minecraftTextures:!0,v2Scene:"light",v2Camera:"dive",v2BlockGroup:"stainedGlass",v2CameraSpeedPercent:80,v2BlockSpeedPercent:40},E0=n=>n/100,b5={camera:E0(b0.v2CameraSpeedPercent),block:E0(b0.v2BlockSpeedPercent)};var E6={off:0,holes:1,texIndex:2,faces:3,atlasAlpha:4};function Or(n){return E6[n]}var nt=b0,ss={rendererWorldPerformance:"normal",rendererMeshersCountOverride:null,starfieldRendering:!0,defaultSkybox:!0,menuBackgroundMode:nt.mode,menuBackgroundMinecraftTextures:nt.minecraftTextures,menuBackgroundV2Scene:nt.v2Scene,menuBackgroundV2Camera:nt.v2Camera,menuBackgroundV2BlockGroup:nt.v2BlockGroup,menuBackgroundV2CameraSpeed:nt.v2CameraSpeedPercent,menuBackgroundV2BlockSpeed:nt.v2BlockSpeedPercent,rendererFuturisticReveal:!1,rendererPerfDebugOverlay:!1,disableBlockEntityTextures:!1,rendererMesher:"wasm",rendererShaderCubeBlocks:!1,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 x6(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,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 os={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:tt.map(n=>[n,m5[n]])},menuBackgroundV2Camera:{possibleValues:rt.map(n=>[n,p5[n]])},menuBackgroundV2BlockGroup:{possibleValues:it.map(n=>[n,g5[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. Reload to apply.",requiresRestart:!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:"WASM is faster. Use JS if WASM is not working. Requires reload.",requiresRestart:!0},rendererShaderCubeBlocks:{text:"(UNSTABLE) Instanced shader cubes",tooltip:"Render full blocks through the global GPU instanced path. Requires WASM mesher and WebGL2.",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"]]}},as=[{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","rendererShaderCubeBlocks"]},{title:"Renderer debug",keys:["rendererFuturisticReveal","rendererPerfDebugOverlay","rendererShaderCubeDebugMode"]}];E();x();k();R();E();x();k();R();E();x();k();R();E();x();k();R();function Dr(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let a=0;a<i;a++){let v=(o+a*r)*4;if(s.data[v+3]!==255)return!0}return!1}function c1(n){return n/64}function vs(n,e,t){if(t){if(Dr(n,0,0,e,e))return}else if(Dr(n,0,0,e,e/2))return;let r=c1(e),i=(s,o,a,v)=>n.clearRect(s*r,o*r,a*r,v*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 R6(n,e){n.save(),n.scale(-1,1);let t=c1(e),r=(i,s,o,a,v,l)=>n.drawImage(n.canvas,i*t,s*t,o*t,a*t,-v*t,l*t,-o*t,a*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 Fr(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),R6(r,i),vs(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),vs(r,n.width,!0)}function k6(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 zr(n,e){let t=k6(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 T6(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let a=0;a<i;a++){let v=(o+a*r)*4;if(!(s.data[v+0]===0&&s.data[v+1]===0&&s.data[v+2]===0&&s.data[v+3]===255))return!1}return!0}function M6(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let a=0;a<i;a++){let v=(o+a*r)*4;if(!(s.data[v+0]===255&&s.data[v+1]===255&&s.data[v+2]===255&&s.data[v+3]===255))return!1}return!0}function Lr(n){let e=c1(n.width),t=n.getContext("2d",{willReadFrequently:!0}),r=(a,v,l,c)=>Dr(t,a*e,v*e,l*e,c*e),i=(a,v,l,c)=>T6(t,a*e,v*e,l*e,c*e),s=(a,v,l,c)=>M6(t,a*e,v*e,l*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 Ur(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=c1(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)}E();x();k();R();import B6 from"mc-assets/dist/other-textures/latest/entity/player/wide/steve.png";E();x();k();R();import*as m0 from"three";E();x();k();R();var S6=()=>{if(typeof OffscreenCanvas>"u")return!1;try{let n=new OffscreenCanvas(1,1);return(n.getContext("webgl2")||n.getContext("webgl"))!==null}catch{return!1}},C6=S6(),Ve=(n,e)=>{if(C6||typeof document>"u")return new OffscreenCanvas(n,e);let t=document.createElement("canvas");return t.width=n,t.height=e,t};async function st(n){let t=await(await fetch(n)).blob();return createImageBitmap(t)}var Re=(n,e=!1)=>{n instanceof m0.Mesh&&(n.geometry?.dispose?.(),n.material?.dispose?.()),n.children&&n.children.forEach(t=>Re(t,e)),e&&n instanceof m0.Mesh&&n.material?.map?.dispose?.()},Gr={},ls={},y5=n=>{let e=new m0.Texture,t=st(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}},Pt=async n=>y5(n).texture,I0=n=>{let e=Ve(n.width,n.height);e.getContext("2d").drawImage(n,0,0);let r=new m0.Texture(e);return r.magFilter=m0.NearestFilter,r.minFilter=m0.NearestFilter,r};function It(n){let{texture:e,promise:t}=y5(n);return e.magFilter=m0.NearestFilter,e.minFilter=m0.NearestFilter,t.catch(r=>{}),e}async function d1(n,e,t){if(!Gr[n]){let{promise:i,resolve:s}=Promise.withResolvers(),o=y5(n);Gr[n]=o.texture,o.promise.then(s),ls[n]=i}e(Gr[n]),ls[n].then(()=>{t?.()})}var $e=B6,af=Pt($e),cs={apiEnabled:!0},u1=n=>{Object.assign(cs,n)};async function H0(n,e){if(!cs.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 y0(n){n.startsWith("data:")||(n=await P6(n.replace("http://","https://")));let e=await st(n),t=Ve(64,64);return Fr(t,e),{canvas:t,image:e}}var P6=async n=>{let t=await(await fetch(n,{})).arrayBuffer();return`data:image/png;base64,${z.from(t).toString("base64")}`};function gf(n){return{mode:n.menuBackgroundMode,useMinecraftTextures:n.menuBackgroundMinecraftTextures,v2Scene:n.menuBackgroundV2Scene,v2Camera:n.menuBackgroundV2Camera,v2BlockGroup:n.menuBackgroundV2BlockGroup,v2CameraSpeed:E0(n.menuBackgroundV2CameraSpeed),v2BlockSpeed:E0(n.menuBackgroundV2BlockSpeed)}}function H6(n,e){let t=n.v2;t&&(t.setScene?.(e.menuBackgroundV2Scene),t.setCamera?.(e.menuBackgroundV2Camera),t.setBlockGroup?.(e.menuBackgroundV2BlockGroup),t.setCameraSpeed?.(E0(e.menuBackgroundV2CameraSpeed)),t.setBlockSpeed?.(E0(e.menuBackgroundV2BlockSpeed)))}function O6(n){return n.rendererMesher!=="legacy-js"}function D6(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 F6(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 z6(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 L6(n,e,t={}){let r=n.inWorldRenderingConfig,i=O6(e);r.showChunkBorders=e.showChunkBorders,r.futuristicReveal=e.rendererFuturisticReveal,D6(n,e,i),r.renderEntities=e.renderEntities,z6(n,e,t),F6(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=e.rendererShaderCubeBlocks&&i,r.disableMesherConversionCache=!!t.isSafari,u1({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=Or(e.rendererShaderCubeDebugMode)}function bf(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 yf(n,e,t={}){n.bindRendererOptions(()=>e);let r=t.getWindowFocused?.()??!0,i=()=>{let s=e;if(L6(n,s,{isSafari:t.isSafari,isCypress:t.isCypress,windowFocused:r}),n.currentDisplay==="menu"){let o=n.backend?.getMenuBackground?.();o&&H6(o,s)}};return i(),t.onRegisterFocusHandlers?.({onFocus:()=>{r=!0,i()},onBlur:()=>{r=!1,i()}}),I6(e,i)}function _f(n,e,t){n.inWorldRenderingConfig.enableLighting=!t||e}E();x();k();R();import{proxy as U6}from"valtio";var ds=()=>U6({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}),G6=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"}}),N6=()=>({reactive:ds()}),us=(n,e,t)=>({...e,"minecraft:date":new Date});E();x();k();R();E();x();k();R();import*as Q5 from"three";import{Vec3 as u9}from"vec3";E();x();k();R();import{proxy as W6,getVersion as Vr,subscribe as ms}from"valtio";import{Vec3 as jr}from"vec3";function ps(n,e){let t=e??globalThis;return t.addEventListener("message",r=>{let{type:i,args:s,msgId:o}=r.data;if(n[i]){let a=n[i](...s);a instanceof Promise&&a.then(v=>{t.postMessage({type:"result",msgId:o,args:[v]})})}}),null}var gs=(n,e=!0)=>{let t=0;return new Proxy({},{get(r,i){return i==="transfer"?(...s)=>new Proxy({},{get(o,a){return(...v)=>{n.postMessage({type:a,args:v},s)}}}):(...s)=>{let o=t++,a=e?s.filter(v=>v instanceof ArrayBuffer||v instanceof MessagePort||typeof ImageBitmap<"u"&&v instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&v instanceof OffscreenCanvas||typeof ImageData<"u"&&v instanceof ImageData):[];return n.postMessage({type:i,msgId:o,args:s},a),{then(v){let l=({data:c})=>{c.type==="result"&&c.msgId===o&&(v(c.args[0]),n.removeEventListener("message",l))};n.addEventListener("message",l)}}}}})},bs=!1,_5={toWorker:0,fromWorker:0},fs=null,V6=()=>{fs==null&&(typeof window>"u"||(fs=setInterval(()=>{globalThis.debugWorkerSyncStats={..._5},_5.toWorker=0,_5.fromWorker=0},1e3)))},f1=n=>{V6(),n==="toWorker"?_5.toWorker++:_5.fromWorker++};var j6=()=>Math.random().toString(36).slice(2,15)+Math.random().toString(36).slice(2,15),Y6=(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},Q6=(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]]},Wr=(n,e)=>{if(n==null||typeof n!="object")return n;if(n instanceof jr)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=>Wr(r,e));if(Vr(n)!==void 0)return w5(n);let t={};for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=Wr(n[r],e));return t},K6=(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:Wr(r[2],e)})}return t},ys=(n,e,t,r,i)=>{if(e.length===0)return;let s=K6(e,t);if(s.length!==0)try{t.postMessage({type:"sync",syncId:n,ops:s}),r==="toWorker"&&f1("toWorker")}catch{for(let a of s)a.kind==="set"&&ot(a.value)}},_s=(n,e,t,r=!1)=>{for(let i of e)i.kind==="delete"?Q6(n,i.path):Y6(n,i.path,E5(i.value,[],t,!1,!1));r==="fromWorker"&&f1("fromWorker")},ws=(n,e,t,r,i)=>{try{let s=w5(e);t.postMessage({type:"sync",syncId:n,value:s}),r==="toWorker"&&f1("toWorker")}catch{ot(e)}},As=(n,e,t,r=!1)=>{Object.assign(n,E5(e,[],t,!1,!1)),r==="fromWorker"&&f1("fromWorker")},Nr=(n,e,t,r,i)=>{let s=n.__syncFromWorker||e.__syncFromWorker,o=n.__syncToWorker||e.__syncToWorker;if(!o&&!s&&!r)return;let a=j6();if(n.__syncId=a,o||r){r&&o!==!1&&ms(e,l=>{ys(a,l,t,"toWorker",`toWorker:${i}`)});let v=n.__syncToWorkerInterval??e.__syncToWorkerInterval??0;v>0&&!r&&setInterval(()=>{ws(a,e,t,"toWorker",`toWorker:interval:${i}`)},v)}e.__syncFromWorker&&t.addEventListener("message",v=>{v.data.type==="sync"&&v.data.syncId===a&&(v.data.ops?_s(e,v.data.ops,t,"fromWorker"):v.data.value&&As(e,v.data.value,t,"fromWorker"))})},w5=n=>{if(Vr(n)===void 0)return n;if(Array.isArray(n))return n.map(w5);if(typeof n=="object"&&n!==null){let e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=w5(n[t]));return e}return n},A5=(n,e,t=!0,r=!0,i=!1)=>{var a,v;let s=n,o={};for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){if(t&&typeof n[l]=="function")continue;if(n[l]instanceof Date||n[l]instanceof RegExp||n[l]instanceof Map||n[l]instanceof Set||n[l]instanceof WeakMap||n[l]instanceof WeakSet,n[l]instanceof jr){o[l]={x:n[l].x,y:n[l].y,z:n[l].z},o[l].__restorer="Vec3";continue}if(o[l]=n[l],typeof n[l]=="object"&&n[l]!==null){if(n[l].prepareForTransfer){o[l]=n[l].prepareForTransfer(e);continue}let c=Vr(n[l])!==void 0;o[l]=c?w5(n[l]):n[l],n[l].__syncFromWorker&&(o[l].__syncFromWorker=!0),n[l].__syncToWorker&&(o[l].__syncToWorker=!0),n[l].__syncFromWorkerInterval&&(o[l].__syncFromWorkerInterval=n[l].__syncFromWorkerInterval),n[l].__syncToWorkerInterval&&(o[l].__syncToWorkerInterval=n[l].__syncToWorkerInterval);let u=n[l].__syncToWorker!==!1&&!i&&c&&!n[l].__syncFromWorker;if((a=o[l]).__syncToWorker??(a.__syncToWorker=u),c&&((v=o[l]).__valtio??(v.__valtio=!0)),o[l].__syncToWorker&&c){Nr(o[l],s[l],e,!0,l);continue}if(o[l].__syncFromWorker||o[l].__syncToWorker){Nr(o[l],s[l],e,c,l);continue}Nr(o[l],s[l],e,!1,l),o[l]=A5(o[l],e,t,!1,c)}}return o},ot=(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&&ot(n[t],[...e,t]);try{structuredClone(n[t])}catch{}}},hs=new WeakMap,J6=(n,e,t)=>{if(!n.__syncId)return;let r=n.__syncId,i=hs.get(e);if(i||(i=new Set,hs.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?_s(n,s.data.ops,e):s.data.value&&As(n,s.data.value,e))}),n.__syncFromWorker)){n.__valtio&&ms(n,o=>{ys(r,o,e,"fromWorker",`fromWorker:${t}`)});let s=n.__syncFromWorkerInterval??0;s>0&&!n.__valtio&&setInterval(()=>{ws(r,n,e,"fromWorker",`fromWorker:interval:${t}`)},s)}},Z6=[{restorerName:"Vec3",restoreTransferred(n,e){return new jr(n.x,n.y,n.z)}}];var E5=(n,e,t,r=!0,i=!0)=>{let s=[...Z6,...e],o=(a,v)=>{if(a==null||typeof a!="object")return a;if(a.__restorer){let l=s.find(u=>u.restorerName?u.restorerName===a.__restorer:u.name===a.__restorer);if(l)return l.restoreTransferred(a,t);let c=new Error(`Restorer ${a.__restorer} not found`);if(typeof r=="function")r(c);else if(r)throw c;return a}if(Array.isArray(a))return a.map((l,c)=>o(l,`${v}[${c}]`));for(let l in a){if(!Object.prototype.hasOwnProperty.call(a,l))continue;let c=a[l];c!=null&&typeof c=="object"&&(a[l]=o(c,`${v}.${l}`))}return a.__valtio&&(a=W6(a)),i&&J6(a,t,v),a};return o(n,"root")};E();x();k();R();var h1=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()}};E();x();k();R();import*as Q from"three";import{Vec3 as G0}from"vec3";import i9 from"prismarine-chat";E();x();k();R();var q6=(n,e)=>{try{return JSON.parse(n)}catch{return null}},X6={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"},m1=(n,e,t,r=s=>{},i=(s,o)=>Ve(s,o))=>{let a=[16,9],v=a[0]-a[1],l=v/16,c="front_text"in n?n.front_text.messages:[n.Text1,n.Text2,n.Text3,n.Text4];if(!c.some(g=>g!=="null"))return;let u=i(16*40,v*40),h=u.getContext("2d");r(h);let p=("front_text"in n?n.front_text.color:n.Color)||"black";for(let[g,y]of c.slice(0,4).entries())y!=="null"&&Yr(y,t,u,64,p,64*(g+1)+(e?0:-8));return u},Yr=(n,e,t,r,i,s=0)=>{let o=!1,a=typeof n=="string"&&(n?.startsWith("{")||n?.startsWith('"'))?q6(n??'""',"sign text"):n;if(!a||typeof a!="object"&&typeof a!="string")return;let v=t.getContext("2d");if(!v)throw new Error("Could not get 2d context");v.imageSmoothingEnabled=!1,v.font=`${r}px mojangles`;let l=new e(a),c=[],u=!1,h="",p=s,g=[],y=(S,C)=>{S.text!==null&&S.text!==void 0&&S.text;let M=S.text===null||S.text===void 0?void 0:String(S.text),I={color:S.color??C?.color,underlined:S.underlined??C?.underlined,strikethrough:S.strikethrough??C?.strikethrough,bold:S.bold??C?.bold,italic:S.italic??C?.italic};if(u=u||I.underlined||I.strikethrough||!1,M?.includes(`
287
- `))for(let B of M.split(`
288
- `))A(B,I),p+=r,h="";else M&&A(M,I);if(S.extra)for(let B of S.extra)y(B,I)},A=(S,C)=>{o||(o=S.trim()!==""),h+=S,g[p]=v.measureText(h).width;let M=C.color??i;M.startsWith("#")||(M=X6[M.toLowerCase()]||M),c.push({fontStyle:`${C.bold?"bold":""} ${C.italic?"italic":""}`,fillStyle:M,underlineStyle:C.underlined??!1,strikeStyle:C.strikethrough??!1,offset:p,text:S})};if(y(l),!u&&!l.toString().trim())return;let b=0,w=0;for(let{fillStyle:S,fontStyle:C,underlineStyle:M,strikeStyle:I,offset:B,text:H}of c){w!==B&&(b=0),w=B,v.fillStyle=S,v.textRendering="optimizeLegibility",v.font=`${C} ${r}px mojangles`;let G=g[B]??v.measureText(H).width,O=(t.width-G)/2+b;v.fillText(H,O,B),I&&(v.lineWidth=r/8,v.strokeStyle=S,v.beginPath(),v.moveTo(O,B-v.lineWidth*2.5),v.lineTo(O+v.measureText(H).width,B-v.lineWidth*2.5),v.stroke()),M&&(v.lineWidth=r/8,v.strokeStyle=S,v.beginPath(),v.moveTo(O,B+v.lineWidth),v.lineTo(O+v.measureText(H).width,B+v.lineWidth),v.stroke()),b+=v.measureText(H).width}return o};E();x();k();R();function Ht(n){let e=Math.floor(n.x/16),t=Math.floor(n.z/16);return[e,t]}function Qr(n){let e=Math.floor(n.x/16),t=Math.floor(n.y/16),r=Math.floor(n.z/16);return[e,t,r]}E();x();k();R();import{Vec3 as p1}from"vec3";import{subscribeKey as qr}from"valtio/utils";import{proxy as i7,subscribe as n7}from"valtio";E();x();k();R();var at={blocks:"blocksArray",blockCollisionShapes:"blockCollisionShapes",biomes:"biomesArray",tints:"tints"};E();x();k();R();var Es=16;var xs=(n,e)=>e?`${n}:${e}`:String(n);E();x();k();R();var Rs=0,x0={},Kr=40,vt="mc-renderer-debug-overlay",lt=(n,e=80,t=Rs,r=Kr,i)=>{if(ae)return{updateText(){},setVisibility(){}};let s=document.createElement("div");return s.style.position="fixed",s.style.top=`${r??Kr}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),x0[n]=s,r===void 0&&t===Rs&&(Kr+=20),{updateText(o){s.innerText!==o&&(s.innerText=o)},setVisibility(o){s.style.display=o?"block":"none"}}};var Jr=(n,e)=>{ae||!x0[n]||(x0[n].innerText=e)},ks=n=>{if(!ae)for(let e in x0)x0[e].style.display=n?"block":"none"},Ts=()=>{if(!ae)for(let n in x0)$6(n)},$6=n=>{ae||!x0[n]||(x0[n].remove(),delete x0[n])};E();x();k();R();var e7=n=>{let e=n%24e3/24e3-.25;return e<0&&(e+=1),e>1&&(e-=1),e+(1-Math.cos(e*Math.PI))/2},t7=n=>{let e=(n%24e3+24e3)%24e3,t=e7(e),i=Math.cos(t*Math.PI*2)*.5+.5,s=Math.round(4+i*11);return Math.max(4,Math.min(15,s))},Zr=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)}}},r7=()=>{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=t7(e),i=Zr(e)}};typeof window<"u"&&(window.debugSkyLight=r7);E();x();k();R();function Ue(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 Ms(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 x5(n,e){return(n%e+e)%e}var R0=class R0{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,"worldSizeParams",{minY:0,worldHeight:256});d(this,"reactiveDebugParams",i7({stopRendering:!1,chunksRenderAboveOverride:void 0,chunksRenderAboveEnabled:!1,chunksRenderBelowOverride:void 0,chunksRenderBelowEnabled:!1,chunksRenderDistanceOverride:void 0,chunksRenderDistanceEnabled:!1,disableEntities:!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 Z0);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,"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.snapshotInitialValues(),this.worldRendererConfig=t.inWorldRenderingConfig,this.playerStateReactive=t.playerStateReactive,this.playerStateUtils=U2(this.playerStateReactive),this.reactiveState=t.rendererState,this.renderUpdateEmitter.on("update",()=>{let o=Object.keys(this.finishedChunks).length;Jr("loaded-chunks",`${o}/${this.chunksLength} chunks (${this.lastChunkDistance}/${this.viewDistance})`)}),lt("downloaded-chunks",100,140,20,{className:vt}),this.connect(this.displayOptions.worldView);let i=setInterval(()=>{this.geometryReceiveCountPerSec=Object.values(this.geometryReceiveCount).reduce((o,a)=>o+a,0),this.geometryReceiveCount={},ks(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()};Ms(this.resourcesManager,"assetsTexturesUpdated",e,this.abortController.signal),this.watchReactivePlayerState(),this.watchReactiveConfig(),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 p1(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=xs(t,s),a=this.blockStateModelInfo.get(o);return{customBlockName:s,modelInfo:a}}initWorkers(e=this.worldRendererConfig.mesherWorkers){for(let t=0;t<e+0;t++){let r=s7(i=>{Array.isArray(i)?this.messageQueue.push(...i):this.messageQueue.push(i),this.processMessageQueue("worker")},this.worldRendererConfig.wasmMesher?"mesherWasm.js":"mesher.js");this.workers.push(r)}}onReactivePlayerStateUpdated(e,t,r=!0){return r&&t(this.playerStateReactive[e]),qr(this.playerStateReactive,e,t)}onReactiveConfigUpdated(e,t){t(this.worldRendererConfig[e]),e==="*"?n7(this.worldRendererConfig,t):qr(this.worldRendererConfig,e,t)}onReactiveDebugUpdated(e,t){t(this.reactiveDebugParams[e]),qr(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=>{u1({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 p1(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 a=!0,v=this.getSectionHeight();for(let l=this.worldMinYRender;l<this.worldSizeParams.worldHeight;l+=v)if(!this.finishedSections[`${s[0]},${l},${s[2]}`]){a=!1;break}if(a){this.finishedChunks[o]=!0;let l=16,c=`${Math.floor(s[0]/l)},${Math.floor(s[2]/l)}`;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 a=++this.workersPhaseSampleCount;this.workersPreAverageTime=(this.workersPreAverageTime*(a-1)+t.pre)/a,this.workersWasmAverageTime=(this.workersWasmAverageTime*(a-1)+t.wasm)/a,this.workersPostAverageTime=(this.workersPostAverageTime*(a-1)+t.post)/a;let v=typeof t.preTargetConvert=="number"?t.preTargetConvert:0,l=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,g=typeof t.preCacheMisses=="number"?t.preCacheMisses:0;if(this.workersPreTargetConvertAverageTime=(this.workersPreTargetConvertAverageTime*(a-1)+v)/a,this.workersPreNeighborConvertAverageTime=(this.workersPreNeighborConvertAverageTime*(a-1)+l)/a,this.workersPreNeighborCountAverage=(this.workersPreNeighborCountAverage*(a-1)+c)/a,this.workersPreTypedArrayBuildAverageTime=(this.workersPreTypedArrayBuildAverageTime*(a-1)+u)/a,this.workersPreOtherAverageTime=(this.workersPreOtherAverageTime*(a-1)+h)/a,this.workersPreCacheHitsTotal+=p,this.workersPreCacheMissesTotal+=g,this.worldRendererConfig.debugWasmPerf&&a%R0.PHASE_PERF_LOG_INTERVAL===0){let y=this.workersPreAverageTime+this.workersWasmAverageTime+this.workersPostAverageTime,A=y>0?this.workersPreAverageTime/y*100:0,b=y>0?this.workersWasmAverageTime/y*100:0,w=y>0?this.workersPostAverageTime/y*100:0,S=this.workersPreAverageTime,C=S>0?this.workersPreTargetConvertAverageTime/S*100:0,M=S>0?this.workersPreNeighborConvertAverageTime/S*100:0,I=S>0?this.workersPreTypedArrayBuildAverageTime/S*100:0,B=S>0?this.workersPreOtherAverageTime/S*100:0,H=this.workersPreNeighborCountAverage,G=H>0?this.workersPreNeighborConvertAverageTime/H:0,O=this.workersPreCacheHitsTotal+this.workersPreCacheMissesTotal,j=O>0?this.workersPreCacheHitsTotal/O*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}}}downloadMesherLog(){let e=document.createElement("a");e.href="data:text/plain;charset=utf-8,"+encodeURIComponent(this.mesherLogger.contents.join(`
289
- `)),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]=Ht(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.sendMesherMcData()}getMesherConfig(){let e=this.timeOfTheDay,t=e<0||e>24e3?15:Zr(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;Cs(this.workers,this.version,at,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 Es}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,Jr("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 l of this.workers)l.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);let a=this.getSectionHeight(),v=16;for(let l=this.worldMinYRender;l<this.worldSizeParams.worldHeight;l+=a){let c=new p1(e,l,t);this.setSectionDirty(c),this.neighborChunkUpdates&&(!i||this.worldRendererConfig.smoothLighting)&&(this.setSectionDirty(c.offset(-v,0,0)),this.setSectionDirty(c.offset(v,0,0)),this.setSectionDirty(c.offset(0,0,-v)),this.setSectionDirty(c.offset(0,0,v)))}}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 a;delete this.loadedChunks[`${e},${t}`];let r=`${e},${t}`,i=this.heightmapDebounceTimers.get(r);i&&(clearTimeout(i),this.heightmapDebounceTimers.delete(r));for(let[v,l]of this.sectionDirtyTimers)v.startsWith(`${e},`)&&v.endsWith(`,${t}`)&&(clearTimeout(l),this.sectionDirtyTimers.delete(v),this.sectionDirtyCount.delete(v),this.sectionDirtyPendingArgs.delete(v));for(let v=0;v<this.workers.length;v++)(a=this.toWorkerMessagesQueue)[v]??(a[v]=[]),this.toWorkerMessagesQueue[v].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 v=this.worldMinYRender;v<this.worldSizeParams.worldHeight;v+=s){let l=`${e},${v},${t}`,c=this.sectionsWaiting.get(l);c!==void 0&&c>0,this.sectionsWaiting.delete(l),delete this.finishedSections[l]}this.highestBlocksByChunks.delete(`${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,a=Math.floor(e.z/16)*16;this.queuedChunks.has(`${o},${a}`)&&await new Promise(v=>{this.queuedFunctions.push(()=>{v()})}),this.loadedChunks[`${o},${a}`],this.setBlockStateIdInner(e,t,r)})()}updateEntity(e,t=!1){}lightUpdate(e,t){}connect(e){let t=e,r=this.abortController.signal;Ue(t,"entity",s=>{this.updateEntity(s,!1)},r),Ue(t,"entityMoved",s=>{this.updateEntity(s,!0)},r),Ue(t,"playerEntity",s=>{this.updatePlayerEntity?.(s)},r);let i=null;Ue(t,"loadChunk",({x:s,z:o,chunk:a,worldConfig:v,isLightUpdate:l})=>{this.worldSizeParams=v,this.queuedChunks.add(`${s},${o}`);let c=[s,o,a,l];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),Ue(t,"blockEntities",s=>{this.blockEntities=s},r),Ue(t,"unloadChunk",({x:s,z:o})=>{this.removeColumn(s,o)},r),Ue(t,"blockUpdate",({pos:s,stateId:o})=>{this.setBlockStateId(new p1(s.x,s.y,s.z),o)},r),Ue(t,"chunkPosUpdate",({pos:s})=>{this.updateViewerPosition(s)},r),Ue(t,"end",()=>{this.worldStop?.()},r),Ue(t,"renderDistance",s=>{this.viewDistance=s,this.chunksLength=s===0?1:d5(s).length,this.allChunksFinished=Object.keys(this.finishedChunks).length===this.chunksLength,this.onRenderDistanceChanged?.(s)},r),Ue(t,"markAsLoaded",({x:s,z:o})=>{this.markAsLoaded(s,o)},r),Ue(t,"updateLight",({pos:s})=>{this.lightUpdate(s.x,s.z)},r),Ue(t,"onWorldSwitch",()=>{for(let s of this.onWorldSwitched)try{s()}catch(o){setTimeout(()=>{throw o},0)}},r),Ue(t,"time",s=>{this.worldRendererConfig.dayCycle&&(this.timeUpdated?.(s),this.timeOfTheDay=s)},r),Ue(t,"biomeUpdate",({biome:s})=>{this.biomeUpdated?.(s)},r),Ue(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}`,a=this.protocolCustomBlocks.get(s)||{};for(let v of this.workers)v.postMessage({type:"blockUpdate",pos:e,stateId:t,customBlockModels:a});if(this.anyModuleRequiresHeightmap()){let v=Math.floor(e.x/16)*16,l=Math.floor(e.z/16)*16,c=`${v},${l}`;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:v,z:l})},100))}}if(this.logWorkerWork(`-> blockUpdate ${JSON.stringify({pos:e,stateId:t,customBlockModels:a})}`),this.setSectionDirty(e,!0,!0),this.neighborChunkUpdates){let l=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&l-1||this.setSectionDirty(e.offset(0,-l,0),!0,!0),(e.y&l-1)===l-1&&this.setSectionDirty(e.offset(0,l,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&l-1)&&this.setSectionDirty(e.offset(-16,-l,0),!0,!0),(e.x&15)===15&&!(e.y&l-1)&&this.setSectionDirty(e.offset(16,-l,0),!0,!0),!(e.z&15)&&!(e.y&l-1)&&this.setSectionDirty(e.offset(0,-l,-16),!0,!0),(e.z&15)===15&&!(e.y&l-1)&&this.setSectionDirty(e.offset(0,-l,16),!0,!0),!(e.y&l-1)&&!(e.x&15)&&!(e.z&15)&&this.setSectionDirty(e.offset(-16,-l,-16),!0,!0),!(e.y&l-1)&&(e.x&15)===15&&!(e.z&15)&&this.setSectionDirty(e.offset(16,-l,-16),!0,!0),!(e.y&l-1)&&!(e.x&15)&&(e.z&15)===15&&this.setSectionDirty(e.offset(-16,-l,16),!0,!0),!(e.y&l-1)&&(e.x&15)===15&&(e.z&15)===15&&this.setSectionDirty(e.offset(16,-l,16),!0,!0))}}getWorkerNumber(e,t=!1){let i=this.getSectionHeight();if(this.worldRendererConfig.dedicatedChangeWorker&&this.workers.length>1){if(this.worldRendererConfig.wasmMesher)return x5(Math.floor(e.x/16)+Math.floor(e.z/16),this.workers.length);if(t){let a=`${Math.floor(e.x/16)*16},${Math.floor(e.y/i)*i},${Math.floor(e.z/16)*16}`;if(this.sectionsWaiting.get(a)&&!this.finishedSections[a]){let l=this.workers.length-1;return x5(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),l)}return this.workers.length-1}let o=this.workers.length-1;return x5(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),o)}if(this.worldRendererConfig.wasmMesher)return x5(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 x5(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(),a=`${Math.floor(e.x/s)*s},${Math.floor(e.y/o)*o},${Math.floor(e.z/s)*s}`,v=(this.sectionDirtyCount.get(a)??0)+1;this.sectionDirtyCount.set(a,v),v<=R0.GEOMETRY_THROTTLE_THRESHOLD?(this._dispatchDirtyImmediate(e,t,r),this.sectionDirtyTimers.has(a)||this.sectionDirtyTimers.set(a,setTimeout(()=>{let l=this.sectionDirtyPendingArgs.get(a);this.sectionDirtyCount.delete(a),this.sectionDirtyTimers.delete(a),this.sectionDirtyPendingArgs.delete(a),l&&this._dispatchDirtyImmediate(l.pos,l.value,l.useChangeWorker)},R0.GEOMETRY_THROTTLE_DELAY))):(this.sectionDirtyPendingArgs.set(a,{pos:e,value:t,useChangeWorker:r}),this.sectionDirtyTimers.has(a)||this.sectionDirtyTimers.set(a,setTimeout(()=>{let l=this.sectionDirtyPendingArgs.get(a);this.sectionDirtyCount.delete(a),this.sectionDirtyTimers.delete(a),this.sectionDirtyPendingArgs.delete(a),l&&this._dispatchDirtyImmediate(l.pos,l.value,l.useChangeWorker)},R0.GEOMETRY_THROTTLE_DELAY)))}_dispatchDirtyImmediate(e,t,r){var v;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 a=this.getWorkerNumber(e,r&&(this.mesherLogger.active||this.worldRendererConfig.dedicatedChangeWorker));this.sectionsWaiting.set(o,(this.sectionsWaiting.get(o)??0)+1),this.forceCallFromMesherReplayer?this.workers[a].postMessage({type:"dirty",x:e.x,y:e.y,z:e.z,value:t,config:this.getMesherConfig()}):((v=this.toWorkerMessagesQueue)[a]??(v[a]=[]),this.toWorkerMessagesQueue[a].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(),Ts()}};d(R0,"PHASE_PERF_LOG_INTERVAL",64),d(R0,"GEOMETRY_THROTTLE_THRESHOLD",1),d(R0,"GEOMETRY_THROTTLE_DELAY",100);var g1=R0,s7=(n,e="mesher.js")=>{let t;if(D.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},Ss=!1,Cs=(n,e,t=at,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&&!Ss&&(Ss=!0);for(let s of n)s.postMessage({type:"mcData",mcData:i})},Xr=(n,e,t=at,r,i=1e4)=>Promise.all(n.map(s=>new Promise((o,a)=>{let v=setTimeout(()=>{s.removeEventListener("message",l),a(new Error(`mcData transfer timeout (${i}ms)`))},i),l=({data:c})=>{c?.type==="mcDataApplied"&&(clearTimeout(v),s.removeEventListener("message",l),o())};s.addEventListener("message",l),Cs([s],e,t,r)}))).then(()=>{});E();x();k();R();import{Vec3 as o7}from"vec3";import*as r0 from"three";E();x();k();R();function b1(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,a=(s+2)%3,v=[[0,0,0],[0,0,0],[0,0,0]];return v[s][s]=1,v[o][o]=r,v[o][a]=-i,v[a][o]=+i,v[a][a]=r,v}function $r(n,e){return e?[n[0]+e[0],n[1]+e[1],n[2]+e[2]]:n}function ei(n,e){return e?[n[0]-e[0],n[1]-e[1],n[2]-e[2]]:n}function Ot(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 Bs(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],a=n[1][1],v=n[2][1],l=n[0][2],c=n[1][2],u=n[2][2],h=e[0][0],p=e[1][0],g=e[2][0],y=e[0][1],A=e[1][1],b=e[2][1],w=e[0][2],S=e[1][2],C=e[2][2];return t[0][0]=r*h+i*y+s*w,t[1][0]=r*p+i*A+s*S,t[2][0]=r*g+i*b+s*C,t[0][1]=o*h+a*y+v*w,t[1][1]=o*p+a*A+v*S,t[2][1]=o*g+a*b+v*C,t[0][2]=l*h+c*y+u*w,t[1][2]=l*p+c*A+u*S,t[2][2]=l*g+c*b+u*C,t}var ti={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 a7(n,e,t,r,i,s,o,a){let v=new o7(0,0,0);for(let l in n.faces){let c=n.faces[l],{corners:u,mask1:h,mask2:p}=ti[l],g=Ot(r,ti[l].dir);if(c.cullface&&a[l])continue;let y=n.from[0],A=n.from[1],b=n.from[2],w=n.to[0],S=n.to[1],C=n.to[2],M=c.texture,{u:I}=M,{v:B}=M,{su:H}=M,{sv:G}=M,O=Math.floor(t.positions.length/3),j=[1,1,1];c.tintindex!==void 0&&c.tintindex===0&&(j=[.5686274509803921,.7411764705882353,.34901960784313724]);let J=c.rotation||0,Z=Math.cos(J*Math.PI/180),$=-Math.sin(J*Math.PI/180),ue=null,le=null;n.rotation&&(ue=b1(n.rotation.axis,n.rotation.angle),le=ei(n.rotation.origin,Ot(ue,n.rotation.origin)));let ce=[],Ee=1;for(let Ie of u){let se=[Ie[0]?w:y,Ie[1]?S:A,Ie[2]?C:b];se=$r(Ot(ue,se),le),se=$r(Ot(r,se),i),se=se.map(Je=>Je/16),t.positions.push(se[0],se[1],se[2]),t.normals.push(...g);let Y=(Ie[3]-.5)*Z-(Ie[4]-.5)*$+.5,oe=(Ie[3]-.5)*$+(Ie[4]-.5)*Z+.5;t.uvs.push(Y*H+I,oe*G+B);let xe=1;e&&(xe=4/4*(15/15),ce.push(3)),t.colors.push(Ee*j[0]*xe,Ee*j[1]*xe,Ee*j[2]*xe)}e&&ce[0]+ce[3]>=ce[1]+ce[2]?t.indices.push(O,O+3,O+2,O,O+1,O+3):t.indices.push(O,O+1,O+2,O+2,O+1,O+3)}}var v7=(n,e,t,r,i=[],s={})=>{let l={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 g=null,y=null;for(let b of["x","y","z"])b in p&&(g?g=Bs(g,b1(b,-(p[b]??0))):g=b1(b,-(p[b]??0)));g&&(y=[8,8,8],y=ei(y,Ot(g,y)));let A=p.ao??!0;for(let b of p.elements??[])a7(b,A,l,g,y,e,t,s)}let c=l.positions.length/3;for(let u=0;u<l.t_positions.length/12;u++)l.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 l.positions.push(...l.t_positions),l.normals.push(...l.t_normals),l.colors.push(...l.t_colors),l.uvs.push(...l.t_uvs),delete l.t_positions,delete l.t_normals,delete l.t_colors,delete l.t_uvs,l.positions=new Float32Array(l.positions),l.normals=new Float32Array(l.normals),l.colors=new Float32Array(l.colors),l.uvs=new Float32Array(l.uvs),l},l7=(...n)=>{let t={geometry:v7(...n)},r=new r0.BufferGeometry;return r.setAttribute("position",new r0.BufferAttribute(t.geometry.positions,3)),r.setAttribute("normal",new r0.BufferAttribute(t.geometry.normals,3)),r.setAttribute("color",new r0.BufferAttribute(t.geometry.colors,3)),r.setAttribute("uv",new r0.BufferAttribute(t.geometry.uvs,2)),r.setIndex(t.geometry.indices),r.name="block-geometry",r},ri=(n,...e)=>{let t=l7(...e),r=new r0.Mesh(t,n);r.position.set(-.5,-.5,-.5);let i=new r0.Group;return i.add(r),i.rotation.set(0,-r0.MathUtils.degToRad(90),0,"ZYX"),globalThis.mesh=i,i},Ps=(n,e)=>{n.position.set(e.x+.5,e.y+.5,e.z+.5)};E();x();k();R();import*as De from"three";var R5=async(n,e)=>{let t;if(!n&&!e){let{canvas:l}=await y0($e);t=new De.CanvasTexture(l)}else{if(n||(n=await H0(e,"skin")),!n)return;let{canvas:l}=await y0(n);t=new De.CanvasTexture(l)}t.magFilter=De.NearestFilter,t.minFilter=De.NearestFilter;let r=!1,s=c7(40,16,r?-2:-3,-2,-2,r?3:4,12,4,64,64),o=new De.MeshStandardMaterial;o.map=t,o.needsUpdate=!0;let a=new De.Mesh(s,o),v=new De.Group;return v.add(a),v};function c7(n,e,t,r,i,s,o,a,v,l,c=!1){let u=t/16,h=r/16,p=i/16,g=(t+s)/16,y=(r+o)/16,A=(i+a)/16;c&&([u,g]=[g,u]);let b=[[u,h,p],[g,h,p],[g,y,p],[u,y,p],[u,h,A],[g,h,A],[g,y,A],[u,y,A]],w=n,S=n+a,C=n+a+s,M=n+a+s+s,I=n+a+s+a,B=n+a+s+a+s,H=e,G=e+a,O=e+a+o,j=[{vi:[5,4,0,1],uv:[S,H,C,G],n:[0,-1,0]},{vi:[2,3,7,6],uv:[C,G,M,H],n:[0,1,0]},{vi:[0,4,7,3],uv:[w,G,S,O],n:[-1,0,0]},{vi:[1,0,3,2],uv:[S,G,C,O],n:[0,0,-1]},{vi:[5,1,2,6],uv:[C,G,I,O],n:[1,0,0]},{vi:[4,5,6,7],uv:[I,G,B,O],n:[0,0,1]}],J=[],Z=[],$=[],ue=[];for(let ce=0;ce<j.length;ce++){let Ee=j[ce],Ie=ce*4,[se,Y,oe,xe]=Ee.uv,Je=[[oe/v,1-Y/l],[se/v,1-Y/l],[se/v,1-xe/l],[oe/v,1-xe/l]],Ne=c?[3,2,1,0]:[0,1,2,3],n0=c?-Ee.n[0]:Ee.n[0];for(let _e=0;_e<4;_e++){let f0=b[Ee.vi[Ne[_e]]];J.push(f0[0],f0[1],f0[2]),Z.push(Je[_e][0],Je[_e][1]),$.push(n0,Ee.n[1],Ee.n[2])}ue.push(Ie,Ie+1,Ie+2,Ie,Ie+2,Ie+3)}let le=new De.BufferGeometry;return le.setAttribute("position",new De.Float32BufferAttribute(J,3)),le.setAttribute("uv",new De.Float32BufferAttribute(Z,2)),le.setAttribute("normal",new De.Float32BufferAttribute($,3)),le.setIndex(ue),le}E();x();k();R();E();x();k();R();import*as Se from"three";E();x();k();R();E();x();k();R();var O0=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)}},ii=class extends O0{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 ni(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 d7={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:ni,toHexString:ni},T5={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},u7={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,t=1){let r=T5.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 T5.toHexString(i)}},f7={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,t=1){let r=T5.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 T5.toHexString(i)}},h7=[d7,T5,u7,f7];function m7(n){return h7.find(e=>e.match(n))}var si=class extends O0{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=m7(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=ni(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}},k5=class extends O0{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}},oi=class extends O0{constructor(e,t,r,i,s,o){super(e,t,r,"number"),this._initInput(),this.min(i),this.max(s);let a=o!==void 0;this.step(a?o:this._getImplicitStep(),a),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 w=parseFloat(this.$input.value);isNaN(w)||(this._stepExplicit&&(w=this._snap(w)),this.setValue(this._clamp(w)))},r=w=>{let S=parseFloat(this.$input.value);isNaN(S)||(this._snapClampSetValue(S+w),this.$input.value=this.getValue())},i=w=>{w.key==="Enter"&&this.$input.blur(),w.code==="ArrowUp"&&(w.preventDefault(),r(this._step*this._arrowKeyMultiplier(w))),w.code==="ArrowDown"&&(w.preventDefault(),r(this._step*this._arrowKeyMultiplier(w)*-1))},s=w=>{this._inputFocused&&(w.preventDefault(),r(this._step*this._normalizeMouseWheel(w)))},o=!1,a,v,l,c,u,h=5,p=w=>{a=w.clientX,v=l=w.clientY,o=!0,c=this.getValue(),u=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",y)},g=w=>{if(o){let S=w.clientX-a,C=w.clientY-v;Math.abs(C)>h?(w.preventDefault(),this.$input.blur(),o=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(S)>h&&y()}if(!o){let S=w.clientY-l;u-=S*this._step*this._arrowKeyMultiplier(w),c+u>this._max?u=this._max-c:c+u<this._min&&(u=this._min-c),this._snapClampSetValue(c+u)}l=w.clientY},y=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",y)},A=()=>{this._inputFocused=!0},b=()=>{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",A),this.$input.addEventListener("blur",b)}_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=(b,w,S,C,M)=>(b-w)/(S-w)*(M-C)+C,t=b=>{let w=this.$slider.getBoundingClientRect(),S=e(b,w.left,w.right,this._min,this._max);this._snapClampSetValue(S)},r=b=>{this._setDraggingStyle(!0),t(b.clientX),window.addEventListener("mousemove",i),window.addEventListener("mouseup",s)},i=b=>{t(b.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",s)},o=!1,a,v,l=b=>{b.preventDefault(),this._setDraggingStyle(!0),t(b.touches[0].clientX),o=!1},c=b=>{b.touches.length>1||(this._hasScrollBar?(a=b.touches[0].clientX,v=b.touches[0].clientY,o=!0):l(b),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",h))},u=b=>{if(o){let w=b.touches[0].clientX-a,S=b.touches[0].clientY-v;Math.abs(w)>Math.abs(S)?l(b):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",h))}else b.preventDefault(),t(b.touches[0].clientX)},h=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",h)},p=this._callOnFinishChange.bind(this),g=400,y,A=b=>{if(Math.abs(b.deltaX)<Math.abs(b.deltaY)&&this._hasScrollBar)return;b.preventDefault();let S=this._normalizeMouseWheel(b)*this._step;this._snapClampSetValue(this.getValue()+S),this.$input.value=this.getValue(),clearTimeout(y),y=setTimeout(p,g)};this.$slider.addEventListener("mousedown",r),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",A,{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}},ai=class extends O0{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}},vi=class extends O0{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}},p7=`.lil-gui {
308
+ `;Ut=6;gt={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,TRANSPARENT_SHIFT:31},V3={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,SPARE_BITS:1},Ll={SECTION_BITS:22,SECTION_MASK:(1<<22)-1,LO_BITS:16,HI_BITS:6,SECTION_BIAS:2097152}});var wi,W3=Ne(()=>{"use strict";E();x();k();R();wi=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 bt from"three";var Ai,N3=Ne(()=>{"use strict";E();x();k();R();Ai=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),v=`${i}:${s}`,a=this.categoryBiomeToIndex.get(v);if(a!==void 0)return a;let l=this.colorToIndex.get(o);if(l!==void 0)return this.categoryBiomeToIndex.set(v,l),l;let c=this.entries.length;return this.entries.push({r:e,g:t,b:r}),this.colorToIndex.set(o,c),this.categoryBiomeToIndex.set(v,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 bt.DataTexture(e,256,1,bt.RGBAFormat,bt.FloatType);return t.minFilter=bt.NearestFilter,t.magFilter=bt.NearestFilter,t.wrapS=bt.ClampToEdgeWrapping,t.wrapT=bt.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,v=(i&255)/255;return[s,o,v]}if(e.grass){let i=r(e.grass.default);for(let{keys:s,color:o}of e.grass.data??[]){let v=r(o);for(let a of s)t.add(v[0],v[1],v[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 v=r(o);for(let a of s)t.add(v[0],v[1],v[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 v=r(o);for(let a of s)t.add(v[0],v[1],v[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 v=r(o);for(let a of s)t.add(v[0],v[1],v[2],"constant",a)}t.add(i[0],i[1],i[2],"constant","default")}return t}}});import j3 from"mc-assets/dist/blocksAtlases.json";function Hl(){let n=globalThis.loadedData?.tints;return n||(Q3||(Q3=!0),null)}function xi(){let n=Hl();if(!n)return null;if(Ei||(Ei=Ai.fromTintsData(n),Ei.createTexture()),!y1){let e=j3.latest??j3;y1=new wi({width:e.width,height:e.height,tileSize:e.tileSize??16,suSv:e.suSv??16,textures:e.textures??{}})}return{tintPalette:Ei,textureIndexMapping:y1}}function Y3(){return 1<<V3.EMPTY_SHIFT>>>0}var o5,Ei,y1,Q3,a5=Ne(()=>{"use strict";E();x();k();R();Zt();W3();N3();o5=4,Ei=null,y1=null,Q3=!1});import*as Le from"three";function Ol(n,e){let t=new Le.InstancedBufferGeometry,r=new Float32Array(Ut*3);t.setAttribute("position",new Le.BufferAttribute(r,3));let i=new Uint32Array(e),s=new Uint32Array(e),o=new Uint32Array(e),v=new Uint32Array(e),a=o5;for(let l=0;l<e;l++)i[l]=n[l*a],s[l]=n[l*a+1],o[l]=n[l*a+2],v[l]=n[l*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(v,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 Dl(n){n.raycast=(e,t)=>{let{geometry:r}=n;if(!r.boundingBox||(K3.copy(r.boundingBox).applyMatrix4(n.matrixWorld),!e.ray.intersectBox(K3,_1)))return;let i=e.ray.origin.distanceTo(_1);t.push({distance:i,point:_1.clone(),object:n})}}function Ri(n,e){let t=Ol(n.words,n.count),r=new Le.Mesh(t,e);return r.name="shaderMesh",r.matrixAutoUpdate=!1,r.frustumCulled=!1,Dl(r),r}function w1(n){n.geometry.dispose()}var K3,_1,A1=Ne(()=>{"use strict";E();x();k();R();Zt();a5();K3=new Le.Box3,_1=new Le.Vector3});var e6={};hr(e6,{applyWorldGeometryExport:()=>Ul,createMeshesFromExport:()=>Z3,downloadWorldGeometry:()=>E1,exportWorldGeometry:()=>q3,loadTextureFromDataUrl:()=>$3,loadWorldGeometryFromUrl:()=>Fl});import*as He from"three";function q3(n,e,t,r=!1){let i=[],s=Ht(n.timeOfTheDay)/15,o=n.chunkMeshManager.globalLegacyBuffer;for(let[a,l]of Object.entries(n.sectionObjects)){let c=[],u=[],f=[],m=[],g=[],b=[],A=[],y=o?.getSectionGeometryData(a);y&&(c.push(...y.positions),f.push(...mi(y.colors,y.skyLights,y.blockLights,s)),m.push(...y.skyLights),g.push(...y.blockLights),b.push(...y.uvs),A.push(...y.indices));let _=l.children.find(M=>M.name==="mesh");if(_?.geometry){let{geometry:M}=_,C=M.getAttribute("position"),T=M.getAttribute("normal"),P=M.getAttribute("color"),B=M.getAttribute("a_skyLight"),L=M.getAttribute("a_blockLight"),G=M.getAttribute("uv"),H=M.index;if(C&&H&&P){let N=c.length/3,Y=C.count,q=Array.from(P.array),Z=B?Array.from(B.array):new Array(Y).fill(1),ae=L?Array.from(L.array):new Array(Y).fill(0);c.push(...Array.from(C.array)),T&&u.push(...Array.from(T.array)),f.push(...mi(q,Z,ae,s)),m.push(...Z),g.push(...ae),G&&b.push(...Array.from(G.array));for(let oe of Array.from(H.array))A.push(oe+N)}}c.length===0||A.length===0||i.push({key:a,position:{x:l.worldX??0,y:l.worldY??0,z:l.worldZ??0},geometry:{positions:c,normals:u,colors:f,skyLights:m,blockLights:g,uvs:b,indices:A}})}let v={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"),l=n.material.map,{image:c}=l;c&&(a.width=c.width,a.height=c.height,a.getContext("2d").drawImage(c,0,0),v.textureAtlasDataUrl=a.toDataURL("image/png"))}return v}function E1(n,e,t,r="world-geometry.json",i=!1){let s=q3(n,e,t,i),o=JSON.stringify(s),v=new Blob([o],{type:"application/json"}),a=URL.createObjectURL(v),l=document.createElement("a");l.href=a,l.download=r,l.click(),URL.revokeObjectURL(a)}async function Fl(n){let e=await fetch(n);if(!e.ok)throw new Error(`Failed to fetch world geometry: ${e.statusText}`);return e.json()}function X3(n,e){let t=n.map??n.map;if(!t)return null;let r=bi();r.uniforms.u_atlas.value=t,yi(r,e);let i=xi();if(!i)return null;let{tintPalette:s}=i;return s.isReady()||s.createTexture(),r.uniforms.u_tintPalette.value=s.getTexture(),r}function Z3(n,e,t,r=1){let i=[],s=t??X3(e,r);for(let o of n.sections){let v=new He.Group;if(v.name="chunk",o.geometry.positions.length>0&&o.geometry.indices.length>0){let c=new He.BufferGeometry;if(c.setAttribute("position",new He.Float32BufferAttribute(o.geometry.positions,3)),o.geometry.normals.length&&c.setAttribute("normal",new He.Float32BufferAttribute(o.geometry.normals,3)),o.geometry.colors.length){let g=o.geometry.skyLights?.length?mi(o.geometry.colors,o.geometry.skyLights,o.geometry.blockLights,r):o.geometry.colors;c.setAttribute("color",new He.Float32BufferAttribute(g,3))}o.geometry.uvs.length&&c.setAttribute("uv",new He.Float32BufferAttribute(o.geometry.uvs,2));let f=Math.max(...o.geometry.indices)>65535?Uint32Array:Uint16Array;c.setIndex(new He.BufferAttribute(new f(o.geometry.indices),1));let m=new He.Mesh(c,e);m.position.set(o.position.x,o.position.y,o.position.z),m.name="mesh",v.add(m)}let l=o.shaderCubes;if(l&&l.count>0&&s){let c=Ri(l,s);c.position.set(o.position.x,o.position.y,o.position.z),v.add(c)}v.children.length>0&&i.push(v)}return i}async function $3(n){return new Promise((e,t)=>{let r=new Image;r.onload=()=>{let i=new He.Texture(r);i.magFilter=He.NearestFilter,i.minFilter=He.NearestFilter,i.needsUpdate=!0,i.flipY=!1,e(i)},r.onerror=t,r.src=n})}async function Ul(n,e){let{scene:t,renderUpdateEmitter:r,material:i}=n,s=t.getObjectByName(J3);s&&(t.remove(s),zl(s));let o=!!e.textureAtlasDataUrl,v;if(o&&e.textureAtlasDataUrl){let f=await $3(e.textureAtlasDataUrl);v=new He.MeshLambertMaterial({map:f,vertexColors:!0,transparent:!0,alphaTest:.1}),v.name="geometry-export-material"}else v=i;let a=Ht(n.timeOfTheDay)/15,l=e.sections.some(f=>(f.shaderCubes?.count??0)>0)?X3(v,a):null,c=Z3(e,v,l,a),u=new He.Group;u.name=J3,o&&(u.userData.geometryExportMaterial=v);for(let f of c)u.add(f);return t.add(u),r.emit("update"),c.length}var J3,zl,x1=Ne(()=>{"use strict";E();x();k();R();Ir();U3();a5();Zt();A1();J3="geometry-export-root";zl=n=>{n.traverse(t=>{t.isMesh&&t.geometry?.dispose()});let e=n.userData?.geometryExportMaterial;e&&(e.map?.dispose?.(),e.dispose?.())}});E();x();k();R();E();x();k();R();E();x();k();R();E();x();k();R();import{proxy as A2}from"valtio";E();x();k();R();E();x();k();R();var Ki=()=>({longRenderTime:!1,constantLongRenderTime:!1,tooManyEntities:!1,tooManyTextures:!1,unknownReason:!1});E();x();k();R();var yr=30;var Ji=45,qi=100;E();x();k();R();var w5=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(f=>f>=30).length,v=s>=8&&o/s>=.65,a=e.loadedTextureCount>=100,l=t&&e.entitiesMs>=8&&r<=20,u=t&&!(i||v||l||a);this.factors.longRenderTime=i,this.factors.constantLongRenderTime=v,this.factors.tooManyEntities=l,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}};E();x();k();R();var c7=[{key:"longRenderTime",code:"LR"},{key:"constantLongRenderTime",code:"CLR"},{key:"tooManyEntities",code:"ENT"},{key:"tooManyTextures",code:"TEX"},{key:"unknownReason",code:"UNK"}];function Xi(n){let e=c7.filter(({key:t})=>n[t]).map(({code:t})=>t);return e.length>0?e.join("+"):""}var A5={paused:!1,showChunkBorders:!1,enableDebugOverlay:!1,debugWasmPerf:!1,debugModelVariant:void 0,futuristicReveal:!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,moduleStates:{}},E2={fpsLimit:void 0,sceneBackground:"lightblue",timeoutRendering:!1},zc=(n={})=>A2({...A5,...n}),v0=()=>({reactive:A2({world:{chunksLoaded:{},heightmaps:{},allChunksLoaded:!1,mesherWork:!1,instabilityFactors:Ki(),intersectMedia:null},renderer:"...",preventEscapeMenu:!1}),nonReactive:{fps:0,worstRenderTime:0,avgRenderTime:0,world:{chunksLoadedCount:0,chunksTotalNumber:0,chunksFullInfo:"-"},renderer:{timeline:{live:[],frozen:[],lastSecond:[]}}}});E();x();k();R();import{proxy as d7}from"valtio";var Zi=()=>d7({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}),x2=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"}}),R2=()=>({reactive:Zi()});E();x();k();R();import{Vec3 as x7}from"vec3";import{proxy as G2}from"valtio";E();x();k();R();E();x();k();R();E();x();k();R();E();x();k();R();var _r={},k2=!1;function u7(){if(k2)return _r;k2=!0;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(T,P,B){return Function.prototype.apply.call(T,P,B)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(T){return Object.getOwnPropertyNames(T).concat(Object.getOwnPropertySymbols(T))}:t=function(T){return Object.getOwnPropertyNames(T)};function r(C){}var i=Number.isNaN||function(T){return T!==T};function s(){s.init.call(this)}_r=s,_r.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function v(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");o=C}}),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(T){if(typeof T!="number"||T<0||i(T))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+T+".");return this._maxListeners=T,this};function a(C){return C._maxListeners===void 0?s.defaultMaxListeners:C._maxListeners}s.prototype.getMaxListeners=function(){return a(this)},s.prototype.emit=function(T){for(var P=[],B=1;B<arguments.length;B++)P.push(arguments[B]);var L=T==="error",G=this._events;if(G!==void 0)L=L&&G.error===void 0;else if(!L)return!1;if(L){var H;if(P.length>0&&(H=P[0]),H instanceof Error)throw H;var N=new Error("Unhandled error."+(H?" ("+H.message+")":""));throw N.context=H,N}var Y=G[T];if(Y===void 0)return!1;if(typeof Y=="function")e(Y,this,P);else for(var q=Y.length,Z=g(Y,q),B=0;B<q;++B)e(Z[B],this,P);return!0};function l(C,T,P,B){var L,G,H;if(v(P),G=C._events,G===void 0?(G=C._events=Object.create(null),C._eventsCount=0):(G.newListener!==void 0&&(C.emit("newListener",T,P.listener?P.listener:P),G=C._events),H=G[T]),H===void 0)H=G[T]=P,++C._eventsCount;else if(typeof H=="function"?H=G[T]=B?[P,H]:[H,P]:B?H.unshift(P):H.push(P),L=a(C),L>0&&H.length>L&&!H.warned){H.warned=!0;var N=new Error("Possible EventEmitter memory leak detected. "+H.length+" "+String(T)+" listeners added. Use emitter.setMaxListeners() to increase limit");N.name="MaxListenersExceededWarning",N.emitter=C,N.type=T,N.count=H.length}return C}s.prototype.addListener=function(T,P){return l(this,T,P,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(T,P){return l(this,T,P,!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(C,T,P){var B={fired:!1,wrapFn:void 0,target:C,type:T,listener:P},L=c.bind(B);return L.listener=P,B.wrapFn=L,L}s.prototype.once=function(T,P){return v(P),this.on(T,u(this,T,P)),this},s.prototype.prependOnceListener=function(T,P){return v(P),this.prependListener(T,u(this,T,P)),this},s.prototype.removeListener=function(T,P){var B,L,G,H,N;if(v(P),L=this._events,L===void 0)return this;if(B=L[T],B===void 0)return this;if(B===P||B.listener===P)--this._eventsCount===0?this._events=Object.create(null):(delete L[T],L.removeListener&&this.emit("removeListener",T,B.listener||P));else if(typeof B!="function"){for(G=-1,H=B.length-1;H>=0;H--)if(B[H]===P||B[H].listener===P){N=B[H].listener,G=H;break}if(G<0)return this;G===0?B.shift():b(B,G),B.length===1&&(L[T]=B[0]),L.removeListener!==void 0&&this.emit("removeListener",T,N||P)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(T){var P,B,L;if(B=this._events,B===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[T]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete B[T]),this;if(arguments.length===0){var G=Object.keys(B),H;for(L=0;L<G.length;++L)H=G[L],H!=="removeListener"&&this.removeAllListeners(H);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(P=B[T],typeof P=="function")this.removeListener(T,P);else if(P!==void 0)for(L=P.length-1;L>=0;L--)this.removeListener(T,P[L]);return this};function f(C,T,P){var B=C._events;if(B===void 0)return[];var L=B[T];return L===void 0?[]:typeof L=="function"?P?[L.listener||L]:[L]:P?A(L):g(L,L.length)}s.prototype.listeners=function(T){return f(this,T,!0)},s.prototype.rawListeners=function(T){return f(this,T,!1)},s.listenerCount=function(C,T){return typeof C.listenerCount=="function"?C.listenerCount(T):m.call(C,T)},s.prototype.listenerCount=m;function m(C){var T=this._events;if(T!==void 0){var P=T[C];if(typeof P=="function")return 1;if(P!==void 0)return P.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function g(C,T){for(var P=new Array(T),B=0;B<T;++B)P[B]=C[B];return P}function b(C,T){for(;T+1<C.length;T++)C[T]=C[T+1];C.pop()}function A(C){for(var T=new Array(C.length),P=0;P<T.length;++P)T[P]=C[P].listener||C[P];return T}function y(C,T){return new Promise(function(P,B){function L(H){C.removeListener(T,G),B(H)}function G(){typeof C.removeListener=="function"&&C.removeListener("error",L),P([].slice.call(arguments))}M(C,T,G,{once:!0}),T!=="error"&&_(C,L,{once:!0})})}function _(C,T,P){typeof C.on=="function"&&M(C,"error",T,P)}function M(C,T,P,B){if(typeof C.on=="function")B.once?C.once(T,P):C.on(T,P);else if(typeof C.addEventListener=="function")C.addEventListener(T,function L(G){B.once&&C.removeEventListener(T,L),P(G)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof C)}return _r}var wr=u7();wr.once;wr.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)})};wr.on=function(n,e){let t=[],r=[],i=null,s=!1,o={async next(){let l=t.shift();if(l)return createIterResult(l,!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,v),n.removeListener("error",a),s=!0;for(let l of r)l.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(l){i=l,n.removeListener(e,v),n.removeListener("error",a)},[Symbol.asyncIterator](){return this}};return n.on(e,v),n.on("error",a),o;function v(...l){let c=r.shift();c?c.resolve(createIterResult(l,!1)):t.push(l)}function a(l){s=!0;let c=r.shift();c?c.reject(l):i=l,o.return()}};var{EventEmitter:l0,defaultMaxListeners:td,init:rd,listenerCount:id,on:nd,once:sd}=wr;import{Vec3 as c0}from"vec3";E();x();k();R();function E5(n){let e=n*2+1;if(e<=0)return[];let t=[],r=0,i=0,s=0,o=-1;for(let v=0;v<e*e;v++){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}E();x();k();R();function $i(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=>$i(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=$i(r[s],e+1);o!==void 0&&(i[s]=o)}return i}function Ar(n){return n.map(e=>$i(e))}var z0=n=>[Math.floor(n.x/16),Math.floor(n.z/16)],f7=n=>[Math.floor(n.x/16),Math.floor(n.y/16),Math.floor(n.z/16)],T2=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)},F0=new WeakMap,x5=class x5 extends l0{static restoreTransferred(e,t){let r=new x5;if(!t)return r;let i=F0.get(t);if(i)i.activeWorldView=r;else{let s=({data:o})=>{let a=F0.get(t)?.activeWorldView;!a||o?.class!==x5.restorerName||o.type==="event"&&a.emit(o.eventName,...o.args)};t.addEventListener("message",s),i={activeWorldView:r,handler:s},F0.set(t,i)}return r}static clearWorkerBridgeForTest(e){let t=F0.get(e);t&&(e.removeEventListener("message",t.handler),F0.delete(e))}static getWorkerBridgeListenerCountForTest(e){return F0.has(e)?1:0}};d(x5,"restorerName","WorldViewWorker");var d0=x5,u0=class extends l0{constructor(t,r,i=new c0(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 c0(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:d0.restorerName,type:"event",eventName:i,args:Ar(s)})}}return{__restorer:d0.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]=z0(t),o=E5(this.viewDistance).map(([v,a])=>new c0((i+v)*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 T2(t,this.addWaitTime,async o=>{!s||this.loadedChunks[`${o.x},${o.z}`]||(this.world.getColumnAt(o)||(s=await new Promise(v=>{this.waitingSpiralChunksLoad[`${o.x},${o.z}`]=v})),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 l,c;let[s,o]=z0(this.lastPos),v=Math.abs(s-Math.floor(t.x/16)),a=Math.abs(o-Math.floor(t.z/16));if(v<=this.viewDistance&&a<=this.viewDistance){let u=await this.world.getColumnAt(t.y!==void 0?t:new c0(t.x,0,t.z));if(u){let f=u.toJson(),m={minY:u.minY??0,worldHeight:u.worldHeight??256};this.emit("loadChunk",{x:t.x,z:t.z,chunk:f,blockEntities:u.blockEntities,worldConfig:m,isLightUpdate:r}),this.loadedChunks[`${t.x},${t.z}`]=!0,(l=this.debugChunksInfo)[c=`${t.x},${t.z}`]??(l[c]={loads:[]}),this.debugChunksInfo[`${t.x},${t.z}`].loads.push({dataLength:f.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[v,a,l]=s.split(",").map(Number);return t.world.getBlock(new c0(v,a,l))?.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]=z0(this.lastPos),[v,a]=z0(t);if(s!==v||o!==a||r){this.emit("chunkPosUpdate",{pos:t});let l=[],c=r?this.viewDistance:this.viewDistance+this.keepChunksDistance;for(let f of Object.keys(this.loadedChunks)){let[m,g]=f.split(",").map(Number),b=new c0(m,0,g),[A,y]=z0(b),_=Math.abs(v-A),M=Math.abs(a-y);(_>c||M>c)&&l.push(b)}for(let f of l)this.unloadChunk(f);let u=E5(this.viewDistance).map(([f,m])=>{let g=new c0((v+f)*16,0,(a+m)*16);if(!this.loadedChunks[`${g.x},${g.z}`])return g}).filter(f=>!!f);this.lastPos.update(t),this._loadChunks(u,t)}else this.emit("chunkPosUpdate",{pos:t}),this.lastPos.update(t)}};E();x();k();R();E();x();k();R();import D2 from"minecraft-data";import h7 from"mc-assets/dist/blocksAtlases.json";import m7 from"mc-assets/dist/itemsAtlases.json";import vn from"mc-assets/dist/itemDefinitions.json";import p7 from"mc-assets/dist/blocksAtlasLatest.png";import g7 from"mc-assets/dist/blocksAtlasLegacy.png";import b7 from"mc-assets/dist/itemsAtlasLatest.png";import y7 from"mc-assets/dist/itemsAtlasLegacy.png";import _7 from"mc-assets/dist/textureReplacements/christmas";import{AtlasParser as f0}from"mc-assets/dist/atlasParser";import L2 from"mc-assets/dist/worldBlockProvider";E();x();k();R();var sn=y5(M2(),1);import*as Rr from"three";E();x();k();R();E();x();k();R();var Er=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,v=0;this.context&&(o=Math.min(o,e),v=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(v.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 S2=class xr{constructor({logsPerSecond:e=20,samplesLog:t=100,samplesGraph:r=10,precision:i=2,minimal:s=!1,horizontal:o=!0,mode:v=0}={}){this.mode=v,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 xr.Panel("FPS","#0ff","#002"),0),this.msPanel=this.addPanel(new xr.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=v,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 xr.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 v=0;v<t.logs.length;v++)r+=t.logs[v],t.logs[v]>i&&(i=t.logs[v]);let s=0,o=.01;for(let v=0;v<t.graph.length;v++)s+=t.graph[v],t.graph[v]>o&&(o=t.graph[v]);e&&e.update(r/Math.min(t.logs.length,this.samplesLog),s/Math.min(t.graph.length,this.samplesGraph),i,o,this.precision)}}};S2.Panel=Er;var C2=S2;E();x();k();R();var De=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-De.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?De.Bounce.In(n*2)*.5:De.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}}}}),R5=function(){return performance.now()},G0=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=R5()),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}(),U0={Linear:function(n,e){var t=n.length-1,r=t*e,i=Math.floor(r),s=U0.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=U0.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=U0.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=U0.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,v=i*i,a=i*v;return(2*e-2*t+s+o)*a+(-3*e+3*t-2*s-o)*v+s*i+e}}},B2=function(){function n(){}return n.nextId=function(){return n._nextId++},n._nextId=0,n}(),rn=new G0,ze=function(){function n(e,t){t===void 0&&(t=rn),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=De.Linear.None,this._interpolationFunction=U0.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=B2.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=R5()),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 v=e[o],a=Array.isArray(v),l=a?"array":typeof v,c=!a&&Array.isArray(r[o]);if(!(l==="undefined"||l==="function")){if(c){var u=r[o];if(u.length===0)continue;for(var f=[v],m=0,g=u.length;m<g;m+=1){var b=this._handleRelativeValue(v,u[m]);if(isNaN(b)){c=!1;break}f.push(b)}c&&(r[o]=f)}if((l==="object"||a)&&v&&!c){t[o]=a?[]:{};var A=v;for(var y in A)t[o][y]=A[y];i[o]=a?[]:{};var u=r[o];if(!this._isDynamic){var _={};for(var y in u)_[y]=u[y];r[o]=u=_}this._setupProperties(A,t[o],u,i[o],s)}else(typeof t[o]>"u"||s)&&(t[o]=v),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=R5()),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=R5()),!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=rn),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=De.Linear.None),this._easingFunction=e,this},n.prototype.interpolation=function(e){return e===void 0&&(e=U0.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=R5()),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 v=0,a=this._chainedTweens.length;v<a;v++)this._chainedTweens[v].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,v=r[s],a=Array.isArray(e[s]),l=Array.isArray(v),c=!a&&l;c?e[s]=this._interpolationFunction(v,i):typeof v=="object"&&v?this._updateProperties(e[s],o,v,i):(v=this._handleRelativeValue(o,v),typeof v=="number"&&(e[s]=o+(v-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 $d=B2.nextId,kt=rn,eu=kt.getAll.bind(kt),tu=kt.removeAll.bind(kt),ru=kt.add.bind(kt),iu=kt.remove.bind(kt),P2=kt.update.bind(kt);E();x();k();R();function nn(n){if(n==="high-performance")return"high-performance";if(n==="low-power")return"low-power"}var ce=typeof globalThis.WorkerGlobalScope<"u"&&globalThis instanceof globalThis.WorkerGlobalScope,on=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 sn.default,this.stats2=new sn.default,this.statsGl=new C2({minimal:!0}),this.stats2.showPanel(2),this.denseMode=typeof O<"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()}},k5=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 Rr.WebGLRenderer({canvas:this.canvas,preserveDrawingBuffer:!0,logarithmicDepthBuffer:!0,powerPreference:nn(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=Rr.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&&!ce&&(this.stats=new on(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=I2(),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(),P2(),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 I2(){let n=document.createElement("canvas");return n.id="viewer-canvas",document.body.appendChild(n),n}var an=()=>{let n=I2(),e=n.transferControlToOffscreen(),t=!1,r=(o,v)=>{},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 H2}from"mc-assets/dist/itemsRenderer";import{getLoadedItemDefinitionsStore as ln}from"mc-assets/dist/stores";var kr=null;function F2(n){return ce?((!kr||typeof kr.get!="function")&&(kr=ln(vn)),kr):(z2(n),n.itemsDefinitionsStore)}function z2(n){ce||typeof n.itemsDefinitionsStore?.get=="function"||(n.itemsDefinitionsStore=ln(n.sourceItemDefinitionsJson??vn))}var V0=class{constructor(e){d(this,"sourceItemDefinitionsJson",vn);d(this,"itemsDefinitionsStore",ln(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),z2(this)}if(this.version){let t=globalThis.loadedData??globalThis.mcData;ce&&t?.entitiesByName?this.mcData=t:this.mcData=D2(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}},O2="1.21.4",Nt=class Nt extends l0{constructor(){super(...arguments);d(this,"sourceBlockStatesModels",null);d(this,"sourceBlocksAtlases",h7);d(this,"sourceItemsAtlases",m7);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(ce&&!(!t.version||!t.blockstatesModels||!t.blocksAtlasJson)){if(this.blocksAtlasParser=new f0({latest:t.blocksAtlasJson},""),t.itemsAtlasJson)this.itemsAtlasParser=new f0({latest:t.itemsAtlasJson},"");else if(!this.itemsAtlasParser?.atlas?.latest){if(!this.sourceItemsAtlases||Object.keys(this.sourceItemsAtlases).length===0)return;this.itemsAtlasParser=new f0(this.sourceItemsAtlases,"")}t.itemsRenderer=new H2(t.version,t.blockstatesModels,this.itemsAtlasParser,this.blocksAtlasParser),t.worldBlockProvider=L2(t.blockstatesModels,this.blocksAtlasParser.atlas,O2)}}static restoreTransferred(t,r){let i=new Nt,s=o=>{i.currentResources=new V0(o),i.rebuildWorkerRenderers(i.currentResources)};return s(t.currentResources),r&&r.addEventListener("message",({data:o})=>{o.class===Nt.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:Nt.restorerName,type:"event",eventName:i,args:Ar(s)}),i==="assetsTexturesUpdated"||i==="assetsInventoryReady"){let o=this.enrichTransferSnapshot(this.currentResources?.prepareForTransfer());t.postMessage({class:Nt.restorerName,type:"newResources",currentResources:o})}}}return{__restorer:Nt.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 V0}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 V0;s.version=this.currentConfig.version,s.texturesVersion=this.currentConfig.texturesVersion??s.version,s.mcData=D2(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 H2(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,_7);let s=new f0(this.sourceBlocksAtlases,p7,g7),o=Object.keys(t.customTextures.blocks?.textures??{}),{atlas:v,canvas:a}=await s.makeNewAtlas(t.texturesVersion,l=>{if(this.currentConfig.includeOnlyBlocks&&!this.currentConfig.includeOnlyBlocks.includes(l))return!1;let c=t.customTextures.blocks?.textures[l];return r[l]??c},void 0,void 0,o,{needHorizontalIndexes:!!this.currentConfig.includeOnlyBlocks});this.blocksAtlasParser=new f0({latest:v},a.toDataURL()),t.blocksAtlasImage=await createImageBitmap(a),t.blocksAtlasJson=this.blocksAtlasParser.atlas.latest,t.worldBlockProvider=L2(t.blockstatesModels,this.blocksAtlasParser.atlas,O2)}async recreateItemsAtlas(t=this.currentResources){let r=new f0(this.sourceItemsAtlases,b7,y7),i=Object.keys(t.customTextures.items?.textures??{}),{atlas:s,canvas:o}=await r.makeNewAtlas(t.texturesVersion,v=>{let a=t.customTextures.items?.textures[v];if(a)return a},t.customTextures.items?.tileSize,void 0,i);this.itemsAtlasParser=new f0({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(Nt,"restorerName","ResourcesManager");var At=Nt;E();x();k();R();var ft=class extends Error{constructor(t,r){super(t);d(this,"failure");this.name="MesherWorkerPreloadError",this.failure=r}};function w7(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 A7=45e3,E7=1e4;async function U2(n){if(O.env.SINGLE_FILE_BUILD)return;let e=n?.fetchTimeoutMs??A7,t=n?.pingTimeoutMs??E7,r=n?.script??"mesher.js",i=new URL(r,document.baseURI).href,s;try{let u=new AbortController,f=window.setTimeout(()=>u.abort(),e);try{s=await fetch(i,{credentials:"same-origin",cache:"force-cache",signal:u.signal})}finally{clearTimeout(f)}}catch(u){let f=u;throw f?.name==="AbortError"?new ft(`Mesher script fetch timed out after ${e}ms (${i}).`,{phase:"fetch",code:"timeout"}):new ft(`Mesher script fetch failed (network): ${f?.message??u}. URL: ${i}`,{phase:"fetch",code:"network",detail:String(f?.message??u)})}if(!s.ok)throw new ft(`Mesher script HTTP ${s.status} ${s.statusText}: ${i}`,{phase:"fetch",code:"bad-status",status:s.status});let o=s.headers.get("content-type")??"",v=await s.arrayBuffer();if(v.byteLength===0)throw new ft(`Mesher script response was empty: ${i}`,{phase:"fetch",code:"invalid-body",hint:"empty"});let a=Math.min(1024,v.byteLength),l=new TextDecoder().decode(v.slice(0,a)).trimStart();if(l.startsWith("<!DOCTYPE")||l.startsWith("<html")||l.startsWith("<HTML"))throw new ft(`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 f=u instanceof Error?u.message:String(u);throw new ft(`Could not construct Worker for mesher (${i}): ${f}`,{phase:"worker",code:"construct-failed",message:f})}await new Promise((u,f)=>{let m=!1,g=window.setTimeout(()=>{m||(m=!0,b(),f(new ft(`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(g);let T=c;c=void 0,T&&(T.removeEventListener("message",_),T.removeEventListener("error",M),T.removeEventListener("messageerror",C),T.terminate())},A=()=>{m||(m=!0,b(),u())},y=T=>{m||(m=!0,b(),f(T))};function _(T){w7(T.data)&&A()}function M(T){y(new ft(`Mesher worker script failed to load or threw during startup: ${T.message||"unknown"} @ ${i}`,{phase:"worker",code:"script-error",message:T.message}))}function C(){y(new ft(`Mesher worker message channel error (structured clone / deserialization). URL: ${i}`,{phase:"ping",code:"messageerror"}))}c.addEventListener("message",_),c.addEventListener("error",M),c.addEventListener("messageerror",C);try{c.postMessage({type:"mc-web-ping",t:performance.now(),workerIndex:0})}catch(T){let P=T instanceof Error?T.message:String(T);y(new ft(`Failed to post mc-web-ping to mesher worker: ${P}`,{phase:"ping",code:"post-failed",detail:P}))}})}var V2=class{constructor(e={},t=new At){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:Zi()});d(this,"rendererState");d(this,"nonReactiveState");d(this,"worldReady");d(this,"resolveWorldReady");d(this,"lastCamUpdate",0);d(this,"getRendererOptions");this.config={...E2,...e.config},this.menuBackgroundOptions={...e.config?.menuBackground,...e.menuBackground},this.inWorldRenderingConfig=G2({...A5,...e.rendererConfig});let r=v0();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 U2({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 x7(0,64,0);this.worldView=new u0(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 v;if(this.backend){let a=this.backend.startWorld(o);a&&typeof a.then=="function"&&(v=a)}return this.currentState={method:"startWorld",args:[o]},await v,this.resolveWorldReady(),this.onWorldStart?.(),!!v}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=G2(v0().reactive),this.nonReactiveState=v0().nonReactive}updateCamera(e,t,r){this.backend?.updateCamera(e,t,r)}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)}};E();x();k();R();import{subscribe as H7}from"valtio/vanilla";E();x();k();R();E();x();k();R();var h0=["galaxy","nether","end","cyber","light"],m0=["cruise","barrel","dive","orbit","snake"],T5={galaxy:"Galaxy",nether:"Nether",end:"The End",cyber:"Cyber",light:"Light Space"},M5={cruise:"Cruise",barrel:"Barrel",dive:"Dive",orbit:"Orbit",snake:"Snake"},p0=["mixed","stainedGlass","wool","construction","glow","world"],S5={mixed:"Mixed",stainedGlass:"Stained glass",wool:"Wool",construction:"Construction",glow:"Glow",world:"World (grass & ores)"};E();x();k();R();var Tt={mode:"v2",minecraftTextures:!0,v2Scene:"light",v2Camera:"dive",v2BlockGroup:"stainedGlass",v2CameraSpeedPercent:80,v2BlockSpeedPercent:40},It=n=>n/100,C5={camera:It(Tt.v2CameraSpeedPercent),block:It(Tt.v2BlockSpeedPercent)};var R7={off:0,holes:1,texIndex:2,faces:3,atlasAlpha:4};function cn(n){return R7[n]}var g0=Tt,W2={rendererWorldPerformance:"normal",rendererMeshersCountOverride:null,starfieldRendering:!0,defaultSkybox:!0,menuBackgroundMode:g0.mode,menuBackgroundMinecraftTextures:g0.minecraftTextures,menuBackgroundV2Scene:g0.v2Scene,menuBackgroundV2Camera:g0.v2Camera,menuBackgroundV2BlockGroup:g0.v2BlockGroup,menuBackgroundV2CameraSpeed:g0.v2CameraSpeedPercent,menuBackgroundV2BlockSpeed:g0.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 k7(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 N2={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:h0.map(n=>[n,T5[n]])},menuBackgroundV2Camera:{possibleValues:m0.map(n=>[n,M5[n]])},menuBackgroundV2BlockGroup:{possibleValues:p0.map(n=>[n,S5[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"]]}},j2=[{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"]}];E();x();k();R();E();x();k();R();E();x();k();R();E();x();k();R();function dn(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let v=0;v<i;v++){let a=(o+v*r)*4;if(s.data[a+3]!==255)return!0}return!1}function Tr(n){return n/64}function Q2(n,e,t){if(t){if(dn(n,0,0,e,e))return}else if(dn(n,0,0,e,e/2))return;let r=Tr(e),i=(s,o,v,a)=>n.clearRect(s*r,o*r,v*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 T7(n,e){n.save(),n.scale(-1,1);let t=Tr(e),r=(i,s,o,v,a,l)=>n.drawImage(n.canvas,i*t,s*t,o*t,v*t,-a*t,l*t,-o*t,v*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 un(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),T7(r,i),Q2(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),Q2(r,n.width,!0)}function M7(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 fn(n,e){let t=M7(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 S7(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let v=0;v<i;v++){let a=(o+v*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 C7(n,e,t,r,i){let s=n.getImageData(e,t,r,i);for(let o=0;o<r;o++)for(let v=0;v<i;v++){let a=(o+v*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 hn(n){let e=Tr(n.width),t=n.getContext("2d",{willReadFrequently:!0}),r=(v,a,l,c)=>dn(t,v*e,a*e,l*e,c*e),i=(v,a,l,c)=>S7(t,v*e,a*e,l*e,c*e),s=(v,a,l,c)=>C7(t,v*e,a*e,l*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 mn(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=Tr(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)}E();x();k();R();import I7 from"mc-assets/dist/other-textures/latest/entity/player/wide/steve.png";E();x();k();R();import*as Et from"three";E();x();k();R();var B7=()=>{if(typeof OffscreenCanvas>"u")return!1;try{let n=new OffscreenCanvas(1,1);return(n.getContext("webgl2")||n.getContext("webgl"))!==null}catch{return!1}},P7=B7(),qe=(n,e)=>{if(P7||typeof document>"u")return new OffscreenCanvas(n,e);let t=document.createElement("canvas");return t.width=n,t.height=e,t};async function b0(n){let t=await(await fetch(n)).blob();return createImageBitmap(t)}var Te=(n,e=!1)=>{n instanceof Et.Mesh&&(n.geometry?.dispose?.(),n.material?.dispose?.()),n.children&&n.children.forEach(t=>Te(t,e)),e&&n instanceof Et.Mesh&&n.material?.map?.dispose?.()},pn={},Y2={},B5=n=>{let e=new Et.Texture,t=b0(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}},W0=async n=>B5(n).texture,jt=n=>{let e=qe(n.width,n.height);e.getContext("2d").drawImage(n,0,0);let r=new Et.Texture(e);return r.magFilter=Et.NearestFilter,r.minFilter=Et.NearestFilter,r};function N0(n){let{texture:e,promise:t}=B5(n);return e.magFilter=Et.NearestFilter,e.minFilter=Et.NearestFilter,t.catch(r=>{}),e}async function Mr(n,e,t){if(!pn[n]){let{promise:i,resolve:s}=Promise.withResolvers(),o=B5(n);pn[n]=o.texture,o.promise.then(s),Y2[n]=i}e(pn[n]),Y2[n].then(()=>{t?.()})}var st=I7,Eh=W0(st),K2={apiEnabled:!0},Sr=n=>{Object.assign(K2,n)};async function Qt(n,e){if(!K2.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 Mt(n){n.startsWith("data:")||(n=await L7(n.replace("http://","https://")));let e=await b0(n),t=qe(64,64);return un(t,e),{canvas:t,image:e}}var L7=async n=>{let t=await(await fetch(n,{})).arrayBuffer();return`data:image/png;base64,${D.from(t).toString("base64")}`};function Ih(n){return{mode:n.menuBackgroundMode,useMinecraftTextures:n.menuBackgroundMinecraftTextures,v2Scene:n.menuBackgroundV2Scene,v2Camera:n.menuBackgroundV2Camera,v2BlockGroup:n.menuBackgroundV2BlockGroup,v2CameraSpeed:It(n.menuBackgroundV2CameraSpeed),v2BlockSpeed:It(n.menuBackgroundV2BlockSpeed)}}function O7(n,e){let t=n.v2;t&&(t.setScene?.(e.menuBackgroundV2Scene),t.setCamera?.(e.menuBackgroundV2Camera),t.setBlockGroup?.(e.menuBackgroundV2BlockGroup),t.setCameraSpeed?.(It(e.menuBackgroundV2CameraSpeed)),t.setBlockSpeed?.(It(e.menuBackgroundV2BlockSpeed)))}function D7(n){return n.rendererMesher!=="legacy-js"}function F7(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 z7(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 U7(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 G7(n,e,t={}){let r=n.inWorldRenderingConfig,i=D7(e);r.showChunkBorders=e.showChunkBorders,r.futuristicReveal=e.rendererFuturisticReveal,F7(n,e,i),r.renderEntities=e.renderEntities,U7(n,e,t),z7(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,Sr({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=cn(e.rendererShaderCubeDebugMode)}function Lh(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 Hh(n,e,t={}){n.bindRendererOptions(()=>e);let r=t.getWindowFocused?.()??!0,i=()=>{let s=e;if(G7(n,s,{isSafari:t.isSafari,isCypress:t.isCypress,windowFocused:r}),n.currentDisplay==="menu"){let o=n.backend?.getMenuBackground?.();o&&O7(o,s)}};return i(),t.onRegisterFocusHandlers?.({onFocus:()=>{r=!0,i()},onBlur:()=>{r=!1,i()}}),H7(e,i)}function Oh(n,e,t){n.inWorldRenderingConfig.enableLighting=!t||e}E();x();k();R();import{proxy as V7}from"valtio";var J2=()=>V7({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}),W7=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"}}),N7=()=>({reactive:J2()}),q2=(n,e,t)=>({...e,"minecraft:date":new Date});E();x();k();R();E();x();k();R();import*as cr from"three";import{Vec3 as M9}from"vec3";E();x();k();R();import{proxy as j7,getVersion as yn,subscribe as $2}from"valtio";import{Vec3 as _n}from"vec3";function eo(n,e){let t=e??globalThis;return t.addEventListener("message",r=>{let{type:i,args:s,msgId:o}=r.data;if(n[i]){let v=n[i](...s);v instanceof Promise&&v.then(a=>{t.postMessage({type:"result",msgId:o,args:[a]})})}}),null}var to=(n,e=!0)=>{let t=0;return new Proxy({},{get(r,i){return i==="transfer"?(...s)=>new Proxy({},{get(o,v){return(...a)=>{n.postMessage({type:v,args:a},s)}}}):(...s)=>{let o=t++,v=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},v),{then(a){let l=({data:c})=>{c.type==="result"&&c.msgId===o&&(a(c.args[0]),n.removeEventListener("message",l))};n.addEventListener("message",l)}}}}})},ro=!1,P5={toWorker:0,fromWorker:0},X2=null,Q7=()=>{X2==null&&(typeof window>"u"||(X2=setInterval(()=>{globalThis.debugWorkerSyncStats={...P5},P5.toWorker=0,P5.fromWorker=0},1e3)))},Cr=n=>{Q7(),n==="toWorker"?P5.toWorker++:P5.fromWorker++};var Y7=()=>Math.random().toString(36).slice(2,15)+Math.random().toString(36).slice(2,15),K7=(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},J7=(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]]},bn=(n,e)=>{if(n==null||typeof n!="object")return n;if(n instanceof _n)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=>bn(r,e));if(yn(n)!==void 0)return I5(n);let t={};for(let r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=bn(n[r],e));return t},q7=(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:bn(r[2],e)})}return t},io=(n,e,t,r,i)=>{if(e.length===0)return;let s=q7(e,t);if(s.length!==0)try{t.postMessage({type:"sync",syncId:n,ops:s}),r==="toWorker"&&Cr("toWorker")}catch{for(let v of s)v.kind==="set"&&y0(v.value)}},no=(n,e,t,r=!1)=>{for(let i of e)i.kind==="delete"?J7(n,i.path):K7(n,i.path,H5(i.value,[],t,!1,!1));r==="fromWorker"&&Cr("fromWorker")},so=(n,e,t,r,i)=>{try{let s=I5(e);t.postMessage({type:"sync",syncId:n,value:s}),r==="toWorker"&&Cr("toWorker")}catch{y0(e)}},oo=(n,e,t,r=!1)=>{Object.assign(n,H5(e,[],t,!1,!1)),r==="fromWorker"&&Cr("fromWorker")},gn=(n,e,t,r,i)=>{let s=n.__syncFromWorker||e.__syncFromWorker,o=n.__syncToWorker||e.__syncToWorker;if(!o&&!s&&!r)return;let v=Y7();if(n.__syncId=v,o||r){r&&o!==!1&&$2(e,l=>{io(v,l,t,"toWorker",`toWorker:${i}`)});let a=n.__syncToWorkerInterval??e.__syncToWorkerInterval??0;a>0&&!r&&setInterval(()=>{so(v,e,t,"toWorker",`toWorker:interval:${i}`)},a)}e.__syncFromWorker&&t.addEventListener("message",a=>{a.data.type==="sync"&&a.data.syncId===v&&(a.data.ops?no(e,a.data.ops,t,"fromWorker"):a.data.value&&oo(e,a.data.value,t,"fromWorker"))})},I5=n=>{if(yn(n)===void 0)return n;if(Array.isArray(n))return n.map(I5);if(typeof n=="object"&&n!==null){let e={};for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=I5(n[t]));return e}return n},L5=(n,e,t=!0,r=!0,i=!1)=>{var v,a;let s=n,o={};for(let l in n)if(Object.prototype.hasOwnProperty.call(n,l)){if(t&&typeof n[l]=="function")continue;if(n[l]instanceof Date||n[l]instanceof RegExp||n[l]instanceof Map||n[l]instanceof Set||n[l]instanceof WeakMap||n[l]instanceof WeakSet,n[l]instanceof _n){o[l]={x:n[l].x,y:n[l].y,z:n[l].z},o[l].__restorer="Vec3";continue}if(o[l]=n[l],typeof n[l]=="object"&&n[l]!==null){if(n[l].prepareForTransfer){o[l]=n[l].prepareForTransfer(e);continue}let c=yn(n[l])!==void 0;o[l]=c?I5(n[l]):n[l],n[l].__syncFromWorker&&(o[l].__syncFromWorker=!0),n[l].__syncToWorker&&(o[l].__syncToWorker=!0),n[l].__syncFromWorkerInterval&&(o[l].__syncFromWorkerInterval=n[l].__syncFromWorkerInterval),n[l].__syncToWorkerInterval&&(o[l].__syncToWorkerInterval=n[l].__syncToWorkerInterval);let u=n[l].__syncToWorker!==!1&&!i&&c&&!n[l].__syncFromWorker;if((v=o[l]).__syncToWorker??(v.__syncToWorker=u),c&&((a=o[l]).__valtio??(a.__valtio=!0)),o[l].__syncToWorker&&c){gn(o[l],s[l],e,!0,l);continue}if(o[l].__syncFromWorker||o[l].__syncToWorker){gn(o[l],s[l],e,c,l);continue}gn(o[l],s[l],e,!1,l),o[l]=L5(o[l],e,t,!1,c)}}return o},y0=(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&&y0(n[t],[...e,t]);try{structuredClone(n[t])}catch{}}},Z2=new WeakMap,X7=(n,e,t)=>{if(!n.__syncId)return;let r=n.__syncId,i=Z2.get(e);if(i||(i=new Set,Z2.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?no(n,s.data.ops,e):s.data.value&&oo(n,s.data.value,e))}),n.__syncFromWorker)){n.__valtio&&$2(n,o=>{io(r,o,e,"fromWorker",`fromWorker:${t}`)});let s=n.__syncFromWorkerInterval??0;s>0&&!n.__valtio&&setInterval(()=>{so(r,n,e,"fromWorker",`fromWorker:interval:${t}`)},s)}},Z7=[{restorerName:"Vec3",restoreTransferred(n,e){return new _n(n.x,n.y,n.z)}}];var H5=(n,e,t,r=!0,i=!0)=>{let s=[...Z7,...e],o=(v,a)=>{if(v==null||typeof v!="object")return v;if(v.__restorer){let l=s.find(u=>u.restorerName?u.restorerName===v.__restorer:u.name===v.__restorer);if(l)return l.restoreTransferred(v,t);let c=new Error(`Restorer ${v.__restorer} not found`);if(typeof r=="function")r(c);else if(r)throw c;return v}if(Array.isArray(v))return v.map((l,c)=>o(l,`${a}[${c}]`));for(let l in v){if(!Object.prototype.hasOwnProperty.call(v,l))continue;let c=v[l];c!=null&&typeof c=="object"&&(v[l]=o(c,`${a}.${l}`))}return v.__valtio&&(v=j7(v)),i&&X7(v,t,a),v};return o(n,"root")};E();x();k();R();var Br=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()}};E();x();k();R();import*as K from"three";import{Vec3 as e0}from"vec3";import y9 from"prismarine-chat";E();x();k();R();var $7=(n,e)=>{try{return JSON.parse(n)}catch{return null}},e8={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"},Pr=(n,e,t,r=s=>{},i=(s,o)=>qe(s,o))=>{let v=[16,9],a=v[0]-v[1],l=a/16,c="front_text"in n?n.front_text.messages:[n.Text1,n.Text2,n.Text3,n.Text4];if(!c.some(g=>g!=="null"))return;let u=i(16*40,a*40),f=u.getContext("2d");r(f);let m=("front_text"in n?n.front_text.color:n.Color)||"black";for(let[g,b]of c.slice(0,4).entries())b!=="null"&&wn(b,t,u,64,m,64*(g+1)+(e?0:-8));return u},wn=(n,e,t,r,i,s=0)=>{let o=!1,v=typeof n=="string"&&(n?.startsWith("{")||n?.startsWith('"'))?$7(n??'""',"sign text"):n;if(!v||typeof v!="object"&&typeof v!="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 l=new e(v),c=[],u=!1,f="",m=s,g=[],b=(M,C)=>{M.text!==null&&M.text!==void 0&&M.text;let T=M.text===null||M.text===void 0?void 0:String(M.text),P={color:M.color??C?.color,underlined:M.underlined??C?.underlined,strikethrough:M.strikethrough??C?.strikethrough,bold:M.bold??C?.bold,italic:M.italic??C?.italic};if(u=u||P.underlined||P.strikethrough||!1,T?.includes(`
309
+ `))for(let B of T.split(`
310
+ `))A(B,P),m+=r,f="";else T&&A(T,P);if(M.extra)for(let B of M.extra)b(B,P)},A=(M,C)=>{o||(o=M.trim()!==""),f+=M,g[m]=a.measureText(f).width;let T=C.color??i;T.startsWith("#")||(T=e8[T.toLowerCase()]||T),c.push({fontStyle:`${C.bold?"bold":""} ${C.italic?"italic":""}`,fillStyle:T,underlineStyle:C.underlined??!1,strikeStyle:C.strikethrough??!1,offset:m,text:M})};if(b(l),!u&&!l.toString().trim())return;let y=0,_=0;for(let{fillStyle:M,fontStyle:C,underlineStyle:T,strikeStyle:P,offset:B,text:L}of c){_!==B&&(y=0),_=B,a.fillStyle=M,a.textRendering="optimizeLegibility",a.font=`${C} ${r}px mojangles`;let G=g[B]??a.measureText(L).width,H=(t.width-G)/2+y;a.fillText(L,H,B),P&&(a.lineWidth=r/8,a.strokeStyle=M,a.beginPath(),a.moveTo(H,B-a.lineWidth*2.5),a.lineTo(H+a.measureText(L).width,B-a.lineWidth*2.5),a.stroke()),T&&(a.lineWidth=r/8,a.strokeStyle=M,a.beginPath(),a.moveTo(H,B+a.lineWidth),a.lineTo(H+a.measureText(L).width,B+a.lineWidth),a.stroke()),y+=a.measureText(L).width}return o};E();x();k();R();function j0(n){let e=Math.floor(n.x/16),t=Math.floor(n.z/16);return[e,t]}function An(n){let e=Math.floor(n.x/16),t=Math.floor(n.y/16),r=Math.floor(n.z/16);return[e,t,r]}E();x();k();R();import{Vec3 as Lr}from"vec3";import{subscribeKey as Rn}from"valtio/utils";import{proxy as s8,subscribe as o8}from"valtio";E();x();k();R();var _0={blocks:"blocksArray",blockCollisionShapes:"blockCollisionShapes",biomes:"biomesArray",tints:"tints"};E();x();k();R();var ao=16;var vo=(n,e)=>e?`${n}:${e}`:String(n);E();x();k();R();var lo=0,Lt={},En=40,w0="mc-renderer-debug-overlay",A0=(n,e=80,t=lo,r=En,i)=>{if(ce)return{updateText(){},setVisibility(){}};let s=document.createElement("div");return s.style.position="fixed",s.style.top=`${r??En}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),Lt[n]=s,r===void 0&&t===lo&&(En+=20),{updateText(o){s.innerText!==o&&(s.innerText=o)},setVisibility(o){s.style.display=o?"block":"none"}}};var xn=(n,e)=>{ce||!Lt[n]||(Lt[n].innerText=e)},co=n=>{if(!ce)for(let e in Lt)Lt[e].style.display=n?"block":"none"},uo=()=>{if(!ce)for(let n in Lt)t8(n)},t8=n=>{ce||!Lt[n]||(Lt[n].remove(),delete Lt[n])};Ir();E();x();k();R();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 fo(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 O5(n,e){return(n%e+e)%e}var Ot=class Ot{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,"reactiveDebugParams",s8({stopRendering:!1,chunksRenderAboveOverride:void 0,chunksRenderAboveEnabled:!1,chunksRenderBelowOverride:void 0,chunksRenderBelowEnabled:!1,chunksRenderDistanceOverride:void 0,chunksRenderDistanceEnabled:!1,disableEntities:!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 l0);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.snapshotInitialValues(),this.worldRendererConfig=t.inWorldRenderingConfig,this.playerStateReactive=t.playerStateReactive,this.playerStateUtils=x2(this.playerStateReactive),this.reactiveState=t.rendererState,this.renderUpdateEmitter.on("update",()=>{let o=Object.keys(this.finishedChunks).length;xn("loaded-chunks",`${o}/${this.chunksLength} chunks (${this.lastChunkDistance}/${this.viewDistance})`)}),A0("downloaded-chunks",100,140,20,{className:w0}),this.connect(this.displayOptions.worldView);let i=setInterval(()=>{this.geometryReceiveCountPerSec=Object.values(this.geometryReceiveCount).reduce((o,v)=>o+v,0),this.geometryReceiveCount={},co(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()};fo(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 Lr(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=vo(t,s),v=this.blockStateModelInfo.get(o);return{customBlockName:s,modelInfo:v}}getMesherWorkerScript(){return this.worldRendererConfig.wasmMesher?"wasm":"legacy"}createMesherWorker(){let e=this.getMesherWorkerScript();return a8(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]),Rn(this.playerStateReactive,e,t)}onReactiveConfigUpdated(e,t,r=!0){return r&&t(this.worldRendererConfig[e]),e==="*"?o8(this.worldRendererConfig,t):Rn(this.worldRendererConfig,e,t)}onReactiveDebugUpdated(e,t){t(this.reactiveDebugParams[e]),Rn(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=>{Sr({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 Lr(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 v=!0,a=this.getSectionHeight();for(let l=this.worldMinYRender;l<this.worldSizeParams.worldHeight;l+=a)if(!this.finishedSections[`${s[0]},${l},${s[2]}`]){v=!1;break}if(v){this.finishedChunks[o]=!0;let l=16,c=`${Math.floor(s[0]/l)},${Math.floor(s[2]/l)}`;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 v=++this.workersPhaseSampleCount;this.workersPreAverageTime=(this.workersPreAverageTime*(v-1)+t.pre)/v,this.workersWasmAverageTime=(this.workersWasmAverageTime*(v-1)+t.wasm)/v,this.workersPostAverageTime=(this.workersPostAverageTime*(v-1)+t.post)/v;let a=typeof t.preTargetConvert=="number"?t.preTargetConvert:0,l=typeof t.preNeighborConvert=="number"?t.preNeighborConvert:0,c=typeof t.preNeighborCount=="number"?t.preNeighborCount:0,u=typeof t.preTypedArrayBuild=="number"?t.preTypedArrayBuild:0,f=typeof t.preOther=="number"?t.preOther:0,m=typeof t.preCacheHits=="number"?t.preCacheHits:0,g=typeof t.preCacheMisses=="number"?t.preCacheMisses:0;if(this.workersPreTargetConvertAverageTime=(this.workersPreTargetConvertAverageTime*(v-1)+a)/v,this.workersPreNeighborConvertAverageTime=(this.workersPreNeighborConvertAverageTime*(v-1)+l)/v,this.workersPreNeighborCountAverage=(this.workersPreNeighborCountAverage*(v-1)+c)/v,this.workersPreTypedArrayBuildAverageTime=(this.workersPreTypedArrayBuildAverageTime*(v-1)+u)/v,this.workersPreOtherAverageTime=(this.workersPreOtherAverageTime*(v-1)+f)/v,this.workersPreCacheHitsTotal+=m,this.workersPreCacheMissesTotal+=g,this.worldRendererConfig.debugWasmPerf&&v%Ot.PHASE_PERF_LOG_INTERVAL===0){let b=this.workersPreAverageTime+this.workersWasmAverageTime+this.workersPostAverageTime,A=b>0?this.workersPreAverageTime/b*100:0,y=b>0?this.workersWasmAverageTime/b*100:0,_=b>0?this.workersPostAverageTime/b*100:0,M=this.workersPreAverageTime,C=M>0?this.workersPreTargetConvertAverageTime/M*100:0,T=M>0?this.workersPreNeighborConvertAverageTime/M*100:0,P=M>0?this.workersPreTypedArrayBuildAverageTime/M*100:0,B=M>0?this.workersPreOtherAverageTime/M*100:0,L=this.workersPreNeighborCountAverage,G=L>0?this.workersPreNeighborConvertAverageTime/L:0,H=this.workersPreCacheHitsTotal+this.workersPreCacheMissesTotal,N=H>0?this.workersPreCacheHitsTotal/H*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}}}downloadMesherLog(){let e=document.createElement("a");e.href="data:text/plain;charset=utf-8,"+encodeURIComponent(this.mesherLogger.contents.join(`
311
+ `)),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]=j0(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:Ht(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;mo(this.workers,this.version,_0,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 ao}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,xn("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 l of this.workers)l.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);let v=this.getSectionHeight(),a=16;for(let l=this.worldMinYRender;l<this.worldSizeParams.worldHeight;l+=v){let c=new Lr(e,l,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 v;delete this.loadedChunks[`${e},${t}`];let r=`${e},${t}`,i=this.heightmapDebounceTimers.get(r);i&&(clearTimeout(i),this.heightmapDebounceTimers.delete(r));for(let[a,l]of this.sectionDirtyTimers)a.startsWith(`${e},`)&&a.endsWith(`,${t}`)&&(clearTimeout(l),this.sectionDirtyTimers.delete(a),this.sectionDirtyCount.delete(a),this.sectionDirtyPendingArgs.delete(a));for(let a=0;a<this.workers.length;a++)(v=this.toWorkerMessagesQueue)[a]??(v[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 l=`${e},${a},${t}`,c=this.sectionsWaiting.get(l);c!==void 0&&c>0,this.sectionsWaiting.delete(l),delete this.finishedSections[l]}this.highestBlocksByChunks.delete(`${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,v=Math.floor(e.z/16)*16;this.queuedChunks.has(`${o},${v}`)&&await new Promise(a=>{this.queuedFunctions.push(()=>{a()})}),this.loadedChunks[`${o},${v}`],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:v,worldConfig:a,isLightUpdate:l})=>{this.worldSizeParams=a,this.queuedChunks.add(`${s},${o}`);let c=[s,o,v,l];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 Lr(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:E5(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",()=>{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:Ht(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}`,v=this.protocolCustomBlocks.get(s)||{};for(let a of this.workers)a.postMessage({type:"blockUpdate",pos:e,stateId:t,customBlockModels:v});if(this.anyModuleRequiresHeightmap()){let a=Math.floor(e.x/16)*16,l=Math.floor(e.z/16)*16,c=`${a},${l}`;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:l})},100))}}if(this.logWorkerWork(`-> blockUpdate ${JSON.stringify({pos:e,stateId:t,customBlockModels:v})}`),this.setSectionDirty(e,!0,!0),this.neighborChunkUpdates){let l=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&l-1||this.setSectionDirty(e.offset(0,-l,0),!0,!0),(e.y&l-1)===l-1&&this.setSectionDirty(e.offset(0,l,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&l-1)&&this.setSectionDirty(e.offset(-16,-l,0),!0,!0),(e.x&15)===15&&!(e.y&l-1)&&this.setSectionDirty(e.offset(16,-l,0),!0,!0),!(e.z&15)&&!(e.y&l-1)&&this.setSectionDirty(e.offset(0,-l,-16),!0,!0),(e.z&15)===15&&!(e.y&l-1)&&this.setSectionDirty(e.offset(0,-l,16),!0,!0),!(e.y&l-1)&&!(e.x&15)&&!(e.z&15)&&this.setSectionDirty(e.offset(-16,-l,-16),!0,!0),!(e.y&l-1)&&(e.x&15)===15&&!(e.z&15)&&this.setSectionDirty(e.offset(16,-l,-16),!0,!0),!(e.y&l-1)&&!(e.x&15)&&(e.z&15)===15&&this.setSectionDirty(e.offset(-16,-l,16),!0,!0),!(e.y&l-1)&&(e.x&15)===15&&(e.z&15)===15&&this.setSectionDirty(e.offset(16,-l,16),!0,!0))}}getWorkerNumber(e,t=!1){let i=this.getSectionHeight();if(this.worldRendererConfig.dedicatedChangeWorker&&this.workers.length>1){if(this.worldRendererConfig.wasmMesher)return O5(Math.floor(e.x/16)+Math.floor(e.z/16),this.workers.length);if(t){let v=`${Math.floor(e.x/16)*16},${Math.floor(e.y/i)*i},${Math.floor(e.z/16)*16}`;if(this.sectionsWaiting.get(v)&&!this.finishedSections[v]){let l=this.workers.length-1;return O5(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),l)}return this.workers.length-1}let o=this.workers.length-1;return O5(Math.floor(e.x/16)+Math.floor(e.y/i)+Math.floor(e.z/16),o)}if(this.worldRendererConfig.wasmMesher)return O5(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 O5(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(),v=`${Math.floor(e.x/s)*s},${Math.floor(e.y/o)*o},${Math.floor(e.z/s)*s}`,a=(this.sectionDirtyCount.get(v)??0)+1;this.sectionDirtyCount.set(v,a),a<=Ot.GEOMETRY_THROTTLE_THRESHOLD?(this._dispatchDirtyImmediate(e,t,r),this.sectionDirtyTimers.has(v)||this.sectionDirtyTimers.set(v,setTimeout(()=>{let l=this.sectionDirtyPendingArgs.get(v);this.sectionDirtyCount.delete(v),this.sectionDirtyTimers.delete(v),this.sectionDirtyPendingArgs.delete(v),l&&this._dispatchDirtyImmediate(l.pos,l.value,l.useChangeWorker)},Ot.GEOMETRY_THROTTLE_DELAY))):(this.sectionDirtyPendingArgs.set(v,{pos:e,value:t,useChangeWorker:r}),this.sectionDirtyTimers.has(v)||this.sectionDirtyTimers.set(v,setTimeout(()=>{let l=this.sectionDirtyPendingArgs.get(v);this.sectionDirtyCount.delete(v),this.sectionDirtyTimers.delete(v),this.sectionDirtyPendingArgs.delete(v),l&&this._dispatchDirtyImmediate(l.pos,l.value,l.useChangeWorker)},Ot.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 v=this.getWorkerNumber(e,r&&(this.mesherLogger.active||this.worldRendererConfig.dedicatedChangeWorker));this.sectionsWaiting.set(o,(this.sectionsWaiting.get(o)??0)+1),this.forceCallFromMesherReplayer?this.workers[v].postMessage({type:"dirty",x:e.x,y:e.y,z:e.z,value:t,config:this.getMesherConfig()}):((a=this.toWorkerMessagesQueue)[v]??(a[v]=[]),this.toWorkerMessagesQueue[v].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(),uo()}};d(Ot,"PHASE_PERF_LOG_INTERVAL",64),d(Ot,"GEOMETRY_THROTTLE_THRESHOLD",1),d(Ot,"GEOMETRY_THROTTLE_DELAY",100);var Hr=Ot,a8=(n,e="mesher.js")=>{let t;if(O.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},ho=!1,mo=(n,e,t=_0,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&&!ho&&(ho=!0);for(let s of n)s.postMessage({type:"mcData",mcData:i})},kn=(n,e,t=_0,r,i=1e4)=>Promise.all(n.map(s=>new Promise((o,v)=>{let a=setTimeout(()=>{s.removeEventListener("message",l),v(new Error(`mcData transfer timeout (${i}ms)`))},i),l=({data:c})=>{c?.type==="mcDataApplied"&&(clearTimeout(a),s.removeEventListener("message",l),o())};s.addEventListener("message",l),mo([s],e,t,r)}))).then(()=>{});Ir();E();x();k();R();import{Vec3 as v8}from"vec3";import*as ct from"three";E();x();k();R();function Or(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,v=(s+2)%3,a=[[0,0,0],[0,0,0],[0,0,0]];return a[s][s]=1,a[o][o]=r,a[o][v]=-i,a[v][o]=+i,a[v][v]=r,a}function Tn(n,e){return e?[n[0]+e[0],n[1]+e[1],n[2]+e[2]]:n}function Mn(n,e){return e?[n[0]-e[0],n[1]-e[1],n[2]-e[2]]:n}function Q0(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 po(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],v=n[1][1],a=n[2][1],l=n[0][2],c=n[1][2],u=n[2][2],f=e[0][0],m=e[1][0],g=e[2][0],b=e[0][1],A=e[1][1],y=e[2][1],_=e[0][2],M=e[1][2],C=e[2][2];return t[0][0]=r*f+i*b+s*_,t[1][0]=r*m+i*A+s*M,t[2][0]=r*g+i*y+s*C,t[0][1]=o*f+v*b+a*_,t[1][1]=o*m+v*A+a*M,t[2][1]=o*g+v*y+a*C,t[0][2]=l*f+c*b+u*_,t[1][2]=l*m+c*A+u*M,t[2][2]=l*g+c*y+u*C,t}var Sn={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 l8(n,e,t,r,i,s,o,v){let a=new v8(0,0,0);for(let l in n.faces){let c=n.faces[l],{corners:u,mask1:f,mask2:m}=Sn[l],g=Q0(r,Sn[l].dir);if(c.cullface&&v[l])continue;let b=n.from[0],A=n.from[1],y=n.from[2],_=n.to[0],M=n.to[1],C=n.to[2],T=c.texture,{u:P}=T,{v:B}=T,{su:L}=T,{sv:G}=T,H=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),Z=-Math.sin(Y*Math.PI/180),ae=null,oe=null;n.rotation&&(ae=Or(n.rotation.axis,n.rotation.angle),oe=Mn(n.rotation.origin,Q0(ae,n.rotation.origin)));let le=[],ye=1;for(let pe of u){let se=[pe[0]?_:b,pe[1]?M:A,pe[2]?C:y];se=Tn(Q0(ae,se),oe),se=Tn(Q0(r,se),i),se=se.map(rt=>rt/16),t.positions.push(se[0],se[1],se[2]),t.normals.push(...g);let Q=(pe[3]-.5)*q-(pe[4]-.5)*Z+.5,ve=(pe[3]-.5)*Z+(pe[4]-.5)*q+.5;t.uvs.push(Q*L+P,ve*G+B);let ke=1;e&&(ke=4/4*(15/15),le.push(3)),t.colors.push(ye*N[0]*ke,ye*N[1]*ke,ye*N[2]*ke)}e&&le[0]+le[3]>=le[1]+le[2]?t.indices.push(H,H+3,H+2,H,H+1,H+3):t.indices.push(H,H+1,H+2,H+2,H+1,H+3)}}var c8=(n,e,t,r,i=[],s={})=>{let l={sx:.5,sy:.5,sz:.5,positions:[],normals:[],colors:[],uvs:[],t_positions:[],t_normals:[],t_colors:[],t_uvs:[],indices:[],tiles:{}};for(let[u,f]of n.entries()){let m=f[i[u]]??f[0];if(!m)continue;let g=null,b=null;for(let y of["x","y","z"])y in m&&(g?g=po(g,Or(y,-(m[y]??0))):g=Or(y,-(m[y]??0)));g&&(b=[8,8,8],b=Mn(b,Q0(g,b)));let A=m.ao??!0;for(let y of m.elements??[])l8(y,A,l,g,b,e,t,s)}let c=l.positions.length/3;for(let u=0;u<l.t_positions.length/12;u++)l.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 l.positions.push(...l.t_positions),l.normals.push(...l.t_normals),l.colors.push(...l.t_colors),l.uvs.push(...l.t_uvs),delete l.t_positions,delete l.t_normals,delete l.t_colors,delete l.t_uvs,l.positions=new Float32Array(l.positions),l.normals=new Float32Array(l.normals),l.colors=new Float32Array(l.colors),l.uvs=new Float32Array(l.uvs),l},d8=(...n)=>{let t={geometry:c8(...n)},r=new ct.BufferGeometry;return r.setAttribute("position",new ct.BufferAttribute(t.geometry.positions,3)),r.setAttribute("normal",new ct.BufferAttribute(t.geometry.normals,3)),r.setAttribute("color",new ct.BufferAttribute(t.geometry.colors,3)),r.setAttribute("uv",new ct.BufferAttribute(t.geometry.uvs,2)),r.setIndex(t.geometry.indices),r.name="block-geometry",r},Cn=(n,...e)=>{let t=d8(...e),r=new ct.Mesh(t,n);r.position.set(-.5,-.5,-.5);let i=new ct.Group;return i.add(r),i.rotation.set(0,-ct.MathUtils.degToRad(90),0,"ZYX"),globalThis.mesh=i,i},go=(n,e)=>{n.position.set(e.x+.5,e.y+.5,e.z+.5)};E();x();k();R();import*as Ue from"three";var D5=async(n,e)=>{let t;if(!n&&!e){let{canvas:l}=await Mt(st);t=new Ue.CanvasTexture(l)}else{if(n||(n=await Qt(e,"skin")),!n)return;let{canvas:l}=await Mt(n);t=new Ue.CanvasTexture(l)}t.magFilter=Ue.NearestFilter,t.minFilter=Ue.NearestFilter;let r=!1,s=u8(40,16,r?-2:-3,-2,-2,r?3:4,12,4,64,64),o=new Ue.MeshStandardMaterial;o.map=t,o.needsUpdate=!0;let v=new Ue.Mesh(s,o),a=new Ue.Group;return a.add(v),a};function u8(n,e,t,r,i,s,o,v,a,l,c=!1){let u=t/16,f=r/16,m=i/16,g=(t+s)/16,b=(r+o)/16,A=(i+v)/16;c&&([u,g]=[g,u]);let y=[[u,f,m],[g,f,m],[g,b,m],[u,b,m],[u,f,A],[g,f,A],[g,b,A],[u,b,A]],_=n,M=n+v,C=n+v+s,T=n+v+s+s,P=n+v+s+v,B=n+v+s+v+s,L=e,G=e+v,H=e+v+o,N=[{vi:[5,4,0,1],uv:[M,L,C,G],n:[0,-1,0]},{vi:[2,3,7,6],uv:[C,G,T,L],n:[0,1,0]},{vi:[0,4,7,3],uv:[_,G,M,H],n:[-1,0,0]},{vi:[1,0,3,2],uv:[M,G,C,H],n:[0,0,-1]},{vi:[5,1,2,6],uv:[C,G,P,H],n:[1,0,0]},{vi:[4,5,6,7],uv:[P,G,B,H],n:[0,0,1]}],Y=[],q=[],Z=[],ae=[];for(let le=0;le<N.length;le++){let ye=N[le],pe=le*4,[se,Q,ve,ke]=ye.uv,rt=[[ve/a,1-Q/l],[se/a,1-Q/l],[se/a,1-ke/l],[ve/a,1-ke/l]],Ke=c?[3,2,1,0]:[0,1,2,3],dt=c?-ye.n[0]:ye.n[0];for(let Ee=0;Ee<4;Ee++){let wt=y[ye.vi[Ke[Ee]]];Y.push(wt[0],wt[1],wt[2]),q.push(rt[Ee][0],rt[Ee][1]),Z.push(dt,ye.n[1],ye.n[2])}ae.push(pe,pe+1,pe+2,pe,pe+2,pe+3)}let oe=new Ue.BufferGeometry;return oe.setAttribute("position",new Ue.Float32BufferAttribute(Y,3)),oe.setAttribute("uv",new Ue.Float32BufferAttribute(q,2)),oe.setAttribute("normal",new Ue.Float32BufferAttribute(Z,3)),oe.setIndex(ae),oe}E();x();k();R();E();x();k();R();import*as Ie from"three";E();x();k();R();E();x();k();R();var Yt=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)}},Bn=class extends Yt{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 Pn(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 f8={isPrimitive:!0,match:n=>typeof n=="string",fromHexString:Pn,toHexString:Pn},z5={isPrimitive:!0,match:n=>typeof n=="number",fromHexString:n=>parseInt(n.substring(1),16),toHexString:n=>"#"+n.toString(16).padStart(6,0)},h8={isPrimitive:!1,match:n=>Array.isArray(n),fromHexString(n,e,t=1){let r=z5.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 z5.toHexString(i)}},m8={isPrimitive:!1,match:n=>Object(n)===n,fromHexString(n,e,t=1){let r=z5.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 z5.toHexString(i)}},p8=[f8,z5,h8,m8];function g8(n){return p8.find(e=>e.match(n))}var In=class extends Yt{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=g8(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=Pn(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}},F5=class extends Yt{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}},Ln=class extends Yt{constructor(e,t,r,i,s,o){super(e,t,r,"number"),this._initInput(),this.min(i),this.max(s);let v=o!==void 0;this.step(v?o:this._getImplicitStep(),v),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 _=parseFloat(this.$input.value);isNaN(_)||(this._stepExplicit&&(_=this._snap(_)),this.setValue(this._clamp(_)))},r=_=>{let M=parseFloat(this.$input.value);isNaN(M)||(this._snapClampSetValue(M+_),this.$input.value=this.getValue())},i=_=>{_.key==="Enter"&&this.$input.blur(),_.code==="ArrowUp"&&(_.preventDefault(),r(this._step*this._arrowKeyMultiplier(_))),_.code==="ArrowDown"&&(_.preventDefault(),r(this._step*this._arrowKeyMultiplier(_)*-1))},s=_=>{this._inputFocused&&(_.preventDefault(),r(this._step*this._normalizeMouseWheel(_)))},o=!1,v,a,l,c,u,f=5,m=_=>{v=_.clientX,a=l=_.clientY,o=!0,c=this.getValue(),u=0,window.addEventListener("mousemove",g),window.addEventListener("mouseup",b)},g=_=>{if(o){let M=_.clientX-v,C=_.clientY-a;Math.abs(C)>f?(_.preventDefault(),this.$input.blur(),o=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(M)>f&&b()}if(!o){let M=_.clientY-l;u-=M*this._step*this._arrowKeyMultiplier(_),c+u>this._max?u=this._max-c:c+u<this._min&&(u=this._min-c),this._snapClampSetValue(c+u)}l=_.clientY},b=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",b)},A=()=>{this._inputFocused=!0},y=()=>{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",m),this.$input.addEventListener("focus",A),this.$input.addEventListener("blur",y)}_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,C,T)=>(y-_)/(M-_)*(T-C)+C,t=y=>{let _=this.$slider.getBoundingClientRect(),M=e(y,_.left,_.right,this._min,this._max);this._snapClampSetValue(M)},r=y=>{this._setDraggingStyle(!0),t(y.clientX),window.addEventListener("mousemove",i),window.addEventListener("mouseup",s)},i=y=>{t(y.clientX)},s=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",i),window.removeEventListener("mouseup",s)},o=!1,v,a,l=y=>{y.preventDefault(),this._setDraggingStyle(!0),t(y.touches[0].clientX),o=!1},c=y=>{y.touches.length>1||(this._hasScrollBar?(v=y.touches[0].clientX,a=y.touches[0].clientY,o=!0):l(y),window.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("touchend",f))},u=y=>{if(o){let _=y.touches[0].clientX-v,M=y.touches[0].clientY-a;Math.abs(_)>Math.abs(M)?l(y):(window.removeEventListener("touchmove",u),window.removeEventListener("touchend",f))}else y.preventDefault(),t(y.touches[0].clientX)},f=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",u),window.removeEventListener("touchend",f)},m=this._callOnFinishChange.bind(this),g=400,b,A=y=>{if(Math.abs(y.deltaX)<Math.abs(y.deltaY)&&this._hasScrollBar)return;y.preventDefault();let M=this._normalizeMouseWheel(y)*this._step;this._snapClampSetValue(this.getValue()+M),this.$input.value=this.getValue(),clearTimeout(b),b=setTimeout(m,g)};this.$slider.addEventListener("mousedown",r),this.$slider.addEventListener("touchstart",c,{passive:!1}),this.$slider.addEventListener("wheel",A,{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}},Hn=class extends Yt{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}},On=class extends Yt{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 {
290
312
  font-family: var(--font-family);
291
313
  font-size: var(--font-size);
292
314
  line-height: 1;
@@ -717,11 +739,11 @@ void main() {
717
739
  @font-face {
718
740
  font-family: "lil-gui";
719
741
  src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAA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GZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff");
720
- }`;function g7(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 Is=!1,li=class n{constructor({parent:e,autoPlace:t=e===void 0,container:r,width:i,title:s="Controls",closeFolders:o=!1,injectStyles:a=!0,touchStyles:v=!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",l=>{(l.code==="Enter"||l.code==="Space")&&(l.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"),v&&this.domElement.classList.add("allow-touch-styles"),!Is&&a&&(g7(p7),Is=!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 ai(this,e,t,r);switch(typeof e[t]){case"number":return new oi(this,e,t,r,i,s);case"boolean":return new ii(this,e,t);case"string":return new vi(this,e,t);case"function":return new k5(this,e,t)}}addColor(e,t,r=1){return new si(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 k5||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 k5)){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}},ci=li;var k0=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(!ae){this.gui=new ci,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 ae?this:(!this.initialized&&this.gui&&(this.loadSavedValues(),this.setupControls(),this.initialized=!0),this.show(),this)}get visible(){return ae?!1:this._visible}set visible(e){ae||!this.gui||(this._visible=e,this.gui.domElement.style.display=e?"block":"none",this.saveVisibility())}loadSavedValues(){if(!ae)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(!ae)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(!ae)try{localStorage.setItem(`${this.storageKey}_visible`,this._visible.toString())}catch{}}setupControls(){if(!(ae||!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 ci,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(){ae||(this.saveValues(),this.saveVisibility())}destroy(){ae||!this.gui||(this.saveVisibility(),this.gui.destroy())}toggle(){this.visible=!this.visible}show(){this.visible=!0}hide(){this.visible=!1}};E();x();k();R();E();x();k();R();var y1=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 b7={x:3e3,y:3e3,z:3e3,rotation:Math.PI,scale:1,default:3e3},ct=class{constructor(e,t,r){this.getState=e;this.setState=t;d(this,"animationController",new y1);d(this,"defaultState");d(this,"speeds");d(this,"currentStateName","");d(this,"transitioningToStateName","");this.speeds={...b7},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],a=Math.abs(s-o),v=this.getPropertySpeed(i),l=a/v*1e3;t=Math.max(t,l)}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=He.Linear.None,s){this.isTransitioning&&this.animationController.forceFinish(!1),this.transitioningToStateName=t??"";let o=this.getState(),a=this.calculateDuration(e);this.animationController.startAnimation(()=>{let v=new Ct;return new Oe(o,v).to(e,a).easing(i).onUpdate(l=>{for(let c of Object.keys(l))this.setState(c,l[c])}).onComplete(()=>{this.animationController.forceFinish(),this.currentStateName=this.transitioningToStateName,this.transitioningToStateName="",r?.()}).start(),v},s)}reset(){this.startTransition(this.defaultState)}update(){this.animationController.update()}forceFinish(){this.animationController.forceFinish()}transitionTo(e,t,r,i){this.startTransition(e,t,r,He.Linear.None,i)}getCurrentValue(e){return this.getState()[e]}get isTransitioning(){return this.animationController.isActive}};E();x();k();R();import{subscribeKey as y7}from"valtio/utils";function _1(n,e,t,r,i){let s=0,o,a=async()=>{let v=++s,l=await n(e[t]);v===s?(o&&i?.(o),r(l),o=l):i?.(l)};return a(),y7(e,t,a)}E();x();k();R();var Hs=Math.PI/180;function w1(n){let{walkDist:e,prevWalkDist:t,bob:r,prevBob:i,partialTick:s}=n,o=e-t,a=-(e+o*s),v=i+(r-i)*s,l=Math.sin(a*Math.PI),c=Math.cos(a*Math.PI);return{position:{x:l*v*.5,y:-Math.abs(c*v)},rotation:{x:Math.abs(Math.cos(a*Math.PI-.2)*v)*5*Hs,z:l*v*3*Hs}}}E();x();k();R();var A1=n=>({"minecraft:display_context":"firstperson","minecraft:use_duration":n.playerStateReactive.itemUsageTicks,"minecraft:using_item":!!n.playerStateReactive.itemUsageTicks}),_7=()=>({"minecraft:display_context":"firstperson"}),Dt=(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},_7());return`${e.type}:${t}:${r.modelName}`};var je=new Se.Matrix4,Os=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function w7(n,e){let t=new Se.Matrix4,r=1,i=Math.sqrt(n),s=-.3*Math.sin(i*Math.PI),o=.4*Math.sin(i*2*Math.PI),a=-.4*Math.sin(n*Math.PI);return t.multiply(je.makeTranslation(r*(s+.64),o-.6+e*-.6,a-.72)),t.multiply(je.makeRotationY(r*45*Math.PI/180)),t.multiply(je.makeRotationY(r*Math.sin(i*Math.PI)*70*Math.PI/180)),t.multiply(je.makeRotationZ(r*Math.sin(n*n*Math.PI)*-20*Math.PI/180)),t.multiply(je.makeTranslation(r*-1,3.6,3.5)),t.multiply(je.makeRotationZ(r*120*Math.PI/180)),t.multiply(je.makeRotationX(200*Math.PI/180)),t.multiply(je.makeRotationY(r*-135*Math.PI/180)),t.multiply(je.makeTranslation(r*5.6,0,0)),t.multiply(je.makeTranslation(r*-5/16,2/16,0)),t}function A7(n,e){let t=new Se.Matrix4,r=1,i=Math.sqrt(n),s=-.4*Math.sin(i*Math.PI),o=.2*Math.sin(i*2*Math.PI),a=-.2*Math.sin(n*Math.PI);t.multiply(je.makeTranslation(r*s,o,a)),t.multiply(je.makeTranslation(r*.56,-.52+e*-.6,-.72));let v=Math.sin(n*n*Math.PI),l=Math.sin(i*Math.PI);return t.multiply(je.makeRotationY(r*(45+v*-20)*Math.PI/180)),t.multiply(je.makeRotationZ(r*l*-20*Math.PI/180)),t.multiply(je.makeRotationX(l*-80*Math.PI/180)),t.multiply(je.makeRotationY(r*-45*Math.PI/180)),t}var M5=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;d(this,"holdingBlock");d(this,"blockSwapAnimation");d(this,"cameraGroup",new Se.Mesh);d(this,"armTransformGroup",new Se.Group);d(this,"camera",new Se.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 di,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||R5().then(r=>{this.disposed||(this.playerHand=r,this.updateItem())}).then(()=>{if(this.disposed)return;let r=_1(async()=>R5(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=>{Re(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,Re(this.cameraGroup,!0),this.holdingBlock&&this.holdingBlock!==this.playerHand&&Re(this.holdingBlock,!0),this.holdingBlock=void 0,this.playerHand&&(Re(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 Se.Mesh,this.armTransformGroup=new Se.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 Se.Scene;o.add(this.cameraGroup);let a=t.getSize(new Se.Vector2),v=a.height>a.width;v?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:l}=this;if(l&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),v){let c=Math.min(a.width,a.height);l?t.setViewport(0,0,c,c):t.setViewport(a.width-c,0,c,c)}t.render(o,this.camera),v&&t.setViewport(0,0,a.width,a.height),l&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new ct(()=>({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!==Dt(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),g=1-Math.pow(.5,h*36);this.xBob+=(i-this.xBob)*p,this.yBob+=Os(s-this.yBob)*g}this.lastBobUpdateTime=t;let o=(i-this.xBob)*-.05,a=Os(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),g=1.8,y=w1({walkDist:h.walkDist*g,prevWalkDist:h.prevWalkDist*g,bob:h.bob,prevBob:h.prevBob,partialTick:p});this.cameraGroup.position.x+=y.position.x,this.cameraGroup.position.y+=y.position.y,this.cameraGroup.rotation.z+=y.rotation.z,this.cameraGroup.rotation.x+=y.rotation.x}this.cameraGroup.rotation.x+=o,this.cameraGroup.rotation.y+=a;let l=this.currentDisplayType,c=this.swingAnimator?.getSwingProgress()??0,u;l==="hand"?u=w7(c,this.equipProgress):u=A7(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},A1(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 Se.Group;r.name="displayTransform",e.type==="item"?(r.position.set(1.13/16,3.2/16,1.13/16),r.rotation.set(0,Se.MathUtils.degToRad(-90),Se.MathUtils.degToRad(25),"XYZ"),r.scale.set(.68,.68,.68)):(r.rotation.set(0,Se.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=Dt(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&&Re(this.holdingBlock,!1),this.holdingBlock=void 0}if(!e){this.currentDisplayType="hand";let v=this.swingAnimator;v?.stopSwing(),v&&(v.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 a=this.swingAnimator;a&&(a.type=o.type),this.idleAnimator=void 0}};var di=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 k0("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}},Ds=(n,e,t,r,i)=>{let s=r.transformModel(e,{name:t,properties:{}});return ri(n,[[s]],void 0,"plains",i)};E();x();k();R();import*as de from"three";import{subscribeKey as S3}from"valtio/utils";E();x();k();R();import*as ze from"three";E();x();k();R();import Oi from"prismarine-nbt";import*as V from"three";E();x();k();R();E();x();k();R();import{BoxGeometry as Ye,DoubleSide as gi,FrontSide as zs,Group as v0,Mesh as Ge,MeshStandardMaterial as S5,Vector2 as E1}from"three";function bi(n,e,t,r,i,s,o,a){let v=(B,H,G,O)=>[new E1(B/o,1-O/a),new E1(G/o,1-O/a),new E1(G/o,1-H/a),new E1(B/o,1-H/a)],l=v(e+s,t,e+r+s,t+s),c=v(e+r+s,t,e+r*2+s,t+s),u=v(e,t+s,e+s,t+s+i),h=v(e+s,t+s,e+r+s,t+s+i),p=v(e+r+s,t+s,e+r+s*2,t+i+s),g=v(e+r+s*2,t+s,e+r*2+s*2,t+i+s),y=n.attributes.uv,A=[p[3],p[2],p[0],p[1]],b=[u[3],u[2],u[0],u[1]],w=[l[3],l[2],l[0],l[1]],S=[c[0],c[1],c[3],c[2]],C=[h[3],h[2],h[0],h[1]],M=[g[3],g[2],g[0],g[1]],I=[];for(let B of[A,b,w,S,C,M])for(let H of B)I.push(H.x,H.y);y.set(new Float32Array(I)),y.needsUpdate=!0}function a0(n,e,t,r,i,s){bi(n,e,t,r,i,s,64,64)}function ui(n,e,t,r,i,s){bi(n,e,t,r,i,s,64,32)}var T0=class extends v0{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"}},fi=class extends v0{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 S5({side:zs}),this.layer2Material=new S5({side:gi,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 Ye(8,8,8);a0(e,0,0,8,8,8);let t=new Ge(e,this.layer1Material),r=new Ye(9,9,9);a0(r,32,0,8,8,8);let i=new Ge(r,this.layer2Material);this.head=new T0(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 Ye(8,12,4);a0(s,16,16,8,12,4);let o=new Ge(s,this.layer1Material),a=new Ye(8.5,12.5,4.5);a0(a,16,32,8,12,4);let v=new Ge(a,this.layer2Material);this.body=new T0(o,v),this.body.name="body",this.body.add(o,v),this.body.position.y=-6,this.add(this.body);let l=new Ye,c=new Ge(l,this.layer1MaterialBiased);this.modelListeners.push(()=>{c.scale.x=this.slim?3:4,c.scale.y=12,c.scale.z=4,a0(l,40,16,this.slim?3:4,12,4)});let u=new Ye,h=new Ge(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,a0(u,40,32,this.slim?3:4,12,4)});let p=new v0;p.add(c,h),this.modelListeners.push(()=>{p.position.x=this.slim?-.5:-1}),p.position.y=-4,this.rightArm=new T0(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 g=new Ye,y=new Ge(g,this.layer1MaterialBiased);this.modelListeners.push(()=>{y.scale.x=this.slim?3:4,y.scale.y=12,y.scale.z=4,a0(g,32,48,this.slim?3:4,12,4)});let A=new Ye,b=new Ge(A,this.layer2MaterialBiased);this.modelListeners.push(()=>{b.scale.x=this.slim?3.5:4.5,b.scale.y=12.5,b.scale.z=4.5,a0(A,48,48,this.slim?3:4,12,4)});let w=new v0;w.add(y,b),this.modelListeners.push(()=>{w.position.x=this.slim?.5:1}),w.position.y=-4,this.leftArm=new T0(y,b),this.leftArm.name="leftArm",this.leftArm.add(w),this.leftArm.position.x=5,this.leftArm.position.y=-2,this.add(this.leftArm);let S=new Ye(4,12,4);a0(S,0,16,4,12,4);let C=new Ge(S,this.layer1MaterialBiased),M=new Ye(4.5,12.5,4.5);a0(M,0,32,4,12,4);let I=new Ge(M,this.layer2MaterialBiased),B=new v0;B.add(C,I),B.position.y=-6,this.rightLeg=new T0(C,I),this.rightLeg.name="rightLeg",this.rightLeg.add(B),this.rightLeg.position.x=-1.9,this.rightLeg.position.y=-12,this.rightLeg.position.z=-.1,this.add(this.rightLeg);let H=new Ye(4,12,4);a0(H,16,48,4,12,4);let G=new Ge(H,this.layer1MaterialBiased),O=new Ye(4.5,12.5,4.5);a0(O,0,48,4,12,4);let j=new Ge(O,this.layer2MaterialBiased),J=new v0;J.add(G,j),J.position.y=-6,this.leftLeg=new T0(G,j),this.leftLeg.name="leftLeg",this.leftLeg.add(J),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 T0)}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}},hi=class extends v0{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 S5({side:gi,transparent:!0,alphaTest:1e-5});let e=new Ye(10,16,1);ui(e,0,0,10,16,1),this.cape=new Ge(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}},mi=class extends v0{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 S5({side:gi,transparent:!0,alphaTest:1e-5});let e=new Ye(12,22,4);ui(e,22,0,10,20,2);let t=new Ge(e,this.material);t.position.x=-5,t.position.y=-10,t.position.z=-1,this.leftWing=new v0,this.leftWing.add(t),this.add(this.leftWing);let r=new Ye(12,22,4);ui(r,22,0,10,20,2);let i=new Ge(r,this.material);i.scale.x=-1,i.position.x=5,i.position.y=-10,i.position.z=-1,this.rightWing=new v0,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}},pi=class extends v0{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 S5({side:zs});let e=new Ye(8,8,4/3);bi(e,0,0,6,6,1,14,7),this.rightEar=new Ge(e,this.material),this.rightEar.name="rightEar",this.rightEar.position.x=-6,this.add(this.rightEar),this.leftEar=new Ge(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}},Fs=10.8*Math.PI/180,Ft=class extends v0{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 fi,this.skin.name="skin",this.skin.position.y=8,this.add(this.skin),this.cape=new hi,this.cape.name="cape",this.cape.position.y=8,this.cape.position.z=-2,this.cape.rotation.x=Fs,this.cape.rotation.y=Math.PI,this.add(this.cape),this.elytra=new mi,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 pi,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=Fs,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()}};E();x();k();R();import{Color as lg,PointLight as cg,EquirectangularReflectionMapping as dg,Group as ug,NearestFilter as fg,PerspectiveCamera as hg,Scene as mg,Texture as pg,Vector2 as gg,WebGLRenderer as bg,AmbientLight as yg,CanvasTexture as _g,WebGLRenderTarget as wg,FloatType as Ag,DepthTexture as Eg,Clock as xg,Object3D as Rg,ColorManagement as kg}from"three";import{OrbitControls as Mg}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as Cg}from"three/examples/jsm/postprocessing/EffectComposer.js";import"three/examples/jsm/postprocessing/Pass.js";import{RenderPass as Hg}from"three/examples/jsm/postprocessing/RenderPass.js";import{ShaderPass as Dg}from"three/examples/jsm/postprocessing/ShaderPass.js";import{FXAAShader as zg}from"three/examples/jsm/shaders/FXAAShader.js";E();x();k();R();var x1=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))}};E();x();k();R();import{CanvasTexture as Kp,NearestFilter as Jp,Sprite as Zp,SpriteMaterial as qp}from"three";E();x();k();R();var E7=Object.defineProperty,x7=(n,e,t)=>e in n?E7(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ge=(n,e,t)=>(x7(n,typeof e!="symbol"?e+"":e,t),t);function yi(n){let e=[n];if(n.extra&&n.extra.length!==0)for(let t of n.extra)e.push(...yi(t));return e}var q=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`${q.CONTROL_STRING}${this.code}`}},be=q;ge(be,"CONTROL_STRING","\xA7");ge(be,"BLACK",new q("color","black","BLACK","0",{color:"#000000"},{color:"#000000"}));ge(be,"DARK_BLUE",new q("color","dark_blue","DARK_BLUE","1",{color:"#0000AA"},{color:"#00002A"}));ge(be,"DARK_GREEN",new q("color","dark_green","DARK_GREEN","2",{color:"#00AA00"},{color:"#002A00"}));ge(be,"DARK_AQUA",new q("color","dark_aqua","DARK_AQUA","3",{color:"#00AAAA"},{color:"#002A2A"}));ge(be,"DARK_RED",new q("color","dark_red","DARK_RED","4",{color:"#AA0000"},{color:"#2A0000"}));ge(be,"DARK_PURPLE",new q("color","dark_purple","DARK_PURPLE","5",{color:"#AA00AA"},{color:"#2A002A"}));ge(be,"GOLD",new q("color","gold","GOLD","6",{color:"#FFAA00"},{color:"#2A2A00"}));ge(be,"GRAY",new q("color","gray","GRAY","7",{color:"#AAAAAA"},{color:"#2A2A2A"}));ge(be,"DARK_GRAY",new q("color","dark_gray","DARK_GRAY","8",{color:"#555555"},{color:"#151515"}));ge(be,"BLUE",new q("color","blue","BLUE","9",{color:"#5555FF"},{color:"#15153F"}));ge(be,"GREEN",new q("color","green","GREEN","a",{color:"#55FF55"},{color:"#153F15"}));ge(be,"AQUA",new q("color","aqua","AQUA","b",{color:"#55FFFF"},{color:"#153F3F"}));ge(be,"RED",new q("color","red","RED","c",{color:"#FF5555"},{color:"#3F1515"}));ge(be,"LIGHT_PURPLE",new q("color","light_purple","LIGHT_PURPLE","d",{color:"#FF55FF"},{color:"#3F153F"}));ge(be,"YELLOW",new q("color","yellow","YELLOW","e",{color:"#FFFF55"},{color:"#3F3F15"}));ge(be,"WHITE",new q("color","white","WHITE","f",{color:"#FFFFFF"},{color:"#3F3F3F"}));ge(be,"OBFUSCATED",new q("obfuscated",!0,"OBFUSCATED","k",{}));ge(be,"BOLD",new q("bold",!0,"BOLD","l",{"font-weight":"bold"}));ge(be,"STRIKETHROUGH",new q("strikethrough",!0,"STRIKETHROUGH","m",{"text-decoration":"line-through"}));ge(be,"UNDERLINE",new q("underlined",!0,"UNDERLINE","n",{"text-decoration":"underline"}));ge(be,"ITALIC",new q("italic",!0,"ITALIC","o",{"font-style":"italic"}));ge(be,"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`${q.CONTROL_STRING}r`}});ge(be,"list",[q.BLACK,q.DARK_BLUE,q.DARK_GREEN,q.DARK_AQUA,q.DARK_RED,q.DARK_PURPLE,q.GOLD,q.GRAY,q.DARK_GRAY,q.BLUE,q.GREEN,q.AQUA,q.RED,q.LIGHT_PURPLE,q.YELLOW,q.WHITE,q.OBFUSCATED,q.BOLD,q.STRIKETHROUGH,q.UNDERLINE,q.ITALIC,q.RESET]);var F5=a5(_i(),1);xi();var x3=a5(lo(),1);import R3 from"prismarine-chat";E();x();k();R();import*as Ri from"three";E();x();k();R();var l8=n=>Math.max(0,Math.min(1,n)),c8=(n,e,t)=>n+(e-n)*t;function d8(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 H5=class extends x1{constructor(){super(...arguments);d(this,"switchAnimationCallback");d(this,"isRunning",!1);d(this,"isMoving",!0);d(this,"isCrouched",!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.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 a=this._phase+(this.isRunning?Math.PI*.5:0),v=!1;f8(t,this.isCrouched?1:0);let l=this.isRunning?Math.cos(a):Math.sin(a);if(Math.abs(l)<.02&&this.switchAnimationCallback&&(v=!0),this.isRunning?(t.skin.leftLeg.rotation.x=Math.cos(a+Math.PI)*1.3,t.skin.rightLeg.rotation.x=Math.cos(a)*1.3):(t.skin.leftLeg.rotation.x=Math.sin(a)*.5,t.skin.rightLeg.rotation.x=Math.sin(a+Math.PI)*.5),this.isRunning){t.skin.leftArm.rotation.x=Math.cos(a)*1.5,t.skin.rightArm.rotation.x=Math.cos(a+Math.PI)*1.5;let c=Math.PI*.1;t.skin.leftArm.rotation.z=Math.cos(a)*.1+c,t.skin.rightArm.rotation.z=Math.cos(a+Math.PI)*.1-c}else{t.skin.leftArm.rotation.x=Math.sin(a+Math.PI)*.5,t.skin.rightArm.rotation.x=Math.sin(a)*.5;let c=Math.PI*.02;t.skin.leftArm.rotation.z=Math.cos(a)*.03+c,t.skin.rightArm.rotation.z=Math.cos(a+Math.PI)*.03-c}if(this._swingTime!==null){this._swingTime+=r;let c=Math.min(this._swingTime/this._swingDuration,1);u8.animate(c,t,this.isMoving),c>=1&&(this._swingTime=null)}if(this.isRunning&&(t.rotation.z=Math.cos(a+Math.PI)*.01),this.isRunning){let c=Math.PI*.3;t.cape.rotation.x=Math.sin(a*2)*.1+c}else{let c=Math.PI*.06;t.cape.rotation.x=Math.sin(a/1.5)*.06+c}if(v){let c=this.switchAnimationCallback;this.switchAnimationCallback=null,c?.()}}},u8={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 f8(n,e){let t=n?.skin,r=n?.cape,i=n?.elytra;if(!t||!r)return;let s=l8(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=c8(.72,.26179944+.4582006,o)),d8(n),t.head.position.y+=-3.618325234674*o;let a=.1*o,v=(3.618325234674-3.4500310377)*o,l=-2.53943318*o;t.leftArm.position.z+=v,t.rightArm.position.z+=v,t.leftArm.rotation.x+=.410367746202*o,t.rightArm.rotation.x+=.410367746202*o,t.leftArm.rotation.z+=a,t.rightArm.rotation.z+=-a,t.leftArm.position.y+=l,t.rightArm.position.y+=l,t.rightLeg.position.z+=-3.4500310377*o,t.leftLeg.position.z+=-3.4500310377*o}function ki(n){let e=n.skin,t=[e.layer1Material,e.layer1MaterialBiased,e.layer2Material,e.layer2MaterialBiased];for(let r of t)r.transparent=!0,r.alphaTest=.1,r.depthWrite=!0}E();x();k();R();import*as ne from"three";function h8(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 m8(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,a=n.width,v=n.height,l=t/2,c=r??1/Math.max(a,v),u=(B,H)=>{if(B<0||H<0||B>=a||H>=v)return!1;let G=(H*a+B)*4;return o[G+3]>128},h=[],p=[],g=[],y=[],A=0,b=(B,H,G,O,j,J,Z,$)=>(h.push(B,H,G),g.push(O,j),y.push(J,Z,$),A++),w=(B,H,G,O)=>{p.push(B,H,G,B,G,O)},S=(B,H)=>{let G=(B/a-.5)*c*a,O=-(H/v-.5)*c*v;return{x:G,y:O}},C=Array.from({length:v+1},()=>Array.from({length:a+1},()=>null)),M=Array.from({length:v+1},()=>Array.from({length:a+1},()=>null));for(let B=0;B<=v;B++)for(let H=0;H<=a;H++){let{x:G,y:O}=S(H-.5,B-.5),j=H/a,J=B/v,Z=!1,$=[[H-1,B-1],[H,B-1],[H-1,B],[H,B]];for(let[ue,le]of $)if(u(ue,le)){Z=!0;break}Z&&(C[B][H]=b(G,O,l,j,J,0,0,1),M[B][H]=b(G,O,-l,j,J,0,0,-1))}for(let B=0;B<v;B++)for(let H=0;H<a;H++){if(!u(H,B))continue;let G=C[B][H],O=C[B][H+1],j=C[B+1][H+1],J=C[B+1][H],Z=M[B][H],$=M[B][H+1],ue=M[B+1][H+1],le=M[B+1][H];G!==null&&O!==null&&j!==null&&J!==null&&w(G,O,j,J),Z!==null&&$!==null&&ue!==null&&le!==null&&w($,Z,le,ue)}for(let B=0;B<v;B++)for(let H=0;H<a;H++){if(!u(H,B))continue;let G=(H+.5)/a,O=(B+.5)/v;if(!u(H-1,B)){let j=C[B][H],J=C[B+1][H],Z=M[B][H],$=M[B+1][H];if(j!==null&&J!==null&&Z!==null&&$!==null){let ue=b(h[j*3],h[j*3+1],h[j*3+2],G,O,-1,0,0),le=b(h[J*3],h[J*3+1],h[J*3+2],G,O,-1,0,0),ce=b(h[$*3],h[$*3+1],h[$*3+2],G,O,-1,0,0),Ee=b(h[Z*3],h[Z*3+1],h[Z*3+2],G,O,-1,0,0);w(ue,le,ce,Ee)}}if(!u(H+1,B)){let j=C[B+1][H+1],J=C[B][H+1],Z=M[B+1][H+1],$=M[B][H+1];if(j!==null&&J!==null&&Z!==null&&$!==null){let ue=b(h[j*3],h[j*3+1],h[j*3+2],G,O,1,0,0),le=b(h[J*3],h[J*3+1],h[J*3+2],G,O,1,0,0),ce=b(h[$*3],h[$*3+1],h[$*3+2],G,O,1,0,0),Ee=b(h[Z*3],h[Z*3+1],h[Z*3+2],G,O,1,0,0);w(ue,le,ce,Ee)}}if(!u(H,B-1)){let j=C[B][H],J=C[B][H+1],Z=M[B][H],$=M[B][H+1];if(j!==null&&J!==null&&Z!==null&&$!==null){let ue=b(h[j*3],h[j*3+1],h[j*3+2],G,O,0,-1,0),le=b(h[J*3],h[J*3+1],h[J*3+2],G,O,0,-1,0),ce=b(h[$*3],h[$*3+1],h[$*3+2],G,O,0,-1,0),Ee=b(h[Z*3],h[Z*3+1],h[Z*3+2],G,O,0,-1,0);w(ue,le,ce,Ee)}}if(!u(H,B+1)){let j=C[B+1][H+1],J=C[B+1][H],Z=M[B+1][H+1],$=M[B+1][H];if(j!==null&&J!==null&&Z!==null&&$!==null){let ue=b(h[j*3],h[j*3+1],h[j*3+2],G,O,0,1,0),le=b(h[J*3],h[J*3+1],h[J*3+2],G,O,0,1,0),ce=b(h[$*3],h[$*3+1],h[$*3+2],G,O,0,1,0),Ee=b(h[Z*3],h[Z*3+1],h[Z*3+2],G,O,0,1,0);w(ue,le,ce,Ee)}}}let I=new ne.BufferGeometry;return I.setAttribute("position",new ne.Float32BufferAttribute(h,3)),I.setAttribute("uv",new ne.Float32BufferAttribute(g,2)),I.setAttribute("normal",new ne.Float32BufferAttribute(y,3)),I.setIndex(p),I.computeVertexNormals(),{geometry:I,totalVertices:A,totalTriangles:p.length/3}}function p8(n,e){let{u:t,v:r,sizeX:i,sizeY:s}=e,o=Math.max(1,Math.floor(i*n.image.width)),a=Math.max(1,Math.floor(s*n.image.height)),v=h8(o,a),l=v.getContext("2d");if(!l)throw new Error("Failed to get 2d context for item texture canvas");return l.imageSmoothingEnabled=!1,l.drawImage(n.image,t*n.image.width,r*n.image.height,i*n.image.width,s*n.image.height,0,0,v.width,v.height),v}function co(n,e,t={}){let{faceCamera:r=!1,use3D:i=!0,depth:s=.04}=t,{u:o,v:a,sizeX:v,sizeY:l}=e;if(r){let y=n.clone();y.flipY=!0,y.offset.set(o,1-a-l),y.repeat.set(v,l),y.needsUpdate=!0,y.magFilter=ne.NearestFilter,y.minFilter=ne.NearestFilter;let A=new ne.SpriteMaterial({map:y,transparent:!0,alphaTest:.1});return{mesh:new ne.Sprite(A),itemsTexture:y,cleanup(){y.dispose()}}}if(i)try{let y=p8(n,e),{geometry:A}=m8(y,{depth:s}),b=new ne.CanvasTexture(y);b.magFilter=ne.NearestFilter,b.minFilter=ne.NearestFilter,b.wrapS=b.wrapT=ne.ClampToEdgeWrapping,b.flipY=!1,b.needsUpdate=!0;let w=new ne.MeshStandardMaterial({map:b,side:ne.DoubleSide,transparent:!0,alphaTest:.1});return{mesh:new ne.Mesh(A,w),itemsTexture:b,cleanup(){b.dispose(),A.dispose(),w.map&&w.map.dispose(),w.dispose()}}}catch{}let c=n.clone();c.flipY=!0,c.offset.set(o,1-a-l),c.repeat.set(v,l),c.needsUpdate=!0,c.magFilter=ne.NearestFilter,c.minFilter=ne.NearestFilter;let u=c.clone();u.repeat.x*=-1,u.needsUpdate=!0,u.offset.set(o+v,1-a-l);let h=new ne.MeshStandardMaterial({map:c,transparent:!0,alphaTest:.1}),p=new ne.MeshStandardMaterial({map:u,transparent:!0,alphaTest:.1});return{mesh:new ne.Mesh(new ne.BoxGeometry(1,1,0),[new ne.MeshBasicMaterial({color:0}),new ne.MeshBasicMaterial({color:0}),new ne.MeshBasicMaterial({color:0}),new ne.MeshBasicMaterial({color:0}),h,p]),itemsTexture:c,itemsTextureFlipped:u,cleanup(){c.dispose(),u.dispose(),h.dispose(),p.dispose()}}}E();x();k();R();import*as te from"three";E();x();k();R();E();x();k();R();import{REVISION as g8}from"three";var uo=parseInt(g8.replace(/\D+/g,""));E();x();k();R();import{Loader as b8,FileLoader as y8,Group as _8,BufferGeometry as fo,Float32BufferAttribute as Wt,LineBasicMaterial as Ti,Material as ho,PointsMaterial as B1,MeshPhongMaterial as w8,LineSegments as mo,Points as Mi,Mesh as po,Vector3 as O5}from"three";var A8=/^[og]\s*(.+)?/,E8=/^mtllib /,x8=/^usemtl /,R8=/^usemap /,go=new O5,Si=new O5,bo=new O5,yo=new O5,l0=new O5;function k8(){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 a={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(v){let l={index:typeof v=="number"?v:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return l.clone=this.clone.bind(l),l}};return this.materials.push(a),a},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;go.fromArray(i,e),Si.fromArray(i,t),bo.fromArray(i,r),l0.subVectors(bo,Si),yo.subVectors(go,Si),l0.cross(yo),l0.normalize(),s.push(l0.x,l0.y,l0.z),s.push(l0.x,l0.y,l0.z),s.push(l0.x,l0.y,l0.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,a,v,l){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),a!==void 0&&a!==""){let g=this.normals.length;u=this.parseNormalIndex(a,g),h=this.parseNormalIndex(v,g),p=this.parseNormalIndex(l,g),this.addNormal(u,h,p)}else this.addFaceNormal(u,h,p);if(i!==void 0&&i!==""){let g=this.uvs.length;u=this.parseUVIndex(i,g),h=this.parseUVIndex(s,g),p=this.parseUVIndex(o,g),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 Vt=class extends b8{constructor(e){super(e),this.materials=null}load(e,t,r,i){let s=this,o=new y8(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(a))}catch(v){i&&i(v),s.manager.itemError(e)}},r,i)}setMaterials(e){return this.materials=e,this}parse(e){let t=new k8;e.indexOf(`\r
742
+ }`;function y8(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 bo=!1,Dn=class n{constructor({parent:e,autoPlace:t=e===void 0,container:r,width:i,title:s="Controls",closeFolders:o=!1,injectStyles:v=!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",l=>{(l.code==="Enter"||l.code==="Space")&&(l.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"),!bo&&v&&(y8(b8),bo=!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 Hn(this,e,t,r);switch(typeof e[t]){case"number":return new Ln(this,e,t,r,i,s);case"boolean":return new Bn(this,e,t);case"string":return new On(this,e,t);case"function":return new F5(this,e,t)}}addColor(e,t,r=1){return new In(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 F5||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 F5)){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}},Fn=Dn;var Dt=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(!ce){this.gui=new Fn,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 ce?this:(!this.initialized&&this.gui&&(this.loadSavedValues(),this.setupControls(),this.initialized=!0),this.show(),this)}get visible(){return ce?!1:this._visible}set visible(e){ce||!this.gui||(this._visible=e,this.gui.domElement.style.display=e?"block":"none",this.saveVisibility())}loadSavedValues(){if(!ce)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(!ce)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(!ce)try{localStorage.setItem(`${this.storageKey}_visible`,this._visible.toString())}catch{}}setupControls(){if(!(ce||!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 Fn,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(){ce||(this.saveValues(),this.saveVisibility())}destroy(){ce||!this.gui||(this.saveVisibility(),this.gui.destroy())}toggle(){this.visible=!this.visible}show(){this.visible=!0}hide(){this.visible=!1}};E();x();k();R();E();x();k();R();var Dr=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 _8={x:3e3,y:3e3,z:3e3,rotation:Math.PI,scale:1,default:3e3},E0=class{constructor(e,t,r){this.getState=e;this.setState=t;d(this,"animationController",new Dr);d(this,"defaultState");d(this,"speeds");d(this,"currentStateName","");d(this,"transitioningToStateName","");this.speeds={..._8},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],v=Math.abs(s-o),a=this.getPropertySpeed(i),l=v/a*1e3;t=Math.max(t,l)}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=De.Linear.None,s){this.isTransitioning&&this.animationController.forceFinish(!1),this.transitioningToStateName=t??"";let o=this.getState(),v=this.calculateDuration(e);this.animationController.startAnimation(()=>{let a=new G0;return new ze(o,a).to(e,v).easing(i).onUpdate(l=>{for(let c of Object.keys(l))this.setState(c,l[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,De.Linear.None,i)}getCurrentValue(e){return this.getState()[e]}get isTransitioning(){return this.animationController.isActive}};E();x();k();R();import{subscribeKey as w8}from"valtio/utils";function Fr(n,e,t,r,i){let s=0,o,v=async()=>{let a=++s,l=await n(e[t]);a===s?(o&&i?.(o),r(l),o=l):i?.(l)};return v(),w8(e,t,v)}E();x();k();R();var yo=Math.PI/180;function zr(n){let{walkDist:e,prevWalkDist:t,bob:r,prevBob:i,partialTick:s}=n,o=e-t,v=-(e+o*s),a=i+(r-i)*s,l=Math.sin(v*Math.PI),c=Math.cos(v*Math.PI);return{position:{x:l*a*.5,y:-Math.abs(c*a)},rotation:{x:Math.abs(Math.cos(v*Math.PI-.2)*a)*5*yo,z:l*a*3*yo}}}E();x();k();R();var Ur=n=>({"minecraft:display_context":"firstperson","minecraft:use_duration":n.playerStateReactive.itemUsageTicks,"minecraft:using_item":!!n.playerStateReactive.itemUsageTicks}),A8=()=>({"minecraft:display_context":"firstperson"}),Y0=(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},A8());return`${e.type}:${t}:${r.modelName}`};var Xe=new Ie.Matrix4,_o=n=>(n=(n+Math.PI)%(Math.PI*2),n<0&&(n+=Math.PI*2),n-Math.PI);function E8(n,e){let t=new Ie.Matrix4,r=1,i=Math.sqrt(n),s=-.3*Math.sin(i*Math.PI),o=.4*Math.sin(i*2*Math.PI),v=-.4*Math.sin(n*Math.PI);return t.multiply(Xe.makeTranslation(r*(s+.64),o-.6+e*-.6,v-.72)),t.multiply(Xe.makeRotationY(r*45*Math.PI/180)),t.multiply(Xe.makeRotationY(r*Math.sin(i*Math.PI)*70*Math.PI/180)),t.multiply(Xe.makeRotationZ(r*Math.sin(n*n*Math.PI)*-20*Math.PI/180)),t.multiply(Xe.makeTranslation(r*-1,3.6,3.5)),t.multiply(Xe.makeRotationZ(r*120*Math.PI/180)),t.multiply(Xe.makeRotationX(200*Math.PI/180)),t.multiply(Xe.makeRotationY(r*-135*Math.PI/180)),t.multiply(Xe.makeTranslation(r*5.6,0,0)),t.multiply(Xe.makeTranslation(r*-5/16,2/16,0)),t}function x8(n,e){let t=new Ie.Matrix4,r=1,i=Math.sqrt(n),s=-.4*Math.sin(i*Math.PI),o=.2*Math.sin(i*2*Math.PI),v=-.2*Math.sin(n*Math.PI);t.multiply(Xe.makeTranslation(r*s,o,v)),t.multiply(Xe.makeTranslation(r*.56,-.52+e*-.6,-.72));let a=Math.sin(n*n*Math.PI),l=Math.sin(i*Math.PI);return t.multiply(Xe.makeRotationY(r*(45+a*-20)*Math.PI/180)),t.multiply(Xe.makeRotationZ(r*l*-20*Math.PI/180)),t.multiply(Xe.makeRotationX(l*-80*Math.PI/180)),t.multiply(Xe.makeRotationY(r*-45*Math.PI/180)),t}var U5=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;d(this,"holdingBlock");d(this,"blockSwapAnimation");d(this,"cameraGroup",new Ie.Mesh);d(this,"armTransformGroup",new Ie.Group);d(this,"camera",new Ie.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 zn,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||D5().then(r=>{this.disposed||(this.playerHand=r,this.updateItem())}).then(()=>{if(this.disposed)return;let r=Fr(async()=>D5(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=>{Te(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,Te(this.cameraGroup,!0),this.holdingBlock&&this.holdingBlock!==this.playerHand&&Te(this.holdingBlock,!0),this.holdingBlock=void 0,this.playerHand&&(Te(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 Ie.Mesh,this.armTransformGroup=new Ie.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 Ie.Scene;o.add(this.cameraGroup);let v=t.getSize(new Ie.Vector2),a=v.height>v.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:l}=this;if(l&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),a){let c=Math.min(v.width,v.height);l?t.setViewport(0,0,c,c):t.setViewport(v.width-c,0,c,c)}t.render(o,this.camera),a&&t.setViewport(0,0,v.width,v.height),l&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new E0(()=>({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!==Y0(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 f=Math.min((t-this.lastBobUpdateTime)/1e3,.1),m=1-Math.pow(.5,f*28),g=1-Math.pow(.5,f*36);this.xBob+=(i-this.xBob)*m,this.yBob+=_o(s-this.yBob)*g}this.lastBobUpdateTime=t;let o=(i-this.xBob)*-.05,v=_o(s-this.yBob)*-.035;if(this.cameraGroup.position.copy(e.position),this.cameraGroup.rotation.copy(e.rotation),this.worldRenderer.displayOptions.inWorldRenderingConfig.viewBobbing){let f=this.worldRenderer.playerStateReactive;f.walkDist!==this.lastBobWalkDist&&(this.lastBobTickTime=t,this.lastBobWalkDist=f.walkDist);let m=Math.min((t-this.lastBobTickTime)/50,1),g=1.8,b=zr({walkDist:f.walkDist*g,prevWalkDist:f.prevWalkDist*g,bob:f.bob,prevBob:f.prevBob,partialTick:m});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+=v;let l=this.currentDisplayType,c=this.swingAnimator?.getSwingProgress()??0,u;l==="hand"?u=E8(c,this.equipProgress):u=x8(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},Ur(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 Ie.Group;r.name="displayTransform",e.type==="item"?(r.position.set(1.13/16,3.2/16,1.13/16),r.rotation.set(0,Ie.MathUtils.degToRad(-90),Ie.MathUtils.degToRad(25),"XYZ"),r.scale.set(.68,.68,.68)):(r.rotation.set(0,Ie.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=Y0(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&&Te(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 v=this.swingAnimator;v&&(v.type=o.type),this.idleAnimator=void 0}};var zn=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 Dt("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}},wo=(n,e,t,r,i)=>{let s=r.transformModel(e,{name:t,properties:{}});return Cn(n,[[s]],void 0,"plains",i)};E();x();k();R();import*as he from"three";import{subscribeKey as f3}from"valtio/utils";E();x();k();R();import*as Ve from"three";E();x();k();R();import l1 from"prismarine-nbt";import*as j from"three";E();x();k();R();E();x();k();R();import{BoxGeometry as Ze,DoubleSide as jn,FrontSide as Eo,Group as mt,Mesh as Qe,MeshStandardMaterial as G5,Vector2 as Gr}from"three";function Qn(n,e,t,r,i,s,o,v){let a=(B,L,G,H)=>[new Gr(B/o,1-H/v),new Gr(G/o,1-H/v),new Gr(G/o,1-L/v),new Gr(B/o,1-L/v)],l=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),f=a(e+s,t+s,e+r+s,t+s+i),m=a(e+r+s,t+s,e+r+s*2,t+i+s),g=a(e+r+s*2,t+s,e+r*2+s*2,t+i+s),b=n.attributes.uv,A=[m[3],m[2],m[0],m[1]],y=[u[3],u[2],u[0],u[1]],_=[l[3],l[2],l[0],l[1]],M=[c[0],c[1],c[3],c[2]],C=[f[3],f[2],f[0],f[1]],T=[g[3],g[2],g[0],g[1]],P=[];for(let B of[A,y,_,M,C,T])for(let L of B)P.push(L.x,L.y);b.set(new Float32Array(P)),b.needsUpdate=!0}function ht(n,e,t,r,i,s){Qn(n,e,t,r,i,s,64,64)}function Un(n,e,t,r,i,s){Qn(n,e,t,r,i,s,64,32)}var Ft=class extends mt{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"}},Gn=class extends mt{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 G5({side:Eo}),this.layer2Material=new G5({side:jn,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 Ze(8,8,8);ht(e,0,0,8,8,8);let t=new Qe(e,this.layer1Material),r=new Ze(9,9,9);ht(r,32,0,8,8,8);let i=new Qe(r,this.layer2Material);this.head=new Ft(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 Ze(8,12,4);ht(s,16,16,8,12,4);let o=new Qe(s,this.layer1Material),v=new Ze(8.5,12.5,4.5);ht(v,16,32,8,12,4);let a=new Qe(v,this.layer2Material);this.body=new Ft(o,a),this.body.name="body",this.body.add(o,a),this.body.position.y=-6,this.add(this.body);let l=new Ze,c=new Qe(l,this.layer1MaterialBiased);this.modelListeners.push(()=>{c.scale.x=this.slim?3:4,c.scale.y=12,c.scale.z=4,ht(l,40,16,this.slim?3:4,12,4)});let u=new Ze,f=new Qe(u,this.layer2MaterialBiased);this.modelListeners.push(()=>{f.scale.x=this.slim?3.5:4.5,f.scale.y=12.5,f.scale.z=4.5,ht(u,40,32,this.slim?3:4,12,4)});let m=new mt;m.add(c,f),this.modelListeners.push(()=>{m.position.x=this.slim?-.5:-1}),m.position.y=-4,this.rightArm=new Ft(c,f),this.rightArm.name="rightArm",this.rightArm.add(m),this.rightArm.position.x=-5,this.rightArm.position.y=-2,this.add(this.rightArm);let g=new Ze,b=new Qe(g,this.layer1MaterialBiased);this.modelListeners.push(()=>{b.scale.x=this.slim?3:4,b.scale.y=12,b.scale.z=4,ht(g,32,48,this.slim?3:4,12,4)});let A=new Ze,y=new Qe(A,this.layer2MaterialBiased);this.modelListeners.push(()=>{y.scale.x=this.slim?3.5:4.5,y.scale.y=12.5,y.scale.z=4.5,ht(A,48,48,this.slim?3:4,12,4)});let _=new mt;_.add(b,y),this.modelListeners.push(()=>{_.position.x=this.slim?.5:1}),_.position.y=-4,this.leftArm=new Ft(b,y),this.leftArm.name="leftArm",this.leftArm.add(_),this.leftArm.position.x=5,this.leftArm.position.y=-2,this.add(this.leftArm);let M=new Ze(4,12,4);ht(M,0,16,4,12,4);let C=new Qe(M,this.layer1MaterialBiased),T=new Ze(4.5,12.5,4.5);ht(T,0,32,4,12,4);let P=new Qe(T,this.layer2MaterialBiased),B=new mt;B.add(C,P),B.position.y=-6,this.rightLeg=new Ft(C,P),this.rightLeg.name="rightLeg",this.rightLeg.add(B),this.rightLeg.position.x=-1.9,this.rightLeg.position.y=-12,this.rightLeg.position.z=-.1,this.add(this.rightLeg);let L=new Ze(4,12,4);ht(L,16,48,4,12,4);let G=new Qe(L,this.layer1MaterialBiased),H=new Ze(4.5,12.5,4.5);ht(H,0,48,4,12,4);let N=new Qe(H,this.layer2MaterialBiased),Y=new mt;Y.add(G,N),Y.position.y=-6,this.leftLeg=new Ft(G,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 Ft)}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}},Vn=class extends mt{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 G5({side:jn,transparent:!0,alphaTest:1e-5});let e=new Ze(10,16,1);Un(e,0,0,10,16,1),this.cape=new Qe(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}},Wn=class extends mt{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 G5({side:jn,transparent:!0,alphaTest:1e-5});let e=new Ze(12,22,4);Un(e,22,0,10,20,2);let t=new Qe(e,this.material);t.position.x=-5,t.position.y=-10,t.position.z=-1,this.leftWing=new mt,this.leftWing.add(t),this.add(this.leftWing);let r=new Ze(12,22,4);Un(r,22,0,10,20,2);let i=new Qe(r,this.material);i.scale.x=-1,i.position.x=5,i.position.y=-10,i.position.z=-1,this.rightWing=new mt,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}},Nn=class extends mt{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 G5({side:Eo});let e=new Ze(8,8,4/3);Qn(e,0,0,6,6,1,14,7),this.rightEar=new Qe(e,this.material),this.rightEar.name="rightEar",this.rightEar.position.x=-6,this.add(this.rightEar),this.leftEar=new Qe(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}},Ao=10.8*Math.PI/180,K0=class extends mt{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 Gn,this.skin.name="skin",this.skin.position.y=8,this.add(this.skin),this.cape=new Vn,this.cape.name="cape",this.cape.position.y=8,this.cape.position.z=-2,this.cape.rotation.x=Ao,this.cape.rotation.y=Math.PI,this.add(this.cape),this.elytra=new Wn,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 Nn,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=Ao,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()}};E();x();k();R();import{Color as Rb,PointLight as kb,EquirectangularReflectionMapping as Tb,Group as Mb,NearestFilter as Sb,PerspectiveCamera as Cb,Scene as Bb,Texture as Pb,Vector2 as Ib,WebGLRenderer as Lb,AmbientLight as Hb,CanvasTexture as Ob,WebGLRenderTarget as Db,FloatType as Fb,DepthTexture as zb,Clock as Ub,Object3D as Gb,ColorManagement as Vb}from"three";import{OrbitControls as Nb}from"three/examples/jsm/controls/OrbitControls.js";import{EffectComposer as Qb}from"three/examples/jsm/postprocessing/EffectComposer.js";import"three/examples/jsm/postprocessing/Pass.js";import{RenderPass as qb}from"three/examples/jsm/postprocessing/RenderPass.js";import{ShaderPass as Zb}from"three/examples/jsm/postprocessing/ShaderPass.js";import{FXAAShader as ey}from"three/examples/jsm/shaders/FXAAShader.js";E();x();k();R();var Vr=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))}};E();x();k();R();import{CanvasTexture as cb,NearestFilter as db,Sprite as ub,SpriteMaterial as fb}from"three";E();x();k();R();var R8=Object.defineProperty,k8=(n,e,t)=>e in n?R8(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,we=(n,e,t)=>(k8(n,typeof e!="symbol"?e+"":e,t),t);function Yn(n){let e=[n];if(n.extra&&n.extra.length!==0)for(let t of n.extra)e.push(...Yn(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}`}},Ae=$;we(Ae,"CONTROL_STRING","\xA7");we(Ae,"BLACK",new $("color","black","BLACK","0",{color:"#000000"},{color:"#000000"}));we(Ae,"DARK_BLUE",new $("color","dark_blue","DARK_BLUE","1",{color:"#0000AA"},{color:"#00002A"}));we(Ae,"DARK_GREEN",new $("color","dark_green","DARK_GREEN","2",{color:"#00AA00"},{color:"#002A00"}));we(Ae,"DARK_AQUA",new $("color","dark_aqua","DARK_AQUA","3",{color:"#00AAAA"},{color:"#002A2A"}));we(Ae,"DARK_RED",new $("color","dark_red","DARK_RED","4",{color:"#AA0000"},{color:"#2A0000"}));we(Ae,"DARK_PURPLE",new $("color","dark_purple","DARK_PURPLE","5",{color:"#AA00AA"},{color:"#2A002A"}));we(Ae,"GOLD",new $("color","gold","GOLD","6",{color:"#FFAA00"},{color:"#2A2A00"}));we(Ae,"GRAY",new $("color","gray","GRAY","7",{color:"#AAAAAA"},{color:"#2A2A2A"}));we(Ae,"DARK_GRAY",new $("color","dark_gray","DARK_GRAY","8",{color:"#555555"},{color:"#151515"}));we(Ae,"BLUE",new $("color","blue","BLUE","9",{color:"#5555FF"},{color:"#15153F"}));we(Ae,"GREEN",new $("color","green","GREEN","a",{color:"#55FF55"},{color:"#153F15"}));we(Ae,"AQUA",new $("color","aqua","AQUA","b",{color:"#55FFFF"},{color:"#153F3F"}));we(Ae,"RED",new $("color","red","RED","c",{color:"#FF5555"},{color:"#3F1515"}));we(Ae,"LIGHT_PURPLE",new $("color","light_purple","LIGHT_PURPLE","d",{color:"#FF55FF"},{color:"#3F153F"}));we(Ae,"YELLOW",new $("color","yellow","YELLOW","e",{color:"#FFFF55"},{color:"#3F3F15"}));we(Ae,"WHITE",new $("color","white","WHITE","f",{color:"#FFFFFF"},{color:"#3F3F3F"}));we(Ae,"OBFUSCATED",new $("obfuscated",!0,"OBFUSCATED","k",{}));we(Ae,"BOLD",new $("bold",!0,"BOLD","l",{"font-weight":"bold"}));we(Ae,"STRIKETHROUGH",new $("strikethrough",!0,"STRIKETHROUGH","m",{"text-decoration":"line-through"}));we(Ae,"UNDERLINE",new $("underlined",!0,"UNDERLINE","n",{"text-decoration":"underline"}));we(Ae,"ITALIC",new $("italic",!0,"ITALIC","o",{"font-style":"italic"}));we(Ae,"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`}});we(Ae,"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 J5=y5(Kn(),1);Zn();var v3=y5(Ko(),1);import l3 from"prismarine-chat";E();x();k();R();import*as $n from"three";E();x();k();R();var d4=n=>Math.max(0,Math.min(1,n)),u4=(n,e,t)=>n+(e-n)*t;function f4(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 Q5=class extends Vr{constructor(){super(...arguments);d(this,"switchAnimationCallback");d(this,"isRunning",!1);d(this,"isMoving",!0);d(this,"isCrouched",!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.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 v=this._phase+(this.isRunning?Math.PI*.5:0),a=!1;m4(t,this.isCrouched?1:0);let l=this.isRunning?Math.cos(v):Math.sin(v);if(Math.abs(l)<.02&&this.switchAnimationCallback&&(a=!0),this.isRunning?(t.skin.leftLeg.rotation.x=Math.cos(v+Math.PI)*1.3,t.skin.rightLeg.rotation.x=Math.cos(v)*1.3):(t.skin.leftLeg.rotation.x=Math.sin(v)*.5,t.skin.rightLeg.rotation.x=Math.sin(v+Math.PI)*.5),this.isRunning){t.skin.leftArm.rotation.x=Math.cos(v)*1.5,t.skin.rightArm.rotation.x=Math.cos(v+Math.PI)*1.5;let c=Math.PI*.1;t.skin.leftArm.rotation.z=Math.cos(v)*.1+c,t.skin.rightArm.rotation.z=Math.cos(v+Math.PI)*.1-c}else{t.skin.leftArm.rotation.x=Math.sin(v+Math.PI)*.5,t.skin.rightArm.rotation.x=Math.sin(v)*.5;let c=Math.PI*.02;t.skin.leftArm.rotation.z=Math.cos(v)*.03+c,t.skin.rightArm.rotation.z=Math.cos(v+Math.PI)*.03-c}if(this._swingTime!==null){this._swingTime+=r;let c=Math.min(this._swingTime/this._swingDuration,1);h4.animate(c,t,this.isMoving),c>=1&&(this._swingTime=null)}if(this.isRunning&&(t.rotation.z=Math.cos(v+Math.PI)*.01),this.isRunning){let c=Math.PI*.3;t.cape.rotation.x=Math.sin(v*2)*.1+c}else{let c=Math.PI*.06;t.cape.rotation.x=Math.sin(v/1.5)*.06+c}if(a){let c=this.switchAnimationCallback;this.switchAnimationCallback=null,c?.()}}},h4={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 m4(n,e){let t=n?.skin,r=n?.cape,i=n?.elytra;if(!t||!r)return;let s=d4(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=u4(.72,.26179944+.4582006,o)),f4(n),t.head.position.y+=-3.618325234674*o;let v=.1*o,a=(3.618325234674-3.4500310377)*o,l=-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+=v,t.rightArm.rotation.z+=-v,t.leftArm.position.y+=l,t.rightArm.position.y+=l,t.rightLeg.position.z+=-3.4500310377*o,t.leftLeg.position.z+=-3.4500310377*o}function e1(n){let e=n.skin,t=[e.layer1Material,e.layer1MaterialBiased,e.layer2Material,e.layer2MaterialBiased];for(let r of t)r.transparent=!0,r.alphaTest=.1,r.depthWrite=!0}E();x();k();R();import*as ne from"three";function p4(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 g4(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,v=n.width,a=n.height,l=t/2,c=r??1/Math.max(v,a),u=(B,L)=>{if(B<0||L<0||B>=v||L>=a)return!1;let G=(L*v+B)*4;return o[G+3]>128},f=[],m=[],g=[],b=[],A=0,y=(B,L,G,H,N,Y,q,Z)=>(f.push(B,L,G),g.push(H,N),b.push(Y,q,Z),A++),_=(B,L,G,H)=>{m.push(B,L,G,B,G,H)},M=(B,L)=>{let G=(B/v-.5)*c*v,H=-(L/a-.5)*c*a;return{x:G,y:H}},C=Array.from({length:a+1},()=>Array.from({length:v+1},()=>null)),T=Array.from({length:a+1},()=>Array.from({length:v+1},()=>null));for(let B=0;B<=a;B++)for(let L=0;L<=v;L++){let{x:G,y:H}=M(L-.5,B-.5),N=L/v,Y=B/a,q=!1,Z=[[L-1,B-1],[L,B-1],[L-1,B],[L,B]];for(let[ae,oe]of Z)if(u(ae,oe)){q=!0;break}q&&(C[B][L]=y(G,H,l,N,Y,0,0,1),T[B][L]=y(G,H,-l,N,Y,0,0,-1))}for(let B=0;B<a;B++)for(let L=0;L<v;L++){if(!u(L,B))continue;let G=C[B][L],H=C[B][L+1],N=C[B+1][L+1],Y=C[B+1][L],q=T[B][L],Z=T[B][L+1],ae=T[B+1][L+1],oe=T[B+1][L];G!==null&&H!==null&&N!==null&&Y!==null&&_(G,H,N,Y),q!==null&&Z!==null&&ae!==null&&oe!==null&&_(Z,q,oe,ae)}for(let B=0;B<a;B++)for(let L=0;L<v;L++){if(!u(L,B))continue;let G=(L+.5)/v,H=(B+.5)/a;if(!u(L-1,B)){let N=C[B][L],Y=C[B+1][L],q=T[B][L],Z=T[B+1][L];if(N!==null&&Y!==null&&q!==null&&Z!==null){let ae=y(f[N*3],f[N*3+1],f[N*3+2],G,H,-1,0,0),oe=y(f[Y*3],f[Y*3+1],f[Y*3+2],G,H,-1,0,0),le=y(f[Z*3],f[Z*3+1],f[Z*3+2],G,H,-1,0,0),ye=y(f[q*3],f[q*3+1],f[q*3+2],G,H,-1,0,0);_(ae,oe,le,ye)}}if(!u(L+1,B)){let N=C[B+1][L+1],Y=C[B][L+1],q=T[B+1][L+1],Z=T[B][L+1];if(N!==null&&Y!==null&&q!==null&&Z!==null){let ae=y(f[N*3],f[N*3+1],f[N*3+2],G,H,1,0,0),oe=y(f[Y*3],f[Y*3+1],f[Y*3+2],G,H,1,0,0),le=y(f[Z*3],f[Z*3+1],f[Z*3+2],G,H,1,0,0),ye=y(f[q*3],f[q*3+1],f[q*3+2],G,H,1,0,0);_(ae,oe,le,ye)}}if(!u(L,B-1)){let N=C[B][L],Y=C[B][L+1],q=T[B][L],Z=T[B][L+1];if(N!==null&&Y!==null&&q!==null&&Z!==null){let ae=y(f[N*3],f[N*3+1],f[N*3+2],G,H,0,-1,0),oe=y(f[Y*3],f[Y*3+1],f[Y*3+2],G,H,0,-1,0),le=y(f[Z*3],f[Z*3+1],f[Z*3+2],G,H,0,-1,0),ye=y(f[q*3],f[q*3+1],f[q*3+2],G,H,0,-1,0);_(ae,oe,le,ye)}}if(!u(L,B+1)){let N=C[B+1][L+1],Y=C[B+1][L],q=T[B+1][L+1],Z=T[B+1][L];if(N!==null&&Y!==null&&q!==null&&Z!==null){let ae=y(f[N*3],f[N*3+1],f[N*3+2],G,H,0,1,0),oe=y(f[Y*3],f[Y*3+1],f[Y*3+2],G,H,0,1,0),le=y(f[Z*3],f[Z*3+1],f[Z*3+2],G,H,0,1,0),ye=y(f[q*3],f[q*3+1],f[q*3+2],G,H,0,1,0);_(ae,oe,le,ye)}}}let P=new ne.BufferGeometry;return P.setAttribute("position",new ne.Float32BufferAttribute(f,3)),P.setAttribute("uv",new ne.Float32BufferAttribute(g,2)),P.setAttribute("normal",new ne.Float32BufferAttribute(b,3)),P.setIndex(m),P.computeVertexNormals(),{geometry:P,totalVertices:A,totalTriangles:m.length/3}}function b4(n,e){let{u:t,v:r,sizeX:i,sizeY:s}=e,o=Math.max(1,Math.floor(i*n.image.width)),v=Math.max(1,Math.floor(s*n.image.height)),a=p4(o,v),l=a.getContext("2d");if(!l)throw new Error("Failed to get 2d context for item texture canvas");return l.imageSmoothingEnabled=!1,l.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 Jo(n,e,t={}){let{faceCamera:r=!1,use3D:i=!0,depth:s=.04}=t,{u:o,v,sizeX:a,sizeY:l}=e;if(r){let b=n.clone();b.flipY=!0,b.offset.set(o,1-v-l),b.repeat.set(a,l),b.needsUpdate=!0,b.magFilter=ne.NearestFilter,b.minFilter=ne.NearestFilter;let A=new ne.SpriteMaterial({map:b,transparent:!0,alphaTest:.1});return{mesh:new ne.Sprite(A),itemsTexture:b,cleanup(){b.dispose()}}}if(i)try{let b=b4(n,e),{geometry:A}=g4(b,{depth:s}),y=new ne.CanvasTexture(b);y.magFilter=ne.NearestFilter,y.minFilter=ne.NearestFilter,y.wrapS=y.wrapT=ne.ClampToEdgeWrapping,y.flipY=!1,y.needsUpdate=!0;let _=new ne.MeshStandardMaterial({map:y,side:ne.DoubleSide,transparent:!0,alphaTest:.1});return{mesh:new ne.Mesh(A,_),itemsTexture:y,cleanup(){y.dispose(),A.dispose(),_.map&&_.map.dispose(),_.dispose()}}}catch{}let c=n.clone();c.flipY=!0,c.offset.set(o,1-v-l),c.repeat.set(a,l),c.needsUpdate=!0,c.magFilter=ne.NearestFilter,c.minFilter=ne.NearestFilter;let u=c.clone();u.repeat.x*=-1,u.needsUpdate=!0,u.offset.set(o+a,1-v-l);let f=new ne.MeshStandardMaterial({map:c,transparent:!0,alphaTest:.1}),m=new ne.MeshStandardMaterial({map:u,transparent:!0,alphaTest:.1});return{mesh:new ne.Mesh(new ne.BoxGeometry(1,1,0),[new ne.MeshBasicMaterial({color:0}),new ne.MeshBasicMaterial({color:0}),new ne.MeshBasicMaterial({color:0}),new ne.MeshBasicMaterial({color:0}),f,m]),itemsTexture:c,itemsTextureFlipped:u,cleanup(){c.dispose(),u.dispose(),f.dispose(),m.dispose()}}}E();x();k();R();import*as te from"three";E();x();k();R();E();x();k();R();import{REVISION as y4}from"three";var qo=parseInt(y4.replace(/\D+/g,""));E();x();k();R();import{Loader as _4,FileLoader as w4,Group as A4,BufferGeometry as Xo,Float32BufferAttribute as e5,LineBasicMaterial as t1,Material as Zo,PointsMaterial as Jr,MeshPhongMaterial as E4,LineSegments as $o,Points as r1,Mesh as ea,Vector3 as Y5}from"three";var x4=/^[og]\s*(.+)?/,R4=/^mtllib /,k4=/^usemtl /,T4=/^usemap /,ta=new Y5,i1=new Y5,ra=new Y5,ia=new Y5,pt=new Y5;function M4(){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 v={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 l={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 l.clone=this.clone.bind(l),l}};return this.materials.push(v),v},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;ta.fromArray(i,e),i1.fromArray(i,t),ra.fromArray(i,r),pt.subVectors(ra,i1),ia.subVectors(ta,i1),pt.cross(ia),pt.normalize(),s.push(pt.x,pt.y,pt.z),s.push(pt.x,pt.y,pt.z),s.push(pt.x,pt.y,pt.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,v,a,l){let c=this.vertices.length,u=this.parseVertexIndex(e,c),f=this.parseVertexIndex(t,c),m=this.parseVertexIndex(r,c);if(this.addVertex(u,f,m),this.addColor(u,f,m),v!==void 0&&v!==""){let g=this.normals.length;u=this.parseNormalIndex(v,g),f=this.parseNormalIndex(a,g),m=this.parseNormalIndex(l,g),this.addNormal(u,f,m)}else this.addFaceNormal(u,f,m);if(i!==void 0&&i!==""){let g=this.uvs.length;u=this.parseUVIndex(i,g),f=this.parseUVIndex(s,g),m=this.parseUVIndex(o,g),this.addUV(u,f,m),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 t5=class extends _4{constructor(e){super(e),this.materials=null}load(e,t,r,i){let s=this,o=new w4(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(v){try{t(s.parse(v))}catch(a){i&&i(a),s.manager.itemError(e)}},r,i)}setMaterials(e){return this.materials=e,this}parse(e){let t=new M4;e.indexOf(`\r
721
743
  `)!==-1&&(e=e.replace(/\r\n/g,`
722
744
  `)),e.indexOf(`\\
723
745
  `)!==-1&&(e=e.replace(/\\\n/g,""));let r=e.split(`
724
- `),i="",s="",o=0,a=[],v=typeof"".trimLeft=="function";for(let u=0,h=r.length;u<h;u++)if(i=r[u],i=v?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 g=i.substr(1).trim().split(/\s+/),y=[];for(let b=0,w=g.length;b<w;b++){let S=g[b];if(S.length>0){let C=S.split("/");y.push(C)}}let A=y[0];for(let b=1,w=y.length-1;b<w;b++){let S=y[b],C=y[b+1];t.addFace(A[0],S[0],C[0],A[1],S[1],C[1],A[2],S[2],C[2])}}else if(s==="l"){let p=i.substring(1).trim().split(" "),g=[],y=[];if(i.indexOf("/")===-1)g=p;else for(let A=0,b=p.length;A<b;A++){let w=p[A].split("/");w[0]!==""&&g.push(w[0]),w[1]!==""&&y.push(w[1])}t.addLineGeometry(g,y)}else if(s==="p"){let g=i.substr(1).trim().split(" ");t.addPointGeometry(g)}else if((a=A8.exec(i))!==null){let p=(" "+a[0].substr(1).trim()).substr(1);t.startObject(p)}else if(x8.test(i))t.object.startMaterial(i.substring(7).trim(),t.materialLibraries);else if(E8.test(i))t.materialLibraries.push(i.substring(7).trim());else if(!R8.test(i)){if(s==="s"){if(a=i.split(" "),a.length>1){let g=a[1].trim().toLowerCase();t.object.smooth=g!=="0"&&g!=="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 l=new _8;if(l.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],g=p.geometry,y=p.materials,A=g.type==="Line",b=g.type==="Points",w=!1;if(g.vertices.length===0)continue;let S=new fo;S.setAttribute("position",new Wt(g.vertices,3)),g.normals.length>0&&S.setAttribute("normal",new Wt(g.normals,3)),g.colors.length>0&&(w=!0,S.setAttribute("color",new Wt(g.colors,3))),g.hasUVIndices===!0&&S.setAttribute("uv",new Wt(g.uvs,2));let C=[];for(let I=0,B=y.length;I<B;I++){let H=y[I],G=H.name+"_"+H.smooth+"_"+w,O=t.materials[G];if(this.materials!==null){if(O=this.materials.create(H.name),A&&O&&!(O instanceof Ti)){let j=new Ti;ho.prototype.copy.call(j,O),j.color.copy(O.color),O=j}else if(b&&O&&!(O instanceof B1)){let j=new B1({size:10,sizeAttenuation:!1});ho.prototype.copy.call(j,O),j.color.copy(O.color),j.map=O.map,O=j}}O===void 0&&(A?O=new Ti:b?O=new B1({size:1,sizeAttenuation:!1}):O=new w8,O.name=H.name,O.flatShading=!H.smooth,O.vertexColors=w,t.materials[G]=O),C.push(O)}let M;if(C.length>1){for(let I=0,B=y.length;I<B;I++){let H=y[I];S.addGroup(H.groupStart,H.groupCount,I)}A?M=new mo(S,C):b?M=new Mi(S,C):M=new po(S,C)}else A?M=new mo(S,C[0]):b?M=new Mi(S,C[0]):M=new po(S,C[0]);M.name=p.name,l.add(M)}else if(t.vertices.length>0){let u=new B1({size:1,sizeAttenuation:!1}),h=new fo;h.setAttribute("position",new Wt(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0&&(h.setAttribute("color",new Wt(t.colors,3)),u.vertexColors=!0);let p=new Mi(h,u);l.add(p)}return l}};E();x();k();R();import{InstancedBufferGeometry as T8,Float32BufferAttribute as _o,InstancedInterleavedBuffer as wo,InterleavedBufferAttribute as P1,WireframeGeometry as M8,Box3 as Eo,Sphere as S8,Vector3 as C8}from"three";var Ao=new Eo,I1=new C8,ft=class extends T8{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 _o(e,3)),this.setAttribute("uv",new _o(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 wo(t,6,1);return this.setAttribute("instanceStart",new P1(r,3,0)),this.setAttribute("instanceEnd",new P1(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 wo(r,t*2,1);return this.setAttribute("instanceColorStart",new P1(i,t,0)),this.setAttribute("instanceColorEnd",new P1(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 M8(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Eo);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Ao.setFromBufferAttribute(t),this.boundingBox.union(Ao))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new S8),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++)I1.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(I1)),I1.fromBufferAttribute(t,s),i=Math.max(i,r.distanceToSquared(I1));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)}}toJSON(){}applyMatrix(e){return this.applyMatrix4(e)}};E();x();k();R();import{Mesh as I8,InstancedInterleavedBuffer as H8,InterleavedBufferAttribute as ko,Vector3 as So,Vector4 as O8}from"three";E();x();k();R();import{ShaderMaterial as B8,UniformsUtils as xo,UniformsLib as Ro,Vector2 as P8}from"three";var ht=class extends B8{constructor(e){super({type:"LineMaterial",uniforms:xo.clone(xo.merge([Ro.common,Ro.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new P8(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
746
+ `),i="",s="",o=0,v=[],a=typeof"".trimLeft=="function";for(let u=0,f=r.length;u<f;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 m=i.split(/\s+/);switch(m[0]){case"v":t.vertices.push(parseFloat(m[1]),parseFloat(m[2]),parseFloat(m[3])),m.length>=7?t.colors.push(parseFloat(m[4]),parseFloat(m[5]),parseFloat(m[6])):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(m[1]),parseFloat(m[2]),parseFloat(m[3]));break;case"vt":t.uvs.push(parseFloat(m[1]),parseFloat(m[2]));break}}else if(s==="f"){let g=i.substr(1).trim().split(/\s+/),b=[];for(let y=0,_=g.length;y<_;y++){let M=g[y];if(M.length>0){let C=M.split("/");b.push(C)}}let A=b[0];for(let y=1,_=b.length-1;y<_;y++){let M=b[y],C=b[y+1];t.addFace(A[0],M[0],C[0],A[1],M[1],C[1],A[2],M[2],C[2])}}else if(s==="l"){let m=i.substring(1).trim().split(" "),g=[],b=[];if(i.indexOf("/")===-1)g=m;else for(let A=0,y=m.length;A<y;A++){let _=m[A].split("/");_[0]!==""&&g.push(_[0]),_[1]!==""&&b.push(_[1])}t.addLineGeometry(g,b)}else if(s==="p"){let g=i.substr(1).trim().split(" ");t.addPointGeometry(g)}else if((v=x4.exec(i))!==null){let m=(" "+v[0].substr(1).trim()).substr(1);t.startObject(m)}else if(k4.test(i))t.object.startMaterial(i.substring(7).trim(),t.materialLibraries);else if(R4.test(i))t.materialLibraries.push(i.substring(7).trim());else if(!T4.test(i)){if(s==="s"){if(v=i.split(" "),v.length>1){let g=v[1].trim().toLowerCase();t.object.smooth=g!=="0"&&g!=="off"}else t.object.smooth=!0;let m=t.object.currentMaterial();m&&(m.smooth=t.object.smooth)}else if(i==="\0")continue}}t.finalize();let l=new A4;if(l.materialLibraries=[].concat(t.materialLibraries),!(t.objects.length===1&&t.objects[0].geometry.vertices.length===0)===!0)for(let u=0,f=t.objects.length;u<f;u++){let m=t.objects[u],g=m.geometry,b=m.materials,A=g.type==="Line",y=g.type==="Points",_=!1;if(g.vertices.length===0)continue;let M=new Xo;M.setAttribute("position",new e5(g.vertices,3)),g.normals.length>0&&M.setAttribute("normal",new e5(g.normals,3)),g.colors.length>0&&(_=!0,M.setAttribute("color",new e5(g.colors,3))),g.hasUVIndices===!0&&M.setAttribute("uv",new e5(g.uvs,2));let C=[];for(let P=0,B=b.length;P<B;P++){let L=b[P],G=L.name+"_"+L.smooth+"_"+_,H=t.materials[G];if(this.materials!==null){if(H=this.materials.create(L.name),A&&H&&!(H instanceof t1)){let N=new t1;Zo.prototype.copy.call(N,H),N.color.copy(H.color),H=N}else if(y&&H&&!(H instanceof Jr)){let N=new Jr({size:10,sizeAttenuation:!1});Zo.prototype.copy.call(N,H),N.color.copy(H.color),N.map=H.map,H=N}}H===void 0&&(A?H=new t1:y?H=new Jr({size:1,sizeAttenuation:!1}):H=new E4,H.name=L.name,H.flatShading=!L.smooth,H.vertexColors=_,t.materials[G]=H),C.push(H)}let T;if(C.length>1){for(let P=0,B=b.length;P<B;P++){let L=b[P];M.addGroup(L.groupStart,L.groupCount,P)}A?T=new $o(M,C):y?T=new r1(M,C):T=new ea(M,C)}else A?T=new $o(M,C[0]):y?T=new r1(M,C[0]):T=new ea(M,C[0]);T.name=m.name,l.add(T)}else if(t.vertices.length>0){let u=new Jr({size:1,sizeAttenuation:!1}),f=new Xo;f.setAttribute("position",new e5(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0&&(f.setAttribute("color",new e5(t.colors,3)),u.vertexColors=!0);let m=new r1(f,u);l.add(m)}return l}};E();x();k();R();import{InstancedBufferGeometry as S4,Float32BufferAttribute as na,InstancedInterleavedBuffer as sa,InterleavedBufferAttribute as qr,WireframeGeometry as C4,Box3 as aa,Sphere as B4,Vector3 as P4}from"three";var oa=new aa,Xr=new P4,k0=class extends S4{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 na(e,3)),this.setAttribute("uv",new na(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 sa(t,6,1);return this.setAttribute("instanceStart",new qr(r,3,0)),this.setAttribute("instanceEnd",new qr(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 sa(r,t*2,1);return this.setAttribute("instanceColorStart",new qr(i,t,0)),this.setAttribute("instanceColorEnd",new qr(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 C4(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new aa);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),oa.setFromBufferAttribute(t),this.boundingBox.union(oa))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new B4),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++)Xr.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(Xr)),Xr.fromBufferAttribute(t,s),i=Math.max(i,r.distanceToSquared(Xr));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)}}toJSON(){}applyMatrix(e){return this.applyMatrix4(e)}};E();x();k();R();import{Mesh as H4,InstancedInterleavedBuffer as O4,InterleavedBufferAttribute as ca,Vector3 as fa,Vector4 as D4}from"three";E();x();k();R();import{ShaderMaterial as I4,UniformsUtils as va,UniformsLib as la,Vector2 as L4}from"three";var T0=class extends I4{constructor(e){super({type:"LineMaterial",uniforms:va.clone(va.merge([la.common,la.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new L4(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
725
747
  #include <common>
726
748
  #include <fog_pars_vertex>
727
749
  #include <logdepthbuf_pars_vertex>
@@ -1124,12 +1146,12 @@ void main() {
1124
1146
  gl_FragColor = diffuseColor;
1125
1147
 
1126
1148
  #include <tonemapping_fragment>
1127
- #include <${uo>=154?"colorspace_fragment":"encodings_fragment"}>
1149
+ #include <${qo>=154?"colorspace_fragment":"encodings_fragment"}>
1128
1150
  #include <fog_fragment>
1129
1151
  #include <premultiplied_alpha_fragment>
1130
1152
 
1131
1153
  }
1132
- `,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 To=new So,Mo=new So,Ci=new O8,D5=class extends I8{constructor(e=new ft,t=new ht({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,a=0,v=t.count;o<v;o++,a+=2)To.fromBufferAttribute(t,o),Mo.fromBufferAttribute(r,o),i[a]=a===0?0:i[a-1],i[a+1]=i[a]+To.distanceTo(Mo);let s=new H8(i,2,1);return e.setAttribute("instanceDistanceStart",new ko(s,1,0)),e.setAttribute("instanceDistanceEnd",new ko(s,1,1)),this}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(Ci),this.material.uniforms.resolution.value.set(Ci.z,Ci.w))}};import{GLTFLoader as w4}from"three/examples/jsm/loaders/GLTFLoader.js";import A4 from"mc-assets/dist/other-textures/latest/entity/zombie/husk.png";import{Vec3 as H1}from"vec3";import E4 from"mc-assets/dist/other-textures/latest/entity/cat/ocelot.png";import x4 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/arrow.png";import R4 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/spectral_arrow.png";import k4 from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/tipped_arrow.png";var Co={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}};E();x();k();R();var jt={};q5(jt,{allay:()=>Bo,arrow:()=>t3,axolotl:()=>Po,blaze:()=>Io,boat:()=>f3,camel:()=>Ho,cat:()=>Oo,chicken:()=>Do,cod:()=>Fo,creeper:()=>zo,dolphin:()=>Lo,ender_dragon:()=>Uo,enderman:()=>Go,endermite:()=>No,fox:()=>Wo,frog:()=>Vo,ghast:()=>jo,goat:()=>Yo,guardian:()=>Qo,horse:()=>Ko,llama:()=>Jo,minecart:()=>Zo,parrot:()=>qo,piglin:()=>Xo,pillager:()=>$o,rabbit:()=>e3,shulker:()=>r3,sniffer:()=>i3,spider:()=>n3,tadpole:()=>s3,turtle:()=>o3,vex:()=>a3,villager:()=>v3,warden:()=>l3,witch:()=>c3,wolf:()=>d3,zombie_villager:()=>u3});E();x();k();R();var Bo=`# Made in Blockbench 4.9.4
1154
+ `,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 da=new fa,ua=new fa,n1=new D4,K5=class extends H4{constructor(e=new k0,t=new T0({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,v=0,a=t.count;o<a;o++,v+=2)da.fromBufferAttribute(t,o),ua.fromBufferAttribute(r,o),i[v]=v===0?0:i[v-1],i[v+1]=i[v]+da.distanceTo(ua);let s=new O4(i,2,1);return e.setAttribute("instanceDistanceStart",new ca(s,1,0)),e.setAttribute("instanceDistanceEnd",new ca(s,1,1)),this}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(n1),this.material.uniforms.resolution.value.set(n1.z,n1.w))}};import{GLTFLoader as Ev}from"three/examples/jsm/loaders/GLTFLoader.js";import xv from"mc-assets/dist/other-textures/latest/entity/zombie/husk.png";import{Vec3 as Zr}from"vec3";import Rv from"mc-assets/dist/other-textures/latest/entity/cat/ocelot.png";import kv from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/arrow.png";import Tv from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/spectral_arrow.png";import Mv from"mc-assets/dist/other-textures/1.21.2/entity/projectiles/tipped_arrow.png";var ha={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}};E();x();k();R();var r5={};hr(r5,{allay:()=>ma,arrow:()=>za,axolotl:()=>pa,blaze:()=>ga,boat:()=>Xa,camel:()=>ba,cat:()=>ya,chicken:()=>_a,cod:()=>wa,creeper:()=>Aa,dolphin:()=>Ea,ender_dragon:()=>xa,enderman:()=>Ra,endermite:()=>ka,fox:()=>Ta,frog:()=>Ma,ghast:()=>Sa,goat:()=>Ca,guardian:()=>Ba,horse:()=>Pa,llama:()=>Ia,minecart:()=>La,parrot:()=>Ha,piglin:()=>Oa,pillager:()=>Da,rabbit:()=>Fa,shulker:()=>Ua,sniffer:()=>Ga,spider:()=>Va,tadpole:()=>Wa,turtle:()=>Na,vex:()=>ja,villager:()=>Qa,warden:()=>Ya,witch:()=>Ka,wolf:()=>Ja,zombie_villager:()=>qa});E();x();k();R();var ma=`# Made in Blockbench 4.9.4
1133
1155
  mtllib materials.mtl
1134
1156
 
1135
1157
  o head
@@ -1453,7 +1475,7 @@ f 51/152/38 52/151/38 50/150/38 49/149/38
1453
1475
  f 56/156/39 51/155/39 49/154/39 54/153/39
1454
1476
  f 55/160/40 56/159/40 54/158/40 53/157/40
1455
1477
  f 54/164/41 49/163/41 50/162/41 53/161/41
1456
- f 55/168/42 52/167/42 51/166/42 56/165/42`;var Po=`# Made in Blockbench 4.9.4
1478
+ f 55/168/42 52/167/42 51/166/42 56/165/42`;var pa=`# Made in Blockbench 4.9.4
1457
1479
  mtllib materials.mtl
1458
1480
 
1459
1481
  o body
@@ -1961,7 +1983,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
1961
1983
  f 88/252/63 83/251/63 81/250/63 86/249/63
1962
1984
  f 87/256/64 88/255/64 86/254/64 85/253/64
1963
1985
  f 86/260/65 81/259/65 82/258/65 85/257/65
1964
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var Io=`# Made in Blockbench 4.9.4
1986
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var ga=`# Made in Blockbench 4.9.4
1965
1987
  mtllib materials.mtl
1966
1988
 
1967
1989
  o upperBodyParts0
@@ -2561,7 +2583,7 @@ f 99/296/74 100/295/74 98/294/74 97/293/74
2561
2583
  f 104/300/75 99/299/75 97/298/75 102/297/75
2562
2584
  f 103/304/76 104/303/76 102/302/76 101/301/76
2563
2585
  f 102/308/77 97/307/77 98/306/77 101/305/77
2564
- f 103/312/78 100/311/78 99/310/78 104/309/78`;var Ho=`# Made in Blockbench 4.9.4
2586
+ f 103/312/78 100/311/78 99/310/78 104/309/78`;var ba=`# Made in Blockbench 4.9.4
2565
2587
  mtllib materials.mtl
2566
2588
 
2567
2589
  o body
@@ -3621,7 +3643,7 @@ f 179/536/134 180/535/134 178/534/134 177/533/134
3621
3643
  f 184/540/135 179/539/135 177/538/135 182/537/135
3622
3644
  f 183/544/136 184/543/136 182/542/136 181/541/136
3623
3645
  f 182/548/137 177/547/137 178/546/137 181/545/137
3624
- f 183/552/138 180/551/138 179/550/138 184/549/138`;var Oo=`# Made in Blockbench 4.9.4
3646
+ f 183/552/138 180/551/138 179/550/138 184/549/138`;var ya=`# Made in Blockbench 4.9.4
3625
3647
  mtllib materials.mtl
3626
3648
 
3627
3649
  o body
@@ -4129,7 +4151,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
4129
4151
  f 88/252/63 83/251/63 81/250/63 86/249/63
4130
4152
  f 87/256/64 88/255/64 86/254/64 85/253/64
4131
4153
  f 86/260/65 81/259/65 82/258/65 85/257/65
4132
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var Do=`# Made in Blockbench 4.9.4
4154
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var _a=`# Made in Blockbench 4.9.4
4133
4155
  mtllib materials.mtl
4134
4156
 
4135
4157
  o body
@@ -4499,7 +4521,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
4499
4521
  f 64/180/45 59/179/45 57/178/45 62/177/45
4500
4522
  f 63/184/46 64/183/46 62/182/46 61/181/46
4501
4523
  f 62/188/47 57/187/47 58/186/47 61/185/47
4502
- f 63/192/48 60/191/48 59/190/48 64/189/48`;var Fo=`# Made in Blockbench 4.9.4
4524
+ f 63/192/48 60/191/48 59/190/48 64/189/48`;var wa=`# Made in Blockbench 4.9.4
4503
4525
  mtllib materials.mtl
4504
4526
 
4505
4527
  o body
@@ -4869,7 +4891,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
4869
4891
  f 64/180/45 59/179/45 57/178/45 62/177/45
4870
4892
  f 63/184/46 64/183/46 62/182/46 61/181/46
4871
4893
  f 62/188/47 57/187/47 58/186/47 61/185/47
4872
- f 63/192/48 60/191/48 59/190/48 64/189/48`;var zo=`# Made in Blockbench 4.9.4
4894
+ f 63/192/48 60/191/48 59/190/48 64/189/48`;var Aa=`# Made in Blockbench 4.9.4
4873
4895
  mtllib materials.mtl
4874
4896
 
4875
4897
  o Body
@@ -5147,7 +5169,7 @@ f 43/128/32 44/127/32 42/126/32 41/125/32
5147
5169
  f 48/132/33 43/131/33 41/130/33 46/129/33
5148
5170
  f 47/136/34 48/135/34 46/134/34 45/133/34
5149
5171
  f 46/140/35 41/139/35 42/138/35 45/137/35
5150
- f 47/144/36 44/143/36 43/142/36 48/141/36`;var Lo=`# Made in Blockbench 4.9.4
5172
+ f 47/144/36 44/143/36 43/142/36 48/141/36`;var Ea=`# Made in Blockbench 4.9.4
5151
5173
  mtllib materials.mtl
5152
5174
 
5153
5175
  o body
@@ -5517,7 +5539,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
5517
5539
  f 64/180/45 59/179/45 57/178/45 62/177/45
5518
5540
  f 63/184/46 64/183/46 62/182/46 61/181/46
5519
5541
  f 62/188/47 57/187/47 58/186/47 61/185/47
5520
- f 63/192/48 60/191/48 59/190/48 64/189/48`;var Uo=`# Made in Blockbench 4.9.4
5542
+ f 63/192/48 60/191/48 59/190/48 64/189/48`;var xa=`# Made in Blockbench 4.9.4
5521
5543
  mtllib materials.mtl
5522
5544
 
5523
5545
  o neck
@@ -8509,7 +8531,7 @@ f 515/1544/386 516/1543/386 514/1542/386 513/1541/386
8509
8531
  f 520/1548/387 515/1547/387 513/1546/387 518/1545/387
8510
8532
  f 519/1552/388 520/1551/388 518/1550/388 517/1549/388
8511
8533
  f 518/1556/389 513/1555/389 514/1554/389 517/1553/389
8512
- f 519/1560/390 516/1559/390 515/1558/390 520/1557/390`;var Go=`# Made in Blockbench 4.9.4
8534
+ f 519/1560/390 516/1559/390 515/1558/390 520/1557/390`;var Ra=`# Made in Blockbench 4.9.4
8513
8535
  mtllib materials.mtl
8514
8536
 
8515
8537
  o Head
@@ -8833,7 +8855,7 @@ f 51/152/38 52/151/38 50/150/38 49/149/38
8833
8855
  f 56/156/39 51/155/39 49/154/39 54/153/39
8834
8856
  f 55/160/40 56/159/40 54/158/40 53/157/40
8835
8857
  f 54/164/41 49/163/41 50/162/41 53/161/41
8836
- f 55/168/42 52/167/42 51/166/42 56/165/42`;var No=`# Made in Blockbench 4.9.4
8858
+ f 55/168/42 52/167/42 51/166/42 56/165/42`;var ka=`# Made in Blockbench 4.9.4
8837
8859
  mtllib materials.mtl
8838
8860
 
8839
8861
  o section_2
@@ -9019,7 +9041,7 @@ f 27/80/20 28/79/20 26/78/20 25/77/20
9019
9041
  f 32/84/21 27/83/21 25/82/21 30/81/21
9020
9042
  f 31/88/22 32/87/22 30/86/22 29/85/22
9021
9043
  f 30/92/23 25/91/23 26/90/23 29/89/23
9022
- f 31/96/24 28/95/24 27/94/24 32/93/24`;var Wo=`# Made in Blockbench 4.9.4
9044
+ f 31/96/24 28/95/24 27/94/24 32/93/24`;var Ta=`# Made in Blockbench 4.9.4
9023
9045
  mtllib materials.mtl
9024
9046
 
9025
9047
  o body
@@ -9481,7 +9503,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
9481
9503
  f 80/228/57 75/227/57 73/226/57 78/225/57
9482
9504
  f 79/232/58 80/231/58 78/230/58 77/229/58
9483
9505
  f 78/236/59 73/235/59 74/234/59 77/233/59
9484
- f 79/240/60 76/239/60 75/238/60 80/237/60`;var Vo=`# Made in Blockbench 4.9.4
9506
+ f 79/240/60 76/239/60 75/238/60 80/237/60`;var Ma=`# Made in Blockbench 4.9.4
9485
9507
  mtllib materials.mtl
9486
9508
 
9487
9509
  o body
@@ -10219,7 +10241,7 @@ f 123/368/92 124/367/92 122/366/92 121/365/92
10219
10241
  f 128/372/93 123/371/93 121/370/93 126/369/93
10220
10242
  f 127/376/94 128/375/94 126/374/94 125/373/94
10221
10243
  f 126/380/95 121/379/95 122/378/95 125/377/95
10222
- f 127/384/96 124/383/96 123/382/96 128/381/96`;var jo=`# Made in Blockbench 4.9.4
10244
+ f 127/384/96 124/383/96 123/382/96 128/381/96`;var Sa=`# Made in Blockbench 4.9.4
10223
10245
  mtllib materials.mtl
10224
10246
 
10225
10247
  o body
@@ -10681,7 +10703,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
10681
10703
  f 80/228/57 75/227/57 73/226/57 78/225/57
10682
10704
  f 79/232/58 80/231/58 78/230/58 77/229/58
10683
10705
  f 78/236/59 73/235/59 74/234/59 77/233/59
10684
- f 79/240/60 76/239/60 75/238/60 80/237/60`;var Yo=`# Made in Blockbench 4.9.4
10706
+ f 79/240/60 76/239/60 75/238/60 80/237/60`;var Ca=`# Made in Blockbench 4.9.4
10685
10707
  mtllib materials.mtl
10686
10708
 
10687
10709
  o left_back_leg
@@ -11281,7 +11303,7 @@ f 99/296/74 100/295/74 98/294/74 97/293/74
11281
11303
  f 104/300/75 99/299/75 97/298/75 102/297/75
11282
11304
  f 103/304/76 104/303/76 102/302/76 101/301/76
11283
11305
  f 102/308/77 97/307/77 98/306/77 101/305/77
11284
- f 103/312/78 100/311/78 99/310/78 104/309/78`;var Qo=`# Made in Blockbench 4.9.4
11306
+ f 103/312/78 100/311/78 99/310/78 104/309/78`;var Ba=`# Made in Blockbench 4.9.4
11285
11307
  mtllib materials.mtl
11286
11308
 
11287
11309
  o head
@@ -12295,7 +12317,7 @@ f 171/512/128 172/511/128 170/510/128 169/509/128
12295
12317
  f 176/516/129 171/515/129 169/514/129 174/513/129
12296
12318
  f 175/520/130 176/519/130 174/518/130 173/517/130
12297
12319
  f 174/524/131 169/523/131 170/522/131 173/521/131
12298
- f 175/528/132 172/527/132 171/526/132 176/525/132`;var Ko=`# Made in Blockbench 4.9.4
12320
+ f 175/528/132 172/527/132 171/526/132 176/525/132`;var Pa=`# Made in Blockbench 4.9.4
12299
12321
  mtllib materials.mtl
12300
12322
 
12301
12323
  o Body
@@ -13355,7 +13377,7 @@ f 179/536/134 180/535/134 178/534/134 177/533/134
13355
13377
  f 184/540/135 179/539/135 177/538/135 182/537/135
13356
13378
  f 183/544/136 184/543/136 182/542/136 181/541/136
13357
13379
  f 182/548/137 177/547/137 178/546/137 181/545/137
13358
- f 183/552/138 180/551/138 179/550/138 184/549/138`;var Jo=`# Made in Blockbench 4.9.4
13380
+ f 183/552/138 180/551/138 179/550/138 184/549/138`;var Ia=`# Made in Blockbench 4.9.4
13359
13381
  mtllib materials.mtl
13360
13382
 
13361
13383
  o head
@@ -13863,7 +13885,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
13863
13885
  f 88/252/63 83/251/63 81/250/63 86/249/63
13864
13886
  f 87/256/64 88/255/64 86/254/64 85/253/64
13865
13887
  f 86/260/65 81/259/65 82/258/65 85/257/65
13866
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var Zo=`# Made in Blockbench 4.9.4
13888
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var La=`# Made in Blockbench 4.9.4
13867
13889
  mtllib materials.mtl
13868
13890
 
13869
13891
  o bottom
@@ -14095,7 +14117,7 @@ f 35/104/26 36/103/26 34/102/26 33/101/26
14095
14117
  f 40/108/27 35/107/27 33/106/27 38/105/27
14096
14118
  f 39/112/28 40/111/28 38/110/28 37/109/28
14097
14119
  f 38/116/29 33/115/29 34/114/29 37/113/29
14098
- f 39/120/30 36/119/30 35/118/30 40/117/30`;var qo=`# Made in Blockbench 4.9.4
14120
+ f 39/120/30 36/119/30 35/118/30 40/117/30`;var Ha=`# Made in Blockbench 4.9.4
14099
14121
  mtllib materials.mtl
14100
14122
 
14101
14123
  o body
@@ -14603,7 +14625,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
14603
14625
  f 88/252/63 83/251/63 81/250/63 86/249/63
14604
14626
  f 87/256/64 88/255/64 86/254/64 85/253/64
14605
14627
  f 86/260/65 81/259/65 82/258/65 85/257/65
14606
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var Xo=`# Made in Blockbench 4.9.4
14628
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var Oa=`# Made in Blockbench 4.9.4
14607
14629
  mtllib materials.mtl
14608
14630
 
14609
14631
  o Body
@@ -15341,7 +15363,7 @@ f 123/368/92 124/367/92 122/366/92 121/365/92
15341
15363
  f 128/372/93 123/371/93 121/370/93 126/369/93
15342
15364
  f 127/376/94 128/375/94 126/374/94 125/373/94
15343
15365
  f 126/380/95 121/379/95 122/378/95 125/377/95
15344
- f 127/384/96 124/383/96 123/382/96 128/381/96`;var $o=`# Made in Blockbench 4.9.4
15366
+ f 127/384/96 124/383/96 123/382/96 128/381/96`;var Da=`# Made in Blockbench 4.9.4
15345
15367
  mtllib materials.mtl
15346
15368
 
15347
15369
  o Body
@@ -15711,7 +15733,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
15711
15733
  f 64/180/45 59/179/45 57/178/45 62/177/45
15712
15734
  f 63/184/46 64/183/46 62/182/46 61/181/46
15713
15735
  f 62/188/47 57/187/47 58/186/47 61/185/47
15714
- f 63/192/48 60/191/48 59/190/48 64/189/48`;var e3=`# Made in Blockbench 4.9.4
15736
+ f 63/192/48 60/191/48 59/190/48 64/189/48`;var Fa=`# Made in Blockbench 4.9.4
15715
15737
  mtllib materials.mtl
15716
15738
 
15717
15739
  o rearFootLeft
@@ -16265,7 +16287,7 @@ f 91/272/68 92/271/68 90/270/68 89/269/68
16265
16287
  f 96/276/69 91/275/69 89/274/69 94/273/69
16266
16288
  f 95/280/70 96/279/70 94/278/70 93/277/70
16267
16289
  f 94/284/71 89/283/71 90/282/71 93/281/71
16268
- f 95/288/72 92/287/72 91/286/72 96/285/72`;var t3=`# Aspose.3D Wavefront OBJ Exporter
16290
+ f 95/288/72 92/287/72 91/286/72 96/285/72`;var za=`# Aspose.3D Wavefront OBJ Exporter
16269
16291
  # Copyright 2004-2024 Aspose Pty Ltd.
16270
16292
  # File created: 02/12/2025 20:01:28
16271
16293
 
@@ -16325,7 +16347,7 @@ f 5/8/5 6/4/6 8/3/7 7/5/8
16325
16347
  f 9/11/9 10/7/10 12/6/11 11/12/12
16326
16348
  #3 polygons
16327
16349
 
16328
- `;var r3=`# Made in Blockbench 4.9.4
16350
+ `;var Ua=`# Made in Blockbench 4.9.4
16329
16351
  mtllib materials.mtl
16330
16352
 
16331
16353
  o base
@@ -16465,7 +16487,7 @@ f 19/56/14 20/55/14 18/54/14 17/53/14
16465
16487
  f 24/60/15 19/59/15 17/58/15 22/57/15
16466
16488
  f 23/64/16 24/63/16 22/62/16 21/61/16
16467
16489
  f 22/68/17 17/67/17 18/66/17 21/65/17
16468
- f 23/72/18 20/71/18 19/70/18 24/69/18`;var i3=`# Made in Blockbench 4.9.4
16490
+ f 23/72/18 20/71/18 19/70/18 24/69/18`;var Ga=`# Made in Blockbench 4.9.4
16469
16491
  mtllib materials.mtl
16470
16492
 
16471
16493
  o body
@@ -17157,7 +17179,7 @@ f 115/344/86 116/343/86 114/342/86 113/341/86
17157
17179
  f 120/348/87 115/347/87 113/346/87 118/345/87
17158
17180
  f 119/352/88 120/351/88 118/350/88 117/349/88
17159
17181
  f 118/356/89 113/355/89 114/354/89 117/353/89
17160
- f 119/360/90 116/359/90 115/358/90 120/357/90`;var n3=`# Made in Blockbench 4.9.4
17182
+ f 119/360/90 116/359/90 115/358/90 120/357/90`;var Va=`# Made in Blockbench 4.9.4
17161
17183
  mtllib materials.mtl
17162
17184
 
17163
17185
  o head
@@ -17665,7 +17687,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
17665
17687
  f 88/252/63 83/251/63 81/250/63 86/249/63
17666
17688
  f 87/256/64 88/255/64 86/254/64 85/253/64
17667
17689
  f 86/260/65 81/259/65 82/258/65 85/257/65
17668
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var s3=`# Made in Blockbench 4.9.4
17690
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var Wa=`# Made in Blockbench 4.9.4
17669
17691
  mtllib materials.mtl
17670
17692
 
17671
17693
  o body
@@ -17759,7 +17781,7 @@ f 11/32/8 12/31/8 10/30/8 9/29/8
17759
17781
  f 16/36/9 11/35/9 9/34/9 14/33/9
17760
17782
  f 15/40/10 16/39/10 14/38/10 13/37/10
17761
17783
  f 14/44/11 9/43/11 10/42/11 13/41/11
17762
- f 15/48/12 12/47/12 11/46/12 16/45/12`;var o3=`# Made in Blockbench 4.9.4
17784
+ f 15/48/12 12/47/12 11/46/12 16/45/12`;var Na=`# Made in Blockbench 4.9.4
17763
17785
  mtllib materials.mtl
17764
17786
 
17765
17787
  o body
@@ -18129,7 +18151,7 @@ f 59/176/44 60/175/44 58/174/44 57/173/44
18129
18151
  f 64/180/45 59/179/45 57/178/45 62/177/45
18130
18152
  f 63/184/46 64/183/46 62/182/46 61/181/46
18131
18153
  f 62/188/47 57/187/47 58/186/47 61/185/47
18132
- f 63/192/48 60/191/48 59/190/48 64/189/48`;var a3=`# Made in Blockbench 4.9.4
18154
+ f 63/192/48 60/191/48 59/190/48 64/189/48`;var ja=`# Made in Blockbench 4.9.4
18133
18155
  mtllib materials.mtl
18134
18156
 
18135
18157
  o body
@@ -18453,7 +18475,7 @@ f 51/152/38 52/151/38 50/150/38 49/149/38
18453
18475
  f 56/156/39 51/155/39 49/154/39 54/153/39
18454
18476
  f 55/160/40 56/159/40 54/158/40 53/157/40
18455
18477
  f 54/164/41 49/163/41 50/162/41 53/161/41
18456
- f 55/168/42 52/167/42 51/166/42 56/165/42`;var v3=`# Made in Blockbench 4.9.4
18478
+ f 55/168/42 52/167/42 51/166/42 56/165/42`;var Qa=`# Made in Blockbench 4.9.4
18457
18479
  mtllib materials.mtl
18458
18480
 
18459
18481
  o body
@@ -18961,7 +18983,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
18961
18983
  f 88/252/63 83/251/63 81/250/63 86/249/63
18962
18984
  f 87/256/64 88/255/64 86/254/64 85/253/64
18963
18985
  f 86/260/65 81/259/65 82/258/65 85/257/65
18964
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var l3=`# Made in Blockbench 4.9.4
18986
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var Ya=`# Made in Blockbench 4.9.4
18965
18987
  mtllib materials.mtl
18966
18988
 
18967
18989
  o body
@@ -19423,7 +19445,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
19423
19445
  f 80/228/57 75/227/57 73/226/57 78/225/57
19424
19446
  f 79/232/58 80/231/58 78/230/58 77/229/58
19425
19447
  f 78/236/59 73/235/59 74/234/59 77/233/59
19426
- f 79/240/60 76/239/60 75/238/60 80/237/60`;var c3=`# Made in Blockbench 4.9.4
19448
+ f 79/240/60 76/239/60 75/238/60 80/237/60`;var Ka=`# Made in Blockbench 4.9.4
19427
19449
  mtllib materials.mtl
19428
19450
 
19429
19451
  o head
@@ -20069,7 +20091,7 @@ f 107/320/80 108/319/80 106/318/80 105/317/80
20069
20091
  f 112/324/81 107/323/81 105/322/81 110/321/81
20070
20092
  f 111/328/82 112/327/82 110/326/82 109/325/82
20071
20093
  f 110/332/83 105/331/83 106/330/83 109/329/83
20072
- f 111/336/84 108/335/84 107/334/84 112/333/84`;var d3=`# Made in Blockbench 4.9.4
20094
+ f 111/336/84 108/335/84 107/334/84 112/333/84`;var Ja=`# Made in Blockbench 4.9.4
20073
20095
  mtllib materials.mtl
20074
20096
 
20075
20097
  o head
@@ -20577,7 +20599,7 @@ f 83/248/62 84/247/62 82/246/62 81/245/62
20577
20599
  f 88/252/63 83/251/63 81/250/63 86/249/63
20578
20600
  f 87/256/64 88/255/64 86/254/64 85/253/64
20579
20601
  f 86/260/65 81/259/65 82/258/65 85/257/65
20580
- f 87/264/66 84/263/66 83/262/66 88/261/66`;var u3=`# Made in Blockbench 4.9.4
20602
+ f 87/264/66 84/263/66 83/262/66 88/261/66`;var qa=`# Made in Blockbench 4.9.4
20581
20603
  mtllib materials.mtl
20582
20604
 
20583
20605
  o Body
@@ -21039,7 +21061,7 @@ f 75/224/56 76/223/56 74/222/56 73/221/56
21039
21061
  f 80/228/57 75/227/57 73/226/57 78/225/57
21040
21062
  f 79/232/58 80/231/58 78/230/58 77/229/58
21041
21063
  f 78/236/59 73/235/59 74/234/59 77/233/59
21042
- f 79/240/60 76/239/60 75/238/60 80/237/60`;var f3=`# Made in Blockbench 4.9.4
21064
+ f 79/240/60 76/239/60 75/238/60 80/237/60`;var Xa=`# Made in Blockbench 4.9.4
21043
21065
  mtllib materials.mtl
21044
21066
 
21045
21067
  o bottom
@@ -21455,9 +21477,9 @@ f 67/200/50 68/199/50 66/198/50 65/197/50
21455
21477
  f 72/204/51 67/203/51 65/202/51 70/201/51
21456
21478
  f 71/208/52 72/207/52 70/206/52 69/205/52
21457
21479
  f 70/212/53 65/211/53 66/210/53 69/209/53
21458
- f 71/216/54 68/215/54 67/214/54 72/213/54`;var Bi={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/9odutodO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M464xPvTf20BsqVGtbw5/2P95vN8NoPEamiQP4TCsAAIMUe97oXmo/d7rQCzijITq2QYiSkwAAFilWim9LT6+vrchwRBd7BUKAvBQZM/itIBhyi8CyCoUGV4lwA7okXE1IZ71NKCRFn6fnuBCrRUFpbISSTUnUTKoA363Uv8KKUkluFApOqKBcVMhbUpCykKpVdCCnL4sAQJKF8K9hJXZbleSEW87K059OcRIQ+GYR8mkxre14sjua2TqakF7R+txVwYELK6fz4GDseJwhRNApbEjIlx8tlMhwlREIU9sDYyX4B2Jsd4eGGjPnk79eF7v1N/+oaQnpuvrm5ITPnvD9be8Uov+DATXMLKem5++nujiSZ83W+/oqDMJVm9LP3t1yMJySLrC5z/wUHjjD6aeX5gvQ8/vb4SMjbk18u4mdhBLLQzjmddZ9dTvBTuCekyZOWtHi+MsY4pLWOEGqEJJuHzYaQszyZkbZFpaNt16EhhLuFIhuEoDF78ZP9A0Obf2KBegjhAAAAAElFTkSuQmCC",guardian:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAhFBMVEX///+rjEZQjnQtWUcAAADX1c/Y1cvX1czX1MzX08vW083X08rW08vX0snW0snV0crAuq7Auq3Auaq+ua3dkET/gi+DpZy5k2Syk0/wdyjecipqlYPsZCqFhmBmiYDLZSNdf3XeSSh4dVCmXCxOeWbUQSDKPBxBcVpkW1BgVko5ZVJ5CxKoxgN0AAAABXRSTlMAAAAAAMJrBrEAAAOASURBVHjapZaJcttIDAW5lvfIHtnLYiLDee4kzwsL+///F45I66AkW467akSoIHRhhjOkuq5bLper4fL/wHAhiscBItiMIYSgm+j76GOga1xdXXWD4PNy2epHQ9q1HrAz0+mneCswfeB+K/i8Wi6HsZoEA4vFojtP4E1vO8GmvvWw5QUBEd4TrFabBj53F9LbEfZOcLt8WN2ubi8WTEu7J1g9DPUPt5cLPBM83N3e3g2C6+tu4PqYmaCPxk5w99/9XRsvCaLR9+G0Y8ID3f3916/DuO8azwmMgTA4WuQW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DC0MGzNgpzGlJEiTLfMQUIwYNo68I3WexO2BdgCgQ3awNVlJuzrcGpP5FVkhckCIRLGLuwVaTaopJLyBGuK9gPmptRbfNFMc1qozZfFCglQKoIgDOeagA7Ym3zEOXa7MN1gASBBRlQwZQ96JOBwF4MCeidg5puQ4YMELPNgO5UeXsWVEgAYVJlMALkIBKIAAwHnH0SI8FE2xybddYr5tmzZFJAwAeWYIorcACzE5KC4wBwDLYVgu24gwPeR57KlFHpN1XRsiZgehACKz2wUJ+xnOF7uu/1pcL77Kq6caZUD2/0ZFAk9zM9XrfYvrb1L1TPXvNbFnhwqQEPOKZbVKaZW0aWIpvy+bZVOypUYT7vFx9tGz9zOcFuDN/+gIHIEjcASOwBH44cB/1lQM4ZNhKecAAAAASUVORK5CYII="};E();x();k();R();import*as Fe from"three";var Pi=class{constructor(e,t){this.object=e;this.animations=t;d(this,"clock",new Fe.Clock);d(this,"animatedObjects",new Set);d(this,"state")}createAnimationState(){let e=new Fe.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 Fe.Mesh||r instanceof Fe.Line||r instanceof Fe.Points||r instanceof Fe.Sprite){let i=r.onBeforeRender;r.onBeforeRender=(s,o,a,v,l,c)=>{let u=this.clock.getDelta();e.update(u),i?.(s,o,a,v,l,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?Fe.LoopRepeat:Fe.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?Fe.LoopRepeat:Fe.LoopOnce,1/0),r.clampWhenFinished=!t)}stopAnimations(){this.state.mixer.stopAllAction()}getDelta(){return this.clock.getDelta()}};function h3(n,e){let t=new Pi(n,e);return t.createAnimationState(),t}function T4(n){return"parts"in n&&Array.isArray(n.parts)?n.parts:[n]}var M4={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 m3(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function S4(n,e,t,r,i=!1,s=64,o=64,a=!1,v=[]){let l=new te.Euler(0,0,0);r.rotation&&(l.x=-r.rotation[0]*Math.PI/180,l.y=-r.rotation[1]*Math.PI/180,l.z=-r.rotation[2]*Math.PI/180);for(let{dir:c,corners:u,u0:h,v0:p,u1:g,v1:y}of Object.values(M4)){let A=Math.floor(n.positions.length/3),b=c[0]!==0,w=[];for(let S of u){let C,M;i?(C=(r.uv[0]+S[3]*r.size[0])/s,M=(r.uv[1]+S[4]*r.size[1])/o):(C=(r.uv[0]+m3(S[3]?g:h,r.size))/s,M=(r.uv[1]+m3(S[4]?y:p,r.size))/o);let I=b&&a?S[0]^1:S[0],B=S[1],H=b&&a?S[2]^1:S[2],G=r.inflate??0,O=new te.Vector3(r.origin[0]+I*r.size[0]+(I?G:-G),r.origin[1]+B*r.size[1]+(B?G:-G),r.origin[2]+H*r.size[2]+(H?G:-G));O=O.applyEuler(l),O=O.sub(t.position),O=O.applyEuler(t.rotation),O=O.add(t.position),n.positions.push(O.x,O.y,O.z),n.normals.push(c[0],c[1],c[2]),w.push(C,M),n.skinIndices.push(e,0,0,0),n.skinWeights.push(1,0,0,0)}if(a)for(let S=0;S+1<u.length;S+=2){let C=S*2,M=w.slice(C,C+4);w[C]=M[2],w[C+1]=M[b?1:3],w[C+2]=M[0],w[C+3]=M[b?3:1]}n.uvs.push(...w),n.indices.push(A,A+1,A+2,A+2,A+1,A+3)}}function D0(n,e,t,r={},i={}){let s=t.texturewidth??64,o=t.textureheight??64,a,v=e.startsWith("block:"),l=n?.material.map;if(v){if(!n)throw new Error("worldRenderer is required for block textures");let w=e.slice(6),S=n.resourcesManager.currentResources.blocksAtlasJson.textures[w];S&&(s=l?.image.width??s,o=l?.image.height??o,a=[S.u,S.v])}let c={},u={positions:[],normals:[],uvs:[],indices:[],skinIndices:[],skinWeights:[]},h=0;for(let w of t.bones){let S=new te.Bone;if(w.pivot&&(S.position.x=w.pivot[0],S.position.y=w.pivot[1],S.position.z=w.pivot[2]),w.bind_pose_rotation?(S.rotation.x=-w.bind_pose_rotation[0]*Math.PI/180,S.rotation.y=-w.bind_pose_rotation[1]*Math.PI/180,S.rotation.z=-w.bind_pose_rotation[2]*Math.PI/180):w.rotation&&(S.rotation.x=-w.rotation[0]*Math.PI/180,S.rotation.y=-w.rotation[1]*Math.PI/180,S.rotation.z=-w.rotation[2]*Math.PI/180),r.rotation?.[w.name]&&(S.rotation.x-=(r.rotation[w.name].x??0)*Math.PI/180,S.rotation.y-=(r.rotation[w.name].y??0)*Math.PI/180,S.rotation.z-=(r.rotation[w.name].z??0)*Math.PI/180),S.name=`bone_${w.name}`,c[w.name]=S,w.cubes)for(let C of w.cubes){let M=[];S4(u,h,S,C,v,s,o,w.mirror,M),M.length&&(i.errors??(i.errors=[]),i.errors.push(...M.map(I=>`Bone ${w.name}: ${I}`)))}h++}let p=[];for(let w of t.bones)w.parent&&c[w.parent]?c[w.parent].add(c[w.name]):p.push(c[w.name]);let g=new te.Skeleton(Object.values(c)),y=new te.BufferGeometry;y.setAttribute("position",new te.Float32BufferAttribute(u.positions,3)),y.setAttribute("normal",new te.Float32BufferAttribute(u.normals,3)),y.setAttribute("uv",new te.Float32BufferAttribute(u.uvs,2)),y.setAttribute("skinIndex",new te.Uint16BufferAttribute(u.skinIndices,4)),y.setAttribute("skinWeight",new te.Float32BufferAttribute(u.skinWeights,4)),y.setIndex(u.indices);let A=new te.MeshLambertMaterial({transparent:!0,alphaTest:.1,side:te.DoubleSide}),b=new te.SkinnedMesh(y,A);if(b.add(...p),b.bind(g),b.scale.set(1/16,1/16,1/16),a){let w=l.clone();w.offset.set(a[0],a[1]),w.needsUpdate=!0,A.map=w}else d1(e,w=>{A.map||(w.magFilter=te.NearestFilter,w.minFilter=te.NearestFilter,w.flipY=!1,w.wrapS=te.RepeatWrapping,w.wrapT=te.RepeatWrapping,A.map=w)},()=>{let w=A.map.image.width;w&&s!==w&&(A.map.repeat.x=s/w);let S=A.map.image.height;S&&o!==S&&(A.map.repeat.y=o/S),A.needsUpdate=!0});return b}var C4=[{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 p3(n){for(let e of C4)if(typeof e.pattern=="string"){if(e.pattern===n)return e.target}else if(e.pattern.test(n))return e.target}var g3=n=>Co[n],b3={zombie:1.85,husk:1.85,arrow:.0025},B4={zombie:new H1(0,1,0),husk:new H1(0,1,0),boat:new H1(0,-1,0),arrow:new H1(0,-.9,0)},M0=class{constructor(e,t,r,i={},s={}){d(this,"mesh");d(this,"animations");d(this,"animationControllers",[]);let o=t,a=p3(t);if(a&&(t=a,s.tempMap=a),i.customModel){let l=T4(i.customModel);this.mesh=new te.Object3D;for(let c=0;c<l.length;c++){let{modelPath:u,modelType:h,metadata:p}=l[c],g=new te.Object3D;switch(g.name=`custom_part_${c}`,h){case"gltf":{new w4().parseAsync(u,"").then(A=>{if(g.add(A.scene),p?.scale){let b=p.scale;g.scale.set(b,b,b)}if(p?.offset){let{x:b=0,y:w=0,z:S=0}=p.offset;g.position.set(b,w,S)}if(p?.texture){let b=It(p.texture);g.traverse(w=>{w instanceof te.Mesh&&(w.material=new te.MeshBasicMaterial({map:b,transparent:!0,alphaTest:.1}))})}if(A.animations?.length){this.animations=[...this.animations??[],...A.animations];let b=h3(g,A.animations);this.animationControllers.push(b);let w=p?.animation,S=p?.animationLoop??!0;w?b.playAnimation(w,S):b.playAnimation(A.animations[0].name,S)}}).catch(A=>{});break}case"obj":{let A=new Vt().parse(u);if(p?.scale){let{scale:b}=p;A.scale.set(b,b,b)}if(p?.offset){let{x:b=0,y:w=0,z:S=0}=p.offset;A.position.set(b,w,S)}if(p?.texture){let b=It(p.texture),w=new te.MeshBasicMaterial({map:b,transparent:!0,alphaTest:.1});A.traverse(S=>{S instanceof te.Mesh&&(S.material=w)})}g.add(A);break}case"bedrock":{let y=JSON.parse(u);if(p?.scale&&g.scale.set(p.scale,p.scale,p.scale),p?.offset){let{x:A=0,y:b=0,z:w=0}=p.offset;g.position.set(A,b,w)}for(let[A,b]of Object.entries(y.geometry)){let w=p?.textures?.[A]??y.textures?.[A];if(!w)continue;let S=D0(r,w.endsWith(".png")||w.startsWith("data:image/")||w.startsWith("block:")?w:w+".png",b,i,s);S.name=`geometry_${A}`,g.add(S)}break}}this.mesh.add(g)}s.type=l.length===1?l[0].modelType:"special";return}if(jt[t]){let l=new Vt,c={zombie_horse:`textures/${e}/entity/horse/horse_zombie.png`,husk:A4,skeleton_horse:`textures/${e}/entity/horse/horse_skeleton.png`,donkey:`textures/${e}/entity/horse/donkey.png`,mule:`textures/${e}/entity/horse/mule.png`,ocelot:E4,arrow:x4,spectral_arrow:R4,tipped_arrow:k4},u=c[o]||c[t];u&&(s.textureMap=!0);let h=u||Bi[t];if(Bi[t]&&(s.isHardcodedTexture=!0),!h)throw new Error(`No texture for ${t}`);let p=It(h),g=new te.MeshBasicMaterial({map:p,transparent:!0,alphaTest:.1}),y=l.parse(jt[t]),A=b3[o]||b3[t];A&&y.scale.set(A,A,A);let b=B4[o];b&&y.position.set(b.x,b.y,b.z),y.traverse(w=>{w instanceof te.Mesh&&(w.material=g,w.name==="Head layer"&&(w.visible=!1),w.name==="Head"&&i.rotation?.head&&(w.rotation.x-=(i.rotation.head.x??0)*Math.PI/180,w.rotation.y-=(i.rotation.head.y??0)*Math.PI/180,w.rotation.z-=(i.rotation.head.z??0)*Math.PI/180))}),this.mesh=y,s.type="obj";return}let v=g3(t);if(v){this.mesh=new te.Object3D;for(let[l,c]of Object.entries(v.geometry)){let u=i.textures?.[l]??v.textures[l];if(!u)continue;let h=D0(r,u.endsWith(".png")||u.startsWith("data:image/")||u.startsWith("block:")?u:u+".png",c,i,s);h.name=`geometry_${l}`,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=p3(e)||e,jt[e])return{boneNames:[]};let t=g3(e);if(!t)throw new Error(`Unknown entity ${e}`);return{boneNames:Object.values(t.geometry).flatMap(r=>r.name)}}};globalThis.EntityMesh=M0;E();x();k();R();import{default as H4}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_1.png";import{default as O4}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_2.png";import{default as D4}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_1.png";import{default as F4}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_2.png";import{default as z4}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_1.png";import{default as L4}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_2.png";import{default as U4}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_1.png";import{default as G4}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_2.png";import{default as N4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1.png";import{default as W4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1_overlay.png";import{default as V4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2.png";import{default as j4}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2_overlay.png";import{default as Y4}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_1.png";import{default as Q4}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_2.png";import{default as K4}from"mc-assets/dist/other-textures/latest/models/armor/turtle_layer_1.png";import{default as _3}from"mc-assets/dist/other-textures/latest/entity/elytra.png";var F0={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 y3={leather_layer_1:N4,leather_layer_1_overlay:W4,leather_layer_2:V4,leather_layer_2_overlay:j4,chainmail_layer_1:H4,chainmail_layer_2:O4,iron_layer_1:U4,iron_layer_2:G4,diamond_layer_1:D4,diamond_layer_2:F4,golden_layer_1:z4,golden_layer_2:L4,netherite_layer_1:Y4,netherite_layer_2:Q4,turtle_layer_1:K4};var k3=Pt($e),J4=120,Ii=n=>n*(Math.PI/180);function Z4(n){return n<0&&(n=4294967295+n+1>>>0),n.toString(16)}function q4(n){if(n===void 0)return;if(parseInt(n,10)===0)return"rgba(0, 0, 0, 0)";let e=Z4(parseInt(n,10));return e.length===8?`#${e.slice(2,8)}${e.slice(0,2)}`:`#${e}`}function w3(n,e){return n===void 0?e:n instanceof V.Quaternion?n:Array.isArray(n)?new V.Quaternion(n[0],n[1],n[2],n[3]):new V.Quaternion(n.x,n.y,n.z,n.w)}function _0(n,e){return n===void 0?e??new V.Euler:n instanceof V.Euler?n:n.yaw!==void 0&&n.pitch!==void 0&&n.roll!==void 0?new V.Euler(-Ii(n.pitch),-Ii(n.yaw),Ii(n.roll),"ZYX"):n.x!==void 0&&n.y!==void 0&&n.z!==void 0?new V.Euler(n.z,n.y,n.x,"ZYX"):Array.isArray(n)?new V.Euler(n[0],n[1],n[2]):e??new V.Euler}var O1=Math.PI*2;function X4(n,e){let t=((e-n)%O1+O1)%O1;return t>Math.PI?t-O1:t}function T3({username:n,nameTagBackgroundColor:e="rgba(0, 0, 0, 0.3)",nameTagTextOpacity:t=255},{fontFamily:r="mojangles"},i){let s=Ve(64,64),o=R3(i),a=s.getContext("2d");if(!a)throw new Error("Could not get 2d context");let v=48,l=5;a.font=`${v}px ${r}`;let c=String(typeof n=="string"?n:new o(n).toString()).split(`
21459
- `),u=0;for(let p of c){let g=a.measureText(p).width+l*2;g>u&&(u=g)}if(s.width=u,s.height=(v+l)*c.length,a.fillStyle=e,a.fillRect(0,0,s.width,s.height),a.globalAlpha=t/255,!!Yr(n,o,s,v,"white",-l+v))return a.globalAlpha=1,s}globalThis.getUsernameTexture=T3;var F1=(n,e,t,r)=>{for(let v of t.children)v.name==="nametag"&&v.removeFromParent();if(n.username===void 0||n.username===null||(typeof n.username=="string"?n.username:new(R3(r))(n.username).toString()).startsWith("EMPTY"))return;let s=T3(n,e,r);if(!s)return;let o=new V.Texture(s);o.needsUpdate=!0;let a;if(n.nameTagFixed){let v=new V.PlaneGeometry,l=new V.MeshBasicMaterial({map:o});l.transparent=!0,a=new V.Mesh(v,l),a.rotation.set(n.pitch,V.MathUtils.degToRad(n.yaw+180),0),a.position.y+=n.height+.3}else{let v=new V.SpriteMaterial({map:o});a=new V.Sprite(v),a.position.y+=n.height+.6}return a.renderOrder=1e3,a.scale.set(s.width*.005,s.height*.005,1),n.nameTagRotationRight&&a.applyQuaternion(n.nameTagRotationRight),n.nameTagScale&&a.scale.multiply(n.nameTagScale),n.nameTagRotationLeft&&a.applyQuaternion(n.nameTagRotationLeft),n.nameTagTranslation&&a.position.add(n.nameTagTranslation),a.name="nametag",t.add(a),a},A3={},$4=n=>n.charAt(0)===n.charAt(0).toUpperCase();function E3(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 ev(n,e,t,r,i){if(e.name)try{let l=($4(e.name)?Ei(e.name):e.name).toLowerCase(),c=new M0("1.16.4",l,t,i);if(c.mesh)return F1(e,r,c.mesh,t.version),c.mesh}catch(l){reportError?.(l)}if(!n||!(0,x3.isEntityAttackable)(n,e))return;let s=new V.BoxGeometry(e.width,e.height,e.width);s.translate(0,e.height/2,0);let o=new V.MeshBasicMaterial({color:16711935}),a=new V.Mesh(s,o);return(A3[e.name]=(A3[e.name]||0)+1)<6&&F1({username:e.name,height:e.height},r,a,t.version),a}var z1=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 V.Clock);d(this,"currentlyRendering",!0);d(this,"cachedMapsImages",{});d(this,"itemFrameMaps",{});d(this,"pendingModelOverrides",new Map);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.playerEntity){let t=new V.Group;t.originalEntity={...e,name:"player"};let r=new V.Group,i=this.setupPlayerObject(e,r,{});t.playerObject=i,t.add(r),t.name="player_entity",this.playerEntity=t,this.worldRenderer.scene.add(t),this.updatePlayerSkin(e.id,e.username,e.uuid??void 0,$e)}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),Re(e);this.entities={},this.currentSkinUrls={},this.playerEntity&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.playerEntity),Re(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;for(let r of t?[t]:Object.values(this.entities))e?this.worldRenderer.scene.children.includes(r)||this.worldRenderer.scene.add(r):this.worldRenderer.scene.remove(r)}playEntityModelAnimation(e,t,r=!1){let i=this.entities[e];i&&i.traverse(s=>{s instanceof M0&&s.playAnimation(t,r)})}render(){let e=this.worldRenderer.worldRendererConfig.renderEntities;e!==this.currentlyRendering&&this.setRendering(e);let t=Math.min(this.clock.getDelta(),1/30),r=this.worldRenderer.viewerChunkPosition,i=10*10;for(let[s,o]of[...Object.entries(this.entities),["player_entity",this.playerEntity]]){if(!o)continue;let a=s==="player_entity";if(a){let l=this.worldRenderer.playerStateUtils.isThirdPerson();if(o.visible=l,l){let c=this.worldRenderer.playerStateReactive.eyeHeight;o.position.set(this.worldRenderer.cameraWorldPos.x,this.worldRenderer.cameraWorldPos.y-c,this.worldRenderer.cameraWorldPos.z)}}let{playerObject:v}=o;if(v?.animation&&v.animation.update(v,t),o.traverse(l=>{l instanceof M0&&l.update(t)}),!a&&r&&o.position){let l=o.position.x-r.x,c=o.position.y-r.y,u=o.position.z-r.z,h=l*l+c*c+u*u;o.visible=!!(h<i||this.worldRenderer.shouldObjectVisible(o)),this.maybeRenderPlayerSkin(s)}if(o.visible&&this.syncArmorPositions(o),a&&o.visible){let l=this.worldRenderer.cameraShake.getBaseRotation();o.rotation.set(0,l.yaw,0),o.traverse(c=>{c.name==="head"&&c.rotation.set(-l.pitch,0,0)})}}}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}isCanvasBlank(e){return!e.getContext("2d")?.getImageData(0,0,e.width,e.height).data.some(t=>t!==0)}async updatePlayerSkin(e,t,r,i,s=void 0){i!==$e&&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 a=this.getPlayerObject(e);if(!a)return;if(i===!0){if(!t)return;let l=await H0(t,"skin");if(!this.getPlayerObject(e)||!l)return;i=l}if(typeof i!="string")throw new Error("Invalid skin url");if(this.currentSkinUrls[String(e)]===i){if(s){if(s===!0&&t){let l=await H0(t,"cape");if(!this.getPlayerObject(e)||!l)return;s=l}typeof s=="string"&&this.loadAndApplyCape(e,s)}return}i!==$e&&(this.currentSkinUrls[String(e)]=i);let v=this.worldRenderer.worldRendererConfig.renderEars||t==="deadmau5";this.loadAndApplySkin(e,i,v).then(async()=>{if(s){if(s===!0&&t){let l=await H0(t,"cape");if(!this.getPlayerObject(e)||!l)return;s=l}typeof s=="string"&&this.loadAndApplyCape(e,s)}}),a.cape.visible=!1,s||(a.backEquipment=null,a.elytra.map=null,a.cape.map&&a.cape.map.dispose(),a.cape.map=null)}async loadAndApplySkin(e,t,r){let i=this.getPlayerObject(e);if(i)try{let s;if(i=this.getPlayerObject(e),!i)return;let o,a;if(t===$e){let l=await y0($e);s=l.image,o=new V.CanvasTexture(l.canvas),a=l.canvas}else{let{canvas:l,image:c}=await y0(t);s=c,o=new V.CanvasTexture(l),a=l}o.magFilter=V.NearestFilter,o.minFilter=V.NearestFilter,o.needsUpdate=!0,i.skin.map=o,i.skin.modelType=Lr(a),i.skin.isCustom=t!==$e,ki(i);let v;if(s?r&&(v=Ve(64,64),Ur(v,s),r=!this.isCanvasBlank(v)):r=!1,r){let l=new V.CanvasTexture(v);l.magFilter=V.NearestFilter,l.minFilter=V.NearestFilter,l.needsUpdate=!0,i.ears.map=l,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 y0(t);if(r=this.getPlayerObject(e),!r)return;zr(i,s);let o=new V.CanvasTexture(i);o.magFilter=V.NearestFilter,o.minFilter=V.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}r.switchAnimationCallback=null,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"?F5.default.simplify(F5.default.parse(e)):Oi.simplify(e);return yi(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=Ds(this.worldRenderer.material,s.resolvedModel,s.modelName,this.worldRenderer.resourcesManager.currentResources.worldBlockProvider,this.worldRenderer.resourcesManager.currentResources.mcData),a=1;t["minecraft:display_context"]==="ground"?a=.5:t["minecraft:display_context"]==="thirdperson"&&(a=6),o.scale.set(a,a,a);let v=new V.Group;return v.add(o),{mesh:v,isBlock:!0,modelName:s.modelName}}if(s){let o=s.renderInfo?.texture==="blocks"?this.worldRenderer.material.map:this.worldRenderer.itemsTexture,{u:a,v,su:l,sv:c}=s,p=co(o,{u:a,v,sizeX:l??1,sizeY:c??1},{faceCamera:r,use3D:!r}),g=1;return t["minecraft:display_context"]==="ground"?g=.5:t["minecraft:display_context"]==="thirdperson"&&(g=6),p.mesh.scale.set(g,g,g),{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.additionalCleanup&&i.additionalCleanup(),i.traverse(g=>{g.additionalCleanup&&g.additionalCleanup()}),this.onRemoveEntity(e),this.worldRenderer.sceneOrigin.removeAndUntrack(i),Re(i),delete this.entities[e.id];return}let o;if(i===void 0){this.beforeEntityAdded(e);let g=new V.Group;if(g.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 b=e.name==="tnt"||e.type==="projectile"?{name:e.name}:e.name==="falling_block"?{blockState:e.objectData}:E3(e.metadata)?.find(w=>typeof w=="object"&&w?.itemCount);if(b){let w=this.getItemMesh(b,{"minecraft:display_context":"ground"},e.type==="projectile");if(w){if(o=w.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 V.Clock;o.onBeforeRender=()=>{let C=S.getDelta();o.rotation.y+=C}}g.additionalCleanup=()=>{w.cleanup&&w.cleanup()}}}}else if(r){let b=new V.Group,w=this.setupPlayerObject(e,b,t);if(g.playerObject=w,o=b,e.username){let S=F1(e,{fontFamily:"mojangles"},b,this.worldRenderer.version);S&&(S.position.y=w.position.y+w.scale.y*16+3,S.scale.multiplyScalar(12))}}else o=ev(this.mcData,e,this.worldRenderer,this.entitiesOptions,{...t,customModel:e.customModel});if(!o)return;o.name="mesh";let y=e.pos??e.position;this.worldRenderer.sceneOrigin.track(g),g.position.set(y.x,y.y,y.z);let A=new V.BoxHelper(o,e.type==="hostile"?16711680:e.type==="mob"?65280:e.type==="player"?255:16753920);A.name="debug",g.add(o),g.add(A),A.visible=!1,this.worldRenderer.scene.add(g),i=g,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||$e),this.setDebugMode(this.debugMode,g),this.setRendering(this.currentlyRendering,g),this.afterAddEntity(e)}else o=i.children.find(g=>g.name==="mesh");this.updateEntityEquipment(i,e);let a=M3(e,this.mcData),l=(E3(e.metadata)?.[0]??e.metadata?.[0]??0)&32||this.worldRenderer.playerStateReactive.cameraSpectatingEntity===e.id&&this.worldRenderer.playerStateUtils.isSpectator();for(let g of o.children??[])g.name!=="nametag"&&(g.visible=!l);a.baby?i.scale.set(.5,.5,.5):i.scale.set(1,1,1);let c=D1("text_display",e,this.mcData),u=c?.text||a.custom_name_visible&&a.custom_name;if(e.name!=="player"&&u){let g=c&&(c.billboard_render_constraints==="fixed"||!c.billboard_render_constraints),y=c&&!(parseInt(c.style_flags,10)&4)?q4(c.background_color):void 0,A;if(c?.text_opacity){let b=parseInt(c?.text_opacity,10);A=b>0?b:256-b}F1({...e,username:typeof u=="string"?F5.default.simplify(F5.default.parse(u)):Oi.simplify(u),nameTagBackgroundColor:y,nameTagTextOpacity:A,nameTagFixed:g,nameTagScale:c?.scale,nameTagTranslation:c&&(c.translation||new V.Vector3(0,0,0)),nameTagRotationLeft:w3(c?.left_rotation),nameTagRotationRight:w3(c?.right_rotation)},this.entitiesOptions,o,this.worldRenderer.version)}let h=D1("armor_stand",e,this.mcData);if(h){let g=(parseInt(h.client_flags,10)&1)!==0,y=(parseInt(h.client_flags,10)&4)!==0,A=(parseInt(h.client_flags,10)&8)===0,b=(parseInt(h.client_flags,10)&16)!==0;o.castShadow=!b,o.receiveShadow=!b,g?i.scale.set(.5,.5,.5):i.scale.set(1,1,1),i.traverse(w=>{switch(w.name){case"bone_baseplate":this.setVisible(w,A),w.rotation.y=-i.rotation.y;break;case"bone_head":h.head_pose&&w.setRotationFromEuler(_0(h.head_pose));break;case"bone_body":h.body_pose&&w.setRotationFromEuler(_0(h.body_pose));break;case"bone_rightarm":w.parent?.name!=="bone_armor"&&this.setVisible(w,y),h.left_arm_pose?w.setRotationFromEuler(_0(h.left_arm_pose)):w.setRotationFromEuler(_0({yaw:-10,pitch:-10,roll:0}));break;case"bone_leftarm":w.parent?.name!=="bone_armor"&&this.setVisible(w,y),h.right_arm_pose?w.setRotationFromEuler(_0(h.right_arm_pose)):w.setRotationFromEuler(_0({yaw:10,pitch:-10,roll:0}));break;case"bone_rightleg":h.left_leg_pose?w.setRotationFromEuler(_0(h.left_leg_pose)):w.setRotationFromEuler(_0({yaw:-1,pitch:-1,roll:0}));break;case"bone_leftleg":h.right_leg_pose?w.setRotationFromEuler(_0(h.right_leg_pose)):w.setRotationFromEuler(_0({yaw:1,pitch:1,roll:0}));break}})}let p=D1("item_frame",e,this.mcData);if(p||(p=D1("glow_item_frame",e,this.mcData)),p){let g=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(y=>{if(y.name.startsWith("map_")){Re(y);let A=parseInt(y.name.split("_")[1],10);return this.itemFrameMaps[A]=this.itemFrameMaps[A]?.filter(b=>b!==y),y instanceof V.Mesh&&y.material?.map?.dispose(),!0}else if(y.name==="item")return Re(y),!0;return!1})?.removeFromParent(),g&&(g.itemId??g.blockId??0)!==0){let y=p.rotation??0,A=g.nbtData?.value?.map?.value??g.components?.find(b=>b.type==="map_id")?.data;if(A)o.scale.set(16/12,16/12,1),this.addMapModel(i,A,y);else{let b=this.getItemMesh(g,{"minecraft:display_context":"fixed"});b&&(b.mesh.position.set(0,0,-.05),b.isBlock?b.mesh.scale.set(.25,.25,.25):b.mesh.scale.set(.5,.5,.5),b.mesh.rotateY(Math.PI),b.mesh.rotateZ(-y*Math.PI/4),b.mesh.name="item",i.add(b.mesh))}}}e.username!==void 0&&(i.username=e.username),this.updateNameTagVisibility(i),this.updateEntityPosition(e,s,t)}updateEntityPosition(e,t,r){let i=this.entities[e.id];if(!i)return;let s=t?0:J4;if(e.position){let a=this.worldRenderer.sceneOrigin.getWorldPosition(i)??{x:e.position.x,y:e.position.y,z:e.position.z};i.userData._tweenTarget||(i.userData._tweenTarget={x:a.x,y:a.y,z:a.z}),i.userData._posTween?.stop(),i.userData._posTween=new Oe(i.userData._tweenTarget).to({x:e.position.x,y:e.position.y,z:e.position.z},s).onUpdate(()=>{i.position.set(i.userData._tweenTarget.x,i.userData._tweenTarget.y,i.userData._tweenTarget.z)}).start()}let o;if(i.playerObject&&r?.rotation?.head){let a=r.rotation.head.y,v=typeof a=="number"&&Number.isFinite(a)?a:e.yaw;typeof v=="number"&&Number.isFinite(v)&&(o=v)}else typeof e.yaw=="number"&&Number.isFinite(e.yaw)&&(o=e.yaw);if(typeof o=="number"&&Number.isFinite(o)){let a=X4(i.rotation.y,o);i.userData._rotTween?.stop(),i.userData._rotTween=new Oe(i.rotation).to({y:i.rotation.y+a},s).start()}if(i?.playerObject&&r?.rotation?.head){let{playerObject:a}=i;a.skin.head.rotation.y=0;let v=r.rotation.head.x;a.skin.head.rotation.x=typeof v=="number"&&Number.isFinite(v)?-v:0}}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),a=(s?new V.Vector3(s.x,s.y,s.z):t.position.clone().add(new V.Vector3(this.worldRenderer.sceneOrigin.x,this.worldRenderer.sceneOrigin.y,this.worldRenderer.sceneOrigin.z))).distanceTo(i);if(a<r&&a<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 a=new V.MeshLambertMaterial(o),v=new V.Mesh(new V.PlaneGeometry(1,1),a);v.rotation.set(0,Math.PI,0),e.add(v);let l=!0;e.traverseVisible(c=>{c.name==="geometry_frame"&&(l=!1)}),l?v.position.set(0,0,.499):v.position.set(0,0,.437),v.rotateZ(Math.PI*2-r*Math.PI/2),v.name=`map_${t}`,s||(v.visible=!1),this.itemFrameMaps[t]||(this.itemFrameMaps[t]=[]),this.itemFrameMaps[t].push(v)}loadMap(e){let t=It(e);return t.needsUpdate=!0,t}addItemModel(e,t,r,i=!1){let s=`bone_${t}item`,o=`custom_item_${t}`;if(e.traverse(v=>{v.name===o&&(v.removeFromParent(),v.additionalCleanup&&v.additionalCleanup())}),!r)return;let a=this.getItemMesh(r,{"minecraft:display_context":"thirdperson"});a?.mesh&&e.traverse(v=>{if(v.name.toLowerCase()===s||v.name===`${t}Arm`){let l=new V.Object3D;l.additionalCleanup=()=>{a.cleanup&&a.cleanup()};let c=a.mesh;l.rotation.z=-Math.PI/16,a.isBlock?l.rotation.y=Math.PI/4:(c.rotation.z=-Math.PI/4,l.rotation.y=Math.PI/2,l.scale.multiplyScalar(2)),i&&(l.position.y=-8,l.position.z=5,l.position.x=t==="left"?1:-1,l.rotation.x=Math.PI),l.add(c),l.name=o,v.add(l)}})}handleDamageEvent(e,t){let r=this.entities[e]?.children.find(i=>i.name==="mesh");r&&r.traverse(i=>{if(i instanceof V.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 Oe(i.material.color).to(o,500).start()}})}raycastSceneDebug(){let e=new V.Raycaster;return e.setFromCamera(new V.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 Ft;i.realPlayerUuid=e.uuid??"",i.realUsername=e.username??"",i.position.set(0,16,0),ki(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 H5,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),z5(this.worldRenderer,e,"feet",t.equipment[2]),z5(this.worldRenderer,e,"legs",t.equipment[3],2),z5(this.worldRenderer,e,"chest",t.equipment[4]),z5(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,_3),i.cape.map===null&&(i.cape.visible=!1)}}};function M3(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 D1(n,e,t){if(e.name===n)return M3(e,t)}function z5(n,e,t,r,i=1,s=!1){if(!r){Hi(e,t);return}let o=r.name.split("_"),a,v=t==="head"&&r.name==="player_head";if(v)if(Hi(e,t),r.nbt){let g=Oi.simplify(r.nbt);try{let y;if(g.SkullOwner?y=g.SkullOwner.Properties.textures[0]?.Value:y=g["minecraft:profile"]?.Properties?.find(A=>A.name==="textures")?.value,y){a=JSON.parse(z.from(y,"base64").toString()).textures?.SKIN?.url;let{skinTexturesProxy:b}=n.worldRendererConfig;b&&(a=a?.replace("http://textures.minecraft.net/",b).replace("https://textures.minecraft.net/",b))}}catch{}}else a=$e;let l=o[0];if(!a){let g=`${l}_layer_${i}${s?"_overlay":""}`;a=n.resourcesManager.currentResources.customTextures.armor?.textures[g]?.src??y3[g]}if(!a||!F0[t]){Hi(e,t);return}let c=`geometry_armor_${t}${s?"_overlay":""}`,u=e.children.findLast(g=>g.name===c),h;if(u?(h=u.material,d1(a,g=>{g.magFilter=V.NearestFilter,g.minFilter=V.NearestFilter,g.flipY=!1,g.wrapS=V.MirroredRepeatWrapping,g.wrapT=V.MirroredRepeatWrapping,h.map=g})):(u=D0(n,a,F0[t]),t==="head"&&(u.children[0].position.y+=.01),u.name=c,h=u.material,v||(h.side=V.DoubleSide)),l==="leather"&&!s){let g=r.nbt?.value?.display?.value?.color?.value;if(g){let y=g>>16&255,A=g>>8&255,b=g&255;h.color.setRGB(y/255,A/255,b/255)}else h.color.setHex(11890001);z5(n,e,t,r,i,!0)}else h.color.setHex(16777215);let p=new V.Object3D;p.name=`armor_${t}${s?"_overlay":""}`,p.add(u),e.add(u)}function Hi(n,e){for(let t of n.children)(t.name===`geometry_armor_${e}`||t.name===`geometry_armor_${e}_overlay`)&&t.removeFromParent()}var Di=async(n,e)=>{let t;if(!n&&!e)t=await k3;else{if(n||(n=await H0(e,"skin")),!n)return;let{canvas:v}=await y0(n);t=new ze.CanvasTexture(v)}t.magFilter=ze.NearestFilter,t.minFilter=ze.NearestFilter;let r=new ze.BoxGeometry,i=new ze.MeshStandardMaterial,s=!1,o=new ze.Mesh(r,i);o.scale.x=s?3:4,o.scale.y=12,o.scale.z=4,rv(r,40,16,s?3:4,12,4),i.map=t,i.needsUpdate=!0;let a=new ze.Group;return a.add(o),a.scale.set(.1,.1,.1),o.rotation.z=Math.PI,a};function tv(n,e,t,r,i,s,o,a){let v=(B,H,G,O)=>[new ze.Vector2(B/o,1-O/a),new ze.Vector2(G/o,1-O/a),new ze.Vector2(G/o,1-H/a),new ze.Vector2(B/o,1-H/a)],l=v(e+s,t,e+r+s,t+s),c=v(e+r+s,t,e+r*2+s,t+s),u=v(e,t+s,e+s,t+s+i),h=v(e+s,t+s,e+r+s,t+s+i),p=v(e+r+s,t+s,e+r+s*2,t+i+s),g=v(e+r+s*2,t+s,e+r*2+s*2,t+i+s),y=n.attributes.uv,A=[p[3],p[2],p[0],p[1]],b=[u[3],u[2],u[0],u[1]],w=[l[3],l[2],l[0],l[1]],S=[c[0],c[1],c[3],c[2]],C=[h[3],h[2],h[0],h[1]],M=[g[3],g[2],g[0],g[1]],I=[];for(let B of[A,b,w,S,C,M])for(let H of B)I.push(H.x,H.y);y.set(new Float32Array(I)),y.needsUpdate=!0}function rv(n,e,t,r,i,s){tv(n,e,t,r,i,s,64,64)}var C3={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]}},L5=class{constructor(e,t=!1){this.worldRenderer=e;this.offHand=t;d(this,"holdingBlock");d(this,"blockSwapAnimation");d(this,"cameraGroup",new de.Mesh);d(this,"objectOuterGroup",new de.Group);d(this,"objectInnerGroup",new de.Group);d(this,"holdingBlockInnerGroup",new de.Group);d(this,"camera",new de.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(S3(this.worldRenderer.playerStateReactive,"heldItemMain",()=>{this.offHand||this.updateItem()})),this.unsubs.push(S3(this.worldRenderer.playerStateReactive,"heldItemOff",()=>{this.offHand&&this.updateItem()})),this.config=e.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||Di().then(r=>{this.disposed||(this.playerHand=r,this.updateItem())}).then(()=>{if(this.disposed)return;let r=_1(async()=>Di(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=>{Re(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 de.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 de.Scene;o.add(this.cameraGroup),this.updateCameraGroup(),o.add(r.clone()),o.add(i.clone());let a=t.getSize(new de.Vector2),v=Math.min(a.width,a.height),l=a.width-v,{offHandDisplay:c}=this;if(c&&(this.cameraGroup.scale.x=-1),t.autoClear=!1,t.clearDepth(),this.offHandDisplay)t.setViewport(0,0,v,v);else{let u=a.width-v;t.setViewport(u,0,v,v)}t.render(o,this.camera),t.setViewport(0,0,a.width,a.height),c&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new ct(()=>({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!==Dt(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 a=i*2.22*.2;this.objectOuterGroup.scale.set(a,a,a)}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},A1(this.worldRenderer),!1,this.lastItemModelName);if(i){let{mesh:s,isBlock:o,modelName:a}=i;o?(t=s,e.type="block"):(s.position.set(.5,.5,.5),t=s,e.type="item"),this.lastItemModelName=a}}else t=this.playerHand;if(!t)return;t.name="holdingBlock";let r=this.getHandHeld3d().rotation;return t.rotation.x=de.MathUtils.degToRad(r.x),t.rotation.y=de.MathUtils.degToRad(r.y),t.rotation.z=de.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=Dt(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 a=new de.Group;this.holdingBlockInnerGroup.removeFromParent(),this.holdingBlockInnerGroup=new de.Group,this.holdingBlockInnerGroup.add(o.model),a.add(this.holdingBlockInnerGroup),this.holdingBlock=o.model,this.objectInnerGroup=new de.Group,this.objectInnerGroup.add(a),this.objectInnerGroup.position.set(-.5,-.5,-.5),s&&(this.objectInnerGroup.position.y-=this.objectInnerGroup.scale.y*1.5),Object.assign(a.position,{x:.5,y:.5,z:.5}),this.objectOuterGroup=new de.Group,this.objectOuterGroup.add(this.objectInnerGroup),this.cameraGroup.add(this.objectOuterGroup);let v=this.getHandHeld3d().rotation;this.objectOuterGroup.rotation.y=de.MathUtils.degToRad(v.yOuter),s&&await this.playBlockSwapAnimation("appeared"),this.swingAnimator??(this.swingAnimator=new zi(this.holdingBlockInnerGroup)),this.swingAnimator.setHandMesh(this.holdingBlockInnerGroup),this.swingAnimator.type=o.type,this.config.viewBobbing&&(this.idleAnimator=new Fi(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=C3[`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=C3[`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,Re(this.cameraGroup,!0),Re(this.objectOuterGroup,!0),Re(this.objectInnerGroup,!0),Re(this.holdingBlockInnerGroup,!0),this.holdingBlock=void 0,this.playerHand&&(Re(this.playerHand,!0),this.playerHand=void 0)}},Fi=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 Ct);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 ct(()=>({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 k0("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 Oe(this.idleOffset,this.tween).to({y:.05,rotationZ:.05},3e3).easing(He.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()}},zi=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 k0("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),a=Math.sin(s*this.PI);if(this.type==="hand"){let v=this.debugParams.armSwingXPosScale*a,l=this.debugParams.armSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.armSwingZPosScale*o;this.handMesh.position.x+=v,this.handMesh.position.y+=l+this.debugParams.armHeightScale*i,this.handMesh.position.z+=c,this.handMesh.rotation.y+=de.MathUtils.degToRad(this.debugParams.armSwingYRotAmount*a),this.handMesh.rotation.z+=de.MathUtils.degToRad(this.debugParams.armSwingZRotAmount*o)}else{let v=this.debugParams.itemSwingXPosScale*a,l=this.debugParams.itemSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.itemSwingZPosScale*o;this.handMesh.position.x+=v,this.handMesh.position.y+=l+this.debugParams.itemHeightScale*i,this.handMesh.position.z+=c,this.handMesh.rotation.y+=de.MathUtils.degToRad(this.debugParams.itemPreswingRotY),this.handMesh.rotation.x+=de.MathUtils.degToRad(this.debugParams.itemSwingXRotAmount*o),this.handMesh.rotation.y+=de.MathUtils.degToRad(this.debugParams.itemSwingYRotAmount*a),this.handMesh.rotation.z+=de.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 U5(n,e=!1){return n.displayOptions.inWorldRenderingConfig.handRenderer==="legacy"?new L5(n,e):new M5(n,e)}E();x();k();R();import*as Qe from"three";import{Vec3 as Li}from"vec3";var B3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAALUlEQVR42mP4//8/IyWYYdSAwW6Ara3tf4oMmD179n9ChhD0AsiQ0Wgc7AYAAOqH+zNQ3r9kAAAAAElFTkSuQmCC";var P3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAOklEQVR42mP4//8/IyWYYdQA3AbY2tr+H1gDZs+e/R9mCD7D8IYBzBAQTXYgEvIKQQPw2T6aEqlkAADEA/W3ycLXvwAAAABJRU5ErkJggg==";var I3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAQklEQVR42mP4//8/IyWYYRgbYGtr+39wGQDiYzMUpwGzZ8+GawDRID4IkxSIMEOwaSQ6FgiFBW0NIOR8osJgBOQFALo37sVTOo/LAAAAAElFTkSuQmCC";var H3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAWElEQVR42mP4//8/IyWYYXAbYGtr+59sA0CaZ8+eTZkBhNg4DQApQlYIcglMDN1VWA0AKYJpQvYONi/hDUSYIfjCgmA0EooJ2hmAK9CINgBXoA2xvEAMBgBGPud3dYZtOQAAAABJRU5ErkJggg==";var O3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAYklEQVR42r1TQQrAMAxyD8tL89iMHgQJoQxHewi0UsWYFFX1/CkcF4iIsgUWOTM9ASV3F3rHF+v9rK4wEVnEFoFYbwmTbRZFFN9m0B9QZBfk2THaAhqktQdTkHYL9iZe+40vs7nda+BuVOMAAAAASUVORK5CYII=";var D3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAcElEQVR42rWTWwpAIQhEbWGu1MUaXRgQcXpyP8SIPI1jibu3l5DfAKrqyFgfAczsKxx5xJUCFGYFUZXMpOe9CAa8BOS+0U5UVbYQ6Siqbi0BFT0auTSRHZqNkE6BGXgEYKYtAczIbQAz8ukzXT3l3egz49IXvXQCVAAAAABJRU5ErkJggg==";var F3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAeElEQVQ4jaWSQQ4AIQgD9WG8tI/tnkgaUgmuBw8YHcqERXK/nOUuI4JPAABMSESwA1qAQgAQwBygnfNjTaCpWoBzUlNZQJ07x9FUdgSlV5FaW4Cjq8isW8BJ2GgPtEuVdr0HKvLXHjiRI0An8jTKqo9dF000cnBzPgKuxXtbq/m1AAAAAElFTkSuQmCC";var z3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhUlEQVR42qWTSRKAMAgE8WF5KY/FygEL2yEp9cAhCz0wJBYRx58wbowxYsZngLvHjITsgNYpJySBrPIBUMqZSHhdSw+oQlgVa01U7VRQ7huTk67aUWZaVyaNZFsSQBCTVBW3KahLyo/lQ6KR1Y+2BTUyGqke1AXoxsSzpYlU3FW0/Exv1ie0hq53Bf15aAAAAABJRU5ErkJggg==";var L3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAmklEQVR42o2SYQ6FMAiDeQfbSXdYXjSpqd869QeZQiilpbr7l2KM0cc75+xUV77YpGCjAPUqitMU3uCAXrsAlPSCcgJMbG4M0mQ1Etz/i0KlXQnmwyqpv1uH4h7fiws7ISneTYNEk0ImCxcAArGJrE4AXhypPtl7AqTdeJG8k3gHb0L6QfmK9WQTa59cSFdHRssKFHHngteV/wPDepaHIu0QVAAAAABJRU5ErkJggg==";var U3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAoUlEQVR42n2Tyw3AIAxD3cGYlGFTUSmV+2o4IEEAf2JQVV1rjDGq576ec5avWVdfWIW12aMPEJBEImoPv+CAvvcCODsVNWBS8wA4A5ndv1/ytciQvBLMyeTSHD3ZYXPXXH7Y0ZMdJvCxQJls5O6tKHlPPWGEfU58WZR6ive1kKSleFNC2kXGRnrcDqhTTOmPeP3pAZnTq6Oin4X0oXbfnNZu626Io6lqGCwAAAAASUVORK5CYII=";var L1=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=[B3,P3,I3,H3,O3,D3,F3,z3,L3,U3];for(let i=0;i<10;i++)Pt(t[i]).then(s=>{s.magFilter=Qe.NearestFilter,s.minFilter=Qe.NearestFilter,this.breakTextures.push(s)});let r=new Qe.MeshBasicMaterial({transparent:!0,blending:Qe.MultiplyBlending,alphaTest:.5});this.blockBreakMesh=new Qe.Mesh(new Qe.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 ht({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:a}=r,v=new Li(i.x,i.y,i.z);this.blockBreakMesh.scale.set(s*1.001,o*1.001,a*1.001),v.add(new Li(e.x,e.y,e.z)),this.blockBreakMesh.position.set(v.x,v.y,v.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)&&fv(t??[],this.interactionLines.shapePositions??[])&&!r||(this.interactionLines!==null&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.interactionLines.mesh),this.interactionLines=null),e===null))return;let i=new Qe.Group;for(let{position:s,width:o,height:a,depth:v}of t??[]){let l=new Li(s.x,s.y,s.z),c=[1.0001*o,1.0001*a,1.0001*v],u=new Qe.BoxGeometry(...c),h=new ft().fromEdgesGeometry(new Qe.EdgesGeometry(u)),p=new D5(h,this.cursorLineMaterial);p.position.set(l.x,l.y,l.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()}},fv=(n,e)=>{if(n.length!==e.length)return!1;for(let[t,r]of n.entries())if(r!==e[t])return!1;return!0};E();x();k();R();E();x();k();R();var hv=a5(_i(),1);import G3 from"prismarine-nbt";import{getItemDefinition as mv}from"mc-assets/dist/itemDefinitions";var pv=(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 a=o.get("custom_name")||o.get("item_name");a&&(t=typeof a.data=="string"?a.data:G3.simplify(a.data));let v=o.get("item_model");if(v&&(r=v.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 l=o.get("lore");l&&(t??(t=n.displayName??n.name),t+=`
21460
- ${JSON.stringify(l.data)}`)}if(n.nbt){let o=G3.simplify(n.nbt),a=o.display?.Name;a&&(t=a),s&&o.CustomModelData&&s[o.CustomModelData]&&(r=s[o.CustomModelData])}return{customText:t,customModel:r}};var N3=(n,e,t,r)=>{let i=n.name,{customModel:s}=pv(n,t);s&&(i=s);let o=us(r,{...e}),a=t.currentResources,v=mv(es(a),{name:i,version:a.version,properties:o})?.model;return(v==="minecraft:special"?void 0:v)??i};E();x();k();R();var K3=a5(Y3(),1);import{versionToNumber as Q3}from"mc-assets/dist/utils";var J3=(n,e,t=!1,r=!1)=>{let i=n.modelName,s=globalThis.loadedData.itemsByName[i];Q3(e.currentResources.version)<Q3("1.13")&&(i=(0,K3.getRenamedData)(s?"items":"blocks",i,e.currentResources.version,"1.13.1"));let o;if(!r){let v=e.currentResources?.guiAtlas?.json,l=u=>u&&v?.textures[u.replace("minecraft:","").replace("block/","").replace("blocks/","").replace("item/","").replace("items/","").replace("_inventory","")],c=l(i)??l(n.originalItemName);if(c){let u=c.u*v.width,h=c.v*v.height;return{texture:"gui",slice:[u,h,v.tileSize,v.tileSize],scale:.25,blockData:null,modelName:null}}}let a=v=>v.top??v;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(v){reportError?.(`Failed to render item ${i} (original: ${n.originalItemName}) on ${e.currentResources.version} (resourcepack: TODO!): ${v.stack}`),o=a(e.currentResources.itemsRenderer.getItemTexture("errored"))}return o??(o=a(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 Z3=(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 a=o?globalThis.loadedData.blocksByStateId[o]?.name:typeof s=="number"?globalThis.loadedData.items[s]?.name:s;if(!a)throw new Error(`Item not found: ${s}`);let v=N3({...n,name:a},e,t,r),l=J3({modelName:v},t,!1,!0);if(!l)throw new Error(`Failed to get render info for item ${a}`);let c=l.texture==="blocks"?i.blocksAtlasImage:i.itemsAtlasImage;if(l.blockData)return{resolvedModel:l.blockData.resolvedModel,modelName:l.modelName};if(l.slice){let[u,h,p,g]=l.slice,[y,A,b,w]=[u/c.width,h/c.height,p/c.width,g/c.height];return{u:y,v:A,su:b,sv:w,renderInfo:l,modelName:l.modelName}}throw new Error(`Invalid render info for item ${a}`)}catch(a){return reportError?.(a),{u:0,v:0,su:16/i.blocksAtlasImage.width,sv:16/i.blocksAtlasImage.width,modelName:"missing"}}};E();x();k();R();import*as Qt from"three";var G1=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 Qt.AudioListener,this.worldRenderer.camera.add(this.audioListener))}playSound(e,t,r=1,i=1,s=500){this.initAudioListener();let o=new Qt.PositionalAudio(this.audioListener);this.activeSounds.add(o),this.soundVolumes.set(o,r);let a=new Qt.AudioLoader,v=Date.now();a.loadAsync(t).then(l=>{Date.now()-v>s||(o.setBuffer(l),o.setRefDistance(20),o.setVolume(r*this.baseVolume),o.setPlaybackRate(i),this.worldRenderer.sceneOrigin.addAndTrack(o),o.position.set(e.x,e.y,e.z),o.onEnded=()=>{this.worldRenderer.sceneOrigin.removeAndUntrack(o),o.source&&o.disconnect(),this.activeSounds.delete(o),this.soundVolumes.delete(o),a.manager.itemEnd(t)},o.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(){this.playSound(this.worldRenderer.camera.position,"/sound.mp3")}};E();x();k();R();import*as Le from"three";var N1=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 Le.Quaternion().setFromAxisAngle(new Le.Vector3(0,1,0),this.baseYaw);e.setRotationFromQuaternion(t)}else{let t=this.addAntiZfightingOffset(this.basePitch),r=this.addAntiZfightingOffset(this.baseYaw),i=new Le.Quaternion().setFromAxisAngle(new Le.Vector3(1,0,0),t),s=new Le.Quaternion().setFromAxisAngle(new Le.Vector3(0,1,0),r),o=new Le.Quaternion().setFromAxisAngle(new Le.Vector3(0,0,1),Le.MathUtils.degToRad(this.rollAngle)),a=new Le.Quaternion,v=new Le.Quaternion,l=this.worldRenderer.playerStateReactive.perspective;if(this.cameraBobInput){let u=w1(this.cameraBobInput);a=new Le.Quaternion().setFromAxisAngle(new Le.Vector3(0,0,1),u.rotation.z),v=new Le.Quaternion().setFromAxisAngle(new Le.Vector3(1,0,0),u.rotation.x),l==="first_person"&&this.worldRenderer.camera.position.set(u.position.x,u.position.y,0)}else l==="first_person"&&this.worldRenderer.camera.position.set(0,0,0);let c=s.multiply(i).multiply(o).multiply(a).multiply(v);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}};E();x();k();R();import*as K from"three";var W1=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 a=s.getContext("2d");if(!a)return new K.CanvasTexture(s);a.clearRect(0,0,s.width,s.height),a.fillStyle=`rgba(${r>>16&255}, ${r>>8&255}, ${r&255}, 1)`,a.fillRect(0,0,s.width,s.height),a.fillStyle="#ff0000",a.font="bold 10px sans-serif",a.textAlign="center",a.textBaseline="middle",a.fillText(i,s.width/2,s.height/2,s.width);let v=new K.CanvasTexture(s);return v.minFilter=K.LinearFilter,v.magFilter=K.LinearFilter,v}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 a=r>>16&255,v=r>>8&255,l=r&255;o.fillStyle=`rgba(${a}, ${v}, ${l}, ${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 a=t.src.endsWith(".png")||t.src.endsWith(".jpg")||t.src.endsWith(".jpeg")||t.imageOverride;i&&!t.imageOverride&&fetch(t.src,{method:"HEAD"}).then(M=>{M.headers.get("content-type")?.startsWith("image/")&&(this.destroyMedia(e),this.addMedia(e,{...r,src:t.src,imageOverride:!0}))}).catch(console.error);let v,l,c=ae&&!a;if(!a&&!c){v=document.createElement("video"),v.src=t.src.endsWith(".gif")?t.src.replace(".gif",".mp4"):t.src,v.loop=t.loop??!0;let M=(t.volume??1)*this.worldRenderer.worldRendererConfig.volume;v.volume=Math.min(M,1),v.playsInline=!0,v.crossOrigin="anonymous";let I=this.worldRenderer.soundSystem;if(I.initAudioListener(),!I.audioListener)throw new Error("Audio listener not initialized");l=new K.PositionalAudio(I.audioListener),l.setRefDistance(6),l.setVolume(M),this.worldRenderer.sceneOrigin.addAndTrack(l),l.position.set(t.position.x,t.position.y,t.position.z),l.setMediaElementSource(v),l.connect(),v.addEventListener("pause",()=>{l?.pause(),globalThis.tempSendVideoStop?.(e,"paused",v.currentTime)}),v.addEventListener("play",()=>{l?.play(),globalThis.tempSendVideoPlay?.(e)}),v.addEventListener("seeked",()=>{l&&v&&(l.offset=v.currentTime)}),v.addEventListener("stalled",()=>{globalThis.tempSendVideoStop?.(e,"stalled",v.currentTime)}),v.addEventListener("waiting",()=>{globalThis.tempSendVideoStop?.(e,"waiting",v.currentTime)}),v.addEventListener("error",({error:B})=>{globalThis.tempSendVideoStop?.(e,`error: ${B}`,v.currentTime)}),v.addEventListener("ended",()=>{globalThis.tempSendVideoStop?.(e,"ended",v.currentTime),t.loop||(v.currentTime=0,C.ended=!0)})}let u=this.createBackgroundTexture(t.size.width,t.size.height,t.background),h=M=>{let I=this.createErrorTexture(t.size.width,t.size.height,t.background,M);y.map=I,y.needsUpdate=!0},p=new K.PlaneGeometry(1,1),g=t.allowLighting?K.MeshLambertMaterial:K.MeshBasicMaterial,y=new g({map:u,transparent:!0,side:t.doubleSide?K.DoubleSide:K.FrontSide,alphaTest:.1}),A;if(v)A=new K.VideoTexture(v);else if(c)A=this.createErrorTexture(t.size.width,t.size.height,t.background,"Video unavailable (multi-thread)");else if(ae){let M=y5(t.src);A=M.texture,A.minFilter=K.NearestFilter,A.magFilter=K.NearestFilter,M.promise.then(()=>{this.customMedia.get(e)?.texture===A&&(y.map=A,y.needsUpdate=!0)}).catch(()=>h())}else A=new K.TextureLoader().load(t.src,()=>{this.customMedia.get(e)?.texture===A&&(y.map=A,y.needsUpdate=!0)},void 0,()=>h());A.minFilter=K.NearestFilter,A.magFilter=K.NearestFilter,A.generateMipmaps=!1;let b=new K.Mesh(p,y),{mesh:w}=this.positionMeshExact(b,K.MathUtils.degToRad((t.rotation??0)*90),t.position,t.size.width,t.size.height);s.add(w),v&&(b.onBeforeRender=()=>{v.readyState===v.HAVE_ENOUGH_DATA&&(!v.paused||!C?.hadAutoPlayError)&&(y.map!==A&&(y.map=A,y.needsUpdate=!0),A.needsUpdate=!0,l&&(l.position.copy(w.position),l.rotation.copy(w.rotation)))});let S=M=>{let I=p.attributes.uv.array;I[0]=M.startU,I[1]=M.startV,I[2]=M.endU,I[3]=M.startV,I[4]=M.endU,I[5]=M.endV,I[6]=M.startU,I[7]=M.endV,p.attributes.uv.needsUpdate=!0};t.uvMapping&&S(t.uvMapping);let C={mesh:w,video:v,texture:A,updateUVMapping:S,positionalAudio:l,props:r,hadAutoPlayError:!1,pausedBecuaseHidden:!1,ended:!1,handleError(M){if(C.destroyed)return;let I=B=>B;h(M.name==="NotAllowedError"||M.name==="AbortError"?I("Waiting for user interaction"):I("Failed to auto play"))}};return this.customMedia.set(e,C),v&&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 a=new K.Group;a.add(e);let v=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711680}));v.position.set(r.x,r.y,r.z),a.add(v);let l=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),a.add(u);let h=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16776960}));h.position.set(l,r.y,c),a.add(h);let p=new K.Mesh(new K.BoxGeometry(.1,.1,.1),new K.MeshBasicMaterial({color:16711935}));p.position.set(l,r.y+s,c),a.add(p);let g=new K.Vector3(this.worldRenderer.sceneOrigin.toSceneX(r.x),this.worldRenderer.sceneOrigin.toSceneY(r.y),this.worldRenderer.sceneOrigin.toSceneZ(r.z)),y=new K.ArrowHelper(new K.Vector3(Math.cos(t),0,Math.sin(t)),g,1,16711680);return a.add(y),{mesh:e,debugGroup:a}}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],a=o.object;for(let[v,l]of this.customMedia.entries())if(a===l.mesh||l.mesh.children.includes(a)){let{uv:c}=o;if(c){let u={id:v,x:c.x,y:c.y};this.worldRenderer.reactiveState.world.intersectMedia=u,this.worldRenderer.debugVideo=l,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),a=o?.props.controlMode;if(o?.video&&(a?.mouseButton==="both"||a?.mouseButton===e))switch(a?.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}}}}};E();x();k();R();import*as L0 from"three";E();x();k();R();import*as ke from"three";var wv=1,q3=10,p0={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 $3(n){let e=n.color??16711680,t=n.depthTest??!1,r=n.visualScale??n.metadata?.visualScale??(typeof window>"u"?void 0:window.serverMetadata?.waypointVisualScale)??p0.DEFAULT_VISUAL_SCALE,i=n.opacity??n.metadata?.opacity??(typeof window>"u"?void 0:window.serverMetadata?.waypointOpacity)??p0.DEFAULT_OPACITY,s=Ve(X3(),X3());V1(s,e,n.label??"","0m",r);let o=new ke.CanvasTexture(s);o.anisotropy=1,o.magFilter=ke.LinearFilter,o.minFilter=ke.LinearFilter;let a=new ke.SpriteMaterial({map:o,transparent:!0,opacity:1,depthTest:t,depthWrite:!1}),v=new ke.Sprite(a);v.position.set(0,0,0),v.renderOrder=10,v.material.opacity=i;let l=n.label??"",c="0m",u=Number.NaN,h,p,g,y,A=null,b=p0.ARROW.enabledDefault,w=new ke.Group;w.add(v);let{x:S,y:C,z:M}=n.position;w.position.set(S,C,M);function I(){o.needsUpdate=!0}function B(){if(!p||!g)return;let Y=p.width;g.clearRect(0,0,Y,Y),g.beginPath(),g.moveTo(Y*.15,Y*.5),g.lineTo(Y*.85,Y*.5),g.lineTo(Y*.5,Y*.15),g.closePath();let oe=`#${e.toString(16).padStart(6,"0")}`;g.lineWidth=6,g.strokeStyle="black",g.stroke(),g.fillStyle=oe,g.fill(),y&&(y.needsUpdate=!0)}function H(Y){e=Y,c="0m",u=0,V1(s,e,l,"0m",r),I(),h&&B()}function G(Y){l=Y??"",V1(s,e,l,c,r),I()}function O(Y,oe){oe!==c&&(c=oe,V1(s,e,Y,oe,r),I())}function j(Y){v.visible=Y}function J(Y,oe,xe){w.position.set(Y,oe,xe)}function Z(Y,oe,xe,Je){let Ne=oe*Math.PI/180,_e=Math.tan(Ne/2)*2*xe*(p0.TARGET_SCREEN_PX*r/Je);v.scale.set(_e,_e,1)}function $(){if(h)return;let Y=128;p=Ve(Y,Y),g=p.getContext("2d"),B(),y=new ke.CanvasTexture(p),y.anisotropy=1,y.magFilter=ke.LinearFilter,y.minFilter=ke.LinearFilter;let oe=new ke.SpriteMaterial({map:y,transparent:!0,depthTest:!1,depthWrite:!1,opacity:i});h=new ke.Sprite(oe),h.renderOrder=12,h.visible=!1,A&&A.add(h)}function ue(Y){b=Y,!Y&&h&&(h.visible=!1)}function le(Y){h?.parent&&h.parent.remove(h),A=Y,h&&Y&&Y.add(h)}function ce(Y,oe,xe){if(!b||($(),!h))return!0;let Je=n.metadata?.onlyLeftRight===!0,Ne=new ke.Vector3;Y.getWorldDirection(Ne);let n0=Y.up.clone().normalize(),_e=new ke.Vector3().copy(Ne).cross(n0).normalize(),f0=new ke.Vector3().copy(_e).cross(Ne).normalize(),i5=new ke.Vector3().setFromMatrixPosition(Y.matrixWorld),n5=new ke.Vector3(w.position.x,w.position.y,w.position.z).sub(i5),W0=n5.dot(Ne),S0=n5.dot(_e),V0=n5.dot(f0),K5=oe/xe,j0=Y.fov*Math.PI/180,Et=2*Math.atan(Math.tan(j0/2)*K5),J5=Math.atan2(S0,W0),Z5=Math.atan2(V0,W0);if(W0>0&&Math.abs(J5)<=Et/2&&Math.abs(Z5)<=j0/2)return h.visible=!1,!0;let Ze=J5/(Et/2),Me=Z5/(j0/2);W0<=0&&(Math.abs(Ze)>Math.abs(Me)?(Ze=Math.sign(Ze),Me=0):(Ze=0,Me=Math.sign(Me))),Je&&(Math.abs(Ze)>Math.abs(Me)||(Ze=Ze>=0?1:-1),Me=0);let xt=Math.max(Math.abs(Ze),Math.abs(Me))||1,s5=Ze/xt,s0=Me/xt,Rt=p0.ARROW.paddingPx,_=(s5+1)*.5*oe,f=(1-s0)*.5*xe,m=Math.min(Math.max(_,Rt),oe-Rt),T=Math.min(Math.max(f,Rt),xe-Rt);s5=m/oe*2-1,s0=-(T/xe)*2+1;let P=Math.max(2,Y.near*4),F=Math.tan(j0/2)*P,N=F*K5,ie=i5.clone().add(Ne.clone().multiplyScalar(P)).add(_e.clone().multiplyScalar(s5*N)).add(f0.clone().multiplyScalar(s0*F));h.visible=!0,h.position.copy(ie);let pe=Math.atan2(Me,Ze);h.material.rotation=pe-Math.PI/2;let me=Math.tan(j0/2)*2*P*(p0.ARROW.pixelSize*r/xe);return h.scale.set(me,me,1),!1}function Ee(Y){return Y.distanceTo(w.position)}function Ie(Y,oe,xe,Je){let Ne=Ee(Y);Z(Y,oe.fov,Ne,Je);let n0=Math.round(Ne/q3)*q3;n0!==u&&(u=n0,O(l,`${Math.max(0,n0)}m`));let _e=ce(oe,xe,Je);return j(_e),_e}function se(){let Y=v.material;if(Y.map?.dispose(),Y.dispose(),h){h.parent&&h.parent.remove(h);let oe=h.material;oe.map?.dispose(),oe.dispose()}h=void 0,p=void 0,g=void 0,y=void 0}return{group:w,sprite:v,enableOffscreenArrow:ue,setArrowParent:le,updateForCamera:Ie,setColor:H,setLabel:G,updateDistanceText:O,setVisible:j,setPosition:J,dispose:se}}function ea(){let n=globalThis.devicePixelRatio||1,e=Math.min(n,wv);return p0.CANVAS_SCALE*e}function X3(){return Math.round(p0.CANVAS_SIZE*ea())}function V1(n,e,t,r,i){let s=n.width,o=ea(),a=n.getContext("2d");a.clearRect(0,0,s,s);let v=s/2,l=Math.round(s*p0.LAYOUT.DOT_Y),c=Math.round(s*.05*i),u=Math.max(2,Math.round(4*o*i)),h=c+u;a.beginPath(),a.arc(v,l,h,0,Math.PI*2),a.fillStyle=`#${e.toString(16).padStart(6,"0")}`,a.fill(),a.textAlign="center",a.textBaseline="middle";let p=Math.round(s*.08*i),g=Math.round(s*.06*i);a.font=`800 ${p}px mojangles`,a.lineWidth=Math.max(2,Math.round(3*o*i));let y=Math.round(s*p0.LAYOUT.NAME_Y);a.strokeStyle="black",a.strokeText(t,v,y),a.fillStyle="white",a.fillText(t,v,y),a.font=`800 ${g}px mojangles`,a.lineWidth=Math.max(2,Math.round(2*o*i));let A=Math.round(s*p0.LAYOUT.DISTANCE_Y);a.strokeStyle="black",a.strokeText(r,v,A),a.fillStyle="#CCCCCC",a.fillText(r,v,A)}var j1=class{constructor(e){this.worldRenderer=e;d(this,"waypoints",new Map);d(this,"waypointScene",new L0.Scene);d(this,"lastCameraPosition",new L0.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 L0.Vector2);for(let o of this.waypoints.values()){let a=new L0.Vector3(o.x,o.y,o.z),v=t.distanceTo(a),l=(!o.minDistance||v>=o.minDistance)&&(o.maxDistance===1/0||v<=o.maxDistance);o.sprite.setVisible(l),l&&(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:a,metadata:v}=s,l=s.minDistance??0,c=s.maxDistance??1/0,u=$3({position:new L0.Vector3(t,r,i),color:o,label:a||e,metadata:v});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:l,maxDistance:c,color:o,label:a,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))}};E();x();k();R();import*as Ae from"three";import{Vec3 as G5}from"vec3";var we=class we{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 Ae.BoxGeometry(we.DEFAULT_PARTICLE_SIZE,we.DEFAULT_PARTICLE_SIZE,we.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 Ae.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=we.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],a=Math.floor(we.DEFAULT_PARTICLE_COUNT*t),v;if(we.DEBUG_SHOW_EXPLOSION_CENTER){let c=.5*t,u=new Ae.SphereGeometry(c,8,8),h=new Ae.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});v=new Ae.Mesh(u,h),v.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(v),v.position.set(e.x,e.y,e.z)}for(let c=0;c<a;c++){let u=Math.random()*Math.PI*2,h=Math.sqrt(Math.random())*we.VELOCITY_FACTOR*t,p=new G5(h*Math.cos(u),Math.random()*.5-.25,h*Math.sin(u));c<5;let g=r===void 0?this.getRandomMaterial().clone():new Ae.MeshBasicMaterial({color:r,transparent:!0,opacity:1}),y=new Ae.Mesh(this.particleGeometry,g);y.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(y),y.position.set(e.x,e.y,e.z),c<5;let A={position:e.clone(),velocity:p,color:new Ae.Color(g.color),life:1,maxLife:1,mesh:y};o.push(A)}let l={id:s,position:e.clone(),particles:o,startTime:Date.now(),duration:i,size:t,debugSphere:v};return this.explosions.set(s,l),l}createExplosionFacingCamera(e,t=1,r,i=we.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],a=Math.floor(we.DEFAULT_PARTICLE_COUNT*t),v;if(we.DEBUG_SHOW_EXPLOSION_CENTER){let h=.5*t,p=new Ae.SphereGeometry(h,8,8),g=new Ae.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});v=new Ae.Mesh(p,g),v.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(v),v.position.set(e.x,e.y,e.z)}let l=this.worldRenderer.getCameraPosition(),c=new G5(l.x-e.x,l.y-e.y,l.z-e.z).normalize();for(let h=0;h<a;h++){let p=Math.random()*Math.PI*2,g=Math.sqrt(Math.random())*we.VELOCITY_FACTOR*t,y=new G5(g*Math.cos(p),g*Math.sin(p),0),A=new G5(y.x*c.x-y.z*c.z,y.y,y.x*c.z+y.z*c.x);h<5;let b=r===void 0?this.getRandomMaterial().clone():new Ae.MeshBasicMaterial({color:r,transparent:!0,opacity:1}),w=new Ae.Mesh(this.particleGeometry,b);w.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(w),w.position.set(e.x,e.y,e.z);let S={position:e.clone(),velocity:A,color:new Ae.Color(b.color),life:1,maxLife:1,mesh:w};o.push(S)}let u={id:s,position:e.clone(),particles:o,startTime:Date.now(),duration:i,size:t,debugSphere:v};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 G5(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)},we.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+=we.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 a=e.life;e.life-=t/r;let v=Math.max(0,e.life);if(e.mesh.material instanceof Ae.MeshBasicMaterial&&(e.mesh.material.opacity=v),i&&a>.95){let l=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 Ae.Material&&r.mesh.material.dispose();t.debugSphere&&(this.worldRenderer.sceneOrigin.removeAndUntrack(t.debugSphere),t.debugSphere.geometry.dispose(),t.debugSphere.material instanceof Ae.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(we,"DEFAULT_PARTICLE_COUNT",50),d(we,"DEFAULT_PARTICLE_SIZE",.05),d(we,"DEFAULT_EXPLOSION_DURATION",6e3),d(we,"GRAVITY",-.005),d(we,"VELOCITY_FACTOR",1.5),d(we,"TEST_INTERVAL",1e3),d(we,"DEBUG_SHOW_EXPLOSION_CENTER",!0),d(we,"DEBUG_SHOW_PARTICLE_TRAILS",!1);var Y1=we;E();x();k();R();import*as mt from"three";import{Vec3 as Ui}from"vec3";var Q1=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 Ui(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}]),a=[i,s,o];return this.startScript(a[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 mt.Vector3(t.lookAt.x,t.lookAt.y,t.lookAt.z),h=new mt.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 a=this.getEasingFunction(t.easing||"easeInOut"),v=new Oe(this.currentPosition).to(i,r).easing(a).onUpdate(()=>{this.updateCamera(new Ui(this.currentPosition.x,this.currentPosition.y,this.currentPosition.z),this.currentRotation.yaw,this.currentRotation.pitch)}),l=new Oe(this.currentRotation).to(this.wrapRotation(s),r).easing(a).onUpdate(()=>{this.updateCamera(new Ui(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 Oe(u).to({fov:o},r).easing(a).onUpdate(()=>{this.currentFov=u.fov,this.updateFov(this.currentFov)})}this.currentTweens=[v,l],c&&this.currentTweens.push(c),v.start(),l.start(),c?.start(),v.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 He.Linear.None;case"easeIn":return He.Quadratic.In;case"easeOut":return He.Quadratic.Out;case"easeInOut":return He.Quadratic.InOut;case"smoothstep":return He.Cubic.InOut;case"bounce":return He.Bounce.Out;default:return He.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 a=0;a<=8;a++){let v=a/8*Math.PI*2,l=e.x+Math.cos(v)*t,c=e.z+Math.sin(v)*t,u=e.y+r;s.push({x:l,y:u,z:c,yaw:v+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,a=20;for(let v=0;v<=o;v++){let l=v/o,c=l*r*Math.PI*2,u=mt.MathUtils.lerp(e.x,t.x,l)+Math.cos(c)*a*(1-l),h=mt.MathUtils.lerp(e.z,t.z,l)+Math.sin(c)*a*(1-l),p=mt.MathUtils.lerp(e.y,t.y,l);s.push({x:u,y:p,z:h,yaw:c+Math.PI/2,pitch:-.3*l,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}}};E();x();k();R();import*as ee from"three";var Gi=.75,K1=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",Gi);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 k0("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.encoding=ee.sRGBEncoding,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),a=this.getSkyColorByTemp(o),v=(a>>16&255)/255,l=(a>>8&255)/255,c=(a&255)/255;return new ee.Vector3(v*s,l*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 a=(e-Math.floor(e))*6,v=a-Math.floor(a),l=r*(1-t),c=r*(1-t*v),u=r*(1-t*(1-v));switch(Math.floor(a)){case 0:i=Math.floor(r*255+.5),s=Math.floor(u*255+.5),o=Math.floor(l*255+.5);break;case 1:i=Math.floor(c*255+.5),s=Math.floor(r*255+.5),o=Math.floor(l*255+.5);break;case 2:i=Math.floor(l*255+.5),s=Math.floor(r*255+.5),o=Math.floor(u*255+.5);break;case 3:i=Math.floor(l*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(l*255+.5),o=Math.floor(r*255+.5);break;case 5:i=Math.floor(r*255+.5),s=Math.floor(l*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 g=this.waterBreathing?100:5;this.scene.fog=new ee.Fog(new ee.Color(0,0,1),.0025,g),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),a=this.getFogColor(this.partialTicks),v=Math.cos(s*Math.PI*2)*2+.5,l=Math.max(0,Math.min(1,v)),c=this.prevFogBrightness+(this.fogBrightness-this.prevFogBrightness)*this.partialTicks,u=(a.x+(o.x-a.x)*i)*l*c,h=(a.y+(o.y-a.y)*i)*l*c,p=(a.z+(o.z-a.z)*i)*l*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))}};E();x();k();R();import*as re from"three";var Av=`
21480
+ f 71/216/54 68/215/54 67/214/54 72/213/54`;var s1={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/HBcUGbQJCBkBejgkMrt3j5WeYGD0iAglkXkehVZFlBQ2b0FkKjtE2CjIIYEUfIhESdMCUyWoyBFZPZI+Nks8OUs/f7kXSsLgCxwiRbBl9YRgddazcC5lhnc/T1VFdQObDMIwdJBRQQhYNWBTTCXYzR0AMZIyOy9c373FuQFGXLJLzYFE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W/k/w/m+U4SDJ84MkMhxlmY7y8TCVGy8fpsR+WnXDGuPq8mHIN8fuL8tkDiT4AAAAAElFTkSuQmCC",parrot:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAP1BMVEUAAAD/////7nn/6j3/5TPGxsa7u7vZra23t7ewsLCoqKienp6ZmZmWlpaRkZGQkJD3cwmGhoYlJSUPDw8AAAD7udxiAAAAAXRSTlMAQObYZgAAANJJREFUeNrN0tEKwjAMBdDGxpnbZqtx/v+32jYMN9QKPnkhYdBDk0EDHSIQ0CGBDkEV/pFgahtgBhxEZu7nSGj1Ajg6SAmpVQe4M98hgHCMVUAgqklbObgyXwGhXczUWlXg10Z+bj/4i3X19gra1KJrDfVGakcARdFyqyEHS353w35J2oGiBRO8++miqrU2MJdZIN6pJy+Lz3Cgs04yeaees6qeByMypZQo548jLDdl9mnE8D18B+EyBiG4+AGMduBwCi2/g+BiAAJ/BTwEW/4XPABsMA1LwNN2rAAAAABJRU5ErkJggg==",piglin:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAWlBMVEUAAAD/gID/////7aj/5bX12iryuobMzIPCwnTooHTVlXreihzJgmWHh1e6ZkWtVTKiWTplXEOhPjiESzOXQyKNNQ1rOSR6JiF2Kw08OS5TKxpgIwo6GgwhHhyEOBusAAAAAnRSTlMABHH+CSEAAAKgSURBVHja7ZZxU9swDMXDWAMSRspwYiDQ7/81pyd5Vzzf3Oz4t78GRU2kF9m5Hm8y7h8sMM34zMQrcKZj3BvTRHMVoHVVJwRm41n1eSDwYFSB2QW0AoG4psY0JgRAK5BeiV7TWCD2wLt7AXkhehE1Du1BL6CPKT0quL4HgMgFxIBAy6xt3hICsYniHBRIzET+6Ij1jxg3/NUyXxEwiK0wiITZBJC3And3d10uzCzKjOkNOzGrX6wKJoUVpiTJQ5MbVseyqpX9SEQWmHUV+4obhI8LQCd5aHJDBALCRLIaQuRfWSRhBK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FW7h8NAW+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/e3eja01vbWqQXkNjYmAAlhFUU1N1Ry93QjVcQjpISElMODM9LSkzJBEjIyMjGBTjk4HHAAAADXRSTlMAAAAAAAAAAAAAAAAA7Uh4SAAAAn9JREFUeNrtlN1ymzAQRm3cuG5C9oMFJIW0id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EPOKZbVKaZW0aWIpvy+bZVOypUYT7vFx9tGz9zOcFuDN/+gIHIEjcASOwBH44cB/1lQM4ZNhKecAAAAASUVORK5CYII="};E();x();k();R();import*as Ge from"three";var o1=class{constructor(e,t){this.object=e;this.animations=t;d(this,"timer",new Ge.Timer);d(this,"animatedObjects",new Set);d(this,"state")}createAnimationState(){let e=new Ge.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 Ge.Mesh||r instanceof Ge.Line||r instanceof Ge.Points||r instanceof Ge.Sprite){let i=r.onBeforeRender;r.onBeforeRender=(s,o,v,a,l,c)=>{this.timer.update(performance.now());let u=this.timer.getDelta();e.update(u),i?.(s,o,v,a,l,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?Ge.LoopRepeat:Ge.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?Ge.LoopRepeat:Ge.LoopOnce,1/0),r.clampWhenFinished=!t)}stopAnimations(){this.state.mixer.stopAllAction()}getDelta(){return this.timer.update(performance.now()),this.timer.getDelta()}};function Za(n,e){let t=new o1(n,e);return t.createAnimationState(),t}function Sv(n){return"parts"in n&&Array.isArray(n.parts)?n.parts:[n]}var Cv={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 $a(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function Bv(n,e,t,r,i=!1,s=64,o=64,v=!1,a=[]){let l=new te.Euler(0,0,0);r.rotation&&(l.x=-r.rotation[0]*Math.PI/180,l.y=-r.rotation[1]*Math.PI/180,l.z=-r.rotation[2]*Math.PI/180);for(let{dir:c,corners:u,u0:f,v0:m,u1:g,v1:b}of Object.values(Cv)){let A=Math.floor(n.positions.length/3),y=c[0]!==0,_=[];for(let M of u){let C,T;i?(C=(r.uv[0]+M[3]*r.size[0])/s,T=(r.uv[1]+M[4]*r.size[1])/o):(C=(r.uv[0]+$a(M[3]?g:f,r.size))/s,T=(r.uv[1]+$a(M[4]?b:m,r.size))/o);let P=y&&v?M[0]^1:M[0],B=M[1],L=y&&v?M[2]^1:M[2],G=r.inflate??0,H=new te.Vector3(r.origin[0]+P*r.size[0]+(P?G:-G),r.origin[1]+B*r.size[1]+(B?G:-G),r.origin[2]+L*r.size[2]+(L?G:-G));H=H.applyEuler(l),H=H.sub(t.position),H=H.applyEuler(t.rotation),H=H.add(t.position),n.positions.push(H.x,H.y,H.z),n.normals.push(c[0],c[1],c[2]),_.push(C,T),n.skinIndices.push(e,0,0,0),n.skinWeights.push(1,0,0,0)}if(v)for(let M=0;M+1<u.length;M+=2){let C=M*2,T=_.slice(C,C+4);_[C]=T[2],_[C+1]=T[y?1:3],_[C+2]=T[0],_[C+3]=T[y?3:1]}n.uvs.push(..._),n.indices.push(A,A+1,A+2,A+2,A+1,A+3)}}function Kt(n,e,t,r={},i={}){let s=t.texturewidth??64,o=t.textureheight??64,v,a=e.startsWith("block:"),l=n?.material.map;if(a){if(!n)throw new Error("worldRenderer is required for block textures");let _=e.slice(6),M=n.resourcesManager.currentResources.blocksAtlasJson.textures[_];M&&(s=l?.image.width??s,o=l?.image.height??o,v=[M.u,M.v])}let c={},u={positions:[],normals:[],uvs:[],indices:[],skinIndices:[],skinWeights:[]},f=0;for(let _ of t.bones){let M=new te.Bone;if(_.pivot&&(M.position.x=_.pivot[0],M.position.y=_.pivot[1],M.position.z=_.pivot[2]),_.bind_pose_rotation?(M.rotation.x=-_.bind_pose_rotation[0]*Math.PI/180,M.rotation.y=-_.bind_pose_rotation[1]*Math.PI/180,M.rotation.z=-_.bind_pose_rotation[2]*Math.PI/180):_.rotation&&(M.rotation.x=-_.rotation[0]*Math.PI/180,M.rotation.y=-_.rotation[1]*Math.PI/180,M.rotation.z=-_.rotation[2]*Math.PI/180),r.rotation?.[_.name]&&(M.rotation.x-=(r.rotation[_.name].x??0)*Math.PI/180,M.rotation.y-=(r.rotation[_.name].y??0)*Math.PI/180,M.rotation.z-=(r.rotation[_.name].z??0)*Math.PI/180),M.name=`bone_${_.name}`,c[_.name]=M,_.cubes)for(let C of _.cubes){let T=[];Bv(u,f,M,C,a,s,o,_.mirror,T),T.length&&(i.errors??(i.errors=[]),i.errors.push(...T.map(P=>`Bone ${_.name}: ${P}`)))}f++}let m=[];for(let _ of t.bones)_.parent&&c[_.parent]?c[_.parent].add(c[_.name]):m.push(c[_.name]);let g=new te.Skeleton(Object.values(c)),b=new te.BufferGeometry;b.setAttribute("position",new te.Float32BufferAttribute(u.positions,3)),b.setAttribute("normal",new te.Float32BufferAttribute(u.normals,3)),b.setAttribute("uv",new te.Float32BufferAttribute(u.uvs,2)),b.setAttribute("skinIndex",new te.Uint16BufferAttribute(u.skinIndices,4)),b.setAttribute("skinWeight",new te.Float32BufferAttribute(u.skinWeights,4)),b.setIndex(u.indices);let A=new te.MeshLambertMaterial({transparent:!0,alphaTest:.1,side:te.DoubleSide}),y=new te.SkinnedMesh(b,A);if(y.add(...m),y.bind(g),y.scale.set(1/16,1/16,1/16),v){let _=l.clone();_.offset.set(v[0],v[1]),_.needsUpdate=!0,A.map=_}else Mr(e,_=>{A.map||(_.magFilter=te.NearestFilter,_.minFilter=te.NearestFilter,_.flipY=!1,_.wrapS=te.RepeatWrapping,_.wrapT=te.RepeatWrapping,A.map=_)},()=>{let _=A.map;if(!_)return;let M=_.image.width;M&&s!==M&&(_.repeat.x=s/M);let C=_.image.height;C&&o!==C&&(_.repeat.y=o/C),A.needsUpdate=!0});return y}var Pv=[{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 e3(n){for(let e of Pv)if(typeof e.pattern=="string"){if(e.pattern===n)return e.target}else if(e.pattern.test(n))return e.target}var t3=n=>ha[n],r3={zombie:1.85,husk:1.85,arrow:.0025},Iv={zombie:new Zr(0,1,0),husk:new Zr(0,1,0),boat:new Zr(0,-1,0),arrow:new Zr(0,-.9,0)},zt=class{constructor(e,t,r,i={},s={}){d(this,"mesh");d(this,"animations");d(this,"animationControllers",[]);let o=t,v=e3(t);if(v&&(t=v,s.tempMap=v),i.customModel){let l=Sv(i.customModel);this.mesh=new te.Object3D;for(let c=0;c<l.length;c++){let{modelPath:u,modelType:f,metadata:m}=l[c],g=new te.Object3D;switch(g.name=`custom_part_${c}`,f){case"gltf":{new Ev().parseAsync(u,"").then(A=>{if(g.add(A.scene),m?.scale){let y=m.scale;g.scale.set(y,y,y)}if(m?.offset){let{x:y=0,y:_=0,z:M=0}=m.offset;g.position.set(y,_,M)}if(m?.texture){let y=N0(m.texture);g.traverse(_=>{_ instanceof te.Mesh&&(_.material=new te.MeshBasicMaterial({map:y,transparent:!0,alphaTest:.1}))})}if(A.animations?.length){this.animations=[...this.animations??[],...A.animations];let y=Za(g,A.animations);this.animationControllers.push(y);let _=m?.animation,M=m?.animationLoop??!0;_?y.playAnimation(_,M):y.playAnimation(A.animations[0].name,M)}}).catch(A=>{});break}case"obj":{let A=new t5().parse(u);if(m?.scale){let{scale:y}=m;A.scale.set(y,y,y)}if(m?.offset){let{x:y=0,y:_=0,z:M=0}=m.offset;A.position.set(y,_,M)}if(m?.texture){let y=N0(m.texture),_=new te.MeshBasicMaterial({map:y,transparent:!0,alphaTest:.1});A.traverse(M=>{M instanceof te.Mesh&&(M.material=_)})}g.add(A);break}case"bedrock":{let b=JSON.parse(u);if(m?.scale&&g.scale.set(m.scale,m.scale,m.scale),m?.offset){let{x:A=0,y=0,z:_=0}=m.offset;g.position.set(A,y,_)}for(let[A,y]of Object.entries(b.geometry)){let _=m?.textures?.[A]??b.textures?.[A];if(!_)continue;let M=Kt(r,_.endsWith(".png")||_.startsWith("data:image/")||_.startsWith("block:")?_:_+".png",y,i,s);M.name=`geometry_${A}`,g.add(M)}break}}this.mesh.add(g)}s.type=l.length===1?l[0].modelType:"special";return}if(r5[t]){let l=new t5,c={zombie_horse:`textures/${e}/entity/horse/horse_zombie.png`,husk:xv,skeleton_horse:`textures/${e}/entity/horse/horse_skeleton.png`,donkey:`textures/${e}/entity/horse/donkey.png`,mule:`textures/${e}/entity/horse/mule.png`,ocelot:Rv,arrow:kv,spectral_arrow:Tv,tipped_arrow:Mv},u=c[o]||c[t];u&&(s.textureMap=!0);let f=u||s1[t];if(s1[t]&&(s.isHardcodedTexture=!0),!f)throw new Error(`No texture for ${t}`);let m=N0(f),g=new te.MeshBasicMaterial({map:m,transparent:!0,alphaTest:.1}),b=l.parse(r5[t]),A=r3[o]||r3[t];A&&b.scale.set(A,A,A);let y=Iv[o];y&&b.position.set(y.x,y.y,y.z),b.traverse(_=>{_ instanceof te.Mesh&&(_.material=g,_.name==="Head layer"&&(_.visible=!1),_.name==="Head"&&i.rotation?.head&&(_.rotation.x-=(i.rotation.head.x??0)*Math.PI/180,_.rotation.y-=(i.rotation.head.y??0)*Math.PI/180,_.rotation.z-=(i.rotation.head.z??0)*Math.PI/180))}),this.mesh=b,s.type="obj";return}let a=t3(t);if(a){this.mesh=new te.Object3D;for(let[l,c]of Object.entries(a.geometry)){let u=i.textures?.[l]??a.textures[l];if(!u)continue;let f=Kt(r,u.endsWith(".png")||u.startsWith("data:image/")||u.startsWith("block:")?u:u+".png",c,i,s);f.name=`geometry_${l}`,this.mesh.add(f)}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=e3(e)||e,r5[e])return{boneNames:[]};let t=t3(e);if(!t)throw new Error(`Unknown entity ${e}`);return{boneNames:Object.values(t.geometry).flatMap(r=>r.name)}}};globalThis.EntityMesh=zt;E();x();k();R();import{default as Ov}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_1.png";import{default as Dv}from"mc-assets/dist/other-textures/latest/models/armor/chainmail_layer_2.png";import{default as Fv}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_1.png";import{default as zv}from"mc-assets/dist/other-textures/latest/models/armor/diamond_layer_2.png";import{default as Uv}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_1.png";import{default as Gv}from"mc-assets/dist/other-textures/latest/models/armor/gold_layer_2.png";import{default as Vv}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_1.png";import{default as Wv}from"mc-assets/dist/other-textures/latest/models/armor/iron_layer_2.png";import{default as Nv}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1.png";import{default as jv}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_1_overlay.png";import{default as Qv}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2.png";import{default as Yv}from"mc-assets/dist/other-textures/latest/models/armor/leather_layer_2_overlay.png";import{default as Kv}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_1.png";import{default as Jv}from"mc-assets/dist/other-textures/latest/models/armor/netherite_layer_2.png";import{default as qv}from"mc-assets/dist/other-textures/latest/models/armor/turtle_layer_1.png";import{default as n3}from"mc-assets/dist/other-textures/latest/entity/elytra.png";var Jt={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 i3={leather_layer_1:Nv,leather_layer_1_overlay:jv,leather_layer_2:Qv,leather_layer_2_overlay:Yv,chainmail_layer_1:Ov,chainmail_layer_2:Dv,iron_layer_1:Vv,iron_layer_2:Wv,diamond_layer_1:Fv,diamond_layer_2:zv,golden_layer_1:Uv,golden_layer_2:Gv,netherite_layer_1:Kv,netherite_layer_2:Jv,turtle_layer_1:qv};var c3=W0(st),Xv=120,a1=n=>n*(Math.PI/180);function Zv(n){return n<0&&(n=4294967295+n+1>>>0),n.toString(16)}function $v(n){if(n===void 0)return;if(parseInt(n,10)===0)return"rgba(0, 0, 0, 0)";let e=Zv(parseInt(n,10));return e.length===8?`#${e.slice(2,8)}${e.slice(0,2)}`:`#${e}`}function s3(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 St(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(-a1(n.pitch),-a1(n.yaw),a1(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 $r=Math.PI*2;function el(n,e){let t=((e-n)%$r+$r)%$r;return t>Math.PI?t-$r:t}function d3({username:n,nameTagBackgroundColor:e="rgba(0, 0, 0, 0.3)",nameTagTextOpacity:t=255},{fontFamily:r="mojangles"},i){let s=qe(64,64),o=l3(i),v=s.getContext("2d");if(!v)throw new Error("Could not get 2d context");let a=48,l=5;v.font=`${a}px ${r}`;let c=String(typeof n=="string"?n:new o(n).toString()).split(`
21481
+ `),u=0;for(let m of c){let g=v.measureText(m).width+l*2;g>u&&(u=g)}if(s.width=u,s.height=(a+l)*c.length,v.fillStyle=e,v.fillRect(0,0,s.width,s.height),v.globalAlpha=t/255,!!wn(n,o,s,a,"white",-l+a))return v.globalAlpha=1,s}globalThis.getUsernameTexture=d3;var ti=(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(l3(r))(n.username).toString()).startsWith("EMPTY"))return;let s=d3(n,e,r);if(!s)return;let o=new j.Texture(s);o.needsUpdate=!0;let v;if(n.nameTagFixed){let a=new j.PlaneGeometry,l=new j.MeshBasicMaterial({map:o});l.transparent=!0,v=new j.Mesh(a,l),v.rotation.set(n.pitch,j.MathUtils.degToRad(n.yaw+180),0),v.position.y+=n.height+.3}else{let a=new j.SpriteMaterial({map:o});v=new j.Sprite(a),v.position.y+=n.height+.6}return v.renderOrder=1e3,v.scale.set(s.width*.005,s.height*.005,1),n.nameTagRotationRight&&v.applyQuaternion(n.nameTagRotationRight),n.nameTagScale&&v.scale.multiply(n.nameTagScale),n.nameTagRotationLeft&&v.applyQuaternion(n.nameTagRotationLeft),n.nameTagTranslation&&v.position.add(n.nameTagTranslation),v.name="nametag",t.add(v),v},o3={},tl=n=>n.charAt(0)===n.charAt(0).toUpperCase();function a3(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 rl(n,e,t,r,i){if(e.name)try{let l=(tl(e.name)?Xn(e.name):e.name).toLowerCase(),c=new zt("1.16.4",l,t,i);if(c.mesh)return ti(e,r,c.mesh,t.version),c.mesh}catch(l){reportError?.(l)}if(!n||!(0,v3.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}),v=new j.Mesh(s,o);return(o3[e.name]=(o3[e.name]||0)+1)<6&&ti({username:e.name,height:e.height},r,v,t.version),v}var ri=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,"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.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.worldRenderer.scene.add(t),this.updatePlayerSkin(e.id,e.username,e.uuid??void 0,st)}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),Te(e);this.entities={},this.currentSkinUrls={},this.playerEntity&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.playerEntity),Te(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;for(let r of t?[t]:Object.values(this.entities))e?this.worldRenderer.scene.children.includes(r)||this.worldRenderer.scene.add(r):this.worldRenderer.scene.remove(r)}playEntityModelAnimation(e,t,r=!1){let i=this.entities[e];i&&i.traverse(s=>{s instanceof zt&&s.playAnimation(t,r)})}render(){let e=this.worldRenderer.worldRendererConfig.renderEntities;e!==this.currentlyRendering&&this.setRendering(e),this.clock.update(performance.now());let t=Math.min(this.clock.getDelta(),1/30),r=this.worldRenderer.viewerChunkPosition,i=10*10;for(let[s,o]of[...Object.entries(this.entities),["player_entity",this.playerEntity]]){if(!o)continue;let v=s==="player_entity";if(v){let l=this.worldRenderer.playerStateUtils.isThirdPerson();if(o.visible=l,l){let c=this.worldRenderer.playerStateReactive.eyeHeight;o.position.set(this.worldRenderer.cameraWorldPos.x,this.worldRenderer.cameraWorldPos.y-c,this.worldRenderer.cameraWorldPos.z)}}let{playerObject:a}=o;if(a?.animation&&a.animation.update(a,t),o.traverse(l=>{l instanceof zt&&l.update(t)}),!v&&r&&o.position){let l=o.position.x-r.x,c=o.position.y-r.y,u=o.position.z-r.z,f=l*l+c*c+u*u;o.visible=!!(f<i||this.worldRenderer.shouldObjectVisible(o)),this.maybeRenderPlayerSkin(s)}if(o.visible&&this.syncArmorPositions(o),v&&o.visible){let l=this.worldRenderer.cameraShake.getBaseRotation();o.rotation.set(0,l.yaw,0),o.traverse(c=>{c.name==="head"&&c.rotation.set(-l.pitch,0,0)})}}}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}isCanvasBlank(e){return!e.getContext("2d")?.getImageData(0,0,e.width,e.height).data.some(t=>t!==0)}async updatePlayerSkin(e,t,r,i,s=void 0){i!==st&&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 v=this.getPlayerObject(e);if(!v)return;if(i===!0){if(!t)return;let l=await Qt(t,"skin");if(!this.getPlayerObject(e)||!l)return;i=l}if(typeof i!="string")throw new Error("Invalid skin url");if(this.currentSkinUrls[String(e)]===i){if(s){if(s===!0&&t){let l=await Qt(t,"cape");if(!this.getPlayerObject(e)||!l)return;s=l}typeof s=="string"&&this.loadAndApplyCape(e,s)}return}i!==st&&(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 l=await Qt(t,"cape");if(!this.getPlayerObject(e)||!l)return;s=l}typeof s=="string"&&this.loadAndApplyCape(e,s)}}),v.cape.visible=!1,s||(v.backEquipment=null,v.elytra.map=null,v.cape.map&&v.cape.map.dispose(),v.cape.map=null)}async loadAndApplySkin(e,t,r){let i=this.getPlayerObject(e);if(i)try{let s;if(i=this.getPlayerObject(e),!i)return;let o,v;if(t===st){let l=await Mt(st);s=l.image,o=new j.CanvasTexture(l.canvas),v=l.canvas}else{let{canvas:l,image:c}=await Mt(t);s=c,o=new j.CanvasTexture(l),v=l}o.magFilter=j.NearestFilter,o.minFilter=j.NearestFilter,o.needsUpdate=!0,i.skin.map=o,i.skin.modelType=hn(v),i.skin.isCustom=t!==st,e1(i);let a;if(s?r&&(a=qe(64,64),mn(a,s),r=!this.isCanvasBlank(a)):r=!1,r){let l=new j.CanvasTexture(a);l.magFilter=j.NearestFilter,l.minFilter=j.NearestFilter,l.needsUpdate=!0,i.ears.map=l,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 Mt(t);if(r=this.getPlayerObject(e),!r)return;fn(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}r.switchAnimationCallback=null,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"?J5.default.simplify(J5.default.parse(e)):l1.simplify(e);return Yn(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=wo(this.worldRenderer.material,s.resolvedModel,s.modelName,this.worldRenderer.resourcesManager.currentResources.worldBlockProvider,this.worldRenderer.resourcesManager.currentResources.mcData),v=1;t["minecraft:display_context"]==="ground"?v=.5:t["minecraft:display_context"]==="thirdperson"&&(v=6),o.scale.set(v,v,v);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:v,v:a,su:l,sv:c}=s,m=Jo(o,{u:v,v:a,sizeX:l??1,sizeY:c??1},{faceCamera:r,use3D:!r}),g=1;return t["minecraft:display_context"]==="ground"?g=.5:t["minecraft:display_context"]==="thirdperson"&&(g=6),m.mesh.scale.set(g,g,g),{mesh:m.mesh,isBlock:!1,modelName:s.modelName,cleanup:m.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.additionalCleanup&&i.additionalCleanup(),i.traverse(g=>{g.additionalCleanup&&g.additionalCleanup()}),this.onRemoveEntity(e),this.worldRenderer.sceneOrigin.removeAndUntrack(i),Te(i),delete this.entities[e.id];return}let o;if(i===void 0){this.beforeEntityAdded(e);let g=new j.Group;if(g.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 y=e.name==="tnt"||e.type==="projectile"?{name:e.name}:e.name==="falling_block"?{blockState:e.objectData}:a3(e.metadata)?.find(_=>typeof _=="object"&&_?.itemCount);if(y){let _=this.getItemMesh(y,{"minecraft:display_context":"ground"},e.type==="projectile");if(_){if(o=_.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 M=new j.Timer;o.onBeforeRender=()=>{M.update(performance.now());let C=M.getDelta();o.rotation.y+=C}}g.additionalCleanup=()=>{_.cleanup&&_.cleanup()}}}}else if(r){let y=new j.Group,_=this.setupPlayerObject(e,y,t);if(g.playerObject=_,o=y,e.username){let M=ti(e,{fontFamily:"mojangles"},y,this.worldRenderer.version);M&&(M.position.y=_.position.y+_.scale.y*16+3,M.scale.multiplyScalar(12))}}else o=rl(this.mcData,e,this.worldRenderer,this.entitiesOptions,{...t,customModel:e.customModel});if(!o)return;o.name="mesh";let b=e.pos??e.position;this.worldRenderer.sceneOrigin.track(g),g.position.set(b.x,b.y,b.z);let A=new j.BoxHelper(o,e.type==="hostile"?16711680:e.type==="mob"?65280:e.type==="player"?255:16753920);A.name="debug",g.add(o),g.add(A),A.visible=!1,this.worldRenderer.scene.add(g),i=g,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||st),this.setDebugMode(this.debugMode,g),this.setRendering(this.currentlyRendering,g),this.afterAddEntity(e)}else o=i.children.find(g=>g.name==="mesh");this.updateEntityEquipment(i,e);let v=u3(e,this.mcData),l=(a3(e.metadata)?.[0]??e.metadata?.[0]??0)&32||this.worldRenderer.playerStateReactive.cameraSpectatingEntity===e.id&&this.worldRenderer.playerStateUtils.isSpectator();for(let g of o.children??[])g.name!=="nametag"&&(g.visible=!l);v.baby?i.scale.set(.5,.5,.5):i.scale.set(1,1,1);let c=ei("text_display",e,this.mcData),u=c?.text||v.custom_name_visible&&v.custom_name;if(e.name!=="player"&&u){let g=c&&(c.billboard_render_constraints==="fixed"||!c.billboard_render_constraints),b=c&&!(parseInt(c.style_flags,10)&4)?$v(c.background_color):void 0,A;if(c?.text_opacity){let y=parseInt(c?.text_opacity,10);A=y>0?y:256-y}ti({...e,username:typeof u=="string"?J5.default.simplify(J5.default.parse(u)):l1.simplify(u),nameTagBackgroundColor:b,nameTagTextOpacity:A,nameTagFixed:g,nameTagScale:c?.scale,nameTagTranslation:c&&(c.translation||new j.Vector3(0,0,0)),nameTagRotationLeft:s3(c?.left_rotation),nameTagRotationRight:s3(c?.right_rotation)},this.entitiesOptions,o,this.worldRenderer.version)}let f=ei("armor_stand",e,this.mcData);if(f){let g=(parseInt(f.client_flags,10)&1)!==0,b=(parseInt(f.client_flags,10)&4)!==0,A=(parseInt(f.client_flags,10)&8)===0,y=(parseInt(f.client_flags,10)&16)!==0;o.castShadow=!y,o.receiveShadow=!y,g?i.scale.set(.5,.5,.5):i.scale.set(1,1,1),i.traverse(_=>{switch(_.name){case"bone_baseplate":this.setVisible(_,A),_.rotation.y=-i.rotation.y;break;case"bone_head":f.head_pose&&_.setRotationFromEuler(St(f.head_pose));break;case"bone_body":f.body_pose&&_.setRotationFromEuler(St(f.body_pose));break;case"bone_rightarm":_.parent?.name!=="bone_armor"&&this.setVisible(_,b),f.left_arm_pose?_.setRotationFromEuler(St(f.left_arm_pose)):_.setRotationFromEuler(St({yaw:-10,pitch:-10,roll:0}));break;case"bone_leftarm":_.parent?.name!=="bone_armor"&&this.setVisible(_,b),f.right_arm_pose?_.setRotationFromEuler(St(f.right_arm_pose)):_.setRotationFromEuler(St({yaw:10,pitch:-10,roll:0}));break;case"bone_rightleg":f.left_leg_pose?_.setRotationFromEuler(St(f.left_leg_pose)):_.setRotationFromEuler(St({yaw:-1,pitch:-1,roll:0}));break;case"bone_leftleg":f.right_leg_pose?_.setRotationFromEuler(St(f.right_leg_pose)):_.setRotationFromEuler(St({yaw:1,pitch:1,roll:0}));break}})}let m=ei("item_frame",e,this.mcData);if(m||(m=ei("glow_item_frame",e,this.mcData)),m){let g=m?.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_")){Te(b);let A=parseInt(b.name.split("_")[1],10);return this.itemFrameMaps[A]=this.itemFrameMaps[A]?.filter(y=>y!==b),b instanceof j.Mesh&&b.material?.map?.dispose(),!0}else if(b.name==="item")return Te(b),!0;return!1})?.removeFromParent(),g&&(g.itemId??g.blockId??0)!==0){let b=m.rotation??0,A=g.nbtData?.value?.map?.value??g.components?.find(y=>y.type==="map_id")?.data;if(A)o.scale.set(16/12,16/12,1),this.addMapModel(i,A,b);else{let y=this.getItemMesh(g,{"minecraft:display_context":"fixed"});y&&(y.mesh.position.set(0,0,-.05),y.isBlock?y.mesh.scale.set(.25,.25,.25):y.mesh.scale.set(.5,.5,.5),y.mesh.rotateY(Math.PI),y.mesh.rotateZ(-b*Math.PI/4),y.mesh.name="item",i.add(y.mesh))}}}e.username!==void 0&&(i.username=e.username),this.updateNameTagVisibility(i),this.updateEntityPosition(e,s,t)}updateEntityPosition(e,t,r){let i=this.entities[e.id];if(!i)return;let s=t?0:Xv;if(e.position){let v=this.worldRenderer.sceneOrigin.getWorldPosition(i)??{x:e.position.x,y:e.position.y,z:e.position.z};i.userData._tweenTarget||(i.userData._tweenTarget={x:v.x,y:v.y,z:v.z}),i.userData._posTween?.stop(),i.userData._posTween=new ze(i.userData._tweenTarget).to({x:e.position.x,y:e.position.y,z:e.position.z},s).onUpdate(()=>{i.position.set(i.userData._tweenTarget.x,i.userData._tweenTarget.y,i.userData._tweenTarget.z)}).start()}let o;if(i.playerObject&&r?.rotation?.head){let v=r.rotation.head.y,a=typeof v=="number"&&Number.isFinite(v)?v:e.yaw;typeof a=="number"&&Number.isFinite(a)&&(o=a)}else typeof e.yaw=="number"&&Number.isFinite(e.yaw)&&(o=e.yaw);if(typeof o=="number"&&Number.isFinite(o)){let v=el(i.rotation.y,o);i.userData._rotTween?.stop(),i.userData._rotTween=new ze(i.rotation).to({y:i.rotation.y+v},s).start()}if(i?.playerObject&&r?.rotation?.head){let{playerObject:v}=i;v.skin.head.rotation.y=0;let a=r.rotation.head.x;v.skin.head.rotation.x=typeof a=="number"&&Number.isFinite(a)?-a:0}}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),v=(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(v<r&&v<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 v=new j.MeshLambertMaterial(o),a=new j.Mesh(new j.PlaneGeometry(1,1),v);a.rotation.set(0,Math.PI,0),e.add(a);let l=!0;e.traverseVisible(c=>{c.name==="geometry_frame"&&(l=!1)}),l?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=N0(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 v=this.getItemMesh(r,{"minecraft:display_context":"thirdperson"});v?.mesh&&e.traverse(a=>{if(a.name.toLowerCase()===s||a.name===`${t}Arm`){let l=new j.Object3D;l.additionalCleanup=()=>{v.cleanup&&v.cleanup()};let c=v.mesh;l.rotation.z=-Math.PI/16,v.isBlock?l.rotation.y=Math.PI/4:(c.rotation.z=-Math.PI/4,l.rotation.y=Math.PI/2,l.scale.multiplyScalar(2)),i&&(l.position.y=-8,l.position.z=5,l.position.x=t==="left"?1:-1,l.rotation.x=Math.PI),l.add(c),l.name=o,a.add(l)}})}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 ze(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 K0;i.realPlayerUuid=e.uuid??"",i.realUsername=e.username??"",i.position.set(0,16,0),e1(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 Q5,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),q5(this.worldRenderer,e,"feet",t.equipment[2]),q5(this.worldRenderer,e,"legs",t.equipment[3],2),q5(this.worldRenderer,e,"chest",t.equipment[4]),q5(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,n3),i.cape.map===null&&(i.cape.visible=!1)}}};function u3(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 ei(n,e,t){if(e.name===n)return u3(e,t)}function q5(n,e,t,r,i=1,s=!1){if(!r){v1(e,t);return}let o=r.name.split("_"),v,a=t==="head"&&r.name==="player_head";if(a)if(v1(e,t),r.nbt){let g=l1.simplify(r.nbt);try{let b;if(g.SkullOwner?b=g.SkullOwner.Properties.textures[0]?.Value:b=g["minecraft:profile"]?.Properties?.find(A=>A.name==="textures")?.value,b){v=JSON.parse(D.from(b,"base64").toString()).textures?.SKIN?.url;let{skinTexturesProxy:y}=n.worldRendererConfig;y&&(v=v?.replace("http://textures.minecraft.net/",y).replace("https://textures.minecraft.net/",y))}}catch{}}else v=st;let l=o[0];if(!v){let g=`${l}_layer_${i}${s?"_overlay":""}`;v=n.resourcesManager.currentResources.customTextures.armor?.textures[g]?.src??i3[g]}if(!v||!Jt[t]){v1(e,t);return}let c=`geometry_armor_${t}${s?"_overlay":""}`,u=e.children.findLast(g=>g.name===c),f;if(u?(f=u.material,Mr(v,g=>{g.magFilter=j.NearestFilter,g.minFilter=j.NearestFilter,g.flipY=!1,g.wrapS=j.MirroredRepeatWrapping,g.wrapT=j.MirroredRepeatWrapping,f.map=g})):(u=Kt(n,v,Jt[t]),t==="head"&&(u.children[0].position.y+=.01),u.name=c,f=u.material,a||(f.side=j.DoubleSide)),l==="leather"&&!s){let g=r.nbt?.value?.display?.value?.color?.value;if(g){let b=g>>16&255,A=g>>8&255,y=g&255;f.color.setRGB(b/255,A/255,y/255)}else f.color.setHex(11890001);q5(n,e,t,r,i,!0)}else f.color.setHex(16777215);let m=new j.Object3D;m.name=`armor_${t}${s?"_overlay":""}`,m.add(u),e.add(u)}function v1(n,e){for(let t of n.children)(t.name===`geometry_armor_${e}`||t.name===`geometry_armor_${e}_overlay`)&&t.removeFromParent()}var c1=async(n,e)=>{let t;if(!n&&!e)t=await c3;else{if(n||(n=await Qt(e,"skin")),!n)return;let{canvas:a}=await Mt(n);t=new Ve.CanvasTexture(a)}t.magFilter=Ve.NearestFilter,t.minFilter=Ve.NearestFilter;let r=new Ve.BoxGeometry,i=new Ve.MeshStandardMaterial,s=!1,o=new Ve.Mesh(r,i);o.scale.x=s?3:4,o.scale.y=12,o.scale.z=4,nl(r,40,16,s?3:4,12,4),i.map=t,i.needsUpdate=!0;let v=new Ve.Group;return v.add(o),v.scale.set(.1,.1,.1),o.rotation.z=Math.PI,v};function il(n,e,t,r,i,s,o,v){let a=(B,L,G,H)=>[new Ve.Vector2(B/o,1-H/v),new Ve.Vector2(G/o,1-H/v),new Ve.Vector2(G/o,1-L/v),new Ve.Vector2(B/o,1-L/v)],l=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),f=a(e+s,t+s,e+r+s,t+s+i),m=a(e+r+s,t+s,e+r+s*2,t+i+s),g=a(e+r+s*2,t+s,e+r*2+s*2,t+i+s),b=n.attributes.uv,A=[m[3],m[2],m[0],m[1]],y=[u[3],u[2],u[0],u[1]],_=[l[3],l[2],l[0],l[1]],M=[c[0],c[1],c[3],c[2]],C=[f[3],f[2],f[0],f[1]],T=[g[3],g[2],g[0],g[1]],P=[];for(let B of[A,y,_,M,C,T])for(let L of B)P.push(L.x,L.y);b.set(new Float32Array(P)),b.needsUpdate=!0}function nl(n,e,t,r,i,s){il(n,e,t,r,i,s,64,64)}var h3={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]}},X5=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,"objectOuterGroup",new he.Group);d(this,"objectInnerGroup",new he.Group);d(this,"holdingBlockInnerGroup",new he.Group);d(this,"camera",new he.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(f3(this.worldRenderer.playerStateReactive,"heldItemMain",()=>{this.offHand||this.updateItem()})),this.unsubs.push(f3(this.worldRenderer.playerStateReactive,"heldItemOff",()=>{this.offHand&&this.updateItem()})),this.config=e.displayOptions.inWorldRenderingConfig,this.offHandDisplay=this.offHand,this.offHand||c1().then(r=>{this.disposed||(this.playerHand=r,this.updateItem())}).then(()=>{if(this.disposed)return;let r=Fr(async()=>c1(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=>{Te(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 he.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 he.Scene;o.add(this.cameraGroup),this.updateCameraGroup(),o.add(r.clone()),o.add(i.clone());let v=t.getSize(new he.Vector2),a=Math.min(v.width,v.height),l=v.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=v.width-a;t.setViewport(u,0,a,a)}t.render(o,this.camera),t.setViewport(0,0,v.width,v.height),c&&(this.cameraGroup.scale.x=1)}async playBlockSwapAnimation(e){this.blockSwapAnimation??(this.blockSwapAnimation={switcher:new E0(()=>({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!==Y0(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 v=i*2.22*.2;this.objectOuterGroup.scale.set(v,v,v)}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},Ur(this.worldRenderer),!1,this.lastItemModelName);if(i){let{mesh:s,isBlock:o,modelName:v}=i;o?(t=s,e.type="block"):(s.position.set(.5,.5,.5),t=s,e.type="item"),this.lastItemModelName=v}}else t=this.playerHand;if(!t)return;t.name="holdingBlock";let r=this.getHandHeld3d().rotation;return t.rotation.x=he.MathUtils.degToRad(r.x),t.rotation.y=he.MathUtils.degToRad(r.y),t.rotation.z=he.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=Y0(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 v=new he.Group;this.holdingBlockInnerGroup.removeFromParent(),this.holdingBlockInnerGroup=new he.Group,this.holdingBlockInnerGroup.add(o.model),v.add(this.holdingBlockInnerGroup),this.holdingBlock=o.model,this.objectInnerGroup=new he.Group,this.objectInnerGroup.add(v),this.objectInnerGroup.position.set(-.5,-.5,-.5),s&&(this.objectInnerGroup.position.y-=this.objectInnerGroup.scale.y*1.5),Object.assign(v.position,{x:.5,y:.5,z:.5}),this.objectOuterGroup=new he.Group,this.objectOuterGroup.add(this.objectInnerGroup),this.cameraGroup.add(this.objectOuterGroup);let a=this.getHandHeld3d().rotation;this.objectOuterGroup.rotation.y=he.MathUtils.degToRad(a.yOuter),s&&await this.playBlockSwapAnimation("appeared"),this.swingAnimator??(this.swingAnimator=new u1(this.holdingBlockInnerGroup)),this.swingAnimator.setHandMesh(this.holdingBlockInnerGroup),this.swingAnimator.type=o.type,this.config.viewBobbing&&(this.idleAnimator=new d1(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=h3[`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=h3[`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,Te(this.cameraGroup,!0),Te(this.objectOuterGroup,!0),Te(this.objectInnerGroup,!0),Te(this.holdingBlockInnerGroup,!0),this.holdingBlock=void 0,this.playerHand&&(Te(this.playerHand,!0),this.playerHand=void 0)}},d1=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 G0);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 E0(()=>({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 Dt("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 ze(this.idleOffset,this.tween).to({y:.05,rotationZ:.05},3e3).easing(De.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()}},u1=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 Dt("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),v=Math.sin(s*this.PI);if(this.type==="hand"){let a=this.debugParams.armSwingXPosScale*v,l=this.debugParams.armSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.armSwingZPosScale*o;this.handMesh.position.x+=a,this.handMesh.position.y+=l+this.debugParams.armHeightScale*i,this.handMesh.position.z+=c,this.handMesh.rotation.y+=he.MathUtils.degToRad(this.debugParams.armSwingYRotAmount*v),this.handMesh.rotation.z+=he.MathUtils.degToRad(this.debugParams.armSwingZRotAmount*o)}else{let a=this.debugParams.itemSwingXPosScale*v,l=this.debugParams.itemSwingYPosScale*Math.sin(s*this.PI*2),c=this.debugParams.itemSwingZPosScale*o;this.handMesh.position.x+=a,this.handMesh.position.y+=l+this.debugParams.itemHeightScale*i,this.handMesh.position.z+=c,this.handMesh.rotation.y+=he.MathUtils.degToRad(this.debugParams.itemPreswingRotY),this.handMesh.rotation.x+=he.MathUtils.degToRad(this.debugParams.itemSwingXRotAmount*o),this.handMesh.rotation.y+=he.MathUtils.degToRad(this.debugParams.itemSwingYRotAmount*v),this.handMesh.rotation.z+=he.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 Z5(n,e=!1){return n.displayOptions.inWorldRenderingConfig.handRenderer==="legacy"?new X5(n,e):new U5(n,e)}E();x();k();R();import*as $e from"three";import{Vec3 as f1}from"vec3";var m3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAALUlEQVR42mP4//8/IyWYYdSAwW6Ara3tf4oMmD179n9ChhD0AsiQ0Wgc7AYAAOqH+zNQ3r9kAAAAAElFTkSuQmCC";var p3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAOklEQVR42mP4//8/IyWYYdQA3AbY2tr+H1gDZs+e/R9mCD7D8IYBzBAQTXYgEvIKQQPw2T6aEqlkAADEA/W3ycLXvwAAAABJRU5ErkJggg==";var g3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAQklEQVR42mP4//8/IyWYYRgbYGtr+39wGQDiYzMUpwGzZ8+GawDRID4IkxSIMEOwaSQ6FgiFBW0NIOR8osJgBOQFALo37sVTOo/LAAAAAElFTkSuQmCC";var b3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAWElEQVR42mP4//8/IyWYYXAbYGtr+59sA0CaZ8+eTZkBhNg4DQApQlYIcglMDN1VWA0AKYJpQvYONi/hDUSYIfjCgmA0EooJ2hmAK9CINgBXoA2xvEAMBgBGPud3dYZtOQAAAABJRU5ErkJggg==";var y3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAYklEQVR42r1TQQrAMAxyD8tL89iMHgQJoQxHewi0UsWYFFX1/CkcF4iIsgUWOTM9ASV3F3rHF+v9rK4wEVnEFoFYbwmTbRZFFN9m0B9QZBfk2THaAhqktQdTkHYL9iZe+40vs7nda+BuVOMAAAAASUVORK5CYII=";var _3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAcElEQVR42rWTWwpAIQhEbWGu1MUaXRgQcXpyP8SIPI1jibu3l5DfAKrqyFgfAczsKxx5xJUCFGYFUZXMpOe9CAa8BOS+0U5UVbYQ6Siqbi0BFT0auTSRHZqNkE6BGXgEYKYtAczIbQAz8ukzXT3l3egz49IXvXQCVAAAAABJRU5ErkJggg==";var w3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAeElEQVQ4jaWSQQ4AIQgD9WG8tI/tnkgaUgmuBw8YHcqERXK/nOUuI4JPAABMSESwA1qAQgAQwBygnfNjTaCpWoBzUlNZQJ07x9FUdgSlV5FaW4Cjq8isW8BJ2GgPtEuVdr0HKvLXHjiRI0An8jTKqo9dF000cnBzPgKuxXtbq/m1AAAAAElFTkSuQmCC";var A3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAhUlEQVR42qWTSRKAMAgE8WF5KY/FygEL2yEp9cAhCz0wJBYRx58wbowxYsZngLvHjITsgNYpJySBrPIBUMqZSHhdSw+oQlgVa01U7VRQ7huTk67aUWZaVyaNZFsSQBCTVBW3KahLyo/lQ6KR1Y+2BTUyGqke1AXoxsSzpYlU3FW0/Exv1ie0hq53Bf15aAAAAABJRU5ErkJggg==";var E3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAmklEQVR42o2SYQ6FMAiDeQfbSXdYXjSpqd869QeZQiilpbr7l2KM0cc75+xUV77YpGCjAPUqitMU3uCAXrsAlPSCcgJMbG4M0mQ1Etz/i0KlXQnmwyqpv1uH4h7fiws7ISneTYNEk0ImCxcAArGJrE4AXhypPtl7AqTdeJG8k3gHb0L6QfmK9WQTa59cSFdHRssKFHHngteV/wPDepaHIu0QVAAAAABJRU5ErkJggg==";var x3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAoUlEQVR42n2Tyw3AIAxD3cGYlGFTUSmV+2o4IEEAf2JQVV1rjDGq576ec5avWVdfWIW12aMPEJBEImoPv+CAvvcCODsVNWBS8wA4A5ndv1/ytciQvBLMyeTSHD3ZYXPXXH7Y0ZMdJvCxQJls5O6tKHlPPWGEfU58WZR6ive1kKSleFNC2kXGRnrcDqhTTOmPeP3pAZnTq6Oin4X0oXbfnNZu626Io6lqGCwAAAAASUVORK5CYII=";var ii=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=[m3,p3,g3,b3,y3,_3,w3,A3,E3,x3];for(let i=0;i<10;i++)W0(t[i]).then(s=>{s.magFilter=$e.NearestFilter,s.minFilter=$e.NearestFilter,this.breakTextures.push(s)});let r=new $e.MeshBasicMaterial({transparent:!0,blending:$e.MultiplyBlending,premultipliedAlpha:!0,alphaTest:.5});this.blockBreakMesh=new $e.Mesh(new $e.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 T0({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:v}=r,a=new f1(i.x,i.y,i.z);this.blockBreakMesh.scale.set(s*1.001,o*1.001,v*1.001),a.add(new f1(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)&&ml(t??[],this.interactionLines.shapePositions??[])&&!r||(this.interactionLines!==null&&(this.worldRenderer.sceneOrigin.removeAndUntrack(this.interactionLines.mesh),this.interactionLines=null),e===null))return;let i=new $e.Group;for(let{position:s,width:o,height:v,depth:a}of t??[]){let l=new f1(s.x,s.y,s.z),c=[1.0001*o,1.0001*v,1.0001*a],u=new $e.BoxGeometry(...c),f=new k0().fromEdgesGeometry(new $e.EdgesGeometry(u)),m=new K5(f,this.cursorLineMaterial);m.position.set(l.x,l.y,l.z),m.computeLineDistances(),i.add(m)}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()}},ml=(n,e)=>{if(n.length!==e.length)return!1;for(let[t,r]of n.entries())if(r!==e[t])return!1;return!0};E();x();k();R();E();x();k();R();var pl=y5(Kn(),1);import R3 from"prismarine-nbt";import{getItemDefinition as gl}from"mc-assets/dist/itemDefinitions";var bl=(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 v=o.get("custom_name")||o.get("item_name");v&&(t=typeof v.data=="string"?v.data:R3.simplify(v.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 l=o.get("lore");l&&(t??(t=n.displayName??n.name),t+=`
21482
+ ${JSON.stringify(l.data)}`)}if(n.nbt){let o=R3.simplify(n.nbt),v=o.display?.Name;v&&(t=v),s&&o.CustomModelData&&s[o.CustomModelData]&&(r=s[o.CustomModelData])}return{customText:t,customModel:r}};var k3=(n,e,t,r)=>{let i=n.name,{customModel:s}=bl(n,t);s&&(i=s);let o=q2(r,{...e}),v=t.currentResources,a=gl(F2(v),{name:i,version:v.version,properties:o})?.model;return(a==="minecraft:special"?void 0:a)??i};E();x();k();R();var P3=y5(C3(),1);import{versionToNumber as B3}from"mc-assets/dist/utils";var I3=(n,e,t=!1,r=!1)=>{let i=n.modelName,s=globalThis.loadedData.itemsByName[i];B3(e.currentResources.version)<B3("1.13")&&(i=(0,P3.getRenamedData)(s?"items":"blocks",i,e.currentResources.version,"1.13.1"));let o;if(!r){let a=e.currentResources?.guiAtlas?.json,l=u=>u&&a?.textures[u.replace("minecraft:","").replace("block/","").replace("blocks/","").replace("item/","").replace("items/","").replace("_inventory","")],c=l(i)??l(n.originalItemName);if(c){let u=c.u*a.width,f=c.v*a.height;return{texture:"gui",slice:[u,f,a.tileSize,a.tileSize],scale:.25,blockData:null,modelName:null}}}let v=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=v(e.currentResources.itemsRenderer.getItemTexture("errored"))}return o??(o=v(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 L3=(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 v=o?globalThis.loadedData.blocksByStateId[o]?.name:typeof s=="number"?globalThis.loadedData.items[s]?.name:s;if(!v)throw new Error(`Item not found: ${s}`);let a=k3({...n,name:v},e,t,r),l=I3({modelName:a},t,!1,!0);if(!l)throw new Error(`Failed to get render info for item ${v}`);let c=l.texture==="blocks"?i.blocksAtlasImage:i.itemsAtlasImage;if(l.blockData)return{resolvedModel:l.blockData.resolvedModel,modelName:l.modelName};if(l.slice){let[u,f,m,g]=l.slice,[b,A,y,_]=[u/c.width,f/c.height,m/c.width,g/c.height];return{u:b,v:A,su:y,sv:_,renderInfo:l,modelName:l.modelName}}throw new Error(`Invalid render info for item ${v}`)}catch(v){return reportError?.(v),{u:0,v:0,su:16/i.blocksAtlasImage.width,sv:16/i.blocksAtlasImage.width,modelName:"missing"}}};E();x();k();R();import*as n5 from"three";var si=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 n5.AudioListener,this.worldRenderer.camera.add(this.audioListener))}playSound(e,t,r=1,i=1,s=500){this.initAudioListener();let o=new n5.PositionalAudio(this.audioListener);this.activeSounds.add(o),this.soundVolumes.set(o,r);let v=new n5.AudioLoader,a=Date.now();v.loadAsync(t).then(l=>{Date.now()-a>s||(o.setBuffer(l),o.setRefDistance(20),o.setVolume(r*this.baseVolume),o.setPlaybackRate(i),this.worldRenderer.sceneOrigin.addAndTrack(o),o.position.set(e.x,e.y,e.z),o.onEnded=()=>{this.worldRenderer.sceneOrigin.removeAndUntrack(o),o.source&&o.disconnect(),this.activeSounds.delete(o),this.soundVolumes.delete(o),v.manager.itemEnd(t)},o.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(){this.playSound(this.worldRenderer.camera.position,"/sound.mp3")}};E();x();k();R();import*as We from"three";var oi=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 We.Quaternion().setFromAxisAngle(new We.Vector3(0,1,0),this.baseYaw);e.setRotationFromQuaternion(t)}else{let t=this.addAntiZfightingOffset(this.basePitch),r=this.addAntiZfightingOffset(this.baseYaw),i=new We.Quaternion().setFromAxisAngle(new We.Vector3(1,0,0),t),s=new We.Quaternion().setFromAxisAngle(new We.Vector3(0,1,0),r),o=new We.Quaternion().setFromAxisAngle(new We.Vector3(0,0,1),We.MathUtils.degToRad(this.rollAngle)),v=new We.Quaternion,a=new We.Quaternion,l=this.worldRenderer.playerStateReactive.perspective;if(this.cameraBobInput){let u=zr(this.cameraBobInput);v=new We.Quaternion().setFromAxisAngle(new We.Vector3(0,0,1),u.rotation.z),a=new We.Quaternion().setFromAxisAngle(new We.Vector3(1,0,0),u.rotation.x),l==="first_person"&&this.worldRenderer.camera.position.set(u.position.x,u.position.y,0)}else l==="first_person"&&this.worldRenderer.camera.position.set(0,0,0);let c=s.multiply(i).multiply(o).multiply(v).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}};E();x();k();R();import*as J from"three";var ai=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 v=s.getContext("2d");if(!v)return new J.CanvasTexture(s);v.clearRect(0,0,s.width,s.height),v.fillStyle=`rgba(${r>>16&255}, ${r>>8&255}, ${r&255}, 1)`,v.fillRect(0,0,s.width,s.height),v.fillStyle="#ff0000",v.font="bold 10px sans-serif",v.textAlign="center",v.textBaseline="middle",v.fillText(i,s.width/2,s.height/2,s.width);let a=new J.CanvasTexture(s);return a.minFilter=J.LinearFilter,a.magFilter=J.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 J.CanvasTexture(s);let v=r>>16&255,a=r>>8&255,l=r&255;o.fillStyle=`rgba(${v}, ${a}, ${l}, ${i})`,o.fillRect(0,0,1,1);let c=new J.CanvasTexture(s);return c.minFilter=J.NearestFilter,c.magFilter=J.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 v=t.src.endsWith(".png")||t.src.endsWith(".jpg")||t.src.endsWith(".jpeg")||t.imageOverride;i&&!t.imageOverride&&fetch(t.src,{method:"HEAD"}).then(T=>{T.headers.get("content-type")?.startsWith("image/")&&(this.destroyMedia(e),this.addMedia(e,{...r,src:t.src,imageOverride:!0}))}).catch(console.error);let a,l,c=ce&&!v;if(!v&&!c){a=document.createElement("video"),a.src=t.src.endsWith(".gif")?t.src.replace(".gif",".mp4"):t.src,a.loop=t.loop??!0;let T=(t.volume??1)*this.worldRenderer.worldRendererConfig.volume;a.volume=Math.min(T,1),a.playsInline=!0,a.crossOrigin="anonymous";let P=this.worldRenderer.soundSystem;if(P.initAudioListener(),!P.audioListener)throw new Error("Audio listener not initialized");l=new J.PositionalAudio(P.audioListener),l.setRefDistance(6),l.setVolume(T),this.worldRenderer.sceneOrigin.addAndTrack(l),l.position.set(t.position.x,t.position.y,t.position.z),l.setMediaElementSource(a),l.connect(),a.addEventListener("pause",()=>{l?.pause(),globalThis.tempSendVideoStop?.(e,"paused",a.currentTime)}),a.addEventListener("play",()=>{l?.play(),globalThis.tempSendVideoPlay?.(e)}),a.addEventListener("seeked",()=>{l&&a&&(l.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:B})=>{globalThis.tempSendVideoStop?.(e,`error: ${B}`,a.currentTime)}),a.addEventListener("ended",()=>{globalThis.tempSendVideoStop?.(e,"ended",a.currentTime),t.loop||(a.currentTime=0,C.ended=!0)})}let u=this.createBackgroundTexture(t.size.width,t.size.height,t.background),f=T=>{let P=this.createErrorTexture(t.size.width,t.size.height,t.background,T);b.map=P,b.needsUpdate=!0},m=new J.PlaneGeometry(1,1),g=t.allowLighting?J.MeshLambertMaterial:J.MeshBasicMaterial,b=new g({map:u,transparent:!0,side:t.doubleSide?J.DoubleSide:J.FrontSide,alphaTest:.1}),A;if(a)A=new J.VideoTexture(a);else if(c)A=this.createErrorTexture(t.size.width,t.size.height,t.background,"Video unavailable (multi-thread)");else if(ce){let T=B5(t.src);A=T.texture,A.minFilter=J.NearestFilter,A.magFilter=J.NearestFilter,T.promise.then(()=>{this.customMedia.get(e)?.texture===A&&(b.map=A,b.needsUpdate=!0)}).catch(()=>f())}else A=new J.TextureLoader().load(t.src,()=>{this.customMedia.get(e)?.texture===A&&(b.map=A,b.needsUpdate=!0)},void 0,()=>f());A.minFilter=J.NearestFilter,A.magFilter=J.NearestFilter,A.generateMipmaps=!1;let y=new J.Mesh(m,b),{mesh:_}=this.positionMeshExact(y,J.MathUtils.degToRad((t.rotation??0)*90),t.position,t.size.width,t.size.height);s.add(_),a&&(y.onBeforeRender=()=>{a.readyState===a.HAVE_ENOUGH_DATA&&(!a.paused||!C?.hadAutoPlayError)&&(b.map!==A&&(b.map=A,b.needsUpdate=!0),A.needsUpdate=!0,l&&(l.position.copy(_.position),l.rotation.copy(_.rotation)))});let M=T=>{let P=m.attributes.uv.array;P[0]=T.startU,P[1]=T.startV,P[2]=T.endU,P[3]=T.startV,P[4]=T.endU,P[5]=T.endV,P[6]=T.startU,P[7]=T.endV,m.attributes.uv.needsUpdate=!0};t.uvMapping&&M(t.uvMapping);let C={mesh:_,video:a,texture:A,updateUVMapping:M,positionalAudio:l,props:r,hadAutoPlayError:!1,pausedBecuaseHidden:!1,ended:!1,handleError(T){if(C.destroyed)return;let P=B=>B;f(T.name==="NotAllowedError"||T.name==="AbortError"?P("Waiting for user interaction"):P("Failed to auto play"))}};return this.customMedia.set(e,C),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 J.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 v=new J.Group;v.add(e);let a=new J.Mesh(new J.BoxGeometry(.1,.1,.1),new J.MeshBasicMaterial({color:16711680}));a.position.set(r.x,r.y,r.z),v.add(a);let l=r.x+Math.cos(t)*i,c=r.z+Math.sin(t)*i,u=new J.Mesh(new J.BoxGeometry(.1,.1,.1),new J.MeshBasicMaterial({color:255}));u.position.set(r.x,r.y+s,r.z),v.add(u);let f=new J.Mesh(new J.BoxGeometry(.1,.1,.1),new J.MeshBasicMaterial({color:16776960}));f.position.set(l,r.y,c),v.add(f);let m=new J.Mesh(new J.BoxGeometry(.1,.1,.1),new J.MeshBasicMaterial({color:16711935}));m.position.set(l,r.y+s,c),v.add(m);let g=new J.Vector3(this.worldRenderer.sceneOrigin.toSceneX(r.x),this.worldRenderer.sceneOrigin.toSceneY(r.y),this.worldRenderer.sceneOrigin.toSceneZ(r.z)),b=new J.ArrowHelper(new J.Vector3(Math.cos(t),0,Math.sin(t)),g,1,16711680);return v.add(b),{mesh:e,debugGroup:v}}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 J.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 J.Raycaster,i=new J.Vector2(0,0);r.setFromCamera(i,e);let s=r.intersectObjects(t.children,!0);if(s.length>0){let o=s[0],v=o.object;for(let[a,l]of this.customMedia.entries())if(v===l.mesh||l.mesh.children.includes(v)){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=l,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),v=o?.props.controlMode;if(o?.video&&(v?.mouseButton==="both"||v?.mouseButton===e))switch(v?.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}}}}};E();x();k();R();import*as Xt from"three";E();x();k();R();import*as Me from"three";var El=1,H3=10,xt={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 D3(n){let e=n.color??16711680,t=n.depthTest??!1,r=n.visualScale??n.metadata?.visualScale??(typeof window>"u"?void 0:window.serverMetadata?.waypointVisualScale)??xt.DEFAULT_VISUAL_SCALE,i=n.opacity??n.metadata?.opacity??(typeof window>"u"?void 0:window.serverMetadata?.waypointOpacity)??xt.DEFAULT_OPACITY,s=qe(O3(),O3());vi(s,e,n.label??"","0m",r);let o=new Me.CanvasTexture(s);o.anisotropy=1,o.magFilter=Me.LinearFilter,o.minFilter=Me.LinearFilter;let v=new Me.SpriteMaterial({map:o,transparent:!0,opacity:1,depthTest:t,depthWrite:!1}),a=new Me.Sprite(v);a.position.set(0,0,0),a.renderOrder=10,a.material.opacity=i;let l=n.label??"",c="0m",u=Number.NaN,f,m,g,b,A=null,y=xt.ARROW.enabledDefault,_=new Me.Group;_.add(a);let{x:M,y:C,z:T}=n.position;_.position.set(M,C,T);function P(){o.needsUpdate=!0}function B(){if(!m||!g)return;let Q=m.width;g.clearRect(0,0,Q,Q),g.beginPath(),g.moveTo(Q*.15,Q*.5),g.lineTo(Q*.85,Q*.5),g.lineTo(Q*.5,Q*.15),g.closePath();let ve=`#${e.toString(16).padStart(6,"0")}`;g.lineWidth=6,g.strokeStyle="black",g.stroke(),g.fillStyle=ve,g.fill(),b&&(b.needsUpdate=!0)}function L(Q){e=Q,c="0m",u=0,vi(s,e,l,"0m",r),P(),f&&B()}function G(Q){l=Q??"",vi(s,e,l,c,r),P()}function H(Q,ve){ve!==c&&(c=ve,vi(s,e,Q,ve,r),P())}function N(Q){a.visible=Q}function Y(Q,ve,ke){_.position.set(Q,ve,ke)}function q(Q,ve,ke,rt){let Ke=ve*Math.PI/180,Ee=Math.tan(Ke/2)*2*ke*(xt.TARGET_SCREEN_PX*r/rt);a.scale.set(Ee,Ee,1)}function Z(){if(f)return;let Q=128;m=qe(Q,Q),g=m.getContext("2d"),B(),b=new Me.CanvasTexture(m),b.anisotropy=1,b.magFilter=Me.LinearFilter,b.minFilter=Me.LinearFilter;let ve=new Me.SpriteMaterial({map:b,transparent:!0,depthTest:!1,depthWrite:!1,opacity:i});f=new Me.Sprite(ve),f.renderOrder=12,f.visible=!1,A&&A.add(f)}function ae(Q){y=Q,!Q&&f&&(f.visible=!1)}function oe(Q){f?.parent&&f.parent.remove(f),A=Q,f&&Q&&Q.add(f)}function le(Q,ve,ke){if(!y||(Z(),!f))return!0;let rt=n.metadata?.onlyLeftRight===!0,Ke=new Me.Vector3;Q.getWorldDirection(Ke);let dt=Q.up.clone().normalize(),Ee=new Me.Vector3().copy(Ke).cross(dt).normalize(),wt=new Me.Vector3().copy(Ee).cross(Ke).normalize(),m5=new Me.Vector3().setFromMatrixPosition(Q.matrixWorld),p5=new Me.Vector3(_.position.x,_.position.y,_.position.z).sub(m5),r0=p5.dot(Ke),Gt=p5.dot(Ee),i0=p5.dot(wt),dr=ve/ke,n0=Q.fov*Math.PI/180,L0=2*Math.atan(Math.tan(n0/2)*dr),ur=Math.atan2(Gt,r0),fr=Math.atan2(i0,r0);if(r0>0&&Math.abs(ur)<=L0/2&&Math.abs(fr)<=n0/2)return f.visible=!1,!0;let it=ur/(L0/2),Pe=fr/(n0/2);r0<=0&&(Math.abs(it)>Math.abs(Pe)?(it=Math.sign(it),Pe=0):(it=0,Pe=Math.sign(Pe))),rt&&(Math.abs(it)>Math.abs(Pe)||(it=it>=0?1:-1),Pe=0);let H0=Math.max(Math.abs(it),Math.abs(Pe))||1,g5=it/H0,ut=Pe/H0,O0=xt.ARROW.paddingPx,w=(g5+1)*.5*ve,h=(1-ut)*.5*ke,p=Math.min(Math.max(w,O0),ve-O0),S=Math.min(Math.max(h,O0),ke-O0);g5=p/ve*2-1,ut=-(S/ke)*2+1;let I=Math.max(2,Q.near*4),U=Math.tan(n0/2)*I,V=U*dr,ie=m5.clone().add(Ke.clone().multiplyScalar(I)).add(Ee.clone().multiplyScalar(g5*V)).add(wt.clone().multiplyScalar(ut*U));f.visible=!0,f.position.copy(ie);let _e=Math.atan2(Pe,it);f.material.rotation=_e-Math.PI/2;let be=Math.tan(n0/2)*2*I*(xt.ARROW.pixelSize*r/ke);return f.scale.set(be,be,1),!1}function ye(Q){return Q.distanceTo(_.position)}function pe(Q,ve,ke,rt){let Ke=ye(Q);q(Q,ve.fov,Ke,rt);let dt=Math.round(Ke/H3)*H3;dt!==u&&(u=dt,H(l,`${Math.max(0,dt)}m`));let Ee=le(ve,ke,rt);return N(Ee),Ee}function se(){let Q=a.material;if(Q.map?.dispose(),Q.dispose(),f){f.parent&&f.parent.remove(f);let ve=f.material;ve.map?.dispose(),ve.dispose()}f=void 0,m=void 0,g=void 0,b=void 0}return{group:_,sprite:a,enableOffscreenArrow:ae,setArrowParent:oe,updateForCamera:pe,setColor:L,setLabel:G,updateDistanceText:H,setVisible:N,setPosition:Y,dispose:se}}function F3(){let n=globalThis.devicePixelRatio||1,e=Math.min(n,El);return xt.CANVAS_SCALE*e}function O3(){return Math.round(xt.CANVAS_SIZE*F3())}function vi(n,e,t,r,i){let s=n.width,o=F3(),v=n.getContext("2d");v.clearRect(0,0,s,s);let a=s/2,l=Math.round(s*xt.LAYOUT.DOT_Y),c=Math.round(s*.05*i),u=Math.max(2,Math.round(4*o*i)),f=c+u;v.beginPath(),v.arc(a,l,f,0,Math.PI*2),v.fillStyle=`#${e.toString(16).padStart(6,"0")}`,v.fill(),v.textAlign="center",v.textBaseline="middle";let m=Math.round(s*.08*i),g=Math.round(s*.06*i);v.font=`800 ${m}px mojangles`,v.lineWidth=Math.max(2,Math.round(3*o*i));let b=Math.round(s*xt.LAYOUT.NAME_Y);v.strokeStyle="black",v.strokeText(t,a,b),v.fillStyle="white",v.fillText(t,a,b),v.font=`800 ${g}px mojangles`,v.lineWidth=Math.max(2,Math.round(2*o*i));let A=Math.round(s*xt.LAYOUT.DISTANCE_Y);v.strokeStyle="black",v.strokeText(r,a,A),v.fillStyle="#CCCCCC",v.fillText(r,a,A)}var li=class{constructor(e){this.worldRenderer=e;d(this,"waypoints",new Map);d(this,"waypointScene",new Xt.Scene);d(this,"lastCameraPosition",new Xt.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 Xt.Vector2);for(let o of this.waypoints.values()){let v=new Xt.Vector3(o.x,o.y,o.z),a=t.distanceTo(v),l=(!o.minDistance||a>=o.minDistance)&&(o.maxDistance===1/0||a<=o.maxDistance);o.sprite.setVisible(l),l&&(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:v,metadata:a}=s,l=s.minDistance??0,c=s.maxDistance??1/0,u=D3({position:new Xt.Vector3(t,r,i),color:o,label:v||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:l,maxDistance:c,color:o,label:v,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))}};E();x();k();R();import*as Re from"three";import{Vec3 as $5}from"vec3";var xe=class xe{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 Re.BoxGeometry(xe.DEFAULT_PARTICLE_SIZE,xe.DEFAULT_PARTICLE_SIZE,xe.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 Re.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=xe.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],v=Math.floor(xe.DEFAULT_PARTICLE_COUNT*t),a;if(xe.DEBUG_SHOW_EXPLOSION_CENTER){let c=.5*t,u=new Re.SphereGeometry(c,8,8),f=new Re.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});a=new Re.Mesh(u,f),a.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(a),a.position.set(e.x,e.y,e.z)}for(let c=0;c<v;c++){let u=Math.random()*Math.PI*2,f=Math.sqrt(Math.random())*xe.VELOCITY_FACTOR*t,m=new $5(f*Math.cos(u),Math.random()*.5-.25,f*Math.sin(u));c<5;let g=r===void 0?this.getRandomMaterial().clone():new Re.MeshBasicMaterial({color:r,transparent:!0,opacity:1}),b=new Re.Mesh(this.particleGeometry,g);b.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(b),b.position.set(e.x,e.y,e.z),c<5;let A={position:e.clone(),velocity:m,color:new Re.Color(g.color),life:1,maxLife:1,mesh:b};o.push(A)}let l={id:s,position:e.clone(),particles:o,startTime:Date.now(),duration:i,size:t,debugSphere:a};return this.explosions.set(s,l),l}createExplosionFacingCamera(e,t=1,r,i=xe.DEFAULT_EXPLOSION_DURATION){let s=`firework_${this.explosionCounter++}_${Date.now()}`,o=[],v=Math.floor(xe.DEFAULT_PARTICLE_COUNT*t),a;if(xe.DEBUG_SHOW_EXPLOSION_CENTER){let f=.5*t,m=new Re.SphereGeometry(f,8,8),g=new Re.MeshBasicMaterial({color:16711680,wireframe:!0,transparent:!0,opacity:.8});a=new Re.Mesh(m,g),a.renderOrder=999,this.worldRenderer.sceneOrigin.addAndTrack(a),a.position.set(e.x,e.y,e.z)}let l=this.worldRenderer.getCameraPosition(),c=new $5(l.x-e.x,l.y-e.y,l.z-e.z).normalize();for(let f=0;f<v;f++){let m=Math.random()*Math.PI*2,g=Math.sqrt(Math.random())*xe.VELOCITY_FACTOR*t,b=new $5(g*Math.cos(m),g*Math.sin(m),0),A=new $5(b.x*c.x-b.z*c.z,b.y,b.x*c.z+b.z*c.x);f<5;let y=r===void 0?this.getRandomMaterial().clone():new Re.MeshBasicMaterial({color:r,transparent:!0,opacity:1}),_=new Re.Mesh(this.particleGeometry,y);_.renderOrder=1e3,this.worldRenderer.sceneOrigin.addAndTrack(_),_.position.set(e.x,e.y,e.z);let M={position:e.clone(),velocity:A,color:new Re.Color(y.color),life:1,maxLife:1,mesh:_};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 $5(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)},xe.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+=xe.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 v=e.life;e.life-=t/r;let a=Math.max(0,e.life);if(e.mesh.material instanceof Re.MeshBasicMaterial&&(e.mesh.material.opacity=a),i&&v>.95){let l=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 Re.Material&&r.mesh.material.dispose();t.debugSphere&&(this.worldRenderer.sceneOrigin.removeAndUntrack(t.debugSphere),t.debugSphere.geometry.dispose(),t.debugSphere.material instanceof Re.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(xe,"DEFAULT_PARTICLE_COUNT",50),d(xe,"DEFAULT_PARTICLE_SIZE",.05),d(xe,"DEFAULT_EXPLOSION_DURATION",6e3),d(xe,"GRAVITY",-.005),d(xe,"VELOCITY_FACTOR",1.5),d(xe,"TEST_INTERVAL",1e3),d(xe,"DEBUG_SHOW_EXPLOSION_CENTER",!0),d(xe,"DEBUG_SHOW_PARTICLE_TRAILS",!1);var ci=xe;E();x();k();R();import*as M0 from"three";import{Vec3 as h1}from"vec3";var di=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 h1(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}]),v=[i,s,o];return this.startScript(v[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 M0.Vector3(t.lookAt.x,t.lookAt.y,t.lookAt.z),f=new M0.Vector3(t.x,t.y,t.z),m=u.sub(f).normalize();s.yaw=Math.atan2(-m.x,-m.z),s.pitch=Math.asin(m.y)}let v=this.getEasingFunction(t.easing||"easeInOut"),a=new ze(this.currentPosition).to(i,r).easing(v).onUpdate(()=>{this.updateCamera(new h1(this.currentPosition.x,this.currentPosition.y,this.currentPosition.z),this.currentRotation.yaw,this.currentRotation.pitch)}),l=new ze(this.currentRotation).to(this.wrapRotation(s),r).easing(v).onUpdate(()=>{this.updateCamera(new h1(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 ze(u).to({fov:o},r).easing(v).onUpdate(()=>{this.currentFov=u.fov,this.updateFov(this.currentFov)})}this.currentTweens=[a,l],c&&this.currentTweens.push(c),a.start(),l.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 De.Linear.None;case"easeIn":return De.Quadratic.In;case"easeOut":return De.Quadratic.Out;case"easeInOut":return De.Quadratic.InOut;case"smoothstep":return De.Cubic.InOut;case"bounce":return De.Bounce.Out;default:return De.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 v=0;v<=8;v++){let a=v/8*Math.PI*2,l=e.x+Math.cos(a)*t,c=e.z+Math.sin(a)*t,u=e.y+r;s.push({x:l,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,v=20;for(let a=0;a<=o;a++){let l=a/o,c=l*r*Math.PI*2,u=M0.MathUtils.lerp(e.x,t.x,l)+Math.cos(c)*v*(1-l),f=M0.MathUtils.lerp(e.z,t.z,l)+Math.sin(c)*v*(1-l),m=M0.MathUtils.lerp(e.y,t.y,l);s.push({x:u,y:m,z:f,yaw:c+Math.PI/2,pitch:-.3*l,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}}};E();x();k();R();import*as ee from"three";var m1=.75,ui=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",m1);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 Dt("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),v=this.getSkyColorByTemp(o),a=(v>>16&255)/255,l=(v>>8&255)/255,c=(v&255)/255;return new ee.Vector3(a*s,l*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 v=(e-Math.floor(e))*6,a=v-Math.floor(v),l=r*(1-t),c=r*(1-t*a),u=r*(1-t*(1-a));switch(Math.floor(v)){case 0:i=Math.floor(r*255+.5),s=Math.floor(u*255+.5),o=Math.floor(l*255+.5);break;case 1:i=Math.floor(c*255+.5),s=Math.floor(r*255+.5),o=Math.floor(l*255+.5);break;case 2:i=Math.floor(l*255+.5),s=Math.floor(r*255+.5),o=Math.floor(u*255+.5);break;case 3:i=Math.floor(l*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(l*255+.5),o=Math.floor(r*255+.5);break;case 5:i=Math.floor(r*255+.5),s=Math.floor(l*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 g=this.waterBreathing?100:5;this.scene.fog=new ee.Fog(new ee.Color(0,0,1),.0025,g),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),v=this.getFogColor(this.partialTicks),a=Math.cos(s*Math.PI*2)*2+.5,l=Math.max(0,Math.min(1,a)),c=this.prevFogBrightness+(this.fogBrightness-this.prevFogBrightness)*this.partialTicks,u=(v.x+(o.x-v.x)*i)*l*c,f=(v.y+(o.y-v.y)*i)*l*c,m=(v.z+(o.z-v.z)*i)*l*c;this.scene.background=new ee.Color(u,f,m),this.scene.fog=new ee.Fog(new ee.Color(u,f,m),.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))}};E();x();k();R();import*as re from"three";var xl=`
21461
21483
  precision highp float;
21462
21484
  attribute vec3 position;
21463
21485
  attribute vec4 color;
@@ -21477,7 +21499,7 @@ void main() {
21477
21499
  gl_PointSize = size * adjustSize * (300.0 / length(mvPosition.xyz));
21478
21500
  gl_Position = projectionMatrix * mvPosition;
21479
21501
  }
21480
- `,Ev=`
21502
+ `,Rl=`
21481
21503
  precision highp float;
21482
21504
  uniform sampler2D texture;
21483
21505
  varying vec4 vColor;
@@ -21486,7 +21508,156 @@ void main() {
21486
21508
  vec4 texColor = texture2D(texture, gl_PointCoord);
21487
21509
  gl_FragColor = vColor * texColor;
21488
21510
  }
21489
- `,Ke={textureSize:128,gravity:new re.Vector3(0,-.005,0),friction:.998,defaultParticleSize:300,maxActiveFireworks:5},N5=n=>{let t=n*3;return{x:t,y:t+1,z:t+2}},W5=n=>{let t=n*4;return{r:t,g:t+1,b:t+2,a:t+3}},pt=(n=0,e=0)=>Math.floor(Math.random()*(n+1-e))+e,xv=(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()},Rv=()=>{let n=Ke.textureSize,e=Ve(n,n),t=e.getContext("2d"),r=n/2;xv(t,r,e.width,e.height);let i=new re.Texture(e);return i.needsUpdate=!0,i},kv=(n,e,t,r,i=Ke.defaultParticleSize)=>{let s=new re.BufferGeometry,o=[],a=[],v=[],l=[],c=[],u=Math.random()>.3?"single":"multiple",h=pt(100,20)*.01,p=()=>pt(100,1)*.01,g="red",y=Math.random();y>.66?g="red":y>.33?g="green":g="blue";for(let b=0;b<n;b++){let w=new re.Vector3(0,0,0);if(o.push(w.x,w.y,w.z),a.push(e[b].x,e[b].y,e[b].z),t==="seed"){let S=e[b].y**2*.04;b===0&&(S*=1.1),l.push(S),c.push(S*.017),v.push(1,1,1,1)}else if(t==="trail"){let S=Math.random()*.1+.1;l.push(S),c.push(S*.017),v.push(1,1,1,1)}else{let S=pt(i,10)*.001;if(l.push(S),c.push(S*.017),u==="multiple")v.push(p(),p(),p(),1);else switch(g){case"red":v.push(h,.1,.1,1);break;case"green":v.push(.1,h,.1,1);break;case"blue":v.push(.1,.1,h,1);break}}}s.setAttribute("position",new re.Float32BufferAttribute(o,3)),s.setAttribute("velocity",new re.Float32BufferAttribute(a,3)),s.setAttribute("color",new re.Float32BufferAttribute(v,4)),s.setAttribute("adjustSize",new re.Float32BufferAttribute(l,1)),s.setAttribute("mass",new re.Float32BufferAttribute(c,1));let A=new re.RawShaderMaterial({uniforms:{size:{value:Ke.textureSize},texture:{value:r}},transparent:!0,depthWrite:!1,blending:re.AdditiveBlending,vertexShader:Av,fragmentShader:Ev});return new re.Points(s,A)},V5=class{constructor(e,t,r,i,s){d(this,"particleNum");d(this,"timerStartFading");d(this,"mesh");this.particleNum=e,this.timerStartFading=10,this.mesh=kv(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,a=v=>Math.random()>.5?0:(1-v)*.1;for(let v=0;v<this.particleNum;v++){let{x:l,y:c,z:u}=N5(v);r.array[c]+=e.y-s.array[v],r.array[l]*=Ke.friction,r.array[u]*=Ke.friction,r.array[c]*=Ke.friction,t.array[l]+=r.array[l],t.array[c]+=r.array[c],t.array[u]+=r.array[u];let{a:h}=W5(v);this.timerStartFading<=0&&(i.array[h]*=o()-a(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()}},Ni=class extends V5{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,a=u=>Math.random()>.3?0:(1-u)*.1,v=()=>Math.random()>.5?.05:-.05,l=()=>Math.random()>.1,c=Ke.friction*.98;for(let u=0;u<this.particleNum;u++){let{x:h,y:p,z:g}=N5(u);r.array[p]+=e.y-s.array[u],r.array[h]*=c,r.array[g]*=c,r.array[p]*=c,t.array[h]+=r.array[h],t.array[p]+=r.array[p],t.array[g]+=r.array[g],l()&&(t.array[h]+=v()),l()&&(t.array[g]+=v());let{a:y}=W5(u);i.array[y]*=o()-a(i.array[y]),i.array[y]<.001&&(i.array[y]=0)}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},Wi=class extends V5{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,a=()=>Math.random()>.5?.05:-.05,v=()=>Math.random()>.2;for(let l=0;l<this.particleNum;l++){let{x:c,y:u,z:h}=N5(l);r.array[u]+=e.y-s.array[l],r.array[c]*=Ke.friction,r.array[h]*=Ke.friction,r.array[u]*=Ke.friction,t.array[c]+=r.array[c],t.array[u]+=r.array[u],t.array[h]+=r.array[h],v()&&(t.array[c]+=a()),v()&&(t.array[h]+=a());let{a:p}=W5(l);i.array[p]*=o(),i.array[p]<.001&&(i.array[p]=0)}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},j5=class{constructor(e,t=Ke.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 re.Group,this.isExplode=!1,this.texture=e,this.particleSize=t;let i=400,s=150;this.petalsNum=pt(i,s),this.life=150,this.seed=this.getSeed(r),this.meshGroup.add(this.seed.mesh),this.flowerSizeRate=re.MathUtils.mapLinear(this.petalsNum,s,i,.4,.7)}getSeed(e){let r=[];for(let s=0;s<40;s++){let a=s===0?Math.random()*2.5+.9:Math.random()*2+.4,v=0;r.push(new re.Vector3(0,a,v))}let i=new Ni(40,r,this.texture);if(e)i.mesh.position.set(0,0,0);else{let s=Math.random()*80-40,o=-50,a=Math.random()*80-40;i.mesh.position.set(s,o,a)}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 a=0;a<t;a++){i=pt(120,60)*.01;let v=re.MathUtils.degToRad(Math.random()*180),l=re.MathUtils.degToRad(Math.random()*360),c=Math.sin(v)*Math.cos(l)*i,u=Math.sin(v)*Math.sin(l)*i,h=Math.cos(v)*i,p=new re.Vector3(c,u,h);p.multiplyScalar(this.flowerSizeRate),r.push(p)}else{let a=180/t,v=360*(Math.random()*20+1)/t,l=v,c=v;i=pt(120,60)*.01;for(let u=0;u<t;u++){let h=Math.sin(re.MathUtils.degToRad(a*u)),p=Math.cos(re.MathUtils.degToRad(a*u))*i,g=Math.cos(re.MathUtils.degToRad(l*u))*h*i,y=Math.sin(re.MathUtils.degToRad(c*u))*h*i,A=new re.Vector3(g,y,p);A.multiplyScalar(this.flowerSizeRate),r.push(A)}}let o=new V5(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(Ke.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:a}=this.seed.mesh.position,v=new re.Vector3(s,o,a),l=0,c;for(let u=0,h=e.array.length;u<h;u++){let p=e.array[u];u%3===1&&p>l&&(l=p,c=new re.Vector3(e.array[u-1],p,e.array[u+2]))}c&&(v.add(c),this.explode(v))}},Kt=class extends j5{constructor(t,r=Ke.defaultParticleSize,i){super(t,r,i);d(this,"tailMeshGroup");d(this,"tails");let s=150,o=100;this.petalsNum=pt(s,o),this.flowerSizeRate=re.MathUtils.mapLinear(this.petalsNum,o,s,.4,.7),this.tailMeshGroup=new re.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 M=0;M<20;M++)o.push(new re.Vector3(0,0,0));let a=new Wi(20,o,this.texture),{r:v,g:l,b:c,a:u}=W5(s),h=i.array[v],p=i.array[l],g=i.array[c],y=i.array[u],A=a.mesh.geometry.attributes.position,b=a.mesh.geometry.attributes.color;for(let M=0;M<A.count;M++){let I=W5(M);b.array[I.r]=h,b.array[I.g]=p,b.array[I.b]=g,b.array[I.a]=y}let{x:w,y:S,z:C}=this.flower.mesh.position;a.mesh.position.set(w,S,C),t.push(a),this.tailMeshGroup.add(a.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:a,y:v,z:l}=N5(i),c=new re.Vector3(r.array[a],r.array[v],r.array[l]),u=o.mesh.geometry.attributes.position,h=o.mesh.geometry.attributes.velocity;for(let p=0;p<u.count;p++){let g=N5(p),y=new re.Vector3,A=new re.Vector3(u.array[g.x],u.array[g.y],u.array[g.z]),b=new re.Vector3(h.array[g.x],h.array[g.y],h.array[g.z]);y.subVectors(c,A);let w=y.sub(b);w.normalize(),w.multiplyScalar(Math.random()*3e-4*this.life),h.array[g.x]+=w.x,h.array[g.y]+=w.y,h.array[g.z]+=w.z}h.needsUpdate=!0}this.life>0&&(this.life-=1.2)}else this.drawTail()}},J1=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=Rv(),this.particleSize=r?.defaultParticleSize??Ke.defaultParticleSize,this.maxFireworks=r?.maxActiveFireworks??Ke.maxActiveFireworks}launchFirework(e){if(this.fireworksInstances.length>=this.maxFireworks)return;let t=e?.particleSize??this.particleSize,r=e?.position,i;e?.forceRich?i=new Kt(this.texture,t,r):e?.forceBasic?i=new j5(this.texture,t,r):i=Math.random()>.5?new j5(this.texture,t,r):new Kt(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(Ke.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 Kt&&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 Kt)for(let t of e.tails)t.disposeAll();this.fireworksInstances=[]}dispose(){this.clear(),this.texture.dispose()}};E();x();k();R();var ta=Symbol("tracked-proxy"),Tv=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"]),Z1=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,a=new Proxy(r,{get(v,l,c){if(l===ta)return i;if(l==="set")return(h,p,g)=>(i.x=h,i.y=p,i.z=g,v.set(h-s._x,p-s._y,g-s._z),o?.updateMatrix&&e.updateMatrix(),c);if(l==="copy")return h=>{let p=h[ta],g=p?p.x:h.x,y=p?p.y:h.y,A=p?p.z:h.z;return i.x=g,i.y=y,i.z=A,v.set(g-s._x,y-s._y,A-s._z),o?.updateMatrix&&e.updateMatrix(),c};if(l==="setX")return h=>(i.x=h,v.x=h-s._x,o?.updateMatrix&&e.updateMatrix(),c);if(l==="setY")return h=>(i.y=h,v.y=h-s._y,o?.updateMatrix&&e.updateMatrix(),c);if(l==="setZ")return h=>(i.z=h,v.z=h-s._z,o?.updateMatrix&&e.updateMatrix(),c);if(typeof l=="string"&&Tv.has(l))return()=>{throw new Error(`Cannot call position.${l}() on a tracked object. Use position.set(x, y, z) instead.`)};let u=v[l];return typeof u=="function"?u.bind(v):u},set(v,l,c){return l==="x"?(i.x=c,v.x=c-s._x,o?.updateMatrix&&e.updateMatrix(),!0):l==="y"?(i.y=c,v.y=c-s._y,o?.updateMatrix&&e.updateMatrix(),!0):l==="z"?(i.z=c,v.z=c-s._z,o?.updateMatrix&&e.updateMatrix(),!0):(v[l]=c,!0)}});Object.defineProperty(e,"position",{value:a,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}};Ji();E();x();k();R();Zt();gt();Qi();import Yv from"prismarine-chat";import*as X from"three";import*as ar from"prismarine-nbt";import{Vec3 as Xi}from"vec3";E();x();k();R();gt();Zt();import*as u0 from"three";var Fv=512e3,zv=1e6,ma=15e3,Lv=.25,qt=aa(),nr=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);this.capacityFaces=Fv,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(qt);let r=new u0.InstancedBufferGeometry,i=new Float32Array(X1*3);r.setAttribute("position",new u0.BufferAttribute(i,3));let s=o=>{let a=new u0.InstancedBufferAttribute(o,1);return a.setUsage(u0.DynamicDrawUsage),a};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 u0.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)}addSection(e,t,r){if(r<=0){this.removeSection(e);return}this.sectionSlots.has(e)&&this.removeSection(e),r>this.capacityFaces&&this.growCapacity(r);let i=this.takeFreeSlot(r);i||(this.highWatermark+r>this.capacityFaces&&this.growCapacity(this.highWatermark+r),i={start:this.highWatermark,count:r},this.highWatermark+=r);let s=4;for(let o=0;o<r;o++){let a=i.start+o,v=o*s;this.w0[a]=t[v],this.w1[a]=t[v+1],this.w2[a]=t[v+2],this.w3[a]=t[v+3]}this.sectionSlots.set(e,i),this.markDirty(i.start,i.start+r-1),this.mesh.geometry.instanceCount=this.highWatermark}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,a=s*r;i[a]=this.w0[o],i[a+1]=this.w1[o],i[a+2]=this.w2[o],i[a+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.pendingMove?.key===e){let{oldStart:r,count:i}=this.pendingMove;for(let s=r;s<r+i;s++)this.w0[s]=0,this.w1[s]=0,this.w2[s]=qt,this.w3[s]=0;this.markDirty(r,r+i-1),this.insertFreeSlot({start:r,count: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]=qt,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}}compactStep(){if(this.pendingMove){let{newStart:a,count:v}=this.pendingMove;this.rangeFullyUploaded(a,a+v-1)&&this.finalizePendingMove();return}if(this.highWatermark===0||this.interiorFreeFaces()/this.highWatermark<=Lv)return;let t=this.findMovableSection(ma);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}}uploadDirtyRange(){let e=this.pendingRanges[0];if(!e)return;let t=e.start,r=Math.min(e.end-e.start+1,ma),i=this.mesh.geometry;for(let s of["a_w0","a_w1","a_w2","a_w3"]){let o=i.getAttribute(s);o.updateRange.offset=t,o.updateRange.count=r,o.needsUpdate=!0}t+r>e.end?this.pendingRanges.shift():e.start=t+r}setCameraOrigin(e,t,r){let i=Math.floor(e),s=Math.floor(t),o=Math.floor(r),a=this.mesh.material.uniforms.u_cameraOrigin;a?.value?.set&&a.value.set(i,s,o);let v=this.mesh.material.uniforms.u_cameraOriginFrac;v?.value?.set&&v.value.set(e-i,t-s,r-o)}reset(){this.sectionSlots.clear(),this.freeList.length=0,this.highWatermark=0,this.pendingRanges.length=0,this.pendingMove=null,this.w0.fill(0),this.w1.fill(0),this.w2.fill(qt),this.w3.fill(0),this.mesh.geometry.instanceCount=0}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()}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}finalizePendingMove(){let e=this.pendingMove;if(!e)return;let{oldStart:t,count:r}=e;for(let i=t;i<t+r;i++)this.w0[i]=0,this.w1[i]=0,this.w2[i]=qt,this.w3[i]=0;this.insertFreeSlot({start:t,count:r}),this.shrinkHighWatermark(),t<this.highWatermark&&this.markDirty(t,t+r-1),this.mesh.geometry.instanceCount=this.highWatermark,this.pendingMove=null}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();let t=this.capacityFaces;for(;t<e;)t+=zv;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(qt,this.w0.length),this.w0=r,this.w1=i,this.w2=s,this.w3=o,this.capacityFaces=t;let a=this.mesh.geometry,v=(l,c)=>{let u=a.getAttribute(c);u&&(a.deleteAttribute(c),"dispose"in u&&typeof u.dispose=="function"&&u.dispose());let h=new u0.InstancedBufferAttribute(l,1);h.setUsage(u0.DynamicDrawUsage),a.setAttribute(c,h)};v(this.w0,"a_w0"),v(this.w1,"a_w1"),v(this.w2,"a_w2"),v(this.w3,"a_w3"),this.pendingRanges.length=0}};E();x();k();R();Zt();gt();function pa(n,e,t,r,i){if(e<=0)return;let s=t-8,o=r-8,a=i-8,v=Jt,l=16,c=16,u=16,h=-1,p=-1,g=-1;for(let M=0;M<e;M++){let I=n[M*v],B=I&(1<<c0.LX_BITS)-1,H=I>>c0.LY_SHIFT&(1<<c0.LY_BITS)-1,G=I>>c0.LZ_SHIFT&(1<<c0.LZ_BITS)-1;B<l&&(l=B),H<c&&(c=H),G<u&&(u=G),B>h&&(h=B),H>p&&(p=H),G>g&&(g=G)}if(h<0)return;let y=s+l,A=o+c,b=a+u,w=s+h+1,S=o+p+1,C=a+g+1;return{minX:y,minY:A,minZ:b,maxX:w,maxY:S,maxZ:C,cx:(y+w)*.5,cy:(A+S)*.5,cz:(b+C)*.5}}function sr(n,e,t,r,i,s,o,a,v){return n>=r&&n<=o&&e>=i&&e<=a&&t>=s&&t<=v}function Zi(n,e,t,r,i,s,o,a,v,l,c,u,h){if(sr(n,e,t,o,a,v,l,c,u))return;let p=0,g=h;if(Math.abs(r)<1e-8){if(n<o||n>l)return}else{let y=1/r,A=(o-n)*y,b=(l-n)*y;if(A>b){let w=A;A=b,b=w}if(p=Math.max(p,A),g=Math.min(g,b),p>g)return}if(Math.abs(i)<1e-8){if(e<a||e>c)return}else{let y=1/i,A=(a-e)*y,b=(c-e)*y;if(A>b){let w=A;A=b,b=w}if(p=Math.max(p,A),g=Math.min(g,b),p>g)return}if(Math.abs(s)<1e-8){if(t<v||t>u)return}else{let y=1/s,A=(v-t)*y,b=(u-t)*y;if(A>b){let w=A;A=b,b=w}if(p=Math.max(p,A),g=Math.min(g,b),p>g)return}return p<=g&&p>=0?p:void 0}function Uv(n,e,t,r,i,s,o,a,v,l,c,u,h){let p=h;if(Math.abs(r)>=1e-8){let g=r>0?(l-n)/r:(o-n)/r;g>1e-6&&(p=Math.min(p,g))}else if(n<o||n>l)return;if(Math.abs(i)>=1e-8){let g=i>0?(c-e)/i:(a-e)/i;g>1e-6&&(p=Math.min(p,g))}else if(e<a||e>c)return;if(Math.abs(s)>=1e-8){let g=s>0?(u-t)/s:(v-t)/s;g>1e-6&&(p=Math.min(p,g))}else if(t<v||t>u)return;return p<=h?p:void 0}function qi(n,e,t,r,i,s,o,a,v,l,c,u,h,p,g,y){let A=i-8,b=s-8,w=o-8,S=p,C=!1;for(let M=0;M<t;M++){let I=n[e+M*r],B=I&(1<<c0.LX_BITS)-1,H=I>>c0.LY_SHIFT&(1<<c0.LY_BITS)-1,G=I>>c0.LZ_SHIFT&(1<<c0.LZ_BITS)-1,O=B+(H<<4)+(G<<8);if(g[O]===y)continue;g[O]=y;let j=A+B,J=b+H,Z=w+G,$=j+1,ue=J+1,le=Z+1,ce;sr(a,v,l,j,J,Z,$,ue,le)?ce=Uv(a,v,l,c,u,h,j,J,Z,$,ue,le,S):ce=Zi(a,v,l,c,u,h,j,J,Z,$,ue,le,S),ce!==void 0&&ce<S&&(S=ce,C=!0)}return C?S:void 0}E();x();k();R();import*as qe from"three";var ga=20,ba=40,Gv={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},ya={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 Nv(n){let e=n.replace("_wall_banner","_banner");return Gv[e]??15}var Wv=(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 a=0;a<s;a+=2)n.fillRect(r+a,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 Vv(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 jv=(n,e,t=(r,i)=>Ve(r,i))=>{let i=t(ga*1,ba*1),s=i.getContext("2d");if(s){if(s.imageSmoothingEnabled=!1,e?.Patterns&&e.Patterns.length>0)for(let o of e.Patterns){let a=o.Color??0,v=o.Pattern??"bs",l=ya[a]||ya[0];Wv(s,v,l,0,0,ga*1,ba*1)}return i}},or=new Map;function _a(n,e,t){let r=Nv(e),i=Vv(r,t?.Patterns),s=or.get(i);if(s)return s.refCount++,s.texture;let o=jv(r,t);if(!o)return;let a=new qe.Texture(o);return a.magFilter=qe.NearestFilter,a.minFilter=qe.NearestFilter,a.needsUpdate=!0,or.set(i,{texture:a,refCount:1}),a}function wa(n){for(let[e,t]of or.entries())if(t.texture===n){t.refCount--,t.refCount<=0&&(t.texture.dispose(),or.delete(e));return}}function Aa(n,e,t,r){let a,v,l;t?(a=(-14.6+13.4)/2/16-.5,v=1-14.75/16-.5,l=1/2):(a=(1.4+29.4)/2/16,v=1-7.25/16-.5,l=0);let c=new qe.Mesh(new qe.PlaneGeometry(.85,1.75),new qe.MeshBasicMaterial({map:r,transparent:!0}));c.renderOrder=999;let u=.5/16,h=.25/16;t?c.position.set(0,a,v+h+.004):c.position.set(0,a,v+u/2+.004);let p=new qe.Group;return p.rotation.set(0,-qe.MathUtils.degToRad(e*(t?90:45/2)),0),p.add(c),p.bannerTexture=r,p.position.set(n.x+.5,n.y+l,n.z+.5),p}var bt=class bt{constructor(e,t,r,i,s=3){this.worldRenderer=e;this.scene=t;this.material=r;this.worldHeight=i;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,"chunkBoxMaterial",new X.MeshBasicMaterial({color:0,transparent:!0,opacity:0}));d(this,"cubeShaderMaterial",null);d(this,"globalBlockBuffer",null);d(this,"shaderSectionRaycastBoxes",new Map);d(this,"blockRaycastVisitGen",new Uint16Array(4096));d(this,"blockRaycastVisitStamp",1);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 $i(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.material);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?!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=rr();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}getCubeShaderMaterial(){return this.isShaderCubesGpuEnabled()?(this.cubeShaderMaterial||(this.cubeShaderMaterial=q1(),this.syncCubeShaderUniforms()),this.cubeShaderMaterial):null}getGlobalBlockBuffer(){let e=this.getCubeShaderMaterial();return e?(this.globalBlockBuffer||(this.globalBlockBuffer=new nr(e,this.scene)),this.globalBlockBuffer):null}shouldDeferShaderToPerSection(e){let t=this.worldRenderer.getModule("futuristicReveal");return t?t.isInInitialRevealCampaign?.()?!0:t.shouldUseRevealEffect?.(e)===!0:!1}migrateDeferredShaderToGlobal(e){let t=this.sectionObjects[e];if(!t?.deferredShaderCubes)return;let{words:r,count:i}=t.deferredShaderCubes,s=t.worldX,o=t.worldY,a=t.worldZ;s!==void 0&&o!==void 0&&a!==void 0&&this.registerShaderSectionRaycastBox(e,r,i,s,o,a),this.getGlobalBlockBuffer()?.addSection(e,r,i);let l=t.mesh===t.shaderMesh;t.shaderMesh&&(Yi(t.shaderMesh),t.remove(t.shaderMesh),t.shaderMesh=void 0),delete t.deferredShaderCubes,l&&(t.mesh=void 0)}registerShaderSectionRaycastBox(e,t,r,i,s,o){let a=pa(t,r,i,s,o);a?this.shaderSectionRaycastBoxes.set(e,{box:a,sectionCenterX:i,sectionCenterY:s,sectionCenterZ:o}):this.shaderSectionRaycastBoxes.delete(e)}unregisterShaderSectionRaycastBox(e){this.shaderSectionRaycastBoxes.delete(e)}raycastShaderSectionAABBs(e,t,r,i=80){let s=e.x,o=e.y,a=e.z,v=t.x,l=t.y,c=t.z,u=i*i,h=r,p=!1;this.blockRaycastVisitStamp++,this.blockRaycastVisitStamp>=65535&&(this.blockRaycastVisitGen.fill(0),this.blockRaycastVisitStamp=1);for(let[g,y]of this.shaderSectionRaycastBoxes){let A=this.sectionObjects[g];if(A&&!A.visible)continue;let{box:b}=y,w=b.cx-s,S=b.cy-o,C=b.cz-a;if(w*w+S*S+C*C>u)continue;let M=Zi(s,o,a,v,l,c,b.minX,b.minY,b.minZ,b.maxX,b.maxY,b.maxZ,h);if(M===void 0&&sr(s,o,a,b.minX,b.minY,b.minZ,b.maxX,b.maxY,b.maxZ)){let I=this.globalBlockBuffer,B=I?.getSectionSlot(g);if(I&&B)M=qi(I.getW0(),B.start,B.count,1,y.sectionCenterX,y.sectionCenterY,y.sectionCenterZ,s,o,a,v,l,c,h,this.blockRaycastVisitGen,this.blockRaycastVisitStamp);else{let H=this.sectionObjects[g]?.deferredShaderCubes;H&&(M=qi(H.words,0,H.count,Jt,y.sectionCenterX,y.sectionCenterY,y.sectionCenterZ,s,o,a,v,l,c,h,this.blockRaycastVisitGen,this.blockRaycastVisitStamp))}}M!==void 0&&M<h&&(h=M,p=!0)}return p?h:void 0}updateSection(e,t){let r=t.positions.length>0,i=t.shaderCubes,s=this.isShaderCubesGpuEnabled()&&(i?.count??0)>0;if(!r&&!s)return this.releaseSection(e),null;let o=this.sectionObjects[e];o&&this.cleanupSection(e),r||this.releasePooledMesh(e);let a;if(r){let A=this.activeSections.get(e);if(!A){if(A=this.acquireMesh(),!A)return null;this.activeSections.set(e,A),A.sectionKey=e}let{mesh:b}=A;this.updateGeometryAttribute(b.geometry,"position",t.positions,3),this.updateGeometryAttribute(b.geometry,"normal",t.normals,3),this.updateGeometryAttribute(b.geometry,"color",t.colors,3),this.updateGeometryAttribute(b.geometry,"uv",t.uvs,2),b.geometry.index=new X.BufferAttribute(t.indices,1),b.geometry.boundingBox=new X.Box3(new X.Vector3(-8,-8,-8),new X.Vector3(8,8,8)),b.geometry.boundingSphere=new X.Sphere(new X.Vector3(0,0,0),Math.sqrt(3*8**2)),this.worldRenderer.sceneOrigin.track(b,{updateMatrix:!0}),b.position.set(t.sx,t.sy,t.sz),b.updateMatrix(),b.visible=!0,b.name="mesh",A.lastUsedTime=performance.now(),a=b}let v=s?this.getCubeShaderMaterial():null,l,c=s&&this.shouldDeferShaderToPerSection(e);s&&i&&(c&&v?(l=ir(i,v),l.visible=!0):this.getGlobalBlockBuffer()?.addSection(e,i.words,i.count)),o=new X.Group,a&&(o.add(a),o.mesh=a),l&&(o.add(l),o.shaderMesh=l,i&&(o.deferredShaderCubes={words:i.words,count:i.count}),o.mesh||(o.mesh=l)),s&&i&&this.registerShaderSectionRaycastBox(e,i.words,i.count,t.sx,t.sy,t.sz);let u=0;r&&(u+=t.positions.length/3/4),s&&i&&(u+=i.count),o.tilesCount=u,o.blocksCount=t.blocksCount,o.worldX=t.sx,o.worldY=t.sy,o.worldZ=t.sz,o.sectionKey=e,o.name="chunk";try{if(Object.keys(t.signs).length>0){let A=new X.Group;A.name="signs";for(let[b,{isWall:w,isHanging:S,rotation:C}]of Object.entries(t.signs)){let M=this.worldRenderer.blockEntities[b];if(!M)continue;let[I,B,H]=b.split(","),G=this.signHeadsRenderer.renderSign(new Xi(+I,+B,+H),C,w,S,ar.simplify(M));G&&A.add(G)}o.add(A),o.signsContainer=A}if(Object.keys(t.heads).length>0){let A=new X.Group;A.name="heads";for(let[b,{isWall:w,rotation:S}]of Object.entries(t.heads)){let C=this.worldRenderer.blockEntities[b];if(!C)continue;let[M,I,B]=b.split(","),H=this.signHeadsRenderer.renderHead(new Xi(+M,+I,+B),S,w,ar.simplify(C));H&&A.add(H)}o.add(A),o.headsContainer=A}if(Object.keys(t.banners).length>0){let A=new X.Group;A.name="banners",o.bannersContainer=A,o.add(A);for(let[b,{isWall:w,rotation:S,blockName:C}]of Object.entries(t.banners)){let M=this.worldRenderer.blockEntities[b];if(!M)continue;let[I,B,H]=b.split(","),G=_a(this.worldRenderer,C,ar.simplify(M));if(!G)continue;let O=Aa(new Xi(+I,+B,+H),S,w,G),{x:j,y:J,z:Z}=O.position;this.worldRenderer.sceneOrigin.track(O),O.position.set(j,J,Z),A.add(O)}}}catch{}this.sectionObjects[e]=o,this.scene.add(o),o.matrixAutoUpdate=!1,this.worldRenderer.displayOptions?.inWorldRenderingConfig?.showChunkBorders&&this.updateBoxHelper(e,!0);let h=e.split(","),p=`${h[0]},${h[2]}`,g=!!this.worldRenderer.displayOptions?.inWorldRenderingConfig?._renderByChunks,y=!!this.worldRenderer.worldRendererConfig?.wasmMesher;if((g||y)&&!this.worldRenderer.finishedChunks[p]){o.visible=!1,o._waitingForChunkDisplay=!0;let A=this.waitingChunksToDisplay[p]??(this.waitingChunksToDisplay[p]=[]);A.includes(e)||A.push(e)}return o}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]}}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]),a=Math.floor(r.x/16),v=Math.floor(r.z/16),l=(s>>4)-a,c=(o>>4)-v,u=l*l+c*c;if(u===0)return!1;let h=this.worldRenderer.finishedChunks,p=this.worldRenderer.loadedChunks,g=this.worldRenderer.viewDistance;if(t<bt.EXPECTED_NEAR_GRACE_MS&&g>0){let A=g*g,b=Math.min(g,Math.ceil(Math.sqrt(Math.max(0,u-1))));for(let w=-b;w<=b;w++)for(let S=-b;S<=b;S++){let C=w*w+S*S;if(C>=u||C>A)continue;let M=a+w<<4,I=v+S<<4,B=`${M},${I}`;if(B!==e&&p[B]&&!h[B])return!0}return!1}for(let A in p){if(A===e||h[A])continue;let b=A.split(",");if(b.length!==2)continue;let w=(Number(b[0])>>4)-a,S=(Number(b[1])>>4)-v;if(w*w+S*S<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())},bt.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()},bt.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){let t=this.sectionObjects[e];if(t){if(t._waitingForChunkDisplay){let r=e.split(","),i=`${r[0]},${r[2]}`,s=this.waitingChunksToDisplay[i];if(s){let o=s.indexOf(e);o!==-1&&s.splice(o,1),s.length===0&&delete this.waitingChunksToDisplay[i]}}if(t.bannersContainer&&(t.bannersContainer.traverse(r=>{r.bannerTexture&&wa(r.bannerTexture)}),this.disposeContainer(t.bannersContainer)),this.globalBlockBuffer?.removeSection(e),this.unregisterShaderSectionRaycastBox(e),t.shaderMesh&&(Yi(t.shaderMesh),t.shaderMesh=void 0),delete t.deferredShaderCubes,t.signsContainer&&this.disposeContainer(t.signsContainer),t.headsContainer&&this.disposeContainer(t.headsContainer),this.worldRenderer.sceneOrigin.removeAndUntrackAll(t),this.scene.remove(t),t.boxHelper){this.worldRenderer.sceneOrigin.removeAndUntrack(t.boxHelper),this.scene.remove(t.boxHelper),t.boxHelper.geometry.dispose();let r=t.boxHelper.material;if(Array.isArray(r))for(let i of r)i.dispose();else r.dispose();t.boxHelper=void 0}delete this.sectionObjects[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?.mesh)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 a=i.worldX??0,v=i.worldY??0,l=i.worldZ??0;this.worldRenderer.sceneOrigin.track(o,{updateMatrix:!0}),o.position.set(a,v,l),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)}cleanSignChunkTextures(e,t){this.signHeadsRenderer.cleanChunkTextures(e,t)}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)}}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,a=0,v=this.globalBlockBuffer?.mesh.geometry;if(v)for(let c of["a_w0","a_w1","a_w2","a_w3"]){let u=v.getAttribute(c);if(u){let h=u.array.byteLength;a+=h,e+=h}}for(let c of Object.values(this.sectionObjects)){let u=c.shaderMesh?.geometry;if(u)for(let h of["a_w0","a_w1","a_w2","a_w3"]){let p=u.getAttribute(h);if(p){let g=p.array.byteLength;a+=g,e+=g}}}for(let c of this.meshPool)if(c.inUse&&c.mesh.geometry){let{geometry:u}=c.mesh,h=u.getAttribute("position");if(h){let A=h.array.byteLength;t+=A,e+=A}let p=u.getAttribute("normal");if(p){let A=p.array.byteLength;r+=A,e+=A}let g=u.getAttribute("color");if(g){let A=g.array.byteLength;i+=A,e+=A}let y=u.getAttribute("uv");if(y){let A=y.array.byteLength;s+=A,e+=A}if(u.index){let A=u.index.array.byteLength;o+=A,e+=A}}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:`${(a/(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.globalBlockBuffer?.dispose(),this.globalBlockBuffer=null,this.cubeShaderMaterial?.dispose(),this.cubeShaderMaterial=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.material),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.material);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","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){Re(e,!0)}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),a={x:i/16,y:s/16,z:o/16},v=a.x-e.x,l=a.z-e.z,c=Math.floor(Math.hypot(v,l));r.visible=c<=this.performanceOverrideDistance}}};d(bt,"NEAR_REVEAL_TIMEOUT_MS",5e3),d(bt,"EXPECTED_NEAR_GRACE_MS",1500);var Y5=bt,$i=class{constructor(e){this.worldRendererThree=e;d(this,"chunkTextures",new Map)}dispose(){for(let[,e]of this.chunkTextures)for(let t of Object.keys(e))e[t].dispose();this.chunkTextures.clear()}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 a=JSON.parse(z.from(s,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:v}=this.worldRendererThree.worldRendererConfig;v&&(a=a?.replace("http://textures.minecraft.net/",v).replace("https://textures.minecraft.net/",v));let l=D0(this.worldRendererThree,a,F0.head),c=new X.Group;return r&&l.position.set(0,.3125,.3125),l.position.y-=23/16,c.add(l),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=this.getSignTexture(e,s,i);if(!o)return;let a=new X.Mesh(new X.PlaneGeometry(1,1),new X.MeshBasicMaterial({map:o,transparent:!0}));a.renderOrder=999;let v=7/16,l=i?1.3:1;a.scale.set(1*l,v*l,1*l);let c=(i?2:1.5)/16,u=.25/16;r&&!i?a.position.set(0,0,-.5+c+u+1e-4):a.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(a);let p=(i?10:8)/16,g=(i?0:r?4.333:9.333)/16,y=p/2+g;return this.worldRendererThree.sceneOrigin.track(h),h.position.set(e.x+.5,e.y+y,e.z+.5),h}getSignTexture(e,t,r,i=!1){let s=Ht(e),o=this.chunkTextures.get(`${s[0]},${s[1]}`);o||(o={},this.chunkTextures.set(`${s[0]},${s[1]}`,o));let a=`${e.x},${e.y},${e.z}`;if(o[a])return o[a];let v=Yv(this.worldRendererThree.version),l=m1(t,r,v);if(!l)return;let c=new X.Texture(l);return c.magFilter=X.NearestFilter,c.minFilter=X.NearestFilter,c.needsUpdate=!0,o[a]=c,c}cleanChunkTextures(e,t){let r=`${Math.floor(e/16)},${Math.floor(t/16)}`,i=this.chunkTextures.get(r);if(i)for(let s of Object.keys(i))i[s].dispose(),delete i[s]}};E();x();k();R();E();x();k();R();import*as U0 from"three";var vr={},Ea=!1;function Qv(){if(Ea)return;let n=globalThis.loadedData?.tints;if(n){for(let e of Object.keys(n))vr[e]=Kv(n[e]);Ea=!0}}function Kv(n){let e={},t=xa(n.default??16777215);if(n.data)for(let r of n.data){let i=xa(r.color);for(let s of r.keys)e[s]=i}return new Proxy(e,{get(r,i){return r[i]??t}})}function xa(n){return[(n>>16&255)/255,(n>>8&255)/255,(n&255)/255]}function Ra(n,e){return Qv(),n==="grass_block"?[1,1,1]:n==="redstone_wire"?[1,1,1]:n==="birch_leaves"||n==="spruce_leaves"||n==="lily_pad"?vr.constant?.[n]??[1,1,1]:n.includes("leaves")||n==="vine"?vr.foliage?.[e]??[1,1,1]:["short_grass","tall_grass","fern","large_fern","sugar_cane","grass"].includes(n)?vr.grass?.[e]??[1,1,1]:[1,1,1]}var Jv=512,en=1/20,tn=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>=en;)this.tickAccumulator-=en,this.tickPhysics();let t=this.tickAccumulator/en;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 a=this.resolveBlockTexture(i);if(!a)return;let v=Ra(i,o);for(let l=0;l<4;l++)for(let c=0;c<4;c++)for(let u=0;u<4;u++){let h=e+(l+.5)/4,p=t+(c+.5)/4,g=r+(u+.5)/4,y=h-e-.5,A=p-t-.5,b=g-r-.5;y+=(Math.random()*2-1)*.4,A+=(Math.random()*2-1)*.4,b+=(Math.random()*2-1)*.4;let w=(Math.random()+Math.random()+1)*.15,S=Math.sqrt(y*y+A*A+b*b),C=y/S*w*.4,M=A/S*w*.4+.1,I=b/S*w*.4,B=Math.floor(4/(Math.random()*.9+.1));this.createParticle(h,p,g,C,M,I,B,a,s,e,r,1,v)}}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,a="plains"){if(!this.enabled)return;let v=this.resolveBlockTexture(s);if(!v)return;let l=Ra(s,a),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,g=(Math.random()*2-1)*.4*.2+.1*.2,y=(Math.random()*2-1)*.4*.2,A=Math.floor(4/(Math.random()*.9+.1));this.createParticle(c,u,h,p,g,y,A,v,o,e,r,.6,l)}createParticle(e,t,r,i,s,o,a,v,l,c,u,h=1,p=[1,1,1]){this.ensureMaterial();let g=this.findInactiveParticle();g||(this.particles.length<Jv?g=this.allocateParticle():g=this.recycleOldest());let y=Math.floor(Math.random()*4),A=Math.floor(Math.random()*4),b=v.u+y/4*v.su,w=v.v+A/4*v.sv,S=v.su/4,C=v.sv/4;this.setGeometryUVs(g.mesh.geometry,b,w,S,C),g.active=!0,g.x=e,g.y=t,g.z=r,g.prevX=e,g.prevY=t,g.prevZ=r,g.xd=i,g.yd=s,g.zd=o,g.age=0,g.maxAge=a,g.onGround=!1,g.floorMap=l,g.blockX=Math.floor(c),g.blockZ=Math.floor(u);let M=.1*(.5+Math.random()*.5)*2*h;g.mesh.scale.set(M,M,M),g.mesh.position.set(e,t,r),g.mesh.visible=!0;let I=.6*p[0],B=.6*p[1],H=.6*p[2],G=new Float32Array([I,B,H,I,B,H,I,B,H,I,B,H]),O=g.mesh.geometry.getAttribute("color");O?(O.set(G),O.needsUpdate=!0):g.mesh.geometry.setAttribute("color",new U0.Float32BufferAttribute(G,3)),this.worldRenderer.sceneOrigin.addAndTrack(g.mesh)}allocateParticle(){let e=new U0.PlaneGeometry(1,1),t=new U0.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 U0.MeshBasicMaterial({map:e,vertexColors:!0,transparent:!0,alphaTest:.1}))}},ka={id:"blockBreakParticles",controller:tn,enabledDefault:!0,cannotBeDisabled:!0,requiresHeightmap:!1};E();x();k();R();var rn=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()}},Ta={id:"cameraBobbing",controller:rn,enabledDefault:!0,cannotBeDisabled:!0};E();x();k();R();import*as Pe from"three";var nn=2e3,Ma=32,Sa=32,lr=12,Ca=24,cr=1.2,Zv=-5;var sn=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 Pe.Matrix4);d(this,"tempPosition",new Pe.Vector3);d(this,"tempQuaternion",new Pe.Quaternion);d(this,"tempScale",new Pe.Vector3);d(this,"render",e=>{if(!this.enabled||!this.instancedMesh||!this.material)return;this.syncMaterialToSceneFog();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:a}=this,v=NaN,l=NaN,c;for(let u=0;u<nn;u++){let h=this.particles[u];this.instancedMesh.getMatrixAt(u,i),i.decompose(s,o,a),s.addScaledVector(h.velocity,e);let p=s.y,g=Math.sqrt(s.x*s.x+s.z*s.z),y=t.x+s.x,A=t.y+s.y,b=t.z+s.z,w=Math.floor(y/16),S=Math.floor(b/16);(w!==v||S!==l)&&(c=r[`${w},${S}`],v=w,l=S);let C=(Math.floor(y)%16+16)%16,M=(Math.floor(b)%16+16)%16,I=c?.[M*16+C];if(g>Ma||I!==void 0&&I!==-32768&&A<=I+1+h.despawnOffset||p<Zv){this.respawnParticle(s);let H=lr+Math.random()*(Ca-lr);h.velocity.set((Math.random()-.5)*cr,-H,(Math.random()-.5)*cr),h.despawnOffset=Math.random()*.5}i.compose(s,o,a),this.instancedMesh.setMatrixAt(u,i)}this.instancedMesh.instanceMatrix.needsUpdate=!0})}enable(){this.enabled||(this.enabled=!0,this.instancedMesh?this.instancedMesh.visible=!0:this.createRain())}disable(){this.enabled&&(this.enabled=!1,this.instancedMesh&&(this.instancedMesh.visible=!1))}autoEnableCheck(){return this.worldRenderer.worldRendererConfig.isRaining===!0}dispose(){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=[]}syncMaterialToSceneFog(){if(!this.material)return;let e=this.worldRenderer.scene.fog;e instanceof Pe.Fog||e instanceof Pe.FogExp2?this.material.color.copy(e.color):this.material.color.set(13426158),this.material.fog=!0}createRain(){this.geometry=new Pe.BoxGeometry(.03,.3,.03),this.material=new Pe.MeshBasicMaterial({color:13426158,transparent:!0,opacity:.35,depthWrite:!0,fog:!0}),this.instancedMesh=new Pe.InstancedMesh(this.geometry,this.material,nn),this.instancedMesh.name="rain-particles",this.instancedMesh.frustumCulled=!1,this.syncMaterialToSceneFog();let e=new Pe.Matrix4,t=new Pe.Vector3;for(let r=0;r<nn;r++){this.respawnParticle(t),t.y=Math.random()*Sa,e.setPosition(t),this.instancedMesh.setMatrixAt(r,e);let i=lr+Math.random()*(Ca-lr);this.particles.push({velocity:new Pe.Vector3((Math.random()-.5)*cr,-i,(Math.random()-.5)*cr),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()*Ma;e.set(Math.cos(t)*r,Sa,Math.sin(t)*r)}},Ba={id:"rain",controller:sn,enabledDefault:!1,requiresHeightmap:!0};E();x();k();R();import*as ye from"three";var Pa=new ye.Color(13/255,234/255,238/255),qv=9;var Xv=350,$v=650;var e9=120,t9=280,on=class{constructor(e){this.worldRenderer=e;d(this,"pendingGeometries",new Map);d(this,"revealingSections",new Map);d(this,"finishedChunkCount",0);d(this,"revealTriggered",!1);d(this,"revealStartTime",0);d(this,"enabled",!1);d(this,"onWorldSwitchedCb",null);d(this,"patched",!1);d(this,"initialWaveDone",!1);d(this,"initialRevealWaveSettled",!1);d(this,"wireframeMaterial");d(this,"wireframeGlowMaterial");d(this,"pulseTime",0);d(this,"revealedChunks",new Set);d(this,"originalFinishChunk",null);d(this,"originalDestroy",null);d(this,"originalSceneAdd",null);d(this,"originalHandleWorkerMessage",null);d(this,"render",e=>{this.enabled&&this.update(e*1e3)});this.wireframeMaterial=new ye.LineBasicMaterial({color:Pa,transparent:!0,opacity:1,blending:ye.AdditiveBlending,depthWrite:!1}),this.wireframeGlowMaterial=new ye.LineBasicMaterial({color:Pa,transparent:!0,opacity:.55,blending:ye.AdditiveBlending,depthWrite:!1})}isFuturisticRevealConfigured(){return this.worldRenderer.worldRendererConfig.futuristicReveal===!0}isInInitialRevealCampaign(){return this.enabled&&!this.initialRevealWaveSettled}autoEnableCheck(){return this.isFuturisticRevealConfigured()}enable(){if(this.isFuturisticRevealConfigured()&&!(this.enabled&&this.patched)){if(this.enabled&&!this.patched){this.patchWorldRenderer();return}this.enabled=!0,this.patchWorldRenderer()}}disable(){this.enabled&&(this.enabled=!1,this.unpatchWorldRenderer(),this.reset())}toggle(){return this.enabled?this.disable():this.enable(),this.enabled}dispose(){this.disable(),this.wireframeMaterial.dispose(),this.wireframeGlowMaterial.dispose()}patchWorldRenderer(){if(this.patched)return;this.patched=!0;let e=this.worldRenderer;this.onWorldSwitchedCb=()=>this.reset(),e.onWorldSwitched.push(this.onWorldSwitchedCb),this.originalFinishChunk=e.finishChunk.bind(e),e.finishChunk=t=>{this.originalFinishChunk(t),this.onChunkFinished(t)},this.originalDestroy=e.destroy.bind(e),e.destroy=()=>{this.dispose(),this.originalDestroy()},this.originalHandleWorkerMessage=e.handleWorkerMessage.bind(e),e.handleWorkerMessage=t=>{this.originalHandleWorkerMessage(t),this.enabled&&t?.type==="geometry"&&Promise.resolve().then(()=>{try{this.registerSection(t.key,t.geometry)}catch{}})},this.originalSceneAdd=e.scene.add.bind(e.scene),e.scene.add=(...t)=>{let r=this.originalSceneAdd(...t);for(let i of t)this.checkAndPatchMesh(i);return r}}unpatchWorldRenderer(){let e=this.worldRenderer;if(this.originalFinishChunk&&(e.finishChunk=this.originalFinishChunk,this.originalFinishChunk=null),this.originalDestroy&&(e.destroy=this.originalDestroy,this.originalDestroy=null),this.originalHandleWorkerMessage&&(e.handleWorkerMessage=this.originalHandleWorkerMessage,this.originalHandleWorkerMessage=null),this.originalSceneAdd&&(e.scene.add=this.originalSceneAdd,this.originalSceneAdd=null),this.onWorldSwitchedCb){let t=e.onWorldSwitched.indexOf(this.onWorldSwitchedCb);t!==-1&&e.onWorldSwitched.splice(t,1),this.onWorldSwitchedCb=null}this.patched=!1}checkAndPatchMesh(e){if(e instanceof ye.Mesh&&(e.name==="mesh"||e.name==="shaderMesh")){let t=this.findSectionKeyForMesh(e);t&&this.shouldUseRevealEffect(t)&&(e.visible=!1,e.hiddenByReveal=!0)}for(let t of e.children)this.checkAndPatchMesh(t)}findSectionKeyForMesh(e){let t=e;for(;t;){let{sectionKey:p}=t;if(p&&this.worldRenderer.chunkMeshManager.sectionObjects[p]===t)return p;t=t.parent}let r=this.worldRenderer.sceneOrigin.getWorldPosition(e),i=r?.x??this.worldRenderer.sceneOrigin.toWorldX(e.position.x),s=r?.y??this.worldRenderer.sceneOrigin.toWorldY(e.position.y),o=r?.z??this.worldRenderer.sceneOrigin.toWorldZ(e.position.z),a=16,v=this.worldRenderer.getSectionHeight(),l=Math.floor(i/a)*a,c=Math.floor(s/v)*v,u=Math.floor(o/a)*a,h=`${l},${c},${u}`;return this.worldRenderer.chunkMeshManager.sectionObjects[h]?h:null}get scene(){return this.worldRenderer.realScene}getCameraPosition(){return this.worldRenderer.getCameraPosition()}sectionHasRevealContent(e){return(e.wireframePositions?.length??0)>0||(e.positions?.length??0)>0?!0:(e.shaderCubes?.count??0)>0}getSectionRenderMeshes(e){let t=this.worldRenderer.chunkMeshManager.sectionObjects[e];if(!t)return[];let r=[];for(let i of["mesh","shaderMesh"]){let s=t.children.find(o=>o.name===i);s instanceof ye.Mesh&&r.push(s)}return r}hideSectionRenderMeshes(e){let t=this.getSectionRenderMeshes(e);for(let r of t)r.visible=!1,r.hiddenByReveal=!0;return t}setMeshFadeOpacity(e,t){if(e.name==="shaderMesh"){e.visible=t>.001;return}let r=e.material;if(!Array.isArray(r))if(r.originalMaterial)r.opacity=t,r.transparent=!0,r.needsUpdate=!0;else{r.originalMaterial=r;let i=r.clone();i.transparent=!0,i.opacity=t,i.needsUpdate=!0,e.material=i}}restoreMeshMaterial(e){let t=e.originalMaterial;if(!t)return;let r=e.material;e.material=t,r!==t&&r.dispose(),delete e.originalMaterial}onChunkFinished(e){this.finishedChunkCount++,!this.revealTriggered&&this.finishedChunkCount>=qv&&this.triggerReveal()}registerSection(e,t){if(!(this.revealedChunks.has(e)||this.revealingSections.has(e))){if(this.revealTriggered&&this.initialWaveDone){this.revealedChunks.add(e);return}this.revealTriggered?this.startSectionReveal(e,t):this.pendingGeometries.set(e,t)}}shouldUseRevealEffect(e){return!this.enabled||this.revealTriggered&&this.initialWaveDone?!1:!this.revealedChunks.has(e)&&!this.revealingSections.has(e)}triggerReveal(){this.revealTriggered=!0,this.initialWaveDone=!0,this.revealStartTime=performance.now();let e=this.getCameraPosition(),t=[...this.pendingGeometries.entries()];this.pendingGeometries.clear();let r=t.map(([s,o])=>{let a=Math.hypot(o.sx-e.x,o.sy-e.y,o.sz-e.z);return{key:s,geometry:o,distance:a}}).sort((s,o)=>s.distance-o.distance),i=r.at(-1)?.distance||1;for(let{key:s,geometry:o,distance:a}of r){let v=a/i*1500;setTimeout(()=>{!this.revealedChunks.has(s)&&!this.revealingSections.has(s)&&this.startSectionReveal(s,o)},v)}}startSectionReveal(e,t){if(!this.sectionHasRevealContent(t)||this.revealingSections.has(e)||this.revealedChunks.has(e))return;let r=this.createWireframeGeometry(t),i=this.worldRenderer.chunkMeshManager.globalBlockBuffer,s=i?.hasSection(e)?i.takeSectionData(e):void 0,o=this.hideSectionRenderMeshes(e),a=new ye.LineSegments(r,this.wireframeMaterial.clone());this.worldRenderer.sceneOrigin.track(a),a.position.set(t.sx,t.sy,t.sz),a.name="scifi-wireframe",a.renderOrder=1e3;let v=new ye.LineSegments(r.clone(),this.wireframeGlowMaterial.clone());this.worldRenderer.sceneOrigin.track(v),v.position.set(t.sx,t.sy,t.sz),v.scale.set(1.02,1.02,1.02),v.name="scifi-glow",v.renderOrder=999;let l=new ye.Group;l.add(a),l.add(v),l.name="scifi-reveal-group",l.sectionKey=e,this.scene.add(l);let c=this.initialWaveDone?e9:Xv,u=this.initialWaveDone?t9:$v,h={key:e,wireframeGroup:l,revealStartTime:performance.now(),phase:"wireframe",renderMeshRefs:o,globalShaderRestore:s,wireframeMs:c,revealMs:u};setTimeout(()=>{for(let p of this.getSectionRenderMeshes(e))p.hiddenByReveal||this.hideSectionRenderMeshes(e)},0),this.revealingSections.set(e,h)}createSectionBoundsWireframe(){let r=[[-8,-8,-8],[8,-8,-8],[-8,8,-8],[8,8,-8],[-8,-8,8],[8,-8,8],[-8,8,8],[8,8,8]],i=[[0,1],[1,3],[3,2],[2,0],[4,5],[5,7],[7,6],[6,4],[0,4],[1,5],[2,6],[3,7]],s=[];for(let[a,v]of i)s.push(...r[a],...r[v]);let o=new ye.BufferGeometry;return o.setAttribute("position",new ye.Float32BufferAttribute(s,3)),o}createWireframeGeometry(e){if(e.wireframePositions&&e.wireframePositions.length>0){let a=new ye.BufferGeometry;return a.setAttribute("position",new ye.Float32BufferAttribute(e.wireframePositions,3)),a}let t=e.positions,r=e.indices;if(!t?.length||!r?.length)return this.createSectionBoundsWireframe();let i=[],s=new Set;for(let a=0;a<r.length;a+=3){let v=r[a],l=r[a+1],c=r[a+2];this.addEdge(t,v,l,i,s),this.addEdge(t,l,c,i,s),this.addEdge(t,c,v,i,s)}let o=new ye.BufferGeometry;return o.setAttribute("position",new ye.Float32BufferAttribute(i,3)),o}addEdge(e,t,r,i,s){let o=Math.min(t,r),a=Math.max(t,r),v=`${o}-${a}`;s.has(v)||(s.add(v),i.push(e[t*3],e[t*3+1],e[t*3+2],e[r*3],e[r*3+1],e[r*3+2]))}update(e){if(!this.enabled||this.revealingSections.size===0)return;this.pulseTime+=e*.001;let t=performance.now(),r=.6+.4*Math.sin(this.pulseTime*4),i=[];for(let[s,o]of this.revealingSections){let a=t-o.revealStartTime;if(o.phase==="wireframe"){let v=o.wireframeGroup.children[0],l=o.wireframeGroup.children[1];if(v?.material){let c=v.material;c.opacity=r;let u=.85+.15*Math.sin(this.pulseTime*6+a*.002);c.color.setRGB(13/255*u,234/255*u,238/255*u)}if(l?.material){let c=l.material;c.opacity=r*.4}if(a>o.wireframeMs){o.phase="transitioning",o.renderMeshRefs=this.getSectionRenderMeshes(s);for(let c of o.renderMeshRefs)c.visible=!0,this.setMeshFadeOpacity(c,0)}}else if(o.phase==="transitioning"){let v=a-o.wireframeMs,l=Math.min(1,v/o.revealMs),c=1-(1-l)**3,u=o.wireframeGroup.children[0],h=o.wireframeGroup.children[1];if(u?.material){let p=u.material;p.opacity=1-c}if(h?.material){let p=h.material;p.opacity=(1-c)*.55}for(let p of o.renderMeshRefs)this.setMeshFadeOpacity(p,c);l>=1&&(o.phase="complete",i.push(o))}}for(let s of i)this.completeReveal(s)}completeReveal(e){this.revealingSections.delete(e.key),this.revealedChunks.add(e.key),this.revealTriggered&&this.revealingSections.size===0&&(this.initialRevealWaveSettled=!0);for(let t of e.renderMeshRefs)this.restoreMeshMaterial(t),t.visible=!0,delete t.hiddenByReveal;this.worldRenderer.chunkMeshManager.migrateDeferredShaderToGlobal(e.key),e.globalShaderRestore&&this.worldRenderer.chunkMeshManager.globalBlockBuffer?.addSection(e.key,e.globalShaderRestore.words,e.globalShaderRestore.count),this.disposeWireframeGroup(e.wireframeGroup)}disposeWireframeGroup(e){this.worldRenderer.sceneOrigin.removeAndUntrackAll(e);let t=[];e.traverse(r=>{t.push(r)});for(let r of t){let i=r;if(i.geometry&&i.geometry.dispose(),i.material){let s=i.material;if(Array.isArray(s))for(let o of s)o.dispose();else s&&typeof s.dispose=="function"&&s.dispose()}}e.clear()}reset(){for(let e of this.revealingSections.values())this.disposeWireframeGroup(e.wireframeGroup);this.pendingGeometries.clear(),this.revealingSections.clear(),this.revealedChunks.clear(),this.finishedChunkCount=0,this.revealTriggered=!1,this.initialWaveDone=!1,this.initialRevealWaveSettled=!1,this.revealStartTime=0,this.pulseTime=0}forceCompleteAll(){let e=[...this.revealingSections.values()];for(let t of e){t.renderMeshRefs=this.getSectionRenderMeshes(t.key);for(let r of t.renderMeshRefs)this.restoreMeshMaterial(r),r.visible=!0,delete r.hiddenByReveal;this.completeReveal(t)}}debugGetWireframeGroups(){let e=[];return this.scene.traverse(t=>{t.name==="scifi-reveal-group"&&e.push(t)}),e}debugForceCleanup(){let e=this.debugGetWireframeGroups();for(let t of e)this.disposeWireframeGroup(t);for(let t of this.revealingSections.values())this.disposeWireframeGroup(t.wireframeGroup);this.revealingSections.clear()}debugStatus(){let e=this.debugGetWireframeGroups(),t=new Set(this.revealingSections.keys()),r=e.filter(i=>!t.has(i.sectionKey));return{revealTriggered:this.revealTriggered,finishedChunkCount:this.finishedChunkCount,pendingGeometries:this.pendingGeometries.size,revealingSections:this.revealingSections.size,revealedChunks:this.revealedChunks.size,wireframeGroupsInScene:e.length,orphanedWireframeGroups:r.length,orphanedKeys:r.map(i=>i.sectionKey),sections:[...this.revealingSections.entries()].map(([i,s])=>({key:i,phase:s.phase,renderMeshCount:s.renderMeshRefs.length,wireframeInScene:s.wireframeGroup.parent!==null}))}}debugLog(){}},Ia={id:"futuristicReveal",controller:on,enabledDefault:!0};E();x();k();R();import*as Te from"three";var r9=parseInt(Te.REVISION.replaceAll(/\D+/g,""),10),an=class extends Te.ShaderMaterial{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:`
21511
+ `,et={textureSize:128,gravity:new re.Vector3(0,-.005,0),friction:.998,defaultParticleSize:300,maxActiveFireworks:5},er=n=>{let t=n*3;return{x:t,y:t+1,z:t+2}},tr=n=>{let t=n*4;return{r:t,g:t+1,b:t+2,a:t+3}},S0=(n=0,e=0)=>Math.floor(Math.random()*(n+1-e))+e,kl=(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()},Tl=()=>{let n=et.textureSize,e=qe(n,n),t=e.getContext("2d"),r=n/2;kl(t,r,e.width,e.height);let i=new re.Texture(e);return i.needsUpdate=!0,i},Ml=(n,e,t,r,i=et.defaultParticleSize)=>{let s=new re.BufferGeometry,o=[],v=[],a=[],l=[],c=[],u=Math.random()>.3?"single":"multiple",f=S0(100,20)*.01,m=()=>S0(100,1)*.01,g="red",b=Math.random();b>.66?g="red":b>.33?g="green":g="blue";for(let y=0;y<n;y++){let _=new re.Vector3(0,0,0);if(o.push(_.x,_.y,_.z),v.push(e[y].x,e[y].y,e[y].z),t==="seed"){let M=e[y].y**2*.04;y===0&&(M*=1.1),l.push(M),c.push(M*.017),a.push(1,1,1,1)}else if(t==="trail"){let M=Math.random()*.1+.1;l.push(M),c.push(M*.017),a.push(1,1,1,1)}else{let M=S0(i,10)*.001;if(l.push(M),c.push(M*.017),u==="multiple")a.push(m(),m(),m(),1);else switch(g){case"red":a.push(f,.1,.1,1);break;case"green":a.push(.1,f,.1,1);break;case"blue":a.push(.1,.1,f,1);break}}}s.setAttribute("position",new re.Float32BufferAttribute(o,3)),s.setAttribute("velocity",new re.Float32BufferAttribute(v,3)),s.setAttribute("color",new re.Float32BufferAttribute(a,4)),s.setAttribute("adjustSize",new re.Float32BufferAttribute(l,1)),s.setAttribute("mass",new re.Float32BufferAttribute(c,1));let A=new re.RawShaderMaterial({uniforms:{size:{value:et.textureSize},texture:{value:r}},transparent:!0,depthWrite:!1,blending:re.AdditiveBlending,vertexShader:xl,fragmentShader:Rl});return new re.Points(s,A)},rr=class{constructor(e,t,r,i,s){d(this,"particleNum");d(this,"timerStartFading");d(this,"mesh");this.particleNum=e,this.timerStartFading=10,this.mesh=Ml(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,v=a=>Math.random()>.5?0:(1-a)*.1;for(let a=0;a<this.particleNum;a++){let{x:l,y:c,z:u}=er(a);r.array[c]+=e.y-s.array[a],r.array[l]*=et.friction,r.array[u]*=et.friction,r.array[c]*=et.friction,t.array[l]+=r.array[l],t.array[c]+=r.array[c],t.array[u]+=r.array[u];let{a:f}=tr(a);this.timerStartFading<=0&&(i.array[f]*=o()-v(i.array[f]),i.array[f]<.001&&(i.array[f]=0))}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}disposeAll(){this.mesh.geometry.dispose(),this.mesh.material.dispose()}},p1=class extends rr{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,v=u=>Math.random()>.3?0:(1-u)*.1,a=()=>Math.random()>.5?.05:-.05,l=()=>Math.random()>.1,c=et.friction*.98;for(let u=0;u<this.particleNum;u++){let{x:f,y:m,z:g}=er(u);r.array[m]+=e.y-s.array[u],r.array[f]*=c,r.array[g]*=c,r.array[m]*=c,t.array[f]+=r.array[f],t.array[m]+=r.array[m],t.array[g]+=r.array[g],l()&&(t.array[f]+=a()),l()&&(t.array[g]+=a());let{a:b}=tr(u);i.array[b]*=o()-v(i.array[b]),i.array[b]<.001&&(i.array[b]=0)}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},g1=class extends rr{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,v=()=>Math.random()>.5?.05:-.05,a=()=>Math.random()>.2;for(let l=0;l<this.particleNum;l++){let{x:c,y:u,z:f}=er(l);r.array[u]+=e.y-s.array[l],r.array[c]*=et.friction,r.array[f]*=et.friction,r.array[u]*=et.friction,t.array[c]+=r.array[c],t.array[u]+=r.array[u],t.array[f]+=r.array[f],a()&&(t.array[c]+=v()),a()&&(t.array[f]+=v());let{a:m}=tr(l);i.array[m]*=o(),i.array[m]<.001&&(i.array[m]=0)}t.needsUpdate=!0,r.needsUpdate=!0,i.needsUpdate=!0}},ir=class{constructor(e,t=et.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 re.Group,this.isExplode=!1,this.texture=e,this.particleSize=t;let i=400,s=150;this.petalsNum=S0(i,s),this.life=150,this.seed=this.getSeed(r),this.meshGroup.add(this.seed.mesh),this.flowerSizeRate=re.MathUtils.mapLinear(this.petalsNum,s,i,.4,.7)}getSeed(e){let r=[];for(let s=0;s<40;s++){let v=s===0?Math.random()*2.5+.9:Math.random()*2+.4,a=0;r.push(new re.Vector3(0,v,a))}let i=new p1(40,r,this.texture);if(e)i.mesh.position.set(0,0,0);else{let s=Math.random()*80-40,o=-50,v=Math.random()*80-40;i.mesh.position.set(s,o,v)}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 v=0;v<t;v++){i=S0(120,60)*.01;let a=re.MathUtils.degToRad(Math.random()*180),l=re.MathUtils.degToRad(Math.random()*360),c=Math.sin(a)*Math.cos(l)*i,u=Math.sin(a)*Math.sin(l)*i,f=Math.cos(a)*i,m=new re.Vector3(c,u,f);m.multiplyScalar(this.flowerSizeRate),r.push(m)}else{let v=180/t,a=360*(Math.random()*20+1)/t,l=a,c=a;i=S0(120,60)*.01;for(let u=0;u<t;u++){let f=Math.sin(re.MathUtils.degToRad(v*u)),m=Math.cos(re.MathUtils.degToRad(v*u))*i,g=Math.cos(re.MathUtils.degToRad(l*u))*f*i,b=Math.sin(re.MathUtils.degToRad(c*u))*f*i,A=new re.Vector3(g,b,m);A.multiplyScalar(this.flowerSizeRate),r.push(A)}}let o=new rr(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(et.gravity);let e=this.seed.mesh.geometry.attributes.position,t=this.seed.mesh.geometry.attributes.velocity,r=0;for(let u=0,f=t.array.length;u<f;u++){let m=t.array[u];u%3===1&&m>0&&r++}if(!(r===0))return;let{x:s,y:o,z:v}=this.seed.mesh.position,a=new re.Vector3(s,o,v),l=0,c;for(let u=0,f=e.array.length;u<f;u++){let m=e.array[u];u%3===1&&m>l&&(l=m,c=new re.Vector3(e.array[u-1],m,e.array[u+2]))}c&&(a.add(c),this.explode(a))}},s5=class extends ir{constructor(t,r=et.defaultParticleSize,i){super(t,r,i);d(this,"tailMeshGroup");d(this,"tails");let s=150,o=100;this.petalsNum=S0(s,o),this.flowerSizeRate=re.MathUtils.mapLinear(this.petalsNum,o,s,.4,.7),this.tailMeshGroup=new re.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 T=0;T<20;T++)o.push(new re.Vector3(0,0,0));let v=new g1(20,o,this.texture),{r:a,g:l,b:c,a:u}=tr(s),f=i.array[a],m=i.array[l],g=i.array[c],b=i.array[u],A=v.mesh.geometry.attributes.position,y=v.mesh.geometry.attributes.color;for(let T=0;T<A.count;T++){let P=tr(T);y.array[P.r]=f,y.array[P.g]=m,y.array[P.b]=g,y.array[P.a]=b}let{x:_,y:M,z:C}=this.flower.mesh.position;v.mesh.position.set(_,M,C),t.push(v),this.tailMeshGroup.add(v.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:v,y:a,z:l}=er(i),c=new re.Vector3(r.array[v],r.array[a],r.array[l]),u=o.mesh.geometry.attributes.position,f=o.mesh.geometry.attributes.velocity;for(let m=0;m<u.count;m++){let g=er(m),b=new re.Vector3,A=new re.Vector3(u.array[g.x],u.array[g.y],u.array[g.z]),y=new re.Vector3(f.array[g.x],f.array[g.y],f.array[g.z]);b.subVectors(c,A);let _=b.sub(y);_.normalize(),_.multiplyScalar(Math.random()*3e-4*this.life),f.array[g.x]+=_.x,f.array[g.y]+=_.y,f.array[g.z]+=_.z}f.needsUpdate=!0}this.life>0&&(this.life-=1.2)}else this.drawTail()}},fi=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=Tl(),this.particleSize=r?.defaultParticleSize??et.defaultParticleSize,this.maxFireworks=r?.maxActiveFireworks??et.maxActiveFireworks}launchFirework(e){if(this.fireworksInstances.length>=this.maxFireworks)return;let t=e?.particleSize??this.particleSize,r=e?.position,i;e?.forceRich?i=new s5(this.texture,t,r):e?.forceBasic?i=new ir(this.texture,t,r):i=Math.random()>.5?new ir(this.texture,t,r):new s5(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(et.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 s5&&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 s5)for(let t of e.tails)t.disposeAll();this.fireworksInstances=[]}dispose(){this.clear(),this.texture.dispose()}};E();x();k();R();var z3=Symbol("tracked-proxy"),Sl=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"]),hi=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,v=new Proxy(r,{get(a,l,c){if(l===z3)return i;if(l==="set")return(f,m,g)=>(i.x=f,i.y=m,i.z=g,a.set(f-s._x,m-s._y,g-s._z),o?.updateMatrix&&e.updateMatrix(),c);if(l==="copy")return f=>{let m=f[z3],g=m?m.x:f.x,b=m?m.y:f.y,A=m?m.z:f.z;return i.x=g,i.y=b,i.z=A,a.set(g-s._x,b-s._y,A-s._z),o?.updateMatrix&&e.updateMatrix(),c};if(l==="setX")return f=>(i.x=f,a.x=f-s._x,o?.updateMatrix&&e.updateMatrix(),c);if(l==="setY")return f=>(i.y=f,a.y=f-s._y,o?.updateMatrix&&e.updateMatrix(),c);if(l==="setZ")return f=>(i.z=f,a.z=f-s._z,o?.updateMatrix&&e.updateMatrix(),c);if(typeof l=="string"&&Sl.has(l))return()=>{throw new Error(`Cannot call position.${l}() on a tracked object. Use position.set(x, y, z) instead.`)};let u=a[l];return typeof u=="function"?u.bind(a):u},set(a,l,c){return l==="x"?(i.x=c,a.x=c-s._x,o?.updateMatrix&&e.updateMatrix(),!0):l==="y"?(i.y=c,a.y=c-s._y,o?.updateMatrix&&e.updateMatrix(),!0):l==="z"?(i.z=c,a.z=c-s._z,o?.updateMatrix&&e.updateMatrix(),!0):(a[l]=c,!0)}});Object.defineProperty(e,"position",{value:v,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}};x1();E();x();k();R();a5();Zt();import a9 from"prismarine-chat";import*as X from"three";import*as Hi from"prismarine-nbt";import{Vec3 as D1}from"vec3";E();x();k();R();gi();import*as Fe from"three";function C0(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 Gl=`
21512
+ precision highp float;
21513
+
21514
+ uniform vec3 u_originDelta;
21515
+ uniform vec3 u_cameraOriginFrac;
21516
+
21517
+ in float a_skyLight;
21518
+ in float a_blockLight;
21519
+
21520
+ // position, uv, color: declared by Three.js shader chunks (vertexColors \u2192 USE_COLOR).
21521
+ out vec3 vColor;
21522
+ out vec2 v_uv;
21523
+ out float v_skyLight;
21524
+ out float v_blockLight;
21525
+
21526
+ #ifdef USE_LOGARITHMIC_DEPTH_BUFFER
21527
+ out float vFragDepth;
21528
+ #endif
21529
+
21530
+ #ifdef USE_FOG
21531
+ out float vFogDepth;
21532
+ #endif
21533
+
21534
+ void main() {
21535
+ vec3 relativePos = modelMatrix[3].xyz + u_originDelta + position - u_cameraOriginFrac;
21536
+ vec4 mvPosition = viewMatrix * vec4(relativePos, 1.0);
21537
+ gl_Position = projectionMatrix * mvPosition;
21538
+
21539
+ vColor = color;
21540
+ v_uv = uv;
21541
+ v_skyLight = a_skyLight;
21542
+ v_blockLight = a_blockLight;
21543
+
21544
+ #ifdef USE_LOGARITHMIC_DEPTH_BUFFER
21545
+ vFragDepth = 1.0 + gl_Position.w;
21546
+ #endif
21547
+
21548
+ #ifdef USE_FOG
21549
+ vFogDepth = -mvPosition.z;
21550
+ #endif
21551
+ }
21552
+ `,R1=`
21553
+ precision highp float;
21554
+
21555
+ uniform sampler2D u_atlas;
21556
+ uniform float u_skyLevel;
21557
+ uniform float u_lightCurve;
21558
+ uniform float u_minBrightness;
21559
+ uniform float u_lightGamma;
21560
+
21561
+ in vec3 vColor;
21562
+ in vec2 v_uv;
21563
+ in float v_skyLight;
21564
+ in float v_blockLight;
21565
+
21566
+ #ifdef USE_LOGARITHMIC_DEPTH_BUFFER
21567
+ uniform float logDepthBufFC;
21568
+ in float vFragDepth;
21569
+ #endif
21570
+
21571
+ #ifdef USE_FOG
21572
+ uniform vec3 fogColor;
21573
+ in float vFogDepth;
21574
+ #ifdef FOG_EXP2
21575
+ uniform float fogDensity;
21576
+ #else
21577
+ uniform float fogNear;
21578
+ uniform float fogFar;
21579
+ #endif
21580
+ #endif
21581
+
21582
+ out vec4 FragColor;
21583
+
21584
+ void writeLogDepth() {
21585
+ #ifdef USE_LOGARITHMIC_DEPTH_BUFFER
21586
+ gl_FragDepth = log2(vFragDepth) * logDepthBufFC * 0.5;
21587
+ #endif
21588
+ }
21589
+
21590
+ void applyFog() {
21591
+ #ifdef USE_FOG
21592
+ #ifdef FOG_EXP2
21593
+ float fogFactor = 1.0 - exp(-fogDensity * fogDensity * vFogDepth * vFogDepth);
21594
+ #else
21595
+ float fogFactor = smoothstep(fogNear, fogFar, vFogDepth);
21596
+ #endif
21597
+ FragColor.rgb = mix(FragColor.rgb, fogColor, fogFactor);
21598
+ #endif
21599
+ }
21600
+
21601
+ ${pi}
21602
+
21603
+ void main() {
21604
+ vec4 texColor = texture(u_atlas, v_uv);
21605
+ float L = max(v_blockLight, min(v_skyLight, u_skyLevel));
21606
+ float Lm = applyLightmap(L);
21607
+ vec3 rgb = texColor.rgb * vColor * Lm;
21608
+ float alpha = texColor.a;
21609
+
21610
+ if (alpha < 0.1) {
21611
+ discard;
21612
+ }
21613
+
21614
+ FragColor = vec4(rgb, alpha);
21615
+ applyFog();
21616
+ writeLogDepth();
21617
+ }
21618
+ `,t6=`
21619
+ precision highp float;
21620
+
21621
+ uniform vec3 u_originDelta;
21622
+ uniform vec3 u_cameraOriginFrac;
21623
+
21624
+ in vec3 a_origin;
21625
+ in float a_skyLight;
21626
+ in float a_blockLight;
21627
+
21628
+ // position, uv, color: declared by Three.js shader chunks (vertexColors \u2192 USE_COLOR).
21629
+ out vec3 vColor;
21630
+ out vec2 v_uv;
21631
+ out float v_skyLight;
21632
+ out float v_blockLight;
21633
+
21634
+ #ifdef USE_LOGARITHMIC_DEPTH_BUFFER
21635
+ out float vFragDepth;
21636
+ #endif
21637
+
21638
+ #ifdef USE_FOG
21639
+ out float vFogDepth;
21640
+ #endif
21641
+
21642
+ void main() {
21643
+ vec3 relativePos = a_origin + u_originDelta + position - u_cameraOriginFrac;
21644
+ vec4 mvPosition = viewMatrix * vec4(relativePos, 1.0);
21645
+ gl_Position = projectionMatrix * mvPosition;
21646
+
21647
+ vColor = color;
21648
+ v_uv = uv;
21649
+ v_skyLight = a_skyLight;
21650
+ v_blockLight = a_blockLight;
21651
+
21652
+ #ifdef USE_LOGARITHMIC_DEPTH_BUFFER
21653
+ vFragDepth = 1.0 + gl_Position.w;
21654
+ #endif
21655
+
21656
+ #ifdef USE_FOG
21657
+ vFogDepth = -mvPosition.z;
21658
+ #endif
21659
+ }
21660
+ `,k1={u_atlas:{value:null},u_originDelta:{value:new Fe.Vector3},u_cameraOriginFrac:{value:new Fe.Vector3},u_skyLevel:{value:1},u_lightCurve:{value:tt.curve},u_minBrightness:{value:tt.minBrightness},u_lightGamma:{value:tt.gamma}};function r6(){return new Fe.ShaderMaterial({vertexShader:Gl,fragmentShader:R1,uniforms:Fe.UniformsUtils.merge([Fe.UniformsLib.fog,k1]),transparent:!0,depthWrite:!0,depthTest:!0,vertexColors:!0,glslVersion:Fe.GLSL3,fog:!0})}function i6(){return new Fe.ShaderMaterial({vertexShader:t6,fragmentShader:R1,uniforms:Fe.UniformsUtils.merge([Fe.UniformsLib.fog,k1]),transparent:!1,depthWrite:!0,depthTest:!0,vertexColors:!0,glslVersion:Fe.GLSL3,fog:!0})}function n6(){return new Fe.ShaderMaterial({vertexShader:t6,fragmentShader:R1,uniforms:Fe.UniformsUtils.merge([Fe.UniformsLib.fog,k1]),transparent:!0,depthWrite:!0,depthTest:!0,vertexColors:!0,glslVersion:Fe.GLSL3,fog:!0})}function ki(n,e,t,r,i){let{originDelta:s,cameraOriginFrac:o}=C0(e,t,r,i),v=n.uniforms.u_originDelta;v?.value?.set&&v.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 Ti(n,e){let t=n.uniforms.u_skyLevel;t&&(t.value=e)}function Mi(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)}}E();x();k();R();var T1=8,Vl=.01;function M1(n,e,t,r,i){n.matrix.makeTranslation(e-i.x,t-i.y,r-i.z),n.matrixWorldNeedsUpdate=!0,n.frustumCulled=!1}function Si(n,e,t,r,i,s,o,v,a,l){let c=n-r,u=e-i,f=t-s,m=T1+Vl;return a.set(c-m,u-m,f-m),l.set(c+m,u+m,f+m),v.set(a,l),{visible:o.intersectsBox(v),distSq:c*c+u*u+f*f}}function s6(n,e,t,r,i,s,o,v,a,l,c){let{visible:u,distSq:f}=Si(e,t,r,i,s,o,v,a,l,c);n.visible=u,n.renderOrder=-f}A1();E();x();k();R();import*as yt from"three";E();x();k();R();E();x();k();R();E();x();k();R();import*as de from"three";var vt=4,Se=6,fe=3,Ct=2,Ye=1,Wl=128e3,Nl=128e3,jl=5e3,I1=.75,L1=256,H1=64,ar=class{constructor(e,t,r){d(this,"mesh");d(this,"material");d(this,"growthIncrementQuads");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,"sectionSlots",new Map);d(this,"freeList",[]);d(this,"highWatermark",0);d(this,"pendingRanges",[]);d(this,"_spanScratch",[]);d(this,"renderOrigin",{x:0,y:0,z:0});this.material=e,this.growthIncrementQuads=r?.growthIncrementQuads??Nl,this.capacityQuads=r?.initialCapacityQuads??Wl;let i=this.capacityQuads*vt;this.positions=new Float32Array(i*fe),this.colors=new Float32Array(i*fe),this.skyLights=new Float32Array(i*Ye),this.blockLights=new Float32Array(i*Ye),this.uvs=new Float32Array(i*Ct),this.aOrigin=new Float32Array(i*fe),this.indices=new Uint32Array(this.capacityQuads*Se);let s=new de.BufferGeometry,o=(a,l,c)=>{let u=new de.BufferAttribute(a,l);return u.setUsage(de.DynamicDrawUsage),s.setAttribute(c,u),u};o(this.positions,fe,"position"),o(this.colors,fe,"color"),o(this.skyLights,Ye,"a_skyLight"),o(this.blockLights,Ye,"a_blockLight"),o(this.uvs,Ct,"uv"),o(this.aOrigin,fe,"a_origin");let v=new de.BufferAttribute(this.indices,1);v.setUsage(de.DynamicDrawUsage),s.setIndex(v),s.setDrawRange(0,0),s.boundingSphere=new de.Sphere(new de.Vector3,1/0),this.mesh=new de.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()}syncDefaultDrawGroups(){let e=this.mesh.geometry;e.clearGroups();let t=this.highWatermark*Se;t>0&&e.addGroup(0,t,0),e.setDrawRange(0,t)}addSection(e,t,r,i,s){let o=t.positions.length/fe,v=o/vt;if(o===0||v*vt!==o)return this.removeSection(e),!1;if(t.indices.length%Se!==0||t.indices.length/Se!==v)return!1;this.sectionSlots.has(e)&&this.removeSection(e),v>this.capacityQuads&&this.growCapacity(v);let a=this.takeFreeSlot(v);a||(this.highWatermark+v>this.capacityQuads&&this.growCapacity(this.highWatermark+v),a={start:this.highWatermark,count:v},this.highWatermark+=v);let l=a.start*vt,c=l*fe,u=l*Ct,f=l*Ye;this.positions.set(t.positions,c),this.colors.set(t.colors,c),this.skyLights.set(t.skyLights,f),this.blockLights.set(t.blockLights,f),this.uvs.set(t.uvs,u);let m=c,g=this.renderOrigin.x,b=this.renderOrigin.y,A=this.renderOrigin.z;for(let M=0;M<o;M++){let C=m+M*fe;this.aOrigin[C]=r-g,this.aOrigin[C+1]=i-b,this.aOrigin[C+2]=s-A}let y=a.start*Se,_=l;for(let M=0;M<t.indices.length;M++)this.indices[y+M]=t.indices[M]+_;return this.sectionSlots.set(e,a),this.markDirty(a.start,a.start+v-1),this.syncDefaultDrawGroups(),!0}updateDrawSpans(e,t){let r=this.mesh.geometry;if(r.clearGroups(),this.highWatermark===0){r.setDrawRange(0,0);return}let i=this._spanScratch;i.length=0;let s=0;for(let o of e){let v=this.sectionSlots.get(o.key);v&&(i.push({start:v.start,count:v.count}),s+=v.count)}if(i.length===0){r.setDrawRange(0,0);return}if(t==="opaque"){if(s>=this.highWatermark*I1){r.addGroup(0,this.highWatermark*Se,0),r.setDrawRange(0,this.highWatermark*Se);return}i.sort((o,v)=>o.start-v.start),this.mergeOpaqueSpans(i),this.capOpaqueSpans(i);for(let o of i)r.addGroup(o.start*Se,o.count*Se,0)}else{e.sort((o,v)=>v.distSq-o.distSq);for(let o of e){let v=this.sectionSlots.get(o.key);v&&r.addGroup(v.start*Se,v.count*Se,0)}}r.setDrawRange(0,this.highWatermark*Se)}mergeOpaqueSpans(e){if(e.length<2)return;let t=0;for(;t<e.length-1;){let r=e[t],i=e[t+1];i.start-(r.start+r.count)<=L1?(r.count=i.start+i.count-r.start,e.splice(t+1,1)):t++}}capOpaqueSpans(e){for(;e.length>H1;){let t=0,r=1/0;for(let o=0;o<e.length-1;o++){let v=e[o+1].start-(e[o].start+e[o].count);v<r&&(r=v,t=o)}let i=e[t],s=e[t+1];i.count=s.start+s.count-i.start,e.splice(t+1,1)}}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*vt,i=t.start*vt,s=i*fe,o=i*Ct,v=t.start*Se,a=t.count*Se,l=i*Ye,c=this.positions.slice(s,s+r*fe),u=this.colors.slice(s,s+r*fe),f=this.skyLights.slice(l,l+r*Ye),m=this.blockLights.slice(l,l+r*Ye),g=this.uvs.slice(o,o+r*Ct),b=this.indices.slice(v,v+a),A=i;for(let C=0;C<b.length;C++)b[C]=b[C]-A;let y=this.aOrigin[s]+this.renderOrigin.x,_=this.aOrigin[s+1]+this.renderOrigin.y,M=this.aOrigin[s+2]+this.renderOrigin.z;return{positions:c,colors:u,skyLights:f,blockLights:m,uvs:g,indices:b,sx:y,sy:_,sz:M}}removeSection(e){let t=this.sectionSlots.get(e);if(!t)return;let r=t.start*Se,i=t.count*Se;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()}hasPendingUploads(){return this.pendingRanges.length>0}uploadDirtyRange(){let e=this.pendingRanges[0];if(!e)return;let t=e.start,r=Math.min(e.end-e.start+1,jl),i=t*vt,s=r*vt,o=t*Se,v=r*Se,a=this.mesh.geometry,l=a.getAttribute("position");l.clearUpdateRanges(),l.addUpdateRange(i*fe,s*fe),l.needsUpdate=!0;let c=a.getAttribute("color");c.clearUpdateRanges(),c.addUpdateRange(i*fe,s*fe),c.needsUpdate=!0;let u=a.getAttribute("a_skyLight");u.clearUpdateRanges(),u.addUpdateRange(i*Ye,s*Ye),u.needsUpdate=!0;let f=a.getAttribute("a_blockLight");f.clearUpdateRanges(),f.addUpdateRange(i*Ye,s*Ye),f.needsUpdate=!0;let m=a.getAttribute("uv");m.clearUpdateRanges(),m.addUpdateRange(i*Ct,s*Ct),m.needsUpdate=!0;let g=a.getAttribute("a_origin");g.clearUpdateRanges(),g.addUpdateRange(i*fe,s*fe),g.needsUpdate=!0;let b=a.index;b.clearUpdateRanges(),b.addUpdateRange(o,v),b.needsUpdate=!0,t+r>e.end?this.pendingRanges.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*vt,i=t.count*vt,s=r*fe;for(let o=0;o<i;o++){let v=s+o*fe;this.aOrigin[v]-=e.x,this.aOrigin[v+1]-=e.y,this.aOrigin[v+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){let{originDelta:i,cameraOriginFrac:s}=C0(this.renderOrigin,e,t,r),o=this.material.uniforms.u_originDelta;o?.value?.set&&o.value.set(i.x,i.y,i.z);let v=this.material.uniforms.u_cameraOriginFrac;v?.value?.set&&v.value.set(s.x,s.y,s.z)}raycastSections(e,t,r){let i=e.ray,s=e.near,o=e.far;o6.copy(i.origin).sub(Ql.set(this.renderOrigin.x,this.renderOrigin.y,this.renderOrigin.z)),B1.origin.copy(o6),B1.direction.copy(i.direction);for(let v of t){let a=this.sectionSlots.get(v);if(!a)continue;let c=a.start*vt*fe,u=a.start*Se,f=a.count*Se;for(let m=0;m<f;m+=3){let g=this.indices[u+m],b=this.indices[u+m+1],A=this.indices[u+m+2];if(g===b&&b===A)continue;let y=Yl(B1,this.positions,this.aOrigin,c,g,b,A,s,o);y!==null&&r.push({distance:y,point:i.at(y,new de.Vector3),object:this.mesh,face:null,faceIndex:Math.floor(m/3)})}}return r.sort((v,a)=>v.distance-a.distance),r}getMemoryBytes(){return this.capacityQuads*vt*(fe*3+Ye*2+Ct)*4+this.capacityQuads*Se*4}reset(){this.sectionSlots.clear(),this.freeList.length=0,this.highWatermark=0,this.pendingRanges.length=0,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()}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)}}growCapacity(e){let t=this.capacityQuads;for(;t<e;)t+=this.growthIncrementQuads;let r=this.capacityQuads*vt,i=t*vt,s=new Float32Array(i*fe),o=new Float32Array(i*fe),v=new Float32Array(i*Ye),a=new Float32Array(i*Ye),l=new Float32Array(i*Ct),c=new Float32Array(i*fe),u=new Uint32Array(t*Se);s.set(this.positions),o.set(this.colors),v.set(this.skyLights),a.set(this.blockLights),l.set(this.uvs),c.set(this.aOrigin),u.set(this.indices),this.positions=s,this.colors=o,this.skyLights=v,this.blockLights=a,this.uvs=l,this.aOrigin=c,this.indices=u,this.capacityQuads=t;let f=this.mesh.geometry,m=(A,y,_)=>{f.getAttribute(_)&&f.deleteAttribute(_);let C=new de.BufferAttribute(A,y);C.setUsage(de.DynamicDrawUsage),f.setAttribute(_,C)};m(this.positions,fe,"position"),m(this.colors,fe,"color"),m(this.skyLights,Ye,"a_skyLight"),m(this.blockLights,Ye,"a_blockLight"),m(this.uvs,Ct,"uv"),m(this.aOrigin,fe,"a_origin"),f.index&&f.setIndex(null);let b=new de.BufferAttribute(this.indices,1);b.setUsage(de.DynamicDrawUsage),f.setIndex(b),this.pendingRanges.length=0}},nr=new de.Vector3,S1=new de.Vector3,C1=new de.Vector3,sr=new de.Vector3,or=new de.Vector3,Ci=new de.Vector3,o6=new de.Vector3,Ql=new de.Vector3,B1=new de.Ray;function P1(n,e,t,r,i){let s=t+r*fe;i.set(e[s]+n[s],e[s+1]+n[s+1],e[s+2]+n[s+2])}function Yl(n,e,t,r,i,s,o,v,a){P1(e,t,r,i,nr),P1(e,t,r,s,S1),P1(e,t,r,o,C1),sr.subVectors(S1,nr),or.subVectors(C1,nr),Ci.crossVectors(sr,or);let l=Ci.dot(n.direction);if(Math.abs(l)<1e-8)return null;let c=nr.clone().sub(n.origin).dot(Ci)/l;if(c<v||c>a)return null;let u=n.at(c,new de.Vector3);return Kl(u,nr,S1,C1)?c:null}function Kl(n,e,t,r){sr.subVectors(t,e),or.subVectors(r,e);let i=Ci.crossVectors(sr,or).normalize(),s=sr,o=or,v=n.clone().sub(e),a=s.dot(s),l=s.dot(o),c=o.dot(o),u=v.dot(s),f=v.dot(o),m=a*c-l*l;if(Math.abs(m)<1e-12)return!1;let g=(c*u-l*f)/m,b=(a*f-l*u)/m;return 1-g-b>=-1e-4&&g>=-1e-4&&b>=-1e-4}var v5=H1,Jl=L1;function ql(n){if(n.length<2)return;let e=0;for(;e<n.length-1;){let t=n[e],r=n[e+1];r.start-(t.start+t.count)<=Jl?(t.count=r.start+r.count-t.start,n.splice(e+1,1)):e++}}function Xl(n){for(;n.length>v5;){let e=0,t=1/0;for(let s=0;s<n.length-1;s++){let o=n[s+1].start-(n[s].start+n[s].count);o<t&&(t=o,e=s)}let r=n[e],i=n[e+1];r.count=i.start+i.count-r.start,n.splice(e+1,1)}}function a6(n,e){if(n.length===0||e===0)return[];let t=0;for(let i of n)t+=i.count;if(t>=e*I1)return[{start:0,count:e}];let r=n.map(i=>({start:i.start,count:i.count}));return r.sort((i,s)=>i.start-s.start),ql(r),Xl(r),r}Zt();function l6(){return{firsts:new Int32Array(v5),counts:new Int32Array(v5),instanceCounts:new Int32Array(v5),baseInstances:new Int32Array(v5)}}function c6(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 v6=!1;function d6(n,e){v6||!e||(v6=!0)}function u6(n,e,t,r,i){let s=t.length;if(s===0)return;let o=n.TRIANGLES;if(e.tier==="A"&&e.ext){let v=e.ext;for(let a=0;a<s;a++){let l=t[a];r.firsts[a]=0,r.counts[a]=Ut,r.instanceCounts[a]=l.count,r.baseInstances[a]=l.start}v.multiDrawArraysInstancedBaseInstanceWEBGL(o,r.firsts,0,r.counts,0,r.instanceCounts,0,r.baseInstances,0,s);return}if(e.tier==="B"&&e.ext){let v=e.ext;for(let a=0;a<s;a++){let l=t[a];v.drawArraysInstancedBaseInstanceWEBGL(o,0,Ut,l.count,l.start)}return}i?.(n,t)}Zt();a5();var Zl=512e3,$l=1e6,f6=15e3,e9=.25,l5=Y3(),Bi=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,"visibleSpans",[]);d(this,"_drawScratch",l6());d(this,"multiDrawCaps",null);d(this,"tierCVao",null);d(this,"tierCAttrs",null);d(this,"tierCGl",null);d(this,"debugOverlay",!1);this.capacityFaces=Zl,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(l5);let r=new yt.InstancedBufferGeometry,i=new Float32Array(Ut*3);r.setAttribute("position",new yt.BufferAttribute(i,3));let s=o=>{let v=new yt.InstancedBufferAttribute(o,1);return v.setUsage(yt.DynamicDrawUsage),v};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 yt.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,v,a,l,c)=>{if(this.visibleSpans.length===0)return;let u=c,f=o.getContext();this.multiDrawCaps||(this.multiDrawCaps=c6(f),d6(this.multiDrawCaps.tier,this.debugOverlay)),u6(f,this.multiDrawCaps,this.visibleSpans,this._drawScratch,this.multiDrawCaps.tier==="C"?(m,g)=>this.drawTierCSpans(m,g,o,u):void 0)}}setDebugOverlay(e){this.debugOverlay=e}suppressThreeDraw(){let e=this.mesh.geometry;e.setDrawRange(0,Ut),e.instanceCount=0}setVisibleSpans(e){this.visibleSpans=e}getVisibleSpans(){return this.visibleSpans}forEachSectionSlot(e){for(let[t,r]of this.sectionSlots)e(t,r)}getSectionDrawStart(e){let t=this.sectionSlots.get(e);if(t)return this.pendingMove?.key===e?this.pendingMove.oldStart:t.start}getHighWatermark(){return this.highWatermark}hasPendingUploads(){return this.pendingRanges.length>0}getPendingMove(){return this.pendingMove}addSection(e,t,r){if(r<=0){this.removeSection(e);return}this.sectionSlots.has(e)&&this.removeSection(e),r>this.capacityFaces&&this.growCapacity(r);let i=this.takeFreeSlot(r);i||(this.highWatermark+r>this.capacityFaces&&this.growCapacity(this.highWatermark+r),i={start:this.highWatermark,count:r},this.highWatermark+=r);let s=4;for(let o=0;o<r;o++){let v=i.start+o,a=o*s;this.w0[v]=t[a],this.w1[v]=t[a+1],this.w2[v]=t[a+2],this.w3[v]=t[a+3]}this.sectionSlots.set(e,i),this.markDirty(i.start,i.start+r-1),this.mesh.geometry.instanceCount=this.highWatermark}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,v=s*r;i[v]=this.w0[o],i[v+1]=this.w1[o],i[v+2]=this.w2[o],i[v+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.pendingMove?.key===e){let{oldStart:r,count:i}=this.pendingMove;for(let s=r;s<r+i;s++)this.w0[s]=0,this.w1[s]=0,this.w2[s]=l5,this.w3[s]=0;this.markDirty(r,r+i-1),this.insertFreeSlot({start:r,count: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]=l5,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}}compactStep(){if(this.pendingMove){let{newStart:v,count:a}=this.pendingMove;this.rangeFullyUploaded(v,v+a-1)&&this.finalizePendingMove();return}if(this.highWatermark===0||this.interiorFreeFaces()/this.highWatermark<=e9)return;let t=this.findMovableSection(f6);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}}uploadDirtyRange(){let e=this.pendingRanges[0];if(!e)return;let t=e.start,r=Math.min(e.end-e.start+1,f6),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}setCameraOrigin(e,t,r,i){let{originDelta:s,cameraOriginFrac:o}=C0(e,t,r,i),v=_i(e),a=this.mesh.material.uniforms.u_originDelta;a?.value?.set&&a.value.set(s.x,s.y,s.z);let l=this.mesh.material.uniforms.u_cameraOriginFrac;l?.value?.set&&l.value.set(o.x,o.y,o.z);let c=this.mesh.material.uniforms.u_sectionOriginRel;c?.value?.set&&c.value.set(v.x,v.y,v.z)}reset(){this.sectionSlots.clear(),this.freeList.length=0,this.highWatermark=0,this.pendingRanges.length=0,this.pendingMove=null,this.visibleSpans=[],this.w0.fill(0),this.w1.fill(0),this.w2.fill(l5),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 v=o.start*4,a=l=>{e.bindBuffer(e.ARRAY_BUFFER,l.buffer),e.vertexAttribIPointer(l.loc,1,e.UNSIGNED_INT,4,v)};a(s.w0),a(s.w1),a(s.w2),a(s.w3),e.drawArraysInstanced(e.TRIANGLES,0,Ut,o.count)}e.bindVertexArray(null)}ensureTierCVao(e,t,r){this.tierCGl=e;let o=t.properties.get(r).currentProgram.program,v=e.getAttribLocation(o,"a_w0"),a=e.getAttribLocation(o,"a_w1"),l=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),f=u(v);if(this.tierCVao&&this.tierCAttrs&&f&&this.tierCAttrs.w0.buffer!==f&&this.invalidateTierCVao(),this.tierCVao)return;let m=u(v),g=u(a),b=u(l),A=u(c);if(!m||!g||!b||!A)return;let y=e.createVertexArray();if(!y)return;e.bindVertexArray(y);let _=(M,C)=>{e.enableVertexAttribArray(M),e.bindBuffer(e.ARRAY_BUFFER,C),e.vertexAttribIPointer(M,1,e.UNSIGNED_INT,4,0),e.vertexAttribDivisor(M,1)};_(v,m),_(a,g),_(l,b),_(c,A),e.bindVertexArray(null),this.tierCVao=y,this.tierCAttrs={w0:{loc:v,buffer:m},w1:{loc:a,buffer:g},w2:{loc:l,buffer:b},w3:{loc:c,buffer:A}}}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}finalizePendingMove(){let e=this.pendingMove;if(!e)return;let{oldStart:t,count:r}=e;for(let i=t;i<t+r;i++)this.w0[i]=0,this.w1[i]=0,this.w2[i]=l5,this.w3[i]=0;this.insertFreeSlot({start:t,count:r}),this.shrinkHighWatermark(),t<this.highWatermark&&this.markDirty(t,t+r-1),this.mesh.geometry.instanceCount=this.highWatermark,this.pendingMove=null}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();let t=this.capacityFaces;for(;t<e;)t+=$l;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(l5,this.w0.length),this.w0=r,this.w1=i,this.w2=s,this.w3=o,this.capacityFaces=t;let v=this.mesh.geometry,a=(l,c)=>{let u=v.getAttribute(c);u&&(v.deleteAttribute(c),"dispose"in u&&typeof u.dispose=="function"&&u.dispose());let f=new yt.InstancedBufferAttribute(l,1);f.setUsage(yt.DynamicDrawUsage),v.setAttribute(c,f)};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()}};E();x();k();R();a5();Zt();function h6(n,e,t,r,i){if(e<=0)return;let s=t-8,o=r-8,v=i-8,a=o5,l=16,c=16,u=16,f=-1,m=-1,g=-1;for(let T=0;T<e;T++){let P=n[T*a],B=P&(1<<gt.LX_BITS)-1,L=P>>gt.LY_SHIFT&(1<<gt.LY_BITS)-1,G=P>>gt.LZ_SHIFT&(1<<gt.LZ_BITS)-1;B<l&&(l=B),L<c&&(c=L),G<u&&(u=G),B>f&&(f=B),L>m&&(m=L),G>g&&(g=G)}if(f<0)return;let b=s+l,A=o+c,y=v+u,_=s+f+1,M=o+m+1,C=v+g+1;return{minX:b,minY:A,minZ:y,maxX:_,maxY:M,maxZ:C,cx:(b+_)*.5,cy:(A+M)*.5,cz:(y+C)*.5}}function vr(n,e,t,r,i,s,o,v,a){return n>=r&&n<=o&&e>=i&&e<=v&&t>=s&&t<=a}function m6(n,e,t,r,i,s,o,v,a,l,c){let u=n-c,f=e-c,m=t-c,g=n+c,b=e+c,A=t+c;return vr(r,i,s,u,f,m,g,b,A)?!0:Pi(r,i,s,o,v,a,u,f,m,g,b,A,l)!==void 0}function Pi(n,e,t,r,i,s,o,v,a,l,c,u,f){if(vr(n,e,t,o,v,a,l,c,u))return;let m=0,g=f;if(Math.abs(r)<1e-8){if(n<o||n>l)return}else{let b=1/r,A=(o-n)*b,y=(l-n)*b;if(A>y){let _=A;A=y,y=_}if(m=Math.max(m,A),g=Math.min(g,y),m>g)return}if(Math.abs(i)<1e-8){if(e<v||e>c)return}else{let b=1/i,A=(v-e)*b,y=(c-e)*b;if(A>y){let _=A;A=y,y=_}if(m=Math.max(m,A),g=Math.min(g,y),m>g)return}if(Math.abs(s)<1e-8){if(t<a||t>u)return}else{let b=1/s,A=(a-t)*b,y=(u-t)*b;if(A>y){let _=A;A=y,y=_}if(m=Math.max(m,A),g=Math.min(g,y),m>g)return}return m<=g&&m>=0?m:void 0}function t9(n,e,t,r,i,s,o,v,a,l,c,u,f){let m=f;if(Math.abs(r)>=1e-8){let g=r>0?(l-n)/r:(o-n)/r;g>1e-6&&(m=Math.min(m,g))}else if(n<o||n>l)return;if(Math.abs(i)>=1e-8){let g=i>0?(c-e)/i:(v-e)/i;g>1e-6&&(m=Math.min(m,g))}else if(e<v||e>c)return;if(Math.abs(s)>=1e-8){let g=s>0?(u-t)/s:(a-t)/s;g>1e-6&&(m=Math.min(m,g))}else if(t<a||t>u)return;return m<=f?m:void 0}function O1(n,e,t,r,i,s,o,v,a,l,c,u,f,m,g,b){let A=i-8,y=s-8,_=o-8,M=m,C=!1;for(let T=0;T<t;T++){let P=n[e+T*r],B=P&(1<<gt.LX_BITS)-1,L=P>>gt.LY_SHIFT&(1<<gt.LY_BITS)-1,G=P>>gt.LZ_SHIFT&(1<<gt.LZ_BITS)-1,H=B+(L<<4)+(G<<8);if(g[H]===b)continue;g[H]=b;let N=A+B,Y=y+L,q=_+G,Z=N+1,ae=Y+1,oe=q+1,le;vr(v,a,l,N,Y,q,Z,ae,oe)?le=t9(v,a,l,c,u,f,N,Y,q,Z,ae,oe,M):le=Pi(v,a,l,c,u,f,N,Y,q,Z,ae,oe,M),le!==void 0&&le<M&&(M=le,C=!0)}return C?M:void 0}E();x();k();R();import*as nt from"three";E();x();k();R();gi();var Ii=class{constructor(){d(this,"entries",new Set);d(this,"skyLevel",1);d(this,"lightmapParams",{...tt})}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=b1(e.blockLightNorm,e.skyLightNorm,this.skyLevel,this.lightmapParams);e.material.color.setScalar(t)}};function p6(n,e,t,r,i=tt){let s=b1(e,t,r,i);return n.color.setScalar(s),s}var g6=20,b6=40,r9={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},y6={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 i9(n){let e=n.replace("_wall_banner","_banner");return r9[e]??15}var n9=(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 v=0;v<s;v+=2)n.fillRect(r+v,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 s9(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 o9=(n,e,t=(r,i)=>qe(r,i))=>{let i=t(g6*1,b6*1),s=i.getContext("2d");if(s){if(s.imageSmoothingEnabled=!1,e?.Patterns&&e.Patterns.length>0)for(let o of e.Patterns){let v=o.Color??0,a=o.Pattern??"bs",l=y6[v]||y6[0];n9(s,a,l,0,0,g6*1,b6*1)}return i}},Li=new Map;function _6(n,e,t){let r=i9(e),i=s9(r,t?.Patterns),s=Li.get(i);if(s)return s.refCount++,s.texture;let o=o9(r,t);if(!o)return;let v=new nt.Texture(o);return v.magFilter=nt.NearestFilter,v.minFilter=nt.NearestFilter,v.needsUpdate=!0,Li.set(i,{texture:v,refCount:1}),v}function w6(n){for(let[e,t]of Li.entries())if(t.texture===n){t.refCount--,t.refCount<=0&&(t.texture.dispose(),Li.delete(e));return}}function A6(n,e,t,r,i=0,s=1,o=1){let c,u,f;t?(c=(-14.6+13.4)/2/16-.5,u=1-14.75/16-.5,f=1/2):(c=(1.4+29.4)/2/16,u=1-7.25/16-.5,f=0);let m=new nt.MeshBasicMaterial({map:r,transparent:!0});p6(m,i,s,o);let g=new nt.Mesh(new nt.PlaneGeometry(.85,1.75),m);g.renderOrder=999;let b=.5/16,A=.25/16;t?g.position.set(0,c,u+A+.004):g.position.set(0,c,u+b/2+.004);let y=new nt.Group;return y.rotation.set(0,-nt.MathUtils.degToRad(e*(t?90:45/2)),0),y.add(g),y.bannerTexture=r,y.bannerMaterial=m,y.position.set(n.x+.5,n.y+f,n.z+.5),y}var Rt=class Rt{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 Ii);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,"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,"globalBlockBuffer",null);d(this,"globalLegacyBuffer",null);d(this,"globalLegacyBlendBuffer",null);d(this,"shaderSectionRaycastBoxes",new Map);d(this,"blockRaycastVisitGen",new Uint16Array(4096));d(this,"blockRaycastVisitStamp",1);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 F1(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=xi();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&&yi(t,e),this.legacyShaderMaterial&&Ti(this.legacyShaderMaterial,e),this.globalLegacyShaderMaterial&&Ti(this.globalLegacyShaderMaterial,e),this.globalLegacyBlendShaderMaterial&&Ti(this.globalLegacyBlendShaderMaterial,e),this.blockEntityLightRegistry.setSkyLevel(e)}setBlockLightmapParams(e){let t=this.cubeShaderMaterial??(this.isShaderCubesGpuEnabled()?this.getCubeShaderMaterial():null);t&&G3(t,e),this.legacyShaderMaterial&&Mi(this.legacyShaderMaterial,e),this.globalLegacyShaderMaterial&&Mi(this.globalLegacyShaderMaterial,e),this.globalLegacyBlendShaderMaterial&&Mi(this.globalLegacyBlendShaderMaterial,e),this.blockEntityLightRegistry.setLightmapParams(e)}getLegacyShaderMaterial(){return this.legacyShaderMaterial||(this.legacyShaderMaterial=r6(),this.syncLegacyShaderUniforms()),this.legacyShaderMaterial}getGlobalLegacyShaderMaterial(){return this.globalLegacyShaderMaterial||(this.globalLegacyShaderMaterial=i6(),this.syncLegacyShaderUniforms()),this.globalLegacyShaderMaterial}getGlobalLegacyBuffer(){return this.globalLegacyBuffer||(this.globalLegacyBuffer=new ar(this.getGlobalLegacyShaderMaterial(),this.scene),this.globalLegacyBuffer.setRenderOrigin(this.renderOrigin)),this.globalLegacyBuffer}getGlobalLegacyBlendShaderMaterial(){return this.globalLegacyBlendShaderMaterial||(this.globalLegacyBlendShaderMaterial=n6(),this.syncLegacyShaderUniforms()),this.globalLegacyBlendShaderMaterial}getGlobalLegacyBlendBuffer(){return this.globalLegacyBlendBuffer||(this.globalLegacyBlendBuffer=new ar(this.getGlobalLegacyBlendShaderMaterial(),this.scene,{name:"globalLegacyBlend",initialCapacityQuads:32e3,growthIncrementQuads:32e3}),this.globalLegacyBlendBuffer.setRenderOrigin(this.renderOrigin)),this.globalLegacyBlendBuffer}getRenderOrigin(){return this.renderOrigin}maybeRebase(e){let t=this.renderOrigin;if(Math.abs(e.x-t.x)<=Rt.REBASE_THRESHOLD&&Math.abs(e.y-t.y)<=Rt.REBASE_THRESHOLD&&Math.abs(e.z-t.z)<=Rt.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 v=this.sectionObjects[o];v&&M1(s.mesh,v.worldX??0,v.worldY??0,v.worldZ??0,r)}this.renderOrigin=r,this.globalLegacyBuffer?.setRenderOrigin(r),this.globalLegacyBlendBuffer?.setRenderOrigin(r)}sectionUsesPooledLegacyMesh(e){return this.activeSections.has(e)}updateSectionCullAndSort(e,t,r,i){this._legacyCullProjScreen.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._legacyCullFrustum.setFromProjectionMatrix(this._legacyCullProjScreen);let s=this._visibleSectionSpans;s.length=0;for(let[v,a]of Object.entries(this.sectionObjects)){if(a.worldX===void 0||!a.visible)continue;let{visible:l,distSq:c}=Si(a.worldX,a.worldY??0,a.worldZ??0,t,r,i,this._legacyCullFrustum,this._legacyCullBox,this._legacyCullBoxMin,this._legacyCullBoxMax);l&&s.push({key:v,distSq:c})}this.globalLegacyBuffer?.updateDrawSpans(s,"opaque"),this.globalLegacyBlendBuffer?.updateDrawSpans(s,"sortedBlend");let o=this.globalBlockBuffer;if(o){let v=[];o.forEachSectionSlot((l,c)=>{let u=this.shaderSectionRaycastBoxes.get(l);if(!u)return;let{visible:f}=Si(u.sectionCenterX,u.sectionCenterY,u.sectionCenterZ,t,r,i,this._legacyCullFrustum,this._legacyCullBox,this._legacyCullBoxMin,this._legacyCullBoxMax);if(!f)return;let m=o.getSectionDrawStart(l);m!==void 0&&v.push({start:m,count:c.count})});let a=a6(v,o.getHighWatermark());o.setVisibleSpans(a)}for(let v of this.activeSections.values()){let a=v.sectionKey;if(!a)continue;let l=this.sectionObjects[a];l&&s6(v.mesh,l.worldX??0,l.worldY??0,l.worldZ??0,t,r,i,this._legacyCullFrustum,this._legacyCullBox,this._legacyCullBoxMin,this._legacyCullBoxMax)}}markCullDirty(){this.cullDirty=!0}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;ki(this.getLegacyShaderMaterial(),i,e,t,r),ki(this.getGlobalLegacyShaderMaterial(),i,e,t,r),ki(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:v}=C0(i,e,t,r),a=_i(i),l=s.uniforms.u_originDelta;l?.value?.set&&l.value.set(o.x,o.y,o.z);let c=s.uniforms.u_cameraOriginFrac;c?.value?.set&&c.value.set(v.x,v.y,v.z);let u=s.uniforms.u_sectionOriginRel;u?.value?.set&&u.value.set(a.x,a.y,a.z)}}getCubeShaderMaterial(){return this.isShaderCubesGpuEnabled()?(this.cubeShaderMaterial||(this.cubeShaderMaterial=bi(),this.syncCubeShaderUniforms()),this.cubeShaderMaterial):null}getGlobalBlockBuffer(){let e=this.getCubeShaderMaterial();return e?(this.globalBlockBuffer||(this.globalBlockBuffer=new Bi(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,v=t.worldZ;s!==void 0&&o!==void 0&&v!==void 0&&this.registerShaderSectionRaycastBox(e,r,i,s,o,v),this.getGlobalBlockBuffer()?.addSection(e,r,i),this.markCullDirty();let l=t.mesh===t.shaderMesh;t.shaderMesh&&(w1(t.shaderMesh),t.remove(t.shaderMesh),t.shaderMesh=void 0),delete t.deferredShaderCubes,l&&(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:v,indices:a}=t.deferredLegacyOpaque,l=t.worldX,c=t.worldY,u=t.worldZ;l!==void 0&&c!==void 0&&u!==void 0&&this.getGlobalLegacyBuffer().addSection(e,{positions:r,colors:i,skyLights:s,blockLights:o,uvs:v,indices:a},l,c,u),delete t.deferredLegacyOpaque}if(t.deferredLegacyBlend){let{positions:r,colors:i,skyLights:s,blockLights:o,uvs:v,indices:a}=t.deferredLegacyBlend,l=t.worldX,c=t.worldY,u=t.worldZ;l!==void 0&&c!==void 0&&u!==void 0&&this.getGlobalLegacyBlendBuffer().addSection(e,{positions:r,colors:i,skyLights:s,blockLights:o,uvs:v,indices:a},l,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()}}raycastGlobalLegacySections(e,t,r){let i=r*r,s=e.ray.direction.x,o=e.ray.direction.y,v=e.ray.direction.z,a=e.far,l=T1+.01,c=[];for(let[f,m]of Object.entries(this.sectionObjects)){if(m.worldX===void 0)continue;let g=m.worldX-t.x,b=(m.worldY??0)-t.y,A=(m.worldZ??0)-t.z;if(g*g+b*b+A*A>i)continue;let y=this.globalLegacyBuffer?.hasSection(f)??!1,_=this.globalLegacyBlendBuffer?.hasSection(f)??!1;!y&&!_||m6(m.worldX,m.worldY??0,m.worldZ??0,t.x,t.y,t.z,s,o,v,a,l)&&c.push(f)}if(c.length===0)return;let u=[];return this.globalLegacyBuffer?.raycastSections(e,c,u),this.globalLegacyBlendBuffer?.raycastSections(e,c,u),u[0]?.distance}registerShaderSectionRaycastBox(e,t,r,i,s,o){let v=h6(t,r,i,s,o);v?this.shaderSectionRaycastBoxes.set(e,{box:v,sectionCenterX:i,sectionCenterY:s,sectionCenterZ:o}):this.shaderSectionRaycastBoxes.delete(e)}unregisterShaderSectionRaycastBox(e){this.shaderSectionRaycastBoxes.delete(e)}raycastShaderSectionAABBs(e,t,r,i=80){let s=e.x,o=e.y,v=e.z,a=t.x,l=t.y,c=t.z,u=i*i,f=r,m=!1;this.blockRaycastVisitStamp++,this.blockRaycastVisitStamp>=65535&&(this.blockRaycastVisitGen.fill(0),this.blockRaycastVisitStamp=1);for(let[g,b]of this.shaderSectionRaycastBoxes){let A=this.sectionObjects[g];if(A&&!A.visible)continue;let{box:y}=b,_=y.cx-s,M=y.cy-o,C=y.cz-v;if(_*_+M*M+C*C>u)continue;let T=Pi(s,o,v,a,l,c,y.minX,y.minY,y.minZ,y.maxX,y.maxY,y.maxZ,f);if(T===void 0&&vr(s,o,v,y.minX,y.minY,y.minZ,y.maxX,y.maxY,y.maxZ)){let P=this.globalBlockBuffer,B=P?.getSectionSlot(g);if(P&&B)T=O1(P.getW0(),B.start,B.count,1,b.sectionCenterX,b.sectionCenterY,b.sectionCenterZ,s,o,v,a,l,c,f,this.blockRaycastVisitGen,this.blockRaycastVisitStamp);else{let L=this.sectionObjects[g]?.deferredShaderCubes;L&&(T=O1(L.words,0,L.count,o5,b.sectionCenterX,b.sectionCenterY,b.sectionCenterZ,s,o,v,a,l,c,f,this.blockRaycastVisitGen,this.blockRaycastVisitStamp))}}T!==void 0&&T<f&&(f=T,m=!0)}return m?f:void 0}uploadLegacyPooledMesh(e,t,r,i,s){let{mesh:o}=e,v=t;return this.updateGeometryAttribute(o.geometry,"position",v.positions,3),this.updateGeometryAttribute(o.geometry,"normal",v.normals,3),this.updateGeometryAttribute(o.geometry,"color",v.colors,3),this.updateGeometryAttribute(o.geometry,"a_skyLight",v.skyLights,1),this.updateGeometryAttribute(o.geometry,"a_blockLight",v.blockLights,1),this.updateGeometryAttribute(o.geometry,"uv",v.uvs,2),o.geometry.index=new X.BufferAttribute(v.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)),M1(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,v=this.isShaderCubesGpuEnabled()&&(o?.count??0)>0;if(!s&&!v)return this.releaseSection(e),null;let a=this.sectionObjects[e];a&&this.cleanupSection(e,{forRemesh:!0}),i||this.releasePooledMesh(e);let l,c,u,f=!1;if(r){let T={positions:t.positions,colors:t.colors,skyLights:t.skyLights,blockLights:t.blockLights,uvs:t.uvs,indices:t.indices};if(this.shouldDeferLegacyOpaqueToPerSection(e)){if(c={positions:new Float32Array(T.positions),colors:new Float32Array(T.colors),skyLights:new Float32Array(T.skyLights),blockLights:new Float32Array(T.blockLights),uvs:new Float32Array(T.uvs),indices:T.indices instanceof Uint32Array?new Uint32Array(T.indices):new Uint16Array(T.indices)},!i){let B=this.acquirePooledSectionMesh(e);if(!B)return null;l=this.uploadLegacyPooledMesh(B,t,t.sx,t.sy,t.sz)}}else if(!this.getGlobalLegacyBuffer().addSection(e,T,t.sx,t.sy,t.sz)){let L=this.acquirePooledSectionMesh(e);if(!L)return null;l=this.uploadLegacyPooledMesh(L,t,t.sx,t.sy,t.sz)}}if(i&&t.blend){let T={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(this.shouldDeferLegacyOpaqueToPerSection(e)){u={positions:new Float32Array(T.positions),colors:new Float32Array(T.colors),skyLights:new Float32Array(T.skyLights),blockLights:new Float32Array(T.blockLights),uvs:new Float32Array(T.uvs),indices:T.indices instanceof Uint32Array?new Uint32Array(T.indices):new Uint16Array(T.indices)};let B=this.acquirePooledSectionMesh(e);if(!B)return null;let L=this.uploadLegacyPooledMesh(B,t.blend,t.sx,t.sy,t.sz);l=l??L,f=!0}else if(!this.getGlobalLegacyBlendBuffer().addSection(e,T,t.sx,t.sy,t.sz)){let L=this.acquirePooledSectionMesh(e);if(!L)return null;let G=this.uploadLegacyPooledMesh(L,t.blend,t.sx,t.sy,t.sz);l=l??G,f=!0}}let m=v?this.getCubeShaderMaterial():null,g,b=v&&this.shouldDeferShaderToPerSection(e);v&&o&&(b&&m?(g=Ri(o,m),g.visible=!0):this.getGlobalBlockBuffer()?.addSection(e,o.words,o.count)),a=new X.Group,l&&(a.add(l),a.mesh=l),g&&(a.add(g),a.shaderMesh=g,o&&(a.deferredShaderCubes={words:o.words,count:o.count}),a.mesh||(a.mesh=g)),c&&(a.deferredLegacyOpaque=c),u&&(a.deferredLegacyBlend=u),v&&o&&this.registerShaderSectionRaycastBox(e,o.words,o.count,t.sx,t.sy,t.sz);let A=0;r&&(A+=t.positions.length/3/4),i&&t.blend&&(A+=t.blend.positions.length/3/4),v&&o&&(A+=o.count),a.tilesCount=A,a.hasBlendMesh=f,a.blocksCount=t.blocksCount,a.worldX=t.sx,a.worldY=t.sy,a.worldZ=t.sz,a.sectionKey=e,a.name="chunk";try{if(Object.keys(t.signs).length>0){let T=new X.Group;T.name="signs";for(let[P,{isWall:B,isHanging:L,rotation:G}]of Object.entries(t.signs)){let H=this.worldRenderer.blockEntities[P];if(!H)continue;let[N,Y,q]=P.split(","),Z=this.signHeadsRenderer.renderSign(new D1(+N,+Y,+q),G,B,L,Hi.simplify(H));Z&&T.add(Z)}a.add(T),a.signsContainer=T}if(Object.keys(t.heads).length>0){let T=new X.Group;T.name="heads";for(let[P,{isWall:B,rotation:L}]of Object.entries(t.heads)){let G=this.worldRenderer.blockEntities[P];if(!G)continue;let[H,N,Y]=P.split(","),q=this.signHeadsRenderer.renderHead(new D1(+H,+N,+Y),L,B,Hi.simplify(G));q&&T.add(q)}a.add(T),a.headsContainer=T}if(Object.keys(t.banners).length>0){let T=new X.Group;T.name="banners",a.bannersContainer=T,a.add(T);for(let[P,B]of Object.entries(t.banners)){let{isWall:L,rotation:G,blockName:H,blockLightNorm:N=0,skyLightNorm:Y=1}=B,q=this.worldRenderer.blockEntities[P];if(!q)continue;let[Z,ae,oe]=P.split(","),le=_6(this.worldRenderer,H,Hi.simplify(q));if(!le)continue;let ye=this.blockEntityLightRegistry.getSkyLevel(),pe=A6(new D1(+Z,+ae,+oe),G,L,le,N,Y,ye);pe.bannerMaterial&&this.blockEntityLightRegistry.register({material:pe.bannerMaterial,blockLightNorm:N,skyLightNorm:Y});let{x:se,y:Q,z:ve}=pe.position;this.worldRenderer.sceneOrigin.track(pe),pe.position.set(se,Q,ve),T.add(pe)}}}catch{}this.sectionObjects[e]=a,this.scene.add(a),a.matrixAutoUpdate=!1,this.worldRenderer.displayOptions?.inWorldRenderingConfig?.showChunkBorders&&this.updateBoxHelper(e,!0);let y=e.split(","),_=`${y[0]},${y[2]}`,M=!!this.worldRenderer.displayOptions?.inWorldRenderingConfig?._renderByChunks,C=!!this.worldRenderer.worldRendererConfig?.wasmMesher;if((M||C)&&!this.worldRenderer.finishedChunks[_]){a.visible=!1,a._waitingForChunkDisplay=!0;let T=this.waitingChunksToDisplay[_]??(this.waitingChunksToDisplay[_]=[]);T.includes(e)||T.push(e)}return this.markCullDirty(),a}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]}}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]),v=Math.floor(r.x/16),a=Math.floor(r.z/16),l=(s>>4)-v,c=(o>>4)-a,u=l*l+c*c;if(u===0)return!1;let f=this.worldRenderer.finishedChunks,m=this.worldRenderer.loadedChunks,g=this.worldRenderer.viewDistance;if(t<Rt.EXPECTED_NEAR_GRACE_MS&&g>0){let A=g*g,y=Math.min(g,Math.ceil(Math.sqrt(Math.max(0,u-1))));for(let _=-y;_<=y;_++)for(let M=-y;M<=y;M++){let C=_*_+M*M;if(C>=u||C>A)continue;let T=v+_<<4,P=a+M<<4,B=`${T},${P}`;if(B!==e&&m[B]&&!f[B])return!0}return!1}for(let A in m){if(A===e||f[A])continue;let y=A.split(",");if(y.length!==2)continue;let _=(Number(y[0])>>4)-v,M=(Number(y[1])>>4)-a;if(_*_+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())},Rt.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()},Rt.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 v=o.indexOf(e);v!==-1&&o.splice(v,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&&w6(s.bannerTexture)}this.disposeContainer(r.bannersContainer)}if(this.globalBlockBuffer?.removeSection(e),this.globalLegacyBuffer?.removeSection(e),this.globalLegacyBlendBuffer?.removeSection(e),this.unregisterShaderSectionRaycastBox(e),this.markCullDirty(),delete r.deferredLegacyOpaque,delete r.deferredLegacyBlend,r.shaderMesh&&(w1(r.shaderMesh),r.shaderMesh=void 0),delete r.deferredShaderCubes,r.signsContainer&&this.disposeContainer(r.signsContainer,!1),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 v=i.worldX??0,a=i.worldY??0,l=i.worldZ??0;this.worldRenderer.sceneOrigin.track(o,{updateMatrix:!0}),o.position.set(v,a,l),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)}cleanSignChunkTextures(e,t){this.signHeadsRenderer.cleanChunkTextures(e,t)}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)}}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,v=0,a=this.globalBlockBuffer?.mesh.geometry;if(a)for(let f of["a_w0","a_w1","a_w2","a_w3"]){let m=a.getAttribute(f);if(m){let g=m.array.byteLength;v+=g,e+=g}}let l=this.globalLegacyBuffer?.getMemoryBytes()??0,c=this.globalLegacyBlendBuffer?.getMemoryBytes()??0;e+=l+c,t+=l+c;for(let f of Object.values(this.sectionObjects)){let m=f.shaderMesh?.geometry;if(m)for(let g of["a_w0","a_w1","a_w2","a_w3"]){let b=m.getAttribute(g);if(b){let A=b.array.byteLength;v+=A,e+=A}}}for(let f of this.meshPool)if(f.inUse&&f.mesh.geometry){let{geometry:m}=f.mesh,g=m.getAttribute("position");if(g){let _=g.array.byteLength;t+=_,e+=_}let b=m.getAttribute("normal");if(b){let _=b.array.byteLength;r+=_,e+=_}let A=m.getAttribute("color");if(A){let _=A.array.byteLength;i+=_,e+=_}let y=m.getAttribute("uv");if(y){let _=y.array.byteLength;s+=_,e+=_}if(m.index){let _=m.index.array.byteLength;o+=_,e+=_}}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:`${(v/(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.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){Te(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),v={x:i/16,y:s/16,z:o/16},a=v.x-e.x,l=v.z-e.z,c=Math.floor(Math.hypot(a,l));r.visible=c<=this.performanceOverrideDistance}}};d(Rt,"REBASE_THRESHOLD",65536),d(Rt,"NEAR_REVEAL_TIMEOUT_MS",5e3),d(Rt,"EXPECTED_NEAR_GRACE_MS",1500);var lr=Rt,F1=class{constructor(e){this.worldRendererThree=e;d(this,"chunkTextures",new Map)}dispose(){for(let[,e]of this.chunkTextures)for(let t of Object.keys(e))e[t].tex.dispose();this.chunkTextures.clear()}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 v=JSON.parse(D.from(s,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:a}=this.worldRendererThree.worldRendererConfig;a&&(v=v?.replace("http://textures.minecraft.net/",a).replace("https://textures.minecraft.net/",a));let l=Kt(this.worldRendererThree,v,Jt.head),c=new X.Group;return r&&l.position.set(0,.3125,.3125),l.position.y-=23/16,c.add(l),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=this.getSignTexture(e,s,i);if(!o)return;let v=new X.Mesh(new X.PlaneGeometry(1,1),new X.MeshBasicMaterial({map:o,transparent:!0}));v.renderOrder=999;let a=7/16,l=i?1.3:1;v.scale.set(1*l,a*l,1*l);let c=(i?2:1.5)/16,u=.25/16;r&&!i?v.position.set(0,0,-.5+c+u+1e-4):v.position.set(0,0,c/2+1e-4);let f=new X.Group;f.rotation.set(0,-X.MathUtils.degToRad(t*(r?90:45/2)),0),f.add(v);let m=(i?10:8)/16,g=(i?0:r?4.333:9.333)/16,b=m/2+g;return this.worldRendererThree.sceneOrigin.track(f),f.position.set(e.x+.5,e.y+b,e.z+.5),f}getSignTexture(e,t,r,i=!1){let s=j0(e),o=this.chunkTextures.get(`${s[0]},${s[1]}`);o||(o={},this.chunkTextures.set(`${s[0]},${s[1]}`,o));let v=`${e.x},${e.y},${e.z}`,a=JSON.stringify(t)+"|"+r+"|"+i,l=o[v];if(l&&l.signature===a)return l.tex;l?.tex&&l.tex.dispose();let c=a9(this.worldRendererThree.version),u=Pr(t,r,c);if(!u)return;let f=new X.Texture(u);return f.magFilter=X.NearestFilter,f.minFilter=X.NearestFilter,f.needsUpdate=!0,o[v]={tex:f,signature:a},f}cleanChunkTextures(e,t){let r=`${Math.floor(e/16)},${Math.floor(t/16)}`,i=this.chunkTextures.get(r);if(!i)return;let s=Object.keys(i);for(let o of s)i[o].tex.dispose(),delete i[o]}};E();x();k();R();E();x();k();R();import*as $t from"three";var Oi={},E6=!1;function v9(){if(E6)return;let n=globalThis.loadedData?.tints;if(n){for(let e of Object.keys(n))Oi[e]=l9(n[e]);E6=!0}}function l9(n){let e={},t=x6(n.default??16777215);if(n.data)for(let r of n.data){let i=x6(r.color);for(let s of r.keys)e[s]=i}return new Proxy(e,{get(r,i){return r[i]??t}})}function x6(n){return[(n>>16&255)/255,(n>>8&255)/255,(n&255)/255]}function R6(n,e){return v9(),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 c9=512,z1=1/20,U1=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>=z1;)this.tickAccumulator-=z1,this.tickPhysics();let t=this.tickAccumulator/z1;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 v=this.resolveBlockTexture(i);if(!v)return;let a=R6(i,o);for(let l=0;l<4;l++)for(let c=0;c<4;c++)for(let u=0;u<4;u++){let f=e+(l+.5)/4,m=t+(c+.5)/4,g=r+(u+.5)/4,b=f-e-.5,A=m-t-.5,y=g-r-.5;b+=(Math.random()*2-1)*.4,A+=(Math.random()*2-1)*.4,y+=(Math.random()*2-1)*.4;let _=(Math.random()+Math.random()+1)*.15,M=Math.sqrt(b*b+A*A+y*y),C=b/M*_*.4,T=A/M*_*.4+.1,P=y/M*_*.4,B=Math.floor(4/(Math.random()*.9+.1));this.createParticle(f,m,g,C,T,P,B,v,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,v="plains"){if(!this.enabled)return;let a=this.resolveBlockTexture(s);if(!a)return;let l=R6(s,v),c=e+Math.random()*.8+.1,u=t+Math.random()*.8+.1,f=r+Math.random()*.8+.1;switch(i){case 0:u=t-.1;break;case 1:u=t+1+.1;break;case 2:f=r-.1;break;case 3:f=r+1+.1;break;case 4:c=e-.1;break;case 5:c=e+1+.1;break}let m=(Math.random()*2-1)*.4*.2,g=(Math.random()*2-1)*.4*.2+.1*.2,b=(Math.random()*2-1)*.4*.2,A=Math.floor(4/(Math.random()*.9+.1));this.createParticle(c,u,f,m,g,b,A,a,o,e,r,.6,l)}createParticle(e,t,r,i,s,o,v,a,l,c,u,f=1,m=[1,1,1]){this.ensureMaterial();let g=this.findInactiveParticle();g||(this.particles.length<c9?g=this.allocateParticle():g=this.recycleOldest());let b=Math.floor(Math.random()*4),A=Math.floor(Math.random()*4),y=a.u+b/4*a.su,_=a.v+A/4*a.sv,M=a.su/4,C=a.sv/4;this.setGeometryUVs(g.mesh.geometry,y,_,M,C),g.active=!0,g.x=e,g.y=t,g.z=r,g.prevX=e,g.prevY=t,g.prevZ=r,g.xd=i,g.yd=s,g.zd=o,g.age=0,g.maxAge=v,g.onGround=!1,g.floorMap=l,g.blockX=Math.floor(c),g.blockZ=Math.floor(u);let T=.1*(.5+Math.random()*.5)*2*f;g.mesh.scale.set(T,T,T),g.mesh.position.set(e,t,r),g.mesh.visible=!0;let P=.6*m[0],B=.6*m[1],L=.6*m[2],G=new Float32Array([P,B,L,P,B,L,P,B,L,P,B,L]),H=g.mesh.geometry.getAttribute("color");H?(H.set(G),H.needsUpdate=!0):g.mesh.geometry.setAttribute("color",new $t.Float32BufferAttribute(G,3)),this.worldRenderer.sceneOrigin.addAndTrack(g.mesh)}allocateParticle(){let e=new $t.PlaneGeometry(1,1),t=new $t.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 $t.MeshBasicMaterial({map:e,vertexColors:!0,transparent:!0,alphaTest:.1}))}},k6={id:"blockBreakParticles",controller:U1,enabledDefault:!0,cannotBeDisabled:!0,requiresHeightmap:!1};E();x();k();R();var G1=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()}},T6={id:"cameraBobbing",controller:G1,enabledDefault:!0,cannotBeDisabled:!0};E();x();k();R();import*as Oe from"three";var V1=2e3,M6=32,S6=32,Di=12,C6=24,Fi=1.2,d9=-5;var W1=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 Oe.Matrix4);d(this,"tempPosition",new Oe.Vector3);d(this,"tempQuaternion",new Oe.Quaternion);d(this,"tempScale",new Oe.Vector3);d(this,"render",e=>{if(!this.enabled||!this.instancedMesh||!this.material)return;this.syncMaterialToSceneFog();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:v}=this,a=NaN,l=NaN,c;for(let u=0;u<V1;u++){let f=this.particles[u];this.instancedMesh.getMatrixAt(u,i),i.decompose(s,o,v),s.addScaledVector(f.velocity,e);let m=s.y,g=Math.sqrt(s.x*s.x+s.z*s.z),b=t.x+s.x,A=t.y+s.y,y=t.z+s.z,_=Math.floor(b/16),M=Math.floor(y/16);(_!==a||M!==l)&&(c=r[`${_},${M}`],a=_,l=M);let C=(Math.floor(b)%16+16)%16,T=(Math.floor(y)%16+16)%16,P=c?.[T*16+C];if(g>M6||P!==void 0&&P!==-32768&&A<=P+1+f.despawnOffset||m<d9){this.respawnParticle(s);let L=Di+Math.random()*(C6-Di);f.velocity.set((Math.random()-.5)*Fi,-L,(Math.random()-.5)*Fi),f.despawnOffset=Math.random()*.5}i.compose(s,o,v),this.instancedMesh.setMatrixAt(u,i)}this.instancedMesh.instanceMatrix.needsUpdate=!0})}enable(){this.enabled||(this.enabled=!0,this.instancedMesh?this.instancedMesh.visible=!0:this.createRain())}disable(){this.enabled&&(this.enabled=!1,this.instancedMesh&&(this.instancedMesh.visible=!1))}autoEnableCheck(){return this.worldRenderer.worldRendererConfig.isRaining===!0}dispose(){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=[]}syncMaterialToSceneFog(){if(!this.material)return;let e=this.worldRenderer.scene.fog;e instanceof Oe.Fog||e instanceof Oe.FogExp2?this.material.color.copy(e.color):this.material.color.set(13426158),this.material.fog=!0}createRain(){this.geometry=new Oe.BoxGeometry(.03,.3,.03),this.material=new Oe.MeshBasicMaterial({color:13426158,transparent:!0,opacity:.35,depthWrite:!0,fog:!0}),this.instancedMesh=new Oe.InstancedMesh(this.geometry,this.material,V1),this.instancedMesh.name="rain-particles",this.instancedMesh.frustumCulled=!1,this.syncMaterialToSceneFog();let e=new Oe.Matrix4,t=new Oe.Vector3;for(let r=0;r<V1;r++){this.respawnParticle(t),t.y=Math.random()*S6,e.setPosition(t),this.instancedMesh.setMatrixAt(r,e);let i=Di+Math.random()*(C6-Di);this.particles.push({velocity:new Oe.Vector3((Math.random()-.5)*Fi,-i,(Math.random()-.5)*Fi),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()*M6;e.set(Math.cos(t)*r,S6,Math.sin(t)*r)}},B6={id:"rain",controller:W1,enabledDefault:!1,requiresHeightmap:!0};E();x();k();R();import*as Ce from"three";var P6=new Ce.Color(13/255,234/255,238/255),u9=9,f9=12e3,h9=1500,m9=1e4,p9=350,g9=650,I6=120,L6=280,N1=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 Ce.LineBasicMaterial({color:P6,transparent:!0,opacity:1,blending:Ce.AdditiveBlending,depthWrite:!1}));d(this,"wireframeGlowMaterial",new Ce.LineBasicMaterial({color:P6,transparent:!0,opacity:.55,blending:Ce.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 Ce.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>=f9&&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>m9){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?I6:p9,fadeMs:o?L6:g9,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>=u9){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:v,sy:a,sz:l}=o.geometry,c=Math.hypot(v-t.x,a-t.y,l-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*h9,s.wireframeMs=I6,s.fadeMs=L6}}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 Ce.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 Ce.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 v=new Ce.Group;v.name="scifi-reveal-group",v.add(s,o),this.worldRenderer.realScene.add(v),r.visible=!1,this.setShaderMeshesVisible(e.key,!1),e.wireframeGroup=v,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 v=.85+.15*Math.sin(this.pulseTime*6+t*.002);o.color.setRGB(13/255*v,234/255*v,238/255*v)}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 Ce.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 Ce.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 Ce.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 v=0;v<r.length;v+=3){let a=r[v],l=r[v+1],c=r[v+2];this.addEdge(t,a,l,i,s),this.addEdge(t,l,c,i,s),this.addEdge(t,c,a,i,s)}let o=new Ce.BufferGeometry;return o.setAttribute("position",new Ce.Float32BufferAttribute(i,3)),o}addEdge(e,t,r,i,s){let o=Math.min(t,r),v=Math.max(t,r),a=`${o}-${v}`;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]))}},H6={id:"futuristicReveal",controller:N1,enabledDefault:!0};E();x();k();R();import*as Be from"three";var b9=parseInt(Be.REVISION.replaceAll(/\D+/g,""),10),j1=class extends Be.ShaderMaterial{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:`
21490
21661
  uniform float time;
21491
21662
  attribute float size;
21492
21663
  varying vec3 vColor;
@@ -21505,8 +21676,8 @@ void main() {
21505
21676
  gl_FragColor = vec4(vColor, 1.0);
21506
21677
 
21507
21678
  #include <tonemapping_fragment>
21508
- #include <${r9>=154?"colorspace_fragment":"encodings_fragment"}>
21509
- }`})}},vn=class{constructor(e){this.worldRenderer=e;d(this,"points");d(this,"clock",new Te.Clock);d(this,"enabled",!1);d(this,"currentTime");d(this,"enablementCheck",()=>this.currentTime?this.currentTime>13500&&this.currentTime<23e3:!1);d(this,"render",e=>{this.points&&(this.points.position.set(0,0,0),this.points.material.uniforms.time.value=this.clock.getElapsedTime()*.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 Te.BufferGeometry,a=y=>new Te.Vector3().setFromSpherical(new Te.Spherical(y,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),v=[],l=[],c=Array.from({length:r},()=>(.5+.5*Math.random())*i),u=new Te.Color,h=e+t,p=t/r;for(let y=0;y<r;y++)h-=p*Math.random(),v.push(...a(h).toArray()),u.setHSL(y/r,s,.9),l.push(u.r,u.g,u.b);o.setAttribute("position",new Te.Float32BufferAttribute(v,3)),o.setAttribute("color",new Te.Float32BufferAttribute(l,3)),o.setAttribute("size",new Te.Float32BufferAttribute(c,1));let g=new an;g.blending=Te.AdditiveBlending,g.depthTest=!0,g.depthWrite=!1,g.transparent=!0,this.points=new Te.Points(o,g),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)}},Ha={id:"starfield",controller:vn,enabledDefault:!0,cannotBeDisabled:!0};var Oa={starfield:Ha,futuristicReveal:Ia,rain:Ba,cameraBobbing:Ta,blockBreakParticles:ka};var yt=class yt extends g1{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,"chunkTextures",new Map);d(this,"signsCache",new Map);d(this,"cameraSectionPos",new G0(0,0,0));d(this,"holdingBlock");d(this,"holdingBlockLeft");d(this,"scene",new Q.Scene);d(this,"ambientLight",new Q.AmbientLight(13421772));d(this,"directionalLight",new Q.DirectionalLight(16777215,.5));d(this,"entities",new z1(this,globalThis.mcData));d(this,"performanceMonitor");d(this,"cameraGroupVr");d(this,"material",new Q.MeshBasicMaterial({vertexColors:!0,transparent:!0,alphaTest:.1}));d(this,"itemsTexture");d(this,"cursorBlock");d(this,"onRender",[]);d(this,"lastRenderTime",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 Z1(this.scene));d(this,"cameraWorldPos",{x:0,y:0,z:0});d(this,"_cameraPositionAccessWarned",!1);d(this,"_tmpCameraPos",new Q.Vector3);d(this,"currentPosTween");d(this,"currentRotTween");d(this,"_tpDirection",new Q.Vector3);d(this,"_tpPitchQuat",new Q.Quaternion);d(this,"_tpYawQuat",new Q.Quaternion);d(this,"_tpFinalQuat",new Q.Quaternion);d(this,"_tpScenePos",new Q.Vector3);d(this,"_tpAxisX",new Q.Vector3(1,0,0));d(this,"_tpAxisY",new Q.Vector3(0,1,0));d(this,"_tpRaycaster",new Q.Raycaster);d(this,"_tpChunkWorldPos",new Q.Vector3);d(this,"debugOverlayAdded",!1);d(this,"debugRaycastHelper");d(this,"debugHitPoint");d(this,"prevFramePerspective",null);this.performanceMonitor=new l5(this.reactiveState.world.instabilityFactors),this.renderer=t;let s=yt.getRendererInfo(t)??"...";i.rendererState.renderer=s,this.chunkMeshManager=new Y5(this,this.scene,this.material,this.worldSizeParams.worldHeight,this.viewDistance),this.onRenderDistanceChanged=o=>{this.chunkMeshManager.updateViewDistance(o)},this.cursorBlock=new L1(this),this.holdingBlock=U5(this),this.holdingBlockLeft=U5(this,!0);for(let o of Object.values(Oa))this.registerModule(o);this.skyboxRenderer=new K1(this.realScene,!1,null),this.skyboxRenderer.init(),this.addDebugOverlay(),this.resetScene(),this.init(),this.soundSystem=new G1(this),this.cameraShake=new N1(this,this.onRender),this.media=new W1(this),this.fireworksLegacy=new Y1(this),this.waypoints=new j1(this),this.cinimaticScript=new Q1(this,(o,a,v)=>this.setCinimaticCamera(o,a,v),o=>this.setCinimaticFov(o),()=>({position:new G0(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 J1(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}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}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=(v,l,c)=>Math.abs(v)>i||Math.abs(l)>i||Math.abs(c)>i,o=()=>{!r._cameraPositionAccessWarned&&typeof D<"u"},a=new Proxy(t,{set(v,l,c){return(l==="x"||l==="y"||l==="z")&&typeof c=="number"&&Math.abs(c)>i&&o(),v[l]=c,!0},get(v,l,c){let u=v[l];return l==="set"?function(h,p,g){return s(h,p,g)&&o(),v.set(h,p,g)}:l==="setX"||l==="setY"||l==="setZ"?function(h){return Math.abs(h)>i&&o(),v[l](h)}:l==="copy"?function(h){return s(h.x,h.y,h.z)&&o(),v.copy(h)}:typeof u=="function"?u.bind(v):u}});Object.defineProperty(this.camera,"position",{value:a,configurable:!0,enumerable:!0})}worldSwitchActions(){this.onWorldSwitched.push(()=>{this.protocolCustomBlocks.clear(),this.sectionsOffsetsAnimations={},this.waypoints.clear(),this.cinimaticScript.stopScript(),this.fireworks.clear()})}downloadWorldGeometry(){Ki(this,new Q.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.cameraShake.getBaseRotation(),"world-geometry.json")}updateEntity(t,r=!1){let i={rotation:{head:{x:t.headPitch??t.pitch,y:t.headYaw,z:0}}};r?this.entities.updateEntityPosition(t,!1,i):this.entities.update(t,i)}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 Q.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 Q.Vector2);this.camera=new Q.PerspectiveCamera(75,t.x/t.y,.1,1e3),this._wrapCameraPositionWithWarning(),this.cameraContainer=new Q.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)}),this.onReactivePlayerStateUpdated("directionalLight",t=>{t&&(this.directionalLight.intensity=t)}),this.onReactivePlayerStateUpdated("lookingAtBlock",t=>{this.cursorBlock.setHighlightCursorBlock(t?new G0(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 G0(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",r=>{this.updateShowChunksBorder(r)}),this.onReactiveConfigUpdated("defaultSkybox",r=>{this.skyboxRenderer.updateDefaultSkybox(r)}),this.onReactiveConfigUpdated("shaderCubeDebugMode",()=>{this.chunkMeshManager.syncCubeShaderUniforms()}),this.onReactiveConfigUpdated("futuristicReveal",()=>{this.updateModulesFromConfig()});let t=this.displayOptions.inWorldRenderingConfig.handRenderer;this.onReactiveConfigUpdated("handRenderer",r=>{if(r===t)return;t=r;let i=this.holdingBlock.ready,s=this.holdingBlockLeft.ready;this.holdingBlock.dispose(),this.holdingBlockLeft.dispose(),this.holdingBlock=U5(this),this.holdingBlockLeft=U5(this,!0),i&&(this.holdingBlock.ready=!0,this.holdingBlock.updateItem()),s&&(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=I0(t.blocksAtlasImage);s.needsUpdate=!0,s.flipY=!1,this.material.map=s,this.chunkMeshManager.syncCubeShaderUniforms();let o=I0(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 Q.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)}biomeUpdated(t){t?.temperature!==void 0&&this.skyboxRenderer.updateTemperature(t.temperature)}biomeReset(){this.skyboxRenderer.updateTemperature(Gi)}getItemRenderData(t,r){return Z3(t,r,this.resourcesManager,this.playerStateReactive)}async demoModel(){let t=cursorBlockRel(0,1,0).position,r=await R5();Ps(r,t);let i=new Q.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 Q.BoxHelper(r,16776960);r.add(i),this.realScene.add(r)}addDebugOverlay(){if(this.debugOverlayAdded)return;this.debugOverlayAdded=!0;let t=lt("debug-overlay",80,0,void 0,{className:vt});setInterval(()=>{if(t.setVisibility(this.displayAdvancedStats),this.displayAdvancedStats){let r=v=>new Intl.NumberFormat("en-US",{}).format(v),i=v=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(v),s="";s+=`TE: ${r(this.renderer.info.memory.textures)} `,s+=`F: ${i(this.tilesRendered)} `,s+=`B: ${i(this.blocksRendered)} `,s+=`MEM: ${this.chunkMeshManager.getEstimatedMemoryUsage().total} `;let o=this.chunkMeshManager.getStats();s+=`POOL: ${o.activeCount}/${o.poolSize} `;let a=Er(this.reactiveState.world.instabilityFactors);a&&(s+=`PF: ${a} `),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)),v=500-(Math.abs(i-this.cameraSectionPos.x)+Math.abs(s-this.cameraSectionPos.y)+Math.abs(o-this.cameraSectionPos.z)),l=r.mesh??r.shaderMesh??r.children.find(c=>c.name==="mesh"||c.name==="shaderMesh");l&&(l.renderOrder=v)}updateViewerPosition(t){this.viewerChunkPosition=t}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)}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<yt.MAX_SECTION_UPDATE_BUFFER_MS){let[v,l,c]=s.split(",").map(Number),u=[`${v-16},${l},${c}`,`${v+16},${l},${c}`,`${v},${l-r},${c}`,`${v},${l+r},${c}`,`${v},${l},${c-16}`,`${v},${l},${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 a=o.key.split(","),v=`${a[0]},${a[2]}`;if(!this.loadedChunks[v]||!this.active){this.chunkMeshManager.releaseSection(o.key);continue}if(!this.chunkMeshManager.sectionHasRenderableContent(o.geometry)){this.chunkMeshManager.releaseSection(o.key);continue}this.chunkMeshManager.updateSection(o.key,o.geometry),this.updatePosDataChunk(o.key)}}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}this.chunkMeshManager.updateSection(t.key,t.geometry),this.updatePosDataChunk(t.key)}}getSignTexture(t,r,i,s=!1){let o=Ht(t),a=this.chunkTextures.get(`${o[0]},${o[1]}`);a||(a={},this.chunkTextures.set(`${o[0]},${o[1]}`,a));let v=`${t.x},${t.y},${t.z}`;if(a[v])return a[v];let l=i9(this.version),c=m1(r,i,l);if(!c)return;let u=new Q.Texture(c);return u.magFilter=Q.NearestFilter,u.minFilter=Q.NearestFilter,u.needsUpdate=!0,a[v]=u,u}getCameraPosition(t){return(t??this._tmpCameraPos).set(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z)}getSectionCameraPosition(){let t=this.getCameraPosition();return new G0(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){let s=this.playerStateReactive.eyeHeight;this.updateCamera(t?.offset(0,s,0)??null,r,i),this.updateCameraSectionPos()}getThirdPersonCamera(t,r,i){t??(t=new Q.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z));let s=this.playerStateReactive.perspective==="third_person_back",o=4,a=this._tpDirection.set(0,0,-1),v=this._tpPitchQuat.setFromAxisAngle(this._tpAxisX,i),l=this._tpYawQuat.setFromAxisAngle(this._tpAxisY,r),c=this._tpFinalQuat.multiplyQuaternions(l,v);a.applyQuaternion(c),s&&a.multiplyScalar(-1),this.DEBUG_RAYCAST&&this.debugRaycast(t,a,o);let u=this._tpScenePos.set(this.sceneOrigin.toSceneX(t.x),this.sceneOrigin.toSceneY(t.y),this.sceneOrigin.toSceneZ(t.z)),h=this._tpRaycaster;h.set(u,a),h.far=o;let p=80,g=p*p,y=t.x,A=t.y,b=t.z,w=[];for(let B of Object.values(this.sectionObjects)){if(B.name!=="chunk"||!B.visible||B.worldX===void 0)continue;let H=B.worldX-y,G=B.worldY-A,O=B.worldZ-b;if(H*H+G*G+O*O>g)continue;let j=B.children.find(J=>J.name==="mesh"||J.name==="shaderMesh");j&&w.push(j)}let S=h.intersectObjects(w,!1),C=o;S.length>0&&(C=Math.max(.5,S[0].distance-.2));let M=this.chunkMeshManager.raycastShaderSectionAABBs(t,a,C,p);return M!==void 0&&(C=Math.max(.5,M-.2)),new G0(t.x+a.x*C,t.y+a.y*C,t.z+a.z*C)}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 Q.Vector3(this.sceneOrigin.toSceneX(t.x),this.sceneOrigin.toSceneY(t.y),this.sceneOrigin.toSceneZ(t.z));this.debugRaycastHelper=new Q.ArrowHelper(r.clone().normalize(),s,i,16711680,i*.1,i*.05),this.realScene.add(this.debugRaycastHelper);let o=new Q.SphereGeometry(.2,8,8),a=new Q.MeshBasicMaterial({color:65280});this.debugHitPoint=new Q.Mesh(o,a),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,a=Math.min(o/yt.FOV_TRANSITION_MS,1),v=l=>1-(1-l)**3;this.animatedFov+=(i-this.animatedFov)*v(a),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){if(!this.cinimaticScript.running){if(t){this.renderer.xr.isPresenting&&(t.y-=this.camera.position.y),this.currentPosTween?.stop();let s=this.displayOptions.inWorldRenderingConfig.instantCameraUpdate?0:this.playerStateUtils.isSpectatingEntity()?150:50;this.currentPosTween=new Oe(this.cameraWorldPos).to({x:t.x,y:t.y,z:t.z},s).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 s=this.cameraShake.getBaseRotation(),o=0,a=Math.PI/2;s.yaw<a&&r>Math.PI+a?o=-Math.PI*2:r<a&&s.yaw>Math.PI+a&&(o=Math.PI*2),this.currentRotTween?.stop(),this.currentRotTween=new Oe(s).to({pitch:i,yaw:r+o},100).onUpdate(v=>this.cameraShake.setBaseRotation(v.pitch,v.yaw-o)).start()}else{this.currentRotTween?.stop(),this.cameraShake.setBaseRotation(i,r);let{perspective:s}=this.playerStateReactive;if(s==="third_person_back"||s==="third_person_front"){let o=new Q.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),a=this.getThirdPersonCamera(o,r,i),v=o.distanceTo(new Q.Vector3(a.x,a.y,a.z)),l=s==="third_person_back"?v:-v;this.camera.position.set(0,0,l),s==="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:a}=this.reactiveDebugParams,v=this.getSectionHeight(),l=this.cameraSectionPos.y*v;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,g]=c.split(",").map(Number),y=s&&t!==void 0?p<=l+t:o&&r!==void 0?p>=l-r:a&&i!==void 0?Math.abs(p-l)<=i:!0;u.visible=y}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 u=this.renderer.getSize(new Q.Vector2);this.camera.aspect=u.width/u.height,this.camera.updateProjectionMatrix()}let o=0;if(!this.reactiveDebugParams.disableEntities){let u=performance.now();this.entities.render(),o=performance.now()-u}let a=this.cameraGroupVr instanceof Q.Group?this.cameraGroupVr.children.find(u=>u instanceof Q.PerspectiveCamera):this.camera;this.applyPendingSectionUpdates();let v=this.chunkMeshManager.globalBlockBuffer;v&&(v.setCameraOrigin(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),v.compactStep(),v.uploadDirtyRange()),this.renderer.render(this.scene,a),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 u of this.fountains)this.sectionObjects[u.sectionId]&&!this.sectionObjects[u.sectionId].foutain&&(u.createParticles(this.sectionObjects[u.sectionId]),this.sectionObjects[u.sectionId].foutain=!0),u.render();this.waypoints.render(),this.fireworks.update();for(let u of this.onRender)u(i);let c=performance.now()-r;this.worldRendererConfig.autoLowerRenderDistance&&this.chunkMeshManager.recordRenderTime(c),this.renderTimeAvgCount++,this.renderTimeAvg=(this.renderTimeAvg*(this.renderTimeAvgCount-1)+c)/this.renderTimeAvgCount,this.renderTimeMax=Math.max(this.renderTimeMax,c),this.performanceMonitor.onFrame({totalMs:c,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(a=>a.name==="textures")?.value,!!o)try{let v=JSON.parse(z.from(o,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:l}=this.worldRendererConfig;l&&(v=v?.replace("http://textures.minecraft.net/",l).replace("https://textures.minecraft.net/",l));let c=D0(this,v,F0.head),u=new Q.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,-Q.MathUtils.degToRad(r*(i?90:45/2)),0),u.scale.set(.8,.8,.8),u}catch{}}renderSign(t,r,i,s,o){let a=this.getSignTexture(t,o,s);if(!a)return;let v=new Q.Mesh(new Q.PlaneGeometry(1,1),new Q.MeshBasicMaterial({map:a,transparent:!0}));v.renderOrder=999;let l=7/16,c=s?1.3:1;v.scale.set(1*c,l*c,1*c);let u=(s?2:1.5)/16,h=.25/16;i&&!s?v.position.set(0,0,-.5+u+h+1e-4):v.position.set(0,0,u/2+1e-4);let p=new Q.Group;p.rotation.set(0,-Q.MathUtils.degToRad(r*(i?90:45/2)),0),p.add(v);let g=(s?10:8)/16,y=(s?0:i?4.333:9.333)/16,A=g/2+y;return this.sceneOrigin.track(p),p.position.set(t.x+.5,t.y+A,t.z+.5),p}lightUpdate(t,r){for(let i=this.worldSizeParams.minY;i<this.worldSizeParams.worldHeight;i+=16)this.setSectionDirty(new G0(t,i,r))}rerenderAllChunks(){for(let t of Object.keys(this.sectionObjects)){let[r,i,s]=t.split(",").map(Number);this.setSectionDirty(new G0(r,i,s))}}updateShowChunksBorder(t){this.chunkMeshManager.updateAllBoxHelpers(t)}resetWorld(){super.resetWorld(),this.pendingSectionUpdates.clear(),this.pendingSectionBufferStartTimes.clear(),this.chunkMeshManager.dispose(),this.chunkMeshManager=new Y5(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]=Qr(t);return Object.fromEntries(Object.entries(this.sectionObjects).map(([a,v])=>{let[l,c,u]=a.split(",").map(Number),[h,p,g]=Qr({x:l,y:c,z:u});return[r?`${h-i},${p-s},${g-o}`:`${h-i},${g-o}`,v]}))}cleanChunkTextures(t,r){let i=this.chunkTextures.get(`${Math.floor(t/16)},${Math.floor(r/16)}`)??{};for(let s of Object.keys(i))i[s].dispose(),delete i[s];this.chunkMeshManager.cleanSignChunkTextures(t,r)}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.cleanChunkTextures(t,r),this.clearPendingSectionUpdatesForChunk(t,r);let i=this.getSectionHeight(),s=this.worldMinYRender;for(let o=s;o<this.worldSizeParams.worldHeight;o+=i){let a=`${t},${o},${r}`;this.chunkMeshManager.sectionObjects[a]&&this.chunkMeshManager.releaseSection(a)}this.chunkMeshManager.onChunkRemovedFromGate(`${t},${r}`)}updateViewerPosition(t){super.updateViewerPosition(t),this.chunkMeshManager.pendingNearReveal.size>0&&this.chunkMeshManager.tryRevealPending()}onViewerChunkPositionChanged(){this.chunkMeshManager.tryRevealPending()}setSectionDirty(...t){let[r]=t;this.cleanChunkTextures(r.x,r.z),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,a,v=this.sceneOrigin.getWorldPosition(t);v?(s=v.x,o=v.y,a=v.z):(s=this.sceneOrigin.toWorldX(t.position.x),o=this.sceneOrigin.toWorldY(t.position.y),a=this.sceneOrigin.toWorldZ(t.position.z));let l=Math.floor(s/16)*16,c=Math.floor(a/16)*16,u=Math.floor(o/i)*i,h=`${l},${c}`,p=`${l},${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(yt,"FOV_TRANSITION_MS",200),d(yt,"MAX_SECTION_UPDATE_BUFFER_MS",500);var _t=yt;E();x();k();R();E();x();k();R();var N0="1.21.4";E();x();k();R();function wt(n,e){n.aspect=e.width/e.height,n.updateProjectionMatrix()}E();x();k();R();function ln(n,e=!1){return n?.mode?n.mode:e?"worldBlocks":b0.mode}E();x();k();R();import*as ve from"three";E();x();k();R();function cn(...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 dn=new Date,Da=dn.getMonth()===11&&dn.getDate()>=24&&dn.getDate()<=26,n9=["panorama_3.webp","panorama_1.webp","panorama_4.webp","panorama_5.webp","panorama_0.webp","panorama_2.webp"],s9=200,Xt=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 ve.Scene,this.scene.background=new ve.Color(3294568);let t=new ve.AmbientLight(13421772);this.scene.add(t);let r=new ve.DirectionalLight(16777215,.5);r.position.set(1,1,.5).normalize(),r.castShadow=!0,this.scene.add(r),this.camera=new ve.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&&wt(this.camera,this.documentRenderer.canvas)}dispose(){this.scene.clear(),this.panoramaGroup=null,this.startTimes.clear()}buildCubemap(){let e=new ve.BoxGeometry(1e3,1e3,1e3),t=[];for(let s of n9)(async()=>{let a=cn("background",Da?"christmas":"",s),v=await st(a),l=I0(v);l.matrixAutoUpdate=!1,l.matrix.set(-1,0,1,0,1,0,0,0,1),l.wrapS=ve.ClampToEdgeWrapping,l.wrapT=ve.ClampToEdgeWrapping,l.minFilter=ve.LinearFilter,l.magFilter=ve.LinearFilter;let c=new ve.MeshBasicMaterial({map:l,transparent:!0,side:ve.DoubleSide,depthWrite:!1,opacity:0});this.startTimes.set(c,Date.now()),t.push(c)})().catch(a=>{});let r=new ve.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 a=Date.now()-o;s.opacity=Math.min(1,a/s9)}}};let i=new ve.Object3D;if(i.add(r),!Da)for(let s=0;s<20;s++){let o=new M0("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 a=Math.random()*.01;o.children[0].onBeforeRender=()=>{o.rotation.y+=a,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 st(cn("background","panorama_0.webp")),t=I0(e),r=new ve.Mesh(new ve.PlaneGeometry(1e3,1e3),new ve.MeshBasicMaterial({map:t}));r.position.set(0,0,-500),this.scene.add(r)}};E();x();k();R();import*as W from"three";var Fa=.1,fn={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"]},za={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]}},o9={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}},a9={cruise:1,barrel:1.6,dive:2.2,orbit:.7,snake:1.4},v9=250,dr=1e4,ur=3e3,$t=n=>n[Math.floor(Math.random()*n.length)],un=n=>"#"+n.toString(16).padStart(6,"0"),La=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,un(n.top)),n.mid!=null&&s.addColorStop(.45,un(n.mid)),s.addColorStop(1,un(n.bottom)),t.fillStyle=s,t.fillRect(0,0,r,i);let o=new W.CanvasTexture(e);return o.needsUpdate=!0,o},At=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=b0;this.curScene=t.initialScene??i.v2Scene,this.curCam=t.initialCamera??i.v2Camera,this.blockGroup=t.initialBlockGroup??i.v2BlockGroup,this.cameraSpeed=t.initialCameraSpeed??b5.camera,this.blockSpeed=t.initialBlockSpeed??b5.block,this.useMinecraftTextures=t.useMinecraftTextures??i.minecraftTextures,this.resourcesManager=t.resourcesManager;let s=za[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<v9;h++)this.spawnBlock(s,!0);if(!this.useMinecraftTextures){let h=s.edgeLineColor??62975;for(let p=0;p<40;p++){let g=new W.LineBasicMaterial({color:h,transparent:!0,opacity:.25});$t(this.blocks).mesh.add(new W.LineSegments(this.eGeo,g))}}this.scene.add(this.bGroup);let o=new W.BufferGeometry,a=new Float32Array(5e3*3);for(let h=0;h<5e3*3;h++)a[h]=(Math.random()-.5)*500;o.setAttribute("position",new W.BufferAttribute(a,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 v=new Float32Array(dr*3),l=new Float32Array(dr*3);for(let h=0;h<dr;h++){let p=h%3,g=Math.random(),y=p/3*Math.PI*2+g*Math.PI*5,A=g*90+Math.random()*10,b=(1-g)*18;v[h*3]=Math.cos(y)*A+(Math.random()-.5)*b,v[h*3+1]=(Math.random()-.5)*7,v[h*3+2]=Math.sin(y)*A+(Math.random()-.5)*b-180;let w=.2+g*.8,S=s.galFn(w);l[h*3]=S.r,l[h*3+1]=S.g,l[h*3+2]=S.b}this.galGeo.setAttribute("position",new W.BufferAttribute(v,3)),this.galGeo.setAttribute("color",new W.BufferAttribute(l,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(ur*3),u=new Float32Array(ur*3);for(let h=0;h<ur;h++){let p=25+Math.random()*110,g=Math.random()*Math.PI*2,y=(Math.random()-.5)*Math.PI*.5;c[h*3]=p*Math.cos(g)*Math.cos(y),c[h*3+1]=p*Math.sin(y)*.6,c[h*3+2]=p*Math.sin(g)*Math.cos(y)-80;let A=new W.Color($t(s.nebula));u[h*3]=A.r,u[h*3+1]=A.g,u[h*3+2]=A.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:N0,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 h0;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=La(e.gradientBg);s&&(this.gradientSkyTexture.dispose(),this.gradientSkyTexture=s,this.gradientSky.material.map=s,this.gradientSky.material.needsUpdate=!0)}}else{let s=La(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 a={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(a),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:$t(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=I0(t.blocksAtlasImage),this.atlasTexture.flipY=!1,this.atlasTexture.needsUpdate=!0;for(let s of fn[this.blockGroup]){let o=this.resolveBlockAtlasUv(s,i,r);if(!o)continue;let a=this.atlasTexture.clone();a.flipY=!1,a.offset.set(o.u,o.v),a.repeat.set(o.su,o.sv),a.needsUpdate=!0;let v=s.includes("glass"),l=new W.MeshBasicMaterial({map:a,side:W.DoubleSide,transparent:v,opacity:v?.85:1,alphaTest:v?.08:0,depthWrite:!0,toneMapped:!1});this.blockMaterialPool.set(s,l)}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=$t([...this.blockMaterialPool.keys()]);s.minecraftBlockName=o,s.mesh.material=this.blockMaterialPool.get(o).clone()}}setScene(e){if(!tt.includes(e)||e===this.curScene||this.transitioning)return;this.transitioning=!0,this.curScene=e;let t=za[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($t(t.blocks));let r=this.nebGeo.attributes.color;for(let s=0;s<ur;s++){let o=new W.Color($t(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<dr;s++){let o=.2+Math.random()*.8,a=t.galFn(o);i.setXYZ(s,a.r,a.g,a.b)}i.needsUpdate=!0,this.transitioning=!1},150)}setCamera(e){rt.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(it.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&&wt(this.camera,this.documentRenderer.canvas);let r=o9[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*Fa,a=this.my*Fa,v=r.pos(this.camT,o,a),l=r.look(this.camT,o,a);this.camera.position.set(v.x,v.y,v.z),this.camera.lookAt(l.x,l.y,l.z),this.camera.rotation.z=r.roll(this.camT,o);let c=a9[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()}};E();x();k();R();import*as t5 from"three";import{Vec3 as Ga}from"vec3";E();x();k();R();import l9 from"prismarine-world";import c9 from"prismarine-chunk";var Ua=n=>{let e=l9(n),t=c9(n),r=new e(n).sync,i=d9(r);for(let s of i)if(s.startsWith("set")&&s!=="setColumn"){let o=r[s].bind(r);r[s]=(...a)=>{let v=a[0];v.x!==void 0&&!r.getColumnAt(v)&&r.setColumn(Math.floor(v.x/16),Math.floor(v.z/16),new t(void 0)),o(...a)}}return r};function d9(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 e5=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",_t);this._scene=new t5.Scene,this._scene.background=new t5.Color(3294568),this._camera=new t5.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=N0,t=new h0;if(t.currentConfig={version:e,noInventoryGui:!0},await t.updateAssetsData?.({}),this.abortSignal.aborted)return;let r=Ua(e),s=Xa("prismarine-block")(e),a=globalThis.mcData.blocksArray.filter(p=>{if(!p.name.includes("stained_glass"))return!1;let g=s.fromStateId(p.defaultState,0);if(g.shapes?.length!==1)return!1;let y=g.shapes[0];return y[0]===0&&y[1]===0&&y[2]===0&&y[3]===1&&y[4]===1&&y[5]===1}),v=-15,l=100,c=100;for(let p=-l;p<l;p++)for(let g=-c;g<c;g++){let y=a[Math.floor(Math.random()*a.length)];r.setBlockStateId(new Ga(p,g,v),y.defaultState)}this._camera.updateProjectionMatrix(),this._camera.position.set(.5,c/2+.5,.5),this._camera.rotation.set(0,0,0);let u=new Ga(...this._camera.position.toArray()),h=new $0(r,2,u);this.abortSignal.aborted||(this.worldRenderer=new this.WorldRendererClass(this.documentRenderer.renderer,this.options,{version:e,worldView:h,inWorldRenderingConfig:c5,playerStateReactive:G2().reactive,rendererState:J0().reactive,nonReactiveState:J0().nonReactive,resourcesManager:t}),this.worldRenderer instanceof _t&&(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&&wt(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,a=s.clientX/window.innerWidth-.5,v=-(s.clientY/window.innerHeight-.5);i?.stop(),i=new Oe(e.position).to({x:t+a*o,y:r+v*o},0),i.start(),e.updateProjectionMatrix()},{signal:this.abortSignal})}};E();x();k();R();import*as Na from"three";var r5=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=ln(r,i)}get v2(){return this.active instanceof At?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 Na.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 At(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 e5(this.documentRenderer,this.options,this.abortController.signal);default:return new Xt(this.documentRenderer)}}dispose(){this.active?.dispose(),this.active=void 0,this.abortController.abort()}};Q5.ColorManagement.enabled=!1;globalThis.THREE=Q5;var Wa=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),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:e=>n.toggleModule("rain",e),spawnBlockBreakParticles(e,t,r,i,s,o){n.getModule("blockBreakParticles")?.spawnBlockBreakParticles(e,t,r,i,s,o)},spawnBlockCrackParticle(e,t,r,i,s,o,a){n.getModule("blockBreakParticles")?.spawnCrackParticle(e,t,r,i,s,o,a)},async loadGeometryExport(e){let{applyWorldGeometryExport:t}=await Promise.resolve().then(()=>(Ji(),ha));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}}}}),f9=[],fr=(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)}},Va=()=>{let n,e=null,t=null,r=null,i=null,s=(c,u)=>{ae?n=E5(c,f9,globalThis):n=c,e=new h5(n,u?.canvas),globalThis.renderer=e.renderer,globalThis.documentRenderer=e,globalThis.threeJsBackend=l,fr("default",l)},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 r5(e,{...n},u,!!D.env.SINGLE_FILE_BUILD_MODE),fr("menuBackgroundCreated",t),await t.start(u),fr("menuBackgroundReady",t)},a=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=ae?E5(c,[h0,X0],globalThis):c;e.nonReactiveState=h.nonReactiveState,globalThis.resourcesManager=h.resourcesManager,r=new _t(e.renderer,n,h),await r.worldReadyPromise,i=h.inWorldRenderingConfig.enableDebugOverlay?new h1(h.nonReactiveState):null,globalThis.frameTimingCollector=i;let p=e.render;e.render=function(g){p.call(this,g),i?.markFrameStart(),h.inWorldRenderingConfig.paused||r?.render(g),i?.markFrameEnd(),i?.markFrameDisplay()},e.inWorldRenderingConfig=h.inWorldRenderingConfig,globalThis.world=r,fr("worldReady",r)},v=()=>{t&&(t.dispose(),t=null),e&&e.dispose(),r&&(r.destroy(),r=null)},l={id:"threejs",displayName:`three.js ${Q5.REVISION}`,startMenuBackground:o,startWorld:a,disconnect:v,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){i?.markCameraUpdate(!c),r?.setFirstPersonCamera(c,u,h)},get soundSystem(){return r?.soundSystem},get backendMethods(){if(r)return Wa(r)}};return{main:{init:s,backend:l},workerProxy(){return ps({init(c,u){s(c,{canvas:u})},updateSizeExternal(c,u,h){e?.updateSizeExternal(c,u,h)},startMenuBackground:o,startWorld:a,disconnect:v,setRendering:l.setRendering,updateCamera(c,u,h){let p=c?new u9(c.x,c.y,c.z):null;i?.markCameraUpdate(!p),l.updateCamera(p,u,h)},async callBackendMethod(c,...u){if(!r)throw new Error("World renderer not initialized");let p=Wa(r)[c];if(!p)throw new Error(`Backend method ${String(c)} is unavailable`);return p(...u)}})}}};var hr=n=>{let{main:e}=Va();return e.init(n),e.backend};hr.id="threejs";hr.displayName="three.js Blocking Beta";hr.description="Simple, old and stable main thread graphics backend providing balanced performance on top of WebGL2.";E();x();k();R();import*as ja from"three";function h9(n){let e="threeWorker.js",t;if(D.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 mr=async n=>{let e=h9(()=>{}),t=gs(e),r=Pr();r.onSizeChanged((a,v)=>{t.updateSizeExternal(a,v,window.devicePixelRatio||1)});let i=A5(n,e);try{t.init(i,r.canvas)}catch(a){throw ot(i),a}let s=new Proxy({},{get(a,v){if(typeof v=="string")return async(...l)=>t.callBackendMethod(v,...l)}});return{id:"threejs",displayName:`three.js ${ja.REVISION}`,async startMenuBackground(a){let v=a?.resourcesManager?.currentResources?.mcData;if(v){let c={...at,items:"itemsArray",entities:"entitiesArray"};await Xr([e],N0,c,v)}let l=A5(a??{},e);try{await t.startMenuBackground(structuredClone(l))}catch(c){throw ot(l),c}},async startWorld(a){let v={...at,items:"itemsArray",entities:"entitiesArray"};await Xr([e],a.version,v,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 l=A5(a,e);try{await t.startWorld(structuredClone(l))}catch(h){throw ot(l),h}t.updateSizeExternal(r.size.width,r.size.height,window.devicePixelRatio||1);let c=lt("fps");setInterval(()=>{let{fps:h,avgRenderTime:p,worstRenderTime:g}=a.nonReactiveState;c.updateText(`FPS: ${h.toFixed(0)} (${p.toFixed(0)}ms/${g.toFixed(0)}ms)`),a.nonReactiveState.fps=0},1e3);let u=lt("downloaded-chunks",100,140,20,{className:vt});setInterval(()=>{let h=(n.config.statsVisible??0)>1;u.setVisibility(h),h&&u.updateText(a.nonReactiveState.world.chunksFullInfo)},200)},disconnect(){r.destroy(),t.disconnect(),e.terminate()},setRendering(a){t.setRendering(a)},updateCamera(a,v,l){t.updateCamera(a?{x:a.x,y:a.y,z:a.z}:null,v,l)},soundSystem:void 0,backendMethods:s}};mr.id="threejs-off-thread";mr.displayName="three.js Multi-thread EXPERIMENTAL";mr.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{ns as AppViewer,Xt as ClassicMenuBackground,h5 as DocumentRenderer,Ar as HIGH_TEXTURE_COUNT,r1 as LONG_RENDER_TIME_MS,wr as LOW_FPS_THRESHOLD,Bt as LoadedResourcesTransferrable,vt as MC_RENDERER_DEBUG_OVERLAY_CLASS,N0 as MENU_BACKGROUND_MC_VERSION,b5 as MENU_BACKGROUND_MOTION_DEFAULTS,b0 as MENU_BACKGROUND_OPTION_DEFAULTS,fn as MINECRAFT_BLOCK_GROUPS,it as MINECRAFT_BLOCK_GROUP_IDS,g5 as MINECRAFT_BLOCK_GROUP_LABELS,r5 as MenuBackgroundRenderer,l5 as PerformanceMonitor,ss as RENDERER_DEFAULT_OPTIONS,os as RENDERER_OPTIONS_META,as as RENDERER_RENDER_GUI_SECTIONS,h0 as ResourcesManager,At as V2MenuBackground,rt as V2_CAMERA_IDS,p5 as V2_CAMERA_LABELS,tt as V2_SCENE_IDS,m5 as V2_SCENE_LABELS,e5 as WorldBlocksMenuBackground,$0 as WorldView,X0 as WorldViewWorker,Pr as addCanvasForWorker,H6 as applyMenuBackgroundLiveOptions,_f as applyRendererEnableLighting,L6 as applyRendererOptions,bf as applyRendererWorldViewOptions,Mt as chunkPos,mr as createGraphicsBackendOffThread,hr as createGraphicsBackendSingleThread,El as createWorldRendererConfig,L2 as defaultGraphicsBackendConfig,_r as defaultPerformanceInstabilityFactors,c5 as defaultWorldRendererConfig,W2 as delayedIterator,Er as formatPerformanceFactorsDebug,J0 as getDefaultRendererState,ds as getInitialPlayerState,N6 as getInitialPlayerStateRenderer,G6 as getPlayerStateUtils,ae as isWebWorker,gf as menuBackgroundOptionsFromStorage,E0 as menuBackgroundSpeedToMultiplier,x6 as migrateRendererOptions,Or as rendererShaderCubeDebugModeToValue,d6 as sectionPos,yf as subscribeRendererOptions};
21679
+ #include <${b9>=154?"colorspace_fragment":"encodings_fragment"}>
21680
+ }`})}},Q1=class{constructor(e){this.worldRenderer=e;d(this,"points");d(this,"timer",new Be.Timer);d(this,"enabled",!1);d(this,"currentTime");d(this,"enablementCheck",()=>this.currentTime?this.currentTime>13500&&this.currentTime<23e3:!1);d(this,"render",e=>{this.points&&(this.points.position.set(0,0,0),this.timer.update(performance.now()),this.points.material.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 Be.BufferGeometry,v=b=>new Be.Vector3().setFromSpherical(new Be.Spherical(b,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),a=[],l=[],c=Array.from({length:r},()=>(.5+.5*Math.random())*i),u=new Be.Color,f=e+t,m=t/r;for(let b=0;b<r;b++)f-=m*Math.random(),a.push(...v(f).toArray()),u.setHSL(b/r,s,.9),l.push(u.r,u.g,u.b);o.setAttribute("position",new Be.Float32BufferAttribute(a,3)),o.setAttribute("color",new Be.Float32BufferAttribute(l,3)),o.setAttribute("size",new Be.Float32BufferAttribute(c,1));let g=new j1;g.blending=Be.AdditiveBlending,g.depthTest=!0,g.depthWrite=!1,g.transparent=!0,this.points=new Be.Points(o,g),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)}},O6={id:"starfield",controller:Q1,enabledDefault:!0,cannotBeDisabled:!0};var D6={starfield:O6,futuristicReveal:H6,rain:B6,cameraBobbing:T6,blockBreakParticles:k6};var _t=class _t extends Hr{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,"chunkTextures",new Map);d(this,"signsCache",new Map);d(this,"cameraSectionPos",new e0(0,0,0));d(this,"holdingBlock");d(this,"holdingBlockLeft");d(this,"scene",new K.Scene);d(this,"ambientLight",new K.AmbientLight(13421772,_t.LEGACY_TO_PHYSICAL_LIGHT));d(this,"directionalLight",new K.DirectionalLight(16777215,.5*_t.LEGACY_TO_PHYSICAL_LIGHT));d(this,"entities",new ri(this,globalThis.mcData));d(this,"performanceMonitor");d(this,"cameraGroupVr");d(this,"material",new K.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 hi(this.scene));d(this,"cameraWorldPos",{x:0,y:0,z:0});d(this,"_cameraPositionAccessWarned",!1);d(this,"_tmpCameraPos",new K.Vector3);d(this,"currentPosTween");d(this,"currentRotTween");d(this,"_tpDirection",new K.Vector3);d(this,"_tpPitchQuat",new K.Quaternion);d(this,"_tpYawQuat",new K.Quaternion);d(this,"_tpFinalQuat",new K.Quaternion);d(this,"_tpScenePos",new K.Vector3);d(this,"_tpAxisX",new K.Vector3(1,0,0));d(this,"_tpAxisY",new K.Vector3(0,1,0));d(this,"_tpRaycaster",new K.Raycaster);d(this,"_tpChunkWorldPos",new K.Vector3);d(this,"debugOverlayAdded",!1);d(this,"debugRaycastHelper");d(this,"debugHitPoint");d(this,"prevFramePerspective",null);this.performanceMonitor=new w5(this.reactiveState.world.instabilityFactors),this.renderer=t;let s=_t.getRendererInfo(t)??"...";i.rendererState.renderer=s,this.chunkMeshManager=new lr(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 ii(this),this.holdingBlock=Z5(this),this.holdingBlockLeft=Z5(this,!0);for(let o of Object.values(D6))this.registerModule(o);this.skyboxRenderer=new ui(this.realScene,!1,null),this.skyboxRenderer.init(),this.addDebugOverlay(),this.resetScene(),this.init(),this.soundSystem=new si(this),this.cameraShake=new oi(this,this.onRender),this.media=new ai(this),this.fireworksLegacy=new ci(this),this.waypoints=new li(this),this.cinimaticScript=new di(this,(o,v,a)=>this.setCinimaticCamera(o,v,a),o=>this.setCinimaticFov(o),()=>({position:new e0(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 fi(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}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}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,l,c)=>Math.abs(a)>i||Math.abs(l)>i||Math.abs(c)>i,o=()=>{!r._cameraPositionAccessWarned&&typeof O<"u"},v=new Proxy(t,{set(a,l,c){return(l==="x"||l==="y"||l==="z")&&typeof c=="number"&&Math.abs(c)>i&&o(),a[l]=c,!0},get(a,l,c){let u=a[l];return l==="set"?function(f,m,g){return s(f,m,g)&&o(),a.set(f,m,g)}:l==="setX"||l==="setY"||l==="setZ"?function(f){return Math.abs(f)>i&&o(),a[l](f)}:l==="copy"?function(f){return s(f.x,f.y,f.z)&&o(),a.copy(f)}:typeof u=="function"?u.bind(a):u}});Object.defineProperty(this.camera,"position",{value:v,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(){E1(this,new K.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.cameraShake.getBaseRotation(),"world-geometry.json")}updateEntity(t,r=!1){let i={rotation:{head:{x:t.headPitch??t.pitch,y:t.headYaw,z:0}}};r?this.entities.updateEntityPosition(t,!1,i):this.entities.update(t,i)}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 K.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 K.Vector2);this.camera=new K.PerspectiveCamera(75,t.x/t.y,.1,1e3),this._wrapCameraPositionWithWarning(),this.cameraContainer=new K.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*_t.LEGACY_TO_PHYSICAL_LIGHT)}),this.onReactivePlayerStateUpdated("directionalLight",t=>{t&&(this.directionalLight.intensity=t*_t.LEGACY_TO_PHYSICAL_LIGHT)}),this.onReactivePlayerStateUpdated("lookingAtBlock",t=>{this.cursorBlock.setHighlightCursorBlock(t?new e0(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 e0(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",r=>{this.updateShowChunksBorder(r)}),this.onReactiveConfigUpdated("defaultSkybox",r=>{this.skyboxRenderer.updateDefaultSkybox(r)}),this.onReactiveConfigUpdated("shaderCubeDebugMode",()=>{this.chunkMeshManager.syncCubeShaderUniforms(),this.chunkMeshManager.syncLegacyShaderUniforms()}),this.onReactiveConfigUpdated("futuristicReveal",()=>{this.updateModulesFromConfig()});let t=this.displayOptions.inWorldRenderingConfig.handRenderer;this.onReactiveConfigUpdated("handRenderer",r=>{if(r===t)return;t=r;let i=this.holdingBlock.ready,s=this.holdingBlockLeft.ready;this.holdingBlock.dispose(),this.holdingBlockLeft.dispose(),this.holdingBlock=Z5(this),this.holdingBlockLeft=Z5(this,!0),i&&(this.holdingBlock.ready=!0,this.holdingBlock.updateItem()),s&&(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=jt(t.blocksAtlasImage);s.needsUpdate=!0,s.flipY=!1,this.material.map=s,this.chunkMeshManager.syncCubeShaderUniforms(),this.chunkMeshManager.syncLegacyShaderUniforms();let o=jt(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 K.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=Ht(t)/15;this.chunkMeshManager.setSkyLevel(r)}onDayCycleSkyLightChanged(t){}biomeUpdated(t){t?.temperature!==void 0&&this.skyboxRenderer.updateTemperature(t.temperature)}biomeReset(){this.skyboxRenderer.updateTemperature(m1)}getItemRenderData(t,r){return L3(t,r,this.resourcesManager,this.playerStateReactive)}async demoModel(){let t=cursorBlockRel(0,1,0).position,r=await D5();go(r,t);let i=new K.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 K.BoxHelper(r,16776960);r.add(i),this.realScene.add(r)}addDebugOverlay(){if(this.debugOverlayAdded)return;this.debugOverlayAdded=!0;let t=A0("debug-overlay",80,0,void 0,{className:w0});setInterval(()=>{if(t.setVisibility(this.displayAdvancedStats),this.displayAdvancedStats){let r=a=>new Intl.NumberFormat("en-US",{}).format(a),i=a=>new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(a),s="";s+=`TE: ${r(this.renderer.info.memory.textures)} `,s+=`F: ${i(this.tilesRendered)} `,s+=`B: ${i(this.blocksRendered)} `,s+=`MEM: ${this.chunkMeshManager.getEstimatedMemoryUsage().total} `;let o=this.chunkMeshManager.getStats();s+=`POOL: ${o.activeCount}/${o.poolSize} `;let v=Xi(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)),l=r.mesh??r.shaderMesh??r.children.find(c=>c.name==="mesh"||c.name==="shaderMesh");l&&(l.renderOrder=a)}updateViewerPosition(t){this.viewerChunkPosition=t}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<_t.MAX_SECTION_UPDATE_BUFFER_MS){let[a,l,c]=s.split(",").map(Number),u=[`${a-16},${l},${c}`,`${a+16},${l},${c}`,`${a},${l-r},${c}`,`${a},${l+r},${c}`,`${a},${l},${c-16}`,`${a},${l},${c+16}`],f=!1;for(let m of u)if(this.sectionsWaiting.has(m)&&!this.pendingSectionUpdates.has(m)&&this.sectionObjects[m]){f=!0;break}if(f)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 v=o.key.split(","),a=`${v[0]},${v[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 l=this.chunkMeshManager.updateSection(o.key,o.geometry);this.updatePosDataChunk(o.key),l&&this.getModule("futuristicReveal")?.onSectionMeshed?.(o.key,o.geometry,l)}}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)}}getSignTexture(t,r,i,s=!1){let o=j0(t),v=this.chunkTextures.get(`${o[0]},${o[1]}`);v||(v={},this.chunkTextures.set(`${o[0]},${o[1]}`,v));let a=`${t.x},${t.y},${t.z}`;if(v[a])return v[a];let l=y9(this.version),c=Pr(r,i,l);if(!c)return;let u=new K.Texture(c);return u.magFilter=K.NearestFilter,u.minFilter=K.NearestFilter,u.needsUpdate=!0,v[a]=u,u}getCameraPosition(t){return(t??this._tmpCameraPos).set(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z)}getSectionCameraPosition(){let t=this.getCameraPosition();return new e0(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){let s=this.playerStateReactive.eyeHeight;this.updateCamera(t?.offset(0,s,0)??null,r,i),this.updateCameraSectionPos()}getThirdPersonCamera(t,r,i){t??(t=new K.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z));let s=this.playerStateReactive.perspective==="third_person_back",o=4,v=this._tpDirection.set(0,0,-1),a=this._tpPitchQuat.setFromAxisAngle(this._tpAxisX,i),l=this._tpYawQuat.setFromAxisAngle(this._tpAxisY,r),c=this._tpFinalQuat.multiplyQuaternions(l,a);v.applyQuaternion(c),s&&v.multiplyScalar(-1),this.DEBUG_RAYCAST&&this.debugRaycast(t,v,o);let u=this._tpRaycaster;u.set(t,v),u.far=o;let f=80,m=f*f,g=t.x,b=t.y,A=t.z,y=[];for(let B of Object.values(this.sectionObjects)){if(B.name!=="chunk"||!B.visible||B.worldX===void 0)continue;let L=B.worldX-g,G=B.worldY-b,H=B.worldZ-A;if(L*L+G*G+H*H>m)continue;let N=B.children.find(Y=>Y.name==="mesh");N&&y.push(N)}let _=u.intersectObjects(y,!1),M=o;_.length>0&&(M=Math.max(.5,_[0].distance-.2));let C=this.chunkMeshManager.raycastShaderSectionAABBs(t,v,M,f);C!==void 0&&(M=Math.max(.5,C-.2));let T=this.chunkMeshManager.raycastGlobalLegacySections(u,t,f);return T!==void 0&&(M=Math.max(.5,T-.2)),new e0(t.x+v.x*M,t.y+v.y*M,t.z+v.z*M)}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 K.Vector3(this.sceneOrigin.toSceneX(t.x),this.sceneOrigin.toSceneY(t.y),this.sceneOrigin.toSceneZ(t.z));this.debugRaycastHelper=new K.ArrowHelper(r.clone().normalize(),s,i,16711680,i*.1,i*.05),this.realScene.add(this.debugRaycastHelper);let o=new K.SphereGeometry(.2,8,8),v=new K.MeshBasicMaterial({color:65280});this.debugHitPoint=new K.Mesh(o,v),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,v=Math.min(o/_t.FOV_TRANSITION_MS,1),a=l=>1-(1-l)**3;this.animatedFov+=(i-this.animatedFov)*a(v),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){if(!this.cinimaticScript.running){if(t){this.renderer.xr.isPresenting&&(t.y-=this.camera.position.y),this.currentPosTween?.stop();let s=this.displayOptions.inWorldRenderingConfig.instantCameraUpdate?0:this.playerStateUtils.isSpectatingEntity()?150:50;this.currentPosTween=new ze(this.cameraWorldPos).to({x:t.x,y:t.y,z:t.z},s).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 s=this.cameraShake.getBaseRotation(),o=0,v=Math.PI/2;s.yaw<v&&r>Math.PI+v?o=-Math.PI*2:r<v&&s.yaw>Math.PI+v&&(o=Math.PI*2),this.currentRotTween?.stop(),this.currentRotTween=new ze(s).to({pitch:i,yaw:r+o},100).onUpdate(a=>this.cameraShake.setBaseRotation(a.pitch,a.yaw-o)).start()}else{this.currentRotTween?.stop(),this.cameraShake.setBaseRotation(i,r);let{perspective:s}=this.playerStateReactive;if(s==="third_person_back"||s==="third_person_front"){let o=new K.Vector3(this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),v=this.getThirdPersonCamera(o,r,i),a=o.distanceTo(new K.Vector3(v.x,v.y,v.z)),l=s==="third_person_back"?a:-a;this.camera.position.set(0,0,l),s==="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:v}=this.reactiveDebugParams,a=this.getSectionHeight(),l=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[f,m,g]=c.split(",").map(Number),b=s&&t!==void 0?m<=l+t:o&&r!==void 0?m>=l-r:v&&i!==void 0?Math.abs(m-l)<=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 M=this.renderer.getSize(new K.Vector2);this.camera.aspect=M.width/M.height,this.camera.updateProjectionMatrix()}let o=0;if(!this.reactiveDebugParams.disableEntities){let M=performance.now();this.entities.render(),o=performance.now()-M}let v=this.cameraGroupVr instanceof K.Group?this.cameraGroupVr.children.find(M=>M instanceof K.PerspectiveCamera):this.camera;this.applyPendingSectionUpdates();let a=performance.now(),l=a-this.lastSciFiTickMs;this.lastSciFiTickMs=a,this.getModule("futuristicReveal")?.tick?.(l,a);let c=this.cameraWorldPos.x,u=this.cameraWorldPos.y,f=this.cameraWorldPos.z;this.chunkMeshManager.maybeRebase({x:c,y:u,z:f});let m=this.chunkMeshManager.getRenderOrigin(),g=this.chunkMeshManager.globalBlockBuffer;g&&(g.setCameraOrigin(m,c,u,f),g.setDebugOverlay(this.displayOptions.inWorldRenderingConfig.enableDebugOverlay),g.compactStep(),g.hasPendingUploads()&&g.uploadDirtyRange(),g.suppressThreeDraw());let b=this.chunkMeshManager.globalLegacyBuffer;b?.hasPendingUploads()&&b.uploadDirtyRange();let A=this.chunkMeshManager.globalLegacyBlendBuffer;A?.hasPendingUploads()&&A.uploadDirtyRange(),this.chunkMeshManager.setLegacyCameraOrigin(c,u,f),this.chunkMeshManager.updateCullDirtyFromCamera(v,c,u,f),this.chunkMeshManager.cullDirty&&(this.chunkMeshManager.updateSectionCullAndSort(v,this.cameraWorldPos.x,this.cameraWorldPos.y,this.cameraWorldPos.z),this.chunkMeshManager.clearCullDirty()),this.renderer.render(this.scene,v),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 M of this.fountains)this.sectionObjects[M.sectionId]&&!this.sectionObjects[M.sectionId].foutain&&(M.createParticles(this.sectionObjects[M.sectionId]),this.sectionObjects[M.sectionId].foutain=!0),M.render();this.waypoints.render(),this.fireworks.update();for(let M of this.onRender)M(i);let _=performance.now()-r;this.worldRendererConfig.autoLowerRenderDistance&&this.chunkMeshManager.recordRenderTime(_),this.renderTimeAvgCount++,this.renderTimeAvg=(this.renderTimeAvg*(this.renderTimeAvgCount-1)+_)/this.renderTimeAvgCount,this.renderTimeMax=Math.max(this.renderTimeMax,_),this.performanceMonitor.onFrame({totalMs:_,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(v=>v.name==="textures")?.value,!!o)try{let a=JSON.parse(D.from(o,"base64").toString()).textures?.SKIN?.url,{skinTexturesProxy:l}=this.worldRendererConfig;l&&(a=a?.replace("http://textures.minecraft.net/",l).replace("https://textures.minecraft.net/",l));let c=Kt(this,a,Jt.head),u=new K.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,-K.MathUtils.degToRad(r*(i?90:45/2)),0),u.scale.set(.8,.8,.8),u}catch{}}renderSign(t,r,i,s,o){let v=this.getSignTexture(t,o,s);if(!v)return;let a=new K.Mesh(new K.PlaneGeometry(1,1),new K.MeshBasicMaterial({map:v,transparent:!0}));a.renderOrder=999;let l=7/16,c=s?1.3:1;a.scale.set(1*c,l*c,1*c);let u=(s?2:1.5)/16,f=.25/16;i&&!s?a.position.set(0,0,-.5+u+f+1e-4):a.position.set(0,0,u/2+1e-4);let m=new K.Group;m.rotation.set(0,-K.MathUtils.degToRad(r*(i?90:45/2)),0),m.add(a);let g=(s?10:8)/16,b=(s?0:i?4.333:9.333)/16,A=g/2+b;return this.sceneOrigin.track(m),m.position.set(t.x+.5,t.y+A,t.z+.5),m}lightUpdate(t,r){for(let i=this.worldSizeParams.minY;i<this.worldSizeParams.worldHeight;i+=16)this.setSectionDirty(new e0(t,i,r))}rerenderAllChunks(){for(let t of Object.keys(this.sectionObjects)){let[r,i,s]=t.split(",").map(Number);this.setSectionDirty(new e0(r,i,s))}}updateShowChunksBorder(t){this.chunkMeshManager.updateAllBoxHelpers(t)}resetWorld(){super.resetWorld(),this.pendingSectionUpdates.clear(),this.pendingSectionBufferStartTimes.clear(),this.chunkMeshManager.dispose(),this.chunkMeshManager=new lr(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]=An(t);return Object.fromEntries(Object.entries(this.sectionObjects).map(([v,a])=>{let[l,c,u]=v.split(",").map(Number),[f,m,g]=An({x:l,y:c,z:u});return[r?`${f-i},${m-s},${g-o}`:`${f-i},${g-o}`,a]}))}cleanChunkTextures(t,r){let i=this.chunkTextures.get(`${Math.floor(t/16)},${Math.floor(r/16)}`)??{};for(let s of Object.keys(i))i[s].dispose(),delete i[s];this.chunkMeshManager.cleanSignChunkTextures(t,r)}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.cleanChunkTextures(t,r),this.clearPendingSectionUpdatesForChunk(t,r);let i=this.getSectionHeight(),s=this.worldMinYRender;for(let o=s;o<this.worldSizeParams.worldHeight;o+=i){let v=`${t},${o},${r}`;this.chunkMeshManager.sectionObjects[v]&&this.chunkMeshManager.releaseSection(v)}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,v,a=this.sceneOrigin.getWorldPosition(t);a?(s=a.x,o=a.y,v=a.z):(s=this.sceneOrigin.toWorldX(t.position.x),o=this.sceneOrigin.toWorldY(t.position.y),v=this.sceneOrigin.toWorldZ(t.position.z));let l=Math.floor(s/16)*16,c=Math.floor(v/16)*16,u=Math.floor(o/i)*i,f=`${l},${c}`,m=`${l},${u},${c}`;return!!this.finishedChunks[f]||!!this.sectionObjects[m]}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(_t,"LEGACY_TO_PHYSICAL_LIGHT",Math.PI),d(_t,"FOV_TRANSITION_MS",200),d(_t,"MAX_SECTION_UPDATE_BUFFER_MS",500);var B0=_t;E();x();k();R();E();x();k();R();var t0="1.21.4";E();x();k();R();function P0(n,e){n.aspect=e.width/e.height,n.updateProjectionMatrix()}E();x();k();R();function Y1(n,e=!1){return n?.mode?n.mode:e?"worldBlocks":Tt.mode}E();x();k();R();import*as ue from"three";E();x();k();R();function K1(...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 J1=new Date,F6=J1.getMonth()===11&&J1.getDate()>=24&&J1.getDate()<=26,_9=["panorama_3.webp","panorama_1.webp","panorama_4.webp","panorama_5.webp","panorama_0.webp","panorama_2.webp"],w9=200,c5=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&&P0(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 _9)(async()=>{let v=K1("background",F6?"christmas":"",s),a=await b0(v),l=jt(a);l.matrixAutoUpdate=!1,l.matrix.set(-1,0,1,0,1,0,0,0,1),l.wrapS=ue.ClampToEdgeWrapping,l.wrapT=ue.ClampToEdgeWrapping,l.minFilter=ue.LinearFilter,l.magFilter=ue.LinearFilter;let c=new ue.MeshBasicMaterial({map:l,transparent:!0,side:ue.DoubleSide,depthWrite:!1,opacity:0});this.startTimes.set(c,Date.now()),t.push(c)})().catch(v=>{});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 v=Date.now()-o;s.opacity=Math.min(1,v/w9)}}};let i=new ue.Object3D;if(i.add(r),!F6)for(let s=0;s<20;s++){let o=new zt("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 v=Math.random()*.01;o.children[0].onBeforeRender=()=>{o.rotation.y+=v,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 b0(K1("background","panorama_0.webp")),t=jt(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)}};E();x();k();R();import*as W from"three";var z6=.1,X1={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"]},U6={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]}},A9={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}},E9={cruise:1,barrel:1.6,dive:2.2,orbit:.7,snake:1.4},x9=250,zi=1e4,Ui=3e3,d5=n=>n[Math.floor(Math.random()*n.length)],q1=n=>"#"+n.toString(16).padStart(6,"0"),G6=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,q1(n.top)),n.mid!=null&&s.addColorStop(.45,q1(n.mid)),s.addColorStop(1,q1(n.bottom)),t.fillStyle=s,t.fillRect(0,0,r,i);let o=new W.CanvasTexture(e);return o.needsUpdate=!0,o},I0=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=Tt;this.curScene=t.initialScene??i.v2Scene,this.curCam=t.initialCamera??i.v2Camera,this.blockGroup=t.initialBlockGroup??i.v2BlockGroup,this.cameraSpeed=t.initialCameraSpeed??C5.camera,this.blockSpeed=t.initialBlockSpeed??C5.block,this.useMinecraftTextures=t.useMinecraftTextures??i.minecraftTextures,this.resourcesManager=t.resourcesManager;let s=U6[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 f=0;f<x9;f++)this.spawnBlock(s,!0);if(!this.useMinecraftTextures){let f=s.edgeLineColor??62975;for(let m=0;m<40;m++){let g=new W.LineBasicMaterial({color:f,transparent:!0,opacity:.25});d5(this.blocks).mesh.add(new W.LineSegments(this.eGeo,g))}}this.scene.add(this.bGroup);let o=new W.BufferGeometry,v=new Float32Array(5e3*3);for(let f=0;f<5e3*3;f++)v[f]=(Math.random()-.5)*500;o.setAttribute("position",new W.BufferAttribute(v,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(zi*3),l=new Float32Array(zi*3);for(let f=0;f<zi;f++){let m=f%3,g=Math.random(),b=m/3*Math.PI*2+g*Math.PI*5,A=g*90+Math.random()*10,y=(1-g)*18;a[f*3]=Math.cos(b)*A+(Math.random()-.5)*y,a[f*3+1]=(Math.random()-.5)*7,a[f*3+2]=Math.sin(b)*A+(Math.random()-.5)*y-180;let _=.2+g*.8,M=s.galFn(_);l[f*3]=M.r,l[f*3+1]=M.g,l[f*3+2]=M.b}this.galGeo.setAttribute("position",new W.BufferAttribute(a,3)),this.galGeo.setAttribute("color",new W.BufferAttribute(l,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(Ui*3),u=new Float32Array(Ui*3);for(let f=0;f<Ui;f++){let m=25+Math.random()*110,g=Math.random()*Math.PI*2,b=(Math.random()-.5)*Math.PI*.5;c[f*3]=m*Math.cos(g)*Math.cos(b),c[f*3+1]=m*Math.sin(b)*.6,c[f*3+2]=m*Math.sin(g)*Math.cos(b)-80;let A=new W.Color(d5(s.nebula));u[f*3]=A.r,u[f*3+1]=A.g,u[f*3+2]=A.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:t0,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 At;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=G6(e.gradientBg);s&&(this.gradientSkyTexture.dispose(),this.gradientSkyTexture=s,this.gradientSky.material.map=s,this.gradientSky.material.needsUpdate=!0)}}else{let s=G6(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 v={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(v),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:d5(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=jt(t.blocksAtlasImage),this.atlasTexture.flipY=!1,this.atlasTexture.needsUpdate=!0;for(let s of X1[this.blockGroup]){let o=this.resolveBlockAtlasUv(s,i,r);if(!o)continue;let v=this.atlasTexture.clone();v.flipY=!1,v.offset.set(o.u,o.v),v.repeat.set(o.su,o.sv),v.needsUpdate=!0;let a=s.includes("glass"),l=new W.MeshBasicMaterial({map:v,side:W.DoubleSide,transparent:a,opacity:a?.85:1,alphaTest:a?.08:0,depthWrite:!0,toneMapped:!1});this.blockMaterialPool.set(s,l)}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=d5([...this.blockMaterialPool.keys()]);s.minecraftBlockName=o,s.mesh.material=this.blockMaterialPool.get(o).clone()}}setScene(e){if(!h0.includes(e)||e===this.curScene||this.transitioning)return;this.transitioning=!0,this.curScene=e;let t=U6[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(d5(t.blocks));let r=this.nebGeo.attributes.color;for(let s=0;s<Ui;s++){let o=new W.Color(d5(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<zi;s++){let o=.2+Math.random()*.8,v=t.galFn(o);i.setXYZ(s,v.r,v.g,v.b)}i.needsUpdate=!0,this.transitioning=!1},150)}setCamera(e){m0.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(p0.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&&P0(this.camera,this.documentRenderer.canvas);let r=A9[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*z6,v=this.my*z6,a=r.pos(this.camT,o,v),l=r.look(this.camT,o,v);this.camera.position.set(a.x,a.y,a.z),this.camera.lookAt(l.x,l.y,l.z),this.camera.rotation.z=r.roll(this.camT,o);let c=E9[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 f=u.mesh.userData.baseOpacity??.38;u.mesh.userData.baseOpacity==null&&(u.mesh.userData.baseOpacity=f);let m=.88+Math.abs(Math.sin(this.animTime*8e-4+u.mesh.position.x*.3))*.12;u.mesh.material.opacity=f*m}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()}};E();x();k();R();import*as f5 from"three";import{Vec3 as W6}from"vec3";E();x();k();R();import R9 from"prismarine-world";import k9 from"prismarine-chunk";var V6=n=>{let e=R9(n),t=k9(n),r=new e(n).sync,i=T9(r);for(let s of i)if(s.startsWith("set")&&s!=="setColumn"){let o=r[s].bind(r);r[s]=(...v)=>{let a=v[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(...v)}}return r};function T9(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 u5=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",B0);this._scene=new f5.Scene,this._scene.background=new f5.Color(3294568),this._camera=new f5.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=t0,t=new At;if(t.currentConfig={version:e,noInventoryGui:!0},await t.updateAssetsData?.({}),this.abortSignal.aborted)return;let r=V6(e),s=e7("prismarine-block")(e),v=globalThis.mcData.blocksArray.filter(m=>{if(!m.name.includes("stained_glass"))return!1;let g=s.fromStateId(m.defaultState,0);if(g.shapes?.length!==1)return!1;let b=g.shapes[0];return b[0]===0&&b[1]===0&&b[2]===0&&b[3]===1&&b[4]===1&&b[5]===1}),a=-15,l=100,c=100;for(let m=-l;m<l;m++)for(let g=-c;g<c;g++){let b=v[Math.floor(Math.random()*v.length)];r.setBlockStateId(new W6(m,g,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 W6(...this._camera.position.toArray()),f=new u0(r,2,u);this.abortSignal.aborted||(this.worldRenderer=new this.WorldRendererClass(this.documentRenderer.renderer,this.options,{version:e,worldView:f,inWorldRenderingConfig:A5,playerStateReactive:R2().reactive,rendererState:v0().reactive,nonReactiveState:v0().nonReactive,resourcesManager:t}),this.worldRenderer instanceof B0&&(this._scene=this.worldRenderer.realScene,this._camera=this.worldRenderer.camera),f.init(u),await this.worldRenderer.waitForChunksToRender(),!this.abortSignal.aborted&&this.setupMouseParallax())}update(e,t){t&&P0(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,v=s.clientX/window.innerWidth-.5,a=-(s.clientY/window.innerHeight-.5);i?.stop(),i=new ze(e.position).to({x:t+v*o,y:r+a*o},0),i.start(),e.updateProjectionMatrix()},{signal:this.abortSignal})}};E();x();k();R();import*as N6 from"three";var h5=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=Y1(r,i)}get v2(){return this.active instanceof I0?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 N6.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 I0(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 u5(this.documentRenderer,this.options,this.abortController.signal);default:return new c5(this.documentRenderer)}}dispose(){this.active?.dispose(),this.active=void 0,this.abortController.abort()}};cr.ColorManagement.enabled=!1;globalThis.THREE=cr;var j6=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),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:e=>n.toggleModule("rain",e),spawnBlockBreakParticles(e,t,r,i,s,o){n.getModule("blockBreakParticles")?.spawnBlockBreakParticles(e,t,r,i,s,o)},spawnBlockCrackParticle(e,t,r,i,s,o,v){n.getModule("blockBreakParticles")?.spawnCrackParticle(e,t,r,i,s,o,v)},async loadGeometryExport(e){let{applyWorldGeometryExport:t}=await Promise.resolve().then(()=>(x1(),e6));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}}}}),S9=[],Gi=(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)}},Q6=()=>{let n,e=null,t=null,r=null,i=null,s=(c,u)=>{ce?n=H5(c,S9,globalThis):n=c,e=new k5(n,u?.canvas),globalThis.renderer=e.renderer,globalThis.documentRenderer=e,globalThis.threeJsBackend=l,Gi("default",l)},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 h5(e,{...n},u,!!O.env.SINGLE_FILE_BUILD_MODE),Gi("menuBackgroundCreated",t),await t.start(u),Gi("menuBackgroundReady",t)},v=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 f=ce?H5(c,[At,d0],globalThis):c;e.nonReactiveState=f.nonReactiveState,globalThis.resourcesManager=f.resourcesManager,r=new B0(e.renderer,n,f),await r.worldReadyPromise,i=f.inWorldRenderingConfig.enableDebugOverlay?new Br(f.nonReactiveState):null,globalThis.frameTimingCollector=i;let m=e.render;e.render=function(g){m.call(this,g),i?.markFrameStart(),f.inWorldRenderingConfig.paused||r?.render(g),i?.markFrameEnd(),i?.markFrameDisplay()},e.inWorldRenderingConfig=f.inWorldRenderingConfig,globalThis.world=r,Gi("worldReady",r)},a=()=>{t&&(t.dispose(),t=null),e&&e.dispose(),r&&(r.destroy(),r=null)},l={id:"threejs",displayName:`three.js ${cr.REVISION}`,startMenuBackground:o,startWorld:v,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,f){i?.markCameraUpdate(!c),r?.setFirstPersonCamera(c,u,f)},get soundSystem(){return r?.soundSystem},get backendMethods(){if(r)return j6(r)}};return{main:{init:s,backend:l},workerProxy(){return eo({init(c,u){s(c,{canvas:u})},updateSizeExternal(c,u,f){e?.updateSizeExternal(c,u,f)},startMenuBackground:o,startWorld:v,disconnect:a,setRendering:l.setRendering,updateCamera(c,u,f){let m=c?new M9(c.x,c.y,c.z):null;i?.markCameraUpdate(!m),l.updateCamera(m,u,f)},async callBackendMethod(c,...u){if(!r)throw new Error("World renderer not initialized");let m=j6(r)[c];if(!m)throw new Error(`Backend method ${String(c)} is unavailable`);return m(...u)}})}}};var Vi=n=>{let{main:e}=Q6();return e.init(n),e.backend};Vi.id="threejs";Vi.displayName="three.js Blocking Beta";Vi.description="Simple, old and stable main thread graphics backend providing balanced performance on top of WebGL2.";E();x();k();R();import*as Y6 from"three";function C9(n){let e="threeWorker.js",t;if(O.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 Wi=async n=>{let e={onMessage:a=>{}},t=C9(a=>{e.onMessage(a)}),r=to(t),i=an();i.onSizeChanged((a,l)=>{r.updateSizeExternal(a,l,window.devicePixelRatio||1)});let s=L5(n,t);try{r.init(s,i.canvas)}catch(a){throw y0(s),a}let o=new Proxy({},{get(a,l){if(typeof l=="string")return async(...c)=>r.callBackendMethod(l,...c)}});return{id:"threejs",displayName:`three.js ${Y6.REVISION}`,async startMenuBackground(a){let l=a?.resourcesManager?.currentResources?.mcData;if(l){let u={..._0,items:"itemsArray",entities:"entitiesArray"};await kn([t],t0,u,l)}let c=L5(a??{},t);try{await r.startMenuBackground(structuredClone(c))}catch(u){throw y0(c),u}},async startWorld(a){let l=a.worldView;e.onMessage=g=>{g?.type==="reloadLoadedChunks"&&l.reloadLoadedChunks().catch(b=>{})};let c={..._0,items:"itemsArray",entities:"entitiesArray"};await kn([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=L5(a,t);try{await r.startWorld(structuredClone(u))}catch(g){throw y0(u),g}r.updateSizeExternal(i.size.width,i.size.height,window.devicePixelRatio||1);let f=A0("fps");setInterval(()=>{let{fps:g,avgRenderTime:b,worstRenderTime:A}=a.nonReactiveState;f.updateText(`FPS: ${g.toFixed(0)} (${b.toFixed(0)}ms/${A.toFixed(0)}ms)`),a.nonReactiveState.fps=0},1e3);let m=A0("downloaded-chunks",100,140,20,{className:w0});setInterval(()=>{let g=(n.config.statsVisible??0)>1;m.setVisibility(g),g&&m.updateText(a.nonReactiveState.world.chunksFullInfo)},200)},disconnect(){i.destroy(),r.disconnect(),t.terminate()},setRendering(a){r.setRendering(a)},updateCamera(a,l,c){r.updateCamera(a?{x:a.x,y:a.y,z:a.z}:null,l,c)},soundSystem:void 0,backendMethods:o}};Wi.id="threejs-off-thread";Wi.displayName="three.js Multi-thread EXPERIMENTAL";Wi.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{V2 as AppViewer,c5 as ClassicMenuBackground,k5 as DocumentRenderer,qi as HIGH_TEXTURE_COUNT,yr as LONG_RENDER_TIME_MS,Ji as LOW_FPS_THRESHOLD,V0 as LoadedResourcesTransferrable,w0 as MC_RENDERER_DEBUG_OVERLAY_CLASS,t0 as MENU_BACKGROUND_MC_VERSION,C5 as MENU_BACKGROUND_MOTION_DEFAULTS,Tt as MENU_BACKGROUND_OPTION_DEFAULTS,X1 as MINECRAFT_BLOCK_GROUPS,p0 as MINECRAFT_BLOCK_GROUP_IDS,S5 as MINECRAFT_BLOCK_GROUP_LABELS,h5 as MenuBackgroundRenderer,w5 as PerformanceMonitor,W2 as RENDERER_DEFAULT_OPTIONS,N2 as RENDERER_OPTIONS_META,j2 as RENDERER_RENDER_GUI_SECTIONS,At as ResourcesManager,I0 as V2MenuBackground,m0 as V2_CAMERA_IDS,M5 as V2_CAMERA_LABELS,h0 as V2_SCENE_IDS,T5 as V2_SCENE_LABELS,u5 as WorldBlocksMenuBackground,u0 as WorldView,d0 as WorldViewWorker,an as addCanvasForWorker,O7 as applyMenuBackgroundLiveOptions,Oh as applyRendererEnableLighting,G7 as applyRendererOptions,Lh as applyRendererWorldViewOptions,z0 as chunkPos,Wi as createGraphicsBackendOffThread,Vi as createGraphicsBackendSingleThread,zc as createWorldRendererConfig,E2 as defaultGraphicsBackendConfig,Ki as defaultPerformanceInstabilityFactors,A5 as defaultWorldRendererConfig,T2 as delayedIterator,Xi as formatPerformanceFactorsDebug,v0 as getDefaultRendererState,J2 as getInitialPlayerState,N7 as getInitialPlayerStateRenderer,W7 as getPlayerStateUtils,ce as isWebWorker,Ih as menuBackgroundOptionsFromStorage,It as menuBackgroundSpeedToMultiplier,k7 as migrateRendererOptions,cn as rendererShaderCubeDebugModeToValue,f7 as sectionPos,Hh as subscribeRendererOptions};
21510
21681
  /*! Bundled license information:
21511
21682
 
21512
21683
  @jspm/core/nodelibs/browser/chunk-DtuTasat.js: