"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[9978],{99978:(e,t,n)=>{n.d(t,{makeImageData:()=>f});var l=n(99546),c=n(22593),o=n.n(c),s=n(75943),r=n(7080);const a=.3;function i(e,t,n,l,c,o){t.fillStyle=(0,s.WX)(e),t.fillRect(n-a,l-a,c+a,o+a)}function u(e,t,n,l,c,o,r){t.fillStyle=(0,s.j0)(e,r),t.fillRect(n-a,l-a,c+a,o+a)}async function f(e,t){const{scrollTop:n,minorAlleleFrequencyFilter:c,sources:s,rowHeight:f,features:h,regions:b,bpPerPx:g,renderingMode:m}=t,p=b[0],x=(0,r.Cg)(h.values(),c),k=new(o());for(const t of x){const[c,o]=(0,l.featureSpanPx)(t,p,g),r=Math.max(Math.round(o-c),2),h=t.get("genotypes");let b=-n;const x=s.length;for(let t=0;t<x;t++){const{name:n,HP:l}=s[t],o=h[n],g=Math.floor(c),p=Math.max(f,1);if(o){k.insert({minX:g-a,maxX:g+r+a,minY:b-a,maxY:b+p+a,genotype:o});const t=o.includes("|");"phased"===m?t?u(o.split("|"),e,g,b,r,p,l):(e.fillStyle="black",e.fillRect(g-a,b-a,r+a,p+a)):i(o.split(/[/|]/),e,g,b,r,p)}b+=f}}return{rbush:k.toJSON()}}},75943:(e,t,n)=>{n.d(t,{WX:()=>s,j0:()=>r,uL:()=>a});var l=n(40898),c=n(87485),o=n(7080);function s(e){const t=e.length;let n=0,l=0,o=0,s=0;for(const t of e)"1"===t?n++:"0"===t?s++:"."===t?l++:o++;if(s===t)return"#ccc";{let e=(0,c.M)(`hsl(200,50%,${80-n/t*50}%)`);return o&&(e=e.mix(`hsla(0,100%,20%,${o/t})`)),l&&(e=e.mix(`hsla(50,50%,50%,${l/t/2})`)),e.toHex()}}function r(e,t){const n=+e[t];return n?l.set1[n-1]||"black":"#ccc"}function a(e,t,n){return+e[t]?(0,o.qH)(+n)||"black":"#ccc"}}}]);
//# sourceMappingURL=9978.439cb7b6.chunk.js.map