"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[4755],{54755:(e,n,a)=>{a.r(n),a.d(n,{default:()=>p});var t=a(7552),i=a(67112),l=a(99546),s=a(48759),o=a(76218),r=a(31378),d=a(93062),u=a(54898),c=a(30698),h=a(69092),g=a(89870),b=a(68446),m=a(75785),x=a(69500);const j=(0,m.n9)()((e=>({dialogContent:{display:"flex",flexDirection:"column"},expand:{transform:"rotate(0deg)",marginLeft:"auto",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest})},expandOpen:{transform:"rotate(180deg)"}}))),p=(0,b.observer)((function({onClose:e,model:n}){const{classes:a,cx:b}=j(),[m,p]=(0,t.useState)(""),[v,f]=(0,t.useState)(""),[A,C]=(0,t.useState)(""),[S,w]=(0,t.useState)(""),[U,k]=(0,t.useState)(!1),{jbrowse:y}=(0,l.getSession)(n),L=Boolean(m&&v||A||S);function P(){m&&v?y.addPlugin({name:m,umdUrl:v}):A?y.addPlugin({esmUrl:A}):S&&y.addPlugin({cjsUrl:S})}return(0,x.jsx)(i.Dialog,{open:!0,onClose:e,title:"Add custom plugin",children:(0,x.jsxs)("form",{onSubmit:P,children:[(0,x.jsxs)(o.A,{className:a.dialogContent,children:[(0,x.jsx)(r.A,{children:"Enter the name of the plugin and its URL. The name should match what is defined in the plugin's build."}),(0,x.jsx)(d.A,{label:"Plugin name",variant:"outlined",value:m,onChange:e=>{p(e.target.value)}}),(0,x.jsx)(d.A,{label:"Plugin URL",variant:"outlined",value:v,onChange:e=>{f(e.target.value)}}),(0,x.jsxs)(r.A,{onClick:()=>{k(!U)},children:[(0,x.jsx)(g.A,{className:b(a.expand,{[a.expandOpen]:U}),"aria-expanded":U,"aria-label":"show more",children:(0,x.jsx)(s.A,{})}),"Advanced options"]}),(0,x.jsx)(u.A,{in:U,children:(0,x.jsxs)("div",{className:a.dialogContent,children:[(0,x.jsx)(r.A,{children:"The above fields assume that the plugin is built in UMD format. If your plugin is in another format, or you have additional builds you want to add (such as a CJS build for using NodeJS APIs in desktop), you can enter the URLs for those builds below."}),(0,x.jsx)(d.A,{label:"ESM build URL",variant:"outlined",value:A,onChange:e=>{C(e.target.value)}}),(0,x.jsx)(d.A,{label:"CJS build URL",variant:"outlined",value:S,onChange:e=>{w(e.target.value)}})]})})]}),(0,x.jsxs)(c.A,{children:[(0,x.jsx)(h.A,{variant:"contained",onClick:e,children:"Cancel"}),(0,x.jsx)(h.A,{variant:"contained",color:"primary",onClick:P,disabled:!L,children:"Submit"})]})]})})}))}}]);
//# sourceMappingURL=4755.10a5211b.chunk.js.map