"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[9589],{69589:function(n,e,t){t.r(e),t.d(e,{default:function(){return k}});var o=t(96234),i=t(96902),c=t(66431),r=t(32143),a=t(15817),s=t(8317),l=t(44536),u=t(27664),d=t(91188),p=t(4782),f=t(30474),m=t(17867),g=t(29938),h=(0,p.observer)((function(n){var e=n.connectionType,t=n.model,o=n.session,c=e.configEditorComponent||f.wP;return(0,g.jsx)(i.Suspense,{fallback:(0,g.jsx)(m.LoadingEllipses,{}),children:(0,g.jsx)(c,{model:{target:t},session:o})})})),C=t(66519),x=t(25322),j=t(15996),v=t(16403),b=(0,p.observer)((function(n){var e=n.connectionTypeChoices,t=n.connectionType,o=n.setConnectionType;return(0,i.useEffect)((function(){t||o(e[0])})),(0,g.jsx)("form",{autoComplete:"off",children:t?(0,g.jsx)(C.Z,{value:t.name,label:"connectionType",helperText:t.description?(0,g.jsxs)(g.Fragment,{children:[t.description,t.url?(0,g.jsx)(x.Z,{href:t.url,rel:"noopener noreferrer",target:"_blank",children:(0,g.jsx)(v.Z,{})}):null]}):null,select:!0,fullWidth:!0,onChange:function(n){return o(e.find((function(e){return e.name===n.target.value})))},variant:"outlined",children:e.map((function(n){return(0,g.jsx)(j.Z,{value:n.name,children:n.displayName||n.name},n.name)}))}):null})})),Z=(0,d.ZL)()((function(n){return{root:{marginTop:n.spacing(1)},stepper:{backgroundColor:n.palette.background.default},button:{marginTop:n.spacing(1),marginRight:n.spacing(1)},actionsContainer:{marginBottom:n.spacing(2)}}})),T=["Select a Connection Type","Configure Connection"],k=(0,p.observer)((function(n){var e=n.model,t=(0,i.useState)(),d=(0,o.Z)(t,2),p=d[0],f=d[1],m=(0,i.useState)(),C=(0,o.Z)(m,2),x=C[0],j=C[1],v=(0,i.useState)(0),k=(0,o.Z)(v,2),y=k[0],w=k[1],N=Z().classes,S=(0,u.getSession)(e),E=(0,u.getEnv)(S).pluginManager;return(0,g.jsx)("div",{className:N.root,children:(0,g.jsx)(c.Z,{className:N.stepper,activeStep:y,orientation:"vertical",children:T.map((function(n){return(0,g.jsxs)(r.Z,{children:[(0,g.jsx)(a.Z,{children:n}),(0,g.jsxs)(s.Z,{children:[0===y?(0,g.jsx)(b,{connectionTypeChoices:E.getConnectionElements(),connectionType:p,setConnectionType:function(n){if(f(n),n){var t="".concat(n.name,"-").concat(Date.now());j(n.configSchema.create({connectionId:t},(0,u.getEnv)(e)))}}}):p&&x?(0,g.jsx)(h,{connectionType:p,model:x,session:S}):null,(0,g.jsxs)("div",{className:N.actionsContainer,children:[(0,g.jsx)(l.Z,{disabled:0===y,onClick:function(){return w(y-1)},className:N.button,children:"Back"}),(0,g.jsx)(l.Z,{disabled:!(0===y&&p||1===y&&x),variant:"contained",color:"primary",onClick:function(){if(y===T.length-1){var n,t=S.addConnectionConf(x);null===(n=S.makeConnection)||void 0===n||n.call(S,t),S.hideWidget(e)}else w(y+1)},className:N.button,"data-testid":"addConnectionNext",children:y===T.length-1?"Connect":"Next"})]})]})]},n)}))})})}))}}]);
//# sourceMappingURL=9589.cdf3deac.chunk.js.map