"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[1531],{40474:(e,t,n)=>{n.d(t,{A:()=>p});var o=n(99546),r=n(68446),s=n(67758),i=n(69500);const l=e=>{const t=(0,s.c)(5),{color:n}=e,r=void 0===n?"rgb(255,255,255,0.8)":n;let l,a;return t[0]!==r?(l=(0,o.getFillProps)(r),t[0]=r,t[1]=l):l=t[1],t[2]!==e||t[3]!==l?(a=(0,i.jsx)("rect",{...e,...l}),t[2]=e,t[3]=l,t[4]=a):a=t[4],a},a=function(e){const t=(0,s.c)(27),{source:n,idx:o,rowHeight:r,labelWidth:a,model:c,exportSVG:h}=e,d=Math.min(20,r),{needsCustomLegend:g,graphType:x,needsFullHeightScalebar:m,rowHeightTooSmallForScalebar:u,renderColorBoxes:p}=c,w=Math.min(r,12),j=r>11,f=p?15:0,b=a+f+5,S=(h?10:0)||(x&&!u?50:0);let v,V,C,F;return t[0]!==d||t[1]!==S||t[2]!==o||t[3]!==b||t[4]!==m||t[5]!==r?(v=m?null:(0,i.jsx)(l,{y:o*r+1,x:S,width:b,height:d}),t[0]=d,t[1]=S,t[2]=o,t[3]=b,t[4]=m,t[5]=r,t[6]=v):v=t[6],t[7]!==d||t[8]!==f||t[9]!==S||t[10]!==o||t[11]!==g||t[12]!==r||t[13]!==n.color?(V=n.color?(0,i.jsx)(l,{y:o*r+1,x:S,width:f,height:g?r:d,color:n.color}):null,t[7]=d,t[8]=f,t[9]=S,t[10]=o,t[11]=g,t[12]=r,t[13]=n.color,t[14]=V):V=t[14],t[15]!==j||t[16]!==f||t[17]!==S||t[18]!==o||t[19]!==r||t[20]!==n.name||t[21]!==w?(C=j?(0,i.jsx)("text",{y:o*r+13,x:S+f+2,fontSize:w,children:n.name}):null,t[15]=j,t[16]=f,t[17]=S,t[18]=o,t[19]=r,t[20]=n.name,t[21]=w,t[22]=C):C=t[22],t[23]!==v||t[24]!==V||t[25]!==C?(F=(0,i.jsxs)(i.Fragment,{children:[v,V,C]}),t[23]=v,t[24]=V,t[25]=C,t[26]=F):F=t[26],F},c=(0,r.observer)(function({model:e,rowHeight:t,exportSVG:n}){const{graphType:o,needsFullHeightScalebar:r,rowHeightTooSmallForScalebar:s,renderColorBoxes:c,sources:h,labelWidth:d}=e,g=d+(c?15:0)+5,x=(n?10:0)||(o&&!s?50:0);return h?(0,i.jsxs)(i.Fragment,{children:[r?(0,i.jsx)(l,{y:0,x,width:g,height:(h.length+.25)*t}):null,h.map((o,r)=>(0,i.jsx)(a,{source:o,idx:r,model:e,rowHeight:t,exportSVG:n,labelWidth:d},`${o.name}-${r}`))]}):null});var h=n(58474),d=n(90461);const g=(0,r.observer)(function({model:e,orientation:t,exportSVG:n}){const{labelWidth:r}=e,{width:s}=(0,o.getContainingView)(e);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("g",{transform:`translate(${n?0:(0,h.A3)(e)},0)`,children:(0,i.jsx)(d.A,{model:e,orientation:t})}),(0,i.jsx)("g",{transform:`translate(${s-r-100},0)`,children:(0,i.jsx)(c,{exportSVG:n,model:e,rowHeight:12})})]})}),x=(0,r.observer)(({model:e})=>{const{ticks:t,scaleType:n}=e,{width:r}=(0,o.getContainingView)(e),s=`[${t?.values[0]}-${t?.values[1]}]${"log"===n?" (log scale)":""}`,a=(0,o.measureText)(s,14),c=r-a-25;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l,{y:0,x:c,width:a+6,height:16}),(0,i.jsx)("text",{y:13,x:c,children:s})]})}),m=(0,r.observer)(function({model:e,orientation:t,exportSVG:n}){const{sources:o,rowHeight:r,rowHeightTooSmallForScalebar:s,needsCustomLegend:l,ticks:a}=e;return o?.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c,{exportSVG:n,model:e,rowHeight:e.rowHeight}),s||l?(0,i.jsx)(x,{model:e}):o.map((n,o)=>(0,i.jsx)("g",{transform:`translate(0 ${r*o})`,children:(0,i.jsx)(d.A,{model:e,orientation:t})},`${JSON.stringify(a)}-${o}`))]}):null}),u=(0,r.observer)(function({children:e,model:t,exportSVG:n}){const{height:r}=t;return n?e:(0,i.jsx)("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none",height:r,width:(0,o.getContainingView)(t).width},children:e})}),p=(0,r.observer)(function(e){const{model:t,orientation:n,exportSVG:o}=e,{showSidebar:r,stats:s,needsFullHeightScalebar:l,sources:a}=t;return s&&a?(0,i.jsx)(u,{...e,children:r?l?(0,i.jsx)(g,{model:t,orientation:n,exportSVG:o}):(0,i.jsx)(m,{model:t,orientation:n,exportSVG:o}):null}):null})},51531:(e,t,n)=>{n.d(t,{renderSvg:()=>l});var o=n(99546),r=n(42489),s=n(40474),i=n(69500);async function l(e,t,n){await(0,r.when)(()=>!!e.stats&&!!e.regionCannotBeRenderedText);const{offsetPx:l}=(0,o.getContainingView)(e);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("g",{children:await n(t)}),(0,i.jsx)("g",{transform:`translate(${Math.max(-l,0)})`,children:(0,i.jsx)(s.A,{model:e,orientation:"left",exportSVG:!0})})]})}},58474:(e,t,n)=>{n.d(t,{A3:()=>a,BO:()=>s,oJ:()=>i});var o=n(68584),r=n(99546);function s(e,t,n=1){const o=t.map(t=>e.findIndex(e=>e.name===t)).sort((e,t)=>e-t);let r=0;for(const t of o){const o=Math.max(r,t-n);o>=r&&e.splice(o,0,e.splice(t,1)[0]),r+=1}return e}function i(e,t,n=1){const o=t.map(t=>e.findIndex(e=>e.name===t)).sort((e,t)=>t-e);let r=e.length-1;for(const t of o){const o=Math.min(r,t+n);o<=r&&e.splice(o,0,e.splice(t,1)[0]),r-=1}return e}const l=12.8;function a(e){const{prefersOffset:t}=e,{trackLabels:n}=(0,r.getContainingView)(e),s=(0,r.getContainingTrack)(e),i=(0,o.getConf)(s,"name");return"overlapping"!==n||t?10:(0,r.measureText)(i,l)+100}}}]);
//# sourceMappingURL=1531.028159d1.chunk.js.map