@gmod/cram 1.6.3 → 1.6.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/craiIndex.js +1 -1
- package/dist/craiIndex.js.map +1 -1
- package/dist/cram-bundle.js +1 -1
- package/esm/craiIndex.js +1 -1
- package/esm/craiIndex.js.map +1 -1
- package/package.json +1 -1
- package/src/craiIndex.js +1 -1
package/CHANGELOG.md
CHANGED
package/dist/craiIndex.js
CHANGED
|
@@ -196,7 +196,7 @@ var CraiIndex = /** @class */ (function () {
|
|
|
196
196
|
compare = function (entry) {
|
|
197
197
|
var entryStart = entry.start;
|
|
198
198
|
var entryEnd = entry.start + entry.span;
|
|
199
|
-
if (entryStart
|
|
199
|
+
if (entryStart > queryEnd) {
|
|
200
200
|
return -1;
|
|
201
201
|
} // entry is ahead of query
|
|
202
202
|
if (entryEnd <= queryStart) {
|
package/dist/craiIndex.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"craiIndex.js","sourceRoot":"","sources":["../src/craiIndex.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oFAA2D;AAC3D,wDAAgC;AAChC,iCAA+B;AAC/B,2BAA2B;AAC3B,mCAA6C;AAE7C,IAAM,SAAS,GAAG,QAAQ,CAAA,CAAC,QAAQ;AAEnC;IACE,eAAY,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC3B,CAAC;IAED,wBAAQ,GAAR;QACE,OAAO,UAAG,IAAI,CAAC,KAAK,cAAI,IAAI,CAAC,IAAI,cAAI,IAAI,CAAC,cAAc,cAAI,IAAI,CAAC,UAAU,cAAI,IAAI,CAAC,UAAU,CAAE,CAAA;IAClG,CAAC;IACH,YAAC;AAAD,CAAC,AARD,IAQC;AAED,SAAS,gBAAgB,CAAC,KAAK,EAAE,MA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CAChC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;6BACzB;yBACF;wBACD,sBAAO,IAAI,EAAA;;;;KACZ;IACH,gBAAC;AAAD,CAAC,AA3ID,IA2IC"}
|
package/dist/cram-bundle.js
CHANGED
|
@@ -14,4 +14,4 @@ e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,f=(1<<s)-1,u=f>>1,c=-7,h=r?i-1:0,l=
|
|
|
14
14
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
15
15
|
* @license MIT
|
|
16
16
|
*/
|
|
17
|
-
t.exports=function(t){return null!=t&&(r(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=r(5),f=o(r(12)),u=o(r(65));function c(t,e,r,n){if(!n)throw new a.CramMalformedError("could not resolve intra-slice mate pairs, file seems truncated or malformed");var i=!!(n.mate||void 0!==n.mateRecordNumber&&n.mateRecordNumber!==e);r.readName||(r.readName=String(r.uniqueId),n.readName=r.readName),r.mate={sequenceId:n.sequenceId,alignmentStart:n.alignmentStart,uniqueId:n.uniqueId},n.readName&&(r.mate.readName=n.readName),n.mate||void 0!==n.mateRecordNumber||(n.mate={sequenceId:r.sequenceId,alignmentStart:r.alignmentStart,uniqueId:r.uniqueId},r.readName&&(n.mate.readName=r.readName)),r.flags|=f.default.BAM_FPAIRED,n.flags&f.default.BAM_FUNMAP&&(r.flags|=f.default.BAM_FMUNMAP),r.flags&f.default.BAM_FUNMAP&&(n.flags|=f.default.BAM_FMUNMAP),n.flags&f.default.BAM_FREVERSE&&(r.flags|=f.default.BAM_FMREVERSE),r.flags&f.default.BAM_FREVERSE&&(n.flags|=f.default.BAM_FMREVERSE),void 0===r.templateLength&&(i?function(t,e,r){var n=function e(r){var n=[r];if(r.mateRecordNumber>=0){var i=t[r.mateRecordNumber];if(!i)throw new a.CramMalformedError("intra-slice mate record not found, this file seems malformed");n.push.apply(n,e(i))}return n}(r),i=n.map((function(t){return t.alignmentStart})),o=n.map((function(t){return t.alignmentStart+t.readLength-1})),s=Math.max.apply(Math,o)-Math.min.apply(Math,i)+1;s>=0&&n.forEach((function(t){if(void 0!==t.templateLength)throw new a.CramMalformedError("mate pair group has some members that have template lengths already, this file seems malformed");t.templateLength=s}))}(t,0,r):function(t,e){var r=Math.min(t.alignmentStart,e.alignmentStart),n=Math.max(t.alignmentStart+t.readLength-1,e.alignmentStart+e.readLength-1)-r+1;t.templateLength=n,e.templateLength=n}(r,n)),delete r.mateRecordNumber}var h=function(){function t(t,e){this.container=t,this.file=t.file,this.containerPosition=e}return t.prototype.getHeader=function(){return n(this,void 0,void 0,(function(){var t,e,r;return i(this,(function(n){switch(n.label){case 0:return[4,this.file.getSectionParsers()];case 1:return t=n.sent(),[4,this.container.getHeader()];case 2:return e=n.sent(),[4,this.file.readBlock(e._endPosition+this.containerPosition)];case 3:if("MAPPED_SLICE_HEADER"===(r=n.sent()).contentType)r.content=(0,s.parseItem)(r.content,t.cramMappedSliceHeader.parser,0,e._endPosition);else{if("UNMAPPED_SLICE_HEADER"!==r.contentType)throw new a.CramMalformedError("error reading slice header block, invalid content type ".concat(r._contentType));r.content=(0,s.parseItem)(r.content,t.cramUnmappedSliceHeader.parser,0,e._endPosition)}return[2,r]}}))}))},t.prototype.getBlocks=function(){return n(this,void 0,void 0,(function(){var t,e,r,n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.getHeader()];case 1:t=i.sent(),e=t._endPosition,r=new Array(t.content.numBlocks),n=0,i.label=2;case 2:return n<r.length?(o=r,a=n,[4,this.file.readBlock(e)]):[3,5];case 3:o[a]=i.sent(),e=r[n]._endPosition,i.label=4;case 4:return n+=1,[3,2];case 5:return[2,r]}}))}))},t.prototype.getCoreDataBlock=function(){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.getBlocks()];case 1:return[2,t.sent()[0]]}}))}))},t.prototype._getBlocksContentIdIndex=function(){return n(this,void 0,void 0,(function(){var t,e;return i(this,(function(r){switch(r.label){case 0:return[4,this.getBlocks()];case 1:return t=r.sent(),e={},t.forEach((function(t){"EXTERNAL_DATA"===t.contentType&&(e[t.contentId]=t)})),[2,e]}}))}))},t.prototype.getBlockByContentId=function(t){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this._getBlocksContentIdIndex()];case 1:return[2,e.sent()[t]]}}))}))},t.prototype.getReferenceRegion=function(){return n(this,void 0,void 0,(function(){var t,e,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,this.getHeader()];case 1:return(t=i.sent().content).refSeqId<0?[2,void 0]:[4,this.container.getCompressionScheme()];case 2:if(e=i.sent(),t.refBaseBlockId>=0){if(!(r=this.getBlockByContentId(t.refBaseBlockId)))throw new a.CramMalformedError("embedded reference specified, but reference block does not exist");if(t.span>r.uncompressedSize)throw new a.CramMalformedError("Embedded reference is too small");return[2,{seq:r.data.toString("utf8"),start:t.refSeqStart,end:t.refSeqStart+t.refSeqSpan-1,span:t.refSeqSpan}]}if(!e.referenceRequired&&!this.file.fetchReferenceSequenceCallback)return[3,4];if(!this.file.fetchReferenceSequenceCallback)throw new Error("reference sequence not embedded, and seqFetch callback not provided, cannot fetch reference sequence");return[4,this.file.fetchReferenceSequenceCallback(t.refSeqId,t.refSeqStart,t.refSeqStart+t.refSeqSpan-1)];case 3:if((n=i.sent()).length!==t.refSeqSpan)throw new a.CramArgumentError("seqFetch callback returned a reference sequence of the wrong length");return[2,{seq:n,start:t.refSeqStart,end:t.refSeqStart+t.refSeqSpan-1,span:t.refSeqSpan}];case 4:return[2,void 0]}}))}))},t.prototype.getAllRecords=function(){return this.getRecords((function(){return!0}))},t.prototype._fetchRecords=function(){return n(this,void 0,void 0,(function(){var t,e,r,n,o,f,h,l,d,p,g,y,v,m,b,_,w=this;return i(this,(function(i){switch(i.label){case 0:return[4,this.file.getDefinition()];case 1:return t=i.sent().majorVersion,[4,this.container.getCompressionScheme()];case 2:return e=i.sent(),[4,this.getHeader()];case 3:return r=i.sent(),[4,this._getBlocksContentIdIndex()];case 4:return n=i.sent(),t>1&&this.file.options.checkSequenceMD5&&r.content.refSeqId>=0&&"0000000000000000"!==r.content.md5.join("")?[4,this.getReferenceRegion()]:[3,6];case 5:if((o=i.sent())&&(f=o.seq,h=o.start,l=o.end,d=(0,s.sequenceMD5)(f),p=r.content.md5.map((function(t){return(t<16?"0":"")+t.toString(16)})).join(""),d!==p))throw new a.CramMalformedError("MD5 checksum reference mismatch for ref ".concat(r.content.refSeqId," pos ").concat(h,"..").concat(l,". recorded MD5: ").concat(p,", calculated MD5: ").concat(d));i.label=6;case 6:return[4,this.getCoreDataBlock()];case 7:for(g=i.sent(),y={lastAlignmentStart:r.content.refSeqStart||0,coreBlock:{bitPosition:7,bytePosition:0},externalBlocks:{map:new Map,getCursor:function(t){var e=this.map.get(t);return void 0===e&&(e={bitPosition:7,bytePosition:0},this.map.set(t,e)),e}}},v=function(t){var r=e.getCodecForDataSeries(t);if(!r)throw new a.CramMalformedError("no codec defined for ".concat(t," data series"));return r.decode(w,g,n,y)},m=new Array(r.content.numRecords),b=0;b<m.length;b+=1)try{m[b]=(0,u.default)(this,v,e,r,g,n,y,t,b),m[b].uniqueId=r.contentPosition+r.content.recordCounter+b+1}catch(t){if(t instanceof a.CramBufferOverrunError){console.warn("read attempted beyond end of buffer, file seems truncated."),m=m.filter((function(t){return!!t}));break}throw t}for(b=0;b<m.length;b+=1)(_=m[b].mateRecordNumber)>=0&&c(m,b,m[b],m[_]);return[2,m]}}))}))},t.prototype.getRecords=function(t){return n(this,void 0,void 0,(function(){var e,r,o,a,s,f,u,c,h,l,d,p=this;return i(this,(function(g){switch(g.label){case 0:return e=this.container.filePosition+this.containerPosition,(r=this.file.featureCache.get(e))||(r=this._fetchRecords(),this.file.featureCache.set(e,r)),[4,r];case 1:return(o=g.sent().filter(t)).length&&this.file.fetchReferenceSequenceCallback?[4,this.getHeader()]:[3,5];case 2:return(a=g.sent()).content.refSeqId>=0||-2===a.content.refSeqId?(s=a.content.refSeqId>=0?a.content.refSeqId:void 0,[4,this.container.getCompressionScheme()]):[3,5];case 3:for(f=g.sent(),u={},h=0;h<o.length;h+=1)l=void 0!==s?s:o[h].sequenceId,(d=u[l])||(d={id:l,start:o[h].alignmentStart,end:-1/0},u[l]=d),(c=o[h].alignmentStart+(o[h].lengthOnRef||o[h].readLength)-1)>d.end&&(d.end=c),o[h].alignmentStart<d.start&&(d.start=o[h].alignmentStart);return[4,Promise.all(Object.values(u).map((function(t){return n(p,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return-1!==t.id&&t.start<=t.end?(e=t,[4,this.file.fetchReferenceSequenceCallback(t.id,t.start,t.end)]):[3,2];case 1:e.seq=r.sent(),r.label=2;case 2:return[2]}}))}))})))];case 4:for(g.sent(),h=0;h<o.length;h+=1)l=void 0!==s?s:o[h].sequenceId,(d=u[l])&&d.seq&&o[h].addReferenceSequence(d,f);g.label=5;case 5:return[2,o]}}))}))},t}();e.default=h,"getHeader getBlocks _getBlocksContentIdIndex".split(" ").forEach((function(t){return(0,s.tinyMemoize)(h,t)}))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(23)),o=r(0),a=n(r(66)),s=n(r(12));function f(t){for(var e="",r=0;r<t.length&&0!==t[r];r++)e+=String.fromCharCode(t[r]);return e}function u(t,e){if("Z"===t)return f(e);if("A"===t)return String.fromCharCode(e[0]);if("I"===t)return i.default.fromBytesLE(e).toNumber();if("i"===t)return new Int32Array(e.buffer)[0];if("s"===t)return new Int16Array(e.buffer)[0];if("S"===t)return new Uint16Array(e.buffer)[0];if("c"===t)return new Int8Array(e.buffer)[0];if("C"===t)return e[0];if("f"===t)return new Float32Array(e.buffer)[0];if("H"===t)return Number.parseInt(f(e).replace(/^0x/,""),16);if("B"===t)return function(t){var e=String.fromCharCode(t[0]),r=Int32Array.from(t.slice(1))[0],n=new Array(r);if(t=t.slice(5),"c"===e)for(var i=new Int8Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("C"===e)for(i=new Uint8Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("s"===e)for(i=new Int16Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("S"===e)for(i=new Uint16Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("i"===e)for(i=new Int32Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("I"===e)for(i=new Uint32Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else{if("f"!==e)throw new Error("unknown type: "+e);for(i=new Float32Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o]}return n}(e);throw new o.CramMalformedError("Unrecognized tag type ".concat(t))}e.default=function(t,e,r,n,i,c,h,l,d){var p=new a.default;if(p.flags=e("BF"),p.cramFlags=e("CF"),l>1&&-2===n.content.refSeqId?p.sequenceId=e("RI"):p.sequenceId=n.content.refSeqId,p.readLength=e("RL"),p.alignmentStart=e("AP"),r.APdelta&&(p.alignmentStart+=h.lastAlignmentStart),h.lastAlignmentStart=p.alignmentStart,p.readGroupId=e("RG"),r.readNamesIncluded&&(p.readName=f(e("RN"))),p.isDetached()){var g={};g.flags=e("MF"),r.readNamesIncluded||(g.readName=f(e("RN")),p.readName=g.readName),g.sequenceId=e("NS"),g.alignmentStart=e("NP"),(g.flags||g.sequenceId>-1)&&(p.mate=g),p.templateSize=e("TS"),g.flags&s.default.CRAM_M_UNMAP&&(p.flags|=s.default.BAM_FMUNMAP),g.flags&s.default.CRAM_M_REVERSE&&(p.flags|=s.default.BAM_FMREVERSE)}else p.hasMateDownStream()&&(p.mateRecordNumber=e("NF")+d+1);var y=e("TL");if(y<0)throw new o.CramMalformedError("invalid TL index");for(var v=r.getTagNames(y),m=v.length,b=0;b<m;b+=1){var _=v[b],w=_.substr(0,2),A=_.substr(2,1),S=r.getCodecForTag(_);if(!S)throw new o.CramMalformedError("no codec defined for auxiliary tag ".concat(_));var E=S.decode(t,i,c,h);p.tags[w]=u(A,E)}if(p.isSegmentUnmapped())if(p.isUnknownBases())p.readBases=null,p.qualityScores=null;else{for(k=new Array(p.readLength),b=0;b<k.length;b+=1)k[b]=e("BA");if(p.readBases=String.fromCharCode.apply(String,k),p.isPreservingQualityScores()){for(b=0;b<k.length;b+=1)k[b]=e("QS");p.qualityScores=k}}else{var C=e("FN");C&&(p.readFeatures=function(t,e,r,n,i){var a=0,s=t.alignmentStart-1,f=new Array(e);function u(t){var e=t[0],n=t[1],i=r(n);return"character"===e?String.fromCharCode(i):"string"===e?i.toString("utf8"):"numArray"===e?i.toArray():i}for(var c=0;c<e;c+=1){var h=String.fromCharCode(r("FC")),l=r("FP"),d={code:h},p={B:["character","BA"],S:["string",i>1?"SC":"IN"],X:["number","BS"],D:["number","DL"],I:["string","IN"],i:["character","BA"],b:["string","BB"],q:["numArray","QQ"],Q:["number","QS"],H:["number","HC"],P:["number","PD"],N:["number","RS"]}[h];if(!p)throw new o.CramMalformedError('invalid read feature code "'.concat(h,'"'));d.data=u(p);var g={B:["number","QS"]}[h];g&&(d.data=[d.data,u(g)]),a+=l,d.pos=a,s+=l,d.refPos=s,"D"===h||"N"===h?s+=d.data:"I"===h||"S"===h?s-=d.data.length:"i"===h&&(s-=1),f[c]=d}return f}(p,C,e,0,l));var B=p.readLength;if(p.readFeatures&&p.readFeatures.forEach((function(t){var e=t.code,r=t.data;"D"===e||"N"===e?B+=r:"I"===e||"S"===e?B-=r.length:"i"===e&&(B-=1)})),Number.isNaN(B)&&(console.warn("".concat(p.readName||"".concat(p.sequenceId,":").concat(p.alignmentStart)," record has invalid read features")),B=p.readLength),p.lengthOnRef=B,p.mappingQuality=e("MQ"),p.isPreservingQualityScores()){for(var k=new Array(p.readLength),b=0;b<k.length;b+=1)k[b]=e("QS");p.qualityScores=k}}return p}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(12));var o={a:0,A:0,c:1,C:1,g:2,G:2,t:3,T:3,n:4,N:4};var a=function(){function t(){this.tags={}}return t.prototype.isPaired=function(){return!!(this.flags&i.default.BAM_FPAIRED)},t.prototype.isProperlyPaired=function(){return!!(this.flags&i.default.BAM_FPROPER_PAIR)},t.prototype.isSegmentUnmapped=function(){return!!(this.flags&i.default.BAM_FUNMAP)},t.prototype.isMateUnmapped=function(){return!!(this.flags&i.default.BAM_FMUNMAP)},t.prototype.isReverseComplemented=function(){return!!(this.flags&i.default.BAM_FREVERSE)},t.prototype.isMateReverseComplemented=function(){return!!(this.flags&i.default.BAM_FMREVERSE)},t.prototype.isRead1=function(){return!!(this.flags&i.default.BAM_FREAD1)},t.prototype.isRead2=function(){return!!(this.flags&i.default.BAM_FREAD2)},t.prototype.isSecondary=function(){return!!(this.flags&i.default.BAM_FSECONDARY)},t.prototype.isFailedQc=function(){return!!(this.flags&i.default.BAM_FQCFAIL)},t.prototype.isDuplicate=function(){return!!(this.flags&i.default.BAM_FDUP)},t.prototype.isSupplementary=function(){return!!(this.flags&i.default.BAM_FSUPPLEMENTARY)},t.prototype.isDetached=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_DETACHED)},t.prototype.hasMateDownStream=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_MATE_DOWNSTREAM)},t.prototype.isPreservingQualityScores=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_PRESERVE_QUAL_SCORES)},t.prototype.isUnknownBases=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_NO_SEQ)},t.prototype.getReadBases=function(){return!this.readBases&&this._refRegion&&(this.readBases=function(t,e){if((t.lengthOnRef||t.readLength)&&!t.isUnknownBases()){var r=t.alignmentStart-e.start;if(!t.readFeatures)return e.seq.substr(r,t.lengthOnRef).toUpperCase();for(var n="",i=r,o=0;n.length<t.readLength;)if(o<t.readFeatures.length){var a=t.readFeatures[o];if("Q"===a.code||"q"===a.code)o+=1;else if(a.pos===n.length+1)if(o+=1,"b"===a.code){var s=a.data.split(","),f=String.fromCharCode.apply(String,s);n+=f,i+=f.length}else"B"===a.code?(n+=a.data[0],i+=1):"X"===a.code?(n+=a.sub,i+=1):"I"===a.code?n+=a.data:"D"===a.code?i+=a.data:"i"===a.code?n+=a.data:"N"===a.code?i+=a.data:"S"===a.code?n+=a.data:"P"===a.code||a.code;else if(o<t.readFeatures.length){n+=u=e.seq.substr(i,t.readFeatures[o].pos-n.length-1),i+=u.length}}else{var u;n+=u=e.seq.substr(i,t.readLength-n.length),i+=u.length}return n.toUpperCase()}}(this,this._refRegion)),this.readBases},t.prototype.getPairOrientation=function(){if(!this.isSegmentUnmapped()&&this.isPaired()&&!this.isMateUnmapped()&&this.mate&&this.sequenceId===this.mate.sequenceId){var t=this.isReverseComplemented()?"R":"F",e=this.isMateReverseComplemented()?"R":"F",r=" ",n=" ";this.isRead1()?(r="1",n="2"):this.isRead2()&&(r="2",n="1");var i=[],o=this.templateLength||this.templateSize;return this.alignmentStart>this.mate.alignmentStart&&o>0&&(o=-o),o>0?(i[0]=t,i[1]=r,i[2]=e,i[3]=n):(i[2]=t,i[3]=r,i[0]=e,i[1]=n),i.join("")}return null},t.prototype.addReferenceSequence=function(t,e){this.readFeatures&&this.readFeatures.forEach((function(r){"X"===r.code&&function(t,e,r,n){if(e){var i=n.refPos-e.start,a=e.seq.charAt(i);a&&(n.ref=a);var s=o[a];void 0===s&&(s=4);var f=r.substitutionMatrix[s][n.data];f&&(n.sub=f)}}(0,t,e,r)})),!this.readBases&&t.start<=this.alignmentStart&&t.end>=this.alignmentStart+(this.lengthOnRef||this.readLength)-1&&(this._refRegion=t)},t.prototype.toJSON=function(){var t=this,e={};return Object.keys(this).forEach((function(r){"_"!==r.charAt(0)&&(e[r]=t[r])})),e.readBases=this.getReadBases(),e},t}();e.default=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(68),o={BF:"int",CF:"int",RI:"int",RL:"int",AP:"int",RG:"int",MF:"int",NS:"int",NP:"int",TS:"int",NF:"int",TC:"byte",TN:"int",FN:"int",FC:"byte",FP:"int",BS:"byte",IN:"byteArray",SC:"byteArray",DL:"int",BA:"byte",BB:"byteArray",RS:"int",PD:"int",HC:"int",MQ:"int",RN:"byteArray",QS:"byte",QQ:"byteArray",TL:"int",TM:"ignore",TV:"ignore"};var a=function(){function t(t){Object.assign(this,t),this.readNamesIncluded=t.preservation.RN,this.APdelta=t.preservation.AP,this.referenceRequired=!!t.preservation.RR,this.tagIdsDictionary=t.preservation.TD,this.substitutionMatrix=function(t){for(var e=new Array(5),r=0;r<5;r+=1)e[r]=new Array(4);return e[0][t[0]>>6&3]="C",e[0][t[0]>>4&3]="G",e[0][t[0]>>2&3]="T",e[0][t[0]>>0&3]="N",e[1][t[1]>>6&3]="A",e[1][t[1]>>4&3]="G",e[1][t[1]>>2&3]="T",e[1][t[1]>>0&3]="N",e[2][t[2]>>6&3]="A",e[2][t[2]>>4&3]="C",e[2][t[2]>>2&3]="T",e[2][t[2]>>0&3]="N",e[3][t[3]>>6&3]="A",e[3][t[3]>>4&3]="C",e[3][t[3]>>2&3]="G",e[3][t[3]>>0&3]="N",e[4][t[4]>>6&3]="A",e[4][t[4]>>4&3]="C",e[4][t[4]>>2&3]="G",e[4][t[4]>>0&3]="T",e}(t.preservation.SM),this.dataSeriesCodecCache=new Map,this.tagCodecCache={}}return t.prototype.getCodecForTag=function(t){if(!this.tagCodecCache[t]){var e=this.tagEncoding[t];e&&(this.tagCodecCache[t]=(0,i.instantiateCodec)(e,"byteArray"))}return this.tagCodecCache[t]},t.prototype.getTagNames=function(t){return this.tagIdsDictionary[t]},t.prototype.getCodecForDataSeries=function(t){var e=this.dataSeriesCodecCache.get(t);if(void 0===e){var r=this.dataSeriesEncoding[t];if(r){var a=o[t];if(!a)throw new n.CramMalformedError("data series name ".concat(t," not defined in file compression header"));e=(0,i.instantiateCodec)(r,a),this.dataSeriesCodecCache.set(t,e)}}return e},t.prototype.toJSON=function(){var t=this,e={};return Object.keys(this).forEach((function(r){/Cache$/.test(r)||(e[r]=t[r])})),e},t}();e.default=a},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.instantiateCodec=e.getCodecClassWithId=void 0;var i=r(0),o=n(r(69)),a=n(r(70)),s=n(r(71)),f=n(r(72)),u=n(r(73)),c=n(r(74)),h=n(r(75)),l={1:a.default,3:o.default,4:f.default,5:s.default,6:u.default,7:h.default,9:c.default};function d(t){return l[t]}e.getCodecClassWithId=d,e.instantiateCodec=function t(e,r){var n=d("ignore"===r?0:e.codecId);if(!n)throw new i.CramUnimplementedError("no codec implemented for codec ID ".concat(e.codecId));return new n(e.parameters,r,t)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0);var s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if(!["byte","int"].includes(n.dataType))throw new TypeError("".concat(n.dataType," decoding not yet implemented by HUFFMAN_INT codec"));return n.buildCodeBook(),n.buildCodes(),n.buildCaches(),0===n.sortedCodes[0].bitLength&&(n._decode=n._decodeZeroLengthCode),n}return i(e,t),e.prototype.buildCodeBook=function(){for(var t=this,e=new Array(this.parameters.numCodes),r=0;r<this.parameters.numCodes;r+=1)e[r]={symbol:this.parameters.symbols[r],bitLength:this.parameters.bitLengths[r]};e=e.sort((function(t,e){return t.bitLength-e.bitLength||t.symbol-e.symbol})),this.codeBook={},e.forEach((function(e){t.codeBook[e.bitLength]||(t.codeBook[e.bitLength]=[]),t.codeBook[e.bitLength].push(e.symbol)}))},e.prototype.buildCodes=function(){var t=this;this.codes={};var e=0,r=-1;Object.entries(this.codeBook).forEach((function(n){var i=n[0],o=n[1];i=parseInt(i,10),o.forEach((function(n){var o={bitLength:i,value:n};r+=1;var s,f,u=i-e;if(r<<=u,o.bitCode=r,e+=u,16843009*((f=(858993459&(f=(s=r)-(s>>1)&1431655765))+(f>>2&858993459))+(f>>4)&252645135)>>24>i)throw new a.CramMalformedError("Symbol out of range");t.codes[n]=o}))}))},e.prototype.buildCaches=function(){this.sortedCodes=Object.values(this.codes).sort((function(t,e){return t.bitLength-e.bitLength||t.bitCode-e.bitCode})),this.sortedByValue=Object.values(this.codes).sort((function(t,e){return t.value-e.value})),this.sortedValuesByBitCode=this.sortedCodes.map((function(t){return t.value})),this.sortedBitCodes=this.sortedCodes.map((function(t){return t.bitCode})),this.sortedBitLengthsByBitCode=this.sortedCodes.map((function(t){return t.bitLength}));var t=Math.max.apply(Math,this.sortedBitCodes);this.bitCodeToValue=new Array(t+1).fill(-1);for(var e=0;e<this.sortedBitCodes.length;e+=1)this.bitCodeToValue[this.sortedCodes[e].bitCode]=e},e.prototype.decode=function(t,e,r,n){return this._decode(t,e,n.coreBlock)},e.prototype._decodeZeroLengthCode=function(){return this.sortedCodes[0].value},e.prototype._decode=function(t,e,r){for(var n=e.content,i=0,o=0,s=0;s<this.sortedCodes.length;s+=1){var f=this.sortedCodes[s].bitLength;o<<=f-i,o|=this._getBits(n,r,f-i),i=f;var u=this.bitCodeToValue[o];if(u>-1&&this.sortedBitLengthsByBitCode[u]===f)return this.sortedValuesByBitCode[u];for(var c=s;this.sortedCodes[c+1].bitLength===f&&c<this.sortedCodes.length;c+=1)s+=1}throw new a.CramMalformedError("Huffman symbol not found.")},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=o(r(3)),f=r(5),u=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"===n.dataType)n._decodeData=n._decodeInt;else{if("byte"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by EXTERNAL codec"));n._decodeData=n._decodeByte}return n}return i(e,t),e.prototype.decode=function(t,e,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new a.CramMalformedError("no block found with content ID ".concat(i));var s=n.externalBlocks.getCursor(i);return this._decodeData(o,s)},e.prototype._decodeInt=function(t,e){var r=(0,f.parseItf8)(t.content,e.bytePosition),n=r[0],i=r[1];return e.bytePosition+=i,n},e.prototype._decodeByte=function(t,e){if(e.bytePosition>=t.content.length)throw new a.CramBufferOverrunError("attempted to read beyond end of block. this file seems truncated.");return t.content[e.bytePosition++]},e}(s.default);e.default=u},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("byteArray"!==r)throw new TypeError("byteArrayStop codec does not support data type ".concat(r));return n._decode=n._decodeByteArray,n}return i(e,t),e.prototype.decode=function(t,e,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new a.CramMalformedError("no block found with content ID ".concat(i));var s=n.externalBlocks.getCursor(i);return this._decode(o,s)},e.prototype._decodeByteArray=function(t,e){for(var r=t.content,n=this.parameters.stopByte,i=e.bytePosition,o=e.bytePosition;r[o]!==n&&o<r.length;){if(o===r.length)throw new a.CramBufferOverrunError("byteArrayStop reading beyond length of data buffer?");o+=1}return e.bytePosition=o+1,r.slice(i,o)},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(5),s=function(t){function e(e,r,n){void 0===e&&(e={});var i=t.call(this,e,r)||this;if(i.instantiateCodec=n,"byteArray"!==r)throw new TypeError("byteArrayLength does not support data type ".concat(r));return i}return i(e,t),e.prototype.decode=function(t,e,r,n){for(var i=this._getLengthCodec().decode(t,e,r,n),o=this._getDataCodec(),a=new Uint8Array(i),s=0;s<i;s+=1)a[s]=o.decode(t,e,r,n);return a},e.prototype._getLengthCodec=function(){var t=this.parameters.lengthsEncoding;return this.instantiateCodec(t,"int")},e.prototype._getDataCodec=function(){var t=this.parameters.valuesEncoding;return this.instantiateCodec(t,"byte")},e}(o(r(3)).default);e.default=s,"_getLengthCodec _getDataCodec".split(" ").forEach((function(t){return(0,a.tinyMemoize)(s,t)}))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by BETA codec"));return n}return i(e,t),e.prototype.decode=function(t,e,r,n){return this._getBits(e.content,n.coreBlock,this.parameters.length)-this.parameters.offset},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by GAMMA codec"));return n}return i(e,t),e.prototype.decode=function(t,e,r,n){for(var i=1;0===this._getBits(e.content,n.coreBlock,1);)i+=1;return(this._getBits(e.content,n.coreBlock,i-1)|1<<i-1)-this.parameters.offset},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by SUBEXP codec"));return n}return i(e,t),e.prototype.decode=function(t,e,r,n){for(var i,o,a=0;this._getBits(e.content,n.coreBlock,1);)a+=1;return 0===a?(i=this.parameters.K,o=this._getBits(e.content,n.coreBlock,i)):o=1<<(i=a+this.parameters.K-1)|this._getBits(e.content,n.coreBlock,i),o-this.parameters.offset},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n=r(77),i=r(79);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){i.isString(t)&&(t=b(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),h=["%","/","?",";","#"].concat(c),l=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(80);function b(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o<t.indexOf("#")?"?":"#",u=t.split(s);u[0]=u[0].replace(/\\/g,"/");var b=t=u.join(s);if(b=b.trim(),!r&&1===t.split("#").length){var _=f.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=e?m.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var w=a.exec(b);if(w){var A=(w=w[0]).toLowerCase();this.protocol=A,b=b.substr(w.length)}if(r||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var S="//"===b.substr(0,2);!S||w&&y[w]||(b=b.substr(2),this.slashes=!0)}if(!y[w]&&(S||w&&!v[w])){for(var E,C,B=-1,k=0;k<l.length;k++){-1!==(R=b.indexOf(l[k]))&&(-1===B||R<B)&&(B=R)}-1!==(C=-1===B?b.lastIndexOf("@"):b.lastIndexOf("@",B))&&(E=b.slice(0,C),b=b.slice(C+1),this.auth=decodeURIComponent(E)),B=-1;for(k=0;k<h.length;k++){var R;-1!==(R=b.indexOf(h[k]))&&(-1===B||R<B)&&(B=R)}-1===B&&(B=b.length),this.host=b.slice(0,B),b=b.slice(B),this.parseHost(),this.hostname=this.hostname||"";var x="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!x)for(var M=this.hostname.split(/\./),T=(k=0,M.length);k<T;k++){var P=M[k];if(P&&!P.match(d)){for(var I="",O=0,F=P.length;O<F;O++)P.charCodeAt(O)>127?I+="x":I+=P[O];if(!I.match(d)){var U=M.slice(0,k),L=M.slice(k+1),N=P.match(p);N&&(U.push(N[1]),L.unshift(N[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=n.toASCII(this.hostname));var z=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+z,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[A])for(k=0,T=c.length;k<T;k++){var q=c[k];if(-1!==b.indexOf(q)){var j=encodeURIComponent(q);j===q&&(j=escape(q)),b=b.split(q).join(j)}}var H=b.indexOf("#");-1!==H&&(this.hash=b.substr(H),b=b.slice(0,H));var W=b.indexOf("?");if(-1!==W?(this.search=b.substr(W),this.query=b.substr(W+1),e&&(this.query=m.parse(this.query)),b=b.slice(0,W)):e&&(this.search="",this.query={}),b&&(this.pathname=b),v[A]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){z=this.pathname||"";var V=this.search||"";this.path=z+V}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=m.stringify(this.query));var s=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||v[e])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var f=Object.keys(t),u=0;u<f.length;u++){var c=f[u];"protocol"!==c&&(r[c]=t[c])}return v[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!v[t.protocol]){for(var h=Object.keys(t),l=0;l<h.length;l++){var d=h[l];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||y[t.protocol])r.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var g=r.pathname||"",m=r.search||"";r.path=g+m}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),_=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=_||b||r.host&&t.pathname,A=w,S=r.pathname&&r.pathname.split("/")||[],E=(p=t.pathname&&t.pathname.split("/")||[],r.protocol&&!v[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),w=w&&(""===p[0]||""===S[0])),_)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,S=p;else if(p.length)S||(S=[]),S.pop(),S=S.concat(p),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search)){if(E)r.hostname=r.host=S.shift(),(x=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var C=S.slice(-1)[0],B=(r.host||t.host||S.length>1)&&("."===C||".."===C)||""===C,k=0,R=S.length;R>=0;R--)"."===(C=S[R])?S.splice(R,1):".."===C?(S.splice(R,1),k++):k&&(S.splice(R,1),k--);if(!w&&!A)for(;k--;k)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),B&&"/"!==S.join("/").substr(-1)&&S.push("");var x,M=""===S[0]||S[0]&&"/"===S[0].charAt(0);E&&(r.hostname=r.host=M?"":S.length?S.shift():"",(x=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift()));return(w=w||r.host&&S.length)&&!M&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){(function(t,n){var i;/*! https://mths.be/punycode v1.3.2 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var a="object"==typeof n&&n;a.global!==a&&a.window!==a&&a.self;var s,f=2147483647,u=/^xn--/,c=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function g(t){throw RangeError(l[t])}function y(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function v(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+y((t=t.replace(h,".")).split("."),e).join(".")}function m(t){for(var e,r,n=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function b(t){return y(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=p(t)})).join("")}function _(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,r){var n=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;n+=36)t=d(t/35);return d(n+36*t/(t+38))}function A(t){var e,r,n,i,o,a,s,u,c,h,l,p=[],y=t.length,v=0,m=128,_=72;for((r=t.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&g("not-basic"),p.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<y;){for(o=v,a=1,s=36;i>=y&&g("invalid-input"),((u=(l=t.charCodeAt(i++))-48<10?l-22:l-65<26?l-65:l-97<26?l-97:36)>=36||u>d((f-v)/a))&&g("overflow"),v+=u*a,!(u<(c=s<=_?1:s>=_+26?26:s-_));s+=36)a>d(f/(h=36-c))&&g("overflow"),a*=h;_=w(v-o,e=p.length+1,0==o),d(v/e)>f-m&&g("overflow"),m+=d(v/e),v%=e,p.splice(v++,0,m)}return b(p)}function S(t){var e,r,n,i,o,a,s,u,c,h,l,y,v,b,A,S=[];for(y=(t=m(t)).length,e=128,r=0,o=72,a=0;a<y;++a)(l=t[a])<128&&S.push(p(l));for(n=i=S.length,i&&S.push("-");n<y;){for(s=f,a=0;a<y;++a)(l=t[a])>=e&&l<s&&(s=l);for(s-e>d((f-r)/(v=n+1))&&g("overflow"),r+=(s-e)*v,e=s,a=0;a<y;++a)if((l=t[a])<e&&++r>f&&g("overflow"),l==e){for(u=r,c=36;!(u<(h=c<=o?1:c>=o+26?26:c-o));c+=36)A=u-h,b=36-h,S.push(p(_(h+A%b,0))),u=d(A/b);S.push(p(_(u,0))),o=w(r,v,n==i),r=0,++n}++r,++e}return S.join("")}s={version:"1.3.2",ucs2:{decode:m,encode:b},decode:A,encode:S,toASCII:function(t){return v(t,(function(t){return c.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return v(t,(function(t){return u.test(t)?A(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return s}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(78)(t),r(9))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){"use strict";e.decode=e.parse=r(81),e.encode=e.stringify=r(82)},function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var a={};if("string"!=typeof t||0===t.length)return a;var s=/\+/g;t=t.split(e);var f=1e3;o&&"number"==typeof o.maxKeys&&(f=o.maxKeys);var u=t.length;f>0&&u>f&&(u=f);for(var c=0;c<u;++c){var h,l,d,p,g=t[c].replace(s,"%20"),y=g.indexOf(r);y>=0?(h=g.substr(0,y),l=g.substr(y+1)):(h=g,l=""),d=decodeURIComponent(h),p=decodeURIComponent(l),n(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,s){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(a(t),(function(a){var s=encodeURIComponent(n(a))+r;return i(t[a])?o(t[a],(function(t){return s+encodeURIComponent(n(t))})).join(e):s+encodeURIComponent(n(t[a]))})).join(e):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var a=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e,r){"use strict";(function(t){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(84)),s=o(r(85)),f=function(){function e(t){var e=this;this.position=0,this.url=t,this.cache=new s.default({fetch:function(t,r){return e._fetch(t,r)}})}return e.prototype._fetch=function(e,r){return n(this,void 0,void 0,(function(){var n,o,s,f,u,c;return i(this,(function(i){switch(i.label){case 0:return n={},r<1/0?n.range="bytes=".concat(e,"-").concat(e+r):r===1/0&&0!==e&&(n.range="bytes=".concat(e,"-")),[4,(0,a.default)(this.url,{method:"GET",headers:n,redirect:"follow",mode:"cors"})];case 1:return 200===(o=i.sent()).status&&0===e||206===o.status?(u=(f=t).from,[4,o.arrayBuffer()]):[3,3];case 2:return s=u.apply(f,[i.sent()]),(c=/\/(\d+)$/.exec(o.headers.get("content-range")))[1]&&(this._stat={size:parseInt(c[1],10)}),[2,s];case 3:throw new Error("HTTP ".concat(o.status," fetching ").concat(this.url))}}))}))},e.prototype.read=function(t,e,r,n){void 0===e&&(e=0),void 0===r&&(r=1/0),void 0===n&&(n=0);return null===n&&(this.position,this.position+=r),this.cache.get(t,e,r,n)},e.prototype.readFile=function(){return n(this,void 0,void 0,(function(){var e,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,(0,a.default)(this.url,{method:"GET",redirect:"follow",mode:"cors"})];case 1:return e=i.sent(),n=(r=t).from,[4,e.arrayBuffer()];case 2:return[2,n.apply(r,[i.sent()])]}}))}))},e.prototype.stat=function(){return n(this,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return this._stat?[3,2]:(e=t.allocUnsafe(10),[4,this.read(e,0,10,0)]);case 1:if(r.sent(),!this._stat)throw new Error("unable to determine size of file at ".concat(this.url));r.label=2;case 2:return[2,this._stat]}}))}))},e}();e.default=f}).call(this,r(1).Buffer)},function(t,e){var r="undefined"!=typeof self?self:this,n=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function c(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function g(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||f(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var t,e,r,n=d(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=p(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=u(t),e=c(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},l.prototype.delete=function(t){delete this.map[u(t)]},l.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},l.prototype.set=function(t,e){this.map[u(t)]=c(e)},l.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),h(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),h(t)},n&&(l.prototype[Symbol.iterator]=l.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){var r,n,i=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(r=e.method||this.method||"GET",n=r.toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function _(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var A=[301,302,303,307,308];w.redirect=function(t,e){if(-1===A.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function S(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new w(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",f),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",f)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=l,t.Request=b,t.Response=w),e.Headers=l,e.Request=b,e.Response=w,e.fetch=S,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(11)),s=function(){function t(t){var e=t.fetch,r=t.size,n=void 0===r?1e7:r,i=t.chunkSize,o=void 0===i?32768:i;if(!e)throw new Error("fetch function required");this.fetch=e,this.chunkSize=o,this.lruCache=new a.default({maxSize:Math.floor(n/o)})}return t.prototype.get=function(t,e,r,o){return n(this,void 0,void 0,(function(){var n,a,s,f,u,c,h,l,d=this;return i(this,(function(i){switch(i.label){case 0:if(t.length<e+r)throw new Error("output buffer not big enough for request");for(n=Math.floor(o/this.chunkSize),a=Math.floor((o+r)/this.chunkSize),s=new Array(a-n+1),f=function(t){s[t-n]=u._getChunk(t).then((function(e){return{data:e,chunkNumber:t}}))},u=this,c=n;c<=a;c+=1)f(c);return[4,Promise.all(s)];case 1:return h=i.sent(),l=o-h[0].chunkNumber*this.chunkSize,h.forEach((function(i){var s=i.data,f=i.chunkNumber,u=f*d.chunkSize,c=0,h=d.chunkSize,p=e+(f-n)*d.chunkSize-l;f===n&&(p=e,c=l),f===a&&(h=o+r-u),s.copy(t,p,c,h)})),[2]}}))}))},t.prototype._getChunk=function(t){var e=this.lruCache.get(t);if(e)return e;var r=this.fetch(t*this.chunkSize,this.chunkSize);return this.lruCache.set(t,r),r},t}();e.default=s},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseHeaderText=void 0,e.parseHeaderText=function(t){var e=t.split(/\r?\n/),r=[];return e.forEach((function(t){var e=t.split(/\t/),n=e[0],i=e.slice(1).map((function(t){var e=t.split(":",2);return{tag:e[0],value:e[1]}}));n&&r.push({tag:n.substr(1),data:i})})),r}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=o(r(16)),f=function(){function t(t){if(t.cram?this.cram=t.cram:this.cram=new s.default({url:t.cramUrl,path:t.cramPath,filehandle:t.cramFilehandle,seqFetch:t.seqFetch,checkSequenceMD5:t.checkSequenceMD5,cacheSize:t.cacheSize}),!(this.cram instanceof s.default))throw new Error("invalid arguments: no cramfile");if(this.index=t.index,!this.index.getEntriesForRange)throw new Error("invalid arguments: not an index");this.fetchSizeLimit=t.fetchSizeLimit||3e6}return t.prototype.getRecordsForRange=function(t,e,r,o){return void 0===o&&(o={}),n(this,void 0,void 0,(function(){var n,s,f,u,c,h,l,d,p,g,y,v,m,b,_,w,A,S,E,C,B,k,R,x=this;return i(this,(function(i){switch(i.label){case 0:if(o.viewAsPairs=o.viewAsPairs||!1,o.pairAcrossChr=o.pairAcrossChr||!1,o.maxInsertSize=o.maxInsertSize||2e5,"string"==typeof t)throw new a.CramUnimplementedError("string sequence names not yet supported");return n=t,[4,this.index.getEntriesForRange(n,e,r)];case 1:if(s=i.sent(),(f=s.map((function(t){return t.sliceBytes})).reduce((function(t,e){return t+e}),0))>this.fetchSizeLimit)throw new a.CramSizeLimitError("data size of ".concat(f.toLocaleString()," bytes exceeded fetch size limit of ").concat(this.fetchSizeLimit.toLocaleString()," bytes"));return u=function(n){return n.sequenceId===t&&n.alignmentStart<=r&&n.alignmentStart+n.lengthOnRef-1>=e},[4,Promise.all(s.map((function(t){return x.getRecordsInSlice(t,u)})))];case 2:if(c=i.sent(),h=(R=Array.prototype).concat.apply(R,c),!o.viewAsPairs)return[3,5];for(l={},d={},A=0;A<h.length;A+=1)p=h[A].readName,g=h[A].uniqueId,l[p]||(l[p]=0),l[p]+=1,d[g]=1;for(y={},Object.entries(l).forEach((function(t){var e=t[0];1===t[1]&&(y[e]=!0)})),v=[],A=0;A<h.length;A+=1)m=h[A].readName,y[m]&&h[A].mate&&(h[A].mate.sequenceId===n||o.pairAcrossChr)&&Math.abs(h[A].alignmentStart-h[A].mate.alignmentStart)<o.maxInsertSize&&(b=this.index.getEntriesForRange(h[A].mate.sequenceId,h[A].mate.alignmentStart,h[A].mate.alignmentStart+1),v.push(b));return[4,Promise.all(v)];case 3:for(_=i.sent(),w=[],A=0;A<_.length;A+=1)w.push.apply(w,_[A]);if(w=w.sort((function(t,e){return t.toString().localeCompare(e.toString())})).filter((function(t,e,r){return!e||t.toString()!==r[e-1].toString()})),S=[],E=[],(C=w.map((function(t){return t.sliceBytes})).reduce((function(t,e){return t+e}),0))>this.fetchSizeLimit)throw new Error("mate data size of ".concat(C.toLocaleString()," bytes exceeded fetch size limit of ").concat(this.fetchSizeLimit.toLocaleString()," bytes"));return w.forEach((function(t){var e=x.cram.featureCache.get(t.toString());e||(e=x.getRecordsInSlice(t,(function(){return!0})),x.cram.featureCache.set(t.toString(),e)),S.push(e);var r=e.then((function(t){for(var e=[],r=0;r<t.length;r+=1){var n=t[r];y[n.readName]&&!d[n.uniqueId]&&e.push(n)}return e}));E.push(r)})),[4,Promise.all(E)];case 4:(B=i.sent()).length&&(k=B.reduce((function(t,e){return t.concat(e)})),h=h.concat(k)),i.label=5;case 5:return[2,h]}}))}))},t.prototype.getRecordsInSlice=function(t,e){var r=t.containerStart,n=t.sliceStart,i=t.sliceBytes;return this.cram.getContainerAtPosition(r).getSlice(n,i).getRecords(e)},t.prototype.hasDataForReferenceSequence=function(t){return this.index.hasDataForReferenceSequence(t)},t}();e.default=f},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(90)),s=o(r(11)),f=r(17),u=r(29),c=r(0),h=function(){function t(t){Object.assign(this,t)}return t.prototype.toString=function(){return"".concat(this.start,":").concat(this.span,":").concat(this.containerStart,":").concat(this.sliceStart,":").concat(this.sliceBytes)},t}();function l(t,e){if(e.some((function(t){return void 0===t})))throw new c.CramMalformedError("invalid .crai index file");var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5];t[r]||(t[r]=[]),t[r].push(new h({start:n,span:i,containerStart:o,sliceStart:a,sliceBytes:s}))}var d=function(){function t(t){var e=this,r=(0,u.open)(t.url,t.path,t.filehandle);this._parseCache=new a.default({cache:new s.default({maxSize:1}),fill:function(t,r){return e.parseIndex({signal:r})}}),this.readFile=r.readFile.bind(r)}return t.prototype.parseIndex=function(){var t={};return this.readFile().then((function(t){return 31===t[0]&&139===t[1]?(0,f.unzip)(t):t})).then((function(e){if(e.length>4&&21578050===e.readUInt32LE(0))throw new c.CramMalformedError("invalid .crai index file. note: file appears to be a .bai index. this is technically legal but please open a github issue if you need support");for(var r=[],n="",i=0;i<e.length;i+=1){var o=e[i];if(o>=48&&o<=57||!n&&45===o)n+=String.fromCharCode(o);else if(9===o)r.push(Number.parseInt(n,10)),n="";else if(10===o)r.push(Number.parseInt(n,10)),n="",l(t,r),r=[];else if(13!==o&&32!==o)throw new c.CramMalformedError("invalid .crai index file")}return n&&r.push(Number.parseInt(n,10)),6===r.length&&l(t,r),Object.entries(t).forEach((function(e){var r=e[0],n=e[1];t[r]=n.sort((function(t,e){return t.start-e.start||t.span-e.span}))})),t}))},t.prototype.getIndex=function(t){return void 0===t&&(t={}),this._parseCache.get("index",null,t.signal)},t.prototype.hasDataForReferenceSequence=function(t){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.getIndex()];case 1:return[2,!!e.sent()[t]]}}))}))},t.prototype.getEntriesForRange=function(t,e,r){return n(this,void 0,void 0,(function(){var n,o,a,s;return i(this,(function(i){switch(i.label){case 0:return[4,this.getIndex()];case 1:if(!(n=i.sent()[t]))return[2,[]];for(o=function(t){var n=t.start,i=t.start+t.span;return n>=r?-1:i<=e?1:0},a=[],s=0;s<n.length;s+=1)0===o(n[s])&&a.push(n[s]);return[2,a]}}))}))},t}();e.default=d},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(91)).default;e.default=i},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(92)),o=n(r(13)),a=n(r(14)),s=n(r(15)),f=r(30),u=n(r(94)),c=n(r(95)),h=function(){function t(e){var r=e.fill,n=e.cache;if((0,o.default)(this,t),(0,s.default)(this,"cache",void 0),(0,s.default)(this,"fillCallback",void 0),"function"!=typeof r)throw new TypeError("must pass a fill function");if("object"!==(0,i.default)(n))throw new TypeError("must pass a cache object");if("function"!=typeof n.get||"function"!=typeof n.set||"function"!=typeof n.delete)throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=n,this.fillCallback=r}return(0,a.default)(t,[{key:"evict",value:function(t,e){this.cache.get(t)===e&&this.cache.delete(t)}},{key:"fill",value:function(t,e,r,n){var i=this,o=new u.default,a=new c.default;a.addCallback(n);var s={aborter:o,promise:this.fillCallback(e,o.signal,(function(t){a.callback(t)})),settled:!1,statusReporter:a,get aborted(){return this.aborter.signal.aborted}};s.aborter.addSignal(r),s.aborter.signal.addEventListener("abort",(function(){s.settled||i.evict(t,s)})),s.promise.then((function(){s.settled=!0}),(function(e){s.settled=!0,i.evict(t,s)})).catch((function(t){throw console.error(t),t})),this.cache.set(t,s)}},{key:"has",value:function(t){return this.cache.has(t)}},{key:"get",value:function(e,r,n,i){if(!n&&r instanceof f.AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");var o=this.cache.get(e);return o?o.aborted&&!o.settled?(this.evict(e,o),this.get(e,r,n,i)):o.settled?o.promise:(o.aborter.addSignal(n),o.statusReporter.addCallback(i),t.checkSinglePromise(o.promise,n)):(this.fill(e,r,n,i),t.checkSinglePromise(this.cache.get(e).promise,n))}},{key:"delete",value:function(t){var e=this.cache.get(t);e&&(e.settled||e.aborter.abort(),this.cache.delete(t))}},{key:"clear",value:function(){for(var t=this.cache.keys(),e=0,r=t.next();!r.done;r=t.next())this.delete(r.value),e+=1;return e}}],[{key:"isAbortException",value:function(t){return"AbortError"===t.name||"ERR_ABORTED"===t.code||"AbortError: aborted"===t.message||"Error: aborted"===t.message}},{key:"checkSinglePromise",value:function(t,e){function r(){if(e&&e.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return t.then((function(t){return r(),t}),(function(t){throw r(),t}))}}]),t}();e.default=h},function(t,e){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),t}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?f(t):e}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=a(t);if(e){var i=a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function h(t,e,r){return(h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(r):i.value}})(t,e,r||t)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(){n(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return o(t,[{key:"addEventListener",value:function(t,e,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:e,options:r})}},{key:"removeEventListener",value:function(t,e){if(t in this.listeners)for(var r=this.listeners[t],n=0,i=r.length;n<i;n++)if(r[n].callback===e)return void r.splice(n,1)}},{key:"dispatchEvent",value:function(t){if(t.type in this.listeners){for(var e=this.listeners[t.type].slice(),r=0,n=e.length;r<n;r++){var i=e[r];try{i.callback.call(this,t)}catch(t){Promise.resolve().then((function(){throw t}))}i.options&&i.options.once&&this.removeEventListener(t.type,i.callback)}return!t.defaultPrevented}}}]),t}(),d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(r,t);var e=c(r);function r(){var t;return n(this,r),(t=e.call(this)).listeners||l.call(f(t)),Object.defineProperty(f(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(f(t),"onabort",{value:null,writable:!0,configurable:!0}),t}return o(r,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(t){"abort"===t.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,t)),h(a(r.prototype),"dispatchEvent",this).call(this,t)}}]),r}(l),p=function(){function t(){n(this,t),Object.defineProperty(this,"signal",{value:new d,writable:!0,configurable:!0})}return o(t,[{key:"abort",value:function(){var t;try{t=new Event("abort")}catch(e){"undefined"!=typeof document?document.createEvent?(t=document.createEvent("Event")).initEvent("abort",!1,!1):(t=document.createEventObject()).type="abort":t={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(t)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(p.prototype[Symbol.toStringTag]="AbortController",d.prototype[Symbol.toStringTag]="AbortSignal"),e.AbortController=p,e.AbortSignal=d,e.abortableFetch=function(t){"function"==typeof t&&(t={fetch:t});var e=t,r=e.fetch,n=e.Request,i=void 0===n?r.Request:n,o=e.AbortController,a=e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=void 0!==a&&a;if(!function(t){return t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof t.Request&&!t.Request.prototype.hasOwnProperty("signal")||!t.AbortController}({fetch:r,Request:i,AbortController:o,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:r,Request:f};var f=i;(f&&!f.prototype.hasOwnProperty("signal")||s)&&((f=function(t,e){var r;e&&e.signal&&(r=e.signal,delete e.signal);var n=new i(t,e);return r&&Object.defineProperty(n,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),n}).prototype=i.prototype);var u=r;return{fetch:function(t,e){var r=f&&f.prototype.isPrototypeOf(t)?t.signal:e?e.signal:void 0;if(r){var n;try{n=new DOMException("Aborted","AbortError")}catch(t){(n=new Error("Aborted")).name="AbortError"}if(r.aborted)return Promise.reject(n);var i=new Promise((function(t,e){r.addEventListener("abort",(function(){return e(n)}),{once:!0})}));return e&&e.signal&&delete e.signal,Promise.race([i,u(t,e)])}return u(t,e)},Request:f}}},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(14)),o=n(r(15)),a=n(r(13)),s=r(30),f=function t(){(0,a.default)(this,t)},u=function(){function t(){(0,a.default)(this,t),(0,o.default)(this,"signals",new Set),(0,o.default)(this,"abortController",new s.AbortController)}return(0,i.default)(t,[{key:"addSignal",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new f;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",(function(){t.handleAborted(e)}))}},{key:"handleAborted",value:function(t){this.signals.delete(t),0===this.signals.size&&this.abortController.abort()}},{key:"abort",value:function(){this.abortController.abort()}},{key:"signal",get:function(){return this.abortController.signal}}]),t}();e.default=u},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(13)),o=n(r(14)),a=n(r(15)),s=function(){function t(){(0,i.default)(this,t),(0,a.default)(this,"callbacks",new Set),(0,a.default)(this,"currentMessage",void 0)}return(0,o.default)(t,[{key:"addCallback",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};this.callbacks.add(t),t(this.currentMessage)}},{key:"callback",value:function(t){this.currentMessage=t,this.callbacks.forEach((function(e){e(t)}))}}]),t}();e.default=s}]);
|
|
17
|
+
t.exports=function(t){return null!=t&&(r(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=r(5),f=o(r(12)),u=o(r(65));function c(t,e,r,n){if(!n)throw new a.CramMalformedError("could not resolve intra-slice mate pairs, file seems truncated or malformed");var i=!!(n.mate||void 0!==n.mateRecordNumber&&n.mateRecordNumber!==e);r.readName||(r.readName=String(r.uniqueId),n.readName=r.readName),r.mate={sequenceId:n.sequenceId,alignmentStart:n.alignmentStart,uniqueId:n.uniqueId},n.readName&&(r.mate.readName=n.readName),n.mate||void 0!==n.mateRecordNumber||(n.mate={sequenceId:r.sequenceId,alignmentStart:r.alignmentStart,uniqueId:r.uniqueId},r.readName&&(n.mate.readName=r.readName)),r.flags|=f.default.BAM_FPAIRED,n.flags&f.default.BAM_FUNMAP&&(r.flags|=f.default.BAM_FMUNMAP),r.flags&f.default.BAM_FUNMAP&&(n.flags|=f.default.BAM_FMUNMAP),n.flags&f.default.BAM_FREVERSE&&(r.flags|=f.default.BAM_FMREVERSE),r.flags&f.default.BAM_FREVERSE&&(n.flags|=f.default.BAM_FMREVERSE),void 0===r.templateLength&&(i?function(t,e,r){var n=function e(r){var n=[r];if(r.mateRecordNumber>=0){var i=t[r.mateRecordNumber];if(!i)throw new a.CramMalformedError("intra-slice mate record not found, this file seems malformed");n.push.apply(n,e(i))}return n}(r),i=n.map((function(t){return t.alignmentStart})),o=n.map((function(t){return t.alignmentStart+t.readLength-1})),s=Math.max.apply(Math,o)-Math.min.apply(Math,i)+1;s>=0&&n.forEach((function(t){if(void 0!==t.templateLength)throw new a.CramMalformedError("mate pair group has some members that have template lengths already, this file seems malformed");t.templateLength=s}))}(t,0,r):function(t,e){var r=Math.min(t.alignmentStart,e.alignmentStart),n=Math.max(t.alignmentStart+t.readLength-1,e.alignmentStart+e.readLength-1)-r+1;t.templateLength=n,e.templateLength=n}(r,n)),delete r.mateRecordNumber}var h=function(){function t(t,e){this.container=t,this.file=t.file,this.containerPosition=e}return t.prototype.getHeader=function(){return n(this,void 0,void 0,(function(){var t,e,r;return i(this,(function(n){switch(n.label){case 0:return[4,this.file.getSectionParsers()];case 1:return t=n.sent(),[4,this.container.getHeader()];case 2:return e=n.sent(),[4,this.file.readBlock(e._endPosition+this.containerPosition)];case 3:if("MAPPED_SLICE_HEADER"===(r=n.sent()).contentType)r.content=(0,s.parseItem)(r.content,t.cramMappedSliceHeader.parser,0,e._endPosition);else{if("UNMAPPED_SLICE_HEADER"!==r.contentType)throw new a.CramMalformedError("error reading slice header block, invalid content type ".concat(r._contentType));r.content=(0,s.parseItem)(r.content,t.cramUnmappedSliceHeader.parser,0,e._endPosition)}return[2,r]}}))}))},t.prototype.getBlocks=function(){return n(this,void 0,void 0,(function(){var t,e,r,n,o,a;return i(this,(function(i){switch(i.label){case 0:return[4,this.getHeader()];case 1:t=i.sent(),e=t._endPosition,r=new Array(t.content.numBlocks),n=0,i.label=2;case 2:return n<r.length?(o=r,a=n,[4,this.file.readBlock(e)]):[3,5];case 3:o[a]=i.sent(),e=r[n]._endPosition,i.label=4;case 4:return n+=1,[3,2];case 5:return[2,r]}}))}))},t.prototype.getCoreDataBlock=function(){return n(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.getBlocks()];case 1:return[2,t.sent()[0]]}}))}))},t.prototype._getBlocksContentIdIndex=function(){return n(this,void 0,void 0,(function(){var t,e;return i(this,(function(r){switch(r.label){case 0:return[4,this.getBlocks()];case 1:return t=r.sent(),e={},t.forEach((function(t){"EXTERNAL_DATA"===t.contentType&&(e[t.contentId]=t)})),[2,e]}}))}))},t.prototype.getBlockByContentId=function(t){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this._getBlocksContentIdIndex()];case 1:return[2,e.sent()[t]]}}))}))},t.prototype.getReferenceRegion=function(){return n(this,void 0,void 0,(function(){var t,e,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,this.getHeader()];case 1:return(t=i.sent().content).refSeqId<0?[2,void 0]:[4,this.container.getCompressionScheme()];case 2:if(e=i.sent(),t.refBaseBlockId>=0){if(!(r=this.getBlockByContentId(t.refBaseBlockId)))throw new a.CramMalformedError("embedded reference specified, but reference block does not exist");if(t.span>r.uncompressedSize)throw new a.CramMalformedError("Embedded reference is too small");return[2,{seq:r.data.toString("utf8"),start:t.refSeqStart,end:t.refSeqStart+t.refSeqSpan-1,span:t.refSeqSpan}]}if(!e.referenceRequired&&!this.file.fetchReferenceSequenceCallback)return[3,4];if(!this.file.fetchReferenceSequenceCallback)throw new Error("reference sequence not embedded, and seqFetch callback not provided, cannot fetch reference sequence");return[4,this.file.fetchReferenceSequenceCallback(t.refSeqId,t.refSeqStart,t.refSeqStart+t.refSeqSpan-1)];case 3:if((n=i.sent()).length!==t.refSeqSpan)throw new a.CramArgumentError("seqFetch callback returned a reference sequence of the wrong length");return[2,{seq:n,start:t.refSeqStart,end:t.refSeqStart+t.refSeqSpan-1,span:t.refSeqSpan}];case 4:return[2,void 0]}}))}))},t.prototype.getAllRecords=function(){return this.getRecords((function(){return!0}))},t.prototype._fetchRecords=function(){return n(this,void 0,void 0,(function(){var t,e,r,n,o,f,h,l,d,p,g,y,v,m,b,_,w=this;return i(this,(function(i){switch(i.label){case 0:return[4,this.file.getDefinition()];case 1:return t=i.sent().majorVersion,[4,this.container.getCompressionScheme()];case 2:return e=i.sent(),[4,this.getHeader()];case 3:return r=i.sent(),[4,this._getBlocksContentIdIndex()];case 4:return n=i.sent(),t>1&&this.file.options.checkSequenceMD5&&r.content.refSeqId>=0&&"0000000000000000"!==r.content.md5.join("")?[4,this.getReferenceRegion()]:[3,6];case 5:if((o=i.sent())&&(f=o.seq,h=o.start,l=o.end,d=(0,s.sequenceMD5)(f),p=r.content.md5.map((function(t){return(t<16?"0":"")+t.toString(16)})).join(""),d!==p))throw new a.CramMalformedError("MD5 checksum reference mismatch for ref ".concat(r.content.refSeqId," pos ").concat(h,"..").concat(l,". recorded MD5: ").concat(p,", calculated MD5: ").concat(d));i.label=6;case 6:return[4,this.getCoreDataBlock()];case 7:for(g=i.sent(),y={lastAlignmentStart:r.content.refSeqStart||0,coreBlock:{bitPosition:7,bytePosition:0},externalBlocks:{map:new Map,getCursor:function(t){var e=this.map.get(t);return void 0===e&&(e={bitPosition:7,bytePosition:0},this.map.set(t,e)),e}}},v=function(t){var r=e.getCodecForDataSeries(t);if(!r)throw new a.CramMalformedError("no codec defined for ".concat(t," data series"));return r.decode(w,g,n,y)},m=new Array(r.content.numRecords),b=0;b<m.length;b+=1)try{m[b]=(0,u.default)(this,v,e,r,g,n,y,t,b),m[b].uniqueId=r.contentPosition+r.content.recordCounter+b+1}catch(t){if(t instanceof a.CramBufferOverrunError){console.warn("read attempted beyond end of buffer, file seems truncated."),m=m.filter((function(t){return!!t}));break}throw t}for(b=0;b<m.length;b+=1)(_=m[b].mateRecordNumber)>=0&&c(m,b,m[b],m[_]);return[2,m]}}))}))},t.prototype.getRecords=function(t){return n(this,void 0,void 0,(function(){var e,r,o,a,s,f,u,c,h,l,d,p=this;return i(this,(function(g){switch(g.label){case 0:return e=this.container.filePosition+this.containerPosition,(r=this.file.featureCache.get(e))||(r=this._fetchRecords(),this.file.featureCache.set(e,r)),[4,r];case 1:return(o=g.sent().filter(t)).length&&this.file.fetchReferenceSequenceCallback?[4,this.getHeader()]:[3,5];case 2:return(a=g.sent()).content.refSeqId>=0||-2===a.content.refSeqId?(s=a.content.refSeqId>=0?a.content.refSeqId:void 0,[4,this.container.getCompressionScheme()]):[3,5];case 3:for(f=g.sent(),u={},h=0;h<o.length;h+=1)l=void 0!==s?s:o[h].sequenceId,(d=u[l])||(d={id:l,start:o[h].alignmentStart,end:-1/0},u[l]=d),(c=o[h].alignmentStart+(o[h].lengthOnRef||o[h].readLength)-1)>d.end&&(d.end=c),o[h].alignmentStart<d.start&&(d.start=o[h].alignmentStart);return[4,Promise.all(Object.values(u).map((function(t){return n(p,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return-1!==t.id&&t.start<=t.end?(e=t,[4,this.file.fetchReferenceSequenceCallback(t.id,t.start,t.end)]):[3,2];case 1:e.seq=r.sent(),r.label=2;case 2:return[2]}}))}))})))];case 4:for(g.sent(),h=0;h<o.length;h+=1)l=void 0!==s?s:o[h].sequenceId,(d=u[l])&&d.seq&&o[h].addReferenceSequence(d,f);g.label=5;case 5:return[2,o]}}))}))},t}();e.default=h,"getHeader getBlocks _getBlocksContentIdIndex".split(" ").forEach((function(t){return(0,s.tinyMemoize)(h,t)}))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(23)),o=r(0),a=n(r(66)),s=n(r(12));function f(t){for(var e="",r=0;r<t.length&&0!==t[r];r++)e+=String.fromCharCode(t[r]);return e}function u(t,e){if("Z"===t)return f(e);if("A"===t)return String.fromCharCode(e[0]);if("I"===t)return i.default.fromBytesLE(e).toNumber();if("i"===t)return new Int32Array(e.buffer)[0];if("s"===t)return new Int16Array(e.buffer)[0];if("S"===t)return new Uint16Array(e.buffer)[0];if("c"===t)return new Int8Array(e.buffer)[0];if("C"===t)return e[0];if("f"===t)return new Float32Array(e.buffer)[0];if("H"===t)return Number.parseInt(f(e).replace(/^0x/,""),16);if("B"===t)return function(t){var e=String.fromCharCode(t[0]),r=Int32Array.from(t.slice(1))[0],n=new Array(r);if(t=t.slice(5),"c"===e)for(var i=new Int8Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("C"===e)for(i=new Uint8Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("s"===e)for(i=new Int16Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("S"===e)for(i=new Uint16Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("i"===e)for(i=new Int32Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else if("I"===e)for(i=new Uint32Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o];else{if("f"!==e)throw new Error("unknown type: "+e);for(i=new Float32Array(t.buffer),o=0;o<r;o+=1)n[o]=i[o]}return n}(e);throw new o.CramMalformedError("Unrecognized tag type ".concat(t))}e.default=function(t,e,r,n,i,c,h,l,d){var p=new a.default;if(p.flags=e("BF"),p.cramFlags=e("CF"),l>1&&-2===n.content.refSeqId?p.sequenceId=e("RI"):p.sequenceId=n.content.refSeqId,p.readLength=e("RL"),p.alignmentStart=e("AP"),r.APdelta&&(p.alignmentStart+=h.lastAlignmentStart),h.lastAlignmentStart=p.alignmentStart,p.readGroupId=e("RG"),r.readNamesIncluded&&(p.readName=f(e("RN"))),p.isDetached()){var g={};g.flags=e("MF"),r.readNamesIncluded||(g.readName=f(e("RN")),p.readName=g.readName),g.sequenceId=e("NS"),g.alignmentStart=e("NP"),(g.flags||g.sequenceId>-1)&&(p.mate=g),p.templateSize=e("TS"),g.flags&s.default.CRAM_M_UNMAP&&(p.flags|=s.default.BAM_FMUNMAP),g.flags&s.default.CRAM_M_REVERSE&&(p.flags|=s.default.BAM_FMREVERSE)}else p.hasMateDownStream()&&(p.mateRecordNumber=e("NF")+d+1);var y=e("TL");if(y<0)throw new o.CramMalformedError("invalid TL index");for(var v=r.getTagNames(y),m=v.length,b=0;b<m;b+=1){var _=v[b],w=_.substr(0,2),A=_.substr(2,1),S=r.getCodecForTag(_);if(!S)throw new o.CramMalformedError("no codec defined for auxiliary tag ".concat(_));var E=S.decode(t,i,c,h);p.tags[w]=u(A,E)}if(p.isSegmentUnmapped())if(p.isUnknownBases())p.readBases=null,p.qualityScores=null;else{for(k=new Array(p.readLength),b=0;b<k.length;b+=1)k[b]=e("BA");if(p.readBases=String.fromCharCode.apply(String,k),p.isPreservingQualityScores()){for(b=0;b<k.length;b+=1)k[b]=e("QS");p.qualityScores=k}}else{var C=e("FN");C&&(p.readFeatures=function(t,e,r,n,i){var a=0,s=t.alignmentStart-1,f=new Array(e);function u(t){var e=t[0],n=t[1],i=r(n);return"character"===e?String.fromCharCode(i):"string"===e?i.toString("utf8"):"numArray"===e?i.toArray():i}for(var c=0;c<e;c+=1){var h=String.fromCharCode(r("FC")),l=r("FP"),d={code:h},p={B:["character","BA"],S:["string",i>1?"SC":"IN"],X:["number","BS"],D:["number","DL"],I:["string","IN"],i:["character","BA"],b:["string","BB"],q:["numArray","QQ"],Q:["number","QS"],H:["number","HC"],P:["number","PD"],N:["number","RS"]}[h];if(!p)throw new o.CramMalformedError('invalid read feature code "'.concat(h,'"'));d.data=u(p);var g={B:["number","QS"]}[h];g&&(d.data=[d.data,u(g)]),a+=l,d.pos=a,s+=l,d.refPos=s,"D"===h||"N"===h?s+=d.data:"I"===h||"S"===h?s-=d.data.length:"i"===h&&(s-=1),f[c]=d}return f}(p,C,e,0,l));var B=p.readLength;if(p.readFeatures&&p.readFeatures.forEach((function(t){var e=t.code,r=t.data;"D"===e||"N"===e?B+=r:"I"===e||"S"===e?B-=r.length:"i"===e&&(B-=1)})),Number.isNaN(B)&&(console.warn("".concat(p.readName||"".concat(p.sequenceId,":").concat(p.alignmentStart)," record has invalid read features")),B=p.readLength),p.lengthOnRef=B,p.mappingQuality=e("MQ"),p.isPreservingQualityScores()){for(var k=new Array(p.readLength),b=0;b<k.length;b+=1)k[b]=e("QS");p.qualityScores=k}}return p}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(12));var o={a:0,A:0,c:1,C:1,g:2,G:2,t:3,T:3,n:4,N:4};var a=function(){function t(){this.tags={}}return t.prototype.isPaired=function(){return!!(this.flags&i.default.BAM_FPAIRED)},t.prototype.isProperlyPaired=function(){return!!(this.flags&i.default.BAM_FPROPER_PAIR)},t.prototype.isSegmentUnmapped=function(){return!!(this.flags&i.default.BAM_FUNMAP)},t.prototype.isMateUnmapped=function(){return!!(this.flags&i.default.BAM_FMUNMAP)},t.prototype.isReverseComplemented=function(){return!!(this.flags&i.default.BAM_FREVERSE)},t.prototype.isMateReverseComplemented=function(){return!!(this.flags&i.default.BAM_FMREVERSE)},t.prototype.isRead1=function(){return!!(this.flags&i.default.BAM_FREAD1)},t.prototype.isRead2=function(){return!!(this.flags&i.default.BAM_FREAD2)},t.prototype.isSecondary=function(){return!!(this.flags&i.default.BAM_FSECONDARY)},t.prototype.isFailedQc=function(){return!!(this.flags&i.default.BAM_FQCFAIL)},t.prototype.isDuplicate=function(){return!!(this.flags&i.default.BAM_FDUP)},t.prototype.isSupplementary=function(){return!!(this.flags&i.default.BAM_FSUPPLEMENTARY)},t.prototype.isDetached=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_DETACHED)},t.prototype.hasMateDownStream=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_MATE_DOWNSTREAM)},t.prototype.isPreservingQualityScores=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_PRESERVE_QUAL_SCORES)},t.prototype.isUnknownBases=function(){return!!(this.cramFlags&i.default.CRAM_FLAG_NO_SEQ)},t.prototype.getReadBases=function(){return!this.readBases&&this._refRegion&&(this.readBases=function(t,e){if((t.lengthOnRef||t.readLength)&&!t.isUnknownBases()){var r=t.alignmentStart-e.start;if(!t.readFeatures)return e.seq.substr(r,t.lengthOnRef).toUpperCase();for(var n="",i=r,o=0;n.length<t.readLength;)if(o<t.readFeatures.length){var a=t.readFeatures[o];if("Q"===a.code||"q"===a.code)o+=1;else if(a.pos===n.length+1)if(o+=1,"b"===a.code){var s=a.data.split(","),f=String.fromCharCode.apply(String,s);n+=f,i+=f.length}else"B"===a.code?(n+=a.data[0],i+=1):"X"===a.code?(n+=a.sub,i+=1):"I"===a.code?n+=a.data:"D"===a.code?i+=a.data:"i"===a.code?n+=a.data:"N"===a.code?i+=a.data:"S"===a.code?n+=a.data:"P"===a.code||a.code;else if(o<t.readFeatures.length){n+=u=e.seq.substr(i,t.readFeatures[o].pos-n.length-1),i+=u.length}}else{var u;n+=u=e.seq.substr(i,t.readLength-n.length),i+=u.length}return n.toUpperCase()}}(this,this._refRegion)),this.readBases},t.prototype.getPairOrientation=function(){if(!this.isSegmentUnmapped()&&this.isPaired()&&!this.isMateUnmapped()&&this.mate&&this.sequenceId===this.mate.sequenceId){var t=this.isReverseComplemented()?"R":"F",e=this.isMateReverseComplemented()?"R":"F",r=" ",n=" ";this.isRead1()?(r="1",n="2"):this.isRead2()&&(r="2",n="1");var i=[],o=this.templateLength||this.templateSize;return this.alignmentStart>this.mate.alignmentStart&&o>0&&(o=-o),o>0?(i[0]=t,i[1]=r,i[2]=e,i[3]=n):(i[2]=t,i[3]=r,i[0]=e,i[1]=n),i.join("")}return null},t.prototype.addReferenceSequence=function(t,e){this.readFeatures&&this.readFeatures.forEach((function(r){"X"===r.code&&function(t,e,r,n){if(e){var i=n.refPos-e.start,a=e.seq.charAt(i);a&&(n.ref=a);var s=o[a];void 0===s&&(s=4);var f=r.substitutionMatrix[s][n.data];f&&(n.sub=f)}}(0,t,e,r)})),!this.readBases&&t.start<=this.alignmentStart&&t.end>=this.alignmentStart+(this.lengthOnRef||this.readLength)-1&&(this._refRegion=t)},t.prototype.toJSON=function(){var t=this,e={};return Object.keys(this).forEach((function(r){"_"!==r.charAt(0)&&(e[r]=t[r])})),e.readBases=this.getReadBases(),e},t}();e.default=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(0),i=r(68),o={BF:"int",CF:"int",RI:"int",RL:"int",AP:"int",RG:"int",MF:"int",NS:"int",NP:"int",TS:"int",NF:"int",TC:"byte",TN:"int",FN:"int",FC:"byte",FP:"int",BS:"byte",IN:"byteArray",SC:"byteArray",DL:"int",BA:"byte",BB:"byteArray",RS:"int",PD:"int",HC:"int",MQ:"int",RN:"byteArray",QS:"byte",QQ:"byteArray",TL:"int",TM:"ignore",TV:"ignore"};var a=function(){function t(t){Object.assign(this,t),this.readNamesIncluded=t.preservation.RN,this.APdelta=t.preservation.AP,this.referenceRequired=!!t.preservation.RR,this.tagIdsDictionary=t.preservation.TD,this.substitutionMatrix=function(t){for(var e=new Array(5),r=0;r<5;r+=1)e[r]=new Array(4);return e[0][t[0]>>6&3]="C",e[0][t[0]>>4&3]="G",e[0][t[0]>>2&3]="T",e[0][t[0]>>0&3]="N",e[1][t[1]>>6&3]="A",e[1][t[1]>>4&3]="G",e[1][t[1]>>2&3]="T",e[1][t[1]>>0&3]="N",e[2][t[2]>>6&3]="A",e[2][t[2]>>4&3]="C",e[2][t[2]>>2&3]="T",e[2][t[2]>>0&3]="N",e[3][t[3]>>6&3]="A",e[3][t[3]>>4&3]="C",e[3][t[3]>>2&3]="G",e[3][t[3]>>0&3]="N",e[4][t[4]>>6&3]="A",e[4][t[4]>>4&3]="C",e[4][t[4]>>2&3]="G",e[4][t[4]>>0&3]="T",e}(t.preservation.SM),this.dataSeriesCodecCache=new Map,this.tagCodecCache={}}return t.prototype.getCodecForTag=function(t){if(!this.tagCodecCache[t]){var e=this.tagEncoding[t];e&&(this.tagCodecCache[t]=(0,i.instantiateCodec)(e,"byteArray"))}return this.tagCodecCache[t]},t.prototype.getTagNames=function(t){return this.tagIdsDictionary[t]},t.prototype.getCodecForDataSeries=function(t){var e=this.dataSeriesCodecCache.get(t);if(void 0===e){var r=this.dataSeriesEncoding[t];if(r){var a=o[t];if(!a)throw new n.CramMalformedError("data series name ".concat(t," not defined in file compression header"));e=(0,i.instantiateCodec)(r,a),this.dataSeriesCodecCache.set(t,e)}}return e},t.prototype.toJSON=function(){var t=this,e={};return Object.keys(this).forEach((function(r){/Cache$/.test(r)||(e[r]=t[r])})),e},t}();e.default=a},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.instantiateCodec=e.getCodecClassWithId=void 0;var i=r(0),o=n(r(69)),a=n(r(70)),s=n(r(71)),f=n(r(72)),u=n(r(73)),c=n(r(74)),h=n(r(75)),l={1:a.default,3:o.default,4:f.default,5:s.default,6:u.default,7:h.default,9:c.default};function d(t){return l[t]}e.getCodecClassWithId=d,e.instantiateCodec=function t(e,r){var n=d("ignore"===r?0:e.codecId);if(!n)throw new i.CramUnimplementedError("no codec implemented for codec ID ".concat(e.codecId));return new n(e.parameters,r,t)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0);var s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if(!["byte","int"].includes(n.dataType))throw new TypeError("".concat(n.dataType," decoding not yet implemented by HUFFMAN_INT codec"));return n.buildCodeBook(),n.buildCodes(),n.buildCaches(),0===n.sortedCodes[0].bitLength&&(n._decode=n._decodeZeroLengthCode),n}return i(e,t),e.prototype.buildCodeBook=function(){for(var t=this,e=new Array(this.parameters.numCodes),r=0;r<this.parameters.numCodes;r+=1)e[r]={symbol:this.parameters.symbols[r],bitLength:this.parameters.bitLengths[r]};e=e.sort((function(t,e){return t.bitLength-e.bitLength||t.symbol-e.symbol})),this.codeBook={},e.forEach((function(e){t.codeBook[e.bitLength]||(t.codeBook[e.bitLength]=[]),t.codeBook[e.bitLength].push(e.symbol)}))},e.prototype.buildCodes=function(){var t=this;this.codes={};var e=0,r=-1;Object.entries(this.codeBook).forEach((function(n){var i=n[0],o=n[1];i=parseInt(i,10),o.forEach((function(n){var o={bitLength:i,value:n};r+=1;var s,f,u=i-e;if(r<<=u,o.bitCode=r,e+=u,16843009*((f=(858993459&(f=(s=r)-(s>>1)&1431655765))+(f>>2&858993459))+(f>>4)&252645135)>>24>i)throw new a.CramMalformedError("Symbol out of range");t.codes[n]=o}))}))},e.prototype.buildCaches=function(){this.sortedCodes=Object.values(this.codes).sort((function(t,e){return t.bitLength-e.bitLength||t.bitCode-e.bitCode})),this.sortedByValue=Object.values(this.codes).sort((function(t,e){return t.value-e.value})),this.sortedValuesByBitCode=this.sortedCodes.map((function(t){return t.value})),this.sortedBitCodes=this.sortedCodes.map((function(t){return t.bitCode})),this.sortedBitLengthsByBitCode=this.sortedCodes.map((function(t){return t.bitLength}));var t=Math.max.apply(Math,this.sortedBitCodes);this.bitCodeToValue=new Array(t+1).fill(-1);for(var e=0;e<this.sortedBitCodes.length;e+=1)this.bitCodeToValue[this.sortedCodes[e].bitCode]=e},e.prototype.decode=function(t,e,r,n){return this._decode(t,e,n.coreBlock)},e.prototype._decodeZeroLengthCode=function(){return this.sortedCodes[0].value},e.prototype._decode=function(t,e,r){for(var n=e.content,i=0,o=0,s=0;s<this.sortedCodes.length;s+=1){var f=this.sortedCodes[s].bitLength;o<<=f-i,o|=this._getBits(n,r,f-i),i=f;var u=this.bitCodeToValue[o];if(u>-1&&this.sortedBitLengthsByBitCode[u]===f)return this.sortedValuesByBitCode[u];for(var c=s;this.sortedCodes[c+1].bitLength===f&&c<this.sortedCodes.length;c+=1)s+=1}throw new a.CramMalformedError("Huffman symbol not found.")},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=o(r(3)),f=r(5),u=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"===n.dataType)n._decodeData=n._decodeInt;else{if("byte"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by EXTERNAL codec"));n._decodeData=n._decodeByte}return n}return i(e,t),e.prototype.decode=function(t,e,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new a.CramMalformedError("no block found with content ID ".concat(i));var s=n.externalBlocks.getCursor(i);return this._decodeData(o,s)},e.prototype._decodeInt=function(t,e){var r=(0,f.parseItf8)(t.content,e.bytePosition),n=r[0],i=r[1];return e.bytePosition+=i,n},e.prototype._decodeByte=function(t,e){if(e.bytePosition>=t.content.length)throw new a.CramBufferOverrunError("attempted to read beyond end of block. this file seems truncated.");return t.content[e.bytePosition++]},e}(s.default);e.default=u},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("byteArray"!==r)throw new TypeError("byteArrayStop codec does not support data type ".concat(r));return n._decode=n._decodeByteArray,n}return i(e,t),e.prototype.decode=function(t,e,r,n){var i=this.parameters.blockContentId,o=r[i];if(!o)throw new a.CramMalformedError("no block found with content ID ".concat(i));var s=n.externalBlocks.getCursor(i);return this._decode(o,s)},e.prototype._decodeByteArray=function(t,e){for(var r=t.content,n=this.parameters.stopByte,i=e.bytePosition,o=e.bytePosition;r[o]!==n&&o<r.length;){if(o===r.length)throw new a.CramBufferOverrunError("byteArrayStop reading beyond length of data buffer?");o+=1}return e.bytePosition=o+1,r.slice(i,o)},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(5),s=function(t){function e(e,r,n){void 0===e&&(e={});var i=t.call(this,e,r)||this;if(i.instantiateCodec=n,"byteArray"!==r)throw new TypeError("byteArrayLength does not support data type ".concat(r));return i}return i(e,t),e.prototype.decode=function(t,e,r,n){for(var i=this._getLengthCodec().decode(t,e,r,n),o=this._getDataCodec(),a=new Uint8Array(i),s=0;s<i;s+=1)a[s]=o.decode(t,e,r,n);return a},e.prototype._getLengthCodec=function(){var t=this.parameters.lengthsEncoding;return this.instantiateCodec(t,"int")},e.prototype._getDataCodec=function(){var t=this.parameters.valuesEncoding;return this.instantiateCodec(t,"byte")},e}(o(r(3)).default);e.default=s,"_getLengthCodec _getDataCodec".split(" ").forEach((function(t){return(0,a.tinyMemoize)(s,t)}))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by BETA codec"));return n}return i(e,t),e.prototype.decode=function(t,e,r,n){return this._getBits(e.content,n.coreBlock,this.parameters.length)-this.parameters.offset},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by GAMMA codec"));return n}return i(e,t),e.prototype.decode=function(t,e,r,n){for(var i=1;0===this._getBits(e.content,n.coreBlock,1);)i+=1;return(this._getBits(e.content,n.coreBlock,i-1)|1<<i-1)-this.parameters.offset},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=function(t){function e(e,r){void 0===e&&(e={});var n=t.call(this,e,r)||this;if("int"!==n.dataType)throw new a.CramUnimplementedError("".concat(n.dataType," decoding not yet implemented by SUBEXP codec"));return n}return i(e,t),e.prototype.decode=function(t,e,r,n){for(var i,o,a=0;this._getBits(e.content,n.coreBlock,1);)a+=1;return 0===a?(i=this.parameters.K,o=this._getBits(e.content,n.coreBlock,i)):o=1<<(i=a+this.parameters.K-1)|this._getBits(e.content,n.coreBlock,i),o-this.parameters.offset},e}(o(r(3)).default);e.default=s},function(t,e,r){"use strict";var n=r(77),i=r(79);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){i.isString(t)&&(t=b(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,f=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),h=["%","/","?",";","#"].concat(c),l=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(80);function b(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o<t.indexOf("#")?"?":"#",u=t.split(s);u[0]=u[0].replace(/\\/g,"/");var b=t=u.join(s);if(b=b.trim(),!r&&1===t.split("#").length){var _=f.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=e?m.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var w=a.exec(b);if(w){var A=(w=w[0]).toLowerCase();this.protocol=A,b=b.substr(w.length)}if(r||w||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var S="//"===b.substr(0,2);!S||w&&y[w]||(b=b.substr(2),this.slashes=!0)}if(!y[w]&&(S||w&&!v[w])){for(var E,C,B=-1,k=0;k<l.length;k++){-1!==(R=b.indexOf(l[k]))&&(-1===B||R<B)&&(B=R)}-1!==(C=-1===B?b.lastIndexOf("@"):b.lastIndexOf("@",B))&&(E=b.slice(0,C),b=b.slice(C+1),this.auth=decodeURIComponent(E)),B=-1;for(k=0;k<h.length;k++){var R;-1!==(R=b.indexOf(h[k]))&&(-1===B||R<B)&&(B=R)}-1===B&&(B=b.length),this.host=b.slice(0,B),b=b.slice(B),this.parseHost(),this.hostname=this.hostname||"";var x="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!x)for(var M=this.hostname.split(/\./),T=(k=0,M.length);k<T;k++){var P=M[k];if(P&&!P.match(d)){for(var I="",O=0,F=P.length;O<F;O++)P.charCodeAt(O)>127?I+="x":I+=P[O];if(!I.match(d)){var U=M.slice(0,k),L=M.slice(k+1),N=P.match(p);N&&(U.push(N[1]),L.unshift(N[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=n.toASCII(this.hostname));var z=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+z,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!g[A])for(k=0,T=c.length;k<T;k++){var q=c[k];if(-1!==b.indexOf(q)){var j=encodeURIComponent(q);j===q&&(j=escape(q)),b=b.split(q).join(j)}}var H=b.indexOf("#");-1!==H&&(this.hash=b.substr(H),b=b.slice(0,H));var W=b.indexOf("?");if(-1!==W?(this.search=b.substr(W),this.query=b.substr(W+1),e&&(this.query=m.parse(this.query)),b=b.slice(0,W)):e&&(this.search="",this.query={}),b&&(this.pathname=b),v[A]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){z=this.pathname||"";var V=this.search||"";this.path=z+V}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=m.stringify(this.query));var s=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||v[e])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var f=Object.keys(t),u=0;u<f.length;u++){var c=f[u];"protocol"!==c&&(r[c]=t[c])}return v[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!v[t.protocol]){for(var h=Object.keys(t),l=0;l<h.length;l++){var d=h[l];r[d]=t[d]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||y[t.protocol])r.pathname=t.pathname;else{for(var p=(t.pathname||"").split("/");p.length&&!(t.host=p.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var g=r.pathname||"",m=r.search||"";r.path=g+m}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),_=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=_||b||r.host&&t.pathname,A=w,S=r.pathname&&r.pathname.split("/")||[],E=(p=t.pathname&&t.pathname.split("/")||[],r.protocol&&!v[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===p[0]?p[0]=t.host:p.unshift(t.host)),t.host=null),w=w&&(""===p[0]||""===S[0])),_)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,S=p;else if(p.length)S||(S=[]),S.pop(),S=S.concat(p),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search)){if(E)r.hostname=r.host=S.shift(),(x=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var C=S.slice(-1)[0],B=(r.host||t.host||S.length>1)&&("."===C||".."===C)||""===C,k=0,R=S.length;R>=0;R--)"."===(C=S[R])?S.splice(R,1):".."===C?(S.splice(R,1),k++):k&&(S.splice(R,1),k--);if(!w&&!A)for(;k--;k)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),B&&"/"!==S.join("/").substr(-1)&&S.push("");var x,M=""===S[0]||S[0]&&"/"===S[0].charAt(0);E&&(r.hostname=r.host=M?"":S.length?S.shift():"",(x=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=x.shift(),r.host=r.hostname=x.shift()));return(w=w||r.host&&S.length)&&!M&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){(function(t,n){var i;/*! https://mths.be/punycode v1.3.2 by @mathias */!function(o){e&&e.nodeType,t&&t.nodeType;var a="object"==typeof n&&n;a.global!==a&&a.window!==a&&a.self;var s,f=2147483647,u=/^xn--/,c=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,p=String.fromCharCode;function g(t){throw RangeError(l[t])}function y(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function v(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+y((t=t.replace(h,".")).split("."),e).join(".")}function m(t){for(var e,r,n=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function b(t){return y(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=p(t)})).join("")}function _(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function w(t,e,r){var n=0;for(t=r?d(t/700):t>>1,t+=d(t/e);t>455;n+=36)t=d(t/35);return d(n+36*t/(t+38))}function A(t){var e,r,n,i,o,a,s,u,c,h,l,p=[],y=t.length,v=0,m=128,_=72;for((r=t.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&g("not-basic"),p.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<y;){for(o=v,a=1,s=36;i>=y&&g("invalid-input"),((u=(l=t.charCodeAt(i++))-48<10?l-22:l-65<26?l-65:l-97<26?l-97:36)>=36||u>d((f-v)/a))&&g("overflow"),v+=u*a,!(u<(c=s<=_?1:s>=_+26?26:s-_));s+=36)a>d(f/(h=36-c))&&g("overflow"),a*=h;_=w(v-o,e=p.length+1,0==o),d(v/e)>f-m&&g("overflow"),m+=d(v/e),v%=e,p.splice(v++,0,m)}return b(p)}function S(t){var e,r,n,i,o,a,s,u,c,h,l,y,v,b,A,S=[];for(y=(t=m(t)).length,e=128,r=0,o=72,a=0;a<y;++a)(l=t[a])<128&&S.push(p(l));for(n=i=S.length,i&&S.push("-");n<y;){for(s=f,a=0;a<y;++a)(l=t[a])>=e&&l<s&&(s=l);for(s-e>d((f-r)/(v=n+1))&&g("overflow"),r+=(s-e)*v,e=s,a=0;a<y;++a)if((l=t[a])<e&&++r>f&&g("overflow"),l==e){for(u=r,c=36;!(u<(h=c<=o?1:c>=o+26?26:c-o));c+=36)A=u-h,b=36-h,S.push(p(_(h+A%b,0))),u=d(A/b);S.push(p(_(u,0))),o=w(r,v,n==i),r=0,++n}++r,++e}return S.join("")}s={version:"1.3.2",ucs2:{decode:m,encode:b},decode:A,encode:S,toASCII:function(t){return v(t,(function(t){return c.test(t)?"xn--"+S(t):t}))},toUnicode:function(t){return v(t,(function(t){return u.test(t)?A(t.slice(4).toLowerCase()):t}))}},void 0===(i=function(){return s}.call(e,r,e,t))||(t.exports=i)}()}).call(this,r(78)(t),r(9))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},function(t,e,r){"use strict";e.decode=e.parse=r(81),e.encode=e.stringify=r(82)},function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,o){e=e||"&",r=r||"=";var a={};if("string"!=typeof t||0===t.length)return a;var s=/\+/g;t=t.split(e);var f=1e3;o&&"number"==typeof o.maxKeys&&(f=o.maxKeys);var u=t.length;f>0&&u>f&&(u=f);for(var c=0;c<u;++c){var h,l,d,p,g=t[c].replace(s,"%20"),y=g.indexOf(r);y>=0?(h=g.substr(0,y),l=g.substr(y+1)):(h=g,l=""),d=decodeURIComponent(h),p=decodeURIComponent(l),n(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,s){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?o(a(t),(function(a){var s=encodeURIComponent(n(a))+r;return i(t[a])?o(t[a],(function(t){return s+encodeURIComponent(n(t))})).join(e):s+encodeURIComponent(n(t[a]))})).join(e):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var a=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e,r){"use strict";(function(t){var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(84)),s=o(r(85)),f=function(){function e(t){var e=this;this.position=0,this.url=t,this.cache=new s.default({fetch:function(t,r){return e._fetch(t,r)}})}return e.prototype._fetch=function(e,r){return n(this,void 0,void 0,(function(){var n,o,s,f,u,c;return i(this,(function(i){switch(i.label){case 0:return n={},r<1/0?n.range="bytes=".concat(e,"-").concat(e+r):r===1/0&&0!==e&&(n.range="bytes=".concat(e,"-")),[4,(0,a.default)(this.url,{method:"GET",headers:n,redirect:"follow",mode:"cors"})];case 1:return 200===(o=i.sent()).status&&0===e||206===o.status?(u=(f=t).from,[4,o.arrayBuffer()]):[3,3];case 2:return s=u.apply(f,[i.sent()]),(c=/\/(\d+)$/.exec(o.headers.get("content-range")))[1]&&(this._stat={size:parseInt(c[1],10)}),[2,s];case 3:throw new Error("HTTP ".concat(o.status," fetching ").concat(this.url))}}))}))},e.prototype.read=function(t,e,r,n){void 0===e&&(e=0),void 0===r&&(r=1/0),void 0===n&&(n=0);return null===n&&(this.position,this.position+=r),this.cache.get(t,e,r,n)},e.prototype.readFile=function(){return n(this,void 0,void 0,(function(){var e,r,n;return i(this,(function(i){switch(i.label){case 0:return[4,(0,a.default)(this.url,{method:"GET",redirect:"follow",mode:"cors"})];case 1:return e=i.sent(),n=(r=t).from,[4,e.arrayBuffer()];case 2:return[2,n.apply(r,[i.sent()])]}}))}))},e.prototype.stat=function(){return n(this,void 0,void 0,(function(){var e;return i(this,(function(r){switch(r.label){case 0:return this._stat?[3,2]:(e=t.allocUnsafe(10),[4,this.read(e,0,10,0)]);case 1:if(r.sent(),!this._stat)throw new Error("unable to determine size of file at ".concat(this.url));r.label=2;case 2:return[2,this._stat]}}))}))},e}();e.default=f}).call(this,r(1).Buffer)},function(t,e){var r="undefined"!=typeof self?self:this,n=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function c(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function g(t){var e=new FileReader,r=p(e);return e.readAsArrayBuffer(t),r}function y(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=y(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||f(t))?this._bodyArrayBuffer=y(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var t,e,r,n=d(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=p(e),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=u(t),e=c(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},l.prototype.delete=function(t){delete this.map[u(t)]},l.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},l.prototype.set=function(t,e){this.map[u(t)]=c(e)},l.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),h(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),h(t)},n&&(l.prototype[Symbol.iterator]=l.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){var r,n,i=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(r=e.method||this.method||"GET",n=r.toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function _(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function w(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},w.error=function(){var t=new w(null,{status:0,statusText:""});return t.type="error",t};var A=[301,302,303,307,308];w.redirect=function(t,e){if(-1===A.indexOf(e))throw new RangeError("Invalid status code");return new w(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function S(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new w(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",f),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",f)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=l,t.Request=b,t.Response=w),e.Headers=l,e.Request=b,e.Response=w,e.fetch=S,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(11)),s=function(){function t(t){var e=t.fetch,r=t.size,n=void 0===r?1e7:r,i=t.chunkSize,o=void 0===i?32768:i;if(!e)throw new Error("fetch function required");this.fetch=e,this.chunkSize=o,this.lruCache=new a.default({maxSize:Math.floor(n/o)})}return t.prototype.get=function(t,e,r,o){return n(this,void 0,void 0,(function(){var n,a,s,f,u,c,h,l,d=this;return i(this,(function(i){switch(i.label){case 0:if(t.length<e+r)throw new Error("output buffer not big enough for request");for(n=Math.floor(o/this.chunkSize),a=Math.floor((o+r)/this.chunkSize),s=new Array(a-n+1),f=function(t){s[t-n]=u._getChunk(t).then((function(e){return{data:e,chunkNumber:t}}))},u=this,c=n;c<=a;c+=1)f(c);return[4,Promise.all(s)];case 1:return h=i.sent(),l=o-h[0].chunkNumber*this.chunkSize,h.forEach((function(i){var s=i.data,f=i.chunkNumber,u=f*d.chunkSize,c=0,h=d.chunkSize,p=e+(f-n)*d.chunkSize-l;f===n&&(p=e,c=l),f===a&&(h=o+r-u),s.copy(t,p,c,h)})),[2]}}))}))},t.prototype._getChunk=function(t){var e=this.lruCache.get(t);if(e)return e;var r=this.fetch(t*this.chunkSize,this.chunkSize);return this.lruCache.set(t,r),r},t}();e.default=s},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseHeaderText=void 0,e.parseHeaderText=function(t){var e=t.split(/\r?\n/),r=[];return e.forEach((function(t){var e=t.split(/\t/),n=e[0],i=e.slice(1).map((function(t){var e=t.split(":",2);return{tag:e[0],value:e[1]}}));n&&r.push({tag:n.substr(1),data:i})})),r}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=o(r(16)),f=function(){function t(t){if(t.cram?this.cram=t.cram:this.cram=new s.default({url:t.cramUrl,path:t.cramPath,filehandle:t.cramFilehandle,seqFetch:t.seqFetch,checkSequenceMD5:t.checkSequenceMD5,cacheSize:t.cacheSize}),!(this.cram instanceof s.default))throw new Error("invalid arguments: no cramfile");if(this.index=t.index,!this.index.getEntriesForRange)throw new Error("invalid arguments: not an index");this.fetchSizeLimit=t.fetchSizeLimit||3e6}return t.prototype.getRecordsForRange=function(t,e,r,o){return void 0===o&&(o={}),n(this,void 0,void 0,(function(){var n,s,f,u,c,h,l,d,p,g,y,v,m,b,_,w,A,S,E,C,B,k,R,x=this;return i(this,(function(i){switch(i.label){case 0:if(o.viewAsPairs=o.viewAsPairs||!1,o.pairAcrossChr=o.pairAcrossChr||!1,o.maxInsertSize=o.maxInsertSize||2e5,"string"==typeof t)throw new a.CramUnimplementedError("string sequence names not yet supported");return n=t,[4,this.index.getEntriesForRange(n,e,r)];case 1:if(s=i.sent(),(f=s.map((function(t){return t.sliceBytes})).reduce((function(t,e){return t+e}),0))>this.fetchSizeLimit)throw new a.CramSizeLimitError("data size of ".concat(f.toLocaleString()," bytes exceeded fetch size limit of ").concat(this.fetchSizeLimit.toLocaleString()," bytes"));return u=function(n){return n.sequenceId===t&&n.alignmentStart<=r&&n.alignmentStart+n.lengthOnRef-1>=e},[4,Promise.all(s.map((function(t){return x.getRecordsInSlice(t,u)})))];case 2:if(c=i.sent(),h=(R=Array.prototype).concat.apply(R,c),!o.viewAsPairs)return[3,5];for(l={},d={},A=0;A<h.length;A+=1)p=h[A].readName,g=h[A].uniqueId,l[p]||(l[p]=0),l[p]+=1,d[g]=1;for(y={},Object.entries(l).forEach((function(t){var e=t[0];1===t[1]&&(y[e]=!0)})),v=[],A=0;A<h.length;A+=1)m=h[A].readName,y[m]&&h[A].mate&&(h[A].mate.sequenceId===n||o.pairAcrossChr)&&Math.abs(h[A].alignmentStart-h[A].mate.alignmentStart)<o.maxInsertSize&&(b=this.index.getEntriesForRange(h[A].mate.sequenceId,h[A].mate.alignmentStart,h[A].mate.alignmentStart+1),v.push(b));return[4,Promise.all(v)];case 3:for(_=i.sent(),w=[],A=0;A<_.length;A+=1)w.push.apply(w,_[A]);if(w=w.sort((function(t,e){return t.toString().localeCompare(e.toString())})).filter((function(t,e,r){return!e||t.toString()!==r[e-1].toString()})),S=[],E=[],(C=w.map((function(t){return t.sliceBytes})).reduce((function(t,e){return t+e}),0))>this.fetchSizeLimit)throw new Error("mate data size of ".concat(C.toLocaleString()," bytes exceeded fetch size limit of ").concat(this.fetchSizeLimit.toLocaleString()," bytes"));return w.forEach((function(t){var e=x.cram.featureCache.get(t.toString());e||(e=x.getRecordsInSlice(t,(function(){return!0})),x.cram.featureCache.set(t.toString(),e)),S.push(e);var r=e.then((function(t){for(var e=[],r=0;r<t.length;r+=1){var n=t[r];y[n.readName]&&!d[n.uniqueId]&&e.push(n)}return e}));E.push(r)})),[4,Promise.all(E)];case 4:(B=i.sent()).length&&(k=B.reduce((function(t,e){return t.concat(e)})),h=h.concat(k)),i.label=5;case 5:return[2,h]}}))}))},t.prototype.getRecordsInSlice=function(t,e){var r=t.containerStart,n=t.sliceStart,i=t.sliceBytes;return this.cram.getContainerAtPosition(r).getSlice(n,i).getRecords(e)},t.prototype.hasDataForReferenceSequence=function(t){return this.index.hasDataForReferenceSequence(t)},t}();e.default=f},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{f(n.next(t))}catch(t){o(t)}}function s(t){try{f(n.throw(t))}catch(t){o(t)}}function f(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}f((n=n.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=o(r(90)),s=o(r(11)),f=r(17),u=r(29),c=r(0),h=function(){function t(t){Object.assign(this,t)}return t.prototype.toString=function(){return"".concat(this.start,":").concat(this.span,":").concat(this.containerStart,":").concat(this.sliceStart,":").concat(this.sliceBytes)},t}();function l(t,e){if(e.some((function(t){return void 0===t})))throw new c.CramMalformedError("invalid .crai index file");var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5];t[r]||(t[r]=[]),t[r].push(new h({start:n,span:i,containerStart:o,sliceStart:a,sliceBytes:s}))}var d=function(){function t(t){var e=this,r=(0,u.open)(t.url,t.path,t.filehandle);this._parseCache=new a.default({cache:new s.default({maxSize:1}),fill:function(t,r){return e.parseIndex({signal:r})}}),this.readFile=r.readFile.bind(r)}return t.prototype.parseIndex=function(){var t={};return this.readFile().then((function(t){return 31===t[0]&&139===t[1]?(0,f.unzip)(t):t})).then((function(e){if(e.length>4&&21578050===e.readUInt32LE(0))throw new c.CramMalformedError("invalid .crai index file. note: file appears to be a .bai index. this is technically legal but please open a github issue if you need support");for(var r=[],n="",i=0;i<e.length;i+=1){var o=e[i];if(o>=48&&o<=57||!n&&45===o)n+=String.fromCharCode(o);else if(9===o)r.push(Number.parseInt(n,10)),n="";else if(10===o)r.push(Number.parseInt(n,10)),n="",l(t,r),r=[];else if(13!==o&&32!==o)throw new c.CramMalformedError("invalid .crai index file")}return n&&r.push(Number.parseInt(n,10)),6===r.length&&l(t,r),Object.entries(t).forEach((function(e){var r=e[0],n=e[1];t[r]=n.sort((function(t,e){return t.start-e.start||t.span-e.span}))})),t}))},t.prototype.getIndex=function(t){return void 0===t&&(t={}),this._parseCache.get("index",null,t.signal)},t.prototype.hasDataForReferenceSequence=function(t){return n(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.getIndex()];case 1:return[2,!!e.sent()[t]]}}))}))},t.prototype.getEntriesForRange=function(t,e,r){return n(this,void 0,void 0,(function(){var n,o,a,s;return i(this,(function(i){switch(i.label){case 0:return[4,this.getIndex()];case 1:if(!(n=i.sent()[t]))return[2,[]];for(o=function(t){var n=t.start,i=t.start+t.span;return n>r?-1:i<=e?1:0},a=[],s=0;s<n.length;s+=1)0===o(n[s])&&a.push(n[s]);return[2,a]}}))}))},t}();e.default=d},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(91)).default;e.default=i},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(92)),o=n(r(13)),a=n(r(14)),s=n(r(15)),f=r(30),u=n(r(94)),c=n(r(95)),h=function(){function t(e){var r=e.fill,n=e.cache;if((0,o.default)(this,t),(0,s.default)(this,"cache",void 0),(0,s.default)(this,"fillCallback",void 0),"function"!=typeof r)throw new TypeError("must pass a fill function");if("object"!==(0,i.default)(n))throw new TypeError("must pass a cache object");if("function"!=typeof n.get||"function"!=typeof n.set||"function"!=typeof n.delete)throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=n,this.fillCallback=r}return(0,a.default)(t,[{key:"evict",value:function(t,e){this.cache.get(t)===e&&this.cache.delete(t)}},{key:"fill",value:function(t,e,r,n){var i=this,o=new u.default,a=new c.default;a.addCallback(n);var s={aborter:o,promise:this.fillCallback(e,o.signal,(function(t){a.callback(t)})),settled:!1,statusReporter:a,get aborted(){return this.aborter.signal.aborted}};s.aborter.addSignal(r),s.aborter.signal.addEventListener("abort",(function(){s.settled||i.evict(t,s)})),s.promise.then((function(){s.settled=!0}),(function(e){s.settled=!0,i.evict(t,s)})).catch((function(t){throw console.error(t),t})),this.cache.set(t,s)}},{key:"has",value:function(t){return this.cache.has(t)}},{key:"get",value:function(e,r,n,i){if(!n&&r instanceof f.AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");var o=this.cache.get(e);return o?o.aborted&&!o.settled?(this.evict(e,o),this.get(e,r,n,i)):o.settled?o.promise:(o.aborter.addSignal(n),o.statusReporter.addCallback(i),t.checkSinglePromise(o.promise,n)):(this.fill(e,r,n,i),t.checkSinglePromise(this.cache.get(e).promise,n))}},{key:"delete",value:function(t){var e=this.cache.get(t);e&&(e.settled||e.aborter.abort(),this.cache.delete(t))}},{key:"clear",value:function(){for(var t=this.cache.keys(),e=0,r=t.next();!r.done;r=t.next())this.delete(r.value),e+=1;return e}}],[{key:"isAbortException",value:function(t){return"AbortError"===t.name||"ERR_ABORTED"===t.code||"AbortError: aborted"===t.message||"Error: aborted"===t.message}},{key:"checkSinglePromise",value:function(t,e){function r(){if(e&&e.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return t.then((function(t){return r(),t}),(function(t){throw r(),t}))}}]),t}();e.default=h},function(t,e){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function o(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),t}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?f(t):e}function c(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=a(t);if(e){var i=a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return u(this,r)}}function h(t,e,r){return(h="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,r){var n=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=a(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(r):i.value}})(t,e,r||t)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(){n(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return o(t,[{key:"addEventListener",value:function(t,e,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:e,options:r})}},{key:"removeEventListener",value:function(t,e){if(t in this.listeners)for(var r=this.listeners[t],n=0,i=r.length;n<i;n++)if(r[n].callback===e)return void r.splice(n,1)}},{key:"dispatchEvent",value:function(t){if(t.type in this.listeners){for(var e=this.listeners[t.type].slice(),r=0,n=e.length;r<n;r++){var i=e[r];try{i.callback.call(this,t)}catch(t){Promise.resolve().then((function(){throw t}))}i.options&&i.options.once&&this.removeEventListener(t.type,i.callback)}return!t.defaultPrevented}}}]),t}(),d=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}(r,t);var e=c(r);function r(){var t;return n(this,r),(t=e.call(this)).listeners||l.call(f(t)),Object.defineProperty(f(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(f(t),"onabort",{value:null,writable:!0,configurable:!0}),t}return o(r,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(t){"abort"===t.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,t)),h(a(r.prototype),"dispatchEvent",this).call(this,t)}}]),r}(l),p=function(){function t(){n(this,t),Object.defineProperty(this,"signal",{value:new d,writable:!0,configurable:!0})}return o(t,[{key:"abort",value:function(){var t;try{t=new Event("abort")}catch(e){"undefined"!=typeof document?document.createEvent?(t=document.createEvent("Event")).initEvent("abort",!1,!1):(t=document.createEventObject()).type="abort":t={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(t)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(p.prototype[Symbol.toStringTag]="AbortController",d.prototype[Symbol.toStringTag]="AbortSignal"),e.AbortController=p,e.AbortSignal=d,e.abortableFetch=function(t){"function"==typeof t&&(t={fetch:t});var e=t,r=e.fetch,n=e.Request,i=void 0===n?r.Request:n,o=e.AbortController,a=e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,s=void 0!==a&&a;if(!function(t){return t.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):"function"==typeof t.Request&&!t.Request.prototype.hasOwnProperty("signal")||!t.AbortController}({fetch:r,Request:i,AbortController:o,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:r,Request:f};var f=i;(f&&!f.prototype.hasOwnProperty("signal")||s)&&((f=function(t,e){var r;e&&e.signal&&(r=e.signal,delete e.signal);var n=new i(t,e);return r&&Object.defineProperty(n,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),n}).prototype=i.prototype);var u=r;return{fetch:function(t,e){var r=f&&f.prototype.isPrototypeOf(t)?t.signal:e?e.signal:void 0;if(r){var n;try{n=new DOMException("Aborted","AbortError")}catch(t){(n=new Error("Aborted")).name="AbortError"}if(r.aborted)return Promise.reject(n);var i=new Promise((function(t,e){r.addEventListener("abort",(function(){return e(n)}),{once:!0})}));return e&&e.signal&&delete e.signal,Promise.race([i,u(t,e)])}return u(t,e)},Request:f}}},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(14)),o=n(r(15)),a=n(r(13)),s=r(30),f=function t(){(0,a.default)(this,t)},u=function(){function t(){(0,a.default)(this,t),(0,o.default)(this,"signals",new Set),(0,o.default)(this,"abortController",new s.AbortController)}return(0,i.default)(t,[{key:"addSignal",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new f;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",(function(){t.handleAborted(e)}))}},{key:"handleAborted",value:function(t){this.signals.delete(t),0===this.signals.size&&this.abortController.abort()}},{key:"abort",value:function(){this.abortController.abort()}},{key:"signal",get:function(){return this.abortController.signal}}]),t}();e.default=u},function(t,e,r){"use strict";var n=r(8);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(r(13)),o=n(r(14)),a=n(r(15)),s=function(){function t(){(0,i.default)(this,t),(0,a.default)(this,"callbacks",new Set),(0,a.default)(this,"currentMessage",void 0)}return(0,o.default)(t,[{key:"addCallback",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};this.callbacks.add(t),t(this.currentMessage)}},{key:"callback",value:function(t){this.currentMessage=t,this.callbacks.forEach((function(e){e(t)}))}}]),t}();e.default=s}]);
|
package/esm/craiIndex.js
CHANGED
|
@@ -138,7 +138,7 @@ export default class CraiIndex {
|
|
|
138
138
|
const compare = entry => {
|
|
139
139
|
const entryStart = entry.start;
|
|
140
140
|
const entryEnd = entry.start + entry.span;
|
|
141
|
-
if (entryStart
|
|
141
|
+
if (entryStart > queryEnd) {
|
|
142
142
|
return -1;
|
|
143
143
|
} // entry is ahead of query
|
|
144
144
|
if (entryEnd <= queryStart) {
|
package/esm/craiIndex.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"craiIndex.js","sourceRoot":"","sources":["../src/craiIndex.js"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;AAC3D,OAAO,QAAQ,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAE7C,MAAM,SAAS,GAAG,QAAQ,CAAA,CAAC,QAAQ;AAEnC,MAAM,KAAK;IACT,YAAY,IAAI;QACd,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC3B,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,EAAE,CAAA;IAClG,CAAC;CACF;AAED,SAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM;IACrC,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,SAAS,CAAC,EAAE;QACvC,MAAM,IAAI,kBAAkB,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AE,QAAQ;QAClD,MAAM,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAA;QACjD,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,EAAE,CAAA;SACV;QAED,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE;YACtB,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAA;YAC9B,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAA;YACzC,IAAI,UAAU,GAAG,QAAQ,EAAE;gBACzB,OAAO,CAAC,CAAC,CAAA;aACV,CAAC,0BAA0B;YAC5B,IAAI,QAAQ,IAAI,UAAU,EAAE;gBAC1B,OAAO,CAAC,CAAA;aACT,CAAC,wBAAwB;YAC1B,OAAO,CAAC,CAAA,CAAC,uBAAuB;QAClC,CAAC,CAAA;QACD,MAAM,IAAI,GAAG,EAAE,CAAA;QACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;YAC7C,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE;gBAChC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;aACzB;SACF;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
package/package.json
CHANGED
package/src/craiIndex.js
CHANGED
|
@@ -161,7 +161,7 @@ export default class CraiIndex {
|
|
|
161
161
|
const compare = entry => {
|
|
162
162
|
const entryStart = entry.start
|
|
163
163
|
const entryEnd = entry.start + entry.span
|
|
164
|
-
if (entryStart
|
|
164
|
+
if (entryStart > queryEnd) {
|
|
165
165
|
return -1
|
|
166
166
|
} // entry is ahead of query
|
|
167
167
|
if (entryEnd <= queryStart) {
|