"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[1281],{61281:(e,t,a)=>{a.r(t),a.d(t,{default:()=>k});var n=a(7552),r=a(29499),c=a(36715),s=a(1343),l=a(83867),o=a(33371),h=a(32808),i=a(58507),u=a(5401),d=a(48735),m=a(36422),g=a(75785),p=a(68446),A=a(99546);const b=(0,g.n9)()({dialogContent:{width:"40em"}}),k=(0,p.observer)((function({model:e,handleClose:t}){const{classes:a}=b(),[g,p]=(0,n.useState)(""),[k,C]=(0,n.useState)(!0),[E,S]=(0,n.useState)(!0),[w,y]=(0,n.useState)(!0);let v;try{new RegExp(g)}catch(e){v=e}return n.createElement(d.Dialog,{maxWidth:"xl",open:!0,onClose:t,title:"Sequence search"},n.createElement(r.A,{className:a.dialogContent},n.createElement(c.A,null,"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)."),n.createElement(s.A,{value:g,onChange:e=>p(e.target.value),helperText:"Sequence search pattern"}),n.createElement(l.A,null,n.createElement(o.A,{control:n.createElement(h.A,{checked:k,onChange:e=>C(e.target.checked)}),label:"Search forward strand"}),n.createElement(o.A,{control:n.createElement(h.A,{checked:E,onChange:e=>S(e.target.checked)}),label:"Search reverse strand"}),n.createElement(o.A,{control:n.createElement(h.A,{checked:w,onChange:e=>y(e.target.checked)}),label:"Case insensitive"})),v?n.createElement(c.A,{color:"error"},`${v}`):null),n.createElement(i.A,null,n.createElement(u.A,{onClick:()=>{if(g){const t="sequence_search_"+ +Date.now(),a=(0,A.getSession)(e),{assemblyManager:n}=a,r=e.assemblyNames[0];(0,A.isSessionWithAddTracks)(a)&&(a.addTrackConf({trackId:t,name:`Sequence search ${g}`,assemblyNames:[r],type:"FeatureTrack",adapter:{type:"SequenceSearchAdapter",search:g,searchForward:k,searchReverse:E,caseInsensitive:w,sequenceAdapter:(0,m.getSnapshot)(n.get(r)?.configuration.sequence.adapter)}}),e.showTrack(t))}t()},variant:"contained",color:"primary"},"Submit"),n.createElement(u.A,{onClick:()=>t(),variant:"contained",color:"secondary"},"Close")))}))}}]);
//# sourceMappingURL=1281.c56319d6.chunk.js.map