"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[9978],{21016:(e,t,n)=>{n.d(t,{K:()=>l});var o=n(87485),c=n(46879);function l(e,t,n,l,f,r,s){t.fillStyle=function(e,t){const n=e.length;let c=0,l=0,f=0,r=0;for(const n of e)n===t?c++:"0"===n?r++:"."===n?l++:f++;if(r===n)return"#ccc";{let e;if(c&&(e=(0,o.M)(`hsl(200,50%,${80-c/n*50}%)`)),f){const t=`hsla(0,100%,20%,${f/n})`;e=e?e.mix(t):(0,o.M)(t)}if(l){const t=`hsl(50,50%,50%,${l/n})`;e=e?e.mix(t):(0,o.M)(t)}return e?.toHex()||"black"}}(e,s),t.fillRect(n-c.f2,l-c.f2,f+c.f2,r+c.f2)}},40171:(e,t,n)=>{n.d(t,{E:()=>f});var o=n(40898),c=n(46879),l=n(42268);function f(e,t,n,f,r,s,i,a){t.fillStyle=void 0!==a?function(e,t,n){return+e[t]?(0,l.qH)(+n)||"black":"#ccc"}(e,i,a):function(e,t){const n=+e[t];return n?o.set1[n-1]||"black":"#ccc"}(e,i),t.fillRect(n-c.f2,f-c.f2,r+c.f2,s+c.f2)}},42268:(e,t,n)=>{function o(e){let t=0;for(let n=0;n<e.length;n++)t+=e.charCodeAt(n);return c(10*t)}function c(e){return`hsl(${e%255}, 50%, 50%)`}n.d(t,{XL:()=>o,qH:()=>c})},46879:(e,t,n)=>{n.d(t,{f2:()=>o});const o=.3},99978:(e,t,n)=>{n.d(t,{makeImageData:()=>u});var o=n(99546),c=n(37347),l=n(22593),f=n.n(l),r=n(46879),s=n(21016),i=n(40171),a=n(85497);async function u(e,t){const{scrollTop:n,minorAlleleFrequencyFilter:l,sources:u,rowHeight:h,features:m,regions:p,bpPerPx:b,renderingMode:g,stopToken:d}=t,w=p[0];(0,c.SW)(d);const k=(0,a.Cg)(m.values(),l);(0,c.SW)(d);const x=new(f());let M=performance.now();for(const{mostFrequentAlt:t,feature:l}of k){performance.now()-M>400&&((0,c.SW)(d),M=performance.now());const[f,a]=(0,o.featureSpanPx)(l,w,b),m=Math.max(Math.round(a-f),2),p=l.get("genotypes");let k=-n;const S=u.length;for(let n=0;n<S;n++){const{name:o,HP:c}=u[n],l=p[o],a=Math.floor(f),b=Math.max(h,1);if(l){x.insert({minX:a-r.f2,maxX:a+m+r.f2,minY:k-r.f2,maxY:k+b+r.f2,genotype:l});const n=l.includes("|");if("phased"===g)if(n){const t=l.split("|");(0,i.E)(t,e,a,k,m,b,c)}else e.fillStyle="black",e.fillRect(a-r.f2,k-r.f2,m+r.f2,b+r.f2);else{const n=l.split(/[/|]/);(0,s.K)(n,e,a,k,m,b,t)}}k+=h}}return{rbush:x.toJSON()}}}}]);
//# sourceMappingURL=9978.c862be3b.chunk.js.map