"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[3639],{73639:function(e,t,r){r.r(t),r.d(t,{default:function(){return v}});var n=r(41361),a=r(33028),s=r(32723),u=r(34795),c=r(9249),i=r(87371),o=r(45754),f=r(13820),l=r(29598),p=r(26131),d=r(81073),h=r(26080),v=function(e){(0,o.Z)(r,e);var t=(0,f.Z)(r);function r(){return(0,c.Z)(this,r),t.apply(this,arguments)}return(0,i.Z)(r,[{key:"configure",value:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var t,r;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,null===(t=this.getSubAdapter)||void 0===t?void 0:t.call(this,this.getConf("sequenceAdapter"));case 2:if(r=e.sent){e.next=5;break}throw new Error("Error getting subadapter");case 5:return e.abrupt("return",r.dataAdapter);case 6:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getRefNames",value:function(){var e=(0,u.Z)((0,s.Z)().mark((function e(){var t;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.configure();case 2:return t=e.sent,e.abrupt("return",t.getRefNames());case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getFeatures",value:function(e,t){var r=this;return(0,p.ObservableCreate)(function(){var c=(0,u.Z)((0,s.Z)().mark((function u(c){var i,o,f,l,p,v,g,m,w,Z,b,x,k,y,C,A,F,N,q,I,R,_;return(0,s.Z)().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,r.configure();case 2:if(o=s.sent,1e3,f=e.start,l=e.end,f=Math.max(0,f-1e3),!((l+=1e3)<0||f>l)){s.next=10;break}return c.complete(),s.abrupt("return");case 10:return p=o.getFeatures((0,a.Z)((0,a.Z)({},e),{},{start:f,end:l}),t),s.next=13,p.pipe((0,h.q)()).toPromise();case 13:if(v=s.sent,g=(null===(i=v[0])||void 0===i?void 0:i.get("seq"))||"",m=r.getConf("search"),w=r.getConf("searchForward"),Z=r.getConf("searchReverse"),b=r.getConf("caseInsensitive"),x=new RegExp(m,"g"+(b?"i":"")),m){if(w){k=g.matchAll(x),y=(0,n.Z)(k);try{for(y.s();!(C=y.n()).done;)A=C.value,F=f+(A.index||0),(0,d.doesIntersect2)(F,F+m.length,e.start,e.end)&&c.next(new d.SimpleFeature({uniqueId:"".concat(r.id,"-match-").concat(F,"-p"),refName:e.refName,start:F,end:F+A[0].length,name:A[0],strand:1}))}catch(u){y.e(u)}finally{y.f()}}if(Z){N=(0,d.revcom)(g).matchAll(x),q=(0,n.Z)(N);try{for(q.s();!(I=q.n()).done;)R=I.value,_=l-(R.index||0),(0,d.doesIntersect2)(_,_+m.length,e.start,e.end)&&c.next(new d.SimpleFeature({uniqueId:"".concat(r.id,"-match-").concat(_,"-n"),refName:e.refName,start:_-R[0].length,name:R[0],end:_,strand:-1}))}catch(u){q.e(u)}finally{q.f()}}}c.complete();case 22:case"end":return s.stop()}}),u)})));return function(e){return c.apply(this,arguments)}}())}},{key:"freeResources",value:function(){}}]),r}(l.BaseFeatureDataAdapter)}}]);
//# sourceMappingURL=3639.00c07dc9.chunk.js.map