>>24,m=O>>>16&255,b=65535&O,!(v<=s);){if(0===u)break e;u--,l+=n[i++]<>>=v,s-=v,r.lens[r.have++]=b;else{if(16===b){for(P=v+2;s>>=v,s-=v,0===r.have){e.msg="invalid bit length repeat",r.mode=Qt;break}A=r.lens[r.have-1],d=3+(3&l),l>>>=2,s-=2}else if(17===b){for(P=v+3;s
>>=v,s-=v,A=0,d=3+(7&l),l>>>=3,s-=3}else{for(P=v+7;s
>>=v,s-=v,A=0,d=11+(127&l),l>>>=7,s-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Qt;break}for(;d--;)r.lens[r.have++]=A}}if(r.mode===Qt)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Qt;break}if(r.lenbits=9,j={bits:r.lenbits},x=Pt(1,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,x){e.msg="invalid literal/lengths set",r.mode=Qt;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},x=Pt(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,x){e.msg="invalid distances set",r.mode=Qt;break}if(r.mode=Vt,t===_t)break e;case Vt:r.mode=Wt;case Wt:if(u>=6&&c>=258){e.next_out=a,e.avail_out=c,e.next_in=i,e.avail_in=u,r.hold=l,r.bits=s,At(e,p),a=e.next_out,o=e.output,c=e.avail_out,i=e.next_in,n=e.input,u=e.avail_in,l=r.hold,s=r.bits,r.mode===Gt&&(r.back=-1);break}for(r.back=0;O=r.lencode[l&(1<>>24,m=O>>>16&255,b=65535&O,!(v<=s);){if(0===u)break e;u--,l+=n[i++]<>g)],v=O>>>24,m=O>>>16&255,b=65535&O,!(g+v<=s);){if(0===u)break e;u--,l+=n[i++]<>>=g,s-=g,r.back+=g}if(l>>>=v,s-=v,r.back+=v,r.length=b,0===m){r.mode=16205;break}if(32&m){r.back=-1,r.mode=Gt;break}if(64&m){e.msg="invalid literal/length code",r.mode=Qt;break}r.extra=15&m,r.mode=16201;case 16201:if(r.extra){for(P=r.extra;s>>=r.extra,s-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;O=r.distcode[l&(1<>>24,m=O>>>16&255,b=65535&O,!(v<=s);){if(0===u)break e;u--,l+=n[i++]<>g)],v=O>>>24,m=O>>>16&255,b=65535&O,!(g+v<=s);){if(0===u)break e;u--,l+=n[i++]<>>=g,s-=g,r.back+=g}if(l>>>=v,s-=v,r.back+=v,64&m){e.msg="invalid distance code",r.mode=Qt;break}r.offset=b,r.extra=15&m,r.mode=16203;case 16203:if(r.extra){for(P=r.extra;s>>=r.extra,s-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Qt;break}r.mode=16204;case 16204:if(0===c)break e;if(d=p-c,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Qt;break}d>r.wnext?(d-=r.wnext,h=r.wsize-d):h=r.wnext-d,d>r.length&&(d=r.length),y=r.window}else y=o,h=a-r.offset,d=r.length;d>c&&(d=c),c-=d,r.length-=d;do{o[a++]=y[h++]}while(--d);0===r.length&&(r.mode=Wt);break;case 16205:if(0===c)break e;o[a++]=r.length,c--,r.mode=Wt;break;case qt:if(r.wrap){for(;s<32;){if(0===u)break e;u--,l|=n[i++]<{if(Kt(e))return Mt;let t=e.state;return t.window&&(t.window=null),e.state=null,Lt},inflateGetHeader:(e,t)=>{if(Kt(e))return Mt;const r=e.state;return 0==(2&r.wrap)?Mt:(r.head=t,t.done=!1,Lt)},inflateSetDictionary:(e,t)=>{const r=t.length;let n,o,i;return Kt(e)?Mt:(n=e.state,0!==n.wrap&&n.mode!==zt?Mt:n.mode===zt&&(o=1,o=ee(o,t,r,0),o!==n.check)?Rt:(i=ir(e,t,r,r),i?(n.mode=16210,Nt):(n.havedict=1,Lt)))},inflateInfo:"pako inflate (from Nodeca project)"},ur=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const cr=Object.prototype.toString,{Z_NO_FLUSH:lr,Z_FINISH:sr,Z_OK:fr,Z_STREAM_END:pr,Z_NEED_DICT:dr,Z_STREAM_ERROR:hr,Z_DATA_ERROR:yr,Z_MEM_ERROR:vr}=oe;function mr(e){this.options=nt.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ut,this.strm.avail_out=0;let r=ar.inflateInit2(this.strm,t.windowBits);if(r!==fr)throw new Error(ne[r]);if(this.header=new ur,ar.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=at.string2buf(t.dictionary):"[object ArrayBuffer]"===cr.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=ar.inflateSetDictionary(this.strm,t.dictionary),r!==fr)))throw new Error(ne[r])}function br(e,t){const r=new mr(t);if(r.push(e),r.err)throw r.msg||ne[r.err];return r.result}mr.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,o=this.options.dictionary;let i,a,u;if(this.ended)return!1;for(a=t===~~t?t:!0===t?sr:lr,"[object ArrayBuffer]"===cr.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),i=ar.inflate(r,a),i===dr&&o&&(i=ar.inflateSetDictionary(r,o),i===fr?i=ar.inflate(r,a):i===yr&&(i=dr));r.avail_in>0&&i===pr&&r.state.wrap>0&&0!==e[r.next_in];)ar.inflateReset(r),i=ar.inflate(r,a);switch(i){case hr:case yr:case dr:case vr:return this.onEnd(i),this.ended=!0,!1}if(u=r.avail_out,r.next_out&&(0===r.avail_out||i===pr))if("string"===this.options.to){let e=at.utf8border(r.output,r.next_out),t=r.next_out-e,o=at.buf2string(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(o)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(i!==fr||0!==u){if(i===pr)return i=ar.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},mr.prototype.onData=function(e){this.chunks.push(e)},mr.prototype.onEnd=function(e){e===fr&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=nt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var gr={Inflate:mr,inflate:br,inflateRaw:function(e,t){return(t=t||{}).raw=!0,br(e,t)},ungzip:br,constants:oe};const{Deflate:wr,deflate:Sr,deflateRaw:Ar,gzip:xr}=wt,{Inflate:Or,inflate:Er,inflateRaw:jr,ungzip:Pr}=gr;var kr=jr;function Cr(e){return Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cr(e)}function _r(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;t&&r&&Number(a.offset)-r<=2e3?(t.length=BigInt(Number(t.length)+Number(a.length)-r+Number(a.offset)),t.blocks.push(a)):o.push(t={blocks:[a],length:a.length,offset:a.offset}),r=Number(t.offset)+Number(t.length)}}catch(e){i.e(e)}finally{i.f()}return o}function Fr(e){if(e&&e.aborted){if("undefined"==typeof DOMException){var t=new Rr("aborted");throw t.code="ERR_ABORTED",t}throw new DOMException("aborted","AbortError")}}function Dr(e){return Dr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dr(e)}function Br(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zr(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Ur(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function Vr(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function Wr(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Vr(i,n,o,a,u,"next",e)}function u(e){Vr(i,n,o,a,u,"throw",e)}a(void 0)}))}}function qr(e,t){for(var r=0;r=r}var Kr=function(){function e(t,r,n,i,a,u){var c,l=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bbi=t,this.refsByName=r,this.cirTreeOffset=n,this.isBigEndian=i,this.isCompressed=a,this.blockType=u,this.featureCache=new(d())({cache:new(y())({maxSize:1e3}),fill:(c=Wr(Hr().mark((function e(t,r){var n,i,a,u;return Hr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Number(t.length),i=Number(t.offset),e.next=4,l.bbi.read(o.Buffer.alloc(n),0,n,i,{signal:r});case 4:return a=e.sent,u=a.buffer,e.abrupt("return",u);case 7:case"end":return e.stop()}}),e)}))),function(e,t){return c.apply(this,arguments)})}),!(n>=0))throw new Error("invalid cirTreeOffset!");var s=function(e){var t=e?"big":"little",r=(new f).endianess(t).uint32("chromId").uint32("start").uint32("end").uint32("validCnt").floatle("minScore").floatle("maxScore").floatle("sumData").floatle("sumSqData").saveOffset("offset"),n=(new f).endianess(t).uint8("isLeaf").skip(1).uint16("cnt").choice({tag:"isLeaf",choices:{1:(new f).endianess(t).array("blocksToFetch",{length:"cnt",type:(new f).endianess(t).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").uint64("blockSize").saveOffset("offset")}),0:(new f).array("recurOffsets",{length:"cnt",type:(new f).endianess(t).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").saveOffset("offset")})}}),o=(new f).endianess(t).uint32("chromId").int32("start").int32("end").string("rest",{zeroTerminated:!0}).saveOffset("offset");return{bigWigParser:(new f).endianess(t).skip(4).int32("blockStart").skip(4).uint32("itemStep").uint32("itemSpan").uint8("blockType").skip(1).uint16("itemCount").choice({tag:"blockType",choices:Qr(Qr(Qr({},3,(new f).array("items",{length:"itemCount",type:(new f).floatle("score")})),2,(new f).array("items",{length:"itemCount",type:(new f).endianess(t).int32("start").floatle("score")})),1,(new f).array("items",{length:"itemCount",type:(new f).endianess(t).int32("start").int32("end").floatle("score")}))}),bigBedParser:o,summaryParser:r,leafParser:n}}(i);this.leafParser=s.leafParser,this.bigBedParser=s.bigBedParser}var t,r,n,i;return t=e,r=[{key:"readWigData",value:(i=Wr(Hr().mark((function e(t,r,n,i,a){var u,c,l,s,f,p,d,h,y,v,m,b,g,S,A,x=this;return Hr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,u=this.refsByName,c=this.bbi,l=this.cirTreeOffset,s=this.isBigEndian,void 0===(f=u[t])&&i.complete(),p={chrId:f,start:r,end:n},this.cirTreePromise||(this.cirTreePromise=c.read(o.Buffer.alloc(48),0,48,Number(l),a)),e.next=8,this.cirTreePromise;case 8:return d=e.sent,h=d.buffer,y=s?h.readUInt32BE(4):h.readUInt32LE(4),v=[],m=0,b=function(e,t,r){try{var n=e.subarray(t),o=x.leafParser.parse(n);if(o.blocksToFetch&&(v=v.concat(o.blocksToFetch.filter((function(e){return g(e)})).map((function(e){return{offset:e.blockOffset,length:e.blockSize}})))),o.recurOffsets){var a=o.recurOffsets.filter((function(e){return g(e)})).map((function(e){return Number(e.blockOffset)}));a.length>0&&A(a,r+1)}}catch(e){i.error(e)}},g=function(e){var t=e.startChrom,o=e.startBase,i=e.endChrom,a=e.endBase;return(tf||i===f&&a>=r)},S=function(){var e=Wr(Hr().mark((function e(t,r,n){var o,u,c,l,s,f;return Hr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=r.max()-r.min(),u=r.min(),e.next=5,x.featureCache.get("".concat(o,"_").concat(u),{length:o,offset:u},null==a?void 0:a.signal);case 5:c=e.sent,l=Gr(t);try{for(l.s();!(s=l.n()).done;)f=s.value,r.contains(f)&&(b(c,f-u,n),0==(m-=1)&&x.readFeatures(i,v,zr(zr({},a),{},{request:p})))}catch(e){l.e(e)}finally{l.f()}e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),i.error(e.t0);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t,r,n){return e.apply(this,arguments)}}(),A=function(e,t){try{m+=e.length;for(var r=4+32*Number(y),n=new w(e[0],e[0]+r),o=1;o2&&void 0!==s[2]?s[2]:{},e.prev=1,o=this.blockType,i=this.isCompressed,a=n.signal,u=n.request,c=Nr(r),Fr(a),e.next=8,Promise.all(c.map(function(){var e=Wr(Hr().mark((function e(r){var n,c,s,f,p,d,h,y;return Hr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Fr(a),n=r.length,c=r.offset,e.next=4,l.featureCache.get("".concat(n,"_").concat(c),r,a);case 4:s=e.sent,f=Gr(r.blocks),e.prev=6,f.s();case 8:if((p=f.n()).done){e.next=27;break}d=p.value,Fr(a),h=Number(d.offset)-Number(r.offset),y=s,i&&(v=s.subarray(h),y=kr(v.subarray(2)),h=0),Fr(a),e.t0=o,e.next="summary"===e.t0?18:"bigwig"===e.t0?20:"bigbed"===e.t0?22:24;break;case 18:return t.next(l.parseSummaryBlock(y,h,u)),e.abrupt("break",25);case 20:return t.next(l.parseBigWigBlock(y,h,u)),e.abrupt("break",25);case 22:return t.next(l.parseBigBedBlock(y,h,256*Number(d.offset),u)),e.abrupt("break",25);case 24:console.warn("Don't know what to do with ".concat(o));case 25:e.next=8;break;case 27:e.next=32;break;case 29:e.prev=29,e.t1=e.catch(6),f.e(e.t1);case 32:return e.prev=32,f.f(),e.finish(32);case 35:case"end":return e.stop()}var v}),e,null,[[6,29,32,35]])})));return function(t){return e.apply(this,arguments)}}()));case 8:t.complete(),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),t.error(e.t0);case 14:case"end":return e.stop()}}),e,this,[[1,11]])}))),function(e,t){return n.apply(this,arguments)})}],r&&qr(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Jr=r(39962),Xr=r(19157),Zr=r(69191),en=r(83809);function tn(e){return tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tn(e)}function rn(){rn=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),u=new _(n||[]);return o(a,"_invoke",{value:j(e,r,u)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",v={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(L([])));A&&A!==r&&n.call(A,a)&&(w=A);var x=g.prototype=m.prototype=Object.create(w);function O(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,u){var c=f(e[o],e,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==tn(s)&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?y:d,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function nn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function on(e){for(var t=1;t1&&void 0!==y[1]?y[1]:2e3,e.next=3,this.bbi.read(o.Buffer.alloc(r),0,r,0,t);case 3:if(n=e.sent,i=n.buffer,a=this._isBigEndian(i),u=pn(a),c=u.headerParser.parse(i),l=c.magic,s=c.asOffset,f=c.totalSummaryOffset,c.fileType=l===fn?"bigbed":"bigwig",!(s>r||f>r)){e.next=12;break}return e.abrupt("return",this._getMainHeader(t,2*r));case 12:if(s&&(p=Number(c.asOffset),c.autoSql=(v=i.subarray(p,i.indexOf(0,p)),(new TextDecoder).decode(v))),!(c.totalSummaryOffset>r-40)){e.next=15;break}return e.abrupt("return",this._getMainHeader(t,2*r));case 15:return c.totalSummaryOffset&&(d=i.subarray(Number(c.totalSummaryOffset)),h=u.totalSummaryParser.parse(d),c.totalSummary=on(on({},h),{},{basesCovered:Number(h.basesCovered)})),e.abrupt("return",on(on({},c),{},{isBigEndian:a}));case 17:case"end":return e.stop()}var v}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"_isBigEndian",value:function(e){var t=e.readInt32LE(0);if(t===sn||t===fn)return!1;if((t=e.readInt32BE(0))===sn||t===fn)return!0;throw new Error("not a BigWig/BigBed file")}},{key:"_readChromTree",value:(u=un(rn().mark((function e(t,r){var n,i,a,u,c,l,s,p,d,h,y,v,m,b,g,w=this;return rn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=t.isBigEndian,i=n?"big":"little",a=[],u={},c=Number(t.unzoomedDataOffset),l=Number(t.chromTreeOffset);c%4!=0;)c+=1;return s=c-l,e.next=10,this.bbi.read(o.Buffer.alloc(s),0,s,Number(l),r);case 10:return p=e.sent,d=p.buffer,h=pn(n),y=h.chromTreeParser.parse(d),v=y.keySize,m=(new f).endianess(i).string("key",{stripNull:!0,length:v}).uint32("refId").uint32("refSize").saveOffset("offset"),b=(new f).endianess(i).skip(v).uint64("childOffset").saveOffset("offset"),g=function(){var e=un(rn().mark((function e(t){var r,n,o,i,c,s,f,p,y,v,S,A,x,O;return rn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((r=t)>=d.length)){e.next=3;break}throw new Error("reading beyond end of buffer");case 3:if(n=h.isLeafNode.parse(d.subarray(r)),o=n.isLeafNode,i=n.cnt,r+=n.offset,!o){e.next=10;break}for(c=0;c0,u));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"getFeatureStream",value:(i=un(rn().mark((function e(t,r,n,o){var i,a,u,c,l;return rn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getHeader(o);case 2:if(i=this.renameRefSeqs(t),c=(u=o||{}).basesPerSpan,l=u.scale,!c){e.next=10;break}return e.next=7,this.getView(1/c,o);case 7:a=e.sent,e.next=19;break;case 10:if(!l){e.next=16;break}return e.next=13,this.getView(l,o);case 13:a=e.sent,e.next=19;break;case 16:return e.next=18,this.getView(1,o);case 18:a=e.sent;case 19:return e.abrupt("return",new Xr.c((function(e){a.readWigData(i,r,n,e,o)})));case 20:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return i.apply(this,arguments)})},{key:"getFeatures",value:(n=un(rn().mark((function e(t,r,n,o){var i,a;return rn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getFeatureStream(t,r,n,o);case 2:return i=e.sent,e.next=5,(0,Zr._)(i.pipe((0,en.$)()));case 5:return a=e.sent,e.abrupt("return",a.flat());case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,r,o){return n.apply(this,arguments)})}],r&&cn(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function hn(e){return hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hn(e)}function yn(){yn=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),u=new _(n||[]);return o(a,"_invoke",{value:j(e,r,u)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",v={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(L([])));A&&A!==r&&n.call(A,a)&&(w=A);var x=g.prototype=m.prototype=Object.create(w);function O(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,u){var c=f(e[o],e,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==hn(s)&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?y:d,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function vn(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function mn(e,t){for(var r=0;r=0)){e.next=20;break}if(!((p=o[f])&&p.reductionLevel<=2*l)){e.next=17;break}return d=Number(p.indexOffset),e.abrupt("return",new Kr(this.bbi,i,d,u,c>0,"summary"));case 17:f-=1,e.next=12;break;case 20:return e.abrupt("return",this.getUnzoomedView(r));case 21:case"end":return e.stop()}}),e,this)})),i=function(){var e=this,t=arguments;return new Promise((function(r,n){var i=o.apply(e,t);function a(e){vn(i,r,n,a,u,"next",e)}function u(e){vn(i,r,n,a,u,"throw",e)}a(void 0)}))},function(e,t){return i.apply(this,arguments)})}],n&&mn(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),t}(dn),On=r(61436),En=r(41327),jn=r(17133);function Pn(e){return Pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pn(e)}var kn=["signal"];function Cn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_n(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function _n(e,t){if(e){if("string"==typeof e)return Ln(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ln(e,t):void 0}}function Ln(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function In(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function Mn(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){In(i,n,o,a,u,"next",e)}function u(e){In(i,n,o,a,u,"throw",e)}a(void 0)}))}}function Rn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nn(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.signal,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,kn);return this.readIndicesCache.get(JSON.stringify(r),e,t)}},{key:"getView",value:(c=Mn(Tn().mark((function e(t,r){return Tn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.getUnzoomedView(r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"_readIndices",value:(u=Mn(Tn().mark((function e(t){var r,n,i,a,u,c,l,s,p,d,h,y,v,m,b,g;return Tn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getHeader(t);case 2:return r=e.sent,n=r.extHeaderOffset,i=r.isBigEndian,e.next=7,this.bbi.read(o.Buffer.alloc(64),0,64,Number(n));case 7:if(a=e.sent,u=a.buffer,c=i?"big":"little",l=(new f).endianess(c).uint16("size").uint16("count").uint64("offset").parse(u),s=l.count,p=l.offset,0!==s){e.next=14;break}return e.abrupt("return",[]);case 14:return h=(d=20)*s,e.next=18,this.bbi.read(o.Buffer.alloc(h),0,h,Number(p));case 18:for(y=e.sent,v=y.buffer,m=(new f).endianess(c).int16("type").int16("fieldcount").uint64("offset").skip(4).int16("field"),b=[],g=0;g1&&void 0!==l[1]?l[1]:{},e.next=3,this.getHeader(r);case 3:return n=e.sent,i=n.isBigEndian,e.next=7,this.readIndices(r);case 7:if(0!==(a=e.sent).length){e.next=10;break}return e.abrupt("return",[]);case 10:return u=a.map(function(){var e=Mn(Tn().mark((function e(n){var a,u,l,s,p,d,h,y,v,m,b,g;return Tn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=n.offset,u=n.field,e.next=3,c.bbi.read(o.Buffer.alloc(32),0,32,Number(a),r);case 3:return l=e.sent,s=l.buffer,p=i?"big":"little",d=(new f).endianess(p).int32("magic").int32("blockSize").int32("keySize").int32("valSize").uint64("itemCount"),h=d.parse(s),y=h.blockSize,v=h.keySize,m=h.valSize,b=(new f).endianess(p).int8("nodeType").skip(1).int16("cnt").choice({tag:"nodeType",choices:{0:(new f).array("leafkeys",{length:"cnt",type:(new f).endianess(p).string("key",{length:v,stripNull:!0}).uint64("offset")}),1:(new f).array("keys",{length:"cnt",type:(new f).endianess(p).string("key",{length:v,stripNull:!0}).uint64("offset").uint32("length").uint32("reserved")})}}),g=function(){var e=Mn(Tn().mark((function e(n){var i,a,l,s,f,p,d,h,w;return Tn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Number(n),a=4+y*(v+m),e.next=4,c.bbi.read(o.Buffer.alloc(a),0,a,i,r);case 4:if(l=e.sent,s=l.buffer,!(f=b.parse(s)).leafkeys){e.next=18;break}d=0;case 9:if(!(d1&&void 0!==u[1]?u[1]:{},e.next=3,this.searchExtraIndexBlocks(t,r);case 3:if(0!==(n=e.sent).length){e.next=6;break}return e.abrupt("return",[]);case 6:return e.next=8,this.getUnzoomedView(r);case 8:return o=e.sent,i=n.map((function(e){return new Xr.c((function(t){o.readFeatures(t,[e],r)})).pipe((0,En.T)((function(e,t){return e.concat(t)})),(0,jn.T)((function(t){var r,n=Cn(t);try{for(n.s();!(r=n.n()).done;)r.value.field=e.field}catch(e){n.e(e)}finally{n.f()}return t})))})),e.next=12,(0,Zr._)(On.h.apply(void 0,function(e){if(Array.isArray(e))return Ln(e)}(c=i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(c)||_n(c)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()));case 12:return a=e.sent,e.abrupt("return",a.filter((function(e){var r;return(null===(r=e.rest)||void 0===r?void 0:r.split("\t")[(e.field||0)-3])===t})));case 14:case"end":return e.stop()}var c}),e,this)}))),function(e){return i.apply(this,arguments)})}],n&&Fn(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),t}(dn)},38004:e=>{"use strict";function t(e,r,n,o){this.message=e,this.expected=r,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}!function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(t,Error),t.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,r="";for(t=0;t0){for(t=1,n=1;tRe&&(Re=Te,Ne=[]),Ne.push(e))}function We(){var t,r,n,i,a,p,d;return t=Te,et()!==o&&(r=qe())!==o&&et()!==o&&(n=Qe())!==o&&et()!==o&&(i=Ye())!==o&&et()!==o?(40===e.charCodeAt(Te)?(a=u,Te++):(a=o,0===Fe&&Ve(c)),a!==o&&et()!==o?(p=function(){var e,t,r,n,i;if(e=Te,(t=Ke())!==o)if(et()!==o){for(r=[],n=Te,et()!==o&&(i=Ke())!==o?(Ie=n,n=j(t,i)):(Te=n,n=o);n!==o;)r.push(n),n=Te,et()!==o&&(i=Ke())!==o?(Ie=n,n=j(t,i)):(Te=n,n=o);r!==o&&(n=et())!==o?(Ie=e,e=t=P(t,r)):(Te=e,e=o)}else Te=e,e=o;else Te=e,e=o;return e}(),p!==o&&et()!==o?(41===e.charCodeAt(Te)?(d=l,Te++):(d=o,0===Fe&&Ve(s)),d!==o&&et()!==o?(Ie=t,t=f(r,n,i,p)):(Te=t,t=o)):(Te=t,t=o)):(Te=t,t=o)):(Te=t,t=o),t}function qe(){var t;return e.substr(Te,6)===p?(t=p,Te+=6):(t=o,0===Fe&&Ve(d)),t===o&&(e.substr(Te,6)===h?(t=h,Te+=6):(t=o,0===Fe&&Ve(y)),t===o&&(e.substr(Te,5)===v?(t=v,Te+=5):(t=o,0===Fe&&Ve(m)))),t}function Qe(){var t,r,n,i;return(t=Xe())===o&&(t=Te,(r=Xe())!==o&&(n=$e())!==o?t=r=[r,n]:(Te=t,t=o),t===o&&(t=Te,(r=Xe())!==o?(e.substr(Te,4)===b?(n=b,Te+=4):(n=o,0===Fe&&Ve(g)),n!==o?t=r=[r,n]:(Te=t,t=o)):(Te=t,t=o),t===o&&(t=Te,(r=Xe())!==o&&(n=$e())!==o?(e.substr(Te,4)===b?(i=b,Te+=4):(i=o,0===Fe&&Ve(g)),i!==o?t=r=[r,n,i]:(Te=t,t=o)):(Te=t,t=o)))),t}function $e(){var t;return e.substr(Te,7)===w?(t=w,Te+=7):(t=o,0===Fe&&Ve(S)),t===o&&(e.substr(Te,5)===A?(t=A,Te+=5):(t=o,0===Fe&&Ve(x)),t===o&&(e.substr(Te,6)===O?(t=O,Te+=6):(t=o,0===Fe&&Ve(E)))),t}function Ye(){var e;return(e=Ze())===o&&(e=et()),e}function Ke(){var t,r,n,i,a,f,p,d;return t=Te,(r=Je())!==o&&et()!==o&&(n=Xe())!==o&&et()!==o?(59===e.charCodeAt(Te)?(i=_,Te++):(i=o,0===Fe&&Ve(L)),i!==o&&et()!==o&&(a=Ye())!==o?(Ie=t,t=r=T(r,n,a)):(Te=t,t=o)):(Te=t,t=o),t===o&&(t=Te,(r=Je())!==o&&et()!==o?(91===e.charCodeAt(Te)?(n=I,Te++):(n=o,0===Fe&&Ve(M)),n!==o&&et()!==o?(i=function(){var t;return t=function(){var t,r,n;if(Fe++,t=Te,et()!==o){if(r=[],je.test(e.charAt(Te))?(n=e.charAt(Te),Te++):(n=o,0===Fe&&Ve(Pe)),n!==o)for(;n!==o;)r.push(n),je.test(e.charAt(Te))?(n=e.charAt(Te),Te++):(n=o,0===Fe&&Ve(Pe));else r=o;r!==o?(Ie=t,t=ke()):(Te=t,t=o)}else Te=t,t=o;return Fe--,t===o&&(o,0===Fe&&Ve(Ee)),t}(),t===o&&(t=Xe()),t}(),i!==o&&et()!==o?(93===e.charCodeAt(Te)?(a=R,Te++):(a=o,0===Fe&&Ve(N)),a!==o&&et()!==o&&(f=Xe())!==o&&et()!==o?(59===e.charCodeAt(Te)?(p=_,Te++):(p=o,0===Fe&&Ve(L)),p!==o&&et()!==o&&(d=Ye())!==o?(Ie=t,t=r=F(r,i,f,d)):(Te=t,t=o)):(Te=t,t=o)):(Te=t,t=o)):(Te=t,t=o)):(Te=t,t=o),t===o&&(t=Te,(r=Je())!==o&&et()!==o?(40===e.charCodeAt(Te)?(n=u,Te++):(n=o,0===Fe&&Ve(c)),n!==o&&et()!==o?(i=function(){var t,r,n,i,a,u;if(t=Te,(r=Xe())!==o){for(n=[],i=Te,44===e.charCodeAt(Te)?(a=B,Te++):(a=o,0===Fe&&Ve(z)),a!==o&&et()!==o&&(u=Xe())!==o?(Ie=i,i=a=j(r,u)):(Te=i,i=o);i!==o;)n.push(i),i=Te,44===e.charCodeAt(Te)?(a=B,Te++):(a=o,0===Fe&&Ve(z)),a!==o&&et()!==o&&(u=Xe())!==o?(Ie=i,i=a=j(r,u)):(Te=i,i=o);n!==o?(Ie=t,t=r=G(r,n)):(Te=t,t=o)}else Te=t,t=o;return t}(),i!==o&&et()!==o?(41===e.charCodeAt(Te)?(a=l,Te++):(a=o,0===Fe&&Ve(s)),a!==o&&et()!==o&&(f=Xe())!==o&&et()!==o?(59===e.charCodeAt(Te)?(p=_,Te++):(p=o,0===Fe&&Ve(L)),p!==o&&et()!==o&&(d=Ye())!==o?(Ie=t,t=r=D(r,i,f,d)):(Te=t,t=o)):(Te=t,t=o)):(Te=t,t=o)):(Te=t,t=o)):(Te=t,t=o),t===o&&(t=function(){var t,r,n,i,a;return t=Te,(r=et())!==o?(n=function(){var t;return 35===e.charCodeAt(Te)?(t=k,Te++):(t=o,0===Fe&&Ve(C)),t}(),n!==o&&(i=Ze())!==o&&(a=et())!==o?t=r=[r,n,i,a]:(Te=t,t=o)):(Te=t,t=o),t}()))),t}function Je(){var t,r,n;return e.substr(Te,3)===U?(t=U,Te+=3):(t=o,0===Fe&&Ve(H)),t===o&&(e.substr(Te,4)===V?(t=V,Te+=4):(t=o,0===Fe&&Ve(W)),t===o&&(e.substr(Te,5)===q?(t=q,Te+=5):(t=o,0===Fe&&Ve(Q)),t===o&&(e.substr(Te,6)===$?(t=$,Te+=6):(t=o,0===Fe&&Ve(Y)),t===o&&(e.substr(Te,4)===K?(t=K,Te+=4):(t=o,0===Fe&&Ve(J)),t===o&&(e.substr(Te,5)===X?(t=X,Te+=5):(t=o,0===Fe&&Ve(Z)),t===o&&(e.substr(Te,5)===ee?(t=ee,Te+=5):(t=o,0===Fe&&Ve(te)),t===o&&(e.substr(Te,4)===re?(t=re,Te+=4):(t=o,0===Fe&&Ve(ne)),t===o&&(e.substr(Te,6)===oe?(t=oe,Te+=6):(t=o,0===Fe&&Ve(ie)),t===o&&(e.substr(Te,7)===ae?(t=ae,Te+=7):(t=o,0===Fe&&Ve(ue)),t===o&&(e.substr(Te,4)===ce?(t=ce,Te+=4):(t=o,0===Fe&&Ve(le)),t===o&&(e.substr(Te,6)===se?(t=se,Te+=6):(t=o,0===Fe&&Ve(fe)),t===o&&(e.substr(Te,6)===pe?(t=pe,Te+=6):(t=o,0===Fe&&Ve(de)),t===o&&(e.substr(Te,3)===he?(t=he,Te+=3):(t=o,0===Fe&&Ve(ye)),t===o&&(t=Te,(r=qe())!==o&&et()!==o&&(n=Qe())!==o?(Ie=t,t=r=ve(r,n)):(Te=t,t=o))))))))))))))),t}function Xe(){var t,r,n,i,a;if(t=Te,r=Te,me.test(e.charAt(Te))?(n=e.charAt(Te),Te++):(n=o,0===Fe&&Ve(be)),n!==o){for(i=[],ge.test(e.charAt(Te))?(a=e.charAt(Te),Te++):(a=o,0===Fe&&Ve(we));a!==o;)i.push(a),ge.test(e.charAt(Te))?(a=e.charAt(Te),Te++):(a=o,0===Fe&&Ve(we));i!==o?r=n=[n,i]:(Te=r,r=o)}else Te=r,r=o;return r!==o&&(Ie=t,r=Se(r)),r}function Ze(){var t,r,n;for(t=Te,r=[],Ae.test(e.charAt(Te))?(n=e.charAt(Te),Te++):(n=o,0===Fe&&Ve(xe));n!==o;)r.push(n),Ae.test(e.charAt(Te))?(n=e.charAt(Te),Te++):(n=o,0===Fe&&Ve(xe));return r!==o&&(Ie=t,r=Oe(r)),r}function et(){var t,r;for(Fe++,t=[],_e.test(e.charAt(Te))?(r=e.charAt(Te),Te++):(r=o,0===Fe&&Ve(Le));r!==o;)t.push(r),_e.test(e.charAt(Te))?(r=e.charAt(Te),Te++):(r=o,0===Fe&&Ve(Le));return Fe--,t===o&&(r=o,0===Fe&&Ve(Ce)),t}if((n=a())!==o&&Te===e.length)return n;throw n!==o&&Te{"use strict";r.d(t,{A:()=>P});var n={};r.r(n),r.d(n,{bigChain:()=>a,bigGenePred:()=>u,bigInteract:()=>c,bigLink:()=>l,bigMaf:()=>s,bigNarrowPeak:()=>f,bigPsl:()=>p,defaultBedSchema:()=>d,mafFrames:()=>h,mafSummary:()=>y});var o=r(38004),i=r.n(o),a='table bigChain\n"bigChain pairwise alignment"\n (\n string chrom; "Reference sequence chromosome or scaffold"\n uint chromStart; "Start position in chromosome"\n uint chromEnd; "End position in chromosome"\n string name; "Name or ID of item, ideally both human readable and unique"\n uint score; "Score (0-1000)"\n char[1] strand; "+ or - for strand"\n uint tSize; "size of target sequence"\n string qName; "name of query sequence"\n uint qSize; "size of query sequence"\n uint qStart; "start of alignment on query sequence"\n uint qEnd; "end of alignment on query sequence"\n uint chainScore; "score from chain"\n )',u='table bigGenePred\n"bigGenePred gene models"\n (\n string chrom; "Reference sequence chromosome or scaffold"\n uint chromStart; "Start position in chromosome"\n uint chromEnd; "End position in chromosome"\n string name; "Name or ID of item, ideally both human readable and unique"\n uint score; "Score (0-1000)"\n char[1] strand; "+ or - for strand"\n uint thickStart; "Start of where display should be thick (start codon)"\n uint thickEnd; "End of where display should be thick (stop codon)"\n uint reserved; "RGB value (use R,G,B string in input file)"\n int blockCount; "Number of blocks"\n int[blockCount] blockSizes; "Comma separated list of block sizes"\n int[blockCount] chromStarts; "Start positions relative to chromStart"\n string name2; "Alternative/human readable name"\n string cdsStartStat; "Status of CDS start annotation (none, unknown, incomplete, or complete)"\n string cdsEndStat; "Status of CDS end annotation (none, unknown, incomplete, or complete)"\n int[blockCount] exonFrames; "Exon frame {0,1,2}, or -1 if no frame for exon"\n string type; "Transcript type"\n string geneName; "Primary identifier for gene"\n string geneName2; "Alternative/human readable gene name"\n string geneType; "Gene type"\n )',c='table interact\n"interaction between two regions"\n (\n string chrom; "Chromosome (or contig, scaffold, etc.). For interchromosomal, use 2 records"\n uint chromStart; "Start position of lower region. For interchromosomal, set to chromStart of this region"\n uint chromEnd; "End position of upper region. For interchromosomal, set to chromEnd of this region"\n string name; "Name of item, for display. Usually \'sourceName/targetName/exp\' or empty"\n uint score; "Score (0-1000)"\n double value; "Strength of interaction or other data value. Typically basis for score"\n string exp; "Experiment name (metadata for filtering). Use . if not applicable"\n string color; "Item color. Specified as r,g,b or hexadecimal #RRGGBB or html color name, as in //www.w3.org/TR/css3-color/#html4. Use 0 and spectrum setting to shade by score"\n string sourceChrom; "Chromosome of source region (directional) or lower region. For non-directional interchromosomal, chrom of this region."\n uint sourceStart; "Start position in chromosome of source/lower/this region"\n uint sourceEnd; "End position in chromosome of source/lower/this region"\n string sourceName; "Identifier of source/lower/this region"\n string sourceStrand; "Orientation of source/lower/this region: + or -. Use . if not applicable"\n string targetChrom; "Chromosome of target region (directional) or upper region. For non-directional interchromosomal, chrom of other region"\n uint targetStart; "Start position in chromosome of target/upper/this region"\n uint targetEnd; "End position in chromosome of target/upper/this region"\n string targetName; "Identifier of target/upper/this region"\n string targetStrand; "Orientation of target/upper/this region: + or -. Use . if not applicable"\n\n )',l='table bigLink\n"bigLink pairwise alignment"\n (\n string chrom; "Reference sequence chromosome or scaffold"\n uint chromStart; "Start position in chromosome"\n uint chromEnd; "End position in chromosome"\n string name; "Name or ID of item, ideally both human readable and unique"\n uint qStart; "start of alignment on query sequence"\n )',s='table bedMaf\n"Bed3 with MAF block"\n (\n string chrom; "Reference sequence chromosome or scaffold"\n uint chromStart; "Start position in chromosome"\n uint chromEnd; "End position in chromosome"\n lstring mafBlock; "MAF block"\n )',f='table bigNarrowPeak\n"BED6+4 Peaks of signal enrichment based on pooled, normalized (interpreted) data."\n(\n string chrom; "Reference sequence chromosome or scaffold"\n uint chromStart; "Start position in chromosome"\n uint chromEnd; "End position in chromosome"\n string name;\t "Name given to a region (preferably unique). Use . if no name is assigned"\n uint score; "Indicates how dark the peak will be displayed in the browser (0-1000) "\n char[1] strand; "+ or - or . for unknown"\n float signalValue; "Measurement of average enrichment for the region"\n float pValue; "Statistical significance of signal value (-log10). Set to -1 if not used."\n float qValue; "Statistical significance with multiple-test correction applied (FDR -log10). Set to -1 if not used."\n int peak; "Point-source called for this peak; 0-based offset from chromStart. Set to -1 if no point-source called."\n)',p='table bigPsl\n"bigPsl pairwise alignment"\n (\n string chrom; "Reference sequence chromosome or scaffold"\n uint chromStart; "Start position in chromosome"\n uint chromEnd; "End position in chromosome"\n string name; "Name or ID of item, ideally both human readable and unique"\n uint score; "Score (0-1000)"\n char[1] strand; "+ or - indicates whether the query aligns to the + or - strand on the reference"\n uint thickStart; "Start of where display should be thick (start codon)"\n uint thickEnd; "End of where display should be thick (stop codon)"\n uint reserved; "RGB value (use R,G,B string in input file)"\n int blockCount; "Number of blocks"\n int[blockCount] blockSizes; "Comma separated list of block sizes"\n int[blockCount] chromStarts; "Start positions relative to chromStart"\n\n uint oChromStart;"Start position in other chromosome"\n uint oChromEnd; "End position in other chromosome"\n char[1] oStrand; "+ or -, - means that psl was reversed into BED-compatible coordinates"\n uint oChromSize; "Size of other chromosome."\n int[blockCount] oChromStarts; "Start positions relative to oChromStart or from oChromStart+oChromSize depending on strand"\n\n lstring oSequence; "Sequence on other chrom (or empty)"\n string oCDS; "CDS in NCBI format"\n\n uint chromSize;"Size of target chromosome"\n\n uint match; "Number of bases matched."\n uint misMatch; " Number of bases that don\'t match "\n uint repMatch; " Number of bases that match but are part of repeats "\n uint nCount; " Number of \'N\' bases "\n uint seqType; "0=empty, 1=nucleotide, 2=amino_acid"\n )',d='table defaultBedSchema\n"BED12"\n (\n string chrom; "The name of the chromosome (e.g. chr3, chrY, chr2_random) or scaffold (e.g. scaffold10671)."\n uint chromStart; "The starting position of the feature in the chromosome or scaffold. The first base in a chromosome is numbered 0."\n uint chromEnd; "The ending position of the feature in the chromosome or scaffold. The chromEnd base is not included in the display of the feature. For example, the first 100 bases of a chromosome are defined as chromStart=0, chromEnd=100, and span the bases numbered 0-99."\n string name; "Defines the name of the BED line."\n float score; "Feature score, doesn\'t care about the 0-1000 limit as in bed"\n char strand; "Defines the strand. Either \'.\' (=no strand) or \'+\' or \'-\'"\n uint thickStart; "The starting position at which the feature is drawn thickly (for example, the start codon in gene displays). When there is no thick part, thickStart and thickEnd are usually set to the chromStart position."\n uint thickEnd; "The ending position at which the feature is drawn thickly (for example the stop codon in gene displays)."\n string itemRgb; "An RGB value of the form R,G,B (e.g. 255,0,0). "\n uint blockCount; " The number of blocks (exons) in the BED line."\n uint[blockCount] blockSizes; " A comma-separated list of the block sizes. The number of items in this list should correspond to blockCount."\n uint[blockCount] blockStarts; "A comma-separated list of block starts. All of the blockStart positions should be calculated relative to chromStart. The number of items in this list should correspond to blockCount."\n )',h='table mafFrames\n"codon frame assignment for MAF components"\n (\n string chrom; "Reference sequence chromosome or scaffold"\n uint chromStart; "Start range in chromosome"\n uint chromEnd; "End range in chromosome"\n string src; "Name of sequence source in MAF"\n ubyte frame; "frame (0,1,2) for first base(+) or last bast(-)"\n char[1] strand; "+ or -"\n string name; "Name of gene used to define frame"\n int prevFramePos; "target position of the previous base (in transcription direction) that continues this frame, or -1 if none, or frame not contiguous"\n int nextFramePos; "target position of the next base (in transcription direction) that continues this frame, or -1 if none, or frame not contiguous"\n ubyte isExonStart; "does this start the CDS portion of an exon?"\n ubyte isExonEnd; "does this end the CDS portion of an exon?"\n )',y='table mafSummary\n"Positions and scores for alignment blocks"\n (\n string chrom; "Reference sequence chromosome or scaffold"\n uint chromStart; "Start position in chromosome"\n uint chromEnd; "End position in chromosome"\n string src; "Sequence name or database of alignment"\n float score; "Floating point score."\n char[1] leftStatus; "Gap/break annotation for preceding block"\n char[1] rightStatus; "Gap/break annotation for following block"\n )';function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.autoSql)this.autoSql=S(i().parse(t.autoSql));else if(t.type){if(!m[t.type])throw new Error("Type not found");this.autoSql=S(m[t.type])}else this.autoSql=S(m.defaultBedSchema),this.attemptDefaultBed=!0}var t,r;return t=e,r=[{key:"parseLine",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.autoSql,n=t.uniqueId,o=Array.isArray(e)?e:e.split("\t"),i={};if(!this.attemptDefaultBed||this.attemptDefaultBed&&function(e){var t;return e.length>=12&&!Number.isNaN(parseInt(e[9],10))&&(null===(t=e[10])||void 0===t?void 0:t.split(",").filter((function(e){return!!e})).length)===parseInt(e[9],10)}(o))for(var a=0;a{"use strict";r.r(t),r.d(t,{BgzfFilehandle:()=>I,unzip:()=>s,unzipChunk:()=>p,unzipChunkSlice:()=>h});var n=r(85832),o=r(39962),i=r(159);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,a=Object.create(i.prototype),u=new T(n||[]);return o(a,"_invoke",{value:k(e,r,u)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h="suspendedStart",y="suspendedYield",v="executing",m="completed",b={};function g(){}function w(){}function S(){}var A={};f(A,c,(function(){return this}));var x=Object.getPrototypeOf,O=x&&x(x(I([])));O&&O!==r&&n.call(O,c)&&(A=O);var E=S.prototype=g.prototype=Object.create(A);function j(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function r(o,i,u,c){var l=d(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==a(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,u,c)}),(function(e){r("throw",e,u,c)})):t.resolve(f).then((function(e){s.value=e,u(s)}),(function(e){return r("throw",e,u,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=h;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=C(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=d(t,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=d(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function I(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function l(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){c(i,n,o,a,u,"next",e)}function u(e){c(i,n,o,a,u,"throw",e)}a(void 0)}))}}function s(e){return f.apply(this,arguments)}function f(){return(f=l(u().mark((function e(t){var r,o,a,c,l,s,f,p,d,h;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,o=0,a=0,c=[],l=0;case 5:if(f=t.subarray(o),s=new i.Inflate,r=s.strm,s.push(f,i.Z_SYNC_FLUSH),!s.err){e.next=12;break}throw new Error(s.msg);case 12:o+=r.next_in,c[a]=s.result,l+=c[a].length,a+=1;case 16:if(r.avail_in){e.next=5;break}case 17:for(p=new Uint8Array(l),d=0,h=0;d=c.blockPosition)){e.next=30;break}return f[y]=f[y].subarray(0,c.blockPosition===a.blockPosition?c.dataPosition-a.dataPosition+1:c.dataPosition+1),p.push(l),d.push(s),h+=f[y].length,e.abrupt("break",33);case 30:h+=f[y].length,y++;case 32:if(o.avail_in){e.next=9;break}case 33:for(S=new Uint8Array(h),A=0,x=0;A=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function w(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function S(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){w(i,n,o,a,u,"next",e)}function u(e){w(i,n,o,a,u,"throw",e)}a(void 0)}))}}function A(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=m().fromBytesLE(e.slice(t,t+8),r);if(n.greaterThan(Number.MAX_SAFE_INTEGER)||n.lessThan(Number.MIN_SAFE_INTEGER))throw new TypeError("integer overflow");return n.toNumber()}},{key:"_getIndex",value:function(){return this.index||(this.index=this._readIndex()),this.index}},{key:"_readIndex",value:(u=S(g().mark((function e(){var t,r,o,i,a,u,c;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.Buffer.allocUnsafe(8),e.next=3,this.filehandle.read(t,0,8,0);case 3:if(r=this._readLongWithOverflow(t,0,!0)){e.next=6;break}return e.abrupt("return",[[0,0]]);case 6:if((o=new Array(r+1))[0]=[0,0],!((i=16*r)>Number.MAX_SAFE_INTEGER)){e.next=11;break}throw new TypeError("integer overflow");case 11:return t=n.Buffer.allocUnsafe(i),e.next=14,this.filehandle.read(t,0,i,8);case 14:for(a=0;ar?0:n0?c=l-1:s<0&&(u=l+1),l=Math.ceil((c-u)/2)+u,s=a(o[l],o[l+1]);i.push(o[l]),f=l+1;case 15:if(!(f=n)){e.next=19;break}return e.abrupt("break",22);case 19:f+=1,e.next=15;break;case 22:return i[i.length-1][1]e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function C(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function _(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){C(i,n,o,a,u,"next",e)}function u(e){C(i,n,o,a,u,"throw",e)}a(void 0)}))}}function L(e,t){for(var r=0;r=i?0:i-d,y=Math.min(i+o,d+f.length)-d,h>=0&&h{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){return o="function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?function(e){return n(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":n(e)},o(e)}var i=r(85832).Buffer,a=r(44841),u=r(94165).o,c=r(12899);"undefined"!=typeof window&&(window.Buffer=i),"undefined"!=typeof self&&(self.Buffer=i);var l={UInt8:1,UInt16LE:2,UInt16BE:2,UInt32LE:4,UInt32BE:4,Int8:1,Int16LE:2,Int16BE:2,Int32LE:4,Int32BE:4,FloatLE:4,FloatBE:4,DoubleLE:8,DoubleBE:8,UInt64:8,Int64:8},s={},f="___parser_",p=[];!function(){var e;for(e=1;e<=32;e++)p.push(e)}();var d={};Object.keys(l).concat(Object.keys({String:null,Buffer:null,Array:null,Skip:null,Choice:null,Nest:null,Bit:null,Itf8:null,Ltf8:null})).forEach((function(e){d[e.toLowerCase()]=e}));var h=function(){this.varName="",this.type="",this.options={},this.next=null,this.head=null,this.compiled=null,this.endian="le",this.constructorFn=null,this.alias=null};h.start=function(){return new h},Object.keys(l).forEach((function(e){h.prototype[e.toLowerCase()]=function(t,r){return this.setNextParser(e.toLowerCase(),t,r)};var t=e.replace(/BE|LE/,"").toLowerCase();t in h.prototype||(h.prototype[t]=function(e,r){return this[t+this.endian](e,r)})})),p.forEach((function(e){h.prototype["bit".concat(e.toString())]=function(t,r){return r||(r={}),r.length=e,this.setNextParser("bit",t,r)}})),h.prototype.namely=function(e){return s[e]=this,this.alias=e,this},h.prototype.skip=function(e,t){if(t&&t.assert)throw new Error("assert option on skip is not allowed.");return this.setNextParser("skip","",{length:e})},h.prototype.string=function(e,t){if(!t.zeroTerminated&&!t.length&&!t.greedy)throw new Error("Neither length, zeroTerminated, nor greedy is defined for string.");if((t.zeroTerminated||t.length)&&t.greedy)throw new Error("greedy is mutually exclusive with length and zeroTerminated for string.");if(t.stripNull&&!t.length&&!t.greedy)throw new Error("Length or greedy must be defined if stripNull is defined.");return t.encoding=t.encoding||"utf8",this.setNextParser("string",e,t)},h.prototype.buffer=function(e,t){if(!t.length&&!t.readUntil)throw new Error("Length nor readUntil is defined in buffer parser");return this.setNextParser("buffer",e,t)},h.prototype.array=function(e,t){if(!t.readUntil&&!t.length&&!t.lengthInBytes)throw new Error("Length option of array is not defined.");if(!t.type)throw new Error("Type option of array is not defined.");if("string"==typeof t.type&&!s[t.type]&&Object.keys(l).indexOf(d[t.type])<0)throw new Error('Specified primitive type "'.concat(t.type,'" is not supported.'));return this.setNextParser("array",e,t)},h.prototype.choice=function(e,t){if(1===arguments.length&&"object"===o(e)&&(t=e,e=null),!t.tag)throw new Error("Tag option of array is not defined.");if(!t.choices)throw new Error("Choices option of array is not defined.");return Object.keys(t.choices).forEach((function(r){if(!t.choices[r])throw new Error("Choice Case ".concat(r," of ").concat(e," is not valid."));if("string"==typeof t.choices[r]&&!s[t.choices[r]]&&Object.keys(l).indexOf(d[t.choices[r]])<0)throw new Error('Specified primitive type "'.concat(t.choices[r],'" is not supported.'))}),this),this.setNextParser("choice",e,t)},h.prototype.nest=function(e,t){if(1===arguments.length&&"object"===o(e)&&(t=e,e=null),!t.type)throw new Error("Type option of nest is not defined.");if(!(t.type instanceof h||s[t.type]))throw new Error("Type option of nest must be a Parser object.");if(!(t.type instanceof h||e))throw new Error("options.type must be a object if variable name is omitted.");return this.setNextParser("nest",e,t)},h.prototype.endianess=function(e){switch(e.toLowerCase()){case"little":this.endian="le";break;case"big":this.endian="be";break;default:throw new Error("Invalid endianess: ".concat(e))}return this},h.prototype.create=function(e){if(!(e instanceof Function))throw new Error("Constructor must be a Function object.");return this.constructorFn=e,this},h.prototype.getCode=function(){var e=new u;return e.pushCode("if (!Buffer.isBuffer(buffer)) {"),e.generateError('"argument buffer is not a Buffer object"'),e.pushCode("}"),this.alias?this.addAliasedCode(e):this.addRawCode(e),this.alias?e.pushCode("return {0}(0)",f+this.alias):e.pushCode("return { offset: offset, result: vars };"),e.code},h.prototype.addRawCode=function(e){e.pushCode("var offset = 0;"),this.constructorFn?e.pushCode("var vars = new constructorFn();"):e.pushCode("var vars = {};"),this.generate(e),this.resolveReferences(e),e.pushCode("return { offset: offset, result: vars };")},h.prototype.addAliasedCode=function(e){return e.pushCode("function {0}(offset) {",f+this.alias),this.constructorFn?e.pushCode("var vars = new constructorFn();"):e.pushCode("var vars = {};"),this.generate(e),e.markResolved(this.alias),this.resolveReferences(e),e.pushCode("return { offset: offset, result: vars };"),e.pushCode("}"),e},h.prototype.resolveReferences=function(e){var t=e.getUnresolvedReferences();e.markRequested(t),t.forEach((function(t){s[t].addAliasedCode(e)}))},h.prototype.compile=function(){var e="(function(buffer, constructorFn, Long) { ".concat(this.getCode()," })");this.compiled=a.runInThisContext(e)},h.prototype.sizeOf=function(){var e=NaN;if(Object.keys(l).indexOf(this.type)>=0)e=l[this.type];else if("String"===this.type&&"number"==typeof this.options.length)e=this.options.length;else if("Buffer"===this.type&&"number"==typeof this.options.length)e=this.options.length;else if("Array"===this.type&&"number"==typeof this.options.length){var t=NaN;"string"==typeof this.options.type?t=l[d[this.options.type]]:this.options.type instanceof h&&(t=this.options.type.sizeOf()),e=this.options.length*t}else"Skip"===this.type?e=this.options.length:"Nest"===this.type?e=this.options.type.sizeOf():this.type||(e=0);return this.next&&(e+=this.next.sizeOf()),e},h.prototype.parse=function(e){return this.compiled||this.compile(),this.compiled(e,this.constructorFn,c)},h.prototype.setNextParser=function(e,t,r){var n=new h;return n.type=d[e],n.varName=t,n.options=r||n.options,n.endian=this.endian,this.head?this.head.next=n:this.next=n,this.head=n,this},h.prototype.generate=function(e){this.type&&(this["generate".concat(this.type)](e),this.generateAssert(e));var t=e.generateVariable(this.varName);return this.options.formatter&&this.generateFormatter(e,t,this.options.formatter),this.generateNext(e)},h.prototype.generateAssert=function(e){if(this.options.assert){var t=e.generateVariable(this.varName);switch(o(this.options.assert)){case"function":e.pushCode("if (!({0}).call(vars, {1})) {",this.options.assert,t);break;case"number":e.pushCode("if ({0} !== {1}) {",this.options.assert,t);break;case"string":e.pushCode('if ("{0}" !== {1}) {',this.options.assert,t);break;default:throw new Error("Assert option supports only strings, numbers and assert functions.")}e.generateError('"Assert error: {0} is " + {0}',t),e.pushCode("}")}},h.prototype.generateNext=function(e){return this.next&&(e=this.next.generate(e)),e},Object.keys(l).forEach((function(e){h.prototype["generate".concat(e)]=function(t){"UInt64"===e?t.pushCode("{0} = Long.fromBytes(buffer.slice(offset,offset+8), true, this.endian === 'le').toNumber();",t.generateVariable(this.varName),e):"Int64"===e?t.pushCode("{0} = Long.fromBytes(buffer.slice(offset,offset+8), false, this.endian === 'le').toNumber();",t.generateVariable(this.varName),e):t.pushCode("{0} = buffer.read{1}(offset);",t.generateVariable(this.varName),e),t.pushCode("offset += {0};",l[e])}})),h.prototype.generateBit=function(e){var t=JSON.parse(JSON.stringify(this));if(t.varName=e.generateVariable(t.varName),e.bitFields.push(t),!this.next||this.next&&["Bit","Nest"].indexOf(this.next.type)<0){var r=0;e.bitFields.forEach((function(e){r+=e.options.length}));var n=e.generateTmpVariable();if(r<=8)e.pushCode("var {0} = buffer.readUInt8(offset);",n),r=8;else if(r<=16)e.pushCode("var {0} = buffer.readUInt16BE(offset);",n),r=16;else if(r<=24){var o=e.generateTmpVariable(),i=e.generateTmpVariable();e.pushCode("var {0} = buffer.readUInt16BE(offset);",o),e.pushCode("var {0} = buffer.readUInt8(offset + 2);",i),e.pushCode("var {2} = ({0} << 8) | {1};",o,i,n),r=24}else{if(!(r<=32))throw new Error("Currently, bit field sequence longer than 4-bytes is not supported.");e.pushCode("var {0} = buffer.readUInt32BE(offset);",n),r=32}e.pushCode("offset += {0};",r/8);var a=0,u="be"===this.endian;e.bitFields.forEach((function(t){e.pushCode("{0} = {1} >> {2} & {3};",t.varName,n,u?r-a-t.options.length:a,(1< offset++);"),e.pushCode("{0} = buffer.toString('{1}', {2}, offset);",t,this.options.encoding,r)),this.options.stripNull&&e.pushCode("{0} = {0}.replace(/\\x00+$/g, '')",t)},h.prototype.generateBuffer=function(e){"eof"===this.options.readUntil?e.pushCode("{0} = buffer.slice(offset);",e.generateVariable(this.varName)):(e.pushCode("{0} = buffer.slice(offset, offset + {1});",e.generateVariable(this.varName),e.generateOption(this.options.length)),e.pushCode("offset += {0};",e.generateOption(this.options.length))),this.options.clone&&e.pushCode("{0} = Buffer.from({0});",e.generateVariable(this.varName))},h.prototype.generateArray=function(e){var t=e.generateOption(this.options.length),r=e.generateOption(this.options.lengthInBytes),n=this.options.type,o=e.generateTmpVariable(),i=e.generateVariable(this.varName),a=e.generateTmpVariable(),u=this.options.key,c="string"==typeof u;if(c?e.pushCode("{0} = {};",i):e.pushCode("{0} = [];",i),"function"==typeof this.options.readUntil?e.pushCode("do {"):"eof"===this.options.readUntil?e.pushCode("for (var {0} = 0; offset < buffer.length; {0}++) {",o):void 0!==r?e.pushCode("for (var {0} = offset; offset - {0} < {1}; ) {",o,r):e.pushCode("for (var {0} = 0; {0} < {1}; {0}++) {",o,t),"string"==typeof n)if(s[n]){var p=e.generateTmpVariable();e.pushCode("var {0} = {1}(offset);",p,f+n),e.pushCode("var {0} = {1}.result; offset = {1}.offset;",a,p),n!==this.alias&&e.addReference(n)}else e.pushCode("var {0} = buffer.read{1}(offset);",a,d[n]),e.pushCode("offset += {0};",l[d[n]]);else n instanceof h&&(e.pushCode("var {0} = {};",a),e.pushScope(a),n.generate(e),e.popScope());c?e.pushCode("{0}[{2}.{1}] = {2};",i,u,a):e.pushCode("{0}.push({1});",i,a),e.pushCode("}"),"function"==typeof this.options.readUntil&&e.pushCode(" while (!({0}).call(this, {1}, buffer.slice(offset)));",this.options.readUntil,a)},h.prototype.generateChoiceCase=function(e,t,r){if("string"==typeof r)if(s[r]){var n=e.generateTmpVariable();e.pushCode("var {0} = {1}(offset);",n,f+r),e.pushCode("{0} = {1}.result; offset = {1}.offset;",e.generateVariable(this.varName),n),r!==this.alias&&e.addReference(r)}else e.pushCode("{0} = buffer.read{1}(offset);",e.generateVariable(this.varName),d[r]),e.pushCode("offset += {0};",l[d[r]]);else r instanceof h&&(e.pushPath(t),r.generate(e),e.popPath(t))},h.prototype.generateChoice=function(e){var t=e.generateOption(this.options.tag);this.varName&&e.pushCode("{0} = {};",e.generateVariable(this.varName)),e.pushCode("switch({0}) {",t),Object.keys(this.options.choices).forEach((function(t){var r=this.options.choices[t];Number.isNaN(parseInt(t,10))?e.pushCode("case '{0}':",t):e.pushCode("case {0}:",t),this.generateChoiceCase(e,this.varName,r),e.pushCode("break;")}),this),e.pushCode("default:"),this.options.defaultChoice?this.generateChoiceCase(e,this.varName,this.options.defaultChoice):e.generateError('"Met undefined tag value " + {0} + " at choice"',t),e.pushCode("}")},h.prototype.generateNest=function(e){var t=e.generateVariable(this.varName);if(this.options.type instanceof h)this.varName&&e.pushCode("{0} = {};",t),e.pushPath(this.varName),this.options.type.generate(e),e.popPath(this.varName);else if(s[this.options.type]){var r=e.generateTmpVariable();e.pushCode("var {0} = {1}(offset);",r,f+this.options.type),e.pushCode("{0} = {1}.result; offset = {1}.offset;",t,r),this.options.type!==this.alias&&e.addReference(this.options.type)}},h.prototype.generateFormatter=function(e,t,r){"function"==typeof r&&e.pushCode("{0} = ({1}).call(this, {0});",t,r)},h.prototype.isInteger=function(){return!!this.type.match(/U?Int[8|16|32][BE|LE]?|Bit\d+/)},h.prototype.itf8=function(e,t){return this.setNextParser("itf8",e,t)},h.prototype.itf8=function(e,t){return this.setNextParser("itf8",e,t)},h.prototype.generateItf8=function(e){var t=e.generateVariable(this.varName),r=e.generateTmpVariable();e.pushCode("\n var ".concat(r," = buffer[offset];\n if (").concat(r," < 0x80) {\n ").concat(t," = ").concat(r,";\n offset += 1;\n } else if (").concat(r," < 0xc0) {\n ").concat(t," = ((").concat(r,"<<8) | buffer[offset+1]) & 0x3fff;\n offset += 2;\n } else if (").concat(r," < 0xe0) {\n ").concat(t," = ((").concat(r,"<<16) | (buffer[offset+1]<< 8) | buffer[offset+2]) & 0x1fffff;\n offset += 3;\n } else if (").concat(r," < 0xf0) {\n ").concat(t," = ((").concat(r,"<<24) | (buffer[offset+1]<<16) | (buffer[offset+2]<<8) | buffer[offset+3]) & 0x0fffffff;\n offset += 4\n } else {\n ").concat(t," = ((").concat(r," & 0x0f)<<28) | (buffer[offset+1]<<20) | (buffer[offset+2]<<12) | (buffer[offset+3]<<4) | (buffer[offset+4] & 0x0f);\n // x=((0xff & 0x0f)<<28) | (0xff<<20) | (0xff<<12) | (0xff<<4) | (0x0f & 0x0f);\n // TODO *val_p = uv < 0x80000000UL ? uv : -((int32_t) (0xffffffffUL - uv)) - 1;\n offset += 5\n }\n "))},h.prototype.ltf8=function(e,t){return this.setNextParser("ltf8",e,t)},h.prototype.generateLtf8=function(e){var t=e.generateVariable(this.varName),r=e.generateTmpVariable();e.pushCode("\n var ".concat(r," = buffer[offset];\n if (").concat(r," < 0x80) {\n ").concat(t," = ").concat(r,";\n offset += 1;\n } else if (").concat(r," < 0xc0) {\n ").concat(t," = ((buffer[offset]<<8) | buffer[offset+1]) & 0x3fff;\n offset += 2;\n } else if (").concat(r," < 0xe0) {\n ").concat(t," = ((buffer[offset]<<16) | (buffer[offset+1]<<8) | buffer[offset+2]) & 0x1fffff;\n ").concat(t," = (((").concat(r," & 63) << 16) | buffer.readUInt16LE(offset + 1));\n offset += 3;\n } else if (").concat(r," < 0xf0) {\n ").concat(t," = ((buffer[offset]<<24) | (buffer[offset+1]<<16) | (buffer[offset+2]<<8) | buffer[offset+3]) & 0x0fffffff;\n offset += 4;\n } else if (").concat(r," < 0xf8) {\n ").concat(t," = (((buffer[offset] & 15) * Math.pow(2,32))) +\n (buffer[offset+1]<<24) | (buffer[offset+2]<<16 | buffer[offset+3]<<8 | buffer[offset+4])\n // TODO *val_p = uv < 0x80000000UL ? uv : -((int32_t) (0xffffffffUL - uv)) - 1;\n offset += 5;\n } else if (").concat(r," < 0xfc) {\n ").concat(t," = ((((buffer[offset] & 7) << 8) | buffer[offset+1] )) * Math.pow(2,32) +\n (buffer[offset+2]<<24) | (buffer[offset+3]<<16 | buffer[offset+4]<<8 | buffer[offset+5])\n offset += 6;\n } else if (").concat(r," < 0xfe) {\n ").concat(t," = ((((buffer[offset] & 3) << 16) | buffer[offset+1]<<8 | buffer[offset+2])) * Math.pow(2,32) +\n (buffer[offset+3]<<24) | (buffer[offset+4]<<16 | buffer[offset+5]<<8 | buffer[offset+6])\n offset += 7;\n } else if (").concat(r," < 0xff) {\n ").concat(t," = Long.fromBytesBE(buffer.slice(offset+1,offset+8));\n if (").concat(t,".greaterThan(Number.MAX_SAFE_INTEGER) || ").concat(t,".lessThan(Number.MIN_SAFE_INTEGER))\n throw new Error('integer overflow')\n ").concat(t," = ").concat(t,".toNumber()\n offset += 8;\n } else {\n ").concat(t," = Long.fromBytesBE(buffer.slice(offset+1,offset+9));\n if (").concat(t,".greaterThan(Number.MAX_SAFE_INTEGER) || ").concat(t,".lessThan(Number.MIN_SAFE_INTEGER))\n throw new Error('integer overflow')\n ").concat(t," = ").concat(t,".toNumber()\n offset += 9;\n }\n "))},t.i=h},94165:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e){return n="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)},n(e)}var o=function(){this.code="",this.scopes=[["vars"]],this.isAsync=!1,this.bitFields=[],this.tmpVariableCount=0,this.references={}};o.prototype.generateVariable=function(e){var t=[];for(Array.prototype.push.apply(t,this.scopes[this.scopes.length-1]);/^\$parent\./.test(e);)t.pop(),e=e.replace(/^\$parent\./,"");return e&&t.push(e),t.join(".")},o.prototype.generateOption=function(e){switch(n(e)){case"number":return e.toString();case"string":return this.generateVariable(e);case"function":return"(".concat(e,").call(").concat(this.generateVariable(),", vars)");default:return}},o.prototype.generateError=function(){var e=Array.prototype.slice.call(arguments),t=o.interpolate.apply(this,e);this.isAsync?this.pushCode("return process.nextTick(function() { callback(new Error(".concat(t,"), vars); });")):this.pushCode("throw new Error(".concat(t,");"))},o.prototype.generateTmpVariable=function(){return"$tmp".concat(this.tmpVariableCount++)},o.prototype.pushCode=function(){var e=Array.prototype.slice.call(arguments);this.code+="".concat(o.interpolate.apply(this,e),"\n")},o.prototype.pushPath=function(e){e&&this.scopes[this.scopes.length-1].push(e)},o.prototype.popPath=function(e){e&&this.scopes[this.scopes.length-1].pop()},o.prototype.pushScope=function(e){this.scopes.push([e])},o.prototype.popScope=function(){this.scopes.pop()},o.prototype.addReference=function(e){this.references[e]||(this.references[e]={resolved:!1,requested:!1})},o.prototype.markResolved=function(e){this.references[e].resolved=!0},o.prototype.markRequested=function(e){e.forEach(function(e){this.references[e].requested=!0}.bind(this))},o.prototype.getUnresolvedReferences=function(){var e=this.references;return Object.keys(this.references).filter((function(t){return!e[t].resolved&&!e[t].requested}))},o.interpolate=function(e){var t=e.match(/{\d+}/g),r=Array.prototype.slice.call(arguments,1);return t&&t.forEach((function(t){var n=parseInt(t.substr(1,t.length-2),10);e=e.replace(t,r[n].toString())})),e},t.o=o},44841:e=>{e.exports.runInThisContext=function(e){return new Function("code","return eval(code);").call(globalThis,e)}},67245:(e,t,r)=>{"use strict";r.d(t,{A:()=>ie});var n={};r.r(n),r.d(n,{escape:()=>y,escapeColumn:()=>v,formatAttributes:()=>w,formatComment:()=>E,formatDirective:()=>O,formatFeature:()=>x,formatItem:()=>P,formatSequence:()=>j,parseAttributes:()=>m,parseDirective:()=>g,parseFeature:()=>b,unescape:()=>d});var o=r(47775),i=r(10136);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r".concat(e.id).concat(e.description?" ".concat(e.description):"","\n").concat(e.sequence,"\n")}function P(e){function t(e){return"attributes"in e?x(e):"directive"in e?O(e):"sequence"in e?j(e):"comment"in e?E(e):"# (invalid item found during format)\n"}return Array.isArray(e)?e.map(t):t(e)}function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function C(e){return function(e){if(Array.isArray(e))return M(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||I(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function L(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r\s*(\S+)\s*(.*)/.exec(e);t?(this._flush(),this.currentSequence={id:t[1],sequence:""},t[2]&&(this.currentSequence.description=t[2].trim())):this.currentSequence&&/\S/.test(e)&&(this.currentSequence.sequence+=e.replace(/\s/g,""))}},{key:"_flush",value:function(){this.currentSequence&&this.seqCallback(this.currentSequence)}},{key:"finish",value:function(){this._flush()}}]),e}(),z=function(){function e(t){R(this,e),this.fastaParser=void 0,this.eof=!1,this.lineNumber=0,this._underConstructionTopLevel=[],this._underConstructionById={},this._completedReferences={},this._underConstructionOrphans={};var r=function(){};this.featureCallback=t.featureCallback||r,this.endCallback=t.endCallback||r,this.commentCallback=t.commentCallback||r,this.errorCallback=t.errorCallback||r,this.directiveCallback=t.directiveCallback||r,this.sequenceCallback=t.sequenceCallback||r,this.disableDerivesFromReferences=t.disableDerivesFromReferences||!1,this.bufferSize=void 0===t.bufferSize?1e3:t.bufferSize}return F(e,[{key:"addLine",value:function(e){if(this.fastaParser)this.fastaParser.addLine(e);else if(!this.eof)if(this.lineNumber+=1,/^\s*[^#\s>]/.test(e))this._bufferLine(e);else{var t=/^\s*(#+)(.*)/.exec(e);if(t){var r=T(t,2)[1],n=T(t,3)[2];if(3===r.length)this._emitAllUnderConstructionFeatures();else if(2===r.length){var o=g(e);o&&("FASTA"===o.directive?(this._emitAllUnderConstructionFeatures(),this.eof=!0,this.fastaParser=new B(this.sequenceCallback)):this._emitItem(o))}else n=n.replace(/\s*/,""),this._emitItem({comment:n})}else if(/^\s*$/.test(e));else{if(!/^\s*>/.test(e)){var i=e.replace(/\r?\n?$/g,"");throw new Error("GFF3 parse error. Cannot parse '".concat(i,"'."))}this._emitAllUnderConstructionFeatures(),this.eof=!0,this.fastaParser=new B(this.sequenceCallback),this.fastaParser.addLine(e)}}}},{key:"finish",value:function(){this._emitAllUnderConstructionFeatures(),this.fastaParser&&this.fastaParser.finish(),this.endCallback()}},{key:"_emitItem",value:function(e){Array.isArray(e)?this.featureCallback(e):"directive"in e?this.directiveCallback(e):"comment"in e&&this.commentCallback(e)}},{key:"_enforceBufferSizeLimit",value:function(){for(var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=function t(r){r&&Array.isArray(r)&&r[0].attributes&&r[0].attributes.ID&&r[0].attributes.ID[0]&&(r[0].attributes.ID.forEach((function(t){delete e._underConstructionById[t],delete e._completedReferences[t]})),r.forEach((function(e){e.child_features&&e.child_features.forEach((function(e){return t(e)})),e.derived_features&&e.derived_features.forEach((function(e){return t(e)}))})))};this._underConstructionTopLevel.length+t>this.bufferSize;){var n=this._underConstructionTopLevel.shift();n&&(this._emitItem(n),r(n))}}},{key:"_emitAllUnderConstructionFeatures",value:function(){if(this._underConstructionTopLevel.forEach(this._emitItem.bind(this)),this._underConstructionTopLevel=[],this._underConstructionById={},this._completedReferences={},Array.from(Object.values(this._underConstructionOrphans)).length)throw new Error("some features reference other features that do not exist in the file (or in the same '###' scope). ".concat(Object.keys(this._underConstructionOrphans)))}},{key:"_bufferLine",value:function(e){var t,r,n,o=this,i=L(L({},b(e)),{},{child_features:[],derived_features:[]}),a=(null===(t=i.attributes)||void 0===t?void 0:t.ID)||[],u=(null===(r=i.attributes)||void 0===r?void 0:r.Parent)||[],c=this.disableDerivesFromReferences?[]:(null===(n=i.attributes)||void 0===n?void 0:n.Derives_from)||[];if(a.length||u.length||c.length){var l=void 0;a.forEach((function(e){var t=o._underConstructionById[e];t?(t[t.length-1].type!==i.type&&o._parseError('multi-line feature "'.concat(e,'" has inconsistent types: "').concat(i.type,'", "').concat(t[t.length-1].type,'"')),t.push(i),l=t):(l=[i],o._enforceBufferSizeLimit(1),u.length||c.length||o._underConstructionTopLevel.push(l),o._underConstructionById[e]=l,o._resolveReferencesTo(l,e))})),this._resolveReferencesFrom(l||[i],{Parent:u,Derives_from:c},a)}else this._emitItem([i])}},{key:"_resolveReferencesTo",value:function(e,t){var r=this._underConstructionOrphans[t];r&&(e.forEach((function(e){var t;(t=e.child_features).push.apply(t,C(r.Parent))})),e.forEach((function(e){var t;(t=e.derived_features).push.apply(t,C(r.Derives_from))})),delete this._underConstructionOrphans[t])}},{key:"_parseError",value:function(e){this.eof=!0,this.errorCallback("".concat(this.lineNumber,": ").concat(e))}},{key:"_resolveReferencesFrom",value:function(e,t,r){var n=this;function o(e,t,r){var n=e[t];n||(n={},e[t]=n);var o=n[r]||!1;return n[r]=!0,o}t.Parent.forEach((function(t){var i=n._underConstructionById[t];if(i){r.filter((function(e){return o(n._completedReferences,e,"Parent,".concat(t))})).length||i.forEach((function(t){t.child_features.push(e)}))}else{var a=n._underConstructionOrphans[t];a||(a={Parent:[],Derives_from:[]},n._underConstructionOrphans[t]=a),a.Parent.push(e)}})),t.Derives_from.forEach((function(t){var i=n._underConstructionById[t];if(i){r.filter((function(e){return o(n._completedReferences,e,"Derives_from,".concat(t))})).length||i.forEach((function(t){t.derived_features.push(e)}))}else{var a=n._underConstructionOrphans[t];a||(a={Parent:[],Derives_from:[]},n._underConstructionOrphans[t]=a),a.Derives_from.push(e)}}))}}]),e}(),G=r(94931);function U(e){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(e)}function H(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};H(this,t),(e=q(this,t,[{objectMode:!0}])).textBuffer="";var n=re(r);e.encoding=r.encoding||"utf8",e.decoder=new i.I;var o=e.push.bind(Y(e));return e.parser=new z({featureCallback:n.parseFeatures?o:void 0,directiveCallback:n.parseDirectives?o:void 0,commentCallback:n.parseComments?o:void 0,sequenceCallback:n.parseSequences?o:void 0,errorCallback:function(t){return e.emit("error",t)},bufferSize:n.bufferSize,disableDerivesFromReferences:n.disableDerivesFromReferences}),e}return K(t,e),W(t,[{key:"_addLine",value:function(e){e&&this.parser.addLine(e)}},{key:"_nextText",value:function(e){var t=this,r=(this.textBuffer+e).split(/\r?\n/);this.textBuffer=r.pop()||"",r.forEach((function(e){return t._addLine(e)}))}},{key:"_transform",value:function(e,t,r){this._nextText(this.decoder.write(e)),te(r)}},{key:"_flush",value:function(e){this.decoder.end&&this._nextText(this.decoder.end()),null!=this.textBuffer&&this._addLine(this.textBuffer),this.parser.finish(),te(e)}}]),t}(o.Transform),oe=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return H(this,t),(e=q(this,t,[Object.assign(r,{objectMode:!0})])).linesSinceLastSyncMark=0,e.haveWeEmittedData=!1,e.fastaMode=!1,e.minLinesBetweenSyncMarks=r.minSyncLines||100,e.insertVersionDirective=r.insertVersionDirective||!1,e}return K(t,e),W(t,[{key:"_transform",value:function(e,t,r){var n;if(!this.haveWeEmittedData&&this.insertVersionDirective){var o=Array.isArray(e)?e[0]:e;"directive"in o&&"gff-version"!==o.directive&&this.push("##gff-version 3\n")}if("sequence"in e&&!this.fastaMode&&(this.push("##FASTA\n"),this.fastaMode=!0),n=Array.isArray(e)?e.map(P).join(""):P(e),this.push(n),this.linesSinceLastSyncMark>=this.minLinesBetweenSyncMarks)this.push("###\n"),this.linesSinceLastSyncMark=0;else{for(var i=0,a=0;a0&&void 0!==arguments[0]?arguments[0]:{})},parseStringSync:function(e){if(!e)return[];var t=re(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),r=[],n=r.push.bind(r),o=new z({featureCallback:t.parseFeatures?n:void 0,directiveCallback:t.parseDirectives?n:void 0,commentCallback:t.parseComments?n:void 0,sequenceCallback:t.parseSequences?n:void 0,disableDerivesFromReferences:t.disableDerivesFromReferences||!1,bufferSize:1/0,errorCallback:function(e){throw e}});return e.split(/\r?\n/).forEach(o.addLine.bind(o)),o.finish(),r},formatSync:function(e){var t=[],r=[];e.forEach((function(e){"sequence"in e?r.push(e):t.push(e)}));var n=t.map(P).join("");return r.length&&(n+="##FASTA\n",n+=r.map(j).join("")),n},formatStream:function(){return new oe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},formatFile:function(e,t){var r=Z({insertVersionDirective:!0},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});return new Promise((function(n,o){e.pipe(new oe(r)).on("end",(function(){return n(null)})).on("error",o).pipe(t)}))},util:n}},92561:(e,t,r)=>{"use strict";r.d(t,{tP:()=>S,BL:()=>y});var n=r(39962),o=r(12388),i=r(85832).Buffer;function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(){u=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var i=t&&t.prototype instanceof g?t:g,a=Object.create(i.prototype),u=new T(n||[]);return o(a,"_invoke",{value:k(e,r,u)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h="suspendedStart",y="suspendedYield",v="executing",m="completed",b={};function g(){}function w(){}function S(){}var A={};f(A,c,(function(){return this}));var x=Object.getPrototypeOf,O=x&&x(x(I([])));O&&O!==r&&n.call(O,c)&&(A=O);var E=S.prototype=g.prototype=Object.create(A);function j(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function r(o,i,u,c){var l=d(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==a(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,u,c)}),(function(e){r("throw",e,u,c)})):t.resolve(f).then((function(e){s.value=e,u(s)}),(function(e){return r("throw",e,u,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=h;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=C(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=d(t,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=d(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function I(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r3?s[3]:void 0,o=s.length>2?s[2]:void 0,!((r=s.length>1&&void 0!==s[1]?s[1]:0)<0)){e.next=6;break}throw new TypeError("regionStart cannot be less than 0");case 6:if((void 0===o||o>t.length)&&(o=t.length),!(r>=o)){e.next=9;break}return e.abrupt("return","");case 9:return a=p(t,r),c=p(t,o)-a,l=i.allocUnsafe(c),e.next=14,this.fasta.read(l,0,c,a,n);case 14:return e.abrupt("return",l.toString("utf8").replace(/\s+/g,""));case 15:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})}],r&&c(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function m(e,t,r){return t=g(t),function(e,t){if(t&&("object"===v(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,b()?Reflect.construct(t,r||[],g(e).constructor):t.apply(e,r))}function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(b=function(){return!!e})()}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function w(e,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},w(e,t)}var S=function(e){function t(e){var r,n=e.fasta,i=e.path,a=e.fai,u=e.faiPath,c=e.gzi,l=e.gziPath;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),r=m(this,t,[{fasta:n,path:i,fai:a,faiPath:u}]),n&&c?r.fasta=new o.BgzfFilehandle({filehandle:n,gziFilehandle:c}):i&&l&&(r.fasta=new o.BgzfFilehandle({path:i,gziPath:l})),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}(t,e),r=t,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(y)},87906:(e,t,r)=>{"use strict";r.d(t,{wD:()=>ke});var n=r(87791),o=r.n(n),i=r(84137),a=r.n(i),u=r(85832),c=r(39962),l=r(12388);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function f(e){var t="function"==typeof Map?new Map:void 0;return f=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return function(e,t,r){if(p())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&d(o,r.prototype),o}(e,arguments,h(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),d(r,e)},f(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function y(e){if(e.greaterThan(Number.MAX_SAFE_INTEGER)||e.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");return e.toNumber()}var v=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=arguments,r=h(r=t),function(e,t){if(t&&("object"===s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,p()?Reflect.construct(r,n||[],h(e).constructor):r.apply(e,n));var e,r,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(t,e),r=t,Object.defineProperty(r,"prototype",{writable:!1}),r;var r}(f(Error));function m(e){if(e&&e.aborted){if("undefined"!=typeof DOMException)throw new DOMException("aborted","AbortError");var t=new v("aborted");throw t.code="ERR_ABORTED",t}}function b(e,t){var r=[],n=null;return 0===e.length?e:(e.sort((function(e,t){var r=e.minv.blockPosition-t.minv.blockPosition;return 0!==r?r:e.minv.dataPosition-t.minv.dataPosition})),e.forEach((function(e){var o,i;(!t||e.maxv.compareTo(t)>0)&&(null===n?(r.push(e),n=e):(o=n,(i=e).minv.blockPosition-o.maxv.blockPosition<65e3&&i.maxv.blockPosition-o.minv.blockPosition<5e6?e.maxv.compareTo(n.maxv)>0&&(n.maxv=e.maxv):(r.push(e),n=e)))})),r)}var g=r(12899),w=r.n(g);function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function A(e,t){for(var r=0;r0&&(e=n[t]);return e}}],(r=[{key:"toString",value:function(){return"".concat(this.blockPosition,":").concat(this.dataPosition)}},{key:"compareTo",value:function(e){return this.blockPosition-e.blockPosition||this.dataPosition-e.dataPosition}}])&&A(t.prototype,r),n&&A(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(arguments.length>2&&void 0!==arguments[2]&&arguments[2])throw new Error("big-endian virtual file offsets not implemented");return new O(1099511627776*e[t+7]+4294967296*e[t+6]+16777216*e[t+5]+65536*e[t+4]+256*e[t+3]+e[t+2],e[t+1]<<8|e[t])}function j(e){return j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}function P(e,t){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.minv=t,this.maxv=r,this.bin=n,this._fetchedSize=o}var t,r;return t=e,(r=[{key:"toUniqueString",value:function(){return"".concat(this.minv,"..").concat(this.maxv," (bin ").concat(this.bin,", fetchedSize ").concat(this.fetchedSize(),")")}},{key:"toString",value:function(){return this.toUniqueString()}},{key:"compareTo",value:function(e){return this.minv.compareTo(e.minv)||this.maxv.compareTo(e.maxv)||this.bin-e.bin}},{key:"fetchedSize",value:function(){return void 0!==this._fetchedSize?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}])&&P(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),_=["indices"];function L(e){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L(e)}function T(){T=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),u=new _(n||[]);return o(a,"_invoke",{value:j(e,r,u)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",v={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(I([])));A&&A!==r&&n.call(A,a)&&(w=A);var x=g.prototype=m.prototype=Object.create(w);function O(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,u){var c=f(e[o],e,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==L(s)&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?y:d,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function I(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function I(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function M(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function R(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){M(i,n,o,a,u,"next",e)}function u(e){M(i,n,o,a,u,"throw",e)}a(void 0)}))}}function N(e,t){for(var r=0;r0&&void 0!==o[0]?o[0]:{},e.next=3,this.parse(t);case 3:return(r=e.sent).indices,n=I(r,_),e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"_findFirstData",value:function(e,t){return e?e.compareTo(t)>0?t:e:t}},{key:"parse",value:(o=R(T().mark((function e(){var t,r=this,n=arguments;return T().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},this.parseP||(this.parseP=this._parse(t).catch((function(e){throw r.parseP=void 0,e}))),e.abrupt("return",this.parseP);case 3:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{key:"hasRefSeq",value:(n=R(T().mark((function e(t){var r,n,o,i=arguments;return T().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},e.next=3,this.parse(r);case 3:return o=e.sent,e.abrupt("return",!!(null===(n=o.indices[t])||void 0===n?void 0:n.binIndex));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}],r&&N(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function B(e){return B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B(e)}function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(e,t)||U(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=U(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function U(e,t){if(e){if("string"==typeof e)return H(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?H(e,t):void 0}}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function W(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function q(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){W(i,n,o,a,u,"next",e)}function u(e){W(i,n,o,a,u,"throw",e)}a(void 0)}))}}function Q(e,t){for(var r=0;r>26),1+((t-=1)>>26)],[9+(e>>23),9+(t>>23)],[73+(e>>20),73+(t>>20)],[585+(e>>17),585+(t>>17)],[4681+(e>>14),4681+(t>>14)]]}var ee=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),Y(this,t,arguments)}var r,n,o,i,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&X(e,t)}(t,e),r=t,n=[{key:"lineCount",value:(a=q(V().mark((function e(t){var r,n,o,i,a=arguments;return V().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},e.next=3,this.parse(r);case 3:if(n=e.sent){e.next=6;break}return e.abrupt("return",-1);case 6:if(o=n.refNameToId[t],n.indices[o]){e.next=10;break}return e.abrupt("return",-1);case 10:if(!(i=n.indices[o].stats)){e.next=13;break}return e.abrupt("return",i.lineCount);case 13:return e.abrupt("return",-1);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"_parse",value:(i=q(V().mark((function e(){var t,r,n,o,i,a,u,c,s,f,p,d,h,y,v,b,g,w,S,A=this,x=arguments;return V().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=x.length>0&&void 0!==x[0]?x[0]:{},e.next=3,this.filehandle.readFile(t);case 3:return r=e.sent,e.next=6,(0,l.unzip)(r);case 6:if(n=e.sent,m(t.signal),21578324===n.readUInt32LE(0)){e.next=10;break}throw new Error("Not a TBI file");case 10:if(o=n.readInt32LE(4),i=n.readInt32LE(8),a=65536&i?"zero-based-half-open":"1-based-closed",u={0:"generic",1:"SAM",2:"VCF"}[15&i]){e.next=17;break}throw new Error("invalid Tabix preset format flags ".concat(i));case 17:return c={ref:n.readInt32LE(12),start:n.readInt32LE(16),end:n.readInt32LE(20)},s=n.readInt32LE(24),37449,f=Math.pow(2,29),p=s?String.fromCharCode(s):null,d=n.readInt32LE(28),h=n.readInt32LE(32),y=this._parseNameBytes(n.slice(36,36+h)),v=y.refNameToId,b=y.refIdToName,g=36+h,S=new Array(o).fill(0).map((function(){var e=n.readInt32LE(g);g+=4;for(var t,r={},o=0;o37450)throw new Error("tabix index contains too many bins, please use a CSI index");if(37450===i){var a=n.readInt32LE(g);g+=4,2===a&&(t=A.parsePseudoBin(n,g)),g+=16*a}else{var u=n.readInt32LE(g);g+=4;for(var c=new Array(u),l=0;l3&&void 0!==P[3]?P[3]:{},r<0&&(r=0),e.next=4,this.parse(o);case 4:if(i=e.sent){e.next=7;break}return e.abrupt("return",[]);case 7:if(a=i.refNameToId[t],u=i.indices[a]){e.next=11;break}return e.abrupt("return",[]);case 11:(u.linearIndex.length?u.linearIndex[r>>14>=u.linearIndex.length?u.linearIndex.length-1:r>>14]:new O(0,0))||console.warn("querying outside of possible tabix range"),c=Z(r,n),l=[],s=G(c);try{for(s.s();!(f=s.n()).done;)for(p=z(f.value,2),d=p[0],h=p[1],y=d;y<=h;y++)if(u.binIndex[y]){v=G(u.binIndex[y]);try{for(v.s();!(m=v.n()).done;)g=m.value,l.push(new C(g.minv,g.maxv,y))}catch(e){v.e(e)}finally{v.f()}}}catch(e){s.e(e)}finally{s.f()}for(w=u.linearIndex.length,S=null,A=Math.min(r>>14,w-1),x=Math.min(n>>14,w-1),E=A;E<=x;++E)(j=u.linearIndex[E])&&(!S||j.compareTo(S)<0)&&(S=j);return e.abrupt("return",b(l,S));case 23:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return o.apply(this,arguments)})}],n&&Q(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),t}(D);function te(e){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(e)}function re(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ne(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ne(e,t){if(e){if("string"==typeof e)return oe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oe(e,t):void 0}}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function ce(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function le(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ce(i,n,o,a,u,"next",e)}function u(e){ce(i,n,o,a,u,"throw",e)}a(void 0)}))}}function se(e,t){for(var r=0;r1&&void 0!==a[1]?a[1]:{},e.next=3,this.parse(r);case 3:if(n=e.sent){e.next=6;break}return e.abrupt("return",-1);case 6:if(o=n.refNameToId[t],n.indices[o]){e.next=10;break}return e.abrupt("return",-1);case 10:if(!(i=n.indices[o].stats)){e.next=13;break}return e.abrupt("return",i.lineCount);case 13:return e.abrupt("return",-1);case 14:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"indexCov",value:function(){throw new Error("CSI indexes do not support indexcov")}},{key:"parseAuxData",value:function(e,t){var r=e.readInt32LE(t),n=65536&r?"zero-based-half-open":"1-based-closed",o={0:"generic",1:"SAM",2:"VCF"}[15&r];if(!o)throw new Error("invalid Tabix preset format flags ".concat(r));var i={ref:e.readInt32LE(t+4),start:e.readInt32LE(t+8),end:e.readInt32LE(t+12)},a=e.readInt32LE(t+16),u=a?String.fromCharCode(a):null,c=e.readInt32LE(t+20),l=e.readInt32LE(t+24),s=this._parseNameBytes(e.slice(t+28,t+28+l));return{refIdToName:s.refIdToName,refNameToId:s.refNameToId,skipLines:c,metaChar:u,columnNumbers:i,format:o,coordinateType:n}}},{key:"_parseNameBytes",value:function(e){for(var t=0,r=0,n=[],o={},i=0;i0&&void 0!==d[0]?d[0]:{},e.t0=l.unzip,e.next=4,this.filehandle.readFile(t);case 4:return e.t1=e.sent,e.next=7,(0,e.t0)(e.t1);case 7:if(21582659!==(r=e.sent).readUInt32LE(0)){e.next=12;break}n=1,e.next=17;break;case 12:if(38359875!==r.readUInt32LE(0)){e.next=16;break}n=2,e.next=17;break;case 16:throw new Error("Not a CSI file");case 17:return this.minShift=r.readInt32LE(4),this.depth=r.readInt32LE(8),this.maxBinNumber=((1<<3*(this.depth+1))-1)/7,o=Math.pow(2,this.minShift+3*this.depth),i=r.readInt32LE(12),a=i&&i>=30?this.parseAuxData(r,16):{refIdToName:[],refNameToId:{},metaChar:null,columnNumbers:{ref:0,start:1,end:2},coordinateType:"zero-based-half-open",format:"generic"},u=r.readInt32LE(16+i),s=16+i+4,f=new Array(u).fill(0).map((function(){var e=r.readInt32LE(s);s+=4;for(var t,n={},o=0;op.maxBinNumber)t=p.parsePseudoBin(r,s+4),s+=48;else{var a=E(r,s+4);c=p._findFirstData(c,a);var u=r.readInt32LE(s+12);s+=16;for(var l=new Array(u),f=0;f3&&void 0!==w[3]?w[3]:{},r<0&&(r=0),e.next=4,this.parse(o);case 4:if(i=e.sent){e.next=7;break}return e.abrupt("return",[]);case 7:if(a=i.refNameToId[t],u=i.indices[a]){e.next=11;break}return e.abrupt("return",[]);case 11:c=this.reg2bins(r,n),l=[],s=re(c);try{for(s.s();!(f=s.n()).done;)for(S=f.value,A=2,p=function(e){if(Array.isArray(e))return e}(S)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(S,A)||ne(S,A)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),d=p[0],h=p[1],y=d;y<=h;y++)if(u.binIndex[y]){v=re(u.binIndex[y]);try{for(v.s();!(m=v.n()).done;)g=m.value,l.push(new C(g.minv,g.maxv,y))}catch(e){v.e(e)}finally{v.f()}}}catch(e){s.e(e)}finally{s.f()}return e.abrupt("return",b(l,new O(0,0)));case 16:case"end":return e.stop()}var S,A}),e,this)}))),function(e,t,r){return o.apply(this,arguments)})},{key:"reg2bins",value:function(e,t){(e-=1)<1&&(e=1),t>Math.pow(2,50)&&(t=Math.pow(2,34)),t-=1;for(var r,n=0,o=0,i=this.minShift+3*this.depth,a=[];n<=this.depth;i-=3,o+=(r=3*n,1*Math.pow(2,r)),n+=1){var u=o+ve(e,i),c=o+ve(t,i);if(c-u+a.length>this.maxBinNumber)throw new Error("query ".concat(e,"-").concat(t," is too large for current binning scheme (shift ").concat(this.minShift,", depth ").concat(this.depth,"), try a smaller query or a coarser index binning scheme"));a.push([u,c])}return a}}],n&&se(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),t}(D);function be(e){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(e)}function ge(){ge=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var i=t&&t.prototype instanceof m?t:m,a=Object.create(i.prototype),u=new _(n||[]);return o(a,"_invoke",{value:j(e,r,u)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",v={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,A=S&&S(S(L([])));A&&A!==r&&n.call(A,a)&&(w=A);var x=g.prototype=m.prototype=Object.create(w);function O(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,u){var c=f(e[o],e,i);if("throw"!==c.type){var l=c.arg,s=l.value;return s&&"object"==be(s)&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(s).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=p;return function(i,a){if(o===h)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=P(u,n);if(c){if(c===v)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?y:d,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:L(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function we(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Se(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Se(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function Se(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rthis.chunkSizeLimit)){e.next=30;break}throw new Error("Too much data. Chunk size ".concat(v.toLocaleString()," bytes exceeds chunkSizeLimit of ").concat(this.chunkSizeLimit.toLocaleString(),"."));case 30:e.next=25;break;case 32:e.next=37;break;case 34:e.prev=34,e.t0=e.catch(23),d.e(e.t0);case 37:return e.prev=37,d.f(),e.finish(37);case 40:b=Date.now(),g=we(p),e.prev=42,g.s();case 44:if((w=g.n()).done){e.next=83;break}return S=w.value,A=void 0,e.next=49,this.chunkCache.get(S.toString(),S,a);case 49:x=e.sent,O=x.buffer,E=x.cpositions,j=x.dpositions,m(a),P=0,k=0;case 56:if(!(P=j[k++];);k--}if(T=this.checkLine(l,t,s,f,L),I=T.startCoordinate,M=T.overlaps,!(void 0!==A&&void 0!==I&&A>I)){e.next=66;break}throw new Error("Lines not sorted by start coordinate (".concat(A," > ").concat(I,"), this file is not usable with Tabix."));case 66:if(A=I,!M){e.next=71;break}c(L.trim(),256*E[k]+(P-j[k])+S.minv.dataPosition+1),e.next=73;break;case 71:if(!(void 0!==I&&I>=f)){e.next=73;break}return e.abrupt("return");case 73:if(!(this.yieldTime&&b-Date.now()>this.yieldTime)){e.next=78;break}return b=Date.now(),m(a),e.next=78,Pe(1);case 78:P=C+1,e.next=56;break;case 81:e.next=44;break;case 83:e.next=88;break;case 85:e.prev=85,e.t1=e.catch(42),g.e(e.t1);case 88:return e.prev=88,g.f(),e.finish(88);case 91:case"end":return e.stop()}}),e,this,[[23,34,37,40],[42,85,88,91]])}))),function(e,t,r,n){return y.apply(this,arguments)})},{key:"getMetadata",value:(h=xe(ge().mark((function e(){var t,r=arguments;return ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:{},e.abrupt("return",this.index.getMetadata(t));case 2:case"end":return e.stop()}}),e,this)}))),function(){return h.apply(this,arguments)})},{key:"getHeaderBuffer",value:(d=xe(ge().mark((function e(){var t,r,n,o,i,a,u,c,s,f,p,d,h=arguments;return ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=h.length>0&&void 0!==h[0]?h[0]:{},e.next=3,this.getMetadata(t);case 3:return r=e.sent,n=r.firstDataLine,o=r.metaChar,i=r.maxBlockSize,m(t.signal),a=((null==n?void 0:n.blockPosition)||0)+i,e.next=11,this._readRegion(0,a,t);case 11:return u=e.sent,e.next=14,(0,l.unzip)(u);case 14:if(c=e.sent,!o){e.next=28;break}s=-1,f="\n".charCodeAt(0),p=o.charCodeAt(0),d=0;case 20:if(!(d0&&void 0!==n[0]?n[0]:{},e.next=3,this.getHeaderBuffer(t);case 3:return r=e.sent,e.abrupt("return",r.toString("utf8"));case 5:case"end":return e.stop()}}),e,this)}))),function(){return p.apply(this,arguments)})},{key:"getReferenceSequenceNames",value:(f=xe(ge().mark((function e(){var t,r,n=arguments;return ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.next=3,this.getMetadata(t);case 3:return r=e.sent,e.abrupt("return",r.refIdToName);case 5:case"end":return e.stop()}}),e,this)}))),function(){return f.apply(this,arguments)})},{key:"checkLine",value:function(e,t,r,n,o){var i=e.columnNumbers,a=e.metaChar,u=e.coordinateType,c=e.format;if(a&&o.startsWith(a))return{overlaps:!1};var l=i.ref,s=i.start,f=i.end;l||(l=0),s||(s=0),f||(f=0),"VCF"===c&&(f=8);for(var p=Math.max(l,s,f),d=1,h=0,y="",v=-1/0,m=0;m=n)return{startCoordinate:v,overlaps:!1};if((0===f||f===s)&&v+1<=r)return{startCoordinate:v,overlaps:!1}}else if("VCF"===c&&4===d)y=o.slice(h,m);else if(d===f&&("VCF"===c?this._getVcfEnd(v,y,o.slice(h,m)):parseInt(o.slice(h,m),10))<=r)return{overlaps:!1};if(h=m+1,(d+=1)>p)break}return{startCoordinate:v,overlaps:!0}}},{key:"_getVcfEnd",value:function(e,t,r){var n=e+t.length,o=r.includes("SVTYPE=TRA");if("."===r[0]||o){if(o)return e+1}else for(var i=";",a=0;a1&&void 0!==n[1]?n[1]:{},e.abrupt("return",this.index.lineCount(t,r));case 2:case"end":return e.stop()}}),e,this)}))),function(e){return s.apply(this,arguments)})},{key:"_readRegion",value:(i=xe(ge().mark((function e(t,r){var n,o,i,a,c,l=arguments;return ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>2&&void 0!==l[2]?l[2]:{},o=u.Buffer.alloc(r),e.next=4,this.filehandle.read(o,0,r,t,n);case 4:return i=e.sent,a=i.bytesRead,c=i.buffer,e.abrupt("return",c.slice(0,a));case 8:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"readChunk",value:(n=xe(ge().mark((function e(t){var r,n,o=arguments;return ge().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},e.next=3,this._readRegion(t.minv.blockPosition,t.fetchedSize(),r);case 3:return n=e.sent,e.abrupt("return",(0,l.unzipChunkSlice)(n,t));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}],r&&Oe(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},61:(e,t,r)=>{"use strict";r.d(t,{A:()=>f,h:()=>s});const n={InfoFields:{AA:{Number:1,Type:"String",Description:"Ancestral allele"},AC:{Number:"A",Type:"Integer",Description:"Allele count in genotypes, for each ALT allele, in the same order as listed"},AD:{Number:"R",Type:"Integer",Description:"Total read depth for each allele"},ADF:{Number:"R",Type:"Integer",Description:"Read depth for each allele on the forward strand"},ADR:{Number:"R",Type:"Integer",Description:"Read depth for each allele on the reverse strand"},AF:{Number:"A",Type:"Float",Description:"Allele frequency for each ALT allele in the same order as listed (estimated from primary data, not called genotypes)"},AN:{Number:1,Type:"Integer",Description:"Total number of alleles in called genotypes"},BQ:{Number:1,Type:"Float",Description:"RMS base quality"},CIGAR:{Number:1,Type:"Float",Description:"Cigar string describing how to align an alternate allele to the reference allele"},DB:{Number:0,Type:"Flag",Description:"dbSNP membership"},DP:{Number:1,Type:"Integer",Description:"combined depth across samples"},END:{Number:1,Type:"Integer",Description:"End position (for use with symbolic alleles)"},H2:{Number:0,Type:"Flag",Description:"HapMap2 membership"},H3:{Number:0,Type:"Flag",Description:"HapMap3 membership"},MQ:{Number:1,Type:null,Description:"RMS mapping quality"},MQ0:{Number:1,Type:"Integer",Description:"Number of MAPQ == 0 reads"},NS:{Number:1,Type:"Integer",Description:"Number of samples with data"},SB:{Number:4,Type:"Integer",Description:"Strand bias"},SOMATIC:{Number:0,Type:"Flag",Description:"Somatic mutation (for cancer genomics)"},VALIDATED:{Number:0,Type:"Flag",Description:"Validated by follow-up experiment"},"1000G":{Number:0,Type:"Flag",Description:"1000 Genomes membership"},IMPRECISE:{Number:0,Type:"Flag",Description:"Imprecise structural variation"},NOVEL:{Number:0,Type:"Flag",Description:"Indicates a novel structural variation"},SVTYPE:{Number:1,Type:"String",Description:"Type of structural variant"},SVLEN:{Number:null,Type:"Integer",Description:"Difference in length between REF and ALT alleles"},CIPOS:{Number:2,Type:"Integer",Description:"Confidence interval around POS for imprecise variants"},CIEND:{Number:2,Type:"Integer",Description:"Confidence interval around END for imprecise variants"},HOMLEN:{Type:"Integer",Description:"Length of base pair identical micro-homology at event breakpoints"},HOMSEQ:{Type:"String",Description:"Sequence of base pair identical micro-homology at event breakpoints"},BKPTID:{Type:"String",Description:"ID of the assembled alternate allele in the assembly file"},MEINFO:{Number:4,Type:"String",Description:"Mobile element info of the form NAME,START,END,POLARITY"},METRANS:{Number:4,Type:"String",Description:"Mobile element transduction info of the form CHR,START,END,POLARITY"},DGVID:{Number:1,Type:"String",Description:"ID of this element in Database of Genomic Variation"},DBVARID:{Number:1,Type:"String",Description:"ID of this element in DBVAR"},DBRIPID:{Number:1,Type:"String",Description:"ID of this element in DBRIP"},MATEID:{Number:null,Type:"String",Description:"ID of mate breakends"},PARID:{Number:1,Type:"String",Description:"ID of partner breakend"},EVENT:{Number:1,Type:"String",Description:"ID of event associated to breakend"},CILEN:{Number:2,Type:"Integer",Description:"Confidence interval around the inserted material between breakend"},DPADJ:{Type:"Integer",Description:"Read Depth of adjacency"},CN:{Number:1,Type:"Integer",Description:"Copy number of segment containing breakend"},CNADJ:{Number:null,Type:"Integer",Description:"Copy number of adjacency"},CICN:{Number:2,Type:"Integer",Description:"Confidence interval around copy number for the segment"},CICNADJ:{Number:null,Type:"Integer",Description:"Confidence interval around copy number for the adjacency"}},GenotypeFields:{AD:{Number:"R",Type:"Integer",Description:"Read depth for each allele"},ADF:{Number:"R",Type:"Integer",Description:"Read depth for each allele on the forward strand"},ADR:{Number:"R",Type:"Integer",Description:"Read depth for each allele on the reverse strand"},DP:{Number:1,Type:"Integer",Description:"Read depth"},EC:{Number:"A",Type:"Integer",Description:"Expected alternate allele counts"},FT:{Number:1,Type:"String",Description:'Filter indicating if this genotype was "called"'},GL:{Number:"G",Type:"Float",Description:"Genotype likelihoods"},GP:{Number:"G",Type:"Float",Description:"Genotype posterior probabilities"},GQ:{Number:1,Type:"Integer",Description:"Conditional genotype quality"},GT:{Number:1,Type:"String",Description:"Genotype"},HQ:{Number:2,Type:"Integer",Description:"Haplotype quality"},MQ:{Number:1,Type:"Integer",Description:"RMS mapping quality"},PL:{Number:"G",Type:"Integer",Description:"Phred-scaled genotype likelihoods rounded to the closest integer"},PQ:{Number:1,Type:"Integer",Description:"Phasing quality"},PS:{Number:1,Type:"Integer",Description:"Phase set"}},AltTypes:{DEL:{Description:"Deletion relative to the reference"},INS:{Description:"Insertion of novel sequence relative to the reference"},DUP:{Description:"Region of elevated copy number relative to the reference"},INV:{Description:"Inversion of reference sequence"},CNV:{Description:"Copy number variable region (may be both deletion and duplication)"},"DUP:TANDEM":{Description:"Tandem duplication"},"DEL:ME":{Description:"Deletion of mobile element relative to the reference"},"INS:ME":{Description:"Insertion of a mobile element relative to the reference"},NON_REF:{Description:"Represents any possible alternative allele at this location"},"*":{Description:"Represents any possible alternative allele at this location"}},FilterTypes:{PASS:{Description:"Passed all filters"}}};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1){for(var r,n,o,i=e.includes("[")?"right":"left",a=0;a(.*)");if(!c)throw new Error("failed to parse ".concat(e));var l=null==c?void 0:c[2];return l?{Join:"left",Replacement:l,MateDirection:"right",MatePosition:"<".concat(null==c?void 0:c[1],">:1")}:void 0}if(e.includes("<")){var s=e.match("(.*)<(.*)>");if(!s)throw new Error("failed to parse ".concat(e));var f=null==s?void 0:s[1];return f?{Join:"right",Replacement:f,MateDirection:"right",MatePosition:"<".concat(null==s?void 0:s[2],">:1")}:void 0}}const f=function(){function e(t){var r=this,o=t.header,i=void 0===o?"":o,a=t.strict,u=void 0===a||a;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!i||!i.length)throw new Error("empty header received");var c,l=i.split(/[\r\n]+/).filter((function(e){return e}));if(!l.length)throw new Error("no non-empty header lines specified");if(this.strict=u,this.metadata=JSON.parse(JSON.stringify({INFO:n.InfoFields,FORMAT:n.GenotypeFields,ALT:n.AltTypes,FILTER:n.FilterTypes})),l.forEach((function(e){if(!e.startsWith("#"))throw new Error("Bad line in header:\n".concat(e));e.startsWith("##")?r._parseMetadata(e):c=e})),!c)throw new Error("No format line found in header");var s=c.trim().split("\t"),f=s.slice(0,8),p=["#CHROM","POS","ID","REF","ALT","QUAL","FILTER","INFO"];if(s.length<8)throw new Error("VCF header missing columns:\n".concat(c));if(f.length!==p.length||!f.every((function(e,t){return e===p[t]})))throw new Error("VCF column headers not correct:\n".concat(c));this.samples=s.slice(9)}var t,r;return t=e,r=[{key:"_parseGenotypes",value:function(e,t){var r=this,n=t.split("\t"),o={},i=null==e?void 0:e.split(":");return i&&this.samples.forEach((function(e,t){o[e]={},i.forEach((function(t){o[e][t]=null})),n[t].split(":").filter((function(e){return e})).forEach((function(t,n){var a;if(""===t||"."===t||void 0===t)a=null;else{var u=t.split(",").map((function(e){return"."===e?null:e})),c=r.getMetadata("FORMAT",i[n],"Type");a="Integer"===c||"Float"===c?u.map((function(e){return e?+e:e})):u}o[e][i[n]]=a}),{})})),o}},{key:"_parseMetadata",value:function(e){var t=e.trim().match(/^##(.+?)=(.*)/);if(!t)throw new Error("Line is not a valid metadata line: ".concat(e));var r=i(t.slice(1,3),2),n=r[0],o=r[1];if(o.startsWith("<")){n in this.metadata||(this.metadata[n]={});var a=i(this._parseStructuredMetaVal(o),2),u=a[0],c=a[1];this.metadata[n][u]=c}else this.metadata[n]=o}},{key:"_parseStructuredMetaVal",value:function(e){var t=this._parseKeyValue(e.replace(/^<|>$/g,""),","),r=t.ID;return delete t.ID,"Number"in t&&(Number.isNaN(Number(t.Number))||(t.Number=Number(t.Number))),[r,t]}},{key:"getMetadata",value:function(){for(var e=this.metadata,t=arguments.length,r=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:";",r={},n="",o="",i=1,a=0;ae.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function s(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&u.every((function(e){return(0,y.default)(e)}))?h.default.createElement(b.default,{key:o,name:o,prefix:P,value:u}):h.default.createElement(g.default,{key:o,name:o,value:u,description:f,prefix:P});if((0,y.default)(u)){t.omitSingleLevel;var p=l(t,i);return(0,m.isUriLocation)(u)?E?null:h.default.createElement(w.default,{key:o,name:o,prefix:P,value:u}):h.default.createElement(e,c(c({},p),{},{key:o,attributes:u,descriptions:d,prefix:[].concat(s(P),[o])}))}return h.default.createElement(S.default,{key:o,name:o,value:O(u,o),description:f,prefix:P,width:Math.min(L,170)})})))}},98330:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(41486)),i=r(3024),a=n(r(4990)),u=r(31050),c=r(87931),l=(0,i.makeStyles)()((function(e){return{fieldValue:{wordBreak:"break-word",maxHeight:300,fontSize:12,padding:e.spacing(.5),overflow:"auto"}}}));t.default=function(e){var t=e.value,r=l().classes,n="".concat(t).match(/^https?:\/\//);return o.default.createElement("div",{className:r.fieldValue},o.default.isValidElement(t)?t:n?o.default.createElement(u.Link,{href:"".concat(t)},"".concat(t)):o.default.createElement(c.SanitizedHTML,{html:(0,a.default)(t)?JSON.stringify(t):String(t)}))}},19895:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var o=["id"];function i(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e,t,r){var o;return o=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,"string");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==n(o)?o:String(o))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,o))})),L=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=l(e))){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(n);try{for(L.s();!(t=L.n()).done;)for(var T=t.value,I=0,M=Object.keys(T);Ie.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};return e.forEach((function(e){(0,i.default)(t)&&(t=t[e])})),"string"==typeof t?t:(0,i.default)(t)&&"string"==typeof(null==t?void 0:t.Description)?t.Description:void 0}},53387:function(e,t,r){"use strict";function n(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r2*p?"".concat(n.slice(0,p),"...").concat(n.slice(-p)):n):null)})),l?a.default.createElement("span",{style:{background:u.updownstreamColor}},l):null)}},36067:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(41486)),i=r(92536),a=r(66708);t.default=function(e){var t=e.cds,r=e.sequence;return o.default.createElement("span",{style:{background:i.cdsColor}},(0,a.stitch)(t,r))}},51233:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(41486)),i=r(92536);t.default=function(e){var t=e.sequence,r=e.upstream,n=e.downstream;return o.default.createElement(o.default.Fragment,null,r?o.default.createElement("span",{style:{background:i.updownstreamColor}},r):null,o.default.createElement("span",{style:{background:i.genomeColor}},t),n?o.default.createElement("span",{style:{background:i.updownstreamColor}},n):null)}},78600:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(41486)),i=r(66708),a=r(92536);t.default=function(e){for(var t=e.cds,r=e.sequence,n=e.codonTable,u=(0,i.stitch)(t,r),c="",l=0;le.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r".concat(r.name||r.id||"".concat(r.refName,":").concat(r.start+1,"-").concat(r.end),"-").concat(n,"\n")),u.default.createElement("br",null),"genomic"===n?u.default.createElement(p.default,{sequence:y}):"genomic_sequence_updownstream"===n?u.default.createElement(p.default,{sequence:y,upstream:m,downstream:g}):"cds"===n?u.default.createElement(d.default,{cds:A,sequence:y}):"cdna"===n?u.default.createElement(s.default,{exons:O,cds:A,utr:x,sequence:y,intronBp:a}):"protein"===n?u.default.createElement(f.default,{cds:A,codonTable:j,sequence:y}):"gene"===n?u.default.createElement(s.default,{exons:O,cds:A,utr:x,sequence:y,includeIntrons:!0,intronBp:a}):"gene_collapsed_intron"===n?u.default.createElement(s.default,{exons:O,cds:A,sequence:y,utr:x,includeIntrons:!0,collapseIntron:!0,intronBp:a}):"gene_updownstream"===n?u.default.createElement(s.default,{exons:O,cds:A,sequence:y,utr:x,upstream:m,downstream:g,includeIntrons:!0,intronBp:a}):"gene_updownstream_collapsed_intron"===n?u.default.createElement(s.default,{exons:O,cds:A,sequence:y,utr:x,upstream:m,downstream:g,includeIntrons:!0,collapseIntron:!0,intronBp:a}):u.default.createElement("div",null,"Unknown type")))}));t.default=h},64466:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){o=function(){return t};var e,t={},r=Object.prototype,i=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",s=u.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,i=Object.create(o.prototype),u=new T(n||[]);return a(i,"_invoke",{value:k(e,r,u)}),i}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h="suspendedStart",y="suspendedYield",v="executing",m="completed",b={};function g(){}function w(){}function S(){}var A={};f(A,c,(function(){return this}));var x=Object.getPrototypeOf,O=x&&x(x(I([])));O&&O!==r&&i.call(O,c)&&(A=O);var E=S.prototype=g.prototype=Object.create(A);function j(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function r(o,a,u,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==n(f)&&i.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,u,c)}),(function(e){r("throw",e,u,c)})):t.resolve(f).then((function(e){s.value=e,u(s)}),(function(e){return r("throw",e,u,c)}))}c(l.arg)}var o;a(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}})}function k(t,r,n){var o=h;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=C(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=d(t,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=d(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function I(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function i(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function u(e){i(a,n,o,u,c,"next",e)}function c(e){i(a,n,o,u,c,"throw",e)}u(void 0)}))}}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);rp)){e.next=7;break}d({error:"Genomic sequence larger than ".concat(p,'bp, use "force load" button to display')}),e.next=19;break;case 7:return l=i-r,s=a+r,e.next=11,b(i,a,u);case 11:return f=e.sent,e.next=14,b(Math.max(0,l),i,u);case 14:return h=e.sent,e.next=17,b(a,s,u);case 17:y=e.sent,c||d({seq:f,upstream:h,downstream:y});case 19:e.next=25;break;case 21:e.prev=21,e.t0=e.catch(0),console.error(e.t0),v(e.t0);case 25:case"end":return e.stop()}}),e,null,[[0,21]])})))(),function(){c=!0}}),[t,e,r,n]),{sequence:c,error:y}}},68486:function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genomeColor=t.updownstreamColor=t.cdsColor=t.proteinColor=t.utrColor=t.intronColor=void 0,t.intronColor=void 0,t.utrColor="rgb(200,240,240)",t.proteinColor="rgb(220,160,220)",t.cdsColor="rgb(220,220,180)",t.updownstreamColor="rgba(250,200,200)",t.genomeColor="rgb(200,280,200)"},7946:function(e,t,r){"use strict";var n=["featureData","finalizedFeatureData"],o=["unformattedFeatureData","featureData"];function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};t<=o||null===(n=e.subfeatures)||void 0===n||n.map((function(e){m(e,t,r,o+1,i),r(e)}))}function b(e){return s.types.model("BaseFeatureWidget",{id:y.ElementId,type:s.types.literal("BaseFeatureWidget"),featureData:s.types.frozen(),formattedFields:s.types.frozen(),unformattedFeatureData:s.types.frozen(),view:s.types.safeReference(e.pluggableMstType("view","stateModel")),track:s.types.safeReference(e.pluggableMstType("track","stateModel")),trackId:s.types.maybe(s.types.string),trackType:s.types.maybe(s.types.string),maxDepth:s.types.maybe(s.types.number)}).volatile((function(){return{error:void 0}})).actions((function(e){return{setFeatureData:function(t){e.unformattedFeatureData=t},clearFeatureData:function(){e.featureData=void 0},setFormattedData:function(t){e.featureData=t},setExtra:function(t,r,n){e.trackId=r,e.trackType=t,e.maxDepth=n},setError:function(t){e.error=t}}})).actions((function(e){return{afterCreate:function(){(0,s.addDisposer)(e,(0,f.autorun)((function(){try{var t=e.unformattedFeatureData,r=e.track,n=(0,h.getSession)(e);if(r&&e.setExtra(r.type,r.configuration.trackId,(0,d.getConf)(r,["formatDetails","maxDepth"])),t){var o=(0,p.default)(t),i=function(e,t){return c(c({},(0,d.getConf)(n,["formatDetails",e],{feature:t})),(0,d.getConf)(r,["formatDetails",e],{feature:t}))};r&&(o.__jbrowsefmt=i("feature",o),m(o,(0,d.getConf)(r,["formatDetails","depth"]),(function(e){e.__jbrowsefmt=i("subfeatures",e)}))),e.setFormattedData(o)}}catch(t){console.error(t),e.setError(t)}})))}}})).preProcessSnapshot((function(e){return c({unformattedFeatureData:e.featureData,featureData:e.finalizedFeatureData},a(e,n))})).postProcessSnapshot((function(e){e.unformattedFeatureData;var t=e.featureData,r=a(e,o);return c({finalizedFeatureData:JSON.parse(JSON.stringify(t,(function(e,t){return void 0===t?null:t})))},r)}))}t.configSchema=v,t.default=b,t.stateModelFactory=b},66708:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=r.start&&e.start<=r.start})),u=t.findIndex((function(e){return e.end>=o.end&&e.start<=o.end})),c=t[u],l=t[i],s=[].concat(n(t.slice(0,i)),[{start:l.start,end:r.start}]).map((function(e){return a(a({},e),{},{type:"five_prime_UTR"})})),f=[{start:o.end,end:c.end}].concat(n(t.slice(u+1))).map((function(e){return a(a({},e),{},{type:"three_prime_UTR"})}));return[].concat(n(s),n(f))},t.calculateUTRs2=function(e,t){if(!e.length)return[];var r=e.at(0),o=e.at(-1),i=[{start:t.start,end:r.start}].map((function(e){return a(a({},e),{},{type:"five_prime_UTR"})})),u=[{start:o.end,end:t.end}].map((function(e){return a(a({},e),{},{type:"three_prime_UTR"})}));return[].concat(n(i),n(u))},t.ellipses=function(e){return e.length>20?"".concat(e.slice(0,20),"..."):e}},41702:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.definitions=[],this.fetchESM=null==r?void 0:r.fetchESM,this.fetchCJS=null==r?void 0:r.fetchCJS,this.definitions=JSON.parse(JSON.stringify(t))}var t,r,n,u,c,s,f;return t=e,r=[{key:"loadCJSPlugin",value:(f=l(i().mark((function e(t,r){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("http:"===(n=new URL(t.cjsUrl,r)).protocol||"https:"===n.protocol){e.next=3;break}throw new Error('Cannot load plugins using protocol "'.concat(n.protocol,'"'));case 3:if(this.fetchCJS){e.next=5;break}throw new Error("No fetchCJS callback provided");case 5:return e.abrupt("return",this.fetchCJS(n.href));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"loadESMPlugin",value:(s=l(i().mark((function e(t,r){var n,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("http:"===(n="esmUrl"in t?new URL(t.esmUrl,r):new URL(t.esmLoc.uri,t.esmLoc.baseUri)).protocol||"https:"===n.protocol){e.next=3;break}throw new Error('cannot load plugins using protocol "'.concat(n.protocol,'"'));case 3:if(this.fetchESM){e.next=5;break}throw new Error("No ESM fetcher installed");case 5:return e.next=7,this.fetchESM(n.href);case 7:if(o=e.sent){e.next=10;break}throw new Error("Could not load ESM plugin: ".concat(n));case 10:return e.abrupt("return",o);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"loadUMDPlugin",value:(c=l(i().mark((function e(t,r){var n,o,a,u;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("http:"===(n="url"in t?new URL(t.url,r):"umdUrl"in t?new URL(t.umdUrl,r):new URL(t.umdLoc.uri,t.umdLoc.baseUri)).protocol||"https:"===n.protocol){e.next=3;break}throw new Error('cannot load plugins using protocol "'.concat(n.protocol,'"'));case 3:if(o=t.name,a="JBrowsePlugin".concat(o),"undefined"!=typeof jest){e.next=10;break}return e.next=8,b(n.href);case 8:e.next=11;break;case 10:globalThis[a]={default:p.default};case 11:if(u=globalThis[a]){e.next=14;break}throw new Error("Failed to load UMD bundle for ".concat(o,", ").concat(a," is undefined"));case 14:return e.abrupt("return",u);case 15:case"end":return e.stop()}}),e)}))),function(e,t){return c.apply(this,arguments)})},{key:"loadPlugin",value:(u=l(i().mark((function e(t,r){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!h.isElectron||!w(t)){e.next=6;break}return e.next=3,this.loadCJSPlugin(t,r);case 3:case 9:case 15:n=e.sent,e.next=23;break;case 6:if(!v(t)){e.next=12;break}return e.next=9,this.loadESMPlugin(t,r);case 12:if(!y(t)){e.next=18;break}return e.next=15,this.loadUMDPlugin(t,r);case 18:if(h.isElectron||!w(t)){e.next=22;break}throw new Error("CommonJS plugin found, but not in a NodeJS environment: ".concat(JSON.stringify(t)));case 22:throw new Error("Could not determine plugin type: ".concat(JSON.stringify(t)));case 23:if(n.default){e.next=25;break}throw new Error("".concat(S(t)," does not have a default export, cannot load"));case 25:return e.abrupt("return",n.default);case 26:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"installGlobalReExports",value:function(e){e.JBrowseExports=Object.fromEntries(Object.entries(d.default).map((function(e){var t,r,n=(r=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,r)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return[n[0],n[1]]})))}},{key:"load",value:(n=l(i().mark((function e(t){var r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(this.definitions.map(function(){var e=l(i().mark((function e(n){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.loadPlugin(n,t);case 2:return e.t0=e.sent,e.t1=n,e.abrupt("return",{plugin:e.t0,definition:e.t1});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})}],r&&a(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.default=A},91070:function(e,t,r){"use strict";function n(){n=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,a=Object.create(o.prototype),u=new T(n||[]);return i(a,"_invoke",{value:k(e,r,u)}),a}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var h="suspendedStart",y="suspendedYield",v="executing",m="completed",b={};function g(){}function w(){}function S(){}var A={};f(A,u,(function(){return this}));var x=Object.getPrototypeOf,O=x&&x(x(I([])));O&&O!==r&&o.call(O,u)&&(A=O);var E=S.prototype=g.prototype=Object.create(A);function j(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function P(e,t){function r(n,i,a,u){var c=d(e[n],e,i);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==l(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(f).then((function(e){s.value=e,a(s)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var n;i(this,"_invoke",{value:function(e,o){function i(){return new t((function(t,n){r(e,o,t,n)}))}return n=n?n.then(i,i):i()}})}function k(t,r,n){var o=h;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=C(u,n);if(c){if(c===b)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var l=d(t,r,n);if("normal"===l.type){if(o=n.done?m:y,l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function C(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,C(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var i=d(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,b;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function I(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function r(){for(;++n=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function o(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=u(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function a(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:[];s(this,e),this.plugins=[],this.jexl=(0,_.default)(),this.pluginMetadata={},this.runtimePluginDefinitions=[],this.elementCreationSchedule=new L("renderer","adapter","text search adapter","display","track","connection","view","widget","rpc method","internet account","add track workflow"),this.rendererTypes=new T("RendererType",v.default),this.adapterTypes=new T("AdapterType",m.default),this.textSearchAdapterTypes=new T("TextSearchAdapterType",E.default),this.trackTypes=new T("TrackType",b.default),this.displayTypes=new T("DisplayType",g.default),this.connectionTypes=new T("ConnectionType",A.default),this.viewTypes=new T("ViewType",w.default),this.widgetTypes=new T("WidgetType",S.default),this.rpcMethods=new T("RpcMethodType",x.default),this.addTrackWidgets=new T("AddTrackWorkflow",j.default),this.internetAccountTypes=new T("InternetAccountType",O.default),this.configured=!1,this.extensionPoints=new Map,this.jbrequireCache=new Map,this.lib=k.default,this.load=function(e){return t.jbrequireCache.has(e)||t.jbrequireCache.set(e,e(t)),t.jbrequireCache.get(e)},this.jbrequire=function(e){if("string"==typeof e){var r=t.lib[e];if(!r)throw new TypeError("No jbrequire re-export defined for package '".concat(e,"'. If this package must be shared between plugins, add it to ReExports.js. If it does not need to be shared, just import it normally."));return r}if("function"==typeof e)return t.load(e);if(e.default)return t.jbrequire(e.default);throw new TypeError("lib passed to jbrequire must be either a string or a function")},this.addPlugin({plugin:new C.default,metadata:{isCore:!0}}),r.forEach((function(e){t.addPlugin(e)}))}var t,r;return p(e,[{key:"pluginConfigurationSchemas",value:function(){var e={};return this.plugins.forEach((function(t){t.configurationSchema&&(e[t.name]=t.configurationSchema)})),e}},{key:"addPlugin",value:function(e){if(this.configured)throw new Error("JBrowse already configured, cannot add plugins");var t,r,n=(t="install"in e&&"configure"in e?[e,{}]:[e.plugin,e.metadata],r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(t,r)||u(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=n[0],i=n[1],a=void 0===i?{}:i;if(this.plugins.includes(o))throw new Error("plugin already installed");return this.pluginMetadata[o.name]=a,"definition"in e&&this.runtimePluginDefinitions.push(e.definition),o.install(this),this.plugins.push(o),this}},{key:"getPlugin",value:function(e){return this.plugins.find((function(t){return t.name===e}))}},{key:"hasPlugin",value:function(e){return void 0!==this.getPlugin(e)}},{key:"createPluggableElements",value:function(){return this.elementCreationSchedule&&(this.elementCreationSchedule.run(),delete this.elementCreationSchedule),this}},{key:"setRootModel",value:function(e){this.rootModel=e}},{key:"configure",value:function(){var e=this;if(this.configured)throw new Error("already configured");return this.plugins.forEach((function(t){return t.configure(e)})),this.configured=!0,this}},{key:"getElementTypeRecord",value:function(e){switch(e){case"adapter":return this.adapterTypes;case"text search adapter":return this.textSearchAdapterTypes;case"connection":return this.connectionTypes;case"widget":return this.widgetTypes;case"renderer":return this.rendererTypes;case"display":return this.displayTypes;case"track":return this.trackTypes;case"view":return this.viewTypes;case"rpc method":return this.rpcMethods;case"internet account":return this.internetAccountTypes;case"add track workflow":return this.addTrackWidgets;default:throw new Error("invalid element type '".concat(e,"'"))}}},{key:"addElementType",value:function(e,t){var r,n=this;if("function"!=typeof t)throw new Error("must provide a callback function that returns the new type object");var o=this.getElementTypeRecord(e);return null===(r=this.elementCreationSchedule)||void 0===r||r.add(e,(function(){var r=t(n);if(!r.name)throw new Error("cannot add a ".concat(e," with no name"));if(o.has(r.name))throw new Error("".concat(e," ").concat(r.name," already registered, cannot register it again"));o.add(r.name,n.evaluateExtensionPoint("Core-extendPluggableElement",r))})),this}},{key:"getElementType",value:function(e,t){return this.getElementTypeRecord(e).get(t)}},{key:"getElementTypesInGroup",value:function(e){return this.getElementTypeRecord(e).all()}},{key:"getTrackElements",value:function(){return this.getElementTypesInGroup("track")}},{key:"getConnectionElements",value:function(){return this.getElementTypesInGroup("connection")}},{key:"getAddTrackWorkflowElements",value:function(){return this.getElementTypesInGroup("add track workflow")}},{key:"getRpcElements",value:function(){return this.getElementTypesInGroup("rpc method")}},{key:"getDisplayElements",value:function(){return this.getElementTypesInGroup("display")}},{key:"getAdapterElements",value:function(){return this.getElementTypesInGroup("adapter")}},{key:"pluggableMstType",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:y.types.maybe(y.types.null),o=this.getElementTypeRecord(e).all().map((function(e){return e[t]})).filter((function(e){return(0,y.isType)(e)&&(0,y.isModelType)(e)}));return 0===o.length&&"undefined"==typeof jest?(console.warn("No pluggable types found matching ('".concat(e,"','").concat(t,"')")),n):(r=y.types).union.apply(r,a(o))}},{key:"pluggableConfigSchemaType",value:function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"configSchema",n=this.getElementTypeRecord(e).all().map((function(e){return e[r]})).filter((function(e){return(0,P.isBareConfigurationSchemaType)(e)}));return 0===n.length&&n.push((0,P.ConfigurationSchema)("Null",{})),(t=y.types).union.apply(t,a(n))}},{key:"getRendererType",value:function(e){return this.rendererTypes.get(e)}},{key:"getRendererTypes",value:function(){return this.rendererTypes.all()}},{key:"getAdapterType",value:function(e){return this.adapterTypes.get(e)}},{key:"getTextSearchAdapterType",value:function(e){return this.textSearchAdapterTypes.get(e)}},{key:"getTrackType",value:function(e){return this.trackTypes.get(e)}},{key:"getDisplayType",value:function(e){return this.displayTypes.get(e)}},{key:"getViewType",value:function(e){return this.viewTypes.get(e)}},{key:"getAddTrackWorkflow",value:function(e){return this.addTrackWidgets.get(e)}},{key:"getWidgetType",value:function(e){return this.widgetTypes.get(e)}},{key:"getConnectionType",value:function(e){return this.connectionTypes.get(e)}},{key:"getRpcMethodType",value:function(e){return this.rpcMethods.get(e)}},{key:"getInternetAccountType",value:function(e){return this.internetAccountTypes.get(e)}},{key:"addRendererType",value:function(e){return this.addElementType("renderer",e)}},{key:"addAdapterType",value:function(e){return this.addElementType("adapter",e)}},{key:"addTextSearchAdapterType",value:function(e){return this.addElementType("text search adapter",e)}},{key:"addTrackType",value:function(e){var t=this;return this.addElementType("track",(function(){var r=e(t);return t.getElementTypesInGroup("display").forEach((function(e){e.trackType!==r.name||r.displayTypes.includes(e)||r.addDisplayType(e)})),r}))}},{key:"addDisplayType",value:function(e){return this.addElementType("display",e)}},{key:"addViewType",value:function(e){var t=this;return this.addElementType("view",(function(){var r=e(t);return t.getElementTypesInGroup("display").forEach((function(e){e.viewType!==r.name&&e.viewType!==r.extendedName||r.displayTypes.includes(e)||r.addDisplayType(e)})),r}))}},{key:"addWidgetType",value:function(e){return this.addElementType("widget",e)}},{key:"addConnectionType",value:function(e){return this.addElementType("connection",e)}},{key:"addRpcMethod",value:function(e){return this.addElementType("rpc method",e)}},{key:"addInternetAccountType",value:function(e){return this.addElementType("internet account",e)}},{key:"addAddTrackWorkflowType",value:function(e){return this.addElementType("add track workflow",e)}},{key:"addToExtensionPoint",value:function(e,t){var r=this.extensionPoints.get(e);r||(r=[],this.extensionPoints.set(e,r)),r.push(t)}},{key:"evaluateExtensionPoint",value:function(e,t,r){var n=this.extensionPoints.get(e),o=t;if(n){var a,u=i(n);try{for(u.s();!(a=u.n()).done;){var c=a.value;try{o=c(o,r)}catch(e){console.error(e)}}}catch(e){u.e(e)}finally{u.f()}}return o}},{key:"evaluateAsyncExtensionPoint",value:(t=n().mark((function e(t,r,o){var a,u,c,l,s;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=this.extensionPoints.get(t),u=r,!a){e.next=27;break}c=i(a),e.prev=4,c.s();case 6:if((l=c.n()).done){e.next=19;break}return s=l.value,e.prev=8,e.next=11,s(u,o);case 11:u=e.sent,e.next=17;break;case 14:e.prev=14,e.t0=e.catch(8),console.error(e.t0);case 17:e.next=6;break;case 19:e.next=24;break;case 21:e.prev=21,e.t1=e.catch(4),c.e(e.t1);case 24:return e.prev=24,c.f(),e.finish(24);case 27:return e.abrupt("return",u);case 28:case"end":return e.stop()}}),e,this,[[4,21,24,27],[8,14]])})),r=function(){var e=this,r=arguments;return new Promise((function(n,i){var a=t.apply(e,r);function u(e){o(a,n,i,u,c,"next",e)}function c(e){o(a,n,i,u,c,"throw",e)}u(void 0)}))},function(e,t,n){return r.apply(this,arguments)})}]),e}();t.default=I},7862:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(52313);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.Attributes}})},13440:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(52313);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.BaseCard}})},25983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(52313);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.FeatureDetails}})},96039:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=r(15870);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n(o).default}})},72539:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=["mobx","mobx-state-tree","react","react/jsx-runtime","react-dom","mobx-react","@mui/x-data-grid","@mui/material/utils","@material-ui/core/utils","tss-react/mui","@material-ui/core","@mui/material","prop-types","@mui/material/styles","@material-ui/core/styles","@material-ui/core/Accordion","@material-ui/core/AccordionActions","@material-ui/core/AccordionDetails","@material-ui/core/Alert","@material-ui/core/AlertTitle","@material-ui/core/Autocomplete","@material-ui/core/Avatar","@material-ui/core/AvatarGroup","@material-ui/core/Backdrop","@material-ui/core/Badge","@material-ui/core/Box","@material-ui/core/Breadcrumbs","@material-ui/core/Button","@material-ui/core/ButtonGroup","@material-ui/core/Card","@material-ui/core/CardActions","@material-ui/core/CardActionArea","@material-ui/core/CardContent","@material-ui/core/CardHeader","@material-ui/core/CardMedia","@material-ui/core/CircularProgress","@material-ui/core/Collapse","@material-ui/core/ClickAwayListener","@material-ui/core/Chip","@material-ui/core/Checkbox","@material-ui/core/Container","@material-ui/core/Dialog","@material-ui/core/DialogActions","@material-ui/core/DialogTitle","@material-ui/core/DialogContent","@material-ui/core/DialogContentText","@material-ui/core/Divider","@material-ui/core/Drawer","@material-ui/core/Fab","@material-ui/core/Fade","@material-ui/core/FilledInput","@material-ui/core/FormLabel","@material-ui/core/FormControl","@material-ui/core/FormControlLabel","@material-ui/core/FormHelperText","@material-ui/core/FormGroup","@material-ui/core/Grid","@material-ui/core/Grow","@material-ui/core/Icon","@material-ui/core/IconButton","@material-ui/core/Input","@material-ui/core/InputBase","@material-ui/core/InputLabel","@material-ui/core/InputAdornment","@material-ui/core/Link","@material-ui/core/LinearProgress","@material-ui/core/List","@material-ui/core/ListItem","@material-ui/core/ListItemAvatar","@material-ui/core/ListItemSecondaryAction","@material-ui/core/ListItemIcon","@material-ui/core/ListSubheader","@material-ui/core/ListItemText","@material-ui/core/Menu","@material-ui/core/MenuItem","@material-ui/core/MenuList","@material-ui/core/Modal","@material-ui/core/NativeSelect","@material-ui/core/OutlinedInput","@material-ui/core/Pagination","@material-ui/core/PaginationItem","@material-ui/core/Paper","@material-ui/core/Popover","@material-ui/core/Popper","@material-ui/core/Portal","@material-ui/core/Radio","@material-ui/core/RadioGroup","@material-ui/core/Rating","@material-ui/core/ScopedCssBaseline","@material-ui/core/Select","@material-ui/core/Skeleton","@material-ui/core/Slider","@material-ui/core/Snackbar","@material-ui/core/SnackbarContent","@material-ui/core/SpeedDial","@material-ui/core/SpeedDialAction","@material-ui/core/SpeedDialIcon","@material-ui/core/Stack","@material-ui/core/Step","@material-ui/core/StepButton","@material-ui/core/StepConnector","@material-ui/core/StepLabel","@material-ui/core/StepIcon","@material-ui/core/Stepper","@material-ui/core/SvgIcon","@material-ui/core/Switch","@material-ui/core/Tab","@material-ui/core/Table","@material-ui/core/TableBody","@material-ui/core/TableCell","@material-ui/core/TableContainer","@material-ui/core/TableFooter","@material-ui/core/TableHead","@material-ui/core/TablePagination","@material-ui/core/TableRow","@material-ui/core/TableSortLabel","@material-ui/core/Tabs","@material-ui/core/TextField","@material-ui/core/TextareaAutosize","@material-ui/core/ToggleButton","@material-ui/core/ToggleButtonGroup","@material-ui/core/Toolbar","@material-ui/core/Tooltip","@material-ui/core/Typography","@mui/material/Accordion","@mui/material/AccordionActions","@mui/material/AccordionDetails","@mui/material/Alert","@mui/material/AlertTitle","@mui/material/Autocomplete","@mui/material/Avatar","@mui/material/AvatarGroup","@mui/material/Backdrop","@mui/material/Badge","@mui/material/Box","@mui/material/Breadcrumbs","@mui/material/Button","@mui/material/ButtonGroup","@mui/material/Card","@mui/material/CardActions","@mui/material/CardActionArea","@mui/material/CardContent","@mui/material/CardHeader","@mui/material/CardMedia","@mui/material/CircularProgress","@mui/material/Collapse","@mui/material/ClickAwayListener","@mui/material/Chip","@mui/material/Checkbox","@mui/material/Container","@mui/material/Dialog","@mui/material/DialogActions","@mui/material/DialogTitle","@mui/material/DialogContent","@mui/material/DialogContentText","@mui/material/Divider","@mui/material/Drawer","@mui/material/Fab","@mui/material/Fade","@mui/material/FilledInput","@mui/material/FormLabel","@mui/material/FormControl","@mui/material/FormControlLabel","@mui/material/FormHelperText","@mui/material/FormGroup","@mui/material/Grid","@mui/material/Grow","@mui/material/Icon","@mui/material/IconButton","@mui/material/Input","@mui/material/InputBase","@mui/material/InputLabel","@mui/material/InputAdornment","@mui/material/Link","@mui/material/LinearProgress","@mui/material/List","@mui/material/ListItem","@mui/material/ListItemAvatar","@mui/material/ListItemSecondaryAction","@mui/material/ListItemIcon","@mui/material/ListSubheader","@mui/material/ListItemText","@mui/material/Menu","@mui/material/MenuItem","@mui/material/MenuList","@mui/material/Modal","@mui/material/NativeSelect","@mui/material/OutlinedInput","@mui/material/Pagination","@mui/material/PaginationItem","@mui/material/Paper","@mui/material/Popover","@mui/material/Popper","@mui/material/Portal","@mui/material/Radio","@mui/material/RadioGroup","@mui/material/Rating","@mui/material/ScopedCssBaseline","@mui/material/Select","@mui/material/Skeleton","@mui/material/Slider","@mui/material/Snackbar","@mui/material/SnackbarContent","@mui/material/SpeedDial","@mui/material/SpeedDialAction","@mui/material/SpeedDialIcon","@mui/material/Stack","@mui/material/Step","@mui/material/StepButton","@mui/material/StepConnector","@mui/material/StepLabel","@mui/material/StepIcon","@mui/material/Stepper","@mui/material/SvgIcon","@mui/material/Switch","@mui/material/Tab","@mui/material/Table","@mui/material/TableBody","@mui/material/TableCell","@mui/material/TableContainer","@mui/material/TableFooter","@mui/material/TableHead","@mui/material/TablePagination","@mui/material/TableRow","@mui/material/TableSortLabel","@mui/material/Tabs","@mui/material/TextField","@mui/material/TextareaAutosize","@mui/material/ToggleButton","@mui/material/ToggleButtonGroup","@mui/material/Toolbar","@mui/material/Tooltip","@mui/material/Typography","@material-ui/lab/ToggleButton","@material-ui/lab/ToggleButtonGroup","@material-ui/lab/Autocomplete","@material-ui/lab/Alert","@material-ui/lab","@jbrowse/core/Plugin","@jbrowse/core/pluggableElementTypes","@jbrowse/core/pluggableElementTypes/ViewType","@jbrowse/core/pluggableElementTypes/AdapterType","@jbrowse/core/pluggableElementTypes/DisplayType","@jbrowse/core/pluggableElementTypes/TrackType","@jbrowse/core/pluggableElementTypes/WidgetType","@jbrowse/core/pluggableElementTypes/models","@jbrowse/core/pluggableElementTypes/renderers/ServerSideRendererType","@jbrowse/core/pluggableElementTypes/renderers/CircularChordRendererType","@jbrowse/core/pluggableElementTypes/renderers/BoxRendererType","@jbrowse/core/pluggableElementTypes/renderers/FeatureRendererType","@jbrowse/core/pluggableElementTypes/renderers/RendererType","@jbrowse/core/configuration","@jbrowse/core/util/types/mst","@jbrowse/core/ui","@jbrowse/core/util","@jbrowse/core/util/color","@jbrowse/core/util/layouts","@jbrowse/core/util/tracks","@jbrowse/core/util/Base1DViewModel","@jbrowse/core/util/io","@jbrowse/core/util/mst-reflection","@jbrowse/core/util/rxjs","@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail","@jbrowse/core/data_adapters/BaseAdapter"]},15870:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0)throw new Error("The following modules are in the modules libs, but not the re-exports list: ".concat(se.join(", ")));var fe=Y.default.filter((function(e){return!le.includes(e)}));if(fe.length)throw new Error("The following modules are in the re-exports list, but not the modules libs: ".concat(fe.join(", ")));t.default=ce},93015:(e,t)=>{"use strict";function r(e,t,r){return t=o(t),function(e,t){if(t&&("object"===a(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,n()?Reflect.construct(t,r||[],o(e).constructor):t.apply(e,r))}function n(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(n=function(){return!!e})()}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var r=0;r=0;--o){var a=this.tryEntries[o],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&i.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function i(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function a(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r