"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[9742],{29742:(e,t,s)=>{s.r(t),s.d(t,{default:()=>u,openFilehandleWrapper:()=>l});var a=s(56798),n=s(16979),r=s(59062),o=s(7886),i=s(35051).lW;class c{constructor(e){this.filehandle=e}async read(e,t){const{buffer:s,bytesRead:a}=await this.filehandle.read(i.allocUnsafe(t),0,t,e);return s.buffer.slice(s.byteOffset,s.byteOffset+a)}}function l(e,t){return new c((0,r.openLocation)(e,t))}class u extends a.BaseFeatureDataAdapter{constructor(e,t,s){super(e,t,s),this.hic=void 0;const a=this.getConf("hicLocation");this.hic=new o.Z({file:l(a,this.pluginManager)})}async setup(e){const{statusCallback:t=(()=>{})}=e||{};t("Downloading .hic header");const s=await this.hic.getMetaData();return t(""),s}async getHeader(e){const t=await this.setup(e),{chromosomes:s,...a}=t;return a}async getRefNames(e){return(await this.setup(e)).chromosomes.map((e=>e.name))}async getResolution(e,t){const{resolutions:s}=await this.setup(t);let a=s.at(-1);for(let n=s.length-1;n>=0;n-=1){const t=s[n];t<=2*e&&(a=t)}return a}getFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,n.ObservableCreate)((async s=>{const{refName:a,start:n,end:r}=e,{resolution:o,bpPerPx:i=1,statusCallback:c=(()=>{})}=t,l=await this.getResolution(i/(o||1e3),t);c("Downloading .hic data");(await this.hic.getContactRecords("KR",{start:n,chr:a,end:r},{start:n,chr:a,end:r},"BP",l)).forEach((e=>{s.next(e)})),c(""),s.complete()}),t.signal)}async getMultiRegionFeatureDensityStats(e){return{featureDensity:0}}freeResources(){}}}}]);
//# sourceMappingURL=9742.6c5dd426.chunk.js.map