text: (this["webpackJsonp@jbrowse/web"]=this["webpackJsonp@jbrowse/web"]||[]).push([[46],{2506:function(e,n,t){"use strict";t.r(n);var a=t(87),o=t.n(a),c=t(82),r=t(88),l=t(1),i=t.n(l),s=t(51),d=t(2435),u=t(2434),m=t(2529),b=t(2427),f=t(2459),g=t(1566),h=t(2431),v=t(2412),k=t(2474),E=t(563),p=t.n(E),C=t(312),j=t.n(C),O=t(698),y=t.n(O),x=t(1039),w=t.n(x),T=t(1042),W=t.n(T),I=t(2276),S=t.n(I),N=t(2277),B=t.n(N),A=t(2275),L=t(275),M=t(84),D=t(81),H=t(85),F=t(2399),z=Object(l.lazy)((function(){return t.e(58).then(t.bind(null,2394))})),R=Object(l.lazy)((function(){return t.e(59).then(t.bind(null,2395))})),J=Object(l.lazy)((function(){return t.e(60).then(t.bind(null,2396))})),P=Object(l.lazy)((function(){return t.e(61).then(t.bind(null,2397))})),U=Object(s.a)((function(e){var n,t;return{searchBox:{marginBottom:e.spacing(2)},menuIcon:{marginRight:e.spacing(1),marginBottom:0},fab:{position:"absolute",bottom:e.spacing(6),right:e.spacing(6)},compactCheckbox:{padding:0},checkboxLabel:{marginRight:0,"&:hover":{backgroundColor:"#eee"}},accordionBase:{display:"flex"},accordionCard:{padding:3,cursor:"pointer",display:"flex"},nestingLevelMarker:{position:"absolute",borderLeft:"1.5px solid #555"},accordionColor:{background:null===(n=e.palette.tertiary)||void 0===n?void 0:n.main,color:null===(t=e.palette.tertiary)||void 0===t?void 0:t.contrastText,width:"100%",display:"flex",paddingLeft:5},accordionText:{margin:"auto 0"}}})),_=function(e){var n=e.data,t=e.isOpen,a=e.style,o=e.setOpen,c=n.isLeaf,r=n.nestingLevel,l=n.checked,s=n.id,f=n.name,g=n.onChange,h=n.conf,v=n.onMoreInfo,k=U(),E=10*r+(c?10:0),p=f&&(f.endsWith("(Unsupported)")||f.endsWith("(Unknown)"));return i.a.createElement("div",{style:a,className:c?void 0:k.accordionBase},new Array(r).fill(0).map((function(e,n){return i.a.createElement("div",{key:"mark-".concat(n),style:{left:10*n+4,height:a.height},className:k.nestingLevelMarker})})),i.a.createElement("div",{className:c?void 0:k.accordionCard,onClick:function(){return o(!t)},style:{marginLeft:E,whiteSpace:"nowrap",width:"100%"}},i.a.createElement("div",{className:c?void 0:k.accordionColor},c?i.a.createElement(i.a.Fragment,null,i.a.createElement(u.a,{className:k.checkboxLabel,control:i.a.createElement(m.a,{className:k.compactCheckbox,checked:l,onChange:function(){return g(s)},color:"primary",disabled:p,inputProps:{"data-testid":"htsTrackEntry-".concat(s)}}),label:f}),i.a.createElement(b.a,{onClick:function(e){return v({target:e.currentTarget,id:s,conf:h})},color:"secondary","data-testid":"htsTrackEntryMenu-".concat(s)},i.a.createElement(S.a,null))):i.a.createElement("div",{className:k.accordionText},i.a.createElement(d.a,null,t?i.a.createElement(y.a,null):i.a.createElement(w.a,null),f)))))},q=function(e,n,t){var a=!!e.conf;return{data:Object(r.a)(Object(r.a)({defaultHeight:a?22:40,isLeaf:a,isOpenByDefault:!0,nestingLevel:n},e),t),nestingLevel:n,node:e}},G=Object(H.observer)((function(e){var n,t=e.height,a=e.tree,r=e.model,s=Object(l.useRef)(null),d=Object(l.useState)(),u=Object(c.a)(d,2),m=u[0],b=u[1],f=Object(M.getSession)(r),g=r.filterText,h={onChange:function(e){return r.view.toggleTrack(e)},onMoreInfo:b},v=Object(l.useCallback)(o.a.mark((function e(){var n,t,c,r;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0;case 1:if(!(n<a.children.length)){e.next=7;break}return e.next=4,q(a.children[n],0,h);case 4:n++,e.next=1;break;case 7:return void(e.next=10);case 10:t=e.sent,c=0;case 12:if(!(c<t.node.children.length)){e.next=19;break}return r=t.node.children[c],e.next=16,q(r,t.nestingLevel+1,h);case 16:c++,e.next=12;break;case 19:e.next=7;break;case 21:case"end":return e.stop()}}),e)})),[a,h]),k=null===m||void 0===m?void 0:m.conf,E=k&&(null===(n=f.getTrackActionMenuItems)||void 0===n?void 0:n.call(f,k))||[];return Object(l.useEffect)((function(){s.current.recomputeTree({refreshNodes:!0,useDefaultHeight:!0})}),[a,g]),i.a.createElement(i.a.Fragment,null,i.a.createElement(F.a,{ref:s,treeWalker:v,height:t},_),i.a.createElement(L.a,{anchorEl:null===m||void 0===m?void 0:m.target,menuItems:E,onMenuItemClick:function(e,n){n(),b(void 0)},open:Boolean(m),onClose:function(){return b(void 0)}}))})),K=function(e){var n=e.tree,t=e.model,a=e.offset;return"undefined"===typeof jest?i.a.createElement(A.a,{disableWidth:!0},(function(e){var o=e.height;return i.a.createElement(G,{height:o-a,model:t,tree:n})})):i.a.createElement(G,{height:9e3,model:t,tree:n})},Q=function(e){var n=e.overrideDimensions,t=e.children;return n?i.a.createElement("div",{style:Object(r.a)({},n)},t):i.a.createElement(i.a.Fragment,null,t)},V=Object(H.observer)((function(e){var n=e.model,t=e.toolbarHeight,a=e.overrideDimensions,o=U(),r=Object(M.getSession)(n),s=Object(l.useState)(null),d=Object(c.a)(s,2),u=d[0],m=d[1];function b(){m(null)}return i.a.createElement(Q,{overrideDimensions:a},i.a.createElement(Y,{model:n,toolbarHeight:t,overrideDimensions:a}),i.a.createElement(f.a,{color:"secondary",className:o.fab,onClick:function(e){m(e.currentTarget)}},i.a.createElement(j.a,null)),i.a.createElement(g.a,{anchorEl:u,open:Boolean(u),onClose:function(){return m(null)}},i.a.createElement(h.a,{onClick:function(){b();var e=r.addWidget("AddConnectionWidget","addConnectionWidget");r.showWidget(e)}},"Add connection"),i.a.createElement(h.a,{onClick:function(){b();var e=r.addWidget("AddTrackWidget","addTrackWidget",{view:n.view.id});r.showWidget(e)}},"Add track")))})),X=Object(H.observer)((function(e){var n=e.model,t=e.setHeaderHeight,a=e.setAssemblyIdx,o=e.assemblyIdx,r=U(),s=Object(M.getSession)(n),d=Object(l.useState)(),u=Object(c.a)(d,2),m=u[0],f=u[1],g=Object(l.useState)(),h=Object(c.a)(g,2),E=h[0],C=h[1],j=Object(l.useState)(),O=Object(c.a)(j,2),y=O[0],x=O[1],w=Object(l.useState)(),T=Object(c.a)(w,2),I=T[0],S=T[1],N=Object(l.useState)(!1),A=Object(c.a)(N,2),H=A[0],F=A[1],_=Object(l.useState)(!1),q=Object(c.a)(_,2),G=q[0],K=q[1],Q=n.assemblyNames,V=Q[o];function X(e,n){var t=Object(D.readConfObject)(e,"name"),a=s.prepareToBreakConnection(e);if(a){var o=Object(c.a)(a,2),r=o[0],l=o[1];Object.keys(l).length>0?x({connectionConf:e,safelyBreakConnection:r,dereferenceTypeCount:l,name:t}):r()}n&&S({name:t,connectionConf:e})}var Y=[{label:"Turn on/off connections...",onClick:function(){return K(!0)}},{label:"Delete connections...",onClick:function(){return F(!0)}}],Z=Q.length>1?[{label:"Select assembly...",subMenu:Q.map((function(e,n){return{label:e,onClick:function(){a(n)}}}))}]:[],$=[{label:"Add track...",onClick:function(){s.showWidget(s.addWidget("AddTrackWidget","addTrackWidget",{view:n.view.id}))}}].concat(Z);return i.a.createElement("div",{ref:function(e){return t((null===e||void 0===e?void 0:e.getBoundingClientRect().height)||0)},"data-testid":"hierarchical_track_selector"},i.a.createElement("div",{style:{display:"flex"}},i.a.createElement(b.a,{className:r.menuIcon,onClick:function(e){C(e.currentTarget)}},i.a.createElement(W.a,null)),i.a.createElement(b.a,{className:r.menuIcon,onClick:function(e){f(e.currentTarget)}},i.a.createElement(B.a,null)),i.a.createElement(v.a,{className:r.searchBox,label:"Filter tracks",value:n.filterText,onChange:function(e){return n.setFilterText(e.target.value)},fullWidth:!0,InputProps:{endAdornment:i.a.createElement(k.a,{position:"end"},i.a.createElement(b.a,{color:"secondary",onClick:n.clearFilterText},i.a.createElement(p.a,null)))}})),i.a.createElement(L.a,{anchorEl:m,open:Boolean(m),onMenuItemClick:function(e,n){n(),f(void 0)},onClose:function(){f(void 0)},menuItems:[{label:"Add connection",onClick:function(){s.showWidget(s.addWidget("AddConnectionWidget","addConnectionWidget"))}}].concat(Y)}),i.a.createElement(L.a,{anchorEl:E,open:Boolean(E),onMenuItemClick:function(e,n){n(),C(void 0)},onClose:function(){C(void 0)},menuItems:$}),i.a.createElement(l.Suspense,{fallback:i.a.createElement("div",null)},y?i.a.createElement(z,{modalInfo:y,setModalInfo:x,session:s}):I?i.a.createElement(R,{handleClose:function(){S(void 0)},deleteDialogDetails:I,session:s}):null,H?i.a.createElement(J,{handleClose:function(){return F(!1)},breakConnection:X,session:s}):null,G?i.a.createElement(P,{handleClose:function(){return K(!1)},session:s,breakConnection:X,assemblyName:V}):null))})),Y=Object(H.observer)((function(e){var n=e.model,t=e.toolbarHeight,a=void 0===t?0:t,o=Object(l.useState)(0),r=Object(c.a)(o,2),s=r[0],d=r[1],u=Object(l.useState)(0),m=Object(c.a)(u,2),b=m[0],f=m[1],g=n.assemblyNames;if(!g[s])return null;var h=n.hierarchy(g[s]);return i.a.createElement(i.a.Fragment,null,i.a.createElement(X,{model:n,setHeaderHeight:f,setAssemblyIdx:d,assemblyIdx:s}),i.a.createElement(K,{tree:h,model:n,offset:a+b}))}));n.default=V}}]);
  //# sourceMappingURL=46.30f00249.chunk.js.map