"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[965],{40965:(e,t,n)=>{n.r(t),n.d(t,{default:()=>N});var a=n(7552),o=n(92562),r=n(99546),s=n(91468),i=n(68446),c=n(33039),l=n.n(c),f=n(31409),m=n.n(f),u=n(5401),g=n(75785),d=n(68584),b=n(68984),p=n(49823);function C({config:e}){const[t,n]=(0,a.useState)(),[o,s]=(0,a.useState)(),i=(0,r.getSession)(e),{rpcManager:c}=i;(0,a.useEffect)((()=>{(async()=>{try{const t=(0,d.readConfObject)(e,"adapter"),n=await c.call(e.trackId,"CoreGetInfo",{adapterConfig:t});s(n)}catch(e){console.error(e),n(e)}})()}),[e,c]);const l="string"==typeof o?{header:`<pre>${o.replaceAll("<","&lt;").replaceAll(">","&gt;")}</pre>`}:o||{};return a.createElement(b.BaseCard,{title:"File info"},t?a.createElement(p.ErrorMessage,{error:t}):void 0===o?a.createElement(p.LoadingEllipses,{message:"Loading file data"}):a.createElement(b.Attributes,{attributes:l}))}var E=n(29499);const h=(0,g.n9)()((e=>({container:{minWidth:800},refNames:{maxHeight:300,overflow:"auto",flexGrow:1,background:e.palette.background.default}}))),A=(0,i.observer)((function({config:e,onClose:t}){const{classes:n}=h(),[o,i]=(0,a.useState)(),[c,l]=(0,a.useState)(),[f,g]=(0,a.useState)(!1),{rpcManager:b}=(0,r.getSession)(e);(0,a.useEffect)((()=>{(async()=>{try{const t=await Promise.all([...new Set((0,s.getConfAssemblyNames)(e))].map((async t=>{const n=(0,d.readConfObject)(e,"adapter");return[t,await b.call(e.trackId,"CoreGetRefNames",{adapterConfig:n,regions:[{assemblyName:t}]})]})));l(Object.fromEntries(t))}catch(e){console.error(e),i(e)}})()}),[e,b]);const C=c?Object.entries(c):[],A=C.flatMap((([e,t])=>[`--- ${e} ---`,...t.slice(0,1e4),t.length>1e4?`\nToo many refNames to show in browser for ${e}, use "Copy ref names" button to copy to clipboard`:""])).filter((e=>!!e)).join("\n");return a.createElement(p.Dialog,{open:!0,title:"Reference sequence names used in track",onClose:t,maxWidth:"xl"},a.createElement(E.A,{className:n.container},o?a.createElement(p.ErrorMessage,{error:o}):void 0===c?a.createElement(p.LoadingEllipses,{message:"Loading refNames"}):a.createElement(a.Fragment,null,a.createElement(u.A,{variant:"contained",onClick:()=>{m()(C.flatMap((([e,t])=>[`--- ${e} ---`,...t])).filter((e=>!!e)).join("\n")),g(!0),setTimeout((()=>{g(!1)}),1e3)}},f?"Copied to clipboard!":"Copy ref names"),a.createElement("pre",{className:n.refNames},A))))})),y=(0,g.n9)()({content:{minWidth:800},button:{float:"right"}});function v(e,t){for(const n in e)n===t?delete e[n]:"object"==typeof e[n]&&v(e[n],t);return e}const w=(0,i.observer)((function({config:e}){const[t,n]=(0,a.useState)(!1),o=(0,d.readConfObject)(e),s=(0,r.getSession)(e),{classes:i}=y(),[c,f]=(0,a.useState)(!1),g=(0,d.getConf)(s,["formatAbout","hideUris"])||(0,d.readConfObject)(e,["formatAbout","hideUris"]),{pluginManager:p}=(0,r.getEnv)(s),E=p.evaluateExtensionPoint("Core-customizeAbout",{config:{...o,...(0,d.getConf)(s,["formatAbout","config"],{config:o}),...(0,d.readConfObject)(e,["formatAbout","config"],{config:o})}},{session:s,config:e}),h=p.evaluateExtensionPoint("Core-extraAboutPanel",null,{session:s,config:e});return a.createElement("div",{className:i.content},a.createElement(b.BaseCard,{title:"Configuration"},g?null:a.createElement("span",{className:i.button},a.createElement(u.A,{variant:"contained",color:"secondary",onClick:()=>{f(!0)}},"Show ref names"),a.createElement(u.A,{variant:"contained",onClick:()=>{const e=v(l()(o),"baseUri");m()(JSON.stringify(e,null,2)),n(!0),setTimeout((()=>{n(!1)}),1e3)}},t?"Copied to clipboard!":"Copy config")),a.createElement(b.Attributes,{attributes:E,omit:["displays","baseUri","refNames","formatAbout"],hideUris:g})),h?a.createElement(b.BaseCard,{title:h.name},a.createElement(h.Component,{config:e})):null,a.createElement(C,{config:e}),c?a.createElement(A,{config:e,onClose:()=>{f(!1)}}):null)}));function N({config:e,handleClose:t}){const n=(0,r.getSession)(e),i=(0,s.getTrackName)(e,n),{pluginManager:c}=(0,r.getEnv)(n),l=c.evaluateExtensionPoint("Core-replaceAbout",w,{session:n,config:e});return a.createElement(o.A,{open:!0,onClose:t,title:i,maxWidth:"xl"},a.createElement(l,{config:e}))}}}]);
//# sourceMappingURL=965.8524fdac.chunk.js.map