var chem;(()=>{"use strict";var e,r,t={9493:(e,r,t)=>{const n=e=>null==e;function o(e,r,t,n){if(t>e[e.length-1])return;const o=e.findIndex((e=>t>e))+1;e.pop(),e.splice(o,0,t),r.pop(),r.splice(o,0,n)}var a=t(1542),l=t(6465);onmessage=async e=>{const{values:r,startIdx:t,endIdx:s,fnName:i,opts:c,nNeighbours:p}=e.data;try{const e=new Array(r.length).fill(null).map((()=>new Array(p).fill(-1))),h=new Array(r.length).fill(null).map((()=>new Array(p).fill(999999))),f=s-t;if((0,a.sQ)(i))for(let e=0;e<r.length;++e)n(r[e])||(r[e]=new l.Z(r[e]._data,r[e]._length));let u=0;const g=new a.UH(i).getMeasure(c),v=r.length-2-Math.floor(Math.sqrt(-8*t+4*r.length*(r.length-1)-7)/2-.5),d=t-r.length*v+Math.floor((v+1)*(v+2)/2);let m=v,w=d;for(;u<f;){const t=n(r[m])||n(r[w])?1:g(r[m],r[w]);o(h[m],e[m],t,w),o(h[w],e[w],t,m),u++,w++,w===r.length&&(m++,w=m+1)}postMessage({knnDistances:h,knnIndexes:e})}catch(e){postMessage({error:e})}}}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,o.x=()=>{var e=o.O(void 0,[388,542],(()=>o(9493)));return o.O(e)},e=[],o.O=(r,t,n,a)=>{if(!t){var l=1/0;for(p=0;p<e.length;p++){for(var[t,n,a]=e[p],s=!0,i=0;i<t.length;i++)(!1&a||l>=a)&&Object.keys(o.O).every((e=>o.O[e](t[i])))?t.splice(i--,1):(s=!1,a<l&&(l=a));if(s){e.splice(p--,1);var c=n();void 0!==c&&(r=c)}}return r}a=a||0;for(var p=e.length;p>0&&e[p-1][2]>a;p--)e[p]=e[p-1];e[p]=[t,n,a]},o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((r,t)=>(o.f[t](e,r),r)),[])),o.u=e=>e+".js",o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var r=o.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={493:1};o.f.i=(r,t)=>{e[r]||importScripts(o.p+o.u(r))};var r=self.webpackChunkchem=self.webpackChunkchem||[],t=r.push.bind(r);r.push=r=>{var[n,a,l]=r;for(var s in a)o.o(a,s)&&(o.m[s]=a[s]);for(l&&l(o);n.length;)e[n.pop()]=1;t(r)}})(),r=o.x,o.x=()=>Promise.all([o.e(388),o.e(542)]).then(r);var a=o.x();chem=a})();
//# sourceMappingURL=493.js.map