(function(l,ye){typeof exports=="object"&&typeof module<"u"?ye(exports):typeof define=="function"&&define.amd?define(["exports"],ye):(l=typeof globalThis<"u"?globalThis:l||self,ye(l.deepslate={}))})(this,function(l){"use strict";var Oh=Object.defineProperty;var Ch=(l,ye,Ct)=>ye in l?Oh(l,ye,{enumerable:!0,configurable:!0,writable:!0,value:Ct}):l[ye]=Ct;var p=(l,ye,Ct)=>(Ch(l,typeof ye!="symbol"?ye+"":ye,Ct),Ct);function ye(e){var t=e.slice(0,2);return t.length===2&&t[0]===31&&t[1]===139}function Ct(e){const t=e.slice(0,2);return t.length===2&&t[0]===120&&(t[1]===1||t[1]===94||t[1]===156||t[2]===218)}function wa(e){const t=e.slice(0,8),n=new DataView(t.buffer,t.byteOffset),i=n.getUint32(0,!0),r=n.getUint32(4,!0);if(t.length===8&&i>0&&i<100&&r===e.byteLength-8)return i}function Ea(e){var t=[],n,i;for(n=0;n>6),t.push(128|i&63)):i<65536?(t.push(224|i>>12),t.push(128|i>>6&63),t.push(128|i&63)):(t.push(240|i>>18&7),t.push(128|i>>12&63),t.push(128|i>>6&63),t.push(128|i&63));return t}function pa(e){var t=[],n;for(n=0;n=n)return;let i=this.buffer.byteLength;for(;ithis.buffer.byteLength&&s.fill(0,this.buffer.byteLength,this.offset),this.buffer=r,this.view=new DataView(r),this.array=s}writeNumber(t,n,i){this.accommodate(n),this.view[t](this.offset,i,this.littleEndian),this.offset+=n}writeBytes(t){this.accommodate(t.length),this.array.set(t,this.offset),this.offset+=t.length}writeString(t){const n=Ea(t);this.writeShort(n.length),this.writeBytes(n)}getData(){return this.accommodate(0),this.array.slice(0,this.offset)}}l.Json=void 0,(e=>{function t(f){return typeof f=="number"?f:void 0}e.readNumber=t;function n(f){return typeof f=="number"?Math.floor(f):void 0}e.readInt=n;function i(f){return typeof f=="string"?f:void 0}e.readString=i;function r(f){return typeof f=="boolean"?f:void 0}e.readBoolean=r;function s(f){return typeof f=="object"&&f!==null&&!Array.isArray(f)?f:void 0}e.readObject=s;function a(f,g){if(!!Array.isArray(f))return g?f.map(d=>g(d)):f}e.readArray=a;function o(f,g){if(!!Array.isArray(f))return[0,1].map(d=>g(f[d]))}e.readPair=o;function u(f,g){var w;const d=(w=s(f))!=null?w:{};return Object.fromEntries(Object.entries(d).map(([S,_])=>[S,g(_)]))}e.readMap=u;function c(f,g,d){const w=g(f);return w?d(w):void 0}e.compose=c;function h(f,g){return typeof f!="string"?g[0]:g.includes(f)?f:g[0]}e.readEnum=h})(l.Json||(l.Json={}));class Me{constructor(t){p(this,"source");p(this,"cursor");this.source=t,this.cursor=0}get remainingLength(){return this.source.length-this.cursor}get totalLength(){return this.source.length}getRead(t=0){return this.source.substring(t,this.cursor)}getRemaining(){return this.source.substring(this.cursor)}canRead(t=1){return this.cursor+t<=this.source.length}peek(t=0){return this.source.charAt(this.cursor+t)}read(){return this.source.charAt(this.cursor++)}skip(){this.cursor+=1}skipWhitespace(){for(;this.canRead()&&Me.isWhitespace(this.peek());)this.skip()}expect(t,n=!1){if(n&&this.skipWhitespace(),!this.canRead()||this.peek()!==t)throw this.createError(`Expected '${t}'`);this.skip()}readInt(){const t=this.cursor;for(;this.canRead()&&Me.isAllowedInNumber(this.peek());)this.skip();const n=this.getRead(t);if(n.length===0)throw this.createError("Expected integer");try{const i=Number(n);if(isNaN(i)||!Number.isInteger(i))throw new Error;return i}catch{throw this.cursor=t,this.createError(`Invalid integer '${n}'`)}}readFloat(){const t=this.cursor;for(;this.canRead()&&Me.isAllowedInNumber(this.peek());)this.skip();const n=this.getRead(t);if(n.length===0)throw this.createError("Expected float");try{const i=Number(n);if(isNaN(i))throw new Error;return i}catch{throw this.cursor=t,this.createError(`Invalid float '${n}'`)}}readUnquotedString(){const t=this.cursor;for(;this.canRead()&&Me.isAllowedInUnquotedString(this.peek());)this.skip();return this.getRead(t)}readQuotedString(){if(!this.canRead())return"";const t=this.peek();if(!Me.isQuotedStringStart(t))throw this.createError("Expected quote to start a string");return this.skip(),this.readStringUntil(t)}readString(){if(!this.canRead())return"";const t=this.peek();return Me.isQuotedStringStart(t)?(this.skip(),this.readStringUntil(t)):this.readUnquotedString()}readStringUntil(t){const n=[];let i=!1;for(;this.canRead();){const r=this.read();if(i)if(r===t||r==="\\")n.push(r),i=!1;else throw this.cursor-=1,this.createError(`Invalid escape sequence '${r}' in quoted string`);else if(r==="\\")i=!0;else{if(r===t)return n.join("");n.push(r)}}throw this.createError("Unclosed quoted string")}readBoolean(){const t=this.cursor,n=this.readUnquotedString();if(n.length===0)throw this.createError("Expected bool");if(n==="true")return!0;if(n==="false")return!1;throw this.cursor=t,this.createError(`Invalid bool, expected true or false but found '${n}'`)}static isAllowedInNumber(t){return t>="0"&&t<="9"||t==="."||t==="-"}static isAllowedInUnquotedString(t){return t>="0"&&t<="9"||t>="A"&&t<="Z"||t>="a"&&t<="z"||t==="_"||t==="-"||t==="."||t==="+"}static isQuotedStringStart(t){return t==="'"||t==='"'}static isWhitespace(t){return t===" "||t===" "||t===` `||t==="\r"}createError(t){const n=Math.min(this.source.length,this.cursor),i=(n>10?"...":"")+this.source.substring(Math.max(0,n-10),n);return new Error(`${t} at position ${this.cursor}: ${i}<--[HERE]`)}}function fn(e){let t=null;return()=>(t==null&&(t=e()),t)}function Mt(e,t,n){const i=e.get(t);if(i!==void 0)return i;const r=n(t);return e.set(t,r),r}function Oi(e,t,n,i){const r=e.get(t),s=r!=null?r:n;return i(s,t),e.set(t,s),s}function we(e){const t=e>>16&255,n=e>>8&255,i=e&255;return[t/255,n/255,i/255]}/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */const ba=4,Ar=0,Nr=1,Sa=2;function qt(e){let t=e.length;for(;--t>=0;)e[t]=0}const va=0,yr=1,Aa=2,Na=3,ya=258,Ci=29,dn=256,gn=dn+1+Ci,Xt=30,Mi=19,kr=2*gn+1,Lt=15,Li=16,ka=7,Bi=256,Rr=16,Tr=17,Ir=18,Pi=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),$n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Ra=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Or=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ta=512,et=new Array((gn+2)*2);qt(et);const _n=new Array(Xt*2);qt(_n);const mn=new Array(Ta);qt(mn);const wn=new Array(ya-Na+1);qt(wn);const Gi=new Array(Ci);qt(Gi);const Kn=new Array(Xt);qt(Kn);function Di(e,t,n,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}let Cr,Mr,Lr;function xi(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const Br=e=>e<256?mn[e]:mn[256+(e>>>7)],En=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Ne=(e,t,n)=>{e.bi_valid>Li-n?(e.bi_buf|=t<>Li-e.bi_valid,e.bi_valid+=n-Li):(e.bi_buf|=t<{Ne(e,n[t*2],n[t*2+1])},Pr=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},Ia=e=>{e.bi_valid===16?(En(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Oa=(e,t)=>{const n=t.dyn_tree,i=t.max_code,r=t.stat_desc.static_tree,s=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,u=t.stat_desc.max_length;let c,h,f,g,d,w,S=0;for(g=0;g<=Lt;g++)e.bl_count[g]=0;for(n[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;cu&&(g=u,S++),n[h*2+1]=g,!(h>i)&&(e.bl_count[g]++,d=0,h>=o&&(d=a[h-o]),w=n[h*2],e.opt_len+=w*(g+d),s&&(e.static_len+=w*(r[h*2+1]+d)));if(S!==0){do{for(g=u-1;e.bl_count[g]===0;)g--;e.bl_count[g]--,e.bl_count[g+1]+=2,e.bl_count[u]--,S-=2}while(S>0);for(g=u;g!==0;g--)for(h=e.bl_count[g];h!==0;)f=e.heap[--c],!(f>i)&&(n[f*2+1]!==g&&(e.opt_len+=(g-n[f*2+1])*n[f*2],n[f*2+1]=g),h--)}},Gr=(e,t,n)=>{const i=new Array(Lt+1);let r=0,s,a;for(s=1;s<=Lt;s++)i[s]=r=r+n[s-1]<<1;for(a=0;a<=t;a++){let o=e[a*2+1];o!==0&&(e[a*2]=Pr(i[o]++,o))}},Ca=()=>{let e,t,n,i,r;const s=new Array(Lt+1);for(n=0,i=0;i>=7;i{let t;for(t=0;t{e.bi_valid>8?En(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Ma=(e,t,n,i)=>{xr(e),i&&(En(e,n),En(e,~n)),e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Hr=(e,t,n,i)=>{const r=t*2,s=n*2;return e[r]{const i=e.heap[n];let r=n<<1;for(;r<=e.heap_len&&(r{let i,r,s=0,a,o;if(e.last_lit!==0)do i=e.pending_buf[e.d_buf+s*2]<<8|e.pending_buf[e.d_buf+s*2+1],r=e.pending_buf[e.l_buf+s],s++,i===0?Ze(e,r,t):(a=wn[r],Ze(e,a+dn+1,t),o=Pi[a],o!==0&&(r-=Gi[a],Ne(e,r,o)),i--,a=Br(i),Ze(e,a,n),o=$n[a],o!==0&&(i-=Kn[a],Ne(e,i,o)));while(s{const n=t.dyn_tree,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,s=t.stat_desc.elems;let a,o,u=-1,c;for(e.heap_len=0,e.heap_max=kr,a=0;a>1;a>=1;a--)Hi(e,n,a);c=s;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Hi(e,n,1),o=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=o,n[c*2]=n[a*2]+n[o*2],e.depth[c]=(e.depth[a]>=e.depth[o]?e.depth[a]:e.depth[o])+1,n[a*2+1]=n[o*2+1]=c,e.heap[1]=c++,Hi(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Oa(e,t),Gr(n,u,e.bl_count)},Fr=(e,t,n)=>{let i,r=-1,s,a=t[0*2+1],o=0,u=7,c=4;for(a===0&&(u=138,c=3),t[(n+1)*2+1]=65535,i=0;i<=n;i++)s=a,a=t[(i+1)*2+1],!(++o{let i,r=-1,s,a=t[0*2+1],o=0,u=7,c=4;for(a===0&&(u=138,c=3),i=0;i<=n;i++)if(s=a,a=t[(i+1)*2+1],!(++o{let t;for(Fr(e,e.dyn_ltree,e.l_desc.max_code),Fr(e,e.dyn_dtree,e.d_desc.max_code),zi(e,e.bl_desc),t=Mi-1;t>=3&&e.bl_tree[Or[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Ba=(e,t,n,i)=>{let r;for(Ne(e,t-257,5),Ne(e,n-1,5),Ne(e,i-4,4),r=0;r{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Ar;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Nr;for(n=32;n{Ur||(Ca(),Ur=!0),e.l_desc=new xi(e.dyn_ltree,Cr),e.d_desc=new xi(e.dyn_dtree,Mr),e.bl_desc=new xi(e.bl_tree,Lr),e.bi_buf=0,e.bi_valid=0,Dr(e)},Wr=(e,t,n,i)=>{Ne(e,(va<<1)+(i?1:0),3),Ma(e,t,n,!0)},Da=e=>{Ne(e,yr<<1,3),Ze(e,Bi,et),Ia(e)},xa=(e,t,n,i)=>{let r,s,a=0;e.level>0?(e.strm.data_type===Sa&&(e.strm.data_type=Pa(e)),zi(e,e.l_desc),zi(e,e.d_desc),a=La(e),r=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=r&&(r=s)):r=s=n+5,n+4<=r&&t!==-1?Wr(e,t,n,i):e.strategy===ba||s===r?(Ne(e,(yr<<1)+(i?1:0),3),zr(e,et,_n)):(Ne(e,(Aa<<1)+(i?1:0),3),Ba(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),zr(e,e.dyn_ltree,e.dyn_dtree)),Dr(e),i&&xr(e)},Ha=(e,t,n)=>(e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(wn[n]+dn+1)*2]++,e.dyn_dtree[Br(t)*2]++),e.last_lit===e.lit_bufsize-1);var za=Ga,Fa=Wr,Ja=xa,Ua=Ha,Wa=Da,Va={_tr_init:za,_tr_stored_block:Fa,_tr_flush_block:Ja,_tr_tally:Ua,_tr_align:Wa},pn=(e,t,n,i)=>{let r=e&65535|0,s=e>>>16&65535|0,a=0;for(;n!==0;){a=n>2e3?2e3:n,n-=a;do r=r+t[i++]|0,s=s+r|0;while(--a);r%=65521,s%=65521}return r|s<<16|0};const Za=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},Ya=new Uint32Array(Za());var me=(e,t,n,i)=>{const r=Ya,s=i+n;e^=-1;for(let a=i;a>>8^r[(e^t[a])&255];return e^-1},Bt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Pt={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:$a,_tr_stored_block:Ka,_tr_flush_block:qa,_tr_tally:ft,_tr_align:Xa}=Va,{Z_NO_FLUSH:Gt,Z_PARTIAL_FLUSH:ja,Z_FULL_FLUSH:Qa,Z_FINISH:dt,Z_BLOCK:Vr,Z_OK:Ye,Z_STREAM_END:Zr,Z_STREAM_ERROR:Le,Z_DATA_ERROR:eo,Z_BUF_ERROR:Fi,Z_DEFAULT_COMPRESSION:to,Z_FILTERED:no,Z_HUFFMAN_ONLY:qn,Z_RLE:io,Z_FIXED:ro,Z_DEFAULT_STRATEGY:so,Z_UNKNOWN:ao,Z_DEFLATED:Xn}=Pt,oo=9,co=15,lo=8,ho=29,Ji=256+1+ho,uo=30,fo=19,go=2*Ji+1,_o=15,K=3,gt=258,He=gt+K+1,mo=32,jn=42,Ui=69,Qn=73,ei=91,ti=103,Dt=113,bn=666,he=1,Sn=2,xt=3,jt=4,wo=3,_t=(e,t)=>(e.msg=Bt[t],t),Yr=e=>(e<<1)-(e>4?9:0),mt=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let wt=(e,t,n)=>(t<{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Ee=(e,t)=>{qa(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Et(e.strm)},X=(e,t)=>{e.pending_buf[e.pending++]=t},vn=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Eo=(e,t,n,i)=>{let r=e.avail_in;return r>i&&(r=i),r===0?0:(e.avail_in-=r,t.set(e.input.subarray(e.next_in,e.next_in+r),n),e.state.wrap===1?e.adler=pn(e.adler,t,r,n):e.state.wrap===2&&(e.adler=me(e.adler,t,r,n)),e.next_in+=r,e.total_in+=r,r)},$r=(e,t)=>{let n=e.max_chain_length,i=e.strstart,r,s,a=e.prev_length,o=e.nice_match;const u=e.strstart>e.w_size-He?e.strstart-(e.w_size-He):0,c=e.window,h=e.w_mask,f=e.prev,g=e.strstart+gt;let d=c[i+a-1],w=c[i+a];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do if(r=t,!(c[r+a]!==w||c[r+a-1]!==d||c[r]!==c[i]||c[++r]!==c[i+1])){i+=2,r++;do;while(c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&c[++i]===c[++r]&&ia){if(e.match_start=t,a=s,s>=o)break;d=c[i+a-1],w=c[i+a]}}while((t=f[t&h])>u&&--n!==0);return a<=e.lookahead?a:e.lookahead},Ht=e=>{const t=e.w_size;let n,i,r,s,a;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-He)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,i=e.hash_size,n=i;do r=e.head[--n],e.head[n]=r>=t?r-t:0;while(--i);i=t,n=i;do r=e.prev[--n],e.prev[n]=r>=t?r-t:0;while(--i);s+=t}if(e.strm.avail_in===0)break;if(i=Eo(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=i,e.lookahead+e.insert>=K)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=wt(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=wt(e,e.ins_h,e.window[a+K-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert{let n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Ht(e),e.lookahead===0&&t===Gt)return he;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;const i=e.block_start+n;if((e.strstart===0||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,Ee(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-He&&(Ee(e,!1),e.strm.avail_out===0))return he}return e.insert=0,t===dt?(Ee(e,!0),e.strm.avail_out===0?xt:jt):(e.strstart>e.block_start&&(Ee(e,!1),e.strm.avail_out===0),he)},Wi=(e,t)=>{let n,i;for(;;){if(e.lookahead=K&&(e.ins_h=wt(e,e.ins_h,e.window[e.strstart+K-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-He&&(e.match_length=$r(e,n)),e.match_length>=K)if(i=ft(e,e.strstart-e.match_start,e.match_length-K),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=K){e.match_length--;do e.strstart++,e.ins_h=wt(e,e.ins_h,e.window[e.strstart+K-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=wt(e,e.ins_h,e.window[e.strstart+1]);else i=ft(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(Ee(e,!1),e.strm.avail_out===0))return he}return e.insert=e.strstart{let n,i,r;for(;;){if(e.lookahead=K&&(e.ins_h=wt(e,e.ins_h,e.window[e.strstart+K-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=K-1,n!==0&&e.prev_length4096)&&(e.match_length=K-1)),e.prev_length>=K&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-K,i=ft(e,e.strstart-1-e.prev_match,e.prev_length-K),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=r&&(e.ins_h=wt(e,e.ins_h,e.window[e.strstart+K-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=K-1,e.strstart++,i&&(Ee(e,!1),e.strm.avail_out===0))return he}else if(e.match_available){if(i=ft(e,0,e.window[e.strstart-1]),i&&Ee(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return he}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=ft(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let n,i,r,s;const a=e.window;for(;;){if(e.lookahead<=gt){if(Ht(e),e.lookahead<=gt&&t===Gt)return he;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=K&&e.strstart>0&&(r=e.strstart-1,i=a[r],i===a[++r]&&i===a[++r]&&i===a[++r])){s=e.strstart+gt;do;while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&re.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=K?(n=ft(e,1,e.match_length-K),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=ft(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Ee(e,!1),e.strm.avail_out===0))return he}return e.insert=0,t===dt?(Ee(e,!0),e.strm.avail_out===0?xt:jt):e.last_lit&&(Ee(e,!1),e.strm.avail_out===0)?he:Sn},So=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Ht(e),e.lookahead===0)){if(t===Gt)return he;break}if(e.match_length=0,n=ft(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Ee(e,!1),e.strm.avail_out===0))return he}return e.insert=0,t===dt?(Ee(e,!0),e.strm.avail_out===0?xt:jt):e.last_lit&&(Ee(e,!1),e.strm.avail_out===0)?he:Sn};function $e(e,t,n,i,r){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=i,this.func=r}const An=[new $e(0,0,0,0,po),new $e(4,4,8,4,Wi),new $e(4,5,16,8,Wi),new $e(4,6,32,32,Wi),new $e(4,4,16,16,Qt),new $e(8,16,32,32,Qt),new $e(8,16,128,128,Qt),new $e(8,32,128,256,Qt),new $e(32,128,258,1024,Qt),new $e(32,258,258,4096,Qt)],vo=e=>{e.window_size=2*e.w_size,mt(e.head),e.max_lazy_match=An[e.level].max_lazy,e.good_match=An[e.level].good_length,e.nice_match=An[e.level].nice_length,e.max_chain_length=An[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=K-1,e.match_available=0,e.ins_h=0};function Ao(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Xn,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(go*2),this.dyn_dtree=new Uint16Array((2*uo+1)*2),this.bl_tree=new Uint16Array((2*fo+1)*2),mt(this.dyn_ltree),mt(this.dyn_dtree),mt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(_o+1),this.heap=new Uint16Array(2*Ji+1),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Ji+1),mt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Kr=e=>{if(!e||!e.state)return _t(e,Le);e.total_in=e.total_out=0,e.data_type=ao;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?jn:Dt,e.adler=t.wrap===2?0:1,t.last_flush=Gt,$a(t),Ye},qr=e=>{const t=Kr(e);return t===Ye&&vo(e.state),t},No=(e,t)=>!e||!e.state||e.state.wrap!==2?Le:(e.state.gzhead=t,Ye),Xr=(e,t,n,i,r,s)=>{if(!e)return Le;let a=1;if(t===to&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),r<1||r>oo||n!==Xn||i<8||i>15||t<0||t>9||s<0||s>ro)return _t(e,Le);i===8&&(i=9);const o=new Ao;return e.state=o,o.strm=e,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<Xr(e,t,Xn,co,lo,so),ko=(e,t)=>{let n,i;if(!e||!e.state||t>Vr||t<0)return e?_t(e,Le):Le;const r=e.state;if(!e.output||!e.input&&e.avail_in!==0||r.status===bn&&t!==dt)return _t(e,e.avail_out===0?Fi:Le);r.strm=e;const s=r.last_flush;if(r.last_flush=t,r.status===jn)if(r.wrap===2)e.adler=0,X(r,31),X(r,139),X(r,8),r.gzhead?(X(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),X(r,r.gzhead.time&255),X(r,r.gzhead.time>>8&255),X(r,r.gzhead.time>>16&255),X(r,r.gzhead.time>>24&255),X(r,r.level===9?2:r.strategy>=qn||r.level<2?4:0),X(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(X(r,r.gzhead.extra.length&255),X(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=me(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Ui):(X(r,0),X(r,0),X(r,0),X(r,0),X(r,0),X(r,r.level===9?2:r.strategy>=qn||r.level<2?4:0),X(r,wo),r.status=Dt);else{let a=Xn+(r.w_bits-8<<4)<<8,o=-1;r.strategy>=qn||r.level<2?o=0:r.level<6?o=1:r.level===6?o=2:o=3,a|=o<<6,r.strstart!==0&&(a|=mo),a+=31-a%31,r.status=Dt,vn(r,a),r.strstart!==0&&(vn(r,e.adler>>>16),vn(r,e.adler&65535)),e.adler=1}if(r.status===Ui)if(r.gzhead.extra){for(n=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=me(e.adler,r.pending_buf,r.pending-n,n)),Et(e),n=r.pending,r.pending===r.pending_buf_size));)X(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>n&&(e.adler=me(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=Qn)}else r.status=Qn;if(r.status===Qn)if(r.gzhead.name){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=me(e.adler,r.pending_buf,r.pending-n,n)),Et(e),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}r.gzindexn&&(e.adler=me(e.adler,r.pending_buf,r.pending-n,n)),i===0&&(r.gzindex=0,r.status=ei)}else r.status=ei;if(r.status===ei)if(r.gzhead.comment){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=me(e.adler,r.pending_buf,r.pending-n,n)),Et(e),n=r.pending,r.pending===r.pending_buf_size)){i=1;break}r.gzindexn&&(e.adler=me(e.adler,r.pending_buf,r.pending-n,n)),i===0&&(r.status=ti)}else r.status=ti;if(r.status===ti&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Et(e),r.pending+2<=r.pending_buf_size&&(X(r,e.adler&255),X(r,e.adler>>8&255),e.adler=0,r.status=Dt)):r.status=Dt),r.pending!==0){if(Et(e),e.avail_out===0)return r.last_flush=-1,Ye}else if(e.avail_in===0&&Yr(t)<=Yr(s)&&t!==dt)return _t(e,Fi);if(r.status===bn&&e.avail_in!==0)return _t(e,Fi);if(e.avail_in!==0||r.lookahead!==0||t!==Gt&&r.status!==bn){let a=r.strategy===qn?So(r,t):r.strategy===io?bo(r,t):An[r.level].func(r,t);if((a===xt||a===jt)&&(r.status=bn),a===he||a===xt)return e.avail_out===0&&(r.last_flush=-1),Ye;if(a===Sn&&(t===ja?Xa(r):t!==Vr&&(Ka(r,0,0,!1),t===Qa&&(mt(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Et(e),e.avail_out===0))return r.last_flush=-1,Ye}return t!==dt?Ye:r.wrap<=0?Zr:(r.wrap===2?(X(r,e.adler&255),X(r,e.adler>>8&255),X(r,e.adler>>16&255),X(r,e.adler>>24&255),X(r,e.total_in&255),X(r,e.total_in>>8&255),X(r,e.total_in>>16&255),X(r,e.total_in>>24&255)):(vn(r,e.adler>>>16),vn(r,e.adler&65535)),Et(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Ye:Zr)},Ro=e=>{if(!e||!e.state)return Le;const t=e.state.status;return t!==jn&&t!==Ui&&t!==Qn&&t!==ei&&t!==ti&&t!==Dt&&t!==bn?_t(e,Le):(e.state=null,t===Dt?_t(e,eo):Ye)},To=(e,t)=>{let n=t.length;if(!e||!e.state)return Le;const i=e.state,r=i.wrap;if(r===2||r===1&&i.status!==jn||i.lookahead)return Le;if(r===1&&(e.adler=pn(e.adler,t,n,0)),i.wrap=0,n>=i.w_size){r===0&&(mt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let u=new Uint8Array(i.w_size);u.set(t.subarray(n-i.w_size,n),0),t=u,n=i.w_size}const s=e.avail_in,a=e.next_in,o=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Ht(i);i.lookahead>=K;){let u=i.strstart,c=i.lookahead-(K-1);do i.ins_h=wt(i,i.ins_h,i.window[u+K-1]),i.prev[u&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=u,u++;while(--c);i.strstart=u,i.lookahead=K-1,Ht(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=K-1,i.match_available=0,e.next_in=a,e.input=o,e.avail_in=s,i.wrap=r,Ye};var Io=yo,Oo=Xr,Co=qr,Mo=Kr,Lo=No,Bo=ko,Po=Ro,Go=To,Do="pako deflate (from Nodeca project)",Nn={deflateInit:Io,deflateInit2:Oo,deflateReset:Co,deflateResetKeep:Mo,deflateSetHeader:Lo,deflate:Bo,deflateEnd:Po,deflateSetDictionary:Go,deflateInfo:Do};const xo=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Ho=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(!!n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const i in n)xo(n,i)&&(e[i]=n[i])}}return e},zo=e=>{let t=0;for(let i=0,r=e.length;i=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;yn[254]=yn[254]=1;var Fo=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,i,r,s,a=e.length,o=0;for(r=0;r>>6,t[s++]=128|n&63):n<65536?(t[s++]=224|n>>>12,t[s++]=128|n>>>6&63,t[s++]=128|n&63):(t[s++]=240|n>>>18,t[s++]=128|n>>>12&63,t[s++]=128|n>>>6&63,t[s++]=128|n&63);return t};const Jo=(e,t)=>{if(t<65534&&e.subarray&&jr)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let i=0;i{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let i,r;const s=new Array(n*2);for(r=0,i=0;i4){s[r++]=65533,i+=o-1;continue}for(a&=o===2?31:o===3?15:7;o>1&&i1){s[r++]=65533;continue}a<65536?s[r++]=a:(a-=65536,s[r++]=55296|a>>10&1023,s[r++]=56320|a&1023)}return Jo(s,r)},Wo=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+yn[e[n]]>t?n:t},kn={string2buf:Fo,buf2string:Uo,utf8border:Wo};function Vo(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Qr=Vo;const es=Object.prototype.toString,{Z_NO_FLUSH:Zo,Z_SYNC_FLUSH:Yo,Z_FULL_FLUSH:$o,Z_FINISH:Ko,Z_OK:ii,Z_STREAM_END:qo,Z_DEFAULT_COMPRESSION:Xo,Z_DEFAULT_STRATEGY:jo,Z_DEFLATED:Qo}=Pt;function Rn(e){this.options=ni.assign({level:Xo,method:Qo,chunkSize:16384,windowBits:15,memLevel:8,strategy:jo},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qr,this.strm.avail_out=0;let n=Nn.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==ii)throw new Error(Bt[n]);if(t.header&&Nn.deflateSetHeader(this.strm,t.header),t.dictionary){let i;if(typeof t.dictionary=="string"?i=kn.string2buf(t.dictionary):es.call(t.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(t.dictionary):i=t.dictionary,n=Nn.deflateSetDictionary(this.strm,i),n!==ii)throw new Error(Bt[n]);this._dict_set=!0}}Rn.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize;let r,s;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?Ko:Zo,typeof e=="string"?n.input=kn.string2buf(e):es.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),(s===Yo||s===$o)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(r=Nn.deflate(n,s),r===qo)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=Nn.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===ii;if(n.avail_out===0){this.onData(n.output);continue}if(s>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0},Rn.prototype.onData=function(e){this.chunks.push(e)},Rn.prototype.onEnd=function(e){e===ii&&(this.result=ni.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Vi(e,t){const n=new Rn(t);if(n.push(e,!0),n.err)throw n.msg||Bt[n.err];return n.result}function ec(e,t){return t=t||{},t.raw=!0,Vi(e,t)}function tc(e,t){return t=t||{},t.gzip=!0,Vi(e,t)}var nc=Rn,ic=Vi,rc=ec,sc=tc,ac=Pt,oc={Deflate:nc,deflate:ic,deflateRaw:rc,gzip:sc,constants:ac};const ri=30,cc=12;var lc=function(t,n){let i,r,s,a,o,u,c,h,f,g,d,w,S,_,E,A,N,v,R,O,k,T,C,I;const M=t.state;i=t.next_in,C=t.input,r=i+(t.avail_in-5),s=t.next_out,I=t.output,a=s-(n-t.avail_out),o=s+(t.avail_out-257),u=M.dmax,c=M.wsize,h=M.whave,f=M.wnext,g=M.window,d=M.hold,w=M.bits,S=M.lencode,_=M.distcode,E=(1<>>24,d>>>=v,w-=v,v=N>>>16&255,v===0)I[s++]=N&65535;else if(v&16){R=N&65535,v&=15,v&&(w>>=v,w-=v),w<15&&(d+=C[i++]<>>24,d>>>=v,w-=v,v=N>>>16&255,v&16){if(O=N&65535,v&=15,wu){t.msg="invalid distance too far back",M.mode=ri;break e}if(d>>>=v,w-=v,v=s-a,O>v){if(v=O-v,v>h&&M.sane){t.msg="invalid distance too far back",M.mode=ri;break e}if(k=0,T=g,f===0){if(k+=c-v,v2;)I[s++]=T[k++],I[s++]=T[k++],I[s++]=T[k++],R-=3;R&&(I[s++]=T[k++],R>1&&(I[s++]=T[k++]))}else{k=s-O;do I[s++]=I[k++],I[s++]=I[k++],I[s++]=I[k++],R-=3;while(R>2);R&&(I[s++]=I[k++],R>1&&(I[s++]=I[k++]))}}else if((v&64)===0){N=_[(N&65535)+(d&(1<>3,i-=R,w-=R<<3,d&=(1<{const u=o.bits;let c=0,h=0,f=0,g=0,d=0,w=0,S=0,_=0,E=0,A=0,N,v,R,O,k,T=null,C=0,I;const M=new Uint16Array(en+1),x=new Uint16Array(en+1);let J=null,F=0,ne,se,le;for(c=0;c<=en;c++)M[c]=0;for(h=0;h=1&&M[g]===0;g--);if(d>g&&(d=g),g===0)return r[s++]=1<<24|64<<16|0,r[s++]=1<<24|64<<16|0,o.bits=1,0;for(f=1;f0&&(e===is||g!==1))return-1;for(x[1]=0,c=1;cts||e===rs&&E>ns)return 1;for(;;){ne=c-S,a[h]I?(se=J[F+a[h]],le=T[C+a[h]]):(se=32+64,le=0),N=1<>S)+v]=ne<<24|se<<16|le|0;while(v!==0);for(N=1<>=1;if(N!==0?(A&=N-1,A+=N):A=0,h++,--M[c]===0){if(c===g)break;c=t[n+a[h]]}if(c>d&&(A&O)!==R){for(S===0&&(S=d),k+=f,w=c-S,_=1<ts||e===rs&&E>ns)return 1;R=A&O,r[R]=d<<24|w<<16|k-s|0}}return A!==0&&(r[k+A]=c-S<<24|64<<16|0),o.bits=d,0};const gc=0,ss=1,as=2,{Z_FINISH:os,Z_BLOCK:_c,Z_TREES:si,Z_OK:zt,Z_STREAM_END:mc,Z_NEED_DICT:wc,Z_STREAM_ERROR:Be,Z_DATA_ERROR:cs,Z_MEM_ERROR:ls,Z_BUF_ERROR:Ec,Z_DEFLATED:hs}=Pt,us=1,fs=2,ds=3,gs=4,_s=5,ms=6,ws=7,Es=8,ps=9,bs=10,ai=11,tt=12,Yi=13,Ss=14,$i=15,vs=16,As=17,Ns=18,ys=19,oi=20,ci=21,ks=22,Rs=23,Ts=24,Is=25,Os=26,Ki=27,Cs=28,Ms=29,ae=30,Ls=31,pc=32,bc=852,Sc=592,vc=15,Bs=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Ac(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Ps=e=>{if(!e||!e.state)return Be;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=us,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(bc),t.distcode=t.distdyn=new Int32Array(Sc),t.sane=1,t.back=-1,zt},Gs=e=>{if(!e||!e.state)return Be;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Ps(e)},Ds=(e,t)=>{let n;if(!e||!e.state)return Be;const i=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?Be:(i.window!==null&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,Gs(e))},xs=(e,t)=>{if(!e)return Be;const n=new Ac;e.state=n,n.window=null;const i=Ds(e,t);return i!==zt&&(e.state=null),i},Nc=e=>xs(e,vc);let Hs=!0,qi,Xi;const yc=e=>{if(Hs){qi=new Int32Array(512),Xi=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Tn(ss,e.lens,0,288,qi,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Tn(as,e.lens,0,32,Xi,0,e.work,{bits:5}),Hs=!1}e.lencode=qi,e.lenbits=9,e.distcode=Xi,e.distbits=5},zs=(e,t,n,i)=>{let r;const s=e.state;return s.window===null&&(s.wsize=1<=s.wsize?(s.window.set(t.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>i&&(r=i),s.window.set(t.subarray(n-i,n-i+r),s.wnext),i-=r,i?(s.window.set(t.subarray(n-i,n),0),s.wnext=i,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave{let n,i,r,s,a,o,u,c,h,f,g,d,w,S,_=0,E,A,N,v,R,O,k,T;const C=new Uint8Array(4);let I,M;const x=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Be;n=e.state,n.mode===tt&&(n.mode=Yi),a=e.next_out,r=e.output,u=e.avail_out,s=e.next_in,i=e.input,o=e.avail_in,c=n.hold,h=n.bits,f=o,g=u,T=zt;e:for(;;)switch(n.mode){case us:if(n.wrap===0){n.mode=Yi;break}for(;h<16;){if(o===0)break e;o--,c+=i[s++]<>>8&255,n.check=me(n.check,C,2,0),c=0,h=0,n.mode=fs;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=ae;break}if((c&15)!==hs){e.msg="unknown compression method",n.mode=ae;break}if(c>>>=4,h-=4,k=(c&15)+8,n.wbits===0)n.wbits=k;else if(k>n.wbits){e.msg="invalid window size",n.mode=ae;break}n.dmax=1<>8&1),n.flags&512&&(C[0]=c&255,C[1]=c>>>8&255,n.check=me(n.check,C,2,0)),c=0,h=0,n.mode=ds;case ds:for(;h<32;){if(o===0)break e;o--,c+=i[s++]<>>8&255,C[2]=c>>>16&255,C[3]=c>>>24&255,n.check=me(n.check,C,4,0)),c=0,h=0,n.mode=gs;case gs:for(;h<16;){if(o===0)break e;o--,c+=i[s++]<>8),n.flags&512&&(C[0]=c&255,C[1]=c>>>8&255,n.check=me(n.check,C,2,0)),c=0,h=0,n.mode=_s;case _s:if(n.flags&1024){for(;h<16;){if(o===0)break e;o--,c+=i[s++]<>>8&255,n.check=me(n.check,C,2,0)),c=0,h=0}else n.head&&(n.head.extra=null);n.mode=ms;case ms:if(n.flags&1024&&(d=n.length,d>o&&(d=o),d&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(s,s+d),k)),n.flags&512&&(n.check=me(n.check,i,d,s)),o-=d,s+=d,n.length-=d),n.length))break e;n.length=0,n.mode=ws;case ws:if(n.flags&2048){if(o===0)break e;d=0;do k=i[s+d++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k));while(k&&d>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=tt;break;case bs:for(;h<32;){if(o===0)break e;o--,c+=i[s++]<>>=h&7,h-=h&7,n.mode=Ki;break}for(;h<3;){if(o===0)break e;o--,c+=i[s++]<>>=1,h-=1,c&3){case 0:n.mode=Ss;break;case 1:if(yc(n),n.mode=oi,t===si){c>>>=2,h-=2;break e}break;case 2:n.mode=As;break;case 3:e.msg="invalid block type",n.mode=ae}c>>>=2,h-=2;break;case Ss:for(c>>>=h&7,h-=h&7;h<32;){if(o===0)break e;o--,c+=i[s++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=ae;break}if(n.length=c&65535,c=0,h=0,n.mode=$i,t===si)break e;case $i:n.mode=vs;case vs:if(d=n.length,d){if(d>o&&(d=o),d>u&&(d=u),d===0)break e;r.set(i.subarray(s,s+d),a),o-=d,s+=d,u-=d,a+=d,n.length-=d;break}n.mode=tt;break;case As:for(;h<14;){if(o===0)break e;o--,c+=i[s++]<>>=5,h-=5,n.ndist=(c&31)+1,c>>>=5,h-=5,n.ncode=(c&15)+4,c>>>=4,h-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=ae;break}n.have=0,n.mode=Ns;case Ns:for(;n.have>>=3,h-=3}for(;n.have<19;)n.lens[x[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,I={bits:n.lenbits},T=Tn(gc,n.lens,0,19,n.lencode,0,n.work,I),n.lenbits=I.bits,T){e.msg="invalid code lengths set",n.mode=ae;break}n.have=0,n.mode=ys;case ys:for(;n.have>>24,A=_>>>16&255,N=_&65535,!(E<=h);){if(o===0)break e;o--,c+=i[s++]<>>=E,h-=E,n.lens[n.have++]=N;else{if(N===16){for(M=E+2;h>>=E,h-=E,n.have===0){e.msg="invalid bit length repeat",n.mode=ae;break}k=n.lens[n.have-1],d=3+(c&3),c>>>=2,h-=2}else if(N===17){for(M=E+3;h>>=E,h-=E,k=0,d=3+(c&7),c>>>=3,h-=3}else{for(M=E+7;h>>=E,h-=E,k=0,d=11+(c&127),c>>>=7,h-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=ae;break}for(;d--;)n.lens[n.have++]=k}}if(n.mode===ae)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=ae;break}if(n.lenbits=9,I={bits:n.lenbits},T=Tn(ss,n.lens,0,n.nlen,n.lencode,0,n.work,I),n.lenbits=I.bits,T){e.msg="invalid literal/lengths set",n.mode=ae;break}if(n.distbits=6,n.distcode=n.distdyn,I={bits:n.distbits},T=Tn(as,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,I),n.distbits=I.bits,T){e.msg="invalid distances set",n.mode=ae;break}if(n.mode=oi,t===si)break e;case oi:n.mode=ci;case ci:if(o>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=s,e.avail_in=o,n.hold=c,n.bits=h,lc(e,g),a=e.next_out,r=e.output,u=e.avail_out,s=e.next_in,i=e.input,o=e.avail_in,c=n.hold,h=n.bits,n.mode===tt&&(n.back=-1);break}for(n.back=0;_=n.lencode[c&(1<>>24,A=_>>>16&255,N=_&65535,!(E<=h);){if(o===0)break e;o--,c+=i[s++]<>v)],E=_>>>24,A=_>>>16&255,N=_&65535,!(v+E<=h);){if(o===0)break e;o--,c+=i[s++]<>>=v,h-=v,n.back+=v}if(c>>>=E,h-=E,n.back+=E,n.length=N,A===0){n.mode=Os;break}if(A&32){n.back=-1,n.mode=tt;break}if(A&64){e.msg="invalid literal/length code",n.mode=ae;break}n.extra=A&15,n.mode=ks;case ks:if(n.extra){for(M=n.extra;h>>=n.extra,h-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=Rs;case Rs:for(;_=n.distcode[c&(1<>>24,A=_>>>16&255,N=_&65535,!(E<=h);){if(o===0)break e;o--,c+=i[s++]<>v)],E=_>>>24,A=_>>>16&255,N=_&65535,!(v+E<=h);){if(o===0)break e;o--,c+=i[s++]<>>=v,h-=v,n.back+=v}if(c>>>=E,h-=E,n.back+=E,A&64){e.msg="invalid distance code",n.mode=ae;break}n.offset=N,n.extra=A&15,n.mode=Ts;case Ts:if(n.extra){for(M=n.extra;h>>=n.extra,h-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=ae;break}n.mode=Is;case Is:if(u===0)break e;if(d=g-u,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=ae;break}d>n.wnext?(d-=n.wnext,w=n.wsize-d):w=n.wnext-d,d>n.length&&(d=n.length),S=n.window}else S=r,w=a-n.offset,d=n.length;d>u&&(d=u),u-=d,n.length-=d;do r[a++]=S[w++];while(--d);n.length===0&&(n.mode=ci);break;case Os:if(u===0)break e;r[a++]=n.length,u--,n.mode=ci;break;case Ki:if(n.wrap){for(;h<32;){if(o===0)break e;o--,c|=i[s++]<{if(!e||!e.state)return Be;let t=e.state;return t.window&&(t.window=null),e.state=null,zt},Tc=(e,t)=>{if(!e||!e.state)return Be;const n=e.state;return(n.wrap&2)===0?Be:(n.head=t,t.done=!1,zt)},Ic=(e,t)=>{const n=t.length;let i,r,s;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==ai)?Be:i.mode===ai&&(r=1,r=pn(r,t,n,0),r!==i.check)?cs:(s=zs(e,t,n,n),s?(i.mode=Ls,ls):(i.havedict=1,zt))};var Oc=Gs,Cc=Ds,Mc=Ps,Lc=Nc,Bc=xs,Pc=kc,Gc=Rc,Dc=Tc,xc=Ic,Hc="pako inflate (from Nodeca project)",nt={inflateReset:Oc,inflateReset2:Cc,inflateResetKeep:Mc,inflateInit:Lc,inflateInit2:Bc,inflate:Pc,inflateEnd:Gc,inflateGetHeader:Dc,inflateSetDictionary:xc,inflateInfo:Hc};function zc(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Fc=zc;const Fs=Object.prototype.toString,{Z_NO_FLUSH:Jc,Z_FINISH:Uc,Z_OK:In,Z_STREAM_END:ji,Z_NEED_DICT:Qi,Z_STREAM_ERROR:Wc,Z_DATA_ERROR:Js,Z_MEM_ERROR:Vc}=Pt;function On(e){this.options=ni.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qr,this.strm.avail_out=0;let n=nt.inflateInit2(this.strm,t.windowBits);if(n!==In)throw new Error(Bt[n]);if(this.header=new Fc,nt.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=kn.string2buf(t.dictionary):Fs.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=nt.inflateSetDictionary(this.strm,t.dictionary),n!==In)))throw new Error(Bt[n])}On.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let s,a,o;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?Uc:Jc,Fs.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),s=nt.inflate(n,a),s===Qi&&r&&(s=nt.inflateSetDictionary(n,r),s===In?s=nt.inflate(n,a):s===Js&&(s=Qi));n.avail_in>0&&s===ji&&n.state.wrap>0&&e[n.next_in]!==0;)nt.inflateReset(n),s=nt.inflate(n,a);switch(s){case Wc:case Js:case Qi:case Vc:return this.onEnd(s),this.ended=!0,!1}if(o=n.avail_out,n.next_out&&(n.avail_out===0||s===ji))if(this.options.to==="string"){let u=kn.utf8border(n.output,n.next_out),c=n.next_out-u,h=kn.buf2string(n.output,u);n.next_out=c,n.avail_out=i-c,c&&n.output.set(n.output.subarray(u,u+c),0),this.onData(h)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(s===In&&o===0)){if(s===ji)return s=nt.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(n.avail_in===0)break}}return!0},On.prototype.onData=function(e){this.chunks.push(e)},On.prototype.onEnd=function(e){e===In&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ni.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function er(e,t){const n=new On(t);if(n.push(e),n.err)throw n.msg||Bt[n.err];return n.result}function Zc(e,t){return t=t||{},t.raw=!0,er(e,t)}var Yc=On,$c=er,Kc=Zc,qc=er,Xc=Pt,jc={Inflate:Yc,inflate:$c,inflateRaw:Kc,ungzip:qc,constants:Xc};const{Deflate:Qc,deflate:el,deflateRaw:tl,gzip:nl}=oc,{Inflate:il,inflate:rl,inflateRaw:sl,ungzip:al}=jc;var ol=Qc,cl=el,ll=tl,hl=nl,ul=il,fl=rl,dl=sl,gl=al,_l=Pt,tr={Deflate:ol,deflate:cl,deflateRaw:ll,gzip:hl,Inflate:ul,inflate:fl,inflateRaw:dl,ungzip:gl,constants:_l},B=(e=>(e[e.End=0]="End",e[e.Byte=1]="Byte",e[e.Short=2]="Short",e[e.Int=3]="Int",e[e.Long=4]="Long",e[e.Float=5]="Float",e[e.Double=6]="Double",e[e.ByteArray=7]="ByteArray",e[e.String=8]="String",e[e.List=9]="List",e[e.Compound=10]="Compound",e[e.IntArray=11]="IntArray",e[e.LongArray=12]="LongArray",e))(B||{});const Ti=class{static register(t,n){const i=n.create().getId();if(i!==t)throw new Error(`Registered factory ${B[i]} does not match type ${B[t]}`);Ti.FACTORIES.set(t,n)}isEnd(){return this.getId()===B.End}isByte(){return this.getId()===B.Byte}isShort(){return this.getId()===B.Short}isInt(){return this.getId()===B.Int}isLong(){return this.getId()===B.Long}isFloat(){return this.getId()===B.Float}isDouble(){return this.getId()===B.Double}isByteArray(){return this.getId()===B.ByteArray}isString(){return this.getId()===B.String}isList(){return this.getId()===B.List}isCompound(){return this.getId()===B.Compound}isIntArray(){return this.getId()===B.IntArray}isLongArray(){return this.getId()===B.LongArray}isNumber(){return this.isByte()||this.isShort()||this.isInt()||this.isLong()||this.isFloat()||this.isDouble()}isArray(){return this.isByteArray()||this.isIntArray()||this.isLongArray()}isListOrArray(){return this.isList()||this.isArray()}getAsNumber(){return 0}getAsString(){return""}toJsonWithId(){return{type:this.getId(),value:this.toJson()}}static getFactory(t){const n=this.FACTORIES.get(t);if(!n)throw new Error(`Invalid tag id ${t}`);return n}static create(t){return this.getFactory(t).create()}static fromString(t){const n=typeof t=="string"?new Me(t):t;return this.getFactory(B.Compound).fromString(n)}static fromJson(t,n=B.Compound){return this.getFactory(n).fromJson(t)}static fromJsonWithId(t){var r,s,a;const n=(r=l.Json.readObject(t))!=null?r:{},i=(s=l.Json.readInt(n.type))!=null?s:0;return Ti.fromJson((a=n.value)!=null?a:{},i)}static fromBytes(t,n=B.Compound){return this.getFactory(n).fromBytes(t)}};let j=Ti;p(j,"FACTORIES",new Map);const Yt=class extends j{constructor(n){super();p(this,"value");this.value=typeof n=="number"?n:n?1:0}getId(){return B.Byte}getAsNumber(){return this.value}toString(){return this.value.toFixed()+"b"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.value}toJson(){return this.value}toBytes(n){n.writeByte(this.value)}static create(){return Yt.ZERO}static fromJson(n){var i;return new Yt((i=l.Json.readInt(n))!=null?i:0)}static fromBytes(n){const i=n.readByte();return new Yt(i)}};let Ke=Yt;p(Ke,"ZERO",new Yt(0)),p(Ke,"ONE",new Yt(1)),j.register(B.Byte,Ke);class Cn extends j{constructor(n){super();p(this,"items");this.items=n}getItems(){return this.items.slice(0)}getAsTuple(n,i){return[...Array(n)].map((r,s)=>i(this.items[s]))}get(n){if(n=Math.floor(n),!(n<0||n>=this.items.length))return this.items[n]}get length(){return this.items.length}map(n){return this.items.map(n)}filter(n){return this.items.filter(n)}forEach(n){this.items.forEach(n)}set(n,i){this.items[n]=i}add(n){this.items.push(n)}insert(n,i){this.items.splice(n,0,i)}delete(n){this.items.splice(n,1)}clear(){this.items=[]}}class pt extends Cn{constructor(t){super(Array.from(t!=null?t:[],n=>typeof n=="number"?new Ke(n):n))}getId(){return B.ByteArray}getType(){return B.Byte}toString(){return"[B;"+this.items.map(n=>n.getAsNumber().toFixed()+"B").join(",")+"]"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.items.map(t=>t.getAsNumber())}toJson(){return this.items.map(t=>t.getAsNumber())}toBytes(t){t.writeInt(this.items.length),t.writeBytes(this.items.map(n=>n.getAsNumber()))}static create(){return new pt([])}static fromJson(t){var i;const n=(i=l.Json.readArray(t,r=>{var s;return(s=l.Json.readNumber(r))!=null?s:0}))!=null?i:[];return new pt(n)}static fromBytes(t){const n=t.readInt(),i=t.readBytes(n);return new pt(i)}}j.register(B.ByteArray,pt);class Ft extends j{constructor(n){super();p(this,"value");this.value=n}getId(){return B.Float}getAsNumber(){return this.value}toString(){return this.value.toString()+"f"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.value}toJson(){return this.value}toBytes(n){n.writeFloat(this.value)}static create(){return new Ft(0)}static fromJson(n){var i;return new Ft((i=l.Json.readNumber(n))!=null?i:0)}static fromBytes(n){const i=n.readFloat();return new Ft(i)}}j.register(B.Float,Ft);class it extends j{constructor(n){super();p(this,"value");this.value=n}getId(){return B.Int}getAsNumber(){return this.value}toString(){return this.value.toFixed()}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.value}toJson(){return this.value}toBytes(n){n.writeInt(this.value)}static create(){return new it(0)}static fromJson(n){var i;return new it((i=l.Json.readInt(n))!=null?i:0)}static fromBytes(n){const i=n.readInt();return new it(i)}}j.register(B.Int,it);class bt extends Cn{constructor(t){super(Array.from(t!=null?t:[],n=>typeof n=="number"?new it(n):n))}getId(){return B.IntArray}getType(){return B.Int}get length(){return this.items.length}toString(){return"[I;"+this.items.map(n=>n.getAsNumber().toFixed()).join(",")+"]"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.items.map(t=>t.getAsNumber())}toJson(){return this.items.map(t=>t.getAsNumber())}toBytes(t){t.writeInt(this.items.length);for(const n of this.items)t.writeInt(n.getAsNumber())}static create(){return new bt}static fromJson(t){var i;const n=(i=l.Json.readArray(t,r=>{var s;return(s=l.Json.readNumber(r))!=null?s:0}))!=null?i:[];return new bt(n)}static fromBytes(t){const n=t.readInt(),i=[];for(let r=0;rnew n(r)))}getId(){return B.List}getType(){return this.type}getNumber(n){const i=this.get(n);return i!=null&&i.isNumber()?i.getAsNumber():0}getString(n){const i=this.get(n);return i!=null&&i.isString()?i.getAsString():""}getList(n,i){const r=this.get(n);return(r==null?void 0:r.isList())&&r.getType()===i?r:ze.create()}getCompound(n){const i=this.get(n);return i!=null&&i.isCompound()?i:ue.create()}set(n,i){this.updateType(i),super.set(n,i)}add(n){this.updateType(n),super.add(n)}insert(n,i){this.updateType(i),super.insert(n,i)}updateType(n){if(n.getId()!==B.End){if(this.type===B.End)this.type=n.getId();else if(this.type!==n.getId())throw new Error(`Trying to add tag of type ${B[n.getId()]} to list of ${B[this.type]}`)}}clear(){super.clear(),this.type=B.End}toString(){return"["+this.items.map(n=>n.toString()).join(",")+"]"}toPrettyString(n=" ",i=0){if(this.length===0)return"[]";const r=n.repeat(i),s=n.repeat(i+1);return`[ `+this.map(a=>s+a.toPrettyString(n,i+1)).join(`, `)+` `+r+"]"}toSimplifiedJson(){return this.map(n=>n.toSimplifiedJson())}toJson(){return{type:this.type,items:this.items.map(n=>n.toJson())}}toBytes(n){this.items.length===0?this.type=B.End:this.type=this.items[0].getId(),n.writeByte(this.type),n.writeInt(this.items.length);for(const i of this.items)i.toBytes(n)}static create(){return new ze}static fromJson(n){var a,o,u;const i=(a=l.Json.readObject(n))!=null?a:{},r=(o=l.Json.readNumber(i.type))!=null?o:B.Compound,s=((u=l.Json.readArray(i.items))!=null?u:[]).flatMap(c=>c!==void 0?[j.fromJson(c,r)]:[]);return new ze(s,r)}static fromBytes(n){const i=n.readByte(),r=n.readInt();if(i===B.End&&r>0)throw new Error(`Missing type on ListTag but length is ${r}`);const s=[];for(let a=0;atypeof i=="number"?i:0):[0,0])}static fromBytes(n){const i=n.readInt(),r=n.readInt();return new fe([i,r])}};let Jt=fe;p(Jt,"dataview",new DataView(new Uint8Array(8).buffer)),j.register(B.Long,Jt);class St extends Cn{constructor(t){super(Array.from(t!=null?t:[],n=>typeof n=="bigint"||Array.isArray(n)?new Jt(n):n))}getId(){return B.LongArray}getType(){return B.Long}get length(){return this.items.length}toString(){return"[I;"+this.items.map(n=>n.toString()).join(",")+"]"}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.items.map(t=>t.getAsPair())}toJson(){return this.items.map(t=>t.getAsPair())}toBytes(t){t.writeInt(this.items.length);for(const n of this.items){const[i,r]=n.getAsPair();t.writeInt(i),t.writeInt(r)}}static create(){return new St}static fromJson(t){var i;const n=(i=l.Json.readArray(t,r=>{var s;return(s=l.Json.readPair(r,a=>{var o;return(o=l.Json.readNumber(a))!=null?o:0}))!=null?s:[0,0]}))!=null?i:[];return new St(n)}static fromBytes(t){const n=t.readInt(),i=[];for(let r=0;r{const t=new RegExp("^[-+]?(?:[0-9]+[.]|[0-9]*[.][0-9]+)(?:e[-+]?[0-9]+)?$","i"),n=new RegExp("^[-+]?(?:[0-9]+[.]?|[0-9]*[.][0-9]+)(?:e[-+]?[0-9]+)?d$","i"),i=new RegExp("^[-+]?(?:[0-9]+[.]?|[0-9]*[.][0-9]+)(?:e[-+]?[0-9]+)?f$","i"),r=new RegExp("^[-+]?(?:0|[1-9][0-9]*)b$","i"),s=new RegExp("^[-+]?(?:0|[1-9][0-9]*)l$","i"),a=new RegExp("^[-+]?(?:0|[1-9][0-9]*)s$","i"),o=new RegExp("^[-+]?(?:0|[1-9][0-9]*)$","i");function u(d){if(d.skipWhitespace(),!d.canRead())throw d.createError("Expected value");const w=d.peek();if(w==="{")return c(d);if(w==="[")if(d.canRead(3)&&!Me.isQuotedStringStart(d.peek(1))&&d.peek(2)===";"){d.expect("[",!0);const S=d.cursor,_=d.read();if(d.skip(),d.skipWhitespace(),d.canRead()){if(_==="B")return f(d,pt,B.ByteArray,B.Byte);if(_==="L")return f(d,St,B.LongArray,B.Long);if(_==="I")return f(d,bt,B.IntArray,B.Int);throw d.cursor=S,d.createError(`Invalid array type '${_}'`)}else throw d.createError("Expected value")}else return h(d);else{d.skipWhitespace();const S=d.cursor;if(Me.isQuotedStringStart(d.peek()))return new ke(d.readQuotedString());{const _=d.readUnquotedString();if(_.length===0)throw d.cursor=S,d.createError("Expected value");try{if(i.test(_)){const E=Number(_.substring(0,_.length-1));return new Ft(E)}else if(r.test(_)){const E=Number(_.substring(0,_.length-1));return new Ke(Math.floor(E))}else if(s.test(_)){const E=BigInt(_.substring(0,_.length-1));return new Jt(E)}else if(a.test(_)){const E=Number(_.substring(0,_.length-1));return new Ut(Math.floor(E))}else if(o.test(_)){const E=Number(_);return new it(Math.floor(E))}else if(n.test(_)){const E=Number(_.substring(0,_.length-1));return new At(E)}else if(t.test(_)){const E=Number(_);return new At(E)}else{if(_.toLowerCase()==="true")return Ke.ONE;if(_.toLowerCase()==="false")return Ke.ZERO}}catch{}return _.length===0?ke.EMPTY:new ke(_)}}}e.readTag=u;function c(d){d.expect("{",!0);const w=new Map;for(d.skipWhitespace();d.canRead()&&d.peek()!=="}";){const S=d.cursor;if(d.skipWhitespace(),!d.canRead())throw d.createError("Expected key");const _=d.readString();if(_.length===0)throw d.cursor=S,d.createError("Expected key");d.expect(":",!0);const E=u(d);if(w.set(_,E),!g(d))break;if(!d.canRead())throw d.createError("Expected key")}return d.expect("}",!0),new ue(w)}function h(d){if(d.expect("[",!0),d.skipWhitespace(),!d.canRead())throw d.createError("Expected value");const w=[];let S=B.End;for(;d.peek()!=="]";){const _=d.cursor,E=u(d),A=E.getId();if(S===B.End)S=A;else if(A!==S)throw d.cursor=_,d.createError(`Can't insert ${B[A]} into list of ${B[S]}`);if(w.push(E),!g(d))break;if(!d.canRead())throw d.createError("Expected value")}return d.expect("]",!0),new ze(w,S)}function f(d,w,S,_){const E=[];for(;d.peek()!=="]";){const A=u(d);if(A.getId()!==_)throw d.createError(`Can't insert ${B[A.getId()]} into ${B[S]}`);if(E.push(A.isLong()?A.getAsPair():A.getAsNumber()),!g(d))break;if(!d.canRead())throw d.createError("Expected value")}return d.expect("]"),new w(E)}function g(d){return d.skipWhitespace(),d.canRead()&&d.peek()===","?(d.skip(),d.skipWhitespace(),!0):!1}})(nr||(nr={}));class ue extends j{constructor(n){super();p(this,"properties");this.properties=n!=null?n:new Map}getId(){return B.Compound}has(n){return this.properties.has(n)}hasNumber(n){var i,r;return(r=(i=this.get(n))==null?void 0:i.isNumber())!=null?r:!1}hasString(n){var i,r;return(r=(i=this.get(n))==null?void 0:i.isString())!=null?r:!1}hasList(n,i,r){var a;const s=this.get(n);return(a=(s==null?void 0:s.isList())&&(i===void 0||s.getType()===i)&&(r===void 0||s.length===r))!=null?a:!1}hasCompound(n){var i,r;return(r=(i=this.get(n))==null?void 0:i.isCompound())!=null?r:!1}get(n){return this.properties.get(n)}getString(n){var i,r;return(r=(i=this.get(n))==null?void 0:i.getAsString())!=null?r:""}getNumber(n){var i,r;return(r=(i=this.get(n))==null?void 0:i.getAsNumber())!=null?r:0}getBoolean(n){return this.getNumber(n)!==0}getList(n,i){const r=this.get(n);return(r==null?void 0:r.isList())&&(i===void 0||r.getType()===i)?r:ze.create()}getCompound(n){const i=this.get(n);return i!=null&&i.isCompound()?i:ue.create()}getByteArray(n){const i=this.get(n);return i!=null&&i.isByteArray()?i:pt.create()}getIntArray(n){const i=this.get(n);return i!=null&&i.isIntArray()?i:bt.create()}getLongArray(n){const i=this.get(n);return i!=null&&i.isLongArray()?i:St.create()}keys(){return this.properties.keys()}get size(){return this.properties.size}map(n){return Object.fromEntries([...this.properties.entries()].map(([i,r])=>n(i,r,this)))}forEach(n){[...this.properties.entries()].forEach(([i,r])=>n(i,r,this))}set(n,i){return this.properties.set(n,i),this}delete(n){return this.properties.delete(n)}clear(){return this.properties.clear(),this}toString(){const n=[];for(const[i,r]of this.properties.entries()){const s=i.split("").some(a=>!Me.isAllowedInUnquotedString(a));n.push((s?JSON.stringify(i):i)+":"+r.toString())}return"{"+n.join(",")+"}"}toPrettyString(n=" ",i=0){if(this.size===0)return"{}";const r=n.repeat(i),s=n.repeat(i+1);return`{ `+Object.values(this.map((a,o)=>[a,s+a+": "+o.toPrettyString(n,i+1)])).join(`, `)+` `+r+"}"}toSimplifiedJson(){return this.map((n,i)=>[n,i.toSimplifiedJson()])}toJson(){return this.map((n,i)=>[n,{type:i.getId(),value:i.toJson()}])}toBytes(n){for(const[i,r]of this.properties.entries()){const s=r.getId();n.writeByte(s),n.writeString(i),r.toBytes(n)}n.writeByte(B.End)}static create(){return new ue}static fromString(n){return nr.readTag(n)}static fromJson(n){const i=l.Json.readMap(n,r=>{var c;const{type:s,value:a}=(c=l.Json.readObject(r))!=null?c:{},o=l.Json.readNumber(s);return j.fromJson(a!=null?a:{},o)});return new ue(new Map(Object.entries(i)))}static fromBytes(n){const i=new Map;for(;;){const r=n.readByte();if(r===B.End)break;const s=n.readString(),a=j.fromBytes(n,r);i.set(s,a)}return new ue(i)}}j.register(B.Compound,ue);const Tt=class{constructor(t,n,i,r,s){this.name=t,this.root=n,this.compression=i,this.littleEndian=r,this.bedrockHeader=s}writeNamedTag(t){t.writeByte(B.Compound),t.writeString(this.name),this.root.toBytes(t)}write(){const t=this.littleEndian===!0||this.bedrockHeader!==void 0,n=new vr({littleEndian:t,offset:this.bedrockHeader&&8});if(this.writeNamedTag(n),this.bedrockHeader!==void 0){const r=n.offset;n.offset=0,n.writeInt(this.bedrockHeader),n.writeInt(r-8),n.offset=r}const i=n.getData();return this.compression==="gzip"?tr.gzip(i):this.compression==="zlib"?tr.deflate(i):i}static readNamedTag(t){if(t.readByte()!==B.Compound)throw new Error("Top tag should be a compound");return{name:t.readString(),root:ue.fromBytes(t)}}static create(t={}){var o,u,c;const n=(o=t.name)!=null?o:Tt.DEFAULT_NAME,i=ue.create(),r=(u=t.compression)!=null?u:"none",s=typeof t.bedrockHeader=="boolean"?Tt.DEFAULT_BEDROCK_HEADER:t.bedrockHeader,a=(c=t.littleEndian)!=null?c:t.bedrockHeader!==void 0;return new Tt(n,i,r,a,s)}static read(t,n={}){var g;const i=typeof n.bedrockHeader=="number"?n.bedrockHeader:n.bedrockHeader?wa(t):void 0,r=n.compression==="gzip"||!i&&n.compression===void 0&&ye(t),s=n.compression==="zlib"||!i&&n.compression===void 0&&Ct(t),a=s||r?tr.inflate(t):t,o=n.littleEndian||i!==void 0,u=r?"gzip":s?"zlib":"none",c=new Sr(a,{littleEndian:o,offset:i&&8}),{name:h,root:f}=Tt.readNamedTag(c);return new Tt((g=n.name)!=null?g:h,f,u,o,i)}toJson(){var t;return{name:this.name,root:this.root.toJson(),compression:this.compression,littleEndian:this.littleEndian,bedrockHeader:(t=this.bedrockHeader)!=null?t:null}}static fromJson(t){var u,c,h,f,g;const n=(u=l.Json.readObject(t))!=null?u:{},i=(c=l.Json.readString(n.name))!=null?c:"",r=ue.fromJson((h=n.root)!=null?h:{}),s=(f=l.Json.readString(n.compression))!=null?f:"none",a=(g=l.Json.readBoolean(n.littleEndian))!=null?g:!1,o=l.Json.readNumber(n.bedrockHeader);return new Tt(i,r,s,a,o)}};let qe=Tt;p(qe,"DEFAULT_NAME",""),p(qe,"DEFAULT_BEDROCK_HEADER",4);class rt{constructor(t,n,i,r,s){p(this,"file");p(this,"dirty");this.x=t,this.z=n,this.compression=i,this.timestamp=r,this.raw=s,this.dirty=!1}getCompression(){switch(this.compression){case 1:return"gzip";case 2:return"zlib";case 3:return"none";default:throw new Error(`Invalid compression mode ${this.compression}`)}}setCompression(t){switch(t){case"gzip":this.compression=1;break;case"zlib":this.compression=2;break;case"none":this.compression=3;break;default:throw new Error(`Invalid compression mode ${t}`)}}getFile(){return this.file===void 0&&(this.file=qe.read(this.raw,{compression:this.getCompression()})),this.file}getRoot(){return this.getFile().root}setRoot(t){this.file===void 0&&(this.file=qe.create({compression:this.getCompression()})),this.file.root=t,this.markDirty()}markDirty(){this.dirty=!0}getRaw(){if(this.file===void 0||this.dirty===!1)return this.raw;this.file.compression=this.getCompression();const t=this.file.write();return this.raw=t,this.dirty=!1,t}toJson(){return{x:this.x,z:this.z,compression:this.compression,timestamp:this.timestamp,size:this.raw.byteLength}}toRef(t){return new rt.Ref(this.x,this.z,this.compression,this.timestamp,this.raw.byteLength,t)}static create(t,n,i,r){const s=new rt(t,n,0,r!=null?r:0,i.write());return s.setCompression(i.compression),s}static fromJson(t,n){var c,h,f,g,d,w;const i=(c=l.Json.readObject(t))!=null?c:{},r=(h=l.Json.readInt(i.x))!=null?h:0,s=(f=l.Json.readInt(i.z))!=null?f:0,a=(g=l.Json.readNumber(i.compression))!=null?g:2,o=(d=l.Json.readInt(i.timestamp))!=null?d:0,u=(w=l.Json.readInt(i.size))!=null?w:0;return new rt.Ref(r,s,a,o,u,n)}}(e=>{class t{constructor(i,r,s,a,o,u){p(this,"file");this.x=i,this.z=r,this.compression=s,this.timestamp=a,this.size=o,this.resolver=u}getFile(){if(this.file instanceof qe)return this.file}getRoot(){if(this.file instanceof qe)return this.file.root}async getFileAsync(){return this.file?this.file:(this.file=(async()=>{const i=await this.resolver(this.x,this.z);return this.file=i,i})(),this.file)}async getRootAsync(){return(await this.getFileAsync()).root}isResolved(){return this.file instanceof qe}}e.Ref=t})(rt||(rt={}));class Us{constructor(t){p(this,"chunks");this.chunks=Array(32*32).fill(void 0);for(const n of t){const i=vt.getIndex(n.x,n.z);this.chunks[i]=n}}getChunkPositions(){return this.chunks.flatMap(t=>t?[[t.x,t.z]]:[])}getChunk(t){if(!(t<0||t>=32*32))return this.chunks[t]}findChunk(t,n){return this.getChunk(vt.getIndex(t,n))}getFirstChunk(){return this.chunks.filter(t=>t!==void 0)[0]}filter(t){return this.chunks.filter(n=>n!==void 0&&t(n))}map(t){return this.chunks.flatMap(n=>n!==void 0?[t(n)]:[])}}class vt extends Us{constructor(t){super(t)}write(){let t=0;for(const s of this.chunks)s!==void 0&&(t+=Math.ceil(s.getRaw().length/4096));const n=new Uint8Array(8192+t*4096),i=new DataView(n.buffer);let r=2;for(const s of this.chunks){if(s===void 0)continue;const a=s.getRaw(),o=4*((s.x&31)+(s.z&31)*32),u=Math.ceil(a.length/4096);i.setInt8(o,r>>16),i.setInt16(o+1,r&65535),i.setInt8(o+3,u),i.setInt32(o+4096,s.timestamp);const c=r*4096;i.setInt32(c,a.length+1),i.setInt8(c+4,s.compression),n.set(a,c+5),r+=u}return n}static read(t){const n=[];for(let i=0;i<32;i+=1)for(let r=0;r<32;r+=1){const s=4*((i&31)+(r&31)*32);if(t[s+3]===0)continue;const o=(t[s]<<16)+(t[s+1]<<8)+t[s+2],u=(t[s+4096]<<24)+(t[s+4097]<<16)+(t[s+4098]<<8)+t[s+4099],c=o*4096,h=(t[c]<<24)+(t[c+1]<<16)+(t[c+2]<<8)+t[c+3],f=t[c+4],g=t.slice(c+5,c+4+h);n.push(new rt(i,r,f,u,g))}return new vt(n)}static getIndex(t,n){return(t&31)+(n&31)*32}toJson(){return{chunks:this.map(t=>t.toJson())}}static fromJson(t,n){var a,o;const i=(a=l.Json.readObject(t))!=null?a:{},s=((o=l.Json.readArray(i.chunks))!=null?o:[]).flatMap(u=>u!==void 0?[rt.fromJson(u,n)]:[]);return new vt.Ref(s)}}(e=>{class t extends Us{}e.Ref=t})(vt||(vt={}));class At extends j{constructor(n){super();p(this,"value");this.value=n}getId(){return B.Double}getAsNumber(){return this.value}toString(){return Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}toPrettyString(){return this.toString()}toSimplifiedJson(){return this.value}toJson(){return this.value}toBytes(n){n.writeDouble(this.value)}static create(){return new At(0)}static fromJson(n){var i;return new At((i=l.Json.readNumber(n))!=null?i:0)}static fromBytes(n){const i=n.readDouble();return new At(i)}}j.register(B.Double,At);const on=class extends j{constructor(){super()}getId(){return B.End}toString(){return"END"}toPrettyString(){return this.toString()}toSimplifiedJson(){return null}toJson(){return null}toBytes(){}static create(){return on.INSTANCE}static fromJson(){return on.INSTANCE}static fromBytes(){return on.INSTANCE}};let Mn=on;p(Mn,"INSTANCE",new on),j.register(B.End,Mn),l.Direction=(e=>(e.UP="up",e.DOWN="down",e.NORTH="north",e.EAST="east",e.SOUTH="south",e.WEST="west",e))(l.Direction||{});const ml={up:[0,1,0],down:[0,-1,0],north:[0,0,-1],east:[1,0,0],south:[0,0,1],west:[-1,0,0]};(e=>{e.ALL=["up","down","north","east","south","west"];function t(n){return ml[n]}e.normal=t})(l.Direction||(l.Direction={})),l.BlockPos=void 0,(e=>{function t(f,g,d){return[f,g,d]}e.create=t,e.ZERO=e.create(0,0,0);function n(f,g,d,w){return[f[0]+g,f[1]+d,f[2]+w]}e.offset=n;function i(f,g){return[f[0]-g[0],f[1]-g[1],f[2]-g[2]]}e.subtract=i;function r(f,g){return[f[0]+g[0],f[1]+g[1],f[2]+g[2]]}e.add=r;function s(f,g){return e.offset(f,...l.Direction.normal(g))}e.towards=s;function a(f,g){return f===g?!0:f[0]===g[0]&&f[1]===g[1]&&f[2]===g[2]}e.equals=a;function o(f){return f[0]*f[0]+f[1]*f[1]+f[2]*f[2]}e.magnitude=o;function u(f){return new ze(f.map(g=>new it(g)))}e.toNbt=u;function c(f){return f.getAsTuple(3,g=>g!=null&&g.isInt()?g.getAsNumber():0)}e.fromNbt=c;function h(f){var d;const g=(d=l.Json.readArray(f,w=>{var S;return(S=l.Json.readInt(w))!=null?S:0}))!=null?d:[0,0,0];return t(g[0],g[1],g[2])}e.fromJson=h})(l.BlockPos||(l.BlockPos={}));const je=class{constructor(t,n){if(this.namespace=t,this.path=n,!t.match(/^[a-z0-9._-]*$/))throw new Error(`Non [a-z0-9._-] character in namespace of ${t}${je.SEPARATOR}${n}`);if(!n.match(/^[a-z0-9/._-]*$/))throw new Error(`Non [a-z0-9/._-] character in path of ${t}${je.SEPARATOR}${n}`)}equals(t){return this===t?!0:t instanceof je?this.namespace===t.namespace&&this.path===t.path:!1}toString(){return this.namespace+je.SEPARATOR+this.path}withPrefix(t){return new je(this.namespace,t+this.path)}static create(t){return new je(this.DEFAULT_NAMESPACE,t)}static parse(t){const n=t.indexOf(this.SEPARATOR);if(n>=0){const i=n>=1?t.substring(0,n):this.DEFAULT_NAMESPACE,r=t.substring(n+1);return new je(i,r)}return new je(this.DEFAULT_NAMESPACE,t)}};let G=je;p(G,"DEFAULT_NAMESPACE","minecraft"),p(G,"SEPARATOR",":");const Oe=class{constructor(t,n={}){p(this,"name");this.properties=n,this.name=typeof t=="string"?G.parse(t):t}getName(){return this.name}getProperties(){return this.properties}getProperty(t){return this.properties[t]}isFluid(){return this.is(Oe.WATER)||this.is(Oe.LAVA)}equals(t){return this.name.equals(t.name)?Object.keys(this.properties).every(n=>t.properties[n]===this.properties[n]):!1}is(t){return this.name.equals(t.name)}toString(){return Object.keys(this.properties).length===0?this.name.toString():`${this.name.toString()}[${Object.entries(this.properties).map(([t,n])=>t+"="+n).join(",")}]`}static parse(t){const n=t.indexOf("[");if(n===-1)return new Oe(t);{const i=t.substring(0,n),r=t.substring(n+1,t.length-1).split(","),s=Object.fromEntries(r.map(a=>a.split("=")));return new Oe(i,s)}}static fromNbt(t){const n=G.parse(t.getString("Name")),i=t.getCompound("Properties").map((r,s)=>[r,s.getAsString()]);return new Oe(n,i)}static fromJson(t){var s,a;const n=(s=l.Json.readObject(t))!=null?s:{},i=G.parse((a=l.Json.readString(n.Name))!=null?a:Oe.STONE.name.toString()),r=l.Json.readMap(n.Properties,o=>{var u;return(u=l.Json.readString(o))!=null?u:""});return new Oe(i,r)}};let $=Oe;p($,"AIR",new Oe(G.create("air"))),p($,"STONE",new Oe(G.create("stone"))),p($,"WATER",new Oe(G.create("water"),{level:"0"})),p($,"LAVA",new Oe(G.create("lava"),{level:"0"}));class Ws{constructor(t,n){p(this,"storage");p(this,"palette");this.size=t,this.defaultValue=n,this.storage=Array(t).fill(0),this.palette=[n]}index(t,n,i){return(t<<8)+(n<<4)+i}get(t,n,i){const r=this.storage[this.index(t,n,i)];return this.palette[r]}set(t,n,i,r){let s=this.palette.findIndex(a=>a.equals(r));s===-1&&(s=this.palette.length,this.palette.push(r)),this.storage[this.index(t,n,i)]=s}}const cn=class{constructor(t){p(this,"states");this.minY=t,this.states=new Ws(cn.SIZE,$.AIR)}get minBlockY(){return this.minY<<4}getBlockState(t,n,i){return this.states.get(t,n,i)}setBlockState(t,n,i,r){this.states.set(t,n,i,r)}};let tn=cn;p(tn,"WIDTH",16),p(tn,"SIZE",cn.WIDTH*cn.WIDTH*cn.WIDTH);class wl{constructor(t,n,i){p(this,"sections");this.minY=t,this.height=n,this.pos=i,this.sections=Array(this.sectionsCount).fill(null)}get maxY(){return this.minY+this.height}get minSection(){return this.minY>>4}get maxSection(){return(this.maxY-1>>4)+1}get sectionsCount(){return this.maxSection-this.minSection}getSectionIndex(t){return(t>>4)-this.minSection}getBlockState(t){var a;const[n,i,r]=t,s=this.sections[this.getSectionIndex(i)];return(a=s==null?void 0:s.getBlockState(n&15,i&15,r&15))!=null?a:$.AIR}setBlockState(t,n){const[i,r,s]=t,a=this.getSectionIndex(r);let o=this.sections[a];if(o===null){if(n.equals($.AIR))return;o=this.getOrCreateSection(a)}o.setBlockState(i&15,r&15,s&15,n)}getOrCreateSection(t){return this.sections[t]==null&&(this.sections[t]=new tn(this.minSection+t)),this.sections[t]}}l.ChunkPos=void 0,(e=>{function t(h,f){return[h,f]}e.create=t;function n(h){return[h[0]>>4,h[2]>>4]}e.fromBlockPos=n;function i(h){return[Number(h)&4294967295,Number(h>>BigInt(32))]}e.fromLong=i;function r(h){return s(h[0],h[1])}e.toLong=r;function s(h,f){return BigInt(h&4294967295)|BigInt(f&4294967295)<{function t(r,s){return a=>typeof a=="string"?i(r,G.parse(a)):n(s(a))}e.parser=t;function n(r,s){return{value:()=>r,key:()=>s}}e.direct=n;function i(r,s,a=!0){return a?{value:()=>r.getOrThrow(s),key:()=>s}:{value:()=>r.get(s),key:()=>s}}e.reference=i})(l.Holder||(l.Holder={}));class Nt{constructor(t){this.entries=t}static parser(t,n){const i=n!=null?n:r=>{var s;return l.Holder.reference(t,G.parse((s=l.Json.readString(r))!=null?s:""))};return r=>{var s,a;return typeof r=="string"?r.startsWith("#")?l.Holder.reference(t.getTagRegistry(),G.parse(r.substring(1))):l.Holder.direct(new Nt([])):l.Holder.direct((a=new Nt((s=l.Json.readArray(r,i))!=null?s:[]))!=null?a:[])}}static fromJson(t,n,i){var o,u,c;const r=(o=l.Json.readObject(n))!=null?o:{},s=(u=l.Json.readBoolean(r.replace))!=null?u:!1,a=(c=l.Json.readArray(r.values,h=>{var d,w,S;var f=!0,g="";if(typeof h=="string")g=h;else{const _=(d=l.Json.readObject(h))!=null?d:{};f=(w=l.Json.readBoolean(_.required))!=null?w:!1,g=(S=l.Json.readString(_.id))!=null?S:""}return g.startsWith("#")?l.Holder.reference(t.getTagRegistry(),G.parse(g.substring(1)),f):l.Holder.reference(t,G.parse(g),f)}))!=null?c:[];return i&&!s&&t.getTagRegistry().has(i)&&(a==null||a.push(l.Holder.direct(t.getTagRegistry().get(i)))),new Nt(a)}*getEntries(){for(const t of this.entries){const n=t.value();n!==void 0&&(n instanceof Nt?yield*n.getEntries():yield t)}}}const $t=class{constructor(t,n){p(this,"storage",new Map);p(this,"builtin",new Map);p(this,"tags");this.key=t,this.parser=n}static createAndRegister(t,n){const i=new $t(G.create(t),n);return $t.REGISTRY.register(i.key,i),i}register(t,n,i){return this.storage.set(t.toString(),n),i&&this.builtin.set(t.toString(),n),l.Holder.reference(this,t)}delete(t){const n=this.storage.delete(t.toString());return this.builtin.delete(t.toString()),n}keys(){return[...this.storage.keys()].map(t=>G.parse(t))}has(t){return this.storage.has(t.toString())}get(t){var n=this.storage.get(t.toString());return n instanceof Function&&(n=n(),this.storage.set(t.toString(),n)),n}getOrThrow(t){const n=this.get(t);if(n===void 0)throw new Error(`Missing key in ${this.key.toString()}: ${t.toString()}`);return n}parse(t){if(!this.parser)throw new Error(`No parser exists for ${this.key.toString()}`);return this.parser(t)}clear(){this.storage.clear();for(const[t,n]of this.builtin.entries())this.storage.set(t,n);return this.tags&&this.tags.clear(),this}assign(t){if(!this.key.equals(t.key))throw new Error(`Cannot assign registry of type ${t.key.toString()} to registry of type ${this.key.toString()}`);for(const n of t.keys())this.storage.set(n.toString(),t.getOrThrow(n));return this}cloneEmpty(){return new $t(this.key,this.parser)}forEach(t){for(const[n,i]of this.storage.entries())t(G.parse(n),i instanceof Function?i():i,this)}map(t){return[...this.storage.entries()].map(([n,i])=>t(G.parse(n),i instanceof Function?i():i,this))}getTagRegistry(){return this.tags===void 0&&(this.tags=new $t(new G(this.key.namespace,`tags/${this.key.path}`))),this.tags}};let oe=$t;p(oe,"REGISTRY",new $t(G.create("root")));const li=new oe(G.create("attribute"));oe.REGISTRY.register(li.key,li),l.Attribute=void 0,(e=>{e.REGISTRY=li})(l.Attribute||(l.Attribute={}));function Re(e,t,n,i){const r={id:G.create(e),defaultValue:t,minValue:n,maxValue:i};return li.register(r.id,r,!0),r}l.Attributes=void 0,(e=>{e.MAX_HEALTH=Re("generic.max_health",20,1,1024),e.FOLLOW_RANGE=Re("generic.follow_range",32,0,2048),e.KNOCKBACK_RESISTANCE=Re("generic.knockback_resistance",0,0,1),e.MOVEMENT_SPEED=Re("generic.movement_speed",.7,0,1024),e.FLYING_SPEED=Re("generic.flying_speed",.4,0,1024),e.ATTACK_DAMAGE=Re("generic.attack_damage",2,0,2048),e.ATTACK_KNOCKBACK=Re("generic.attack_knockback",0,0,5),e.ATTACK_SPEED=Re("generic.attack_speed",4,0,1024),e.ARMOR=Re("generic.armor",0,0,30),e.ARMOR_TOUGHNESS=Re("generic.armor_toughness",0,0,20),e.LUCK=Re("generic.luck",0,-1024,1024),e.SPAWN_REINFORCEMENTS=Re("zombie.spawn_reinforcements",0,0,1),e.JUMP_STRENGTH=Re("generic.jump_strength",.7,0,2)})(l.Attributes||(l.Attributes={}));var Fe=(e=>(e[e.addition=0]="addition",e[e.multiply_base=1]="multiply_base",e[e.multiply_total=2]="multiply_total",e))(Fe||{});const hi=new oe(G.create("mob_effect"));oe.REGISTRY.register(hi.key,hi);const Vs=new Map;l.MobEffect=void 0,(e=>{e.REGISTRY=hi;function t(n){return Vs.get(n)}e.fromId=t})(l.MobEffect||(l.MobEffect={}));function q(e,t,n,i,r=new Map){const s={index:e,id:G.create(t),category:n,color:typeof i=="number"?we(i):i,modifiers:r};return Vs.set(e,s),hi.register(s.id,s,!0),s}l.MobEffects=void 0,(e=>{e.SPEED=q(1,"speed","beneficial",8171462,new Map([[l.Attributes.MOVEMENT_SPEED,{amount:.2,operation:Fe.multiply_total}]])),e.SLOWNESS=q(2,"slowness","harmful",5926017,new Map([[l.Attributes.MOVEMENT_SPEED,{amount:-.15,operation:Fe.multiply_total}]])),e.HASTE=q(3,"haste","beneficial",14270531,new Map([[l.Attributes.ATTACK_SPEED,{amount:.1,operation:Fe.multiply_total}]])),e.MINING_FATIGUE=q(4,"mining_fatigue","harmful",4866583,new Map([[l.Attributes.ATTACK_SPEED,{amount:-.1,operation:Fe.multiply_total}]])),e.STRENGTH=q(5,"strength","beneficial",9643043,new Map([[l.Attributes.ATTACK_DAMAGE,{amount:3,operation:Fe.addition}]])),e.INSTANT_HEALTH=q(6,"instant_health","beneficial",16262179),e.INSTANT_DAMAGE=q(7,"instant_damage","harmful",4393481),e.JUMP_BOOST=q(8,"jump_boost","beneficial",2293580),e.NAUSEA=q(9,"nausea","harmful",5578058),e.REGENERATION=q(10,"regeneration","beneficial",13458603),e.RESISTANCE=q(11,"resistance","beneficial",10044730),e.FIRE_RESISTANCE=q(12,"fire_resistance","beneficial",14981690),e.WATER_BREATHING=q(13,"water_breathing","beneficial",3035801),e.INVISIBILITY=q(14,"invisibility","beneficial",8356754),e.BLINDNESS=q(15,"blindness","harmful",2039587),e.NIGHT_VISION=q(16,"night_vision","beneficial",2039713),e.HUNGER=q(17,"hunger","harmful",5797459),e.WEAKNESS=q(18,"weakness","harmful",4738376,new Map([[l.Attributes.ATTACK_DAMAGE,{amount:-4,operation:Fe.addition}]])),e.POISON=q(19,"poison","harmful",5149489),e.WITHER=q(20,"wither","harmful",3484199),e.HEALTH_BOOST=q(21,"health_boost","beneficial",16284963,new Map([[l.Attributes.MAX_HEALTH,{amount:4,operation:Fe.addition}]])),e.ABSORPTION=q(22,"absorption","beneficial",2445989),e.SATURATION=q(23,"saturation","beneficial",16262179),e.GLOWING=q(24,"glowing","neutral",9740385),e.LEVITATION=q(25,"levitation","harmful",13565951),e.LUCK=q(26,"luck","beneficial",3381504,new Map([[l.Attributes.LUCK,{amount:1,operation:Fe.addition}]])),e.UNLUCK=q(27,"unluck","harmful",12624973,new Map([[l.Attributes.LUCK,{amount:-1,operation:Fe.addition}]])),e.SLOW_FALLING=q(28,"slow_falling","beneficial",16773073),e.CONDUIT_POWER=q(29,"conduit_power","beneficial",1950417),e.DOLPHINS_GRACE=q(30,"dolphins_grace","beneficial",8954814),e.BAD_OMEN=q(31,"bad_omen","neutral",745784),e.HERO_OF_THE_VILLAGE=q(32,"hero_of_the_village","beneficial",4521796),e.DARKNESS=q(33,"darkness","harmful",2696993)})(l.MobEffects||(l.MobEffects={})),l.MobEffectInstance=void 0,(e=>{function t(s,a=0,o=0,u=!1,c=!0,h){return{effect:s,duration:a,amplifier:o,ambient:u,visible:c,showIcon:h!=null?h:c}}e.create=t;function n(s){const a=s.getNumber("Id"),o=l.MobEffect.fromId(a);if(o===void 0)return;const u=s.getNumber("Amplifier"),c=s.getNumber("Duration"),h=s.getBoolean("Ambient"),f=!s.has("ShowParticles")||s.getBoolean("ShowParticles"),g=s.has("ShowIcon")?f:s.getBoolean("ShowIcon");return{effect:o,duration:c,amplifier:u,ambient:h,visible:f,showIcon:g}}e.fromNbt=n;function i(s){let[a,o,u]=[0,0,0],c=0;for(const h of s){const f=h.amplifier+1,g=h.effect.color;g!==void 0&&(a+=f*g[0],o+=f*g[1],u+=f*g[2],c+=f)}return c===0?we(0):(a=a/c,o=o/c,u=u/c,[a,o,u])}e.getColor=i;function r(s){const a=Math.floor(s.duration);let o=Math.floor(a/20),u=Math.floor(o/60);o%=60;const c=Math.floor(u/60);return u%=60,`${c>0?`${c}:`:""}${u.toFixed().padStart(2,"0")}:${o.toFixed().padStart(2,"0")}`}e.formatDuration=r})(l.MobEffectInstance||(l.MobEffectInstance={}));const El={mainhand:0,offhand:1,feet:0,legs:1,chest:2,head:3},Ln=new oe(G.create("item"));oe.REGISTRY.register(Ln.key,Ln),l.Item=void 0,(e=>{e.REGISTRY=Ln;function t(n){const i=typeof n=="string"?G.parse(n):n,r=Ln.get(i);return r!=null?r:{id:i,rarity:"common",stack:64}}e.get=t})(l.Item||(l.Item={}));function m(e,t){const n={id:G.create(e),rarity:"common",stack:64,...t,...(t==null?void 0:t.vanishable)||(t==null?void 0:t.wearable)?{vanishable:!0}:{}};return Ln.register(n.id,n,!0),n}function P(e,t,n){return{spawnEgg:{entityType:e,background:t,highlight:n}}}function Z(e,t,n){return{food:{nutrition:e,saturationModifier:t,isMeat:!1,canAlwaysEat:!1,fastFood:!1,effects:[],...n}}}const pl={leather:[5,[1,2,3,1],15,0,0],chainmail:[15,[1,4,5,2],12,0,0],iron:[15,[2,5,6,2],12,0,0],gold:[7,[1,3,5,2],25,0,0],diamond:[33,[3,6,8,3],9,2,0],turtle:[25,[2,5,6,2],9,0,0],netherite:[37,[3,6,8,3],15,3,.1]};function re(e,t){const[n,i,r,s,a]=pl[t],o=El[e];return{stack:1,durability:[13,15,16,11][o]*n,enchantmentValue:r,...t==="netherite"?{fireResistant:!0}:{},wearable:!0,armor:{slot:e,material:t,defense:i[o],toughness:s,knockbackResistance:a}}}const bl={wood:[0,59,2,0,15],stone:[1,131,4,1,5],iron:[2,250,6,2,14],diamond:[3,1561,8,3,10],gold:[0,32,12,0,22],netherite:[4,2031,9,4,15]};function ee(e,t){const[n,i,r,s,a]=bl[e];return{durability:i,enchantmentValue:a,...e==="netherite"?{fireResistant:!0}:{},tiered:{tier:e,level:n,speed:r,damage:s,isWeapon:t==="weapon",isDigger:t==="digger"||t==="axe",isAxe:t==="axe"}}}l.Items=void 0,(e=>{e.AIR=m("air"),e.CARVED_PUMPKIN=m("carved_pumpkin",{wearable:!0}),e.SADDLE=m("saddle",{stack:1}),e.MINECART=m("minecart",{stack:1}),e.CHEST_MINECART=m("chest_minecart",{stack:1}),e.FURNACE_MINECART=m("furnace_minecart",{stack:1}),e.TNT_MINECART=m("tnt_minecart",{stack:1}),e.HOPPER_MINECART=m("hopper_minecart",{stack:1}),e.CARROT_ON_A_STICK=m("carrot_on_a_stick",{stack:1,durability:25}),e.WARPED_FUNGUS_ON_A_STICK=m("warped_fungus_on_a_stick",{stack:1,durability:100}),e.ELYTRA=m("elytra",{rarity:"uncommon",stack:1,durability:432,wearable:!0}),e.OAK_BOAT=m("oak_boat",{stack:1}),e.OAK_CHEST_BOAT=m("oak_chest_boat",{stack:1}),e.SPRUCE_BOAT=m("spruce_boat",{stack:1}),e.SPRUCE_CHEST_BOAT=m("spruce_chest_boat",{stack:1}),e.BIRCH_BOAT=m("birch_boat",{stack:1}),e.BIRCH_CHEST_BOAT=m("birch_chest_boat",{stack:1}),e.JUNGLE_BOAT=m("jungle_boat",{stack:1}),e.JUNGLE_CHEST_BOAT=m("jungle_chest_boat",{stack:1}),e.ACACIA_BOAT=m("acacia_boat",{stack:1}),e.ACACIA_CHEST_BOAT=m("acacia_chest_boat",{stack:1}),e.DARK_OAK_BOAT=m("dark_oak_boat",{stack:1}),e.DARK_OAK_CHEST_BOAT=m("dark_oak_chest_boat",{stack:1}),e.MANGROVE_BOAT=m("mangrove_boat",{stack:1}),e.MANGROVE_CHEST_BOAT=m("mangrove_chest_boat",{stack:1}),e.BAMBOO_RAFT=m("bamboo_raft",{stack:1}),e.BAMBOO_CHEST_RAFT=m("bamboo_chest_raft",{stack:1}),e.STRUCTURE_BLOCK=m("structure_block",{rarity:"epic"}),e.JIGSAW=m("jigsaw",{rarity:"epic"}),e.TURTLE_HELMET=m("turtle_helmet",re("head","turtle")),e.FLINT_AND_STEEL=m("flint_and_steel",{stack:1,durability:64}),e.APPLE=m("apple",Z(4,.3)),e.BOW=m("bow",{stack:1,durability:384,enchantmentValue:1}),e.NETHERITE_INGOT=m("netherite_ingot",{fireResistant:!0}),e.NETHERITE_SCRAP=m("netherite_scrap",{fireResistant:!0}),e.WOODEN_SWORD=m("wooden_sword",ee("wood","weapon")),e.WOODEN_SHOVEL=m("wooden_shovel",ee("wood","digger")),e.WOODEN_PICKAXE=m("wooden_pickaxe",ee("wood","digger")),e.WOODEN_AXE=m("wooden_axe",ee("wood","axe")),e.WOODEN_HOE=m("wooden_hoe",ee("wood","digger")),e.STONE_SWORD=m("stone_sword",ee("stone","weapon")),e.STONE_SHOVEL=m("stone_shovel",ee("stone","digger")),e.STONE_PICKAXE=m("stone_pickaxe",ee("stone","digger")),e.STONE_AXE=m("stone_axe",ee("stone","axe")),e.STONE_HOE=m("stone_hoe",ee("stone","digger")),e.GOLDEN_SWORD=m("golden_sword",ee("gold","weapon")),e.GOLDEN_SHOVEL=m("golden_shovel",ee("gold","digger")),e.GOLDEN_PICKAXE=m("golden_pickaxe",ee("gold","digger")),e.GOLDEN_AXE=m("golden_axe",ee("gold","axe")),e.GOLDEN_HOE=m("golden_hoe",ee("gold","digger")),e.IRON_SWORD=m("iron_sword",ee("iron","weapon")),e.IRON_SHOVEL=m("iron_shovel",ee("iron","digger")),e.IRON_PICKAXE=m("iron_pickaxe",ee("iron","digger")),e.IRON_AXE=m("iron_axe",ee("iron","axe")),e.IRON_HOE=m("iron_hoe",ee("iron","digger")),e.DIAMOND_SWORD=m("diamond_sword",ee("diamond","weapon")),e.DIAMOND_SHOVEL=m("diamond_shovel",ee("diamond","digger")),e.DIAMOND_PICKAXE=m("diamond_pickaxe",ee("diamond","digger")),e.DIAMOND_AXE=m("diamond_axe",ee("diamond","axe")),e.DIAMOND_HOE=m("diamond_hoe",ee("diamond","digger")),e.NETHERITE_SWORD=m("netherite_sword",ee("netherite","weapon")),e.NETHERITE_SHOVEL=m("netherite_shovel",ee("netherite","digger")),e.NETHERITE_PICKAXE=m("netherite_pickaxe",ee("netherite","digger")),e.NETHERITE_AXE=m("netherite_axe",ee("netherite","axe")),e.NETHERITE_HOE=m("netherite_hoe",ee("netherite","digger")),e.MUSHROOM_STEW=m("mushroom_stew",{stack:1,...Z(6,.6)}),e.BREAD=m("bread",Z(5,.6)),e.LEATHER_HELMET=m("leather_helmet",re("head","leather")),e.LEATHER_CHESTPLATE=m("leather_chestplate",re("chest","leather")),e.LEATHER_LEGGINGS=m("leather_leggings",re("legs","leather")),e.LEATHER_BOOTS=m("leather_boots",re("feet","leather")),e.CHAINMAIL_HELMET=m("chainmail_helmet",re("head","chainmail")),e.CHAINMAIL_CHESTPLATE=m("chainmail_chestplate",re("chest","chainmail")),e.CHAINMAIL_LEGGINGS=m("chainmail_leggings",re("legs","chainmail")),e.CHAINMAIL_BOOTS=m("chainmail_boots",re("feet","chainmail")),e.IRON_HELMET=m("iron_helmet",re("head","iron")),e.IRON_CHESTPLATE=m("iron_chestplate",re("chest","iron")),e.IRON_LEGGINGS=m("iron_leggings",re("legs","iron")),e.IRON_BOOTS=m("iron_boots",re("feet","iron")),e.DIAMOND_HELMET=m("diamond_helmet",re("head","diamond")),e.DIAMOND_CHESTPLATE=m("diamond_chestplate",re("chest","diamond")),e.DIAMOND_LEGGINGS=m("diamond_leggings",re("legs","diamond")),e.DIAMOND_BOOTS=m("diamond_boots",re("feet","diamond")),e.GOLDEN_HELMET=m("golden_helmet",re("head","gold")),e.GOLDEN_CHESTPLATE=m("golden_chestplate",re("chest","gold")),e.GOLDEN_LEGGINGS=m("golden_leggings",re("legs","gold")),e.GOLDEN_BOOTS=m("golden_boots",re("feet","gold")),e.NETHERITE_HELMET=m("netherite_helmet",re("head","netherite")),e.NETHERITE_CHESTPLATE=m("netherite_chestplate",re("chest","netherite")),e.NETHERITE_LEGGINGS=m("netherite_leggings",re("legs","netherite")),e.NETHERITE_BOOTS=m("netherite_boots",re("feet","netherite")),e.PORKCHOP=m("porkchop",Z(3,.3,{isMeat:!0})),e.COOKED_PORKCHOP=m("cooked_porkchop",Z(8,.8,{isMeat:!0})),e.GOLDEN_APPLE=m("golden_apple",{rarity:"rare",...Z(4,1.2,{canAlwaysEat:!0,effects:[[l.MobEffectInstance.create(l.MobEffects.REGENERATION,100,1),1],[l.MobEffectInstance.create(l.MobEffects.ABSORPTION,2400,0),1]]})}),e.ENCHANTED_GOLDEN_APPLE=m("enchanted_golden_apple",{rarity:"epic",...Z(4,1.2,{canAlwaysEat:!0,effects:[[l.MobEffectInstance.create(l.MobEffects.REGENERATION,400,1),1],[l.MobEffectInstance.create(l.MobEffects.RESISTANCE,6e3,0),1],[l.MobEffectInstance.create(l.MobEffects.FIRE_RESISTANCE,6e3,0),1],[l.MobEffectInstance.create(l.MobEffects.ABSORPTION,2400,3),1]]})}),e.OAK_SIGN=m("oak_sign",{stack:16}),e.SPRUCE_SIGN=m("spruce_sign",{stack:16}),e.BIRCH_SIGN=m("birch_sign",{stack:16}),e.JUNGLE_SIGN=m("jungle_sign",{stack:16}),e.ACACIA_SIGN=m("acacia_sign",{stack:16}),e.DARK_OAK_SIGN=m("dark_oak_sign",{stack:16}),e.MANGROVE_SIGN=m("mangrove_sign",{stack:16}),e.BAMBOO_SIGN=m("bamboo_sign",{stack:16}),e.CRIMSON_SIGN=m("crimson_sign",{stack:16}),e.WARPED_SIGN=m("warped_sign",{stack:16}),e.OAK_HANGING_SIGN=m("oak_hanging_sign",{stack:16}),e.SPRUCE_HANGING_SIGN=m("spruce_hanging_sign",{stack:16}),e.BIRCH_HANGING_SIGN=m("birch_hanging_sign",{stack:16}),e.JUNGLE_HANGING_SIGN=m("jungle_hanging_sign",{stack:16}),e.ACACIA_HANGING_SIGN=m("acacia_hanging_sign",{stack:16}),e.DARK_OAK_HANGING_SIGN=m("dark_oak_hanging_sign",{stack:16}),e.MANGROVE_HANGING_SIGN=m("mangrove_hanging_sign",{stack:16}),e.BAMBOO_HANGING_SIGN=m("bamboo_hanging_sign",{stack:16}),e.CRIMSON_HANGING_SIGN=m("crimson_hanging_sign",{stack:16}),e.WARPED_HANGING_SIGN=m("warped_hanging_sign",{stack:16}),e.BUCKET=m("bucket",{stack:16}),e.WATER_BUCKET=m("water_bucket",{stack:1,craftRemainder:e.BUCKET}),e.LAVA_BUCKET=m("lava_bucket",{stack:1,craftRemainder:e.BUCKET}),e.POWDER_SNOW_BUCKET=m("powder_snow_bucket",{stack:1}),e.SNOWBALL=m("snowball",{stack:16}),e.MILK_BUCKET=m("milk_bucket",{stack:1,craftRemainder:e.BUCKET}),e.PUFFERFISH_BUCKET=m("pufferfish_bucket",{stack:1}),e.SALMON_BUCKET=m("salmon_bucket",{stack:1}),e.COD_BUCKET=m("cod_bucket",{stack:1}),e.TROPICAL_FISH_BUCKET=m("tropical_fish_bucket",{stack:1}),e.AXOLOTL_BUCKET=m("axolotl_bucket",{stack:1}),e.TADPOLE_BUCKET=m("tadpole_bucket",{stack:1}),e.BOOK=m("book",{enchantmentValue:1}),e.EGG=m("egg",{stack:16}),e.COMPASS=m("compass",{vanishable:!0}),e.BUNDLE=m("bundle",{stack:1}),e.FISHING_ROD=m("fishing_rod",{stack:1,durability:64,enchantmentValue:1}),e.SPYGLASS=m("spyglass",{stack:1}),e.COD=m("cod",Z(2,.1)),e.SALMON=m("salmon",Z(2,.1)),e.TROPICAL_FISH=m("tropical_fish",Z(1,.1)),e.PUFFERFISH=m("pufferfish",Z(1,.1,{effects:[[l.MobEffectInstance.create(l.MobEffects.POISON,1200,1),1],[l.MobEffectInstance.create(l.MobEffects.HUNGER,300,2),1],[l.MobEffectInstance.create(l.MobEffects.NAUSEA,300,0),1]]})),e.COOKED_COD=m("cooked_cod",Z(5,.6)),e.COOKED_SALMON=m("cooked_salmon",Z(6,.8)),e.CAKE=m("cake",{stack:1}),e.WHITE_BED=m("white_bed",{stack:1}),e.ORANGE_BED=m("orange_bed",{stack:1}),e.MAGENTA_BED=m("magenta_bed",{stack:1}),e.LIGHT_BLUE_BED=m("light_blue_bed",{stack:1}),e.YELLOW_BED=m("yellow_bed",{stack:1}),e.LIME_BED=m("lime_bed",{stack:1}),e.PINK_BED=m("pink_bed",{stack:1}),e.GRAY_BED=m("gray_bed",{stack:1}),e.LIGHT_GRAY_BED=m("light_gray_bed",{stack:1}),e.CYAN_BED=m("cyan_bed",{stack:1}),e.PURPLE_BED=m("purple_bed",{stack:1}),e.BLUE_BED=m("blue_bed",{stack:1}),e.BROWN_BED=m("brown_bed",{stack:1}),e.GREEN_BED=m("green_bed",{stack:1}),e.RED_BED=m("red_bed",{stack:1}),e.BLACK_BED=m("black_bed",{stack:1}),e.COOKIE=m("cookie",Z(2,.1)),e.SHEARS=m("shears",{stack:1,durability:238}),e.MELON_SLICE=m("melon_slice",Z(2,.3)),e.DRIED_KELP=m("dried_kelp",Z(1,.3,{fastFood:!0})),e.BEEF=m("beef",Z(3,.3,{isMeat:!0})),e.COOKED_BEEF=m("cooked_beef",Z(8,.8,{isMeat:!0})),e.CHICKEN=m("chicken",Z(2,.3,{isMeat:!0,effects:[[l.MobEffectInstance.create(l.MobEffects.HUNGER,600,0),.3]]})),e.COOKED_CHICKEN=m("cooked_chicken",Z(6,.6,{isMeat:!0})),e.ROTTEN_FLESH=m("rotten_flesh",Z(4,.1,{isMeat:!0,effects:[[l.MobEffectInstance.create(l.MobEffects.HUNGER,600,0),.8]]})),e.ENDER_PEARL=m("ender_pearl",{stack:16}),e.POTION=m("potion",{stack:1}),e.GLASS_BOTTLE=m("glass_bottle"),e.SPIDER_EYE=m("spider_eye",Z(2,.8,{effects:[[l.MobEffectInstance.create(l.MobEffects.POISON,100,0),1]]})),e.ALLAY_SPAWN_EGG=m("allay_spawn_egg",P("allay",56063,44543)),e.AXOLOTL_SPAWN_EGG=m("axolotl_spawn_egg",P("axolotl",16499171,10890612)),e.BAT_SPAWN_EGG=m("bat_spawn_egg",P("bat",4996656,986895)),e.BEE_SPAWN_EGG=m("bee_spawn_egg",P("bee",15582019,4400155)),e.BLAZE_SPAWN_EGG=m("blaze_spawn_egg",P("blaze",16167425,16775294)),e.CAT_SPAWN_EGG=m("cat_spawn_egg",P("cat",15714446,9794134)),e.CAMEL_SPAWN_EGG=m("camel_spawn_egg",P("camel",16565097,13341495)),e.CAVE_SPIDER_SPAWN_EGG=m("cave_spider_spawn_egg",P("cave_spider",803406,11013646)),e.CHICKEN_SPAWN_EGG=m("chicken_spawn_egg",P("chicken",10592673,16711680)),e.COD_SPAWN_EGG=m("cod_spawn_egg",P("cod",12691306,15058059)),e.COW_SPAWN_EGG=m("cow_spawn_egg",P("cow",4470310,10592673)),e.CREEPER_SPAWN_EGG=m("creeper_spawn_egg",P("creeper",894731,0)),e.DOLPHIN_SPAWN_EGG=m("dolphin_spawn_egg",P("dolphin",2243405,16382457)),e.DONKEY_SPAWN_EGG=m("donkey_spawn_egg",P("donkey",5457209,8811878)),e.DROWNED_SPAWN_EGG=m("drowned_spawn_egg",P("drowned",9433559,7969893)),e.ELDER_GUARDIAN_SPAWN_EGG=m("elder_guardian_spawn_egg",P("elder_guardian",13552826,7632531)),e.ENDER_DRAGON_SPAWN_EGG=m("ender_dragon_spawn_egg",P("ender_dragon",1842204,14711290)),e.ENDERMAN_SPAWN_EGG=m("enderman_spawn_egg",P("enderman",1447446,0)),e.ENDERMITE_SPAWN_EGG=m("endermite_spawn_egg",P("endermite",1447446,7237230)),e.EVOKER_SPAWN_EGG=m("evoker_spawn_egg",P("evoker",9804699,1973274)),e.FOX_SPAWN_EGG=m("fox_spawn_egg",P("fox",14005919,13396256)),e.FROG_SPAWN_EGG=m("frog_spawn_egg",P("frog",13661252,16762748)),e.GHAST_SPAWN_EGG=m("ghast_spawn_egg",P("ghast",16382457,12369084)),e.GLOW_SQUID_SPAWN_EGG=m("glow_squid_spawn_egg",P("glow_squid",611926,8778172)),e.GOAT_SPAWN_EGG=m("goat_spawn_egg",P("goat",10851452,5589310)),e.GUARDIAN_SPAWN_EGG=m("guardian_spawn_egg",P("guardian",5931634,15826224)),e.HOGLIN_SPAWN_EGG=m("hoglin_spawn_egg",P("hoglin",13004373,6251620)),e.HORSE_SPAWN_EGG=m("horse_spawn_egg",P("horse",12623485,15656192)),e.HUSK_SPAWN_EGG=m("husk_spawn_egg",P("husk",7958625,15125652)),e.IRON_GOLEM_SPAWN_EGG=m("iron_golem_spawn_egg",P("iron_golem",14405058,7643954)),e.LLAMA_SPAWN_EGG=m("llama_spawn_egg",P("llama",12623485,10051392)),e.MAGMA_CUBE_SPAWN_EGG=m("magma_cube_spawn_egg",P("magma_cube",3407872,16579584)),e.MOOSHROOM_SPAWN_EGG=m("mooshroom_spawn_egg",P("mooshroom",10489616,12040119)),e.MULE_SPAWN_EGG=m("mule_spawn_egg",P("mule",1769984,5321501)),e.OCELOT_SPAWN_EGG=m("ocelot_spawn_egg",P("ocelot",15720061,5653556)),e.PANDA_SPAWN_EGG=m("panda_spawn_egg",P("panda",15198183,1776418)),e.PARROT_SPAWN_EGG=m("parrot_spawn_egg",P("parrot",894731,16711680)),e.PHANTOM_SPAWN_EGG=m("phantom_spawn_egg",P("phantom",4411786,8978176)),e.PIG_SPAWN_EGG=m("pig_spawn_egg",P("pig",15771042,14377823)),e.PIGLIN_SPAWN_EGG=m("piglin_spawn_egg",P("piglin",10051392,16380836)),e.PIGLIN_BRUTE_SPAWN_EGG=m("piglin_brute_spawn_egg",P("piglin_brute",5843472,16380836)),e.PILLAGER_SPAWN_EGG=m("pillager_spawn_egg",P("pillager",5451574,9804699)),e.POLAR_BEAR_SPAWN_EGG=m("polar_bear_spawn_egg",P("polar_bear",15658718,14014157)),e.PUFFERFISH_SPAWN_EGG=m("pufferfish_spawn_egg",P("pufferfish",16167425,3654642)),e.RABBIT_SPAWN_EGG=m("rabbit_spawn_egg",P("rabbit",10051392,7555121)),e.RAVAGER_SPAWN_EGG=m("ravager_spawn_egg",P("ravager",7697520,5984329)),e.SALMON_SPAWN_EGG=m("salmon_spawn_egg",P("salmon",10489616,951412)),e.SHEEP_SPAWN_EGG=m("sheep_spawn_egg",P("sheep",15198183,16758197)),e.SHULKER_SPAWN_EGG=m("shulker_spawn_egg",P("shulker",9725844,5060690)),e.SILVERFISH_SPAWN_EGG=m("silverfish_spawn_egg",P("silverfish",7237230,3158064)),e.SKELETON_SPAWN_EGG=m("skeleton_spawn_egg",P("skeleton",12698049,4802889)),e.SKELETON_HORSE_SPAWN_EGG=m("skeleton_horse_spawn_egg",P("skeleton_horse",6842447,15066584)),e.SLIME_SPAWN_EGG=m("slime_spawn_egg",P("slime",5349438,8306542)),e.SNOW_GOLEM_SPAWN_EGG=m("snow_golem_spawn_egg",P("snow_golem",14283506,8496292)),e.SPIDER_SPAWN_EGG=m("spider_spawn_egg",P("spider",3419431,11013646)),e.SQUID_SPAWN_EGG=m("squid_spawn_egg",P("squid",2243405,7375001)),e.STRAY_SPAWN_EGG=m("stray_spawn_egg",P("stray",6387319,14543594)),e.STRIDER_SPAWN_EGG=m("strider_spawn_egg",P("strider",10236982,5065037)),e.TADPOLE_SPAWN_EGG=m("tadpole_spawn_egg",P("tadpole",7164733,1444352)),e.TRADER_LLAMA_SPAWN_EGG=m("trader_llama_spawn_egg",P("trader_llama",15377456,4547222)),e.TROPICAL_FISH_SPAWN_EGG=m("tropical_fish_spawn_egg",P("tropical_fish",15690005,16775663)),e.TURTLE_SPAWN_EGG=m("turtle_spawn_egg",P("turtle",15198183,44975)),e.VEX_SPAWN_EGG=m("vex_spawn_egg",P("vex",8032420,15265265)),e.VILLAGER_SPAWN_EGG=m("villager_spawn_egg",P("villager",5651507,12422002)),e.VINDICATOR_SPAWN_EGG=m("vindicator_spawn_egg",P("vindicator",9804699,2580065)),e.WANDERING_TRADER_SPAWN_EGG=m("wandering_trader_spawn_egg",P("wandering_trader",4547222,15377456)),e.WARDEN_SPAWN_EGG=m("warden_spawn_egg",P("warden",1001033,3790560)),e.WITCH_SPAWN_EGG=m("witch_spawn_egg",P("witch",3407872,5349438)),e.WITHER_SPAWN_EGG=m("wither_spawn_egg",P("wither",1315860,5075616)),e.WITHER_SKELETON_SPAWN_EGG=m("wither_skeleton_spawn_egg",P("wither_skeleton",1315860,4672845)),e.WOLF_SPAWN_EGG=m("wolf_spawn_egg",P("wolf",14144467,13545366)),e.ZOGLIN_SPAWN_EGG=m("zoglin_spawn_egg",P("zoglin",13004373,15132390)),e.ZOMBIE_SPAWN_EGG=m("zombie_spawn_egg",P("zombie",44975,7969893)),e.ZOMBIE_HORSE_SPAWN_EGG=m("zombie_horse_spawn_egg",P("zombie_horse",3232308,9945732)),e.ZOMBIE_VILLAGER_SPAWN_EGG=m("zombie_villager_spawn_egg",P("zombie_villager",5651507,7969893)),e.ZOMBIFIED_PIGLIN_SPAWN_EGG=m("zombified_piglin_spawn_egg",P("zombified_piglin",15373203,5009705)),e.EXPERIENCE_BOTTLE=m("experience_bottle",{rarity:"uncommon"}),e.WRITABLE_BOOK=m("writable_book",{stack:1}),e.WRITTEN_BOOK=m("written_book",{stack:16}),e.CARROT=m("carrot",Z(3,.6)),e.POTATO=m("potato",Z(1,.3)),e.BAKED_POTATO=m("baked_potato",Z(5,.6)),e.POISONOUS_POTATO=m("poisonous_potato",Z(2,.3,{effects:[[l.MobEffectInstance.create(l.MobEffects.POISON,100,0),.6]]})),e.GOLDEN_CARROT=m("golden_carrot",Z(6,1.2)),e.SKELETON_SKULL=m("skeleton_skull",{rarity:"uncommon",wearable:!0}),e.WITHER_SKELETON_SKULL=m("wither_skeleton_skull",{rarity:"uncommon",wearable:!0}),e.PLAYER_HEAD=m("player_head",{rarity:"uncommon",wearable:!0}),e.ZOMBIE_HEAD=m("zombie_head",{rarity:"uncommon",wearable:!0}),e.CREEPER_HEAD=m("creeper_head",{rarity:"uncommon",wearable:!0}),e.DRAGON_HEAD=m("dragon_head",{rarity:"uncommon",wearable:!0}),e.PIGLIN_HEAD=m("piglin_head",{rarity:"uncommon",wearable:!0}),e.NETHER_STAR=m("nether_star",{rarity:"uncommon"}),e.PUMPKIN_PIE=m("pumpkin_pie",Z(8,.3)),e.ENCHANTED_BOOK=m("enchanted_book",{rarity:"uncommon",stack:1}),e.RABBIT=m("rabbit",Z(3,.3,{isMeat:!0})),e.COOKED_RABBIT=m("cooked_rabbit",Z(5,.6,{isMeat:!0})),e.RABBIT_STEW=m("rabbit_stew",{stack:1,...Z(10,.6)}),e.ARMOR_STAND=m("armor_stand",{stack:16}),e.IRON_HORSE_ARMOR=m("iron_horse_armor",{stack:1}),e.GOLDEN_HORSE_ARMOR=m("golden_horse_armor",{stack:1}),e.DIAMOND_HORSE_ARMOR=m("diamond_horse_armor",{stack:1}),e.LEATHER_HORSE_ARMOR=m("leather_horse_armor",{stack:1}),e.COMMAND_BLOCK_MINECART=m("command_block_minecart",{rarity:"epic",stack:1}),e.MUTTON=m("mutton",Z(2,.3,{isMeat:!0})),e.COOKED_MUTTON=m("cooked_mutton",Z(6,.8,{isMeat:!0})),e.WHITE_BANNER=m("white_banner",{stack:16}),e.ORANGE_BANNER=m("orange_banner",{stack:16}),e.MAGENTA_BANNER=m("magenta_banner",{stack:16}),e.LIGHT_BLUE_BANNER=m("light_blue_banner",{stack:16}),e.YELLOW_BANNER=m("yellow_banner",{stack:16}),e.LIME_BANNER=m("lime_banner",{stack:16}),e.PINK_BANNER=m("pink_banner",{stack:16}),e.GRAY_BANNER=m("gray_banner",{stack:16}),e.LIGHT_GRAY_BANNER=m("light_gray_banner",{stack:16}),e.CYAN_BANNER=m("cyan_banner",{stack:16}),e.PURPLE_BANNER=m("purple_banner",{stack:16}),e.BLUE_BANNER=m("blue_banner",{stack:16}),e.BROWN_BANNER=m("brown_banner",{stack:16}),e.GREEN_BANNER=m("green_banner",{stack:16}),e.RED_BANNER=m("red_banner",{stack:16}),e.BLACK_BANNER=m("black_banner",{stack:16}),e.END_CRYSTAL=m("end_crystal",{rarity:"rare"}),e.CHORUS_FRUIT=m("chorus_fruit",Z(4,.3,{canAlwaysEat:!0})),e.BEETROOT=m("beetroot",Z(1,.6)),e.BEETROOT_SOUP=m("beetroot_soup",{stack:1,...Z(6,.6)}),e.DRAGON_BREATH=m("dragon_breath",{rarity:"uncommon",craftRemainder:e.GLASS_BOTTLE}),e.SPLASH_POTION=m("splash_potion",{stack:1}),e.LINGERING_POTION=m("lingering_potion",{stack:1}),e.SHIELD=m("shield",{stack:1,durability:336}),e.TOTEM_OF_UNDYING=m("totem_of_undying",{rarity:"uncommon",stack:1}),e.KNOWLEDGE_BOOK=m("knowledge_book",{rarity:"epic",stack:1}),e.DEBUG_STICK=m("debug_stick",{rarity:"epic",stack:1}),e.MUSIC_DISC_13=m("music_disc_13",{rarity:"rare",stack:1}),e.MUSIC_DISC_CAT=m("music_disc_cat",{rarity:"rare",stack:1}),e.MUSIC_DISC_BLOCKS=m("music_disc_blocks",{rarity:"rare",stack:1}),e.MUSIC_DISC_CHIRP=m("music_disc_chirp",{rarity:"rare",stack:1}),e.MUSIC_DISC_FAR=m("music_disc_far",{rarity:"rare",stack:1}),e.MUSIC_DISC_MALL=m("music_disc_mall",{rarity:"rare",stack:1}),e.MUSIC_DISC_MELLOHI=m("music_disc_mellohi",{rarity:"rare",stack:1}),e.MUSIC_DISC_STAL=m("music_disc_stal",{rarity:"rare",stack:1}),e.MUSIC_DISC_STRAD=m("music_disc_strad",{rarity:"rare",stack:1}),e.MUSIC_DISC_WARD=m("music_disc_ward",{rarity:"rare",stack:1}),e.MUSIC_DISC_11=m("music_disc_11",{rarity:"rare",stack:1}),e.MUSIC_DISC_WAIT=m("music_disc_wait",{rarity:"rare",stack:1}),e.MUSIC_DISC_OTHERSIDE=m("music_disc_otherside",{rarity:"rare",stack:1}),e.MUSIC_DISC_5=m("music_disc_5",{rarity:"rare",stack:1}),e.MUSIC_DISC_PIGSTEP=m("music_disc_pigstep",{rarity:"rare",stack:1}),e.TRIDENT=m("trident",{stack:1,durability:250,enchantmentValue:1}),e.HEART_OF_THE_SEA=m("heart_of_the_sea",{rarity:"uncommon"}),e.CROSSBOW=m("crossbow",{stack:1,durability:465,enchantmentValue:1}),e.SUSPICIOUS_STEW=m("suspicious_stew",{stack:1,...Z(6,.6,{canAlwaysEat:!0})}),e.FLOWER_BANNER_PATTERN=m("flower_banner_pattern",{stack:1}),e.CREEPER_BANNER_PATTERN=m("creeper_banner_pattern",{rarity:"uncommon",stack:1}),e.SKULL_BANNER_PATTERN=m("skull_banner_pattern",{rarity:"uncommon",stack:1}),e.MOJANG_BANNER_PATTERN=m("mojang_banner_pattern",{rarity:"epic",stack:1}),e.GLOBE_BANNER_PATTERN=m("globe_banner_pattern",{stack:1}),e.PIGLIN_BANNER_PATTERN=m("piglin_banner_pattern",{stack:1}),e.GOAT_HORN=m("goat_horn",{stack:1}),e.SWEET_BERRIES=m("sweet_berries",Z(2,.1)),e.GLOW_BERRIES=m("glow_berries",Z(2,.1)),e.HONEY_BOTTLE=m("honey_bottle",{stack:16,craftRemainder:e.GLASS_BOTTLE,...Z(6,.1)})})(l.Items||(l.Items={}));class ve{constructor(t,n,i=new ue){p(this,"item");this.id=t,this.count=n,this.tag=i}getItem(){return this.item===void 0&&(this.item=l.Item.get(this.id)),this.item}clone(){const t=ue.fromJson(this.tag.toJson());return new ve(this.id,this.count,t)}is(t){return typeof t=="string"?this.id.equals(G.parse(t)):t instanceof G?this.id.equals(t):this.id.equals(t.id)}equals(t){return this===t?!0:t instanceof ve?this.id.equals(t.id)&&this.count===t.count&&this.tag.toString()==t.tag.toString():!1}toString(){return this.id.toString()+(this.tag.size>0?this.tag.toString():"")+(this.count>1?` ${this.count}`:"")}}l.Rotation=(e=>(e.NONE="none",e.CLOCKWISE_90="clockwise_90",e.CLOCKWISE_180="180",e.COUNTERCLOCKWISE_90="counterclockwise_90",e))(l.Rotation||{}),(e=>{function t(n){return["none","clockwise_90","180","counterclockwise_90"][n.nextInt(4)]}e.getRandom=t})(l.Rotation||(l.Rotation={}));const Ii=class{constructor(t,n=[],i=[]){p(this,"blocksMap",[]);this.size=t,this.palette=n,this.blocks=i,i.forEach(r=>{if(!this.isInside(r.pos))throw new Error(`Found block at ${r.pos} which is outside the structure bounds ${this.size}`);this.blocksMap[r.pos[0]*t[1]*t[2]+r.pos[1]*t[2]+r.pos[2]]=r})}getSize(){return this.size}addBlock(t,n,i,r){if(!this.isInside(t))throw new Error(`Cannot add block at ${t} outside the structure bounds ${this.size}`);const s=new $(n,i);let a=this.palette.findIndex(o=>o.equals(s));return a===-1&&(a=this.palette.length,this.palette.push(s)),this.blocks.push({pos:t,state:a,nbt:r}),this.blocksMap[t[0]*this.size[1]*this.size[2]+t[1]*this.size[2]+t[2]]={pos:t,state:a,nbt:r},this}getBlocks(){return this.blocks.map(t=>this.toPlacedBlock(t))}getBlock(t){if(!this.isInside(t))return null;const n=this.blocksMap[t[0]*this.size[1]*this.size[2]+t[1]*this.size[2]+t[2]];return n?this.toPlacedBlock(n):null}toPlacedBlock(t){const n=this.palette[t.state];if(!n)throw new Error(`Block at ${t.pos.join(" ")} in structure references invalid palette index ${t.state}`);return{pos:t.pos,state:n,nbt:t.nbt}}isInside(t){return t[0]>=0&&t[0]=0&&t[1]=0&&t[2]$.fromNbt(s)),r=t.getList("blocks",B.Compound).map(s=>{const a=l.BlockPos.fromNbt(s.getList("pos")),o=s.getNumber("state"),u=s.getCompound("nbt");return{pos:a,state:o,nbt:u.size>0?u:void 0}});return new Ii(n,i,r)}static transform(t,n,i){switch(n){case l.Rotation.COUNTERCLOCKWISE_90:return l.BlockPos.create(i[0]-i[2]+t[2],t[1],i[0]+i[2]-t[0]);case l.Rotation.CLOCKWISE_90:return l.BlockPos.create(i[0]+i[2]-t[2],t[1],i[2]-i[0]+t[0]);case l.Rotation.CLOCKWISE_180:return l.BlockPos.create(i[0]+i[0]-t[0],t[1],i[2]+i[2]-t[2]);default:return t}}};let st=Ii;p(st,"REGISTRY",oe.createAndRegister("structures")),p(st,"EMPTY",new Ii(l.BlockPos.ZERO));const ui=new oe(G.create("enchantment"));oe.REGISTRY.register(ui.key,ui),l.Enchantment=void 0,(e=>{e.REGISTRY=ui;function t(i,r){return i!==r&&i._isCompatible(r)&&r._isCompatible(i)}e.isCompatible=t;function n(i,r){return r._canEnchant(i,()=>{var s,a;return(a=(s=Sl.get(r.category))==null?void 0:s(i.getItem()))!=null?a:!1})}e.canEnchant=n})(l.Enchantment||(l.Enchantment={}));function Y(e,t,n,i){const r={id:G.create(e),rarity:t,category:n,isDiscoverable:!0,isTradeable:!0,isTreasure:!1,isCurse:!1,minLevel:1,maxLevel:1,minCost(s){return 1+s*10},maxCost(s){return this.minCost(s)+5},_isCompatible(){return!0},_canEnchant(s,a){return a()},...i};return ui.register(r.id,r,!0),r}l.Enchantments=void 0,(e=>{e.PROTECTION=Y("protection","common","armor",{maxLevel:4,minCost:i=>1+(i-1)*11,maxCost:i=>1+(i-1)*11+11,_isCompatible:i=>!t.has(i)}),e.FIRE_PROTECTION=Y("fire_protection","uncommon","armor",{maxLevel:4,minCost:i=>10+(i-1)*8,maxCost:i=>10+(i-1)*8+8,_isCompatible:i=>!t.has(i)}),e.FEATHER_FALLING=Y("feather_falling","uncommon","armor_feet",{maxLevel:4,minCost:i=>5+(i-1)*6,maxCost:i=>5+(i-1)*6+6}),e.BLAST_PROTECTION=Y("blast_protection","rare","armor",{maxLevel:4,minCost:i=>5+(i-1)*8,maxCost:i=>5+(i-1)*8+8,_isCompatible:i=>!t.has(i)}),e.PROJECTILE_PROTECTION=Y("projectile_protection","uncommon","armor",{maxLevel:4,minCost:i=>3+(i-1)*6,maxCost:i=>3+(i-1)*6+6,_isCompatible:i=>!t.has(i)}),e.RESPIRATION=Y("respiration","rare","armor_head",{maxLevel:3,minCost:i=>10*i,maxCost:i=>10*i+30}),e.AQUA_AFFINITY=Y("aqua_affinity","rare","armor_head",{minCost:()=>1,maxCost:()=>40}),e.THORNS=Y("thorns","very_rare","armor_chest",{maxLevel:3,minCost:i=>10+20*(i-1),maxCost:i=>10+20*(i-1)+50}),e.DEPTH_STRIDER=Y("depth_strider","rare","armor_feet",{maxLevel:3,minCost:i=>10*i,maxCost:i=>10*i+15,_isCompatible:i=>i!==e.FROST_WALKER}),e.FROST_WALKER=Y("frost_walker","rare","armor_feet",{isTreasure:!0,maxLevel:2,minCost:i=>10*i,maxCost:i=>10*i+15,_isCompatible:i=>i!==e.DEPTH_STRIDER}),e.BINDING_CURSE=Y("binding_curse","very_rare","wearable",{isTreasure:!0,isCurse:!0,minCost:()=>25,maxCost:()=>50}),e.SOUL_SPEED=Y("soul_speed","very_rare","armor_feet",{isDiscoverable:!1,isTradeable:!1,isTreasure:!0,maxLevel:3,minCost:i=>10*i,maxCost:i=>10*i+15}),e.SWIFT_SNEAK=Y("swift_sneak","very_rare","armor_legs",{isDiscoverable:!1,isTradeable:!1,isTreasure:!0,maxLevel:3,minCost:i=>25*i,maxCost:i=>25*i+50}),e.SHARPNESS=Y("sharpness","common","weapon",{maxLevel:5,minCost:i=>1+(i-1)*11,maxCost:i=>1+(i-1)*11+20,_isCompatible:i=>!n.has(i),_canEnchant:(i,r)=>{var s;return((s=i.getItem().tiered)==null?void 0:s.isAxe)||r()}}),e.SMITE=Y("smite","common","weapon",{maxLevel:5,minCost:i=>5+(i-1)*8,maxCost:i=>5+(i-1)*8+20,_isCompatible:i=>!n.has(i),_canEnchant:(i,r)=>{var s;return((s=i.getItem().tiered)==null?void 0:s.isAxe)||r()}}),e.BANE_OF_ARTHROPODS=Y("bane_of_arthropods","common","weapon",{maxLevel:5,minCost:i=>5+(i-1)*8,maxCost:i=>5+(i-1)*8+20,_isCompatible:i=>!n.has(i),_canEnchant:(i,r)=>{var s;return((s=i.getItem().tiered)==null?void 0:s.isAxe)||r()}}),e.KNOCKBACK=Y("knockback","uncommon","weapon",{maxLevel:2,minCost:i=>5+20*(i-1),maxCost:i=>1+i*10+50}),e.FIRE_ASPECT=Y("fire_aspect","rare","weapon",{maxLevel:2,minCost:i=>5+20*(i-1),maxCost:i=>1+i*10+50}),e.LOOTING=Y("looting","rare","weapon",{maxLevel:3,minCost:i=>15+(i-1)*9,maxCost:i=>1+i*10+50,_isCompatible:i=>i!==e.SILK_TOUCH}),e.SWEEPING=Y("sweeping","rare","weapon",{maxLevel:3,minCost:i=>5+(i-1)*9,maxCost:i=>5+(i-1)*9+15}),e.EFFICIENCY=Y("efficiency","common","digger",{maxLevel:5,minCost:i=>1+10*(i-1),maxCost:i=>1+i*10+50,_canEnchant:(i,r)=>i.is("shears")||r()}),e.SILK_TOUCH=Y("silk_touch","very_rare","digger",{minCost:()=>15,maxCost:i=>1+i*10+50,_isCompatible:i=>i!==e.FORTUNE}),e.UNBREAKING=Y("unbreaking","uncommon","breakable",{maxLevel:3,minCost:i=>5+(i-1)*8,maxCost:i=>1+i*10+50,_canEnchant:(i,r)=>r()&&!i.tag.getBoolean("Unbreakable")}),e.FORTUNE=Y("fortune","rare","digger",{maxLevel:3,minCost:i=>15+(i-1)*9,maxCost:i=>1+i*10+50,_isCompatible:i=>i!==e.SILK_TOUCH}),e.POWER=Y("power","common","bow",{maxLevel:5,minCost:i=>1+(i-1)*10,maxCost:i=>1+(i-1)*10+15}),e.PUNCH=Y("punch","rare","bow",{maxLevel:2,minCost:i=>12+(i-1)*20,maxCost:i=>12+(i-1)*20+25}),e.FLAME=Y("flame","rare","bow",{minCost:()=>20,maxCost:()=>50}),e.INFINITY=Y("infinity","very_rare","bow",{minCost:()=>20,maxCost:()=>50,_isCompatible:i=>i!==e.MENDING}),e.LUCK_OF_THE_SEA=Y("luck_of_the_sea","rare","fishing_rod",{maxLevel:3,minCost:i=>15+(i-1)*9,maxCost:i=>1+i*10+50,_isCompatible:i=>i!==e.SILK_TOUCH}),e.LURE=Y("lure","rare","fishing_rod",{maxLevel:3,minCost:i=>15+(i-1)*9,maxCost:i=>1+i*10+50}),e.LOYALTY=Y("loyalty","uncommon","trident",{maxLevel:3,minCost:i=>5+i*7,maxCost:()=>50}),e.IMPALING=Y("impaling","rare","trident",{maxLevel:5,minCost:i=>1+(i-1)*8,maxCost:i=>1+(i-1)*8+20}),e.RIPTIDE=Y("riptide","rare","trident",{maxLevel:3,minCost:i=>5+i*7,maxCost:()=>50,_isCompatible:i=>i!==e.RIPTIDE&&i!==e.CHANNELING}),e.CHANNELING=Y("channeling","very_rare","trident",{minCost:()=>25,maxCost:()=>50}),e.MULTISHOT=Y("multishot","rare","crossbow",{minCost:()=>20,maxCost:()=>50,_isCompatible:i=>i!==e.PIERCING}),e.QUICK_CHARGE=Y("quick_charge","uncommon","crossbow",{maxLevel:3,minCost:i=>12+(i-1)*20,maxCost:()=>50}),e.PIERCING=Y("piercing","common","crossbow",{maxLevel:4,minCost:i=>1+(i-1)*10,maxCost:()=>50,_isCompatible:i=>i!==e.MULTISHOT}),e.MENDING=Y("mending","rare","breakable",{isTreasure:!0,minCost:i=>i*25,maxCost:i=>i*25+50}),e.VANISHING_CURSE=Y("vanishing_curse","very_rare","vanishable",{isTreasure:!0,isCurse:!0,minCost:()=>25,maxCost:()=>50});const t=new Set([e.PROTECTION,e.FIRE_PROTECTION,e.BLAST_PROTECTION,e.PROJECTILE_PROTECTION]),n=new Set([e.SHARPNESS,e.SMITE,e.BANE_OF_ARTHROPODS])})(l.Enchantments||(l.Enchantments={}));const Sl=new Map(Object.entries({armor:e=>e.armor!==void 0,armor_feet:e=>{var t;return((t=e.armor)==null?void 0:t.slot)==="feet"},armor_legs:e=>{var t;return((t=e.armor)==null?void 0:t.slot)==="legs"},armor_chest:e=>{var t;return((t=e.armor)==null?void 0:t.slot)==="chest"},armor_head:e=>{var t;return((t=e.armor)==null?void 0:t.slot)==="head"},weapon:e=>{var t;return((t=e.tiered)==null?void 0:t.isWeapon)===!0},digger:e=>{var t;return((t=e.tiered)==null?void 0:t.isDigger)===!0},fishing_rod:e=>e.id.path==="fishing_rod",trident:e=>e.id.path==="trident",breakable:e=>e.durability!==void 0,bow:e=>e.id.path==="bow",wearable:e=>e.wearable===!0,crossbow:e=>e.id.path==="crossbow",vanishable:e=>e.vanishable===!0})),Bn=new oe(G.create("potion"));oe.REGISTRY.register(Bn.key,Bn),l.Potion=void 0,(e=>{e.REGISTRY=Bn;function t(s){var u;const o=(s instanceof ve?s.tag:s).getString("Potion");return(u=Bn.get(G.parse(o)))!=null?u:l.Potions.EMPTY}e.fromNbt=t;function n(s){const a=s instanceof ve||s instanceof ue?t(s):s,o=[];return o.push(...a.effects),(a instanceof ve||a instanceof ue)&&(a instanceof ve?a.tag:a).getList("CustomPotionEffects",B.Compound).forEach(c=>{const h=l.MobEffectInstance.fromNbt(c);h!==void 0&&o.push(h)}),o}e.getAllEffects=n;function i(s){return(s instanceof ve||s instanceof ue?t(s):s).effects.flatMap(o=>Array.from(o.effect.modifiers.entries()))}e.getAllAttributeModifiers=i;function r(s){if(s===l.Potions.EMPTY)return we(16253176);if(s instanceof ve||s instanceof ue){const o=s instanceof ve?s.tag:s;if(o.hasNumber("CustomPotionColor"))return we(o.getNumber("CustomPotionColor"))}const a=n(s);return l.MobEffectInstance.getColor(a)}e.getColor=r})(l.Potion||(l.Potion={}));function U(e,...t){let n=e;n.startsWith("long_")&&(n=n.slice(5)),n.startsWith("strong_")&&(n=n.slice(7));const i={id:G.create(e),name:n,effects:t};return Bn.register(i.id,i,!0),i}l.Potions=void 0,(e=>{e.EMPTY=U("empty"),e.WATER=U("water"),e.MUNDANE=U("mundane"),e.THICK=U("thick"),e.AWKWARD=U("awkward"),e.NIGHT_VISION=U("night_vision",l.MobEffectInstance.create(l.MobEffects.NIGHT_VISION,3600)),e.LONG_NIGHT_VISION=U("long_night_vision",l.MobEffectInstance.create(l.MobEffects.NIGHT_VISION,9600)),e.INVISIBILITY=U("invisibility",l.MobEffectInstance.create(l.MobEffects.INVISIBILITY,3600)),e.LONG_INVISIBILITY=U("long_invisibility",l.MobEffectInstance.create(l.MobEffects.INVISIBILITY,9600)),e.LEAPING=U("leaping",l.MobEffectInstance.create(l.MobEffects.JUMP_BOOST,3600)),e.LONG_LEAPING=U("long_leaping",l.MobEffectInstance.create(l.MobEffects.JUMP_BOOST,9600)),e.STRONG_LEAPING=U("strong_leaping",l.MobEffectInstance.create(l.MobEffects.JUMP_BOOST,1800,1)),e.FIRE_RESISTANCE=U("fire_resistance",l.MobEffectInstance.create(l.MobEffects.FIRE_RESISTANCE,3600)),e.LONG_FIRE_RESISTANCE=U("long_fire_resistance",l.MobEffectInstance.create(l.MobEffects.FIRE_RESISTANCE,9600)),e.SWIFTNESS=U("swiftness",l.MobEffectInstance.create(l.MobEffects.SPEED,3600)),e.LONG_SWIFTNESS=U("long_swiftness",l.MobEffectInstance.create(l.MobEffects.SPEED,9600)),e.STRONG_SWIFTNESS=U("strong_swiftness",l.MobEffectInstance.create(l.MobEffects.SPEED,1800,1)),e.SLOWNESS=U("slowness",l.MobEffectInstance.create(l.MobEffects.SLOWNESS,1800)),e.LONG_SLOWNESS=U("long_slowness",l.MobEffectInstance.create(l.MobEffects.SLOWNESS,4800)),e.STRONG_SLOWNESS=U("strong_slowness",l.MobEffectInstance.create(l.MobEffects.SLOWNESS,400,3)),e.TURTLE_MASTER=U("turtle_master",l.MobEffectInstance.create(l.MobEffects.SLOWNESS,400,3),l.MobEffectInstance.create(l.MobEffects.RESISTANCE,400,2)),e.LONG_TURTLE_MASTER=U("long_turtle_master",l.MobEffectInstance.create(l.MobEffects.SLOWNESS,800,3),l.MobEffectInstance.create(l.MobEffects.RESISTANCE,800,2)),e.STRONG_TURTLE_MASTER=U("strong_turtle_master",l.MobEffectInstance.create(l.MobEffects.SLOWNESS,400,5),l.MobEffectInstance.create(l.MobEffects.RESISTANCE,400,3)),e.WATER_BREATHING=U("water_breathing",l.MobEffectInstance.create(l.MobEffects.WATER_BREATHING,3600)),e.LONG_WATER_BREATHING=U("long_water_breathing",l.MobEffectInstance.create(l.MobEffects.WATER_BREATHING,9600)),e.HEALING=U("healing",l.MobEffectInstance.create(l.MobEffects.INSTANT_HEALTH,1)),e.STRONG_HEALING=U("strong_healing",l.MobEffectInstance.create(l.MobEffects.INSTANT_HEALTH,1,1)),e.HARMING=U("harming",l.MobEffectInstance.create(l.MobEffects.INSTANT_DAMAGE,1)),e.STRONG_HARMING=U("strong_harming",l.MobEffectInstance.create(l.MobEffects.INSTANT_DAMAGE,1,1)),e.POISON=U("poison",l.MobEffectInstance.create(l.MobEffects.POISON,900)),e.LONG_POISON=U("long_poison",l.MobEffectInstance.create(l.MobEffects.POISON,1800)),e.STRONG_POISON=U("strong_poison",l.MobEffectInstance.create(l.MobEffects.POISON,432,1)),e.REGENERATION=U("regeneration",l.MobEffectInstance.create(l.MobEffects.REGENERATION,900)),e.LONG_REGENERATION=U("long_regeneration",l.MobEffectInstance.create(l.MobEffects.REGENERATION,1800)),e.STRONG_REGENERATION=U("strong_regeneration",l.MobEffectInstance.create(l.MobEffects.REGENERATION,450,1)),e.STRENGTH=U("strength",l.MobEffectInstance.create(l.MobEffects.STRENGTH,3600)),e.LONG_STRENGTH=U("long_strength",l.MobEffectInstance.create(l.MobEffects.STRENGTH,9600)),e.STRONG_STRENGTH=U("strong_strength",l.MobEffectInstance.create(l.MobEffects.STRENGTH,1800,1)),e.WEAKNESS=U("weakness",l.MobEffectInstance.create(l.MobEffects.WEAKNESS,1800)),e.LONG_WEAKNESS=U("long_weakness",l.MobEffectInstance.create(l.MobEffects.WEAKNESS,4800)),e.LUCK=U("luck",l.MobEffectInstance.create(l.MobEffects.LUCK,6e3)),e.SLOW_FALLING=U("slow_falling",l.MobEffectInstance.create(l.MobEffects.SLOW_FALLING,1800)),e.LONG_SLOW_FALLING=U("long_slow_falling",l.MobEffectInstance.create(l.MobEffects.SLOW_FALLING,4800))})(l.Potions||(l.Potions={}));function at(e){return e*e}function yt(e,t,n){return Math.max(t,Math.min(n,e))}function ot(e,t,n){return t+e*(n-t)}function fi(e,t,n,i,r,s){return ot(t,ot(e,n,i),ot(e,r,s))}function Zs(e,t,n,i,r,s,a,o,u,c,h){return ot(n,fi(e,t,i,r,s,a),fi(e,t,o,u,c,h))}function Pn(e,t,n){return e===0?t():e===1?n():t()+e*(n()-t())}function ir(e,t,n,i,r,s){return Pn(t,()=>Pn(e,n,i),()=>Pn(e,r,s))}function Ys(e,t,n,i,r,s,a,o,u,c,h){return Pn(n,()=>ir(e,t,i,r,s,a),()=>ir(e,t,o,u,c,h))}function di(e,t,n){return n<0?e:n>1?t:ot(n,e,t)}function rr(e,t,n){return(e-t)/(n-t)}function gi(e){return e*e*e*(e*(e*6-15)+10)}function Gn(e,t,n,i,r){return ot(rr(e,t,n),i,r)}function sr(e,t,n,i,r){return di(i,r,rr(e,t,n))}function $s(e,t,n){let i=t-e;for(;i>0;){const r=Math.floor(i/2),s=e+r;if(n(s)){i=r;continue}e=s+1,i-=r+1}return e}function ar(e,t,n){let i=BigInt(e*3129871)^BigInt(n)*BigInt(116129781)^BigInt(t);return i=i*i*BigInt(42317861)+i*BigInt(11),i>>BigInt(16)}function _i(e,t,n,i,r,s,a,o){return BigInt(e)<>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>18,e|=e>>32,e+1}function mi(e,t,n){return e.nextInt(n-t+1)+t}function wi(e,t,n){return t>=n?t:e.nextInt(n-t+1)+t}function qs(e,t){for(var n=e.length;n>1;n--){const i=t.nextInt(n),r=e[i];e[i]=e[n-1],e[n-1]=r}}l.MinMaxNumberFunction=void 0,(e=>{function t(n){return typeof n=="object"&&n!==null&&"minValue"in n&&"maxValue"in n}e.is=t})(l.MinMaxNumberFunction||(l.MinMaxNumberFunction={})),l.CubicSpline=void 0,(e=>{function t(r,s){var c,h,f,g;if(typeof r=="number")return new n(r);const a=(c=l.Json.readObject(r))!=null?c:{},o=new i(s(a.coordinate)),u=(h=l.Json.readArray(a.points,d=>{var w;return(w=l.Json.readObject(d))!=null?w:{}}))!=null?h:[];if(u.length===0)return new n(0);for(const d of u){const w=(f=l.Json.readNumber(d.location))!=null?f:0,S=t(d.value,s),_=(g=l.Json.readNumber(d.derivative))!=null?g:0;o.addPoint(w,S,_)}return o}e.fromJson=t;class n{constructor(s){this.value=s}compute(){return this.value}min(){return this.value}max(){return this.value}mapAll(){return this}calculateMinMax(){}}e.Constant=n;class i{constructor(s,a=[],o=[],u=[]){p(this,"calculatedMin",Number.NEGATIVE_INFINITY);p(this,"calculatedMax",Number.POSITIVE_INFINITY);this.coordinate=s,this.locations=a,this.values=o,this.derivatives=u}compute(s){const a=this.coordinate.compute(s),o=$s(0,this.locations.length,N=>aa.mapAll(s)),this.derivatives)}addPoint(s,a,o=0){return this.locations.push(s),this.values.push(typeof a=="number"?new e.Constant(a):a),this.derivatives.push(o),this}calculateMinMax(){if(!l.MinMaxNumberFunction.is(this.coordinate))return;const s=this.locations.length-1;var a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;const u=this.coordinate.minValue(),c=this.coordinate.maxValue();for(const f of this.values)f.calculateMinMax();if(uthis.locations[s]){const f=i.linearExtend(c,this.locations,this.values[s].min(),this.derivatives,s),g=i.linearExtend(c,this.locations,this.values[s].max(),this.derivatives,s);a=Math.min(a,Math.min(f,g)),o=Math.max(o,Math.max(f,g))}for(const f of this.values)a=Math.min(a,f.min()),o=Math.max(o,f.max());for(var h=0;h>>32-i},rotr:function(n,i){return n<<32-i|n>>>i},endian:function(n){if(n.constructor==Number)return t.rotl(n,8)&16711935|t.rotl(n,24)&4278255360;for(var i=0;i0;n--)i.push(Math.floor(Math.random()*256));return i},bytesToWords:function(n){for(var i=[],r=0,s=0;r>>5]|=n[r]<<24-s%32;return i},wordsToBytes:function(n){for(var i=[],r=0;r>>5]>>>24-r%32&255);return i},bytesToHex:function(n){for(var i=[],r=0;r>>4).toString(16)),i.push((n[r]&15).toString(16));return i.join("")},hexToBytes:function(n){for(var i=[],r=0;r>>6*(3-a)&63)):i.push("=");return i.join("")},base64ToBytes:function(n){n=n.replace(/[^A-Z0-9+\/]/ig,"");for(var i=[],r=0,s=0;r>>6-s*2);return i}};js.exports=t})();var dr={utf8:{stringToBytes:function(e){return dr.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(dr.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n * @license MIT */var sh=function(e){return e!=null&&(ea(e)||ah(e)||!!e._isBuffer)};function ea(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function ah(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&ea(e.slice(0,0))}(function(){var e=js.exports,t=Qs.utf8,n=sh,i=Qs.bin,r=function(s,a){s.constructor==String?a&&a.encoding==="binary"?s=i.stringToBytes(s):s=t.stringToBytes(s):n(s)?s=Array.prototype.slice.call(s,0):!Array.isArray(s)&&s.constructor!==Uint8Array&&(s=s.toString());for(var o=e.bytesToWords(s),u=s.length*8,c=1732584193,h=-271733879,f=-1732584194,g=271733878,d=0;d>>24)&16711935|(o[d]<<24|o[d]>>>8)&4278255360;o[u>>>5]|=128<>>9<<4)+14]=u;for(var w=r._ff,S=r._gg,_=r._hh,E=r._ii,d=0;d>>0,h=h+N>>>0,f=f+v>>>0,g=g+R>>>0}return e.endian([c,h,f,g])};r._ff=function(s,a,o,u,c,h,f){var g=s+(a&o|~a&u)+(c>>>0)+f;return(g<>>32-h)+a},r._gg=function(s,a,o,u,c,h,f){var g=s+(a&u|o&~u)+(c>>>0)+f;return(g<>>32-h)+a},r._hh=function(s,a,o,u,c,h,f){var g=s+(a^o^u)+(c>>>0)+f;return(g<>>32-h)+a},r._ii=function(s,a,o,u,c,h,f){var g=s+(o^(a|~u))+(c>>>0)+f;return(g<>>32-h)+a},r._blocksize=16,r._digestsize=16,fr.exports=function(s,a){if(s==null)throw new Error("Illegal argument "+s);var o=e.wordsToBytes(r(s,a));return a&&a.asBytes?o:a&&a.asString?i.bytesToString(o):e.bytesToHex(o)}})();const Ce=class{constructor(t){p(this,"seed",BigInt(0));this.setSeed(t)}static fromLargeFeatureSeed(t,n,i){const r=new Ce(t),s=r.nextLong(),a=r.nextLong(),o=BigInt(n)*s^BigInt(i)*a^t;return r.setSeed(o),r}static fromLargeFeatureWithSalt(t,n,i,r){const s=BigInt(n)*BigInt("341873128712")+BigInt(i)*BigInt("132897987541")+t+BigInt(r);return new Ce(s)}fork(){return new Ce(this.nextLong())}forkPositional(){return new ta(this.nextLong())}setSeed(t){this.seed=(t^Ce.MULTIPLIER)&Ce.MODULUS_MASK}advance(){this.seed=this.seed*Ce.MULTIPLIER+Ce.INCREMENT&Ce.MODULUS_MASK}consume(t){for(let n=0;n>BigInt(Ce.MODULUS_BITS-t));return n>2147483647?n-4294967296:n}nextInt(t){if(t===void 0)return this.next(32);if((t&t-1)==0)return Number(BigInt(t)*BigInt(this.next(31))>>BigInt(31));let n,i;for(;(n=this.next(31))-(i=n%t)+(t-1)<0;);return i}nextLong(){return(BigInt(this.next(32))<>z.BIGINT_30)*z.STAFFORD_1&z.MAX_ULONG,t=(t^t>>z.BIGINT_27)*z.STAFFORD_2&z.MAX_ULONG,(t^t>>z.BIGINT_31)&z.MAX_ULONG}static upgradeSeedTo128bit(t){t<0&&(t+=z.POW2_60);const n=t^z.SILVER_RATIO_64,i=n+z.GOLDEN_RATIO_64&z.MAX_ULONG;return[z.mixStafford13(n),z.mixStafford13(i)]}static rotateLeft(t,n){return t<>z.BIGINT_64-n}setSeed(t){this.seed=z.upgradeSeedTo128bit(t)}fork(){return new z([this.next(),this.next()])}forkPositional(){return new na(this.next(),this.next())}next(){const t=this.seed[0];let n=this.seed[1];const i=z.rotateLeft(t+n&z.MAX_ULONG,z.BIGINT_17)+t&z.MAX_ULONG;return n^=t,this.seed=[z.rotateLeft(t,z.BIGINT_49)^n^n<z.POW2_63&&(t-=z.POW2_60),t}consume(t){let n=this.seed[0],i=this.seed[1];for(let r=0;r>BigInt(64-t)}nextInt(t){let n=this.next()&z.MAX_UINT;if(t){const i=BigInt(t);let r=n*i,s=r&z.MAX_UINT;if(s>z.BIGINT_32;return Number(a)}else{let i=Number(n);return i>=2147483648&&(i-=4294967296),i}}nextFloat(){return Number(this.nextBits(24))*z.FLOAT_MULTIPLIER}nextDouble(){return Number(this.nextBits(53))*z.DOUBLE_MULTIPLIER}parityConfigString(){return"seedLo: "+this.seed[0]+", seedHi: "+this.seed[1]}};let te=z;p(te,"SILVER_RATIO_64",BigInt("7640891576956012809")),p(te,"GOLDEN_RATIO_64",BigInt("-7046029254386353131")),p(te,"FLOAT_MULTIPLIER",1/Math.pow(2,24)),p(te,"DOUBLE_MULTIPLIER",11102230246251565e-32),p(te,"BIGINT_1",BigInt(1)),p(te,"BIGINT_17",BigInt(17)),p(te,"BIGINT_21",BigInt(21)),p(te,"BIGINT_27",BigInt(27)),p(te,"BIGINT_28",BigInt(28)),p(te,"BIGINT_30",BigInt(30)),p(te,"BIGINT_31",BigInt(31)),p(te,"BIGINT_32",BigInt(32)),p(te,"BIGINT_49",BigInt(49)),p(te,"BIGINT_64",BigInt(64)),p(te,"STAFFORD_1",BigInt("-4658895280553007687")),p(te,"STAFFORD_2",BigInt("-7723592293110705685")),p(te,"MAX_ULONG",BigInt("0xFFFFFFFFFFFFFFFF")),p(te,"POW2_60",BigInt("0x10000000000000000")),p(te,"POW2_63",BigInt("0x8000000000000000")),p(te,"MAX_UINT",BigInt(4294967295));class na{constructor(t,n){this.seedLo=t,this.seedHi=n}at(t,n,i){const s=ar(t,n,i)^this.seedLo;return new te([s,this.seedHi])}fromHashOf(t){const n=fr.exports(t,{asBytes:!0}),i=_i(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),r=_i(n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15]);return new te([i^this.seedLo,r^this.seedHi])}seedKey(){return[this.seedLo,this.seedHi]}}const Qe=class{constructor(t){p(this,"p");p(this,"xo");p(this,"yo");p(this,"zo");this.xo=t.nextDouble()*256,this.yo=t.nextDouble()*256,this.zo=t.nextDouble()*256,this.p=Array(256);for(let n=0;n<256;n+=1)this.p[n]=n;for(let n=0;n<256;n+=1){const i=t.nextInt(256-n),r=this.p[n];this.p[n]=this.p[n+i],this.p[n+i]=r}}sample2D(t,n){let i,r,s;const a=(t+n)*Qe.F2,o=Math.floor(t+a),u=o-(i=(o+(r=Math.floor(n+a)))*Qe.G2),c=t-u;let h,f;c>(s=n-(r-i))?(h=1,f=0):(h=0,f=1);const g=c-h+Qe.G2,d=s-f+Qe.G2,w=c-1+2*Qe.G2,S=s-1+2*Qe.G2,_=o&255,E=r&255,A=this.P(_+this.P(E))%12,N=this.P(_+h+this.P(E+f))%12,v=this.P(_+1+this.P(E+1))%12,R=this.getCornerNoise3D(A,c,s,0,.5),O=this.getCornerNoise3D(N,g,d,0,.5),k=this.getCornerNoise3D(v,w,S,0,.5);return 70*(R+O+k)}sample(t,n,i){const r=(t+n+i)*.3333333333333333,s=Math.floor(t+r),a=Math.floor(n+r),o=Math.floor(i+r),u=(s+a+o)*.16666666666666666,c=t-(s-u),h=n-(a-u),f=i-(o-u);let g,d,w,S,_,E;c>=h?h>=f?(g=1,d=0,w=0,S=1,_=1,E=0):c>=f?(g=1,d=0,w=0,S=1,_=0,E=1):(g=0,d=0,w=1,S=1,_=0,E=1):h127?n-256:n;for(let n=0;n<256;n+=1){const i=t.nextInt(256-n),r=this.p[n];this.p[n]=this.p[n+i],this.p[n+i]=r}}sample(t,n,i,r=0,s=0){const a=t+this.xo,o=n+this.yo,u=i+this.zo,c=Math.floor(a),h=Math.floor(o),f=Math.floor(u),g=a-c,d=o-h,w=u-f;let S=0;if(r!==0){const _=s>=0&&s=0;r-=1)r0&&(g=this.maxLimitNoise.getOctaveNoise(E))&&(_+=g.sample(A,N,v,R,s*w)/w),w/=2}return di(S/512,_/512,d)/128}}const Wn=class{constructor(t,{firstOctave:n,amplitudes:i}){p(this,"valueFactor");p(this,"first");p(this,"second");p(this,"maxValue");this.first=new be(t,n,i),this.second=new be(t,n,i);let r=1/0,s=-1/0;for(let o=0;o{function t(i,r){return{firstOctave:i,amplitudes:r}}e.create=t;function n(i){var s,a,o;const r=(s=l.Json.readObject(i))!=null?s:{};return{firstOctave:(a=l.Json.readInt(r.firstOctave))!=null?a:0,amplitudes:(o=l.Json.readArray(r.amplitudes,u=>{var c;return(c=l.Json.readNumber(u))!=null?c:0}))!=null?o:[]}}e.fromJson=n})(l.NoiseParameters||(l.NoiseParameters={}));class oh{constructor(t,n){p(this,"noiseLevels");p(this,"highestFreqInputFactor");p(this,"highestFreqValueFactor");const i=n[n.length-1],s=-n[0]+i+1,a=new Set(n),o=new pe(t);this.noiseLevels=Array(s),i>=0&&i=0&&a.has(i-u)?this.noiseLevels[u]=new pe(t):t.consume(262);if(i>0)throw new Error("Positive octaves are not allowed");this.highestFreqInputFactor=Math.pow(2,i),this.highestFreqValueFactor=1/(Math.pow(2,s)-1)}sample(t,n,i){let r=0,s=this.highestFreqInputFactor,a=this.highestFreqValueFactor;for(let o=0;o{const t=e/15,n=t*.6+(t>0?.4:.3),i=yt(t*t*.7-.5,0,1),r=yt(t*t*.6-.7,0,1);return[n,i,r]},sa=e=>[e/8,1-e/32,e*64],zn={large_fern:()=>ht,tall_grass:()=>ht,grass_block:()=>ht,fern:()=>ht,grass:()=>ht,short_grass:()=>ht,potted_fern:()=>ht,pink_petals:()=>ht,spruce_leaves:()=>ch,birch_leaves:()=>lh,oak_leaves:()=>nn,jungle_leaves:()=>nn,acacia_leaves:()=>nn,dark_oak_leaves:()=>nn,vine:()=>nn,mangrove_leaves:()=>nn,water:()=>bi,bubble_column:()=>bi,cauldron:()=>bi,water_cauldron:()=>bi,redstone_wire:e=>{var t;return uh(parseInt((t=e.power)!=null?t:"0"))},sugar_cane:()=>ht,attached_melon_stem:()=>ra,attached_pumpkin_stem:()=>ra,melon_stem:e=>{var t;return sa(parseInt((t=e.age)!=null?t:"0"))},pumpkin_stem:e=>{var t;return sa(parseInt((t=e.age)!=null?t:"0"))},lily_pad:()=>hh};l.Cull=void 0,(e=>{function t(i,r,s){let{up:a,down:o,north:u,east:c,south:h,west:f}=i;switch(s){case 90:[u,c,h,f]=[c,h,f,u];break;case 180:[u,c,h,f]=[h,f,u,c];break;case 270:[u,c,h,f]=[f,u,c,h]}switch(r){case 90:[a,u,o,h]=[u,o,h,a];break;case 180:[a,u,o,h]=[o,h,a,u];break;case 270:[a,u,o,h]=[h,a,u,o]}return{up:a,down:o,north:u,east:c,south:h,west:f}}e.rotate=t;function n(){return Object.create(null)}e.none=n})(l.Cull||(l.Cull={}));const Ue=class{constructor(t,n,i,r,s){this.pos=t,this.color=n,this.texture=i,this.normal=r,this.blockPos=s}transform(t){return Ue.VEC[0]=this.pos.x,Ue.VEC[1]=this.pos.y,Ue.VEC[2]=this.pos.z,ih(Ue.VEC,Ue.VEC,t),this.pos=new W(Ue.VEC[0],Ue.VEC[1],Ue.VEC[2]),this}static fromPos(t){return new Ue(t,[0,0,0],[0,0],void 0,void 0)}};let Pe=Ue;p(Pe,"VEC",ur());class Si{constructor(t,n){this.v1=t,this.v2=n}vertices(){return[this.v1,this.v2]}forEach(t){return t(this.v1),t(this.v2),this}transform(t){return this.forEach(n=>n.transform(t)),this}setColor(t){return this.forEach(n=>n.color=t),this}toString(){return`Line(${this.v1.pos.toString()}, ${this.v2.pos.toString()})`}static fromPoints(t,n){return new Si(Pe.fromPos(t),Pe.fromPos(n))}}class Ae{constructor(t=[],n=[]){p(this,"posBuffer");p(this,"colorBuffer");p(this,"textureBuffer");p(this,"normalBuffer");p(this,"blockPosBuffer");p(this,"indexBuffer");p(this,"linePosBuffer");p(this,"lineColorBuffer");this.quads=t,this.lines=n}clear(){return this.quads=[],this.lines=[],this}isEmpty(){return this.quads.length===0&&this.lines.length===0}quadVertices(){return this.quads.length*4}quadIndices(){return this.quads.length*6}lineVertices(){return this.lines.length*2}merge(t){return this.quads=this.quads.concat(t.quads),this.lines=this.lines.concat(t.lines),this}addLine(t,n,i,r,s,a,o){const u=new Si(Pe.fromPos(new W(t,n,i)),Pe.fromPos(new W(r,s,a))).setColor(o);return this.lines.push(u),this}addLineCube(t,n,i,r,s,a,o){return this.addLine(t,n,i,t,n,a,o),this.addLine(r,n,i,r,n,a,o),this.addLine(t,n,i,r,n,i,o),this.addLine(t,n,a,r,n,a,o),this.addLine(t,n,i,t,s,i,o),this.addLine(r,n,i,r,s,i,o),this.addLine(t,n,a,t,s,a,o),this.addLine(r,n,a,r,s,a,o),this.addLine(t,s,i,t,s,a,o),this.addLine(r,s,i,r,s,a,o),this.addLine(t,s,i,r,s,i,o),this.addLine(t,s,a,r,s,a,o),this}transform(t){for(const n of this.quads)n.transform(t);return this}rebuild(t,n){const i=(s,a,o)=>{var u;if(s||(s=(u=t.createBuffer())!=null?u:void 0),!s)throw new Error("Cannot create new buffer");return t.bindBuffer(a,s),t.bufferData(a,o,t.DYNAMIC_DRAW),s},r=(s,a,o)=>{if(s.length===0){a&&t.deleteBuffer(a);return}const u=s.flatMap(c=>c.vertices().flatMap(h=>{const f=o(h);if(!f)throw new Error("Missing vertex component");return f}));return i(a,t.ARRAY_BUFFER,new Float32Array(u))};return n.pos&&(this.posBuffer=r(this.quads,this.posBuffer,s=>s.pos.components()),this.linePosBuffer=r(this.lines,this.linePosBuffer,s=>s.pos.components())),n.color&&(this.colorBuffer=r(this.quads,this.colorBuffer,s=>s.color),this.lineColorBuffer=r(this.lines,this.lineColorBuffer,s=>s.color)),n.texture&&(this.textureBuffer=r(this.quads,this.textureBuffer,s=>s.texture)),n.normal&&(this.normalBuffer=r(this.quads,this.normalBuffer,s=>{var a;return(a=s.normal)==null?void 0:a.components()})),n.blockPos&&(this.blockPosBuffer=r(this.quads,this.blockPosBuffer,s=>{var a;return(a=s.blockPos)==null?void 0:a.components()})),this.quads.length===0?(this.indexBuffer&&t.deleteBuffer(this.indexBuffer),this.indexBuffer=void 0):this.indexBuffer=i(this.indexBuffer,t.ELEMENT_ARRAY_BUFFER,new Uint16Array(this.quads.flatMap((s,a)=>[4*a,4*a+1,4*a+2,a*4,4*a+2,4*a+3],!0))),this}}class vi{constructor(t,n,i){this.id=t,this.variants=n,this.multipart=i,this.variants=n}getModelVariants(t){if(this.variants){const n=Object.keys(this.variants).filter(r=>this.matchesVariant(r,t));if(n.length===0)return[];const i=this.variants[n[0]];return[Array.isArray(i)?i[0]:i]}else if(this.multipart)return this.multipart.filter(i=>i.when?this.matchesCase(i.when,t):!0).map(i=>Array.isArray(i.apply)?i.apply[0]:i.apply);return[]}getMesh(t,n,i,r,s){var c,h,f,g,d;const a=this.getModelVariants(n),o=new Ae;for(const w of a){const S=l.Cull.rotate(s,(c=w.x)!=null?c:0,(h=w.y)!=null?h:0),_=r.getBlockModel(G.parse(w.model));if(!_)throw new Error(`Cannot find block model ${w.model}`);const E=(f=zn[t.path])==null?void 0:f.call(zn,n),A=_.getMesh(i,S,E);if(w.x||w.y){const N=Te();Dn(N),Ie(N,N,[8,8,8]),hr(N,N,-cr((g=w.y)!=null?g:0)),Xs(N,N,-cr((d=w.x)!=null?d:0)),Ie(N,N,[-8,-8,-8]),A.transform(N)}o.merge(A)}const u=Te();return Dn(u),xn(u,u,[.0625,.0625,.0625]),o.transform(u)}matchesVariant(t,n){return t.split(",").every(i=>{const[r,s]=i.split("=");return n[r]===s})}matchesCase(t,n){if(Array.isArray(t.OR))return t.OR.some(r=>this.matchesCase(r,n));const i=t;return Object.keys(i).every(r=>i[r].split("|").includes(n[r]))}static fromJson(t,n){return new vi(G.parse(t),n.variants,n.multipart)}}class Xe{constructor(t,n,i,r){this.v1=t,this.v2=n,this.v3=i,this.v4=r}vertices(){return[this.v1,this.v2,this.v3,this.v4]}forEach(t){return t(this.v1),t(this.v2),t(this.v3),t(this.v4),this}transform(t){return this.forEach(n=>n.transform(t)),this}normal(){const t=this.v2.pos.sub(this.v1.pos),n=this.v3.pos.sub(this.v1.pos);return t.cross(n).normalize()}reverse(){return[this.v1,this.v2,this.v3,this.v4]=[this.v4,this.v3,this.v2,this.v1],this}setColor(t){return this.forEach(n=>n.color=t),this}setTexture(t){return this.v1.texture=[t[0],t[1]],this.v2.texture=[t[2],t[3]],this.v3.texture=[t[4],t[5]],this.v4.texture=[t[6],t[7]],this}toString(){return`Quad(${this.v1.pos.toString()}, ${this.v2.pos.toString()}, ${this.v3.pos.toString()}, ${this.v4.pos.toString()})`}static fromPoints(t,n,i,r){return new Xe(Pe.fromPos(t),Pe.fromPos(n),Pe.fromPos(i),Pe.fromPos(r))}}const fh={0:[0,3,2,3,2,1,0,1],90:[2,3,2,1,0,1,0,3],180:[2,1,0,1,0,3,2,3],270:[0,1,0,3,2,3,2,1]},dh={x:[1,0,0],y:[0,1,0],z:[0,0,1]},rn=1.41421356237,gh={x:[1,rn,rn],y:[rn,1,rn],z:[rn,rn,1]},ln=class{constructor(t,n,i,r,s,a){p(this,"generationMarker",!1);this.id=t,this.parent=n,this.textures=i,this.elements=r,this.display=s,this.guiLight=a}getDisplayTransform(t){var r;const n=(r=this.display)==null?void 0:r[t],i=Te();return Dn(i),Ie(i,i,[8,8,8]),n!=null&&n.translation&&Ie(i,i,n.translation),n!=null&&n.rotation&&(Xs(i,i,n.rotation[0]*Math.PI/180),hr(i,i,n.rotation[1]*Math.PI/180),Wl(i,i,-n.rotation[2]*Math.PI/180)),n!=null&&n.scale&&xn(i,i,n.scale),Ie(i,i,[-8,-8,-8]),i}getMesh(t,n,i){var a;const r=new Ae,s=o=>i===void 0?[1,1,1]:o===void 0||o<0?[1,1,1]:typeof i=="function"?i(o):i;for(const o of(a=this.elements)!=null?a:[])r.merge(this.getElementMesh(o,t,n,s));return r}getElementMesh(t,n,i,r){var w,S,_,E,A,N,v,R,O,k,T,C;const s=new Ae,[a,o,u]=t.from,[c,h,f]=t.to,g=(I,M,x)=>{var H,Q,We,Ve,xe,de,ge,_e,Ot;const J=Xe.fromPoints(new W(x[0],x[1],x[2]),new W(x[3],x[4],x[5]),new W(x[6],x[7],x[8]),new W(x[9],x[10],x[11])),F=r(I.tintindex);J.setColor(F);const[ne,se,le,Se]=n.getTextureUV(this.getTexture(I.texture)),ie=(le-ne)/16,y=(Se-se)/16,b=ie/16,L=y/16;M[0]=((Q=(H=I.uv)==null?void 0:H[0])!=null?Q:M[0])*ie+b,M[1]=((Ve=(We=I.uv)==null?void 0:We[1])!=null?Ve:M[1])*y+L,M[2]=((de=(xe=I.uv)==null?void 0:xe[2])!=null?de:M[2])*ie-b,M[3]=((_e=(ge=I.uv)==null?void 0:ge[3])!=null?_e:M[3])*y-L;const D=fh[(Ot=I.rotation)!=null?Ot:0];J.setTexture([ne+M[D[0]],se+M[D[1]],ne+M[D[2]],se+M[D[3]],ne+M[D[4]],se+M[D[5]],ne+M[D[6]],se+M[D[7]]]),s.quads.push(J)};((S=(w=t.faces)==null?void 0:w.up)==null?void 0:S.texture)&&(!t.faces.up.cullface||!i[t.faces.up.cullface])&&g(t.faces.up,[a,16-f,c,16-u],[a,h,f,c,h,f,c,h,u,a,h,u]),((E=(_=t.faces)==null?void 0:_.down)==null?void 0:E.texture)&&(!t.faces.down.cullface||!i[t.faces.down.cullface])&&g(t.faces.down,[16-f,16-c,16-u,16-a],[a,o,u,c,o,u,c,o,f,a,o,f]),((N=(A=t.faces)==null?void 0:A.south)==null?void 0:N.texture)&&(!t.faces.south.cullface||!i[t.faces.south.cullface])&&g(t.faces.south,[a,16-h,c,16-o],[a,o,f,c,o,f,c,h,f,a,h,f]),((R=(v=t.faces)==null?void 0:v.north)==null?void 0:R.texture)&&(!t.faces.north.cullface||!i[t.faces.north.cullface])&&g(t.faces.north,[16-c,16-h,16-a,16-o],[c,o,u,a,o,u,a,h,u,c,h,u]),((k=(O=t.faces)==null?void 0:O.east)==null?void 0:k.texture)&&(!t.faces.east.cullface||!i[t.faces.east.cullface])&&g(t.faces.east,[16-f,16-h,16-u,16-o],[c,o,f,c,o,u,c,h,u,c,h,f]),((C=(T=t.faces)==null?void 0:T.west)==null?void 0:C.texture)&&(!t.faces.west.cullface||!i[t.faces.west.cullface])&&g(t.faces.west,[u,16-h,f,16-o],[a,o,u,a,o,f,a,h,f,a,h,u]);const d=Te();if(Dn(d),t.rotation){const I=th(...t.rotation.origin);Ie(d,d,I),Ul(d,d,cr(t.rotation.angle),dh[t.rotation.axis]),t.rotation.rescale&&xn(d,d,gh[t.rotation.axis]),nh(I,I),Ie(d,d,I)}return s.transform(d)}getTexture(t){var n,i;for(;t.startsWith("#");)t=(i=(n=this.textures)==null?void 0:n[t.slice(1)])!=null?i:"";return G.parse(t)}flatten(t){var i,r,s,a;if(!this.parent)return;if(this.parent.equals(ln.BUILTIN_GENERATED)){this.generationMarker=!0;return}const n=this.getParent(t);if(!n){console.warn(`parent ${this.parent} does not exist!`),this.parent=void 0;return}if(n.flatten(t),this.elements||(this.elements=n.elements),this.textures||(this.textures={}),Object.keys((i=n.textures)!=null?i:{}).forEach(o=>{this.textures[o]||(this.textures[o]=n.textures[o])}),this.display||(this.display={}),Object.keys((r=n.display)!=null?r:{}).forEach(o=>{var c;const u=o;this.display[u]?Object.keys((c=n.display[u])!=null?c:{}).forEach(h=>{const f=h;this.display[u][f]||(this.display[u][f]=n.display[u][f])}):this.display[u]=n.display[u]}),this.guiLight||(this.guiLight=n.guiLight),n.generationMarker&&(this.generationMarker=!0),this.generationMarker&&((a=(s=this.elements)==null?void 0:s.length)!=null?a:0)===0)for(let o=0;oi};return i.flatten(s),r.getMesh(e,{},t,s,n)}function aa(e,t,n,i,r){const s=i.up?16:[14.2,12.5,10.5,9,7,5.3,3.7,1.9,16,16,16,16,16,16,16,16][t],a=G.create(e);return _r(a,n,i,new kt(a,void 0,{still:`block/${e}_still`,flow:`block/${e}_flow`},[{from:[0,0,0],to:[16,s,16],faces:{up:{texture:"#still",tintindex:r,cullface:l.Direction.UP},down:{texture:"#still",tintindex:r,cullface:l.Direction.DOWN},north:{texture:"#flow",tintindex:r,cullface:l.Direction.NORTH},east:{texture:"#flow",tintindex:r,cullface:l.Direction.EAST},south:{texture:"#flow",tintindex:r,cullface:l.Direction.SOUTH},west:{texture:"#flow",tintindex:r,cullface:l.Direction.WEST}}}]))}function _h(e,t,n){const i=Te();Ie(i,i,[.5,.5,.5]),hr(i,i,e==="west"?Math.PI/2:e==="south"?Math.PI:e==="east"?Math.PI*3/2:0),Ie(i,i,[-.5,-.5,-.5]);const r=G.create("chest");return _r(r,n,{},new kt(r,void 0,{0:"entity/chest/normal"},[{from:[1,0,1],to:[15,10,15],faces:{north:{uv:[10.5,8.25,14,10.75],rotation:180,texture:"#0"},east:{uv:[7,8.25,10.5,10.75],rotation:180,texture:"#0"},south:{uv:[3.5,8.25,7,10.75],rotation:180,texture:"#0"},west:{uv:[0,8.25,3.5,10.75],rotation:180,texture:"#0"},up:{uv:[7,4.75,10.5,8.25],texture:"#0"},down:{uv:[3.5,4.75,7,8.25],texture:"#0"}}},{from:[1,10,1],to:[15,14,15],faces:{north:{uv:[10.5,3.75,14,4.75],rotation:180,texture:"#0"},east:{uv:[7,3.75,10.5,4.75],rotation:180,texture:"#0"},south:{uv:[3.5,3.75,7,4.75],rotation:180,texture:"#0"},west:{uv:[0,3.75,3.5,4.75],rotation:180,texture:"#0"},up:{uv:[7,0,10.5,3.5],texture:"#0"},down:{uv:[3.5,0,7,3.5],texture:"#0"}}},{from:[7,8,0],to:[9,12,2],faces:{north:{uv:[.25,.25,.75,1.25],rotation:180,texture:"#0"},east:{uv:[0,.25,.25,1.25],rotation:180,texture:"#0"},south:{uv:[1,.25,1.5,1.25],rotation:180,texture:"#0"},west:{uv:[.75,.25,1,1.25],rotation:180,texture:"#0"},up:{uv:[.25,0,.75,.25],rotation:180,texture:"#0"},down:{uv:[.75,0,1.25,.25],rotation:180,texture:"#0"}}}])).transform(i)}function mh(e){const t=G.create("decorated_pot");return _r(t,e,{},new kt(t,void 0,{0:"entity/decorated_pot/decorated_pot_side",1:"entity/decorated_pot/decorated_pot_base"},[{from:[1,0,1],to:[15,16,15],faces:{north:{uv:[1,0,15,16],texture:"#0"},east:{uv:[1,0,15,16],texture:"#0"},south:{uv:[1,0,15,16],texture:"#0"},west:{uv:[1,0,15,16],texture:"#0"},up:{uv:[0,6.5,7,13.5],texture:"#1"},down:{uv:[7,6.5,14,13.5],texture:"#1"}}},{from:[5,16,5],to:[11,17,11],faces:{north:{uv:[0,5.5,3,6],texture:"#1"},east:{uv:[3,5.5,6,6],texture:"#1"},south:{uv:[6,5.5,9,6],texture:"#1"},west:{uv:[9,5.5,12,6],texture:"#1"}}},{from:[4,17,4],to:[12,20,12],faces:{north:{uv:[0,4,4,5.5],texture:"#1"},east:{uv:[4,4,8,5.5],texture:"#1"},south:{uv:[8,4,12,5.5],texture:"#1"},west:{uv:[12,4,16,5.5],texture:"#1"},up:{uv:[4,0,8,4],texture:"#1"},down:{uv:[8,0,12,4],texture:"#1"}}}]))}const Ai={"minecraft:water":(e,t,n)=>aa("water",parseInt(e.level),t,n,0),"minecraft:lava":(e,t,n)=>aa("lava",parseInt(e.level),t,n),"minecraft:chest":(e,t)=>_h(e.facing||"south",e.type||"single",t),"minecraft:decorated_pot":(e,t)=>mh(t)},mr=new Set(Object.keys(Ai));class oa{constructor(t,n,i,r=16){p(this,"chunks",[]);p(this,"chunkSize");this.gl=t,this.structure=n,this.resources=i,this.chunkSize=typeof r=="number"?[r,r,r]:r,this.updateStructureBuffers()}setStructure(t){this.structure=t,this.updateStructureBuffers()}updateStructureBuffers(t){var n,i;if(!!this.structure){t?t.forEach(r=>{const s=this.getChunk(r);s.mesh.clear(),s.transparentMesh.clear()}):this.chunks.forEach(r=>r.forEach(s=>s.forEach(a=>{a.mesh.clear(),a.transparentMesh.clear()})));for(const r of this.structure.getBlocks()){const s=r.state.getName(),a=r.state.getProperties(),o=(n=this.resources.getDefaultBlockProperties(s))!=null?n:{};Object.entries(o).forEach(([h,f])=>{a[h]||(a[h]=f)});const u=[Math.floor(r.pos[0]/this.chunkSize[0]),Math.floor(r.pos[1]/this.chunkSize[1]),Math.floor(r.pos[2]/this.chunkSize[2])];if(t&&!t.some(h=>rh(h,u)))continue;const c=this.getChunk(u);try{const h=this.resources.getBlockDefinition(s),f={up:this.needsCull(r,l.Direction.UP),down:this.needsCull(r,l.Direction.DOWN),west:this.needsCull(r,l.Direction.WEST),east:this.needsCull(r,l.Direction.EAST),north:this.needsCull(r,l.Direction.NORTH),south:this.needsCull(r,l.Direction.SOUTH)},g=new Ae;h&&g.merge(h.getMesh(s,a,this.resources,this.resources,f)),mr.has(s.toString())&&g.merge(Ai[s.toString()](a,this.resources,f)),g.isEmpty()||(this.finishChunkMesh(g,r.pos),(i=this.resources.getBlockFlags(r.state.getName()))!=null&&i.semi_transparent?c.transparentMesh.merge(g):c.mesh.merge(g))}catch(h){console.error(`Error rendering block ${s}`,h)}}t?t.forEach(r=>{const s=this.getChunk(r);s.mesh.rebuild(this.gl,{pos:!0,color:!0,texture:!0,normal:!0,blockPos:!0}),s.transparentMesh.rebuild(this.gl,{pos:!0,color:!0,texture:!0,normal:!0,blockPos:!0})}):this.chunks.forEach(r=>r.forEach(s=>s.forEach(a=>{a.mesh.rebuild(this.gl,{pos:!0,color:!0,texture:!0,normal:!0,blockPos:!0}),a.transparentMesh.rebuild(this.gl,{pos:!0,color:!0,texture:!0,normal:!0,blockPos:!0})})))}}getMeshes(){const t=this.chunks.flatMap(n=>n.flatMap(i=>i.flatMap(r=>r!=null?r:[])));return t.flatMap(n=>n.mesh.isEmpty()?[]:n.mesh).concat(t.flatMap(n=>n.transparentMesh.isEmpty()?[]:n.transparentMesh))}needsCull(t,n){var s;const i=(s=this.structure.getBlock(l.BlockPos.towards(t.pos,n)))==null?void 0:s.state;if(!i)return!1;const r=this.resources.getBlockFlags(i.getName());return t.state.getName().equals(i.getName())&&(r==null?void 0:r.self_culling)?!0:r!=null&&r.opaque?!(n===l.Direction.UP&&t.state.isFluid()):t.state.isFluid()&&i.isFluid()}finishChunkMesh(t,n){const i=Te();Ie(i,i,n),t.transform(i);for(const r of t.quads){const s=r.normal();r.forEach(a=>a.normal=s),r.forEach(a=>a.blockPos=new W(n[0],n[1],n[2]))}}getChunk(t){const n=Math.abs(t[0])*2+(t[0]<0?1:0),i=Math.abs(t[1])*2+(t[1]<0?1:0),r=Math.abs(t[2])*2+(t[2]<0?1:0);return this.chunks[n]||(this.chunks[n]=[]),this.chunks[n][i]||(this.chunks[n][i]=[]),this.chunks[n][i][r]||(this.chunks[n][i][r]={mesh:new Ae,transparentMesh:new Ae}),this.chunks[n][i][r]}}const ca=new Map;function la(e){if(e.id.namespace!==G.DEFAULT_NAMESPACE)return[1,1,1];const t=ca.get(e.id.path);return t?t(e):[1,1,1]}function ut(e,t){for(const n of e)ca.set(n,t)}ut(["leather_helmet","leather_chestplate","leather_leggings","leather_boots","leather_horse_armor"],({tag:e})=>{const t=e.getCompound("display"),n=we(t.hasNumber("color")?t.getNumber("color"):10511680);return i=>i>0?[1,1,1]:n});const wh=[124/255,189/255,107/255];ut(["tall_grass","large_fern"],()=>wh),ut(["firework_star"],({tag:e})=>{const t=(()=>{const i=e.getCompound("Explosion").get("Colors");if(!(i!=null&&i.isIntArray())||i.length===0)return we(9079434);if(i.length===1)return we(i.get(0).getAsNumber());let[r,s,a]=[0,0,0];for(const o of i.getItems())r+=(o.getAsNumber()&16711680)>>16,s+=(o.getAsNumber()&65280)>>8,a+=(o.getAsNumber()&255)>>0;return r/=i.length,s/=i.length,a/=i.length,[r,s,a]})();return n=>n!==1?[1,1,1]:t}),ut(["potion","splash_potion","lingering_potion"],({tag:e})=>{const t=l.Potion.getColor(e);return n=>n>0?[1,1,1]:t});const Eh=[["allay",56063,44543],["axolotl",16499171,10890612],["bat",4996656,986895],["bee",15582019,4400155],["blaze",16167425,16775294],["cat",15714446,9794134],["camel",16565097,13341495],["cave_spider",803406,11013646],["chicken",10592673,16711680],["cod",12691306,15058059],["cow",4470310,10592673],["creeper",894731,0],["dolphin",2243405,16382457],["donkey",5457209,8811878],["drowned",9433559,7969893],["elder_guardian",13552826,7632531],["ender_dragon",1842204,14711290],["enderman",1447446,0],["endermite",1447446,7237230],["evoker",9804699,1973274],["fox",14005919,13396256],["frog",13661252,16762748],["ghast",16382457,12369084],["glow_squid",611926,8778172],["goat",10851452,5589310],["guardian",5931634,15826224],["hoglin",13004373,6251620],["horse",12623485,15656192],["husk",7958625,15125652],["iron_golem",14405058,7643954],["llama",12623485,10051392],["magma_cube",3407872,16579584],["mooshroom",10489616,12040119],["mule",1769984,5321501],["ocelot",15720061,5653556],["panda",15198183,1776418],["parrot",894731,16711680],["phantom",4411786,8978176],["pig",15771042,14377823],["piglin",10051392,16380836],["piglin_brute",5843472,16380836],["pillager",5451574,9804699],["polar_bear",15658718,14014157],["pufferfish",16167425,3654642],["rabbit",10051392,7555121],["ravager",7697520,5984329],["salmon",10489616,951412],["sheep",15198183,16758197],["shulker",9725844,5060690],["silverfish",7237230,3158064],["skeleton",12698049,4802889],["skeleton_horse",6842447,15066584],["slime",5349438,8306542],["snow_golem",14283506,8496292],["spider",3419431,11013646],["squid",2243405,7375001],["stray",6387319,14543594],["strider",10236982,5065037],["tadpole",7164733,1444352],["trader_llama",15377456,4547222],["tropical_fish",15690005,16775663],["turtle",15198183,44975],["vex",8032420,15265265],["villager",5651507,12422002],["vindicator",9804699,2580065],["wandering_trader",4547222,15377456],["warden",1001033,3790560],["witch",3407872,5349438],["wither",1315860,5075616],["wither_skeleton",1315860,4672845],["wolf",14144467,13545366],["zoglin",13004373,15132390],["zombie",44975,7969893],["zombie_horse",3232308,9945732],["zombie_villager",5651507,7969893],["zombified_piglin",15373203,5009705]];for(const e of Eh)ut([`${e[0]}_spawn_egg`],()=>t=>we(t===0?e[1]:e[2]));for(const e of["grass_block","grass","short_grass","fern","vine","oak_leaves","spruce_leaves","birch_leaves","jungle_leaves","acacia_leaves","dark_oak_leaves","lily_pad"]){const t=zn[e]({});ut([e],()=>t)}ut(["mangrove_leaves"],()=>we(9619016)),ut(["tipped_arrow"],({tag:e})=>{const t=l.Potion.getColor(e);return n=>n===0?t:[1,1,1]}),ut(["filled_map"],({tag:e})=>{const t=e.getCompound("display"),n=we(t.hasNumber("MapColor")?4278190080|t.getNumber("MapColor")&16777215:-12173266);return i=>i===0?[1,1,1]:n});class Fn{constructor(t,n,i){p(this,"gl");p(this,"program");this.gl=t,this.program=this.initShaderProgram(n,i)}getProgram(){return this.program}initShaderProgram(t,n){const i=this.loadShader(this.gl.VERTEX_SHADER,t),r=this.loadShader(this.gl.FRAGMENT_SHADER,n),s=this.gl.createProgram();if(this.gl.attachShader(s,i),this.gl.attachShader(s,r),this.gl.linkProgram(s),!this.gl.getProgramParameter(s,this.gl.LINK_STATUS))throw new Error(`Unable to link shader program: ${this.gl.getProgramInfoLog(s)}`);return s}loadShader(t,n){const i=this.gl.createShader(t);if(this.gl.shaderSource(i,n),this.gl.compileShader(i),!this.gl.getShaderParameter(i,this.gl.COMPILE_STATUS)){const r=new Error(`Compiling ${t===this.gl.VERTEX_SHADER?"vertex":"fragment"} shader: ${this.gl.getShaderInfoLog(i)}`);throw this.gl.deleteShader(i),r}return i}}const ph=` attribute vec4 vertPos; attribute vec2 texCoord; attribute vec3 vertColor; attribute vec3 normal; uniform mat4 mView; uniform mat4 mProj; varying highp vec2 vTexCoord; varying highp vec3 vTintColor; varying highp float vLighting; void main(void) { gl_Position = mProj * mView * vertPos; vTexCoord = texCoord; vTintColor = vertColor; vLighting = normal.y * 0.2 + abs(normal.z) * 0.1 + 0.8; } `,bh=` precision highp float; varying highp vec2 vTexCoord; varying highp vec3 vTintColor; varying highp float vLighting; uniform sampler2D sampler; void main(void) { vec4 texColor = texture2D(sampler, vTexCoord); if(texColor.a < 0.01) discard; gl_FragColor = vec4(texColor.xyz * vTintColor * vLighting, texColor.a); } `;class Ni{constructor(t){p(this,"shaderProgram");p(this,"projMatrix");p(this,"activeShader");this.gl=t,this.shaderProgram=new Fn(t,ph,bh).getProgram(),this.activeShader=this.shaderProgram,this.projMatrix=this.getPerspective(),this.initialize()}setViewport(t,n,i,r){this.gl.viewport(t,n,i,r),this.projMatrix=this.getPerspective()}getPerspective(){const t=70*Math.PI/180,n=this.gl.canvas.clientWidth/this.gl.canvas.clientHeight,i=Te();return Yl(i,t,n,.1,500),i}initialize(){this.gl.enable(this.gl.DEPTH_TEST),this.gl.depthFunc(this.gl.LEQUAL),this.gl.enable(this.gl.BLEND),this.gl.blendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA),this.gl.enable(this.gl.CULL_FACE),this.gl.cullFace(this.gl.BACK)}setShader(t){this.gl.useProgram(t),this.activeShader=t}setVertexAttr(t,n,i){if(i===void 0)throw new Error(`Expected buffer for ${t}`);const r=this.gl.getAttribLocation(this.activeShader,t);this.gl.bindBuffer(this.gl.ARRAY_BUFFER,i),this.gl.vertexAttribPointer(r,n,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(r)}setUniform(t,n){const i=this.gl.getUniformLocation(this.activeShader,t);this.gl.uniformMatrix4fv(i,!1,n)}setTexture(t){this.gl.activeTexture(this.gl.TEXTURE0),this.gl.bindTexture(this.gl.TEXTURE_2D,t)}createAtlasTexture(t){const n=this.gl.createTexture();return this.gl.bindTexture(this.gl.TEXTURE_2D,n),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,t),this.gl.generateMipmap(this.gl.TEXTURE_2D),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.NEAREST),n}prepareDraw(t){this.setUniform("mView",t),this.setUniform("mProj",this.projMatrix)}drawMesh(t,n){if(t.quadVertices()>0){if(n.pos&&this.setVertexAttr("vertPos",3,t.posBuffer),n.color&&this.setVertexAttr("vertColor",3,t.colorBuffer),n.texture&&this.setVertexAttr("texCoord",2,t.textureBuffer),n.normal&&this.setVertexAttr("normal",3,t.normalBuffer),n.blockPos&&this.setVertexAttr("blockPos",3,t.blockPosBuffer),!t.indexBuffer)throw new Error("Expected index buffer");this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,t.indexBuffer),this.gl.drawElements(this.gl.TRIANGLES,t.quadIndices(),this.gl.UNSIGNED_SHORT,0)}t.lineVertices()>0&&(n.pos&&this.setVertexAttr("vertPos",3,t.linePosBuffer),n.color&&this.setVertexAttr("vertColor",3,t.lineColorBuffer),this.gl.drawArrays(this.gl.LINES,0,t.lineVertices()))}}class Sh extends Ni{constructor(n,i,r,s){super(n);p(this,"item");p(this,"mesh");p(this,"tint");p(this,"atlasTexture");this.resources=r,this.item=i instanceof ve?i:new ve(i,1),this.mesh=this.getItemMesh(),this.tint=s==null?void 0:s.tint,this.atlasTexture=this.createAtlasTexture(this.resources.getTextureAtlas())}setItem(n){this.item=n instanceof ve?n:new ve(n,1),this.mesh=this.getItemMesh()}getItemMesh(){const n=this.resources.getBlockModel(this.item.id.withPrefix("item/"));if(!n)throw new Error(`Item model for ${this.item.toString()} does not exist`);let i=this.tint;!i&&this.item.id.namespace===G.DEFAULT_NAMESPACE&&(i=la(this.item));const r=n.getMesh(this.resources,l.Cull.none(),i);if(mr.has(this.item.id.toString())){const s=Ai[this.item.id.toString()]({},this.resources,l.Cull.none()),a=Te();Dn(a),xn(a,a,[16,16,16]),s.transform(a),r.merge(s)}return r.transform(n.getDisplayTransform("gui")),r.quads.forEach(s=>{const a=s.normal();s.forEach(o=>o.normal=a)}),r.rebuild(this.gl,{pos:!0,color:!0,texture:!0,normal:!0}),r}getPerspective(){const n=Te();return $l(n,0,16,0,16,.1,500),n}drawItem(){const n=Te();Ie(n,n,[0,0,-32]),this.setShader(this.shaderProgram),this.setTexture(this.atlasTexture),this.prepareDraw(n),this.drawMesh(this.mesh,{pos:!0,color:!0,texture:!0,normal:!0})}}const vh=` attribute vec4 vertPos; attribute vec3 blockPos; uniform mat4 mView; uniform mat4 mProj; varying highp vec3 vColor; void main(void) { gl_Position = mProj * mView * vertPos; vColor = blockPos / 256.0; } `,Ah=` precision highp float; varying highp vec3 vColor; void main(void) { gl_FragColor = vec4(vColor, 1.0); } `,Nh=` attribute vec4 vertPos; attribute vec3 vertColor; uniform mat4 mView; uniform mat4 mProj; varying highp vec3 vColor; void main(void) { gl_Position = mProj * mView * vertPos; vColor = vertColor; } `,yh=` precision highp float; varying highp vec3 vColor; void main(void) { gl_FragColor = vec4(vColor, 1.0); } `;class kh extends Ni{constructor(n,i,r,s){var o,u;super(n);p(this,"gridShaderProgram");p(this,"colorShaderProgram");p(this,"gridMesh",new Ae);p(this,"outlineMesh",new Ae);p(this,"invisibleBlocksMesh",new Ae);p(this,"atlasTexture");p(this,"useInvisibleBlocks");p(this,"chunkBuilder");this.structure=i,this.resources=r;const a=(o=s==null?void 0:s.chunkSize)!=null?o:16;this.chunkBuilder=new oa(n,i,r,a),s!=null&&s.facesPerBuffer&&console.warn("[deepslate renderer warning]: facesPerBuffer option has been removed in favor of chunkSize"),this.useInvisibleBlocks=(u=s==null?void 0:s.useInvisibleBlockBuffer)!=null?u:!0,this.gridShaderProgram=new Fn(n,Nh,yh).getProgram(),this.colorShaderProgram=new Fn(n,vh,Ah).getProgram(),this.gridMesh=this.getGridMesh(),this.outlineMesh=this.getOutlineMesh(),this.invisibleBlocksMesh=this.getInvisibleBlocksMesh(),this.atlasTexture=this.createAtlasTexture(this.resources.getTextureAtlas())}setStructure(n){this.structure=n,this.chunkBuilder.setStructure(n),this.gridMesh=this.getGridMesh(),this.invisibleBlocksMesh=this.getInvisibleBlocksMesh()}updateStructureBuffers(n){this.chunkBuilder.updateStructureBuffers(n)}getGridMesh(){const[n,i,r]=this.structure.getSize(),s=new Ae;s.addLine(0,0,0,n,0,0,[1,0,0]),s.addLine(0,0,0,0,0,r,[0,0,1]);const a=[.8,.8,.8];s.addLine(0,0,0,0,i,0,a),s.addLine(n,0,0,n,i,0,a),s.addLine(0,0,r,0,i,r,a),s.addLine(n,0,r,n,i,r,a),s.addLine(0,i,0,0,i,r,a),s.addLine(n,i,0,n,i,r,a),s.addLine(0,i,0,n,i,0,a),s.addLine(0,i,r,n,i,r,a);for(let o=1;o<=n;o+=1)s.addLine(o,0,0,o,0,r,a);for(let o=1;o<=r;o+=1)s.addLine(0,0,o,n,0,o,a);return s.rebuild(this.gl,{pos:!0,color:!0})}getOutlineMesh(){return new Ae().addLineCube(0,0,0,1,1,1,[1,1,1]).rebuild(this.gl,{pos:!0,color:!0})}getInvisibleBlocksMesh(){const n=new Ae;if(!this.useInvisibleBlocks)return n;const i=this.structure.getSize();for(let r=0;r{this.drawMesh(i,{pos:!0,color:!0,texture:!0,normal:!0})})}drawColoredStructure(n){this.setShader(this.colorShaderProgram),this.prepareDraw(n),this.chunkBuilder.getMeshes().forEach(i=>{this.drawMesh(i,{pos:!0,color:!0,normal:!0,blockPos:!0})})}drawOutline(n,i){this.setShader(this.gridShaderProgram);const r=Te();Hl(r,n),Ie(r,r,i),this.prepareDraw(r),this.drawMesh(this.outlineMesh,{pos:!0,color:!0})}}class Jn{constructor(t,n){p(this,"part");if(this.img=t,this.idMap=n,!or(t.width)||!or(t.height))throw new Error(`Expected texture atlas dimensions to be powers of two, got ${t.width}x${t.height}.`);this.part=16/t.width}getTextureAtlas(){return this.img}getTextureUV(t){var n;return(n=this.idMap[t.toString()])!=null?n:[0,0,this.part,this.part]}static async fromBlobs(t){const n=Math.sqrt(Object.keys(t).length+1),i=Ks(n),r=i*16,s=1/i,a=document.createElement("canvas");a.width=r,a.height=r;const o=a.getContext("2d");this.drawInvalidTexture(o);const u={};let c=1;return await Promise.all(Object.keys(t).map(async h=>{const f=c%i,g=Math.floor(c/i);c+=1,u[h]=[s*f,s*g,s*f+s,s*g+s];const d=await createImageBitmap(t[h]);o.drawImage(d,0,0,16,16,16*f,16*g,16,16)})),new Jn(o.getImageData(0,0,r,r),u)}static empty(){const t=document.createElement("canvas");t.width=16,t.height=16;const n=t.getContext("2d");return Jn.drawInvalidTexture(n),new Jn(n.getImageData(0,0,16,16),{})}static drawInvalidTexture(t){t.fillStyle="black",t.fillRect(0,0,16,16),t.fillStyle="magenta",t.fillRect(0,0,8,8),t.fillRect(8,8,8,8)}}const Rh=` attribute vec4 vertPos; attribute vec3 vertColor; uniform mat4 mView; uniform mat4 mProj; varying highp vec3 vColor; void main(void) { gl_Position = mProj * mView * vertPos; vColor = vertColor; } `,Th=` precision highp float; varying highp vec3 vColor; void main(void) { gl_FragColor = vec4(vColor, 1.0); } `;class Ih extends Ni{constructor(n){super(n);p(this,"voxelShaderProgram");p(this,"voxels",[]);p(this,"quads",[]);p(this,"meshes",[]);this.voxelShaderProgram=new Fn(n,Rh,Th).getProgram()}setVoxels(n){this.voxels=n,this.quads=this.getQuads(),this.meshes=this.getMeshes()}getQuads(){var r,s,a,o,u,c,h,f,g,d,w,S;const n=new Map;for(const _ of this.voxels)Oi(n,_.x,new Map,E=>{Oi(E,_.y,new Set,A=>{A.add(_.z)})});const i=[];for(const _ of this.voxels)(s=(r=n.get(_.x+1))==null?void 0:r.get(_.y))!=null&&s.has(_.z)||i.push(Xe.fromPoints(new W(_.x+1,_.y,_.z),new W(_.x+1,_.y+1,_.z),new W(_.x+1,_.y+1,_.z+1),new W(_.x+1,_.y,_.z+1)).setColor(_.color)),(o=(a=n.get(_.x-1))==null?void 0:a.get(_.y))!=null&&o.has(_.z)||i.push(Xe.fromPoints(new W(_.x,_.y,_.z+1),new W(_.x,_.y+1,_.z+1),new W(_.x,_.y+1,_.z),new W(_.x,_.y,_.z)).setColor(_.color)),(c=(u=n.get(_.x))==null?void 0:u.get(_.y+1))!=null&&c.has(_.z)||i.push(Xe.fromPoints(new W(_.x,_.y+1,_.z+1),new W(_.x+1,_.y+1,_.z+1),new W(_.x+1,_.y+1,_.z),new W(_.x,_.y+1,_.z)).setColor(_.color)),(f=(h=n.get(_.x))==null?void 0:h.get(_.y-1))!=null&&f.has(_.z)||i.push(Xe.fromPoints(new W(_.x,_.y,_.z),new W(_.x+1,_.y,_.z),new W(_.x+1,_.y,_.z+1),new W(_.x,_.y,_.z+1)).setColor(_.color)),(d=(g=n.get(_.x))==null?void 0:g.get(_.y))!=null&&d.has(_.z+1)||i.push(Xe.fromPoints(new W(_.x,_.y,_.z+1),new W(_.x+1,_.y,_.z+1),new W(_.x+1,_.y+1,_.z+1),new W(_.x,_.y+1,_.z+1)).setColor(_.color)),(S=(w=n.get(_.x))==null?void 0:w.get(_.y))!=null&&S.has(_.z-1)||i.push(Xe.fromPoints(new W(_.x,_.y+1,_.z),new W(_.x+1,_.y+1,_.z),new W(_.x+1,_.y,_.z),new W(_.x,_.y,_.z)).setColor(_.color));return console.debug(`Converted ${this.voxels.length} voxels into ${i.length} quads!`),i}getMeshes(){const n=[];let i=new Ae;for(const r of this.quads){const s=r.normal(),a=(s.y*.25+Math.abs(s.z)*.125+.75)/256;r.forEach(o=>o.color=[o.color[0]*a,o.color[1]*a,o.color[2]*a]),i.quads.push(r),i.quadVertices()>65e3&&(n.push(i),i=new Ae)}i.isEmpty()||n.push(i);for(const r of n)r.rebuild(this.gl,{pos:!0,color:!0});return n}draw(n){if(console.debug(`Drawing ${this.meshes.length} meshes...`),this.setShader(this.voxelShaderProgram),this.prepareDraw(n),this.meshes.length===0){this.gl.clearColor(0,0,0,0),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT);return}for(const i of this.meshes)this.drawMesh(i,{pos:!0,color:!0})}}l.NoiseRouter=void 0,(e=>{const t=o=>new V.HolderHolder(l.Holder.parser(l.WorldgenRegistries.DENSITY_FUNCTION,V.fromJson)(o));function n(o){var c;const u=(c=l.Json.readObject(o))!=null?c:{};return{barrier:t(u.barrier),fluidLevelFloodedness:t(u.fluid_level_floodedness),fluidLevelSpread:t(u.fluid_level_spread),lava:t(u.lava),temperature:t(u.temperature),vegetation:t(u.vegetation),continents:t(u.continents),erosion:t(u.erosion),depth:t(u.depth),ridges:t(u.ridges),initialDensityWithoutJaggedness:t(u.initial_density_without_jaggedness),finalDensity:t(u.final_density),veinToggle:t(u.vein_toggle),veinRidged:t(u.vein_ridged),veinGap:t(u.vein_gap)}}e.fromJson=n;function i(o){return{barrier:V.Constant.ZERO,fluidLevelFloodedness:V.Constant.ZERO,fluidLevelSpread:V.Constant.ZERO,lava:V.Constant.ZERO,temperature:V.Constant.ZERO,vegetation:V.Constant.ZERO,continents:V.Constant.ZERO,erosion:V.Constant.ZERO,depth:V.Constant.ZERO,ridges:V.Constant.ZERO,initialDensityWithoutJaggedness:V.Constant.ZERO,finalDensity:V.Constant.ZERO,veinToggle:V.Constant.ZERO,veinRidged:V.Constant.ZERO,veinGap:V.Constant.ZERO,...o}}e.create=i;function r(o,u){return{barrier:o.barrier.mapAll(u),fluidLevelFloodedness:o.fluidLevelFloodedness.mapAll(u),fluidLevelSpread:o.fluidLevelSpread.mapAll(u),lava:o.lava.mapAll(u),temperature:o.temperature.mapAll(u),vegetation:o.vegetation.mapAll(u),continents:o.continents.mapAll(u),erosion:o.erosion.mapAll(u),depth:o.depth.mapAll(u),ridges:o.ridges.mapAll(u),initialDensityWithoutJaggedness:o.initialDensityWithoutJaggedness.mapAll(u),finalDensity:o.finalDensity.mapAll(u),veinToggle:o.veinToggle.mapAll(u),veinRidged:o.veinRidged.mapAll(u),veinGap:o.veinGap.mapAll(u)}}e.mapAll=r;const s=new Map;function a(o,u){var d;const c=(d=u.key())==null?void 0:d.toString();if(!c)throw new Error("Cannot instantiate noise from direct holder");const h=o.seedKey(),f=s.get(c);if(f&&f[0]===h[0]&&f[1]===h[1])return f[2];const g=new lt(o.fromHashOf(c),u.value());return s.set(c,[h[0],h[1],g]),g}e.instantiate=a})(l.NoiseRouter||(l.NoiseRouter={})),l.NoiseSettings=void 0,(e=>{function t(o){var c,h,f,g,d;const u=(c=l.Json.readObject(o))!=null?c:{};return{minY:(h=l.Json.readInt(u.min_y))!=null?h:0,height:(f=l.Json.readInt(u.height))!=null?f:256,xzSize:(g=l.Json.readInt(u.size_horizontal))!=null?g:1,ySize:(d=l.Json.readInt(u.size_vertical))!=null?d:1}}e.fromJson=t;function n(o){return{minY:0,height:256,xzSize:1,ySize:1,...o}}e.create=n;function i(o){return o.ySize<<2}e.cellHeight=i;function r(o){return o.xzSize<<2}e.cellWidth=r;function s(o){return o.height/i(o)}e.cellCountY=s;function a(o){return Math.floor(o.minY/i(o))}e.minCellY=a})(l.NoiseSettings||(l.NoiseSettings={})),l.NoiseSlideSettings=void 0,(e=>{function t(i){var s,a,o,u;const r=(s=l.Json.readObject(i))!=null?s:{};return{target:(a=l.Json.readNumber(r.target))!=null?a:0,size:(o=l.Json.readInt(r.size))!=null?o:0,offset:(u=l.Json.readInt(r.offset))!=null?u:0}}e.fromJson=t;function n(i,r,s){if(i.size<=0)return r;const a=(s-i.offset)/i.size;return di(i.target,r,a)}e.apply=n})(l.NoiseSlideSettings||(l.NoiseSlideSettings={})),l.VerticalAnchor=void 0,(e=>{function t(s){var o,u,c,h;const a=(o=l.Json.readObject(s))!=null?o:{};return a.absolute!==void 0?n((u=l.Json.readNumber(a.absolute))!=null?u:0):a.above_bottom!==void 0?i((c=l.Json.readNumber(a.above_bottom))!=null?c:0):a.below_top!==void 0?r((h=l.Json.readNumber(a.below_top))!=null?h:0):()=>0}e.fromJson=t;function n(s){return()=>s}e.absolute=n;function i(s){return a=>a.minY+s}e.aboveBottom=i;function r(s){return a=>a.minY+a.height-1-s}e.belowTop=r})(l.VerticalAnchor||(l.VerticalAnchor={}));class ha{constructor(t,n,i){p(this,"surfaceNoise");p(this,"surfaceSecondaryNoise");p(this,"random");p(this,"positionalRandoms");this.rule=t,this.defaultBlock=n,this.random=te.create(i).forkPositional(),this.surfaceNoise=l.NoiseRouter.instantiate(this.random,l.WorldgenRegistries.SURFACE_NOISE),this.surfaceSecondaryNoise=l.NoiseRouter.instantiate(this.random,l.WorldgenRegistries.SURFACE_SECONDARY_NOISE),this.positionalRandoms=new Map}buildSurface(t,n,i,r){const s=l.ChunkPos.minBlockX(t.pos),a=l.ChunkPos.minBlockZ(t.pos),o=new ua(this,t,n,i,r),u=this.rule(o);for(let c=0;c<16;c+=1){const h=s+c;for(let f=0;f<1;f+=1){const g=a+f;o.updateXZ(h,g);let d=0,w=Number.MIN_SAFE_INTEGER,S=Number.MAX_SAFE_INTEGER;for(let _=t.maxY;_>=t.minY;_-=1){const E=l.BlockPos.create(h,_,g),A=t.getBlockState(E);if(A.equals($.AIR)){d=0,w=Number.MIN_SAFE_INTEGER;continue}if(A.isFluid()){w===Number.MIN_SAFE_INTEGER&&(w=_+1);continue}if(S>=_){S=Number.MIN_SAFE_INTEGER;for(let R=_-1;R>=t.minY;R-=1){const O=t.getBlockState(l.BlockPos.create(h,R,g));if(O.equals($.AIR)||O.isFluid()){S=R+1;break}}}d+=1;const N=_-S+1;if(!A.equals(this.defaultBlock))continue;o.updateY(d,N,w,_);const v=u(h,_,g);v&&t.setBlockState(E,v)}}}}getSurfaceDepth(t,n){const i=this.surfaceNoise.sample(t,0,n),r=this.random.at(t,0,n).nextDouble()*.25;return i*2.75+3+r}getSurfaceSecondary(t,n){return this.surfaceSecondaryNoise.sample(t,0,n)}getRandom(t){return Mt(this.positionalRandoms,t,()=>this.random.fromHashOf(t))}}class ua{constructor(t,n,i,r,s){p(this,"blockX",0);p(this,"blockY",0);p(this,"blockZ",0);p(this,"stoneDepthAbove",0);p(this,"stoneDepthBelow",0);p(this,"surfaceDepth",0);p(this,"waterHeight",0);p(this,"biome",()=>"");p(this,"surfaceSecondary",()=>0);p(this,"minSurfaceLevel",()=>0);this.system=t,this.chunk=n,this.noiseChunk=i,this.context=r,this.getBiome=s}updateXZ(t,n){this.blockX=t,this.blockZ=n,this.surfaceDepth=this.system.getSurfaceDepth(t,n),this.surfaceSecondary=fn(()=>this.system.getSurfaceSecondary(t,n)),this.minSurfaceLevel=fn(()=>this.calculateMinSurfaceLevel(t,n))}updateY(t,n,i,r){this.blockY=r,this.stoneDepthAbove=t,this.stoneDepthBelow=n,this.waterHeight=i,this.biome=fn(()=>this.getBiome(l.BlockPos.create(this.blockX,this.blockY,this.blockZ)))}calculateMinSurfaceLevel(t,n){const i=t>>4,r=n>>4,s=this.noiseChunk.getPreliminarySurfaceLevel(i<<4,r<<4),a=this.noiseChunk.getPreliminarySurfaceLevel(i+1<<4,r<<4),o=this.noiseChunk.getPreliminarySurfaceLevel(i<<4,r+1<<4),u=this.noiseChunk.getPreliminarySurfaceLevel(i+1<<4,r+1<<4);return Math.floor(fi((t&15)/16,(n&15)/16,s,a,o,u))+this.surfaceDepth-8}}l.SurfaceRule=void 0,(e=>{e.NOOP=()=>()=>{};function t(s){var u,c,h;const a=(u=l.Json.readObject(s))!=null?u:{};switch((c=l.Json.readString(a.type))==null?void 0:c.replace(/^minecraft:/,"")){case"block":return n($.fromJson(a.result_state));case"sequence":return i((h=l.Json.readArray(a.sequence,e.fromJson))!=null?h:[]);case"condition":return r(l.SurfaceCondition.fromJson(a.if_true),e.fromJson(a.then_run))}return e.NOOP}e.fromJson=t;function n(s){return()=>()=>s}e.block=n;function i(s){return a=>{const o=s.map(u=>u(a));return(u,c,h)=>{for(const f of o){const g=f(u,c,h);if(g)return g}}}}e.sequence=i;function r(s,a){return o=>(u,c,h)=>{if(s(o))return a(o)(u,c,h)}}e.condition=r})(l.SurfaceRule||(l.SurfaceRule={})),l.SurfaceCondition=void 0,(e=>{e.FALSE=()=>!1,e.TRUE=()=>!0;function t(c){var g,d,w,S,_,E,A,N,v,R,O,k;const h=(g=l.Json.readObject(c))!=null?g:{};switch((d=l.Json.readString(h.type))==null?void 0:d.replace(/^minecraft:/,"")){case"above_preliminary_surface":return n();case"biome":return i((w=l.Json.readArray(h.biome_is,T=>{var C;return(C=l.Json.readString(T))!=null?C:""}))!=null?w:[]);case"not":return r(e.fromJson(h.invert));case"stone_depth":return s((S=l.Json.readInt(h.offset))!=null?S:0,(_=l.Json.readBoolean(h.add_surface_depth))!=null?_:!1,(E=l.Json.readInt(h.secondary_depth_range))!=null?E:0,l.Json.readString(h.surface_type)==="ceiling");case"vertical_gradient":return a((A=l.Json.readString(h.random_name))!=null?A:"",l.VerticalAnchor.fromJson(h.true_at_and_below),l.VerticalAnchor.fromJson(h.false_at_and_above));case"water":return o((N=l.Json.readInt(h.offset))!=null?N:0,(v=l.Json.readInt(h.surface_depth_multiplier))!=null?v:0,(R=l.Json.readBoolean(h.add_surface_depth))!=null?R:!1);case"y_above":return u(l.VerticalAnchor.fromJson(h.anchor),(O=l.Json.readInt(h.surface_depth_multiplier))!=null?O:0,(k=l.Json.readBoolean(h.add_surface_depth))!=null?k:!1)}return e.FALSE}e.fromJson=t;function n(){return c=>c.blockY>=c.minSurfaceLevel()}e.abovePreliminarySurface=n;function i(c){const h=new Set(c);return f=>h.has(f.biome())}e.biome=i;function r(c){return h=>!c(h)}e.not=r;function s(c,h,f,g){return d=>{const w=g?d.stoneDepthBelow:d.stoneDepthAbove,S=h?d.surfaceDepth:0,_=f===0?0:Gn(d.surfaceSecondary(),-1,1,0,f);return w<=1+c+S+_}}e.stoneDepth=s;function a(c,h,f){return g=>{const d=h(g.context),w=f(g.context);if(g.blockY<=d)return!0;if(g.blockY>=w)return!1;const S=g.system.getRandom(c),_=Gn(g.blockY,d,w,1,0);return S.nextFloat()<_}}e.verticalGradient=a;function o(c,h,f){return g=>{if(g.waterHeight===Number.MIN_SAFE_INTEGER)return!0;const d=f?g.stoneDepthAbove:0;return g.blockY+d>=g.waterHeight+c+g.surfaceDepth*h}}e.water=o;function u(c,h,f){return g=>{const d=f?g.stoneDepthAbove:0;return g.blockY+d>=c(g.context)+g.surfaceDepth*h}}e.yAbove=u})(l.SurfaceCondition||(l.SurfaceCondition={})),l.NoiseGeneratorSettings=void 0,(e=>{function t(i){var s,a,o,u,c,h;const r=(s=l.Json.readObject(i))!=null?s:{};return{surfaceRule:l.SurfaceRule.fromJson(r.surface_rule),noise:l.NoiseSettings.fromJson(r.noise),defaultBlock:$.fromJson(r.default_block),defaultFluid:$.fromJson(r.default_fluid),noiseRouter:l.NoiseRouter.fromJson(r.noise_router),seaLevel:(a=l.Json.readInt(r.sea_level))!=null?a:0,disableMobGeneration:(o=l.Json.readBoolean(r.disable_mob_generation))!=null?o:!1,aquifersEnabled:(u=l.Json.readBoolean(r.aquifers_enabled))!=null?u:!1,oreVeinsEnabled:(c=l.Json.readBoolean(r.ore_veins_enabled))!=null?c:!1,legacyRandomSource:(h=l.Json.readBoolean(r.legacy_random_source))!=null?h:!1}}e.fromJson=t;function n(i){return{surfaceRule:l.SurfaceRule.NOOP,noise:l.NoiseSettings.create({}),defaultBlock:$.STONE,defaultFluid:$.WATER,noiseRouter:l.NoiseRouter.create({}),seaLevel:0,disableMobGeneration:!1,aquifersEnabled:!1,oreVeinsEnabled:!1,legacyRandomSource:!1,...i}}e.create=n})(l.NoiseGeneratorSettings||(l.NoiseGeneratorSettings={})),l.WorldgenRegistries=void 0,(e=>{e.NOISE=oe.createAndRegister("worldgen/noise",l.NoiseParameters.fromJson),e.DENSITY_FUNCTION=oe.createAndRegister("worldgen/density_function",n=>V.fromJson(n)),e.NOISE_SETTINGS=oe.createAndRegister("worldgen/noise_settings",l.NoiseGeneratorSettings.fromJson),e.BIOME=oe.createAndRegister("worldgen/biome"),e.SURFACE_NOISE=t("surface",-6,[1,1,1]),e.SURFACE_SECONDARY_NOISE=t("surface_secondary",-6,[1,1,0,1]);function t(n,i,r){return e.NOISE.register(G.create(n),l.NoiseParameters.create(i,r),!0)}})(l.WorldgenRegistries||(l.WorldgenRegistries={}));class V{minValue(){return-this.maxValue()}mapAll(t){return t.map(this)}}(e=>{function t(ie,y,b){return{x:ie,y,z:b}}e.context=t;class n extends e{constructor(y){super(),this.input=y}compute(y){return this.transform(y,this.input.compute(y))}}const i=l.Holder.parser(l.WorldgenRegistries.NOISE,l.NoiseParameters.fromJson);function r(ie,y=r){var D,H,Q,We,Ve,xe,de,ge,_e,Ot,hn,un,Zn,Yn,Er,pr,br,ga,_a,ma;if(typeof ie=="string")return new a(l.Holder.reference(l.WorldgenRegistries.DENSITY_FUNCTION,G.parse(ie)));if(typeof ie=="number")return new s(ie);const b=(D=l.Json.readObject(ie))!=null?D:{},L=(H=l.Json.readString(b.type))==null?void 0:H.replace(/^minecraft:/,"");switch(L){case"blend_alpha":return new o(1,0,1);case"blend_offset":return new o(0,-1/0,1/0);case"beardifier":return new o(0,-1/0,1/0);case"old_blended_noise":return new u((Q=l.Json.readNumber(b.xz_scale))!=null?Q:1,(We=l.Json.readNumber(b.y_scale))!=null?We:1,(Ve=l.Json.readNumber(b.xz_factor))!=null?Ve:80,(xe=l.Json.readNumber(b.y_factor))!=null?xe:160,(de=l.Json.readNumber(b.smear_scale_multiplier))!=null?de:8);case"flat_cache":return new h(y(b.argument));case"interpolated":return new w(y(b.argument));case"cache_2d":return new g(y(b.argument));case"cache_once":return new d(y(b.argument));case"cache_all_in_cell":return new f(y(b.argument));case"noise":return new S((ge=l.Json.readNumber(b.xz_scale))!=null?ge:1,(_e=l.Json.readNumber(b.y_scale))!=null?_e:1,i(b.noise));case"end_islands":return new _;case"weird_scaled_sampler":return new A(y(b.input),l.Json.readEnum(b.rarity_value_mapper,E),i(b.noise));case"shifted_noise":return new N(y(b.shift_x),y(b.shift_y),y(b.shift_z),(Ot=l.Json.readNumber(b.xz_scale))!=null?Ot:1,(hn=l.Json.readNumber(b.y_scale))!=null?hn:1,i(b.noise));case"range_choice":return new v(y(b.input),(un=l.Json.readNumber(b.min_inclusive))!=null?un:0,(Zn=l.Json.readNumber(b.max_exclusive))!=null?Zn:1,y(b.when_in_range),y(b.when_out_of_range));case"shift_a":return new O(i(b.argument));case"shift_b":return new k(i(b.argument));case"shift":return new T(i(b.argument));case"blend_density":return new C(y(b.argument));case"clamp":return new I(y(b.input),(Yn=l.Json.readNumber(b.min))!=null?Yn:0,(Er=l.Json.readNumber(b.max))!=null?Er:1);case"abs":case"square":case"cube":case"half_negative":case"quarter_negative":case"squeeze":return new M(L,y(b.argument));case"add":case"mul":case"min":case"max":return new J(l.Json.readEnum(L,x),y(b.argument1),y(b.argument2));case"spline":return new F(l.CubicSpline.fromJson(b.spline,y));case"constant":return new s((pr=l.Json.readNumber(b.argument))!=null?pr:0);case"y_clamped_gradient":return new ne((br=l.Json.readInt(b.from_y))!=null?br:-4064,(ga=l.Json.readInt(b.to_y))!=null?ga:4062,(_a=l.Json.readNumber(b.from_value))!=null?_a:-4064,(ma=l.Json.readNumber(b.to_value))!=null?ma:4062)}return s.ZERO}e.fromJson=r;const se=class extends e{constructor(y){super(),this.value=y}compute(){return this.value}minValue(){return this.value}maxValue(){return this.value}};let s=se;p(s,"ZERO",new se(0)),p(s,"ONE",new se(1)),e.Constant=s;class a extends e{constructor(y){super(),this.holder=y}compute(y){return this.holder.value().compute(y)}minValue(){return this.holder.value().minValue()}maxValue(){return this.holder.value().maxValue()}}e.HolderHolder=a;class o extends e.Constant{constructor(y,b,L){super(y),this.min=b,this.max=L}minValue(){return this.min}maxValue(){return this.max}}e.ConstantMinMax=o;class u extends e{constructor(y,b,L,D,H,Q){super(),this.xzScale=y,this.yScale=b,this.xzFactor=L,this.yFactor=D,this.smearScaleMultiplier=H,this.blendedNoise=Q}compute(y){var b,L;return(L=(b=this.blendedNoise)==null?void 0:b.sample(y.x,y.y,y.z))!=null?L:0}maxValue(){var y,b;return(b=(y=this.blendedNoise)==null?void 0:y.maxValue)!=null?b:0}}e.OldBlendedNoise=u;class c extends e{constructor(y){super(),this.wrapped=y}minValue(){return this.wrapped.minValue()}maxValue(){return this.wrapped.maxValue()}}class h extends c{constructor(b){super(b);p(this,"lastQuartX");p(this,"lastQuartZ");p(this,"lastValue",0)}compute(b){const L=b.x>>2,D=b.z>>2;return(this.lastQuartX!==L||this.lastQuartZ!==D)&&(this.lastValue=this.wrapped.compute(e.context(L<<2,0,D<<2)),this.lastQuartX=L,this.lastQuartZ=D),this.lastValue}mapAll(b){return b.map(new h(this.wrapped.mapAll(b)))}}e.FlatCache=h;class f extends c{constructor(y){super(y)}compute(y){return this.wrapped.compute(y)}mapAll(y){return y.map(new f(this.wrapped.mapAll(y)))}}e.CacheAllInCell=f;class g extends c{constructor(b){super(b);p(this,"lastBlockX");p(this,"lastBlockZ");p(this,"lastValue",0)}compute(b){const L=b.x,D=b.z;return(this.lastBlockX!==L||this.lastBlockZ!==D)&&(this.lastValue=this.wrapped.compute(b),this.lastBlockX=L,this.lastBlockZ=D),this.lastValue}mapAll(b){return b.map(new g(this.wrapped.mapAll(b)))}}e.Cache2D=g;class d extends c{constructor(b){super(b);p(this,"lastBlockX");p(this,"lastBlockY");p(this,"lastBlockZ");p(this,"lastValue",0)}compute(b){const L=b.x,D=b.y,H=b.z;return(this.lastBlockX!==L||this.lastBlockY!==D||this.lastBlockZ!==H)&&(this.lastValue=this.wrapped.compute(b),this.lastBlockX=L,this.lastBlockY=D,this.lastBlockZ=H),this.lastValue}mapAll(b){return b.map(new d(this.wrapped.mapAll(b)))}}e.CacheOnce=d;class w extends c{constructor(b,L=4,D=4){super(b);p(this,"values");this.cellWidth=L,this.cellHeight=D,this.values=new Map}compute({x:b,y:L,z:D}){const H=this.cellWidth,Q=this.cellHeight,We=(b%H+H)%H/H,Ve=(L%Q+Q)%Q/Q,xe=(D%H+H)%H/H,de=Math.floor(b/H)*H,ge=Math.floor(L/Q)*Q,_e=Math.floor(D/H)*H;return Ys(We,Ve,xe,()=>this.computeCorner(de,ge,_e),()=>this.computeCorner(de+H,ge,_e),()=>this.computeCorner(de,ge+Q,_e),()=>this.computeCorner(de+H,ge+Q,_e),()=>this.computeCorner(de,ge,_e+H),()=>this.computeCorner(de+H,ge,_e+H),()=>this.computeCorner(de,ge+Q,_e+H),()=>this.computeCorner(de+H,ge+Q,_e+H))}computeCorner(b,L,D){return Mt(this.values,`${b} ${L} ${D}`,()=>this.wrapped.compute(e.context(b,L,D)))}mapAll(b){return b.map(new w(this.wrapped.mapAll(b)))}withCellSize(b,L){return new w(this.wrapped,b,L)}}e.Interpolated=w;class S extends e{constructor(y,b,L,D){super(),this.xzScale=y,this.yScale=b,this.noiseData=L,this.noise=D}compute(y){var b,L;return(L=(b=this.noise)==null?void 0:b.sample(y.x*this.xzScale,y.y*this.yScale,y.z*this.xzScale))!=null?L:0}maxValue(){var y,b;return(b=(y=this.noise)==null?void 0:y.maxValue)!=null?b:2}}e.Noise=S;class _ extends e{constructor(b){super();p(this,"islandNoise");const L=new ce(b!=null?b:BigInt(0));L.consume(17292),this.islandNoise=new pe(L)}getHeightValue(b,L){const D=Math.floor(b/2),H=Math.floor(L/2),Q=b%2,We=L%2;let Ve=yt(100-Math.sqrt(b*b+L*L),-100,80);for(let xe=-12;xe<=12;xe+=1)for(let de=-12;de<=12;de+=1){const ge=D+xe,_e=H+de;if(ge*ge+_e*_e<=4096||this.islandNoise.sample2D(ge,_e)>=-.9)continue;const Ot=(Math.abs(ge)*3439+Math.abs(_e)*147)%13+9,hn=Q+xe*2,un=We+de*2,Zn=100-Math.sqrt(hn*hn+un*un)*Ot,Yn=yt(Zn,-100,80);Ve=Math.max(Ve,Yn)}return Ve}compute({x:b,y:L,z:D}){return(this.getHeightValue(Math.floor(b/8),Math.floor(D/8))-8)/128}minValue(){return-.84375}maxValue(){return .5625}}e.EndIslands=_;const E=["type_1","type_2"],le=class extends n{constructor(b,L,D,H){super(b);p(this,"mapper");this.rarityValueMapper=L,this.noiseData=D,this.noise=H,this.mapper=le.ValueMapper[this.rarityValueMapper]}transform(b,L){if(!this.noise)return 0;const D=this.mapper(L);return D*Math.abs(this.noise.sample(b.x/D,b.y/D,b.z/D))}mapAll(b){return b.map(new le(this.input.mapAll(b),this.rarityValueMapper,this.noiseData,this.noise))}minValue(){return 0}maxValue(){return this.rarityValueMapper==="type_1"?2:3}static rarityValueMapper1(b){return b<-.5?.75:b<0?1:b<.5?1.5:2}static rarityValueMapper2(b){return b<-.75?.5:b<-.5?.75:b<.5?1:b<.75?2:3}};let A=le;p(A,"ValueMapper",{type_1:le.rarityValueMapper1,type_2:le.rarityValueMapper2}),e.WeirdScaledSampler=A;class N extends S{constructor(y,b,L,D,H,Q,We){super(D,H,Q,We),this.shiftX=y,this.shiftY=b,this.shiftZ=L}compute(y){var H,Q;const b=y.x*this.xzScale+this.shiftX.compute(y),L=y.y*this.yScale+this.shiftY.compute(y),D=y.z*this.xzScale+this.shiftZ.compute(y);return(Q=(H=this.noise)==null?void 0:H.sample(b,L,D))!=null?Q:0}mapAll(y){return y.map(new N(this.shiftX.mapAll(y),this.shiftY.mapAll(y),this.shiftZ.mapAll(y),this.xzScale,this.yScale,this.noiseData,this.noise))}}e.ShiftedNoise=N;class v extends e{constructor(y,b,L,D,H){super(),this.input=y,this.minInclusive=b,this.maxExclusive=L,this.whenInRange=D,this.whenOutOfRange=H}compute(y){const b=this.input.compute(y);return this.minInclusive<=b&&bMath.abs(b),square:b=>b*b,cube:b=>b*b*b,half_negative:b=>b>0?b:b*.5,quarter_negative:b=>b>0?b:b*.25,squeeze:b=>{const L=yt(b,-1,1);return L/2-L*L*L/24}}),e.Mapped=M;const x=["add","mul","min","max"];class J extends e{constructor(y,b,L,D,H){super(),this.type=y,this.argument1=b,this.argument2=L,this.min=D,this.max=H}compute(y){const b=this.argument1.compute(y);switch(this.type){case"add":return b+this.argument2.compute(y);case"mul":return b===0?0:b*this.argument2.compute(y);case"min":return bthis.argument2.maxValue()?b:Math.max(b,this.argument2.compute(y))}}mapAll(y){return y.map(new J(this.type,this.argument1.mapAll(y),this.argument2.mapAll(y)))}minValue(){var y;return(y=this.min)!=null?y:-1/0}maxValue(){var y;return(y=this.max)!=null?y:1/0}withMinMax(){const y=this.argument1.minValue(),b=this.argument2.minValue(),L=this.argument1.maxValue(),D=this.argument2.maxValue();(this.type==="min"||this.type==="max")&&(y>=D||b>=L)&&console.warn(`Creating a ${this.type} function between two non-overlapping inputs`);let H,Q;switch(this.type){case"add":H=y+b,Q=L+D;break;case"mul":H=y>0&&b>0?y*b||0:L<0&&D<0?L*D||0:Math.min(y*D||0,b*L||0),Q=y>0&&b>0?L*D||0:L<0&&D<0?y*b||0:Math.max(y*b||0,L*D||0);break;case"min":H=Math.min(y,b),Q=Math.min(L,D);break;case"max":H=Math.max(y,b),Q=Math.max(L,D);break}return new J(this.type,this.argument1,this.argument2,H,Q)}}e.Ap2=J;class F extends e{constructor(y){super(),this.spline=y}compute(y){return this.spline.compute(y)}mapAll(y){const b=this.spline.mapAll(L=>L instanceof e?L.mapAll(y):L);return b.calculateMinMax(),y.map(new F(b))}minValue(){return this.spline.min()}maxValue(){return this.spline.max()}}e.Spline=F;class ne extends e{constructor(y,b,L,D){super(),this.fromY=y,this.toY=b,this.fromValue=L,this.toValue=D}compute(y){return sr(y.y,this.fromY,this.toY,this.fromValue,this.toValue)}minValue(){return Math.min(this.fromValue,this.toValue)}maxValue(){return Math.max(this.fromValue,this.toValue)}}e.YClampedGradient=ne})(V||(V={}));class Un{constructor(t,n){this.level=t,this.type=n}at(t){return t{function t(n){return{compute({x:i,y:r,z:s},a){if(!(a>0))return n(i,r,s).at(r)}}}e.createDisabled=t})(l.Aquifer||(l.Aquifer={}));const De=class{constructor(t,n,i,r,s,a,o){p(this,"minGridX");p(this,"minGridY");p(this,"minGridZ");p(this,"gridSizeX");p(this,"gridSizeZ");p(this,"gridSize");p(this,"aquiferCache");p(this,"aquiferLocationCache");this.noiseChunk=t,this.router=i,this.random=r,this.globalFluidPicker=o,this.minGridX=this.gridX(l.ChunkPos.minBlockX(n))-1,this.gridSizeX=this.gridX(l.ChunkPos.maxBlockX(n))+1-this.minGridX+1,this.minGridY=this.gridY(s)-1,this.minGridZ=this.gridZ(l.ChunkPos.minBlockZ(n))-1,this.gridSizeZ=this.gridZ(l.ChunkPos.maxBlockZ(n))+1-this.minGridZ+1;const u=this.gridY(s+a)+1-this.minGridY+1;this.gridSize=this.gridSizeX*u*this.gridSizeZ,this.aquiferCache=Array(this.gridSize).fill(void 0),this.aquiferLocationCache=Array(this.gridSize).fill(l.BlockPos.ZERO)}compute({x:t,y:n,z:i},r){if(r<=0){if(this.globalFluidPicker(t,n,i).at(n).is($.LAVA))return $.LAVA;{const s=this.gridX(t-5),a=this.gridY(n+1),o=this.gridZ(i-5);let u=Number.MAX_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER,f=l.BlockPos.ZERO,g=l.BlockPos.ZERO,d=l.BlockPos.ZERO;for(let R=0;R<=1;R+=1)for(let O=-1;O<=1;O+=1)for(let k=0;k<=1;k+=1){const T=this.getLocation(s+R,a+O,o+k),C=l.BlockPos.magnitude(T);u>=C?(d=g,g=f,f=T,h=c,c=u,u=C):c>=C?(d=g,g=T,h=c,c=C):h>=C&&(d=T,h=C)}const w=this.getStatus(f),S=this.getStatus(g),_=this.getStatus(d),E=De.similarity(u,c),A=De.similarity(u,h),N=De.similarity(c,h);let v;if(w.at(n).is($.WATER)&&this.globalFluidPicker(t,n-1,i).at(n-1).is($.LAVA))v=1;else if(E>-1){const R=fn(()=>this.router.barrier.compute(V.context(t,n*.5,i))),O=this.calculatePressure(n,w,S,R),k=this.calculatePressure(n,w,_,R),T=this.calculatePressure(n,S,_,R),C=Math.max(O,k*Math.max(0,A),T*Math.max(N));v=Math.max(0,2*Math.max(0,E)*C)}else v=0;if(r+v<=0)return w.at(n)}}}static similarity(t,n){return 1-Math.abs(n-t)/25}calculatePressure(t,n,i,r){const s=n.at(t),a=i.at(t);if(s.is($.LAVA)&&a.is($.WATER)||s.is($.WATER)&&a.is($.LAVA))return 1;const o=Math.abs(n.level-i.level);if(o===0)return 0;const u=(n.level+i.level)/2,c=t+.5-u,h=o/2-Math.abs(c),f=c>0?h>0?h/1.5:h/2.5:h>-3?(h+3)/3:(h+3)/10;return f<-2||f>2?f:f+r()}getStatus(t){const[n,i,r]=t,s=this.getIndex(this.gridX(n),this.gridY(i),this.gridZ(r)),a=this.aquiferCache[s];if(a!==void 0)return a;const o=this.computeStatus(n,i,r);return this.aquiferCache[s]=o,o}computeStatus(t,n,i){const r=this.globalFluidPicker(t,n,i);let s=Number.MAX_SAFE_INTEGER,a=!1;for(const[w,S]of De.SURFACE_SAMPLING){const _=t+(S<<4),E=i+(S<<4),A=this.noiseChunk.getPreliminarySurfaceLevel(_,E);s=Math.min(s,A);const N=w===0&&S===0;if(N&&n-12>A+8)return r;if(N||n+12>A+8){const v=this.globalFluidPicker(_,A+8,E);if(!v.at(A+8).is($.AIR)){if(N)return v;a=!0}}}const o=a?sr(s+8-n,0,64,1,0):0,u=yt(this.router.fluidLevelFloodedness.compute(V.context(t,n*.67,i)),-1,1);if(u>Gn(o,1,0,-.3,.8))return r;if(u<=Gn(o,1,0,-.8,.4))return new Un(Number.MIN_SAFE_INTEGER,r.type);const c=Math.floor(n/40),h=this.router.fluidLevelSpread.compute(V.context(Math.floor(t/16),c,Math.floor(i/16))),f=c*40+20+Math.floor(h/3)*3,g=Math.min(s,f),d=this.getFluidType(t,n,i,r.type,f);return new Un(g,d)}getFluidType(t,n,i,r,s){if(s<=-10){const a=this.router.lava.compute(V.context(Math.floor(t/64),Math.floor(n/40),Math.floor(i/64)));if(Math.abs(a)>.3)return $.LAVA}return r}getLocation(t,n,i){const r=this.getIndex(t,n,i),s=this.aquiferLocationCache[r];if(l.BlockPos.equals(s,l.BlockPos.ZERO))return s;const a=this.random.at(t,n,i),o=l.BlockPos.create(t*De.X_SPACING+a.nextInt(10),n*De.Y_SPACING+a.nextInt(9),i*De.Z_SPACING+a.nextInt(10));return this.aquiferLocationCache[r]=o,o}getIndex(t,n,i){const r=t-this.minGridX,s=n-this.minGridY,a=i-this.minGridZ,o=(s*this.gridSizeZ+a)*this.gridSizeX+r;if(o<0||o>=this.gridSize)throw new Error(`Invalid aquifer index at ${t} ${n} ${i}: 0 <= ${o} < ${this.gridSize}`);return o}gridX(t){return Math.floor(t/De.X_SPACING)}gridY(t){return Math.floor(t/De.Y_SPACING)}gridZ(t){return Math.floor(t/De.Z_SPACING)}};let Wt=De;p(Wt,"X_SPACING",16),p(Wt,"Y_SPACING",12),p(Wt,"Z_SPACING",16),p(Wt,"SURFACE_SAMPLING",[[-2,-1],[-1,-1],[0,-1],[1,-1],[-3,0],[-2,0],[-1,0],[0,0],[1,0],[-2,1],[-1,1],[0,1],[1,1]]);class yi{constructor(t,n){p(this,"n");if(this.shift=t,this.biomes=n,n.length===0)throw new Error("Cannot create checkerboard biome source without biomes");this.n=n.length}getBiome(t,n,i){const r=(((t>>this.shift)+(i>>this.shift))%this.n+this.n)%this.n;return G.parse(this.biomes[r].toString())}static fromJson(t){var s,a,o;const n=(s=l.Json.readObject(t))!=null?s:{},i=(a=l.Json.readInt(n.scale))!=null?a:2;let r;return typeof n.biomes=="string"?r=[G.parse(n.biomes)]:r=(o=l.Json.readArray(n.biomes,u=>{var c;return G.parse((c=l.Json.readString(u))!=null?c:"")}))!=null?o:[],new yi(i+2,r)}}class sn{constructor(t){this.biome=t}getBiome(){return this.biome}static fromJson(t){var r,s;const n=(r=l.Json.readObject(t))!=null?r:{},i=G.parse((s=l.Json.readString(n.biome))!=null?s:"plains");return new sn(i)}}l.Climate=void 0,(e=>{function n(S,_,E,A,N,v){return new o(S,_,E,A,N,v)}e.target=n;function i(S,_,E,A,N,v,R){return new a(r(S),r(_),r(E),r(A),r(N),r(v),R)}e.parameters=i;function r(S,_){return typeof S=="number"?new s(S,_!=null?_:S):S}e.param=r;class s{constructor(_,E){this.min=_,this.max=E}distance(_){const E=(typeof _=="number"?_:_.min)-this.max,A=this.min-(typeof _=="number"?_:_.max);return E>0?E:Math.max(A,0)}union(_){return new s(Math.min(this.min,_.min),Math.max(this.max,_.max))}static fromJson(_){var N;if(typeof _=="number")return new s(_,_);const[E,A]=(N=l.Json.readArray(_,v=>l.Json.readNumber(v)))!=null?N:[];return new s(E!=null?E:0,A!=null?A:0)}}e.Param=s;class a{constructor(_,E,A,N,v,R,O){this.temperature=_,this.humidity=E,this.continentalness=A,this.erosion=N,this.depth=v,this.weirdness=R,this.offset=O}fittness(_){return at(this.temperature.distance(_.temperature))+at(this.humidity.distance(_.humidity))+at(this.continentalness.distance(_.continentalness))+at(this.erosion.distance(_.erosion))+at(this.depth.distance(_.depth))+at(this.weirdness.distance(_.weirdness))+at(this.offset-_.offset)}space(){return[this.temperature,this.humidity,this.continentalness,this.erosion,this.depth,this.weirdness,new s(this.offset,this.offset)]}static fromJson(_){var A,N;const E=(A=l.Json.readObject(_))!=null?A:{};return new a(s.fromJson(E.temperature),s.fromJson(E.humidity),s.fromJson(E.continentalness),s.fromJson(E.erosion),s.fromJson(E.depth),s.fromJson(E.weirdness),(N=l.Json.readNumber(E.offset))!=null?N:0)}}e.ParamPoint=a;class o{constructor(_,E,A,N,v,R){this.temperature=_,this.humidity=E,this.continentalness=A,this.erosion=N,this.depth=v,this.weirdness=R}get offset(){return 0}toArray(){return[this.temperature,this.humidity,this.continentalness,this.erosion,this.depth,this.weirdness,this.offset]}}e.TargetPoint=o;class u{constructor(_){p(this,"index");this.things=_,this.index=new h(_)}find(_){return this.index.search(_,(E,A)=>E.distance(A))}}e.Parameters=u;class c{constructor(_,E,A,N,v,R){this.temperature=_,this.humidity=E,this.continentalness=A,this.erosion=N,this.depth=v,this.weirdness=R}static fromRouter(_){return new e.Sampler(_.temperature,_.vegetation,_.continents,_.erosion,_.depth,_.ridges)}sample(_,E,A){const N=V.context(_<<2,E<<2,A<<2);return e.target(this.temperature.compute(N),this.humidity.compute(N),this.continentalness.compute(N),this.erosion.compute(N),this.depth.compute(N),this.weirdness.compute(N))}}e.Sampler=c;const w=class{constructor(_){p(this,"root");p(this,"last_leaf",null);if(_.length===0)throw new Error("At least one point is required to build search tree");this.root=w.build(_.map(([E,A])=>new d(E,A)))}static build(_){if(_.length===1)return _[0];if(_.length<=w.CHILDREN_PER_NODE){const v=_.map(R=>{let O=0;for(let k=0;k<7;k+=1){const T=R.space[k];O+=Math.abs((T.min+T.max)/2)}return{key:O,node:R}}).sort((R,O)=>R.key-O.key).map(({node:R})=>R);return new g(v)}let E=1/0,A=-1,N=[];for(let v=0;v<7;++v){_=w.sort(_,v,!1),N=w.bucketize(_);let R=0;for(const O of N)R+=w.area(O.space);E>R&&(E=R,A=v)}return _=w.sort(_,A,!1),N=w.bucketize(_),N=w.sort(N,A,!0),new g(N.map(v=>w.build(v.children)))}static sort(_,E,A){return _.map(N=>{const v=N.space[E],R=(v.min+v.max)/2;return{key:A?Math.abs(R):R,node:N}}).sort((N,v)=>N.key-v.key).map(({node:N})=>N)}static bucketize(_){const E=[];let A=[];const N=Math.pow(10,Math.floor(Math.log(_.length-.01)/Math.log(10)));for(const v of _)A.push(v),!(A.lengthnew s(1/0,-1/0));for(const A of _)E=[...Array(7)].map((N,v)=>E[v].union(A.space[v]));return E}search(_,E,A){let N=E?A(E,_):1/0,v=E;for(const R of this.children){const O=A(R,_);if(N<=O)continue;const k=R.search(_,v,A);if(k===null)continue;const T=R==k?O:A(k,_);if(T===0)return k;N<=T||(N=T,v=k)}return v}}e.RSubTree=g;class d extends f{constructor(_,E){super(_.space()),this.thing=E}search(){return this}}e.RLeaf=d})(l.Climate||(l.Climate={}));class ki{constructor(t){p(this,"parameters");this.parameters=new l.Climate.Parameters(t)}getBiome(t,n,i,r){const s=r.sample(t,n,i);return this.parameters.find(s)}static fromJson(t){var s,a;const n=(s=l.Json.readObject(t))!=null?s:{},r=((a=l.Json.readArray(n.biomes,o=>{var u;return(c=>{var h;return{biome:G.parse((h=l.Json.readString(c.biome))!=null?h:"plains"),parameters:l.Climate.ParamPoint.fromJson(c.parameters)}})((u=l.Json.readObject(o))!=null?u:{})}))!=null?a:[]).map(o=>[o.parameters,()=>o.biome]);return new ki(r)}}const It=class{getBiome(t,n,i,r){const s=t<<2,a=n<<2,o=i<<2,u=s>>4,c=o>>4;if(u*u+c*c<=4096)return It.END;const h=V.context((u*2+1)*8,a,(c*2+1)*8),f=r.erosion.compute(h);return f>.25?It.HIGHLANDS:f>=-.0625?It.MIDLANDS:f>=-.21875?It.BARRENS:It.ISLANDS}static fromJson(t){return new It}};let Rt=It;p(Rt,"END",G.create("the_end")),p(Rt,"HIGHLANDS",G.create("end_highlands")),p(Rt,"MIDLANDS",G.create("end_midlands")),p(Rt,"ISLANDS",G.create("small_end_islands")),p(Rt,"BARRENS",G.create("end_barrens")),l.BiomeSource=void 0,(e=>{function t(i){var a,o;const r=(a=l.Json.readObject(i))!=null?a:{};switch((o=l.Json.readString(r.type))==null?void 0:o.replace(/^minecraft:/,"")){case"fixed":return sn.fromJson(i);case"checkerboard":return yi.fromJson(i);case"multi_noise":return ki.fromJson(i);case"the_end":return Rt.fromJson(i);default:return new sn(G.create("plains"))}}e.fromJson=t;function n(i,r,s,a,o,u,c,h,f=1,g=!1){if(i instanceof sn)return u(i.getBiome())?g?{pos:l.BlockPos.create(r,s,a),biome:i.getBiome()}:{pos:l.BlockPos.create(r-o+c.nextInt(o*2+1),s,a-o+c.nextInt(o*2+1)),biome:i.getBiome()}:void 0;const d=r>>2,w=a>>2,S=o>>2,_=s>>2;for(var E=void 0,A=0,N=g?0:S,v=N;v<=S;v+=f)for(var R=-v;R<=v;R+=f){const k=Math.abs(R)===v;for(var O=-v;O<=v;O+=f){if(g&&!(Math.abs(O)===v)&&!k)continue;const T=d+O,C=w+R,I=i.getBiome(T,_,C,h);if(u(I)){if((E===void 0||c.nextInt(A+1)<=.5)&&(E={pos:l.BlockPos.create(T<<2,s,C<<2),biome:I},g))return E;A++}}}return E}e.findBiomeHorizontal=n})(l.BiomeSource||(l.BiomeSource={})),l.Heightmap=void 0,(e=>{function t(n){if(typeof n=="string"&&(n==="WORLD_SURFACE_WG"||n==="WORLD_SURFACE"||n==="OCEAN_FLOOR_WG"||n==="OCEAN_FLOOR"||n==="MOTION_BLOCKING"||n==="MOTION_BLOCKING_NO_LEAVES"))return n}e.fromJson=t})(l.Heightmap||(l.Heightmap={})),l.HeightProvider=void 0,(e=>{function t(u){var f,g,d;const c=(f=l.Json.readObject(u))!=null?f:{};switch((g=l.Json.readString(c.type))==null?void 0:g.replace(/^minecraft:/,"")){case void 0:return n(l.VerticalAnchor.fromJson(u));case"constant":return n(l.VerticalAnchor.fromJson(c.value));case"uniform":return i(l.VerticalAnchor.fromJson(c.min_inclusive),l.VerticalAnchor.fromJson(c.max_inclusive));case"biased_to_bottom":return r(l.VerticalAnchor.fromJson(c.min_inclusive),l.VerticalAnchor.fromJson(c.max_inclusive),l.Json.readInt(c.inner));case"very_biased_to_bottom":return s(l.VerticalAnchor.fromJson(c.min_inclusive),l.VerticalAnchor.fromJson(c.max_inclusive),l.Json.readInt(c.inner));case"trapezoid":return a(l.VerticalAnchor.fromJson(c.min_inclusive),l.VerticalAnchor.fromJson(c.max_inclusive),l.Json.readInt(c.plateau));case"weighted_list":return o((d=l.Json.readArray(c.distribution,w=>{var _,E;const S=(_=l.Json.readObject(w))!=null?_:{};return{weight:(E=l.Json.readInt(S.weight))!=null?E:1,data:t(S.data)}}))!=null?d:[])}return()=>0}e.fromJson=t;function n(u){return(c,h)=>u(h)}e.constant=n;function i(u,c){return(h,f)=>{const g=u(f),d=c(f);return g>d?g:h.nextInt(d-g+1)+g}}e.uniform=i;function r(u,c,h=1){return(f,g)=>{const d=u(g),w=c(g);if(w-d-h+1<=0)return d;{const S=f.nextInt(w-d-h+1);return f.nextInt(S+h)+d}}}e.biased_to_bottom=r;function s(u,c,h=1){return(f,g)=>{const d=u(g),w=c(g);if(w-d-h+1<=0)return d;{const S=wi(f,d+h,w),_=wi(f,d,S-1);return wi(f,d,_-1+h)}}}e.very_biased_to_bottom=s;function a(u,c,h=0){return(f,g)=>{const d=u(g),w=c(g);if(d>w)return d;{const S=w-d;if(h>=S)return mi(f,d,w);{const _=(S-h)/2,E=S-_;return d+mi(f,0,E)+mi(f,0,_)}}}}e.trapezoid=a;function o(u){const c=u.reduce((h,f,g)=>h+f.weight,0);return(h,f)=>{let g=h.nextInt(c);for(const d of u)if(g-=d.weight,g<=0)return d.data(h,f);return 0}}e.weighted_list=o})(l.HeightProvider||(l.HeightProvider={}));class wr{constructor(t,n,i,r,s,a,o,u,c){p(this,"cellWidth");p(this,"cellHeight");p(this,"firstCellX");p(this,"firstCellZ");p(this,"firstNoiseX");p(this,"firstNoiseZ");p(this,"noiseSizeXZ");p(this,"preliminarySurfaceLevel",new Map);p(this,"aquifer");p(this,"materialRule");p(this,"initialDensity");this.cellCountXZ=t,this.cellCountY=n,this.cellNoiseMinY=i,this.minX=s,this.minZ=a,this.settings=o,this.cellWidth=l.NoiseSettings.cellWidth(o),this.cellHeight=l.NoiseSettings.cellHeight(o),this.firstCellX=Math.floor(s/this.cellWidth),this.firstCellZ=Math.floor(a/this.cellWidth),this.firstNoiseX=s>>2,this.firstNoiseZ=a>>2,this.noiseSizeXZ=t*this.cellWidth>>2,this.aquifer=l.Aquifer.createDisabled(c);const h=r.router.finalDensity;this.materialRule=l.MaterialRule.fromList([f=>this.aquifer.compute(f,h.compute(f))]),this.initialDensity=r.router.initialDensityWithoutJaggedness}getFinalState(t,n,i){return this.materialRule({x:t,y:n,z:i})}getPreliminarySurfaceLevel(t,n){return Mt(this.preliminarySurfaceLevel,l.ChunkPos.asLong(t,n),()=>{const i=t<<2,r=n<<2;for(let s=this.settings.minY+this.settings.height;s>=this.settings.minY;s-=this.cellHeight)if(this.initialDensity.compute(V.context(i,s,r))>.390625)return s;return Number.MAX_SAFE_INTEGER})}}l.MaterialRule=void 0,(e=>{function t(n){return i=>{for(const r of n){const s=r(i);if(s)return s}}}e.fromList=t})(l.MaterialRule||(l.MaterialRule={}));class fa{constructor(t,n){p(this,"noiseChunkCache");p(this,"globalFluidPicker");this.biomeSource=t,this.settings=n,this.noiseChunkCache=new Map;const i=new Un(-54,$.LAVA),r=new Un(n.seaLevel,n.defaultFluid);this.globalFluidPicker=(s,a,o)=>a!o.equals($.AIR):s=o=>o.equals($.STONE),(a=this.iterateNoiseColumn(r,t,n,void 0,s,$.STONE))!=null?a:this.settings.noise.minY}iterateNoiseColumn(t,n,i,r,s,a){var S,_;const o=this.settings.noise.minY,u=l.NoiseSettings.cellHeight(this.settings.noise),c=Math.floor(o/u),h=Math.floor(this.settings.noise.height/u);if(h<=0)return;const f=l.NoiseSettings.cellWidth(this.settings.noise),g=Math.floor(n/f),d=Math.floor(i/f),w=new wr(1,h,c,t,g,d,this.settings.noise,this.settings.aquifersEnabled,this.globalFluidPicker);for(let E=h-1;E>=0;E-=1)for(let A=u-1;A>=0;A-=1){const N=(c+E)*u+A,v=(_=(S=w.getFinalState(n,N,i))!=null?S:a)!=null?_:this.settings.defaultBlock;if(r!==void 0&&(r[N+o]=v),s!==void 0&&s(v))return N+1}}fill(t,n,i=!1){var w;const r=Math.max(n.minY,this.settings.noise.minY),s=Math.min(n.maxY,this.settings.noise.minY+this.settings.noise.height),a=l.NoiseSettings.cellWidth(this.settings.noise),o=l.NoiseSettings.cellHeight(this.settings.noise),u=Math.floor(16/a),c=Math.floor(r/o),h=Math.floor((s-r)/o),f=l.ChunkPos.minBlockX(n.pos),g=l.ChunkPos.minBlockZ(n.pos),d=this.getOrCreateNoiseChunk(t,n);for(let S=0;S=0;A-=1)for(let N=o-1;N>=0;N-=1){const v=(c+A)*o+N,R=v&15,O=n.getSectionIndex(v);n.getSectionIndex(E.minBlockY)!==O&&(E=n.getOrCreateSection(O));for(let k=0;ki)}computeBiome(t,n,i,r){return this.biomeSource.getBiome(n,i,r,t.sampler)}getOrCreateNoiseChunk(t,n){return Mt(this.noiseChunkCache,l.ChunkPos.toLong(n.pos),()=>{const i=Math.max(n.minY,this.settings.noise.minY),r=Math.min(n.maxY,this.settings.noise.minY+this.settings.noise.height),s=l.NoiseSettings.cellWidth(this.settings.noise),a=l.NoiseSettings.cellHeight(this.settings.noise),o=Math.floor(16/s),u=Math.floor(i/a),c=Math.floor((r-i)/a),h=l.ChunkPos.minBlockX(n.pos),f=l.ChunkPos.minBlockZ(n.pos);return new wr(o,c,u,t,h,f,this.settings.noise,this.settings.aquifersEnabled,this.globalFluidPicker)})}}class da{constructor(t,n){p(this,"noiseCache");p(this,"randomCache");p(this,"random");p(this,"aquiferRandom");p(this,"oreRandom");p(this,"surfaceSystem");p(this,"router");p(this,"sampler");this.seed=n,this.noiseCache=new Map,this.randomCache=new Map,this.random=(t.legacyRandomSource?new ce(n):te.create(n)).forkPositional(),this.aquiferRandom=this.random.fromHashOf(G.create("aquifer").toString()).forkPositional(),this.oreRandom=this.random.fromHashOf(G.create("ore").toString()).forkPositional(),this.surfaceSystem=new ha(t.surfaceRule,t.defaultBlock,n),this.router=l.NoiseRouter.mapAll(t.noiseRouter,this.createVisitor(t.noise,t.legacyRandomSource)),this.sampler=l.Climate.Sampler.fromRouter(this.router)}createVisitor(t,n){const i=new Map,r=a=>{const o=a.key();if(o===void 0)throw new Error("Cannot create noise without key");if(n){if(o.equals(G.create("temperature")))return new lt(new ce(this.seed+BigInt(0)),l.NoiseParameters.create(-7,[1,1]));if(o.equals(G.create("vegetation")))return new lt(new ce(this.seed+BigInt(1)),l.NoiseParameters.create(-7,[1,1]));if(o.equals(G.create("offset")))return new lt(this.random.fromHashOf("offset"),l.NoiseParameters.create(0,[0]))}return this.getOrCreateNoise(o)},s={map:a=>{if(a instanceof V.HolderHolder){const o=a.holder.key();if(o!==void 0&&i.has(o.toString()))return i.get(o.toString());{const u=a.holder.value().mapAll(s);return o!==void 0&&i.set(o.toString(),u),u}}return a instanceof V.Interpolated?a.withCellSize(l.NoiseSettings.cellWidth(t),l.NoiseSettings.cellHeight(t)):a instanceof V.ShiftedNoise?new V.ShiftedNoise(a.shiftX,a.shiftY,a.shiftZ,a.xzScale,a.yScale,a.noiseData,r(a.noiseData)):a instanceof V.Noise?new V.Noise(a.xzScale,a.yScale,a.noiseData,r(a.noiseData)):a instanceof V.ShiftNoise?a.withNewNoise(r(a.noiseData)):a instanceof V.WeirdScaledSampler?new V.WeirdScaledSampler(a.input,a.rarityValueMapper,a.noiseData,r(a.noiseData)):a instanceof V.OldBlendedNoise?new V.OldBlendedNoise(a.xzScale,a.yScale,a.xzFactor,a.yFactor,a.smearScaleMultiplier,new ia(this.random.fromHashOf(G.create("terrain").toString()),a.xzScale,a.yScale,a.xzFactor,a.yFactor,a.smearScaleMultiplier)):a instanceof V.EndIslands?new V.EndIslands(this.seed):a instanceof V.Mapped||a instanceof V.Ap2?a.withMinMax():a}};return s}getOrCreateNoise(t){const n=oe.REGISTRY.getOrThrow(G.create("worldgen/noise"));return Mt(this.noiseCache,t.toString(),i=>new lt(this.random.fromHashOf(i),n.getOrThrow(t)))}getOrCreateRandom(t){return Mt(this.randomCache,t.toString(),n=>this.random.fromHashOf(n).forkPositional())}}class Je{static fromJson(t){var i,r,s,a;const n=(i=l.Json.readObject(t))!=null?i:{};switch((r=l.Json.readString(n.element_type))==null?void 0:r.replace(/^minecraft:/,"")){case"single_pool_element":case"legacy_single_pool_element":const o=G.parse((s=l.Json.readString(n.location))!=null?s:""),u={key:()=>o,value:()=>{var h;return(h=st.REGISTRY.get(o))!=null?h:st.EMPTY}};return new Je.SinlgePoolElement(u);case"list_pool_element":const c=(a=l.Json.readArray("elements",Je.fromJson))!=null?a:[];return new Je.ListPoolElement(c);case"feature_pool_element":return new Je.FeaturePoolElement;case"empty_pool_element":default:return new Je.EmptyPoolElement}}}(e=>{class t extends e{getBoundingBox(o,u){throw new Error("Invalid call of EmptyPoolElement")}getShuffledJigsawBlocks(o,u){return[]}toString(){return"[Empty Pool Element]"}}e.EmptyPoolElement=t;class n extends e{constructor(){super();p(this,"defaultJigsawNBT");const u=new Map;u.set("name",new ke("minecraft:bottom")),u.set("final_state",new ke("minecraft:air")),u.set("pool",new ke("minecraft:empty")),u.set("target",new ke("minecraft:empty")),u.set("joint",new ke("rollable")),this.defaultJigsawNBT=new ue(u)}getBoundingBox(u,c){return[u,u]}getShuffledJigsawBlocks(u,c){return[{pos:[0,0,0],state:new $(G.create("jigsaw"),{orientation:"down_south"}),nbt:this.defaultJigsawNBT}]}toString(){return"[Feature Pool Element]"}}e.FeaturePoolElement=n;const s=class extends e{constructor(o){super(),this.template=o}getBoundingBox(o,u){const c=l.BlockPos.offset(this.template.value().getSize(),-1,-1,-1),h=o,f=l.BlockPos.add(st.transform(c,u,l.BlockPos.ZERO),o),g=l.BlockPos.create(Math.min(h[0],f[0]),h[1],Math.min(h[2],f[2])),d=l.BlockPos.create(Math.max(h[0],f[0]),f[1],Math.max(h[2],f[2]));return[g,d]}getShuffledJigsawBlocks(o,u){const c=this.template.value().getBlocks().filter(h=>h.state.getName().equals(s.JIGSAW_ID));return c.forEach(h=>h.pos=st.transform(h.pos,o,l.BlockPos.ZERO)),qs(c,u),c}toString(){return`[Single Pool Element: ${this.template.key()}]`}};let i=s;p(i,"JIGSAW_ID",G.parse("jigsaw")),e.SinlgePoolElement=i;class r extends e{constructor(o){super(),this.elements=o}getBoundingBox(o,u){var c=void 0,h=void 0;for(const f of this.elements){const g=f.getBoundingBox(o,u);!c||!h?(c=g[0],h=g[1]):(c[0]=Math.min(c[0],g[0][0]),c[1]=Math.min(c[1],g[0][1]),c[2]=Math.min(c[2],g[0][2]),h[0]=Math.min(c[0],g[1][0]),h[1]=Math.min(c[1],g[1][1]),h[2]=Math.min(c[2],g[1][2]))}return[c,h]}getShuffledJigsawBlocks(o,u){return this.elements[0].getShuffledJigsawBlocks(o,u)}toString(){return`[List Pool Element: ${"; ".concat(...this.elements.map(o=>o.toString()))}]`}}e.ListPoolElement=r})(Je||(Je={}));const Kt=class{constructor(t,n){p(this,"totalWeight");this.rawTemplates=t,this.fallback=n,this.totalWeight=t.reduce((i,r)=>i+r.weight,0)}static fromJson(t){var s,a,o;const n=(s=l.Json.readObject(t))!=null?s:{},i=Kt.structurePoolParser((a=n.fallback)!=null?a:""),r=(o=l.Json.readArray(n.elements,u=>{var g,d;const c=(g=l.Json.readObject(u))!=null?g:{},h=Je.fromJson(c.element),f=(d=l.Json.readInt(c.weight))!=null?d:1;return{element:h,weight:f}}))!=null?o:[];return new Kt(r,i)}getRandomTemplate(t){var n=t.nextInt(this.totalWeight);for(const i of this.rawTemplates)if(n-=i.weight,n<0)return i.element;return this.rawTemplates[this.rawTemplates.length-1].element}};let Vt=Kt;p(Vt,"REGISTRY",oe.createAndRegister("worldgen/template_pool",Kt.fromJson)),p(Vt,"structurePoolParser",l.Holder.parser(Kt.REGISTRY,Kt.fromJson));class Ri{constructor(t){this.settings=t}onTopOfChunkCenter(t,n,i,r="WORLD_SURFACE_WG"){const s=(n<<4)+8,a=(i<<4)+8;return[s,t.chunkGenerator.getBaseHeight(s,a,r,t.randomState)-1,a]}getLowestY(t,n,i,r,s){return Math.min(t.chunkGenerator.getBaseHeight(n,i,"WORLD_SURFACE_WG",t.randomState)-1,t.chunkGenerator.getBaseHeight(n,i+s,"WORLD_SURFACE_WG",t.randomState)-1,t.chunkGenerator.getBaseHeight(n+r,i,"WORLD_SURFACE_WG",t.randomState)-1,t.chunkGenerator.getBaseHeight(n+r,i+s,"WORLD_SURFACE_WG",t.randomState)-1)}getLowestYIn5by5BoxOffset7Blocks(t,n,i,r){let s=5,a=5;r===l.Rotation.CLOCKWISE_90?s=-5:r===l.Rotation.CLOCKWISE_180?(s=-5,a=-5):r===l.Rotation.COUNTERCLOCKWISE_90&&(a=-5);const o=(n<<4)+7,u=(i<<4)+7;return l.BlockPos.create(o,this.getLowestY(t,o,u,s,a),u)}tryGenerate(t,n,i){const r=ce.fromLargeFeatureSeed(i.seed,t,n),s=this.findGenerationPoint(t,n,r,i);if(s===void 0)return!1;const a=i.biomeSource.getBiome(s[0]>>2,s[1],s[2]>>2,i.randomState.sampler);return[...this.settings.validBiomes.getEntries()].findIndex(o=>{var u;return(u=o.key())==null?void 0:u.equals(a)})>=0}}(e=>{e.REGISTRY=oe.createAndRegister("worldgen/structure",r);class t{constructor(k){this.validBiomes=k}}e.StructureSettings=t;class n{constructor(k,T,C){p(this,"chunkGenerator");p(this,"randomState");this.seed=k,this.biomeSource=T,this.settings=C,this.randomState=new da(C,k),this.chunkGenerator=new fa(T,C)}}e.GenerationContext=n;const i=l.Holder.parser(Vt.REGISTRY,Vt.fromJson);function r(O){var M,x,J;const k=Nt.parser(l.WorldgenRegistries.BIOME),T=(M=l.Json.readObject(O))!=null?M:{},C=k(T.biomes),I=new t(C.value());switch((x=l.Json.readString(T.type))==null?void 0:x.replace(/^minecraft:/,"")){case"buried_treasure":return new a(I);case"desert_pyramid":return new u(I);case"end_city":return new c(I);case"fortress":return new h(I);case"igloo":return new f(I);case"jigsaw":const F=l.HeightProvider.fromJson(T.start_height),ne=i(T.start_pool),se=l.Json.readString(T.start_jigsaw_name),le=se?G.parse(se):void 0,Se=l.Heightmap.fromJson(T.project_start_to_heightmap);return new s(I,ne,F,Se,le);case"jungle_temple":return new g(I);case"mineshaft":const ie=l.Json.readString(T.mineshaft_type)==="mesa"?"mesa":"normal";return new d(I,ie);case"nether_fossil":return new h(I);case"ocean_monument":return new S(I);case"ocean_ruin":return new _(I);case"ruined_portal":return new E(I);case"shipwreck":const y=(J=l.Json.readBoolean(T.is_beached))!=null?J:!1;return new A(I,y);case"stronghold":return new N(I);case"swamp_hut":return new v(I);case"woodland_mansion":return new R(I)}return new a(I)}e.fromJson=r;class s extends e{constructor(k,T,C,I,M){super(k),this.startingPoolHolder=T,this.startHeight=C,this.projectStartToHeightmap=I,this.startJigsawName=M}findGenerationPoint(k,T,C,I){var M=this.startHeight(C,I.settings.noise);const x=l.BlockPos.create(k<<4,M,T<<4),J=l.Rotation.getRandom(C),ne=this.startingPoolHolder.value().getRandomTemplate(C);if(!(ne instanceof Je.EmptyPoolElement)){var se;if(this.startJigsawName){const D=s.getRandomNamedJigsaw(ne,this.startJigsawName,J,C);if(D===void 0)return;se=D}else se=l.BlockPos.ZERO;const le=l.BlockPos.subtract(x,se),Se=ne.getBoundingBox(le,J),ie=(Se[1][0]+Se[0][0])/2^0,y=(Se[1][2]+Se[0][2])/2^0;var M;return this.projectStartToHeightmap?M=x[1]+I.chunkGenerator.getBaseHeight(ie,y,this.projectStartToHeightmap,I.randomState):M=le[1],l.BlockPos.create(ie,M+se[1],y)}}static getRandomNamedJigsaw(k,T,C,I){var x,J;const M=k.getShuffledJigsawBlocks(C,I);for(const F of M)if(G.parse((J=(x=F.nbt)==null?void 0:x.getString("name"))!=null?J:"minecraft:empty").equals(T))return F.pos}}e.JigsawStructure=s;class a extends e{findGenerationPoint(k,T,C,I){return this.onTopOfChunkCenter(I,k,T,"OCEAN_FLOOR_WG")}}e.BuriedTreasureStructure=a;class o extends e{constructor(k,T,C){super(k),this.width=T,this.depth=C}findGenerationPoint(k,T,C,I){if(!(this.getLowestY(I,k<<4,T<<4,this.width,this.depth)o+u.weight,0);for(;s.length>0;){let o=r.nextInt(a),u,c;for([u,c]of s.entries())if(o-=c.weight,o<0)break;if(c.structure.value().tryGenerate(t,n,i))return c.structure.key();s.splice(u,1),a-=c.weight}}}};let Zt=Vn;p(Zt,"REGISTRY",oe.createAndRegister("worldgen/structure_set",Vn.fromJson)),(e=>{class t{constructor(i,r){this.structure=i,this.weight=r}static fromJson(i){var s,a,o;const r=(s=l.Json.readObject(i))!=null?s:{};return new t(l.Holder.reference(Ri.REGISTRY,G.parse((a=l.Json.readString(r.structure))!=null?a:"minecraft:empty")),(o=l.Json.readInt(r.weight))!=null?o:1)}}e.StructureSelectionEntry=t})(Zt||(Zt={}));class Ge{constructor(t,n,i,r,s){this.locateOffset=t,this.frequencyReductionMethod=n,this.frequency=i,this.salt=r,this.exclusionZone=s}static fromJson(t){var c,h,f,g,d,w,S,_,E,A;const n=(c=l.Json.readObject(t))!=null?c:{},i=(h=l.Json.readString(n.type))==null?void 0:h.replace(/^minecraft:/,""),r=l.BlockPos.fromJson(n.locate_offset),s=Ge.FrequencyReducer.fromType((f=l.Json.readString(n.frequency_reduction_method))!=null?f:"default"),a=(g=l.Json.readNumber(n.frequency))!=null?g:1,o=(d=l.Json.readInt(n.salt))!=null?d:0,u="exclusion_zone"in n?Ge.ExclusionZone.fromJson(n.exclusion_zone):void 0;switch(i){case"random_spread":const N=(w=l.Json.readInt(n.spacing))!=null?w:1,v=(S=l.Json.readInt(n.separation))!=null?S:1,R=Ge.SpreadType.fromJson(n.spread_type);return new Ge.RandomSpreadStructurePlacement(r,s,a,o,u,N,v,R);case"concentric_rings":const O=(_=l.Json.readInt(n.distance))!=null?_:1,k=(E=l.Json.readInt(n.spread))!=null?E:1,T=(A=l.Json.readInt(n.count))!=null?A:1,C=Nt.parser(l.WorldgenRegistries.BIOME)(n.preferred_biomes);return new Ge.ConcentricRingsStructurePlacement(r,s,a,o,u,O,k,T,C)}return new Ge.RandomSpreadStructurePlacement([0,0,0],Ge.FrequencyReducer.ProbabilityReducer,1,0,void 0,1,1,"linear")}isStructureChunk(t,n,i){return this.isPlacementChunk(t,n,i)?this.frequency<1&&!this.frequencyReductionMethod(t,this.salt,n,i,this.frequency)?!1:!(this.exclusionZone&&this.exclusionZone.isPlacementForbidden(t,n,i)):!1}prepare(t,n,i){}}(e=>{(s=>{function a(f){switch(f){case"legacy_type_1":return h;case"legacy_type_2":return c;case"legacy_type_3":return u;case"default":default:return o}}s.fromType=a;function o(f,g,d,w,S){return ce.fromLargeFeatureWithSalt(f,g,d,w).nextFloat()>4,E=w>>4,A=new ce(BigInt(_^E<<4)^f);return A.nextInt(),A.nextInt(Math.floor(1/S))===0}s.LegacyPillagerOutpostReducer=h})(e.FrequencyReducer||(e.FrequencyReducer={}));class t{constructor(a,o){this.otherSet=a,this.chunkCount=o}static fromJson(a){var u,c,h;const o=(u=l.Json.readObject(a))!=null?u:{};return new t(l.Holder.reference(Zt.REGISTRY,G.parse((c=l.Json.readString(o.other_set))!=null?c:"")),(h=l.Json.readInt(o.chunk_count))!=null?h:1)}isPlacementForbidden(a,o,u){const c=this.otherSet.value().placement;return c.getPotentialStructureChunks(a,o-this.chunkCount,u-this.chunkCount,o+this.chunkCount,u+this.chunkCount).findIndex(h=>Math.abs(h[0]-o)<=this.chunkCount&&Math.abs(h[1]-u)<=this.chunkCount&&c.isStructureChunk(a,h[0],h[1]))>=0}}e.ExclusionZone=t,(s=>{function a(o){var c;return((c=l.Json.readString(o))!=null?c:"linear")==="triangular"?"triangular":"linear"}s.fromJson=a})(e.SpreadType||(e.SpreadType={}));class n extends e{constructor(a,o,u,c,h,f,g,d){super(a,o,u,c,h),this.spacing=f,this.separation=g,this.spreadType=d}evaluateSpread(a,o){switch(this.spreadType){case"linear":return a.nextInt(o);case"triangular":return Math.floor((a.nextInt(o)+a.nextInt(o))/2)}}getPotentialStructureChunk(a,o,u){const c=Math.floor(o/this.spacing),h=Math.floor(u/this.spacing),f=ce.fromLargeFeatureWithSalt(a,c,h,this.salt),g=this.spacing-this.separation,d=this.evaluateSpread(f,g),w=this.evaluateSpread(f,g);return[c*this.spacing+d,h*this.spacing+w]}isPlacementChunk(a,o,u){const[c,h]=this.getPotentialStructureChunk(a,o,u);return c===o&&h===u}getPotentialStructureChunks(a,o,u,c,h){const f=[];for(let g=Math.floor(o/this.spacing)*this.spacing;g<=c;g+=this.spacing)for(let d=Math.floor(u/this.spacing)*this.spacing;d<=h;d+=this.spacing)f.push(this.getPotentialStructureChunk(a,g,d));return f}}e.RandomSpreadStructurePlacement=n;const i=112;class r extends e{constructor(o,u,c,h,f,g,d,w,S){super(o,u,c,h,f);p(this,"positions");this.distance=g,this.spread=d,this.count=w,this.preferredBiomes=S}prepare(o,u,c){if(this.positions!==void 0||(this.positions=[],this.count===0))return;const h=new ce(c);var f=h.nextDouble()*Math.PI*2,g=this.spread,d=0,w=0;const S=[...this.preferredBiomes.value().getEntries()].flatMap(E=>{var A;return(A=E.key())!=null?A:[]});for(var _=0;_{const T=l.BiomeSource.findBiomeHorizontal(o,v,0,R,i,C=>S.findIndex(I=>I.equals(C))>=0,O,u);return T?[T.pos[0]>>4,T.pos[2]>>4]:[A,N]};this.positions.push({center:[A,N],real:k}),f+=Math.PI*2/g,w++,w==g&&(d++,w=0,g+=2*g/(d+1),g=Math.min(g,this.count-_),f+=h.nextDouble()*Math.PI*2)}}isPlacementChunk(o,u,c){return this.positions===void 0?(console.warn("trying to access concentric rings placement before position calculation"),!1):this.getPotentialStructureChunks(o,u,c,u,c).findIndex(h=>h[0]===u&&h[1]===c)>=0}getPotentialStructureChunks(o,u,c,h,f){if(this.positions===void 0)return console.warn("trying to access concentric rings placement before position calculation"),[];const g=[];for(const d of this.positions)d.center[0]>4)||d.center[0]>h+(i>>4)||d.center[1]>4)||d.center[1]>f+(i>>4)||(d.real instanceof Function&&(d.real=d.real()),g.push(d.real));return g}}e.ConcentricRingsStructurePlacement=r})(Ge||(Ge={})),l.AttributeModifierOperation=Fe,l.BlendedNoise=ia,l.BlockColors=zn,l.BlockDefinition=vi,l.BlockModel=kt,l.BlockState=$,l.CheckerboardBiomeSource=yi,l.Chunk=wl,l.ChunkBuilder=oa,l.ChunkSection=tn,l.DensityFunction=V,l.FixedBiomeSource=sn,l.FluidStatus=Un,l.HolderSet=Nt,l.Identifier=G,l.ImprovedNoise=gr,l.ItemRenderer=Sh,l.ItemStack=ve,l.LegacyPositionalRandom=ta,l.LegacyRandom=ce,l.Line=Si,l.Matrix3=Hn,l.Matrix4=pi,l.Mesh=Ae,l.MultiNoiseBiomeSource=ki,l.NbtAbstractList=Cn,l.NbtByte=Ke,l.NbtByteArray=pt,l.NbtChunk=rt,l.NbtCompound=ue,l.NbtDouble=At,l.NbtEnd=Mn,l.NbtFile=qe,l.NbtFloat=Ft,l.NbtInt=it,l.NbtIntArray=bt,l.NbtList=ze,l.NbtLong=Jt,l.NbtLongArray=St,l.NbtRegion=vt,l.NbtShort=Ut,l.NbtString=ke,l.NbtTag=j,l.NbtType=B,l.NoiseAquifer=Wt,l.NoiseChunk=wr,l.NoiseChunkGenerator=fa,l.NormalNoise=lt,l.PalettedContainer=Ws,l.PerlinNoise=be,l.PerlinSimplexNoise=oh,l.Quad=Xe,l.RandomState=da,l.RawDataInput=Sr,l.RawDataOutput=vr,l.Registry=oe,l.Renderer=Ni,l.ShaderProgram=Fn,l.SimplexNoise=pe,l.SpecialRenderer=Ai,l.SpecialRenderers=mr,l.StringReader=Me,l.Structure=st,l.StructurePlacement=Ge,l.StructurePoolElement=Je,l.StructureRenderer=kh,l.StructureSet=Zt,l.StructureTemplatePool=Vt,l.SurfaceContext=ua,l.SurfaceSystem=ha,l.TextureAtlas=Jn,l.Vector=W,l.Vertex=Pe,l.VoxelRenderer=Ih,l.WorldgenStructure=Ri,l.XoroshiroPositionalRandom=na,l.XoroshiroRandom=te,l.binarySearch=$s,l.clamp=yt,l.clampedLerp=di,l.clampedMap=sr,l.computeIfAbsent=Mt,l.getItemColor=la,l.getSeed=ar,l.intToRgb=we,l.inverseLerp=rr,l.isPowerOfTwo=or,l.lazy=fn,l.lazyLerp=Pn,l.lazyLerp2=ir,l.lazyLerp3=Ys,l.lerp=ot,l.lerp2=fi,l.lerp3=Zs,l.longfromBytes=_i,l.map=Gn,l.mutateWithDefault=Oi,l.nextInt=wi,l.randomBetweenInclusive=mi,l.shuffle=qs,l.smoothstep=gi,l.square=at,l.upperPowerOfTwo=Ks,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});