"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[9322],{89322:(e,n,a)=>{a.r(n),a.d(n,{default:()=>f});var t=a(41867),i=a(3762),s=a(35421),l=a(47409),o=a(75258),r=a(49133),d=a(23141),u=a(27768),c=a(23801),h=a(47192),g=a(90872),b=a(68367),m=a(95460),x=a(80838);const j=(0,h.ZL)()((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)"}}))),f=(0,i.observer)((function(e){let{onClose:n,model:a}=e;const{classes:i,cx:h}=j(),[f,p]=(0,t.useState)(""),[v,C]=(0,t.useState)(""),[Z,S]=(0,t.useState)(""),[w,U]=(0,t.useState)(""),[k,L]=(0,t.useState)(!1),{jbrowse:y}=(0,g.getSession)(a),P=Boolean(f&&v||Z||w);function R(){f&&v?y.addPlugin({name:f,umdUrl:v}):Z?y.addPlugin({esmUrl:Z}):w&&y.addPlugin({cjsUrl:w})}return(0,x.jsx)(s.Dialog,{open:!0,onClose:n,title:"Add custom plugin",children:(0,x.jsxs)("form",{onSubmit:R,children:[(0,x.jsxs)(l.Z,{className:i.dialogContent,children:[(0,x.jsx)(o.Z,{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)(r.Z,{label:"Plugin name",variant:"outlined",value:f,onChange:e=>p(e.target.value)}),(0,x.jsx)(r.Z,{label:"Plugin URL",variant:"outlined",value:v,onChange:e=>C(e.target.value)}),(0,x.jsxs)(o.Z,{onClick:()=>L(!k),children:[(0,x.jsx)(b.Z,{className:h(i.expand,{[i.expandOpen]:k}),"aria-expanded":k,"aria-label":"show more",children:(0,x.jsx)(m.Z,{})}),"Advanced options"]}),(0,x.jsx)(d.Z,{in:k,children:(0,x.jsxs)("div",{className:i.dialogContent,children:[(0,x.jsx)(o.Z,{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)(r.Z,{label:"ESM build URL",variant:"outlined",value:Z,onChange:e=>S(e.target.value)}),(0,x.jsx)(r.Z,{label:"CJS build URL",variant:"outlined",value:w,onChange:e=>U(e.target.value)})]})})]}),(0,x.jsxs)(u.Z,{children:[(0,x.jsx)(c.Z,{variant:"contained",onClick:n,children:"Cancel"}),(0,x.jsx)(c.Z,{variant:"contained",color:"primary",onClick:R,disabled:!P,children:"Submit"})]})]})})}))}}]);
//# sourceMappingURL=9322.92c0de1c.chunk.js.map