"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[7126],{53740:(e,t,n)=>{n.d(t,{A:()=>g});var o=n(7552),r=n(68446),a=n(99546),l=n(68584),s=n(72241),i=n(9502);function c(e,t){const n=t?(0,i.h)(t):void 0,o=e.get("start");let r=e.get("end");const a=e.get("strand"),l=e.get("mate"),s=e.get("refName");let c,m=0,d=0,u=0,g=0;if(["<TRA","<DEL","<INV","<INS","<DUP","<CNV"].some((e=>t?.startsWith(e)))){const t=e.get("INFO"),n=t?.END?.[0]??r;c=t?.CHR2?.[0]??s,m=n,d=n-1,r=o+1}else if(n?.MatePosition){const e=n.MatePosition.split(":");g="left"===n.MateDirection?1:-1,u="left"===n.Join?-1:1,m=+e[1],d=+e[1]-1,c=e[0]}return{k1:{refName:s,start:o,end:r,strand:a,mateDirection:g},k2:l??{refName:c,end:m,start:d,mateDirection:u}}}function m(e,t){const{k1:n,k2:o}=c(e,t);return[e.get("name"),e.get("id"),(0,a.assembleLocString)(n),(0,a.assembleLocString)(o),e.get("INFO")?.SVTYPE,t].filter((e=>!!e)).join(" - ")}const d=(0,r.observer)((function({model:e,feature:t,alt:n,assembly:r,view:a}){const[i,d]=(0,o.useState)(!1),{height:u}=e,{k1:g,k2:f}=c(t,n),b=(0,o.useRef)(null),k=(0,l.getConf)(e,"color",{feature:t,alt:n}),h=r.getCanonicalRefName(g.refName)||g.refName,E=r.getCanonicalRefName(f.refName)||f.refName,p=g.start,v=f.start,x=a.bpToPx({refName:h,coord:p})?.offsetPx,N=a.bpToPx({refName:E,coord:v})?.offsetPx;if(void 0!==x&&void 0!==N){const r=(N-x)/2,l=Math.abs(r),c=Math.min(u,l),h=x-a.offsetPx,E=N-a.offsetPx,p=i?"black":k,v=3;return l>1?o.createElement(o.Fragment,null,o.createElement("path",{d:`M ${h} 0 C ${h} ${c}, ${E} ${c}, ${E} 0`,ref:b,stroke:p,strokeWidth:v,onMouseOut:()=>d(!1),onMouseOver:()=>d(!0),onClick:()=>e.selectFeature(t),fill:"none",pointerEvents:"stroke"}),void 0!==g.mateDirection?o.createElement("line",{stroke:p,strokeWidth:v,onMouseOut:()=>d(!1),onMouseOver:()=>d(!0),onClick:()=>e.selectFeature(t),x1:h,x2:h+20*g.mateDirection,y1:1.5,y2:1.5}):null,void 0!==f.mateDirection?o.createElement("line",{stroke:p,strokeWidth:v,onMouseOut:()=>d(!1),onMouseOver:()=>d(!0),onClick:()=>e.selectFeature(t),x1:E,x2:E+20*f.mateDirection,y1:1.5,y2:1.5}):null,i?o.createElement(s.A,{contents:m(t,n)}):null):null}return null})),u=(0,r.observer)((function({model:e,exportSVG:t,children:n}){const{height:r}=e,l=(0,a.getContainingView)(e),s=Math.round(l.dynamicBlocks.totalWidthPx);return t?n:o.createElement("svg",{width:s,height:r},n)})),g=(0,r.observer)((function({model:e,exportSVG:t}){const n=(0,a.getContainingView)(e),r=(0,a.getSession)(e),{assemblyManager:l}=r,{features:s}=e,i=l.get(n.assemblyNames[0]);return i?o.createElement(u,{model:e,exportSVG:t},s?.map((t=>{const a=t.get("ALT");return a?.map((a=>o.createElement(d,{key:t.id()+"-"+a,session:r,feature:t,alt:a,view:n,model:e,assembly:i})))??o.createElement(d,{key:t.id(),session:r,feature:t,view:n,model:e,assembly:i})}))):null}))},87126:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var o=n(7552),r=n(68446),a=n(89003),l=n(61723),s=n(48735),i=n(68666),c=n(75785),m=n(38130),d=n(2047),u=n(99546);const g=(0,o.lazy)((()=>Promise.all([n.e(9245),n.e(4630)]).then(n.bind(n,74630)))),f=(0,c.n9)()((e=>({loading:{backgroundColor:e.palette.background.default,backgroundImage:`repeating-linear-gradient(45deg, transparent, transparent 5px, ${e.palette.action.disabledBackground} 5px, ${e.palette.action.disabledBackground} 10px)`,position:"absolute",bottom:0,height:50,width:300,right:0,pointerEvents:"none",textAlign:"center"}}))),b=(0,r.observer)((function({model:e,children:t}){const{error:n,regionTooLarge:r}=e;return n?o.createElement(i.LW,{message:`${n}`,severity:"error",action:o.createElement(o.Fragment,null,o.createElement(a.A,{title:"Reload"},o.createElement(l.A,{"data-testid":"reload_button",onClick:()=>e.reload()},o.createElement(m.A,null))),o.createElement(a.A,{title:"Show stack trace"},o.createElement(l.A,{onClick:()=>{(0,u.getSession)(e).queueDialog((t=>[g,{onClose:t,error:e.error}]))}},o.createElement(d.A,null))))}):r?e.regionCannotBeRendered():o.createElement(k,{model:e},t)})),k=(0,r.observer)((function({model:e,children:t}){const{loading:n}=e;return o.createElement("div",null,t,n?o.createElement(h,{model:e}):null)})),h=(0,r.observer)((function({model:e}){const{classes:t}=f(),{message:n}=e;return o.createElement("div",{className:t.loading},o.createElement(s.LoadingEllipses,{message:n}))})),E=b;var p=n(53740);const v=(0,r.observer)((function({model:e,exportSVG:t}){return o.createElement(E,{model:e},o.createElement(p.A,{model:e,exportSVG:t}))}))}}]);
//# sourceMappingURL=7126.ac1a2fa1.chunk.js.map