ts/public/js/Cesium2/ThirdParty/Workers/z-worker-pako.js

2 lines
16 KiB
JavaScript
Raw Normal View History

2025-01-06 01:18:58 +00:00
(function(){"use strict";const{Array:te,Object:m,Number:ne,Math:A,Error:v,Uint8Array:w,Uint16Array:nt,Uint32Array:se,Int32Array:st,Map:re,DataView:W,Promise:M,TextEncoder:ae,crypto:B,postMessage:K,TransformStream:b,ReadableStream:Ve,WritableStream:xe,CompressionStream:rt,DecompressionStream:at}=self,j=void 0,N="undefined",O="function";class oe{constructor(e){return class extends b{constructor(n,s){const r=new e(s);super({transform(a,o){o.enqueue(r.append(a))},flush(a){const o=r.flush();o&&a.enqueue(o)}})}}}}const ie=[];for(let t=0;256>t;t++){let e=t;for(let n=0;8>n;n++)1&e?e=e>>>1^3988292384:e>>>=1;ie[t]=e}class G{constructor(e){this.crc=e||-1}append(e){let n=0|this.crc;for(let s=0,r=0|e.length;r>s;s++)n=n>>>8^ie[255&(n^e[s])];this.crc=n}get(){return~this.crc}}class ce extends b{constructor(){let e;const n=new G;super({transform(s,r){n.append(s),r.enqueue(s)},flush(){const s=new w(4);new W(s.buffer).setUint32(0,n.get()),e.value=s}}),e=this}}const _={concat(t,e){if(t.length===0||e.length===0)return t.concat(e);const n=t[t.length-1],s=_.getPartial(n);return s===32?t.concat(e):_._shiftRight(e,s,0|n,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(e===0)return 0;const n=t[e-1];return 32*(e-1)+_.getPartial(n)},clamp(t,e){if(32*t.length<e)return t;const n=(t=t.slice(0,A.ceil(e/32))).length;return e&=31,n>0&&e&&(t[n-1]=_.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial:(t,e,n)=>t===32?e:(n?0|e:e<<32-t)+1099511627776*t,getPartial:t=>A.round(t/1099511627776)||32,_shiftRight(t,e,n,s){for(s===void 0&&(s=[]);e>=32;e-=32)s.push(n),n=0;if(e===0)return s.concat(t);for(let o=0;o<t.length;o++)s.push(n|t[o]>>>e),n=t[o]<<32-e;const r=t.length?t[t.length-1]:0,a=_.getPartial(r);return s.push(_.partial(e+a&31,e+a>32?n:s.pop(),1)),s}},L={bytes:{fromBits(t){const e=_.bitLength(t)/8,n=new w(e);let s;for(let r=0;e>r;r++)3&r||(s=t[r/4]),n[r]=s>>>24,s<<=8;return n},toBits(t){const e=[];let n,s=0;for(n=0;n<t.length;n++)s=s<<8|t[n],3&~n||(e.push(s),s=0);return 3&n&&e.push(_.partial(8*(3&n),s)),e}}},Ee=class{constructor(t){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],t?(e._h=t._h.slice(0),e._buffer=t._buffer.slice(0),e._length=t._length):e.reset()}reset(){const t=this;return t._h=t._init.slice(0),t._buffer=[],t._length=0,t}update(t){const e=this;typeof t=="string"&&(t=L.utf8String.toBits(t));const n=e._buffer=_.concat(e._buffer,t),s=e._length,r=e._length=s+_.bitLength(t);if(r>9007199254740991)throw new v("Cannot hash more than 2^53 - 1 bits");const a=new se(n);let o=0;for(let l=e.blockSize+s-(e.blockSize+s&e.blockSize-1);r>=l;l+=e.blockSize)e._block(a.subarray(16*o,16*(o+1))),o+=1;return n.splice(0,16*o),e}finalize(){const t=this;let e=t._buffer;const n=t._h;e=_.concat(e,[_.partial(1,1)]);for(let s=e.length+2;15&s;s++)e.push(0);for(e.push(A.floor(t._length/4294967296)),e.push(0|t._length);e.length;)t._block(e.splice(0,16));return t.reset(),n}_f(t,e,n,s){return t>19?t>39?t>59?t>79?void 0:e^n^s:e&n|e&s|n&s:e^n^s:e&n|~e&s}_S(t,e){return e<<t|e>>>32-t}_block(t){const e=this,n=e._h,s=te(80);for(let c=0;16>c;c++)s[c]=t[c];let r=n[0],a=n[1],o=n[2],l=n[3],u=n[4];for(let c=0;79>=c;c++){16>c||(s[c]=e._S(1,s[c-3]^s[c-8]^s[c-14]^s[c-16]));const i=e._S(5,r)+e._f(c,a,o,l)+u+s[c]+e._key[A.floor(c/20)]|0;u=l,l=o,o=e._S(30,a),a=r,r=i}n[0]=n[0]+r|0,n[1]=n[1]+a|0,n[2]=n[2]+o|0,n[3]=n[3]+l|0,n[4]=n[4]+u|0}},Ue={getRandomValues(t){const e=new se(t.buffer),n=s=>{let r=987654321;const a=4294967295;return()=>(r=36969*(65535&r)+(r>>16)&a,(((r<<16)+(s=18e3*(65535&s)+(s>>16)&a)&a)/4294967296+.5)*(A.random()>.5?1:-1))};for(let s,r=0;r<t.length;r+=4){const a=n(4294967296*(s||A.random()));s=987654071*a(),e[r/4]=4294967296*a()|0}return t}},H={importKey:t=>new H.hmacSha1(L.bytes.toBits(t)),pbkdf2(t,e,n,s){if(n=n||1e4,0>s||0>n)throw new v("invalid params to pbkdf2");const r=1+(s>>5)<<2;let a,o,l,u,c;const i=new ArrayBuffer(r),f=new W(i);let h=0;const p=_;for(e=L.bytes.toBits(e),c=1;(r||1)>h;c++){for(a=o=t.encrypt(p.concat(e,[c])),l=1;n>l;l++)for(o=t.encrypt(o),u=0;u<o.length;u