neozipkit 1.0.2 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/NEOZIP_APPNOTE.md +625 -0
  2. package/README.md +44 -11
  3. package/WHATS_NEW.md +153 -10
  4. package/dist/browser/ZipkitBrowser.d.ts.map +1 -1
  5. package/dist/browser/ZipkitBrowser.js +4 -6
  6. package/dist/browser/ZipkitBrowser.js.map +1 -1
  7. package/dist/browser/zstd-browser-shim.d.ts +17 -9
  8. package/dist/browser/zstd-browser-shim.d.ts.map +1 -1
  9. package/dist/browser/zstd-browser-shim.js +99 -21
  10. package/dist/browser/zstd-browser-shim.js.map +1 -1
  11. package/dist/browser-esm/index.js +6534 -1275
  12. package/dist/browser-esm/index.js.map +4 -4
  13. package/dist/browser-umd/index.js +6534 -1275
  14. package/dist/browser-umd/index.js.map +4 -4
  15. package/dist/browser-umd/index.min.js +6 -3
  16. package/dist/core/ZipCompress.d.ts +6 -0
  17. package/dist/core/ZipCompress.d.ts.map +1 -1
  18. package/dist/core/ZipCompress.js +12 -11
  19. package/dist/core/ZipCompress.js.map +1 -1
  20. package/dist/core/ZipCopy.d.ts.map +1 -1
  21. package/dist/core/ZipCopy.js +33 -25
  22. package/dist/core/ZipCopy.js.map +1 -1
  23. package/dist/core/ZipDecompress.d.ts.map +1 -1
  24. package/dist/core/ZipDecompress.js +13 -8
  25. package/dist/core/ZipDecompress.js.map +1 -1
  26. package/dist/core/ZipEntry.d.ts +24 -0
  27. package/dist/core/ZipEntry.d.ts.map +1 -1
  28. package/dist/core/ZipEntry.js +146 -14
  29. package/dist/core/ZipEntry.js.map +1 -1
  30. package/dist/core/Zipkit.d.ts +43 -11
  31. package/dist/core/Zipkit.d.ts.map +1 -1
  32. package/dist/core/Zipkit.js +132 -82
  33. package/dist/core/Zipkit.js.map +1 -1
  34. package/dist/core/components/HashCalculator.d.ts +22 -1
  35. package/dist/core/components/HashCalculator.d.ts.map +1 -1
  36. package/dist/core/components/HashCalculator.js +49 -6
  37. package/dist/core/components/HashCalculator.js.map +1 -1
  38. package/dist/core/components/Util.d.ts +3 -4
  39. package/dist/core/components/Util.d.ts.map +1 -1
  40. package/dist/core/components/Util.js +10 -8
  41. package/dist/core/components/Util.js.map +1 -1
  42. package/dist/core/constants/Headers.d.ts +2 -3
  43. package/dist/core/constants/Headers.d.ts.map +1 -1
  44. package/dist/core/constants/Headers.js +15 -5
  45. package/dist/core/constants/Headers.js.map +1 -1
  46. package/dist/core/constants/MetaPaths.d.ts +38 -0
  47. package/dist/core/constants/MetaPaths.d.ts.map +1 -0
  48. package/dist/core/constants/MetaPaths.js +79 -0
  49. package/dist/core/constants/MetaPaths.js.map +1 -0
  50. package/dist/core/index.d.ts +5 -0
  51. package/dist/core/index.d.ts.map +1 -1
  52. package/dist/core/index.js +18 -1
  53. package/dist/core/index.js.map +1 -1
  54. package/dist/core/inflateZipPayload.d.ts +6 -0
  55. package/dist/core/inflateZipPayload.d.ts.map +1 -0
  56. package/dist/core/inflateZipPayload.js +28 -0
  57. package/dist/core/inflateZipPayload.js.map +1 -0
  58. package/dist/core/merkle/MerkleRoot.d.ts +109 -0
  59. package/dist/core/merkle/MerkleRoot.d.ts.map +1 -0
  60. package/dist/core/merkle/MerkleRoot.js +275 -0
  61. package/dist/core/merkle/MerkleRoot.js.map +1 -0
  62. package/dist/core/origin/OriginExtra.d.ts +43 -0
  63. package/dist/core/origin/OriginExtra.d.ts.map +1 -0
  64. package/dist/core/origin/OriginExtra.js +187 -0
  65. package/dist/core/origin/OriginExtra.js.map +1 -0
  66. package/dist/core/version.js +1 -1
  67. package/dist/core/zip64/Zip64.d.ts +138 -0
  68. package/dist/core/zip64/Zip64.d.ts.map +1 -0
  69. package/dist/core/zip64/Zip64.js +353 -0
  70. package/dist/core/zip64/Zip64.js.map +1 -0
  71. package/dist/node/ZipCompressNode.d.ts.map +1 -1
  72. package/dist/node/ZipCompressNode.js +40 -49
  73. package/dist/node/ZipCompressNode.js.map +1 -1
  74. package/dist/node/ZipCopyNode.d.ts.map +1 -1
  75. package/dist/node/ZipCopyNode.js +26 -26
  76. package/dist/node/ZipCopyNode.js.map +1 -1
  77. package/dist/node/ZipDecompressNode.d.ts.map +1 -1
  78. package/dist/node/ZipDecompressNode.js +21 -3
  79. package/dist/node/ZipDecompressNode.js.map +1 -1
  80. package/dist/node/ZipkitNode.d.ts +23 -1
  81. package/dist/node/ZipkitNode.d.ts.map +1 -1
  82. package/dist/node/ZipkitNode.js +158 -57
  83. package/dist/node/ZipkitNode.js.map +1 -1
  84. package/dist/node/ZstdNode.d.ts +14 -4
  85. package/dist/node/ZstdNode.d.ts.map +1 -1
  86. package/dist/node/ZstdNode.js +28 -4
  87. package/dist/node/ZstdNode.js.map +1 -1
  88. package/dist/node/buildZipBuffer.d.ts +49 -0
  89. package/dist/node/buildZipBuffer.d.ts.map +1 -0
  90. package/dist/node/buildZipBuffer.js +146 -0
  91. package/dist/node/buildZipBuffer.js.map +1 -0
  92. package/dist/node/index.d.ts +3 -0
  93. package/dist/node/index.d.ts.map +1 -1
  94. package/dist/node/index.js +6 -1
  95. package/dist/node/index.js.map +1 -1
  96. package/dist/node/inflateZipPayload.d.ts +5 -0
  97. package/dist/node/inflateZipPayload.d.ts.map +1 -0
  98. package/dist/node/inflateZipPayload.js +21 -0
  99. package/dist/node/inflateZipPayload.js.map +1 -0
  100. package/dist/types/index.js +2 -2
  101. package/node-esm.mjs +32 -0
  102. package/package.json +13 -6
  103. package/src/browser/ZipkitBrowser.ts +4 -6
  104. package/src/browser/zstd-browser-shim.ts +110 -28
  105. package/src/core/ZipCompress.ts +20 -13
  106. package/src/core/ZipCopy.ts +56 -27
  107. package/src/core/ZipDecompress.ts +14 -8
  108. package/src/core/ZipEntry.ts +200 -14
  109. package/src/core/Zipkit.ts +189 -98
  110. package/src/core/components/HashCalculator.ts +58 -6
  111. package/src/core/components/Util.ts +16 -7
  112. package/src/core/constants/Headers.ts +15 -4
  113. package/src/core/constants/MetaPaths.ts +86 -0
  114. package/src/core/index.ts +17 -0
  115. package/src/core/inflateZipPayload.ts +27 -0
  116. package/src/core/merkle/MerkleRoot.ts +312 -0
  117. package/src/core/origin/OriginExtra.ts +209 -0
  118. package/src/core/version.ts +1 -1
  119. package/src/core/zip64/Zip64.ts +473 -0
  120. package/src/node/ZipCompressNode.ts +40 -49
  121. package/src/node/ZipCopyNode.ts +31 -29
  122. package/src/node/ZipDecompressNode.ts +16 -3
  123. package/src/node/ZipkitNode.ts +203 -72
  124. package/src/node/ZstdNode.ts +33 -8
  125. package/src/node/buildZipBuffer.ts +221 -0
  126. package/src/node/index.ts +7 -0
  127. package/src/node/inflateZipPayload.ts +19 -0
  128. package/src/types/index.ts +2 -2
@@ -3,9 +3,9 @@
3
3
  * Copyright (c) 2025 NeoWare, Inc. All rights reserved.
4
4
  * Licensed under MIT License
5
5
  */
6
- "use strict";var NeoZipKit=(()=>{var Wo=Object.create;var zt=Object.defineProperty;var qo=Object.getOwnPropertyDescriptor;var jo=Object.getOwnPropertyNames;var Jo=Object.getPrototypeOf,Qo=Object.prototype.hasOwnProperty;var Z=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ea=(r,t)=>{for(var e in t)zt(r,e,{get:t[e],enumerable:!0})},Cn=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of jo(t))!Qo.call(r,i)&&i!==e&&zt(r,i,{get:()=>t[i],enumerable:!(n=qo(t,i))||n.enumerable});return r};var ta=(r,t,e)=>(e=r!=null?Wo(Jo(r)):{},Cn(t||!r||!r.__esModule?zt(e,"default",{value:r,enumerable:!0}):e,r)),ra=r=>Cn(zt({},"__esModule",{value:!0}),r);var Un=Z(Ht=>{"use strict";Ht.byteLength=ia;Ht.toByteArray=aa;Ht.fromByteArray=la;var oe=[],W=[],na=typeof Uint8Array<"u"?Uint8Array:Array,Er="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(He=0,Ln=Er.length;He<Ln;++He)oe[He]=Er[He],W[Er.charCodeAt(He)]=He;var He,Ln;W[45]=62;W[95]=63;function Rn(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");e===-1&&(e=t);var n=e===t?0:4-e%4;return[e,n]}function ia(r){var t=Rn(r),e=t[0],n=t[1];return(e+n)*3/4-n}function oa(r,t,e){return(t+e)*3/4-e}function aa(r){var t,e=Rn(r),n=e[0],i=e[1],o=new na(oa(r,n,i)),a=0,s=i>0?n-4:n,c;for(c=0;c<s;c+=4)t=W[r.charCodeAt(c)]<<18|W[r.charCodeAt(c+1)]<<12|W[r.charCodeAt(c+2)]<<6|W[r.charCodeAt(c+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=t&255;return i===2&&(t=W[r.charCodeAt(c)]<<2|W[r.charCodeAt(c+1)]>>4,o[a++]=t&255),i===1&&(t=W[r.charCodeAt(c)]<<10|W[r.charCodeAt(c+1)]<<4|W[r.charCodeAt(c+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}function sa(r){return oe[r>>18&63]+oe[r>>12&63]+oe[r>>6&63]+oe[r&63]}function fa(r,t,e){for(var n,i=[],o=t;o<e;o+=3)n=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),i.push(sa(n));return i.join("")}function la(r){for(var t,e=r.length,n=e%3,i=[],o=16383,a=0,s=e-n;a<s;a+=o)i.push(fa(r,a,a+o>s?s:a+o));return n===1?(t=r[e-1],i.push(oe[t>>2]+oe[t<<4&63]+"==")):n===2&&(t=(r[e-2]<<8)+r[e-1],i.push(oe[t>>10]+oe[t>>4&63]+oe[t<<2&63]+"=")),i.join("")}});var Nn=Z(xr=>{xr.read=function(r,t,e,n,i){var o,a,s=i*8-n-1,c=(1<<s)-1,f=c>>1,l=-7,d=e?i-1:0,h=e?-1:1,u=r[t+d];for(d+=h,o=u&(1<<-l)-1,u>>=-l,l+=s;l>0;o=o*256+r[t+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=a*256+r[t+d],d+=h,l-=8);if(o===0)o=1-f;else{if(o===c)return a?NaN:(u?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(u?-1:1)*a*Math.pow(2,o-n)};xr.write=function(r,t,e,n,i,o){var a,s,c,f=o*8-i-1,l=(1<<f)-1,d=l>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,u=n?0:o-1,E=n?1:-1,_=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+d>=1?t+=h/c:t+=h*Math.pow(2,1-d),t*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(t*c-1)*Math.pow(2,i),a=a+d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;r[e+u]=s&255,u+=E,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;r[e+u]=a&255,u+=E,a/=256,f-=8);r[e+u-E]|=_*128}});var qn=Z(nt=>{"use strict";var _r=Un(),tt=Nn(),kn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;nt.Buffer=m;nt.SlowBuffer=ma;nt.INSPECT_MAX_BYTES=50;var $t=2147483647;nt.kMaxLength=$t;m.TYPED_ARRAY_SUPPORT=ca();!m.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ca(){try{let r=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(r,t),r.foo()===42}catch{return!1}}Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}});Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}});function Se(r){if(r>$t)throw new RangeError('The value "'+r+'" is invalid for option "size"');let t=new Uint8Array(r);return Object.setPrototypeOf(t,m.prototype),t}function m(r,t,e){if(typeof r=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return wr(r)}return Pn(r,t,e)}m.poolSize=8192;function Pn(r,t,e){if(typeof r=="string")return ha(r,t);if(ArrayBuffer.isView(r))return da(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(ae(r,ArrayBuffer)||r&&ae(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ae(r,SharedArrayBuffer)||r&&ae(r.buffer,SharedArrayBuffer)))return yr(r,t,e);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return m.from(n,t,e);let i=pa(r);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return m.from(r[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}m.from=function(r,t,e){return Pn(r,t,e)};Object.setPrototypeOf(m.prototype,Uint8Array.prototype);Object.setPrototypeOf(m,Uint8Array);function Mn(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function ua(r,t,e){return Mn(r),r<=0?Se(r):t!==void 0?typeof e=="string"?Se(r).fill(t,e):Se(r).fill(t):Se(r)}m.alloc=function(r,t,e){return ua(r,t,e)};function wr(r){return Mn(r),Se(r<0?0:Sr(r)|0)}m.allocUnsafe=function(r){return wr(r)};m.allocUnsafeSlow=function(r){return wr(r)};function ha(r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!m.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let e=Zn(r,t)|0,n=Se(e),i=n.write(r,t);return i!==e&&(n=n.slice(0,i)),n}function gr(r){let t=r.length<0?0:Sr(r.length)|0,e=Se(t);for(let n=0;n<t;n+=1)e[n]=r[n]&255;return e}function da(r){if(ae(r,Uint8Array)){let t=new Uint8Array(r);return yr(t.buffer,t.byteOffset,t.byteLength)}return gr(r)}function yr(r,t,e){if(t<0||r.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<t+(e||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&e===void 0?n=new Uint8Array(r):e===void 0?n=new Uint8Array(r,t):n=new Uint8Array(r,t,e),Object.setPrototypeOf(n,m.prototype),n}function pa(r){if(m.isBuffer(r)){let t=Sr(r.length)|0,e=Se(t);return e.length===0||r.copy(e,0,0,t),e}if(r.length!==void 0)return typeof r.length!="number"||Ir(r.length)?Se(0):gr(r);if(r.type==="Buffer"&&Array.isArray(r.data))return gr(r.data)}function Sr(r){if(r>=$t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$t.toString(16)+" bytes");return r|0}function ma(r){return+r!=r&&(r=0),m.alloc(+r)}m.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==m.prototype};m.compare=function(t,e){if(ae(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),ae(e,Uint8Array)&&(e=m.from(e,e.offset,e.byteLength)),!m.isBuffer(t)||!m.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let n=t.length,i=e.length;for(let o=0,a=Math.min(n,i);o<a;++o)if(t[o]!==e[o]){n=t[o],i=e[o];break}return n<i?-1:i<n?1:0};m.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};m.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return m.alloc(0);let n;if(e===void 0)for(e=0,n=0;n<t.length;++n)e+=t[n].length;let i=m.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){let a=t[n];if(ae(a,Uint8Array))o+a.length>i.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(i,o)):Uint8Array.prototype.set.call(i,a,o);else if(m.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function Zn(r,t){if(m.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||ae(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let e=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&e===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return br(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Wn(r).length;default:if(i)return n?-1:br(r).length;t=(""+t).toLowerCase(),i=!0}}m.byteLength=Zn;function Ea(r,t,e){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return Ba(this,t,e);case"utf8":case"utf-8":return Hn(this,t,e);case"ascii":return Aa(this,t,e);case"latin1":case"binary":return Ia(this,t,e);case"base64":return wa(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Da(this,t,e);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}m.prototype._isBuffer=!0;function $e(r,t,e){let n=r[t];r[t]=r[e],r[e]=n}m.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)$e(this,e,e+1);return this};m.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)$e(this,e,e+3),$e(this,e+1,e+2);return this};m.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)$e(this,e,e+7),$e(this,e+1,e+6),$e(this,e+2,e+5),$e(this,e+3,e+4);return this};m.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?Hn(this,0,t):Ea.apply(this,arguments)};m.prototype.toLocaleString=m.prototype.toString;m.prototype.equals=function(t){if(!m.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:m.compare(this,t)===0};m.prototype.inspect=function(){let t="",e=nt.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"};kn&&(m.prototype[kn]=m.prototype.inspect);m.prototype.compare=function(t,e,n,i,o){if(ae(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),e<0||n>t.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&e>=n)return 0;if(i>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,o>>>=0,this===t)return 0;let a=o-i,s=n-e,c=Math.min(a,s),f=this.slice(i,o),l=t.slice(e,n);for(let d=0;d<c;++d)if(f[d]!==l[d]){a=f[d],s=l[d];break}return a<s?-1:s<a?1:0};function zn(r,t,e,n,i){if(r.length===0)return-1;if(typeof e=="string"?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,Ir(e)&&(e=i?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(i)return-1;e=r.length-1}else if(e<0)if(i)e=0;else return-1;if(typeof t=="string"&&(t=m.from(t,n)),m.isBuffer(t))return t.length===0?-1:vn(r,t,e,n,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):vn(r,[t],e,n,i);throw new TypeError("val must be string, number or Buffer")}function vn(r,t,e,n,i){let o=1,a=r.length,s=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||t.length<2)return-1;o=2,a/=2,s/=2,e/=2}function c(l,d){return o===1?l[d]:l.readUInt16BE(d*o)}let f;if(i){let l=-1;for(f=e;f<a;f++)if(c(r,f)===c(t,l===-1?0:f-l)){if(l===-1&&(l=f),f-l+1===s)return l*o}else l!==-1&&(f-=f-l),l=-1}else for(e+s>a&&(e=a-s),f=e;f>=0;f--){let l=!0;for(let d=0;d<s;d++)if(c(r,f+d)!==c(t,d)){l=!1;break}if(l)return f}return-1}m.prototype.includes=function(t,e,n){return this.indexOf(t,e,n)!==-1};m.prototype.indexOf=function(t,e,n){return zn(this,t,e,n,!0)};m.prototype.lastIndexOf=function(t,e,n){return zn(this,t,e,n,!1)};function xa(r,t,e,n){e=Number(e)||0;let i=r.length-e;n?(n=Number(n),n>i&&(n=i)):n=i;let o=t.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let s=parseInt(t.substr(a*2,2),16);if(Ir(s))return a;r[e+a]=s}return a}function _a(r,t,e,n){return Yt(br(t,r.length-e),r,e,n)}function ga(r,t,e,n){return Yt(Ra(t),r,e,n)}function ya(r,t,e,n){return Yt(Wn(t),r,e,n)}function ba(r,t,e,n){return Yt(Ua(t,r.length-e),r,e,n)}m.prototype.write=function(t,e,n,i){if(e===void 0)i="utf8",n=this.length,e=0;else if(n===void 0&&typeof e=="string")i=e,n=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-e;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return xa(this,t,e,n);case"utf8":case"utf-8":return _a(this,t,e,n);case"ascii":case"latin1":case"binary":return ga(this,t,e,n);case"base64":return ya(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ba(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function wa(r,t,e){return t===0&&e===r.length?_r.fromByteArray(r):_r.fromByteArray(r.slice(t,e))}function Hn(r,t,e){e=Math.min(r.length,e);let n=[],i=t;for(;i<e;){let o=r[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=e){let c,f,l,d;switch(s){case 1:o<128&&(a=o);break;case 2:c=r[i+1],(c&192)===128&&(d=(o&31)<<6|c&63,d>127&&(a=d));break;case 3:c=r[i+1],f=r[i+2],(c&192)===128&&(f&192)===128&&(d=(o&15)<<12|(c&63)<<6|f&63,d>2047&&(d<55296||d>57343)&&(a=d));break;case 4:c=r[i+1],f=r[i+2],l=r[i+3],(c&192)===128&&(f&192)===128&&(l&192)===128&&(d=(o&15)<<18|(c&63)<<12|(f&63)<<6|l&63,d>65535&&d<1114112&&(a=d))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return Sa(n)}var On=4096;function Sa(r){let t=r.length;if(t<=On)return String.fromCharCode.apply(String,r);let e="",n=0;for(;n<t;)e+=String.fromCharCode.apply(String,r.slice(n,n+=On));return e}function Aa(r,t,e){let n="";e=Math.min(r.length,e);for(let i=t;i<e;++i)n+=String.fromCharCode(r[i]&127);return n}function Ia(r,t,e){let n="";e=Math.min(r.length,e);for(let i=t;i<e;++i)n+=String.fromCharCode(r[i]);return n}function Ba(r,t,e){let n=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>n)&&(e=n);let i="";for(let o=t;o<e;++o)i+=Na[r[o]];return i}function Da(r,t,e){let n=r.slice(t,e),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}m.prototype.slice=function(t,e){let n=this.length;t=~~t,e=e===void 0?n:~~e,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),e<t&&(e=t);let i=this.subarray(t,e);return Object.setPrototypeOf(i,m.prototype),i};function z(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUintLE=m.prototype.readUIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||z(t,e,this.length);let i=this[t],o=1,a=0;for(;++a<e&&(o*=256);)i+=this[t+a]*o;return i};m.prototype.readUintBE=m.prototype.readUIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||z(t,e,this.length);let i=this[t+--e],o=1;for(;e>0&&(o*=256);)i+=this[t+--e]*o;return i};m.prototype.readUint8=m.prototype.readUInt8=function(t,e){return t=t>>>0,e||z(t,1,this.length),this[t]};m.prototype.readUint16LE=m.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||z(t,2,this.length),this[t]|this[t+1]<<8};m.prototype.readUint16BE=m.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||z(t,2,this.length),this[t]<<8|this[t+1]};m.prototype.readUint32LE=m.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};m.prototype.readUint32BE=m.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||z(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};m.prototype.readBigUInt64LE=De(function(t){t=t>>>0,rt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&_t(t,this.length-8);let i=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});m.prototype.readBigUInt64BE=De(function(t){t=t>>>0,rt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&_t(t,this.length-8);let i=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});m.prototype.readIntLE=function(t,e,n){t=t>>>0,e=e>>>0,n||z(t,e,this.length);let i=this[t],o=1,a=0;for(;++a<e&&(o*=256);)i+=this[t+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i};m.prototype.readIntBE=function(t,e,n){t=t>>>0,e=e>>>0,n||z(t,e,this.length);let i=e,o=1,a=this[t+--i];for(;i>0&&(o*=256);)a+=this[t+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*e)),a};m.prototype.readInt8=function(t,e){return t=t>>>0,e||z(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};m.prototype.readInt16LE=function(t,e){t=t>>>0,e||z(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};m.prototype.readInt16BE=function(t,e){t=t>>>0,e||z(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};m.prototype.readInt32LE=function(t,e){return t=t>>>0,e||z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};m.prototype.readInt32BE=function(t,e){return t=t>>>0,e||z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};m.prototype.readBigInt64LE=De(function(t){t=t>>>0,rt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&_t(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)});m.prototype.readBigInt64BE=De(function(t){t=t>>>0,rt(t,"offset");let e=this[t],n=this[t+7];(e===void 0||n===void 0)&&_t(t,this.length-8);let i=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)});m.prototype.readFloatLE=function(t,e){return t=t>>>0,e||z(t,4,this.length),tt.read(this,t,!0,23,4)};m.prototype.readFloatBE=function(t,e){return t=t>>>0,e||z(t,4,this.length),tt.read(this,t,!1,23,4)};m.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||z(t,8,this.length),tt.read(this,t,!0,52,8)};m.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||z(t,8,this.length),tt.read(this,t,!1,52,8)};function V(r,t,e,n,i,o){if(!m.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(e+n>r.length)throw new RangeError("Index out of range")}m.prototype.writeUintLE=m.prototype.writeUIntLE=function(t,e,n,i){if(t=+t,e=e>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;V(this,t,e,n,s,0)}let o=1,a=0;for(this[e]=t&255;++a<n&&(o*=256);)this[e+a]=t/o&255;return e+n};m.prototype.writeUintBE=m.prototype.writeUIntBE=function(t,e,n,i){if(t=+t,e=e>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;V(this,t,e,n,s,0)}let o=n-1,a=1;for(this[e+o]=t&255;--o>=0&&(a*=256);)this[e+o]=t/a&255;return e+n};m.prototype.writeUint8=m.prototype.writeUInt8=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,1,255,0),this[e]=t&255,e+1};m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2};m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2};m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4};m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function $n(r,t,e,n,i){Xn(t,n,i,r,e,7);let o=Number(t&BigInt(4294967295));r[e++]=o,o=o>>8,r[e++]=o,o=o>>8,r[e++]=o,o=o>>8,r[e++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return r[e++]=a,a=a>>8,r[e++]=a,a=a>>8,r[e++]=a,a=a>>8,r[e++]=a,e}function Yn(r,t,e,n,i){Xn(t,n,i,r,e,7);let o=Number(t&BigInt(4294967295));r[e+7]=o,o=o>>8,r[e+6]=o,o=o>>8,r[e+5]=o,o=o>>8,r[e+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return r[e+3]=a,a=a>>8,r[e+2]=a,a=a>>8,r[e+1]=a,a=a>>8,r[e]=a,e+8}m.prototype.writeBigUInt64LE=De(function(t,e=0){return $n(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});m.prototype.writeBigUInt64BE=De(function(t,e=0){return Yn(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))});m.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e=e>>>0,!i){let c=Math.pow(2,8*n-1);V(this,t,e,n,c-1,-c)}let o=0,a=1,s=0;for(this[e]=t&255;++o<n&&(a*=256);)t<0&&s===0&&this[e+o-1]!==0&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n};m.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e=e>>>0,!i){let c=Math.pow(2,8*n-1);V(this,t,e,n,c-1,-c)}let o=n-1,a=1,s=0;for(this[e+o]=t&255;--o>=0&&(a*=256);)t<0&&s===0&&this[e+o+1]!==0&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n};m.prototype.writeInt8=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1};m.prototype.writeInt16LE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2};m.prototype.writeInt16BE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2};m.prototype.writeInt32LE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4};m.prototype.writeInt32BE=function(t,e,n){return t=+t,e=e>>>0,n||V(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};m.prototype.writeBigInt64LE=De(function(t,e=0){return $n(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});m.prototype.writeBigInt64BE=De(function(t,e=0){return Yn(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Vn(r,t,e,n,i,o){if(e+n>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function Gn(r,t,e,n,i){return t=+t,e=e>>>0,i||Vn(r,t,e,4,34028234663852886e22,-34028234663852886e22),tt.write(r,t,e,n,23,4),e+4}m.prototype.writeFloatLE=function(t,e,n){return Gn(this,t,e,!0,n)};m.prototype.writeFloatBE=function(t,e,n){return Gn(this,t,e,!1,n)};function Kn(r,t,e,n,i){return t=+t,e=e>>>0,i||Vn(r,t,e,8,17976931348623157e292,-17976931348623157e292),tt.write(r,t,e,n,52,8),e+8}m.prototype.writeDoubleLE=function(t,e,n){return Kn(this,t,e,!0,n)};m.prototype.writeDoubleBE=function(t,e,n){return Kn(this,t,e,!1,n)};m.prototype.copy=function(t,e,n,i){if(!m.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i<n&&(i=n),i===n||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);let o=i-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,n,i):Uint8Array.prototype.set.call(t,this.subarray(n,i),e),o};m.prototype.fill=function(t,e,n,i){if(typeof t=="string"){if(typeof e=="string"?(i=e,e=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!m.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(t.length===1){let a=t.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e=e>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=e;o<n;++o)this[o]=t;else{let a=m.isBuffer(t)?t:m.from(t,i),s=a.length;if(s===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var et={};function Ar(r,t,e){et[r]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}Ar("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Ar("ERR_INVALID_ARG_TYPE",function(r,t){return`The "${r}" argument must be of type number. Received type ${typeof t}`},TypeError);Ar("ERR_OUT_OF_RANGE",function(r,t,e){let n=`The value of "${r}" is out of range.`,i=e;return Number.isInteger(e)&&Math.abs(e)>2**32?i=Fn(String(e)):typeof e=="bigint"&&(i=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(i=Fn(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);function Fn(r){let t="",e=r.length,n=r[0]==="-"?1:0;for(;e>=n+4;e-=3)t=`_${r.slice(e-3,e)}${t}`;return`${r.slice(0,e)}${t}`}function Ta(r,t,e){rt(t,"offset"),(r[t]===void 0||r[t+e]===void 0)&&_t(t,r.length-(e+1))}function Xn(r,t,e,n,i,o){if(r>e||r<t){let a=typeof t=="bigint"?"n":"",s;throw o>3?t===0||t===BigInt(0)?s=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:s=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:s=`>= ${t}${a} and <= ${e}${a}`,new et.ERR_OUT_OF_RANGE("value",s,r)}Ta(n,i,o)}function rt(r,t){if(typeof r!="number")throw new et.ERR_INVALID_ARG_TYPE(t,"number",r)}function _t(r,t,e){throw Math.floor(r)!==r?(rt(r,e),new et.ERR_OUT_OF_RANGE(e||"offset","an integer",r)):t<0?new et.ERR_BUFFER_OUT_OF_BOUNDS:new et.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,r)}var Ca=/[^+/0-9A-Za-z-_]/g;function La(r){if(r=r.split("=")[0],r=r.trim().replace(Ca,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function br(r,t){t=t||1/0;let e,n=r.length,i=null,o=[];for(let a=0;a<n;++a){if(e=r.charCodeAt(a),e>55295&&e<57344){if(!i){if(e>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(t-=3)>-1&&o.push(239,191,189),i=e;continue}e=(i-55296<<10|e-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((t-=1)<0)break;o.push(e)}else if(e<2048){if((t-=2)<0)break;o.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;o.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return o}function Ra(r){let t=[];for(let e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function Ua(r,t){let e,n,i,o=[];for(let a=0;a<r.length&&!((t-=2)<0);++a)e=r.charCodeAt(a),n=e>>8,i=e%256,o.push(i),o.push(n);return o}function Wn(r){return _r.toByteArray(La(r))}function Yt(r,t,e,n){let i;for(i=0;i<n&&!(i+e>=t.length||i>=r.length);++i)t[i+e]=r[i];return i}function ae(r,t){return r instanceof t||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===t.name}function Ir(r){return r!==r}var Na=(function(){let r="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){let n=e*16;for(let i=0;i<16;++i)t[n+i]=r[e]+r[i]}return t})();function De(r){return typeof BigInt>"u"?ka:r}function ka(){throw new Error("BigInt not supported")}});var Di=Z((Wl,ft)=>{"use strict";function st(r){let t=r.length;for(;--t>=0;)r[t]=0}var os=0,hi=1,as=2,ss=3,fs=258,Hr=29,Bt=256,wt=Bt+1+Hr,at=30,$r=19,di=2*wt+1,Ve=15,Or=16,ls=7,Yr=256,pi=16,mi=17,Ei=18,Zr=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]),er=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]),cs=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),xi=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),us=512,Ie=new Array((wt+2)*2);st(Ie);var bt=new Array(at*2);st(bt);var St=new Array(us);st(St);var At=new Array(fs-ss+1);st(At);var Vr=new Array(Hr);st(Vr);var tr=new Array(at);st(tr);function Fr(r,t,e,n,i){this.static_tree=r,this.extra_bits=t,this.extra_base=e,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}var _i,gi,yi;function Pr(r,t){this.dyn_tree=r,this.max_code=0,this.stat_desc=t}var bi=r=>r<256?St[r]:St[256+(r>>>7)],It=(r,t)=>{r.pending_buf[r.pending++]=t&255,r.pending_buf[r.pending++]=t>>>8&255},G=(r,t,e)=>{r.bi_valid>Or-e?(r.bi_buf|=t<<r.bi_valid&65535,It(r,r.bi_buf),r.bi_buf=t>>Or-r.bi_valid,r.bi_valid+=e-Or):(r.bi_buf|=t<<r.bi_valid&65535,r.bi_valid+=e)},pe=(r,t,e)=>{G(r,e[t*2],e[t*2+1])},wi=(r,t)=>{let e=0;do e|=r&1,r>>>=1,e<<=1;while(--t>0);return e>>>1},hs=r=>{r.bi_valid===16?(It(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):r.bi_valid>=8&&(r.pending_buf[r.pending++]=r.bi_buf&255,r.bi_buf>>=8,r.bi_valid-=8)},ds=(r,t)=>{let e=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,f,l,d,h,u,E,_=0;for(h=0;h<=Ve;h++)r.bl_count[h]=0;for(e[r.heap[r.heap_max]*2+1]=0,f=r.heap_max+1;f<di;f++)l=r.heap[f],h=e[e[l*2+1]*2+1]+1,h>c&&(h=c,_++),e[l*2+1]=h,!(l>n)&&(r.bl_count[h]++,u=0,l>=s&&(u=a[l-s]),E=e[l*2],r.opt_len+=E*(h+u),o&&(r.static_len+=E*(i[l*2+1]+u)));if(_!==0){do{for(h=c-1;r.bl_count[h]===0;)h--;r.bl_count[h]--,r.bl_count[h+1]+=2,r.bl_count[c]--,_-=2}while(_>0);for(h=c;h!==0;h--)for(l=r.bl_count[h];l!==0;)d=r.heap[--f],!(d>n)&&(e[d*2+1]!==h&&(r.opt_len+=(h-e[d*2+1])*e[d*2],e[d*2+1]=h),l--)}},Si=(r,t,e)=>{let n=new Array(Ve+1),i=0,o,a;for(o=1;o<=Ve;o++)i=i+e[o-1]<<1,n[o]=i;for(a=0;a<=t;a++){let s=r[a*2+1];s!==0&&(r[a*2]=wi(n[s]++,s))}},ps=()=>{let r,t,e,n,i,o=new Array(Ve+1);for(e=0,n=0;n<Hr-1;n++)for(Vr[n]=e,r=0;r<1<<Zr[n];r++)At[e++]=n;for(At[e-1]=n,i=0,n=0;n<16;n++)for(tr[n]=i,r=0;r<1<<er[n];r++)St[i++]=n;for(i>>=7;n<at;n++)for(tr[n]=i<<7,r=0;r<1<<er[n]-7;r++)St[256+i++]=n;for(t=0;t<=Ve;t++)o[t]=0;for(r=0;r<=143;)Ie[r*2+1]=8,r++,o[8]++;for(;r<=255;)Ie[r*2+1]=9,r++,o[9]++;for(;r<=279;)Ie[r*2+1]=7,r++,o[7]++;for(;r<=287;)Ie[r*2+1]=8,r++,o[8]++;for(Si(Ie,wt+1,o),r=0;r<at;r++)bt[r*2+1]=5,bt[r*2]=wi(r,5);_i=new Fr(Ie,Zr,Bt+1,wt,Ve),gi=new Fr(bt,er,0,at,Ve),yi=new Fr(new Array(0),cs,0,$r,ls)},Ai=r=>{let t;for(t=0;t<wt;t++)r.dyn_ltree[t*2]=0;for(t=0;t<at;t++)r.dyn_dtree[t*2]=0;for(t=0;t<$r;t++)r.bl_tree[t*2]=0;r.dyn_ltree[Yr*2]=1,r.opt_len=r.static_len=0,r.sym_next=r.matches=0},Ii=r=>{r.bi_valid>8?It(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0},si=(r,t,e,n)=>{let i=t*2,o=e*2;return r[i]<r[o]||r[i]===r[o]&&n[t]<=n[e]},Mr=(r,t,e)=>{let n=r.heap[e],i=e<<1;for(;i<=r.heap_len&&(i<r.heap_len&&si(t,r.heap[i+1],r.heap[i],r.depth)&&i++,!si(t,n,r.heap[i],r.depth));)r.heap[e]=r.heap[i],e=i,i<<=1;r.heap[e]=n},fi=(r,t,e)=>{let n,i,o=0,a,s;if(r.sym_next!==0)do n=r.pending_buf[r.sym_buf+o++]&255,n+=(r.pending_buf[r.sym_buf+o++]&255)<<8,i=r.pending_buf[r.sym_buf+o++],n===0?pe(r,i,t):(a=At[i],pe(r,a+Bt+1,t),s=Zr[a],s!==0&&(i-=Vr[a],G(r,i,s)),n--,a=bi(n),pe(r,a,e),s=er[a],s!==0&&(n-=tr[a],G(r,n,s)));while(o<r.sym_next);pe(r,Yr,t)},zr=(r,t)=>{let e=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,c=-1,f;for(r.heap_len=0,r.heap_max=di,a=0;a<o;a++)e[a*2]!==0?(r.heap[++r.heap_len]=c=a,r.depth[a]=0):e[a*2+1]=0;for(;r.heap_len<2;)f=r.heap[++r.heap_len]=c<2?++c:0,e[f*2]=1,r.depth[f]=0,r.opt_len--,i&&(r.static_len-=n[f*2+1]);for(t.max_code=c,a=r.heap_len>>1;a>=1;a--)Mr(r,e,a);f=o;do a=r.heap[1],r.heap[1]=r.heap[r.heap_len--],Mr(r,e,1),s=r.heap[1],r.heap[--r.heap_max]=a,r.heap[--r.heap_max]=s,e[f*2]=e[a*2]+e[s*2],r.depth[f]=(r.depth[a]>=r.depth[s]?r.depth[a]:r.depth[s])+1,e[a*2+1]=e[s*2+1]=f,r.heap[1]=f++,Mr(r,e,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],ds(r,t),Si(e,c,r.bl_count)},li=(r,t,e)=>{let n,i=-1,o,a=t[1],s=0,c=7,f=4;for(a===0&&(c=138,f=3),t[(e+1)*2+1]=65535,n=0;n<=e;n++)o=a,a=t[(n+1)*2+1],!(++s<c&&o===a)&&(s<f?r.bl_tree[o*2]+=s:o!==0?(o!==i&&r.bl_tree[o*2]++,r.bl_tree[pi*2]++):s<=10?r.bl_tree[mi*2]++:r.bl_tree[Ei*2]++,s=0,i=o,a===0?(c=138,f=3):o===a?(c=6,f=3):(c=7,f=4))},ci=(r,t,e)=>{let n,i=-1,o,a=t[1],s=0,c=7,f=4;for(a===0&&(c=138,f=3),n=0;n<=e;n++)if(o=a,a=t[(n+1)*2+1],!(++s<c&&o===a)){if(s<f)do pe(r,o,r.bl_tree);while(--s!==0);else o!==0?(o!==i&&(pe(r,o,r.bl_tree),s--),pe(r,pi,r.bl_tree),G(r,s-3,2)):s<=10?(pe(r,mi,r.bl_tree),G(r,s-3,3)):(pe(r,Ei,r.bl_tree),G(r,s-11,7));s=0,i=o,a===0?(c=138,f=3):o===a?(c=6,f=3):(c=7,f=4)}},ms=r=>{let t;for(li(r,r.dyn_ltree,r.l_desc.max_code),li(r,r.dyn_dtree,r.d_desc.max_code),zr(r,r.bl_desc),t=$r-1;t>=3&&r.bl_tree[xi[t]*2+1]===0;t--);return r.opt_len+=3*(t+1)+5+5+4,t},Es=(r,t,e,n)=>{let i;for(G(r,t-257,5),G(r,e-1,5),G(r,n-4,4),i=0;i<n;i++)G(r,r.bl_tree[xi[i]*2+1],3);ci(r,r.dyn_ltree,t-1),ci(r,r.dyn_dtree,e-1)},xs=r=>{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&r.dyn_ltree[e*2]!==0)return 0;if(r.dyn_ltree[18]!==0||r.dyn_ltree[20]!==0||r.dyn_ltree[26]!==0)return 1;for(e=32;e<Bt;e++)if(r.dyn_ltree[e*2]!==0)return 1;return 0},ui=!1,_s=r=>{ui||(ps(),ui=!0),r.l_desc=new Pr(r.dyn_ltree,_i),r.d_desc=new Pr(r.dyn_dtree,gi),r.bl_desc=new Pr(r.bl_tree,yi),r.bi_buf=0,r.bi_valid=0,Ai(r)},Bi=(r,t,e,n)=>{G(r,(os<<1)+(n?1:0),3),Ii(r),It(r,e),It(r,~e),e&&r.pending_buf.set(r.window.subarray(t,t+e),r.pending),r.pending+=e},gs=r=>{G(r,hi<<1,3),pe(r,Yr,Ie),hs(r)},ys=(r,t,e,n)=>{let i,o,a=0;r.level>0?(r.strm.data_type===2&&(r.strm.data_type=xs(r)),zr(r,r.l_desc),zr(r,r.d_desc),a=ms(r),i=r.opt_len+3+7>>>3,o=r.static_len+3+7>>>3,o<=i&&(i=o)):i=o=e+5,e+4<=i&&t!==-1?Bi(r,t,e,n):r.strategy===4||o===i?(G(r,(hi<<1)+(n?1:0),3),fi(r,Ie,bt)):(G(r,(as<<1)+(n?1:0),3),Es(r,r.l_desc.max_code+1,r.d_desc.max_code+1,a+1),fi(r,r.dyn_ltree,r.dyn_dtree)),Ai(r),n&&Ii(r)},bs=(r,t,e)=>(r.pending_buf[r.sym_buf+r.sym_next++]=t,r.pending_buf[r.sym_buf+r.sym_next++]=t>>8,r.pending_buf[r.sym_buf+r.sym_next++]=e,t===0?r.dyn_ltree[e*2]++:(r.matches++,t--,r.dyn_ltree[(At[e]+Bt+1)*2]++,r.dyn_dtree[bi(t)*2]++),r.sym_next===r.sym_end);ft.exports._tr_init=_s;ft.exports._tr_stored_block=Bi;ft.exports._tr_flush_block=ys;ft.exports._tr_tally=bs;ft.exports._tr_align=gs});var Gr=Z((ql,Ti)=>{"use strict";var ws=(r,t,e,n)=>{let i=r&65535|0,o=r>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do i=i+t[n++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0};Ti.exports=ws});var Kr=Z((jl,Ci)=>{"use strict";var Ss=()=>{let r,t=[];for(var e=0;e<256;e++){r=e;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;t[e]=r}return t},As=new Uint32Array(Ss()),Is=(r,t,e,n)=>{let i=As,o=n+e;r^=-1;for(let a=n;a<o;a++)r=r>>>8^i[(r^t[a])&255];return r^-1};Ci.exports=Is});var rr=Z((Jl,Li)=>{"use strict";Li.exports={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"}});var ve=Z((Ql,Ri)=>{"use strict";Ri.exports={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}});var zi=Z((ec,_e)=>{"use strict";var{_tr_init:Bs,_tr_stored_block:qr,_tr_flush_block:Ds,_tr_tally:Me,_tr_align:Ts}=Di(),vi=Gr(),Oe=Kr(),Cs=rr(),{Z_NO_FLUSH:Ze,Z_PARTIAL_FLUSH:Ls,Z_FULL_FLUSH:Rs,Z_FINISH:j,Z_BLOCK:Ui,Z_OK:$,Z_STREAM_END:Ni,Z_STREAM_ERROR:Ee,Z_DATA_ERROR:Us,Z_BUF_ERROR:Xr,Z_DEFAULT_COMPRESSION:Ns,Z_FILTERED:ks,Z_HUFFMAN_ONLY:nr,Z_RLE:vs,Z_FIXED:Os,Z_DEFAULT_STRATEGY:Fs,Z_UNKNOWN:Ps,Z_DEFLATED:ir}=ve(),Ms=9,Zs=15,zs=8,Hs=29,$s=256,jr=$s+1+Hs,Ys=30,Vs=19,Gs=2*jr+1,Ks=15,U=3,Pe=258,xe=Pe+U+1,Xs=32,ct=42,nn=57,Jr=69,Qr=73,en=91,tn=103,Ge=113,Tt=666,Y=1,ht=2,Xe=3,dt=4,Ws=3,Ke=(r,t)=>(r.msg=Cs[t],t),ki=r=>r*2-(r>4?9:0),Fe=r=>{let t=r.length;for(;--t>=0;)r[t]=0},qs=r=>{let t,e,n,i=r.w_size;t=r.hash_size,n=t;do e=r.head[--n],r.head[n]=e>=i?e-i:0;while(--t);t=i,n=t;do e=r.prev[--n],r.prev[n]=e>=i?e-i:0;while(--t)},on=(r,t,e)=>(t<<r.hash_shift^e)&r.hash_mask,We=(r,t)=>{let e;if(r.legacy_hash)e=r.ins_h=on(r,r.ins_h,r.window[t+U-1]);else{let i=r.window,o=i[t]|i[t+1]<<8|i[t+2]<<16|i[t+3]<<24;e=r.ins_h=Math.imul(o,66521)+66521>>>16&r.hash_mask}let n=r.prev[t&r.w_mask]=r.head[e];return r.head[e]=t,n},K=r=>{let t=r.state,e=t.pending;e>r.avail_out&&(e=r.avail_out),e!==0&&(r.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),r.next_out),r.next_out+=e,t.pending_out+=e,r.total_out+=e,r.avail_out-=e,t.pending-=e,t.pending===0&&(t.pending_out=0))},X=(r,t)=>{Ds(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,t),r.block_start=r.strstart,K(r.strm)},N=(r,t)=>{r.pending_buf[r.pending++]=t},Dt=(r,t)=>{r.pending_buf[r.pending++]=t>>>8&255,r.pending_buf[r.pending++]=t&255},rn=(r,t,e,n)=>{let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,t.set(r.input.subarray(r.next_in,r.next_in+i),e),r.state.wrap===1?r.adler=vi(r.adler,t,i,e):r.state.wrap===2&&(r.adler=Oe(r.adler,t,i,e)),r.next_in+=i,r.total_in+=i,i)},Oi=(r,t)=>{let e=r.max_chain_length,n=r.strstart,i,o,a=r.prev_length,s=r.nice_match,c=r.strstart>r.w_size-xe?r.strstart-(r.w_size-xe):0,f=r.window,l=r.w_mask,d=r.prev,h=r.strstart+Pe,u=f[n+a-1],E=f[n+a];r.prev_length>=r.good_match&&(e>>=2),s>r.lookahead&&(s=r.lookahead);do if(i=t,!(f[i+a]!==E||f[i+a-1]!==u||f[i]!==f[n]||f[++i]!==f[n+1])){n+=2,i++;do;while(f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&n<h);if(o=Pe-(h-n),n=h-Pe,o>a){if(r.match_start=t,a=o,o>=s)break;u=f[n+a-1],E=f[n+a]}}while((t=d[t&l])>c&&--e!==0);return a<=r.lookahead?a:r.lookahead},ut=r=>{let t=r.w_size,e,n,i;do{if(n=r.window_size-r.lookahead-r.strstart,r.strstart>=t+(t-xe)&&(r.window.set(r.window.subarray(t,t+t-n),0),r.match_start-=t,r.strstart-=t,r.block_start-=t,r.insert>r.strstart&&(r.insert=r.strstart),qs(r),n+=t),r.strm.avail_in===0)break;if(e=rn(r.strm,r.window,r.strstart+r.lookahead,n),r.lookahead+=e,r.legacy_hash){if(r.lookahead+r.insert>=U)for(i=r.strstart-r.insert,r.ins_h=r.window[i],r.ins_h=on(r,r.ins_h,r.window[i+1]);r.insert&&(We(r,i),i++,r.insert--,!(r.lookahead+r.insert<U)););}else if(r.lookahead+r.insert>U)for(i=r.strstart-r.insert;r.insert&&(We(r,i),i++,r.insert--,!(r.lookahead+r.insert<=U)););}while(r.lookahead<xe&&r.strm.avail_in!==0)},Fi=(r,t)=>{let e=r.pending_buf_size-5>r.w_size?r.w_size:r.pending_buf_size-5,n,i,o,a=0,s=r.strm.avail_in;do{if(n=65535,o=r.bi_valid+42>>3,r.strm.avail_out<o||(o=r.strm.avail_out-o,i=r.strstart-r.block_start,n>i+r.strm.avail_in&&(n=i+r.strm.avail_in),n>o&&(n=o),n<e&&(n===0&&t!==j||t===Ze||n!==i+r.strm.avail_in)))break;a=t===j&&n===i+r.strm.avail_in?1:0,qr(r,0,0,a),r.pending_buf[r.pending-4]=n,r.pending_buf[r.pending-3]=n>>8,r.pending_buf[r.pending-2]=~n,r.pending_buf[r.pending-1]=~n>>8,K(r.strm),i&&(i>n&&(i=n),r.strm.output.set(r.window.subarray(r.block_start,r.block_start+i),r.strm.next_out),r.strm.next_out+=i,r.strm.avail_out-=i,r.strm.total_out+=i,r.block_start+=i,n-=i),n&&(rn(r.strm,r.strm.output,r.strm.next_out,n),r.strm.next_out+=n,r.strm.avail_out-=n,r.strm.total_out+=n)}while(a===0);return s-=r.strm.avail_in,s&&(s>=r.w_size?(r.matches=2,r.window.set(r.strm.input.subarray(r.strm.next_in-r.w_size,r.strm.next_in),0),r.strstart=r.w_size,r.insert=r.strstart):(r.window_size-r.strstart<=s&&(r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,r.insert>r.strstart&&(r.insert=r.strstart)),r.window.set(r.strm.input.subarray(r.strm.next_in-s,r.strm.next_in),r.strstart),r.strstart+=s,r.insert+=s>r.w_size-r.insert?r.w_size-r.insert:s),r.block_start=r.strstart),r.high_water<r.strstart&&(r.high_water=r.strstart),a?dt:t!==Ze&&t!==j&&r.strm.avail_in===0&&r.strstart===r.block_start?ht:(o=r.window_size-r.strstart,r.strm.avail_in>o&&r.block_start>=r.w_size&&(r.block_start-=r.w_size,r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,o+=r.w_size,r.insert>r.strstart&&(r.insert=r.strstart)),o>r.strm.avail_in&&(o=r.strm.avail_in),o&&(rn(r.strm,r.window,r.strstart,o),r.strstart+=o,r.insert+=o>r.w_size-r.insert?r.w_size-r.insert:o),r.high_water<r.strstart&&(r.high_water=r.strstart),o=r.bi_valid+42>>3,o=r.pending_buf_size-o>65535?65535:r.pending_buf_size-o,e=o>r.w_size?r.w_size:o,i=r.strstart-r.block_start,(i>=e||(i||t===j)&&t!==Ze&&r.strm.avail_in===0&&i<=o)&&(n=i>o?o:i,a=t===j&&r.strm.avail_in===0&&n===i?1:0,qr(r,r.block_start,n,a),r.block_start+=n,K(r.strm)),a?Xe:Y)},Wr=(r,t)=>{let e,n;for(;;){if(r.lookahead<xe){if(ut(r),r.lookahead<xe&&t===Ze)return Y;if(r.lookahead===0)break}if(e=0,r.lookahead>=U&&(e=We(r,r.strstart)),e!==0&&r.strstart-e<=r.w_size-xe&&(r.match_length=Oi(r,e)),r.match_length>=U)if(n=Me(r,r.strstart-r.match_start,r.match_length-U),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=U){r.match_length--;do r.strstart++,e=We(r,r.strstart);while(--r.match_length!==0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.legacy_hash&&(r.ins_h=r.window[r.strstart],r.ins_h=on(r,r.ins_h,r.window[r.strstart+1]));else n=Me(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(n&&(X(r,!1),r.strm.avail_out===0))return Y}return r.insert=r.strstart<U-1?r.strstart:U-1,t===j?(X(r,!0),r.strm.avail_out===0?Xe:dt):r.sym_next&&(X(r,!1),r.strm.avail_out===0)?Y:ht},lt=(r,t)=>{let e,n,i;for(;;){if(r.lookahead<xe){if(ut(r),r.lookahead<xe&&t===Ze)return Y;if(r.lookahead===0)break}if(e=0,r.lookahead>=U&&(e=We(r,r.strstart)),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=U-1,e!==0&&r.prev_length<r.max_lazy_match&&r.strstart-e<=r.w_size-xe&&(r.match_length=Oi(r,e),r.match_length<=5&&(r.strategy===ks||r.match_length===U&&r.strstart-r.match_start>4096)&&(r.match_length=U-1)),r.prev_length>=U&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-U,n=Me(r,r.strstart-1-r.prev_match,r.prev_length-U),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(e=We(r,r.strstart));while(--r.prev_length!==0);if(r.match_available=0,r.match_length=U-1,r.strstart++,n&&(X(r,!1),r.strm.avail_out===0))return Y}else if(r.match_available){if(n=Me(r,0,r.window[r.strstart-1]),n&&X(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return Y}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(n=Me(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<U-1?r.strstart:U-1,t===j?(X(r,!0),r.strm.avail_out===0?Xe:dt):r.sym_next&&(X(r,!1),r.strm.avail_out===0)?Y:ht},js=(r,t)=>{let e,n,i,o,a=r.window;for(;;){if(r.lookahead<=Pe){if(ut(r),r.lookahead<=Pe&&t===Ze)return Y;if(r.lookahead===0)break}if(r.match_length=0,r.lookahead>=U&&r.strstart>0&&(i=r.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=r.strstart+Pe;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);r.match_length=Pe-(o-i),r.match_length>r.lookahead&&(r.match_length=r.lookahead)}if(r.match_length>=U?(e=Me(r,1,r.match_length-U),r.lookahead-=r.match_length,r.strstart+=r.match_length,r.match_length=0):(e=Me(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++),e&&(X(r,!1),r.strm.avail_out===0))return Y}return r.insert=0,t===j?(X(r,!0),r.strm.avail_out===0?Xe:dt):r.sym_next&&(X(r,!1),r.strm.avail_out===0)?Y:ht},Js=(r,t)=>{let e;for(;;){if(r.lookahead===0&&(ut(r),r.lookahead===0)){if(t===Ze)return Y;break}if(r.match_length=0,e=Me(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++,e&&(X(r,!1),r.strm.avail_out===0))return Y}return r.insert=0,t===j?(X(r,!0),r.strm.avail_out===0?Xe:dt):r.sym_next&&(X(r,!1),r.strm.avail_out===0)?Y:ht};function me(r,t,e,n,i){this.good_length=r,this.max_lazy=t,this.nice_length=e,this.max_chain=n,this.func=i}var Ct=[new me(0,0,0,0,Fi),new me(4,4,8,4,Wr),new me(4,5,16,8,Wr),new me(4,6,32,32,Wr),new me(4,4,16,16,lt),new me(8,16,32,32,lt),new me(8,16,128,128,lt),new me(8,32,128,256,lt),new me(32,128,258,1024,lt),new me(32,258,258,4096,lt)],Qs=r=>{r.window_size=2*r.w_size,Fe(r.head),r.max_lazy_match=Ct[r.level].max_lazy,r.good_match=Ct[r.level].good_length,r.nice_match=Ct[r.level].nice_length,r.max_chain_length=Ct[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=U-1,r.match_available=0,r.ins_h=0};function ef(){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=ir,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.legacy_hash=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(Gs*2),this.dyn_dtree=new Uint16Array((2*Ys+1)*2),this.bl_tree=new Uint16Array((2*Vs+1)*2),Fe(this.dyn_ltree),Fe(this.dyn_dtree),Fe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Ks+1),this.heap=new Uint16Array(2*jr+1),Fe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*jr+1),Fe(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Lt=r=>{if(!r)return 1;let t=r.state;return!t||t.strm!==r||t.status!==ct&&t.status!==nn&&t.status!==Jr&&t.status!==Qr&&t.status!==en&&t.status!==tn&&t.status!==Ge&&t.status!==Tt?1:0},Pi=r=>{if(Lt(r))return Ke(r,Ee);r.total_in=r.total_out=0,r.data_type=Ps;let t=r.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?nn:t.wrap?ct:Ge,r.adler=t.wrap===2?0:1,t.last_flush=-2,Bs(t),$},Mi=r=>{let t=Pi(r);return t===$&&Qs(r.state),t},tf=(r,t)=>Lt(r)||r.state.wrap!==2?Ee:(r.state.gzhead=t,$),Zi=(r,t,e,n,i,o,a)=>{if(!r)return Ee;let s=1;if(t===Ns&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>Ms||e!==ir||n<8||n>15||t<0||t>9||o<0||o>Os||n===8&&s!==1)return Ke(r,Ee);n===8&&(n=9);let c=new ef;return r.state=c,c.strm=r,c.status=ct,c.wrap=s,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.legacy_hash=a?1:0,c.hash_bits=i+7,!c.legacy_hash&&c.hash_bits<15&&(c.hash_bits=15),c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+U-1)/U),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=t,c.strategy=o,c.method=e,Mi(r)},rf=(r,t)=>Zi(r,t,ir,Zs,zs,Fs),nf=(r,t)=>{if(Lt(r)||t>Ui||t<0)return r?Ke(r,Ee):Ee;let e=r.state;if(!r.output||r.avail_in!==0&&!r.input||e.status===Tt&&t!==j)return Ke(r,r.avail_out===0?Xr:Ee);let n=e.last_flush;if(e.last_flush=t,e.pending!==0){if(K(r),r.avail_out===0)return e.last_flush=-1,$}else if(r.avail_in===0&&ki(t)<=ki(n)&&t!==j)return Ke(r,Xr);if(e.status===Tt&&r.avail_in!==0)return Ke(r,Xr);if(e.status===ct&&e.wrap===0&&(e.status=Ge),e.status===ct){let i=ir+(e.w_bits-8<<4)<<8,o=-1;if(e.strategy>=nr||e.level<2?o=0:e.level<6?o=1:e.level===6?o=2:o=3,i|=o<<6,e.strstart!==0&&(i|=Xs),i+=31-i%31,Dt(e,i),e.strstart!==0&&(Dt(e,r.adler>>>16),Dt(e,r.adler&65535)),r.adler=1,e.status=Ge,K(r),e.pending!==0)return e.last_flush=-1,$}if(e.status===nn){if(r.adler=0,N(e,31),N(e,139),N(e,8),e.gzhead)N(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),N(e,e.gzhead.time&255),N(e,e.gzhead.time>>8&255),N(e,e.gzhead.time>>16&255),N(e,e.gzhead.time>>24&255),N(e,e.level===9?2:e.strategy>=nr||e.level<2?4:0),N(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(N(e,e.gzhead.extra.length&255),N(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(r.adler=Oe(r.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=Jr;else if(N(e,0),N(e,0),N(e,0),N(e,0),N(e,0),N(e,e.level===9?2:e.strategy>=nr||e.level<2?4:0),N(e,Ws),e.status=Ge,K(r),e.pending!==0)return e.last_flush=-1,$}if(e.status===Jr){if(e.gzhead.extra){let i=e.pending,o=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+o>e.pending_buf_size;){let s=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>i&&(r.adler=Oe(r.adler,e.pending_buf,e.pending-i,i)),e.gzindex+=s,K(r),e.pending!==0)return e.last_flush=-1,$;i=0,o-=s}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+o),e.pending),e.pending+=o,e.gzhead.hcrc&&e.pending>i&&(r.adler=Oe(r.adler,e.pending_buf,e.pending-i,i)),e.gzindex=0}e.status=Qr}if(e.status===Qr){if(e.gzhead.name){let i=e.pending,o;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>i&&(r.adler=Oe(r.adler,e.pending_buf,e.pending-i,i)),K(r),e.pending!==0)return e.last_flush=-1,$;i=0}e.gzindex<e.gzhead.name.length?o=e.gzhead.name.charCodeAt(e.gzindex++)&255:o=0,N(e,o)}while(o!==0);e.gzhead.hcrc&&e.pending>i&&(r.adler=Oe(r.adler,e.pending_buf,e.pending-i,i)),e.gzindex=0}e.status=en}if(e.status===en){if(e.gzhead.comment){let i=e.pending,o;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>i&&(r.adler=Oe(r.adler,e.pending_buf,e.pending-i,i)),K(r),e.pending!==0)return e.last_flush=-1,$;i=0}e.gzindex<e.gzhead.comment.length?o=e.gzhead.comment.charCodeAt(e.gzindex++)&255:o=0,N(e,o)}while(o!==0);e.gzhead.hcrc&&e.pending>i&&(r.adler=Oe(r.adler,e.pending_buf,e.pending-i,i))}e.status=tn}if(e.status===tn){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(K(r),e.pending!==0))return e.last_flush=-1,$;N(e,r.adler&255),N(e,r.adler>>8&255),r.adler=0}if(e.status=Ge,K(r),e.pending!==0)return e.last_flush=-1,$}if(r.avail_in!==0||e.lookahead!==0||t!==Ze&&e.status!==Tt){let i=e.level===0?Fi(e,t):e.strategy===nr?Js(e,t):e.strategy===vs?js(e,t):Ct[e.level].func(e,t);if((i===Xe||i===dt)&&(e.status=Tt),i===Y||i===Xe)return r.avail_out===0&&(e.last_flush=-1),$;if(i===ht&&(t===Ls?Ts(e):t!==Ui&&(qr(e,0,0,!1),t===Rs&&(Fe(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),K(r),r.avail_out===0))return e.last_flush=-1,$}return t!==j?$:e.wrap<=0?Ni:(e.wrap===2?(N(e,r.adler&255),N(e,r.adler>>8&255),N(e,r.adler>>16&255),N(e,r.adler>>24&255),N(e,r.total_in&255),N(e,r.total_in>>8&255),N(e,r.total_in>>16&255),N(e,r.total_in>>24&255)):(Dt(e,r.adler>>>16),Dt(e,r.adler&65535)),K(r),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?$:Ni)},of=r=>{if(Lt(r))return Ee;let t=r.state.status;return r.state=null,t===Ge?Ke(r,Us):$},af=(r,t)=>{let e=t.length;if(Lt(r))return Ee;let n=r.state,i=n.wrap;if(i===2||i===1&&n.status!==ct||n.lookahead)return Ee;if(i===1&&(r.adler=vi(r.adler,t,e,0)),n.wrap=0,e>=n.w_size){i===0&&(Fe(n.head),n.strstart=0,n.block_start=0,n.insert=0);let c=new Uint8Array(n.w_size);c.set(t.subarray(e-n.w_size,e),0),t=c,e=n.w_size}let o=r.avail_in,a=r.next_in,s=r.input;for(r.avail_in=e,r.next_in=0,r.input=t,ut(n);n.lookahead>=U;){let c=n.strstart,f=n.lookahead-(U-1);do We(n,c),c++;while(--f);n.strstart=c,n.lookahead=U-1,ut(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=U-1,n.match_available=0,r.next_in=a,r.input=s,r.avail_in=o,n.wrap=i,$};_e.exports.deflateInit=rf;_e.exports.deflateInit2=Zi;_e.exports.deflateReset=Mi;_e.exports.deflateResetKeep=Pi;_e.exports.deflateSetHeader=tf;_e.exports.deflate=nf;_e.exports.deflateEnd=of;_e.exports.deflateSetDictionary=af;_e.exports.deflateInfo="pako deflate (from Nodeca project)"});var sn=Z((tc,an)=>{"use strict";var sf=(r,t)=>Object.prototype.hasOwnProperty.call(r,t);an.exports.assign=function(r){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(let n in e)sf(e,n)&&(r[n]=e[n])}}return r};an.exports.flattenChunks=r=>{let t=0;for(let n=0,i=r.length;n<i;n++)t+=r[n].length;let e=new Uint8Array(t);for(let n=0,i=0,o=r.length;n<o;n++){let a=r[n];e.set(a,i),i+=a.length}return e}});var fn=Z((rc,or)=>{"use strict";var Hi=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Hi=!1}var Rt=new Uint8Array(256);for(let r=0;r<256;r++)Rt[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Rt[254]=Rt[255]=1;or.exports.string2buf=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let t,e,n,i,o,a=r.length,s=0;for(i=0;i<a;i++)e=r.charCodeAt(i),(e&64512)===55296&&i+1<a&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),i++)),s+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)e=r.charCodeAt(i),(e&64512)===55296&&i+1<a&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),i++)),e<128?t[o++]=e:e<2048?(t[o++]=192|e>>>6,t[o++]=128|e&63):e<65536?(t[o++]=224|e>>>12,t[o++]=128|e>>>6&63,t[o++]=128|e&63):(t[o++]=240|e>>>18,t[o++]=128|e>>>12&63,t[o++]=128|e>>>6&63,t[o++]=128|e&63);return t};var ff=(r,t)=>{if(t<65534&&r.subarray&&Hi)return String.fromCharCode.apply(null,r.length===t?r:r.subarray(0,t));let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(r[n]);return e};or.exports.buf2string=(r,t)=>{let e=t||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,t));let n,i,o=new Array(e*2);for(i=0,n=0;n<e;){let a=r[n++];if(a<128){o[i++]=a;continue}let s=Rt[a];if(s>4){o[i++]=65533,n+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&n<e;)a=a<<6|r[n++]&63,s--;if(s>1){o[i++]=65533;continue}a<65536?o[i++]=a:(a-=65536,o[i++]=55296|a>>10&1023,o[i++]=56320|a&1023)}return ff(o,i)};or.exports.utf8border=(r,t)=>{t=t||r.length,t>r.length&&(t=r.length);let e=t-1;for(;e>=0&&(r[e]&192)===128;)e--;return e<0||e===0?t:e+Rt[r[e]]>t?e:t}});var ln=Z((nc,$i)=>{"use strict";function lf(){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}$i.exports=lf});var Ki=Z((ic,pt)=>{"use strict";var Ut=zi(),Yi=sn(),Vi=fn(),cn=rr(),cf=ln(),Gi=Object.prototype.toString,{Z_NO_FLUSH:uf,Z_SYNC_FLUSH:hf,Z_FULL_FLUSH:df,Z_FINISH:pf,Z_OK:ar,Z_STREAM_END:mf,Z_DEFAULT_COMPRESSION:Ef,Z_DEFAULT_STRATEGY:xf,Z_DEFLATED:_f}=ve(),gf={level:Ef,method:_f,chunkSize:16384,windowBits:15,memLevel:8,strategy:xf,legacyHash:!0};function Nt(r){this.options=Yi.assign({},gf,r||{});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 cf,this.strm.avail_out=0;let e=Ut.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(e!==ar)throw new Error(cn[e]);if(t.header&&Ut.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=Vi.string2buf(t.dictionary):Gi.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,e=Ut.deflateSetDictionary(this.strm,n),e!==ar)throw new Error(cn[e]);this._dict_set=!0}}Nt.prototype.push=function(r,t){let e=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?pf:uf,typeof r=="string"?e.input=Vi.string2buf(r):Gi.call(r)==="[object ArrayBuffer]"?e.input=new Uint8Array(r):e.input=r,e.next_in=0,e.avail_in=e.input.length;;){if(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),(o===hf||o===df)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(i=Ut.deflate(e,o),i===mf)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),i=Ut.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===ar;if(e.avail_out===0){this.onData(e.output);continue}if(o>0&&e.next_out>0){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(e.avail_in===0)break}return!0};Nt.prototype.onData=function(r){this.chunks.push(r)};Nt.prototype.onEnd=function(r){r===ar&&(this.result=Yi.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function un(r,t){let e=new Nt(t);if(e.push(r,!0),e.err)throw e.msg||cn[e.err];return e.result}function yf(r,t){return t=t||{},t.raw=!0,un(r,t)}function bf(r,t){return t=t||{},t.gzip=!0,un(r,t)}pt.exports.Deflate=Nt;pt.exports.deflate=un;pt.exports.deflateRaw=yf;pt.exports.gzip=bf;pt.exports.constants=ve()});var Wi=Z((oc,Xi)=>{"use strict";Xi.exports=function(t,e){let n,i,o,a,s,c,f,l,d,h,u,E,_,b,p,B,S,g,y,C,w,v,L,D,T=t.state;n=t.next_in,L=t.input,i=n+(t.avail_in-5),o=t.next_out,D=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),c=T.dmax,f=T.wsize,l=T.whave,d=T.wnext,h=T.window,u=T.hold,E=T.bits,_=T.lencode,b=T.distcode,p=(1<<T.lenbits)-1,B=(1<<T.distbits)-1;e:do{E<15&&(u+=L[n++]<<E,E+=8,u+=L[n++]<<E,E+=8),S=_[u&p];t:for(;;){if(g=S>>>24,u>>>=g,E-=g,g=S>>>16&255,g===0)D[o++]=S&65535;else if(g&16){y=S&65535,g&=15,g&&(E<g&&(u+=L[n++]<<E,E+=8),y+=u&(1<<g)-1,u>>>=g,E-=g),E<15&&(u+=L[n++]<<E,E+=8,u+=L[n++]<<E,E+=8),S=b[u&B];r:for(;;){if(g=S>>>24,u>>>=g,E-=g,g=S>>>16&255,g&16){if(C=S&65535,g&=15,E<g&&(u+=L[n++]<<E,E+=8,E<g&&(u+=L[n++]<<E,E+=8)),C+=u&(1<<g)-1,C>c){t.msg="invalid distance too far back",T.mode=16209;break e}if(u>>>=g,E-=g,g=o-a,C>g){if(g=C-g,g>l&&T.sane){t.msg="invalid distance too far back",T.mode=16209;break e}if(w=0,v=h,d===0){if(w+=f-g,g<y){y-=g;do D[o++]=h[w++];while(--g);w=o-C,v=D}}else if(d<g){if(w+=f+d-g,g-=d,g<y){y-=g;do D[o++]=h[w++];while(--g);if(w=0,d<y){g=d,y-=g;do D[o++]=h[w++];while(--g);w=o-C,v=D}}}else if(w+=d-g,g<y){y-=g;do D[o++]=h[w++];while(--g);w=o-C,v=D}for(;y>2;)D[o++]=v[w++],D[o++]=v[w++],D[o++]=v[w++],y-=3;y&&(D[o++]=v[w++],y>1&&(D[o++]=v[w++]))}else{w=o-C;do D[o++]=D[w++],D[o++]=D[w++],D[o++]=D[w++],y-=3;while(y>2);y&&(D[o++]=D[w++],y>1&&(D[o++]=D[w++]))}}else if((g&64)===0){S=b[(S&65535)+(u&(1<<g)-1)];continue r}else{t.msg="invalid distance code",T.mode=16209;break e}break}}else if((g&64)===0){S=_[(S&65535)+(u&(1<<g)-1)];continue t}else if(g&32){T.mode=16191;break e}else{t.msg="invalid literal/length code",T.mode=16209;break e}break}}while(n<i&&o<s);y=E>>3,n-=y,E-=y<<3,u&=(1<<E)-1,t.next_in=n,t.next_out=o,t.avail_in=n<i?5+(i-n):5-(n-i),t.avail_out=o<s?257+(s-o):257-(o-s),T.hold=u,T.bits=E}});var ji=Z((ac,qi)=>{"use strict";var wf=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]),Sf=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,199,75]),Af=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]),If=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]),Bf=(r,t,e,n,i,o,a,s)=>{let c=s.bits,f=0,l=0,d=0,h=0,u=0,E=0,_=0,b=0,p=0,B=0,S,g,y,C,w,v=null,L,D=new Uint16Array(16),T=new Uint16Array(16),ze=null,Tn,Mt,Zt;for(f=0;f<=15;f++)D[f]=0;for(l=0;l<n;l++)D[t[e+l]]++;for(u=c,h=15;h>=1&&D[h]===0;h--);if(u>h&&(u=h),h===0)return i[o++]=1<<24|64<<16|0,i[o++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<h&&D[d]===0;d++);for(u<d&&(u=d),b=1,f=1;f<=15;f++)if(b<<=1,b-=D[f],b<0)return-1;if(b>0&&(r===0||h!==1))return-1;for(T[1]=0,f=1;f<15;f++)T[f+1]=T[f]+D[f];for(l=0;l<n;l++)t[e+l]!==0&&(a[T[t[e+l]]++]=l);if(r===0?(v=ze=a,L=20):r===1?(v=wf,ze=Sf,L=257):(v=Af,ze=If,L=0),B=0,l=0,f=d,w=o,E=u,_=0,y=-1,p=1<<u,C=p-1,r===1&&p>852||r===2&&p>592)return 1;for(;;){Tn=f-_,a[l]+1<L?(Mt=0,Zt=a[l]):a[l]>=L?(Mt=ze[a[l]-L],Zt=v[a[l]-L]):(Mt=96,Zt=0),S=1<<f-_,g=1<<E,d=g;do g-=S,i[w+(B>>_)+g]=Tn<<24|Mt<<16|Zt|0;while(g!==0);for(S=1<<f-1;B&S;)S>>=1;if(S!==0?(B&=S-1,B+=S):B=0,l++,--D[f]===0){if(f===h)break;f=t[e+a[l]]}if(f>u&&(B&C)!==y){for(_===0&&(_=u),w+=d,E=f-_,b=1<<E;E+_<h&&(b-=D[E+_],!(b<=0));)E++,b<<=1;if(p+=1<<E,r===1&&p>852||r===2&&p>592)return 1;y=B&C,i[y]=u<<24|E<<16|w-o|0}}return B!==0&&(i[w+B]=f-_<<24|64<<16|0),s.bits=u,0};qi.exports=Bf});var No=Z((sc,ie)=>{"use strict";var xn=Gr(),ge=Kr(),Df=Wi(),kt=ji(),Tf=0,Ao=1,Io=2,{Z_FINISH:Ji,Z_BLOCK:Cf,Z_TREES:sr,Z_OK:qe,Z_STREAM_END:Lf,Z_NEED_DICT:Rf,Z_STREAM_ERROR:J,Z_DATA_ERROR:Bo,Z_MEM_ERROR:_n,Z_BUF_ERROR:Uf,Z_DEFLATED:Qi}=ve(),ur=16180,eo=16181,to=16182,ro=16183,no=16184,io=16185,oo=16186,ao=16187,so=16188,fo=16189,cr=16190,Be=16191,hn=16192,lo=16193,dn=16194,co=16195,uo=16196,ho=16197,po=16198,fr=16199,lr=16200,mo=16201,Eo=16202,xo=16203,_o=16204,go=16205,pn=16206,yo=16207,bo=16208,F=16209,gn=16210,Do=16211,Nf=852,kf=592,vf=15,Of=vf,wo=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function Ff(){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}var je=r=>{if(!r)return 1;let t=r.state;return!t||t.strm!==r||t.mode<ur||t.mode>Do?1:0},To=r=>{if(je(r))return J;let t=r.state;return r.total_in=r.total_out=t.total=0,r.msg="",t.wrap&&(r.adler=t.wrap&1),t.mode=ur,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(Nf),t.distcode=t.distdyn=new Int32Array(kf),t.sane=1,t.back=-1,qe},Co=r=>{if(je(r))return J;let t=r.state;return t.wsize=0,t.whave=0,t.wnext=0,To(r)},Lo=(r,t)=>{let e;if(je(r))return J;let n=r.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?J:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=e,n.wbits=t,Co(r))},Ro=(r,t)=>{if(!r)return J;let e=new Ff;r.state=e,e.strm=r,e.window=null,e.mode=ur;let n=Lo(r,t);return n!==qe&&(r.state=null),n},Pf=r=>Ro(r,Of),So=!0,mn,En,Mf=r=>{if(So){mn=new Int32Array(512),En=new Int32Array(32);let t=0;for(;t<144;)r.lens[t++]=8;for(;t<256;)r.lens[t++]=9;for(;t<280;)r.lens[t++]=7;for(;t<288;)r.lens[t++]=8;for(kt(Ao,r.lens,0,288,mn,0,r.work,{bits:9}),t=0;t<32;)r.lens[t++]=5;kt(Io,r.lens,0,32,En,0,r.work,{bits:5}),So=!1}r.lencode=mn,r.lenbits=9,r.distcode=En,r.distbits=5},Uo=(r,t,e,n)=>{let i,o=r.state;return o.window===null&&(o.window=new Uint8Array(1<<o.wbits)),o.wsize===0&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0),n>=o.wsize?(o.window.set(t.subarray(e-o.wsize,e),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(t.subarray(e-n,e-n+i),o.wnext),n-=i,n?(o.window.set(t.subarray(e-n,e),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0},Zf=(r,t)=>{let e,n,i,o,a,s,c,f,l,d,h,u,E,_,b=0,p,B,S,g,y,C,w,v,L=new Uint8Array(4),D,T,ze=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(je(r)||!r.output||!r.input&&r.avail_in!==0)return J;e=r.state,e.mode===Be&&(e.mode=hn),a=r.next_out,i=r.output,c=r.avail_out,o=r.next_in,n=r.input,s=r.avail_in,f=e.hold,l=e.bits,d=s,h=c,v=qe;e:for(;;)switch(e.mode){case ur:if(e.wrap===0){e.mode=hn;break}for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.wrap&2&&f===35615){e.wbits===0&&(e.wbits=15),e.check=0,L[0]=f&255,L[1]=f>>>8&255,e.check=ge(e.check,L,2,0),f=0,l=0,e.mode=eo;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((f&255)<<8)+(f>>8))%31){r.msg="incorrect header check",e.mode=F;break}if((f&15)!==Qi){r.msg="unknown compression method",e.mode=F;break}if(f>>>=4,l-=4,w=(f&15)+8,e.wbits===0&&(e.wbits=w),w>15||w>e.wbits){r.msg="invalid window size",e.mode=F;break}e.dmax=1<<e.wbits,e.flags=0,r.adler=e.check=1,e.mode=f&512?fo:Be,f=0,l=0;break;case eo:for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.flags=f,(e.flags&255)!==Qi){r.msg="unknown compression method",e.mode=F;break}if(e.flags&57344){r.msg="unknown header flags set",e.mode=F;break}e.head&&(e.head.text=f>>8&1),e.flags&512&&e.wrap&4&&(L[0]=f&255,L[1]=f>>>8&255,e.check=ge(e.check,L,2,0)),f=0,l=0,e.mode=to;case to:for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.head&&(e.head.time=f),e.flags&512&&e.wrap&4&&(L[0]=f&255,L[1]=f>>>8&255,L[2]=f>>>16&255,L[3]=f>>>24&255,e.check=ge(e.check,L,4,0)),f=0,l=0,e.mode=ro;case ro:for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.head&&(e.head.xflags=f&255,e.head.os=f>>8),e.flags&512&&e.wrap&4&&(L[0]=f&255,L[1]=f>>>8&255,e.check=ge(e.check,L,2,0)),f=0,l=0,e.mode=no;case no:if(e.flags&1024){for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.length=f,e.head&&(e.head.extra_len=f),e.flags&512&&e.wrap&4&&(L[0]=f&255,L[1]=f>>>8&255,e.check=ge(e.check,L,2,0)),f=0,l=0}else e.head&&(e.head.extra=null);e.mode=io;case io:if(e.flags&1024&&(u=e.length,u>s&&(u=s),u&&(e.head&&(w=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(n.subarray(o,o+u),w)),e.flags&512&&e.wrap&4&&(e.check=ge(e.check,n,u,o)),s-=u,o+=u,e.length-=u),e.length))break e;e.length=0,e.mode=oo;case oo:if(e.flags&2048){if(s===0)break e;u=0;do w=n[o+u++],e.head&&w&&e.length<65536&&(e.head.name+=String.fromCharCode(w));while(w&&u<s);if(e.flags&512&&e.wrap&4&&(e.check=ge(e.check,n,u,o)),s-=u,o+=u,w)break e}else e.head&&(e.head.name=null);e.length=0,e.mode=ao;case ao:if(e.flags&4096){if(s===0)break e;u=0;do w=n[o+u++],e.head&&w&&e.length<65536&&(e.head.comment+=String.fromCharCode(w));while(w&&u<s);if(e.flags&512&&e.wrap&4&&(e.check=ge(e.check,n,u,o)),s-=u,o+=u,w)break e}else e.head&&(e.head.comment=null);e.mode=so;case so:if(e.flags&512){for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.wrap&4&&f!==(e.check&65535)){r.msg="header crc mismatch",e.mode=F;break}f=0,l=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),r.adler=e.check=0,e.mode=Be;break;case fo:for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}r.adler=e.check=wo(f),f=0,l=0,e.mode=cr;case cr:if(e.havedict===0)return r.next_out=a,r.avail_out=c,r.next_in=o,r.avail_in=s,e.hold=f,e.bits=l,Rf;r.adler=e.check=1,e.mode=Be;case Be:if(t===Cf||t===sr)break e;case hn:if(e.last){f>>>=l&7,l-=l&7,e.mode=pn;break}for(;l<3;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}switch(e.last=f&1,f>>>=1,l-=1,f&3){case 0:e.mode=lo;break;case 1:if(Mf(e),e.mode=fr,t===sr){f>>>=2,l-=2;break e}break;case 2:e.mode=uo;break;case 3:r.msg="invalid block type",e.mode=F}f>>>=2,l-=2;break;case lo:for(f>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if((f&65535)!==(f>>>16^65535)){r.msg="invalid stored block lengths",e.mode=F;break}if(e.length=f&65535,f=0,l=0,e.mode=dn,t===sr)break e;case dn:e.mode=co;case co:if(u=e.length,u){if(u>s&&(u=s),u>c&&(u=c),u===0)break e;i.set(n.subarray(o,o+u),a),s-=u,o+=u,c-=u,a+=u,e.length-=u;break}e.mode=Be;break;case uo:for(;l<14;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.nlen=(f&31)+257,f>>>=5,l-=5,e.ndist=(f&31)+1,f>>>=5,l-=5,e.ncode=(f&15)+4,f>>>=4,l-=4,e.nlen>286||e.ndist>30){r.msg="too many length or distance symbols",e.mode=F;break}e.have=0,e.mode=ho;case ho:for(;e.have<e.ncode;){for(;l<3;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.lens[ze[e.have++]]=f&7,f>>>=3,l-=3}for(;e.have<19;)e.lens[ze[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,D={bits:e.lenbits},v=kt(Tf,e.lens,0,19,e.lencode,0,e.work,D),e.lenbits=D.bits,v){r.msg="invalid code lengths set",e.mode=F;break}e.have=0,e.mode=po;case po:for(;e.have<e.nlen+e.ndist;){for(;b=e.lencode[f&(1<<e.lenbits)-1],p=b>>>24,B=b>>>16&255,S=b&65535,!(p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(S<16)f>>>=p,l-=p,e.lens[e.have++]=S;else{if(S===16){for(T=p+2;l<T;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(f>>>=p,l-=p,e.have===0){r.msg="invalid bit length repeat",e.mode=F;break}w=e.lens[e.have-1],u=3+(f&3),f>>>=2,l-=2}else if(S===17){for(T=p+3;l<T;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=p,l-=p,w=0,u=3+(f&7),f>>>=3,l-=3}else{for(T=p+7;l<T;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=p,l-=p,w=0,u=11+(f&127),f>>>=7,l-=7}if(e.have+u>e.nlen+e.ndist){r.msg="invalid bit length repeat",e.mode=F;break}for(;u--;)e.lens[e.have++]=w}}if(e.mode===F)break;if(e.lens[256]===0){r.msg="invalid code -- missing end-of-block",e.mode=F;break}if(e.lenbits=9,D={bits:e.lenbits},v=kt(Ao,e.lens,0,e.nlen,e.lencode,0,e.work,D),e.lenbits=D.bits,v){r.msg="invalid literal/lengths set",e.mode=F;break}if(e.distbits=6,e.distcode=e.distdyn,D={bits:e.distbits},v=kt(Io,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,D),e.distbits=D.bits,v){r.msg="invalid distances set",e.mode=F;break}if(e.mode=fr,t===sr)break e;case fr:e.mode=lr;case lr:if(s>=6&&c>=258){r.next_out=a,r.avail_out=c,r.next_in=o,r.avail_in=s,e.hold=f,e.bits=l,Df(r,h),a=r.next_out,i=r.output,c=r.avail_out,o=r.next_in,n=r.input,s=r.avail_in,f=e.hold,l=e.bits,e.mode===Be&&(e.back=-1);break}for(e.back=0;b=e.lencode[f&(1<<e.lenbits)-1],p=b>>>24,B=b>>>16&255,S=b&65535,!(p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(B&&(B&240)===0){for(g=p,y=B,C=S;b=e.lencode[C+((f&(1<<g+y)-1)>>g)],p=b>>>24,B=b>>>16&255,S=b&65535,!(g+p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=g,l-=g,e.back+=g}if(f>>>=p,l-=p,e.back+=p,e.length=S,B===0){e.mode=go;break}if(B&32){e.back=-1,e.mode=Be;break}if(B&64){r.msg="invalid literal/length code",e.mode=F;break}e.extra=B&15,e.mode=mo;case mo:if(e.extra){for(T=e.extra;l<T;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.length+=f&(1<<e.extra)-1,f>>>=e.extra,l-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=Eo;case Eo:for(;b=e.distcode[f&(1<<e.distbits)-1],p=b>>>24,B=b>>>16&255,S=b&65535,!(p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if((B&240)===0){for(g=p,y=B,C=S;b=e.distcode[C+((f&(1<<g+y)-1)>>g)],p=b>>>24,B=b>>>16&255,S=b&65535,!(g+p<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=g,l-=g,e.back+=g}if(f>>>=p,l-=p,e.back+=p,B&64){r.msg="invalid distance code",e.mode=F;break}e.offset=S,e.extra=B&15,e.mode=xo;case xo:if(e.extra){for(T=e.extra;l<T;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.offset+=f&(1<<e.extra)-1,f>>>=e.extra,l-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){r.msg="invalid distance too far back",e.mode=F;break}e.mode=_o;case _o:if(c===0)break e;if(u=h-c,e.offset>u){if(u=e.offset-u,u>e.whave&&e.sane){r.msg="invalid distance too far back",e.mode=F;break}u>e.wnext?(u-=e.wnext,E=e.wsize-u):E=e.wnext-u,u>e.length&&(u=e.length),_=e.window}else _=i,E=a-e.offset,u=e.length;u>c&&(u=c),c-=u,e.length-=u;do i[a++]=_[E++];while(--u);e.length===0&&(e.mode=lr);break;case go:if(c===0)break e;i[a++]=e.length,c--,e.mode=lr;break;case pn:if(e.wrap){for(;l<32;){if(s===0)break e;s--,f|=n[o++]<<l,l+=8}if(h-=c,r.total_out+=h,e.total+=h,e.wrap&4&&h&&(r.adler=e.check=e.flags?ge(e.check,i,h,a-h):xn(e.check,i,h,a-h)),h=c,e.wrap&4&&(e.flags?f:wo(f))!==e.check){r.msg="incorrect data check",e.mode=F;break}f=0,l=0}e.mode=yo;case yo:if(e.wrap&&e.flags){for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(e.wrap&4&&f!==(e.total&4294967295)){r.msg="incorrect length check",e.mode=F;break}f=0,l=0}e.mode=bo;case bo:v=Lf;break e;case F:v=Bo;break e;case gn:return _n;case Do:default:return J}return r.next_out=a,r.avail_out=c,r.next_in=o,r.avail_in=s,e.hold=f,e.bits=l,(e.wsize||h!==r.avail_out&&e.mode<F&&(e.mode<pn||t!==Ji))&&Uo(r,r.output,r.next_out,h-r.avail_out)?(e.mode=gn,_n):(d-=r.avail_in,h-=r.avail_out,r.total_in+=d,r.total_out+=h,e.total+=h,e.wrap&4&&h&&(r.adler=e.check=e.flags?ge(e.check,i,h,r.next_out-h):xn(e.check,i,h,r.next_out-h)),r.data_type=e.bits+(e.last?64:0)+(e.mode===Be?128:0)+(e.mode===fr||e.mode===dn?256:0),(d===0&&h===0||t===Ji)&&v===qe&&(v=Uf),v)},zf=r=>{if(je(r))return J;let t=r.state;return t.window&&(t.window=null),r.state=null,qe},Hf=(r,t)=>{if(je(r))return J;let e=r.state;return(e.wrap&2)===0?J:(e.head=t,t.done=!1,qe)},$f=(r,t)=>{let e=t.length,n,i,o;return je(r)||(n=r.state,n.wrap!==0&&n.mode!==cr)?J:n.mode===cr&&(i=1,i=xn(i,t,e,0),i!==n.check)?Bo:(o=Uo(r,t,e,e),o?(n.mode=gn,_n):(n.havedict=1,qe))};ie.exports.inflateReset=Co;ie.exports.inflateReset2=Lo;ie.exports.inflateResetKeep=To;ie.exports.inflateInit=Pf;ie.exports.inflateInit2=Ro;ie.exports.inflate=Zf;ie.exports.inflateEnd=zf;ie.exports.inflateGetHeader=Hf;ie.exports.inflateSetDictionary=$f;ie.exports.inflateInfo="pako inflate (from Nodeca project)"});var vo=Z((fc,ko)=>{"use strict";function Yf(){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}ko.exports=Yf});var zo=Z((lc,Et)=>{"use strict";var ye=No(),Mo=sn(),wn=fn(),Sn=rr(),Vf=ln(),Gf=vo(),Zo=Object.prototype.toString,{Z_NO_FLUSH:Kf,Z_FINISH:Oo,Z_OK:mt,Z_STREAM_END:yn,Z_NEED_DICT:bn,Z_STREAM_ERROR:Xf,Z_DATA_ERROR:Fo,Z_MEM_ERROR:Wf,Z_BUF_ERROR:Po}=ve(),qf={chunkSize:1024*64,windowBits:15,to:""};function vt(r){this.options=Mo.assign({},qf,r||{});let 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&&!(r&&r.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 Vf,this.strm.avail_out=0;let e=ye.inflateInit2(this.strm,t.windowBits);if(e!==mt)throw new Error(Sn[e]);if(this.header=new Gf,ye.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=wn.string2buf(t.dictionary):Zo.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=ye.inflateSetDictionary(this.strm,t.dictionary),e!==mt)))throw new Error(Sn[e])}vt.prototype.push=function(r,t){let e=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,a,s;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?Oo:Kf,Zo.call(r)==="[object ArrayBuffer]"?e.input=new Uint8Array(r):e.input=r,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),o=ye.inflate(e,a),o===bn&&i&&(o=ye.inflateSetDictionary(e,i),o===mt?o=ye.inflate(e,a):o===Fo&&(o=bn));e.avail_in>0&&o===yn&&e.state.wrap&2&&e.state.flags!==0&&e.input[e.next_in]!==0;)ye.inflateReset(e),o=ye.inflate(e,a);switch(o){case Xf:case Fo:case bn:case Wf:return this.onEnd(o),this.ended=!0,!1}if(s=e.avail_out,e.next_out&&(e.avail_out===0||o===yn||a>0))if(this.options.to==="string"){let c=wn.utf8border(e.output,e.next_out),f=e.next_out-c,l=wn.buf2string(e.output,c);e.next_out=f,e.avail_out=n-f,f&&e.output.set(e.output.subarray(c,c+f),0),this.onData(l)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out)),e.avail_out=0,e.next_out=0;if(!((o===mt||o===Po)&&s===0)){if(o===yn)return o=ye.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(e.avail_in===0){if(a===Oo)return o=ye.inflateEnd(this.strm),this.onEnd(o===mt?Po:o),this.ended=!0,!1;break}}}return!0};vt.prototype.onData=function(r){this.chunks.push(r)};vt.prototype.onEnd=function(r){r===mt&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Mo.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function An(r,t){let e=new vt(t);if(e.push(r,!0),e.err)throw e.msg||Sn[e.err];return e.result}function jf(r,t){return t=t||{},t.raw=!0,An(r,t)}Et.exports.Inflate=vt;Et.exports.inflate=An;Et.exports.inflateRaw=jf;Et.exports.ungzip=An;Et.exports.constants=ve()});var In=Z((cc,be)=>{"use strict";var{Deflate:Jf,deflate:Qf,deflateRaw:el,gzip:tl}=Ki(),{Inflate:rl,inflate:nl,inflateRaw:il,ungzip:ol}=zo(),al=ve();be.exports.Deflate=Jf;be.exports.deflate=Qf;be.exports.deflateRaw=el;be.exports.gzip=tl;be.exports.Inflate=rl;be.exports.inflate=nl;be.exports.inflateRaw=il;be.exports.ungzip=ol;be.exports.constants=al});var El={};ea(El,{AES256_KEY_SIZE:()=>Ye,AES256_PWD_VERIFY_SIZE:()=>Ce,AES256_SALT_SIZE:()=>ce,AES_AUTH_CODE_SIZE:()=>ue,AES_EXTRA_FIELD_SIZE:()=>Le,AES_OVERHEAD:()=>Vt,CENTRAL_DIR:()=>A,CENTRAL_DIRECTORY_END:()=>Qn,CENTRAL_END:()=>ee,CENTRAL_FILE_HEADER:()=>Jn,CMP_METHOD:()=>I,DATATYPE:()=>we,DATA_DESC:()=>Pa,DATA_DESCRIPTOR:()=>Fa,DOS_FILE_ATTR:()=>Ue,ENCRYPT_HDR_SIZE:()=>Te,EXTENSIBLE_DATA_FIELDS:()=>Ma,EncryptionManager:()=>mr,Errors:()=>O,FILE_SYSTEM:()=>P,GP_FLAG:()=>M,HDR_ID:()=>R,HashCalculator:()=>yt,HashCalculatorClass:()=>de,LOCAL_FILE_HEADER:()=>jn,LOCAL_HDR:()=>k,Logger:()=>x,NEOZIPKIT_INFO:()=>qt,NEO_CRYPTO_EXTRA_FIELD_SIZE:()=>Re,NEO_CRYPTO_MAGIC_BYTES:()=>H,NEO_CRYPTO_PAYLOAD_V1:()=>Q,PlatformUtils:()=>ml,ProgressTracker:()=>pr,TIMESTAMP_METADATA:()=>fe,TIMESTAMP_SUBMITTED:()=>se,TOKENIZED_METADATA:()=>le,VERSION:()=>pl,ZIP64_CENTRAL_DIR:()=>Gt,ZIP64_CENTRAL_DIRECTORY_END:()=>Oa,ZIP64_CENTRAL_DIRECTORY_LOCATOR:()=>va,ZIP64_CENTRAL_END:()=>Br,ZipCompress:()=>xt,ZipCopy:()=>hr,ZipCrypto:()=>q,ZipEntry:()=>re,ZipkitBrowser:()=>Pt,configureLoggerFromEnvironment:()=>Dr,crc32:()=>te,crc32update:()=>Wt,getTypeOf:()=>dr,isMetadataFile:()=>hl,isStream:()=>ul,readBigUInt64LE:()=>ll,sha256:()=>ot,uMul:()=>cl});var Xo=ta(qn());var O={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",NO_DATA:"Nothing to decompress",FILE_IN_THE_WAY:"There is a file in the way: %s",UNKNOWN_METHOD:"Invalid/unsupported compression method",STRONG_ENCRYPT_UNSUPPORTED:"Strong Encryption is not supported",INVALID_TIMESTAMP:"Invalid timestamp",TIMESTAMP_FAILED:"Failed to create the timestamp",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",INVALID_CMP_DATA_LENGTH:"Compressed data length does not match the expected length",EXTRACT_FAILED:"Failed to extract file",INVALID_CRC:"CRC32 checksum does not match the expected value",UNKNOWN_SHA256:"The SHA-256 hash has not been saved",INVALID_SHA256:"The SHA-256 hash does not match the expected value",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:"File not found: %s",NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",NO_STREAM_SUPPORT:"Streams are not supported in this environment",NO_BLOB_SUPPORT:"Blobs are not supported in this environment",NO_FILE_READER_SUPPORT:"FileReader is not supported in this environment",NO_FILES:"No files added, Zip file not created",DATATYPE_STRING_UNSUPPORTED:"The String type is not supported by this platform.",DATATYPE_ARRAY_UNSUPPORTED:"The Array type is not supported by this platform.",DATATYPE_BUFFER_UNSUPPORTED:"The Buffer type is not supported by this platform.",DATATYPE_BLOB_UNSUPPORTED:"The Blob type is not supported by this platform.",DATATYPE_U8ARRAY_UNSUPPORTED:"The uint8Array type is not supported by this platform.",DATATYPE_ARRAYBUFFER_UNSUPPORTED:"The ArrayBuffer type is not supported by this platform.",DATATYPE_UNSUPPORTED:"Unsupported input type.",COMPRESS_FAILED:"Failed to compress data",COMPRESSION_ERROR:"Error occurred during compression",DECOMPRESSION_ERROR:"Error occurred during decompression",ENCRYPT_FAILED:"Encryption failed"};var jn="PK",Jn="PK",Qn="PK",va="PK\x07",Oa="PK",Fa="PK\x07\b",se="META-INF/TS-SUBMIT.OTS",fe="META-INF/TIMESTAMP.OTS",le="META-INF/NZIP.TOKEN",k={SIZE:30,SIGNATURE:67324752,VER_EXTRACT:4,FLAGS:6,COMPRESSION:8,TIMEDATE_DOS:10,CRC:14,CMP_SIZE:18,UNCMP_SIZE:22,FNAME_LEN:26,EXTRA_LEN:28},Te=12,ce=16,Ye=32,Ce=2,ue=10,Le=11,Vt=ce+Ce+ue,Q=11,Re=4+Q,H=[78,69,90,0],Pa={SIGNATURE:134695760,SIZE:16,CRC:4,CMP_SIZE:8,UNCMP_SIZE:12},A={SIZE:46,SIGNATURE:33639248,VER_MADE:4,VER_EXT:6,FLAGS:8,CMP_METHOD:10,TIMEDATE_DOS:12,CRC:16,CMP_SIZE:20,UNCMP_SIZE:24,FNAME_LEN:28,EXTRA_LEN:30,COMMENT_LEN:32,DISK_NUM:34,INT_FILE_ATTR:36,EXT_FILE_ATTR:38,LOCAL_HDR_OFFSET:42},ee={SIZE:22,SIGNATURE:101010256,VOL_NUM:4,VOLDIR_START:6,VOL_ENTRIES:8,TOTAL_ENTRIES:10,CENTRAL_DIR_SIZE:12,CENTRAL_DIR_OFFSET:16,ZIP_COMMENT_LEN:20},Gt={SIGNATURE:101075792,SIZE:56,LEAD:12,SIZE_FIELD:4,VER_MADEBY:12,VER_NEEDED:14,VOL_NUM:16,VOLDIR_START:20,VOL_ENTRIES:24,TOTAL_ENTRIES:32,CENTRAL_DIR_SIZE:40,CENTRAL_DIR_OFFSET:48,EXTRA_FIELD:56},Br={SIZE:20,SIGNATURE:117853008,VOL_NUM:4,CENTRAL_DIR_OFFSET:8,TOTAL_DISKS:16},I={STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATE:9,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,ZSTD:93,AES_ENCRYPT:99},M={ENCRYPTED:1,COMPRESSION1:2,COMPRESSION2:4,DATA_DESC:8,ENHANCED_DEFLATE:16,PATCHED:32,STRONG_ENCRYPT:64,EFS:2048,MASK:4096},Ma={ID:0,SIZE:2},R={ZIP64:1,AVINFO:7,PFS:8,OS2:9,NTFS:10,OPENVMS:12,UNIX:13,FORK:14,PATCH:15,x509PKCS7:20,x509CERT_IDF:21,x509CERT_IDC:22,STRONG_ENC:23,AES:39169,RECORD_MGT:24,x509PKCS7RL:25,IBM1:101,IBM2:102,SHA256:334,NEO_CRYPTO:590,POSZIP:18064,UNV_TIME:21589,UID_GID:30837,UNICODE_PATH:28789,SYMLINK:30805,HARDLINK:30821},P={MSDOS:0,AMIGA:1,OPENVMS:2,UNIX:3,VM_CMS:4,ATARI:5,OS2:6,MAC:7,CP_M:9,NTFS:10,MVS:11,VSE:12,ACORN:13,VFAT:14,ALTMVS:15,BEOS:16,TANDEM:17,OS400:18,DARWIN:19},Ue={READONLY:1,HIDDEN:2,SYSTEM:4,VOLUME:8,DIRECTORY:16,ARCHIVE:32};var x=class{static configure(t){this.config={...this.config,...t}}static getConfig(){return{...this.config}}static enable(){this.config.enabled=!0}static disable(){this.config.enabled=!1}static setLevel(t){this.config.level=t}static shouldLog(t){if(!this.config.enabled)return!1;let e=["debug","info","warn","error","silent"],n=e.indexOf(this.config.level);return e.indexOf(t)>=n}static log(...t){this.shouldLog("info")&&this.originalConsole.log(...t)}static error(...t){this.shouldLog("error")&&this.originalConsole.error(...t)}static warn(...t){this.shouldLog("warn")&&this.originalConsole.warn(...t)}static debug(...t){this.shouldLog("debug")&&this.originalConsole.log(...t)}static info(...t){this.shouldLog("info")&&this.originalConsole.info(...t)}static overrideConsole(){console.log=(...t)=>this.log(...t),console.error=(...t)=>this.error(...t),console.warn=(...t)=>this.warn(...t),console.debug=(...t)=>this.debug(...t),console.info=(...t)=>this.info(...t)}static restoreConsole(){console.log=this.originalConsole.log,console.error=this.originalConsole.error,console.warn=this.originalConsole.warn,console.debug=this.originalConsole.debug,console.info=this.originalConsole.info}};x.config={enabled:!0,level:"info"},x.originalConsole={log:console.log,error:console.error,warn:console.warn,debug:console.debug,info:console.info};function Dr(){let r=typeof process<"u"?process.env:{};if(r.NEOZIP_DEBUG==="false"?x.disable():r.NEOZIP_DEBUG==="true"&&(x.enable(),x.setLevel("debug")),r.NEOZIP_LOG_LEVEL){let t=r.NEOZIP_LOG_LEVEL;["debug","info","warn","error","silent"].includes(t)&&x.setLevel(t)}r.NODE_ENV==="production"&&x.setLevel("error")}Dr();var Kt=typeof crypto<"u"?crypto:typeof window<"u"&&window.crypto?window.crypto:null;if(!Kt||!Kt.subtle)throw new Error("Web Crypto API is not available in this environment");function za(r){return new Uint8Array(r)}function ei(r){return r instanceof Uint8Array||r instanceof ArrayBuffer,Buffer.from(r)}async function it(r){let e={sha256:"SHA-256",sha1:"SHA-1",md5:"MD5"}[r.toLowerCase()]||"SHA-256";return{update:function(n){return this._data=this._data?Buffer.concat([this._data,ei(n)]):ei(n),this},digest:async function(n){let i=this._data||Buffer.alloc(0),o=await Kt.subtle.digest(e,i),a=za(o);return n==="hex"?Array.from(a).map(s=>s.toString(16).padStart(2,"0")).join(""):n==="base64"?Buffer.from(a).toString("base64"):Buffer.from(a)}}}function Xt(r){let t=new Uint8Array(r);return Kt.getRandomValues(t),Buffer.from(t)}function Tr(r){let t=(Buffer.isBuffer(r),Buffer.from(r)),e=t.length,n=e*8,i=64-(e+9)%64,o=e+1+(i<0?i+64:i)+8,a=Buffer.alloc(o);t.copy(a,0),a[e]=128,a.writeUInt32BE(n/4294967296>>>0,o-8),a.writeUInt32BE(n>>>0,o-4);let s=[1732584193,4023233417,2562383102,271733878,3285377520],c=[1518500249,1859775393,2400959708,3395469782],f=new Array(80);for(let d=0;d<o;d+=64){for(let p=0;p<16;p++)f[p]=a.readUInt32BE(d+p*4);for(let p=16;p<80;p++)f[p]=(f[p-3]^f[p-8]^f[p-14]^f[p-16])<<1|(f[p-3]^f[p-8]^f[p-14]^f[p-16])>>>31;let[h,u,E,_,b]=s;for(let p=0;p<80;p++){let B,S;p<20?(B=u&E|~u&_,S=c[0]):p<40?(B=u^E^_,S=c[1]):p<60?(B=u&E|u&_|E&_,S=c[2]):(B=u^E^_,S=c[3]),S=(h<<5|h>>>27)+B+b+S+(f[p]>>>0)>>>0,b=_,_=E,E=u<<30|u>>>2,u=h,h=S}s[0]=s[0]+h>>>0,s[1]=s[1]+u>>>0,s[2]=s[2]+E>>>0,s[3]=s[3]+_>>>0,s[4]=s[4]+b>>>0}let l=Buffer.alloc(20);for(let d=0;d<5;d++)l.writeUInt32BE(s[d],d*4);return l}function Cr(r,t){let n=(Buffer.isBuffer(r),Buffer.from(r));n.length>64&&(n=Tr(n)),n.length<64&&(n=Buffer.concat([n,Buffer.alloc(64-n.length)]));let i=Buffer.alloc(64,54),o=Buffer.alloc(64,92);for(let s=0;s<64;s++)i[s]^=n[s],o[s]^=n[s];let a=Tr(Buffer.concat([i,Buffer.isBuffer(t)?t:Buffer.from(t)]));return Tr(Buffer.concat([o,a]))}function ti(r,t,e,n,i){if(i&&i.toLowerCase()!=="sha1")throw new Error("Browser shim only supports PBKDF2 with sha1");let o=20,a=Math.ceil(n/o),s=[],c=Buffer.isBuffer(r)?r:Buffer.from(r),f=Buffer.isBuffer(t)?t:Buffer.from(t);for(let l=1;l<=a;l++){let d=Buffer.from([l>>>24&255,l>>>16&255,l>>>8&255,l&255]),h=Cr(c,Buffer.concat([f,d])),u=Buffer.from(h);for(let E=1;E<e;E++){h=Cr(c,h);for(let _=0;_<o;_++)u[_]^=h[_]}s.push(u)}return Buffer.concat(s).subarray(0,n)}function Lr(r,t){if(r!=="sha1")throw new Error("Browser shim createHmac only supports sha1");let e=Buffer.isBuffer(t)?t:Buffer.from(t),n=Buffer.alloc(0);return{update(i){return n=Buffer.concat([n,Buffer.isBuffer(i)?i:Buffer.from(i)]),this},digest(){let i=Cr(e,n);return n=Buffer.alloc(0),i}}}var he=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),Ha=new Uint8Array([1,2,4,8,16,32,64,128,27,54]);function $a(r){let t=new Uint8Array(240);for(let e=0;e<32;e++)t[e]=r[e];for(let e=8;e<60;e++){let n=e*4,i=(e-8)*4,o=(e-1)*4;if(e%8===0){let a=he[t[o+1]]^Ha[e/8-1];t[n]=t[i]^a,t[n+1]=t[i+1]^he[t[o+2]],t[n+2]=t[i+2]^he[t[o+3]],t[n+3]=t[i+3]^he[t[o]]}else e%8===4?(t[n]=t[i]^he[t[o]],t[n+1]=t[i+1]^he[t[o+1]],t[n+2]=t[i+2]^he[t[o+2]],t[n+3]=t[i+3]^he[t[o+3]]):(t[n]=t[i]^t[o],t[n+1]=t[i+1]^t[o+1],t[n+2]=t[i+2]^t[o+2],t[n+3]=t[i+3]^t[o+3])}return t}function Ne(r){return r<<1&255^(r>>>7&1)*27}function Ya(r,t){let e=new Uint8Array(16);for(let s=0;s<16;s++)e[s]=t[s]^r[s];for(let s=1;s<14;s++){for(let u=0;u<16;u++)e[u]=he[e[u]];let c=e[1];e[1]=e[5],e[5]=e[9],e[9]=e[13],e[13]=c;let f=e[2];e[2]=e[10],e[10]=f;let l=e[6];e[6]=e[14],e[14]=l;let d=e[3];e[3]=e[15],e[15]=e[11],e[11]=e[7],e[7]=d;for(let u=0;u<4;u++){let E=e[u*4],_=e[u*4+1],b=e[u*4+2],p=e[u*4+3];e[u*4]=Ne(E)^Ne(_)^_^b^p,e[u*4+1]=E^Ne(_)^Ne(b)^b^p,e[u*4+2]=E^_^Ne(b)^Ne(p)^p,e[u*4+3]=Ne(E)^E^_^b^Ne(p)}let h=s*16;for(let u=0;u<16;u++)e[u]^=r[h+u]}for(let s=0;s<16;s++)e[s]=he[e[s]];let n=e[1];e[1]=e[5],e[5]=e[9],e[9]=e[13],e[13]=n;let i=e[2];e[2]=e[10],e[10]=i;let o=e[6];e[6]=e[14],e[14]=o;let a=e[3];e[3]=e[15],e[15]=e[11],e[11]=e[7],e[7]=a;for(let s=0;s<16;s++)e[s]^=r[224+s];return e}function ri(r,t,e){if(r!=="aes-256-ecb"||e!=null)throw new Error("Browser shim createCipheriv only supports aes-256-ecb with null iv");let n=Buffer.isBuffer(t)?t:Buffer.from(t);if(n.length!==32)throw new Error("aes-256-ecb requires 32-byte key");let i=$a(n);return{setAutoPadding(){return this},update(o){let a=Buffer.isBuffer(o)?o:Buffer.from(o);if(a.length!==16)throw new Error("Browser shim AES-ECB only supports 16-byte blocks");let s=Ya(i,a);return Buffer.from(s)},final(){return Buffer.alloc(0)}}}var ke=class ke{canHandle(t){return t===1}getMethodName(){return"ZIP-Crypto"}getKeyLength(){return ke.KEY_LENGTH}async encrypt(t,e){try{if(e.method!==1)return{success:!1,error:"ZIP-Crypto encryption method required"};let n=this.initKeys(e.password),i=Buffer.alloc(t.length);for(let o=0;o<t.length;o++){let a=t[o],s=this.encryptByte(n,a);i[o]=s,this.updateKeys(n,a)}return{success:!0,encryptedData:i}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown encryption error"}}}async decrypt(t,e){try{if(e.method!==1)return{success:!1,error:"ZIP-Crypto decryption method required"};let n=this.initKeys(e.password),i=Buffer.alloc(t.length);for(let o=0;o<t.length;o++){let a=t[o],s=this.decryptByte(n,a);i[o]=s,this.updateKeys(n,s)}return{success:!0,decryptedData:i}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown decryption error"}}}verifyPassword(t,e){if(t.length<12)throw new Error("Decrypted header must be at least 12 bytes");if(t[11]!==e)throw new Error("Password verification FAILED")}parseLocalHeaderForDecryption(t,e){if(t.readUInt32LE(0)!==67324752)throw new Error("Invalid local header signature");let n=t.readUInt16LE(6),i=t.readUInt32LE(10),o=t.readUInt32LE(14);n&M.DATA_DESC&&(!e.lastModTimeDate||e.lastModTimeDate===0)&&(e.lastModTimeDate=i),e.localCrc=o;let a;return n&M.DATA_DESC?a=(e.lastModTimeDate||e.timeDateDOS||0)>>8&255:a=(o&&o!==0?o:e.crc)>>24&255,{bitFlags:n,lastModTimeDate:i,localCrc:o,checkByte:a}}createEncryptionHeader(t,e){let n=Buffer.alloc(Te);Xt(11).copy(n,0);let o;return(t.bitFlags&M.DATA_DESC)!==0?o=(t.lastModTimeDate||t.timeDateDOS||0)>>8&255:o=t.crc>>24&255,n[11]=o,x.debug(`[ZipCrypto] Created encryption header: checkByte=0x${o.toString(16).padStart(2,"0")}, DATA_DESC=${(t.bitFlags&M.DATA_DESC)!==0}`),n}encryptBuffer(t,e,n){let i=this.createEncryptionHeader(t,n),o=Buffer.concat([i,e]),a=this.initKeys(n),s=Buffer.alloc(o.length);for(let c=0;c<o.length;c++){let f=o[c],l=this.encryptByte(a,f);s[c]=l,this.updateKeys(a,f)}return x.debug(`[ZipCrypto] Encrypted buffer: ${e.length} bytes compressed data + ${Te} bytes header = ${s.length} bytes total`),s}decryptBuffer(t,e,n,i){let o=e.subarray(t.localHdrOffset),a=o.subarray(0,30),{bitFlags:s,localCrc:c,checkByte:f}=this.parseLocalHeaderForDecryption(a,t),l=a.readUInt16LE(26),d=a.readUInt16LE(28),h=30+l+d,u=12,E=o.subarray(h,h+u),_=Buffer.concat([E,n]),b=this.initKeys(i);for(let B=0;B<_.length;B++){let S=_[B],g=this.decryptByte(b,S);_[B]=g,this.updateKeys(b,g)}let p=_.subarray(0,u);return this.verifyPassword(p,f),_.subarray(u)}async*createStreamDecryptor(t,e,n){let i=this.initKeys(t),o=12,a=Buffer.alloc(o),s=0,c=null,f=0;for(;s<o;){if(!c||f>=c.length){let h=await n.next();if(h.done||!h.value)throw new Error("ZIP-Crypto: insufficient encrypted data (missing encryption header)");c=h.value,f=0}let l=o-s,d=Math.min(l,c.length-f);c.copy(a,s,f,f+d),s+=d,f+=d}for(let l=0;l<o;l++){let d=a[l],h=this.decryptByte(i,d)&255;a[l]=h,this.updateKeys(i,h)}if(this.verifyPassword(a,e),c&&f<c.length){let l=c.length-f;for(let d=0;d<l;d++){let h=f+d,u=c[h],E=this.decryptByte(i,u);c[h]=E,this.updateKeys(i,E)}yield c.subarray(f)}for await(let l of n){for(let d=0;d<l.length;d++){let h=l[d],u=this.decryptByte(i,h);l[d]=u,this.updateKeys(i,u)}yield l}}initKeys(t){let e=[305419896,591751049,878082192];for(let n=0;n<t.length;n++)this.updateKeys(e,t.charCodeAt(n));return e}updateKeys(t,e){t[0]=(t[0]>>>8^ke.CRC_TABLE[(t[0]^e)&255])>>>0,t[1]=(Math.imul(t[1]+(t[0]&255),134775813)+1&4294967295)>>>0,t[2]=(t[2]>>>8^ke.CRC_TABLE[(t[2]^t[1]>>>24)&255])>>>0}encryptByte(t,e){let n=t[2]|2;return(e^Math.imul(n,n^1)>>>8)&255}decryptByte(t,e){let n=t[2]|2;return(e^Math.imul(n,n^1)>>>8)&255}crc32(t,e){return(t>>>8^ke.CRC_TABLE[(t^e)&255])>>>0}static crc32(t){return ii(t)}static crc32update(t,e){return oi(t,e)}};ke.KEY_LENGTH=3,ke.CRC_TABLE=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];var q=ke;function ii(r){typeof r=="string"&&(r=Buffer.from(r,"utf8"));let t=r.length,e=-1;for(let n=0;n<t;)e=q.CRC_TABLE[(e^r[n++])&255]^e>>>8;return~e>>>0}function oi(r,t){return q.CRC_TABLE[(r^t)&255]^r>>>8}function te(r){return ii(r)}function Wt(r,t){return oi(r,t)}function ot(r){return it("sha256").update(r).digest("hex")}var Rr=30,ai=10,Ur=51,re=class{constructor(t,e,n){this.debug=!0;this.verMadeBy=0;this.verExtract=0;this.bitFlags=0;this.cmpMethod=0;this.timeDateDOS=0;this.crc=0;this.compressedSize=0;this.uncompressedSize=0;this.volNumber=0;this.intFileAttr=0;this.extFileAttr=0;this.localHdrOffset=0;this.filename="";this.extraField=null;this.comment=null;this.fileBuffer=null;this.cmpData=null;this.isEncrypted=!1;this.isStrongEncrypt=!1;this.encryptHdr=null;this.lastModTimeDate=0;this.decrypt=null;this.aesVersion=0;this.aesStrength=0;this.realCmpMethod=-1;this.neoCryptoPayloadVersion=0;this.neoCryptoAlgorithm=0;this.neoCryptoFlags=0;this.isUpdated=!0;this.isDirectory=!1;this.isMetaData=!1;this.platform=null;this.universalTime=null;this.uid=null;this.gid=null;this.sha256=null;this.isSymlink=!1;this.linkTarget=null;this.isHardLink=!1;this.originalEntry=null;this.inode=null;this.isMSDOS=this.platform===null;this.isUnixLike=this.platform!=null&&this.platform!=="win32";this.isMacOS=this.platform!=null&&this.platform==="darwin";this.isLinux=this.platform!=null&&this.platform==="linux";this.VER_MADE_BY=(()=>{switch(this.platform){case"darwin":return P.DARWIN<<8|Rr;case"win32":return P.NTFS<<8|Rr;default:return P.UNIX<<8|Rr}})();this.filename=t||"",this.comment=e||null,this.debug=n||!1,this.bitFlags|=M.EFS}readZipEntry(t){if(t.length<A.SIZE)throw new Error("Zip entry data is too small or corrupt");if(t.readUInt32LE(0)!==A.SIGNATURE)throw new Error(O.INVALID_CEN);this.verMadeBy=t.readUInt16LE(A.VER_MADE),this.verExtract=t.readUInt16LE(A.VER_EXT),this.bitFlags=t.readUInt16LE(A.FLAGS),(this.bitFlags&M.ENCRYPTED)!=0&&(this.isEncrypted=!0,(this.bitFlags&M.STRONG_ENCRYPT)!=0&&(this.isStrongEncrypt=!0)),this.cmpMethod=t.readUInt16LE(A.CMP_METHOD),this.timeDateDOS=t.readUInt32LE(A.TIMEDATE_DOS),this.crc=t.readUInt32LE(A.CRC),this.compressedSize=t.readUInt32LE(A.CMP_SIZE),this.uncompressedSize=t.readUInt32LE(A.UNCMP_SIZE),this.volNumber=t.readUInt16LE(A.DISK_NUM),this.intFileAttr=t.readUInt16LE(A.INT_FILE_ATTR),this.extFileAttr=t.readUInt32LE(A.EXT_FILE_ATTR),this.extFileAttr&Ue.DIRECTORY&&(this.isDirectory=!0),this.localHdrOffset=t.readUInt32LE(A.LOCAL_HDR_OFFSET);let e=t.readUInt16LE(A.FNAME_LEN),n=t.toString("utf8",A.SIZE,A.SIZE+e);this.filename=n,this.filename.endsWith("/")&&(this.isDirectory=!0);let i=t.readUInt16LE(A.EXTRA_LEN);if(i>0){this.extraField=t.subarray(A.SIZE+e,A.SIZE+e+i);for(let s=0;s<i;){let c=this.extraField.readUInt16LE(s),f=this.extraField.readUInt16LE(s+2),l=this.extraField.subarray(s+4,s+4+f);if(c===R.UNICODE_PATH&&f>=5){let d=l.readUInt8(0),h=l.readUInt32LE(1),u=Buffer.from(this.filename);if(te(u)===h){let _=l.subarray(5).toString("utf8");this.filename=_,this.debug&&x.log(`Using Unicode Path: ${this.filename}`)}}s+=4+f}for(let s=0;s<i;){let c=this.extraField.readUInt16LE(s),f=this.extraField.readUInt16LE(s+2),l=this.extraField.subarray(s+4,s+4+f);if(c===R.SHA256)f===64?this.sha256=l.toString("utf8"):this.sha256=l.toString("hex");else if(c===R.UNV_TIME)f>=5&&l.readUInt8(0)&1&&(this.universalTime=l.readUInt32LE(1));else if(c===R.UID_GID){if(f>=5){let d=l.readUInt8(0),h=l.readUInt8(1);if(h<=4&&f>=2+h&&(this.uid=l.readUIntLE(2,h),f>=2+h+1)){let u=l.readUInt8(2+h);u<=4&&f>=2+h+1+u&&(this.gid=l.readUIntLE(2+h+1,u))}}}else if(c===R.SYMLINK){if(f>=3){let d=l.readUInt8(0),h=l.readUInt16LE(1);h>0&&f>=3+h&&(this.isSymlink=!0,this.linkTarget=l.subarray(3,3+h).toString("utf8"))}}else if(c===R.HARDLINK){if(f>=11){let d=l.readUInt8(0);this.inode=l.readUInt32LE(1);let h=l.readUInt16LE(5);h>0&&f>=7+h&&(this.isHardLink=!0,this.originalEntry=l.subarray(7,7+h).toString("utf8"))}}else c===R.AES?f>=7&&(this.aesVersion=l.readUInt16LE(0),this.aesStrength=l.readUInt8(4),this.realCmpMethod=l.readUInt16LE(5)):c===R.NEO_CRYPTO&&f>=Q&&l[0]===H[0]&&l[1]===H[1]&&l[2]===H[2]&&l[3]===H[3]&&(this.neoCryptoPayloadVersion=l.readUInt8(4),this.neoCryptoAlgorithm=l.readUInt16LE(5),this.neoCryptoFlags=l.readUInt16LE(7));s+=4+f}}let o=t.readUInt16LE(A.COMMENT_LEN);o>0&&(this.comment=t.toString("utf8",A.SIZE+e,A.SIZE+e+o)),this.debug&&this.showVerboseInfo();let a=A.SIZE+e+i+o;return t.subarray(a)}needsUnicodeHandling(){return/[^\x00-\x7E]|['"]/.test(this.filename)}addUnicodePathField(t,e){let n=Buffer.from(this.filename,"utf8"),i=this.filename.replace(/[^\x00-\x7E]/g,"?"),o=Buffer.from(i,"ascii"),a=te(o),s=5+n.length;return t.writeUInt16LE(R.UNICODE_PATH,e),t.writeUInt16LE(s,e+2),t.writeUInt8(1,e+4),t.writeUInt32LE(a,e+5),n.copy(t,e+9),e+4+s}createLocalHdr(){let t=0,e=this.needsUnicodeHandling();e&&(t=5+Buffer.from(this.filename,"utf8").length+4);let n=this.cmpMethod===I.AES_ENCRYPT&&this.aesVersion>0;n&&(t+=Le);let i=this.neoCryptoAlgorithm>0;i&&(t+=Re);let o=Buffer.alloc(k.SIZE+this.filename.length+t);o.writeUInt32LE(k.SIGNATURE,0);let a=this.cmpMethod===I.AES_ENCRYPT?Ur:ai;o.writeUInt16LE(a,k.VER_EXTRACT),o.writeUInt16LE(this.bitFlags>>>0,k.FLAGS),o.writeUInt16LE(this.cmpMethod,k.COMPRESSION),o.writeUInt32LE(this.timeDateDOS>>>0,k.TIMEDATE_DOS),o.writeUInt32LE(this.aesVersion===2?0:this.crc,k.CRC),o.writeUInt32LE(this.compressedSize,k.CMP_SIZE),o.writeUInt32LE(this.uncompressedSize,k.UNCMP_SIZE),o.writeUInt16LE(this.filename.length,k.FNAME_LEN),o.writeUInt16LE(t,k.EXTRA_LEN);let s=this.filename.replace(/[^\x00-\x7E]/g,"?"),c=Buffer.from(s);c.copy(o,k.SIZE);let f=k.SIZE+c.length;if(e&&(f=this.addUnicodePathField(o,f)),n&&(o.writeUInt16LE(R.AES,f),o.writeUInt16LE(7,f+2),o.writeUInt16LE(this.aesVersion,f+4),o.writeUInt16LE(17729,f+6),o.writeUInt8(this.aesStrength,f+8),o.writeUInt16LE(this.realCmpMethod,f+9),f+=Le),i){o.writeUInt16LE(R.NEO_CRYPTO,f),o.writeUInt16LE(Q,f+2);let l=f+4;for(let d=0;d<4;d++)o.writeUInt8(H[d],l+d);o.writeUInt8(this.neoCryptoPayloadVersion,l+4),o.writeUInt16LE(this.neoCryptoAlgorithm,l+5),o.writeUInt16LE(this.neoCryptoFlags,l+7),o.writeUInt16LE(0,l+9),f+=Re}return o}centralDirEntry(){let t=this.comment?Buffer.from(this.comment,"utf8").length:0,e=this.universalTime?9:0,n=this.uid&&this.gid?15:0,i=this.sha256?Buffer.from(this.sha256,"hex"):null,o=i?i.length+4:0,a=this.isSymlink&&this.linkTarget?7+Buffer.byteLength(this.linkTarget,"utf8"):0,s=this.isHardLink&&this.originalEntry&&this.inode!==null?11+Buffer.byteLength(this.originalEntry,"utf8"):0,c=this.needsUnicodeHandling(),f=0;c&&(f=5+Buffer.from(this.filename,"utf8").length+4);let l=this.cmpMethod===I.AES_ENCRYPT&&this.aesVersion>0,d=l?Le:0,h=this.neoCryptoAlgorithm>0,u=h?Re:0,E=e+o+n+a+s+(c?f:0)+d+u,_=this.filename.replace(/[^\x00-\x7E]/g,"?"),b=_.length,p=Buffer.alloc(A.SIZE+b+t+E);p.writeUInt32LE(A.SIGNATURE,0),p.writeUInt16LE(this.isUpdated?this.VER_MADE_BY:this.verMadeBy,A.VER_MADE);let B=this.cmpMethod===I.AES_ENCRYPT?Ur:ai;p.writeInt16LE(this.isUpdated?B:this.verMadeBy,A.VER_EXT),p.writeInt16LE(this.bitFlags>>>0,A.FLAGS),p.writeInt16LE(this.cmpMethod,A.CMP_METHOD),p.writeUInt32LE(this.timeDateDOS>>>0,A.TIMEDATE_DOS),p.writeUInt32LE(this.aesVersion===2?0:this.crc,A.CRC),p.writeUInt32LE(this.compressedSize,A.CMP_SIZE),p.writeUInt32LE(this.uncompressedSize,A.UNCMP_SIZE),p.writeUInt16LE(this.filename.length,A.FNAME_LEN),p.writeUInt16LE(E,A.EXTRA_LEN),p.writeUInt16LE(t,A.COMMENT_LEN),p.writeUInt16LE(0,A.DISK_NUM),p.writeUInt16LE(this.intFileAttr>>>0,A.INT_FILE_ATTR),p.writeUInt32LE(this.extFileAttr>>>0,A.EXT_FILE_ATTR),p.writeUInt32LE(this.localHdrOffset,A.LOCAL_HDR_OFFSET),Buffer.from(_).copy(p,A.SIZE);let g=A.SIZE+b;t>0&&this.comment&&(Buffer.from(this.comment,"utf8").copy(p,g),g+=t);let y=g;if(this.universalTime&&(p.writeUInt16LE(R.UNV_TIME,y),p.writeUInt16LE(5,y+2),p.writeUInt8(1,y+4),p.writeUInt32LE(Math.floor(Date.now()/1e3),y+5),y+=9),i&&(p.writeUInt16LE(R.SHA256,y),p.writeUInt16LE(i.length,y+2),i.copy(p,y+4),y+=4+i.length),this.uid&&this.gid&&(p.writeUInt16LE(R.UID_GID,y),p.writeUInt16LE(11,y+2),p.writeUInt8(1,y+4),p.writeUInt8(4,y+5),p.writeUInt32LE(this.uid,y+6),p.writeUInt8(4,y+10),p.writeUInt32LE(this.gid,y+11),y+=15),this.isSymlink&&this.linkTarget){let C=Buffer.from(this.linkTarget,"utf8"),w=3+C.length;p.writeUInt16LE(R.SYMLINK,y),p.writeUInt16LE(w,y+2),p.writeUInt8(1,y+4),p.writeUInt16LE(C.length,y+5),C.copy(p,y+7),y+=4+w}if(this.isHardLink&&this.originalEntry&&this.inode!==null){let C=Buffer.from(this.originalEntry,"utf8"),w=7+C.length;p.writeUInt16LE(R.HARDLINK,y),p.writeUInt16LE(w,y+2),p.writeUInt8(1,y+4),p.writeUInt32LE(this.inode,y+5),p.writeUInt16LE(C.length,y+9),C.copy(p,y+11),y+=4+w}if(c&&(y=this.addUnicodePathField(p,y)),l&&(p.writeUInt16LE(R.AES,y),p.writeUInt16LE(7,y+2),p.writeUInt16LE(this.aesVersion,y+4),p.writeUInt16LE(17729,y+6),p.writeUInt8(this.aesStrength,y+8),p.writeUInt16LE(this.realCmpMethod,y+9),y+=Le),h){p.writeUInt16LE(R.NEO_CRYPTO,y),p.writeUInt16LE(Q,y+2);let C=y+4;for(let w=0;w<4;w++)p.writeUInt8(H[w],C+w);p.writeUInt8(this.neoCryptoPayloadVersion,C+4),p.writeUInt16LE(this.neoCryptoAlgorithm,C+5),p.writeUInt16LE(this.neoCryptoFlags,C+7),p.writeUInt16LE(0,C+9),y+=Re}return p}setDateTime(t){if(!t)return 0;let e=t.getFullYear()-1980,n=t.getMonth()+1,i=t.getDate(),o=t.getHours(),a=t.getMinutes(),s=t.getSeconds(),c=(e&127)<<9|(n&15)<<5|i&31,f=(o&31)<<11|(a&63)<<5|s>>1&31;return c<<16|f}parseDateTime(t){if(t==0)return null;let e=t>>16&65535,n=(e>>9&127)+1980,i=(e>>5&15)-1,o=e&31,a=t&65535,s=a>>11&31,c=a>>5&63,f=(a&31)<<1;return new Date(n,i,o,s,c,f)}toLocalDateString(){let t=this.parseDateTime(this.timeDateDOS);return t===null?"--/--/----":t.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"}).slice(0,10)}toTimeString(){let t=this.parseDateTime(this.timeDateDOS);return t===null?"--:--":t.toTimeString().slice(0,5)}toFormattedDateString(){let t=this.parseDateTime(this.timeDateDOS);if(t==null)return"--/--/-- --:--";let e=t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit"}),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return`${e} ${n}`}toFormattedUTCDateString(){let t=this.parseDateTime(this.timeDateDOS);if(t==null)return"--/--/-- --:--";let e=t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC"}),n=t.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"UTC"});return`${e} ${n} UTC`}cmpMethodToString(){switch(this.cmpMethod){case I.STORED:return"Stored";case I.SHRUNK:return"Shrunk";case I.REDUCED1:return"Reduced-1";case I.REDUCED2:return"Reduced-2";case I.REDUCED3:return"Reduced-3";case I.REDUCED4:return"Reduced-4";case I.IMPLODED:return"Imploded";case I.DEFLATED:switch(this.bitFlags&6){case 0:return"Deflate-N";case 2:return"Deflate-M";case 4:return"Deflate-F";case 6:return"Deflate-S"}case I.ENHANCED_DEFLATE:return"Deflate-Enh";case I.IBM_TERSE:return"PKDCL-LZ77";case I.ZSTD:return"Zstandard";case I.AES_ENCRYPT:return this.aesStrength===3?"AES-256":this.aesStrength===2?"AES-192":this.aesStrength===1?"AES-128":"AES";default:return"Unknown"}}fileSystemToString(){switch(this.verMadeBy>>8){case P.MSDOS:return"MS-DOS";case P.AMIGA:return"Amiga";case P.OPENVMS:return"OpenVMS";case P.UNIX:return"Unix";case P.VM_CMS:return"VM/CMS";case P.ATARI:return"Atari ST";case P.OS2:return"OS/2 HPFS";case P.MAC:return"Macintosh";case P.CP_M:return"CP/M";case P.NTFS:return"Windows NTFS";case P.MVS:return"MVS (OS/390 - Z/OS)";case P.VSE:return"VSE";case P.ACORN:return"Acorn Risc";case P.ALTMVS:return"Alternate MVS";case P.BEOS:return"BeOS";case P.TANDEM:return"Tandem";case P.OS400:return"OS/400";case P.DARWIN:return"Apple OS/X (Darwin)";default:return"Unknown"}}compressionMethodCodeToString(t){if(t<0)return"Not set";switch(t){case I.STORED:return"Stored (0)";case I.DEFLATED:return"Deflated (8)";case I.ZSTD:return"Zstandard (93)";case I.BZIP2:return"BZIP2 (12)";case I.LZMA:return"LZMA (14)";case I.AES_ENCRYPT:return"AES wrapper (99)";default:return`code ${t}`}}logEncryptionDetails(){let t=(this.bitFlags&M.ENCRYPTED)!==0,e=(this.bitFlags&M.STRONG_ENCRYPT)!==0;x.log("Encryption (detailed): "),x.log(" GP flags: ",`bit0 encrypted=${t}, bit6 strong_encrypt=${e}`);let n=this.cmpMethod===I.AES_ENCRYPT&&this.aesVersion>0,i=!n&&this.neoCryptoAlgorithm>0;if(n){x.log(" Scheme: ",'WinZip AES (ZIP compression method 99 + extra 0x9901, vendor "AE")'),x.log(" AE variant: ",this.aesVersion===2?"AE-2 \u2014 CRC-32 in local/CEN headers is 0; plaintext integrity from HMAC-SHA1":"AE-1 \u2014 CRC-32 in headers is plaintext (uncompressed) CRC-32");let o=this.aesStrength===3?"AES-256 (extra field strength byte 3)":this.aesStrength===2?"AES-192 (2)":this.aesStrength===1?"AES-128 (1)":`Unknown (${this.aesStrength})`;x.log(" Key size: ",o),x.log(" Real compression (inside ciphertext): ",this.compressionMethodCodeToString(this.realCmpMethod)),x.log(' "Compressed size" in headers: ',"Length of full AES file data: salt + password verifier + ciphertext + 10-byte HMAC"),x.log(" Payload layout: ",`${ce} byte salt + ${Ce} byte verifier + encrypted(compressed) data + ${ue} byte HMAC (PBKDF2-HMAC-SHA1, WinZip AES-CTR)`),x.log(" Version needed to extract (from entry): ",`${this.verExtract}${this.verExtract===Ur?" (5.1 \u2014 typical for AES)":""}`),e?x.log(" Note: ","Strong-encrypt bit set \u2014 unusual for pure WinZip AES; confirm with extra fields."):x.log(" Typical WinZip AES: ","bit 6 (strong) usually clear; bit 0 (encrypted) set.")}else i?(x.log(" Scheme: ","NeoEncrypt (GP encrypted + NEO extra 0x024E; standard ZIP compression method in header)"),x.log(" NEO payload version / algorithm / flags: ",`${this.neoCryptoPayloadVersion} / ${this.neoCryptoAlgorithm} / ${this.neoCryptoFlags}`),x.log(" Compression after decrypt: ",this.compressionMethodCodeToString(this.cmpMethod)),x.log(" Ciphertext layout: ",`Same as WinZip AES-256 stream: ${ce} byte salt + ${Ce} byte verifier + encrypted(compressed) + ${ue} byte HMAC`),x.log(" CRC in headers: ","Plaintext CRC (AE-1 style) for algorithm 1")):t?(e?x.log(" Scheme: ","PKWARE strong encryption (GP bit 6) \u2014 not WinZip method 99; expect extras e.g. 0x0017"):x.log(" Scheme: ","Encrypted (bit 0) \u2014 typically legacy ZipCrypto if method \u2260 99"),x.log(" Compression method in header: ",`${this.cmpMethodToString()} (${this.cmpMethod})`)):x.log(" Scheme: ","Not encrypted")}dosAttributesToString(){let t=this.extFileAttr&65535;if(t===0)return"none";let e="";return e+=t&Ue.READONLY?"r":"-",e+=t&Ue.HIDDEN?"h":"-",e+=t&Ue.SYSTEM?"s":"-",e+=t&Ue.DIRECTORY?"d":"-",e+=t&Ue.ARCHIVE?"a":"-",e}showVerboseInfo(){if(x.log("=== Central Directory Entry (%s) ===",this.filename),x.log("unzip from start of archive: ",this.localHdrOffset),x.log("File system or operating system of origin: ",this.fileSystemToString()),x.log("Version of encoding software: ",this.verMadeBy),x.log("Compression Method: ",this.cmpMethodToString()),x.log("File Security Status: ",this.bitFlags&M.ENCRYPTED?this.bitFlags&M.STRONG_ENCRYPT?"Strong Encrypt":"Encrypted":"Not Encrypted"),this.logEncryptionDetails(),x.log("File Modified (DOS date/time) ",this.toFormattedDateString()),x.log("File Modified (UTC) ",this.toFormattedUTCDateString()),x.log("Compressed Size: ",this.compressedSize),x.log("UnCompressed Size: ",this.uncompressedSize),x.log(`32-bit CRC value (hex): ${this.crc.toString(16).padStart(8,"0")}`),x.log("Length of extra field: ",this.extraField?.length??0),x.log("Length of file comment: ",this.comment?.length??0),x.log("Unix File Attributes: "),x.log("MS-DOS File Attributes: ",this.dosAttributesToString()),this.extraField){x.log(`
7
- The Central-Directory Extra Field contains:`);try{for(let t=0;t<this.extraField.length;){if(t+4>this.extraField.length){x.log(` Warning: Truncated extra field at offset ${t}`);break}let e=this.extraField.readUInt16LE(t),n=e.toString(16).padStart(4,"0"),i=this.extraField.readUInt16LE(t+2);if(i<0||t+4+i>this.extraField.length){x.log(` Warning: Invalid extra field length (${i}) at offset ${t} for ID ${n}`);break}let o=this.extraField.subarray(t+4,t+4+i);try{if(e===R.SHA256)x.log(` ID[0x${n}] NeoZip-SHA256: ${o.toString("hex")}`);else if(e===R.UNV_TIME)if(i>=5){let a=o.readUInt8(0),s=o.readUInt32LE(1),c=new Date(s*1e3);x.log(` ID[0x${n}] Universal Time: flags=${a}, time=${c.toISOString()}`)}else x.log(` ID[0x${n}] Universal Time: (invalid length ${i})`);else if(e===R.UID_GID)if(i>=5){let a=o.readUInt8(0),s=o.readUInt8(1);if(2+s>i)x.log(` ID[0x${n}] Unix UID/GID: (invalid UID size ${s})`);else{let c=o.readUIntLE(2,Math.min(s,4)),f=0;if(2+s+1<i){let l=o.readUInt8(2+s);2+s+1+l<=i&&(f=o.readUIntLE(2+s+1,Math.min(l,4)))}x.log(` ID[0x${n}] Unix UID/GID: version=${a}, uid=${c}, gid=${f}`)}}else x.log(` ID[0x${n}] Unix UID/GID: (invalid length ${i})`);else if(e===R.SYMLINK)if(i>=3){let a=o.readUInt8(0),s=o.readUInt16LE(1);if(s>0&&i>=3+s){let c=o.subarray(3,3+s).toString("utf8");x.log(` ID[0x${n}] Symbolic Link: version=${a}, target="${c}"`)}else x.log(` ID[0x${n}] Symbolic Link: (invalid target length ${s})`)}else x.log(` ID[0x${n}] Symbolic Link: (invalid length ${i})`);else if(e===R.HARDLINK)if(i>=11){let a=o.readUInt8(0),s=o.readUInt32LE(1),c=o.readUInt16LE(5);if(c>0&&i>=7+c){let f=o.subarray(7,7+c).toString("utf8");x.log(` ID[0x${n}] Hard Link: version=${a}, inode=${s}, original="${f}"`)}else x.log(` ID[0x${n}] Hard Link: (invalid original length ${c})`)}else x.log(` ID[0x${n}] Hard Link: (invalid length ${i})`);else if(e===R.UNICODE_PATH)if(i>=5){let a=o.readUInt8(0),s=o.readUInt32LE(1),c=o.subarray(5).toString("utf8"),f=Buffer.from(this.filename),l=te(f),d=s===l?"MATCH":"MISMATCH";x.log(` ID[0x${n}] Unicode Path: version=${a}, CRC32=${s.toString(16)} (${d})`),x.log(` Path: "${c}"`)}else x.log(` ID[0x${n}] Unicode Path: (invalid length ${i})`);else if(e===R.AES)if(i>=7){let a=o.readUInt16LE(0),s=String.fromCharCode(o[2],o[3]),c=o.readUInt8(4),f=o.readUInt16LE(5),l=c===3?"256-bit":c===2?"192-bit":c===1?"128-bit":"Unknown",d=a===2?"AE-2 (CRC=0 in headers)":a===1?"AE-1 (plaintext CRC in headers)":`vendorVer=${a}`;x.log(` ID[0x${n}] WinZip AES: ${d}, vendor="${s}", strength=${l}, realCompressionMethod=${f}`)}else x.log(` ID[0x${n}] WinZip AES: (invalid length ${i})`);else if(e===R.NEO_CRYPTO)if(i>=Q)if(o[0]===H[0]&&o[1]===H[1]&&o[2]===H[2]&&o[3]===H[3]){let a=o.readUInt8(4),s=o.readUInt16LE(5),c=o.readUInt16LE(7);x.log(` ID[0x${n}] NeoEncrypt: payloadVer=${a}, algorithm=${s}, flags=${c}`)}else x.log(` ID[0x${n}] NeoEncrypt: (invalid magic)`);else x.log(` ID[0x${n}] NeoEncrypt: (invalid length ${i})`);else if(e===R.ZIP64)if(x.log(` ID[0x${n}] ZIP64 Extended Information:`),i>=8){let a=0;if(a+8<=i){let s=o.readBigUInt64LE(a);x.log(` Uncompressed Size (ZIP64): ${s.toString()} bytes`),a+=8}if(a+8<=i){let s=o.readBigUInt64LE(a);x.log(` Compressed Size (ZIP64): ${s.toString()} bytes`),a+=8}if(a+8<=i){let s=o.readBigUInt64LE(a);x.log(` Local Header Offset (ZIP64): ${s.toString()}`),a+=8}if(a+4<=i){let s=o.readUInt32LE(a);x.log(` Disk Number (ZIP64): ${s}`)}}else x.log(` ZIP64 Extended Information: (invalid length ${i})`);else{let a=i>0?o.slice(0,Math.min(16,i)).toString("hex"):"";x.log(` ID[0x${n}] Unknown field: length=${i} bytes${a?", data="+a+"...":""}`)}}catch(a){x.log(` Error parsing extra field ID[0x${n}]: ${a.message}`)}t+=4+i}}catch(t){x.log(` Error parsing extra fields: ${t.message}`)}}x.log(`
8
- `)}};var qt={version:"0.7.0",releaseDate:"2026-04-06"};var Ga="ZSTD requires Node.js with native zlib support (Node.js >= 22.15 or >= 23.8). Browser builds do not include a zstd codec; use Deflate or process zstd archives in Node.";function Ae(){throw new Error(Ga)}function Ka(){return!1}function Xa(r){return Ae()}function Wa(r){return Ae()}function qa(){return Ae()}async function ja(r,t){return Ae()}async function Ja(r){return Ae()}function Qa(r,t){return Ae()}function es(r){return Ae()}async function ts(r,t,e,n,i,o){return Ae()}async function*rs(r){Ae()}var gt={isNativeZstdAvailable:Ka,mapCompressionLevel:Xa,createCompressTransform:Wa,createDecompressTransform:qa,compress:ja,decompress:Ja,compressSync:Qa,decompressSync:es,compressChunks:ts,decompressStream:rs};var de=class r{constructor(t){this.crc32State=-1;this.sha256Hash=null;this.useSHA256=!1;this.hashes=[];this.xorResult=Buffer.alloc(32,0);this.enableAccumulation=!1;this.merkleLeaves=[];this.merkleLayers=[];this.merkleOptions={hashLeaves:!1,sortLeaves:!0,sortPairs:!0,duplicateOdd:!0};this.useSHA256=t?.useSHA256||!1,this.enableAccumulation=t?.enableAccumulation||!1,this.useSHA256&&(this.sha256Hash=it("sha256"))}update(t){for(let e=0;e<t.length;e++)this.crc32State=Wt(this.crc32State,t[e]);this.sha256Hash&&this.sha256Hash.update(t)}finalizeCRC32(){return~this.crc32State>>>0}finalizeSHA256(){return this.sha256Hash?this.sha256Hash.digest("hex"):null}reset(){this.crc32State=-1,this.sha256Hash&&(this.sha256Hash=it("sha256"))}addHash(t){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");let e=typeof t=="string"?Buffer.from(t,"hex"):t;this.hashes.push(e),this.merkleLeaves.push(e);for(let n=0;n<32;n++)this.xorResult[n]^=e[n];this.rebuildMerkleTree()}xorHash(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");return this.xorResult.toString("hex")}merkleRoot(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");if(this.merkleLeaves.length===0)return null;this.merkleLayers.length===0&&this.rebuildMerkleTree();let t=this.merkleLayers[this.merkleLayers.length-1];return t&&t.length>0?t[0].toString("hex"):null}leafCount(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");return this.hashes.length}clear(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");this.hashes=[],this.merkleLeaves=[],this.merkleLayers=[],this.xorResult=Buffer.alloc(32,0)}static combineResults(t){let e=new r({enableAccumulation:!0});for(let n of t)n.merkleRoot&&e.addHash(n.merkleRoot);return e.merkleRoot()}hash(t){return it("sha256").update(t).digest()}combinedHash(t,e){return this.merkleOptions.sortPairs&&Buffer.compare(t,e)>0&&([t,e]=[e,t]),this.hash(Buffer.concat([t,e]))}createHashes(t){for(;t.length>1;){let e=this.merkleLayers.length;this.merkleLayers.push([]);for(let n=0;n<t.length-1;n+=2){let i=t[n],o=t[n+1],a=this.combinedHash(i,o);this.merkleLayers[e].push(a)}if(t.length%2===1){let n=t[t.length-1];if(this.merkleOptions.duplicateOdd){let i=this.combinedHash(n,n);this.merkleLayers[e].push(i)}else this.merkleLayers[e].push(n)}t=this.merkleLayers[e]}}rebuildMerkleTree(){if(this.merkleLeaves.length===0){this.merkleLayers=[];return}let t=this.merkleLeaves.map(e=>this.merkleOptions.hashLeaves?this.hash(e):Buffer.isBuffer(e)?e:Buffer.from(e));this.merkleOptions.sortLeaves&&t.sort(Buffer.compare),this.merkleLayers=[t],this.createHashes(t)}getProof(t){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");this.merkleLayers.length===0&&this.rebuildMerkleTree();let e=this.merkleLeaves.findIndex(n=>n.equals(t));if(e===-1)throw new Error("Leaf not found in tree");return this.merkleLayers.reduce((n,i)=>{if(i.length===1)return n;let o=e%2===0?e+1:e-1;return o<i.length&&n.push(i[o]),e=Math.floor(e/2),n},[])}verify(t,e,n){let i=e;for(let o of t)i=Buffer.compare(i,o)<=0?this.combinedHash(i,o):this.combinedHash(o,i);return i.equals(n)}},yt=de;var ns=2*Ye+Ce,is=1e3,Nr=16,jt=class r{constructor(t){this.aesKey=t,this.counter=Buffer.alloc(Nr),this.counter[0]=1,this.keystream=this.encryptCounter(),this.ksPos=0}process(t){if(t.length===0)return Buffer.alloc(0);let e=Buffer.alloc(t.length);for(let n=0;n<t.length;n++)this.ksPos>=Nr&&(r.incrementCounterLE(this.counter),this.keystream=this.encryptCounter(),this.ksPos=0),e[n]=t[n]^this.keystream[this.ksPos++];return e}encryptCounter(){let t=ri("aes-256-ecb",this.aesKey,null);return t.setAutoPadding(!1),t.update(this.counter)}static incrementCounterLE(t){for(let e=0;e<Nr;e++)if(t[e]===255)t[e]=0;else{t[e]++;break}}},kr=class{constructor(t){this.headerSent=!1;this.finished=!1;this.salt=Xt(ce),this.keys=ne.deriveKeys(t,this.salt),this.ctr=new jt(this.keys.aesKey),this.hmac=Lr("sha1",this.keys.hmacKey)}header(){if(this.finished)throw new Error("AesEncryptor already finished");return this.headerSent=!0,Buffer.concat([this.salt,this.keys.passwordVerifier])}update(t){if(this.finished)throw new Error("AesEncryptor already finished");if(!this.headerSent)throw new Error("AesEncryptor.header() must be called before update()");if(t.length===0)return Buffer.alloc(0);let e=this.ctr.process(t);return this.hmac.update(e),e}finish(){if(this.finished)throw new Error("AesEncryptor already finished");if(!this.headerSent)throw new Error("AesEncryptor.header() must be called before finish()");return this.finished=!0,this.hmac.digest().subarray(0,ue)}},vr=class{constructor(t,e){this.keys=null;this.ctr=null;this.hmac=null;this.headerBuf=Buffer.alloc(0);this.authBuf=Buffer.alloc(0);this.headerDone=!1;this.verified=!1;if(e<Vt)throw new Error("AES decryption failed: payload too short");this.password=t,this.cipherLen=e-Vt,this.remainingCipher=this.cipherLen}push(t){let e=t;if(!this.headerDone){this.headerBuf=Buffer.concat([this.headerBuf,e]);let s=ce+Ce;if(this.headerBuf.length<s)return Buffer.alloc(0);let c=this.headerBuf.subarray(0,ce),f=this.headerBuf.subarray(ce,s);if(this.keys=ne.deriveKeys(this.password,c),!this.keys.passwordVerifier.equals(f))throw new Error("AES decryption failed: wrong password");this.ctr=new jt(this.keys.aesKey),this.hmac=Lr("sha1",this.keys.hmacKey),this.headerDone=!0,e=this.headerBuf.subarray(s),this.headerBuf=Buffer.alloc(0)}if(e.length===0)return Buffer.alloc(0);let n=Math.min(e.length,this.remainingCipher),i=e.subarray(0,n),o=e.subarray(n);if(o.length>0&&(this.authBuf=Buffer.concat([this.authBuf,o])),i.length===0)return this.tryVerify(),Buffer.alloc(0);this.hmac.update(i);let a=this.ctr.process(i);return this.remainingCipher-=i.length,this.tryVerify(),a}end(){if(this.remainingCipher>0)throw new Error("AES decryption failed: truncated ciphertext");if(this.tryVerify(),!this.verified)throw new Error("AES decryption failed: missing authentication code")}tryVerify(){if(this.verified||this.remainingCipher>0||!this.hmac||this.authBuf.length<ue)return;let t=this.authBuf.subarray(0,ue);if(!this.hmac.digest().subarray(0,ue).equals(t))throw new Error("AES decryption failed: authentication code mismatch (data corrupted or tampered)");this.verified=!0}},ne=class r{static deriveKeys(t,e){let n=Buffer.isBuffer(t)?t:Buffer.from(t),i=ti(n,e,is,ns,"sha1");return{aesKey:i.subarray(0,Ye),hmacKey:i.subarray(Ye,2*Ye),passwordVerifier:i.subarray(2*Ye)}}static createEncryptor(t){return new kr(t)}static createDecryptor(t,e){return new vr(t,e)}static encryptBuffer(t,e,n){let i=r.createEncryptor(n),o=[i.header()];return e.length>0&&o.push(i.update(e)),o.push(i.finish()),Buffer.concat(o)}static decryptBuffer(t,e,n){let i=r.createDecryptor(n,e.length),o=i.push(e);return i.end(),o}static async*decryptStream(t,e,n){let i=r.createDecryptor(t,e);for await(let o of n){let a=i.push(o);a.length>0&&(yield a)}i.end()}static buildAesExtraField(t,e=1){let n=Buffer.alloc(Le);return n.writeUInt16LE(R.AES,0),n.writeUInt16LE(7,2),n.writeUInt16LE(e,4),n.writeUInt16LE(17729,6),n.writeUInt8(3,8),n.writeUInt16LE(t,9),n}static parseAesExtraField(t){return{vendorVersion:t.readUInt16LE(0),vendorId:String.fromCharCode(t[2],t[3]),encryptionStrength:t.readUInt8(4),realCmpMethod:t.readUInt16LE(5)}}};var Jt=1,Qt=class r{static buildPayloadV1(t=Jt,e=0,n=0){let i=Buffer.alloc(Q);for(let o=0;o<4;o++)i[o]=H[o];return i.writeUInt8(1,4),i.writeUInt16LE(t,5),i.writeUInt16LE(e,7),i.writeUInt16LE(n,9),i}static buildExtraFieldRecordV1(t=Jt,e=0,n=0){let i=Buffer.alloc(Re);return i.writeUInt16LE(R.NEO_CRYPTO,0),i.writeUInt16LE(Q,2),r.buildPayloadV1(t,e,n).copy(i,4),i}static tryParsePayload(t){return t.length<Q||t[0]!==H[0]||t[1]!==H[1]||t[2]!==H[2]||t[3]!==H[3]?null:{payloadVersion:t.readUInt8(4),algorithm:t.readUInt16LE(5),flags:t.readUInt16LE(7),reserved:t.readUInt16LE(9)}}static parsePayload(t){let e=r.tryParsePayload(t);if(!e||e.payloadVersion!==1)throw new Error("NeoEncrypt: invalid NEO crypto extra field");return e}static encryptBuffer(t,e,n){return ne.encryptBuffer(t,e,n)}static decryptBuffer(t,e,n){return ne.decryptBuffer(t,e,n)}};var Ho=In(),Ot=class Ot{log(...t){Ot.loggingEnabled&&x.debug("[ZipCompress]",...t)}constructor(t){this.zipkit=t,this.debug=!1,Ot.loggingEnabled&&x.setLevel("debug"),this.log("ZipCompress initialized")}async compressData(t,e,n,i){this.log(`compressData() called for entry: ${t.filename}`),(!t.uncompressedSize||t.uncompressedSize===0)&&(t.uncompressedSize=e.length);let o=e.length,a=n?.bufferSize||this.zipkit.getBufferSize();this.log(`Compressing ${o} bytes for entry: ${t.filename}`),this.log("Compression options:",{level:n?.level,useZstd:n?.useZstd,bufferSize:a});let s;n?.level===0?(s=I.STORED,this.log("Using STORED method (no compression)")):n?.useZstd?o<100?(s=I.STORED,this.log(`ZSTD fallback to STORED (file too small: ${o} bytes)`)):(s=I.ZSTD,this.log("Using ZSTD method (zstd compression)")):(s=I.DEFLATED,this.log("Using DEFLATED method (default compression)")),t.cmpMethod=s;let f=!t.crc||t.crc===0||n?.useSHA256&&!t.sha256?new de({useSHA256:n?.useSHA256&&!t.sha256||!1}):null;f&&(f.update(e),(!t.crc||t.crc===0)&&(t.crc=f.finalizeCRC32()),n?.useSHA256&&!t.sha256&&(t.sha256=f.finalizeSHA256()),this.log(`Final hashes: CRC32=0x${t.crc.toString(16).padStart(8,"0")}, SHA256=${t.sha256||"N/A"}`));let l=n?.encryptionMethod,d=l==="zipcrypto",h=l==="neo-aes256",u=n?.password&&!d&&!h;if(n?.password){let b=d?"ZipCrypto":h?"NeoEncrypt (AES-256)":"WinZip AES-256";this.log(`Encrypting compressed data for entry: ${t.filename} (method: ${b})`),t.bitFlags=(t.bitFlags||0)|M.ENCRYPTED,t.isEncrypted=!0}let E,_=s===I.ZSTD?"ZSTD":s===I.DEFLATED?"DEFLATED":"STORED";return s===I.STORED?E=e:(this.log(`Processing sequence for ${_}: [HASH] -> [COMPRESS] -> [OUTPUT]`),this.log(`Compressing: method=${_}, input=${o} bytes, buffer size=${a} bytes`),this.log(`Calculating hashes: CRC32=${!t.crc||t.crc===0}, SHA256=${n?.useSHA256}`),s===I.ZSTD?E=await this.zstdCompress(e,n,a,t,i):E=await this.deflateCompress(e,n,a,t,i)),n?.password&&(h?E=this.encryptCompressedDataNeo(t,E,n.password):u?E=this.encryptCompressedDataAes(t,E,n.password):E=this.encryptCompressedData(t,E,n.password)),t.compressedSize=E.length,E}async deflateCompress(t,e,n,i,o){this.log(`deflateCompress() called - entry: ${i?.filename??"unknown"}, bufferSize: ${n}, level: ${e?.level??6}`);let a=n||this.zipkit.getBufferSize(),s=e?.level??6;if(typeof t=="object"&&"totalSize"in t&&"onReadChunk"in t)throw new Error("Chunked reader mode not supported in ZipCompress");if(t.length<=a)return this.deflate(t,e);let c=new Ho.Deflate({level:s,raw:!0}),f=[],l=0,d=0;try{for(let u=0;u<t.length;u+=a){let E=t.slice(u,u+a),_=u+a>=t.length;if(c.push(E,_),c.result&&c.result.length>0){let b=Buffer.from(c.result);f.push(b),d+=b.length,o&&await o(b)}l+=E.length}let h=l>0?Math.round(d/l*100):0;return this.log(`Final hashes: CRC32=0x${i?.crc?.toString(16).padStart(8,"0")}, SHA256=${i?.sha256||"N/A"}`),this.log(`Deflate compression complete: ${d} bytes from ${l} bytes (ratio=${h}%)`),Buffer.concat(f)}catch(h){throw new Error(`Deflate compression failed: ${h instanceof Error?h.message:String(h)}`)}}deflate(t,e){this.log(`deflate() called with buffer size: ${t.length}, level: ${e?.level??6}`);let n=e?.level??6,i=Ho.deflateRaw(t,{level:n}),o=t.length>0?Math.round(i.length/t.length*100):0;return this.log(`Deflate compression complete: ${i.length} bytes from ${t.length} bytes (ratio=${o}%)`),Buffer.from(i.buffer,i.byteOffset,i.byteLength)}async zstdCompress(t,e,n,i,o){this.log(`zstdCompress() called - entry: ${i?.filename??"unknown"}, bufferSize: ${n}, level: ${e?.level??6}`);let a=n||this.zipkit.getBufferSize(),s=e?.level??6,c=Buffer.isBuffer(t),f=c?t.length:t.totalSize;if(!f)throw new Error("ZSTD compression: empty input buffer");if(e?.level===0){if(c)return o&&await o(t),t;let u=[],E=0;for(;E<f;){let _=Math.min(a,f-E),b=t.readChunk(E,_);o?await o(b):u.push(b),E+=b.length}return o?Buffer.alloc(0):Buffer.concat(u)}let l=c?(u,E)=>t.subarray(u,u+E):t.readChunk.bind(t),d=[],h=await gt.compressChunks(l,f,a,s,void 0,async u=>{o?await o(u):d.push(u)});return i&&(i.compressedSize=h),o?Buffer.alloc(0):Buffer.concat(d)}encryptCompressedData(t,e,n){this.log(`encryptCompressedData() called for entry: ${t.filename}, compressed size: ${e.length}`);let o=new q().encryptBuffer(t,e,n);return this.log(`Encryption complete: ${e.length} bytes compressed -> ${o.length} bytes encrypted (includes ${Te}-byte header)`),o}encryptCompressedDataNeo(t,e,n){this.log(`encryptCompressedDataNeo() called for entry: ${t.filename}, compressed size: ${e.length}`);let i=Qt.encryptBuffer(t,e,n);return t.neoCryptoPayloadVersion=1,t.neoCryptoAlgorithm=Jt,t.neoCryptoFlags=0,this.log(`NeoEncrypt encryption complete: ${e.length} bytes -> ${i.length} bytes`),i}encryptCompressedDataAes(t,e,n){this.log(`encryptCompressedDataAes() called for entry: ${t.filename}, compressed size: ${e.length}`);let i=ne.encryptBuffer(t,e,n);return t.realCmpMethod=t.cmpMethod,t.cmpMethod=I.AES_ENCRYPT,t.aesVersion=1,t.aesStrength=3,this.log(`AES-256 encryption complete: ${e.length} bytes -> ${i.length} bytes (salt+verifier+data+hmac)`),i}async compressFileBuffer(t,e,n){this.log(`compressFileBuffer() called for entry: ${t.filename}, size: ${e.length}`),t.uncompressedSize=e.length;let i=new de({useSHA256:n?.useSHA256||!1});return i.update(e),t.crc=i.finalizeCRC32(),n?.useSHA256&&(t.sha256=i.finalizeSHA256(),this.log(`SHA-256 calculated: ${t.sha256}`)),await this.compressData(t,e,n)}};Ot.loggingEnabled=!1;var xt=Ot;var $o=18,bc=Buffer.from([40,181,47,253]);function Yo(r){let t=new de;return t.update(r),t.finalizeCRC32()}function Vo(r,t,e){let n=t>>>0;if(r.length===n+$o&&r.subarray(n).equals(Buffer.alloc($o))){let i=r.subarray(0,n);return e!==void 0&&e!==0&&Yo(i)!==e>>>0?{repaired:r,wasLegacy:!1}:{repaired:i,wasLegacy:!0}}if(r.length>n&&n>0){let i=r.subarray(0,n);if(e!==void 0&&e!==0&&Yo(i)===e>>>0)return{repaired:i,wasLegacy:!0}}return{repaired:r,wasLegacy:!1}}var sl=In(),Ft=class Ft{log(...t){Ft.loggingEnabled&&x.debug("[ZipDecompress]",...t)}constructor(t){this.zipkit=t,this.debug=!1,Ft.loggingEnabled&&x.setLevel("debug")}async extract(t,e){if(!this.zipkit.hasInBuffer())throw new Error("extract() requires Buffer-based ZIP. Use ZipkitNode.extractToFile() for file-based ZIP or call loadZip() first.");this.log(`extract() called for entry: ${t.filename}, method: ${t.cmpMethod}, skipHashCheck: ${e}`);let n=this.zipkit.ensureBuffer(),i=this.zipkit.parseLocalHeader(t,n),o=this.zipkit?.password,a=t.aesVersion>0||t.cmpMethod===I.AES_ENCRYPT,s=t.neoCryptoAlgorithm>0;if(t.isEncrypted&&o&&(this.log(`Starting in-memory decryption for entry: ${t.filename} (${a||s?"AES-256 stream (WinZip or Neo)":"ZipCrypto"})`),a||s?i=ne.decryptBuffer(t,i,o):i=new q().decryptBuffer(t,n,i,o),this.log(`Decryption successful, decrypted compressed data length: ${i.length}`)),i.length===0)return null;let c=a&&t.aesVersion===2?!0:e;return this.unCompress(i,t,c)}inflate(t){this.log(`inflate() called with ${t.length} bytes`);let e=sl.inflateRaw(t);return Buffer.from(e.buffer,e.byteOffset,e.byteLength)}async zstdDecompressSync(t,e){this.log(`zstdDecompressSync() called with ${t.length} bytes`);try{let n=await gt.decompress(t);if(e&&e.uncompressedSize>0){let{repaired:i,wasLegacy:o}=Vo(n,e.uncompressedSize,e.crc);o&&this.log(`Legacy WASM zstd padding repaired: ${n.length} -> ${i.length} bytes`),n=i}return this.log(`ZSTD decompression successful: ${t.length} bytes -> ${n.length} bytes`),n}catch(n){throw this.log(`ZSTD decompression failed: ${n}`),new Error(`ZSTD decompression failed: ${n instanceof Error?n.message:String(n)}`)}}async unCompress(t,e,n){let i=e.cmpMethod===I.AES_ENCRYPT&&e.realCmpMethod>=0?e.realCmpMethod:e.cmpMethod;if(this.log(`unCompress() called for entry: ${e.filename}, method: ${i}, data length: ${t.length}`),t.length===0)return Buffer.alloc(0);let o;if(i===I.STORED)o=t;else if(i===I.DEFLATED)o=this.inflate(t);else if(i===I.ZSTD)o=await this.zstdDecompressSync(t,e);else throw new Error(`Unsupported compression method: ${i}`);if(!n){if(e.sha256){if(!this.zipkit.testSHA256(e,o))throw new Error(O.INVALID_SHA256)}else if(!this.zipkit.testCRC32(e,o))throw new Error(O.INVALID_CRC)}return o}};Ft.loggingEnabled=!1;var Bn=Ft,Go=Bn;var Je=class{constructor(t={}){this.inBuffer=null;this.zipEntries=[];this.centralDirSize=0;this.centralDirOffset=0;this.zipComment=null;this._zipkitCmp=null;this._zipkitDeCmp=null;this.config={bufferSize:t.bufferSize||512*1024,debug:t.debug||!1},this.config.debug&&x.setLevel("debug")}getZipCompress(){return this._zipkitCmp||(this._zipkitCmp=new xt(this)),this._zipkitCmp}getZipDecompress(){return this._zipkitDeCmp||(this._zipkitDeCmp=new Go(this)),this._zipkitDeCmp}getBufferSize(){return this.config.bufferSize||512*1024}hasInBuffer(){return this.inBuffer!==null&&this.inBuffer.length>0}async compressData(t,e,n,i){return this.getZipCompress().compressData(t,e,n,i)}async deflateCompress(t,e,n,i,o){return this.getZipCompress().deflateCompress(t,e,n,i,o)}deflate(t,e){return this.getZipCompress().deflate(t,e)}async zstdCompress(t,e,n,i,o){return this.getZipCompress().zstdCompress(t,e,n,i,o)}async compressFileBuffer(t,e,n){return this.getZipCompress().compressFileBuffer(t,e,n)}async extract(t,e){return this.getZipDecompress().extract(t,e)}loadZip(t){this.resetZipData(),this.inBuffer=t,this.loadEOCDFromBuffer(t);let e=this.getDirectoryFromBuffer();return this.zipEntries=e,e}resetZipData(){this.inBuffer=null,this.zipEntries=[],this.reset(),this.zipComment=null,this._zipkitCmp=null,this._zipkitDeCmp=null}getDirectory(t){return this.zipEntries}getZipEntry(t){try{return this.getDirectory().find(n=>n.filename===t)||null}catch{return null}}ensureBuffer(){return this.inBuffer||(this.inBuffer=Buffer.alloc(0)),this.inBuffer}parseLocalHeader(t,e){let n=e.subarray(t.localHdrOffset);if(n.readUInt32LE(0)!==k.SIGNATURE)throw new Error(O.INVALID_CEN);let i=n.readUInt16LE(k.FLAGS),o=n.readUInt16LE(k.FNAME_LEN),a=n.readUInt16LE(k.EXTRA_LEN),s=k.SIZE+o+a,c=t.aesVersion>0||t.cmpMethod===I.AES_ENCRYPT,f=t.neoCryptoAlgorithm>0;if(c||f){let u=s,E=s+t.compressedSize;return n.subarray(u,E)}let l=0;i&M.ENCRYPTED&&(l=Te);let d=s+l,h=s+t.compressedSize;return n.subarray(d,h)}testCRC32(t,e){let n=te(e),i=n===t.crc;return x.debug(`[DEBUG] testCRC32() comparison: calculated=${n}, stored=${t.crc}, isValid=${i?"\u2713":"\u2717"}, DATA_DESC=${(t.bitFlags&8)!==0?"YES":"NO"}`),i}testSHA256(t,e){if(!t.sha256)throw new Error(O.UNKNOWN_SHA256);let n=ot(e),i=n===t.sha256;return x.debug(`[DEBUG] testSHA256() comparison: calculated=${n}, stored=${t.sha256}, isValid=${i?"\u2713":"\u2717"}`),i}getMemoryUsage(){let t=this.inBuffer?.length||0,e=this.zipEntries.length*1024,n;return this.inBuffer?n="buffer":n="none",{backend:n,memoryUsage:t+e,entries:this.zipEntries.length}}createZipEntry(t,e,n){let i=new re(t,null,!1);return e?(i.crc=te(e),i.uncompressedSize=e.length,i.compressedSize=e.length):(i.crc=0,i.uncompressedSize=0,i.compressedSize=0),i.cmpMethod=I.STORED,i.bitFlags=0,this.zipEntries.push(i),i}async copyEntry(t){if(t.cmpData){let e=t.createLocalHdr();return Buffer.concat([e,t.cmpData])}throw new Error("Cannot copy entry: no compressed data available")}get centralEndHdr(){return(t,e)=>{let n=this.zipEntries.length;return this.centralEndHdrMethod(t,e,n)}}getZipComment(){return this.zipComment}loadEOCDFromBuffer(t){let e=t.length,n=Math.min(65557,e),i=e-n,o=t.subarray(i,i+n),a=-1;for(let f=o.length-22;f>=0;f--)if(o[f]===80&&o.readUInt32LE(f)===ee.SIGNATURE){a=i+f;break}if(a===-1)throw new Error(O.INVALID_FORMAT);let s=t.subarray(a,a+22);if(s.readUInt32LE(0)===ee.SIGNATURE){if(this.centralDirSize=s.readUInt32LE(ee.CENTRAL_DIR_SIZE),this.centralDirOffset=s.readUInt32LE(ee.CENTRAL_DIR_OFFSET),this.centralDirOffset===4294967295){let f=a-20,l=t.subarray(f,f+20);if(l.readUInt32LE(0)===Br.SIGNATURE){let d=Number(l.readBigUInt64LE(8)),h=t.subarray(d,d+56);this.centralDirSize=Number(h.readBigUInt64LE(Gt.CENTRAL_DIR_SIZE)),this.centralDirOffset=Number(h.readBigUInt64LE(Gt.CENTRAL_DIR_OFFSET))}}}else throw new Error(O.INVALID_FORMAT);let c=s.readUInt16LE(ee.ZIP_COMMENT_LEN);if(c>0){let f=a+22;this.zipComment=t.subarray(f,f+c).toString()}}getDirectoryFromBuffer(){if(!this.inBuffer)return[];let t=this.inBuffer,e=[],n=this.centralDirOffset,i=this.centralDirSize,o=this.config.bufferSize||512*1024;for(;i>0;){let a=Math.min(o,i),s=t.subarray(n,n+a),c=0;for(;c<s.length&&s.readUInt32LE(c)===A.SIGNATURE;){let f=new re(null,null,!1),l=s.subarray(c),d=f.readZipEntry(l);e.push(f),c+=l.length-d.length}n+=a,i-=a}return e}reset(){this.centralDirSize=0,this.centralDirOffset=0}centralEndHdrMethod(t,e,n){let i=Buffer.alloc(ee.SIZE);return i.writeUInt32LE(ee.SIGNATURE,0),i.writeUInt16LE(0,4),i.writeUInt16LE(0,6),i.writeUInt16LE(n,8),i.writeUInt16LE(n,10),i.writeUInt32LE(t,12),i.writeUInt32LE(e,16),i.writeUInt16LE(0,20),i}getMerkleRoot(){let t;try{t=this.getDirectory()}catch(o){return x.error(`getMerkleRoot(): Error calling getDirectory(): ${o instanceof Error?o.message:String(o)}`),x.error(`getMerkleRoot(): Stack trace: ${o instanceof Error?o.stack:"No stack trace"}`),null}if(!t||t.length===0)return null;let e=new yt({enableAccumulation:!0}),n=t.filter(o=>{let a=o.filename||"";return a!==se&&a!==fe&&a!==le});for(let o of n)if(o.sha256){let a=Buffer.from(o.sha256,"hex");e.addHash(a)}let i=e.merkleRoot();return i||null}async getMerkleRootAsync(){let t=[];try{if(this.inBuffer)t=this.getDirectory();else return x.error("getMerkleRootAsync() called on file-based ZIP. Use ZipkitServer.getMerkleRootAsync() instead."),null}catch(o){return x.error(`Failed to get directory for merkle root calculation: ${o instanceof Error?o.message:String(o)}`),null}if(!t||t.length===0)return null;let e=new yt({enableAccumulation:!0}),n=t.filter(o=>{let a=o.filename||"";return a!==se&&a!==fe&&a!==le});for(let o of n)if(o.sha256){let a=Buffer.from(o.sha256,"hex");e.addHash(a)}let i=e.merkleRoot();return i||null}};Je.version=qt.version,Je.releaseDate=qt.releaseDate;var hr=class{constructor(t){this.zipkit=t}calculateLocalHeaderSize(t,e){if(e.localHdrOffset+k.SIZE>t.length)throw new Error(`Local header offset ${e.localHdrOffset} is beyond buffer size ${t.length} for entry ${e.filename}`);let n=t.subarray(e.localHdrOffset,e.localHdrOffset+k.SIZE);if(n.readUInt32LE(0)!==k.SIGNATURE)throw new Error(`Invalid local file header signature for entry ${e.filename} at offset ${e.localHdrOffset}`);let i=n.readUInt16LE(k.FNAME_LEN),o=n.readUInt16LE(k.EXTRA_LEN);return k.SIZE+i+o}copyEntryBytes(t,e){let n=this.calculateLocalHeaderSize(t,e),i=(e.bitFlags&M.DATA_DESC)!==0,o=n+e.compressedSize+(i?16:0);if(e.localHdrOffset+o>t.length)throw new Error(`Entry ${e.filename} extends beyond buffer size: offset ${e.localHdrOffset} + size ${o} > buffer length ${t.length}`);let a=t.subarray(e.localHdrOffset,e.localHdrOffset+o);if(i){let s=n+e.compressedSize,c=a.readUInt32LE(s);if(c!==134695760)throw new Error(`Invalid data descriptor signature for entry ${e.filename} (expected 0x08074b50, got 0x${c.toString(16)})`)}return Buffer.from(a)}cloneEntryWithOffset(t,e){let n=new re(t.filename,t.comment||null,t.debug);return n.verMadeBy=t.verMadeBy,n.verExtract=t.verExtract,n.bitFlags=t.bitFlags,n.cmpMethod=t.cmpMethod,n.timeDateDOS=t.timeDateDOS,n.crc=t.crc,n.compressedSize=t.compressedSize,n.uncompressedSize=t.uncompressedSize,n.volNumber=t.volNumber,n.intFileAttr=t.intFileAttr,n.extFileAttr=t.extFileAttr,n.localHdrOffset=e,t.extraField&&(n.extraField=Buffer.from(t.extraField)),n.isEncrypted=t.isEncrypted,n.isStrongEncrypt=t.isStrongEncrypt,n.isDirectory=t.isDirectory,n.isMetaData=t.isMetaData,n.isUpdated=t.isUpdated,n.platform=t.platform,n.universalTime=t.universalTime,n.uid=t.uid,n.gid=t.gid,n.sha256=t.sha256,n.isSymlink=t.isSymlink,n.linkTarget=t.linkTarget,n.isHardLink=t.isHardLink,n.originalEntry=t.originalEntry,n.inode=t.inode,n}buildCentralDirectoryAndEOCDBuffer(t,e,n){let i=[];for(let d of t)i.push(d.centralDirEntry());let o=Buffer.concat(i),a=o.length,s=Buffer.from(e,"utf8"),c=Math.min(s.length,65535),f=Buffer.alloc(22+c),l=0;return f.writeUInt32LE(ee.SIGNATURE,l),l+=4,f.writeUInt16LE(0,l),l+=2,f.writeUInt16LE(0,l),l+=2,f.writeUInt16LE(t.length,l),l+=2,f.writeUInt16LE(t.length,l),l+=2,f.writeUInt32LE(a,l),l+=4,f.writeUInt32LE(n,l),l+=4,f.writeUInt16LE(c,l),l+=2,c>0&&s.copy(f,l,0,c),Buffer.concat([o,f])}async copyZipEntriesOnly(t,e){let n=this.zipkit.loadZip(t),i=e?.entryFilter?n.filter(e.entryFilter):n;if(e?.entrySorter&&(i=[...i].sort(e.entrySorter)),i.length===0)throw new Error("No entries to copy after filtering");let o=[],a=0,s=[];for(let f of i){let l=a,d=this.copyEntryBytes(t,f);o.push(d),a+=d.length;let h=this.cloneEntryWithOffset(f,l);s.push(h)}let c=Buffer.concat(o);return{entryDataBuffer:c,dataEndOffset:c.length,copiedEntries:s}}writeCentralDirectoryAndEOCD(t,e){if(t.length===0)throw new Error("At least one entry is required to finalize");let n=e?.zipComment??"",i=e?.centralDirOffset??0;return this.buildCentralDirectoryAndEOCDBuffer(t,n,i)}async copyZipBuffer(t,e){let{entryDataBuffer:n,dataEndOffset:i,copiedEntries:o}=await this.copyZipEntriesOnly(t,e),a=e?.preserveComments!==!1&&this.zipkit.getZipComment()?this.zipkit.getZipComment():"",s=this.writeCentralDirectoryAndEOCD(o,{zipComment:a,centralDirOffset:i}),c=Buffer.concat([n,s]);return{entries:o.map(f=>({filename:f.filename,localHeaderOffset:f.localHdrOffset,compressedSize:f.compressedSize})),centralDirOffset:i,totalEntries:o.length,zipBuffer:c}}};var fl={base64:!0,array:!0,string:!0,isNode:!0,buffer:!0,uint8array:!0,arrayBuffer:typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",blob:!0,streams:!0,fileReader:!1},Qe=fl;var we={STRING:"string",BUFFER:"buffer",ARRAY:"array",ARRAYBUFFER:"arraybuffer",U8ARRAY:"uint8array",BLOB:"blob",STREAM:"stream"};function ll(r,t){var e=Buffer.from(r.subarray(t,t+8));return e.swap64(),parseInt(`0x${e.toString("hex")}`)}var cl=(r,t)=>Math.imul(r,t)>>>0;function ul(r){if(!r||typeof r!="object")return!1;let t=r;return typeof t.on=="function"&&typeof t.pause=="function"&&typeof t.resume=="function"}function dr(r){if(typeof r=="string"){if(!Qe.string)throw new Error(O.DATATYPE_STRING_UNSUPPORTED);return we.STRING}else if(Object.prototype.toString.call(r)==="[object Array]"){if(!Qe.array)throw new Error(O.DATATYPE_ARRAY_UNSUPPORTED);return we.ARRAY}else if(Buffer.isBuffer(r)){if(!Qe.buffer)throw new Error(O.DATATYPE_BUFFER_UNSUPPORTED);return we.BUFFER}else if(r instanceof Blob){if(!Qe.blob)throw new Error(O.DATATYPE_BLOB_UNSUPPORTED);return we.BLOB}else if(r instanceof Uint8Array){if(!Qe.uint8array)throw new Error(O.DATATYPE_U8ARRAY_UNSUPPORTED);return we.U8ARRAY}else if(r instanceof ArrayBuffer){if(!Qe.arrayBuffer)throw new Error(O.DATATYPE_ARRAYBUFFER_UNSUPPORTED);return we.ARRAYBUFFER}else throw new Error(O.DATATYPE_UNSUPPORTED)}var hl=r=>r===se||r===fe||r===le;var pr=class{constructor(t,e){this.lastReportedPercent=-1;this.fileName=t,this.totalBytes=e,this.processedBytes=0,this.startTime=Date.now(),this.lastUpdateTime=this.startTime}update(t){this.processedBytes+=t,this.reportProgress()}setTotalBytes(t){this.totalBytes=t}reportProgress(){let t=Date.now(),e=Math.floor(this.processedBytes/this.totalBytes*100);(e>this.lastReportedPercent||t-this.lastUpdateTime>500)&&(this.lastReportedPercent=e,this.lastUpdateTime=t,this.printProgress())}printProgress(){let t=(Date.now()-this.startTime)/1e3,e=this.processedBytes/t,n=this.totalBytes>this.processedBytes?(this.totalBytes-this.processedBytes)/e:0,i=Math.floor(this.processedBytes/this.totalBytes*100),o=s=>{let c=["B","KB","MB","GB"],f=s,l=0;for(;f>=1024&&l<c.length-1;)f/=1024,l++;return`${f.toFixed(1)}${c[l]}`},a=s=>s<60?`${s.toFixed(0)}s`:s<3600?`${Math.floor(s/60)}m ${(s%60).toFixed(0)}s`:`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`;process.stdout.write(`\r${this.fileName}: ${i}% (${o(this.processedBytes)}/${o(this.totalBytes)}) [${o(e)}/s] ETA: ${a(n)}`)}complete(){let t=(Date.now()-this.startTime)/1e3,e=this.processedBytes/t,n=i=>{let o=["B","KB","MB","GB"],a=i,s=0;for(;a>=1024&&s<o.length-1;)a/=1024,s++;return`${a.toFixed(1)}${o[s]}`};console.log(`\r${this.fileName}: 100% (${n(this.processedBytes)}) [${n(e)}/s] completed in ${t.toFixed(1)}s`)}getProgressPercent(){return Math.floor(this.processedBytes/this.totalBytes*100)}getProcessingRate(){let t=(Date.now()-this.startTime)/1e3;return this.processedBytes/t}};var mr=class{constructor(){this.providers=new Map;this.registerProvider(new q)}registerProvider(t){t.canHandle(1)&&this.providers.set(1,t),t.canHandle(2)&&this.providers.set(2,t)}getAvailableMethods(){return Array.from(this.providers.keys())}getProvider(t){return this.providers.get(t)||null}async encrypt(t,e){let n=this.getProvider(e.method);return n?await n.encrypt(t,e):{success:!1,error:`No encryption provider available for method ${e.method}`}}async decrypt(t,e){let n=this.getProvider(e.method);return n?await n.decrypt(t,e):{success:!1,error:`No decryption provider available for method ${e.method}`}}getRecommendedMethod(){return 2}validateOptions(t){let e=[];return t.method||e.push("Encryption method is required"),(!t.password||t.password.length===0)&&e.push("Password is required"),t.password&&t.password.length<4&&e.push("Password must be at least 4 characters long"),{isValid:e.length===0,errors:e}}getMethodInfo(t){let e=this.getProvider(t);return e?{name:e.getMethodName(),keyLength:e.getKeyLength(),secure:t===2}:null}listMethods(){let t=[];for(let[e,n]of this.providers)t.push({method:e,name:n.getMethodName(),keyLength:n.getKeyLength(),secure:e===2});return t.sort((e,n)=>e.name.localeCompare(n.name))}};var Dn=new Date,dl=`${String(Dn.getMonth()+1).padStart(2,"0")}-${String(Dn.getDate()).padStart(2,"0")}-${Dn.getFullYear()}`,pl={number:"1.0.2",date:dl};var Ko=Je;var Pt=class extends Ko{constructor(){super()}async loadZipBlob(t){if(dr(t)!==we.BLOB)throw new Error(O.DATATYPE_UNSUPPORTED);return new Promise((e,n)=>{let i=new window.FileReader;i.readAsArrayBuffer(t),i.onload=o=>{if(!i.result){n(new Error("Failed to read file"));return}try{let a=Buffer.from(i.result),s=super.loadZip(a);e(s)}catch(a){n(a)}},i.onerror=()=>{n(i.error||new Error("Failed to read file"))}})}createZipFileEntry(t){let e=super.createZipEntry(t.name);e.fileData=t,e.uncompressedSize=t.size;let n=new Date(t.lastModified);return e.timeDateDOS=e.setDateTime(n),e.cmpMethod=I.DEFLATED,e}async hashFile(t){let e=await t.arrayBuffer(),n=Buffer.from(e);return ot(n)}async compressDataBlob(t,e,n){if(dr(e)!==we.BLOB)throw new Error(O.DATATYPE_UNSUPPORTED);return new Promise(async(i,o)=>{let a=async(c,f,l)=>await this.compressData(c,f,l),s=new window.FileReader;s.readAsArrayBuffer(e),s.onload=async function(c){if(!this.result){o(new Error("Failed to read file"));return}try{let f=Buffer.from(this.result),l=await a(t,f,n);i(l)}catch(f){o(f)}},s.onerror=function(c){o(this.error||new Error("Failed to read file"))}})}async extractBlob(t,e){try{let n=await this.extract(t,e);if(!n)return null;let i=new Uint8Array(n);return new Blob([i],{type:"application/octet-stream"})}catch(n){throw n}}async createZipBlob(t,e){let n=e?.onError||(()=>{}),i=e?.onEntryDone||(()=>{}),o=super.getDirectory();if(!o)return n(new Error(O.NO_FILES)),null;let a=0,s=[];for(let u of o){if(!u.isUpdated)if(u.filename===le||u.filename===se||u.filename===fe)u.isUpdated=!0;else{let _=await super.copyEntry(u);u.localHdrOffset=a,a+=_.length,s.push(_),i(u,"Copied");continue}if(!u.fileData)return n(new Error(O.FILE_NOT_FOUND)),null;let E=await u.fileData.arrayBuffer();if(u.cmpData&&u.compressedSize&&u.crc){let _=u.createLocalHdr();u.localHdrOffset=a,a+=_.length+u.cmpData.length,s.push(_),s.push(u.cmpData),i(u,"Written (pre-compressed)");continue}if(u.filename===le||u.filename===se||u.filename===fe){let _=Buffer.from(E);u.crc=te(_),u.cmpMethod=0,u.compressedSize=_.length,u.uncompressedSize=_.length;let b=u.createLocalHdr();u.localHdrOffset=a,a+=b.length+_.length,s.push(b),s.push(_),i(u,"Stored (metadata)")}else{let _=await this.compressData(u,Buffer.from(E),t),b=u.createLocalHdr();u.localHdrOffset=a,a+=b.length+_.length,s.push(b),s.push(_),i(u,"Written")}}let c=a;for(let u of o){let E=u.centralDirEntry();a+=E.length,s.push(E)}let f=a-c,l=super.centralEndHdr(f,c);s.push(l);let d=Buffer.concat(s),h=new Uint8Array(d);return new Blob([h],{type:"application/zip"})}isMetadataFile(t){return t===se||t===fe||t===le}async addFile(t,e){let n=this.createZipFileEntry(t),i=t,o=await this.compressDataBlob(n,i,e);return n.cmpData=o,n}async verifyEntry(t,e){try{return await this.extractBlob(t,e)!==null}catch(n){return console.error(`Verification failed for ${t.filename}:`,n),!1}}};typeof globalThis<"u"&&(globalThis.Buffer=Xo.Buffer);var ml={isBrowser:typeof window<"u"&&typeof document<"u",isNode:typeof process<"u"&&process.versions&&process.versions.node};return ra(El);})();
6
+ "use strict";var NeoZipKit=(()=>{var bc=Object.create;var pn=Object.defineProperty;var yc=Object.getOwnPropertyDescriptor;var wc=Object.getOwnPropertyNames;var Sc=Object.getPrototypeOf,Ac=Object.prototype.hasOwnProperty;var Y=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Ic=(e,r)=>{for(var t in r)pn(e,t,{get:r[t],enumerable:!0})},ga=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of wc(r))!Ac.call(e,i)&&i!==t&&pn(e,i,{get:()=>r[i],enumerable:!(n=yc(r,i))||n.enumerable});return e};var xa=(e,r,t)=>(t=e!=null?bc(Sc(e)):{},ga(r||!e||!e.__esModule?pn(t,"default",{value:e,enumerable:!0}):t,e)),Bc=e=>ga(pn({},"__esModule",{value:!0}),e);var wa=Y(_n=>{"use strict";_n.byteLength=Dc;_n.toByteArray=kc;_n.fromByteArray=Rc;var Se=[],ue=[],Tc=typeof Uint8Array<"u"?Uint8Array:Array,ci="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(bt=0,ba=ci.length;bt<ba;++bt)Se[bt]=ci[bt],ue[ci.charCodeAt(bt)]=bt;var bt,ba;ue[45]=62;ue[95]=63;function ya(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var n=t===r?0:4-t%4;return[t,n]}function Dc(e){var r=ya(e),t=r[0],n=r[1];return(t+n)*3/4-n}function Lc(e,r,t){return(r+t)*3/4-t}function kc(e){var r,t=ya(e),n=t[0],i=t[1],o=new Tc(Lc(e,n,i)),a=0,s=i>0?n-4:n,c;for(c=0;c<s;c+=4)r=ue[e.charCodeAt(c)]<<18|ue[e.charCodeAt(c+1)]<<12|ue[e.charCodeAt(c+2)]<<6|ue[e.charCodeAt(c+3)],o[a++]=r>>16&255,o[a++]=r>>8&255,o[a++]=r&255;return i===2&&(r=ue[e.charCodeAt(c)]<<2|ue[e.charCodeAt(c+1)]>>4,o[a++]=r&255),i===1&&(r=ue[e.charCodeAt(c)]<<10|ue[e.charCodeAt(c+1)]<<4|ue[e.charCodeAt(c+2)]>>2,o[a++]=r>>8&255,o[a++]=r&255),o}function Cc(e){return Se[e>>18&63]+Se[e>>12&63]+Se[e>>6&63]+Se[e&63]}function vc(e,r,t){for(var n,i=[],o=r;o<t;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),i.push(Cc(n));return i.join("")}function Rc(e){for(var r,t=e.length,n=t%3,i=[],o=16383,a=0,s=t-n;a<s;a+=o)i.push(vc(e,a,a+o>s?s:a+o));return n===1?(r=e[t-1],i.push(Se[r>>2]+Se[r<<4&63]+"==")):n===2&&(r=(e[t-2]<<8)+e[t-1],i.push(Se[r>>10]+Se[r>>4&63]+Se[r<<2&63]+"=")),i.join("")}});var Sa=Y(ui=>{ui.read=function(e,r,t,n,i){var o,a,s=i*8-n-1,c=(1<<s)-1,f=c>>1,l=-7,d=t?i-1:0,h=t?-1:1,u=e[r+d];for(d+=h,o=u&(1<<-l)-1,u>>=-l,l+=s;l>0;o=o*256+e[r+d],d+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=a*256+e[r+d],d+=h,l-=8);if(o===0)o=1-f;else{if(o===c)return a?NaN:(u?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(u?-1:1)*a*Math.pow(2,o-n)};ui.write=function(e,r,t,n,i,o){var a,s,c,f=o*8-i-1,l=(1<<f)-1,d=l>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,u=n?0:o-1,p=n?1:-1,b=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,a=l):(a=Math.floor(Math.log(r)/Math.LN2),r*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+d>=1?r+=h/c:r+=h*Math.pow(2,1-d),r*c>=2&&(a++,c/=2),a+d>=l?(s=0,a=l):a+d>=1?(s=(r*c-1)*Math.pow(2,i),a=a+d):(s=r*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[t+u]=s&255,u+=p,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;e[t+u]=a&255,u+=p,a/=256,f-=8);e[t+u-p]|=b*128}});var bi=Y(Vt=>{"use strict";var hi=wa(),Ht=Sa(),Aa=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Vt.Buffer=g;Vt.SlowBuffer=Mc;Vt.INSPECT_MAX_BYTES=50;var mn=2147483647;Vt.kMaxLength=mn;g.TYPED_ARRAY_SUPPORT=Oc();!g.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Oc(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return!1}}Object.defineProperty(g.prototype,"parent",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.buffer}});Object.defineProperty(g.prototype,"offset",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.byteOffset}});function Ke(e){if(e>mn)throw new RangeError('The value "'+e+'" is invalid for option "size"');let r=new Uint8Array(e);return Object.setPrototypeOf(r,g.prototype),r}function g(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return mi(e)}return Da(e,r,t)}g.poolSize=8192;function Da(e,r,t){if(typeof e=="string")return Nc(e,r);if(ArrayBuffer.isView(e))return Zc(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Ae(e,ArrayBuffer)||e&&Ae(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ae(e,SharedArrayBuffer)||e&&Ae(e.buffer,SharedArrayBuffer)))return pi(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return g.from(n,r,t);let i=zc(e);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return g.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}g.from=function(e,r,t){return Da(e,r,t)};Object.setPrototypeOf(g.prototype,Uint8Array.prototype);Object.setPrototypeOf(g,Uint8Array);function La(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function Uc(e,r,t){return La(e),e<=0?Ke(e):r!==void 0?typeof t=="string"?Ke(e).fill(r,t):Ke(e).fill(r):Ke(e)}g.alloc=function(e,r,t){return Uc(e,r,t)};function mi(e){return La(e),Ke(e<0?0:Ei(e)|0)}g.allocUnsafe=function(e){return mi(e)};g.allocUnsafeSlow=function(e){return mi(e)};function Nc(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!g.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=ka(e,r)|0,n=Ke(t),i=n.write(e,r);return i!==t&&(n=n.slice(0,i)),n}function di(e){let r=e.length<0?0:Ei(e.length)|0,t=Ke(r);for(let n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Zc(e){if(Ae(e,Uint8Array)){let r=new Uint8Array(e);return pi(r.buffer,r.byteOffset,r.byteLength)}return di(e)}function pi(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');let n;return r===void 0&&t===void 0?n=new Uint8Array(e):t===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,t),Object.setPrototypeOf(n,g.prototype),n}function zc(e){if(g.isBuffer(e)){let r=Ei(e.length)|0,t=Ke(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||xi(e.length)?Ke(0):di(e);if(e.type==="Buffer"&&Array.isArray(e.data))return di(e.data)}function Ei(e){if(e>=mn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+mn.toString(16)+" bytes");return e|0}function Mc(e){return+e!=e&&(e=0),g.alloc(+e)}g.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==g.prototype};g.compare=function(r,t){if(Ae(r,Uint8Array)&&(r=g.from(r,r.offset,r.byteLength)),Ae(t,Uint8Array)&&(t=g.from(t,t.offset,t.byteLength)),!g.isBuffer(r)||!g.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let n=r.length,i=t.length;for(let o=0,a=Math.min(n,i);o<a;++o)if(r[o]!==t[o]){n=r[o],i=t[o];break}return n<i?-1:i<n?1:0};g.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};g.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return g.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;let i=g.allocUnsafe(t),o=0;for(n=0;n<r.length;++n){let a=r[n];if(Ae(a,Uint8Array))o+a.length>i.length?(g.isBuffer(a)||(a=g.from(a)),a.copy(i,o)):Uint8Array.prototype.set.call(i,a,o);else if(g.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function ka(e,r){if(g.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Ae(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let t=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let i=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return _i(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ma(e).length;default:if(i)return n?-1:_i(e).length;r=(""+r).toLowerCase(),i=!0}}g.byteLength=ka;function Fc(e,r,t){let n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return qc(this,r,t);case"utf8":case"utf-8":return va(this,r,t);case"ascii":return Xc(this,r,t);case"latin1":case"binary":return Wc(this,r,t);case"base64":return Kc(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jc(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}g.prototype._isBuffer=!0;function yt(e,r,t){let n=e[r];e[r]=e[t],e[t]=n}g.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<r;t+=2)yt(this,t,t+1);return this};g.prototype.swap32=function(){let r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<r;t+=4)yt(this,t,t+3),yt(this,t+1,t+2);return this};g.prototype.swap64=function(){let r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<r;t+=8)yt(this,t,t+7),yt(this,t+1,t+6),yt(this,t+2,t+5),yt(this,t+3,t+4);return this};g.prototype.toString=function(){let r=this.length;return r===0?"":arguments.length===0?va(this,0,r):Fc.apply(this,arguments)};g.prototype.toLocaleString=g.prototype.toString;g.prototype.equals=function(r){if(!g.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:g.compare(this,r)===0};g.prototype.inspect=function(){let r="",t=Vt.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};Aa&&(g.prototype[Aa]=g.prototype.inspect);g.prototype.compare=function(r,t,n,i,o){if(Ae(r,Uint8Array)&&(r=g.from(r,r.offset,r.byteLength)),!g.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),t<0||n>r.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,o>>>=0,this===r)return 0;let a=o-i,s=n-t,c=Math.min(a,s),f=this.slice(i,o),l=r.slice(t,n);for(let d=0;d<c;++d)if(f[d]!==l[d]){a=f[d],s=l[d];break}return a<s?-1:s<a?1:0};function Ca(e,r,t,n,i){if(e.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,xi(t)&&(t=i?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(i)return-1;t=e.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof r=="string"&&(r=g.from(r,n)),g.isBuffer(r))return r.length===0?-1:Ia(e,r,t,n,i);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):Ia(e,[r],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Ia(e,r,t,n,i){let o=1,a=e.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,a/=2,s/=2,t/=2}function c(l,d){return o===1?l[d]:l.readUInt16BE(d*o)}let f;if(i){let l=-1;for(f=t;f<a;f++)if(c(e,f)===c(r,l===-1?0:f-l)){if(l===-1&&(l=f),f-l+1===s)return l*o}else l!==-1&&(f-=f-l),l=-1}else for(t+s>a&&(t=a-s),f=t;f>=0;f--){let l=!0;for(let d=0;d<s;d++)if(c(e,f+d)!==c(r,d)){l=!1;break}if(l)return f}return-1}g.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1};g.prototype.indexOf=function(r,t,n){return Ca(this,r,t,n,!0)};g.prototype.lastIndexOf=function(r,t,n){return Ca(this,r,t,n,!1)};function Pc(e,r,t,n){t=Number(t)||0;let i=e.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;let o=r.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let s=parseInt(r.substr(a*2,2),16);if(xi(s))return a;e[t+a]=s}return a}function Hc(e,r,t,n){return En(_i(r,e.length-t),e,t,n)}function $c(e,r,t,n){return En(tu(r),e,t,n)}function Vc(e,r,t,n){return En(Ma(r),e,t,n)}function Yc(e,r,t,n){return En(ru(r,e.length-t),e,t,n)}g.prototype.write=function(r,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((n===void 0||n>o)&&(n=o),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return Pc(this,r,t,n);case"utf8":case"utf-8":return Hc(this,r,t,n);case"ascii":case"latin1":case"binary":return $c(this,r,t,n);case"base64":return Vc(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yc(this,r,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Kc(e,r,t){return r===0&&t===e.length?hi.fromByteArray(e):hi.fromByteArray(e.slice(r,t))}function va(e,r,t){t=Math.min(e.length,t);let n=[],i=r;for(;i<t;){let o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=t){let c,f,l,d;switch(s){case 1:o<128&&(a=o);break;case 2:c=e[i+1],(c&192)===128&&(d=(o&31)<<6|c&63,d>127&&(a=d));break;case 3:c=e[i+1],f=e[i+2],(c&192)===128&&(f&192)===128&&(d=(o&15)<<12|(c&63)<<6|f&63,d>2047&&(d<55296||d>57343)&&(a=d));break;case 4:c=e[i+1],f=e[i+2],l=e[i+3],(c&192)===128&&(f&192)===128&&(l&192)===128&&(d=(o&15)<<18|(c&63)<<12|(f&63)<<6|l&63,d>65535&&d<1114112&&(a=d))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return Gc(n)}var Ba=4096;function Gc(e){let r=e.length;if(r<=Ba)return String.fromCharCode.apply(String,e);let t="",n=0;for(;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=Ba));return t}function Xc(e,r,t){let n="";t=Math.min(e.length,t);for(let i=r;i<t;++i)n+=String.fromCharCode(e[i]&127);return n}function Wc(e,r,t){let n="";t=Math.min(e.length,t);for(let i=r;i<t;++i)n+=String.fromCharCode(e[i]);return n}function qc(e,r,t){let n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);let i="";for(let o=r;o<t;++o)i+=nu[e[o]];return i}function jc(e,r,t){let n=e.slice(r,t),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}g.prototype.slice=function(r,t){let n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);let i=this.subarray(r,t);return Object.setPrototypeOf(i,g.prototype),i};function K(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUintLE=g.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||K(r,t,this.length);let i=this[r],o=1,a=0;for(;++a<t&&(o*=256);)i+=this[r+a]*o;return i};g.prototype.readUintBE=g.prototype.readUIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||K(r,t,this.length);let i=this[r+--t],o=1;for(;t>0&&(o*=256);)i+=this[r+--t]*o;return i};g.prototype.readUint8=g.prototype.readUInt8=function(r,t){return r=r>>>0,t||K(r,1,this.length),this[r]};g.prototype.readUint16LE=g.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||K(r,2,this.length),this[r]|this[r+1]<<8};g.prototype.readUint16BE=g.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||K(r,2,this.length),this[r]<<8|this[r+1]};g.prototype.readUint32LE=g.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||K(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};g.prototype.readUint32BE=g.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||K(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};g.prototype.readBigUInt64LE=Qe(function(r){r=r>>>0,$t(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&gr(r,this.length-8);let i=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,o=this[++r]+this[++r]*2**8+this[++r]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});g.prototype.readBigUInt64BE=Qe(function(r){r=r>>>0,$t(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&gr(r,this.length-8);let i=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],o=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});g.prototype.readIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||K(r,t,this.length);let i=this[r],o=1,a=0;for(;++a<t&&(o*=256);)i+=this[r+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i};g.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||K(r,t,this.length);let i=t,o=1,a=this[r+--i];for(;i>0&&(o*=256);)a+=this[r+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*t)),a};g.prototype.readInt8=function(r,t){return r=r>>>0,t||K(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};g.prototype.readInt16LE=function(r,t){r=r>>>0,t||K(r,2,this.length);let n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n};g.prototype.readInt16BE=function(r,t){r=r>>>0,t||K(r,2,this.length);let n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n};g.prototype.readInt32LE=function(r,t){return r=r>>>0,t||K(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};g.prototype.readInt32BE=function(r,t){return r=r>>>0,t||K(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};g.prototype.readBigInt64LE=Qe(function(r){r=r>>>0,$t(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&gr(r,this.length-8);let i=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)});g.prototype.readBigInt64BE=Qe(function(r){r=r>>>0,$t(r,"offset");let t=this[r],n=this[r+7];(t===void 0||n===void 0)&&gr(r,this.length-8);let i=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(i)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n)});g.prototype.readFloatLE=function(r,t){return r=r>>>0,t||K(r,4,this.length),Ht.read(this,r,!0,23,4)};g.prototype.readFloatBE=function(r,t){return r=r>>>0,t||K(r,4,this.length),Ht.read(this,r,!1,23,4)};g.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||K(r,8,this.length),Ht.read(this,r,!0,52,8)};g.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||K(r,8,this.length),Ht.read(this,r,!1,52,8)};function ne(e,r,t,n,i,o){if(!g.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}g.prototype.writeUintLE=g.prototype.writeUIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;ne(this,r,t,n,s,0)}let o=1,a=0;for(this[t]=r&255;++a<n&&(o*=256);)this[t+a]=r/o&255;return t+n};g.prototype.writeUintBE=g.prototype.writeUIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;ne(this,r,t,n,s,0)}let o=n-1,a=1;for(this[t+o]=r&255;--o>=0&&(a*=256);)this[t+o]=r/a&255;return t+n};g.prototype.writeUint8=g.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||ne(this,r,t,1,255,0),this[t]=r&255,t+1};g.prototype.writeUint16LE=g.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||ne(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};g.prototype.writeUint16BE=g.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||ne(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};g.prototype.writeUint32LE=g.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||ne(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};g.prototype.writeUint32BE=g.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||ne(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function Ra(e,r,t,n,i){za(r,n,i,e,t,7);let o=Number(r&BigInt(4294967295));e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o;let a=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=a,a=a>>8,e[t++]=a,a=a>>8,e[t++]=a,a=a>>8,e[t++]=a,t}function Oa(e,r,t,n,i){za(r,n,i,e,t,7);let o=Number(r&BigInt(4294967295));e[t+7]=o,o=o>>8,e[t+6]=o,o=o>>8,e[t+5]=o,o=o>>8,e[t+4]=o;let a=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=a,a=a>>8,e[t+2]=a,a=a>>8,e[t+1]=a,a=a>>8,e[t]=a,t+8}g.prototype.writeBigUInt64LE=Qe(function(r,t=0){return Ra(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});g.prototype.writeBigUInt64BE=Qe(function(r,t=0){return Oa(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});g.prototype.writeIntLE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let c=Math.pow(2,8*n-1);ne(this,r,t,n,c-1,-c)}let o=0,a=1,s=0;for(this[t]=r&255;++o<n&&(a*=256);)r<0&&s===0&&this[t+o-1]!==0&&(s=1),this[t+o]=(r/a>>0)-s&255;return t+n};g.prototype.writeIntBE=function(r,t,n,i){if(r=+r,t=t>>>0,!i){let c=Math.pow(2,8*n-1);ne(this,r,t,n,c-1,-c)}let o=n-1,a=1,s=0;for(this[t+o]=r&255;--o>=0&&(a*=256);)r<0&&s===0&&this[t+o+1]!==0&&(s=1),this[t+o]=(r/a>>0)-s&255;return t+n};g.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||ne(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};g.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||ne(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};g.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||ne(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};g.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||ne(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};g.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||ne(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};g.prototype.writeBigInt64LE=Qe(function(r,t=0){return Ra(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});g.prototype.writeBigInt64BE=Qe(function(r,t=0){return Oa(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ua(e,r,t,n,i,o){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Na(e,r,t,n,i){return r=+r,t=t>>>0,i||Ua(e,r,t,4,34028234663852886e22,-34028234663852886e22),Ht.write(e,r,t,n,23,4),t+4}g.prototype.writeFloatLE=function(r,t,n){return Na(this,r,t,!0,n)};g.prototype.writeFloatBE=function(r,t,n){return Na(this,r,t,!1,n)};function Za(e,r,t,n,i){return r=+r,t=t>>>0,i||Ua(e,r,t,8,17976931348623157e292,-17976931348623157e292),Ht.write(e,r,t,n,52,8),t+8}g.prototype.writeDoubleLE=function(r,t,n){return Za(this,r,t,!0,n)};g.prototype.writeDoubleBE=function(r,t,n){return Za(this,r,t,!1,n)};g.prototype.copy=function(r,t,n,i){if(!g.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),t>=r.length&&(t=r.length),t||(t=0),i>0&&i<n&&(i=n),i===n||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),r.length-t<i-n&&(i=r.length-t+n);let o=i-n;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(r,this.subarray(n,i),t),o};g.prototype.fill=function(r,t,n,i){if(typeof r=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!g.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(r.length===1){let a=r.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(r=a)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);let o;if(typeof r=="number")for(o=t;o<n;++o)this[o]=r;else{let a=g.isBuffer(r)?r:g.from(r,i),s=a.length;if(s===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=a[o%s]}return this};var Pt={};function gi(e,r,t){Pt[e]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}gi("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);gi("ERR_INVALID_ARG_TYPE",function(e,r){return`The "${e}" argument must be of type number. Received type ${typeof r}`},TypeError);gi("ERR_OUT_OF_RANGE",function(e,r,t){let n=`The value of "${e}" is out of range.`,i=t;return Number.isInteger(t)&&Math.abs(t)>2**32?i=Ta(String(t)):typeof t=="bigint"&&(i=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(i=Ta(i)),i+="n"),n+=` It must be ${r}. Received ${i}`,n},RangeError);function Ta(e){let r="",t=e.length,n=e[0]==="-"?1:0;for(;t>=n+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return`${e.slice(0,t)}${r}`}function Jc(e,r,t){$t(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&gr(r,e.length-(t+1))}function za(e,r,t,n,i,o){if(e>t||e<r){let a=typeof r=="bigint"?"n":"",s;throw o>3?r===0||r===BigInt(0)?s=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:s=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:s=`>= ${r}${a} and <= ${t}${a}`,new Pt.ERR_OUT_OF_RANGE("value",s,e)}Jc(n,i,o)}function $t(e,r){if(typeof e!="number")throw new Pt.ERR_INVALID_ARG_TYPE(r,"number",e)}function gr(e,r,t){throw Math.floor(e)!==e?($t(e,t),new Pt.ERR_OUT_OF_RANGE(t||"offset","an integer",e)):r<0?new Pt.ERR_BUFFER_OUT_OF_BOUNDS:new Pt.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,e)}var Qc=/[^+/0-9A-Za-z-_]/g;function eu(e){if(e=e.split("=")[0],e=e.trim().replace(Qc,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function _i(e,r){r=r||1/0;let t,n=e.length,i=null,o=[];for(let a=0;a<n;++a){if(t=e.charCodeAt(a),t>55295&&t<57344){if(!i){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function tu(e){let r=[];for(let t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function ru(e,r){let t,n,i,o=[];for(let a=0;a<e.length&&!((r-=2)<0);++a)t=e.charCodeAt(a),n=t>>8,i=t%256,o.push(i),o.push(n);return o}function Ma(e){return hi.toByteArray(eu(e))}function En(e,r,t,n){let i;for(i=0;i<n&&!(i+t>=r.length||i>=e.length);++i)r[i+t]=e[i];return i}function Ae(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function xi(e){return e!==e}var nu=(function(){let e="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let n=t*16;for(let i=0;i<16;++i)r[n+i]=e[t]+e[i]}return r})();function Qe(e){return typeof BigInt>"u"?iu:e}function iu(){throw new Error("BigInt not supported")}});var As=Y((O1,Jt)=>{"use strict";function jt(e){let r=e.length;for(;--r>=0;)e[r]=0}var Cu=0,ls=1,vu=2,Ru=3,Ou=258,ji=29,vr=256,Dr=vr+1+ji,qt=30,Ji=19,cs=2*Dr+1,St=15,Yi=16,Uu=7,Qi=256,us=16,hs=17,ds=18,Wi=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]),Un=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]),Nu=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ps=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Zu=512,We=new Array((Dr+2)*2);jt(We);var Tr=new Array(qt*2);jt(Tr);var Lr=new Array(Zu);jt(Lr);var kr=new Array(Ou-Ru+1);jt(kr);var eo=new Array(ji);jt(eo);var Nn=new Array(qt);jt(Nn);function Ki(e,r,t,n,i){this.static_tree=e,this.extra_bits=r,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var _s,ms,Es;function Gi(e,r){this.dyn_tree=e,this.max_code=0,this.stat_desc=r}var gs=e=>e<256?Lr[e]:Lr[256+(e>>>7)],Cr=(e,r)=>{e.pending_buf[e.pending++]=r&255,e.pending_buf[e.pending++]=r>>>8&255},ie=(e,r,t)=>{e.bi_valid>Yi-t?(e.bi_buf|=r<<e.bi_valid&65535,Cr(e,e.bi_buf),e.bi_buf=r>>Yi-e.bi_valid,e.bi_valid+=t-Yi):(e.bi_buf|=r<<e.bi_valid&65535,e.bi_valid+=t)},ke=(e,r,t)=>{ie(e,t[r*2],t[r*2+1])},xs=(e,r)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--r>0);return t>>>1},zu=e=>{e.bi_valid===16?(Cr(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)},Mu=(e,r)=>{let t=r.dyn_tree,n=r.max_code,i=r.stat_desc.static_tree,o=r.stat_desc.has_stree,a=r.stat_desc.extra_bits,s=r.stat_desc.extra_base,c=r.stat_desc.max_length,f,l,d,h,u,p,b=0;for(h=0;h<=St;h++)e.bl_count[h]=0;for(t[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;f<cs;f++)l=e.heap[f],h=t[t[l*2+1]*2+1]+1,h>c&&(h=c,b++),t[l*2+1]=h,!(l>n)&&(e.bl_count[h]++,u=0,l>=s&&(u=a[l-s]),p=t[l*2],e.opt_len+=p*(h+u),o&&(e.static_len+=p*(i[l*2+1]+u)));if(b!==0){do{for(h=c-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,b-=2}while(b>0);for(h=c;h!==0;h--)for(l=e.bl_count[h];l!==0;)d=e.heap[--f],!(d>n)&&(t[d*2+1]!==h&&(e.opt_len+=(h-t[d*2+1])*t[d*2],t[d*2+1]=h),l--)}},bs=(e,r,t)=>{let n=new Array(St+1),i=0,o,a;for(o=1;o<=St;o++)i=i+t[o-1]<<1,n[o]=i;for(a=0;a<=r;a++){let s=e[a*2+1];s!==0&&(e[a*2]=xs(n[s]++,s))}},Fu=()=>{let e,r,t,n,i,o=new Array(St+1);for(t=0,n=0;n<ji-1;n++)for(eo[n]=t,e=0;e<1<<Wi[n];e++)kr[t++]=n;for(kr[t-1]=n,i=0,n=0;n<16;n++)for(Nn[n]=i,e=0;e<1<<Un[n];e++)Lr[i++]=n;for(i>>=7;n<qt;n++)for(Nn[n]=i<<7,e=0;e<1<<Un[n]-7;e++)Lr[256+i++]=n;for(r=0;r<=St;r++)o[r]=0;for(e=0;e<=143;)We[e*2+1]=8,e++,o[8]++;for(;e<=255;)We[e*2+1]=9,e++,o[9]++;for(;e<=279;)We[e*2+1]=7,e++,o[7]++;for(;e<=287;)We[e*2+1]=8,e++,o[8]++;for(bs(We,Dr+1,o),e=0;e<qt;e++)Tr[e*2+1]=5,Tr[e*2]=xs(e,5);_s=new Ki(We,Wi,vr+1,Dr,St),ms=new Ki(Tr,Un,0,qt,St),Es=new Ki(new Array(0),Nu,0,Ji,Uu)},ys=e=>{let r;for(r=0;r<Dr;r++)e.dyn_ltree[r*2]=0;for(r=0;r<qt;r++)e.dyn_dtree[r*2]=0;for(r=0;r<Ji;r++)e.bl_tree[r*2]=0;e.dyn_ltree[Qi*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},ws=e=>{e.bi_valid>8?Cr(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},is=(e,r,t,n)=>{let i=r*2,o=t*2;return e[i]<e[o]||e[i]===e[o]&&n[r]<=n[t]},Xi=(e,r,t)=>{let n=e.heap[t],i=t<<1;for(;i<=e.heap_len&&(i<e.heap_len&&is(r,e.heap[i+1],e.heap[i],e.depth)&&i++,!is(r,n,e.heap[i],e.depth));)e.heap[t]=e.heap[i],t=i,i<<=1;e.heap[t]=n},os=(e,r,t)=>{let n,i,o=0,a,s;if(e.sym_next!==0)do n=e.pending_buf[e.sym_buf+o++]&255,n+=(e.pending_buf[e.sym_buf+o++]&255)<<8,i=e.pending_buf[e.sym_buf+o++],n===0?ke(e,i,r):(a=kr[i],ke(e,a+vr+1,r),s=Wi[a],s!==0&&(i-=eo[a],ie(e,i,s)),n--,a=gs(n),ke(e,a,t),s=Un[a],s!==0&&(n-=Nn[a],ie(e,n,s)));while(o<e.sym_next);ke(e,Qi,r)},qi=(e,r)=>{let t=r.dyn_tree,n=r.stat_desc.static_tree,i=r.stat_desc.has_stree,o=r.stat_desc.elems,a,s,c=-1,f;for(e.heap_len=0,e.heap_max=cs,a=0;a<o;a++)t[a*2]!==0?(e.heap[++e.heap_len]=c=a,e.depth[a]=0):t[a*2+1]=0;for(;e.heap_len<2;)f=e.heap[++e.heap_len]=c<2?++c:0,t[f*2]=1,e.depth[f]=0,e.opt_len--,i&&(e.static_len-=n[f*2+1]);for(r.max_code=c,a=e.heap_len>>1;a>=1;a--)Xi(e,t,a);f=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Xi(e,t,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,t[f*2]=t[a*2]+t[s*2],e.depth[f]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,t[a*2+1]=t[s*2+1]=f,e.heap[1]=f++,Xi(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Mu(e,r),bs(t,c,e.bl_count)},as=(e,r,t)=>{let n,i=-1,o,a=r[1],s=0,c=7,f=4;for(a===0&&(c=138,f=3),r[(t+1)*2+1]=65535,n=0;n<=t;n++)o=a,a=r[(n+1)*2+1],!(++s<c&&o===a)&&(s<f?e.bl_tree[o*2]+=s:o!==0?(o!==i&&e.bl_tree[o*2]++,e.bl_tree[us*2]++):s<=10?e.bl_tree[hs*2]++:e.bl_tree[ds*2]++,s=0,i=o,a===0?(c=138,f=3):o===a?(c=6,f=3):(c=7,f=4))},ss=(e,r,t)=>{let n,i=-1,o,a=r[1],s=0,c=7,f=4;for(a===0&&(c=138,f=3),n=0;n<=t;n++)if(o=a,a=r[(n+1)*2+1],!(++s<c&&o===a)){if(s<f)do ke(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==i&&(ke(e,o,e.bl_tree),s--),ke(e,us,e.bl_tree),ie(e,s-3,2)):s<=10?(ke(e,hs,e.bl_tree),ie(e,s-3,3)):(ke(e,ds,e.bl_tree),ie(e,s-11,7));s=0,i=o,a===0?(c=138,f=3):o===a?(c=6,f=3):(c=7,f=4)}},Pu=e=>{let r;for(as(e,e.dyn_ltree,e.l_desc.max_code),as(e,e.dyn_dtree,e.d_desc.max_code),qi(e,e.bl_desc),r=Ji-1;r>=3&&e.bl_tree[ps[r]*2+1]===0;r--);return e.opt_len+=3*(r+1)+5+5+4,r},Hu=(e,r,t,n)=>{let i;for(ie(e,r-257,5),ie(e,t-1,5),ie(e,n-4,4),i=0;i<n;i++)ie(e,e.bl_tree[ps[i]*2+1],3);ss(e,e.dyn_ltree,r-1),ss(e,e.dyn_dtree,t-1)},$u=e=>{let r=4093624447,t;for(t=0;t<=31;t++,r>>>=1)if(r&1&&e.dyn_ltree[t*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(t=32;t<vr;t++)if(e.dyn_ltree[t*2]!==0)return 1;return 0},fs=!1,Vu=e=>{fs||(Fu(),fs=!0),e.l_desc=new Gi(e.dyn_ltree,_s),e.d_desc=new Gi(e.dyn_dtree,ms),e.bl_desc=new Gi(e.bl_tree,Es),e.bi_buf=0,e.bi_valid=0,ys(e)},Ss=(e,r,t,n)=>{ie(e,(Cu<<1)+(n?1:0),3),ws(e),Cr(e,t),Cr(e,~t),t&&e.pending_buf.set(e.window.subarray(r,r+t),e.pending),e.pending+=t},Yu=e=>{ie(e,ls<<1,3),ke(e,Qi,We),zu(e)},Ku=(e,r,t,n)=>{let i,o,a=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=$u(e)),qi(e,e.l_desc),qi(e,e.d_desc),a=Pu(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=t+5,t+4<=i&&r!==-1?Ss(e,r,t,n):e.strategy===4||o===i?(ie(e,(ls<<1)+(n?1:0),3),os(e,We,Tr)):(ie(e,(vu<<1)+(n?1:0),3),Hu(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),os(e,e.dyn_ltree,e.dyn_dtree)),ys(e),n&&ws(e)},Gu=(e,r,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=r,e.pending_buf[e.sym_buf+e.sym_next++]=r>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,r===0?e.dyn_ltree[t*2]++:(e.matches++,r--,e.dyn_ltree[(kr[t]+vr+1)*2]++,e.dyn_dtree[gs(r)*2]++),e.sym_next===e.sym_end);Jt.exports._tr_init=Vu;Jt.exports._tr_stored_block=Ss;Jt.exports._tr_flush_block=Ku;Jt.exports._tr_tally=Gu;Jt.exports._tr_align=Yu});var to=Y((U1,Is)=>{"use strict";var Xu=(e,r,t,n)=>{let i=e&65535|0,o=e>>>16&65535|0,a=0;for(;t!==0;){a=t>2e3?2e3:t,t-=a;do i=i+r[n++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0};Is.exports=Xu});var ro=Y((N1,Bs)=>{"use strict";var Wu=()=>{let e,r=[];for(var t=0;t<256;t++){e=t;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;r[t]=e}return r},qu=new Uint32Array(Wu()),ju=(e,r,t,n)=>{let i=qu,o=n+t;e^=-1;for(let a=n;a<o;a++)e=e>>>8^i[(e^r[a])&255];return e^-1};Bs.exports=ju});var Zn=Y((Z1,Ts)=>{"use strict";Ts.exports={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"}});var lt=Y((z1,Ds)=>{"use strict";Ds.exports={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}});var zs=Y((M1,Oe)=>{"use strict";var{_tr_init:Ju,_tr_stored_block:oo,_tr_flush_block:Qu,_tr_tally:dt,_tr_align:eh}=As(),vs=to(),ct=ro(),th=Zn(),{Z_NO_FLUSH:pt,Z_PARTIAL_FLUSH:rh,Z_FULL_FLUSH:nh,Z_FINISH:pe,Z_BLOCK:Ls,Z_OK:j,Z_STREAM_END:ks,Z_STREAM_ERROR:ve,Z_DATA_ERROR:ih,Z_BUF_ERROR:no,Z_DEFAULT_COMPRESSION:oh,Z_FILTERED:ah,Z_HUFFMAN_ONLY:zn,Z_RLE:sh,Z_FIXED:fh,Z_DEFAULT_STRATEGY:lh,Z_UNKNOWN:ch,Z_DEFLATED:Mn}=lt(),uh=9,hh=15,dh=8,ph=29,_h=256,ao=_h+1+ph,mh=30,Eh=19,gh=2*ao+1,xh=15,R=3,ht=258,Re=ht+R+1,bh=32,er=42,ho=57,so=69,fo=73,lo=91,co=103,At=113,Or=666,te=1,rr=2,Bt=3,nr=4,yh=3,It=(e,r)=>(e.msg=th[r],r),Cs=e=>e*2-(e>4?9:0),ut=e=>{let r=e.length;for(;--r>=0;)e[r]=0},wh=e=>{let r,t,n,i=e.w_size;r=e.hash_size,n=r;do t=e.head[--n],e.head[n]=t>=i?t-i:0;while(--r);r=i,n=r;do t=e.prev[--n],e.prev[n]=t>=i?t-i:0;while(--r)},po=(e,r,t)=>(r<<e.hash_shift^t)&e.hash_mask,Tt=(e,r)=>{let t;if(e.legacy_hash)t=e.ins_h=po(e,e.ins_h,e.window[r+R-1]);else{let i=e.window,o=i[r]|i[r+1]<<8|i[r+2]<<16|i[r+3]<<24;t=e.ins_h=Math.imul(o,66521)+66521>>>16&e.hash_mask}let n=e.prev[r&e.w_mask]=e.head[t];return e.head[t]=r,n},se=e=>{let r=e.state,t=r.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(r.pending_buf.subarray(r.pending_out,r.pending_out+t),e.next_out),e.next_out+=t,r.pending_out+=t,e.total_out+=t,e.avail_out-=t,r.pending-=t,r.pending===0&&(r.pending_out=0))},fe=(e,r)=>{Qu(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,r),e.block_start=e.strstart,se(e.strm)},U=(e,r)=>{e.pending_buf[e.pending++]=r},Rr=(e,r)=>{e.pending_buf[e.pending++]=r>>>8&255,e.pending_buf[e.pending++]=r&255},uo=(e,r,t,n)=>{let i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,r.set(e.input.subarray(e.next_in,e.next_in+i),t),e.state.wrap===1?e.adler=vs(e.adler,r,i,t):e.state.wrap===2&&(e.adler=ct(e.adler,r,i,t)),e.next_in+=i,e.total_in+=i,i)},Rs=(e,r)=>{let t=e.max_chain_length,n=e.strstart,i,o,a=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-Re?e.strstart-(e.w_size-Re):0,f=e.window,l=e.w_mask,d=e.prev,h=e.strstart+ht,u=f[n+a-1],p=f[n+a];e.prev_length>=e.good_match&&(t>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=r,!(f[i+a]!==p||f[i+a-1]!==u||f[i]!==f[n]||f[++i]!==f[n+1])){n+=2,i++;do;while(f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&n<h);if(o=ht-(h-n),n=h-ht,o>a){if(e.match_start=r,a=o,o>=s)break;u=f[n+a-1],p=f[n+a]}}while((r=d[r&l])>c&&--t!==0);return a<=e.lookahead?a:e.lookahead},tr=e=>{let r=e.w_size,t,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=r+(r-Re)&&(e.window.set(e.window.subarray(r,r+r-n),0),e.match_start-=r,e.strstart-=r,e.block_start-=r,e.insert>e.strstart&&(e.insert=e.strstart),wh(e),n+=r),e.strm.avail_in===0)break;if(t=uo(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=t,e.legacy_hash){if(e.lookahead+e.insert>=R)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=po(e,e.ins_h,e.window[i+1]);e.insert&&(Tt(e,i),i++,e.insert--,!(e.lookahead+e.insert<R)););}else if(e.lookahead+e.insert>R)for(i=e.strstart-e.insert;e.insert&&(Tt(e,i),i++,e.insert--,!(e.lookahead+e.insert<=R)););}while(e.lookahead<Re&&e.strm.avail_in!==0)},Os=(e,r)=>{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n,i,o,a=0,s=e.strm.avail_in;do{if(n=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o||(o=e.strm.avail_out-o,i=e.strstart-e.block_start,n>i+e.strm.avail_in&&(n=i+e.strm.avail_in),n>o&&(n=o),n<t&&(n===0&&r!==pe||r===pt||n!==i+e.strm.avail_in)))break;a=r===pe&&n===i+e.strm.avail_in?1:0,oo(e,0,0,a),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,se(e.strm),i&&(i>n&&(i=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,n-=i),n&&(uo(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(a===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?nr:r!==pt&&r!==pe&&e.strm.avail_in===0&&e.strstart===e.block_start?rr:(o=e.window_size-e.strstart,e.strm.avail_in>o&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(uo(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,t=o>e.w_size?e.w_size:o,i=e.strstart-e.block_start,(i>=t||(i||r===pe)&&r!==pt&&e.strm.avail_in===0&&i<=o)&&(n=i>o?o:i,a=r===pe&&e.strm.avail_in===0&&n===i?1:0,oo(e,e.block_start,n,a),e.block_start+=n,se(e.strm)),a?Bt:te)},io=(e,r)=>{let t,n;for(;;){if(e.lookahead<Re){if(tr(e),e.lookahead<Re&&r===pt)return te;if(e.lookahead===0)break}if(t=0,e.lookahead>=R&&(t=Tt(e,e.strstart)),t!==0&&e.strstart-t<=e.w_size-Re&&(e.match_length=Rs(e,t)),e.match_length>=R)if(n=dt(e,e.strstart-e.match_start,e.match_length-R),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=R){e.match_length--;do e.strstart++,t=Tt(e,e.strstart);while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=po(e,e.ins_h,e.window[e.strstart+1]));else n=dt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(fe(e,!1),e.strm.avail_out===0))return te}return e.insert=e.strstart<R-1?e.strstart:R-1,r===pe?(fe(e,!0),e.strm.avail_out===0?Bt:nr):e.sym_next&&(fe(e,!1),e.strm.avail_out===0)?te:rr},Qt=(e,r)=>{let t,n,i;for(;;){if(e.lookahead<Re){if(tr(e),e.lookahead<Re&&r===pt)return te;if(e.lookahead===0)break}if(t=0,e.lookahead>=R&&(t=Tt(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=R-1,t!==0&&e.prev_length<e.max_lazy_match&&e.strstart-t<=e.w_size-Re&&(e.match_length=Rs(e,t),e.match_length<=5&&(e.strategy===ah||e.match_length===R&&e.strstart-e.match_start>4096)&&(e.match_length=R-1)),e.prev_length>=R&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-R,n=dt(e,e.strstart-1-e.prev_match,e.prev_length-R),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(t=Tt(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=R-1,e.strstart++,n&&(fe(e,!1),e.strm.avail_out===0))return te}else if(e.match_available){if(n=dt(e,0,e.window[e.strstart-1]),n&&fe(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return te}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=dt(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<R-1?e.strstart:R-1,r===pe?(fe(e,!0),e.strm.avail_out===0?Bt:nr):e.sym_next&&(fe(e,!1),e.strm.avail_out===0)?te:rr},Sh=(e,r)=>{let t,n,i,o,a=e.window;for(;;){if(e.lookahead<=ht){if(tr(e),e.lookahead<=ht&&r===pt)return te;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=R&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+ht;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=ht-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=R?(t=dt(e,1,e.match_length-R),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=dt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(fe(e,!1),e.strm.avail_out===0))return te}return e.insert=0,r===pe?(fe(e,!0),e.strm.avail_out===0?Bt:nr):e.sym_next&&(fe(e,!1),e.strm.avail_out===0)?te:rr},Ah=(e,r)=>{let t;for(;;){if(e.lookahead===0&&(tr(e),e.lookahead===0)){if(r===pt)return te;break}if(e.match_length=0,t=dt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(fe(e,!1),e.strm.avail_out===0))return te}return e.insert=0,r===pe?(fe(e,!0),e.strm.avail_out===0?Bt:nr):e.sym_next&&(fe(e,!1),e.strm.avail_out===0)?te:rr};function Ce(e,r,t,n,i){this.good_length=e,this.max_lazy=r,this.nice_length=t,this.max_chain=n,this.func=i}var Ur=[new Ce(0,0,0,0,Os),new Ce(4,4,8,4,io),new Ce(4,5,16,8,io),new Ce(4,6,32,32,io),new Ce(4,4,16,16,Qt),new Ce(8,16,32,32,Qt),new Ce(8,16,128,128,Qt),new Ce(8,32,128,256,Qt),new Ce(32,128,258,1024,Qt),new Ce(32,258,258,4096,Qt)],Ih=e=>{e.window_size=2*e.w_size,ut(e.head),e.max_lazy_match=Ur[e.level].max_lazy,e.good_match=Ur[e.level].good_length,e.nice_match=Ur[e.level].nice_length,e.max_chain_length=Ur[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=R-1,e.match_available=0,e.ins_h=0};function Bh(){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=Mn,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.legacy_hash=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(gh*2),this.dyn_dtree=new Uint16Array((2*mh+1)*2),this.bl_tree=new Uint16Array((2*Eh+1)*2),ut(this.dyn_ltree),ut(this.dyn_dtree),ut(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(xh+1),this.heap=new Uint16Array(2*ao+1),ut(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*ao+1),ut(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Nr=e=>{if(!e)return 1;let r=e.state;return!r||r.strm!==e||r.status!==er&&r.status!==ho&&r.status!==so&&r.status!==fo&&r.status!==lo&&r.status!==co&&r.status!==At&&r.status!==Or?1:0},Us=e=>{if(Nr(e))return It(e,ve);e.total_in=e.total_out=0,e.data_type=ch;let r=e.state;return r.pending=0,r.pending_out=0,r.wrap<0&&(r.wrap=-r.wrap),r.status=r.wrap===2?ho:r.wrap?er:At,e.adler=r.wrap===2?0:1,r.last_flush=-2,Ju(r),j},Ns=e=>{let r=Us(e);return r===j&&Ih(e.state),r},Th=(e,r)=>Nr(e)||e.state.wrap!==2?ve:(e.state.gzhead=r,j),Zs=(e,r,t,n,i,o,a)=>{if(!e)return ve;let s=1;if(r===oh&&(r=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>uh||t!==Mn||n<8||n>15||r<0||r>9||o<0||o>fh||n===8&&s!==1)return It(e,ve);n===8&&(n=9);let c=new Bh;return e.state=c,c.strm=e,c.status=er,c.wrap=s,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.legacy_hash=a?1:0,c.hash_bits=i+7,!c.legacy_hash&&c.hash_bits<15&&(c.hash_bits=15),c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+R-1)/R),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=r,c.strategy=o,c.method=t,Ns(e)},Dh=(e,r)=>Zs(e,r,Mn,hh,dh,lh),Lh=(e,r)=>{if(Nr(e)||r>Ls||r<0)return e?It(e,ve):ve;let t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===Or&&r!==pe)return It(e,e.avail_out===0?no:ve);let n=t.last_flush;if(t.last_flush=r,t.pending!==0){if(se(e),e.avail_out===0)return t.last_flush=-1,j}else if(e.avail_in===0&&Cs(r)<=Cs(n)&&r!==pe)return It(e,no);if(t.status===Or&&e.avail_in!==0)return It(e,no);if(t.status===er&&t.wrap===0&&(t.status=At),t.status===er){let i=Mn+(t.w_bits-8<<4)<<8,o=-1;if(t.strategy>=zn||t.level<2?o=0:t.level<6?o=1:t.level===6?o=2:o=3,i|=o<<6,t.strstart!==0&&(i|=bh),i+=31-i%31,Rr(t,i),t.strstart!==0&&(Rr(t,e.adler>>>16),Rr(t,e.adler&65535)),e.adler=1,t.status=At,se(e),t.pending!==0)return t.last_flush=-1,j}if(t.status===ho){if(e.adler=0,U(t,31),U(t,139),U(t,8),t.gzhead)U(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),U(t,t.gzhead.time&255),U(t,t.gzhead.time>>8&255),U(t,t.gzhead.time>>16&255),U(t,t.gzhead.time>>24&255),U(t,t.level===9?2:t.strategy>=zn||t.level<2?4:0),U(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(U(t,t.gzhead.extra.length&255),U(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=ct(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=so;else if(U(t,0),U(t,0),U(t,0),U(t,0),U(t,0),U(t,t.level===9?2:t.strategy>=zn||t.level<2?4:0),U(t,yh),t.status=At,se(e),t.pending!==0)return t.last_flush=-1,j}if(t.status===so){if(t.gzhead.extra){let i=t.pending,o=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+o>t.pending_buf_size;){let s=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>i&&(e.adler=ct(e.adler,t.pending_buf,t.pending-i,i)),t.gzindex+=s,se(e),t.pending!==0)return t.last_flush=-1,j;i=0,o-=s}let a=new Uint8Array(t.gzhead.extra);t.pending_buf.set(a.subarray(t.gzindex,t.gzindex+o),t.pending),t.pending+=o,t.gzhead.hcrc&&t.pending>i&&(e.adler=ct(e.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=fo}if(t.status===fo){if(t.gzhead.name){let i=t.pending,o;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(e.adler=ct(e.adler,t.pending_buf,t.pending-i,i)),se(e),t.pending!==0)return t.last_flush=-1,j;i=0}t.gzindex<t.gzhead.name.length?o=t.gzhead.name.charCodeAt(t.gzindex++)&255:o=0,U(t,o)}while(o!==0);t.gzhead.hcrc&&t.pending>i&&(e.adler=ct(e.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=lo}if(t.status===lo){if(t.gzhead.comment){let i=t.pending,o;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(e.adler=ct(e.adler,t.pending_buf,t.pending-i,i)),se(e),t.pending!==0)return t.last_flush=-1,j;i=0}t.gzindex<t.gzhead.comment.length?o=t.gzhead.comment.charCodeAt(t.gzindex++)&255:o=0,U(t,o)}while(o!==0);t.gzhead.hcrc&&t.pending>i&&(e.adler=ct(e.adler,t.pending_buf,t.pending-i,i))}t.status=co}if(t.status===co){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(se(e),t.pending!==0))return t.last_flush=-1,j;U(t,e.adler&255),U(t,e.adler>>8&255),e.adler=0}if(t.status=At,se(e),t.pending!==0)return t.last_flush=-1,j}if(e.avail_in!==0||t.lookahead!==0||r!==pt&&t.status!==Or){let i=t.level===0?Os(t,r):t.strategy===zn?Ah(t,r):t.strategy===sh?Sh(t,r):Ur[t.level].func(t,r);if((i===Bt||i===nr)&&(t.status=Or),i===te||i===Bt)return e.avail_out===0&&(t.last_flush=-1),j;if(i===rr&&(r===rh?eh(t):r!==Ls&&(oo(t,0,0,!1),r===nh&&(ut(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),se(e),e.avail_out===0))return t.last_flush=-1,j}return r!==pe?j:t.wrap<=0?ks:(t.wrap===2?(U(t,e.adler&255),U(t,e.adler>>8&255),U(t,e.adler>>16&255),U(t,e.adler>>24&255),U(t,e.total_in&255),U(t,e.total_in>>8&255),U(t,e.total_in>>16&255),U(t,e.total_in>>24&255)):(Rr(t,e.adler>>>16),Rr(t,e.adler&65535)),se(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?j:ks)},kh=e=>{if(Nr(e))return ve;let r=e.state.status;return e.state=null,r===At?It(e,ih):j},Ch=(e,r)=>{let t=r.length;if(Nr(e))return ve;let n=e.state,i=n.wrap;if(i===2||i===1&&n.status!==er||n.lookahead)return ve;if(i===1&&(e.adler=vs(e.adler,r,t,0)),n.wrap=0,t>=n.w_size){i===0&&(ut(n.head),n.strstart=0,n.block_start=0,n.insert=0);let c=new Uint8Array(n.w_size);c.set(r.subarray(t-n.w_size,t),0),r=c,t=n.w_size}let o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=t,e.next_in=0,e.input=r,tr(n);n.lookahead>=R;){let c=n.strstart,f=n.lookahead-(R-1);do Tt(n,c),c++;while(--f);n.strstart=c,n.lookahead=R-1,tr(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=R-1,n.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,n.wrap=i,j};Oe.exports.deflateInit=Dh;Oe.exports.deflateInit2=Zs;Oe.exports.deflateReset=Ns;Oe.exports.deflateResetKeep=Us;Oe.exports.deflateSetHeader=Th;Oe.exports.deflate=Lh;Oe.exports.deflateEnd=kh;Oe.exports.deflateSetDictionary=Ch;Oe.exports.deflateInfo="pako deflate (from Nodeca project)"});var mo=Y((F1,_o)=>{"use strict";var vh=(e,r)=>Object.prototype.hasOwnProperty.call(e,r);_o.exports.assign=function(e){let r=Array.prototype.slice.call(arguments,1);for(;r.length;){let t=r.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(let n in t)vh(t,n)&&(e[n]=t[n])}}return e};_o.exports.flattenChunks=e=>{let r=0;for(let n=0,i=e.length;n<i;n++)r+=e[n].length;let t=new Uint8Array(r);for(let n=0,i=0,o=e.length;n<o;n++){let a=e[n];t.set(a,i),i+=a.length}return t}});var Eo=Y((P1,Fn)=>{"use strict";var Ms=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ms=!1}var Zr=new Uint8Array(256);for(let e=0;e<256;e++)Zr[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Zr[254]=Zr[255]=1;Fn.exports.string2buf=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let r,t,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)t=e.charCodeAt(i),(t&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),s+=t<128?1:t<2048?2:t<65536?3:4;for(r=new Uint8Array(s),o=0,i=0;o<s;i++)t=e.charCodeAt(i),(t&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),t<128?r[o++]=t:t<2048?(r[o++]=192|t>>>6,r[o++]=128|t&63):t<65536?(r[o++]=224|t>>>12,r[o++]=128|t>>>6&63,r[o++]=128|t&63):(r[o++]=240|t>>>18,r[o++]=128|t>>>12&63,r[o++]=128|t>>>6&63,r[o++]=128|t&63);return r};var Rh=(e,r)=>{if(r<65534&&e.subarray&&Ms)return String.fromCharCode.apply(null,e.length===r?e:e.subarray(0,r));let t="";for(let n=0;n<r;n++)t+=String.fromCharCode(e[n]);return t};Fn.exports.buf2string=(e,r)=>{let t=r||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,r));let n,i,o=new Array(t*2);for(i=0,n=0;n<t;){let a=e[n++];if(a<128){o[i++]=a;continue}let s=Zr[a];if(s>4){o[i++]=65533,n+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&n<t;)a=a<<6|e[n++]&63,s--;if(s>1){o[i++]=65533;continue}a<65536?o[i++]=a:(a-=65536,o[i++]=55296|a>>10&1023,o[i++]=56320|a&1023)}return Rh(o,i)};Fn.exports.utf8border=(e,r)=>{r=r||e.length,r>e.length&&(r=e.length);let t=r-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?r:t+Zr[e[t]]>r?t:r}});var go=Y((H1,Fs)=>{"use strict";function Oh(){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}Fs.exports=Oh});var Vs=Y(($1,ir)=>{"use strict";var zr=zs(),Ps=mo(),Hs=Eo(),xo=Zn(),Uh=go(),$s=Object.prototype.toString,{Z_NO_FLUSH:Nh,Z_SYNC_FLUSH:Zh,Z_FULL_FLUSH:zh,Z_FINISH:Mh,Z_OK:Pn,Z_STREAM_END:Fh,Z_DEFAULT_COMPRESSION:Ph,Z_DEFAULT_STRATEGY:Hh,Z_DEFLATED:$h}=lt(),Vh={level:Ph,method:$h,chunkSize:16384,windowBits:15,memLevel:8,strategy:Hh,legacyHash:!0};function Mr(e){this.options=Ps.assign({},Vh,e||{});let r=this.options;r.raw&&r.windowBits>0?r.windowBits=-r.windowBits:r.gzip&&r.windowBits>0&&r.windowBits<16&&(r.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Uh,this.strm.avail_out=0;let t=zr.deflateInit2(this.strm,r.level,r.method,r.windowBits,r.memLevel,r.strategy,r.legacyHash);if(t!==Pn)throw new Error(xo[t]);if(r.header&&zr.deflateSetHeader(this.strm,r.header),r.dictionary){let n;if(typeof r.dictionary=="string"?n=Hs.string2buf(r.dictionary):$s.call(r.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(r.dictionary):n=r.dictionary,t=zr.deflateSetDictionary(this.strm,n),t!==Pn)throw new Error(xo[t]);this._dict_set=!0}}Mr.prototype.push=function(e,r){let t=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;for(r===~~r?o=r:o=r===!0?Mh:Nh,typeof e=="string"?t.input=Hs.string2buf(e):$s.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),(o===Zh||o===zh)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(i=zr.deflate(t,o),i===Fh)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=zr.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Pn;if(t.avail_out===0){this.onData(t.output);continue}if(o>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};Mr.prototype.onData=function(e){this.chunks.push(e)};Mr.prototype.onEnd=function(e){e===Pn&&(this.result=Ps.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function bo(e,r){let t=new Mr(r);if(t.push(e,!0),t.err)throw t.msg||xo[t.err];return t.result}function Yh(e,r){return r=r||{},r.raw=!0,bo(e,r)}function Kh(e,r){return r=r||{},r.gzip=!0,bo(e,r)}ir.exports.Deflate=Mr;ir.exports.deflate=bo;ir.exports.deflateRaw=Yh;ir.exports.gzip=Kh;ir.exports.constants=lt()});var Ks=Y((V1,Ys)=>{"use strict";Ys.exports=function(r,t){let n,i,o,a,s,c,f,l,d,h,u,p,b,E,x,B,I,_,D,S,y,L,T,m,A=r.state;n=r.next_in,T=r.input,i=n+(r.avail_in-5),o=r.next_out,m=r.output,a=o-(t-r.avail_out),s=o+(r.avail_out-257),c=A.dmax,f=A.wsize,l=A.whave,d=A.wnext,h=A.window,u=A.hold,p=A.bits,b=A.lencode,E=A.distcode,x=(1<<A.lenbits)-1,B=(1<<A.distbits)-1;e:do{p<15&&(u+=T[n++]<<p,p+=8,u+=T[n++]<<p,p+=8),I=b[u&x];t:for(;;){if(_=I>>>24,u>>>=_,p-=_,_=I>>>16&255,_===0)m[o++]=I&65535;else if(_&16){D=I&65535,_&=15,_&&(p<_&&(u+=T[n++]<<p,p+=8),D+=u&(1<<_)-1,u>>>=_,p-=_),p<15&&(u+=T[n++]<<p,p+=8,u+=T[n++]<<p,p+=8),I=E[u&B];r:for(;;){if(_=I>>>24,u>>>=_,p-=_,_=I>>>16&255,_&16){if(S=I&65535,_&=15,p<_&&(u+=T[n++]<<p,p+=8,p<_&&(u+=T[n++]<<p,p+=8)),S+=u&(1<<_)-1,S>c){r.msg="invalid distance too far back",A.mode=16209;break e}if(u>>>=_,p-=_,_=o-a,S>_){if(_=S-_,_>l&&A.sane){r.msg="invalid distance too far back",A.mode=16209;break e}if(y=0,L=h,d===0){if(y+=f-_,_<D){D-=_;do m[o++]=h[y++];while(--_);y=o-S,L=m}}else if(d<_){if(y+=f+d-_,_-=d,_<D){D-=_;do m[o++]=h[y++];while(--_);if(y=0,d<D){_=d,D-=_;do m[o++]=h[y++];while(--_);y=o-S,L=m}}}else if(y+=d-_,_<D){D-=_;do m[o++]=h[y++];while(--_);y=o-S,L=m}for(;D>2;)m[o++]=L[y++],m[o++]=L[y++],m[o++]=L[y++],D-=3;D&&(m[o++]=L[y++],D>1&&(m[o++]=L[y++]))}else{y=o-S;do m[o++]=m[y++],m[o++]=m[y++],m[o++]=m[y++],D-=3;while(D>2);D&&(m[o++]=m[y++],D>1&&(m[o++]=m[y++]))}}else if((_&64)===0){I=E[(I&65535)+(u&(1<<_)-1)];continue r}else{r.msg="invalid distance code",A.mode=16209;break e}break}}else if((_&64)===0){I=b[(I&65535)+(u&(1<<_)-1)];continue t}else if(_&32){A.mode=16191;break e}else{r.msg="invalid literal/length code",A.mode=16209;break e}break}}while(n<i&&o<s);D=p>>3,n-=D,p-=D<<3,u&=(1<<p)-1,r.next_in=n,r.next_out=o,r.avail_in=n<i?5+(i-n):5-(n-i),r.avail_out=o<s?257+(s-o):257-(o-s),A.hold=u,A.bits=p}});var Xs=Y((Y1,Gs)=>{"use strict";var Gh=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]),Xh=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,199,75]),Wh=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]),qh=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]),jh=(e,r,t,n,i,o,a,s)=>{let c=s.bits,f=0,l=0,d=0,h=0,u=0,p=0,b=0,E=0,x=0,B=0,I,_,D,S,y,L=null,T,m=new Uint16Array(16),A=new Uint16Array(16),z=null,Er,Ve,Ye;for(f=0;f<=15;f++)m[f]=0;for(l=0;l<n;l++)m[r[t+l]]++;for(u=c,h=15;h>=1&&m[h]===0;h--);if(u>h&&(u=h),h===0)return i[o++]=1<<24|64<<16|0,i[o++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<h&&m[d]===0;d++);for(u<d&&(u=d),E=1,f=1;f<=15;f++)if(E<<=1,E-=m[f],E<0)return-1;if(E>0&&(e===0||h!==1))return-1;for(A[1]=0,f=1;f<15;f++)A[f+1]=A[f]+m[f];for(l=0;l<n;l++)r[t+l]!==0&&(a[A[r[t+l]]++]=l);if(e===0?(L=z=a,T=20):e===1?(L=Gh,z=Xh,T=257):(L=Wh,z=qh,T=0),B=0,l=0,f=d,y=o,p=u,b=0,D=-1,x=1<<u,S=x-1,e===1&&x>852||e===2&&x>592)return 1;for(;;){Er=f-b,a[l]+1<T?(Ve=0,Ye=a[l]):a[l]>=T?(Ve=z[a[l]-T],Ye=L[a[l]-T]):(Ve=96,Ye=0),I=1<<f-b,_=1<<p,d=_;do _-=I,i[y+(B>>b)+_]=Er<<24|Ve<<16|Ye|0;while(_!==0);for(I=1<<f-1;B&I;)I>>=1;if(I!==0?(B&=I-1,B+=I):B=0,l++,--m[f]===0){if(f===h)break;f=r[t+a[l]]}if(f>u&&(B&S)!==D){for(b===0&&(b=u),y+=d,p=f-b,E=1<<p;p+b<h&&(E-=m[p+b],!(E<=0));)p++,E<<=1;if(x+=1<<p,e===1&&x>852||e===2&&x>592)return 1;D=B&S,i[D]=u<<24|p<<16|y-o|0}}return B!==0&&(i[y+B]=f-b<<24|64<<16|0),s.bits=u,0};Gs.exports=jh});var kf=Y((K1,ye)=>{"use strict";var Bo=to(),Ue=ro(),Jh=Ks(),Fr=Xs(),Qh=0,yf=1,wf=2,{Z_FINISH:Ws,Z_BLOCK:e0,Z_TREES:Hn,Z_OK:Dt,Z_STREAM_END:t0,Z_NEED_DICT:r0,Z_STREAM_ERROR:_e,Z_DATA_ERROR:Sf,Z_MEM_ERROR:To,Z_BUF_ERROR:n0,Z_DEFLATED:qs}=lt(),Kn=16180,js=16181,Js=16182,Qs=16183,ef=16184,tf=16185,rf=16186,nf=16187,of=16188,af=16189,Yn=16190,qe=16191,yo=16192,sf=16193,wo=16194,ff=16195,lf=16196,cf=16197,uf=16198,$n=16199,Vn=16200,hf=16201,df=16202,pf=16203,_f=16204,mf=16205,So=16206,Ef=16207,gf=16208,F=16209,Do=16210,Af=16211,i0=852,o0=592,a0=15,s0=a0,xf=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function f0(){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}var Lt=e=>{if(!e)return 1;let r=e.state;return!r||r.strm!==e||r.mode<Kn||r.mode>Af?1:0},If=e=>{if(Lt(e))return _e;let r=e.state;return e.total_in=e.total_out=r.total=0,e.msg="",r.wrap&&(e.adler=r.wrap&1),r.mode=Kn,r.last=0,r.havedict=0,r.flags=-1,r.dmax=32768,r.head=null,r.hold=0,r.bits=0,r.lencode=r.lendyn=new Int32Array(i0),r.distcode=r.distdyn=new Int32Array(o0),r.sane=1,r.back=-1,Dt},Bf=e=>{if(Lt(e))return _e;let r=e.state;return r.wsize=0,r.whave=0,r.wnext=0,If(e)},Tf=(e,r)=>{let t;if(Lt(e))return _e;let n=e.state;return r<0?(t=0,r=-r):(t=(r>>4)+5,r<48&&(r&=15)),r&&(r<8||r>15)?_e:(n.window!==null&&n.wbits!==r&&(n.window=null),n.wrap=t,n.wbits=r,Bf(e))},Df=(e,r)=>{if(!e)return _e;let t=new f0;e.state=t,t.strm=e,t.window=null,t.mode=Kn;let n=Tf(e,r);return n!==Dt&&(e.state=null),n},l0=e=>Df(e,s0),bf=!0,Ao,Io,c0=e=>{if(bf){Ao=new Int32Array(512),Io=new Int32Array(32);let r=0;for(;r<144;)e.lens[r++]=8;for(;r<256;)e.lens[r++]=9;for(;r<280;)e.lens[r++]=7;for(;r<288;)e.lens[r++]=8;for(Fr(yf,e.lens,0,288,Ao,0,e.work,{bits:9}),r=0;r<32;)e.lens[r++]=5;Fr(wf,e.lens,0,32,Io,0,e.work,{bits:5}),bf=!1}e.lencode=Ao,e.lenbits=9,e.distcode=Io,e.distbits=5},Lf=(e,r,t,n)=>{let i,o=e.state;return o.window===null&&(o.window=new Uint8Array(1<<o.wbits)),o.wsize===0&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0),n>=o.wsize?(o.window.set(r.subarray(t-o.wsize,t),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(r.subarray(t-n,t-n+i),o.wnext),n-=i,n?(o.window.set(r.subarray(t-n,t),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0},u0=(e,r)=>{let t,n,i,o,a,s,c,f,l,d,h,u,p,b,E=0,x,B,I,_,D,S,y,L,T=new Uint8Array(4),m,A,z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Lt(e)||!e.output||!e.input&&e.avail_in!==0)return _e;t=e.state,t.mode===qe&&(t.mode=yo),a=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=t.hold,l=t.bits,d=s,h=c,L=Dt;e:for(;;)switch(t.mode){case Kn:if(t.wrap===0){t.mode=yo;break}for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(t.wrap&2&&f===35615){t.wbits===0&&(t.wbits=15),t.check=0,T[0]=f&255,T[1]=f>>>8&255,t.check=Ue(t.check,T,2,0),f=0,l=0,t.mode=js;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",t.mode=F;break}if((f&15)!==qs){e.msg="unknown compression method",t.mode=F;break}if(f>>>=4,l-=4,y=(f&15)+8,t.wbits===0&&(t.wbits=y),y>15||y>t.wbits){e.msg="invalid window size",t.mode=F;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=f&512?af:qe,f=0,l=0;break;case js:for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(t.flags=f,(t.flags&255)!==qs){e.msg="unknown compression method",t.mode=F;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=F;break}t.head&&(t.head.text=f>>8&1),t.flags&512&&t.wrap&4&&(T[0]=f&255,T[1]=f>>>8&255,t.check=Ue(t.check,T,2,0)),f=0,l=0,t.mode=Js;case Js:for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}t.head&&(t.head.time=f),t.flags&512&&t.wrap&4&&(T[0]=f&255,T[1]=f>>>8&255,T[2]=f>>>16&255,T[3]=f>>>24&255,t.check=Ue(t.check,T,4,0)),f=0,l=0,t.mode=Qs;case Qs:for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}t.head&&(t.head.xflags=f&255,t.head.os=f>>8),t.flags&512&&t.wrap&4&&(T[0]=f&255,T[1]=f>>>8&255,t.check=Ue(t.check,T,2,0)),f=0,l=0,t.mode=ef;case ef:if(t.flags&1024){for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}t.length=f,t.head&&(t.head.extra_len=f),t.flags&512&&t.wrap&4&&(T[0]=f&255,T[1]=f>>>8&255,t.check=Ue(t.check,T,2,0)),f=0,l=0}else t.head&&(t.head.extra=null);t.mode=tf;case tf:if(t.flags&1024&&(u=t.length,u>s&&(u=s),u&&(t.head&&(y=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(o,o+u),y)),t.flags&512&&t.wrap&4&&(t.check=Ue(t.check,n,u,o)),s-=u,o+=u,t.length-=u),t.length))break e;t.length=0,t.mode=rf;case rf:if(t.flags&2048){if(s===0)break e;u=0;do y=n[o+u++],t.head&&y&&t.length<65536&&(t.head.name+=String.fromCharCode(y));while(y&&u<s);if(t.flags&512&&t.wrap&4&&(t.check=Ue(t.check,n,u,o)),s-=u,o+=u,y)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=nf;case nf:if(t.flags&4096){if(s===0)break e;u=0;do y=n[o+u++],t.head&&y&&t.length<65536&&(t.head.comment+=String.fromCharCode(y));while(y&&u<s);if(t.flags&512&&t.wrap&4&&(t.check=Ue(t.check,n,u,o)),s-=u,o+=u,y)break e}else t.head&&(t.head.comment=null);t.mode=of;case of:if(t.flags&512){for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(t.wrap&4&&f!==(t.check&65535)){e.msg="header crc mismatch",t.mode=F;break}f=0,l=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=qe;break;case af:for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.adler=t.check=xf(f),f=0,l=0,t.mode=Yn;case Yn:if(t.havedict===0)return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,t.hold=f,t.bits=l,r0;e.adler=t.check=1,t.mode=qe;case qe:if(r===e0||r===Hn)break e;case yo:if(t.last){f>>>=l&7,l-=l&7,t.mode=So;break}for(;l<3;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}switch(t.last=f&1,f>>>=1,l-=1,f&3){case 0:t.mode=sf;break;case 1:if(c0(t),t.mode=$n,r===Hn){f>>>=2,l-=2;break e}break;case 2:t.mode=lf;break;case 3:e.msg="invalid block type",t.mode=F}f>>>=2,l-=2;break;case sf:for(f>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if((f&65535)!==(f>>>16^65535)){e.msg="invalid stored block lengths",t.mode=F;break}if(t.length=f&65535,f=0,l=0,t.mode=wo,r===Hn)break e;case wo:t.mode=ff;case ff:if(u=t.length,u){if(u>s&&(u=s),u>c&&(u=c),u===0)break e;i.set(n.subarray(o,o+u),a),s-=u,o+=u,c-=u,a+=u,t.length-=u;break}t.mode=qe;break;case lf:for(;l<14;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(t.nlen=(f&31)+257,f>>>=5,l-=5,t.ndist=(f&31)+1,f>>>=5,l-=5,t.ncode=(f&15)+4,f>>>=4,l-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=F;break}t.have=0,t.mode=cf;case cf:for(;t.have<t.ncode;){for(;l<3;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}t.lens[z[t.have++]]=f&7,f>>>=3,l-=3}for(;t.have<19;)t.lens[z[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,m={bits:t.lenbits},L=Fr(Qh,t.lens,0,19,t.lencode,0,t.work,m),t.lenbits=m.bits,L){e.msg="invalid code lengths set",t.mode=F;break}t.have=0,t.mode=uf;case uf:for(;t.have<t.nlen+t.ndist;){for(;E=t.lencode[f&(1<<t.lenbits)-1],x=E>>>24,B=E>>>16&255,I=E&65535,!(x<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(I<16)f>>>=x,l-=x,t.lens[t.have++]=I;else{if(I===16){for(A=x+2;l<A;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(f>>>=x,l-=x,t.have===0){e.msg="invalid bit length repeat",t.mode=F;break}y=t.lens[t.have-1],u=3+(f&3),f>>>=2,l-=2}else if(I===17){for(A=x+3;l<A;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=x,l-=x,y=0,u=3+(f&7),f>>>=3,l-=3}else{for(A=x+7;l<A;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=x,l-=x,y=0,u=11+(f&127),f>>>=7,l-=7}if(t.have+u>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=F;break}for(;u--;)t.lens[t.have++]=y}}if(t.mode===F)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=F;break}if(t.lenbits=9,m={bits:t.lenbits},L=Fr(yf,t.lens,0,t.nlen,t.lencode,0,t.work,m),t.lenbits=m.bits,L){e.msg="invalid literal/lengths set",t.mode=F;break}if(t.distbits=6,t.distcode=t.distdyn,m={bits:t.distbits},L=Fr(wf,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,m),t.distbits=m.bits,L){e.msg="invalid distances set",t.mode=F;break}if(t.mode=$n,r===Hn)break e;case $n:t.mode=Vn;case Vn:if(s>=6&&c>=258){e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,t.hold=f,t.bits=l,Jh(e,h),a=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=t.hold,l=t.bits,t.mode===qe&&(t.back=-1);break}for(t.back=0;E=t.lencode[f&(1<<t.lenbits)-1],x=E>>>24,B=E>>>16&255,I=E&65535,!(x<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(B&&(B&240)===0){for(_=x,D=B,S=I;E=t.lencode[S+((f&(1<<_+D)-1)>>_)],x=E>>>24,B=E>>>16&255,I=E&65535,!(_+x<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=_,l-=_,t.back+=_}if(f>>>=x,l-=x,t.back+=x,t.length=I,B===0){t.mode=mf;break}if(B&32){t.back=-1,t.mode=qe;break}if(B&64){e.msg="invalid literal/length code",t.mode=F;break}t.extra=B&15,t.mode=hf;case hf:if(t.extra){for(A=t.extra;l<A;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}t.length+=f&(1<<t.extra)-1,f>>>=t.extra,l-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=df;case df:for(;E=t.distcode[f&(1<<t.distbits)-1],x=E>>>24,B=E>>>16&255,I=E&65535,!(x<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if((B&240)===0){for(_=x,D=B,S=I;E=t.distcode[S+((f&(1<<_+D)-1)>>_)],x=E>>>24,B=E>>>16&255,I=E&65535,!(_+x<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=_,l-=_,t.back+=_}if(f>>>=x,l-=x,t.back+=x,B&64){e.msg="invalid distance code",t.mode=F;break}t.offset=I,t.extra=B&15,t.mode=pf;case pf:if(t.extra){for(A=t.extra;l<A;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}t.offset+=f&(1<<t.extra)-1,f>>>=t.extra,l-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=F;break}t.mode=_f;case _f:if(c===0)break e;if(u=h-c,t.offset>u){if(u=t.offset-u,u>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=F;break}u>t.wnext?(u-=t.wnext,p=t.wsize-u):p=t.wnext-u,u>t.length&&(u=t.length),b=t.window}else b=i,p=a-t.offset,u=t.length;u>c&&(u=c),c-=u,t.length-=u;do i[a++]=b[p++];while(--u);t.length===0&&(t.mode=Vn);break;case mf:if(c===0)break e;i[a++]=t.length,c--,t.mode=Vn;break;case So:if(t.wrap){for(;l<32;){if(s===0)break e;s--,f|=n[o++]<<l,l+=8}if(h-=c,e.total_out+=h,t.total+=h,t.wrap&4&&h&&(e.adler=t.check=t.flags?Ue(t.check,i,h,a-h):Bo(t.check,i,h,a-h)),h=c,t.wrap&4&&(t.flags?f:xf(f))!==t.check){e.msg="incorrect data check",t.mode=F;break}f=0,l=0}t.mode=Ef;case Ef:if(t.wrap&&t.flags){for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(t.wrap&4&&f!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=F;break}f=0,l=0}t.mode=gf;case gf:L=t0;break e;case F:L=Sf;break e;case Do:return To;case Af:default:return _e}return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,t.hold=f,t.bits=l,(t.wsize||h!==e.avail_out&&t.mode<F&&(t.mode<So||r!==Ws))&&Lf(e,e.output,e.next_out,h-e.avail_out)?(t.mode=Do,To):(d-=e.avail_in,h-=e.avail_out,e.total_in+=d,e.total_out+=h,t.total+=h,t.wrap&4&&h&&(e.adler=t.check=t.flags?Ue(t.check,i,h,e.next_out-h):Bo(t.check,i,h,e.next_out-h)),e.data_type=t.bits+(t.last?64:0)+(t.mode===qe?128:0)+(t.mode===$n||t.mode===wo?256:0),(d===0&&h===0||r===Ws)&&L===Dt&&(L=n0),L)},h0=e=>{if(Lt(e))return _e;let r=e.state;return r.window&&(r.window=null),e.state=null,Dt},d0=(e,r)=>{if(Lt(e))return _e;let t=e.state;return(t.wrap&2)===0?_e:(t.head=r,r.done=!1,Dt)},p0=(e,r)=>{let t=r.length,n,i,o;return Lt(e)||(n=e.state,n.wrap!==0&&n.mode!==Yn)?_e:n.mode===Yn&&(i=1,i=Bo(i,r,t,0),i!==n.check)?Sf:(o=Lf(e,r,t,t),o?(n.mode=Do,To):(n.havedict=1,Dt))};ye.exports.inflateReset=Bf;ye.exports.inflateReset2=Tf;ye.exports.inflateResetKeep=If;ye.exports.inflateInit=l0;ye.exports.inflateInit2=Df;ye.exports.inflate=u0;ye.exports.inflateEnd=h0;ye.exports.inflateGetHeader=d0;ye.exports.inflateSetDictionary=p0;ye.exports.inflateInfo="pako inflate (from Nodeca project)"});var vf=Y((G1,Cf)=>{"use strict";function _0(){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}Cf.exports=_0});var zf=Y((X1,ar)=>{"use strict";var Ne=kf(),Nf=mo(),Co=Eo(),vo=Zn(),m0=go(),E0=vf(),Zf=Object.prototype.toString,{Z_NO_FLUSH:g0,Z_FINISH:Rf,Z_OK:or,Z_STREAM_END:Lo,Z_NEED_DICT:ko,Z_STREAM_ERROR:x0,Z_DATA_ERROR:Of,Z_MEM_ERROR:b0,Z_BUF_ERROR:Uf}=lt(),y0={chunkSize:1024*64,windowBits:15,to:""};function Pr(e){this.options=Nf.assign({},y0,e||{});let r=this.options;r.raw&&r.windowBits>=0&&r.windowBits<16&&(r.windowBits=-r.windowBits,r.windowBits===0&&(r.windowBits=-15)),r.windowBits>=0&&r.windowBits<16&&!(e&&e.windowBits)&&(r.windowBits+=32),r.windowBits>15&&r.windowBits<48&&(r.windowBits&15)===0&&(r.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new m0,this.strm.avail_out=0;let t=Ne.inflateInit2(this.strm,r.windowBits);if(t!==or)throw new Error(vo[t]);if(this.header=new E0,Ne.inflateGetHeader(this.strm,this.header),r.dictionary&&(typeof r.dictionary=="string"?r.dictionary=Co.string2buf(r.dictionary):Zf.call(r.dictionary)==="[object ArrayBuffer]"&&(r.dictionary=new Uint8Array(r.dictionary)),r.raw&&(t=Ne.inflateSetDictionary(this.strm,r.dictionary),t!==or)))throw new Error(vo[t])}Pr.prototype.push=function(e,r){let t=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,a,s;if(this.ended)return!1;for(r===~~r?a=r:a=r===!0?Rf:g0,Zf.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),o=Ne.inflate(t,a),o===ko&&i&&(o=Ne.inflateSetDictionary(t,i),o===or?o=Ne.inflate(t,a):o===Of&&(o=ko));t.avail_in>0&&o===Lo&&t.state.wrap&2&&t.state.flags!==0&&t.input[t.next_in]!==0;)Ne.inflateReset(t),o=Ne.inflate(t,a);switch(o){case x0:case Of:case ko:case b0:return this.onEnd(o),this.ended=!0,!1}if(s=t.avail_out,t.next_out&&(t.avail_out===0||o===Lo||a>0))if(this.options.to==="string"){let c=Co.utf8border(t.output,t.next_out),f=t.next_out-c,l=Co.buf2string(t.output,c);t.next_out=f,t.avail_out=n-f,f&&t.output.set(t.output.subarray(c,c+f),0),this.onData(l)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out)),t.avail_out=0,t.next_out=0;if(!((o===or||o===Uf)&&s===0)){if(o===Lo)return o=Ne.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(t.avail_in===0){if(a===Rf)return o=Ne.inflateEnd(this.strm),this.onEnd(o===or?Uf:o),this.ended=!0,!1;break}}}return!0};Pr.prototype.onData=function(e){this.chunks.push(e)};Pr.prototype.onEnd=function(e){e===or&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Nf.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ro(e,r){let t=new Pr(r);if(t.push(e,!0),t.err)throw t.msg||vo[t.err];return t.result}function w0(e,r){return r=r||{},r.raw=!0,Ro(e,r)}ar.exports.Inflate=Pr;ar.exports.inflate=Ro;ar.exports.inflateRaw=w0;ar.exports.ungzip=Ro;ar.exports.constants=lt()});var Oo=Y((W1,Ze)=>{"use strict";var{Deflate:S0,deflate:A0,deflateRaw:I0,gzip:B0}=Vs(),{Inflate:T0,inflate:D0,inflateRaw:L0,ungzip:k0}=zf(),C0=lt();Ze.exports.Deflate=S0;Ze.exports.deflate=A0;Ze.exports.deflateRaw=I0;Ze.exports.gzip=B0;Ze.exports.Inflate=T0;Ze.exports.inflate=D0;Ze.exports.inflateRaw=L0;Ze.exports.ungzip=k0;Ze.exports.constants=C0});var q_={};Ic(q_,{AES256_KEY_SIZE:()=>wt,AES256_PWD_VERIFY_SIZE:()=>tt,AES256_SALT_SIZE:()=>Ie,AES_AUTH_CODE_SIZE:()=>Be,AES_EXTRA_FIELD_SIZE:()=>rt,AES_OVERHEAD:()=>Sn,CENTRAL_DIR:()=>k,CENTRAL_DIRECTORY_END:()=>Ha,CENTRAL_END:()=>X,CENTRAL_FILE_HEADER:()=>Pa,CLASSIC_EOCD_SIZE:()=>Li,CMP_METHOD:()=>C,DATATYPE:()=>$e,DATA_DESC:()=>lu,DATA_DESCRIPTOR:()=>fu,DOS_FILE_ATTR:()=>it,ENCRYPT_HDR_SIZE:()=>et,EXTENSIBLE_DATA_FIELDS:()=>cu,EncryptionManager:()=>li,Errors:()=>M,FILE_SYSTEM:()=>H,GP_FLAG:()=>V,HDR_ID:()=>v,HashCalculator:()=>ns,HashCalculatorClass:()=>de,LOCAL_FILE_HEADER:()=>Fa,LOCAL_HDR:()=>Z,Logger:()=>w,META_MANIFEST_JSON:()=>yn,META_TIMESTAMP_NZIP:()=>bn,META_TIMESTAMP_OTS:()=>yr,META_TOKEN_NZIP:()=>xr,META_TOKEN_NZIP_LEGACY:()=>gn,META_TS_SUBMIT_NZIP:()=>xn,META_TS_SUBMIT_OTS:()=>br,NEOZIPKIT_INFO:()=>kn,NEO_CRYPTO_EXTRA_FIELD_SIZE:()=>nt,NEO_CRYPTO_MAGIC_BYTES:()=>G,NEO_CRYPTO_PAYLOAD_V1:()=>ge,ORIGIN_EXTRA_VERSION:()=>ma,ORIGIN_TAG:()=>we,ORIGIN_URI_MAX_BYTES:()=>_a,PlatformUtils:()=>W_,ProgressTracker:()=>fi,TIMESTAMP_METADATA:()=>wi,TIMESTAMP_SUBMITTED:()=>yi,TOKENIZED_METADATA:()=>Si,VERSION:()=>X_,ZIP64_BUFFER_SIZE_OFFSET_ERROR:()=>Kt,ZIP64_CENTRAL_DIR:()=>q,ZIP64_CENTRAL_DIRECTORY_END:()=>su,ZIP64_CENTRAL_DIRECTORY_LOCATOR:()=>au,ZIP64_CENTRAL_END:()=>Ge,ZIP64_EOCD_RECORD_SIZE:()=>Ar,ZIP64_EOCD_SIZE_FIELD:()=>Xa,ZIP64_LOCATOR_SIZE:()=>Yt,ZIP64_U16:()=>Xe,ZIP64_U32:()=>ee,ZIP64_VERSION_NEEDED:()=>Tn,ZipCompress:()=>sr,ZipCopy:()=>ai,ZipCrypto:()=>he,ZipEntry:()=>xe,ZipkitBrowser:()=>dn,asciiPathEqualsIgnoreCase:()=>wn,assertBufferAllowsEntryZip64:()=>zi,assertSafeInteger:()=>Ci,buildClassicEocd:()=>ki,buildEndRecords:()=>Ir,buildZip64Eocd:()=>qa,buildZip64Extra:()=>Dn,buildZip64Locator:()=>ja,classicEocdNeedsZip64:()=>Ri,computeArchiveMerkleRoot:()=>_t,computeMerkleRootV0FromDigests:()=>Gn,computeMerkleRootV1FromContents:()=>z0,computeMerkleRootV1FromLeaves:()=>Gr,configureLoggerFromEnvironment:()=>Ai,contentDigest:()=>Yf,crc32:()=>ae,crc32update:()=>Bn,dataDescriptorByteLength:()=>Ui,exceedsU16:()=>Gt,exceedsU32:()=>$,extraFieldHasZip64:()=>Eu,findReservedMetaEntry:()=>Sr,getTypeOf:()=>si,inflateZipPayload:()=>_c,isMetaInfPath:()=>Q,isMetadataFile:()=>M_,isReservedMetaPath:()=>wr,isStream:()=>z_,leafHashV0:()=>N0,leafHashV1:()=>Kr,makeOriginExtra:()=>V_,matchMerkleRoot:()=>M0,merkleRootFromLeaves:()=>Kf,needsZip64Archive:()=>Wa,needsZip64Entry:()=>vi,needsZip64SizeOrOffset:()=>Xt,normalizeMerklePath:()=>Vf,originCrc32Of:()=>P_,originLocatorPresent:()=>mc,originSha256Of:()=>H_,parentHash:()=>No,parseOriginFromEntry:()=>K_,parseOriginFromExtra:()=>Ec,parseZip64Eocd:()=>Ni,parseZip64Extra:()=>Oi,parseZip64Locator:()=>Zi,readBigUInt64LE:()=>N_,readU64AsNumber:()=>ft,sha256:()=>st,stripZip64FromExtra:()=>Ln,uMul:()=>Z_,unixTimeSeconds:()=>$_,writeU64:()=>Le});var xc=xa(bi());var M={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",NO_DATA:"Nothing to decompress",FILE_IN_THE_WAY:"There is a file in the way: %s",UNKNOWN_METHOD:"Invalid/unsupported compression method",STRONG_ENCRYPT_UNSUPPORTED:"Strong Encryption is not supported",INVALID_TIMESTAMP:"Invalid timestamp",TIMESTAMP_FAILED:"Failed to create the timestamp",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",INVALID_CMP_DATA_LENGTH:"Compressed data length does not match the expected length",EXTRACT_FAILED:"Failed to extract file",INVALID_CRC:"CRC32 checksum does not match the expected value",UNKNOWN_SHA256:"The SHA-256 hash has not been saved",INVALID_SHA256:"The SHA-256 hash does not match the expected value",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:"File not found: %s",NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",NO_STREAM_SUPPORT:"Streams are not supported in this environment",NO_BLOB_SUPPORT:"Blobs are not supported in this environment",NO_FILE_READER_SUPPORT:"FileReader is not supported in this environment",NO_FILES:"No files added, Zip file not created",DATATYPE_STRING_UNSUPPORTED:"The String type is not supported by this platform.",DATATYPE_ARRAY_UNSUPPORTED:"The Array type is not supported by this platform.",DATATYPE_BUFFER_UNSUPPORTED:"The Buffer type is not supported by this platform.",DATATYPE_BLOB_UNSUPPORTED:"The Blob type is not supported by this platform.",DATATYPE_U8ARRAY_UNSUPPORTED:"The uint8Array type is not supported by this platform.",DATATYPE_ARRAYBUFFER_UNSUPPORTED:"The ArrayBuffer type is not supported by this platform.",DATATYPE_UNSUPPORTED:"Unsupported input type.",COMPRESS_FAILED:"Failed to compress data",COMPRESSION_ERROR:"Error occurred during compression",DECOMPRESSION_ERROR:"Error occurred during decompression",ENCRYPT_FAILED:"Encryption failed"};var xr="META-INF/TOKEN.NZIP",gn="META-INF/NZIP.TOKEN",xn="META-INF/TS-SUBMIT.NZIP",bn="META-INF/TIMESTAMP.NZIP",br="META-INF/TS-SUBMIT.OTS",yr="META-INF/TIMESTAMP.OTS",yn="META-INF/manifest.json",yi=br,wi=yr,Si=xr,ou=[xr,gn,xn,bn,br,yr,yn];function wn(e,r){return e.length,r.length,e.toLowerCase()===r.toLowerCase()}function Q(e){return e.toLowerCase().startsWith("meta-inf/")}function wr(e){let r=e.toLowerCase();return ou.some(t=>t.toLowerCase()===r)}function Sr(e,r){let t=Array.isArray(r)?r:[r];for(let n of t){let i=e.find(o=>o.filename===n);if(i)return i}for(let n of t){let i=e.find(o=>typeof o.filename=="string"&&wn(o.filename,n));if(i)return i}return null}var Fa="PK",Pa="PK",Ha="PK",au="PK\x07",su="PK",fu="PK\x07\b",Z={SIZE:30,SIGNATURE:67324752,VER_EXTRACT:4,FLAGS:6,COMPRESSION:8,TIMEDATE_DOS:10,CRC:14,CMP_SIZE:18,UNCMP_SIZE:22,FNAME_LEN:26,EXTRA_LEN:28},et=12,Ie=16,wt=32,tt=2,Be=10,rt=11,Sn=Ie+tt+Be,ge=11,nt=4+ge,G=[78,69,90,0],lu={SIGNATURE:134695760,SIZE:16,CRC:4,CMP_SIZE:8,UNCMP_SIZE:12},k={SIZE:46,SIGNATURE:33639248,VER_MADE:4,VER_EXT:6,FLAGS:8,CMP_METHOD:10,TIMEDATE_DOS:12,CRC:16,CMP_SIZE:20,UNCMP_SIZE:24,FNAME_LEN:28,EXTRA_LEN:30,COMMENT_LEN:32,DISK_NUM:34,INT_FILE_ATTR:36,EXT_FILE_ATTR:38,LOCAL_HDR_OFFSET:42},X={SIZE:22,SIGNATURE:101010256,VOL_NUM:4,VOLDIR_START:6,VOL_ENTRIES:8,TOTAL_ENTRIES:10,CENTRAL_DIR_SIZE:12,CENTRAL_DIR_OFFSET:16,ZIP_COMMENT_LEN:20},q={SIGNATURE:101075792,SIZE:56,LEAD:12,SIZE_FIELD:4,VER_MADEBY:12,VER_NEEDED:14,VOL_NUM:16,VOLDIR_START:20,VOL_ENTRIES:24,TOTAL_ENTRIES:32,CENTRAL_DIR_SIZE:40,CENTRAL_DIR_OFFSET:48,EXTRA_FIELD:56},Ge={SIZE:20,SIGNATURE:117853008,VOL_NUM:4,CENTRAL_DIR_OFFSET:8,TOTAL_DISKS:16},C={STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATE:9,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,ZSTD:93,AES_ENCRYPT:99},V={ENCRYPTED:1,COMPRESSION1:2,COMPRESSION2:4,DATA_DESC:8,ENHANCED_DEFLATE:16,PATCHED:32,STRONG_ENCRYPT:64,EFS:2048,MASK:4096},cu={ID:0,SIZE:2},v={ZIP64:1,AVINFO:7,PFS:8,OS2:9,NTFS:10,OPENVMS:12,UNIX:13,FORK:14,PATCH:15,x509PKCS7:20,x509CERT_IDF:21,x509CERT_IDC:22,STRONG_ENC:23,AES:39169,RECORD_MGT:24,x509PKCS7RL:25,IBM1:101,IBM2:102,SHA256:334,ORIGIN:335,NEO_CRYPTO:590,POSZIP:18064,UNV_TIME:21589,UID_GID:30837,UNICODE_PATH:28789,SYMLINK:30805,HARDLINK:30821},H={MSDOS:0,AMIGA:1,OPENVMS:2,UNIX:3,VM_CMS:4,ATARI:5,OS2:6,MAC:7,CP_M:9,NTFS:10,MVS:11,VSE:12,ACORN:13,VFAT:14,ALTMVS:15,BEOS:16,TANDEM:17,OS400:18,DARWIN:19},it={READONLY:1,HIDDEN:2,SYSTEM:4,VOLUME:8,DIRECTORY:16,ARCHIVE:32};var w=class{static configure(r){this.config={...this.config,...r}}static getConfig(){return{...this.config}}static enable(){this.config.enabled=!0}static disable(){this.config.enabled=!1}static setLevel(r){this.config.level=r}static shouldLog(r){if(!this.config.enabled)return!1;let t=["debug","info","warn","error","silent"],n=t.indexOf(this.config.level);return t.indexOf(r)>=n}static log(...r){this.shouldLog("info")&&this.originalConsole.log(...r)}static error(...r){this.shouldLog("error")&&this.originalConsole.error(...r)}static warn(...r){this.shouldLog("warn")&&this.originalConsole.warn(...r)}static debug(...r){this.shouldLog("debug")&&this.originalConsole.log(...r)}static info(...r){this.shouldLog("info")&&this.originalConsole.info(...r)}static overrideConsole(){console.log=(...r)=>this.log(...r),console.error=(...r)=>this.error(...r),console.warn=(...r)=>this.warn(...r),console.debug=(...r)=>this.debug(...r),console.info=(...r)=>this.info(...r)}static restoreConsole(){console.log=this.originalConsole.log,console.error=this.originalConsole.error,console.warn=this.originalConsole.warn,console.debug=this.originalConsole.debug,console.info=this.originalConsole.info}};w.config={enabled:!0,level:"info"},w.originalConsole={log:console.log,error:console.error,warn:console.warn,debug:console.debug,info:console.info};function Ai(){let e=typeof process<"u"?process.env:{};if(e.NEOZIP_DEBUG==="false"?w.disable():e.NEOZIP_DEBUG==="true"&&(w.enable(),w.setLevel("debug")),e.NEOZIP_LOG_LEVEL){let r=e.NEOZIP_LOG_LEVEL;["debug","info","warn","error","silent"].includes(r)&&w.setLevel(r)}e.NODE_ENV==="production"&&w.setLevel("error")}Ai();var An=typeof crypto<"u"?crypto:typeof window<"u"&&window.crypto?window.crypto:null;if(!An||!An.subtle)throw new Error("Web Crypto API is not available in this environment");function hu(e){return new Uint8Array(e)}function $a(e){return e instanceof Uint8Array||e instanceof ArrayBuffer,Buffer.from(e)}async function De(e){let t={sha256:"SHA-256",sha1:"SHA-1",md5:"MD5"}[e.toLowerCase()]||"SHA-256";return{update:function(n){return this._data=this._data?Buffer.concat([this._data,$a(n)]):$a(n),this},digest:async function(n){let i=this._data||Buffer.alloc(0),o=await An.subtle.digest(t,i),a=hu(o);return n==="hex"?Array.from(a).map(s=>s.toString(16).padStart(2,"0")).join(""):n==="base64"?Buffer.from(a).toString("base64"):Buffer.from(a)}}}function In(e){let r=new Uint8Array(e);return An.getRandomValues(r),Buffer.from(r)}function Ii(e){let r=(Buffer.isBuffer(e),Buffer.from(e)),t=r.length,n=t*8,i=64-(t+9)%64,o=t+1+(i<0?i+64:i)+8,a=Buffer.alloc(o);r.copy(a,0),a[t]=128,a.writeUInt32BE(n/4294967296>>>0,o-8),a.writeUInt32BE(n>>>0,o-4);let s=[1732584193,4023233417,2562383102,271733878,3285377520],c=[1518500249,1859775393,2400959708,3395469782],f=new Array(80);for(let d=0;d<o;d+=64){for(let x=0;x<16;x++)f[x]=a.readUInt32BE(d+x*4);for(let x=16;x<80;x++)f[x]=(f[x-3]^f[x-8]^f[x-14]^f[x-16])<<1|(f[x-3]^f[x-8]^f[x-14]^f[x-16])>>>31;let[h,u,p,b,E]=s;for(let x=0;x<80;x++){let B,I;x<20?(B=u&p|~u&b,I=c[0]):x<40?(B=u^p^b,I=c[1]):x<60?(B=u&p|u&b|p&b,I=c[2]):(B=u^p^b,I=c[3]),I=(h<<5|h>>>27)+B+E+I+(f[x]>>>0)>>>0,E=b,b=p,p=u<<30|u>>>2,u=h,h=I}s[0]=s[0]+h>>>0,s[1]=s[1]+u>>>0,s[2]=s[2]+p>>>0,s[3]=s[3]+b>>>0,s[4]=s[4]+E>>>0}let l=Buffer.alloc(20);for(let d=0;d<5;d++)l.writeUInt32BE(s[d],d*4);return l}function Bi(e,r){let n=(Buffer.isBuffer(e),Buffer.from(e));n.length>64&&(n=Ii(n)),n.length<64&&(n=Buffer.concat([n,Buffer.alloc(64-n.length)]));let i=Buffer.alloc(64,54),o=Buffer.alloc(64,92);for(let s=0;s<64;s++)i[s]^=n[s],o[s]^=n[s];let a=Ii(Buffer.concat([i,Buffer.isBuffer(r)?r:Buffer.from(r)]));return Ii(Buffer.concat([o,a]))}function Va(e,r,t,n,i){if(i&&i.toLowerCase()!=="sha1")throw new Error("Browser shim only supports PBKDF2 with sha1");let o=20,a=Math.ceil(n/o),s=[],c=Buffer.isBuffer(e)?e:Buffer.from(e),f=Buffer.isBuffer(r)?r:Buffer.from(r);for(let l=1;l<=a;l++){let d=Buffer.from([l>>>24&255,l>>>16&255,l>>>8&255,l&255]),h=Bi(c,Buffer.concat([f,d])),u=Buffer.from(h);for(let p=1;p<t;p++){h=Bi(c,h);for(let b=0;b<o;b++)u[b]^=h[b]}s.push(u)}return Buffer.concat(s).subarray(0,n)}function Ti(e,r){if(e!=="sha1")throw new Error("Browser shim createHmac only supports sha1");let t=Buffer.isBuffer(r)?r:Buffer.from(r),n=Buffer.alloc(0);return{update(i){return n=Buffer.concat([n,Buffer.isBuffer(i)?i:Buffer.from(i)]),this},digest(){let i=Bi(t,n);return n=Buffer.alloc(0),i}}}var Te=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]),du=new Uint8Array([1,2,4,8,16,32,64,128,27,54]);function pu(e){let r=new Uint8Array(240);for(let t=0;t<32;t++)r[t]=e[t];for(let t=8;t<60;t++){let n=t*4,i=(t-8)*4,o=(t-1)*4;if(t%8===0){let a=Te[r[o+1]]^du[t/8-1];r[n]=r[i]^a,r[n+1]=r[i+1]^Te[r[o+2]],r[n+2]=r[i+2]^Te[r[o+3]],r[n+3]=r[i+3]^Te[r[o]]}else t%8===4?(r[n]=r[i]^Te[r[o]],r[n+1]=r[i+1]^Te[r[o+1]],r[n+2]=r[i+2]^Te[r[o+2]],r[n+3]=r[i+3]^Te[r[o+3]]):(r[n]=r[i]^r[o],r[n+1]=r[i+1]^r[o+1],r[n+2]=r[i+2]^r[o+2],r[n+3]=r[i+3]^r[o+3])}return r}function ot(e){return e<<1&255^(e>>>7&1)*27}function _u(e,r){let t=new Uint8Array(16);for(let s=0;s<16;s++)t[s]=r[s]^e[s];for(let s=1;s<14;s++){for(let u=0;u<16;u++)t[u]=Te[t[u]];let c=t[1];t[1]=t[5],t[5]=t[9],t[9]=t[13],t[13]=c;let f=t[2];t[2]=t[10],t[10]=f;let l=t[6];t[6]=t[14],t[14]=l;let d=t[3];t[3]=t[15],t[15]=t[11],t[11]=t[7],t[7]=d;for(let u=0;u<4;u++){let p=t[u*4],b=t[u*4+1],E=t[u*4+2],x=t[u*4+3];t[u*4]=ot(p)^ot(b)^b^E^x,t[u*4+1]=p^ot(b)^ot(E)^E^x,t[u*4+2]=p^b^ot(E)^ot(x)^x,t[u*4+3]=ot(p)^p^b^E^ot(x)}let h=s*16;for(let u=0;u<16;u++)t[u]^=e[h+u]}for(let s=0;s<16;s++)t[s]=Te[t[s]];let n=t[1];t[1]=t[5],t[5]=t[9],t[9]=t[13],t[13]=n;let i=t[2];t[2]=t[10],t[10]=i;let o=t[6];t[6]=t[14],t[14]=o;let a=t[3];t[3]=t[15],t[15]=t[11],t[11]=t[7],t[7]=a;for(let s=0;s<16;s++)t[s]^=e[224+s];return t}function Ya(e,r,t){if(e!=="aes-256-ecb"||t!=null)throw new Error("Browser shim createCipheriv only supports aes-256-ecb with null iv");let n=Buffer.isBuffer(r)?r:Buffer.from(r);if(n.length!==32)throw new Error("aes-256-ecb requires 32-byte key");let i=pu(n);return{setAutoPadding(){return this},update(o){let a=Buffer.isBuffer(o)?o:Buffer.from(o);if(a.length!==16)throw new Error("Browser shim AES-ECB only supports 16-byte blocks");let s=_u(i,a);return Buffer.from(s)},final(){return Buffer.alloc(0)}}}var at=class at{canHandle(r){return r===1}getMethodName(){return"ZIP-Crypto"}getKeyLength(){return at.KEY_LENGTH}async encrypt(r,t){try{if(t.method!==1)return{success:!1,error:"ZIP-Crypto encryption method required"};let n=this.initKeys(t.password),i=Buffer.alloc(r.length);for(let o=0;o<r.length;o++){let a=r[o],s=this.encryptByte(n,a);i[o]=s,this.updateKeys(n,a)}return{success:!0,encryptedData:i}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown encryption error"}}}async decrypt(r,t){try{if(t.method!==1)return{success:!1,error:"ZIP-Crypto decryption method required"};let n=this.initKeys(t.password),i=Buffer.alloc(r.length);for(let o=0;o<r.length;o++){let a=r[o],s=this.decryptByte(n,a);i[o]=s,this.updateKeys(n,s)}return{success:!0,decryptedData:i}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown decryption error"}}}verifyPassword(r,t){if(r.length<12)throw new Error("Decrypted header must be at least 12 bytes");if(r[11]!==t)throw new Error("Password verification FAILED")}parseLocalHeaderForDecryption(r,t){if(r.readUInt32LE(0)!==67324752)throw new Error("Invalid local header signature");let n=r.readUInt16LE(6),i=r.readUInt32LE(10),o=r.readUInt32LE(14);n&V.DATA_DESC&&(!t.lastModTimeDate||t.lastModTimeDate===0)&&(t.lastModTimeDate=i),t.localCrc=o;let a;return n&V.DATA_DESC?a=(t.lastModTimeDate||t.timeDateDOS||0)>>8&255:a=(o&&o!==0?o:t.crc)>>24&255,{bitFlags:n,lastModTimeDate:i,localCrc:o,checkByte:a}}createEncryptionHeader(r,t){let n=Buffer.alloc(et);In(11).copy(n,0);let o;return(r.bitFlags&V.DATA_DESC)!==0?o=(r.lastModTimeDate||r.timeDateDOS||0)>>8&255:o=r.crc>>24&255,n[11]=o,w.debug(`[ZipCrypto] Created encryption header: checkByte=0x${o.toString(16).padStart(2,"0")}, DATA_DESC=${(r.bitFlags&V.DATA_DESC)!==0}`),n}encryptBuffer(r,t,n){let i=this.createEncryptionHeader(r,n),o=Buffer.concat([i,t]),a=this.initKeys(n),s=Buffer.alloc(o.length);for(let c=0;c<o.length;c++){let f=o[c],l=this.encryptByte(a,f);s[c]=l,this.updateKeys(a,f)}return w.debug(`[ZipCrypto] Encrypted buffer: ${t.length} bytes compressed data + ${et} bytes header = ${s.length} bytes total`),s}decryptBuffer(r,t,n,i){let o=t.subarray(r.localHdrOffset),a=o.subarray(0,30),{bitFlags:s,localCrc:c,checkByte:f}=this.parseLocalHeaderForDecryption(a,r),l=a.readUInt16LE(26),d=a.readUInt16LE(28),h=30+l+d,u=12,p=o.subarray(h,h+u),b=Buffer.concat([p,n]),E=this.initKeys(i);for(let B=0;B<b.length;B++){let I=b[B],_=this.decryptByte(E,I);b[B]=_,this.updateKeys(E,_)}let x=b.subarray(0,u);return this.verifyPassword(x,f),b.subarray(u)}async*createStreamDecryptor(r,t,n){let i=this.initKeys(r),o=12,a=Buffer.alloc(o),s=0,c=null,f=0;for(;s<o;){if(!c||f>=c.length){let h=await n.next();if(h.done||!h.value)throw new Error("ZIP-Crypto: insufficient encrypted data (missing encryption header)");c=h.value,f=0}let l=o-s,d=Math.min(l,c.length-f);c.copy(a,s,f,f+d),s+=d,f+=d}for(let l=0;l<o;l++){let d=a[l],h=this.decryptByte(i,d)&255;a[l]=h,this.updateKeys(i,h)}if(this.verifyPassword(a,t),c&&f<c.length){let l=c.length-f;for(let d=0;d<l;d++){let h=f+d,u=c[h],p=this.decryptByte(i,u);c[h]=p,this.updateKeys(i,p)}yield c.subarray(f)}for await(let l of n){for(let d=0;d<l.length;d++){let h=l[d],u=this.decryptByte(i,h);l[d]=u,this.updateKeys(i,u)}yield l}}initKeys(r){let t=[305419896,591751049,878082192];for(let n=0;n<r.length;n++)this.updateKeys(t,r.charCodeAt(n));return t}updateKeys(r,t){r[0]=(r[0]>>>8^at.CRC_TABLE[(r[0]^t)&255])>>>0,r[1]=(Math.imul(r[1]+(r[0]&255),134775813)+1&4294967295)>>>0,r[2]=(r[2]>>>8^at.CRC_TABLE[(r[2]^r[1]>>>24)&255])>>>0}encryptByte(r,t){let n=r[2]|2;return(t^Math.imul(n,n^1)>>>8)&255}decryptByte(r,t){let n=r[2]|2;return(t^Math.imul(n,n^1)>>>8)&255}crc32(r,t){return(r>>>8^at.CRC_TABLE[(r^t)&255])>>>0}static crc32(r){return Ka(r)}static crc32update(r,t){return Ga(r,t)}};at.KEY_LENGTH=3,at.CRC_TABLE=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];var he=at;function Ka(e){typeof e=="string"&&(e=Buffer.from(e,"utf8"));let r=e.length,t=-1;for(let n=0;n<r;)t=he.CRC_TABLE[(t^e[n++])&255]^t>>>8;return~t>>>0}function Ga(e,r){return he.CRC_TABLE[(e^r)&255]^e>>>8}function ae(e){return Ka(e)}function Bn(e,r){return Ga(e,r)}function st(e){return De("sha256").update(e).digest("hex")}var ee=4294967295,Xe=65535,Tn=45,Xa=44,Ar=56,Yt=20,Li=22,Kt="Zip64 for sizes or offsets \u2265 4 GiB requires the Node file/streaming API; in-memory buffer/browser writers only support Zip64 for entry counts > 65535. Use ZipkitNode (createZipFromFiles / writeZipEntry) instead of buildZipBuffer.";function $(e){return e>ee}function Gt(e){return e>Xe}function Ci(e,r){let t=typeof e=="bigint"?Number(e):e;if(!Number.isFinite(t)||!Number.isSafeInteger(t)||t<0)throw new Error(`Zip64 ${r} is not a safe non-negative integer (got ${String(e)}); values must fit in Number.MAX_SAFE_INTEGER`);return t}function ft(e,r){return Ci(e.readBigUInt64LE(r),`u64@${r}`)}function Le(e,r,t){Ci(t,`u64 write@${r}`),e.writeBigUInt64LE(BigInt(t),r)}function vi(e,r,t,n=0){return $(e)||$(r)||$(t)||Gt(n)}function Xt(e,r,t,n=0,i=0){return $(e)||$(r)||$(t)||$(n)||$(i)}function Wa(e,r,t){return Gt(e)||$(r)||$(t)}function Ri(e){return e.centralDirOffset===ee||e.centralDirSize===ee||e.volEntries===Xe||e.totalEntries===Xe}function Dn(e,r){let t=r?.forLocal===!0,n=[],i=t||e.uncompressedSize!==void 0,o=t||e.compressedSize!==void 0;if(i){if(e.uncompressedSize===void 0)throw new Error("Zip64 local extra requires uncompressedSize");n.push(8)}if(o){if(e.compressedSize===void 0)throw new Error("Zip64 local extra requires compressedSize");n.push(8)}e.localHdrOffset!==void 0&&n.push(8),e.diskStart!==void 0&&n.push(4);let a=n.reduce((f,l)=>f+l,0),s=Buffer.alloc(4+a);s.writeUInt16LE(v.ZIP64,0),s.writeUInt16LE(a,2);let c=4;return i&&(Le(s,c,e.uncompressedSize),c+=8),o&&(Le(s,c,e.compressedSize),c+=8),e.localHdrOffset!==void 0&&(Le(s,c,e.localHdrOffset),c+=8),e.diskStart!==void 0&&s.writeUInt32LE(e.diskStart>>>0,c),s}function Oi(e,r){let t={},n=0;if(r.uncompressedSize===ee){if(n+8>e.length)throw new Error("Zip64 extra truncated (uncompressed size)");t.uncompressedSize=ft(e,n),n+=8}if(r.compressedSize===ee){if(n+8>e.length)throw new Error("Zip64 extra truncated (compressed size)");t.compressedSize=ft(e,n),n+=8}if(r.localHdrOffset===ee){if(n+8>e.length)throw new Error("Zip64 extra truncated (local header offset)");t.localHdrOffset=ft(e,n),n+=8}if(r.diskStart===Xe){if(n+4>e.length)throw new Error("Zip64 extra truncated (disk start)");t.diskStart=e.readUInt32LE(n)}return t}function Eu(e){if(!e||e.length<4)return!1;for(let r=0;r+4<=e.length;){let t=e.readUInt16LE(r),n=e.readUInt16LE(r+2);if(t===v.ZIP64)return!0;r+=4+n}return!1}function Ln(e){if(!e||e.length<4)return e??null;let r=[];for(let t=0;t+4<=e.length;){let n=e.readUInt16LE(t),i=e.readUInt16LE(t+2),o=t+4+i;if(o>e.length)break;n!==v.ZIP64&&r.push(Buffer.from(e.subarray(t,o))),t=o}return r.length===0?null:Buffer.concat(r)}function Ui(e){return e?24:16}function qa(e){let r=Buffer.alloc(Ar);return r.writeUInt32LE(q.SIGNATURE,0),Le(r,q.SIZE_FIELD,Xa),r.writeUInt16LE(e.versionMadeBy??45,q.VER_MADEBY),r.writeUInt16LE(e.versionNeeded??Tn,q.VER_NEEDED),r.writeUInt32LE(e.diskNumber??0,q.VOL_NUM),r.writeUInt32LE(e.diskWithCdStart??0,q.VOLDIR_START),Le(r,q.VOL_ENTRIES,e.totalEntries),Le(r,q.TOTAL_ENTRIES,e.totalEntries),Le(r,q.CENTRAL_DIR_SIZE,e.centralDirSize),Le(r,q.CENTRAL_DIR_OFFSET,e.centralDirOffset),r}function ja(e){let r=Buffer.alloc(Yt);return r.writeUInt32LE(Ge.SIGNATURE,0),r.writeUInt32LE(0,Ge.VOL_NUM),Le(r,Ge.CENTRAL_DIR_OFFSET,e),r.writeUInt32LE(1,Ge.TOTAL_DISKS),r}function ki(e){let r=e.archiveComment||"",t=Buffer.from(r,"utf8"),n=Math.min(t.length,Xe),i=Buffer.alloc(Li+n);i.writeUInt32LE(X.SIGNATURE,0),i.writeUInt16LE(0,X.VOL_NUM),i.writeUInt16LE(0,X.VOLDIR_START);let o=e.useZip64Sentinels&&Gt(e.totalEntries)?Xe:e.totalEntries,a=e.useZip64Sentinels&&$(e.centralDirSize)?ee:e.centralDirSize,s=e.forceCdOffsetSentinel||e.useZip64Sentinels&&$(e.centralDirOffset)?ee:e.centralDirOffset;return i.writeUInt16LE(o,X.VOL_ENTRIES),i.writeUInt16LE(o,X.TOTAL_ENTRIES),i.writeUInt32LE(a,X.CENTRAL_DIR_SIZE),i.writeUInt32LE(s,X.CENTRAL_DIR_OFFSET),i.writeUInt16LE(n,X.ZIP_COMMENT_LEN),n>0&&t.copy(i,Li,0,n),i}function Ir(e){let r=e.allowSizeOffsetZip64!==!1,t=e.forceZip64===!0;if(!(t||Wa(e.totalEntries,e.centralDirSize,e.centralDirOffset)))return ki({totalEntries:e.totalEntries,centralDirSize:e.centralDirSize,centralDirOffset:e.centralDirOffset,archiveComment:e.archiveComment,useZip64Sentinels:!1});if(($(e.centralDirSize)||$(e.centralDirOffset))&&!r)throw new Error(Kt);let o=qa({totalEntries:e.totalEntries,centralDirSize:e.centralDirSize,centralDirOffset:e.centralDirOffset,versionMadeBy:e.versionMadeBy??45}),a=ja(e.zip64EocdOffset),s=ki({totalEntries:e.totalEntries,centralDirSize:e.centralDirSize,centralDirOffset:e.centralDirOffset,archiveComment:e.archiveComment,useZip64Sentinels:!0,forceCdOffsetSentinel:t});return Buffer.concat([o,a,s])}function Ni(e){if(e.length<Ar)throw new Error("Zip64 EOCD truncated");if(e.readUInt32LE(0)!==q.SIGNATURE)throw new Error("Invalid Zip64 EOCD signature");return{totalEntries:ft(e,q.TOTAL_ENTRIES),centralDirSize:ft(e,q.CENTRAL_DIR_SIZE),centralDirOffset:ft(e,q.CENTRAL_DIR_OFFSET)}}function Zi(e){if(e.length<Yt)throw new Error("Zip64 locator truncated");if(e.readUInt32LE(0)!==Ge.SIGNATURE)throw new Error("Invalid Zip64 EOCD locator signature");return ft(e,Ge.CENTRAL_DIR_OFFSET)}function zi(e,r,t){if(Xt(e,r,t))throw new Error(Kt)}var Mi=30,gu=10,Ja=51,xe=class{constructor(r,t,n){this.debug=!0;this.verMadeBy=0;this.verExtract=0;this.bitFlags=0;this.cmpMethod=0;this.timeDateDOS=0;this.crc=0;this.compressedSize=0;this.uncompressedSize=0;this.volNumber=0;this.intFileAttr=0;this.extFileAttr=0;this.localHdrOffset=0;this.filename="";this.extraField=null;this.additionalExtra=null;this.emitUnicodePath=!0;this.comment=null;this.fileBuffer=null;this.cmpData=null;this.isEncrypted=!1;this.isStrongEncrypt=!1;this.encryptHdr=null;this.lastModTimeDate=0;this.decrypt=null;this.aesVersion=0;this.aesStrength=0;this.realCmpMethod=-1;this.neoCryptoPayloadVersion=0;this.neoCryptoAlgorithm=0;this.neoCryptoFlags=0;this.isUpdated=!0;this.isDirectory=!1;this.isMetaData=!1;this.platform=null;this.universalTime=null;this.uid=null;this.gid=null;this.sha256=null;this.merkleLeafV1=null;this.isSymlink=!1;this.linkTarget=null;this.isHardLink=!1;this.originalEntry=null;this.inode=null;this.usesZip64Extra=!1;this.forceZip64=!1;this.isMSDOS=this.platform===null;this.isUnixLike=this.platform!=null&&this.platform!=="win32";this.isMacOS=this.platform!=null&&this.platform==="darwin";this.isLinux=this.platform!=null&&this.platform==="linux";this.VER_MADE_BY=(()=>{switch(this.platform){case"darwin":return H.DARWIN<<8|Mi;case"win32":return H.NTFS<<8|Mi;default:return H.UNIX<<8|Mi}})();this.filename=r||"",this.comment=t||null,this.debug=n||!1,this.bitFlags|=V.EFS}readZipEntry(r){if(r.length<k.SIZE)throw new Error("Zip entry data is too small or corrupt");if(r.readUInt32LE(0)!==k.SIGNATURE)throw new Error(M.INVALID_CEN);this.verMadeBy=r.readUInt16LE(k.VER_MADE),this.verExtract=r.readUInt16LE(k.VER_EXT),this.bitFlags=r.readUInt16LE(k.FLAGS),(this.bitFlags&V.ENCRYPTED)!=0&&(this.isEncrypted=!0,(this.bitFlags&V.STRONG_ENCRYPT)!=0&&(this.isStrongEncrypt=!0)),this.cmpMethod=r.readUInt16LE(k.CMP_METHOD),this.timeDateDOS=r.readUInt32LE(k.TIMEDATE_DOS),this.crc=r.readUInt32LE(k.CRC),this.compressedSize=r.readUInt32LE(k.CMP_SIZE),this.uncompressedSize=r.readUInt32LE(k.UNCMP_SIZE),this.volNumber=r.readUInt16LE(k.DISK_NUM),this.intFileAttr=r.readUInt16LE(k.INT_FILE_ATTR),this.extFileAttr=r.readUInt32LE(k.EXT_FILE_ATTR),this.extFileAttr&it.DIRECTORY&&(this.isDirectory=!0),this.localHdrOffset=r.readUInt32LE(k.LOCAL_HDR_OFFSET);let t=r.readUInt16LE(k.FNAME_LEN),n=r.toString("utf8",k.SIZE,k.SIZE+t);this.filename=n,this.filename.endsWith("/")&&(this.isDirectory=!0);let i=r.readUInt16LE(k.EXTRA_LEN);if(i>0){this.extraField=r.subarray(k.SIZE+t,k.SIZE+t+i);for(let s=0;s<i;){let c=this.extraField.readUInt16LE(s),f=this.extraField.readUInt16LE(s+2),l=this.extraField.subarray(s+4,s+4+f);if(c===v.UNICODE_PATH&&f>=5){let d=l.readUInt8(0),h=l.readUInt32LE(1),u=Buffer.from(this.filename);if(ae(u)===h){let b=l.subarray(5).toString("utf8");this.filename=b,this.debug&&w.log(`Using Unicode Path: ${this.filename}`)}}s+=4+f}for(let s=0;s<i;){let c=this.extraField.readUInt16LE(s),f=this.extraField.readUInt16LE(s+2),l=this.extraField.subarray(s+4,s+4+f);if(c===v.SHA256)f===64?this.sha256=l.toString("utf8"):this.sha256=l.toString("hex");else if(c===v.UNV_TIME)f>=5&&l.readUInt8(0)&1&&(this.universalTime=l.readUInt32LE(1));else if(c===v.UID_GID){if(f>=5){let d=l.readUInt8(0),h=l.readUInt8(1);if(h<=4&&f>=2+h&&(this.uid=l.readUIntLE(2,h),f>=2+h+1)){let u=l.readUInt8(2+h);u<=4&&f>=2+h+1+u&&(this.gid=l.readUIntLE(2+h+1,u))}}}else if(c===v.SYMLINK){if(f>=3){let d=l.readUInt8(0),h=l.readUInt16LE(1);h>0&&f>=3+h&&(this.isSymlink=!0,this.linkTarget=l.subarray(3,3+h).toString("utf8"))}}else if(c===v.HARDLINK){if(f>=11){let d=l.readUInt8(0);this.inode=l.readUInt32LE(1);let h=l.readUInt16LE(5);h>0&&f>=7+h&&(this.isHardLink=!0,this.originalEntry=l.subarray(7,7+h).toString("utf8"))}}else if(c===v.AES)f>=7&&(this.aesVersion=l.readUInt16LE(0),this.aesStrength=l.readUInt8(4),this.realCmpMethod=l.readUInt16LE(5));else if(c===v.NEO_CRYPTO)f>=ge&&l[0]===G[0]&&l[1]===G[1]&&l[2]===G[2]&&l[3]===G[3]&&(this.neoCryptoPayloadVersion=l.readUInt8(4),this.neoCryptoAlgorithm=l.readUInt16LE(5),this.neoCryptoFlags=l.readUInt16LE(7));else if(c===v.ZIP64){let d=Oi(l,{uncompressedSize:this.uncompressedSize,compressedSize:this.compressedSize,localHdrOffset:this.localHdrOffset,diskStart:this.volNumber});this.usesZip64Extra=!0,d.uncompressedSize!==void 0&&(this.uncompressedSize=d.uncompressedSize),d.compressedSize!==void 0&&(this.compressedSize=d.compressedSize),d.localHdrOffset!==void 0&&(this.localHdrOffset=d.localHdrOffset),d.diskStart!==void 0&&(this.volNumber=d.diskStart)}else if(c!==v.UNICODE_PATH){let d=Buffer.from(this.extraField.subarray(s,s+4+f));this.additionalExtra=this.additionalExtra?Buffer.concat([this.additionalExtra,d]):d}s+=4+f}}let o=r.readUInt16LE(k.COMMENT_LEN);o>0&&(this.comment=r.toString("utf8",k.SIZE+t,k.SIZE+t+o)),this.debug&&this.showVerboseInfo();let a=k.SIZE+t+i+o;return r.subarray(a)}needsUnicodeHandling(){return this.emitUnicodePath?/[^\x00-\x7E]|['"]/.test(this.filename):!1}versionNeededToExtract(){let r=gu;return this.cmpMethod===C.AES_ENCRYPT?r=Ja:this.cmpMethod===C.ZSTD&&(r=63),(this.forceZip64||vi(this.uncompressedSize,this.compressedSize,this.localHdrOffset,this.volNumber))&&(r=Math.max(r,Tn)),r}addUnicodePathField(r,t){let n=Buffer.from(this.filename,"utf8"),i=this.filename.replace(/[^\x00-\x7E]/g,"?"),o=Buffer.from(i,"ascii"),a=ae(o),s=5+n.length;return r.writeUInt16LE(v.UNICODE_PATH,t),r.writeUInt16LE(s,t+2),r.writeUInt8(1,t+4),r.writeUInt32LE(a,t+5),n.copy(r,t+9),t+4+s}createLocalHdr(){let r=0,t=this.needsUnicodeHandling();t&&(r=5+Buffer.from(this.filename,"utf8").length+4);let n=this.cmpMethod===C.AES_ENCRYPT&&this.aesVersion>0;n&&(r+=rt);let i=this.neoCryptoAlgorithm>0;i&&(r+=nt);let o=this.sha256?Buffer.from(this.sha256,"hex"):null,a=o&&o.length>0?4+o.length:0,s=Ln(this.additionalExtra),c=s?.length??0,f=this.forceZip64||$(this.uncompressedSize)||$(this.compressedSize);f&&(this.usesZip64Extra=!0);let l=f?Dn({uncompressedSize:this.uncompressedSize,compressedSize:this.compressedSize},{forLocal:!0}):null,d=l?.length??0;r+=a+c+d;let h=Buffer.alloc(Z.SIZE+this.filename.length+r);h.writeUInt32LE(Z.SIGNATURE,0);let u=this.versionNeededToExtract();h.writeUInt16LE(u,Z.VER_EXTRACT),h.writeUInt16LE(this.bitFlags>>>0,Z.FLAGS),h.writeUInt16LE(this.cmpMethod,Z.COMPRESSION),h.writeUInt32LE(this.timeDateDOS>>>0,Z.TIMEDATE_DOS),h.writeUInt32LE(this.aesVersion===2?0:this.crc,Z.CRC),h.writeUInt32LE(f?ee:this.compressedSize,Z.CMP_SIZE),h.writeUInt32LE(f?ee:this.uncompressedSize,Z.UNCMP_SIZE),h.writeUInt16LE(this.filename.length,Z.FNAME_LEN),h.writeUInt16LE(r,Z.EXTRA_LEN);let p=this.filename.replace(/[^\x00-\x7E]/g,"?"),b=Buffer.from(p);b.copy(h,Z.SIZE);let E=Z.SIZE+b.length;if(t&&(E=this.addUnicodePathField(h,E)),l&&(l.copy(h,E),E+=d),n&&(h.writeUInt16LE(v.AES,E),h.writeUInt16LE(7,E+2),h.writeUInt16LE(this.aesVersion,E+4),h.writeUInt16LE(17729,E+6),h.writeUInt8(this.aesStrength,E+8),h.writeUInt16LE(this.realCmpMethod,E+9),E+=rt),i){h.writeUInt16LE(v.NEO_CRYPTO,E),h.writeUInt16LE(ge,E+2);let x=E+4;for(let B=0;B<4;B++)h.writeUInt8(G[B],x+B);h.writeUInt8(this.neoCryptoPayloadVersion,x+4),h.writeUInt16LE(this.neoCryptoAlgorithm,x+5),h.writeUInt16LE(this.neoCryptoFlags,x+7),h.writeUInt16LE(0,x+9),E+=nt}return o&&a>0&&(h.writeUInt16LE(v.SHA256,E),h.writeUInt16LE(o.length,E+2),o.copy(h,E+4),E+=a),s&&c>0&&s.copy(h,E),h}centralDirEntry(){let r=this.comment?Buffer.from(this.comment,"utf8").length:0,t=this.universalTime?9:0,n=this.uid&&this.gid?15:0,i=this.sha256?Buffer.from(this.sha256,"hex"):null,o=i?i.length+4:0,a=this.isSymlink&&this.linkTarget?7+Buffer.byteLength(this.linkTarget,"utf8"):0,s=this.isHardLink&&this.originalEntry&&this.inode!==null?11+Buffer.byteLength(this.originalEntry,"utf8"):0,c=this.needsUnicodeHandling(),f=0;c&&(f=5+Buffer.from(this.filename,"utf8").length+4);let l=this.cmpMethod===C.AES_ENCRYPT&&this.aesVersion>0,d=l?rt:0,h=this.neoCryptoAlgorithm>0,u=h?nt:0,p=Ln(this.additionalExtra),b=p?.length??0,E={};(this.forceZip64||$(this.uncompressedSize))&&(E.uncompressedSize=this.uncompressedSize),(this.forceZip64||$(this.compressedSize))&&(E.compressedSize=this.compressedSize),(this.forceZip64||$(this.localHdrOffset))&&(E.localHdrOffset=this.localHdrOffset),Gt(this.volNumber)&&(E.diskStart=this.volNumber);let x=Object.keys(E).length>0?Dn(E):null;x&&(this.usesZip64Extra=!0);let B=x?.length??0,I=t+o+n+a+s+(c?f:0)+d+u+b+B,_=this.filename.replace(/[^\x00-\x7E]/g,"?"),D=_.length,S=Buffer.alloc(k.SIZE+D+r+I);S.writeUInt32LE(k.SIGNATURE,0),S.writeUInt16LE(this.isUpdated?this.VER_MADE_BY:this.verMadeBy,k.VER_MADE);let y=this.versionNeededToExtract();S.writeInt16LE(this.isUpdated?y:this.verMadeBy,k.VER_EXT),S.writeInt16LE(this.bitFlags>>>0,k.FLAGS),S.writeInt16LE(this.cmpMethod,k.CMP_METHOD),S.writeUInt32LE(this.timeDateDOS>>>0,k.TIMEDATE_DOS),S.writeUInt32LE(this.aesVersion===2?0:this.crc,k.CRC),S.writeUInt32LE(E.compressedSize!==void 0?ee:this.compressedSize,k.CMP_SIZE),S.writeUInt32LE(E.uncompressedSize!==void 0?ee:this.uncompressedSize,k.UNCMP_SIZE),S.writeUInt16LE(this.filename.length,k.FNAME_LEN),S.writeUInt16LE(I,k.EXTRA_LEN),S.writeUInt16LE(r,k.COMMENT_LEN),S.writeUInt16LE(E.diskStart!==void 0?Xe:this.volNumber,k.DISK_NUM),S.writeUInt16LE(this.intFileAttr>>>0,k.INT_FILE_ATTR),S.writeUInt32LE(this.extFileAttr>>>0,k.EXT_FILE_ATTR),S.writeUInt32LE(E.localHdrOffset!==void 0?ee:this.localHdrOffset,k.LOCAL_HDR_OFFSET),Buffer.from(_).copy(S,k.SIZE);let T=k.SIZE+D;r>0&&this.comment&&(Buffer.from(this.comment,"utf8").copy(S,T),T+=r);let m=T;if(x&&(x.copy(S,m),m+=B),this.universalTime&&(S.writeUInt16LE(v.UNV_TIME,m),S.writeUInt16LE(5,m+2),S.writeUInt8(1,m+4),S.writeUInt32LE(Math.floor(Date.now()/1e3),m+5),m+=9),i&&(S.writeUInt16LE(v.SHA256,m),S.writeUInt16LE(i.length,m+2),i.copy(S,m+4),m+=4+i.length),this.uid&&this.gid&&(S.writeUInt16LE(v.UID_GID,m),S.writeUInt16LE(11,m+2),S.writeUInt8(1,m+4),S.writeUInt8(4,m+5),S.writeUInt32LE(this.uid,m+6),S.writeUInt8(4,m+10),S.writeUInt32LE(this.gid,m+11),m+=15),this.isSymlink&&this.linkTarget){let A=Buffer.from(this.linkTarget,"utf8"),z=3+A.length;S.writeUInt16LE(v.SYMLINK,m),S.writeUInt16LE(z,m+2),S.writeUInt8(1,m+4),S.writeUInt16LE(A.length,m+5),A.copy(S,m+7),m+=4+z}if(this.isHardLink&&this.originalEntry&&this.inode!==null){let A=Buffer.from(this.originalEntry,"utf8"),z=7+A.length;S.writeUInt16LE(v.HARDLINK,m),S.writeUInt16LE(z,m+2),S.writeUInt8(1,m+4),S.writeUInt32LE(this.inode,m+5),S.writeUInt16LE(A.length,m+9),A.copy(S,m+11),m+=4+z}if(c&&(m=this.addUnicodePathField(S,m)),l&&(S.writeUInt16LE(v.AES,m),S.writeUInt16LE(7,m+2),S.writeUInt16LE(this.aesVersion,m+4),S.writeUInt16LE(17729,m+6),S.writeUInt8(this.aesStrength,m+8),S.writeUInt16LE(this.realCmpMethod,m+9),m+=rt),h){S.writeUInt16LE(v.NEO_CRYPTO,m),S.writeUInt16LE(ge,m+2);let A=m+4;for(let z=0;z<4;z++)S.writeUInt8(G[z],A+z);S.writeUInt8(this.neoCryptoPayloadVersion,A+4),S.writeUInt16LE(this.neoCryptoAlgorithm,A+5),S.writeUInt16LE(this.neoCryptoFlags,A+7),S.writeUInt16LE(0,A+9),m+=nt}return p&&b>0&&p.copy(S,m),S}setDateTime(r){if(!r)return 0;let t=r.getFullYear()-1980,n=r.getMonth()+1,i=r.getDate(),o=r.getHours(),a=r.getMinutes(),s=r.getSeconds(),c=(t&127)<<9|(n&15)<<5|i&31,f=(o&31)<<11|(a&63)<<5|s>>1&31;return c<<16|f}parseDateTime(r){if(r==0)return null;let t=r>>16&65535,n=(t>>9&127)+1980,i=(t>>5&15)-1,o=t&31,a=r&65535,s=a>>11&31,c=a>>5&63,f=(a&31)<<1;return new Date(n,i,o,s,c,f)}toLocalDateString(){let r=this.parseDateTime(this.timeDateDOS);return r===null?"--/--/----":r.toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"}).slice(0,10)}toTimeString(){let r=this.parseDateTime(this.timeDateDOS);return r===null?"--:--":r.toTimeString().slice(0,5)}toFormattedDateString(){let r=this.parseDateTime(this.timeDateDOS);if(r==null)return"--/--/-- --:--";let t=r.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit"}),n=r.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1});return`${t} ${n}`}toFormattedUTCDateString(){let r=this.parseDateTime(this.timeDateDOS);if(r==null)return"--/--/-- --:--";let t=r.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC"}),n=r.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1,timeZone:"UTC"});return`${t} ${n} UTC`}cmpMethodToString(){switch(this.cmpMethod){case C.STORED:return"Stored";case C.SHRUNK:return"Shrunk";case C.REDUCED1:return"Reduced-1";case C.REDUCED2:return"Reduced-2";case C.REDUCED3:return"Reduced-3";case C.REDUCED4:return"Reduced-4";case C.IMPLODED:return"Imploded";case C.DEFLATED:switch(this.bitFlags&6){case 0:return"Deflate-N";case 2:return"Deflate-M";case 4:return"Deflate-F";case 6:return"Deflate-S"}case C.ENHANCED_DEFLATE:return"Deflate-Enh";case C.IBM_TERSE:return"PKDCL-LZ77";case C.ZSTD:return"Zstandard";case C.AES_ENCRYPT:return this.aesStrength===3?"AES-256":this.aesStrength===2?"AES-192":this.aesStrength===1?"AES-128":"AES";default:return"Unknown"}}fileSystemToString(){switch(this.verMadeBy>>8){case H.MSDOS:return"MS-DOS";case H.AMIGA:return"Amiga";case H.OPENVMS:return"OpenVMS";case H.UNIX:return"Unix";case H.VM_CMS:return"VM/CMS";case H.ATARI:return"Atari ST";case H.OS2:return"OS/2 HPFS";case H.MAC:return"Macintosh";case H.CP_M:return"CP/M";case H.NTFS:return"Windows NTFS";case H.MVS:return"MVS (OS/390 - Z/OS)";case H.VSE:return"VSE";case H.ACORN:return"Acorn Risc";case H.ALTMVS:return"Alternate MVS";case H.BEOS:return"BeOS";case H.TANDEM:return"Tandem";case H.OS400:return"OS/400";case H.DARWIN:return"Apple OS/X (Darwin)";default:return"Unknown"}}compressionMethodCodeToString(r){if(r<0)return"Not set";switch(r){case C.STORED:return"Stored (0)";case C.DEFLATED:return"Deflated (8)";case C.ZSTD:return"Zstandard (93)";case C.BZIP2:return"BZIP2 (12)";case C.LZMA:return"LZMA (14)";case C.AES_ENCRYPT:return"AES wrapper (99)";default:return`code ${r}`}}logEncryptionDetails(){let r=(this.bitFlags&V.ENCRYPTED)!==0,t=(this.bitFlags&V.STRONG_ENCRYPT)!==0;w.log("Encryption (detailed): "),w.log(" GP flags: ",`bit0 encrypted=${r}, bit6 strong_encrypt=${t}`);let n=this.cmpMethod===C.AES_ENCRYPT&&this.aesVersion>0,i=!n&&this.neoCryptoAlgorithm>0;if(n){w.log(" Scheme: ",'WinZip AES (ZIP compression method 99 + extra 0x9901, vendor "AE")'),w.log(" AE variant: ",this.aesVersion===2?"AE-2 \u2014 CRC-32 in local/CEN headers is 0; plaintext integrity from HMAC-SHA1":"AE-1 \u2014 CRC-32 in headers is plaintext (uncompressed) CRC-32");let o=this.aesStrength===3?"AES-256 (extra field strength byte 3)":this.aesStrength===2?"AES-192 (2)":this.aesStrength===1?"AES-128 (1)":`Unknown (${this.aesStrength})`;w.log(" Key size: ",o),w.log(" Real compression (inside ciphertext): ",this.compressionMethodCodeToString(this.realCmpMethod)),w.log(' "Compressed size" in headers: ',"Length of full AES file data: salt + password verifier + ciphertext + 10-byte HMAC"),w.log(" Payload layout: ",`${Ie} byte salt + ${tt} byte verifier + encrypted(compressed) data + ${Be} byte HMAC (PBKDF2-HMAC-SHA1, WinZip AES-CTR)`),w.log(" Version needed to extract (from entry): ",`${this.verExtract}${this.verExtract===Ja?" (5.1 \u2014 typical for AES)":""}`),t?w.log(" Note: ","Strong-encrypt bit set \u2014 unusual for pure WinZip AES; confirm with extra fields."):w.log(" Typical WinZip AES: ","bit 6 (strong) usually clear; bit 0 (encrypted) set.")}else i?(w.log(" Scheme: ","NeoEncrypt (GP encrypted + NEO extra 0x024E; standard ZIP compression method in header)"),w.log(" NEO payload version / algorithm / flags: ",`${this.neoCryptoPayloadVersion} / ${this.neoCryptoAlgorithm} / ${this.neoCryptoFlags}`),w.log(" Compression after decrypt: ",this.compressionMethodCodeToString(this.cmpMethod)),w.log(" Ciphertext layout: ",`Same as WinZip AES-256 stream: ${Ie} byte salt + ${tt} byte verifier + encrypted(compressed) + ${Be} byte HMAC`),w.log(" CRC in headers: ","Plaintext CRC (AE-1 style) for algorithm 1")):r?(t?w.log(" Scheme: ","PKWARE strong encryption (GP bit 6) \u2014 not WinZip method 99; expect extras e.g. 0x0017"):w.log(" Scheme: ","Encrypted (bit 0) \u2014 typically legacy ZipCrypto if method \u2260 99"),w.log(" Compression method in header: ",`${this.cmpMethodToString()} (${this.cmpMethod})`)):w.log(" Scheme: ","Not encrypted")}dosAttributesToString(){let r=this.extFileAttr&65535;if(r===0)return"none";let t="";return t+=r&it.READONLY?"r":"-",t+=r&it.HIDDEN?"h":"-",t+=r&it.SYSTEM?"s":"-",t+=r&it.DIRECTORY?"d":"-",t+=r&it.ARCHIVE?"a":"-",t}showVerboseInfo(){if(w.log("=== Central Directory Entry (%s) ===",this.filename),w.log("unzip from start of archive: ",this.localHdrOffset),w.log("File system or operating system of origin: ",this.fileSystemToString()),w.log("Version of encoding software: ",this.verMadeBy),w.log("Compression Method: ",this.cmpMethodToString()),w.log("File Security Status: ",this.bitFlags&V.ENCRYPTED?this.bitFlags&V.STRONG_ENCRYPT?"Strong Encrypt":"Encrypted":"Not Encrypted"),this.logEncryptionDetails(),w.log("File Modified (DOS date/time) ",this.toFormattedDateString()),w.log("File Modified (UTC) ",this.toFormattedUTCDateString()),w.log("Compressed Size: ",this.compressedSize),w.log("UnCompressed Size: ",this.uncompressedSize),w.log(`32-bit CRC value (hex): ${this.crc.toString(16).padStart(8,"0")}`),w.log("Length of extra field: ",this.extraField?.length??0),w.log("Length of file comment: ",this.comment?.length??0),w.log("Unix File Attributes: "),w.log("MS-DOS File Attributes: ",this.dosAttributesToString()),this.extraField){w.log(`
7
+ The Central-Directory Extra Field contains:`);try{for(let r=0;r<this.extraField.length;){if(r+4>this.extraField.length){w.log(` Warning: Truncated extra field at offset ${r}`);break}let t=this.extraField.readUInt16LE(r),n=t.toString(16).padStart(4,"0"),i=this.extraField.readUInt16LE(r+2);if(i<0||r+4+i>this.extraField.length){w.log(` Warning: Invalid extra field length (${i}) at offset ${r} for ID ${n}`);break}let o=this.extraField.subarray(r+4,r+4+i);try{if(t===v.SHA256)w.log(` ID[0x${n}] NeoZip-SHA256: ${o.toString("hex")}`);else if(t===v.UNV_TIME)if(i>=5){let a=o.readUInt8(0),s=o.readUInt32LE(1),c=new Date(s*1e3);w.log(` ID[0x${n}] Universal Time: flags=${a}, time=${c.toISOString()}`)}else w.log(` ID[0x${n}] Universal Time: (invalid length ${i})`);else if(t===v.UID_GID)if(i>=5){let a=o.readUInt8(0),s=o.readUInt8(1);if(2+s>i)w.log(` ID[0x${n}] Unix UID/GID: (invalid UID size ${s})`);else{let c=o.readUIntLE(2,Math.min(s,4)),f=0;if(2+s+1<i){let l=o.readUInt8(2+s);2+s+1+l<=i&&(f=o.readUIntLE(2+s+1,Math.min(l,4)))}w.log(` ID[0x${n}] Unix UID/GID: version=${a}, uid=${c}, gid=${f}`)}}else w.log(` ID[0x${n}] Unix UID/GID: (invalid length ${i})`);else if(t===v.SYMLINK)if(i>=3){let a=o.readUInt8(0),s=o.readUInt16LE(1);if(s>0&&i>=3+s){let c=o.subarray(3,3+s).toString("utf8");w.log(` ID[0x${n}] Symbolic Link: version=${a}, target="${c}"`)}else w.log(` ID[0x${n}] Symbolic Link: (invalid target length ${s})`)}else w.log(` ID[0x${n}] Symbolic Link: (invalid length ${i})`);else if(t===v.HARDLINK)if(i>=11){let a=o.readUInt8(0),s=o.readUInt32LE(1),c=o.readUInt16LE(5);if(c>0&&i>=7+c){let f=o.subarray(7,7+c).toString("utf8");w.log(` ID[0x${n}] Hard Link: version=${a}, inode=${s}, original="${f}"`)}else w.log(` ID[0x${n}] Hard Link: (invalid original length ${c})`)}else w.log(` ID[0x${n}] Hard Link: (invalid length ${i})`);else if(t===v.UNICODE_PATH)if(i>=5){let a=o.readUInt8(0),s=o.readUInt32LE(1),c=o.subarray(5).toString("utf8"),f=Buffer.from(this.filename),l=ae(f),d=s===l?"MATCH":"MISMATCH";w.log(` ID[0x${n}] Unicode Path: version=${a}, CRC32=${s.toString(16)} (${d})`),w.log(` Path: "${c}"`)}else w.log(` ID[0x${n}] Unicode Path: (invalid length ${i})`);else if(t===v.AES)if(i>=7){let a=o.readUInt16LE(0),s=String.fromCharCode(o[2],o[3]),c=o.readUInt8(4),f=o.readUInt16LE(5),l=c===3?"256-bit":c===2?"192-bit":c===1?"128-bit":"Unknown",d=a===2?"AE-2 (CRC=0 in headers)":a===1?"AE-1 (plaintext CRC in headers)":`vendorVer=${a}`;w.log(` ID[0x${n}] WinZip AES: ${d}, vendor="${s}", strength=${l}, realCompressionMethod=${f}`)}else w.log(` ID[0x${n}] WinZip AES: (invalid length ${i})`);else if(t===v.NEO_CRYPTO)if(i>=ge)if(o[0]===G[0]&&o[1]===G[1]&&o[2]===G[2]&&o[3]===G[3]){let a=o.readUInt8(4),s=o.readUInt16LE(5),c=o.readUInt16LE(7);w.log(` ID[0x${n}] NeoEncrypt: payloadVer=${a}, algorithm=${s}, flags=${c}`)}else w.log(` ID[0x${n}] NeoEncrypt: (invalid magic)`);else w.log(` ID[0x${n}] NeoEncrypt: (invalid length ${i})`);else if(t===v.ZIP64)if(w.log(` ID[0x${n}] ZIP64 Extended Information:`),i>=8){let a=0;if(a+8<=i){let s=o.readBigUInt64LE(a);w.log(` Uncompressed Size (ZIP64): ${s.toString()} bytes`),a+=8}if(a+8<=i){let s=o.readBigUInt64LE(a);w.log(` Compressed Size (ZIP64): ${s.toString()} bytes`),a+=8}if(a+8<=i){let s=o.readBigUInt64LE(a);w.log(` Local Header Offset (ZIP64): ${s.toString()}`),a+=8}if(a+4<=i){let s=o.readUInt32LE(a);w.log(` Disk Number (ZIP64): ${s}`)}}else w.log(` ZIP64 Extended Information: (invalid length ${i})`);else{let a=i>0?o.slice(0,Math.min(16,i)).toString("hex"):"";w.log(` ID[0x${n}] Unknown field: length=${i} bytes${a?", data="+a+"...":""}`)}}catch(a){w.log(` Error parsing extra field ID[0x${n}]: ${a.message}`)}r+=4+i}}catch(r){w.log(` Error parsing extra fields: ${r.message}`)}}w.log(`
8
+ `)}};var kn={version:"1.5.0",releaseDate:"2026-10-25"};var Wt=xa(bi()),xu="This browser does not expose CompressionStream zstd. Use a current Chromium or Safari, or inflate the archive in Node.";function Fi(e){return e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Pi(e){return Wt.Buffer.from(e)}function Qa(){try{return typeof CompressionStream>"u"||typeof DecompressionStream>"u"?!1:(new CompressionStream("zstd"),new DecompressionStream("zstd"),!0)}catch{return!1}}function bu(e){return Math.min(Math.max(1,Math.floor(e*2.1)),19)}function yu(){if(!Qa())throw new Error(xu)}async function es(e,r){yu();let t=r==="compress"?CompressionStream:DecompressionStream,n=new t("zstd"),i=new Uint8Array(e.byteLength);i.set(e);let o=n.writable.getWriter();await o.write(i),await o.close();let a=n.readable.getReader(),s=[],c=0;for(;;){let{done:d,value:h}=await a.read();if(d)break;h&&(s.push(h),c+=h.byteLength)}let f=new Uint8Array(c),l=0;for(let d of s)f.set(d,l),l+=d.byteLength;return f}function wu(e){throw new Error("Browser zstd uses buffer compress(); Node zlib transforms are not available.")}function Su(){throw new Error("Browser zstd uses buffer decompress(); Node zlib transforms are not available.")}async function ts(e,r){return Pi(await es(Fi(e),"compress"))}async function Cn(e){return Pi(await es(Fi(e),"decompress"))}function rs(e,r){throw new Error("Browser zstd compress is async. Use compress().")}function Au(e,r){return rs(e)}function Iu(e){throw new Error("Browser zstd decompress is async. Use decompress().")}function Bu(e){return Pi(Fi(e))}async function Tu(e,r,t,n,i,o){let a=[],s=0;for(;s<r;){let f=Math.min(t,r-s),l=e(s,f);a.push(Wt.Buffer.from(l)),s+=l.length}let c=await ts(Wt.Buffer.concat(a),n);return o&&await o(c),c.length}async function*Du(e){let r=[];for await(let t of e)r.push(Wt.Buffer.from(t));yield await Cn(Wt.Buffer.concat(r))}var Br={isNativeZstdAvailable:Qa,mapCompressionLevel:bu,createCompressTransform:wu,createDecompressTransform:Su,compress:ts,decompress:Cn,compressSync:rs,compressSyncAtLevel:Au,decompressSync:Iu,asZstdBuffer:Bu,compressChunks:Tu,decompressStream:Du};var de=class e{constructor(r){this.crc32State=-1;this.sha256Hash=null;this.merkleLeafHash=null;this.useSHA256=!1;this.hashes=[];this.xorResult=Buffer.alloc(32,0);this.enableAccumulation=!1;this.merkleLeaves=[];this.merkleLayers=[];this.merkleOptions={hashLeaves:!1,sortLeaves:!1,sortPairs:!1,duplicateOdd:!0};this.useSHA256=r?.useSHA256||!1,this.enableAccumulation=r?.enableAccumulation||!1,this.useSHA256&&(this.sha256Hash=De("sha256"),this.merkleLeafHash=De("sha256"),this.merkleLeafHash.update(Buffer.from([0])))}update(r){for(let t=0;t<r.length;t++)this.crc32State=Bn(this.crc32State,r[t]);this.sha256Hash&&this.sha256Hash.update(r),this.merkleLeafHash&&this.merkleLeafHash.update(r)}finalizeCRC32(){return~this.crc32State>>>0}finalizeSHA256(){return this.sha256Hash?this.sha256Hash.digest("hex"):null}finalizeMerkleLeafV1(){return this.merkleLeafHash?this.merkleLeafHash.digest("hex"):null}applyToEntry(r,t){if(t.setCrc&&(r.crc=this.finalizeCRC32()),t.setSha256){let n=this.finalizeSHA256(),i=this.finalizeMerkleLeafV1();n&&(r.sha256=n),i&&(r.merkleLeafV1=i)}}reset(){this.crc32State=-1,this.useSHA256&&(this.sha256Hash=De("sha256"),this.merkleLeafHash=De("sha256"),this.merkleLeafHash.update(Buffer.from([0])))}addHash(r){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");let t=typeof r=="string"?Buffer.from(r,"hex"):r;this.hashes.push(t),this.merkleLeaves.push(t);for(let n=0;n<32;n++)this.xorResult[n]^=t[n];this.rebuildMerkleTree()}xorHash(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");return this.xorResult.toString("hex")}merkleRoot(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");if(this.merkleLeaves.length===0)return null;this.merkleLayers.length===0&&this.rebuildMerkleTree();let r=this.merkleLayers[this.merkleLayers.length-1];return r&&r.length>0?r[0].toString("hex"):null}leafCount(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");return this.hashes.length}clear(){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");this.hashes=[],this.merkleLeaves=[],this.merkleLayers=[],this.xorResult=Buffer.alloc(32,0)}static combineResults(r){let t=new e({enableAccumulation:!0});for(let n of r)n.merkleRoot&&t.addHash(n.merkleRoot);return t.merkleRoot()}hash(r){return De("sha256").update(r).digest()}combinedHash(r,t){return this.merkleOptions.sortPairs&&Buffer.compare(r,t)>0&&([r,t]=[t,r]),this.hash(Buffer.concat([r,t]))}createHashes(r){for(;r.length>1;){let t=this.merkleLayers.length;this.merkleLayers.push([]);for(let n=0;n<r.length-1;n+=2){let i=r[n],o=r[n+1],a=this.combinedHash(i,o);this.merkleLayers[t].push(a)}if(r.length%2===1){let n=r[r.length-1];if(this.merkleOptions.duplicateOdd){let i=this.combinedHash(n,n);this.merkleLayers[t].push(i)}else this.merkleLayers[t].push(n)}r=this.merkleLayers[t]}}rebuildMerkleTree(){if(this.merkleLeaves.length===0){this.merkleLayers=[];return}let r=this.merkleLeaves.map(t=>this.merkleOptions.hashLeaves?this.hash(t):Buffer.isBuffer(t)?t:Buffer.from(t));this.merkleOptions.sortLeaves&&r.sort(Buffer.compare),this.merkleLayers=[r],this.createHashes(r)}getProof(r){if(!this.enableAccumulation)throw new Error("Hash accumulation not enabled. Set enableAccumulation: true in constructor.");this.merkleLayers.length===0&&this.rebuildMerkleTree();let t=this.merkleLeaves.findIndex(n=>n.equals(r));if(t===-1)throw new Error("Leaf not found in tree");return this.merkleLayers.reduce((n,i)=>{if(i.length===1)return n;let o=t%2===0?t+1:t-1;return o<i.length&&n.push(i[o]),t=Math.floor(t/2),n},[])}verify(r,t,n){let i=t;for(let o of r)i=Buffer.compare(i,o)<=0?this.combinedHash(i,o):this.combinedHash(o,i);return i.equals(n)}},ns=de;var Lu=2*wt+tt,ku=1e3,Hi=16,vn=class e{constructor(r){this.aesKey=r,this.counter=Buffer.alloc(Hi),this.counter[0]=1,this.keystream=this.encryptCounter(),this.ksPos=0}process(r){if(r.length===0)return Buffer.alloc(0);let t=Buffer.alloc(r.length);for(let n=0;n<r.length;n++)this.ksPos>=Hi&&(e.incrementCounterLE(this.counter),this.keystream=this.encryptCounter(),this.ksPos=0),t[n]=r[n]^this.keystream[this.ksPos++];return t}encryptCounter(){let r=Ya("aes-256-ecb",this.aesKey,null);return r.setAutoPadding(!1),r.update(this.counter)}static incrementCounterLE(r){for(let t=0;t<Hi;t++)if(r[t]===255)r[t]=0;else{r[t]++;break}}},$i=class{constructor(r){this.headerSent=!1;this.finished=!1;this.salt=In(Ie),this.keys=be.deriveKeys(r,this.salt),this.ctr=new vn(this.keys.aesKey),this.hmac=Ti("sha1",this.keys.hmacKey)}header(){if(this.finished)throw new Error("AesEncryptor already finished");return this.headerSent=!0,Buffer.concat([this.salt,this.keys.passwordVerifier])}update(r){if(this.finished)throw new Error("AesEncryptor already finished");if(!this.headerSent)throw new Error("AesEncryptor.header() must be called before update()");if(r.length===0)return Buffer.alloc(0);let t=this.ctr.process(r);return this.hmac.update(t),t}finish(){if(this.finished)throw new Error("AesEncryptor already finished");if(!this.headerSent)throw new Error("AesEncryptor.header() must be called before finish()");return this.finished=!0,this.hmac.digest().subarray(0,Be)}},Vi=class{constructor(r,t){this.keys=null;this.ctr=null;this.hmac=null;this.headerBuf=Buffer.alloc(0);this.authBuf=Buffer.alloc(0);this.headerDone=!1;this.verified=!1;if(t<Sn)throw new Error("AES decryption failed: payload too short");this.password=r,this.cipherLen=t-Sn,this.remainingCipher=this.cipherLen}push(r){let t=r;if(!this.headerDone){this.headerBuf=Buffer.concat([this.headerBuf,t]);let s=Ie+tt;if(this.headerBuf.length<s)return Buffer.alloc(0);let c=this.headerBuf.subarray(0,Ie),f=this.headerBuf.subarray(Ie,s);if(this.keys=be.deriveKeys(this.password,c),!this.keys.passwordVerifier.equals(f))throw new Error("AES decryption failed: wrong password");this.ctr=new vn(this.keys.aesKey),this.hmac=Ti("sha1",this.keys.hmacKey),this.headerDone=!0,t=this.headerBuf.subarray(s),this.headerBuf=Buffer.alloc(0)}if(t.length===0)return Buffer.alloc(0);let n=Math.min(t.length,this.remainingCipher),i=t.subarray(0,n),o=t.subarray(n);if(o.length>0&&(this.authBuf=Buffer.concat([this.authBuf,o])),i.length===0)return this.tryVerify(),Buffer.alloc(0);this.hmac.update(i);let a=this.ctr.process(i);return this.remainingCipher-=i.length,this.tryVerify(),a}end(){if(this.remainingCipher>0)throw new Error("AES decryption failed: truncated ciphertext");if(this.tryVerify(),!this.verified)throw new Error("AES decryption failed: missing authentication code")}tryVerify(){if(this.verified||this.remainingCipher>0||!this.hmac||this.authBuf.length<Be)return;let r=this.authBuf.subarray(0,Be);if(!this.hmac.digest().subarray(0,Be).equals(r))throw new Error("AES decryption failed: authentication code mismatch (data corrupted or tampered)");this.verified=!0}},be=class e{static deriveKeys(r,t){let n=Buffer.isBuffer(r)?r:Buffer.from(r),i=Va(n,t,ku,Lu,"sha1");return{aesKey:i.subarray(0,wt),hmacKey:i.subarray(wt,2*wt),passwordVerifier:i.subarray(2*wt)}}static createEncryptor(r){return new $i(r)}static createDecryptor(r,t){return new Vi(r,t)}static encryptBuffer(r,t,n){let i=e.createEncryptor(n),o=[i.header()];return t.length>0&&o.push(i.update(t)),o.push(i.finish()),Buffer.concat(o)}static decryptBuffer(r,t,n){let i=e.createDecryptor(n,t.length),o=i.push(t);return i.end(),o}static async*decryptStream(r,t,n){let i=e.createDecryptor(r,t);for await(let o of n){let a=i.push(o);a.length>0&&(yield a)}i.end()}static buildAesExtraField(r,t=1){let n=Buffer.alloc(rt);return n.writeUInt16LE(v.AES,0),n.writeUInt16LE(7,2),n.writeUInt16LE(t,4),n.writeUInt16LE(17729,6),n.writeUInt8(3,8),n.writeUInt16LE(r,9),n}static parseAesExtraField(r){return{vendorVersion:r.readUInt16LE(0),vendorId:String.fromCharCode(r[2],r[3]),encryptionStrength:r.readUInt8(4),realCmpMethod:r.readUInt16LE(5)}}};var Rn=1,On=class e{static buildPayloadV1(r=Rn,t=0,n=0){let i=Buffer.alloc(ge);for(let o=0;o<4;o++)i[o]=G[o];return i.writeUInt8(1,4),i.writeUInt16LE(r,5),i.writeUInt16LE(t,7),i.writeUInt16LE(n,9),i}static buildExtraFieldRecordV1(r=Rn,t=0,n=0){let i=Buffer.alloc(nt);return i.writeUInt16LE(v.NEO_CRYPTO,0),i.writeUInt16LE(ge,2),e.buildPayloadV1(r,t,n).copy(i,4),i}static tryParsePayload(r){return r.length<ge||r[0]!==G[0]||r[1]!==G[1]||r[2]!==G[2]||r[3]!==G[3]?null:{payloadVersion:r.readUInt8(4),algorithm:r.readUInt16LE(5),flags:r.readUInt16LE(7),reserved:r.readUInt16LE(9)}}static parsePayload(r){let t=e.tryParsePayload(r);if(!t||t.payloadVersion!==1)throw new Error("NeoEncrypt: invalid NEO crypto extra field");return t}static encryptBuffer(r,t,n){return be.encryptBuffer(r,t,n)}static decryptBuffer(r,t,n){return be.decryptBuffer(r,t,n)}};var Mf=Oo(),Hr=class Hr{log(...r){Hr.loggingEnabled&&w.debug("[ZipCompress]",...r)}constructor(r){this.zipkit=r,this.debug=!1,Hr.loggingEnabled&&w.setLevel("debug"),this.log("ZipCompress initialized")}async compressData(r,t,n,i){this.log(`compressData() called for entry: ${r.filename}`),(!r.uncompressedSize||r.uncompressedSize===0)&&(r.uncompressedSize=t.length);let o=t.length,a=n?.bufferSize||this.zipkit.getBufferSize();this.log(`Compressing ${o} bytes for entry: ${r.filename}`),this.log("Compression options:",{level:n?.level,useZstd:n?.useZstd,bufferSize:a});let s;n?.level===0?(s=C.STORED,this.log("Using STORED method (no compression)")):n?.useZstd?o<100?(s=C.STORED,this.log(`ZSTD fallback to STORED (file too small: ${o} bytes)`)):(s=C.ZSTD,this.log("Using ZSTD method (zstd compression)")):(s=C.DEFLATED,this.log("Using DEFLATED method (default compression)")),r.cmpMethod=s;let f=!r.crc||r.crc===0||n?.useSHA256&&!r.sha256?new de({useSHA256:n?.useSHA256&&!r.sha256||!1}):null;f&&(f.update(t),f.applyToEntry(r,{setCrc:!r.crc||r.crc===0,setSha256:!!(n?.useSHA256&&!r.sha256)}),this.log(`Final hashes: CRC32=0x${r.crc.toString(16).padStart(8,"0")}, SHA256=${r.sha256||"N/A"}`));let l=n?.encryptionMethod,d=l==="zipcrypto",h=l==="aes256",u=!!n?.password&&!d&&!h;if(n?.password){let E=d?"ZipCrypto":u?"NeoEncrypt (AES-256)":"WinZip AES-256";this.log(`Encrypting compressed data for entry: ${r.filename} (method: ${E})`),r.bitFlags=(r.bitFlags||0)|V.ENCRYPTED,r.isEncrypted=!0}let p,b=s===C.ZSTD?"ZSTD":s===C.DEFLATED?"DEFLATED":"STORED";return s===C.STORED?p=t:(this.log(`Processing sequence for ${b}: [HASH] -> [COMPRESS] -> [OUTPUT]`),this.log(`Compressing: method=${b}, input=${o} bytes, buffer size=${a} bytes`),this.log(`Calculating hashes: CRC32=${!r.crc||r.crc===0}, SHA256=${n?.useSHA256}`),s===C.ZSTD?p=await this.zstdCompress(t,n,a,r,i):p=await this.deflateCompress(t,n,a,r,i)),n?.password&&(u?p=this.encryptCompressedDataNeo(r,p,n.password):h?p=this.encryptCompressedDataAes(r,p,n.password):p=this.encryptCompressedData(r,p,n.password)),r.compressedSize=p.length,p}async deflateCompress(r,t,n,i,o){this.log(`deflateCompress() called - entry: ${i?.filename??"unknown"}, bufferSize: ${n}, level: ${t?.level??6}`);let a=n||this.zipkit.getBufferSize(),s=t?.level??6;if(typeof r=="object"&&"totalSize"in r&&"onReadChunk"in r)throw new Error("Chunked reader mode not supported in ZipCompress");if(r.length<=a)return this.deflate(r,t);let c=new Mf.Deflate({level:s,raw:!0}),f=[],l=0,d=0;try{for(let u=0;u<r.length;u+=a){let p=r.slice(u,u+a),b=u+a>=r.length;if(c.push(p,b),c.result&&c.result.length>0){let E=Buffer.from(c.result);f.push(E),d+=E.length,o&&await o(E)}l+=p.length}let h=l>0?Math.round(d/l*100):0;return this.log(`Final hashes: CRC32=0x${i?.crc?.toString(16).padStart(8,"0")}, SHA256=${i?.sha256||"N/A"}`),this.log(`Deflate compression complete: ${d} bytes from ${l} bytes (ratio=${h}%)`),Buffer.concat(f)}catch(h){throw new Error(`Deflate compression failed: ${h instanceof Error?h.message:String(h)}`)}}deflate(r,t){this.log(`deflate() called with buffer size: ${r.length}, level: ${t?.level??6}`);let n=t?.level??6,i=Mf.deflateRaw(r,{level:n}),o=r.length>0?Math.round(i.length/r.length*100):0;return this.log(`Deflate compression complete: ${i.length} bytes from ${r.length} bytes (ratio=${o}%)`),Buffer.from(i.buffer,i.byteOffset,i.byteLength)}async zstdCompress(r,t,n,i,o){this.log(`zstdCompress() called - entry: ${i?.filename??"unknown"}, bufferSize: ${n}, level: ${t?.level??6}`);let a=n||this.zipkit.getBufferSize(),s=t?.level??6,c=Buffer.isBuffer(r),f=c?r.length:r.totalSize;if(!f)throw new Error("ZSTD compression: empty input buffer");if(t?.level===0){if(c)return o&&await o(r),r;let u=[],p=0;for(;p<f;){let b=Math.min(a,f-p),E=r.readChunk(p,b);o?await o(E):u.push(E),p+=E.length}return o?Buffer.alloc(0):Buffer.concat(u)}let l=c?(u,p)=>r.subarray(u,u+p):r.readChunk.bind(r),d=[],h=await Br.compressChunks(l,f,a,s,void 0,async u=>{o?await o(u):d.push(u)});return i&&(i.compressedSize=h),o?Buffer.alloc(0):Buffer.concat(d)}encryptCompressedData(r,t,n){this.log(`encryptCompressedData() called for entry: ${r.filename}, compressed size: ${t.length}`);let o=new he().encryptBuffer(r,t,n);return this.log(`Encryption complete: ${t.length} bytes compressed -> ${o.length} bytes encrypted (includes ${et}-byte header)`),o}encryptCompressedDataNeo(r,t,n){this.log(`encryptCompressedDataNeo() called for entry: ${r.filename}, compressed size: ${t.length}`);let i=On.encryptBuffer(r,t,n);return r.neoCryptoPayloadVersion=1,r.neoCryptoAlgorithm=Rn,r.neoCryptoFlags=0,this.log(`NeoEncrypt encryption complete: ${t.length} bytes -> ${i.length} bytes`),i}encryptCompressedDataAes(r,t,n){this.log(`encryptCompressedDataAes() called for entry: ${r.filename}, compressed size: ${t.length}`);let i=be.encryptBuffer(r,t,n);return r.realCmpMethod=r.cmpMethod,r.cmpMethod=C.AES_ENCRYPT,r.aesVersion=1,r.aesStrength=3,this.log(`AES-256 encryption complete: ${t.length} bytes -> ${i.length} bytes (salt+verifier+data+hmac)`),i}async compressFileBuffer(r,t,n){this.log(`compressFileBuffer() called for entry: ${r.filename}, size: ${t.length}`),r.uncompressedSize=t.length;let i=new de({useSHA256:n?.useSHA256||!1});return i.update(t),i.applyToEntry(r,{setCrc:!0,setSha256:!!n?.useSHA256}),r.sha256&&this.log(`SHA-256 calculated: ${r.sha256}`),await this.compressData(r,t,n)}};Hr.loggingEnabled=!1;var sr=Hr;var Ff=18,am=Buffer.from([40,181,47,253]);function Pf(e){let r=new de;return r.update(e),r.finalizeCRC32()}function Hf(e,r,t){let n=r>>>0;if(e.length===n+Ff&&e.subarray(n).equals(Buffer.alloc(Ff))){let i=e.subarray(0,n);return t!==void 0&&t!==0&&Pf(i)!==t>>>0?{repaired:e,wasLegacy:!1}:{repaired:i,wasLegacy:!0}}if(e.length>n&&n>0){let i=e.subarray(0,n);if(t!==void 0&&t!==0&&Pf(i)===t>>>0)return{repaired:i,wasLegacy:!0}}return{repaired:e,wasLegacy:!1}}var v0=Oo(),$r=class $r{log(...r){$r.loggingEnabled&&w.debug("[ZipDecompress]",...r)}constructor(r){this.zipkit=r,this.debug=!1,$r.loggingEnabled&&w.setLevel("debug")}async extract(r,t){if(!this.zipkit.hasInBuffer())throw new Error("extract() requires Buffer-based ZIP. Use ZipkitNode.extractToFile() for file-based ZIP or call loadZip() first.");this.log(`extract() called for entry: ${r.filename}, method: ${r.cmpMethod}, skipHashCheck: ${t}`);let n=this.zipkit.ensureBuffer(),i=this.zipkit.parseLocalHeader(r,n),o=this.zipkit?.password,a=r.aesVersion>0||r.cmpMethod===C.AES_ENCRYPT,s=r.neoCryptoAlgorithm>0;if(r.isEncrypted&&o&&(this.log(`Starting in-memory decryption for entry: ${r.filename} (${a||s?"AES-256 stream (WinZip or Neo)":"ZipCrypto"})`),a||s?i=be.decryptBuffer(r,i,o):i=new he().decryptBuffer(r,n,i,o),this.log(`Decryption successful, decrypted compressed data length: ${i.length}`)),i.length===0)return null;let c=a&&r.aesVersion===2?!0:t;return this.unCompress(i,r,c)}inflate(r){this.log(`inflate() called with ${r.length} bytes`);let t=v0.inflateRaw(r);return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}async zstdDecompressSync(r,t){this.log(`zstdDecompressSync() called with ${r.length} bytes`);try{let n=await Br.decompress(r);if(t&&t.uncompressedSize>0){let{repaired:i,wasLegacy:o}=Hf(n,t.uncompressedSize,t.crc);o&&this.log(`Legacy WASM zstd padding repaired: ${n.length} -> ${i.length} bytes`),n=i}return this.log(`ZSTD decompression successful: ${r.length} bytes -> ${n.length} bytes`),n}catch(n){throw this.log(`ZSTD decompression failed: ${n}`),new Error(`ZSTD decompression failed: ${n instanceof Error?n.message:String(n)}`)}}async unCompress(r,t,n){let i=t.cmpMethod===C.AES_ENCRYPT&&t.realCmpMethod>=0?t.realCmpMethod:t.cmpMethod;if(this.log(`unCompress() called for entry: ${t.filename}, method: ${i}, data length: ${r.length}`),r.length===0)return Buffer.alloc(0);let o;if(i===C.STORED)o=r;else if(i===C.DEFLATED)o=this.inflate(r);else if(i===C.ZSTD)o=await this.zstdDecompressSync(r,t);else throw new Error(`Unsupported compression method: ${i}`);let a=new de({useSHA256:!0});a.update(o);let s=a.finalizeCRC32(),c=a.finalizeSHA256(),f=a.finalizeMerkleLeafV1();if(f&&(t.merkleLeafV1=f),!n){if(t.sha256){if(c!==t.sha256)throw new Error(M.INVALID_SHA256)}else if(s!==t.crc)throw new Error(M.INVALID_CRC)}return o}};$r.loggingEnabled=!1;var Uo=$r,$f=Uo;var R0=Buffer.from([0]),O0=Buffer.from([1]);function Vr(e){let r=De("sha256");if(Array.isArray(e))for(let t of e)r.update(t);else r.update(e);return r.digest()}function Yr(e,r){return typeof e=="string"?Buffer.from(e,r??"hex"):Buffer.isBuffer(e)?e:Buffer.from(e)}function Vf(e){let r=e.replace(/\\/g,"/");for(r.startsWith("./")&&(r=r.slice(2));r.startsWith("/");)r=r.slice(1);return typeof r.normalize=="function"&&(r=r.normalize("NFC")),r}function U0(e,r){let t=r==="v1"?Vf(e):e;return Buffer.from(t,"utf8")}function Yf(e){return Vr(Yr(e))}function N0(e,r=!1){let t=Yr(e);return r?t:Vr(t)}function Kr(e){return Vr([R0,Yr(e)])}function No(e,r,t){return Vr(t==="v1"?[O0,e,r]:[e,r])}function Kf(e,r){if(e.length===0)return null;let t=e.map(n=>Buffer.from(n));for(;t.length>1;){let n=[];for(let i=0;i+1<t.length;i+=2)n.push(No(t[i],t[i+1],r));if(t.length%2===1){let i=t[t.length-1];r==="v0"?n.push(No(i,i,r)):n.push(i)}t=n}return t[0].toString("hex")}function Z0(e,r){if(r==="v0"){if(e.contentSha256){let t=Yr(e.contentSha256,typeof e.contentSha256=="string"?"hex":void 0);return t.length!==32?null:t}return e.content?Yf(e.content):null}if(e.merkleLeafV1){let t=Yr(e.merkleLeafV1,typeof e.merkleLeafV1=="string"?"hex":void 0);return t.length!==32?null:t}return e.content?Kr(e.content):null}function _t(e,r="v1"){let t=[];for(let n of e){if(Q(n.path||""))continue;let i=Z0(n,r);i&&t.push({key:U0(n.path||"",r),leaf:i})}return t.length===0?null:(t.sort((n,i)=>Buffer.compare(n.key,i.key)),Kf(t.map(n=>n.leaf),r))}function Gn(e){return _t(e.map(r=>({path:r.path,contentSha256:r.sha256})),"v0")}function z0(e){return _t(e.map(r=>({path:r.path,content:r.content})),"v1")}function Gr(e){return _t(e.map(r=>({path:r.path,merkleLeafV1:r.merkleLeafV1})),"v1")}function M0(e,r){let t=r.toLowerCase().replace(/^0x/,"");if(!/^[0-9a-f]{64}$/.test(t))return null;let n=e.some(o=>!Q(o.path||"")&&(!!o.merkleLeafV1||!!o.content));if(n){let o=_t(e,"v1");if(o&&o===t)return{algorithm:"v1",security:"high"}}let i=_t(e,"v0");return i&&i===t?{algorithm:"v0",security:"legacy"}:null}var kt=class{constructor(r={}){this.inBuffer=null;this.zipEntries=[];this.centralDirSize=0;this.centralDirOffset=0;this.zipComment=null;this._zipkitCmp=null;this._zipkitDeCmp=null;this.config={bufferSize:r.bufferSize||512*1024,debug:r.debug||!1},this.config.debug&&w.setLevel("debug")}getZipCompress(){return this._zipkitCmp||(this._zipkitCmp=new sr(this)),this._zipkitCmp}getZipDecompress(){return this._zipkitDeCmp||(this._zipkitDeCmp=new $f(this)),this._zipkitDeCmp}getBufferSize(){return this.config.bufferSize||512*1024}hasInBuffer(){return this.inBuffer!==null&&this.inBuffer.length>0}async compressData(r,t,n,i){return this.getZipCompress().compressData(r,t,n,i)}async deflateCompress(r,t,n,i,o){return this.getZipCompress().deflateCompress(r,t,n,i,o)}deflate(r,t){return this.getZipCompress().deflate(r,t)}async zstdCompress(r,t,n,i,o){return this.getZipCompress().zstdCompress(r,t,n,i,o)}async compressFileBuffer(r,t,n){return this.getZipCompress().compressFileBuffer(r,t,n)}async extract(r,t){return this.getZipDecompress().extract(r,t)}loadZip(r){this.resetZipData(),this.inBuffer=r,this.loadEOCDFromBuffer(r);let t=this.getDirectoryFromBuffer();return this.zipEntries=t,t}resetZipData(){this.inBuffer=null,this.zipEntries=[],this.reset(),this.zipComment=null,this._zipkitCmp=null,this._zipkitDeCmp=null}getDirectory(r){return this.zipEntries}getZipEntry(r){try{let t=this.getDirectory(),n=t.find(i=>i.filename===r);return n||(wr(r)?Sr(t,r):null)}catch{return null}}ensureBuffer(){return this.inBuffer||(this.inBuffer=Buffer.alloc(0)),this.inBuffer}parseLocalHeader(r,t){let n=t.subarray(r.localHdrOffset);if(n.readUInt32LE(0)!==Z.SIGNATURE)throw new Error(M.INVALID_CEN);let i=n.readUInt16LE(Z.FLAGS),o=n.readUInt16LE(Z.FNAME_LEN),a=n.readUInt16LE(Z.EXTRA_LEN),s=Z.SIZE+o+a,c=r.aesVersion>0||r.cmpMethod===C.AES_ENCRYPT,f=r.neoCryptoAlgorithm>0;if(c||f){let u=s,p=s+r.compressedSize;return n.subarray(u,p)}let l=0;i&V.ENCRYPTED&&(l=et);let d=s+l,h=s+r.compressedSize;return n.subarray(d,h)}testCRC32(r,t){let n=ae(t),i=n===r.crc;return w.debug(`[DEBUG] testCRC32() comparison: calculated=${n}, stored=${r.crc}, isValid=${i?"\u2713":"\u2717"}, DATA_DESC=${(r.bitFlags&8)!==0?"YES":"NO"}`),i}testSHA256(r,t){if(!r.sha256)throw new Error(M.UNKNOWN_SHA256);let n=st(t),i=n===r.sha256;return w.debug(`[DEBUG] testSHA256() comparison: calculated=${n}, stored=${r.sha256}, isValid=${i?"\u2713":"\u2717"}`),i}getMemoryUsage(){let r=this.inBuffer?.length||0,t=this.zipEntries.length*1024,n;return this.inBuffer?n="buffer":n="none",{backend:n,memoryUsage:r+t,entries:this.zipEntries.length}}createZipEntry(r,t,n){let i=new xe(r,null,!1);return t?(i.crc=ae(t),i.uncompressedSize=t.length,i.compressedSize=t.length):(i.crc=0,i.uncompressedSize=0,i.compressedSize=0),i.cmpMethod=C.STORED,i.bitFlags=0,this.zipEntries.push(i),i}async copyEntry(r){if(r.cmpData){let t=r.createLocalHdr();return Buffer.concat([t,r.cmpData])}throw new Error("Cannot copy entry: no compressed data available")}get centralEndHdr(){return(r,t)=>{let n=this.zipEntries.length;return this.centralEndHdrMethod(r,t,n)}}getZipComment(){return this.zipComment}loadEOCDFromBuffer(r){let t=r.length,n=Math.min(65557,t),i=t-n,o=r.subarray(i,i+n),a=-1;for(let f=o.length-22;f>=0;f--)if(o[f]===80&&o.readUInt32LE(f)===X.SIGNATURE){a=i+f;break}if(a===-1)throw new Error(M.INVALID_FORMAT);let s=r.subarray(a,a+22);if(s.readUInt32LE(0)===X.SIGNATURE){this.centralDirSize=s.readUInt32LE(X.CENTRAL_DIR_SIZE),this.centralDirOffset=s.readUInt32LE(X.CENTRAL_DIR_OFFSET);let f=s.readUInt16LE(X.VOL_ENTRIES),l=s.readUInt16LE(X.TOTAL_ENTRIES);if(Ri({volEntries:f,totalEntries:l,centralDirSize:this.centralDirSize,centralDirOffset:this.centralDirOffset})){let d=a-Yt;if(d<0)throw new Error(M.INVALID_FORMAT);let h=r.subarray(d,d+Yt),u=Zi(h),p=r.subarray(u,u+Ar),b=Ni(p);this.centralDirSize=b.centralDirSize,this.centralDirOffset=b.centralDirOffset}}else throw new Error(M.INVALID_FORMAT);let c=s.readUInt16LE(X.ZIP_COMMENT_LEN);if(c>0){let f=a+22;this.zipComment=r.subarray(f,f+c).toString()}}getDirectoryFromBuffer(){if(!this.inBuffer)return[];let r=this.inBuffer,t=[],n=this.centralDirOffset,i=this.centralDirSize,o=this.config.bufferSize||512*1024;for(;i>0;){let a=Math.min(o,i),s=r.subarray(n,n+a),c=0;for(;c<s.length&&s.readUInt32LE(c)===k.SIGNATURE;){let f=new xe(null,null,!1),l=s.subarray(c),d=f.readZipEntry(l);t.push(f),c+=l.length-d.length}n+=a,i-=a}return t}reset(){this.centralDirSize=0,this.centralDirOffset=0}centralEndHdrMethod(r,t,n){return Ir({totalEntries:n,centralDirSize:r,centralDirOffset:t,zip64EocdOffset:t+r,allowSizeOffsetZip64:!1})}getMerkleRoot(r){let t=r?.algorithm??"v1",n;try{n=this.getDirectory()}catch(o){return w.error(`getMerkleRoot(): Error calling getDirectory(): ${o instanceof Error?o.message:String(o)}`),w.error(`getMerkleRoot(): Stack trace: ${o instanceof Error?o.stack:"No stack trace"}`),null}if(!n||n.length===0)return null;let i=n.filter(o=>!Q(o.filename||""));if(t==="v0"){let o=i.filter(a=>a.sha256).map(a=>({path:a.filename||"",sha256:a.sha256}));return Gn(o)}return i.length>0&&i.every(o=>!!o.merkleLeafV1)?Gr(i.map(o=>({path:o.filename||"",merkleLeafV1:o.merkleLeafV1}))):null}async getMerkleRootAsync(r){let t=r?.algorithm??"v1",n=[];try{n=this.getDirectory()}catch(o){return w.error(`Failed to get directory for merkle root calculation: ${o instanceof Error?o.message:String(o)}`),null}if(!n||n.length===0)return null;let i=n.filter(o=>!Q(o.filename||""));if(t==="v0"){let o=i.filter(a=>a.sha256).map(a=>({path:a.filename||"",sha256:a.sha256}));return Gn(o)}if(i.length>0&&i.every(o=>!!o.merkleLeafV1))return Gr(i.map(o=>({path:o.filename||"",merkleLeafV1:o.merkleLeafV1})));if(!this.inBuffer)return w.error("getMerkleRootAsync() called on file-based ZIP without precomputed merkle leaves. Use ZipkitNode (streaming testEntry) or ensure create captured merkleLeafV1."),null;for(let o of i)try{let a=await this.extract(o,!1);if(o.merkleLeafV1)continue;a===null||a.length===0?o.merkleLeafV1=Kr(Buffer.alloc(0)).toString("hex"):o.merkleLeafV1=Kr(a).toString("hex")}catch(a){return w.error(`getMerkleRootAsync(): failed to extract ${o.filename}: ${a instanceof Error?a.message:String(a)}`),null}return i.every(o=>!!o.merkleLeafV1)?Gr(i.map(o=>({path:o.filename||"",merkleLeafV1:o.merkleLeafV1}))):null}static merkleRootFromEntries(r,t="v1"){return _t(r,t)}};kt.version=kn.version,kt.releaseDate=kn.releaseDate;function pr(e){let r=e.length;for(;--r>=0;)e[r]=0}var F0=0,Rl=1,P0=2,H0=3,$0=258,aa=29,fn=256,en=fn+1+aa,cr=30,sa=19,Ol=2*en+1,Ct=15,Zo=16,V0=7,fa=256,Ul=16,Nl=17,Zl=18,jo=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]),Qn=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]),Y0=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),zl=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),K0=512,Je=new Array((en+2)*2);pr(Je);var jr=new Array(cr*2);pr(jr);var tn=new Array(K0);pr(tn);var rn=new Array($0-H0+1);pr(rn);var la=new Array(aa);pr(la);var ei=new Array(cr);pr(ei);function zo(e,r,t,n,i){this.static_tree=e,this.extra_bits=r,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}var Ml,Fl,Pl;function Mo(e,r){this.dyn_tree=e,this.max_code=0,this.stat_desc=r}var Hl=e=>e<256?tn[e]:tn[256+(e>>>7)],nn=(e,r)=>{e.pending_buf[e.pending++]=r&255,e.pending_buf[e.pending++]=r>>>8&255},oe=(e,r,t)=>{e.bi_valid>Zo-t?(e.bi_buf|=r<<e.bi_valid&65535,nn(e,e.bi_buf),e.bi_buf=r>>Zo-e.bi_valid,e.bi_valid+=t-Zo):(e.bi_buf|=r<<e.bi_valid&65535,e.bi_valid+=t)},Fe=(e,r,t)=>{oe(e,t[r*2],t[r*2+1])},$l=(e,r)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--r>0);return t>>>1},G0=e=>{e.bi_valid===16?(nn(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)},X0=(e,r)=>{let t=r.dyn_tree,n=r.max_code,i=r.stat_desc.static_tree,o=r.stat_desc.has_stree,a=r.stat_desc.extra_bits,s=r.stat_desc.extra_base,c=r.stat_desc.max_length,f,l,d,h,u,p,b=0;for(h=0;h<=Ct;h++)e.bl_count[h]=0;for(t[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;f<Ol;f++)l=e.heap[f],h=t[t[l*2+1]*2+1]+1,h>c&&(h=c,b++),t[l*2+1]=h,!(l>n)&&(e.bl_count[h]++,u=0,l>=s&&(u=a[l-s]),p=t[l*2],e.opt_len+=p*(h+u),o&&(e.static_len+=p*(i[l*2+1]+u)));if(b!==0){do{for(h=c-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[c]--,b-=2}while(b>0);for(h=c;h!==0;h--)for(l=e.bl_count[h];l!==0;)d=e.heap[--f],!(d>n)&&(t[d*2+1]!==h&&(e.opt_len+=(h-t[d*2+1])*t[d*2],t[d*2+1]=h),l--)}},Vl=(e,r,t)=>{let n=new Array(Ct+1),i=0,o,a;for(o=1;o<=Ct;o++)i=i+t[o-1]<<1,n[o]=i;for(a=0;a<=r;a++){let s=e[a*2+1];s!==0&&(e[a*2]=$l(n[s]++,s))}},W0=()=>{let e,r,t,n,i,o=new Array(Ct+1);for(t=0,n=0;n<aa-1;n++)for(la[n]=t,e=0;e<1<<jo[n];e++)rn[t++]=n;for(rn[t-1]=n,i=0,n=0;n<16;n++)for(ei[n]=i,e=0;e<1<<Qn[n];e++)tn[i++]=n;for(i>>=7;n<cr;n++)for(ei[n]=i<<7,e=0;e<1<<Qn[n]-7;e++)tn[256+i++]=n;for(r=0;r<=Ct;r++)o[r]=0;for(e=0;e<=143;)Je[e*2+1]=8,e++,o[8]++;for(;e<=255;)Je[e*2+1]=9,e++,o[9]++;for(;e<=279;)Je[e*2+1]=7,e++,o[7]++;for(;e<=287;)Je[e*2+1]=8,e++,o[8]++;for(Vl(Je,en+1,o),e=0;e<cr;e++)jr[e*2+1]=5,jr[e*2]=$l(e,5);Ml=new zo(Je,jo,fn+1,en,Ct),Fl=new zo(jr,Qn,0,cr,Ct),Pl=new zo(new Array(0),Y0,0,sa,V0)},Yl=e=>{let r;for(r=0;r<en;r++)e.dyn_ltree[r*2]=0;for(r=0;r<cr;r++)e.dyn_dtree[r*2]=0;for(r=0;r<sa;r++)e.bl_tree[r*2]=0;e.dyn_ltree[fa*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Kl=e=>{e.bi_valid>8?nn(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Gf=(e,r,t,n)=>{let i=r*2,o=t*2;return e[i]<e[o]||e[i]===e[o]&&n[r]<=n[t]},Fo=(e,r,t)=>{let n=e.heap[t],i=t<<1;for(;i<=e.heap_len&&(i<e.heap_len&&Gf(r,e.heap[i+1],e.heap[i],e.depth)&&i++,!Gf(r,n,e.heap[i],e.depth));)e.heap[t]=e.heap[i],t=i,i<<=1;e.heap[t]=n},Xf=(e,r,t)=>{let n,i,o=0,a,s;if(e.sym_next!==0)do n=e.pending_buf[e.sym_buf+o++]&255,n+=(e.pending_buf[e.sym_buf+o++]&255)<<8,i=e.pending_buf[e.sym_buf+o++],n===0?Fe(e,i,r):(a=rn[i],Fe(e,a+fn+1,r),s=jo[a],s!==0&&(i-=la[a],oe(e,i,s)),n--,a=Hl(n),Fe(e,a,t),s=Qn[a],s!==0&&(n-=ei[a],oe(e,n,s)));while(o<e.sym_next);Fe(e,fa,r)},Jo=(e,r)=>{let t=r.dyn_tree,n=r.stat_desc.static_tree,i=r.stat_desc.has_stree,o=r.stat_desc.elems,a,s,c=-1,f;for(e.heap_len=0,e.heap_max=Ol,a=0;a<o;a++)t[a*2]!==0?(e.heap[++e.heap_len]=c=a,e.depth[a]=0):t[a*2+1]=0;for(;e.heap_len<2;)f=e.heap[++e.heap_len]=c<2?++c:0,t[f*2]=1,e.depth[f]=0,e.opt_len--,i&&(e.static_len-=n[f*2+1]);for(r.max_code=c,a=e.heap_len>>1;a>=1;a--)Fo(e,t,a);f=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Fo(e,t,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,t[f*2]=t[a*2]+t[s*2],e.depth[f]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,t[a*2+1]=t[s*2+1]=f,e.heap[1]=f++,Fo(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],X0(e,r),Vl(t,c,e.bl_count)},Wf=(e,r,t)=>{let n,i=-1,o,a=r[1],s=0,c=7,f=4;for(a===0&&(c=138,f=3),r[(t+1)*2+1]=65535,n=0;n<=t;n++)o=a,a=r[(n+1)*2+1],!(++s<c&&o===a)&&(s<f?e.bl_tree[o*2]+=s:o!==0?(o!==i&&e.bl_tree[o*2]++,e.bl_tree[Ul*2]++):s<=10?e.bl_tree[Nl*2]++:e.bl_tree[Zl*2]++,s=0,i=o,a===0?(c=138,f=3):o===a?(c=6,f=3):(c=7,f=4))},qf=(e,r,t)=>{let n,i=-1,o,a=r[1],s=0,c=7,f=4;for(a===0&&(c=138,f=3),n=0;n<=t;n++)if(o=a,a=r[(n+1)*2+1],!(++s<c&&o===a)){if(s<f)do Fe(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==i&&(Fe(e,o,e.bl_tree),s--),Fe(e,Ul,e.bl_tree),oe(e,s-3,2)):s<=10?(Fe(e,Nl,e.bl_tree),oe(e,s-3,3)):(Fe(e,Zl,e.bl_tree),oe(e,s-11,7));s=0,i=o,a===0?(c=138,f=3):o===a?(c=6,f=3):(c=7,f=4)}},q0=e=>{let r;for(Wf(e,e.dyn_ltree,e.l_desc.max_code),Wf(e,e.dyn_dtree,e.d_desc.max_code),Jo(e,e.bl_desc),r=sa-1;r>=3&&e.bl_tree[zl[r]*2+1]===0;r--);return e.opt_len+=3*(r+1)+5+5+4,r},j0=(e,r,t,n)=>{let i;for(oe(e,r-257,5),oe(e,t-1,5),oe(e,n-4,4),i=0;i<n;i++)oe(e,e.bl_tree[zl[i]*2+1],3);qf(e,e.dyn_ltree,r-1),qf(e,e.dyn_dtree,t-1)},J0=e=>{let r=4093624447,t;for(t=0;t<=31;t++,r>>>=1)if(r&1&&e.dyn_ltree[t*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(t=32;t<fn;t++)if(e.dyn_ltree[t*2]!==0)return 1;return 0},jf=!1,Q0=e=>{jf||(W0(),jf=!0),e.l_desc=new Mo(e.dyn_ltree,Ml),e.d_desc=new Mo(e.dyn_dtree,Fl),e.bl_desc=new Mo(e.bl_tree,Pl),e.bi_buf=0,e.bi_valid=0,Yl(e)},Gl=(e,r,t,n)=>{oe(e,(F0<<1)+(n?1:0),3),Kl(e),nn(e,t),nn(e,~t),t&&e.pending_buf.set(e.window.subarray(r,r+t),e.pending),e.pending+=t},ed=e=>{oe(e,Rl<<1,3),Fe(e,fa,Je),G0(e)},td=(e,r,t,n)=>{let i,o,a=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=J0(e)),Jo(e,e.l_desc),Jo(e,e.d_desc),a=q0(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=t+5,t+4<=i&&r!==-1?Gl(e,r,t,n):e.strategy===4||o===i?(oe(e,(Rl<<1)+(n?1:0),3),Xf(e,Je,jr)):(oe(e,(P0<<1)+(n?1:0),3),j0(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),Xf(e,e.dyn_ltree,e.dyn_dtree)),Yl(e),n&&Kl(e)},rd=(e,r,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=r,e.pending_buf[e.sym_buf+e.sym_next++]=r>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,r===0?e.dyn_ltree[t*2]++:(e.matches++,r--,e.dyn_ltree[(rn[t]+fn+1)*2]++,e.dyn_dtree[Hl(r)*2]++),e.sym_next===e.sym_end),nd=Q0,id=Gl,od=td,ad=rd,sd=ed,fd={_tr_init:nd,_tr_stored_block:id,_tr_flush_block:od,_tr_tally:ad,_tr_align:sd},ld=(e,r,t,n)=>{let i=e&65535|0,o=e>>>16&65535|0,a=0;for(;t!==0;){a=t>2e3?2e3:t,t-=a;do i=i+r[n++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0},on=ld,cd=()=>{let e,r=[];for(var t=0;t<256;t++){e=t;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;r[t]=e}return r},ud=new Uint32Array(cd()),hd=(e,r,t,n)=>{let i=ud,o=n+t;e^=-1;for(let a=n;a<o;a++)e=e>>>8^i[(e^r[a])&255];return e^-1},W=hd,Ot={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"},zt={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},{_tr_init:dd,_tr_stored_block:Qo,_tr_flush_block:pd,_tr_tally:gt,_tr_align:_d}=fd,{Z_NO_FLUSH:xt,Z_PARTIAL_FLUSH:md,Z_FULL_FLUSH:Ed,Z_FINISH:me,Z_BLOCK:Jf,Z_OK:J,Z_STREAM_END:Qf,Z_STREAM_ERROR:Pe,Z_DATA_ERROR:gd,Z_BUF_ERROR:Po,Z_DEFAULT_COMPRESSION:xd,Z_FILTERED:bd,Z_HUFFMAN_ONLY:Xn,Z_RLE:yd,Z_FIXED:wd,Z_DEFAULT_STRATEGY:Sd,Z_UNKNOWN:Ad,Z_DEFLATED:ni}=zt,Id=9,Bd=15,Td=8,Dd=29,Ld=256,ea=Ld+1+Dd,kd=30,Cd=19,vd=2*ea+1,Rd=15,O=3,Et=258,He=Et+O+1,Od=32,hr=42,ca=57,ta=69,ra=73,na=91,ia=103,vt=113,Wr=666,re=1,_r=2,Ut=3,mr=4,Ud=3,Rt=(e,r)=>(e.msg=Ot[r],r),el=e=>e*2-(e>4?9:0),mt=e=>{let r=e.length;for(;--r>=0;)e[r]=0},Nd=e=>{let r,t,n,i=e.w_size;r=e.hash_size,n=r;do t=e.head[--n],e.head[n]=t>=i?t-i:0;while(--r);r=i,n=r;do t=e.prev[--n],e.prev[n]=t>=i?t-i:0;while(--r)},ua=(e,r,t)=>(r<<e.hash_shift^t)&e.hash_mask,Nt=(e,r)=>{let t;if(e.legacy_hash)t=e.ins_h=ua(e,e.ins_h,e.window[r+O-1]);else{let i=e.window,o=i[r]|i[r+1]<<8|i[r+2]<<16|i[r+3]<<24;t=e.ins_h=Math.imul(o,66521)+66521>>>16&e.hash_mask}let n=e.prev[r&e.w_mask]=e.head[t];return e.head[t]=r,n},le=e=>{let r=e.state,t=r.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(r.pending_buf.subarray(r.pending_out,r.pending_out+t),e.next_out),e.next_out+=t,r.pending_out+=t,e.total_out+=t,e.avail_out-=t,r.pending-=t,r.pending===0&&(r.pending_out=0))},ce=(e,r)=>{pd(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,r),e.block_start=e.strstart,le(e.strm)},N=(e,r)=>{e.pending_buf[e.pending++]=r},Xr=(e,r)=>{e.pending_buf[e.pending++]=r>>>8&255,e.pending_buf[e.pending++]=r&255},oa=(e,r,t,n)=>{let i=e.avail_in;return i>n&&(i=n),i===0?0:(e.avail_in-=i,r.set(e.input.subarray(e.next_in,e.next_in+i),t),e.state.wrap===1?e.adler=on(e.adler,r,i,t):e.state.wrap===2&&(e.adler=W(e.adler,r,i,t)),e.next_in+=i,e.total_in+=i,i)},Xl=(e,r)=>{let t=e.max_chain_length,n=e.strstart,i,o,a=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-He?e.strstart-(e.w_size-He):0,f=e.window,l=e.w_mask,d=e.prev,h=e.strstart+Et,u=f[n+a-1],p=f[n+a];e.prev_length>=e.good_match&&(t>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=r,!(f[i+a]!==p||f[i+a-1]!==u||f[i]!==f[n]||f[++i]!==f[n+1])){n+=2,i++;do;while(f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&f[++n]===f[++i]&&n<h);if(o=Et-(h-n),n=h-Et,o>a){if(e.match_start=r,a=o,o>=s)break;u=f[n+a-1],p=f[n+a]}}while((r=d[r&l])>c&&--t!==0);return a<=e.lookahead?a:e.lookahead},dr=e=>{let r=e.w_size,t,n,i;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=r+(r-He)&&(e.window.set(e.window.subarray(r,r+r-n),0),e.match_start-=r,e.strstart-=r,e.block_start-=r,e.insert>e.strstart&&(e.insert=e.strstart),Nd(e),n+=r),e.strm.avail_in===0)break;if(t=oa(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=t,e.legacy_hash){if(e.lookahead+e.insert>=O)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=ua(e,e.ins_h,e.window[i+1]);e.insert&&(Nt(e,i),i++,e.insert--,!(e.lookahead+e.insert<O)););}else if(e.lookahead+e.insert>O)for(i=e.strstart-e.insert;e.insert&&(Nt(e,i),i++,e.insert--,!(e.lookahead+e.insert<=O)););}while(e.lookahead<He&&e.strm.avail_in!==0)},Wl=(e,r)=>{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n,i,o,a=0,s=e.strm.avail_in;do{if(n=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o||(o=e.strm.avail_out-o,i=e.strstart-e.block_start,n>i+e.strm.avail_in&&(n=i+e.strm.avail_in),n>o&&(n=o),n<t&&(n===0&&r!==me||r===xt||n!==i+e.strm.avail_in)))break;a=r===me&&n===i+e.strm.avail_in?1:0,Qo(e,0,0,a),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,le(e.strm),i&&(i>n&&(i=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,n-=i),n&&(oa(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n)}while(a===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?mr:r!==xt&&r!==me&&e.strm.avail_in===0&&e.strstart===e.block_start?_r:(o=e.window_size-e.strstart,e.strm.avail_in>o&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(oa(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,t=o>e.w_size?e.w_size:o,i=e.strstart-e.block_start,(i>=t||(i||r===me)&&r!==xt&&e.strm.avail_in===0&&i<=o)&&(n=i>o?o:i,a=r===me&&e.strm.avail_in===0&&n===i?1:0,Qo(e,e.block_start,n,a),e.block_start+=n,le(e.strm)),a?Ut:re)},Ho=(e,r)=>{let t,n;for(;;){if(e.lookahead<He){if(dr(e),e.lookahead<He&&r===xt)return re;if(e.lookahead===0)break}if(t=0,e.lookahead>=O&&(t=Nt(e,e.strstart)),t!==0&&e.strstart-t<=e.w_size-He&&(e.match_length=Xl(e,t)),e.match_length>=O)if(n=gt(e,e.strstart-e.match_start,e.match_length-O),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=O){e.match_length--;do e.strstart++,t=Nt(e,e.strstart);while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=ua(e,e.ins_h,e.window[e.strstart+1]));else n=gt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(ce(e,!1),e.strm.avail_out===0))return re}return e.insert=e.strstart<O-1?e.strstart:O-1,r===me?(ce(e,!0),e.strm.avail_out===0?Ut:mr):e.sym_next&&(ce(e,!1),e.strm.avail_out===0)?re:_r},fr=(e,r)=>{let t,n,i;for(;;){if(e.lookahead<He){if(dr(e),e.lookahead<He&&r===xt)return re;if(e.lookahead===0)break}if(t=0,e.lookahead>=O&&(t=Nt(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=O-1,t!==0&&e.prev_length<e.max_lazy_match&&e.strstart-t<=e.w_size-He&&(e.match_length=Xl(e,t),e.match_length<=5&&(e.strategy===bd||e.match_length===O&&e.strstart-e.match_start>4096)&&(e.match_length=O-1)),e.prev_length>=O&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-O,n=gt(e,e.strstart-1-e.prev_match,e.prev_length-O),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(t=Nt(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=O-1,e.strstart++,n&&(ce(e,!1),e.strm.avail_out===0))return re}else if(e.match_available){if(n=gt(e,0,e.window[e.strstart-1]),n&&ce(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return re}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=gt(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<O-1?e.strstart:O-1,r===me?(ce(e,!0),e.strm.avail_out===0?Ut:mr):e.sym_next&&(ce(e,!1),e.strm.avail_out===0)?re:_r},Zd=(e,r)=>{let t,n,i,o,a=e.window;for(;;){if(e.lookahead<=Et){if(dr(e),e.lookahead<=Et&&r===xt)return re;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=O&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+Et;do;while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=Et-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=O?(t=gt(e,1,e.match_length-O),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=gt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(ce(e,!1),e.strm.avail_out===0))return re}return e.insert=0,r===me?(ce(e,!0),e.strm.avail_out===0?Ut:mr):e.sym_next&&(ce(e,!1),e.strm.avail_out===0)?re:_r},zd=(e,r)=>{let t;for(;;){if(e.lookahead===0&&(dr(e),e.lookahead===0)){if(r===xt)return re;break}if(e.match_length=0,t=gt(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(ce(e,!1),e.strm.avail_out===0))return re}return e.insert=0,r===me?(ce(e,!0),e.strm.avail_out===0?Ut:mr):e.sym_next&&(ce(e,!1),e.strm.avail_out===0)?re:_r};function ze(e,r,t,n,i){this.good_length=e,this.max_lazy=r,this.nice_length=t,this.max_chain=n,this.func=i}var qr=[new ze(0,0,0,0,Wl),new ze(4,4,8,4,Ho),new ze(4,5,16,8,Ho),new ze(4,6,32,32,Ho),new ze(4,4,16,16,fr),new ze(8,16,32,32,fr),new ze(8,16,128,128,fr),new ze(8,32,128,256,fr),new ze(32,128,258,1024,fr),new ze(32,258,258,4096,fr)],Md=e=>{e.window_size=2*e.w_size,mt(e.head),e.max_lazy_match=qr[e.level].max_lazy,e.good_match=qr[e.level].good_length,e.nice_match=qr[e.level].nice_length,e.max_chain_length=qr[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=O-1,e.match_available=0,e.ins_h=0};function Fd(){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=ni,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.legacy_hash=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(vd*2),this.dyn_dtree=new Uint16Array((2*kd+1)*2),this.bl_tree=new Uint16Array((2*Cd+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(Rd+1),this.heap=new Uint16Array(2*ea+1),mt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*ea+1),mt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var ln=e=>{if(!e)return 1;let r=e.state;return!r||r.strm!==e||r.status!==hr&&r.status!==ca&&r.status!==ta&&r.status!==ra&&r.status!==na&&r.status!==ia&&r.status!==vt&&r.status!==Wr?1:0},ql=e=>{if(ln(e))return Rt(e,Pe);e.total_in=e.total_out=0,e.data_type=Ad;let r=e.state;return r.pending=0,r.pending_out=0,r.wrap<0&&(r.wrap=-r.wrap),r.status=r.wrap===2?ca:r.wrap?hr:vt,e.adler=r.wrap===2?0:1,r.last_flush=-2,dd(r),J},jl=e=>{let r=ql(e);return r===J&&Md(e.state),r},Pd=(e,r)=>ln(e)||e.state.wrap!==2?Pe:(e.state.gzhead=r,J),Jl=(e,r,t,n,i,o,a)=>{if(!e)return Pe;let s=1;if(r===xd&&(r=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>Id||t!==ni||n<8||n>15||r<0||r>9||o<0||o>wd||n===8&&s!==1)return Rt(e,Pe);n===8&&(n=9);let c=new Fd;return e.state=c,c.strm=e,c.status=hr,c.wrap=s,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.legacy_hash=a?1:0,c.hash_bits=i+7,!c.legacy_hash&&c.hash_bits<15&&(c.hash_bits=15),c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+O-1)/O),c.window=new Uint8Array(c.w_size*2),c.head=new Uint16Array(c.hash_size),c.prev=new Uint16Array(c.w_size),c.lit_bufsize=1<<i+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new Uint8Array(c.pending_buf_size),c.sym_buf=c.lit_bufsize,c.sym_end=(c.lit_bufsize-1)*3,c.level=r,c.strategy=o,c.method=t,jl(e)},Hd=(e,r)=>Jl(e,r,ni,Bd,Td,Sd),$d=(e,r)=>{if(ln(e)||r>Jf||r<0)return e?Rt(e,Pe):Pe;let t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===Wr&&r!==me)return Rt(e,e.avail_out===0?Po:Pe);let n=t.last_flush;if(t.last_flush=r,t.pending!==0){if(le(e),e.avail_out===0)return t.last_flush=-1,J}else if(e.avail_in===0&&el(r)<=el(n)&&r!==me)return Rt(e,Po);if(t.status===Wr&&e.avail_in!==0)return Rt(e,Po);if(t.status===hr&&t.wrap===0&&(t.status=vt),t.status===hr){let i=ni+(t.w_bits-8<<4)<<8,o=-1;if(t.strategy>=Xn||t.level<2?o=0:t.level<6?o=1:t.level===6?o=2:o=3,i|=o<<6,t.strstart!==0&&(i|=Od),i+=31-i%31,Xr(t,i),t.strstart!==0&&(Xr(t,e.adler>>>16),Xr(t,e.adler&65535)),e.adler=1,t.status=vt,le(e),t.pending!==0)return t.last_flush=-1,J}if(t.status===ca){if(e.adler=0,N(t,31),N(t,139),N(t,8),t.gzhead)N(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),N(t,t.gzhead.time&255),N(t,t.gzhead.time>>8&255),N(t,t.gzhead.time>>16&255),N(t,t.gzhead.time>>24&255),N(t,t.level===9?2:t.strategy>=Xn||t.level<2?4:0),N(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(N(t,t.gzhead.extra.length&255),N(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=W(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=ta;else if(N(t,0),N(t,0),N(t,0),N(t,0),N(t,0),N(t,t.level===9?2:t.strategy>=Xn||t.level<2?4:0),N(t,Ud),t.status=vt,le(e),t.pending!==0)return t.last_flush=-1,J}if(t.status===ta){if(t.gzhead.extra){let i=t.pending,o=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+o>t.pending_buf_size;){let s=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>i&&(e.adler=W(e.adler,t.pending_buf,t.pending-i,i)),t.gzindex+=s,le(e),t.pending!==0)return t.last_flush=-1,J;i=0,o-=s}let a=new Uint8Array(t.gzhead.extra);t.pending_buf.set(a.subarray(t.gzindex,t.gzindex+o),t.pending),t.pending+=o,t.gzhead.hcrc&&t.pending>i&&(e.adler=W(e.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=ra}if(t.status===ra){if(t.gzhead.name){let i=t.pending,o;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(e.adler=W(e.adler,t.pending_buf,t.pending-i,i)),le(e),t.pending!==0)return t.last_flush=-1,J;i=0}t.gzindex<t.gzhead.name.length?o=t.gzhead.name.charCodeAt(t.gzindex++)&255:o=0,N(t,o)}while(o!==0);t.gzhead.hcrc&&t.pending>i&&(e.adler=W(e.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=na}if(t.status===na){if(t.gzhead.comment){let i=t.pending,o;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(e.adler=W(e.adler,t.pending_buf,t.pending-i,i)),le(e),t.pending!==0)return t.last_flush=-1,J;i=0}t.gzindex<t.gzhead.comment.length?o=t.gzhead.comment.charCodeAt(t.gzindex++)&255:o=0,N(t,o)}while(o!==0);t.gzhead.hcrc&&t.pending>i&&(e.adler=W(e.adler,t.pending_buf,t.pending-i,i))}t.status=ia}if(t.status===ia){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(le(e),t.pending!==0))return t.last_flush=-1,J;N(t,e.adler&255),N(t,e.adler>>8&255),e.adler=0}if(t.status=vt,le(e),t.pending!==0)return t.last_flush=-1,J}if(e.avail_in!==0||t.lookahead!==0||r!==xt&&t.status!==Wr){let i=t.level===0?Wl(t,r):t.strategy===Xn?zd(t,r):t.strategy===yd?Zd(t,r):qr[t.level].func(t,r);if((i===Ut||i===mr)&&(t.status=Wr),i===re||i===Ut)return e.avail_out===0&&(t.last_flush=-1),J;if(i===_r&&(r===md?_d(t):r!==Jf&&(Qo(t,0,0,!1),r===Ed&&(mt(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),le(e),e.avail_out===0))return t.last_flush=-1,J}return r!==me?J:t.wrap<=0?Qf:(t.wrap===2?(N(t,e.adler&255),N(t,e.adler>>8&255),N(t,e.adler>>16&255),N(t,e.adler>>24&255),N(t,e.total_in&255),N(t,e.total_in>>8&255),N(t,e.total_in>>16&255),N(t,e.total_in>>24&255)):(Xr(t,e.adler>>>16),Xr(t,e.adler&65535)),le(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?J:Qf)},Vd=e=>{if(ln(e))return Pe;let r=e.state.status;return e.state=null,r===vt?Rt(e,gd):J},Yd=(e,r)=>{let t=r.length;if(ln(e))return Pe;let n=e.state,i=n.wrap;if(i===2||i===1&&n.status!==hr||n.lookahead)return Pe;if(i===1&&(e.adler=on(e.adler,r,t,0)),n.wrap=0,t>=n.w_size){i===0&&(mt(n.head),n.strstart=0,n.block_start=0,n.insert=0);let c=new Uint8Array(n.w_size);c.set(r.subarray(t-n.w_size,t),0),r=c,t=n.w_size}let o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=t,e.next_in=0,e.input=r,dr(n);n.lookahead>=O;){let c=n.strstart,f=n.lookahead-(O-1);do Nt(n,c),c++;while(--f);n.strstart=c,n.lookahead=O-1,dr(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=O-1,n.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,n.wrap=i,J},Kd=Hd,Gd=Jl,Xd=jl,Wd=ql,qd=Pd,jd=$d,Jd=Vd,Qd=Yd,ep="pako deflate (from Nodeca project)",Jr={deflateInit:Kd,deflateInit2:Gd,deflateReset:Xd,deflateResetKeep:Wd,deflateSetHeader:qd,deflate:jd,deflateEnd:Jd,deflateSetDictionary:Qd,deflateInfo:ep},tp=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),rp=function(e){let r=Array.prototype.slice.call(arguments,1);for(;r.length;){let t=r.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(let n in t)tp(t,n)&&(e[n]=t[n])}}return e},np=e=>{let r=0;for(let n=0,i=e.length;n<i;n++)r+=e[n].length;let t=new Uint8Array(r);for(let n=0,i=0,o=e.length;n<o;n++){let a=e[n];t.set(a,i),i+=a.length}return t},ii={assign:rp,flattenChunks:np},Ql=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ql=!1}var an=new Uint8Array(256);for(let e=0;e<256;e++)an[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;an[254]=an[255]=1;var ip=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let r,t,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)t=e.charCodeAt(i),(t&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),s+=t<128?1:t<2048?2:t<65536?3:4;for(r=new Uint8Array(s),o=0,i=0;o<s;i++)t=e.charCodeAt(i),(t&64512)===55296&&i+1<a&&(n=e.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),t<128?r[o++]=t:t<2048?(r[o++]=192|t>>>6,r[o++]=128|t&63):t<65536?(r[o++]=224|t>>>12,r[o++]=128|t>>>6&63,r[o++]=128|t&63):(r[o++]=240|t>>>18,r[o++]=128|t>>>12&63,r[o++]=128|t>>>6&63,r[o++]=128|t&63);return r},op=(e,r)=>{if(r<65534&&e.subarray&&Ql)return String.fromCharCode.apply(null,e.length===r?e:e.subarray(0,r));let t="";for(let n=0;n<r;n++)t+=String.fromCharCode(e[n]);return t},ap=(e,r)=>{let t=r||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,r));let n,i,o=new Array(t*2);for(i=0,n=0;n<t;){let a=e[n++];if(a<128){o[i++]=a;continue}let s=an[a];if(s>4){o[i++]=65533,n+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&n<t;)a=a<<6|e[n++]&63,s--;if(s>1){o[i++]=65533;continue}a<65536?o[i++]=a:(a-=65536,o[i++]=55296|a>>10&1023,o[i++]=56320|a&1023)}return op(o,i)},sp=(e,r)=>{r=r||e.length,r>e.length&&(r=e.length);let t=r-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?r:t+an[e[t]]>r?t:r},sn={string2buf:ip,buf2string:ap,utf8border:sp};function fp(){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 ec=fp,tc=Object.prototype.toString,{Z_NO_FLUSH:lp,Z_SYNC_FLUSH:cp,Z_FULL_FLUSH:up,Z_FINISH:hp,Z_OK:ti,Z_STREAM_END:dp,Z_DEFAULT_COMPRESSION:pp,Z_DEFAULT_STRATEGY:_p,Z_DEFLATED:mp}=zt,Ep={level:pp,method:mp,chunkSize:16384,windowBits:15,memLevel:8,strategy:_p,legacyHash:!0};function cn(e){this.options=ii.assign({},Ep,e||{});let r=this.options;r.raw&&r.windowBits>0?r.windowBits=-r.windowBits:r.gzip&&r.windowBits>0&&r.windowBits<16&&(r.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ec,this.strm.avail_out=0;let t=Jr.deflateInit2(this.strm,r.level,r.method,r.windowBits,r.memLevel,r.strategy,r.legacyHash);if(t!==ti)throw new Error(Ot[t]);if(r.header&&Jr.deflateSetHeader(this.strm,r.header),r.dictionary){let n;if(typeof r.dictionary=="string"?n=sn.string2buf(r.dictionary):tc.call(r.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(r.dictionary):n=r.dictionary,t=Jr.deflateSetDictionary(this.strm,n),t!==ti)throw new Error(Ot[t]);this._dict_set=!0}}cn.prototype.push=function(e,r){let t=this.strm,n=this.options.chunkSize,i,o;if(this.ended)return!1;for(r===~~r?o=r:o=r===!0?hp:lp,typeof e=="string"?t.input=sn.string2buf(e):tc.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),(o===cp||o===up)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(i=Jr.deflate(t,o),i===dp)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=Jr.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===ti;if(t.avail_out===0){this.onData(t.output);continue}if(o>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};cn.prototype.onData=function(e){this.chunks.push(e)};cn.prototype.onEnd=function(e){e===ti&&(this.result=ii.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ha(e,r){let t=new cn(r);if(t.push(e,!0),t.err)throw t.msg||Ot[t.err];return t.result}function gp(e,r){return r=r||{},r.raw=!0,ha(e,r)}function xp(e,r){return r=r||{},r.gzip=!0,ha(e,r)}var bp=cn,yp=ha,wp=gp,Sp=xp,Ap=zt,Ip={Deflate:bp,deflate:yp,deflateRaw:wp,gzip:Sp,constants:Ap},Wn=16209,Bp=16191,Tp=function(r,t){let n,i,o,a,s,c,f,l,d,h,u,p,b,E,x,B,I,_,D,S,y,L,T,m,A=r.state;n=r.next_in,T=r.input,i=n+(r.avail_in-5),o=r.next_out,m=r.output,a=o-(t-r.avail_out),s=o+(r.avail_out-257),c=A.dmax,f=A.wsize,l=A.whave,d=A.wnext,h=A.window,u=A.hold,p=A.bits,b=A.lencode,E=A.distcode,x=(1<<A.lenbits)-1,B=(1<<A.distbits)-1;e:do{p<15&&(u+=T[n++]<<p,p+=8,u+=T[n++]<<p,p+=8),I=b[u&x];t:for(;;){if(_=I>>>24,u>>>=_,p-=_,_=I>>>16&255,_===0)m[o++]=I&65535;else if(_&16){D=I&65535,_&=15,_&&(p<_&&(u+=T[n++]<<p,p+=8),D+=u&(1<<_)-1,u>>>=_,p-=_),p<15&&(u+=T[n++]<<p,p+=8,u+=T[n++]<<p,p+=8),I=E[u&B];r:for(;;){if(_=I>>>24,u>>>=_,p-=_,_=I>>>16&255,_&16){if(S=I&65535,_&=15,p<_&&(u+=T[n++]<<p,p+=8,p<_&&(u+=T[n++]<<p,p+=8)),S+=u&(1<<_)-1,S>c){r.msg="invalid distance too far back",A.mode=Wn;break e}if(u>>>=_,p-=_,_=o-a,S>_){if(_=S-_,_>l&&A.sane){r.msg="invalid distance too far back",A.mode=Wn;break e}if(y=0,L=h,d===0){if(y+=f-_,_<D){D-=_;do m[o++]=h[y++];while(--_);y=o-S,L=m}}else if(d<_){if(y+=f+d-_,_-=d,_<D){D-=_;do m[o++]=h[y++];while(--_);if(y=0,d<D){_=d,D-=_;do m[o++]=h[y++];while(--_);y=o-S,L=m}}}else if(y+=d-_,_<D){D-=_;do m[o++]=h[y++];while(--_);y=o-S,L=m}for(;D>2;)m[o++]=L[y++],m[o++]=L[y++],m[o++]=L[y++],D-=3;D&&(m[o++]=L[y++],D>1&&(m[o++]=L[y++]))}else{y=o-S;do m[o++]=m[y++],m[o++]=m[y++],m[o++]=m[y++],D-=3;while(D>2);D&&(m[o++]=m[y++],D>1&&(m[o++]=m[y++]))}}else if((_&64)===0){I=E[(I&65535)+(u&(1<<_)-1)];continue r}else{r.msg="invalid distance code",A.mode=Wn;break e}break}}else if((_&64)===0){I=b[(I&65535)+(u&(1<<_)-1)];continue t}else if(_&32){A.mode=Bp;break e}else{r.msg="invalid literal/length code",A.mode=Wn;break e}break}}while(n<i&&o<s);D=p>>3,n-=D,p-=D<<3,u&=(1<<p)-1,r.next_in=n,r.next_out=o,r.avail_in=n<i?5+(i-n):5-(n-i),r.avail_out=o<s?257+(s-o):257-(o-s),A.hold=u,A.bits=p},lr=15,tl=852,rl=592,nl=0,$o=1,il=2,Dp=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]),Lp=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,199,75]),kp=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]),Cp=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]),vp=(e,r,t,n,i,o,a,s)=>{let c=s.bits,f=0,l=0,d=0,h=0,u=0,p=0,b=0,E=0,x=0,B=0,I,_,D,S,y,L=null,T,m=new Uint16Array(lr+1),A=new Uint16Array(lr+1),z=null,Er,Ve,Ye;for(f=0;f<=lr;f++)m[f]=0;for(l=0;l<n;l++)m[r[t+l]]++;for(u=c,h=lr;h>=1&&m[h]===0;h--);if(u>h&&(u=h),h===0)return i[o++]=1<<24|64<<16|0,i[o++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<h&&m[d]===0;d++);for(u<d&&(u=d),E=1,f=1;f<=lr;f++)if(E<<=1,E-=m[f],E<0)return-1;if(E>0&&(e===nl||h!==1))return-1;for(A[1]=0,f=1;f<lr;f++)A[f+1]=A[f]+m[f];for(l=0;l<n;l++)r[t+l]!==0&&(a[A[r[t+l]]++]=l);if(e===nl?(L=z=a,T=20):e===$o?(L=Dp,z=Lp,T=257):(L=kp,z=Cp,T=0),B=0,l=0,f=d,y=o,p=u,b=0,D=-1,x=1<<u,S=x-1,e===$o&&x>tl||e===il&&x>rl)return 1;for(;;){Er=f-b,a[l]+1<T?(Ve=0,Ye=a[l]):a[l]>=T?(Ve=z[a[l]-T],Ye=L[a[l]-T]):(Ve=96,Ye=0),I=1<<f-b,_=1<<p,d=_;do _-=I,i[y+(B>>b)+_]=Er<<24|Ve<<16|Ye|0;while(_!==0);for(I=1<<f-1;B&I;)I>>=1;if(I!==0?(B&=I-1,B+=I):B=0,l++,--m[f]===0){if(f===h)break;f=r[t+a[l]]}if(f>u&&(B&S)!==D){for(b===0&&(b=u),y+=d,p=f-b,E=1<<p;p+b<h&&(E-=m[p+b],!(E<=0));)p++,E<<=1;if(x+=1<<p,e===$o&&x>tl||e===il&&x>rl)return 1;D=B&S,i[D]=u<<24|p<<16|y-o|0}}return B!==0&&(i[y+B]=f-b<<24|64<<16|0),s.bits=u,0},Qr=vp,Rp=0,rc=1,nc=2,{Z_FINISH:ol,Z_BLOCK:Op,Z_TREES:qn,Z_OK:Zt,Z_STREAM_END:Up,Z_NEED_DICT:Np,Z_STREAM_ERROR:Ee,Z_DATA_ERROR:ic,Z_MEM_ERROR:oc,Z_BUF_ERROR:Zp,Z_DEFLATED:al}=zt,oi=16180,sl=16181,fl=16182,ll=16183,cl=16184,ul=16185,hl=16186,dl=16187,pl=16188,_l=16189,ri=16190,je=16191,Vo=16192,ml=16193,Yo=16194,El=16195,gl=16196,xl=16197,bl=16198,jn=16199,Jn=16200,yl=16201,wl=16202,Sl=16203,Al=16204,Il=16205,Ko=16206,Bl=16207,Tl=16208,P=16209,ac=16210,sc=16211,zp=852,Mp=592,Fp=15,Pp=Fp,Dl=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Hp(){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}var Mt=e=>{if(!e)return 1;let r=e.state;return!r||r.strm!==e||r.mode<oi||r.mode>sc?1:0},fc=e=>{if(Mt(e))return Ee;let r=e.state;return e.total_in=e.total_out=r.total=0,e.msg="",r.wrap&&(e.adler=r.wrap&1),r.mode=oi,r.last=0,r.havedict=0,r.flags=-1,r.dmax=32768,r.head=null,r.hold=0,r.bits=0,r.lencode=r.lendyn=new Int32Array(zp),r.distcode=r.distdyn=new Int32Array(Mp),r.sane=1,r.back=-1,Zt},lc=e=>{if(Mt(e))return Ee;let r=e.state;return r.wsize=0,r.whave=0,r.wnext=0,fc(e)},cc=(e,r)=>{let t;if(Mt(e))return Ee;let n=e.state;return r<0?(t=0,r=-r):(t=(r>>4)+5,r<48&&(r&=15)),r&&(r<8||r>15)?Ee:(n.window!==null&&n.wbits!==r&&(n.window=null),n.wrap=t,n.wbits=r,lc(e))},uc=(e,r)=>{if(!e)return Ee;let t=new Hp;e.state=t,t.strm=e,t.window=null,t.mode=oi;let n=cc(e,r);return n!==Zt&&(e.state=null),n},$p=e=>uc(e,Pp),Ll=!0,Go,Xo,Vp=e=>{if(Ll){Go=new Int32Array(512),Xo=new Int32Array(32);let r=0;for(;r<144;)e.lens[r++]=8;for(;r<256;)e.lens[r++]=9;for(;r<280;)e.lens[r++]=7;for(;r<288;)e.lens[r++]=8;for(Qr(rc,e.lens,0,288,Go,0,e.work,{bits:9}),r=0;r<32;)e.lens[r++]=5;Qr(nc,e.lens,0,32,Xo,0,e.work,{bits:5}),Ll=!1}e.lencode=Go,e.lenbits=9,e.distcode=Xo,e.distbits=5},hc=(e,r,t,n)=>{let i,o=e.state;return o.window===null&&(o.window=new Uint8Array(1<<o.wbits)),o.wsize===0&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0),n>=o.wsize?(o.window.set(r.subarray(t-o.wsize,t),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(r.subarray(t-n,t-n+i),o.wnext),n-=i,n?(o.window.set(r.subarray(t-n,t),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0},Yp=(e,r)=>{let t,n,i,o,a,s,c,f,l,d,h,u,p,b,E=0,x,B,I,_,D,S,y,L,T=new Uint8Array(4),m,A,z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Mt(e)||!e.output||!e.input&&e.avail_in!==0)return Ee;t=e.state,t.mode===je&&(t.mode=Vo),a=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=t.hold,l=t.bits,d=s,h=c,L=Zt;e:for(;;)switch(t.mode){case oi:if(t.wrap===0){t.mode=Vo;break}for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(t.wrap&2&&f===35615){t.wbits===0&&(t.wbits=15),t.check=0,T[0]=f&255,T[1]=f>>>8&255,t.check=W(t.check,T,2,0),f=0,l=0,t.mode=sl;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",t.mode=P;break}if((f&15)!==al){e.msg="unknown compression method",t.mode=P;break}if(f>>>=4,l-=4,y=(f&15)+8,t.wbits===0&&(t.wbits=y),y>15||y>t.wbits){e.msg="invalid window size",t.mode=P;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=f&512?_l:je,f=0,l=0;break;case sl:for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(t.flags=f,(t.flags&255)!==al){e.msg="unknown compression method",t.mode=P;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=P;break}t.head&&(t.head.text=f>>8&1),t.flags&512&&t.wrap&4&&(T[0]=f&255,T[1]=f>>>8&255,t.check=W(t.check,T,2,0)),f=0,l=0,t.mode=fl;case fl:for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}t.head&&(t.head.time=f),t.flags&512&&t.wrap&4&&(T[0]=f&255,T[1]=f>>>8&255,T[2]=f>>>16&255,T[3]=f>>>24&255,t.check=W(t.check,T,4,0)),f=0,l=0,t.mode=ll;case ll:for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}t.head&&(t.head.xflags=f&255,t.head.os=f>>8),t.flags&512&&t.wrap&4&&(T[0]=f&255,T[1]=f>>>8&255,t.check=W(t.check,T,2,0)),f=0,l=0,t.mode=cl;case cl:if(t.flags&1024){for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}t.length=f,t.head&&(t.head.extra_len=f),t.flags&512&&t.wrap&4&&(T[0]=f&255,T[1]=f>>>8&255,t.check=W(t.check,T,2,0)),f=0,l=0}else t.head&&(t.head.extra=null);t.mode=ul;case ul:if(t.flags&1024&&(u=t.length,u>s&&(u=s),u&&(t.head&&(y=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(o,o+u),y)),t.flags&512&&t.wrap&4&&(t.check=W(t.check,n,u,o)),s-=u,o+=u,t.length-=u),t.length))break e;t.length=0,t.mode=hl;case hl:if(t.flags&2048){if(s===0)break e;u=0;do y=n[o+u++],t.head&&y&&t.length<65536&&(t.head.name+=String.fromCharCode(y));while(y&&u<s);if(t.flags&512&&t.wrap&4&&(t.check=W(t.check,n,u,o)),s-=u,o+=u,y)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=dl;case dl:if(t.flags&4096){if(s===0)break e;u=0;do y=n[o+u++],t.head&&y&&t.length<65536&&(t.head.comment+=String.fromCharCode(y));while(y&&u<s);if(t.flags&512&&t.wrap&4&&(t.check=W(t.check,n,u,o)),s-=u,o+=u,y)break e}else t.head&&(t.head.comment=null);t.mode=pl;case pl:if(t.flags&512){for(;l<16;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(t.wrap&4&&f!==(t.check&65535)){e.msg="header crc mismatch",t.mode=P;break}f=0,l=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=je;break;case _l:for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}e.adler=t.check=Dl(f),f=0,l=0,t.mode=ri;case ri:if(t.havedict===0)return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,t.hold=f,t.bits=l,Np;e.adler=t.check=1,t.mode=je;case je:if(r===Op||r===qn)break e;case Vo:if(t.last){f>>>=l&7,l-=l&7,t.mode=Ko;break}for(;l<3;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}switch(t.last=f&1,f>>>=1,l-=1,f&3){case 0:t.mode=ml;break;case 1:if(Vp(t),t.mode=jn,r===qn){f>>>=2,l-=2;break e}break;case 2:t.mode=gl;break;case 3:e.msg="invalid block type",t.mode=P}f>>>=2,l-=2;break;case ml:for(f>>>=l&7,l-=l&7;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if((f&65535)!==(f>>>16^65535)){e.msg="invalid stored block lengths",t.mode=P;break}if(t.length=f&65535,f=0,l=0,t.mode=Yo,r===qn)break e;case Yo:t.mode=El;case El:if(u=t.length,u){if(u>s&&(u=s),u>c&&(u=c),u===0)break e;i.set(n.subarray(o,o+u),a),s-=u,o+=u,c-=u,a+=u,t.length-=u;break}t.mode=je;break;case gl:for(;l<14;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(t.nlen=(f&31)+257,f>>>=5,l-=5,t.ndist=(f&31)+1,f>>>=5,l-=5,t.ncode=(f&15)+4,f>>>=4,l-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=P;break}t.have=0,t.mode=xl;case xl:for(;t.have<t.ncode;){for(;l<3;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}t.lens[z[t.have++]]=f&7,f>>>=3,l-=3}for(;t.have<19;)t.lens[z[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,m={bits:t.lenbits},L=Qr(Rp,t.lens,0,19,t.lencode,0,t.work,m),t.lenbits=m.bits,L){e.msg="invalid code lengths set",t.mode=P;break}t.have=0,t.mode=bl;case bl:for(;t.have<t.nlen+t.ndist;){for(;E=t.lencode[f&(1<<t.lenbits)-1],x=E>>>24,B=E>>>16&255,I=E&65535,!(x<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(I<16)f>>>=x,l-=x,t.lens[t.have++]=I;else{if(I===16){for(A=x+2;l<A;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(f>>>=x,l-=x,t.have===0){e.msg="invalid bit length repeat",t.mode=P;break}y=t.lens[t.have-1],u=3+(f&3),f>>>=2,l-=2}else if(I===17){for(A=x+3;l<A;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=x,l-=x,y=0,u=3+(f&7),f>>>=3,l-=3}else{for(A=x+7;l<A;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=x,l-=x,y=0,u=11+(f&127),f>>>=7,l-=7}if(t.have+u>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=P;break}for(;u--;)t.lens[t.have++]=y}}if(t.mode===P)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=P;break}if(t.lenbits=9,m={bits:t.lenbits},L=Qr(rc,t.lens,0,t.nlen,t.lencode,0,t.work,m),t.lenbits=m.bits,L){e.msg="invalid literal/lengths set",t.mode=P;break}if(t.distbits=6,t.distcode=t.distdyn,m={bits:t.distbits},L=Qr(nc,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,m),t.distbits=m.bits,L){e.msg="invalid distances set",t.mode=P;break}if(t.mode=jn,r===qn)break e;case jn:t.mode=Jn;case Jn:if(s>=6&&c>=258){e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,t.hold=f,t.bits=l,Tp(e,h),a=e.next_out,i=e.output,c=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,f=t.hold,l=t.bits,t.mode===je&&(t.back=-1);break}for(t.back=0;E=t.lencode[f&(1<<t.lenbits)-1],x=E>>>24,B=E>>>16&255,I=E&65535,!(x<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(B&&(B&240)===0){for(_=x,D=B,S=I;E=t.lencode[S+((f&(1<<_+D)-1)>>_)],x=E>>>24,B=E>>>16&255,I=E&65535,!(_+x<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=_,l-=_,t.back+=_}if(f>>>=x,l-=x,t.back+=x,t.length=I,B===0){t.mode=Il;break}if(B&32){t.back=-1,t.mode=je;break}if(B&64){e.msg="invalid literal/length code",t.mode=P;break}t.extra=B&15,t.mode=yl;case yl:if(t.extra){for(A=t.extra;l<A;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}t.length+=f&(1<<t.extra)-1,f>>>=t.extra,l-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=wl;case wl:for(;E=t.distcode[f&(1<<t.distbits)-1],x=E>>>24,B=E>>>16&255,I=E&65535,!(x<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if((B&240)===0){for(_=x,D=B,S=I;E=t.distcode[S+((f&(1<<_+D)-1)>>_)],x=E>>>24,B=E>>>16&255,I=E&65535,!(_+x<=l);){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}f>>>=_,l-=_,t.back+=_}if(f>>>=x,l-=x,t.back+=x,B&64){e.msg="invalid distance code",t.mode=P;break}t.offset=I,t.extra=B&15,t.mode=Sl;case Sl:if(t.extra){for(A=t.extra;l<A;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}t.offset+=f&(1<<t.extra)-1,f>>>=t.extra,l-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=P;break}t.mode=Al;case Al:if(c===0)break e;if(u=h-c,t.offset>u){if(u=t.offset-u,u>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=P;break}u>t.wnext?(u-=t.wnext,p=t.wsize-u):p=t.wnext-u,u>t.length&&(u=t.length),b=t.window}else b=i,p=a-t.offset,u=t.length;u>c&&(u=c),c-=u,t.length-=u;do i[a++]=b[p++];while(--u);t.length===0&&(t.mode=Jn);break;case Il:if(c===0)break e;i[a++]=t.length,c--,t.mode=Jn;break;case Ko:if(t.wrap){for(;l<32;){if(s===0)break e;s--,f|=n[o++]<<l,l+=8}if(h-=c,e.total_out+=h,t.total+=h,t.wrap&4&&h&&(e.adler=t.check=t.flags?W(t.check,i,h,a-h):on(t.check,i,h,a-h)),h=c,t.wrap&4&&(t.flags?f:Dl(f))!==t.check){e.msg="incorrect data check",t.mode=P;break}f=0,l=0}t.mode=Bl;case Bl:if(t.wrap&&t.flags){for(;l<32;){if(s===0)break e;s--,f+=n[o++]<<l,l+=8}if(t.wrap&4&&f!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=P;break}f=0,l=0}t.mode=Tl;case Tl:L=Up;break e;case P:L=ic;break e;case ac:return oc;case sc:default:return Ee}return e.next_out=a,e.avail_out=c,e.next_in=o,e.avail_in=s,t.hold=f,t.bits=l,(t.wsize||h!==e.avail_out&&t.mode<P&&(t.mode<Ko||r!==ol))&&hc(e,e.output,e.next_out,h-e.avail_out),d-=e.avail_in,h-=e.avail_out,e.total_in+=d,e.total_out+=h,t.total+=h,t.wrap&4&&h&&(e.adler=t.check=t.flags?W(t.check,i,h,e.next_out-h):on(t.check,i,h,e.next_out-h)),e.data_type=t.bits+(t.last?64:0)+(t.mode===je?128:0)+(t.mode===jn||t.mode===Yo?256:0),(d===0&&h===0||r===ol)&&L===Zt&&(L=Zp),L},Kp=e=>{if(Mt(e))return Ee;let r=e.state;return r.window&&(r.window=null),e.state=null,Zt},Gp=(e,r)=>{if(Mt(e))return Ee;let t=e.state;return(t.wrap&2)===0?Ee:(t.head=r,r.done=!1,Zt)},Xp=(e,r)=>{let t=r.length,n,i,o;return Mt(e)||(n=e.state,n.wrap!==0&&n.mode!==ri)?Ee:n.mode===ri&&(i=1,i=on(i,r,t,0),i!==n.check)?ic:(o=hc(e,r,t,t),o?(n.mode=ac,oc):(n.havedict=1,Zt))},Wp=lc,qp=cc,jp=fc,Jp=$p,Qp=uc,e_=Yp,t_=Kp,r_=Gp,n_=Xp,i_="pako inflate (from Nodeca project)",Me={inflateReset:Wp,inflateReset2:qp,inflateResetKeep:jp,inflateInit:Jp,inflateInit2:Qp,inflate:e_,inflateEnd:t_,inflateGetHeader:r_,inflateSetDictionary:n_,inflateInfo:i_};function o_(){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 a_=o_,dc=Object.prototype.toString,{Z_NO_FLUSH:s_,Z_FINISH:kl,Z_OK:ur,Z_STREAM_END:Wo,Z_NEED_DICT:qo,Z_STREAM_ERROR:f_,Z_DATA_ERROR:Cl,Z_MEM_ERROR:l_,Z_BUF_ERROR:vl}=zt,c_={chunkSize:1024*64,windowBits:15,to:""};function un(e){this.options=ii.assign({},c_,e||{});let r=this.options;r.raw&&r.windowBits>=0&&r.windowBits<16&&(r.windowBits=-r.windowBits,r.windowBits===0&&(r.windowBits=-15)),r.windowBits>=0&&r.windowBits<16&&!(e&&e.windowBits)&&(r.windowBits+=32),r.windowBits>15&&r.windowBits<48&&(r.windowBits&15)===0&&(r.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ec,this.strm.avail_out=0;let t=Me.inflateInit2(this.strm,r.windowBits);if(t!==ur)throw new Error(Ot[t]);if(this.header=new a_,Me.inflateGetHeader(this.strm,this.header),r.dictionary&&(typeof r.dictionary=="string"?r.dictionary=sn.string2buf(r.dictionary):dc.call(r.dictionary)==="[object ArrayBuffer]"&&(r.dictionary=new Uint8Array(r.dictionary)),r.raw&&(t=Me.inflateSetDictionary(this.strm,r.dictionary),t!==ur)))throw new Error(Ot[t])}un.prototype.push=function(e,r){let t=this.strm,n=this.options.chunkSize,i=this.options.dictionary,o,a,s;if(this.ended)return!1;for(r===~~r?a=r:a=r===!0?kl:s_,dc.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),o=Me.inflate(t,a),o===qo&&i&&(o=Me.inflateSetDictionary(t,i),o===ur?o=Me.inflate(t,a):o===Cl&&(o=qo));t.avail_in>0&&o===Wo&&t.state.wrap&2&&t.state.flags!==0&&t.input[t.next_in]!==0;)Me.inflateReset(t),o=Me.inflate(t,a);switch(o){case f_:case Cl:case qo:case l_:return this.onEnd(o),this.ended=!0,!1}if(s=t.avail_out,t.next_out&&(t.avail_out===0||o===Wo||a>0))if(this.options.to==="string"){let c=sn.utf8border(t.output,t.next_out),f=t.next_out-c,l=sn.buf2string(t.output,c);t.next_out=f,t.avail_out=n-f,f&&t.output.set(t.output.subarray(c,c+f),0),this.onData(l)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out)),t.avail_out=0,t.next_out=0;if(!((o===ur||o===vl)&&s===0)){if(o===Wo)return o=Me.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(t.avail_in===0){if(a===kl)return o=Me.inflateEnd(this.strm),this.onEnd(o===ur?vl:o),this.ended=!0,!1;break}}}return!0};un.prototype.onData=function(e){this.chunks.push(e)};un.prototype.onEnd=function(e){e===ur&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ii.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function da(e,r){let t=new un(r);if(t.push(e,!0),t.err)throw t.msg||Ot[t.err];return t.result}function u_(e,r){return r=r||{},r.raw=!0,da(e,r)}var h_=un,d_=da,p_=u_,__=da,m_=zt,E_={Inflate:h_,inflate:d_,inflateRaw:p_,ungzip:__,constants:m_},{Deflate:g_,deflate:x_,deflateRaw:b_,gzip:y_}=Ip,{Inflate:w_,inflate:S_,inflateRaw:A_,ungzip:I_}=E_,B_=g_,T_=x_,D_=b_,L_=y_,k_=w_,C_=S_,v_=A_,R_=I_,O_=zt,pc={Deflate:B_,deflate:T_,deflateRaw:D_,gzip:L_,Inflate:k_,inflate:C_,inflateRaw:v_,ungzip:R_,constants:O_};async function _c(e,r){let t=r instanceof ArrayBuffer?new Uint8Array(r):r;if(e===0)return t.slice();if(e===8){let n=pc.inflateRaw(t);return n instanceof Uint8Array?n:new Uint8Array(n)}if(e===93){let n=await Cn(t);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}throw new Error(`unsupported compression method ${e}`)}var ai=class{constructor(r){this.zipkit=r}calculateLocalHeaderSize(r,t){if(t.localHdrOffset+Z.SIZE>r.length)throw new Error(`Local header offset ${t.localHdrOffset} is beyond buffer size ${r.length} for entry ${t.filename}`);let n=r.subarray(t.localHdrOffset,t.localHdrOffset+Z.SIZE);if(n.readUInt32LE(0)!==Z.SIGNATURE)throw new Error(`Invalid local file header signature for entry ${t.filename} at offset ${t.localHdrOffset}`);let i=n.readUInt16LE(Z.FNAME_LEN),o=n.readUInt16LE(Z.EXTRA_LEN);return Z.SIZE+i+o}copyEntryBytes(r,t){let n=this.calculateLocalHeaderSize(r,t),i=(t.bitFlags&V.DATA_DESC)!==0,o=i?Ui(t.usesZip64Extra):0,a=n+t.compressedSize+o;if(zi(t.uncompressedSize,t.compressedSize,t.localHdrOffset),t.localHdrOffset+a>r.length)throw new Error(`Entry ${t.filename} extends beyond buffer size: offset ${t.localHdrOffset} + size ${a} > buffer length ${r.length}`);let s=r.subarray(t.localHdrOffset,t.localHdrOffset+a);if(i){let c=n+t.compressedSize,f=s.readUInt32LE(c);if(f!==134695760)throw new Error(`Invalid data descriptor signature for entry ${t.filename} (expected 0x08074b50, got 0x${f.toString(16)})`)}return Buffer.from(s)}cloneEntryWithOffset(r,t){let n=new xe(r.filename,r.comment||null,r.debug);return n.verMadeBy=r.verMadeBy,n.verExtract=r.verExtract,n.bitFlags=r.bitFlags,n.cmpMethod=r.cmpMethod,n.timeDateDOS=r.timeDateDOS,n.crc=r.crc,n.compressedSize=r.compressedSize,n.uncompressedSize=r.uncompressedSize,n.volNumber=r.volNumber,n.intFileAttr=r.intFileAttr,n.extFileAttr=r.extFileAttr,n.localHdrOffset=t,r.extraField&&(n.extraField=Buffer.from(r.extraField)),n.isEncrypted=r.isEncrypted,n.isStrongEncrypt=r.isStrongEncrypt,n.isDirectory=r.isDirectory,n.isMetaData=r.isMetaData,n.isUpdated=r.isUpdated,n.platform=r.platform,n.universalTime=r.universalTime,n.uid=r.uid,n.gid=r.gid,n.sha256=r.sha256,n.isSymlink=r.isSymlink,n.linkTarget=r.linkTarget,n.isHardLink=r.isHardLink,n.originalEntry=r.originalEntry,n.inode=r.inode,n.usesZip64Extra=r.usesZip64Extra,r.additionalExtra&&(n.additionalExtra=Buffer.from(r.additionalExtra)),n.aesVersion=r.aesVersion,n.aesStrength=r.aesStrength,n.realCmpMethod=r.realCmpMethod,n.neoCryptoPayloadVersion=r.neoCryptoPayloadVersion,n.neoCryptoAlgorithm=r.neoCryptoAlgorithm,n.neoCryptoFlags=r.neoCryptoFlags,n}buildCentralDirectoryAndEOCDBuffer(r,t,n){if(Xt(0,0,0,0,n)||r.some(c=>Xt(c.uncompressedSize,c.compressedSize,c.localHdrOffset)))throw new Error(Kt);let i=[];for(let c of r)i.push(c.centralDirEntry());let o=Buffer.concat(i),a=o.length;if(Xt(0,0,0,a,n))throw new Error(Kt);let s=Ir({totalEntries:r.length,centralDirSize:a,centralDirOffset:n,zip64EocdOffset:n+a,archiveComment:t,allowSizeOffsetZip64:!1});return Buffer.concat([o,s])}async copyZipEntriesOnly(r,t){let n=this.zipkit.loadZip(r),i=t?.entryFilter?n.filter(t.entryFilter):n;if(t?.entrySorter&&(i=[...i].sort(t.entrySorter)),i.length===0)throw new Error("No entries to copy after filtering");let o=[],a=0,s=[];for(let f of i){let l=a,d=this.copyEntryBytes(r,f);o.push(d),a+=d.length;let h=this.cloneEntryWithOffset(f,l);s.push(h)}let c=Buffer.concat(o);return{entryDataBuffer:c,dataEndOffset:c.length,copiedEntries:s}}writeCentralDirectoryAndEOCD(r,t){if(r.length===0)throw new Error("At least one entry is required to finalize");let n=t?.zipComment??"",i=t?.centralDirOffset??0;return this.buildCentralDirectoryAndEOCDBuffer(r,n,i)}async copyZipBuffer(r,t){let{entryDataBuffer:n,dataEndOffset:i,copiedEntries:o}=await this.copyZipEntriesOnly(r,t),a=t?.preserveComments!==!1&&this.zipkit.getZipComment()?this.zipkit.getZipComment():"",s=this.writeCentralDirectoryAndEOCD(o,{zipComment:a,centralDirOffset:i}),c=Buffer.concat([n,s]);return{entries:o.map(f=>({filename:f.filename,localHeaderOffset:f.localHdrOffset,compressedSize:f.compressedSize})),centralDirOffset:i,totalEntries:o.length,zipBuffer:c}}};var U_={base64:!0,array:!0,string:!0,isNode:!0,buffer:!0,uint8array:!0,arrayBuffer:typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",blob:!0,streams:!0,fileReader:!1},Ft=U_;var $e={STRING:"string",BUFFER:"buffer",ARRAY:"array",ARRAYBUFFER:"arraybuffer",U8ARRAY:"uint8array",BLOB:"blob",STREAM:"stream"};function N_(e,r){var t=Buffer.from(e.subarray(r,r+8));return t.swap64(),parseInt(`0x${t.toString("hex")}`)}var Z_=(e,r)=>Math.imul(e,r)>>>0;function z_(e){if(!e||typeof e!="object")return!1;let r=e;return typeof r.on=="function"&&typeof r.pause=="function"&&typeof r.resume=="function"}function si(e){if(typeof e=="string"){if(!Ft.string)throw new Error(M.DATATYPE_STRING_UNSUPPORTED);return $e.STRING}else if(Object.prototype.toString.call(e)==="[object Array]"){if(!Ft.array)throw new Error(M.DATATYPE_ARRAY_UNSUPPORTED);return $e.ARRAY}else if(Buffer.isBuffer(e)){if(!Ft.buffer)throw new Error(M.DATATYPE_BUFFER_UNSUPPORTED);return $e.BUFFER}else if(e instanceof Blob){if(!Ft.blob)throw new Error(M.DATATYPE_BLOB_UNSUPPORTED);return $e.BLOB}else if(e instanceof Uint8Array){if(!Ft.uint8array)throw new Error(M.DATATYPE_U8ARRAY_UNSUPPORTED);return $e.U8ARRAY}else if(e instanceof ArrayBuffer){if(!Ft.arrayBuffer)throw new Error(M.DATATYPE_ARRAYBUFFER_UNSUPPORTED);return $e.ARRAYBUFFER}else throw new Error(M.DATATYPE_UNSUPPORTED)}var M_=e=>Q(e);var fi=class{constructor(r,t){this.lastReportedPercent=-1;this.fileName=r,this.totalBytes=t,this.processedBytes=0,this.startTime=Date.now(),this.lastUpdateTime=this.startTime}update(r){this.processedBytes+=r,this.reportProgress()}setTotalBytes(r){this.totalBytes=r}reportProgress(){let r=Date.now(),t=Math.floor(this.processedBytes/this.totalBytes*100);(t>this.lastReportedPercent||r-this.lastUpdateTime>500)&&(this.lastReportedPercent=t,this.lastUpdateTime=r,this.printProgress())}printProgress(){let r=(Date.now()-this.startTime)/1e3,t=this.processedBytes/r,n=this.totalBytes>this.processedBytes?(this.totalBytes-this.processedBytes)/t:0,i=Math.floor(this.processedBytes/this.totalBytes*100),o=s=>{let c=["B","KB","MB","GB"],f=s,l=0;for(;f>=1024&&l<c.length-1;)f/=1024,l++;return`${f.toFixed(1)}${c[l]}`},a=s=>s<60?`${s.toFixed(0)}s`:s<3600?`${Math.floor(s/60)}m ${(s%60).toFixed(0)}s`:`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`;process.stdout.write(`\r${this.fileName}: ${i}% (${o(this.processedBytes)}/${o(this.totalBytes)}) [${o(t)}/s] ETA: ${a(n)}`)}complete(){let r=(Date.now()-this.startTime)/1e3,t=this.processedBytes/r,n=i=>{let o=["B","KB","MB","GB"],a=i,s=0;for(;a>=1024&&s<o.length-1;)a/=1024,s++;return`${a.toFixed(1)}${o[s]}`};console.log(`\r${this.fileName}: 100% (${n(this.processedBytes)}) [${n(t)}/s] completed in ${r.toFixed(1)}s`)}getProgressPercent(){return Math.floor(this.processedBytes/this.totalBytes*100)}getProcessingRate(){let r=(Date.now()-this.startTime)/1e3;return this.processedBytes/r}};var ma=1,_a=2048,we={URI:1,CRC32:2,SIZE:3,MTIME:4,SHA256:5};function F_(e){let r=typeof e=="string"?Buffer.from(e,"hex"):e;if(r.length!==32)throw new Error("0x014F sha256 must be 32 bytes");return r}function hn(e,r){let t=Buffer.alloc(3+r.length);return t.writeUInt8(e,0),t.writeUInt16LE(r.length,1),r.copy(t,3),t}function pa(e,r){if(!Number.isFinite(r)||!Number.isInteger(r))throw new Error(`0x014F ${e} must be an integer`)}function mc(e){return e?typeof e.uri=="string"&&e.uri.length>0||e.crc32!==void 0||e.size!==void 0||e.mtime!==void 0||e.sha256!==void 0:!1}function P_(e){return ae(e)>>>0}function H_(e){return Buffer.from(st(e),"hex")}function $_(e){return Math.floor(e.getTime()/1e3)}function V_(e){let r=[],t=e.uri?.trim();if(t!==void 0&&t.length===0)throw new Error("0x014F URI must be non-empty when present");if(t){let a=Buffer.from(t,"utf8");if(a.length>_a)throw new Error(`0x014F URI exceeds ${_a} bytes (${a.length})`);r.push(hn(we.URI,a))}if(e.crc32!==void 0){pa("crc32",e.crc32);let a=Buffer.alloc(4);a.writeUInt32LE(e.crc32>>>0,0),r.push(hn(we.CRC32,a))}if(e.size!==void 0){if(pa("size",e.size),e.size<0)throw new Error("0x014F size must be >= 0");let a=Buffer.alloc(8);a.writeBigUInt64LE(BigInt(e.size),0),r.push(hn(we.SIZE,a))}if(e.mtime!==void 0){pa("mtime",e.mtime);let a=Buffer.alloc(8);a.writeBigInt64LE(BigInt(e.mtime),0),r.push(hn(we.MTIME,a))}if(e.sha256!==void 0&&r.push(hn(we.SHA256,F_(e.sha256))),r.length===0)throw new Error("0x014F requires at least one attribute");let n=1+r.reduce((a,s)=>a+s.length,0),i=Buffer.alloc(4+n);i.writeUInt16LE(v.ORIGIN,0),i.writeUInt16LE(n,2),i.writeUInt8(ma,4);let o=5;for(let a of r)a.copy(i,o),o+=a.length;return i}function Y_(e){let r={},t=0;for(;t+3<=e.length;){let n=e.readUInt8(t),i=e.readUInt16LE(t+1);if(t+=3,t+i>e.length)break;let o=e.subarray(t,t+i);if(t+=i,n===we.URI&&i>0){let a=o.toString("utf8");a.length>0&&(r.uri=a)}else n===we.CRC32&&i===4?r.crc32=o.readUInt32LE(0)>>>0:n===we.SIZE&&i===8?r.size=Number(o.readBigUInt64LE(0)):n===we.MTIME&&i===8?r.mtime=Number(o.readBigInt64LE(0)):n===we.SHA256&&i===32&&(r.sha256=Buffer.from(o))}return mc(r)?r:null}function Ec(e){if(!e||e.length<4)return null;let r=0;for(;r+4<=e.length;){let t=e.readUInt16LE(r),n=e.readUInt16LE(r+2);if(r+=4,r+n>e.length)break;if(t===v.ORIGIN&&n>=1){let i=e.readUInt8(r),o=e.subarray(r+1,r+n);if(i===ma){let a=Y_(o);if(a)return a}}r+=n}return null}function K_(e){return Ec(e.additionalExtra??null)}var li=class{constructor(){this.providers=new Map;this.registerProvider(new he)}registerProvider(r){r.canHandle(1)&&this.providers.set(1,r),r.canHandle(2)&&this.providers.set(2,r)}getAvailableMethods(){return Array.from(this.providers.keys())}getProvider(r){return this.providers.get(r)||null}async encrypt(r,t){let n=this.getProvider(t.method);return n?await n.encrypt(r,t):{success:!1,error:`No encryption provider available for method ${t.method}`}}async decrypt(r,t){let n=this.getProvider(t.method);return n?await n.decrypt(r,t):{success:!1,error:`No decryption provider available for method ${t.method}`}}getRecommendedMethod(){return 2}validateOptions(r){let t=[];return r.method||t.push("Encryption method is required"),(!r.password||r.password.length===0)&&t.push("Password is required"),r.password&&r.password.length<4&&t.push("Password must be at least 4 characters long"),{isValid:t.length===0,errors:t}}getMethodInfo(r){let t=this.getProvider(r);return t?{name:t.getMethodName(),keyLength:t.getKeyLength(),secure:r===2}:null}listMethods(){let r=[];for(let[t,n]of this.providers)r.push({method:t,name:n.getMethodName(),keyLength:n.getKeyLength(),secure:t===2});return r.sort((t,n)=>t.name.localeCompare(n.name))}};var Ea=new Date,G_=`${String(Ea.getMonth()+1).padStart(2,"0")}-${String(Ea.getDate()).padStart(2,"0")}-${Ea.getFullYear()}`,X_={number:"1.5.0",date:G_};var gc=kt;var dn=class extends gc{constructor(){super()}async loadZipBlob(r){if(si(r)!==$e.BLOB)throw new Error(M.DATATYPE_UNSUPPORTED);return new Promise((t,n)=>{let i=new window.FileReader;i.readAsArrayBuffer(r),i.onload=o=>{if(!i.result){n(new Error("Failed to read file"));return}try{let a=Buffer.from(i.result),s=super.loadZip(a);t(s)}catch(a){n(a)}},i.onerror=()=>{n(i.error||new Error("Failed to read file"))}})}createZipFileEntry(r){let t=super.createZipEntry(r.name);t.fileData=r,t.uncompressedSize=r.size;let n=new Date(r.lastModified);return t.timeDateDOS=t.setDateTime(n),t.cmpMethod=C.DEFLATED,t}async hashFile(r){let t=await r.arrayBuffer(),n=Buffer.from(t);return st(n)}async compressDataBlob(r,t,n){if(si(t)!==$e.BLOB)throw new Error(M.DATATYPE_UNSUPPORTED);return new Promise(async(i,o)=>{let a=async(c,f,l)=>await this.compressData(c,f,l),s=new window.FileReader;s.readAsArrayBuffer(t),s.onload=async function(c){if(!this.result){o(new Error("Failed to read file"));return}try{let f=Buffer.from(this.result),l=await a(r,f,n);i(l)}catch(f){o(f)}},s.onerror=function(c){o(this.error||new Error("Failed to read file"))}})}async extractBlob(r,t){try{let n=await this.extract(r,t);if(!n)return null;let i=new Uint8Array(n);return new Blob([i],{type:"application/octet-stream"})}catch(n){throw n}}async createZipBlob(r,t){let n=t?.onError||(()=>{}),i=t?.onEntryDone||(()=>{}),o=super.getDirectory();if(!o)return n(new Error(M.NO_FILES)),null;let a=0,s=[];for(let u of o){if(!u.isUpdated)if(Q(u.filename||""))u.isUpdated=!0;else{let b=await super.copyEntry(u);u.localHdrOffset=a,a+=b.length,s.push(b),i(u,"Copied");continue}if(!u.fileData)return n(new Error(M.FILE_NOT_FOUND)),null;let p=await u.fileData.arrayBuffer();if(u.cmpData&&u.compressedSize&&u.crc){let b=u.createLocalHdr();u.localHdrOffset=a,a+=b.length+u.cmpData.length,s.push(b),s.push(u.cmpData),i(u,"Written (pre-compressed)");continue}if(Q(u.filename||"")){let b=Buffer.from(p);u.crc=ae(b),u.cmpMethod=0,u.compressedSize=b.length,u.uncompressedSize=b.length;let E=u.createLocalHdr();u.localHdrOffset=a,a+=E.length+b.length,s.push(E),s.push(b),i(u,"Stored (metadata)")}else{let b=await this.compressData(u,Buffer.from(p),r),E=u.createLocalHdr();u.localHdrOffset=a,a+=E.length+b.length,s.push(E),s.push(b),i(u,"Written")}}let c=a;for(let u of o){let p=u.centralDirEntry();a+=p.length,s.push(p)}let f=a-c,l=super.centralEndHdr(f,c);s.push(l);let d=Buffer.concat(s),h=new Uint8Array(d);return new Blob([h],{type:"application/zip"})}isMetadataFile(r){return Q(r)}async addFile(r,t){let n=this.createZipFileEntry(r),i=r,o=await this.compressDataBlob(n,i,t);return n.cmpData=o,n}async verifyEntry(r,t){try{return await this.extractBlob(r,t)!==null}catch(n){return console.error(`Verification failed for ${r.filename}:`,n),!1}}};typeof globalThis<"u"&&(globalThis.Buffer=xc.Buffer);var W_={isBrowser:typeof window<"u"&&typeof document<"u",isNode:typeof process<"u"&&process.versions&&process.versions.node};return Bc(q_);})();
9
9
  /*! Bundled license information:
10
10
 
11
11
  ieee754/index.js:
@@ -18,4 +18,7 @@ buffer/index.js:
18
18
  * @author Feross Aboukhadijeh <https://feross.org>
19
19
  * @license MIT
20
20
  *)
21
+
22
+ pako/dist/pako.esm.mjs:
23
+ (*! pako 2.2.0 https://github.com/nodeca/pako @license (MIT AND Zlib) *)
21
24
  */