var chem;(()=>{"use strict";var e,r,o={8623:(e,r,o)=>{var t=o(6590);function n(e){return"smiles"===e}onmessage=({data:{op:e,data:r,argList:o,notationType:s}})=>{switch(e){case"chem_properties":postMessage(function(e,r,o){const s={},a=[];for(const o of r)s[o]=new Array(e.length).fill(null);return e.forEach((e,c)=>{try{const a=n(o)?t.Molecule.fromSmiles(e):t.Molecule.fromMolfile(e);r.forEach(e=>{s[e][c]=l[e].valueFunc(a)})}catch(e){a.push(e instanceof Error?e.message:e)}}),{res:s,errors:a}}(r,o,s));break;case"drug_likeness":postMessage(function(e,r){const o="Drug likeness score",l={[o]:new Array(e.length).fill(0)},s=[],a=new t.DruglikenessPredictor;return e.forEach((e,c)=>{try{const s=n(r)?t.Molecule.fromSmiles(e):t.Molecule.fromMolfile(e),i=a.assessDruglikeness(s);l[o][c]=i}catch(e){s.push(e instanceof Error?e.message:e)}}),{res:l,errors:s}}(r,s));case"Molfile_To_V3K":postMessage(function(e){var r;const o=new Array(null!==(r=null==e?void 0:e.length)&&void 0!==r?r:0).fill(""),n=[];return e.forEach((e,r)=>{if(e)try{const n=t.Molecule.fromMolfile(e).toMolfileV3();o[r]=n.replace("STERAC1","STEABS")}catch(e){n.push(e instanceof Error?e.message:e),o[r]=""}else o[r]=""}),{res:o,errors:n}}(r));case"recalculate_coordinates":postMessage(function(e,r){var o;const l=new Array(null!==(o=null==e?void 0:e.length)&&void 0!==o?o:0).fill(""),s=[];return e.forEach((e,o)=>{if(e)try{const s=n(r)?t.Molecule.fromSmiles(e):t.Molecule.fromMolfile(e);s.inventCoordinates();const a=s.toMolfileV3();l[o]=a.replace("STERAC1","STEABS")}catch(e){s.push(e instanceof Error?e.message:e),l[o]=""}else l[o]=""}),{res:l,errors:s}}(r,s));break;default:postMessage(function(e,r,o){const l={},s=[];for(const o of r)l[o]=new Array(e.length).fill(0);const a=new t.ToxicityPredictor;return e.forEach((e,c)=>{try{const s=n(o)?t.Molecule.fromSmiles(e):t.Molecule.fromMolfile(e);r.forEach(e=>{l[e][c]=a.assessRisk(s,e)})}catch(e){s.push(e instanceof Error?e.message:e)}}),{res:l,errors:s}}(r,o,s))}};const l={MW:{name:"MW",type:"float",valueFunc:e=>e.getMolecularFormula().absoluteWeight},HBA:{name:"HBA",type:"int",valueFunc:e=>new t.MoleculeProperties(e).acceptorCount},HBD:{name:"HBD",type:"int",valueFunc:e=>new t.MoleculeProperties(e).donorCount},LogP:{name:"LogP",type:"float",valueFunc:e=>new t.MoleculeProperties(e).logP},LogS:{name:"LogS",type:"float",valueFunc:e=>new t.MoleculeProperties(e).logS},PSA:{name:"PSA",type:"float",valueFunc:e=>new t.MoleculeProperties(e).polarSurfaceArea},"Rotatable bonds":{name:"Rotatable bonds",type:"int",valueFunc:e=>new t.MoleculeProperties(e).rotatableBondCount},"Stereo centers":{name:"Stereo centers",type:"int",valueFunc:e=>new t.MoleculeProperties(e).stereoCenterCount},"Molecule charge":{name:"Molecule charge",type:"int",valueFunc:e=>function(e){const r=e.getAllAtoms();let o=0;for(let t=0;t<=r;++t)o+=e.getAtomCharge(t);return o}(e)}}}},t={};function n(e){var r=t[e];if(void 0!==r)return r.exports;var l=t[e]={exports:{}};return o[e].call(l.exports,l,l.exports,n),l.exports}n.m=o,n.x=()=>{var e=n.O(void 0,[590],()=>n(8623));return n.O(e)},e=[],n.O=(r,o,t,l)=>{if(!o){var s=1/0;for(u=0;u<e.length;u++){for(var[o,t,l]=e[u],a=!0,c=0;c<o.length;c++)(!1&l||s>=l)&&Object.keys(n.O).every(e=>n.O[e](o[c]))?o.splice(c--,1):(a=!1,l<s&&(s=l));if(a){e.splice(u--,1);var i=t();void 0!==i&&(r=i)}}return r}l=l||0;for(var u=e.length;u>0&&e[u-1][2]>l;u--)e[u]=e[u-1];e[u]=[o,t,l]},n.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return n.d(r,{a:r}),r},n.d=(e,r)=>{for(var o in r)n.o(r,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce((r,o)=>(n.f[o](e,r),r),[])),n.u=e=>e+".js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var r=n.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var o=r.getElementsByTagName("script");if(o.length)for(var t=o.length-1;t>-1&&(!e||!/^http(s?):/.test(e));)e=o[t--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={623:1};n.f.i=(r,o)=>{e[r]||importScripts(n.p+n.u(r))};var r=self.webpackChunkchem=self.webpackChunkchem||[],o=r.push.bind(r);r.push=r=>{var[t,l,s]=r;for(var a in l)n.o(l,a)&&(n.m[a]=l[a]);for(s&&s(n);t.length;)e[t.pop()]=1;o(r)}})(),r=n.x,n.x=()=>n.e(590).then(r);var l=n.x();chem=l})();
//# sourceMappingURL=623.js.map