"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[1281],{61281:(e,s,a)=>{a.r(s),a.d(s,{default:()=>j});var r=a(7552),t=a(67112),n=a(99546),c=a(76218),o=a(61282),l=a(93062),h=a(36866),i=a(7946),d=a(22762),u=a(30698),g=a(69092),x=a(68446),p=a(36422),A=a(75785),b=a(69500);const k=(0,A.n9)()({dialogContent:{width:"40em"}}),j=(0,x.observer)((function({model:e,handleClose:s}){const{classes:a}=k(),[x,A]=(0,r.useState)(""),[j,C]=(0,r.useState)(!0),[S,m]=(0,r.useState)(!0),[w,y]=(0,r.useState)(!0);let v;try{new RegExp(x)}catch(e){v=e}return(0,b.jsxs)(t.Dialog,{maxWidth:"xl",open:!0,onClose:s,title:"Sequence search",children:[(0,b.jsxs)(c.A,{className:a.dialogContent,children:[(0,b.jsx)(o.A,{children:"Supply a sequence to search for. A track will be created with the resulting matches once submitted. You can also supply regex style expressions e.g. AACT(C|T)."}),(0,b.jsx)(l.A,{value:x,onChange:e=>{A(e.target.value)},helperText:"Sequence search pattern"}),(0,b.jsxs)(h.A,{children:[(0,b.jsx)(i.A,{control:(0,b.jsx)(d.A,{checked:j,onChange:e=>{C(e.target.checked)}}),label:"Search forward strand"}),(0,b.jsx)(i.A,{control:(0,b.jsx)(d.A,{checked:S,onChange:e=>{m(e.target.checked)}}),label:"Search reverse strand"}),(0,b.jsx)(i.A,{control:(0,b.jsx)(d.A,{checked:w,onChange:e=>{y(e.target.checked)}}),label:"Case insensitive"})]}),v?(0,b.jsx)(o.A,{color:"error",children:`${v}`}):null]}),(0,b.jsxs)(u.A,{children:[(0,b.jsx)(g.A,{onClick:()=>{if(x){const s="sequence_search_"+ +Date.now(),a=(0,n.getSession)(e),{assemblyManager:r}=a,t=e.assemblyNames[0];(0,n.isSessionWithAddTracks)(a)&&(a.addTrackConf({trackId:s,name:`Sequence search ${x}`,assemblyNames:[t],type:"FeatureTrack",adapter:{type:"SequenceSearchAdapter",search:x,searchForward:j,searchReverse:S,caseInsensitive:w,sequenceAdapter:(0,p.getSnapshot)(r.get(t)?.configuration.sequence.adapter)}}),e.showTrack(s))}s()},variant:"contained",color:"primary",children:"Submit"}),(0,b.jsx)(g.A,{onClick:()=>{s()},variant:"contained",color:"secondary",children:"Close"})]})]})}))}}]);
//# sourceMappingURL=1281.bb7b912b.chunk.js.map