define(["./RuntimeError-9b4ce3fb","./defaultValue-f6d5e6da","./createTaskProcessorWorker"],(function(e,t,n){"use strict";const i=1953029805,r=2917034100;function a(t,n){if(a.passThroughDataForTesting)return n;const o=t.byteLength;if(0===o||o%4!=0)throw new e.RuntimeError("The length of key must be greater than 0 and a multiple of 4.");const s=new DataView(n),l=s.getUint32(0,!0);if(l===i||l===r)return n;const c=new DataView(t);let d=0;const f=n.byteLength,h=f-f%8,u=o;let w,b=8;for(;d=u&&(b=(b+8)%24,w=b);d{let r=65535&e|0,a=e>>>16&65535|0,o=0;for(;0!==n;){o=n>2e3?2e3:n,n-=o;do{r=r+t[i++]|0,a=a+r|0}while(--o);r%=65521,a%=65521}return r|a<<16|0};const h=new Uint32Array((()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t})());var u=(e,t,n,i)=>{const r=h,a=i+n;e^=-1;for(let n=i;n>>8^r[255&(e^t[n])];return-1^e};const w=16209;const b=15,m=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),g=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),k=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),_=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var p={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 y=f,v=u,E=function(e,t){let n,i,r,a,o,s,l,c,d,f,h,u,b,m,g,k,_,p,y,v,E,x,R,A;const T=e.state;n=e.next_in,R=e.input,i=n+(e.avail_in-5),r=e.next_out,A=e.output,a=r-(t-e.avail_out),o=r+(e.avail_out-257),s=T.dmax,l=T.wsize,c=T.whave,d=T.wnext,f=T.window,h=T.hold,u=T.bits,b=T.lencode,m=T.distcode,g=(1<>>24,h>>>=p,u-=p,p=_>>>16&255,0===p)A[r++]=65535&_;else{if(!(16&p)){if(0==(64&p)){_=b[(65535&_)+(h&(1<>>=p,u-=p),u<15&&(h+=R[n++]<>>24,h>>>=p,u-=p,p=_>>>16&255,!(16&p)){if(0==(64&p)){_=m[(65535&_)+(h&(1<s){e.msg="invalid distance too far back",T.mode=w;break e}if(h>>>=p,u-=p,p=r-a,v>p){if(p=v-p,p>c&&T.sane){e.msg="invalid distance too far back",T.mode=w;break e}if(E=0,x=f,0===d){if(E+=l-p,p2;)A[r++]=x[E++],A[r++]=x[E++],A[r++]=x[E++],y-=3;y&&(A[r++]=x[E++],y>1&&(A[r++]=x[E++]))}else{E=r-v;do{A[r++]=A[E++],A[r++]=A[E++],A[r++]=A[E++],y-=3}while(y>2);y&&(A[r++]=A[E++],y>1&&(A[r++]=A[E++]))}break}}break}}while(n>3,n-=y,u-=y<<3,h&=(1<{const l=s.bits;let c,d,f,h,u,w,p=0,y=0,v=0,E=0,x=0,R=0,A=0,T=0,U=0,S=0,Z=null;const D=new Uint16Array(16),I=new Uint16Array(16);let O,B,N,C=null;for(p=0;p<=b;p++)D[p]=0;for(y=0;y=1&&0===D[E];E--);if(x>E&&(x=E),0===E)return r[a++]=20971520,r[a++]=20971520,s.bits=1,0;for(v=1;v0&&(0===e||1!==E))return-1;for(I[1]=0,p=1;p852||2===e&&U>592)return 1;for(;;){O=p-A,o[y]+1=w?(B=C[o[y]-w],N=Z[o[y]-w]):(B=96,N=0),c=1<>A)+d]=O<<24|B<<16|N|0}while(0!==d);for(c=1<>=1;if(0!==c?(S&=c-1,S+=c):S=0,y++,0==--D[p]){if(p===E)break;p=t[n+o[y]]}if(p>x&&(S&h)!==f){for(0===A&&(A=x),u+=v,R=p-A,T=1<852||2===e&&U>592)return 1;f=S&h,r[f]=x<<24|R<<16|u-a|0}}return 0!==S&&(r[u+S]=p-A<<24|64<<16|0),s.bits=x,0},{Z_FINISH:R,Z_BLOCK:A,Z_TREES:T,Z_OK:U,Z_STREAM_END:S,Z_NEED_DICT:Z,Z_STREAM_ERROR:D,Z_DATA_ERROR:I,Z_MEM_ERROR:O,Z_BUF_ERROR:B,Z_DEFLATED:N}=p,C=16180,M=16190,L=16191,F=16192,P=16194,z=16199,V=16200,H=16206,j=16209,K=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Y(){this.strm=null,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 G=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode16211?1:0},Q=e=>{if(G(e))return D;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=C,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,U},W=e=>{if(G(e))return D;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Q(e)},X=(e,t)=>{let n;if(G(e))return D;const i=e.state;return t<0?(n=0,t=-t):(n=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?D:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,W(e))},q=(e,t)=>{if(!e)return D;const n=new Y;e.state=n,n.strm=e,n.window=null,n.mode=C;const i=X(e,t);return i!==U&&(e.state=null),i};let J,$,ee=!0;const te=e=>{if(ee){J=new Int32Array(512),$=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(x(1,e.lens,0,288,J,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;x(2,e.lens,0,32,$,0,e.work,{bits:5}),ee=!1}e.lencode=J,e.lenbits=9,e.distcode=$,e.distbits=5},ne=(e,t,n,i)=>{let r;const a=e.state;return null===a.window&&(a.wsize=1<=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>i&&(r=i),a.window.set(t.subarray(n-i,n-i+r),a.wnext),(i-=r)?(a.window.set(t.subarray(n-i,n),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whaveq(e,15),d.inflateInit2=q,d.inflate=(e,t)=>{let n,i,r,a,o,s,l,c,d,f,h,u,w,b,m,g,k,_,p,Y,Q,W,X=0;const q=new Uint8Array(4);let J,$;const ee=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(G(e)||!e.output||!e.input&&0!==e.avail_in)return D;n=e.state,n.mode===L&&(n.mode=F),o=e.next_out,r=e.output,l=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,c=n.hold,d=n.bits,f=s,h=l,W=U;e:for(;;)switch(n.mode){case C:if(0===n.wrap){n.mode=F;break}for(;d<16;){if(0===s)break e;s--,c+=i[a++]<>>8&255,n.check=v(n.check,q,2,0),c=0,d=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=j;break}if((15&c)!==N){e.msg="unknown compression method",n.mode=j;break}if(c>>>=4,d-=4,Q=8+(15&c),0===n.wbits&&(n.wbits=Q),Q>15||Q>n.wbits){e.msg="invalid window size",n.mode=j;break}n.dmax=1<>8&1),512&n.flags&&4&n.wrap&&(q[0]=255&c,q[1]=c>>>8&255,n.check=v(n.check,q,2,0)),c=0,d=0,n.mode=16182;case 16182:for(;d<32;){if(0===s)break e;s--,c+=i[a++]<>>8&255,q[2]=c>>>16&255,q[3]=c>>>24&255,n.check=v(n.check,q,4,0)),c=0,d=0,n.mode=16183;case 16183:for(;d<16;){if(0===s)break e;s--,c+=i[a++]<>8),512&n.flags&&4&n.wrap&&(q[0]=255&c,q[1]=c>>>8&255,n.check=v(n.check,q,2,0)),c=0,d=0,n.mode=16184;case 16184:if(1024&n.flags){for(;d<16;){if(0===s)break e;s--,c+=i[a++]<>>8&255,n.check=v(n.check,q,2,0)),c=0,d=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(u=n.length,u>s&&(u=s),u&&(n.head&&(Q=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(i.subarray(a,a+u),Q)),512&n.flags&&4&n.wrap&&(n.check=v(n.check,i,u,a)),s-=u,a+=u,n.length-=u),n.length))break e;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===s)break e;u=0;do{Q=i[a+u++],n.head&&Q&&n.length<65536&&(n.head.name+=String.fromCharCode(Q))}while(Q&&u>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=L;break;case 16189:for(;d<32;){if(0===s)break e;s--,c+=i[a++]<>>=7&d,d-=7&d,n.mode=H;break}for(;d<3;){if(0===s)break e;s--,c+=i[a++]<>>=1,d-=1,3&c){case 0:n.mode=16193;break;case 1:if(te(n),n.mode=z,t===T){c>>>=2,d-=2;break e}break;case 2:n.mode=16196;break;case 3:e.msg="invalid block type",n.mode=j}c>>>=2,d-=2;break;case 16193:for(c>>>=7&d,d-=7&d;d<32;){if(0===s)break e;s--,c+=i[a++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=j;break}if(n.length=65535&c,c=0,d=0,n.mode=P,t===T)break e;case P:n.mode=16195;case 16195:if(u=n.length,u){if(u>s&&(u=s),u>l&&(u=l),0===u)break e;r.set(i.subarray(a,a+u),o),s-=u,a+=u,l-=u,o+=u,n.length-=u;break}n.mode=L;break;case 16196:for(;d<14;){if(0===s)break e;s--,c+=i[a++]<>>=5,d-=5,n.ndist=1+(31&c),c>>>=5,d-=5,n.ncode=4+(15&c),c>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=j;break}n.have=0,n.mode=16197;case 16197:for(;n.have>>=3,d-=3}for(;n.have<19;)n.lens[ee[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,J={bits:n.lenbits},W=x(0,n.lens,0,19,n.lencode,0,n.work,J),n.lenbits=J.bits,W){e.msg="invalid code lengths set",n.mode=j;break}n.have=0,n.mode=16198;case 16198:for(;n.have>>24,g=X>>>16&255,k=65535&X,!(m<=d);){if(0===s)break e;s--,c+=i[a++]<>>=m,d-=m,n.lens[n.have++]=k;else{if(16===k){for($=m+2;d<$;){if(0===s)break e;s--,c+=i[a++]<>>=m,d-=m,0===n.have){e.msg="invalid bit length repeat",n.mode=j;break}Q=n.lens[n.have-1],u=3+(3&c),c>>>=2,d-=2}else if(17===k){for($=m+3;d<$;){if(0===s)break e;s--,c+=i[a++]<>>=m,d-=m,Q=0,u=3+(7&c),c>>>=3,d-=3}else{for($=m+7;d<$;){if(0===s)break e;s--,c+=i[a++]<>>=m,d-=m,Q=0,u=11+(127&c),c>>>=7,d-=7}if(n.have+u>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=j;break}for(;u--;)n.lens[n.have++]=Q}}if(n.mode===j)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=j;break}if(n.lenbits=9,J={bits:n.lenbits},W=x(1,n.lens,0,n.nlen,n.lencode,0,n.work,J),n.lenbits=J.bits,W){e.msg="invalid literal/lengths set",n.mode=j;break}if(n.distbits=6,n.distcode=n.distdyn,J={bits:n.distbits},W=x(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,J),n.distbits=J.bits,W){e.msg="invalid distances set",n.mode=j;break}if(n.mode=z,t===T)break e;case z:n.mode=V;case V:if(s>=6&&l>=258){e.next_out=o,e.avail_out=l,e.next_in=a,e.avail_in=s,n.hold=c,n.bits=d,E(e,h),o=e.next_out,r=e.output,l=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,c=n.hold,d=n.bits,n.mode===L&&(n.back=-1);break}for(n.back=0;X=n.lencode[c&(1<>>24,g=X>>>16&255,k=65535&X,!(m<=d);){if(0===s)break e;s--,c+=i[a++]<>_)],m=X>>>24,g=X>>>16&255,k=65535&X,!(_+m<=d);){if(0===s)break e;s--,c+=i[a++]<>>=_,d-=_,n.back+=_}if(c>>>=m,d-=m,n.back+=m,n.length=k,0===g){n.mode=16205;break}if(32&g){n.back=-1,n.mode=L;break}if(64&g){e.msg="invalid literal/length code",n.mode=j;break}n.extra=15&g,n.mode=16201;case 16201:if(n.extra){for($=n.extra;d<$;){if(0===s)break e;s--,c+=i[a++]<>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;X=n.distcode[c&(1<>>24,g=X>>>16&255,k=65535&X,!(m<=d);){if(0===s)break e;s--,c+=i[a++]<>_)],m=X>>>24,g=X>>>16&255,k=65535&X,!(_+m<=d);){if(0===s)break e;s--,c+=i[a++]<>>=_,d-=_,n.back+=_}if(c>>>=m,d-=m,n.back+=m,64&g){e.msg="invalid distance code",n.mode=j;break}n.offset=k,n.extra=15&g,n.mode=16203;case 16203:if(n.extra){for($=n.extra;d<$;){if(0===s)break e;s--,c+=i[a++]<>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=j;break}n.mode=16204;case 16204:if(0===l)break e;if(u=h-l,n.offset>u){if(u=n.offset-u,u>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=j;break}u>n.wnext?(u-=n.wnext,w=n.wsize-u):w=n.wnext-u,u>n.length&&(u=n.length),b=n.window}else b=r,w=o-n.offset,u=n.length;u>l&&(u=l),l-=u,n.length-=u;do{r[o++]=b[w++]}while(--u);0===n.length&&(n.mode=V);break;case 16205:if(0===l)break e;r[o++]=n.length,l--,n.mode=V;break;case H:if(n.wrap){for(;d<32;){if(0===s)break e;s--,c|=i[a++]<{if(G(e))return D;let t=e.state;return t.window&&(t.window=null),e.state=null,U},d.inflateGetHeader=(e,t)=>{if(G(e))return D;const n=e.state;return 0==(2&n.wrap)?D:(n.head=t,t.done=!1,U)},d.inflateSetDictionary=(e,t)=>{const n=t.length;let i,r,a;return G(e)?D:(i=e.state,0!==i.wrap&&i.mode!==M?D:i.mode===M&&(r=1,r=y(r,t,n,0),r!==i.check)?I:(a=ne(e,t,n,n),a?(i.mode=16210,O):(i.havedict=1,U)))},d.inflateInfo="pako inflate (from Nodeca project)";var ie={};const re=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);ie.assign=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const t in n)re(n,t)&&(e[t]=n[t])}}return e},ie.flattenChunks=e=>{let t=0;for(let n=0,i=e.length;n=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;se[254]=se[254]=1,ae.string2buf=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,n,i,r,a,o=e.length,s=0;for(r=0;r>>6,t[a++]=128|63&n):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|63&n):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|63&n);return t};ae.buf2string=(e,t)=>{const n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let i,r;const a=new Array(2*n);for(r=0,i=0;i4)a[r++]=65533,i+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&i1?a[r++]=65533:t<65536?a[r++]=t:(t-=65536,a[r++]=55296|t>>10&1023,a[r++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&oe)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let i=0;i{(t=t||e.length)>e.length&&(t=e.length);let n=t-1;for(;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+se[e[n]]>t?n:t};const le=d,ce=ie,de=ae,fe={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"},he=function(){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},ue=function(){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},we=Object.prototype.toString,{Z_NO_FLUSH:be,Z_FINISH:me,Z_OK:ge,Z_STREAM_END:ke,Z_NEED_DICT:_e,Z_STREAM_ERROR:pe,Z_DATA_ERROR:ye,Z_MEM_ERROR:ve}=p;function Ee(e){this.options=ce.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new he,this.strm.avail_out=0;let n=le.inflateInit2(this.strm,t.windowBits);if(n!==ge)throw new Error(fe[n]);if(this.header=new ue,le.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=de.string2buf(t.dictionary):"[object ArrayBuffer]"===we.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=le.inflateSetDictionary(this.strm,t.dictionary),n!==ge)))throw new Error(fe[n])}function xe(e,t){const n=new Ee(t);if(n.push(e),n.err)throw n.msg||fe[n.err];return n.result}Ee.prototype.push=function(e,t){const n=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let a,o,s;if(this.ended)return!1;for(o=t===~~t?t:!0===t?me:be,"[object ArrayBuffer]"===we.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(i),n.next_out=0,n.avail_out=i),a=le.inflate(n,o),a===_e&&r&&(a=le.inflateSetDictionary(n,r),a===ge?a=le.inflate(n,o):a===ye&&(a=_e));n.avail_in>0&&a===ke&&n.state.wrap>0&&0!==e[n.next_in];)le.inflateReset(n),a=le.inflate(n,o);switch(a){case pe:case ye:case _e:case ve:return this.onEnd(a),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(0===n.avail_out||a===ke))if("string"===this.options.to){let e=de.utf8border(n.output,n.next_out),t=n.next_out-e,r=de.buf2string(n.output,e);n.next_out=t,n.avail_out=i-t,t&&n.output.set(n.output.subarray(e,e+t),0),this.onData(r)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(a!==ge||0!==s){if(a===ke)return a=le.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},Ee.prototype.onData=function(e){this.chunks.push(e)},Ee.prototype.onEnd=function(e){e===ge&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=ce.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},c.Inflate=Ee,c.inflate=xe,c.inflateRaw=function(e,t){return(t=t||{}).raw=!0,xe(e,t)},c.ungzip=xe,c.constants=p;const Re=Uint16Array.BYTES_PER_ELEMENT,Ae=Int32Array.BYTES_PER_ELEMENT,Te=Uint32Array.BYTES_PER_ELEMENT,Ue={METADATA:0,TERRAIN:1,DBROOT:2};Ue.fromString=function(e){return"Metadata"===e?Ue.METADATA:"Terrain"===e?Ue.TERRAIN:"DbRoot"===e?Ue.DBROOT:void 0};const Se=32301;const Ze=5,De=4;const Ie=1953029805,Oe=2917034100;return n((function(t,n){const i=Ue.fromString(t.type);let r=t.buffer;a(t.key,r);const o=function(t){const n=new DataView(t);let i=0;const r=n.getUint32(i,!0);if(i+=Te,r!==Ie&&r!==Oe)throw new e.RuntimeError("Invalid magic");const a=n.getUint32(i,r===Ie);i+=Te;const o=new Uint8Array(t,i),s=c.inflate(o);if(s.length!==a)throw new e.RuntimeError("Size of packet doesn't match header");return s}(r);r=o.buffer;const s=o.length;switch(i){case Ue.METADATA:return function(t,n,i){const r=new DataView(t);let a=0;const o=r.getUint32(a,!0);if(a+=Te,o!==Se)throw new e.RuntimeError("Invalid magic");const s=r.getUint32(a,!0);if(a+=Te,1!==s)throw new e.RuntimeError("Invalid data type. Must be 1 for QuadTreePacket");const c=r.getUint32(a,!0);if(a+=Te,2!==c)throw new e.RuntimeError("Invalid QuadTreePacket version. Only version 2 is supported.");const d=r.getInt32(a,!0);a+=Ae;const f=r.getInt32(a,!0);if(a+=Ae,32!==f)throw new e.RuntimeError("Invalid instance size.");const h=r.getInt32(a,!0);a+=Ae;const u=r.getInt32(a,!0);a+=Ae;const w=r.getInt32(a,!0);if(a+=Ae,h!==d*f+a)throw new e.RuntimeError("Invalid dataBufferOffset");if(h+u+w!==n)throw new e.RuntimeError("Invalid packet offsets");const b=[];for(let e=0;en)throw new e.RuntimeError("Malformed terrain packet found.")}return t};let o=0;const s=[];for(;s.length