"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[9372],{29372:(e,t,s)=>{s.r(t),s.d(t,{default:()=>v});var a=s(7552),n=s(67112),r=s(99546),i=s(84340),o=s(59570),l=s(92826),d=s(91818),c=s(44928),m=s(69092),u=s(68446),h=s(75785),p=s(96480),b=s(50574),x=s(69500);const g=(0,u.observer)(function({model:e,selectedAsm:t,value:s,setValue:a,setOption:n}){const i=(0,r.getSession)(e),{assemblyManager:o,textSearchManager:l}=i,{rankSearchResults:d}=e,c=e.searchScope(t),m=o.get(t);return(0,x.jsx)(p.A,{fetchResults:e=>(0,b.Jf)({queryString:e,assembly:m,textSearchManager:l,rankSearchResults:d,searchScope:c}),model:e,assemblyName:t,value:s,minWidth:270,onChange:e=>{a(e)},onSelect:e=>{n(e)},TextFieldProps:{variant:"outlined",helperText:"Enter sequence name, feature name, or location"}})});var f=s(6184);const S=(0,h.n9)()(e=>({importFormContainer:{padding:e.spacing(2)},button:{margin:e.spacing(2)},container:{padding:e.spacing(4)}})),v=(0,u.observer)(function({model:e}){const{classes:t}=S(),s=(0,r.getSession)(e),{assemblyNames:u,assemblyManager:h}=s,{error:p}=e,[b,v]=(0,a.useState)(u[0]),[A,y]=(0,a.useState)(),j=h.get(b),k=u.length?j?.error:"No configured assemblies",w=k||p,[W,C]=(0,a.useState)(""),R=j?.regions,N=!!R,M=R&&R[0]?.refName||"";return(0,a.useEffect)(()=>{C(M)},[M,b]),(0,x.jsxs)("div",{className:t.container,children:[w?(0,x.jsx)(n.ErrorMessage,{error:w}):null,(0,x.jsx)(o.A,{className:t.importFormContainer,children:(0,x.jsx)("form",{onSubmit:async t=>{if(t.preventDefault(),e.setError(void 0),W)try{A?.getDisplayString()===W&&A.hasLocation()?await(0,f.Kd)({option:A,model:e,assemblyName:b}):A?.results?.length?e.setSearchResults(A.results,A.getLabel(),b):j&&await(0,f.cm)({input:W,assembly:j,model:e})}catch(e){console.error(e),s.notify(`${e}`,"warning")}},children:(0,x.jsxs)(l.A,{container:!0,spacing:1,justifyContent:"center",alignItems:"center",children:[(0,x.jsx)(d.A,{children:(0,x.jsx)(n.AssemblySelector,{onChange:e=>{v(e)},localStorageKey:"lgv",session:s,selected:b})}),b?k?(0,x.jsx)(i.A,{style:{color:"red"}}):N?(0,x.jsx)(d.A,{children:(0,x.jsx)(g,{value:W,setValue:C,selectedAsm:b,setOption:y,model:e})}):(0,x.jsx)(c.A,{size:20,disableShrink:!0}):null,(0,x.jsx)(d.A,{children:(0,x.jsx)(m.A,{type:"submit",disabled:!W,className:t.button,variant:"contained",color:"primary",children:"Open"})}),(0,x.jsx)(d.A,{children:(0,x.jsx)(m.A,{disabled:!W,className:t.button,onClick:()=>{e.setError(void 0),e.showAllRegionsInAssembly(b)},variant:"contained",color:"secondary",children:"Show all regions in assembly"})})]})})})]})})},59570:(e,t,s)=>{s.d(t,{A:()=>S});var a=s(7552),n=s(93878),r=s(2958),i=s(75100),o=s(44472),l=s(53518),d=s(98930),c=s(72233),m=s(69500);const u=(0,c.A)(),h=(0,d.A)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:s}=e;return[t.root,t[`maxWidth${(0,o.A)(String(s.maxWidth))}`],s.fixed&&t.fixed,s.disableGutters&&t.disableGutters]}}),p=e=>(0,l.A)({props:e,name:"MuiContainer",defaultTheme:u});var b=s(74325),x=s(80317),g=s(50864);const f=function(e={}){const{createStyledComponent:t=h,useThemeProps:s=p,componentName:l="MuiContainer"}=e,d=t(({theme:e,ownerState:t})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",...!t.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,s)=>{const a=s,n=e.breakpoints.values[a];return 0!==n&&(t[e.breakpoints.up(a)]={maxWidth:`${n}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:t})=>({..."xs"===t.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},...t.maxWidth&&"xs"!==t.maxWidth&&{[e.breakpoints.up(t.maxWidth)]:{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`}}})),c=a.forwardRef(function(e,t){const a=s(e),{className:c,component:u="div",disableGutters:h=!1,fixed:p=!1,maxWidth:b="lg",classes:x,...g}=a,f={...a,component:u,disableGutters:h,fixed:p,maxWidth:b},S=((e,t)=>{const{classes:s,fixed:a,disableGutters:n,maxWidth:l}=e,d={root:["root",l&&`maxWidth${(0,o.A)(String(l))}`,a&&"fixed",n&&"disableGutters"]};return(0,i.A)(d,e=>(0,r.Ay)(t,e),s)})(f,l);return(0,m.jsx)(d,{as:u,ownerState:f,className:(0,n.A)(S.root,c),ref:t,...g})});return c}({createStyledComponent:(0,x.Ay)("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:s}=e;return[t.root,t[`maxWidth${(0,b.A)(String(s.maxWidth))}`],s.fixed&&t.fixed,s.disableGutters&&t.disableGutters]}}),useThemeProps:e=>(0,g.b)({props:e,name:"MuiContainer"})}),S=f}}]);
//# sourceMappingURL=9372.3c6a6b79.chunk.js.map