(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[5758],{43212:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return y},openFilehandleWrapper:function(){return m}});var r=n(59740),a=n(45754),u=n(86906),s=n(34795),c=n(9249),i=n(87371),o=n(77162),f=n.n(o),p=n(29598),h=n(26131),l=n(33528),v=n(9077),d=n(51754),w=n(49882).Buffer,b=["chromosomes"],k=function(){function e(t){(0,c.Z)(this,e),this.filehandle=t}return(0,i.Z)(e,[{key:"read",value:function(){var e=(0,s.Z)(f().mark((function e(t,n){var r,a,u;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.filehandle.read(w.allocUnsafe(n),0,n,t);case 2:return r=e.sent,a=r.buffer,u=r.bytesRead,e.abrupt("return",a.buffer.slice(a.byteOffset,a.byteOffset+u));case 6:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()}]),e}();function m(e){return new k((0,l.openLocation)(e))}var y=function(e){(0,a.Z)(n,e);var t=(0,u.Z)(n);function n(e,r,a){var u;(0,c.Z)(this,n),(u=t.call(this,e,r,a)).hic=void 0;var s=(0,v.readConfObject)(e,"hicLocation");return u.hic=new d.Z({file:m(s)}),u}return(0,i.Z)(n,[{key:"setup",value:function(){var e=(0,s.Z)(f().mark((function e(t){var n,r,a;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(t||{}).statusCallback,(r=void 0===n?function(){}:n)("Downloading .hic header"),e.next=4,this.hic.getMetaData();case 4:return a=e.sent,r(""),e.abrupt("return",a);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getHeader",value:function(){var e=(0,s.Z)(f().mark((function e(t){var n,a;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setup(t);case 2:return n=e.sent,n.chromosomes,a=(0,r.Z)(n,b),e.abrupt("return",a);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getRefNames",value:function(){var e=(0,s.Z)(f().mark((function e(t){var n;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setup(t);case 2:return n=e.sent,e.abrupt("return",n.chromosomes.map((function(e){return e.name})));case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getResolution",value:function(){var e=(0,s.Z)(f().mark((function e(t,n){var r,a,u,s,c;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setup(n);case 2:for(r=e.sent,a=r.resolutions,u=a[a.length-1],s=a.length-1;s>=0;s-=1)(c=a[s])<=2*t&&(u=c);return e.abrupt("return",u);case 7:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,h.ObservableCreate)(function(){var r=(0,s.Z)(f().mark((function r(a){var u,s,c,i,o,p,h,l,v;return f().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return u=e.refName,s=e.start,c=e.end,i=n.resolution,o=n.bpPerPx,p=void 0===o?1:o,h=n.statusCallback,l=void 0===h?function(){}:h,r.next=4,t.getResolution(p/(i||1e3),n);case 4:return v=r.sent,l("Downloading .hic data"),r.next=8,t.hic.getContactRecords("KR",{start:s,chr:u,end:c},{start:s,chr:u,end:c},"BP",v);case 8:r.sent.forEach((function(e){a.next(e)})),l(""),a.complete();case 12:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}(),n.signal)}},{key:"estimateRegionsStats",value:function(){var e=(0,s.Z)(f().mark((function e(t){return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{featureDensity:0});case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"freeResources",value:function(){}}]),n}(p.BaseFeatureDataAdapter)},41957:function(){}}]);
//# sourceMappingURL=5758.13dda43b.chunk.js.map