(()=>{var t={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"],whitepoint:{2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}}};t.max=t.whitepoint[2].D65,t.rgb=function(i,s){s=s||t.whitepoint[2].E;var e,a,n,h=i[0]/s[0],r=i[1]/s[1],o=i[2]/s[2];return a=-.96924363628087*h+1.87596750150772*r+.041555057407175*o,n=.055630079696993*h+-.20397695888897*r+1.056971514242878*o,e=(e=3.240969941904521*h+-1.537383177570093*r+-.498610760293*o)>.0031308?1.055*Math.pow(e,1/2.4)-.055:e*=12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,[255*(e=Math.min(Math.max(0,e),1)),255*(a=Math.min(Math.max(0,a),1)),255*(n=Math.min(Math.max(0,n),1))]};t.lab=function(t){var i=t[0],s=t[1],e=t[2];return s/=100,e/=108.883,i=(i/=95.047)>.008856?Math.pow(i,1/3):7.787*i+16/116,[116*(s=s>.008856?Math.pow(s,1/3):7.787*s+16/116)-16,500*(i-s),200*(s-(e=e>.008856?Math.pow(e,1/3):7.787*e+16/116))]};const i=3*Math.max(499,491,487,503),s={ncycles:100,netsize:256,samplefac:10};class e{constructor(t,i){if(function(t){for(let i=1,s=arguments.length;i256)throw new Error("Color count must be between 4 and 256");if(this.samplefac<1||this.samplefac>30)throw new Error("Sampling factor must be between 1 and 30");this.maxnetpos=this.netsize-1,this.netbiasshift=4,this.intbiasshift=16,this.intbias=1<>this.betashift,this.betagamma=this.beta*this.gamma,this.initrad=this.netsize>>3,this.radiusbiasshift=6,this.radiusbias=1<>3);for(let t=0,i=this.netsize;t>=this.netbiasshift,this.network[t][1]>>=this.netbiasshift,this.network[t][2]>>=this.netbiasshift,this.network[t][3]=t}altersingle(t,i,s,e,a){this.network[i][0]-=t*(this.network[i][0]-s)/this.initalpha,this.network[i][1]-=t*(this.network[i][1]-e)/this.initalpha,this.network[i][2]-=t*(this.network[i][2]-a)/this.initalpha}alterneigh(t,i,s,e,a){const n=Math.abs(i-t),h=Math.min(i+t,this.netsize);let r=i+1,o=i-1,l=1;for(;rn;){const t=this.radpower[l++];if(rn){const i=this.network[o--];i[0]-=t*(i[0]-s)/this.alpharadbias,i[1]-=t*(i[1]-e)/this.alpharadbias,i[2]-=t*(i[2]-a)/this.alpharadbias}}}contest(t,i,s){let e=~(1<<31),a=e,n=-1,h=n;for(let r=0,o=this.netsize;r>this.intbiasshift-this.netbiasshift);f>this.betashift;this.freq[r]-=b,this.bias[r]+=b<>1;for(let i=t+1;i>1;for(let i=t+1;i<256;i++)this.netindex[i]=this.maxnetpos}learn(){const t=this.pixels.length,s=30+(this.samplefac-1)/3,e=t/(3*this.samplefac);let a,n=e/this.ncycles|0,h=this.initalpha,r=this.initradius,o=r>>this.radiusbiasshift;o<=1&&(o=0);for(let t=0;t=t&&(l-=t),0===n&&(n=1),++i%n==0){h-=h/s,r-=r/this.radiusdec,o=r>>this.radiusbiasshift,o<=1&&(o=0);for(let t=0;t1){const t=Math.sqrt(n);e=e/t|0,a=a/t|0}const h=t(e,a);return h.drawImage(i,0,0,e,a),h.getImageData(0,0,e,a)}f.bind(void 0,r),f.bind(void 0,o);var b;b=function(t){const{label:i,centroid:s}=n(t,8),e=Math.max(...i);return s[i.findIndex((t=>t==e))]},self.addEventListener("message",(async t=>{const i=t.data,s=i[0],e=i[1];try{const t=[],i=await b(e,(i=>t.push(i)));self.postMessage([s,null,i],t.length?{transfer:t}:void 0)}catch(t){self.postMessage([s,{message:t.message}])}}))})(); //# sourceMappingURL=6589.js.map