"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[2053],{42053:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(56798),s=a(59062),r=a(90872),o=a(16979),c=a(85291),i=a(85579);class u extends n.BaseFeatureDataAdapter{constructor(){super(...arguments),this.setupP=void 0}async setup(e){return this.setupP||(this.setupP=this.setupPre(e).catch((e=>{throw this.setupP=void 0,e}))),this.setupP}async setupPre(e){const t=this.getConf("assemblyNames"),a=this.pluginManager,n=(0,s.openLocation)(this.getConf("bed1Location"),a),r=(0,s.openLocation)(this.getConf("bed2Location"),a),o=(0,s.openLocation)(this.getConf("mcscanSimpleAnchorsLocation"),a),[c,u,f]=await Promise.all([n,r,o].map((t=>(0,i.pJ)(t,e)))),d=(0,i.SN)(c),m=(0,i.SN)(u);return{assemblyNames:t,feats:f.split(/\n|\r\n|\r/).filter((e=>!!e&&"###"!==e)).map(((e,t)=>{const[a,n,s,r,o,c]=e.split("\t"),i=d.get(a),u=d.get(n),f=m.get(s),p=m.get(r);if(!i||!u||!f||!p)throw new Error("feature not found, ".concat(a," ").concat(n," ").concat(s," ").concat(r," ").concat(i," ").concat(u," ").concat(f," ").concat(p));return[i,u,f,p,+o,"-"===c?-1:1,t]}))}}async hasDataForRefName(){return!0}async getRefNames(){return[]}getFeatures(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,o.ObservableCreate)((async a=>{const{assemblyNames:n,feats:s}=await this.setup(t),o=n.indexOf(e.assemblyName);if(-1!==o){const t=0===o;s.forEach((s=>{const[o,i,u,f,d,m,p]=s;let l={refName:o.refName,start:Math.min(o.start,i.start),end:Math.max(o.end,i.end)},h={refName:u.refName,start:Math.min(u.start,f.start),end:Math.max(u.end,f.end)};t||([h,l]=[l,h]),l.refName===e.refName&&(0,r.doesIntersect2)(l.start,l.end,e.start,e.end)&&a.next(new c.Z({...l,uniqueId:"".concat(p),syntenyId:p,assemblyName:n[+!t],score:d,strand:m,mate:{...h,assemblyName:n[+t]}}))}))}a.complete()}))}freeResources(){}}u.capabilities=["getFeatures","getRefNames"]},85579:(e,t,a)=>{a.d(t,{$R:()=>c,SN:()=>r,WU:()=>u,lq:()=>s,pJ:()=>o});var n=a(31238);function s(e){return 31===e[0]&&139===e[1]&&8===e[2]}function r(e){return new Map(e.split(/\n|\r\n|\r/).filter((e=>!!e||e.startsWith("#"))).map((e=>{const[t,a,n,s,r,o]=e.split("\t");return[s,{refName:t,start:+a,end:+n,score:+r,name:s,strand:"-"===o?-1:1}]})))}async function o(e,t){const a=await e.readFile(t);return new TextDecoder("utf8",{fatal:!0}).decode(s(a)?await(0,n.unzip)(a):a)}function c(e,t){return e.map(((e,a)=>[e,t[a]]))}const i="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;function u(e,t){let a=0;const n=[];for(;a<e.length;){const s=e.indexOf("\n",a);if(-1===s)break;const r=e.slice(a,s),o=((null===i||void 0===i?void 0:i.decode(r))||r.toString()).trim();o&&n.push(t(o)),a=s+1}return n}}}]);
//# sourceMappingURL=2053.d77e0011.chunk.js.map