@gmod/tabix 2.0.3 → 2.0.4
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.
- package/CHANGELOG.md +4 -0
- package/dist/csi.js +2 -2
- package/dist/csi.js.map +1 -1
- package/dist/long.d.ts +3 -0
- package/dist/long.js +18 -0
- package/dist/long.js.map +1 -0
- package/dist/tabix-bundle.js +1 -1
- package/dist/tbi.js +4 -3
- package/dist/tbi.js.map +1 -1
- package/esm/csi.js +2 -2
- package/esm/csi.js.map +1 -1
- package/esm/long.d.ts +3 -0
- package/esm/long.js +14 -0
- package/esm/long.js.map +1 -0
- package/esm/tbi.js +4 -3
- package/esm/tbi.js.map +1 -1
- package/package.json +1 -2
- package/src/csi.ts +2 -4
- package/src/long.ts +16 -0
- package/src/tbi.ts +4 -8
package/CHANGELOG.md
CHANGED
package/dist/csi.js
CHANGED
|
@@ -41,7 +41,7 @@ const virtualOffset_1 = __importStar(require("./virtualOffset"));
|
|
|
41
41
|
const chunk_1 = __importDefault(require("./chunk"));
|
|
42
42
|
const util_1 = require("./util");
|
|
43
43
|
const indexFile_1 = __importDefault(require("./indexFile"));
|
|
44
|
-
const
|
|
44
|
+
const long_1 = require("./long");
|
|
45
45
|
const CSI1_MAGIC = 21582659; // CSI\1
|
|
46
46
|
const CSI2_MAGIC = 38359875; // CSI\2
|
|
47
47
|
const formats = {
|
|
@@ -210,7 +210,7 @@ class CSI extends indexFile_1.default {
|
|
|
210
210
|
}
|
|
211
211
|
parsePseudoBin(bytes, offset) {
|
|
212
212
|
return {
|
|
213
|
-
lineCount: (0,
|
|
213
|
+
lineCount: (0, long_1.longFromBytesToUnsigned)(bytes, offset + 28),
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
async blocksForRange(refName, min, max, opts = {}) {
|
package/dist/csi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csi.js","sourceRoot":"","sources":["../src/csi.ts"],"names":[],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AC,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;gBAC5C,MAAM,IAAI,KAAK,CACb,SAAS,GAAG,IAAI,GAAG,mDAAmD,IAAI,CAAC,QAAQ,WAAW,IAAI,CAAC,KAAK,0DAA0D,CACnK,CAAA;YACH,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAU,CAAC,CAAA;QAC5B,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AApPD,sBAoPC"}
|
package/dist/long.d.ts
ADDED
package/dist/long.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TWO_PWR_32_DBL = exports.TWO_PWR_16_DBL = void 0;
|
|
4
|
+
exports.longFromBytesToUnsigned = longFromBytesToUnsigned;
|
|
5
|
+
exports.TWO_PWR_16_DBL = 1 << 16;
|
|
6
|
+
exports.TWO_PWR_32_DBL = exports.TWO_PWR_16_DBL * exports.TWO_PWR_16_DBL;
|
|
7
|
+
function longFromBytesToUnsigned(source, i = 0) {
|
|
8
|
+
const low = source[i] |
|
|
9
|
+
(source[i + 1] << 8) |
|
|
10
|
+
(source[i + 2] << 16) |
|
|
11
|
+
(source[i + 3] << 24);
|
|
12
|
+
const high = source[i + 4] |
|
|
13
|
+
(source[i + 5] << 8) |
|
|
14
|
+
(source[i + 6] << 16) |
|
|
15
|
+
(source[i + 7] << 24);
|
|
16
|
+
return (high >>> 0) * exports.TWO_PWR_32_DBL + (low >>> 0);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=long.js.map
|
package/dist/long.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"long.js","sourceRoot":"","sources":["../src/long.ts"],"names":[],"mappings":";;;AAGA,0DAYC;AAfY,QAAA,cAAc,GAAG,CAAC,IAAI,EAAE,CAAA;AACxB,QAAA,cAAc,GAAG,sBAAc,GAAG,sBAAc,CAAA;AAE7D,SAAgB,uBAAuB,CAAC,MAAkB,EAAE,CAAC,GAAG,CAAC;IAC/D,MAAM,GAAG,GACP,MAAM,CAAC,CAAC,CAAE;QACV,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,IAAI,CAAC,CAAC;QACrB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,IAAI,EAAE,CAAC;QACtB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,IAAI,EAAE,CAAC,CAAA;IACxB,MAAM,IAAI,GACR,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE;QACd,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,IAAI,CAAC,CAAC;QACrB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,IAAI,EAAE,CAAC;QACtB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,IAAI,EAAE,CAAC,CAAA;IACxB,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,sBAAc,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAA;AACpD,CAAC"}
|
package/dist/tabix-bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var t={963:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{constructor(t,e,n,i=void 0){this.minv=t,this.maxv=e,this.bin=n,this._fetchedSize=i}toUniqueString(){return`${this.minv}..${this.maxv} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`}toString(){return this.toUniqueString()}compareTo(t){return this.minv.compareTo(t.minv)||this.maxv.compareTo(t.maxv)||this.bin-t.bin}fetchedSize(){return void 0!==this._fetchedSize?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}},875:function(t,e,n){"use strict";var i,r=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||(i=function(t){return i=Object.getOwnPropertyNames||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[e.length]=n);return e},i(t)},function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n=i(t),s=0;s<n.length;s++)"default"!==n[s]&&r(e,t,n[s]);return a(e,t),e}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const h=n(148),l=s(n(758)),u=o(n(963)),f=n(472),c=o(n(656)),d=n(620),g={0:"generic",1:"SAM",2:"VCF"};function _(t,e){return Math.floor(t/2**e)}class w extends c.default{constructor(t){super(t),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(t,e={}){const n=await this.parse(e),i=n.refNameToId[t];if(void 0===i)return-1;if(!n.indices[i])return-1;const{stats:r}=n.indices[i];return r?r.lineCount:-1}indexCov(){throw new Error("CSI indexes do not support indexcov")}parseAuxData(t,e){const n=new DataView(t.buffer),i=n.getInt32(e,!0),r=65536&i?"zero-based-half-open":"1-based-closed",a=g[15&i];if(!a)throw new Error(`invalid Tabix preset format flags ${i}`);const s={ref:n.getInt32(e+4,!0),start:n.getInt32(e+8,!0),end:n.getInt32(e+12,!0)},o=n.getInt32(e+16,!0),h=o?String.fromCharCode(o):null,l=n.getInt32(e+20,!0),u=n.getInt32(e+24,!0),{refIdToName:f,refNameToId:c}=this._parseNameBytes(t.subarray(e+28,e+28+u));return{refIdToName:f,refNameToId:c,skipLines:l,metaChar:h,columnNumbers:s,format:a,coordinateType:r}}_parseNameBytes(t){let e=0,n=0;const i=[],r={},a=new TextDecoder("utf8");for(let s=0;s<t.length;s+=1)if(!t[s]){if(n<s){const o=this.renameRefSeq(a.decode(t.subarray(n,s)));i[e]=o,r[o]=e}n=s+1,e+=1}return{refNameToId:r,refIdToName:i}}async _parse(t={}){const e=await(0,h.unzip)(await this.filehandle.readFile(t)),n=new DataView(e.buffer);let i;if(21582659===n.getUint32(0,!0))i=1;else{if(38359875!==n.getUint32(0,!0))throw new Error("Not a CSI file");i=2}this.minShift=n.getInt32(4,!0),this.depth=n.getInt32(8,!0),this.maxBinNumber=((1<<3*(this.depth+1))-1)/7;const r=2**(this.minShift+3*this.depth),a=n.getInt32(12,!0),s=a&&a>=30?this.parseAuxData(e,16):{refIdToName:[],refNameToId:{},metaChar:null,columnNumbers:{ref:0,start:1,end:2},coordinateType:"zero-based-half-open",format:"generic"},o=n.getInt32(16+a,!0);let f,c=16+a+4;const d=new Array(o).fill(0).map((()=>{const t=n.getInt32(c,!0);c+=4;const i={};let r;for(let a=0;a<t;a+=1){const t=n.getUint32(c,!0);if(t>this.maxBinNumber)r=this.parsePseudoBin(e,c+4),c+=48;else{const r=(0,l.fromBytes)(e,c+4);f=this._findFirstData(f,r);const a=n.getInt32(c+12,!0);c+=16;const s=new Array(a);for(let n=0;n<a;n+=1){const i=(0,l.fromBytes)(e,c),r=(0,l.fromBytes)(e,c+8);c+=16,s[n]=new u.default(i,r,t)}i[t]=s}}return{binIndex:i,stats:r}}));return{...s,csi:!0,refCount:o,maxBlockSize:65536,firstDataLine:f,csiVersion:i,indices:d,depth:this.depth,maxBinNumber:this.maxBinNumber,maxRefLength:r}}parsePseudoBin(t,e){return{lineCount:(0,d.toNumber)((0,d.fromBytesLE)(t.subarray(e+28,e+36),!0))}}async blocksForRange(t,e,n,i={}){e<0&&(e=0);const r=await this.parse(i),a=r.refNameToId[t];if(void 0===a)return[];const s=r.indices[a];if(!s)return[];const o=this.reg2bins(e,n),h=[];for(const[t,e]of o)for(let n=t;n<=e;n++)if(s.binIndex[n])for(const t of s.binIndex[n])h.push(new u.default(t.minv,t.maxv,n));return(0,f.optimizeChunks)(h,new l.default(0,0))}reg2bins(t,e){(t-=1)<1&&(t=1),e>2**50&&(e=2**34),e-=1;let n=0,i=0,r=this.minShift+3*this.depth;const a=[];for(;n<=this.depth;r-=3,i+=1*2**(3*n),n+=1){const n=i+_(t,r),s=i+_(e,r);if(s-n+a.length>this.maxBinNumber)throw new Error(`query ${t}-${e} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);a.push([n,s])}return a}}e.default=w},806:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.TBI=e.CSI=e.TabixIndexedFile=void 0;var r=n(285);Object.defineProperty(e,"TabixIndexedFile",{enumerable:!0,get:function(){return i(r).default}});var a=n(875);Object.defineProperty(e,"CSI",{enumerable:!0,get:function(){return i(a).default}});var s=n(431);Object.defineProperty(e,"TBI",{enumerable:!0,get:function(){return i(s).default}})},656:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{constructor({filehandle:t,renameRefSeqs:e=t=>t}){this.filehandle=t,this.renameRefSeq=e}async getMetadata(t={}){const{indices:e,...n}=await this.parse(t);return n}_findFirstData(t,e){return t?t.compareTo(e)>0?e:t:e}async parse(t={}){return this.parseP||(this.parseP=this._parse(t).catch((t=>{throw this.parseP=void 0,t}))),this.parseP}async hasRefSeq(t,e={}){const n=await this.parse(e);return!!n.indices[t]?.binIndex}}},285:function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=i(n(430)),a=i(n(392)),s=n(689),o=n(148),h=n(472),l=i(n(431)),u=i(n(875));function f(t){return/^[\u0000-\u007F]*$/.test(t)}e.default=class{constructor({path:t,filehandle:e,url:n,tbiPath:i,tbiUrl:o,tbiFilehandle:h,csiPath:f,csiUrl:c,csiFilehandle:d,renameRefSeqs:g=t=>t,chunkCacheSize:_=5242880}){if(e)this.filehandle=e;else if(t)this.filehandle=new s.LocalFile(t);else{if(!n)throw new TypeError("must provide either filehandle or path");this.filehandle=new s.RemoteFile(n)}if(h)this.index=new l.default({filehandle:h,renameRefSeqs:g});else if(d)this.index=new u.default({filehandle:d,renameRefSeqs:g});else if(i)this.index=new l.default({filehandle:new s.LocalFile(i),renameRefSeqs:g});else if(f)this.index=new u.default({filehandle:new s.LocalFile(f),renameRefSeqs:g});else if(t)this.index=new l.default({filehandle:new s.LocalFile(`${t}.tbi`),renameRefSeqs:g});else if(c)this.index=new u.default({filehandle:new s.RemoteFile(c)});else if(o)this.index=new l.default({filehandle:new s.RemoteFile(o)});else{if(!n)throw new TypeError("must provide one of tbiFilehandle, tbiPath, csiFilehandle, csiPath, tbiUrl, csiUrl");this.index=new l.default({filehandle:new s.RemoteFile(`${n}.tbi`)})}this.renameRefSeq=g,this.chunkCache=new r.default({cache:new a.default({maxSize:Math.floor(_/65536)}),fill:(t,e)=>this.readChunk(t,{signal:e})})}async getLines(t,e,n,i){let r,a,s={};"function"==typeof i?a=i:(s=i,a=i.lineCallback,r=i.signal);const o=await this.index.getMetadata(s);(0,h.checkAbortSignal)(r);const l=e??0,u=n??o.maxRefLength;if(!(l<=u))throw new TypeError("invalid start and end coordinates. start must be less than or equal to end");if(l===u)return;const c=await this.index.blocksForRange(t,l,u,s);(0,h.checkAbortSignal)(r);const d=new TextDecoder("utf8");for(const e of c){const{buffer:n,cpositions:i,dpositions:s}=await this.chunkCache.get(e.toString(),e,r);(0,h.checkAbortSignal)(r);let c=0,g=0;const _=d.decode(n),w=f(_);for(;c<_.length;){let r,h;if(w){if(h=_.indexOf("\n",c),-1===h)break;r=_.slice(c,h)}else{if(h=n.indexOf("\n".charCodeAt(0),c),-1===h)break;const t=n.slice(c,h);r=d.decode(t)}if(s){for(;c+e.minv.dataPosition>=s[g++];);g--}const{startCoordinate:f,overlaps:b}=this.checkLine(o,t,l,u,r);if(b)a(r,256*i[g]+(c-s[g])+e.minv.dataPosition+1);else if(void 0!==f&&f>=u)return;c=h+1}}}async getMetadata(t={}){return this.index.getMetadata(t)}async getHeaderBuffer(t={}){const{firstDataLine:e,metaChar:n,maxBlockSize:i}=await this.getMetadata(t);(0,h.checkAbortSignal)(t.signal);const r=(e?.blockPosition||0)+i,a=await this.filehandle.read(r,0,t),s=await(0,o.unzip)(a);if(n){let t=-1;const e="\n".charCodeAt(0),i=n.charCodeAt(0);for(let n=0;n<s.length&&(n!==t+1||s[n]===i);n+=1)s[n]===e&&(t=n);return s.subarray(0,t+1)}return s}async getHeader(t={}){const e=new TextDecoder("utf8"),n=await this.getHeaderBuffer(t);return e.decode(n)}async getReferenceSequenceNames(t={}){return(await this.getMetadata(t)).refIdToName}checkLine(t,e,n,i,r){const{columnNumbers:a,metaChar:s,coordinateType:o,format:h}=t;if(s&&r.startsWith(s))return{overlaps:!1};let{ref:l,start:u,end:f}=a;l||(l=0),u||(u=0),f||(f=0),"VCF"===h&&(f=8);const c=Math.max(l,u,f);let d=1,g=0,_="",w=-1/0;const b=r.length;for(let t=0;t<b+1;t++)if("\t"===r[t]||t===b){if(d===l){if(this.renameRefSeq(r.slice(g,t))!==e)return{overlaps:!1}}else if(d===u){if(w=parseInt(r.slice(g,t),10),"1-based-closed"===o&&(w-=1),w>=i)return{startCoordinate:w,overlaps:!1};if((0===f||f===u)&&w+1<=n)return{startCoordinate:w,overlaps:!1}}else if("VCF"===h&&4===d)_=r.slice(g,t);else if(d===f&&("VCF"===h?this._getVcfEnd(w,_,r.slice(g,t)):Number.parseInt(r.slice(g,t),10))<=n)return{overlaps:!1};if(g=t+1,d+=1,d>c)break}return{startCoordinate:w,overlaps:!0}}_getVcfEnd(t,e,n){let i=t+e.length;const r=n.includes("SVTYPE=TRA");if("."===n[0]||r){if(r)return t+1}else{let t=";";for(let e=0;e<n.length;e+=1){if(";"===t&&"END="===n.slice(e,e+4)){let t=n.indexOf(";",e);-1===t&&(t=n.length),i=parseInt(n.slice(e+4,t),10);break}t=n[e]}}return i}async lineCount(t,e={}){return this.index.lineCount(t,e)}async readChunk(t,e={}){const n=await this.filehandle.read(t.fetchedSize(),t.minv.blockPosition,e);return(0,o.unzipChunkSlice)(n,t)}}},431:function(t,e,n){"use strict";var i,r=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||(i=function(t){return i=Object.getOwnPropertyNames||function(t){var e=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[e.length]=n);return e},i(t)},function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n=i(t),s=0;s<n.length;s++)"default"!==n[s]&&r(e,t,n[s]);return a(e,t),e}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const h=s(n(758)),l=o(n(963)),u=n(148),f=n(472),c=o(n(656)),d=n(620);class g extends c.default{async lineCount(t,e={}){const n=await this.parse(e),i=n.refNameToId[t];return void 0===i?-1:n.indices[i]?n.indices[i].stats?.lineCount??-1:-1}async _parse(t={}){const e=await this.filehandle.readFile(t),n=await(0,u.unzip)(e);(0,f.checkAbortSignal)(t.signal);const i=new DataView(n.buffer);if(21578324!==i.getUint32(0,!0))throw new Error("Not a TBI file");const r=i.getUint32(4,!0),a=i.getUint32(8,!0),s=65536&a?"zero-based-half-open":"1-based-closed",o={0:"generic",1:"SAM",2:"VCF"}[15&a];if(!o)throw new Error(`invalid Tabix preset format flags ${a}`);const c={ref:i.getInt32(12,!0),start:i.getInt32(16,!0),end:i.getInt32(20,!0)},d=i.getInt32(24,!0),g=d?String.fromCharCode(d):null,_=i.getInt32(28,!0),w=i.getInt32(32,!0),{refNameToId:b,refIdToName:m}=this._parseNameBytes(n.slice(36,36+w));let p,v=36+w;return{indices:new Array(r).fill(0).map((()=>{const t=i.getInt32(v,!0);v+=4;const e={};let r;for(let a=0;a<t;a+=1){const t=i.getUint32(v,!0);if(v+=4,t>37450)throw new Error("tabix index contains too many bins, please use a CSI index");if(37450===t){const t=i.getInt32(v,!0);v+=4,2===t&&(r=this.parsePseudoBin(n,v)),v+=16*t}else{const r=i.getInt32(v,!0);v+=4;const a=new Array(r);for(let e=0;e<r;e+=1){const i=(0,h.fromBytes)(n,v),r=(0,h.fromBytes)(n,v+8);v+=16,p=this._findFirstData(p,i),a[e]=new l.default(i,r,t)}e[t]=a}}const a=i.getInt32(v,!0);v+=4;const s=new Array(a);for(let t=0;t<a;t+=1)s[t]=(0,h.fromBytes)(n,v),v+=8,p=this._findFirstData(p,s[t]);return{binIndex:e,linearIndex:s,stats:r}})),metaChar:g,maxBinNumber:37449,maxRefLength:536870912,skipLines:_,firstDataLine:p,columnNumbers:c,coordinateType:s,format:o,refIdToName:m,refNameToId:b,maxBlockSize:65536}}parsePseudoBin(t,e){return{lineCount:(0,d.toNumber)((0,d.fromBytesLE)(t.subarray(e+16,e+24),!0))}}_parseNameBytes(t){let e=0,n=0;const i=[],r={},a=new TextDecoder("utf8");for(let s=0;s<t.length;s+=1)if(!t[s]){if(n<s){const o=this.renameRefSeq(a.decode(t.subarray(n,s)));i[e]=o,r[o]=e}n=s+1,e+=1}return{refNameToId:r,refIdToName:i}}async blocksForRange(t,e,n,i={}){e<0&&(e=0);const r=await this.parse(i),a=r.refNameToId[t];if(void 0===a)return[];const s=r.indices[a];if(!s)return[];(s.linearIndex.length?s.linearIndex[e>>14>=s.linearIndex.length?s.linearIndex.length-1:e>>14]:new h.default(0,0))||console.warn("querying outside of possible tabix range");const o=(u=e,c=n,[[0,0],[1+((u+=1)>>26),1+((c-=1)>>26)],[9+(u>>23),9+(c>>23)],[73+(u>>20),73+(c>>20)],[585+(u>>17),585+(c>>17)],[4681+(u>>14),4681+(c>>14)]]);var u,c;const d=[];for(const[t,e]of o)for(let n=t;n<=e;n++)if(s.binIndex[n])for(const t of s.binIndex[n])d.push(new l.default(t.minv,t.maxv,n));const g=s.linearIndex.length;let _=null;const w=Math.min(e>>14,g-1),b=Math.min(n>>14,g-1);for(let t=w;t<=b;++t){const e=s.linearIndex[t];e&&(!_||e.compareTo(_)<0)&&(_=e)}return(0,f.optimizeChunks)(d,_)}}e.default=g},472:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.checkAbortSignal=i,e.abortBreakPoint=async function(t){await Promise.resolve(),i(t)},e.canMergeBlocks=r,e.optimizeChunks=function(t,e){const n=[];let i=null;return 0===t.length?t:(t.sort((function(t,e){const n=t.minv.blockPosition-e.minv.blockPosition;return 0!==n?n:t.minv.dataPosition-e.minv.dataPosition})),t.forEach((t=>{(!e||t.maxv.compareTo(e)>0)&&(null===i?(n.push(t),i=t):r(i,t)?t.maxv.compareTo(i.maxv)>0&&(i.maxv=t.maxv):(n.push(t),i=t))})),n)};class n extends Error{}function i(t){if(t&&t.aborted){if("undefined"!=typeof DOMException)throw new DOMException("aborted","AbortError");{const t=new n("aborted");throw t.code="ERR_ABORTED",t}}}function r(t,e){return e.minv.blockPosition-t.maxv.blockPosition<65e3&&e.maxv.blockPosition-t.minv.blockPosition<5e6}},758:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fromBytes=function(t,e=0){return new n(1099511627776*t[e+7]+4294967296*t[e+6]+16777216*t[e+5]+65536*t[e+4]+256*t[e+3]+t[e+2],t[e+1]<<8|t[e])};class n{constructor(t,e){this.blockPosition=t,this.dataPosition=e}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(t){return this.blockPosition-t.blockPosition||this.dataPosition-t.dataPosition}}e.default=n},430:(t,e,n)=>{"use strict";n.r(e),n.d(e,{default:()=>s});class i{}class r{constructor(){this.signals=new Set,this.abortController=new AbortController}addSignal(t=new i){if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(t),t.aborted?this.handleAborted(t):"function"==typeof t.addEventListener&&t.addEventListener("abort",(()=>{this.handleAborted(t)}))}handleAborted(t){this.signals.delete(t),0===this.signals.size&&this.abortController.abort()}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}}class a{constructor(){this.callbacks=new Set}addCallback(t=()=>{}){this.callbacks.add(t),t(this.currentMessage)}callback(t){this.currentMessage=t;for(const e of this.callbacks)e(t)}}class s{constructor({fill:t,cache:e}){if("function"!=typeof t)throw new TypeError("must pass a fill function");if("object"!=typeof e)throw new TypeError("must pass a cache object");if("function"!=typeof e.get||"function"!=typeof e.set||"function"!=typeof e.delete)throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=e,this.fillCallback=t}static isAbortException(t){return"AbortError"===t.name||"ERR_ABORTED"===t.code||"AbortError: aborted"===t.message||"Error: aborted"===t.message}evict(t,e){this.cache.get(t)===e&&this.cache.delete(t)}fill(t,e,n,i){const s=new r,o=new a;o.addCallback(i);const h={aborter:s,promise:this.fillCallback(e,s.signal,(t=>{o.callback(t)})),settled:!1,statusReporter:o,get aborted(){return this.aborter.signal.aborted}};h.aborter.addSignal(n),h.aborter.signal.addEventListener("abort",(()=>{h.settled||this.evict(t,h)})),h.promise.then((()=>{h.settled=!0}),(()=>{h.settled=!0,this.evict(t,h)})).catch((t=>{throw console.error(t),t})),this.cache.set(t,h)}static checkSinglePromise(t,e){function n(){if(null==e?void 0:e.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return t.then((t=>(n(),t)),(t=>{throw n(),t}))}has(t){return this.cache.has(t)}get(t,e,n,i){if(!n&&e instanceof AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");const r=this.cache.get(t);return r?r.aborted&&!r.settled?(this.evict(t,r),this.get(t,e,n,i)):r.settled?r.promise:(r.aborter.addSignal(n),r.statusReporter.addCallback(i),s.checkSinglePromise(r.promise,n)):(this.fill(t,e,n,i),s.checkSinglePromise(this.cache.get(t).promise,n))}delete(t){const e=this.cache.get(t);e&&(e.settled||e.aborter.abort(),this.cache.delete(t))}clear(){const t=this.cache.keys();let e=0;for(let n=t.next();!n.done;n=t.next())this.delete(n.value),e+=1;return e}}},148:(t,e,n)=>{"use strict";n.r(e),n.d(e,{BgzfFilehandle:()=>V,unzip:()=>s,unzipChunkSlice:()=>o});var i=n(689),r=n(668);function a(t){const e=new Uint8Array(function(t){let e=0;for(const n of t)e+=n.length;return e}(t));let n=0;for(const i of t)e.set(i,n),n+=i.length;return e}async function s(t){try{let e,n,i=0;const s=[];do{const a=t.subarray(i);if(n=new r.Inflate,({strm:e}=n),n.push(a,r.Z_SYNC_FLUSH),n.err)throw new Error(n.msg);i+=e.next_in,s.push(n.result)}while(e.avail_in);return a(s)}catch(t){if(/incorrect header check/.exec(`${t}`))throw new Error("problem decompressing block: incorrect gzip header check");throw t}}async function o(t,e){try{let n;const{minv:i,maxv:s}=e;let o=i.blockPosition,h=i.dataPosition;const l=[],u=[],f=[];let c=0;do{const e=t.subarray(o-i.blockPosition),a=new r.Inflate;if(({strm:n}=a),a.push(e,r.Z_SYNC_FLUSH),a.err)throw new Error(a.msg);const d=a.result;l.push(d);let g=d.length;u.push(o),f.push(h),1===l.length&&i.dataPosition&&(l[0]=l[0].subarray(i.dataPosition),g=l[0].length);const _=o;if(o+=n.next_in,h+=g,_>=s.blockPosition){l[c]=l[c].subarray(0,s.blockPosition===i.blockPosition?s.dataPosition-i.dataPosition+1:s.dataPosition+1),u.push(o),f.push(h);break}c++}while(n.avail_in);return{buffer:a(l),cpositions:u,dpositions:f}}catch(t){if(/incorrect header check/.exec(`${t}`))throw new Error("problem decompressing block: incorrect gzip header check");throw t}}const h=4294967296,l=k(1<<24),u=0x10000000000000000,f=u/2,c=Object.freeze(y(0,2147483648)),d=Object.freeze(y(4294967295,2147483647)),g=Object.freeze(y(4294967295,4294967295,!0)),_=Object.freeze(k(1)),w=Object.freeze(k(1,!0)),b=Object.freeze(k(-1)),m=Object.freeze(k(0)),p=Object.freeze(k(0,!0)),v=(new Uint16Array(new Uint8Array([170,187]).buffer)[0],Math.pow);function y(t,e,n,i){return null==i?{low:0|t,high:0|e,unsigned:!!n}:(i.low=0|t,i.high=0|e,i.unsigned=!!n,i)}function k(t,e,n){let i;return e?(t>>>=0,i=0):i=0|((t|=0)<0?-1:0),y(t,i,e,n)}function x(t,e,n){if(null==n&&(n={low:0,high:0,unsigned:!1}),isNaN(t))return $(e?p:m,n);if(e){if(t<0)return $(p,n);if(t>=u)return $(g,n)}else{if(t<=-f)return $(c,n);if(t+1>=f)return $(d,n);if(t<0)return M(x(-t,e,n),n)}return n.low=t%h|0,n.high=t/h|0,n.unsigned=!!e,n}function z(t){return t.unsigned?(t.high>>>0)*h+(t.low>>>0):t.high*h+(t.low>>>0)}"undefined"==typeof BigInt||(BigInt(0),BigInt(1),BigInt(-1),BigInt(h),BigInt(u),BigInt(f));const B={source:null,target:null,offset:0};function I(t,e,n,i){return function(t,e,n,i){"number"==typeof e&&(i=n,n=e,e=!1),"object"==typeof n?(i=n,B.offset=0):B.offset=n||0,null==i?B.target={low:0,high:0,unsigned:!!e}:(i.unsigned=!!e,B.target=i),B.source=t instanceof Uint8Array||!t.buffer?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}(t,e,n,i),function(t,e,n){return n.low=t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24,n.high=t[e+4]|t[e+5]<<8|t[e+6]<<16|t[e+7]<<24,n}(B.source,B.offset,B.target)}const S=128,E=127;function A(t,e,n){let i=t[e];if(!(i&S))return n.low=i,n.high=0,A.bytes=1,n;let r=i&E;if(i=t[e+1],!(i&S))return n.low=r|i<<7,n.high=0,A.bytes=2,n;if(r|=(i&E)<<7,i=t[e+2],!(i&S))return n.low=r|i<<14,n.high=0,A.bytes=3,n;if(r|=(i&E)<<14,i=t[e+3],!(i&S))return n.low=r|i<<21,n.high=0,A.bytes=4,n;r|=(i&E)<<21,i=t[e+4],n.low=r|(15&i)<<28;let a=(112&i)>>4;return i&S?(i=t[e+5],i&S?(a|=(i&E)<<3,i=t[e+6],i&S?(a|=(i&E)<<10,i=t[e+7],i&S?(a|=(i&E)<<17,i=t[e+8],n.high=a|t[e+8]<<24,A.bytes=9,n):(n.high=a|i<<17,A.bytes=8,n)):(n.high=a|i<<10,A.bytes=7,n)):(n.high=a|i<<3,A.bytes=6,n)):(n.high=a,A.bytes=5,n)}function O(t){return 0===t.low&&0===t.high}function R(t){return!(1&~t.low)}function T(t,e){return(!t.unsigned==!e.unsigned||t.high>>>31!=1||e.high>>>31!=1)&&t.high===e.high&&t.low===e.low}function N(t,e){return D(t,e)<0}function C(t,e){return D(t,e)>=0}function P(t,e){return D(t,e)>0}function L(t){return!t.unsigned&&t.high<0}function U(t,e,n){const i=t.high>>>16,r=65535&t.high,a=t.low>>>16,s=65535&t.low,o=e.high>>>16,h=65535&e.high,l=e.low>>>16;let u=s+(65535&e.low),f=u>>>16;u&=65535,f+=a+l;let c=f>>>16;f&=65535,c+=r+h;let d=c>>>16;return c&=65535,d+=i+o,d&=65535,n.low=f<<16|u,n.high=d<<16|c,n.unsigned=!!t.unsigned,n}k(0),A.bytes=1,k(0),k(0),k(0),k(0),k(0),k(0),k(0),k(0),"undefined"==typeof BigInt||(BigInt(h),BigInt(2147483648),BigInt(-1),k(0)),function(){const t=new ArrayBuffer(8);new Float64Array(t),new Uint32Array(t)}();const M=function(){const t=k(0);return function(e,n){return!e.unsigned&&T(e,c)?$(c,n,!1):U(function(t,e){return e.low=~t.low,e.high=~t.high,e.unsigned=!!t.unsigned,e}(e,t),_,n)}}(),F=function(){const t=k(0);return function(e,n,i){return U(e,M(n,t),i)}}(),D=function(){const t=k(0);return function(e,n){if(T(e,n))return 0;const i=L(e),r=L(n);return i&&!r?-1:!i&&r?1:e.unsigned?n.high>>>0>e.high>>>0||n.high===e.high&&n.low>>>0>e.low>>>0?-1:1:L(F(e,n,t))?-1:1}}();function j(t,e,n){if(N(t,l)&&N(e,l))return x(z(t)*z(e),t.unsigned,n),n;const i=t.high>>>16,r=65535&t.high,a=t.low>>>16,s=65535&t.low,o=e.high>>>16,h=65535&e.high,u=e.low>>>16,f=65535&e.low;let c=s*f,d=c>>>16;c&=65535,d+=a*f;let g=d>>>16;d&=65535,d+=s*u,g+=d>>>16,d&=65535,g+=r*f;let _=g>>>16;return g&=65535,g+=a*u,_+=g>>>16,g&=65535,g+=s*h,_+=g>>>16,g&=65535,_+=i*f+r*u+a*h+s*o,_&=65535,n.low=d<<16|c,n.high=_<<16|g,n.unsigned=!!t.unsigned,n}const Z=function(){const t=k(0),e=k(0);return function(n,i,r){return O(n)||O(i)?$(n.unsigned?p:m,r):T(n,c)?($(R(i)?c:m,r),r.unsigned=!!n.unsigned,r):T(i,c)?($(R(n)?c:m,r),r.unsigned=!!n.unsigned,r):L(n)?(M(n,t),L(i)?(M(i,e),j(t,e,r)):(j(t,i,e),M(e,r)),r):L(i)?(M(i,t),j(n,t,e),M(e,r),r):j(n,i,r)}}();!function(){const t=k(0),e=k(0),n=k(0),i=k(0),r=k(0),a=k(0),s=k(0)}();function $(t,e,n){return e.low=0|t.low,e.high=0|t.high,e.unsigned=void 0!==n?n:!!t.unsigned,e}function H(t,e,n){const i=e[1],r=n?n[1]:1/0;return i<=t&&r>t?0:i<t?-1:1}k(0);class W{constructor({filehandle:t,path:e}){if(t)this.filehandle=t;else{if(!e)throw new TypeError("either filehandle or path must be defined");this.filehandle=new i.LocalFile(e)}}_getIndex(){return this.index||(this.index=this._readIndex().catch((t=>{throw this.index=void 0,t}))),this.index}async _readIndex(){const t=z(I((await this.filehandle.read(8,0)).subarray(0,8),!0));if(!t)return[[0,0]];const e=new Array(t+1);e[0]=[0,0];const n=16*t;if(n>Number.MAX_SAFE_INTEGER)throw new TypeError("integer overflow");const i=await this.filehandle.read(n,8);for(let n=0;n<t;n+=1){const t=z(I(i.subarray(16*n,16*n+8),!0)),r=z(I(i.subarray(16*n+8,16*n+16),!0));e[n+1]=[t,r]}return e}async getLastBlock(){return(await this._getIndex()).at(-1)}async getRelevantBlocksForRead(t,e){const n=e+t;if(0===t)return[];const i=await this._getIndex(),r=[];let a=0,s=i.length-1,o=Math.floor(i.length/2),h=H(e,i[o],i[o+1]);for(;0!==h;)h>0?s=o-1:h<0&&(a=o+1),o=Math.ceil((s-a)/2)+a,h=H(e,i[o],i[o+1]);r.push(i[o]);let l=o+1;for(;l<i.length&&(r.push(i[l]),!(i[l][1]>=n));l+=1);return r[r.length-1][1]<n&&r.push([]),r}}class V{constructor({filehandle:t,path:e,gziFilehandle:n,gziPath:r}){if(t)this.filehandle=t;else{if(!e)throw new TypeError("either filehandle or path must be defined");this.filehandle=new i.LocalFile(e)}if(!n&&!r&&!e)throw new TypeError("either gziFilehandle or gziPath must be defined");this.gzi=new W({filehandle:n,path:n||r||!e?`${e}.gzi`:r})}async _readAndUncompressBlock(t,e){let n=e;n||(n=(await this.filehandle.stat()).size);const i=n-t;return s(await this.filehandle.read(i,t))}async read(t,e){const n=await this.gzi.getRelevantBlocksForRead(t,e),i=[];for(let r=0;r<n.length-1;r+=1){const a=await this._readAndUncompressBlock(n[r][0],n[r+1][0]),[,s]=n[r],o=s>=e?0:e-s,h=Math.min(e+t,s+a.length)-s;o>=0&&o<a.length&&i.push(a.subarray(o,h))}return a(i)}}},689:(t,e,n)=>{"use strict";n.r(e),n.d(e,{BlobFile:()=>o,LocalFile:()=>r(),RemoteFile:()=>s,fromUrl:()=>h,open:()=>l});var i=n(937),r=n.n(i);function a(t){return("object"==typeof t&&null!==t&&"message"in t?t.message:`${t}`).replace(/\.$/,"")}class s{constructor(t,e={}){this.baseOverrides={},this.url=t;const n=e.fetch||globalThis.fetch.bind(globalThis);e.overrides&&(this.baseOverrides=e.overrides),this.fetchImplementation=n}async fetch(t,e){let n;try{n=await this.fetchImplementation(t,e)}catch(i){if(!`${i}`.includes("Failed to fetch"))throw new Error(`${a(i)} fetching ${t}`,{cause:i});console.warn(`generic-filehandle: refetching ${t} to attempt to work around chrome CORS header caching bug`);try{n=await this.fetchImplementation(t,{...e,cache:"reload"})}catch(e){throw new Error(`${a(e)} fetching ${t}`,{cause:e})}}return n}async read(t,e,n={}){const{headers:i={},signal:r,overrides:a={}}=n;t<1/0?i.range=`bytes=${e}-${e+t}`:t===1/0&&0!==e&&(i.range=`bytes=${e}-`);const s=await this.fetch(this.url,{...this.baseOverrides,...a,headers:{...i,...a.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:r});if(!s.ok)throw new Error(`HTTP ${s.status} fetching ${this.url}`);if(200===s.status&&0===e||206===s.status){const e=await s.arrayBuffer(),n=s.headers.get("content-range"),i=/\/(\d+)$/.exec(n||"");return i?.[1]&&(this._stat={size:parseInt(i[1],10)}),new Uint8Array(e.slice(0,t))}throw 200===s.status?new Error(`${this.url} fetch returned status 200, expected 206`):new Error(`HTTP ${s.status} fetching ${this.url}`)}async readFile(t={}){let e,n;"string"==typeof t?(e=t,n={}):(e=t.encoding,n=t,delete n.encoding);const{headers:i={},signal:r,overrides:a={}}=n,s=await this.fetch(this.url,{headers:i,method:"GET",redirect:"follow",mode:"cors",signal:r,...this.baseOverrides,...a});if(200!==s.status)throw new Error(`HTTP ${s.status} fetching ${this.url}`);if("utf8"===e)return s.text();if(e)throw new Error(`unsupported encoding: ${e}`);return new Uint8Array(await s.arrayBuffer())}async stat(){if(!this._stat&&(await this.read(10,0),!this._stat))throw new Error(`unable to determine size of file at ${this.url}`);return this._stat}async close(){}}class o{constructor(t){this.blob=t,this.size=t.size}async read(t,e=0){if(!t)return new Uint8Array(0);const n=e,i=n+t;return new Uint8Array(await this.blob.slice(n,i).arrayBuffer())}async readFile(t){const e="string"==typeof t?t:t?.encoding;if("utf8"===e)return this.blob.text();if(e)throw new Error(`unsupported encoding: ${e}`);return new Uint8Array(await this.blob.arrayBuffer())}async stat(){return{size:this.size}}async close(){}}function h(t,e={}){return new s(t,e)}function l(t,e,n,i={}){if(void 0!==n)return n;if(void 0!==t)return h(t,i);if(void 0!==e)return new(r())(e,i);throw new Error("no url, path, or filehandle provided, cannot open")}},668:(t,e,n)=>{"use strict";var i={};(0,n(805).assign)(i,n(303),n(83),n(681)),t.exports=i},303:(t,e,n)=>{"use strict";var i=n(411),r=n(805),a=n(996),s=n(674),o=n(442),h=Object.prototype.toString;function l(t){if(!(this instanceof l))return new l(t);this.options=r.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var n=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==n)throw new Error(s[n]);if(e.header&&i.deflateSetHeader(this.strm,e.header),e.dictionary){var u;if(u="string"==typeof e.dictionary?a.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(n=i.deflateSetDictionary(this.strm,u)))throw new Error(s[n]);this._dict_set=!0}}function u(t,e){var n=new l(e);if(n.push(t,!0),n.err)throw n.msg||s[n.err];return n.result}l.prototype.push=function(t,e){var n,s,o=this.strm,l=this.options.chunkSize;if(this.ended)return!1;s=e===~~e?e:!0===e?4:0,"string"==typeof t?o.input=a.string2buf(t):"[object ArrayBuffer]"===h.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new r.Buf8(l),o.next_out=0,o.avail_out=l),1!==(n=i.deflate(o,s))&&0!==n)return this.onEnd(n),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(a.buf2binstring(r.shrinkBuf(o.output,o.next_out))):this.onData(r.shrinkBuf(o.output,o.next_out)))}while((o.avail_in>0||0===o.avail_out)&&1!==n);return 4===s?(n=i.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==s||(this.onEnd(0),o.avail_out=0,!0)},l.prototype.onData=function(t){this.chunks.push(t)},l.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=l,e.deflate=u,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,u(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,u(t,e)}},83:(t,e,n)=>{"use strict";var i=n(447),r=n(805),a=n(996),s=n(681),o=n(674),h=n(442),l=n(414),u=Object.prototype.toString;function f(t){if(!(this instanceof f))return new f(t);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var n=i.inflateInit2(this.strm,e.windowBits);if(n!==s.Z_OK)throw new Error(o[n]);if(this.header=new l,i.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=a.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=i.inflateSetDictionary(this.strm,e.dictionary))!==s.Z_OK))throw new Error(o[n])}function c(t,e){var n=new f(e);if(n.push(t,!0),n.err)throw n.msg||o[n.err];return n.result}f.prototype.push=function(t,e){var n,o,h,l,f,c=this.strm,d=this.options.chunkSize,g=this.options.dictionary,_=!1;if(this.ended)return!1;o=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?c.input=a.binstring2buf(t):"[object ArrayBuffer]"===u.call(t)?c.input=new Uint8Array(t):c.input=t,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new r.Buf8(d),c.next_out=0,c.avail_out=d),(n=i.inflate(c,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&g&&(n=i.inflateSetDictionary(this.strm,g)),n===s.Z_BUF_ERROR&&!0===_&&(n=s.Z_OK,_=!1),n!==s.Z_STREAM_END&&n!==s.Z_OK)return this.onEnd(n),this.ended=!0,!1;c.next_out&&(0!==c.avail_out&&n!==s.Z_STREAM_END&&(0!==c.avail_in||o!==s.Z_FINISH&&o!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(h=a.utf8border(c.output,c.next_out),l=c.next_out-h,f=a.buf2string(c.output,h),c.next_out=l,c.avail_out=d-l,l&&r.arraySet(c.output,c.output,h,l,0),this.onData(f)):this.onData(r.shrinkBuf(c.output,c.next_out)))),0===c.avail_in&&0===c.avail_out&&(_=!0)}while((c.avail_in>0||0===c.avail_out)&&n!==s.Z_STREAM_END);return n===s.Z_STREAM_END&&(o=s.Z_FINISH),o===s.Z_FINISH?(n=i.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===s.Z_OK):o!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),c.avail_out=0,!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=f,e.inflate=c,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,c(t,e)},e.ungzip=c},805:(t,e)=>{"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)i(n,r)&&(t[r]=n[r])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var r={arraySet:function(t,e,n,i,r){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+i),r);else for(var a=0;a<i;a++)t[r+a]=e[n+a]},flattenChunks:function(t){var e,n,i,r,a,s;for(i=0,e=0,n=t.length;e<n;e++)i+=t[e].length;for(s=new Uint8Array(i),r=0,e=0,n=t.length;e<n;e++)a=t[e],s.set(a,r),r+=a.length;return s}},a={arraySet:function(t,e,n,i,r){for(var a=0;a<i;a++)t[r+a]=e[n+a]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,a))},e.setTyped(n)},996:(t,e,n)=>{"use strict";var i=n(805),r=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){a=!1}for(var s=new i.Buf8(256),o=0;o<256;o++)s[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;function h(t,e){if(e<65534&&(t.subarray&&a||!t.subarray&&r))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",s=0;s<e;s++)n+=String.fromCharCode(t[s]);return n}s[254]=s[254]=1,e.string2buf=function(t){var e,n,r,a,s,o=t.length,h=0;for(a=0;a<o;a++)55296==(64512&(n=t.charCodeAt(a)))&&a+1<o&&56320==(64512&(r=t.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(r-56320),a++),h+=n<128?1:n<2048?2:n<65536?3:4;for(e=new i.Buf8(h),s=0,a=0;s<h;a++)55296==(64512&(n=t.charCodeAt(a)))&&a+1<o&&56320==(64512&(r=t.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(r-56320),a++),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},e.buf2binstring=function(t){return h(t,t.length)},e.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;n<r;n++)e[n]=t.charCodeAt(n);return e},e.buf2string=function(t,e){var n,i,r,a,o=e||t.length,l=new Array(2*o);for(i=0,n=0;n<o;)if((r=t[n++])<128)l[i++]=r;else if((a=s[r])>4)l[i++]=65533,n+=a-1;else{for(r&=2===a?31:3===a?15:7;a>1&&n<o;)r=r<<6|63&t[n++],a--;a>1?l[i++]=65533:r<65536?l[i++]=r:(r-=65536,l[i++]=55296|r>>10&1023,l[i++]=56320|1023&r)}return h(l,i)},e.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+s[t[n]]>e?n:e}},269:t=>{"use strict";t.exports=function(t,e,n,i){for(var r=65535&t,a=t>>>16&65535,s=0;0!==n;){n-=s=n>2e3?2e3:n;do{a=a+(r=r+e[i++]|0)|0}while(--s);r%=65521,a%=65521}return r|a<<16}},681:t=>{"use strict";t.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_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}},823:t=>{"use strict";var e=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();t.exports=function(t,n,i,r){var a=e,s=r+i;t^=-1;for(var o=r;o<s;o++)t=t>>>8^a[255&(t^n[o])];return~t}},411:(t,e,n)=>{"use strict";var i,r=n(805),a=n(665),s=n(269),o=n(823),h=n(674),l=-2,u=258,f=262,c=103,d=113,g=666;function _(t,e){return t.msg=h[e],e}function w(t){return(t<<1)-(t>4?9:0)}function b(t){for(var e=t.length;--e>=0;)t[e]=0}function m(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(r.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function p(t,e){a._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,m(t.strm)}function v(t,e){t.pending_buf[t.pending++]=e}function y(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function k(t,e){var n,i,r=t.max_chain_length,a=t.strstart,s=t.prev_length,o=t.nice_match,h=t.strstart>t.w_size-f?t.strstart-(t.w_size-f):0,l=t.window,c=t.w_mask,d=t.prev,g=t.strstart+u,_=l[a+s-1],w=l[a+s];t.prev_length>=t.good_match&&(r>>=2),o>t.lookahead&&(o=t.lookahead);do{if(l[(n=e)+s]===w&&l[n+s-1]===_&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do{}while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&a<g);if(i=u-(g-a),a=g-u,i>s){if(t.match_start=e,s=i,i>=o)break;_=l[a+s-1],w=l[a+s]}}}while((e=d[e&c])>h&&0!=--r);return s<=t.lookahead?s:t.lookahead}function x(t){var e,n,i,a,h,l,u,c,d,g,_=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=_+(_-f)){r.arraySet(t.window,t.window,_,_,0),t.match_start-=_,t.strstart-=_,t.block_start-=_,e=n=t.hash_size;do{i=t.head[--e],t.head[e]=i>=_?i-_:0}while(--n);e=n=_;do{i=t.prev[--e],t.prev[e]=i>=_?i-_:0}while(--n);a+=_}if(0===t.strm.avail_in)break;if(l=t.strm,u=t.window,c=t.strstart+t.lookahead,d=a,g=void 0,(g=l.avail_in)>d&&(g=d),n=0===g?0:(l.avail_in-=g,r.arraySet(u,l.input,l.next_in,g,c),1===l.state.wrap?l.adler=s(l.adler,u,g,c):2===l.state.wrap&&(l.adler=o(l.adler,u,g,c)),l.next_in+=g,l.total_in+=g,g),t.lookahead+=n,t.lookahead+t.insert>=3)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+3-1])&t.hash_mask,t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<f&&0!==t.strm.avail_in)}function z(t,e){for(var n,i;;){if(t.lookahead<f){if(x(t),t.lookahead<f&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-f&&(t.match_length=k(t,n)),t.match_length>=3)if(i=a._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}function B(t,e){for(var n,i,r;;){if(t.lookahead<f){if(x(t),t.lookahead<f&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-f&&(t.match_length=k(t,n),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,i=a._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(p(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=a._tr_tally(t,0,t.window[t.strstart-1]))&&p(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=a._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}function I(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}function S(){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=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(1146),this.dyn_dtree=new r.Buf16(122),this.bl_tree=new r.Buf16(78),b(this.dyn_ltree),b(this.dyn_dtree),b(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(16),this.heap=new r.Buf16(573),b(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(573),b(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function E(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:d,t.adler=2===e.wrap?0:1,e.last_flush=0,a._tr_init(e),0):_(t,l)}function A(t){var e,n=E(t);return 0===n&&((e=t.state).window_size=2*e.w_size,b(e.head),e.max_lazy_match=i[e.level].max_lazy,e.good_match=i[e.level].good_length,e.nice_match=i[e.level].nice_length,e.max_chain_length=i[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),n}function O(t,e,n,i,a,s){if(!t)return l;var o=1;if(-1===e&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),a<1||a>9||8!==n||i<8||i>15||e<0||e>9||s<0||s>4)return _(t,l);8===i&&(i=9);var h=new S;return t.state=h,h.strm=t,h.wrap=o,h.gzhead=null,h.w_bits=i,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=a+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new r.Buf8(2*h.w_size),h.head=new r.Buf16(h.hash_size),h.prev=new r.Buf16(h.w_size),h.lit_bufsize=1<<a+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new r.Buf8(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=s,h.method=n,A(t)}i=[new I(0,0,0,0,(function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(x(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,p(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-f&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(p(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(p(t,!1),t.strm.avail_out),1)})),new I(4,4,8,4,z),new I(4,5,16,8,z),new I(4,6,32,32,z),new I(4,4,16,16,B),new I(8,16,32,32,B),new I(8,16,128,128,B),new I(8,32,128,256,B),new I(32,128,258,1024,B),new I(32,258,258,4096,B)],e.deflateInit=function(t,e){return O(t,e,8,15,8,0)},e.deflateInit2=O,e.deflateReset=A,e.deflateResetKeep=E,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?l:(t.state.gzhead=e,0):l},e.deflate=function(t,e){var n,r,s,h;if(!t||!t.state||e>5||e<0)return t?_(t,l):l;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||r.status===g&&4!==e)return _(t,0===t.avail_out?-5:l);if(r.strm=t,n=r.last_flush,r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,v(r,31),v(r,139),v(r,8),r.gzhead?(v(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),v(r,255&r.gzhead.time),v(r,r.gzhead.time>>8&255),v(r,r.gzhead.time>>16&255),v(r,r.gzhead.time>>24&255),v(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),v(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(v(r,255&r.gzhead.extra.length),v(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=o(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(v(r,0),v(r,0),v(r,0),v(r,0),v(r,0),v(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),v(r,3),r.status=d);else{var f=8+(r.w_bits-8<<4)<<8;f|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(f|=32),f+=31-f%31,r.status=d,y(r,f),0!==r.strstart&&(y(r,t.adler>>>16),y(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(t.adler=o(t.adler,r.pending_buf,r.pending-s,s)),m(t),s=r.pending,r.pending!==r.pending_buf_size));)v(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(t.adler=o(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=o(t.adler,r.pending_buf,r.pending-s,s)),m(t),s=r.pending,r.pending===r.pending_buf_size)){h=1;break}h=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,v(r,h)}while(0!==h);r.gzhead.hcrc&&r.pending>s&&(t.adler=o(t.adler,r.pending_buf,r.pending-s,s)),0===h&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=o(t.adler,r.pending_buf,r.pending-s,s)),m(t),s=r.pending,r.pending===r.pending_buf_size)){h=1;break}h=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,v(r,h)}while(0!==h);r.gzhead.hcrc&&r.pending>s&&(t.adler=o(t.adler,r.pending_buf,r.pending-s,s)),0===h&&(r.status=c)}else r.status=c;if(r.status===c&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&m(t),r.pending+2<=r.pending_buf_size&&(v(r,255&t.adler),v(r,t.adler>>8&255),t.adler=0,r.status=d)):r.status=d),0!==r.pending){if(m(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&w(e)<=w(n)&&4!==e)return _(t,-5);if(r.status===g&&0!==t.avail_in)return _(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==g){var k=2===r.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(x(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var n,i,r,s,o=t.window;;){if(t.lookahead<=u){if(x(t),t.lookahead<=u&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=o[r=t.strstart-1])===o[++r]&&i===o[++r]&&i===o[++r]){s=t.strstart+u;do{}while(i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&r<s);t.match_length=u-(s-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=a._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=a._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(p(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(p(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(p(t,!1),0===t.strm.avail_out)?1:2}(r,e):i[r.level].func(r,e);if(3!==k&&4!==k||(r.status=g),1===k||3===k)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===k&&(1===e?a._tr_align(r):5!==e&&(a._tr_stored_block(r,0,0,!1),3===e&&(b(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),m(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(v(r,255&t.adler),v(r,t.adler>>8&255),v(r,t.adler>>16&255),v(r,t.adler>>24&255),v(r,255&t.total_in),v(r,t.total_in>>8&255),v(r,t.total_in>>16&255),v(r,t.total_in>>24&255)):(y(r,t.adler>>>16),y(r,65535&t.adler)),m(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},e.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&e!==c&&e!==d&&e!==g?_(t,l):(t.state=null,e===d?_(t,-3):0):l},e.deflateSetDictionary=function(t,e){var n,i,a,o,h,u,f,c,d=e.length;if(!t||!t.state)return l;if(2===(o=(n=t.state).wrap)||1===o&&42!==n.status||n.lookahead)return l;for(1===o&&(t.adler=s(t.adler,e,d,0)),n.wrap=0,d>=n.w_size&&(0===o&&(b(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new r.Buf8(n.w_size),r.arraySet(c,e,d-n.w_size,n.w_size,0),e=c,d=n.w_size),h=t.avail_in,u=t.next_in,f=t.input,t.avail_in=d,t.next_in=0,t.input=e,x(n);n.lookahead>=3;){i=n.strstart,a=n.lookahead-2;do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+3-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++}while(--a);n.strstart=i,n.lookahead=2,x(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=u,t.input=f,t.avail_in=h,n.wrap=o,0},e.deflateInfo="pako deflate (from Nodeca project)"},414:t=>{"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},293:t=>{"use strict";t.exports=function(t,e){var n,i,r,a,s,o,h,l,u,f,c,d,g,_,w,b,m,p,v,y,k,x,z,B,I;n=t.state,i=t.next_in,B=t.input,r=i+(t.avail_in-5),a=t.next_out,I=t.output,s=a-(e-t.avail_out),o=a+(t.avail_out-257),h=n.dmax,l=n.wsize,u=n.whave,f=n.wnext,c=n.window,d=n.hold,g=n.bits,_=n.lencode,w=n.distcode,b=(1<<n.lenbits)-1,m=(1<<n.distbits)-1;t:do{g<15&&(d+=B[i++]<<g,g+=8,d+=B[i++]<<g,g+=8),p=_[d&b];e:for(;;){if(d>>>=v=p>>>24,g-=v,0==(v=p>>>16&255))I[a++]=65535&p;else{if(!(16&v)){if(64&v){if(32&v){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}p=_[(65535&p)+(d&(1<<v)-1)];continue e}for(y=65535&p,(v&=15)&&(g<v&&(d+=B[i++]<<g,g+=8),y+=d&(1<<v)-1,d>>>=v,g-=v),g<15&&(d+=B[i++]<<g,g+=8,d+=B[i++]<<g,g+=8),p=w[d&m];;){if(d>>>=v=p>>>24,g-=v,16&(v=p>>>16&255)){if(k=65535&p,g<(v&=15)&&(d+=B[i++]<<g,(g+=8)<v&&(d+=B[i++]<<g,g+=8)),(k+=d&(1<<v)-1)>h){t.msg="invalid distance too far back",n.mode=30;break t}if(d>>>=v,g-=v,k>(v=a-s)){if((v=k-v)>u&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(x=0,z=c,0===f){if(x+=l-v,v<y){y-=v;do{I[a++]=c[x++]}while(--v);x=a-k,z=I}}else if(f<v){if(x+=l+f-v,(v-=f)<y){y-=v;do{I[a++]=c[x++]}while(--v);if(x=0,f<y){y-=v=f;do{I[a++]=c[x++]}while(--v);x=a-k,z=I}}}else if(x+=f-v,v<y){y-=v;do{I[a++]=c[x++]}while(--v);x=a-k,z=I}for(;y>2;)I[a++]=z[x++],I[a++]=z[x++],I[a++]=z[x++],y-=3;y&&(I[a++]=z[x++],y>1&&(I[a++]=z[x++]))}else{x=a-k;do{I[a++]=I[x++],I[a++]=I[x++],I[a++]=I[x++],y-=3}while(y>2);y&&(I[a++]=I[x++],y>1&&(I[a++]=I[x++]))}break}if(64&v){t.msg="invalid distance code",n.mode=30;break t}p=w[(65535&p)+(d&(1<<v)-1)]}}break}}while(i<r&&a<o);i-=y=g>>3,d&=(1<<(g-=y<<3))-1,t.next_in=i,t.next_out=a,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=a<o?o-a+257:257-(a-o),n.hold=d,n.bits=g}},447:(t,e,n)=>{"use strict";var i=n(805),r=n(269),a=n(823),s=n(293),o=n(998),h=-2,l=12,u=30;function f(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function c(){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 i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function d(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(852),e.distcode=e.distdyn=new i.Buf32(592),e.sane=1,e.back=-1,0):h}function g(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,d(t)):h}function _(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?h:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,g(t))):h}function w(t,e){var n,i;return t?(i=new c,t.state=i,i.window=null,0!==(n=_(t,e))&&(t.state=null),n):h}var b,m,p=!0;function v(t){if(p){var e;for(b=new i.Buf32(512),m=new i.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(o(1,t.lens,0,288,b,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;o(2,t.lens,0,32,m,0,t.work,{bits:5}),p=!1}t.lencode=b,t.lenbits=9,t.distcode=m,t.distbits=5}function y(t,e,n,r){var a,s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new i.Buf8(s.wsize)),r>=s.wsize?(i.arraySet(s.window,e,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((a=s.wsize-s.wnext)>r&&(a=r),i.arraySet(s.window,e,n-r,a,s.wnext),(r-=a)?(i.arraySet(s.window,e,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=a))),0}e.inflateReset=g,e.inflateReset2=_,e.inflateResetKeep=d,e.inflateInit=function(t){return w(t,15)},e.inflateInit2=w,e.inflate=function(t,e){var n,c,d,g,_,w,b,m,p,k,x,z,B,I,S,E,A,O,R,T,N,C,P,L,U=0,M=new i.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return h;(n=t.state).mode===l&&(n.mode=13),_=t.next_out,d=t.output,b=t.avail_out,g=t.next_in,c=t.input,w=t.avail_in,m=n.hold,p=n.bits,k=w,x=b,C=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;p<16;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}if(2&n.wrap&&35615===m){n.check=0,M[0]=255&m,M[1]=m>>>8&255,n.check=a(n.check,M,2,0),m=0,p=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&m)<<8)+(m>>8))%31){t.msg="incorrect header check",n.mode=u;break}if(8!=(15&m)){t.msg="unknown compression method",n.mode=u;break}if(p-=4,N=8+(15&(m>>>=4)),0===n.wbits)n.wbits=N;else if(N>n.wbits){t.msg="invalid window size",n.mode=u;break}n.dmax=1<<N,t.adler=n.check=1,n.mode=512&m?10:l,m=0,p=0;break;case 2:for(;p<16;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}if(n.flags=m,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=u;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=u;break}n.head&&(n.head.text=m>>8&1),512&n.flags&&(M[0]=255&m,M[1]=m>>>8&255,n.check=a(n.check,M,2,0)),m=0,p=0,n.mode=3;case 3:for(;p<32;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}n.head&&(n.head.time=m),512&n.flags&&(M[0]=255&m,M[1]=m>>>8&255,M[2]=m>>>16&255,M[3]=m>>>24&255,n.check=a(n.check,M,4,0)),m=0,p=0,n.mode=4;case 4:for(;p<16;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}n.head&&(n.head.xflags=255&m,n.head.os=m>>8),512&n.flags&&(M[0]=255&m,M[1]=m>>>8&255,n.check=a(n.check,M,2,0)),m=0,p=0,n.mode=5;case 5:if(1024&n.flags){for(;p<16;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}n.length=m,n.head&&(n.head.extra_len=m),512&n.flags&&(M[0]=255&m,M[1]=m>>>8&255,n.check=a(n.check,M,2,0)),m=0,p=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((z=n.length)>w&&(z=w),z&&(n.head&&(N=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),i.arraySet(n.head.extra,c,g,z,N)),512&n.flags&&(n.check=a(n.check,c,z,g)),w-=z,g+=z,n.length-=z),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===w)break t;z=0;do{N=c[g+z++],n.head&&N&&n.length<65536&&(n.head.name+=String.fromCharCode(N))}while(N&&z<w);if(512&n.flags&&(n.check=a(n.check,c,z,g)),w-=z,g+=z,N)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===w)break t;z=0;do{N=c[g+z++],n.head&&N&&n.length<65536&&(n.head.comment+=String.fromCharCode(N))}while(N&&z<w);if(512&n.flags&&(n.check=a(n.check,c,z,g)),w-=z,g+=z,N)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;p<16;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}if(m!==(65535&n.check)){t.msg="header crc mismatch",n.mode=u;break}m=0,p=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=l;break;case 10:for(;p<32;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}t.adler=n.check=f(m),m=0,p=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=_,t.avail_out=b,t.next_in=g,t.avail_in=w,n.hold=m,n.bits=p,2;t.adler=n.check=1,n.mode=l;case l:if(5===e||6===e)break t;case 13:if(n.last){m>>>=7&p,p-=7&p,n.mode=27;break}for(;p<3;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}switch(n.last=1&m,p-=1,3&(m>>>=1)){case 0:n.mode=14;break;case 1:if(v(n),n.mode=20,6===e){m>>>=2,p-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=u}m>>>=2,p-=2;break;case 14:for(m>>>=7&p,p-=7&p;p<32;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}if((65535&m)!=(m>>>16^65535)){t.msg="invalid stored block lengths",n.mode=u;break}if(n.length=65535&m,m=0,p=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(z=n.length){if(z>w&&(z=w),z>b&&(z=b),0===z)break t;i.arraySet(d,c,g,z,_),w-=z,g+=z,b-=z,_+=z,n.length-=z;break}n.mode=l;break;case 17:for(;p<14;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}if(n.nlen=257+(31&m),m>>>=5,p-=5,n.ndist=1+(31&m),m>>>=5,p-=5,n.ncode=4+(15&m),m>>>=4,p-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=u;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;p<3;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}n.lens[F[n.have++]]=7&m,m>>>=3,p-=3}for(;n.have<19;)n.lens[F[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,P={bits:n.lenbits},C=o(0,n.lens,0,19,n.lencode,0,n.work,P),n.lenbits=P.bits,C){t.msg="invalid code lengths set",n.mode=u;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;E=(U=n.lencode[m&(1<<n.lenbits)-1])>>>16&255,A=65535&U,!((S=U>>>24)<=p);){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}if(A<16)m>>>=S,p-=S,n.lens[n.have++]=A;else{if(16===A){for(L=S+2;p<L;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}if(m>>>=S,p-=S,0===n.have){t.msg="invalid bit length repeat",n.mode=u;break}N=n.lens[n.have-1],z=3+(3&m),m>>>=2,p-=2}else if(17===A){for(L=S+3;p<L;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}p-=S,N=0,z=3+(7&(m>>>=S)),m>>>=3,p-=3}else{for(L=S+7;p<L;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}p-=S,N=0,z=11+(127&(m>>>=S)),m>>>=7,p-=7}if(n.have+z>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=u;break}for(;z--;)n.lens[n.have++]=N}}if(n.mode===u)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=u;break}if(n.lenbits=9,P={bits:n.lenbits},C=o(1,n.lens,0,n.nlen,n.lencode,0,n.work,P),n.lenbits=P.bits,C){t.msg="invalid literal/lengths set",n.mode=u;break}if(n.distbits=6,n.distcode=n.distdyn,P={bits:n.distbits},C=o(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,P),n.distbits=P.bits,C){t.msg="invalid distances set",n.mode=u;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(w>=6&&b>=258){t.next_out=_,t.avail_out=b,t.next_in=g,t.avail_in=w,n.hold=m,n.bits=p,s(t,x),_=t.next_out,d=t.output,b=t.avail_out,g=t.next_in,c=t.input,w=t.avail_in,m=n.hold,p=n.bits,n.mode===l&&(n.back=-1);break}for(n.back=0;E=(U=n.lencode[m&(1<<n.lenbits)-1])>>>16&255,A=65535&U,!((S=U>>>24)<=p);){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}if(E&&!(240&E)){for(O=S,R=E,T=A;E=(U=n.lencode[T+((m&(1<<O+R)-1)>>O)])>>>16&255,A=65535&U,!(O+(S=U>>>24)<=p);){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}m>>>=O,p-=O,n.back+=O}if(m>>>=S,p-=S,n.back+=S,n.length=A,0===E){n.mode=26;break}if(32&E){n.back=-1,n.mode=l;break}if(64&E){t.msg="invalid literal/length code",n.mode=u;break}n.extra=15&E,n.mode=22;case 22:if(n.extra){for(L=n.extra;p<L;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}n.length+=m&(1<<n.extra)-1,m>>>=n.extra,p-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;E=(U=n.distcode[m&(1<<n.distbits)-1])>>>16&255,A=65535&U,!((S=U>>>24)<=p);){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}if(!(240&E)){for(O=S,R=E,T=A;E=(U=n.distcode[T+((m&(1<<O+R)-1)>>O)])>>>16&255,A=65535&U,!(O+(S=U>>>24)<=p);){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}m>>>=O,p-=O,n.back+=O}if(m>>>=S,p-=S,n.back+=S,64&E){t.msg="invalid distance code",n.mode=u;break}n.offset=A,n.extra=15&E,n.mode=24;case 24:if(n.extra){for(L=n.extra;p<L;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}n.offset+=m&(1<<n.extra)-1,m>>>=n.extra,p-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=u;break}n.mode=25;case 25:if(0===b)break t;if(z=x-b,n.offset>z){if((z=n.offset-z)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=u;break}z>n.wnext?(z-=n.wnext,B=n.wsize-z):B=n.wnext-z,z>n.length&&(z=n.length),I=n.window}else I=d,B=_-n.offset,z=n.length;z>b&&(z=b),b-=z,n.length-=z;do{d[_++]=I[B++]}while(--z);0===n.length&&(n.mode=21);break;case 26:if(0===b)break t;d[_++]=n.length,b--,n.mode=21;break;case 27:if(n.wrap){for(;p<32;){if(0===w)break t;w--,m|=c[g++]<<p,p+=8}if(x-=b,t.total_out+=x,n.total+=x,x&&(t.adler=n.check=n.flags?a(n.check,d,x,_-x):r(n.check,d,x,_-x)),x=b,(n.flags?m:f(m))!==n.check){t.msg="incorrect data check",n.mode=u;break}m=0,p=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;p<32;){if(0===w)break t;w--,m+=c[g++]<<p,p+=8}if(m!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=u;break}m=0,p=0}n.mode=29;case 29:C=1;break t;case u:C=-3;break t;case 31:return-4;default:return h}return t.next_out=_,t.avail_out=b,t.next_in=g,t.avail_in=w,n.hold=m,n.bits=p,(n.wsize||x!==t.avail_out&&n.mode<u&&(n.mode<27||4!==e))&&y(t,t.output,t.next_out,x-t.avail_out)?(n.mode=31,-4):(k-=t.avail_in,x-=t.avail_out,t.total_in+=k,t.total_out+=x,n.total+=x,n.wrap&&x&&(t.adler=n.check=n.flags?a(n.check,d,x,t.next_out-x):r(n.check,d,x,t.next_out-x)),t.data_type=n.bits+(n.last?64:0)+(n.mode===l?128:0)+(20===n.mode||15===n.mode?256:0),(0===k&&0===x||4===e)&&0===C&&(C=-5),C)},e.inflateEnd=function(t){if(!t||!t.state)return h;var e=t.state;return e.window&&(e.window=null),t.state=null,0},e.inflateGetHeader=function(t,e){var n;return t&&t.state&&2&(n=t.state).wrap?(n.head=e,e.done=!1,0):h},e.inflateSetDictionary=function(t,e){var n,i=e.length;return t&&t.state?0!==(n=t.state).wrap&&11!==n.mode?h:11===n.mode&&r(1,e,i,0)!==n.check?-3:y(t,e,i,i)?(n.mode=31,-4):(n.havedict=1,0):h},e.inflateInfo="pako inflate (from Nodeca project)"},998:(t,e,n)=>{"use strict";var i=n(805),r=[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],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[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],o=[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];t.exports=function(t,e,n,h,l,u,f,c){var d,g,_,w,b,m,p,v,y,k=c.bits,x=0,z=0,B=0,I=0,S=0,E=0,A=0,O=0,R=0,T=0,N=null,C=0,P=new i.Buf16(16),L=new i.Buf16(16),U=null,M=0;for(x=0;x<=15;x++)P[x]=0;for(z=0;z<h;z++)P[e[n+z]]++;for(S=k,I=15;I>=1&&0===P[I];I--);if(S>I&&(S=I),0===I)return l[u++]=20971520,l[u++]=20971520,c.bits=1,0;for(B=1;B<I&&0===P[B];B++);for(S<B&&(S=B),O=1,x=1;x<=15;x++)if(O<<=1,(O-=P[x])<0)return-1;if(O>0&&(0===t||1!==I))return-1;for(L[1]=0,x=1;x<15;x++)L[x+1]=L[x]+P[x];for(z=0;z<h;z++)0!==e[n+z]&&(f[L[e[n+z]]++]=z);if(0===t?(N=U=f,m=19):1===t?(N=r,C-=257,U=a,M-=257,m=256):(N=s,U=o,m=-1),T=0,z=0,x=B,b=u,E=S,A=0,_=-1,w=(R=1<<S)-1,1===t&&R>852||2===t&&R>592)return 1;for(;;){p=x-A,f[z]<m?(v=0,y=f[z]):f[z]>m?(v=U[M+f[z]],y=N[C+f[z]]):(v=96,y=0),d=1<<x-A,B=g=1<<E;do{l[b+(T>>A)+(g-=d)]=p<<24|v<<16|y}while(0!==g);for(d=1<<x-1;T&d;)d>>=1;if(0!==d?(T&=d-1,T+=d):T=0,z++,0==--P[x]){if(x===I)break;x=e[n+f[z]]}if(x>S&&(T&w)!==_){for(0===A&&(A=S),b+=B,O=1<<(E=x-A);E+A<I&&!((O-=P[E+A])<=0);)E++,O<<=1;if(R+=1<<E,1===t&&R>852||2===t&&R>592)return 1;l[_=T&w]=S<<24|E<<16|b-u}}return 0!==T&&(l[b+T]=x-A<<24|64<<16),c.bits=S,0}},674:t=>{"use strict";t.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"}},665:(t,e,n)=>{"use strict";var i=n(805);function r(t){for(var e=t.length;--e>=0;)t[e]=0}var a=[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],s=[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],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],l=new Array(576);r(l);var u=new Array(60);r(u);var f=new Array(512);r(f);var c=new Array(256);r(c);var d=new Array(29);r(d);var g,_,w,b=new Array(30);function m(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}function p(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function v(t){return t<256?f[t]:f[256+(t>>>7)]}function y(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function k(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,y(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function x(t,e,n){k(t,n[2*e],n[2*e+1])}function z(t,e){var n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1}function B(t,e,n){var i,r,a=new Array(16),s=0;for(i=1;i<=15;i++)a[i]=s=s+n[i-1]<<1;for(r=0;r<=e;r++){var o=t[2*r+1];0!==o&&(t[2*r]=z(a[o]++,o))}}function I(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function S(t){t.bi_valid>8?y(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function E(t,e,n,i){var r=2*e,a=2*n;return t[r]<t[a]||t[r]===t[a]&&i[e]<=i[n]}function A(t,e,n){for(var i=t.heap[n],r=n<<1;r<=t.heap_len&&(r<t.heap_len&&E(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!E(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i}function O(t,e,n){var i,r,o,h,l=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*l]<<8|t.pending_buf[t.d_buf+2*l+1],r=t.pending_buf[t.l_buf+l],l++,0===i?x(t,r,e):(x(t,(o=c[r])+256+1,e),0!==(h=a[o])&&k(t,r-=d[o],h),x(t,o=v(--i),n),0!==(h=s[o])&&k(t,i-=b[o],h))}while(l<t.last_lit);x(t,256,e)}function R(t,e){var n,i,r,a=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,h=e.stat_desc.elems,l=-1;for(t.heap_len=0,t.heap_max=573,n=0;n<h;n++)0!==a[2*n]?(t.heap[++t.heap_len]=l=n,t.depth[n]=0):a[2*n+1]=0;for(;t.heap_len<2;)a[2*(r=t.heap[++t.heap_len]=l<2?++l:0)]=1,t.depth[r]=0,t.opt_len--,o&&(t.static_len-=s[2*r+1]);for(e.max_code=l,n=t.heap_len>>1;n>=1;n--)A(t,a,n);r=h;do{n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],A(t,a,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,a[2*r]=a[2*n]+a[2*i],t.depth[r]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,a[2*n+1]=a[2*i+1]=r,t.heap[1]=r++,A(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,i,r,a,s,o,h=e.dyn_tree,l=e.max_code,u=e.stat_desc.static_tree,f=e.stat_desc.has_stree,c=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,g=e.stat_desc.max_length,_=0;for(a=0;a<=15;a++)t.bl_count[a]=0;for(h[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)(a=h[2*h[2*(i=t.heap[n])+1]+1]+1)>g&&(a=g,_++),h[2*i+1]=a,i>l||(t.bl_count[a]++,s=0,i>=d&&(s=c[i-d]),o=h[2*i],t.opt_len+=o*(a+s),f&&(t.static_len+=o*(u[2*i+1]+s)));if(0!==_){do{for(a=g-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[g]--,_-=2}while(_>0);for(a=g;0!==a;a--)for(i=t.bl_count[a];0!==i;)(r=t.heap[--n])>l||(h[2*r+1]!==a&&(t.opt_len+=(a-h[2*r+1])*h[2*r],h[2*r+1]=a),i--)}}(t,e),B(a,l,t.bl_count)}function T(t,e,n){var i,r,a=-1,s=e[1],o=0,h=7,l=4;for(0===s&&(h=138,l=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=s,s=e[2*(i+1)+1],++o<h&&r===s||(o<l?t.bl_tree[2*r]+=o:0!==r?(r!==a&&t.bl_tree[2*r]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,a=r,0===s?(h=138,l=3):r===s?(h=6,l=3):(h=7,l=4))}function N(t,e,n){var i,r,a=-1,s=e[1],o=0,h=7,l=4;for(0===s&&(h=138,l=3),i=0;i<=n;i++)if(r=s,s=e[2*(i+1)+1],!(++o<h&&r===s)){if(o<l)do{x(t,r,t.bl_tree)}while(0!=--o);else 0!==r?(r!==a&&(x(t,r,t.bl_tree),o--),x(t,16,t.bl_tree),k(t,o-3,2)):o<=10?(x(t,17,t.bl_tree),k(t,o-3,3)):(x(t,18,t.bl_tree),k(t,o-11,7));o=0,a=r,0===s?(h=138,l=3):r===s?(h=6,l=3):(h=7,l=4)}}r(b);var C=!1;function P(t,e,n,r){k(t,0+(r?1:0),3),function(t,e,n){S(t),y(t,n),y(t,~n),i.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}(t,e,n)}e._tr_init=function(t){C||(function(){var t,e,n,i,r,h=new Array(16);for(n=0,i=0;i<28;i++)for(d[i]=n,t=0;t<1<<a[i];t++)c[n++]=i;for(c[n-1]=i,r=0,i=0;i<16;i++)for(b[i]=r,t=0;t<1<<s[i];t++)f[r++]=i;for(r>>=7;i<30;i++)for(b[i]=r<<7,t=0;t<1<<s[i]-7;t++)f[256+r++]=i;for(e=0;e<=15;e++)h[e]=0;for(t=0;t<=143;)l[2*t+1]=8,t++,h[8]++;for(;t<=255;)l[2*t+1]=9,t++,h[9]++;for(;t<=279;)l[2*t+1]=7,t++,h[7]++;for(;t<=287;)l[2*t+1]=8,t++,h[8]++;for(B(l,287,h),t=0;t<30;t++)u[2*t+1]=5,u[2*t]=z(t,5);g=new m(l,a,257,286,15),_=new m(u,s,0,30,15),w=new m(new Array(0),o,0,19,7)}(),C=!0),t.l_desc=new p(t.dyn_ltree,g),t.d_desc=new p(t.dyn_dtree,_),t.bl_desc=new p(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,I(t)},e._tr_stored_block=P,e._tr_flush_block=function(t,e,n,i){var r,a,s=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),R(t,t.l_desc),R(t,t.d_desc),s=function(t){var e;for(T(t,t.dyn_ltree,t.l_desc.max_code),T(t,t.dyn_dtree,t.d_desc.max_code),R(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*h[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(a=t.static_len+3+7>>>3)<=r&&(r=a)):r=a=n+5,n+4<=r&&-1!==e?P(t,e,n,i):4===t.strategy||a===r?(k(t,2+(i?1:0),3),O(t,l,u)):(k(t,4+(i?1:0),3),function(t,e,n,i){var r;for(k(t,e-257,5),k(t,n-1,5),k(t,i-4,4),r=0;r<i;r++)k(t,t.bl_tree[2*h[r]+1],3);N(t,t.dyn_ltree,e-1),N(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),O(t,t.dyn_ltree,t.dyn_dtree)),I(t),i&&S(t)},e._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(c[n]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){k(t,2,3),x(t,256,l),function(t){16===t.bi_valid?(y(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},442:t=>{"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},392:t=>{"use strict";class e{constructor(t={}){if(!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=t.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(t,e){this.cache.set(t,e),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(t){if(this.cache.has(t))return this.cache.get(t);if(this.oldCache.has(t)){const e=this.oldCache.get(t);return this.oldCache.delete(t),this._set(t,e),e}}set(t,e){return this.cache.has(t)?this.cache.set(t,e):this._set(t,e),this}has(t){return this.cache.has(t)||this.oldCache.has(t)}peek(t){return this.cache.has(t)?this.cache.get(t):this.oldCache.has(t)?this.oldCache.get(t):void 0}delete(t){const e=this.cache.delete(t);return e&&this._size--,this.oldCache.delete(t)||e}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[t]of this)yield t}*values(){for(const[,t]of this)yield t}*[Symbol.iterator](){for(const t of this.cache)yield t;for(const t of this.oldCache){const[e]=t;this.cache.has(e)||(yield t)}}get size(){let t=0;for(const e of this.oldCache.keys())this.cache.has(e)||t++;return this._size+t}}t.exports=e},937:()=>{},620:(t,e)=>{var n,i=function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZERO=t.UZERO=t.UONE=t.TWO_PWR_64_DBL=t.TWO_PWR_63_DBL=t.TWO_PWR_32_DBL=t.TWO_PWR_24_DBL=t.TWO_PWR_24=t.TWO_PWR_16_DBL=t.ONE=t.NEG_ONE=t.MIN_VALUE=t.MAX_VALUE=t.MAX_UNSIGNED_VALUE=void 0,t.add=ht,t.and=function(t,e,n){return n.low=t.low&e.low,n.high=t.high&e.high,n.unsigned=!!t.unsigned,n},t.clz=function(t){return t.high?Math.clz32(t.high):Math.clz32(t.low)+32},t.compare=void 0,t.copy=vt,t.ctz=function(t){return t.low?xt(t.low):xt(t.high)+32},t.div=void 0,t.eq=nt,t.fromBigInt=void 0,t.fromBits=b,t.fromBytes=void 0,t.fromBytesBE=N,t.fromBytesBERaw=C,t.fromBytesLE=A,t.fromBytesLERaw=O,t.fromFloat=t.fromBytesRaw=void 0,t.fromInt=m,t.fromNumber=y,t.fromString=kt,t.fromValue=function t(e,n,i){return"object"==typeof n&&null!==n?t(e,void 0,n):"bigint"==typeof e?v(e,n,i):"number"==typeof e?y(e,n,i):"string"==typeof e?kt(e,n,void 0,i):null==e||!1===e?vt(n?d:c,i||m(0)):!0===e?vt(n?u:l,i||m(0)):e.buffer instanceof ArrayBuffer?P(e,n,i):Array.isArray(e)?b(e[0],e[1],"boolean"==typeof n?n:e[2],i):b(e.low,e.high,"boolean"==typeof n?n:e.unsigned,i)},t.fromVarInt=q,t.fromVarIntRaw=Y,t.fromZigZag=K,t.fromZigZagRaw=G,t.ge=rt,t.gt=at,t.isEven=function(t){return!(1&t.low)},t.isLE=void 0,t.isLong=w,t.isLongLike=function(t){return!(null===t||"object"!=typeof t||null!==t.low&&void 0!==t.low&&"number"!=typeof t.low||null!==t.high&&void 0!==t.high&&"number"!=typeof t.high)},t.isNegative=st,t.isOdd=et,t.isPositive=function(t){return t.unsigned||t.high>=0},t.isSLong=function(t){return w(t)&&!t.unsigned},t.isULong=function(t){return w(t)&&!!t.unsigned},t.isZero=tt,t.le=function(t,e){return ct(t,e)<=0},t.lt=it,t.mul=t.mod=void 0,t.mulRaw=wt,t.ne=function(t,e){return!nt(t,e)},t.neg=void 0,t.noBigInt=p,t.not=lt,t.or=function(t,e,n){return n.low=t.low|e.low,n.high=t.high|e.high,n.unsigned=!!t.unsigned,n},t.rotl=function(t,e,n){if(0==(e&=63))return vt(t,n);if(32===e)n.low=t.high,n.high=t.low;else if(e<32){const i=32-e;n.low=t.low<<e|t.high>>>i,n.high=t.high<<e|t.low>>>i}else{const i=32-(e-=32);n.low=t.high<<e|t.low>>>i,n.high=t.low<<e|t.high>>>i}return n.unsigned=!!t.unsigned,n},t.rotr=function(t,e,n){if(0==(e&=63))return vt(t,n);if(32===e)n.low=t.high,n.high=t.low;else if(e<32){const i=32-e;n.low=t.high<<i|t.low>>>e,n.high=t.low<<i|t.high>>>e}else{const i=32-(e-=32);n.low=t.low<<i|t.high>>>e,n.high=t.high<<i|t.low>>>e}return n.unsigned=!!t.unsigned,n},t.shl=_t,t.shr=dt,t.shru=gt,t.toBytes=t.toBigInt=t.sub=void 0,t.toBytesBE=R,t.toBytesBERaw=T,t.toBytesLE=B,t.toBytesLERaw=I,t.toBytesRaw=void 0,t.toInt=J,t.toNumber=k,t.toSigned=function(t,e){return e.low=t.low,e.high=t.high,e.unsigned=!1,e},t.toString=void 0,t.toUnsigned=function(t,e){return e.low=t.low,e.high=t.high,e.unsigned=!0,e},t.toVarInt=j,t.toVarIntRaw=W,t.toZigZag=function t(e,n,i){return z(n,i),H(e,x.offset,x.out),t.bytes=H.bytes,x.target},t.toZigZagRaw=H,t.varIntLength=V,t.xor=function(t,e,n){return n.low=t.low^e.low,n.high=t.high^e.high,n.unsigned=!!t.unsigned,n},t.zigZagLength=function(t){return $(t),V(Z)};t.TWO_PWR_16_DBL=65536;const e=4294967296;t.TWO_PWR_32_DBL=e;const n=1<<24;t.TWO_PWR_24_DBL=n;const i=m(n);t.TWO_PWR_24=i;const r=e*e;t.TWO_PWR_64_DBL=r;const a=r/2;t.TWO_PWR_63_DBL=a;const s=Object.freeze(b(0,2147483648));t.MIN_VALUE=s;const o=Object.freeze(b(4294967295,2147483647));t.MAX_VALUE=o;const h=Object.freeze(b(4294967295,4294967295,!0));t.MAX_UNSIGNED_VALUE=h;const l=Object.freeze(m(1));t.ONE=l;const u=Object.freeze(m(1,!0));t.UONE=u;const f=Object.freeze(m(-1));t.NEG_ONE=f;const c=Object.freeze(m(0));t.ZERO=c;const d=Object.freeze(m(0,!0));t.UZERO=d;const g=48042===new Uint16Array(new Uint8Array([170,187]).buffer)[0];t.isLE=g;const _=Math.pow;function w(t){return null!==t&&"object"==typeof t&&"number"==typeof t.low&&"number"==typeof t.high}function b(t,e,n,i){return null==i?{low:0|t,high:0|e,unsigned:!!n}:(i.low=0|t,i.high=0|e,i.unsigned=!!n,i)}function m(t,e,n){let i;return e?(t>>>=0,i=0):i=0|((t|=0)<0?-1:0),b(t,i,e,n)}function p(){throw new Error("BigInt is not supported on this platform.")}const v="undefined"==typeof BigInt?p:function(){const t=BigInt(0),n=BigInt(1),i=BigInt(-1),l=BigInt(e),u=BigInt(r),f=BigInt(a);return function e(r,a,c){if(null==c&&(c={low:0,high:0,unsigned:!1}),a){if(r<t)return vt(d,c);if(r>=u)return vt(h,c)}else{if(r<=-f)return vt(s,c);if(r+n>=f)return vt(o,c);if(r<t)return ut(e(r*i,a,c),c)}return b(Number(r%l),Number(r/l),a,c)}}();function y(t,n,i){if(null==i&&(i={low:0,high:0,unsigned:!1}),isNaN(t))return vt(n?d:c,i);if(n){if(t<0)return vt(d,i);if(t>=r)return vt(h,i)}else{if(t<=-a)return vt(s,i);if(t+1>=a)return vt(o,i);if(t<0)return ut(y(-t,n,i),i)}return i.low=t%e|0,i.high=t/e|0,i.unsigned=!!n,i}function k(t){return t.unsigned?(t.high>>>0)*e+(t.low>>>0):t.high*e+(t.low>>>0)}t.fromBigInt=v;const x={out:null,target:null,offset:0};function z(t,e){if("object"==typeof t&&null!==t){const n=e;e=t,t=n||0}else t=t||0;x.offset=t,e?e instanceof Uint8Array||!e.buffer?x.out=e:x.out=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):(e=new Uint8Array(t+8),x.out=e),x.target=e}function B(t,e,n){return z(e,n),I(t,x.offset,x.out),x.target}function I(t,e,n){const i=t.high,r=t.low;return n[e]=255&r,n[e+1]=r>>>8&255,n[e+2]=r>>>16&255,n[e+3]=r>>>24,n[e+4]=255&i,n[e+5]=i>>>8&255,n[e+6]=i>>>16&255,n[e+7]=i>>>24,n}const S={source:null,target:null,offset:0};function E(t,e,n,i){"number"==typeof e&&(i=n,n=e,e=!1),"object"==typeof n?(i=n,S.offset=0):S.offset=n||0,null==i?S.target={low:0,high:0,unsigned:!!e}:(i.unsigned=!!e,S.target=i),S.source=t instanceof Uint8Array||!t.buffer?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function A(t,e,n,i){return E(t,e,n,i),O(S.source,S.offset,S.target)}function O(t,e,n){return n.low=t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24,n.high=t[e+4]|t[e+5]<<8|t[e+6]<<16|t[e+7]<<24,n}function R(t,e,n){return z(e,n),T(t,x.offset,x.out),x.target}function T(t,e,n){const i=t.high,r=t.low;return n[e]=i>>>24,n[e+1]=i>>>16&255,n[e+2]=i>>>8&255,n[e+3]=255&i,n[e+4]=r>>>24,n[e+5]=r>>>16&255,n[e+6]=r>>>8&255,n[e+7]=255&r,n}function N(t,e,n,i){return E(t,e,n,i),C(S.source,S.offset,S.target)}function C(t,e,n){return n.low=t[e+4]<<24|t[e+5]<<16|t[e+6]<<8|t[e+7],n.high=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3],n}const P=g?A:N;t.fromBytes=P;const L=g?O:C;t.fromBytesRaw=L;const U=g?B:R;t.toBytes=U;const M=g?I:T;t.toBytesRaw=M;const F=128,D=127;function j(t,e,n){return z(e,n),W(t,x.offset,x.out),j.bytes=W.bytes,x.target}j.bytes=1;const Z=m(0);function $(t){const e=t.high,n=t.low,i=e>>31;Z.low=n<<1^i,Z.high=n>>>31^e<<1^i}function H(t,e,n){return $(t),W(Z,e,n),H.bytes=W.bytes,n}function W(t,e,n){const i=t.high,r=t.low,a=i>>>24,s=i>>>17&D,o=i>>>10&D,h=i>>>3&D,l=(7&i)<<4|r>>>28,u=r>>>21&D,f=r>>>14&D,c=r>>>7&D,d=r&D;return 0!==a?(W.bytes=9,n[e+8]=a,n[e+7]=s|F,n[e+6]=o|F,n[e+5]=h|F,n[e+4]=l|F,n[e+3]=u|F,n[e+2]=f|F,n[e+1]=c|F,n[e]=d|F,n):0!==s?(W.bytes=8,n[e+7]=s,n[e+6]=o|F,n[e+5]=h|F,n[e+4]=l|F,n[e+3]=u|F,n[e+2]=f|F,n[e+1]=c|F,n[e]=d|F,n):0!==o?(W.bytes=7,n[e+6]=o,n[e+5]=h|F,n[e+4]=l|F,n[e+3]=u|F,n[e+2]=f|F,n[e+1]=c|F,n[e]=d|F,n):0!==h?(W.bytes=6,n[e+5]=h,n[e+4]=l|F,n[e+3]=u|F,n[e+2]=f|F,n[e+1]=c|F,n[e]=d|F,n):0!==l?(W.bytes=5,n[e+4]=l,n[e+3]=u|F,n[e+2]=f|F,n[e+1]=c|F,n[e]=d|F,n):0!==u?(W.bytes=4,n[e+3]=u,n[e+2]=f|F,n[e+1]=c|F,n[e]=d|F,n):0!==f?(W.bytes=3,n[e+2]=f,n[e+1]=c|F,n[e]=d|F,n):0!==c?(W.bytes=2,n[e+1]=c,n[e]=d|F,n):(W.bytes=1,n[e]=d,n)}function V(t){const e=t.high,n=t.low;return 0!=e>>>24?9:e>>>17&D?8:e>>>10&D?7:e>>>3&D?6:(7&e)<<4|n>>>28?5:n>>>21&D?4:n>>>14&D?3:n>>>7&D?2:1}function q(t,e,n,i){return E(t,e,n,i),Y(S.source,S.offset,S.target),q.bytes=Y.bytes,S.target}function K(t,e,n,i){return E(t,e,n,i),G(S.source,S.offset,S.target),K.bytes=G.bytes,S.target}function G(t,e,n){Y(t,e,n);const i=n.high,r=n.low,a=-(1&r);return n.low=i<<31^r>>>1^a,n.high=i>>>1^a,G.bytes=Y.bytes,n}function Y(t,e,n){let i=t[e];if(!(i&F))return n.low=i,n.high=0,Y.bytes=1,n;let r=i&D;if(i=t[e+1],!(i&F))return n.low=r|i<<7,n.high=0,Y.bytes=2,n;if(r|=(i&D)<<7,i=t[e+2],!(i&F))return n.low=r|i<<14,n.high=0,Y.bytes=3,n;if(r|=(i&D)<<14,i=t[e+3],!(i&F))return n.low=r|i<<21,n.high=0,Y.bytes=4,n;r|=(i&D)<<21,i=t[e+4],n.low=r|(15&i)<<28;let a=(112&i)>>4;return i&F?(i=t[e+5],i&F?(a|=(i&D)<<3,i=t[e+6],i&F?(a|=(i&D)<<10,i=t[e+7],i&F?(a|=(i&D)<<17,i=t[e+8],n.high=a|t[e+8]<<24,Y.bytes=9,n):(n.high=a|i<<17,Y.bytes=8,n)):(n.high=a|i<<10,Y.bytes=7,n)):(n.high=a|i<<3,Y.bytes=6,n)):(n.high=a,Y.bytes=5,n)}W.bytes=1,q.bytes=1,K.bytes=1,G.bytes=1,Y.bytes=1;const X=function(){const t=m(0),e=m(0),n=m(0),i=m(0),r=m(0),a=m(0),o=m(0),h=m(0);return function l(u,f){if(null==f||0===f||!1===f?f=10:"string"==typeof f&&(f=parseInt(f,10)),f<2||f>36)throw new RangeError(`Radix between 2 and 36 expected, got: ${f}`);if(tt(u))return"0";if(st(u))return nt(u,s)?(y(f,!1,e),mt(u,e,n),bt(n,e,i),ft(i,u,i),l(n,f)+J(i).toString(f)):"-"+l(ut(u,t),f);y(_(f,6),u.unsigned,a),vt(u,r);let c="";for(;;){mt(r,a,o),bt(o,a,h);let t=(J(ft(r,h,h))>>>0).toString(f);if(vt(o,r),tt(r))return t+c;for(;t.length<6;)t="0"+t;c=""+t+c}}}();function J(t){return t.unsigned?t.low>>>0:t.low}t.toString=X;const Q="undefined"==typeof BigInt?p:function(){const t=BigInt(e),n=2n*BigInt(2147483648),i=BigInt(-1),r=m(0);return function e(a){if(st(a))return e(ut(a,r))*i;const s=a.low<0?n+BigInt(a.low):BigInt(a.low),o=BigInt(a.high)*t+s;return a.unsigned?BigInt.asUintN(64,o):BigInt.asIntN(64,o)}}();function tt(t){return 0===t.low&&0===t.high}function et(t){return!(1&~t.low)}function nt(t,e){return(!t.unsigned==!e.unsigned||t.high>>>31!=1||e.high>>>31!=1)&&t.high===e.high&&t.low===e.low}function it(t,e){return ct(t,e)<0}function rt(t,e){return ct(t,e)>=0}function at(t,e){return ct(t,e)>0}function st(t){return!t.unsigned&&t.high<0}t.toBigInt=Q;const ot=function(){const t=new ArrayBuffer(8),e=new Float64Array(t),n=new Uint32Array(t);return g?function(t,i,r){return null==i&&(i={low:0,high:0,unsigned:r}),e[0]=t,i.low=n[0],i.high=n[1],i.unsigned=!!r,i}:function(t,i,r){return null==i&&(i={low:0,high:0,unsigned:r}),e[0]=t,i.low=n[1],i.high=n[0],i.unsigned=!!r,i}}();function ht(t,e,n){const i=t.high>>>16,r=65535&t.high,a=t.low>>>16,s=65535&t.low,o=e.high>>>16,h=65535&e.high,l=e.low>>>16;let u=s+(65535&e.low),f=u>>>16;u&=65535,f+=a+l;let c=f>>>16;f&=65535,c+=r+h;let d=c>>>16;return c&=65535,d+=i+o,d&=65535,n.low=f<<16|u,n.high=d<<16|c,n.unsigned=!!t.unsigned,n}function lt(t,e){return e.low=~t.low,e.high=~t.high,e.unsigned=!!t.unsigned,e}t.fromFloat=ot;const ut=function(){const t=m(0);return function(e,n){return!e.unsigned&&nt(e,s)?vt(s,n,!1):ht(lt(e,t),l,n)}}();t.neg=ut;const ft=function(){const t=m(0);return function(e,n,i){return ht(e,ut(n,t),i)}}();t.sub=ft;const ct=function(){const t=m(0);return function(e,n){if(nt(e,n))return 0;const i=st(e),r=st(n);return i&&!r?-1:!i&&r?1:e.unsigned?n.high>>>0>e.high>>>0||n.high===e.high&&n.low>>>0>e.low>>>0?-1:1:st(ft(e,n,t))?-1:1}}();function dt(t,e,n){return 0==(e&=63)?(n.low=t.low,n.high=t.high):e<32?(n.low=t.low>>>e|t.high<<32-e,n.high=t.high>>e):(n.low=t.high>>e-32,n.high=t.high>=0?0:-1),n.unsigned=!!t.unsigned,n}function gt(t,e,n){return 0==(e&=63)?(n.low=t.low,n.high=t.high):e<32?(n.low=t.low>>>e|t.high<<32-e,n.high=t.high>>>e):32===e?(n.low=t.high,n.high=0):(n.low=t.high>>>e-32,n.high=0),n.unsigned=!!t.unsigned,n}function _t(t,e,n){return 0==(e&=63)?(n.low=t.low,n.high=t.high):e<32?(n.low=t.low<<e,n.high=t.high<<e|t.low>>>32-e):(n.low=0,n.high=t.low<<e-32),n.unsigned=!!t.unsigned,n}function wt(t,e,n){if(it(t,i)&&it(e,i))return y(k(t)*k(e),t.unsigned,n),n;const r=t.high>>>16,a=65535&t.high,s=t.low>>>16,o=65535&t.low,h=e.high>>>16,l=65535&e.high,u=e.low>>>16,f=65535&e.low;let c=o*f,d=c>>>16;c&=65535,d+=s*f;let g=d>>>16;d&=65535,d+=o*u,g+=d>>>16,d&=65535,g+=a*f;let _=g>>>16;return g&=65535,g+=s*u,_+=g>>>16,g&=65535,g+=o*l,_+=g>>>16,g&=65535,_+=r*f+a*u+s*l+o*h,_&=65535,n.low=d<<16|c,n.high=_<<16|g,n.unsigned=!!t.unsigned,n}t.compare=ct;const bt=function(){const t=m(0),e=m(0);return function(n,i,r){return tt(n)||tt(i)?vt(n.unsigned?d:c,r):nt(n,s)?(vt(et(i)?s:c,r),r.unsigned=!!n.unsigned,r):nt(i,s)?(vt(et(n)?s:c,r),r.unsigned=!!n.unsigned,r):st(n)?(ut(n,t),st(i)?(ut(i,e),wt(t,e,r)):(wt(t,i,e),ut(e,r)),r):st(i)?(ut(i,t),wt(n,t,e),ut(e,r),r):wt(n,i,r)}}();t.mul=bt;const mt=function(){const t=m(0),e=m(0),n=m(0),i=m(0),r=m(0),a=m(0),o=m(0);return function h(g,w,b){if(tt(w))throw Error("division by zero");if(tt(g))return vt(g,b);if(g.unsigned){if(w.unsigned||(w=vt(w,a,!0)),at(w,g))return vt(d,b);if(at(w,gt(g,1,o)))return vt(u,b);vt(d,b)}else{if(nt(g,s)){if(nt(w,l)||nt(w,f))return vt(s,b,!1);if(nt(w,s))return vt(l,b,!1);const t={};return _t(h(dt(g,1,{}),w,{}),1,t),nt(t,c)?vt(st(w)?l:f,b,!1):(ft(g,bt(w,t,b),b),ht(t,h(b,w,b),b))}if(nt(w,s))return vt(c,b);if(st(g))return g=ut(g,i),st(w)?h(g,ut(w,r),b):ut(h(g,w,b),b);if(st(w))return ut(h(g,ut(w,r),b),b);vt(c,b)}for(vt(g,t);rt(t,w);){let i=Math.max(1,Math.floor(k(t)/k(w)));const r=Math.ceil(Math.log(i)/Math.LN2),a=r<=48?1:_(2,r-48);for(y(i,!1,e),bt(e,w,n);st(n)||at(n,t);)i-=a,y(i,g.unsigned,e),bt(e,w,n);ht(b,tt(e)?l:e,b),ft(t,n,t)}return b}}();t.div=mt;const pt=function(){const t=m(0);return function(e,n,i){return mt(e,n,t),bt(t,n,t),ft(e,t,i)}}();function vt(t,e,n){return e.low=0|t.low,e.high=0|t.high,e.unsigned=void 0!==n?n:!!t.unsigned,e}let yt;function kt(t,e,n,i){if(0===t.length)return vt(c,i);if("object"==typeof e)i=e,e=!1,n=void 0;else if("number"==typeof e||"boolean"==typeof n)return kt(t,n,e,i);if(null==i&&(i={low:0,high:0,unsigned:e}),"NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)throw new Error(`Input "${t}" is not supported by longfn.`);const r=(t=t.trim()).indexOf("-");if(r>0)throw new Error(`Input "${t}" contains hyphen at unexpected position ${r}`);const a=0===r;if(a){if(e)throw new Error(`Input "${t}" is marked as negative though it is supposed to be unsigned.`);t=t.substr(1)}if(void 0===n||0===n||!1===n)if(/^0x/i.test(t))t=t.substr(2),n=16;else{if(/^0/.test(t))throw new Error(`If no radix is specified, input "${t}" should not start with a 0 as a it is an unclear state in JavaScript`);n=10}else if("string"==typeof n&&(n=parseInt(n,10)),n<2||n>36)throw new RangeError(`Radix between 2 and 36 expected, got: ${n}`);const s=function(t){if(void 0===yt){yt={};for(let t=2;t<=36;t++){const e=m(t,!0),n=[];let i=m(1,!0),r=m(0,!0);for(let a=0;at(i,r);a++){const a={};n.push(a);for(let e=1;e<t;e++){const n=m(e,!0);a[e.toString(t)]=bt(n,i,n)}const s=r;r=i,i=bt(i,e,s)}yt[t]=n}}return yt[t]}(n);vt(c,i,!0);let o=0;for(;o<t.length;o++){const e=s[o%s.length],n=t[o];if("0"!==n&&void 0===e[n])break}for(let e=0,n=o-1;e<o;e++,n--){const r=s[e%s.length],a=t[n];"0"!==a&&ht(i,r[a],i)}return i.unsigned=!!e,a&&ut(i,i),i}function xt(t){const e=Math.clz32(t&-t);return t?31-e:e}return t.mod=pt,"default"in t?t.default:t}({});void 0===(n=function(){return i}.apply(e,[]))||(t.exports=n)}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var a=e[i]={exports:{}};return t[i].call(a.exports,a,a.exports,n),a.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i=n(806);window.gmodTABIX=i})();
|
|
1
|
+
(()=>{var e={963:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e,t,i,n=void 0){this.minv=e,this.maxv=t,this.bin=i,this._fetchedSize=n}toUniqueString(){return`${this.minv}..${this.maxv} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`}toString(){return this.toUniqueString()}compareTo(e){return this.minv.compareTo(e.minv)||this.maxv.compareTo(e.maxv)||this.bin-e.bin}fetchedSize(){return void 0!==this._fetchedSize?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}},875:function(e,t,i){"use strict";var n,a=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var a=Object.getOwnPropertyDescriptor(t,i);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,a)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&a(t,e,i[s]);return r(t,e),t}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=i(511),h=s(i(758)),d=o(i(963)),c=i(472),f=o(i(656)),u=i(586),_={0:"generic",1:"SAM",2:"VCF"};function g(e,t){return Math.floor(e/2**t)}class b extends f.default{constructor(e){super(e),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(e,t={}){const i=await this.parse(t),n=i.refNameToId[e];if(void 0===n)return-1;if(!i.indices[n])return-1;const{stats:a}=i.indices[n];return a?a.lineCount:-1}indexCov(){throw new Error("CSI indexes do not support indexcov")}parseAuxData(e,t){const i=new DataView(e.buffer),n=i.getInt32(t,!0),a=65536&n?"zero-based-half-open":"1-based-closed",r=_[15&n];if(!r)throw new Error(`invalid Tabix preset format flags ${n}`);const s={ref:i.getInt32(t+4,!0),start:i.getInt32(t+8,!0),end:i.getInt32(t+12,!0)},o=i.getInt32(t+16,!0),l=o?String.fromCharCode(o):null,h=i.getInt32(t+20,!0),d=i.getInt32(t+24,!0),{refIdToName:c,refNameToId:f}=this._parseNameBytes(e.subarray(t+28,t+28+d));return{refIdToName:c,refNameToId:f,skipLines:h,metaChar:l,columnNumbers:s,format:r,coordinateType:a}}_parseNameBytes(e){let t=0,i=0;const n=[],a={},r=new TextDecoder("utf8");for(let s=0;s<e.length;s+=1)if(!e[s]){if(i<s){const o=this.renameRefSeq(r.decode(e.subarray(i,s)));n[t]=o,a[o]=t}i=s+1,t+=1}return{refNameToId:a,refIdToName:n}}async _parse(e={}){const t=await(0,l.unzip)(await this.filehandle.readFile(e)),i=new DataView(t.buffer);let n;if(21582659===i.getUint32(0,!0))n=1;else{if(38359875!==i.getUint32(0,!0))throw new Error("Not a CSI file");n=2}this.minShift=i.getInt32(4,!0),this.depth=i.getInt32(8,!0),this.maxBinNumber=((1<<3*(this.depth+1))-1)/7;const a=2**(this.minShift+3*this.depth),r=i.getInt32(12,!0),s=r&&r>=30?this.parseAuxData(t,16):{refIdToName:[],refNameToId:{},metaChar:null,columnNumbers:{ref:0,start:1,end:2},coordinateType:"zero-based-half-open",format:"generic"},o=i.getInt32(16+r,!0);let c,f=16+r+4;const u=new Array(o).fill(0).map((()=>{const e=i.getInt32(f,!0);f+=4;const n={};let a;for(let r=0;r<e;r+=1){const e=i.getUint32(f,!0);if(e>this.maxBinNumber)a=this.parsePseudoBin(t,f+4),f+=48;else{const a=(0,h.fromBytes)(t,f+4);c=this._findFirstData(c,a);const r=i.getInt32(f+12,!0);f+=16;const s=new Array(r);for(let i=0;i<r;i+=1){const n=(0,h.fromBytes)(t,f),a=(0,h.fromBytes)(t,f+8);f+=16,s[i]=new d.default(n,a,e)}n[e]=s}}return{binIndex:n,stats:a}}));return{...s,csi:!0,refCount:o,maxBlockSize:65536,firstDataLine:c,csiVersion:n,indices:u,depth:this.depth,maxBinNumber:this.maxBinNumber,maxRefLength:a}}parsePseudoBin(e,t){return{lineCount:(0,u.longFromBytesToUnsigned)(e,t+28)}}async blocksForRange(e,t,i,n={}){t<0&&(t=0);const a=await this.parse(n),r=a.refNameToId[e];if(void 0===r)return[];const s=a.indices[r];if(!s)return[];const o=this.reg2bins(t,i),l=[];for(const[e,t]of o)for(let i=e;i<=t;i++)if(s.binIndex[i])for(const e of s.binIndex[i])l.push(new d.default(e.minv,e.maxv,i));return(0,c.optimizeChunks)(l,new h.default(0,0))}reg2bins(e,t){(e-=1)<1&&(e=1),t>2**50&&(t=2**34),t-=1;let i=0,n=0,a=this.minShift+3*this.depth;const r=[];for(;i<=this.depth;a-=3,n+=1*2**(3*i),i+=1){const i=n+g(e,a),s=n+g(t,a);if(s-i+r.length>this.maxBinNumber)throw new Error(`query ${e}-${t} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);r.push([i,s])}return r}}t.default=b},806:function(e,t,i){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TBI=t.CSI=t.TabixIndexedFile=void 0;var a=i(285);Object.defineProperty(t,"TabixIndexedFile",{enumerable:!0,get:function(){return n(a).default}});var r=i(875);Object.defineProperty(t,"CSI",{enumerable:!0,get:function(){return n(r).default}});var s=i(431);Object.defineProperty(t,"TBI",{enumerable:!0,get:function(){return n(s).default}})},656:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor({filehandle:e,renameRefSeqs:t=e=>e}){this.filehandle=e,this.renameRefSeq=t}async getMetadata(e={}){const{indices:t,...i}=await this.parse(e);return i}_findFirstData(e,t){return e?e.compareTo(t)>0?t:e:t}async parse(e={}){return this.parseP||(this.parseP=this._parse(e).catch((e=>{throw this.parseP=void 0,e}))),this.parseP}async hasRefSeq(e,t={}){const i=await this.parse(t);return!!i.indices[e]?.binIndex}}},586:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TWO_PWR_32_DBL=t.TWO_PWR_16_DBL=void 0,t.longFromBytesToUnsigned=function(e,i=0){const n=e[i]|e[i+1]<<8|e[i+2]<<16|e[i+3]<<24;return((e[i+4]|e[i+5]<<8|e[i+6]<<16|e[i+7]<<24)>>>0)*t.TWO_PWR_32_DBL+(n>>>0)},t.TWO_PWR_16_DBL=65536,t.TWO_PWR_32_DBL=t.TWO_PWR_16_DBL*t.TWO_PWR_16_DBL},285:function(e,t,i){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const a=n(i(430)),r=n(i(392)),s=i(689),o=i(511),l=i(472),h=n(i(431)),d=n(i(875));function c(e){return/^[\u0000-\u007F]*$/.test(e)}t.default=class{constructor({path:e,filehandle:t,url:i,tbiPath:n,tbiUrl:o,tbiFilehandle:l,csiPath:c,csiUrl:f,csiFilehandle:u,renameRefSeqs:_=e=>e,chunkCacheSize:g=5242880}){if(t)this.filehandle=t;else if(e)this.filehandle=new s.LocalFile(e);else{if(!i)throw new TypeError("must provide either filehandle or path");this.filehandle=new s.RemoteFile(i)}if(l)this.index=new h.default({filehandle:l,renameRefSeqs:_});else if(u)this.index=new d.default({filehandle:u,renameRefSeqs:_});else if(n)this.index=new h.default({filehandle:new s.LocalFile(n),renameRefSeqs:_});else if(c)this.index=new d.default({filehandle:new s.LocalFile(c),renameRefSeqs:_});else if(e)this.index=new h.default({filehandle:new s.LocalFile(`${e}.tbi`),renameRefSeqs:_});else if(f)this.index=new d.default({filehandle:new s.RemoteFile(f)});else if(o)this.index=new h.default({filehandle:new s.RemoteFile(o)});else{if(!i)throw new TypeError("must provide one of tbiFilehandle, tbiPath, csiFilehandle, csiPath, tbiUrl, csiUrl");this.index=new h.default({filehandle:new s.RemoteFile(`${i}.tbi`)})}this.renameRefSeq=_,this.chunkCache=new a.default({cache:new r.default({maxSize:Math.floor(g/65536)}),fill:(e,t)=>this.readChunk(e,{signal:t})})}async getLines(e,t,i,n){let a,r,s={};"function"==typeof n?r=n:(s=n,r=n.lineCallback,a=n.signal);const o=await this.index.getMetadata(s);(0,l.checkAbortSignal)(a);const h=t??0,d=i??o.maxRefLength;if(!(h<=d))throw new TypeError("invalid start and end coordinates. start must be less than or equal to end");if(h===d)return;const f=await this.index.blocksForRange(e,h,d,s);(0,l.checkAbortSignal)(a);const u=new TextDecoder("utf8");for(const t of f){const{buffer:i,cpositions:n,dpositions:s}=await this.chunkCache.get(t.toString(),t,a);(0,l.checkAbortSignal)(a);let f=0,_=0;const g=u.decode(i),b=c(g);for(;f<g.length;){let a,l;if(b){if(l=g.indexOf("\n",f),-1===l)break;a=g.slice(f,l)}else{if(l=i.indexOf("\n".charCodeAt(0),f),-1===l)break;const e=i.slice(f,l);a=u.decode(e)}if(s){for(;f+t.minv.dataPosition>=s[_++];);_--}const{startCoordinate:c,overlaps:w}=this.checkLine(o,e,h,d,a);if(w)r(a,256*n[_]+(f-s[_])+t.minv.dataPosition+1);else if(void 0!==c&&c>=d)return;f=l+1}}}async getMetadata(e={}){return this.index.getMetadata(e)}async getHeaderBuffer(e={}){const{firstDataLine:t,metaChar:i,maxBlockSize:n}=await this.getMetadata(e);(0,l.checkAbortSignal)(e.signal);const a=(t?.blockPosition||0)+n,r=await this.filehandle.read(a,0,e),s=await(0,o.unzip)(r);if(i){let e=-1;const t="\n".charCodeAt(0),n=i.charCodeAt(0);for(let i=0;i<s.length&&(i!==e+1||s[i]===n);i+=1)s[i]===t&&(e=i);return s.subarray(0,e+1)}return s}async getHeader(e={}){const t=new TextDecoder("utf8"),i=await this.getHeaderBuffer(e);return t.decode(i)}async getReferenceSequenceNames(e={}){return(await this.getMetadata(e)).refIdToName}checkLine(e,t,i,n,a){const{columnNumbers:r,metaChar:s,coordinateType:o,format:l}=e;if(s&&a.startsWith(s))return{overlaps:!1};let{ref:h,start:d,end:c}=r;h||(h=0),d||(d=0),c||(c=0),"VCF"===l&&(c=8);const f=Math.max(h,d,c);let u=1,_=0,g="",b=-1/0;const w=a.length;for(let e=0;e<w+1;e++)if("\t"===a[e]||e===w){if(u===h){if(this.renameRefSeq(a.slice(_,e))!==t)return{overlaps:!1}}else if(u===d){if(b=parseInt(a.slice(_,e),10),"1-based-closed"===o&&(b-=1),b>=n)return{startCoordinate:b,overlaps:!1};if((0===c||c===d)&&b+1<=i)return{startCoordinate:b,overlaps:!1}}else if("VCF"===l&&4===u)g=a.slice(_,e);else if(u===c&&("VCF"===l?this._getVcfEnd(b,g,a.slice(_,e)):Number.parseInt(a.slice(_,e),10))<=i)return{overlaps:!1};if(_=e+1,u+=1,u>f)break}return{startCoordinate:b,overlaps:!0}}_getVcfEnd(e,t,i){let n=e+t.length;const a=i.includes("SVTYPE=TRA");if("."===i[0]||a){if(a)return e+1}else{let e=";";for(let t=0;t<i.length;t+=1){if(";"===e&&"END="===i.slice(t,t+4)){let e=i.indexOf(";",t);-1===e&&(e=i.length),n=parseInt(i.slice(t+4,e),10);break}e=i[t]}}return n}async lineCount(e,t={}){return this.index.lineCount(e,t)}async readChunk(e,t={}){const i=await this.filehandle.read(e.fetchedSize(),e.minv.blockPosition,t);return(0,o.unzipChunkSlice)(i,e)}}},431:function(e,t,i){"use strict";var n,a=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var a=Object.getOwnPropertyDescriptor(t,i);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,a)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),s=0;s<i.length;s++)"default"!==i[s]&&a(t,e,i[s]);return r(t,e),t}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=s(i(758)),h=o(i(963)),d=i(511),c=i(472),f=o(i(656)),u=i(586);class _ extends f.default{async lineCount(e,t={}){const i=await this.parse(t),n=i.refNameToId[e];return void 0===n?-1:i.indices[n]?i.indices[n].stats?.lineCount??-1:-1}async _parse(e={}){const t=await this.filehandle.readFile(e),i=await(0,d.unzip)(t);(0,c.checkAbortSignal)(e.signal);const n=new DataView(i.buffer);if(21578324!==n.getUint32(0,!0))throw new Error("Not a TBI file");const a=n.getUint32(4,!0),r=n.getUint32(8,!0),s=65536&r?"zero-based-half-open":"1-based-closed",o={0:"generic",1:"SAM",2:"VCF"}[15&r];if(!o)throw new Error(`invalid Tabix preset format flags ${r}`);const f={ref:n.getInt32(12,!0),start:n.getInt32(16,!0),end:n.getInt32(20,!0)},u=n.getInt32(24,!0),_=u?String.fromCharCode(u):null,g=n.getInt32(28,!0),b=n.getInt32(32,!0),{refNameToId:w,refIdToName:m}=this._parseNameBytes(i.slice(36,36+b));let p,v=36+b;return{indices:new Array(a).fill(0).map((()=>{const e=n.getInt32(v,!0);v+=4;const t={};let a;for(let r=0;r<e;r+=1){const e=n.getUint32(v,!0);if(v+=4,e>37450)throw new Error("tabix index contains too many bins, please use a CSI index");if(37450===e){const e=n.getInt32(v,!0);v+=4,2===e&&(a=this.parsePseudoBin(i,v)),v+=16*e}else{const a=n.getInt32(v,!0);v+=4;const r=new Array(a);for(let t=0;t<a;t+=1){const n=(0,l.fromBytes)(i,v),a=(0,l.fromBytes)(i,v+8);v+=16,p=this._findFirstData(p,n),r[t]=new h.default(n,a,e)}t[e]=r}}const r=n.getInt32(v,!0);v+=4;const s=new Array(r);for(let e=0;e<r;e+=1)s[e]=(0,l.fromBytes)(i,v),v+=8,p=this._findFirstData(p,s[e]);return{binIndex:t,linearIndex:s,stats:a}})),metaChar:_,maxBinNumber:37449,maxRefLength:536870912,skipLines:g,firstDataLine:p,columnNumbers:f,coordinateType:s,format:o,refIdToName:m,refNameToId:w,maxBlockSize:65536}}parsePseudoBin(e,t){return{lineCount:(0,u.longFromBytesToUnsigned)(e,t+16)}}_parseNameBytes(e){let t=0,i=0;const n=[],a={},r=new TextDecoder("utf8");for(let s=0;s<e.length;s+=1)if(!e[s]){if(i<s){const o=this.renameRefSeq(r.decode(e.subarray(i,s)));n[t]=o,a[o]=t}i=s+1,t+=1}return{refNameToId:a,refIdToName:n}}async blocksForRange(e,t,i,n={}){t<0&&(t=0);const a=await this.parse(n),r=a.refNameToId[e];if(void 0===r)return[];const s=a.indices[r];if(!s)return[];(s.linearIndex.length?s.linearIndex[t>>14>=s.linearIndex.length?s.linearIndex.length-1:t>>14]:new l.default(0,0))||console.warn("querying outside of possible tabix range");const o=(d=t,f=i,[[0,0],[1+((d+=1)>>26),1+((f-=1)>>26)],[9+(d>>23),9+(f>>23)],[73+(d>>20),73+(f>>20)],[585+(d>>17),585+(f>>17)],[4681+(d>>14),4681+(f>>14)]]);var d,f;const u=[];for(const[e,t]of o)for(let i=e;i<=t;i++)if(s.binIndex[i])for(const e of s.binIndex[i])u.push(new h.default(e.minv,e.maxv,i));const _=s.linearIndex.length;let g=null;const b=Math.min(t>>14,_-1),w=Math.min(i>>14,_-1);for(let e=b;e<=w;++e){const t=s.linearIndex[e];t&&(!g||t.compareTo(g)<0)&&(g=t)}return(0,c.optimizeChunks)(u,g)}}t.default=_},472:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkAbortSignal=n,t.abortBreakPoint=async function(e){await Promise.resolve(),n(e)},t.canMergeBlocks=a,t.optimizeChunks=function(e,t){const i=[];let n=null;return 0===e.length?e:(e.sort((function(e,t){const i=e.minv.blockPosition-t.minv.blockPosition;return 0!==i?i:e.minv.dataPosition-t.minv.dataPosition})),e.forEach((e=>{(!t||e.maxv.compareTo(t)>0)&&(null===n?(i.push(e),n=e):a(n,e)?e.maxv.compareTo(n.maxv)>0&&(n.maxv=e.maxv):(i.push(e),n=e))})),i)};class i extends Error{}function n(e){if(e&&e.aborted){if("undefined"!=typeof DOMException)throw new DOMException("aborted","AbortError");{const e=new i("aborted");throw e.code="ERR_ABORTED",e}}}function a(e,t){return t.minv.blockPosition-e.maxv.blockPosition<65e3&&t.maxv.blockPosition-e.minv.blockPosition<5e6}},758:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromBytes=function(e,t=0){return new i(1099511627776*e[t+7]+4294967296*e[t+6]+16777216*e[t+5]+65536*e[t+4]+256*e[t+3]+e[t+2],e[t+1]<<8|e[t])};class i{constructor(e,t){this.blockPosition=e,this.dataPosition=t}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(e){return this.blockPosition-e.blockPosition||this.dataPosition-e.dataPosition}}t.default=i},430:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>s});class n{}class a{constructor(){this.signals=new Set,this.abortController=new AbortController}addSignal(e=new n){if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(e),e.aborted?this.handleAborted(e):"function"==typeof e.addEventListener&&e.addEventListener("abort",(()=>{this.handleAborted(e)}))}handleAborted(e){this.signals.delete(e),0===this.signals.size&&this.abortController.abort()}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}}class r{constructor(){this.callbacks=new Set}addCallback(e=()=>{}){this.callbacks.add(e),e(this.currentMessage)}callback(e){this.currentMessage=e;for(const t of this.callbacks)t(e)}}class s{constructor({fill:e,cache:t}){if("function"!=typeof e)throw new TypeError("must pass a fill function");if("object"!=typeof t)throw new TypeError("must pass a cache object");if("function"!=typeof t.get||"function"!=typeof t.set||"function"!=typeof t.delete)throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=t,this.fillCallback=e}static isAbortException(e){return"AbortError"===e.name||"ERR_ABORTED"===e.code||"AbortError: aborted"===e.message||"Error: aborted"===e.message}evict(e,t){this.cache.get(e)===t&&this.cache.delete(e)}fill(e,t,i,n){const s=new a,o=new r;o.addCallback(n);const l={aborter:s,promise:this.fillCallback(t,s.signal,(e=>{o.callback(e)})),settled:!1,statusReporter:o,get aborted(){return this.aborter.signal.aborted}};l.aborter.addSignal(i),l.aborter.signal.addEventListener("abort",(()=>{l.settled||this.evict(e,l)})),l.promise.then((()=>{l.settled=!0}),(()=>{l.settled=!0,this.evict(e,l)})).catch((e=>{throw console.error(e),e})),this.cache.set(e,l)}static checkSinglePromise(e,t){function i(){if(null==t?void 0:t.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return e.then((e=>(i(),e)),(e=>{throw i(),e}))}has(e){return this.cache.has(e)}get(e,t,i,n){if(!i&&t instanceof AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");const a=this.cache.get(e);return a?a.aborted&&!a.settled?(this.evict(e,a),this.get(e,t,i,n)):a.settled?a.promise:(a.aborter.addSignal(i),a.statusReporter.addCallback(n),s.checkSinglePromise(a.promise,i)):(this.fill(e,t,i,n),s.checkSinglePromise(this.cache.get(e).promise,i))}delete(e){const t=this.cache.get(e);t&&(t.settled||t.aborter.abort(),this.cache.delete(e))}clear(){const e=this.cache.keys();let t=0;for(let i=e.next();!i.done;i=e.next())this.delete(i.value),t+=1;return t}}},511:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BgzfFilehandle:()=>c,unzip:()=>s,unzipChunkSlice:()=>o});var n=i(689),a=i(668);function r(e){const t=new Uint8Array(function(e){let t=0;for(const i of e)t+=i.length;return t}(e));let i=0;for(const n of e)t.set(n,i),i+=n.length;return t}async function s(e){try{let t,i,n=0;const s=[];do{const r=e.subarray(n);if(i=new a.Inflate,({strm:t}=i),i.push(r,a.Z_SYNC_FLUSH),i.err)throw new Error(i.msg);n+=t.next_in,s.push(i.result)}while(t.avail_in);return r(s)}catch(e){if(/incorrect header check/.exec(`${e}`))throw new Error("problem decompressing block: incorrect gzip header check");throw e}}async function o(e,t){try{let i;const{minv:n,maxv:s}=t;let o=n.blockPosition,l=n.dataPosition;const h=[],d=[],c=[];let f=0;do{const t=e.subarray(o-n.blockPosition),r=new a.Inflate;if(({strm:i}=r),r.push(t,a.Z_SYNC_FLUSH),r.err)throw new Error(r.msg);const u=r.result;h.push(u);let _=u.length;d.push(o),c.push(l),1===h.length&&n.dataPosition&&(h[0]=h[0].subarray(n.dataPosition),_=h[0].length);const g=o;if(o+=i.next_in,l+=_,g>=s.blockPosition){h[f]=h[f].subarray(0,s.blockPosition===n.blockPosition?s.dataPosition-n.dataPosition+1:s.dataPosition+1),d.push(o),c.push(l);break}f++}while(i.avail_in);return{buffer:r(h),cpositions:d,dpositions:c}}catch(e){if(/incorrect header check/.exec(`${e}`))throw new Error("problem decompressing block: incorrect gzip header check");throw e}}function l(e,t=0){const i=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24;return 4294967296*((e[t+4]|e[t+5]<<8|e[t+6]<<16|e[t+7]<<24)>>>0)+(i>>>0)}function h(e,t,i){const n=t[1],a=i?i[1]:1/0;return n<=e&&a>e?0:n<e?-1:1}class d{constructor({filehandle:e,path:t}){if(e)this.filehandle=e;else{if(!t)throw new TypeError("either filehandle or path must be defined");this.filehandle=new n.LocalFile(t)}}_getIndex(){return this.index||(this.index=this._readIndex().catch((e=>{throw this.index=void 0,e}))),this.index}async _readIndex(){const e=l(await this.filehandle.read(8,0));if(!e)return[[0,0]];const t=new Array(e+1);t[0]=[0,0];const i=16*e;if(i>Number.MAX_SAFE_INTEGER)throw new TypeError("integer overflow");const n=await this.filehandle.read(i,8);for(let i=0;i<e;i+=1){const e=l(n,16*i),a=l(n,16*i+8);t[i+1]=[e,a]}return t}async getLastBlock(){return(await this._getIndex()).at(-1)}async getRelevantBlocksForRead(e,t){const i=t+e;if(0===e)return[];const n=await this._getIndex(),a=[];let r=0,s=n.length-1,o=Math.floor(n.length/2),l=h(t,n[o],n[o+1]);for(;0!==l;)l>0?s=o-1:l<0&&(r=o+1),o=Math.ceil((s-r)/2)+r,l=h(t,n[o],n[o+1]);a.push(n[o]);let d=o+1;for(;d<n.length&&(a.push(n[d]),!(n[d][1]>=i));d+=1);return a[a.length-1][1]<i&&a.push([]),a}}class c{constructor({filehandle:e,path:t,gziFilehandle:i,gziPath:a}){if(e)this.filehandle=e;else{if(!t)throw new TypeError("either filehandle or path must be defined");this.filehandle=new n.LocalFile(t)}if(!i&&!a&&!t)throw new TypeError("either gziFilehandle or gziPath must be defined");this.gzi=new d({filehandle:i,path:i||a||!t?`${t}.gzi`:a})}async _readAndUncompressBlock(e,t){let i=t;i||(i=(await this.filehandle.stat()).size);const n=i-e;return s(await this.filehandle.read(n,e))}async read(e,t){const i=await this.gzi.getRelevantBlocksForRead(e,t),n=[];for(let a=0;a<i.length-1;a+=1){const r=await this._readAndUncompressBlock(i[a][0],i[a+1][0]),[,s]=i[a],o=s>=t?0:t-s,l=Math.min(t+e,s+r.length)-s;o>=0&&o<r.length&&n.push(r.subarray(o,l))}return r(n)}}},689:(e,t,i)=>{"use strict";i.r(t),i.d(t,{BlobFile:()=>o,LocalFile:()=>a(),RemoteFile:()=>s,fromUrl:()=>l,open:()=>h});var n=i(937),a=i.n(n);function r(e){return("object"==typeof e&&null!==e&&"message"in e?e.message:`${e}`).replace(/\.$/,"")}class s{constructor(e,t={}){this.baseOverrides={},this.url=e;const i=t.fetch||globalThis.fetch.bind(globalThis);t.overrides&&(this.baseOverrides=t.overrides),this.fetchImplementation=i}async fetch(e,t){let i;try{i=await this.fetchImplementation(e,t)}catch(n){if(!`${n}`.includes("Failed to fetch"))throw new Error(`${r(n)} fetching ${e}`,{cause:n});console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);try{i=await this.fetchImplementation(e,{...t,cache:"reload"})}catch(t){throw new Error(`${r(t)} fetching ${e}`,{cause:t})}}return i}async read(e,t,i={}){const{headers:n={},signal:a,overrides:r={}}=i;e<1/0?n.range=`bytes=${t}-${t+e}`:e===1/0&&0!==t&&(n.range=`bytes=${t}-`);const s=await this.fetch(this.url,{...this.baseOverrides,...r,headers:{...n,...r.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:a});if(!s.ok)throw new Error(`HTTP ${s.status} fetching ${this.url}`);if(200===s.status&&0===t||206===s.status){const t=await s.arrayBuffer(),i=s.headers.get("content-range"),n=/\/(\d+)$/.exec(i||"");return n?.[1]&&(this._stat={size:parseInt(n[1],10)}),new Uint8Array(t.slice(0,e))}throw 200===s.status?new Error(`${this.url} fetch returned status 200, expected 206`):new Error(`HTTP ${s.status} fetching ${this.url}`)}async readFile(e={}){let t,i;"string"==typeof e?(t=e,i={}):(t=e.encoding,i=e,delete i.encoding);const{headers:n={},signal:a,overrides:r={}}=i,s=await this.fetch(this.url,{headers:n,method:"GET",redirect:"follow",mode:"cors",signal:a,...this.baseOverrides,...r});if(200!==s.status)throw new Error(`HTTP ${s.status} fetching ${this.url}`);if("utf8"===t)return s.text();if(t)throw new Error(`unsupported encoding: ${t}`);return new Uint8Array(await s.arrayBuffer())}async stat(){if(!this._stat&&(await this.read(10,0),!this._stat))throw new Error(`unable to determine size of file at ${this.url}`);return this._stat}async close(){}}class o{constructor(e){this.blob=e,this.size=e.size}async read(e,t=0){if(!e)return new Uint8Array(0);const i=t,n=i+e;return new Uint8Array(await this.blob.slice(i,n).arrayBuffer())}async readFile(e){const t="string"==typeof e?e:e?.encoding;if("utf8"===t)return this.blob.text();if(t)throw new Error(`unsupported encoding: ${t}`);return new Uint8Array(await this.blob.arrayBuffer())}async stat(){return{size:this.size}}async close(){}}function l(e,t={}){return new s(e,t)}function h(e,t,i,n={}){if(void 0!==i)return i;if(void 0!==e)return l(e,n);if(void 0!==t)return new(a())(t,n);throw new Error("no url, path, or filehandle provided, cannot open")}},668:(e,t,i)=>{"use strict";var n={};(0,i(805).assign)(n,i(303),i(83),i(681)),e.exports=n},303:(e,t,i)=>{"use strict";var n=i(411),a=i(805),r=i(996),s=i(674),o=i(442),l=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=a.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var 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 o,this.strm.avail_out=0;var i=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==i)throw new Error(s[i]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var d;if(d="string"==typeof t.dictionary?r.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(i=n.deflateSetDictionary(this.strm,d)))throw new Error(s[i]);this._dict_set=!0}}function d(e,t){var i=new h(t);if(i.push(e,!0),i.err)throw i.msg||s[i.err];return i.result}h.prototype.push=function(e,t){var i,s,o=this.strm,h=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?4:0,"string"==typeof e?o.input=r.string2buf(e):"[object ArrayBuffer]"===l.call(e)?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new a.Buf8(h),o.next_out=0,o.avail_out=h),1!==(i=n.deflate(o,s))&&0!==i)return this.onEnd(i),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(r.buf2binstring(a.shrinkBuf(o.output,o.next_out))):this.onData(a.shrinkBuf(o.output,o.next_out)))}while((o.avail_in>0||0===o.avail_out)&&1!==i);return 4===s?(i=n.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,0===i):2!==s||(this.onEnd(0),o.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=h,t.deflate=d,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,d(e,t)}},83:(e,t,i)=>{"use strict";var n=i(447),a=i(805),r=i(996),s=i(681),o=i(674),l=i(442),h=i(414),d=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var i=n.inflateInit2(this.strm,t.windowBits);if(i!==s.Z_OK)throw new Error(o[i]);if(this.header=new h,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=r.string2buf(t.dictionary):"[object ArrayBuffer]"===d.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=n.inflateSetDictionary(this.strm,t.dictionary))!==s.Z_OK))throw new Error(o[i])}function f(e,t){var i=new c(t);if(i.push(e,!0),i.err)throw i.msg||o[i.err];return i.result}c.prototype.push=function(e,t){var i,o,l,h,c,f=this.strm,u=this.options.chunkSize,_=this.options.dictionary,g=!1;if(this.ended)return!1;o=t===~~t?t:!0===t?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof e?f.input=r.binstring2buf(e):"[object ArrayBuffer]"===d.call(e)?f.input=new Uint8Array(e):f.input=e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new a.Buf8(u),f.next_out=0,f.avail_out=u),(i=n.inflate(f,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&_&&(i=n.inflateSetDictionary(this.strm,_)),i===s.Z_BUF_ERROR&&!0===g&&(i=s.Z_OK,g=!1),i!==s.Z_STREAM_END&&i!==s.Z_OK)return this.onEnd(i),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&i!==s.Z_STREAM_END&&(0!==f.avail_in||o!==s.Z_FINISH&&o!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(l=r.utf8border(f.output,f.next_out),h=f.next_out-l,c=r.buf2string(f.output,l),f.next_out=h,f.avail_out=u-h,h&&a.arraySet(f.output,f.output,l,h,0),this.onData(c)):this.onData(a.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(g=!0)}while((f.avail_in>0||0===f.avail_out)&&i!==s.Z_STREAM_END);return i===s.Z_STREAM_END&&(o=s.Z_FINISH),o===s.Z_FINISH?(i=n.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===s.Z_OK):o!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),f.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){e===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=c,t.inflate=f,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},t.ungzip=f},805:(e,t)=>{"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var a in i)n(i,a)&&(e[a]=i[a])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,i,n,a){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+n),a);else for(var r=0;r<n;r++)e[a+r]=t[i+r]},flattenChunks:function(e){var t,i,n,a,r,s;for(n=0,t=0,i=e.length;t<i;t++)n+=e[t].length;for(s=new Uint8Array(n),a=0,t=0,i=e.length;t<i;t++)r=e[t],s.set(r,a),a+=r.length;return s}},r={arraySet:function(e,t,i,n,a){for(var r=0;r<n;r++)e[a+r]=t[i+r]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,a)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,r))},t.setTyped(i)},996:(e,t,i)=>{"use strict";var n=i(805),a=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch(e){a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){r=!1}for(var s=new n.Buf8(256),o=0;o<256;o++)s[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&r||!e.subarray&&a))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var i="",s=0;s<t;s++)i+=String.fromCharCode(e[s]);return i}s[254]=s[254]=1,t.string2buf=function(e){var t,i,a,r,s,o=e.length,l=0;for(r=0;r<o;r++)55296==(64512&(i=e.charCodeAt(r)))&&r+1<o&&56320==(64512&(a=e.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(a-56320),r++),l+=i<128?1:i<2048?2:i<65536?3:4;for(t=new n.Buf8(l),s=0,r=0;s<l;r++)55296==(64512&(i=e.charCodeAt(r)))&&r+1<o&&56320==(64512&(a=e.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(a-56320),r++),i<128?t[s++]=i:i<2048?(t[s++]=192|i>>>6,t[s++]=128|63&i):i<65536?(t[s++]=224|i>>>12,t[s++]=128|i>>>6&63,t[s++]=128|63&i):(t[s++]=240|i>>>18,t[s++]=128|i>>>12&63,t[s++]=128|i>>>6&63,t[s++]=128|63&i);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),i=0,a=t.length;i<a;i++)t[i]=e.charCodeAt(i);return t},t.buf2string=function(e,t){var i,n,a,r,o=t||e.length,h=new Array(2*o);for(n=0,i=0;i<o;)if((a=e[i++])<128)h[n++]=a;else if((r=s[a])>4)h[n++]=65533,i+=r-1;else{for(a&=2===r?31:3===r?15:7;r>1&&i<o;)a=a<<6|63&e[i++],r--;r>1?h[n++]=65533:a<65536?h[n++]=a:(a-=65536,h[n++]=55296|a>>10&1023,h[n++]=56320|1023&a)}return l(h,n)},t.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+s[e[i]]>t?i:t}},269:e=>{"use strict";e.exports=function(e,t,i,n){for(var a=65535&e,r=e>>>16&65535,s=0;0!==i;){i-=s=i>2e3?2e3:i;do{r=r+(a=a+t[n++]|0)|0}while(--s);a%=65521,r%=65521}return a|r<<16}},681:e=>{"use strict";e.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_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}},823:e=>{"use strict";var t=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();e.exports=function(e,i,n,a){var r=t,s=a+n;e^=-1;for(var o=a;o<s;o++)e=e>>>8^r[255&(e^i[o])];return~e}},411:(e,t,i)=>{"use strict";var n,a=i(805),r=i(665),s=i(269),o=i(823),l=i(674),h=-2,d=258,c=262,f=103,u=113,_=666;function g(e,t){return e.msg=l[t],t}function b(e){return(e<<1)-(e>4?9:0)}function w(e){for(var t=e.length;--t>=0;)e[t]=0}function m(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(a.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))}function p(e,t){r._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,m(e.strm)}function v(e,t){e.pending_buf[e.pending++]=t}function k(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function y(e,t){var i,n,a=e.max_chain_length,r=e.strstart,s=e.prev_length,o=e.nice_match,l=e.strstart>e.w_size-c?e.strstart-(e.w_size-c):0,h=e.window,f=e.w_mask,u=e.prev,_=e.strstart+d,g=h[r+s-1],b=h[r+s];e.prev_length>=e.good_match&&(a>>=2),o>e.lookahead&&(o=e.lookahead);do{if(h[(i=t)+s]===b&&h[i+s-1]===g&&h[i]===h[r]&&h[++i]===h[r+1]){r+=2,i++;do{}while(h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&h[++r]===h[++i]&&r<_);if(n=d-(_-r),r=_-d,n>s){if(e.match_start=t,s=n,n>=o)break;g=h[r+s-1],b=h[r+s]}}}while((t=u[t&f])>l&&0!=--a);return s<=e.lookahead?s:e.lookahead}function x(e){var t,i,n,r,l,h,d,f,u,_,g=e.w_size;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=g+(g-c)){a.arraySet(e.window,e.window,g,g,0),e.match_start-=g,e.strstart-=g,e.block_start-=g,t=i=e.hash_size;do{n=e.head[--t],e.head[t]=n>=g?n-g:0}while(--i);t=i=g;do{n=e.prev[--t],e.prev[t]=n>=g?n-g:0}while(--i);r+=g}if(0===e.strm.avail_in)break;if(h=e.strm,d=e.window,f=e.strstart+e.lookahead,u=r,_=void 0,(_=h.avail_in)>u&&(_=u),i=0===_?0:(h.avail_in-=_,a.arraySet(d,h.input,h.next_in,_,f),1===h.state.wrap?h.adler=s(h.adler,d,_,f):2===h.state.wrap&&(h.adler=o(h.adler,d,_,f)),h.next_in+=_,h.total_in+=_,_),e.lookahead+=i,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+3-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<c&&0!==e.strm.avail_in)}function z(e,t){for(var i,n;;){if(e.lookahead<c){if(x(e),e.lookahead<c&&0===t)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-c&&(e.match_length=y(e,i)),e.match_length>=3)if(n=r._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=r._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(p(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(p(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(p(e,!1),0===e.strm.avail_out)?1:2}function S(e,t){for(var i,n,a;;){if(e.lookahead<c){if(x(e),e.lookahead<c&&0===t)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-c&&(e.match_length=y(e,i),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-3,n=r._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=a&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(p(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=r._tr_tally(e,0,e.window[e.strstart-1]))&&p(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=r._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(p(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(p(e,!1),0===e.strm.avail_out)?1:2}function B(e,t,i,n,a){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=n,this.func=a}function E(){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=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new a.Buf16(1146),this.dyn_dtree=new a.Buf16(122),this.bl_tree=new a.Buf16(78),w(this.dyn_ltree),w(this.dyn_dtree),w(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(16),this.heap=new a.Buf16(573),w(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(573),w(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function I(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:u,e.adler=2===t.wrap?0:1,t.last_flush=0,r._tr_init(t),0):g(e,h)}function T(e){var t,i=I(e);return 0===i&&((t=e.state).window_size=2*t.w_size,w(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),i}function C(e,t,i,n,r,s){if(!e)return h;var o=1;if(-1===t&&(t=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),r<1||r>9||8!==i||n<8||n>15||t<0||t>9||s<0||s>4)return g(e,h);8===n&&(n=9);var l=new E;return e.state=l,l.strm=e,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=r+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new a.Buf8(2*l.w_size),l.head=new a.Buf16(l.hash_size),l.prev=new a.Buf16(l.w_size),l.lit_bufsize=1<<r+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new a.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=s,l.method=i,T(e)}n=[new B(0,0,0,0,(function(e,t){var i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(x(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+i;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,p(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-c&&(p(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(p(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(p(e,!1),e.strm.avail_out),1)})),new B(4,4,8,4,z),new B(4,5,16,8,z),new B(4,6,32,32,z),new B(4,4,16,16,S),new B(8,16,32,32,S),new B(8,16,128,128,S),new B(8,32,128,256,S),new B(32,128,258,1024,S),new B(32,258,258,4096,S)],t.deflateInit=function(e,t){return C(e,t,8,15,8,0)},t.deflateInit2=C,t.deflateReset=T,t.deflateResetKeep=I,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?h:(e.state.gzhead=t,0):h},t.deflate=function(e,t){var i,a,s,l;if(!e||!e.state||t>5||t<0)return e?g(e,h):h;if(a=e.state,!e.output||!e.input&&0!==e.avail_in||a.status===_&&4!==t)return g(e,0===e.avail_out?-5:h);if(a.strm=e,i=a.last_flush,a.last_flush=t,42===a.status)if(2===a.wrap)e.adler=0,v(a,31),v(a,139),v(a,8),a.gzhead?(v(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),v(a,255&a.gzhead.time),v(a,a.gzhead.time>>8&255),v(a,a.gzhead.time>>16&255),v(a,a.gzhead.time>>24&255),v(a,9===a.level?2:a.strategy>=2||a.level<2?4:0),v(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(v(a,255&a.gzhead.extra.length),v(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=o(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69):(v(a,0),v(a,0),v(a,0),v(a,0),v(a,0),v(a,9===a.level?2:a.strategy>=2||a.level<2?4:0),v(a,3),a.status=u);else{var c=8+(a.w_bits-8<<4)<<8;c|=(a.strategy>=2||a.level<2?0:a.level<6?1:6===a.level?2:3)<<6,0!==a.strstart&&(c|=32),c+=31-c%31,a.status=u,k(a,c),0!==a.strstart&&(k(a,e.adler>>>16),k(a,65535&e.adler)),e.adler=1}if(69===a.status)if(a.gzhead.extra){for(s=a.pending;a.gzindex<(65535&a.gzhead.extra.length)&&(a.pending!==a.pending_buf_size||(a.gzhead.hcrc&&a.pending>s&&(e.adler=o(e.adler,a.pending_buf,a.pending-s,s)),m(e),s=a.pending,a.pending!==a.pending_buf_size));)v(a,255&a.gzhead.extra[a.gzindex]),a.gzindex++;a.gzhead.hcrc&&a.pending>s&&(e.adler=o(e.adler,a.pending_buf,a.pending-s,s)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=73)}else a.status=73;if(73===a.status)if(a.gzhead.name){s=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>s&&(e.adler=o(e.adler,a.pending_buf,a.pending-s,s)),m(e),s=a.pending,a.pending===a.pending_buf_size)){l=1;break}l=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,v(a,l)}while(0!==l);a.gzhead.hcrc&&a.pending>s&&(e.adler=o(e.adler,a.pending_buf,a.pending-s,s)),0===l&&(a.gzindex=0,a.status=91)}else a.status=91;if(91===a.status)if(a.gzhead.comment){s=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>s&&(e.adler=o(e.adler,a.pending_buf,a.pending-s,s)),m(e),s=a.pending,a.pending===a.pending_buf_size)){l=1;break}l=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,v(a,l)}while(0!==l);a.gzhead.hcrc&&a.pending>s&&(e.adler=o(e.adler,a.pending_buf,a.pending-s,s)),0===l&&(a.status=f)}else a.status=f;if(a.status===f&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&m(e),a.pending+2<=a.pending_buf_size&&(v(a,255&e.adler),v(a,e.adler>>8&255),e.adler=0,a.status=u)):a.status=u),0!==a.pending){if(m(e),0===e.avail_out)return a.last_flush=-1,0}else if(0===e.avail_in&&b(t)<=b(i)&&4!==t)return g(e,-5);if(a.status===_&&0!==e.avail_in)return g(e,-5);if(0!==e.avail_in||0!==a.lookahead||0!==t&&a.status!==_){var y=2===a.strategy?function(e,t){for(var i;;){if(0===e.lookahead&&(x(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,i=r._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(p(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(p(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(p(e,!1),0===e.strm.avail_out)?1:2}(a,t):3===a.strategy?function(e,t){for(var i,n,a,s,o=e.window;;){if(e.lookahead<=d){if(x(e),e.lookahead<=d&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=o[a=e.strstart-1])===o[++a]&&n===o[++a]&&n===o[++a]){s=e.strstart+d;do{}while(n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&a<s);e.match_length=d-(s-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=r._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=r._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(p(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(p(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(p(e,!1),0===e.strm.avail_out)?1:2}(a,t):n[a.level].func(a,t);if(3!==y&&4!==y||(a.status=_),1===y||3===y)return 0===e.avail_out&&(a.last_flush=-1),0;if(2===y&&(1===t?r._tr_align(a):5!==t&&(r._tr_stored_block(a,0,0,!1),3===t&&(w(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),m(e),0===e.avail_out))return a.last_flush=-1,0}return 4!==t?0:a.wrap<=0?1:(2===a.wrap?(v(a,255&e.adler),v(a,e.adler>>8&255),v(a,e.adler>>16&255),v(a,e.adler>>24&255),v(a,255&e.total_in),v(a,e.total_in>>8&255),v(a,e.total_in>>16&255),v(a,e.total_in>>24&255)):(k(a,e.adler>>>16),k(a,65535&e.adler)),m(e),a.wrap>0&&(a.wrap=-a.wrap),0!==a.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==f&&t!==u&&t!==_?g(e,h):(e.state=null,t===u?g(e,-3):0):h},t.deflateSetDictionary=function(e,t){var i,n,r,o,l,d,c,f,u=t.length;if(!e||!e.state)return h;if(2===(o=(i=e.state).wrap)||1===o&&42!==i.status||i.lookahead)return h;for(1===o&&(e.adler=s(e.adler,t,u,0)),i.wrap=0,u>=i.w_size&&(0===o&&(w(i.head),i.strstart=0,i.block_start=0,i.insert=0),f=new a.Buf8(i.w_size),a.arraySet(f,t,u-i.w_size,i.w_size,0),t=f,u=i.w_size),l=e.avail_in,d=e.next_in,c=e.input,e.avail_in=u,e.next_in=0,e.input=t,x(i);i.lookahead>=3;){n=i.strstart,r=i.lookahead-2;do{i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+3-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++}while(--r);i.strstart=n,i.lookahead=2,x(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=d,e.input=c,e.avail_in=l,i.wrap=o,0},t.deflateInfo="pako deflate (from Nodeca project)"},414:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},293:e=>{"use strict";e.exports=function(e,t){var i,n,a,r,s,o,l,h,d,c,f,u,_,g,b,w,m,p,v,k,y,x,z,S,B;i=e.state,n=e.next_in,S=e.input,a=n+(e.avail_in-5),r=e.next_out,B=e.output,s=r-(t-e.avail_out),o=r+(e.avail_out-257),l=i.dmax,h=i.wsize,d=i.whave,c=i.wnext,f=i.window,u=i.hold,_=i.bits,g=i.lencode,b=i.distcode,w=(1<<i.lenbits)-1,m=(1<<i.distbits)-1;e:do{_<15&&(u+=S[n++]<<_,_+=8,u+=S[n++]<<_,_+=8),p=g[u&w];t:for(;;){if(u>>>=v=p>>>24,_-=v,0==(v=p>>>16&255))B[r++]=65535&p;else{if(!(16&v)){if(64&v){if(32&v){i.mode=12;break e}e.msg="invalid literal/length code",i.mode=30;break e}p=g[(65535&p)+(u&(1<<v)-1)];continue t}for(k=65535&p,(v&=15)&&(_<v&&(u+=S[n++]<<_,_+=8),k+=u&(1<<v)-1,u>>>=v,_-=v),_<15&&(u+=S[n++]<<_,_+=8,u+=S[n++]<<_,_+=8),p=b[u&m];;){if(u>>>=v=p>>>24,_-=v,16&(v=p>>>16&255)){if(y=65535&p,_<(v&=15)&&(u+=S[n++]<<_,(_+=8)<v&&(u+=S[n++]<<_,_+=8)),(y+=u&(1<<v)-1)>l){e.msg="invalid distance too far back",i.mode=30;break e}if(u>>>=v,_-=v,y>(v=r-s)){if((v=y-v)>d&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(x=0,z=f,0===c){if(x+=h-v,v<k){k-=v;do{B[r++]=f[x++]}while(--v);x=r-y,z=B}}else if(c<v){if(x+=h+c-v,(v-=c)<k){k-=v;do{B[r++]=f[x++]}while(--v);if(x=0,c<k){k-=v=c;do{B[r++]=f[x++]}while(--v);x=r-y,z=B}}}else if(x+=c-v,v<k){k-=v;do{B[r++]=f[x++]}while(--v);x=r-y,z=B}for(;k>2;)B[r++]=z[x++],B[r++]=z[x++],B[r++]=z[x++],k-=3;k&&(B[r++]=z[x++],k>1&&(B[r++]=z[x++]))}else{x=r-y;do{B[r++]=B[x++],B[r++]=B[x++],B[r++]=B[x++],k-=3}while(k>2);k&&(B[r++]=B[x++],k>1&&(B[r++]=B[x++]))}break}if(64&v){e.msg="invalid distance code",i.mode=30;break e}p=b[(65535&p)+(u&(1<<v)-1)]}}break}}while(n<a&&r<o);n-=k=_>>3,u&=(1<<(_-=k<<3))-1,e.next_in=n,e.next_out=r,e.avail_in=n<a?a-n+5:5-(n-a),e.avail_out=r<o?o-r+257:257-(r-o),i.hold=u,i.bits=_}},447:(e,t,i)=>{"use strict";var n=i(805),a=i(269),r=i(823),s=i(293),o=i(998),l=-2,h=12,d=30;function c(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function f(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function u(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):l}function _(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,u(e)):l}function g(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?l:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,_(e))):l}function b(e,t){var i,n;return e?(n=new f,e.state=n,n.window=null,0!==(i=g(e,t))&&(e.state=null),i):l}var w,m,p=!0;function v(e){if(p){var t;for(w=new n.Buf32(512),m=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(o(1,e.lens,0,288,w,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;o(2,e.lens,0,32,m,0,e.work,{bits:5}),p=!1}e.lencode=w,e.lenbits=9,e.distcode=m,e.distbits=5}function k(e,t,i,a){var r,s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new n.Buf8(s.wsize)),a>=s.wsize?(n.arraySet(s.window,t,i-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((r=s.wsize-s.wnext)>a&&(r=a),n.arraySet(s.window,t,i-a,r,s.wnext),(a-=r)?(n.arraySet(s.window,t,i-a,a,0),s.wnext=a,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=r))),0}t.inflateReset=_,t.inflateReset2=g,t.inflateResetKeep=u,t.inflateInit=function(e){return b(e,15)},t.inflateInit2=b,t.inflate=function(e,t){var i,f,u,_,g,b,w,m,p,y,x,z,S,B,E,I,T,C,A,P,O,R,N,F,D=0,M=new n.Buf8(4),U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return l;(i=e.state).mode===h&&(i.mode=13),g=e.next_out,u=e.output,w=e.avail_out,_=e.next_in,f=e.input,b=e.avail_in,m=i.hold,p=i.bits,y=b,x=w,R=0;e:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;p<16;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}if(2&i.wrap&&35615===m){i.check=0,M[0]=255&m,M[1]=m>>>8&255,i.check=r(i.check,M,2,0),m=0,p=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",i.mode=d;break}if(8!=(15&m)){e.msg="unknown compression method",i.mode=d;break}if(p-=4,O=8+(15&(m>>>=4)),0===i.wbits)i.wbits=O;else if(O>i.wbits){e.msg="invalid window size",i.mode=d;break}i.dmax=1<<O,e.adler=i.check=1,i.mode=512&m?10:h,m=0,p=0;break;case 2:for(;p<16;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}if(i.flags=m,8!=(255&i.flags)){e.msg="unknown compression method",i.mode=d;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=d;break}i.head&&(i.head.text=m>>8&1),512&i.flags&&(M[0]=255&m,M[1]=m>>>8&255,i.check=r(i.check,M,2,0)),m=0,p=0,i.mode=3;case 3:for(;p<32;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}i.head&&(i.head.time=m),512&i.flags&&(M[0]=255&m,M[1]=m>>>8&255,M[2]=m>>>16&255,M[3]=m>>>24&255,i.check=r(i.check,M,4,0)),m=0,p=0,i.mode=4;case 4:for(;p<16;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}i.head&&(i.head.xflags=255&m,i.head.os=m>>8),512&i.flags&&(M[0]=255&m,M[1]=m>>>8&255,i.check=r(i.check,M,2,0)),m=0,p=0,i.mode=5;case 5:if(1024&i.flags){for(;p<16;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}i.length=m,i.head&&(i.head.extra_len=m),512&i.flags&&(M[0]=255&m,M[1]=m>>>8&255,i.check=r(i.check,M,2,0)),m=0,p=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((z=i.length)>b&&(z=b),z&&(i.head&&(O=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,f,_,z,O)),512&i.flags&&(i.check=r(i.check,f,z,_)),b-=z,_+=z,i.length-=z),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===b)break e;z=0;do{O=f[_+z++],i.head&&O&&i.length<65536&&(i.head.name+=String.fromCharCode(O))}while(O&&z<b);if(512&i.flags&&(i.check=r(i.check,f,z,_)),b-=z,_+=z,O)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===b)break e;z=0;do{O=f[_+z++],i.head&&O&&i.length<65536&&(i.head.comment+=String.fromCharCode(O))}while(O&&z<b);if(512&i.flags&&(i.check=r(i.check,f,z,_)),b-=z,_+=z,O)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;p<16;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}if(m!==(65535&i.check)){e.msg="header crc mismatch",i.mode=d;break}m=0,p=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=h;break;case 10:for(;p<32;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}e.adler=i.check=c(m),m=0,p=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=g,e.avail_out=w,e.next_in=_,e.avail_in=b,i.hold=m,i.bits=p,2;e.adler=i.check=1,i.mode=h;case h:if(5===t||6===t)break e;case 13:if(i.last){m>>>=7&p,p-=7&p,i.mode=27;break}for(;p<3;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}switch(i.last=1&m,p-=1,3&(m>>>=1)){case 0:i.mode=14;break;case 1:if(v(i),i.mode=20,6===t){m>>>=2,p-=2;break e}break;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=d}m>>>=2,p-=2;break;case 14:for(m>>>=7&p,p-=7&p;p<32;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}if((65535&m)!=(m>>>16^65535)){e.msg="invalid stored block lengths",i.mode=d;break}if(i.length=65535&m,m=0,p=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(z=i.length){if(z>b&&(z=b),z>w&&(z=w),0===z)break e;n.arraySet(u,f,_,z,g),b-=z,_+=z,w-=z,g+=z,i.length-=z;break}i.mode=h;break;case 17:for(;p<14;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}if(i.nlen=257+(31&m),m>>>=5,p-=5,i.ndist=1+(31&m),m>>>=5,p-=5,i.ncode=4+(15&m),m>>>=4,p-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=d;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;p<3;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}i.lens[U[i.have++]]=7&m,m>>>=3,p-=3}for(;i.have<19;)i.lens[U[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,N={bits:i.lenbits},R=o(0,i.lens,0,19,i.lencode,0,i.work,N),i.lenbits=N.bits,R){e.msg="invalid code lengths set",i.mode=d;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;I=(D=i.lencode[m&(1<<i.lenbits)-1])>>>16&255,T=65535&D,!((E=D>>>24)<=p);){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}if(T<16)m>>>=E,p-=E,i.lens[i.have++]=T;else{if(16===T){for(F=E+2;p<F;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}if(m>>>=E,p-=E,0===i.have){e.msg="invalid bit length repeat",i.mode=d;break}O=i.lens[i.have-1],z=3+(3&m),m>>>=2,p-=2}else if(17===T){for(F=E+3;p<F;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}p-=E,O=0,z=3+(7&(m>>>=E)),m>>>=3,p-=3}else{for(F=E+7;p<F;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}p-=E,O=0,z=11+(127&(m>>>=E)),m>>>=7,p-=7}if(i.have+z>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=d;break}for(;z--;)i.lens[i.have++]=O}}if(i.mode===d)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=d;break}if(i.lenbits=9,N={bits:i.lenbits},R=o(1,i.lens,0,i.nlen,i.lencode,0,i.work,N),i.lenbits=N.bits,R){e.msg="invalid literal/lengths set",i.mode=d;break}if(i.distbits=6,i.distcode=i.distdyn,N={bits:i.distbits},R=o(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,N),i.distbits=N.bits,R){e.msg="invalid distances set",i.mode=d;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(b>=6&&w>=258){e.next_out=g,e.avail_out=w,e.next_in=_,e.avail_in=b,i.hold=m,i.bits=p,s(e,x),g=e.next_out,u=e.output,w=e.avail_out,_=e.next_in,f=e.input,b=e.avail_in,m=i.hold,p=i.bits,i.mode===h&&(i.back=-1);break}for(i.back=0;I=(D=i.lencode[m&(1<<i.lenbits)-1])>>>16&255,T=65535&D,!((E=D>>>24)<=p);){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}if(I&&!(240&I)){for(C=E,A=I,P=T;I=(D=i.lencode[P+((m&(1<<C+A)-1)>>C)])>>>16&255,T=65535&D,!(C+(E=D>>>24)<=p);){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}m>>>=C,p-=C,i.back+=C}if(m>>>=E,p-=E,i.back+=E,i.length=T,0===I){i.mode=26;break}if(32&I){i.back=-1,i.mode=h;break}if(64&I){e.msg="invalid literal/length code",i.mode=d;break}i.extra=15&I,i.mode=22;case 22:if(i.extra){for(F=i.extra;p<F;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}i.length+=m&(1<<i.extra)-1,m>>>=i.extra,p-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;I=(D=i.distcode[m&(1<<i.distbits)-1])>>>16&255,T=65535&D,!((E=D>>>24)<=p);){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}if(!(240&I)){for(C=E,A=I,P=T;I=(D=i.distcode[P+((m&(1<<C+A)-1)>>C)])>>>16&255,T=65535&D,!(C+(E=D>>>24)<=p);){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}m>>>=C,p-=C,i.back+=C}if(m>>>=E,p-=E,i.back+=E,64&I){e.msg="invalid distance code",i.mode=d;break}i.offset=T,i.extra=15&I,i.mode=24;case 24:if(i.extra){for(F=i.extra;p<F;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}i.offset+=m&(1<<i.extra)-1,m>>>=i.extra,p-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=d;break}i.mode=25;case 25:if(0===w)break e;if(z=x-w,i.offset>z){if((z=i.offset-z)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=d;break}z>i.wnext?(z-=i.wnext,S=i.wsize-z):S=i.wnext-z,z>i.length&&(z=i.length),B=i.window}else B=u,S=g-i.offset,z=i.length;z>w&&(z=w),w-=z,i.length-=z;do{u[g++]=B[S++]}while(--z);0===i.length&&(i.mode=21);break;case 26:if(0===w)break e;u[g++]=i.length,w--,i.mode=21;break;case 27:if(i.wrap){for(;p<32;){if(0===b)break e;b--,m|=f[_++]<<p,p+=8}if(x-=w,e.total_out+=x,i.total+=x,x&&(e.adler=i.check=i.flags?r(i.check,u,x,g-x):a(i.check,u,x,g-x)),x=w,(i.flags?m:c(m))!==i.check){e.msg="incorrect data check",i.mode=d;break}m=0,p=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;p<32;){if(0===b)break e;b--,m+=f[_++]<<p,p+=8}if(m!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=d;break}m=0,p=0}i.mode=29;case 29:R=1;break e;case d:R=-3;break e;case 31:return-4;default:return l}return e.next_out=g,e.avail_out=w,e.next_in=_,e.avail_in=b,i.hold=m,i.bits=p,(i.wsize||x!==e.avail_out&&i.mode<d&&(i.mode<27||4!==t))&&k(e,e.output,e.next_out,x-e.avail_out)?(i.mode=31,-4):(y-=e.avail_in,x-=e.avail_out,e.total_in+=y,e.total_out+=x,i.total+=x,i.wrap&&x&&(e.adler=i.check=i.flags?r(i.check,u,x,e.next_out-x):a(i.check,u,x,e.next_out-x)),e.data_type=i.bits+(i.last?64:0)+(i.mode===h?128:0)+(20===i.mode||15===i.mode?256:0),(0===y&&0===x||4===t)&&0===R&&(R=-5),R)},t.inflateEnd=function(e){if(!e||!e.state)return l;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var i;return e&&e.state&&2&(i=e.state).wrap?(i.head=t,t.done=!1,0):l},t.inflateSetDictionary=function(e,t){var i,n=t.length;return e&&e.state?0!==(i=e.state).wrap&&11!==i.mode?l:11===i.mode&&a(1,t,n,0)!==i.check?-3:k(e,t,n,n)?(i.mode=31,-4):(i.havedict=1,0):l},t.inflateInfo="pako inflate (from Nodeca project)"},998:(e,t,i)=>{"use strict";var n=i(805),a=[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],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[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],o=[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];e.exports=function(e,t,i,l,h,d,c,f){var u,_,g,b,w,m,p,v,k,y=f.bits,x=0,z=0,S=0,B=0,E=0,I=0,T=0,C=0,A=0,P=0,O=null,R=0,N=new n.Buf16(16),F=new n.Buf16(16),D=null,M=0;for(x=0;x<=15;x++)N[x]=0;for(z=0;z<l;z++)N[t[i+z]]++;for(E=y,B=15;B>=1&&0===N[B];B--);if(E>B&&(E=B),0===B)return h[d++]=20971520,h[d++]=20971520,f.bits=1,0;for(S=1;S<B&&0===N[S];S++);for(E<S&&(E=S),C=1,x=1;x<=15;x++)if(C<<=1,(C-=N[x])<0)return-1;if(C>0&&(0===e||1!==B))return-1;for(F[1]=0,x=1;x<15;x++)F[x+1]=F[x]+N[x];for(z=0;z<l;z++)0!==t[i+z]&&(c[F[t[i+z]]++]=z);if(0===e?(O=D=c,m=19):1===e?(O=a,R-=257,D=r,M-=257,m=256):(O=s,D=o,m=-1),P=0,z=0,x=S,w=d,I=E,T=0,g=-1,b=(A=1<<E)-1,1===e&&A>852||2===e&&A>592)return 1;for(;;){p=x-T,c[z]<m?(v=0,k=c[z]):c[z]>m?(v=D[M+c[z]],k=O[R+c[z]]):(v=96,k=0),u=1<<x-T,S=_=1<<I;do{h[w+(P>>T)+(_-=u)]=p<<24|v<<16|k}while(0!==_);for(u=1<<x-1;P&u;)u>>=1;if(0!==u?(P&=u-1,P+=u):P=0,z++,0==--N[x]){if(x===B)break;x=t[i+c[z]]}if(x>E&&(P&b)!==g){for(0===T&&(T=E),w+=S,C=1<<(I=x-T);I+T<B&&!((C-=N[I+T])<=0);)I++,C<<=1;if(A+=1<<I,1===e&&A>852||2===e&&A>592)return 1;h[g=P&b]=E<<24|I<<16|w-d}}return 0!==P&&(h[w+P]=x-T<<24|64<<16),f.bits=E,0}},674:e=>{"use strict";e.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"}},665:(e,t,i)=>{"use strict";var n=i(805);function a(e){for(var t=e.length;--t>=0;)e[t]=0}var r=[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],s=[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],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],l=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],h=new Array(576);a(h);var d=new Array(60);a(d);var c=new Array(512);a(c);var f=new Array(256);a(f);var u=new Array(29);a(u);var _,g,b,w=new Array(30);function m(e,t,i,n,a){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=n,this.max_length=a,this.has_stree=e&&e.length}function p(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function v(e){return e<256?c[e]:c[256+(e>>>7)]}function k(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function y(e,t,i){e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,k(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)}function x(e,t,i){y(e,i[2*t],i[2*t+1])}function z(e,t){var i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1}function S(e,t,i){var n,a,r=new Array(16),s=0;for(n=1;n<=15;n++)r[n]=s=s+i[n-1]<<1;for(a=0;a<=t;a++){var o=e[2*a+1];0!==o&&(e[2*a]=z(r[o]++,o))}}function B(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function E(e){e.bi_valid>8?k(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function I(e,t,i,n){var a=2*t,r=2*i;return e[a]<e[r]||e[a]===e[r]&&n[t]<=n[i]}function T(e,t,i){for(var n=e.heap[i],a=i<<1;a<=e.heap_len&&(a<e.heap_len&&I(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!I(t,n,e.heap[a],e.depth));)e.heap[i]=e.heap[a],i=a,a<<=1;e.heap[i]=n}function C(e,t,i){var n,a,o,l,h=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*h]<<8|e.pending_buf[e.d_buf+2*h+1],a=e.pending_buf[e.l_buf+h],h++,0===n?x(e,a,t):(x(e,(o=f[a])+256+1,t),0!==(l=r[o])&&y(e,a-=u[o],l),x(e,o=v(--n),i),0!==(l=s[o])&&y(e,n-=w[o],l))}while(h<e.last_lit);x(e,256,t)}function A(e,t){var i,n,a,r=t.dyn_tree,s=t.stat_desc.static_tree,o=t.stat_desc.has_stree,l=t.stat_desc.elems,h=-1;for(e.heap_len=0,e.heap_max=573,i=0;i<l;i++)0!==r[2*i]?(e.heap[++e.heap_len]=h=i,e.depth[i]=0):r[2*i+1]=0;for(;e.heap_len<2;)r[2*(a=e.heap[++e.heap_len]=h<2?++h:0)]=1,e.depth[a]=0,e.opt_len--,o&&(e.static_len-=s[2*a+1]);for(t.max_code=h,i=e.heap_len>>1;i>=1;i--)T(e,r,i);a=l;do{i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],T(e,r,1),n=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=n,r[2*a]=r[2*i]+r[2*n],e.depth[a]=(e.depth[i]>=e.depth[n]?e.depth[i]:e.depth[n])+1,r[2*i+1]=r[2*n+1]=a,e.heap[1]=a++,T(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var i,n,a,r,s,o,l=t.dyn_tree,h=t.max_code,d=t.stat_desc.static_tree,c=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,u=t.stat_desc.extra_base,_=t.stat_desc.max_length,g=0;for(r=0;r<=15;r++)e.bl_count[r]=0;for(l[2*e.heap[e.heap_max]+1]=0,i=e.heap_max+1;i<573;i++)(r=l[2*l[2*(n=e.heap[i])+1]+1]+1)>_&&(r=_,g++),l[2*n+1]=r,n>h||(e.bl_count[r]++,s=0,n>=u&&(s=f[n-u]),o=l[2*n],e.opt_len+=o*(r+s),c&&(e.static_len+=o*(d[2*n+1]+s)));if(0!==g){do{for(r=_-1;0===e.bl_count[r];)r--;e.bl_count[r]--,e.bl_count[r+1]+=2,e.bl_count[_]--,g-=2}while(g>0);for(r=_;0!==r;r--)for(n=e.bl_count[r];0!==n;)(a=e.heap[--i])>h||(l[2*a+1]!==r&&(e.opt_len+=(r-l[2*a+1])*l[2*a],l[2*a+1]=r),n--)}}(e,t),S(r,h,e.bl_count)}function P(e,t,i){var n,a,r=-1,s=t[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),t[2*(i+1)+1]=65535,n=0;n<=i;n++)a=s,s=t[2*(n+1)+1],++o<l&&a===s||(o<h?e.bl_tree[2*a]+=o:0!==a?(a!==r&&e.bl_tree[2*a]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,r=a,0===s?(l=138,h=3):a===s?(l=6,h=3):(l=7,h=4))}function O(e,t,i){var n,a,r=-1,s=t[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),n=0;n<=i;n++)if(a=s,s=t[2*(n+1)+1],!(++o<l&&a===s)){if(o<h)do{x(e,a,e.bl_tree)}while(0!=--o);else 0!==a?(a!==r&&(x(e,a,e.bl_tree),o--),x(e,16,e.bl_tree),y(e,o-3,2)):o<=10?(x(e,17,e.bl_tree),y(e,o-3,3)):(x(e,18,e.bl_tree),y(e,o-11,7));o=0,r=a,0===s?(l=138,h=3):a===s?(l=6,h=3):(l=7,h=4)}}a(w);var R=!1;function N(e,t,i,a){y(e,0+(a?1:0),3),function(e,t,i){E(e),k(e,i),k(e,~i),n.arraySet(e.pending_buf,e.window,t,i,e.pending),e.pending+=i}(e,t,i)}t._tr_init=function(e){R||(function(){var e,t,i,n,a,l=new Array(16);for(i=0,n=0;n<28;n++)for(u[n]=i,e=0;e<1<<r[n];e++)f[i++]=n;for(f[i-1]=n,a=0,n=0;n<16;n++)for(w[n]=a,e=0;e<1<<s[n];e++)c[a++]=n;for(a>>=7;n<30;n++)for(w[n]=a<<7,e=0;e<1<<s[n]-7;e++)c[256+a++]=n;for(t=0;t<=15;t++)l[t]=0;for(e=0;e<=143;)h[2*e+1]=8,e++,l[8]++;for(;e<=255;)h[2*e+1]=9,e++,l[9]++;for(;e<=279;)h[2*e+1]=7,e++,l[7]++;for(;e<=287;)h[2*e+1]=8,e++,l[8]++;for(S(h,287,l),e=0;e<30;e++)d[2*e+1]=5,d[2*e]=z(e,5);_=new m(h,r,257,286,15),g=new m(d,s,0,30,15),b=new m(new Array(0),o,0,19,7)}(),R=!0),e.l_desc=new p(e.dyn_ltree,_),e.d_desc=new p(e.dyn_dtree,g),e.bl_desc=new p(e.bl_tree,b),e.bi_buf=0,e.bi_valid=0,B(e)},t._tr_stored_block=N,t._tr_flush_block=function(e,t,i,n){var a,r,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),A(e,e.l_desc),A(e,e.d_desc),s=function(e){var t;for(P(e,e.dyn_ltree,e.l_desc.max_code),P(e,e.dyn_dtree,e.d_desc.max_code),A(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*l[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),a=e.opt_len+3+7>>>3,(r=e.static_len+3+7>>>3)<=a&&(a=r)):a=r=i+5,i+4<=a&&-1!==t?N(e,t,i,n):4===e.strategy||r===a?(y(e,2+(n?1:0),3),C(e,h,d)):(y(e,4+(n?1:0),3),function(e,t,i,n){var a;for(y(e,t-257,5),y(e,i-1,5),y(e,n-4,4),a=0;a<n;a++)y(e,e.bl_tree[2*l[a]+1],3);O(e,e.dyn_ltree,t-1),O(e,e.dyn_dtree,i-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),C(e,e.dyn_ltree,e.dyn_dtree)),B(e),n&&E(e)},t._tr_tally=function(e,t,i){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&i,e.last_lit++,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(f[i]+256+1)]++,e.dyn_dtree[2*v(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){y(e,2,3),x(e,256,h),function(e){16===e.bi_valid?(k(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},442:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},392:e=>{"use strict";class t{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){const t=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){return this.cache.has(e)?this.cache.get(e):this.oldCache.has(e)?this.oldCache.get(e):void 0}delete(e){const t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of this.cache)yield e;for(const e of this.oldCache){const[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(const t of this.oldCache.keys())this.cache.has(t)||e++;return this._size+e}}e.exports=t},937:()=>{}},t={};function i(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n=i(806);window.gmodTABIX=n})();
|
package/dist/tbi.js
CHANGED
|
@@ -41,7 +41,7 @@ const chunk_1 = __importDefault(require("./chunk"));
|
|
|
41
41
|
const bgzf_filehandle_1 = require("@gmod/bgzf-filehandle");
|
|
42
42
|
const util_1 = require("./util");
|
|
43
43
|
const indexFile_1 = __importDefault(require("./indexFile"));
|
|
44
|
-
const
|
|
44
|
+
const long_1 = require("./long");
|
|
45
45
|
const TBI_MAGIC = 21578324; // TBI\1
|
|
46
46
|
const TAD_LIDX_SHIFT = 14;
|
|
47
47
|
/**
|
|
@@ -178,8 +178,9 @@ class TabixIndex extends indexFile_1.default {
|
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
parsePseudoBin(bytes, offset) {
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
return {
|
|
182
|
+
lineCount: (0, long_1.longFromBytesToUnsigned)(bytes, offset + 16),
|
|
183
|
+
};
|
|
183
184
|
}
|
|
184
185
|
_parseNameBytes(namesBytes) {
|
|
185
186
|
let currRefId = 0;
|
package/dist/tbi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tbi.js","sourceRoot":"","sources":["../src/tbi.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|
3
3
|
import Chunk from './chunk';
|
|
4
4
|
import { optimizeChunks } from './util';
|
|
5
5
|
import IndexFile from './indexFile';
|
|
6
|
-
import {
|
|
6
|
+
import { longFromBytesToUnsigned } from './long';
|
|
7
7
|
const CSI1_MAGIC = 21582659; // CSI\1
|
|
8
8
|
const CSI2_MAGIC = 38359875; // CSI\2
|
|
9
9
|
const formats = {
|
|
@@ -172,7 +172,7 @@ export default class CSI extends IndexFile {
|
|
|
172
172
|
}
|
|
173
173
|
parsePseudoBin(bytes, offset) {
|
|
174
174
|
return {
|
|
175
|
-
lineCount:
|
|
175
|
+
lineCount: longFromBytesToUnsigned(bytes, offset + 28),
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
178
|
async blocksForRange(refName, min, max, opts = {}) {
|
package/esm/csi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csi.js","sourceRoot":"","sources":["../src/csi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAE7C,OAAO,aAAa,EAAE,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,SAAsB,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"csi.js","sourceRoot":"","sources":["../src/csi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAE7C,OAAO,aAAa,EAAE,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,SAAsB,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,QAAQ,CAAA;AAEhD,MAAM,UA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const TWO_PWR_16_DBL = 1 << 16;
|
|
2
|
+
export const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL;
|
|
3
|
+
export function longFromBytesToUnsigned(source, i = 0) {
|
|
4
|
+
const low = source[i] |
|
|
5
|
+
(source[i + 1] << 8) |
|
|
6
|
+
(source[i + 2] << 16) |
|
|
7
|
+
(source[i + 3] << 24);
|
|
8
|
+
const high = source[i + 4] |
|
|
9
|
+
(source[i + 5] << 8) |
|
|
10
|
+
(source[i + 6] << 16) |
|
|
11
|
+
(source[i + 7] << 24);
|
|
12
|
+
return (high >>> 0) * TWO_PWR_32_DBL + (low >>> 0);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=long.js.map
|
package/esm/long.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"long.js","sourceRoot":"","sources":["../src/long.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,CAAA;AACrC,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,GAAG,cAAc,CAAA;AAE7D,MAAM,UAAU,uBAAuB,CAAC,MAAkB,EAAE,CAAC,GAAG,CAAC;IAC/D,MAAM,GAAG,GACP,MAAM,CAAC,CAAC,CAAE;QACV,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,IAAI,CAAC,CAAC;QACrB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,IAAI,EAAE,CAAC;QACtB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,IAAI,EAAE,CAAC,CAAA;IACxB,MAAM,IAAI,GACR,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE;QACd,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,IAAI,CAAC,CAAC;QACrB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,IAAI,EAAE,CAAC;QACtB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAE,IAAI,EAAE,CAAC,CAAA;IACxB,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,cAAc,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAA;AACpD,CAAC"}
|
package/esm/tbi.js
CHANGED
|
@@ -3,7 +3,7 @@ import Chunk from './chunk';
|
|
|
3
3
|
import { unzip } from '@gmod/bgzf-filehandle';
|
|
4
4
|
import { optimizeChunks, checkAbortSignal } from './util';
|
|
5
5
|
import IndexFile from './indexFile';
|
|
6
|
-
import {
|
|
6
|
+
import { longFromBytesToUnsigned } from './long';
|
|
7
7
|
const TBI_MAGIC = 21578324; // TBI\1
|
|
8
8
|
const TAD_LIDX_SHIFT = 14;
|
|
9
9
|
/**
|
|
@@ -140,8 +140,9 @@ export default class TabixIndex extends IndexFile {
|
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
parsePseudoBin(bytes, offset) {
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
return {
|
|
144
|
+
lineCount: longFromBytesToUnsigned(bytes, offset + 16),
|
|
145
|
+
};
|
|
145
146
|
}
|
|
146
147
|
_parseNameBytes(namesBytes) {
|
|
147
148
|
let currRefId = 0;
|
package/esm/tbi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tbi.js","sourceRoot":"","sources":["../src/tbi.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,EAAE,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,KAAK,MAAM,SAAS,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AACzD,OAAO,SAAsB,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tbi.js","sourceRoot":"","sources":["../src/tbi.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,EAAE,EA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,CAAC,GAAG,CAAC,EAAE,CAAC;oBACrB,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;wBACjC,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;oBAC7C,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,0EAA0E;QAC1E,mCAAmC;QACnC,MAAM,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,CAAA;QACnC,IAAI,MAAM,GAAG,IAAI,CAAA;QACjB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;QAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE,KAAK,GAAG,CAAC,CAAC,CAAA;QAC7C,KAAK,IAAI,CAAC,GAAG,MAAM,EAAE,CAAC,IAAI,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YACtC,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;YAC5B,IAAI,EAAE,EAAE,CAAC;gBACP,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;oBACxC,MAAM,GAAG,EAAE,CAAA;gBACb,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gmod/tabix",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Read Tabix-indexed files, supports both .tbi and .csi indexes",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "GMOD/tabix-js",
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"@gmod/abortable-promise-cache": "^2.0.0",
|
|
45
45
|
"@gmod/bgzf-filehandle": "^2.0.1",
|
|
46
46
|
"generic-filehandle2": "^1.0.0",
|
|
47
|
-
"longfn": "^1.3.1",
|
|
48
47
|
"quick-lru": "^4.0.0"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
package/src/csi.ts
CHANGED
|
@@ -5,7 +5,7 @@ import Chunk from './chunk'
|
|
|
5
5
|
import { optimizeChunks } from './util'
|
|
6
6
|
|
|
7
7
|
import IndexFile, { Options } from './indexFile'
|
|
8
|
-
import {
|
|
8
|
+
import { longFromBytesToUnsigned } from './long'
|
|
9
9
|
|
|
10
10
|
const CSI1_MAGIC = 21582659 // CSI\1
|
|
11
11
|
const CSI2_MAGIC = 38359875 // CSI\2
|
|
@@ -197,9 +197,7 @@ export default class CSI extends IndexFile {
|
|
|
197
197
|
|
|
198
198
|
parsePseudoBin(bytes: Uint8Array, offset: number) {
|
|
199
199
|
return {
|
|
200
|
-
lineCount:
|
|
201
|
-
fromBytesLE(bytes.subarray(offset + 28, offset + 36), true),
|
|
202
|
-
),
|
|
200
|
+
lineCount: longFromBytesToUnsigned(bytes, offset + 28),
|
|
203
201
|
}
|
|
204
202
|
}
|
|
205
203
|
|
package/src/long.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const TWO_PWR_16_DBL = 1 << 16
|
|
2
|
+
export const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL
|
|
3
|
+
|
|
4
|
+
export function longFromBytesToUnsigned(source: Uint8Array, i = 0) {
|
|
5
|
+
const low =
|
|
6
|
+
source[i]! |
|
|
7
|
+
(source[i + 1]! << 8) |
|
|
8
|
+
(source[i + 2]! << 16) |
|
|
9
|
+
(source[i + 3]! << 24)
|
|
10
|
+
const high =
|
|
11
|
+
source[i + 4]! |
|
|
12
|
+
(source[i + 5]! << 8) |
|
|
13
|
+
(source[i + 6]! << 16) |
|
|
14
|
+
(source[i + 7]! << 24)
|
|
15
|
+
return (high >>> 0) * TWO_PWR_32_DBL + (low >>> 0)
|
|
16
|
+
}
|
package/src/tbi.ts
CHANGED
|
@@ -3,7 +3,7 @@ import Chunk from './chunk'
|
|
|
3
3
|
import { unzip } from '@gmod/bgzf-filehandle'
|
|
4
4
|
import { optimizeChunks, checkAbortSignal } from './util'
|
|
5
5
|
import IndexFile, { Options } from './indexFile'
|
|
6
|
-
import {
|
|
6
|
+
import { longFromBytesToUnsigned } from './long'
|
|
7
7
|
|
|
8
8
|
const TBI_MAGIC = 21578324 // TBI\1
|
|
9
9
|
const TAD_LIDX_SHIFT = 14
|
|
@@ -154,13 +154,9 @@ export default class TabixIndex extends IndexFile {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
parsePseudoBin(bytes: Uint8Array, offset: number) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
true,
|
|
161
|
-
),
|
|
162
|
-
)
|
|
163
|
-
return { lineCount }
|
|
157
|
+
return {
|
|
158
|
+
lineCount: longFromBytesToUnsigned(bytes, offset + 16),
|
|
159
|
+
}
|
|
164
160
|
}
|
|
165
161
|
|
|
166
162
|
_parseNameBytes(namesBytes: Uint8Array) {
|