"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[864],{88483:(e,t,n)=>{n.r(t),n.d(t,{default:()=>A});var o=n(7552),a=n(92562),r=n(99546),i=n(91468),s=n(33039),c=n.n(s),l=n(31409),f=n.n(l),u=n(5401),g=n(75785),d=n(68584),m=n(41990),b=n(48735);function C({config:e}){const[t,n]=(0,o.useState)(),[a,i]=(0,o.useState)(),s=(0,r.getSession)(e),{rpcManager:c}=s;(0,o.useEffect)((()=>{(async()=>{try{const t=(0,d.readConfObject)(e,"adapter"),n=await c.call(e.trackId,"CoreGetInfo",{adapterConfig:t});i(n)}catch(e){console.error(e),n(e)}})()}),[e,c]);const l="string"==typeof a?{header:`<pre>${a.replaceAll("<","&lt;").replaceAll(">","&gt;")}</pre>`}:a||{};return null!==a?o.createElement(m.BaseCard,{title:"File info"},t?o.createElement(b.ErrorMessage,{error:t}):void 0===a?o.createElement(b.LoadingEllipses,{message:"Loading file data"}):o.createElement(m.Attributes,{attributes:l})):null}const p=(0,g.n9)()({content:{minWidth:800}});function E(e,t){for(const n in e)n===t?delete e[n]:"object"==typeof e[n]&&E(e[n],t);return e}function h({config:e}){const[t,n]=(0,o.useState)(!1),a=(0,d.readConfObject)(e),i=(0,r.getSession)(e),{classes:s}=p(),l=(0,d.getConf)(i,["formatAbout","hideUris"])||(0,d.readConfObject)(e,["formatAbout","hideUris"]),{pluginManager:g}=(0,r.getEnv)(i),b=g.evaluateExtensionPoint("Core-customizeAbout",{config:{...a,...(0,d.getConf)(i,["formatAbout","config"],{config:a}),...(0,d.readConfObject)(e,["formatAbout","config"],{config:a})}},{session:i,config:e}),h=g.evaluateExtensionPoint("Core-extraAboutPanel",null,{session:i,config:e});return o.createElement("div",{className:s.content},o.createElement(m.BaseCard,{title:"Configuration"},l?null:o.createElement(u.A,{variant:"contained",style:{float:"right"},onClick:()=>{const e=E(c()(a),"baseUri");f()(JSON.stringify(e,null,2)),n(!0),setTimeout((()=>n(!1)),1e3)}},t?"Copied to clipboard!":"Copy config"),o.createElement(m.Attributes,{attributes:b,omit:["displays","baseUri","refNames","formatAbout"],hideUris:l})),h?o.createElement(m.BaseCard,{title:h.name},o.createElement(h.Component,{config:e})):null,o.createElement(C,{config:e}))}function A({config:e,handleClose:t}){const n=(0,r.getSession)(e),s=(0,i.getTrackName)(e,n),{pluginManager:c}=(0,r.getEnv)(n),l=c.evaluateExtensionPoint("Core-replaceAbout",h,{session:n,config:e});return o.createElement(a.A,{open:!0,onClose:t,title:s,maxWidth:"xl"},o.createElement(l,{config:e}))}}}]);
//# sourceMappingURL=864.b9df20b7.chunk.js.map