(function(S,T,U,V,L,W,N,s,O,P,Q,A,X,R,Y,C,K,Z,v,$,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,x,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,l){N("JS");O(null,"JS.MathExt","java.lang.Float $.Number java.util.Date $.Hashtable $.Random JU.AU $.BS $.CU $.Lst $.M4 $.Measure $.P3 $.P4 $.PT $.Quat $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.bspt.PointIterator J.c.VDW J.i18n.GT JM.BondSet JS.SV $.ScriptParam $.T JU.BSUtil $.Escape $.JmolMolecule $.Logger $.Parser $.Point3fi $.SimpleUnitCell JV.FileManager $.JC".split(" "),
function(){c$=Q(function(){this.pm=this.rand=this.e=this.vwr=null;P(this,arguments)},JS,"MathExt");R(c$,function(){});l(c$,"init",function(d){this.e=d;this.vwr=this.e.vwr;return this},"~O");l(c$,"evaluate",function(d,a,b,c){switch(c){case 134218250:case 134218242:case 134218245:case 134217749:case 134218244:case 134218246:return this.evaluateMath(d,b,c);case 1275069441:case 1275068928:case 1275068929:case 1275068930:case 1275068931:case 1275335685:case 1275334681:return this.evaluateList(d,a.intValue,
b);case 268435520:0==b.length&&(d.wasX=!1);case 1275068418:return this.evaluateArray(d,b,1275068418==c&&268435665==a.tok);case 134217731:case 134221850:return this.evaluateQuaternion(d,b,c);case 1275068420:return this.evaluateBin(d,b);case 134221829:return this.evaluateCache(d,b);case 1275068934:case 1275068935:return this.evaluateRowCol(d,b,c);case 1765808134:return this.evaluateColor(d,b);case 134221831:return this.evaluateCompare(d,b);case 1228931587:case 134217736:case 1275203608:return this.evaluateConnected(d,
b,c,a.intValue);case 1814695966:return this.evaluateUnitCell(d,b,268435665==a.tok);case 134353926:return this.evaluateContact(d,b);case 134221834:return this.evaluateData(d,b);case 1275069444:case 1275069442:return this.evaluateDotDist(d,b,c,a.intValue);case 1275069443:if(268435665==a.tok)return this.evaluateDotDist(d,b,c,a.intValue);case 134217729:case 1745489939:return this.evaluateMeasure(d,b,a.tok);case 1228935687:case 134222849:return this.evaluateLoad(d,b,1228935687==c);case 1275068427:return this.evaluateFind(d,
b);case 1287653388:case 1825200146:return this.evaluateFormat(d,a.intValue,b,1825200146==c);case 134320141:return this.evaluateUserFunction(d,a.value,b,a.intValue,268435665==a.tok);case 1275068449:case 1275082245:case 1275072526:return this.evaluateGetProperty(d,b,c,268435665==a.tok);case 136314895:return this.evaluateHelix(d,b);case 134219265:case 134217750:case 134219266:return this.evaluatePlane(d,b,c);case 134218759:case 134238732:case 134222850:case 134222350:return this.evaluateScript(d,b,c);
case 1275069446:case 1275069447:case 1275068932:return this.evaluateString(d,a.intValue,b);case 134217751:return this.evaluatePoint(d,b);case 134217762:return this.evaluatePointGroup(d,b);case 134256131:return this.evaluatePrompt(d,b);case 134219268:return this.evaluateRandom(d,b);case 1275068432:return this.evaluateIn(d,b);case 1275072532:return this.evaluateModulation(d,b);case 1275068443:return this.evaluateReplace(d,b);case 134218756:case 134218757:case 1237320707:return this.evaluateSubstructure(d,
b,c,268435665==a.tok);case 1275068444:case 1275068425:return this.evaluateSort(d,b,c);case 1296041986:return this.evaluateSymop(d,b,268435665==a.tok);case 1275068445:return this.evaluateTensor(d,b);case 134217759:return this.evaluateWithin(d,b);case 134221856:return this.evaluateWrite(d,b)}return!1},"JS.ScriptMathProcessor,JS.T,~A,~N");l(c$,"evaluatePointGroup",function(d,a){var b=null,c=null,e=NaN,g=NaN,f;switch(a.length){case 4:g=a[3].asFloat();case 3:e=a[2].asFloat();case 2:switch(a[1].tok){case 8:c=
JS.SV.ptValue(a[1]);break;case 10:f=JS.SV.getBitSet(a[1],!1);c=f.nextSetBit(0);if(0>c||c>=this.vwr.ms.ac||1!=f.cardinality())return!1;if(JS.SV.sValue(a[0]).equalsIgnoreCase("spaceGroup")){c=this.vwr.ms.generateCrystalClass(c,JU.P3.new3(NaN,NaN,NaN));b=Array(c.size());for(f=b.length;0<=--f;)b[f]=c.get(f);c=new JU.P3;2==a.length&&(e=0)}else c=this.vwr.ms.at[c]}if(null!=b)break;case 1:switch(a[0].tok){case 7:var h=a[0].getList(),b=Array(h.size());for(f=b.length;0<=--f;)b[f]=JS.SV.ptValue(h.get(f));break;
case 10:f=JS.SV.getBitSet(a[0],!1);h=this.vwr.ms.getAtomPointVector(f);b=Array(h.size());for(f=b.length;0<=--f;)b[f]=h.get(f);break;default:return!1}break;default:return!1}b=this.vwr.getSymTemp().setPointGroup(null,c,b,null,!1,Float.isNaN(e)?this.vwr.getFloat(570425382):e,Float.isNaN(g)?this.vwr.getFloat(570425384):g,!0);return d.addXMap(b.getPointGroupInfo(-1,null,!0,null,0,1))},"JS.ScriptMathProcessor,~A");l(c$,"evaluateUnitCell",function(d,a,b){b=b?JS.SV.getBitSet(d.getX(),!0):null;b=(null==b?
this.vwr.getAllAtoms():b).nextSetBit(0);var c=a.length-1,e=1;switch(0>c?0:a[c].tok){case 2:case 3:e=a[c].asFloat(),c--}var g=0>c?0:a[0].tok,f=null,h=null;switch(g){case 7:h=a[0].getList();break;case 4:var k=a[0].asString();if(0==k.indexOf("a=")){for(var f=Array(4),j=0;4>j;j++)f[j]=new JU.P3;JU.SimpleUnitCell.setOabc(k,null,f)}}k=null;j=null!=h;if(null==f&&j&&4>h.size())return!1;var m=j?1:0;null==f&&(!j&&8!=g)&&(k=0>b?null:this.vwr.ms.getUnitCell(this.vwr.ms.at[b].mi),f=null==k?x(-1,[JU.P3.new3(0,
0,0),JU.P3.new3(1,0,0),JU.P3.new3(0,1,0),JU.P3.new3(0,0,1)]):k.getUnitCellVectors());if(null==f)if(f=Array(4),j)switch(h.size()){case 3:f[0]=new JU.P3;for(j=0;3>j;j++)f[j+1]=JU.P3.newP(JS.SV.ptValue(h.get(j)));break;case 4:for(j=0;4>j;j++)f[j]=JU.P3.newP(JS.SV.ptValue(h.get(j)));break;case 6:g=v(6,0);for(j=0;6>j;j++)g[j]=h.get(j).asFloat();JU.SimpleUnitCell.setOabc(null,g,f);break;default:return!1}else switch(f[0]=JS.SV.ptValue(a[0]),c){case 3:for(j=1;4>j;j++)(f[j]=JU.P3.newP(JS.SV.ptValue(a[j]))).sub(f[0]);
break;case 1:if(h=a[1].getList(),null!=h&&3==h.size()){for(j=0;3>j;j++)f[j+1]=JS.SV.ptValue(h.get(j));break}default:return!1}j=m<=c?a[m].asString():null;if((h="primitive".equalsIgnoreCase(j))||"conventional".equalsIgnoreCase(j)){if(a=++m>c?"":a[m].asString().toUpperCase(),a.equals("BCC")?a="I":0==a.length&&(a=this.vwr.getSymTemp().getSymmetryInfoAtom(this.vwr.ms,b,null,0,null,null,null,1073741994,0,-1)),null==a||0==a.length||!(null==k?this.vwr.getSymTemp():k).toFromPrimitive(h,a.charAt(0),f))return!1}else"reciprocal".equalsIgnoreCase(j)&&
(f=JU.SimpleUnitCell.getReciprocal(f,null,e),e=1);if(1!=e)for(j=1;4>j;j++)f[j].scale(e);return d.addXObj(f)},"JS.ScriptMathProcessor,~A,~B");l(c$,"evaluateArray",function(d,a,b){if(b){b=d.getX();switch(1==a.length?b.tok:0){case 6:var c=new JU.Lst,e=a[0].asString(),g=b.getMap(),f=b.getKeys(!1);b=0;for(a=f.length;b<a;b++)if(null==g.get(f[b]).getMap())return!1;b=0;for(a=f.length;b<a;b++){var h=g.get(f[b]),h=h.getMap(),h=JS.SV.deepCopy(h,!0,!1);h.put(e,JS.SV.newS(f[b]));c.addLast(JS.SV.newV(6,h))}return d.addXList(c);
case 7:c=new java.util.Hashtable;e=b.getList();g=a[0].asString();b=0;for(a=e.size();b<a;b++)if(h=e.get(b).getMap(),null==h||null==h.get(g))return!1;b=0;for(a=e.size();b<a;b++)h=e.get(b),h=JS.SV.deepCopy(h.getMap(),!0,!1),f=h.remove(g),c.put(f.asString(),JS.SV.newV(6,h));return d.addXObj(c)}return!1}c=Array(a.length);for(b=c.length;0<=--b;)c[b]=JS.SV.newT(a[b]);return d.addXAV(c)},"JS.ScriptMathProcessor,~A,~B");l(c$,"evaluateBin",function(d,a){var b=a.length;if(3>b||5<b)return!1;var c=d.getX(),e=
13==c.tok;if(!e&&7!=c.tok)return d.addX(c);var g=JS.SV.fValue(a[0]),f=JS.SV.fValue(a[1]),h=JS.SV.fValue(a[2]),k=4<=b&&1073742335==a[b-1].tok,b=(5==b||4==b&&!k)&&1073742334!=a[3].tok?JS.SV.sValue(a[3]):null,j=null;if(e)c=c.value;else{e=c.getList();c=v(e.size(),0);null!=b&&(j=JU.AU.createArrayOfHashtable(e.size()));try{for(var m=e.size();0<=--m;)c[m]=JS.SV.fValue(null==b?e.get(m):(j[m]=e.get(m).getMap()).get(b))}catch(q){if(C(q,Exception))return!1;throw q;}}for(var f=Math.max(L(Math.floor((f-g)/h+0.01)),
1),e=K(f,0),r=c.length,m=0;m<r;m++){var n=L(Math.floor((c[m]-g)/h));if(!(0>n||n>=f))if(e[n]++,null!=b){var l=j[m];if(null!=l){l.put("_bin",JS.SV.newI(n));var H=g+h*n,p=H+h;l.put("_binMin",JS.SV.newF(0==n?-3.4028235E38:H));l.put("_binMax",JS.SV.newF(n==f-1?3.4028235E38:p))}}}if(k){k=new JU.Lst;for(m=0;m<f;m++)k.addLast(v(-1,[g+h*m,e[m]]));return d.addXList(k)}return d.addXAI(e)},"JS.ScriptMathProcessor,~A");l(c$,"evaluateCache",function(d,a){return 0<a.length?!1:d.addXMap(this.vwr.fm.cacheList())},
"JS.ScriptMathProcessor,~A");l(c$,"evaluateColor",function(d,a){var b=0<a.length?JS.SV.sValue(a[0]):"",c=b.startsWith("$");if(2==a.length&&b.equalsIgnoreCase("TOHSL"))return d.addXPt(JU.CU.rgbToHSL(JU.P3.newP(8==a[1].tok?JS.SV.ptValue(a[1]):JU.CU.colorPtFromString(a[1].asString())),!0));if(2==a.length&&b.equalsIgnoreCase("TORGB")){var e=JU.P3.newP(8==a[1].tok?JS.SV.ptValue(a[1]):JU.CU.colorPtFromString(a[1].asString()));return d.addXPt(8==a[1].tok?JU.CU.hslToRGB(e):e)}if(4==a.length&&(1073742335==
a[3].tok||1073742334==a[3].tok)){var e=JU.P3.newP(8==a[0].tok?JS.SV.ptValue(a[0]):JU.CU.colorPtFromString(a[0].asString())),g=JU.P3.newP(8==a[1].tok?JS.SV.ptValue(a[1]):JU.CU.colorPtFromString(a[1].asString())),f=1073742335==a[3].tok;f&&(e=JU.CU.rgbToHSL(e,!1),g=JU.CU.rgbToHSL(g,!1));var h=new JU.SB,g=JU.V3.newVsub(g,e),k=a[2].asInt();2>k&&(k=20);g.scale(1/(k-1));for(b=0;b<k;b++)h.append(JU.Escape.escapeColor(JU.CU.colorPtToFFRGB(f?JU.CU.hslToRGB(e):e))),e.add(g);return d.addXStr(h.toString())}k=
c?null:this.vwr.cm.getColorEncoder(b);if(!c&&null==k)return d.addXStr("");e=1<a.length?JS.SV.fValue(a[1]):3.4028235E38;g=2<a.length?JS.SV.fValue(a[2]):3.4028235E38;f=3<a.length?JS.SV.fValue(a[3]):3.4028235E38;h=3.4028235E38!=f||3.4028235E38!=e&&3.4028235E38==g;3.4028235E38==g&&0==b.length&&(f=e,g=this.vwr.getCurrentColorRange(),e=g[0],g=g[1]);if(c){k=b.substring(1);k=x(-1,[k,null]);if(!this.vwr.shm.getShapePropertyData(24,"colorEncoder",k))return d.addXStr("");k=k[1]}else k.setRange(e,g,e>g);b=k.getColorKey();
return h?d.addXPt(JU.CU.colorPtFromInt(k.getArgb(3.4028235E38==g?e:f),null)):d.addX(JS.SV.getVariableMap(b))},"JS.ScriptMathProcessor,~A");l(c$,"evaluateCompare",function(d,a){if(2>a.length||5<a.length)return!1;var b,c=JS.SV.sValue(a[a.length-1]),e=c.equalsIgnoreCase("stddev"),g=c.equalsIgnoreCase("ISOMER"),f=c.equalsIgnoreCase("BONDS"),h=!g&&a.length>(e?3:2),k=10==a[0].tok?a[0].value:null,j=10==a[1].tok?a[1].value:null,m=null==k?JS.SV.sValue(a[0]):"",q=null==j?JS.SV.sValue(a[1]):"",r=new JU.M4;b=
NaN;var n,l;try{if(h&&(null==k||null==j))return!1;if(f){if(4!=a.length)return!1;m=JS.SV.sValue(a[2]);h=m.equalsIgnoreCase("SMILES");try{h&&(m=this.vwr.getSmiles(k))}catch(H){if(C(H,Exception))this.e.evalError(H.getMessage(),null);else throw H;}var p=this.e.getSmilesExt().getFlexFitList(k,j,m,!h);return null==p?d.addXStr(""):d.addXAF(p)}if(g){if(3!=a.length)return!1;if(null==k&&null==j)return d.addXStr(this.vwr.getSmilesMatcher().getRelationship(m,q).toUpperCase());var s=null==k?this.vwr.getSmilesMatcher().getMolecularFormula(m,
!1):JU.JmolMolecule.getMolecularFormulaAtoms(this.vwr.ms.at,k,null,!1),y=null==j?this.vwr.getSmilesMatcher().getMolecularFormula(q,!1):JU.JmolMolecule.getMolecularFormulaAtoms(this.vwr.ms.at,j,null,!1);if(!s.equals(y))return d.addXStr("NONE");null!=k&&(m=this.e.getSmilesExt().getSmilesMatches("/strict///",null,k,null,1,!0,!1));var w;null==j?w=0<this.vwr.getSmilesMatcher().areEqual(q,m):(q=this.e.getSmilesExt().getSmilesMatches("/strict///",null,j,null,1,!0,!1),w=0<=this.e.getSmilesExt().getSmilesMatches("/strict///"+
m,null,j,null,1,!0,!1).nextSetBit(0));if(!w){n=m+q;if(0<=n.indexOf("/")||0<=n.indexOf("\\")||0<=n.indexOf("@")){if(0<=m.indexOf("@")&&(null!=j||0<=q.indexOf("@"))&&0>m.indexOf("@SP")){var v=m.toLowerCase().indexOf("invertstereo"),m=0<=v?"/strict/"+m.substring(0,v)+m.substring(v+12):"/invertstereo strict/"+m;if(w=null==j?0<this.vwr.getSmilesMatcher().areEqual(m,q):0<=this.e.getSmilesExt().getSmilesMatches(m,null,j,null,1,!0,!1).nextSetBit(0))return d.addXStr("ENANTIOMERS")}if(null==j)w=0<this.vwr.getSmilesMatcher().areEqual("/nostereo/"+
q,m);else{var u=this.e.getSmilesExt().getSmilesMatches("/nostereo/"+m,null,j,null,1,!0,!1);w=0<=u.nextSetBit(0)}if(w)return d.addXStr("DIASTEREOMERS")}return d.addXStr("CONSTITUTIONAL ISOMERS")}if(null==k||null==j)return d.addXStr("IDENTICAL");b=this.e.getSmilesExt().getSmilesCorrelation(k,j,m,null,null,null,null,!1,null,null,!1,1);return d.addXStr(0.2>b?"IDENTICAL":"IDENTICAL or CONFORMATIONAL ISOMERS (RMSD="+b+")")}if(h){n=new JU.Lst;l=new JU.Lst;var c=JS.SV.sValue(a[2]),x=c.equalsIgnoreCase("MAP"),
h=c.equalsIgnoreCase("SMILES"),D=x||c.equalsIgnoreCase("SMARTS");if(h||D)c=a.length>(e?4:3)?JS.SV.sValue(a[3]):null;var B="H".equalsIgnoreCase(c)||"allH".equalsIgnoreCase(c)||"bestH".equalsIgnoreCase(c),E="polyhedra".equalsIgnoreCase(c);E&&(c=a.length>(e?5:4)?JS.SV.sValue(a[4]):null);var z="all".equalsIgnoreCase(c)||"allH".equalsIgnoreCase(c),F="best".equalsIgnoreCase(c)||"bestH".equalsIgnoreCase(c);"stddev".equals(c)&&(c=null);m=c;if(null==c||B||z||F){if(!x&&!h||B&&E)return!1;m="/noaromatic"+(z||
F?"/":" nostereo/")+this.e.getSmilesExt().getSmilesMatches(B?"H":"",null,k,null,1,!0,!1)}else z=!0;b=this.e.getSmilesExt().getSmilesCorrelation(k,j,m,n,l,r,null,x,null,null,F,(h?1:2)|(!z&&!F?8:0));if(x){var G=n.size();if(0==G)return d.addXStr("");for(var A=L(l.size()/G),u=new JU.Lst,v=j=0;j<A;j++){var M=JU.AU.newInt2(G);u.addLast(M);for(b=0;b<G;b++,v++)M[b]=K(-1,[n.get(b).i,l.get(v).i])}return z?d.addXList(u):0<u.size()?d.addXAII(u.get(0)):d.addXStr("")}}else{switch(a.length){case 2:break;case 3:if(e)break;
default:return!1}n=this.e.getPointVector(a[0],0);l=this.e.getPointVector(a[1],0);null!=n&&null!=l&&(J.api.Interface.getInterface("JU.Eigen",this.vwr,"script"),b=JU.Measure.getTransformMatrix4(n,l,r,null))}return e||Float.isNaN(b)?d.addXFloat(b):d.addXM4(r.round(1E-7))}catch(I){if(C(I,Exception))return this.e.evalError(null==I.getMessage()?I.toString():I.getMessage(),null),!1;throw I;}},"JS.ScriptMathProcessor,~A");l(c$,"evaluateConnected",function(d,a,b,c){if(5<a.length)return!1;var e=-2147483648,
g=2147483647,f=0,h=3.4028235E38,k=65535,j=null,m=null,q=!1,l=!1;switch(b){case 1275203608:m=-2147483648;f=null;if(0<a.length)switch(a[0].tok){case 2:m=a[0].intValue;break;case 4:f=JS.SV.sValue(a[0])}1275203608==c&&(j=JS.SV.getBitSet(d.getX(),!0));j=x(-1,[Integer.$valueOf(m),f,j]);this.vwr.shm.getShapePropertyData(21,"getCenters",j)||(j[1]=null);return d.addXBs(null==j[1]?new JU.BS:j[1]);case 1228931587:j=d.getX();if(10!=j.tok||1!=a.length||10!=a[0].tok)return!1;j=j.value;m=a[0].value;a=new JU.Lst;
f=this.vwr.ms.at;for(c=j.nextSetBit(0);0<=c;c=j.nextSetBit(c+1)){b=0;h=f[c].bonds;for(l=h.length;0<=--l;)m.get(h[l].getOtherAtom(f[c]).i)&&b++;a.addLast(Integer.$valueOf(b))}return d.addXList(a)}for(c=0;c<a.length;c++){var n=a[c];switch(n.tok){case 10:if((l=s(n.value,JM.BondSet))&&null!=j)return!1;if(null==j)j=n.value;else if(null==m)m=n.value;else return!1;break;case 4:b=JS.SV.sValue(n);k=b.equalsIgnoreCase("hbond")?30720:JS.ScriptParam.getBondOrderFromString(b);if(131071==k)return!1;break;case 3:q=
!0;default:b=n.asInt();n=n.asFloat();if(2147483647!=g)return!1;-2147483648==e?(e=Math.max(b,0),f=n):(g=b,h=n)}}-2147483648==e?(e=1,g=100,f=0.1,h=1E8):2147483647==g&&(g=e,h=f,f=0.1);null==j&&(j=this.vwr.getAllAtoms());q&&null==m&&(m=j);return null!=m?(a=new JU.BS,this.vwr.makeConnections(f,h,k,1086324745,j,m,a,l,!1,0),d.addX(JS.SV.newV(10,JM.BondSet.newBS(a,this.vwr.ms.getAtomIndices(this.vwr.ms.getAtoms(1677721602,a)))))):d.addXBs(this.vwr.ms.getAtomsConnected(e,g,k,j))},"JS.ScriptMathProcessor,~A,~N,~N");
l(c$,"evaluateContact",function(d,a){if(1>a.length||3<a.length)return!1;var b=0,c=100;switch(a[0].tok){case 3:case 2:c=JS.SV.fValue(a[b++]);break;case 10:break;default:return!1}if(b==a.length||!s(a[b].value,JU.BS))return!1;var e=JU.BSUtil.copy(a[b++].value),b=b<a.length?JU.BSUtil.copy(a[b].value):null,c=new J.atomdata.RadiusData(null,10<c?c/100:c,10<c?J.atomdata.RadiusData.EnumType.FACTOR:J.atomdata.RadiusData.EnumType.OFFSET,J.c.VDW.AUTO),b=this.setContactBitSets(e,b,!0,NaN,c,!1);b.or(e);return d.addXBs(b)},
"JS.ScriptMathProcessor,~A");l(c$,"evaluateData",function(d,a){var b=0==a.length?"":JS.SV.sValue(a[0]);switch(a.length){case 0:case 1:break;case 2:case 3:if(10==a[0].tok)return d.addXStr(this.vwr.getModelFileData(b,JS.SV.sValue(a[1]),3==a.length&&JS.SV.bValue(a[2])));break;case 4:var b=a[1].asInt(),c=a[2].asInt(),e=a[3].asInt(),b=JU.Parser.parseFloatArrayFromMatchAndField(JS.SV.sValue(a[0]),null,0,0,null,b,c,null,e);return d.addXStr(JU.Escape.escapeFloatA(b,!1));default:return!1}if(0==b.indexOf("data2d_"))return b=
this.vwr.getDataObj(b,null,2),null==b?d.addXStr(""):2==a.length&&2==a[1].tok?(c=a[1].intValue,0>c&&(c+=b.length),0<=c&&c<b.length?d.addXStr(JU.Escape.escapeFloatA(b[c],!1)):d.addXStr("")):d.addXStr(JU.Escape.escapeFloatAA(b,!1));if(0==b.indexOf("property_"))return b=this.vwr.getDataObj(b,null,1),null==b?d.addXStr(""):d.addXStr(JU.Escape.escapeFloatA(b,!1));b=this.vwr.getDataObj(b,null,-1);return d.addXStr(null==b?"":""+b[1])},"JS.ScriptMathProcessor,~A");l(c$,"evaluateDotDist",function(d,a,b,c){var e=
1275069443==b,g,f,h=null;switch(a.length){case 2:if(2147483647==c){g=a[0];f=a[1];break}h=a[1];case 1:g=d.getX();f=a[0];break;default:return!1}if(1275069442==b)return g=JU.P3.newP(d.ptValue(g,null)),g.cross(g,d.ptValue(f,null)),d.addXPt(g);b=7==f.tok?null:d.ptValue(f,null);a=d.planeValue(f);if(e){var k=-2147483648==c?0:c&480,j=32==k||64==k,m=480==k;switch(g.tok){case 10:var q=g.value,l=null,n=j&&null!=h&&h.asBoolean();switch(f.tok){case 10:l=10==f.tok?f.value:null;case 8:e=this.vwr.ms.at;if(n){f=NaN;
j=2147483647;for(h=q.nextSetBit(0);0<=h;h=q.nextSetBit(h+1))if(m=null==l?e[h].distanceSquared(b):this.e.getBitsetProperty(l,c,e[h],a,g.value,null,!1,g.index,!1).floatValue(),!(32==k?m>=f:m<=f))f=m,j=h;return d.addXBs(2147483647==j?new JU.BS:JU.BSUtil.newAndSetBit(j))}if(m){if(null==l){f=v(q.cardinality(),0);k=0;for(h=q.nextSetBit(0);0<=h;h=q.nextSetBit(h+1),k++)f[k]=e[h].distance(b);return d.addXAF(f)}g=v(q.cardinality(),l.cardinality(),0);k=0;for(h=q.nextSetBit(0);0<=h;h=q.nextSetBit(h+1),k++){b=
0;for(a=l.nextSetBit(0);0<=a;a=l.nextSetBit(a+1),b++)g[k][b]=e[h].distance(e[a])}return d.addXAFF(g)}if(j){f=v(q.cardinality(),0);h=q.nextSetBit(0);for(k=0;0<=h;h=q.nextSetBit(h+1))f[k++]=this.e.getBitsetProperty(l,c,e[h],a,g.value,null,!1,g.index,!1).floatValue();return d.addXAF(f)}return d.addXObj(this.e.getBitsetProperty(q,c,b,a,g.value,null,!1,g.index,!1))}}}q=d.ptValue(g,null);g=d.planeValue(g);l=NaN;try{e?l=null!=a&&null!=h?JU.Measure.directedDistanceToPlane(q,a,JS.SV.ptValue(h)):null==g?null==
a?b.distance(q):JU.Measure.distanceToPlane(a,q):JU.Measure.distanceToPlane(g,b):null!=g&&null!=a?l=g.x*a.x+g.y*a.y+g.z*a.z+g.w*a.w:(null!=g?q=JU.P3.new3(g.x,g.y,g.z):null!=a&&(b=JU.P3.new3(a.x,a.y,a.z)),l=q.dot(b))}catch(t){if(!C(t,Exception))throw t;}return d.addXFloat(l)},"JS.ScriptMathProcessor,~A,~N,~N");l(c$,"evaluateHelix",function(d,a){if(1>a.length||5<a.length)return!1;var b=2<a.length?3:1,c=b>=a.length?"array":JS.SV.sValue(a[b]),b=JS.T.getTokFromName(c);if(2<a.length){var e=d.ptValue(a[0],
null),g=d.ptValue(a[1],null);if(0==b||9!=a[2].tok||null==e||null==g)return!1;var f=JU.Quat.newP4(a[2].value),f=JU.Measure.computeHelicalAxis(e,g,f);return null==f?!1:d.addXObj(JU.Escape.escapeHelical(c,b,e,g,f))}c=s(a[0].value,JU.BS)?a[0].value:this.vwr.ms.getAtoms(1094715412,new Integer(a[0].asInt()));switch(b){case 134217751:case 1073741854:case 1665140738:return d.addXObj(this.getHelixData(c,b));case 134217729:return d.addXFloat(this.getHelixData(c,134217729).floatValue());case 135176:case 1745489939:return d.addXObj(this.getHelixData(c,
b));case 1275068418:f=this.getHelixData(c,1073742001);if(null==f)break;return d.addXAS(f)}return!1},"JS.ScriptMathProcessor,~A");l(c$,"getHelixData",function(d,a){var b=d.nextSetBit(0);return 0>b?"null":this.vwr.ms.at[b].group.getHelixData(a,this.vwr.getQuaternionFrame(),this.vwr.getInt(553648146))},"JU.BS,~N");l(c$,"evaluateFind",function(d,a){var b=d.getX(),c=7==b.tok,e=0==a.length,g=e?"":JS.SV.sValue(a[0]),f=1<a.length&&1073742335!=a[1].tok&&1073742334!=a[1].tok&&10!=a[1].tok?JS.SV.sValue(a[1]):
"",h=!c&&g.equalsIgnoreCase("SEQUENCE"),k=!c&&g.equalsIgnoreCase("SEQ");if(g.toUpperCase().startsWith("SMILES/")){g.endsWith("/")||(g+="/");var j=g.substring(6)+"//";JV.JC.isSmilesCanonical(j)?(f="SMILES",g="CHEMICAL"):(g="SMILES",f=j+f)}else g.toUpperCase().startsWith("SMARTS/")&&(g.endsWith("/")||(g+="/"),f=g.substring(6)+(0==f.length?"//":f),g="SMARTS");var m=!c&&g.equalsIgnoreCase("SMILES"),j=!c&&g.equalsIgnoreCase("SMARTS"),l=!c&&g.equalsIgnoreCase("CHEMICAL"),r=!c&&g.equalsIgnoreCase("MF"),
n=!c&&g.equalsIgnoreCase("CELLFORMULA"),t=0<a.length?a[a.length-1]:JS.SV.vF,v=!c&&1073742335==t.tok;try{if(l){var p=10==b.tok?b.value:null,s=null==p?JS.SV.sValue(b):this.vwr.getOpenSmiles(p),s=(0==s.length?"":this.vwr.getChemicalInfo(s,f.toLowerCase(),p)).trim();s.startsWith("InChI")&&(s=JU.PT.rep(JU.PT.rep(s,"InChI=",""),"InChIKey=",""));return d.addXStr(s)}if(m||j||10==b.tok){var p=m||j?2:1,y=p<a.length&&10==a[p].tok?a[p++].value:null,w="bonds".equalsIgnoreCase(JS.SV.sValue(a[a.length-1])),s=w||
v,p=null;switch(b.tok){case 4:var x=JS.SV.sValue(b);if(null!=y||m&&1==a.length)return!1;if(f.equalsIgnoreCase("mf"))p=this.vwr.getSmilesMatcher().getMolecularFormula(x,j);else{var k=f,u=!0,y=!1;switch(a.length){case 4:u=JS.SV.bValue(a[3]);case 3:y=JS.SV.bValue(a[2])}w=!y&&(!u||!j);try{p=this.e.getSmilesExt().getSmilesMatches(k,x,null,null,j?2:1,!y,!u)}catch(A){if(C(A,Exception))return System.out.println(A.getMessage()),d.addXInt(-1);throw A;}if(w){var D=p.length;return d.addXInt(!u&&0<D?1:D)}}break;
case 10:u=b.value;if(r&&0!=f.length)return d.addXBs(JU.JmolMolecule.getBitSetForMF(this.vwr.ms.at,u,f));if(r||n)return d.addXStr(JU.JmolMolecule.getMolecularFormulaAtoms(this.vwr.ms.at,u,r?null:this.vwr.ms.getCellWeights(u),v));if(h||k){var B=t.asString().equalsIgnoreCase("H"),s=(new Boolean(s|B)).valueOf();return d.addXStr(this.vwr.getSmilesOpt(u,-1,-1,(s?7340032|(B?9437184:0):0)|(k?34603008:1048576),null))}if(m||j)g=1<a.length&&10==a[1].tok?this.vwr.getSmilesOpt(a[1].value,0,0,0,f):f;f=f.toUpperCase();
if(w)var E=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,this.vwr.ms.ac,u,(m?1:2)|8),p=0<E.length?this.vwr.ms.getDihedralMap(E[0]):K(0,0);else if(f.equalsIgnoreCase("map"))p=E=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,this.vwr.ms.ac,u,(m?1:2)|128);else if(g.equalsIgnoreCase("crystalClass"))p=this.vwr.ms.generateCrystalClass(u.nextSetBit(0),2!=a.length?null:10==t.tok?this.vwr.ms.getAtomSetCenter(t.value):JS.SV.ptValue(t));else var z=(m?0<=f.indexOf("OPEN")?5:
1:2)|(v&&0==g.length?22020096:0),p=this.e.getSmilesExt().getSmilesMatches(g,null,u,y,z,!v,!1)}null==p&&this.e.invArg();return d.addXObj(p)}}catch(F){if(C(F,Exception))this.e.evalError(F.getMessage(),null);else throw F;}x=0<=f.indexOf("v");u=0<=f.indexOf("i");f=0<=f.indexOf("m");D=0==g.length;j=!D&&2==a.length;if(c||j){y=j?this.getPatternMatcher():null;k=null;h=c?b.getList():null;if(j)try{k=y.compile(g,u)}catch(G){if(C(G,Exception))this.e.evalError(G.toString(),null);else throw G;}y=D?null:JS.SV.strListValue(b);
E=D?h.size():y.length;JU.Logger.debugging&&JU.Logger.debug("finding "+g);u=new JU.BS;w=0;z=null;B=f?new JU.Lst:null;m="";for(b=0;b<E;b++){if(D)switch(r=h.get(b),r.tok){case 6:r=r.getMap().isEmpty()!=e;break;case 7:r=0==r.getList().size()!=e;break;case 4:r=0==r.asString().length!=e;break;default:r=!0}else j?(m=y[b],z=k.matcher(m),r=z.find()):r=0<=JS.SV.sValue(h.get(b)).indexOf(g);if(f&&r||!f&&r==!x)w++,u.set(b),f&&B.addLast(x?m.substring(0,z.start())+m.substring(z.end()):z.group())}if(!c)return f?
d.addXStr(1==B.size()?B.get(0):""):x?d.addXBool(1==w):f?d.addXStr(0==w?"":z.group()):d.addXInt(0==w?0:z.start()+1);if(f){c=Array(w);if(0<w)for(b=y.length;0<=--b;)u.get(b)&&(--w,c[w]=f?B.get(w):y[b]);return d.addXAS(c)}c=new JU.Lst;for(b=u.nextSetBit(0);0<=b;b=u.nextSetBit(b+1))c.addLast(h.get(b));return d.addXList(c)}return h?d.addXStr(this.vwr.getJBR().toStdAmino3(JS.SV.sValue(b))):d.addXInt(JS.SV.sValue(b).indexOf(g)+1)},"JS.ScriptMathProcessor,~A");l(c$,"evaluateGetProperty",function(d,a,b,c){var e=
c&&1275082245==b;b=1275068449==b;var g=0,f=0==a.length?0:a[0].tok;if(2==a.length&&(7==f||6==f||14==f))return d.addXObj(this.vwr.extractProperty(a[0].value,a[1].value.toString(),-1));var h=c&&1==a.length&&10==a[0].tok?a[0].value:null,k=null==h&&0<a.length?JS.SV.sValue(a[g++]):"",f=k,j=f.toLowerCase();!e&&0>j.indexOf("[select ")&&(f=j);var m=!1;f.equals("json")&&a.length>g&&(m=!0,f=JS.SV.sValue(a[g++]));var l=null;if(c){l=d.getX();switch(l.tok){case 10:break;case 4:return b=l.value,a=Array(3),b.startsWith("$")?
(b=b.substring(1),c=this.vwr.shm.getShapeIdFromObjectName(b),0<=c&&(a[0]=b,this.vwr.shm.getShapePropertyData(c,"index",a),null!=a[1]&&!k.equals("index")&&(b=a[1].intValue(),a[1]=this.vwr.shm.getShapePropertyIndex(c,k.intern(),b)))):(c=JV.JC.shapeTokenIndex(JS.T.getTokFromName(b)),0<=c&&(a[0]=k,a[1]=Integer.$valueOf(-1),this.vwr.shm.getShapePropertyData(c,k.intern(),a))),null==a[1]?d.addXStr(""):d.addXObj(a[1]);case 7:if(null!=h){a=l.getList();c=new JU.Lst;for(g=h.nextSetBit(0);0<=g;g=h.nextSetBit(g+
1))c.addLast(a.get(g));return d.addXList(c)}default:return e&&(f="[SELECT "+f+"]"),d.addXObj(this.vwr.extractProperty(l,f,-1))}!j.startsWith("bondinfo")&&!j.startsWith("atominfo")&&(f="atomInfo."+f)}k="";if(f.equalsIgnoreCase("fileContents")&&2<a.length){k=JS.SV.sValue(a[1]);for(g=2;g<a.length;g++)k+="|"+JS.SV.sValue(a[g]);g=a.length}else if(a.length>g)switch(a[g].tok){case 10:k=a[g++].value;f.equalsIgnoreCase("bondInfo")&&(a.length>g&&10==a[g].tok)&&(k=x(-1,[k,a[g].value]));break;case 6:case 4:this.vwr.checkPropertyParameter(f)&&
(k=a[g++].value)}if(c&&(k=l.value,0>k.nextSetBit(0)))return d.addXStr("");b&&!c&&(f="auxiliaryInfo.models."+f);f=JU.PT.rep(f,".[","[");c=this.vwr.getProperty(null,f,k);g<a.length&&(c=this.vwr.extractProperty(c,a,g));return d.addXObj(m?JS.SV.safeJSON("value",c):JS.SV.isVariableType(c)?c:JU.Escape.toReadable(f,c))},"JS.ScriptMathProcessor,~A,~N,~B");l(c$,"evaluateFormat",function(d,a,b,c){var e=2>b.length||1287653388==a?d.getX():null,g=0==b.length?"%U":7==b[0].tok?null:JS.SV.sValue(b[0]);if(!c&&0<b.length&&
null!=e&&10!=e.tok&&null!=g){if(2==b.length){var e=e.getList(),f=b[1].getList();if(null==e||null==f)return!1;e=JS.SV.getVariableList(this.getSublist(e,f))}b=x(-1,[b[0],e]);e=null}if(null==e){a=c?-1:JS.SV.getFormatType(g);if(0<=a&&2!=b.length)return!1;if(0<=a||2>b.length||7!=b[1].tok)return b=JS.SV.format(b,a),g.equalsIgnoreCase("json")?d.addXStr(b):d.addXObj(b);g=b[1].getList();b=x(-1,[b[0],null]);c=Array(g.size());for(e=c.length;0<=--e;)b[1]=g.get(e),c[e]=JS.SV.format(b,a).toString();return d.addXAS(c)}if(7==
e.tok&&null==g)return e=e.getList(),f=b[0].getList(),g=this.getSublist(e,f),d.addXList(g);b=10==e.tok?e.value:null;a=JS.T.tokAttr(a,480);return d.addXObj(null==g?"":null==b?JS.SV.sprintf(JU.PT.formatCheck(g),e):this.e.getCmdExt().getBitsetIdent(b,g,e.value,!0,e.index,a))},"JS.ScriptMathProcessor,~N,~A,~B");l(c$,"getSublist",function(d,a){for(var b=new JU.Lst,c,e,g,f=0,h=d.size();f<h;f++)switch(e=d.get(f),e.tok){case 6:c=e.getMap();g=new JU.Lst;for(var k=0,j=a.size();k<j;k++)e=c.get(JS.SV.sValue(a.get(k))),
g.addLast(null==e?JS.SV.newS(""):e);b.addLast(JS.SV.getVariableList(g));break;case 7:c=new java.util.Hashtable;g=e.getList();k=0;for(j=Math.min(g.size(),a.size());k<j;k++)c.put(JS.SV.sValue(a.get(k)),g.get(k));b.addLast(JS.SV.getVariable(c))}return b},"JU.Lst,JU.Lst");l(c$,"evaluateList",function(d,a,b){var c=b.length,e=d.getX(),g=7==e.tok,f;switch(a){case 1275335685:return 2==c&&d.addX(e.pushPop(b[0],b[1]))||1==c&&d.addX(e.pushPop(null,b[0]));case 1275334681:return 1==c&&d.addX(e.pushPop(b[0],null))||
0==c&&d.addX(e.pushPop(null,null));case 1275069441:if(1!=c&&2!=c)return!1;break;case 1275069447:case 1275069446:break;default:if(1!=c)return!1}var h=null,k=null,j=null;if(2==c){var m=JS.SV.sValue(b[0]);f=b[1];if(1275069441==a){h=g?JS.SV.strListValue(e):JU.PT.split(JS.SV.sValue(e),"\n");k=7==f.tok?JS.SV.strListValue(f):JU.PT.split(JS.SV.sValue(f),"\n");j=Array(c=Math.max(h.length,k.length));for(e=0;e<c;e++)j[e]=(e>=h.length?"":h[e])+m+(e>=k.length?"":k[e]);return d.addXAS(j)}if(1073742335!=f.tok)return!1;
j=e.getList();(c=0==m.length)&&(m=",");if(1275069446==a){k=Array(j.size());for(e=j.size();0<=--e;)if(b=j.get(e).getList(),null==b)k[e]=j.get(e);else{a=new JU.SB;g=0;for(h=b.size();g<h;g++)0<g&&a.append(m),f=b.get(g),a.append(c&&4==f.tok?'"'+JU.PT.rep(f.value,'"','""')+'"':""+f.asString());k[e]=JS.SV.newS(a.toString())}return d.addXAV(k)}a=new JU.Lst;c&&(m="\x00");k=K(2,0);e=0;for(f=j.size();e<f;e++){g=j.get(e).asString();if(c){k[1]=0;for(h=k[0]=0;;){b=JU.PT.getCSVString(g,k);if(null==b){if(-1==k[1]){g+=
++e<f?"\n"+j.get(e).asString():'"';k[1]=h;continue}g=g.substring(0,h)+g.substring(h).$replace(",","\x00");break}g=g.substring(0,h)+g.substring(h,k[0]).$replace(",","\x00")+b+g.substring(k[1]);k[1]=h=k[0]+b.length}}for(var l=g.$plit(m),r=new JU.Lst,g=0,h=l.length;g<h;g++){b=l[g];if(0>b.indexOf("."))try{r.addLast(JS.SV.newI(Integer.parseInt(b)));continue}catch(n){if(!C(n,Exception))throw n;}else try{r.addLast(JS.SV.getVariable(Float.$valueOf(Float.parseFloat(b))));continue}catch(t){if(!C(t,Exception))throw t;
}r.addLast(JS.SV.newS(b))}a.addLast(JS.SV.getVariableList(r))}return d.addXObj(JS.SV.getVariableList(a))}f=0==c?JS.SV.newV(1073742327,"all"):b[0];j=1073742327==f.tok;if(!g&&4!=e.tok)return d.binaryOp(this.opTokenFor(a),e,f);var l=JS.SV.isScalar(e),s=JS.SV.isScalar(f),p=r=null,m=e.getList(),x=f.getList();g?c=m.size():l?c=2147483647:(h=JU.PT.split(JS.SV.sValue(e),"\n"),r=v(c=h.length,0),JU.PT.parseFloatArrayData(h,r));if(j&&1275069446!=a){j=0;if(g)for(e=c;0<=--e;)j+=JS.SV.fValue(m.get(e));else if(!l)for(e=
c;0<=--e;)j+=r[e];return d.addXFloat(j)}if(1275069446==a&&4==f.tok){a=new JU.SB;if(l)a.append(JS.SV.sValue(e));else{b=j?"":f.value.toString();for(e=0;e<c;e++)a.append(0<e?b:"").append(JS.SV.sValue(m.get(e)))}return d.addXStr(a.toString())}var y=null;s?y=f:7==f.tok?c=Math.min(c,x.size()):(k=JU.PT.split(JS.SV.sValue(f),"\n"),p=v(k.length,0),JU.PT.parseFloatArrayData(k,p),c=Math.min(c,p.length));var w=this.opTokenFor(a),A=Array(c);if(g&&j)return j=new JU.Lst,d.addXList(this.addAllLists(e.getList(),j));
b=l?e:null;for(var u,e=0;e<c;e++){u=s?y:7==f.tok?x.get(e):Float.isNaN(p[e])?JS.SV.getVariable(JS.SV.unescapePointOrBitsetAsVariable(k[e])):JS.SV.newF(p[e]);l||(b=g?m.get(e):Float.isNaN(r[e])?JS.SV.getVariable(JS.SV.unescapePointOrBitsetAsVariable(h[e])):JS.SV.newF(r[e]));1275069446==a&&7!=b.tok&&(j=new JU.Lst,j.addLast(b),b=JS.SV.getVariableList(j));if(!d.binaryOp(w,b,u))return!1;A[e]=d.getX()}return d.addXAV(A)},"JS.ScriptMathProcessor,~N,~A");l(c$,"addAllLists",function(d,a){for(var b=d.size(),
c=0;c<b;c++){var e=d.get(c);7==e.tok?this.addAllLists(e.getList(),a):a.addLast(e)}return a},"JU.Lst,JU.Lst");l(c$,"evaluateLoad",function(d,a,b){if(1>a.length||3<a.length)return!1;var c=JV.FileManager.fixDOSName(JS.SV.sValue(a[0])),e=1<a.length&&1073742335==a[1].tok,g=this.vwr.async||2<a.length&&1073742335==a[a.length-1].tok,f=1<a.length&&2==a[1].tok?a[1].asInt():-1;a=1<a.length&&a[1].asString().equalsIgnoreCase("JSON");if(e)return d.addXMap(this.vwr.fm.getFileAsMap(c));e=c.startsWith("?");if(this.vwr.isJS&&
(e||g)){if(b&&e)return d.addXStr("");c=this.e.loadFileAsync("load()_",c,d.oPt,!0)}b=b?this.vwr.fm.getFilePath(c,!1,!1):this.vwr.getFileAsString4(c,f,!1,!1,!0,"script");return a?d.addXObj(this.vwr.parseJSON(b)):d.addXStr(b)},"JS.ScriptMathProcessor,~A,~B");l(c$,"evaluateMath",function(d,a,b){if(134217749==b)return 1==a.length&&4==a[0].tok?d.addXStr(new java.util.Date+"\t"+JS.SV.sValue(a[0])):d.addXInt((System.currentTimeMillis()&2147483647)-(0==a.length?0:a[0].asInt()));if(1!=a.length)return!1;if(134218250==
b)return 2==a[0].tok?d.addXInt(Math.abs(a[0].asInt())):d.addXFloat(Math.abs(a[0].asFloat()));a=JS.SV.fValue(a[0]);switch(b){case 134218242:return d.addXFloat(180*Math.acos(a)/3.141592653589793);case 134218245:return d.addXFloat(Math.cos(3.141592653589793*a/180));case 134218244:return d.addXFloat(Math.sin(3.141592653589793*a/180));case 134218246:return d.addXFloat(Math.sqrt(a))}return!1},"JS.ScriptMathProcessor,~A,~N");l(c$,"evaluateMeasure",function(d,a,b){var c=0;switch(b){case 1745489939:b=new JU.Lst;
for(var e=v(-1,[3.4028235E38,3.4028235E38]),g=null,f=null,h=!1,k=!1,j=0,m=!1,l=null,r=0,n=3.4028235E38,t=!1,s=!1,l=0;l<a.length;l++)switch(a[l].tok){case 10:var p=a[l].value;0==p.length()&&(m=!0);b.addLast(p);c++;r++;break;case 8:p=new JU.Point3fi;p.setT(a[l].value);b.addLast(p);c++;break;case 2:case 3:e[j++%2]=JS.SV.fValue(a[l]);break;case 4:p=JS.SV.sValue(a[l]);p.equalsIgnoreCase("vdw")||p.equalsIgnoreCase("vanderwaals")?n=(l+1<a.length&&2==a[l+1].tok?a[++l].asInt():100)/100:p.equalsIgnoreCase("notConnected")?
k=!0:p.equalsIgnoreCase("connected")?h=!0:p.equalsIgnoreCase("minArray")?t=1<=r:p.equalsIgnoreCase("asArray")?s=1<=r:JU.PT.isOneOf(p.toLowerCase(),";nm;nanometers;pm;picometers;angstroms;ang;au;")||p.endsWith("hz")?f=p.toLowerCase():g=c+":"+p;break;default:return!1}if(2>c||4<c||2<j||k&&h)return!1;if(m||3.4028235E38!=n&&(2!=r||2!=c))return d.addXStr("");l=3.4028235E38==n?new J.atomdata.RadiusData(e,0,null,null):new J.atomdata.RadiusData(null,n,J.atomdata.RadiusData.EnumType.FACTOR,J.c.VDW.AUTO);return d.addXObj(this.vwr.newMeasurementData(null,
b).set(0,null,l,g,f,null,h,k,null,!0,0,0,null).getMeasurements(s,t));case 134217729:if(3!=(c=a.length)&&4!=c)return!1;break;default:if(2!=(c=a.length))return!1}b=Array(c);for(l=0;l<c;l++)if(null==(b[l]=d.ptValue(a[l],null)))return!1;switch(c){case 2:return d.addXFloat(b[0].distance(b[1]));case 3:return d.addXFloat(JU.Measure.computeAngleABC(b[0],b[1],b[2],!0));case 4:return d.addXFloat(JU.Measure.computeTorsion(b[0],b[1],b[2],b[3],!0))}return!1},"JS.ScriptMathProcessor,~A,~N");l(c$,"evaluateModulation",
function(d,a){var b="",c=NaN,e=null;switch(a.length){case 0:break;case 1:switch(a[0].tok){case 8:e=a[0].value;break;case 4:b=a[0].asString();break;default:c=JS.SV.fValue(a[0])}break;case 2:b=JS.SV.sValue(a[0]);c=JS.SV.fValue(a[1]);break;default:return!1}null==e&&1E6>c&&(e=JU.P3.new3(c,c,c));c=d.getX();c=10==c.tok?c.value:new JU.BS;return d.addXList(this.vwr.ms.getModulationList(c,(b+"D").toUpperCase().charAt(0),e))},"JS.ScriptMathProcessor,~A");l(c$,"evaluatePlane",function(d,a,b){if(134219265==b&&
3!=a.length||134219266==b&&2!=a.length&&3!=a.length||0==a.length||4<a.length)return!1;var c,e,g,f,h;switch(a.length){case 1:if(10==a[0].tok&&(b=a[0].value,3==b.cardinality()))return a=this.vwr.ms.getAtomPointVector(b),d.addXPt4(JU.Measure.getPlaneThroughPoints(a.get(0),a.get(1),a.get(2),new JU.V3,new JU.V3,new JU.P4));a=JU.Escape.uP(JS.SV.sValue(a[0]));return s(a,JU.P4)?d.addXPt4(a):d.addXStr(""+a);case 2:if(134219266==b){if(9!=a[1].tok)return!1;g=new JU.P3;b=new JU.V3;h=new JU.V3;f=a[1].value;if(9==
a[0].tok)return a=JU.Measure.getIntersectionPP(a[0].value,f),null==a?d.addXStr(""):d.addXList(a);e=d.ptValue(a[0],null);return null==e?d.addXStr(""):d.addXPt(JU.Measure.getIntersection(e,null,f,g,b,h))}case 3:case 4:switch(b){case 134219265:return d.addXPt4(this.e.getHklPlane(JU.P3.new3(JS.SV.fValue(a[0]),JS.SV.fValue(a[1]),JS.SV.fValue(a[2]))));case 134219266:c=d.ptValue(a[0],null);e=d.ptValue(a[1],null);if(null==c||null==e)return d.addXStr("");e=JU.V3.newV(e);e.normalize();if(9==a[2].tok)return g=
new JU.P3,b=new JU.V3,h=new JU.V3,c=JU.Measure.getIntersection(c,e,a[2].value,g,b,h),null==c?d.addXStr(""):d.addXPt(c);g=d.ptValue(a[2],null);if(null==g)return d.addXStr("");a=new JU.V3;JU.Measure.projectOntoAxis(g,c,e,a);return d.addXPt(g)}switch(a[0].tok){case 2:case 3:if(3==a.length)return c=JS.SV.fValue(a[0]),g=JS.SV.fValue(a[1]),a=JS.SV.fValue(a[2]),b=JU.V3.new3(0,0,1),e=JU.P3.new3(0,1,0),a=JU.Quat.newVA(e,a),a.getMatrix().rotate(b),e.set(0,0,1),a=JU.Quat.newVA(e,g),a.getMatrix().rotate(b),e.setT(b),
e.scale(c),f=new JU.P4,JU.Measure.getPlaneThroughPoint(e,b,f),d.addXPt4(f);break;case 10:case 8:c=d.ptValue(a[0],null);e=d.ptValue(a[1],null);if(null==e)return!1;g=2<a.length&&(10==a[2].tok||8==a[2].tok)?d.ptValue(a[2],null):null;b=JU.V3.newV(e);if(null==g)return f=new JU.P4,2==a.length||2!=a[2].tok&&3!=a[2].tok&&!a[2].asBoolean()?(g=JU.P3.newP(c),g.add(e),g.scale(0.5),b.sub(c),b.normalize()):1073742335==a[2].tok?g=c:(b.sub(c),g=new JU.P3,g.scaleAdd2(a[2].asFloat(),b,c)),JU.Measure.getPlaneThroughPoint(g,
b,f),d.addXPt4(f);h=new JU.V3;a=4==a.length?d.ptValue(a[3],null):null;a=JU.Measure.getDirectedNormalThroughPoints(c,e,g,a,b,h);return d.addXPt4(JU.P4.new4(b.x,b.y,b.z,a))}}if(4!=a.length)return!1;b=JS.SV.fValue(a[0]);e=JS.SV.fValue(a[1]);c=JS.SV.fValue(a[2]);a=JS.SV.fValue(a[3]);return d.addXPt4(JU.P4.new4(b,e,c,a))},"JS.ScriptMathProcessor,~A,~N");l(c$,"evaluatePoint",function(d,a){switch(a.length){default:return!1;case 1:if(3==a[0].tok||2==a[0].tok)return d.addXInt(a[0].asInt());var b=JS.SV.sValue(a[0]);
7==a[0].tok&&(b="{"+b+"}");b=JU.Escape.uP(b);return s(b,JU.P3)?d.addXPt(b):d.addXStr(""+b);case 2:switch(a[1].tok){case 1073742334:case 1073742335:switch(a[0].tok){case 8:b=JU.P3.newP(a[0].value);break;case 10:b=this.vwr.ms.getAtomSetCenter(a[0].value);break;default:return!1}1073742335==a[1].tok?(this.vwr.tm.transformPt3f(b,b),b.y=this.vwr.tm.height-b.y,this.vwr.antialiased&&b.scale(0.5)):(this.vwr.antialiased&&b.scale(2),b.y=this.vwr.tm.height-b.y,this.vwr.tm.unTransformPoint(b,b));break;case 8:var c=
a[0].getList();if(null==c||4!=c.size())return!1;var e=JS.SV.ptValue(a[1]),b=JU.P3.newP(JS.SV.ptValue(c.get(0)));b.scaleAdd2(e.x,JS.SV.ptValue(c.get(1)),b);b.scaleAdd2(e.y,JS.SV.ptValue(c.get(2)),b);b.scaleAdd2(e.z,JS.SV.ptValue(c.get(3)),b);break;default:return!1}return d.addXPt(b);case 3:return d.addXPt(JU.P3.new3(a[0].asFloat(),a[1].asFloat(),a[2].asFloat()));case 4:return d.addXPt4(JU.P4.new4(a[0].asFloat(),a[1].asFloat(),a[2].asFloat(),a[3].asFloat()))}},"JS.ScriptMathProcessor,~A");l(c$,"evaluatePrompt",
function(d,a){if(1!=a.length&&2!=a.length&&3!=a.length)return!1;var b=JS.SV.sValue(a[0]),c=1<a.length&&7==a[1].tok?JS.SV.strListValue(a[1]):null,e=null!=c||1==a.length||3==a.length&&a[2].asBoolean(),g=null!=c?null:2<=a.length?JS.SV.sValue(a[1]):"OK",b=""+this.vwr.prompt(b,g,c,e);return e&&null!=c?d.addXInt(Integer.parseInt(b)+1):d.addXStr(b)},"JS.ScriptMathProcessor,~A");l(c$,"evaluateQuaternion",function(d,a,b){var c=null,e=a.length,g=2147483647,f=!1;134221850==b&&(1<e&&(4==a[e-1].tok&&a[e-1].value.equalsIgnoreCase("relative"))&&
(e--,f=!0),1<e&&(2==a[e-1].tok&&10==a[0].tok)&&(g=a[e-1].asInt(),0>=g&&(g=2147483646),e--));switch(e){case 0:case 1:case 4:break;case 2:if(134221850==b){if(7==a[0].tok&&(7==a[1].tok||1073742335==a[1].tok))break;if(10==a[0].tok&&(2==a[1].tok||10==a[1].tok))break}if(null==(c=d.ptValue(a[0],null))||134221850!=b&&8==a[1].tok)return!1;break;case 3:if(134221850!=b)return!1;if(9==a[0].tok){if(8!=a[2].tok&&10!=a[2].tok)return!1;break}for(var h=0;3>h;h++)if(8!=a[h].tok&&10!=a[h].tok)return!1;break;default:return!1}var k=
h=null,j=null;switch(e){case 0:return d.addXPt4(this.vwr.tm.getRotationQ().toPoint4f());default:if(134221850==b&&7==a[0].tok){b=this.e.getQuaternionArray(a[0].getList(),1073742001);a=JU.Quat.sphereMean(b,null,1E-4);h=s(a,JU.Quat)?a:null;break}else if(134221850==b&&10==a[0].tok)k=this.vwr.getAtomGroupQuaternions(a[0].value,g);else if(11==a[0].tok)h=JU.Quat.newM(a[0].value);else if(9==a[0].tok)j=a[0].value;else if(j=JS.SV.sValue(a[0]),j=JU.Escape.uP(j.equalsIgnoreCase("best")?this.vwr.getOrientationText(1073741864,
"best",null).toString():j),!s(j,JU.P4))return!1;134217731==b&&(h=JU.Quat.newVA(JU.P3.new3(j.x,j.y,j.z),j.w));break;case 2:if(134221850==b){if(7==a[0].tok&&7==a[1].tok){b=this.e.getQuaternionArray(a[0].getList(),1073742001);k=this.e.getQuaternionArray(a[1].getList(),1073742001);k=JU.Quat.div(k,b,g,f);break}if(7==a[0].tok&&1073742335==a[1].tok)return b=this.e.getQuaternionArray(a[0].getList(),1073742001),g=v(1,0),JU.Quat.sphereMean(b,g,1E-4),d.addXFloat(g[0]);if(10==a[0].tok&&10==a[1].tok){b=this.vwr.getAtomGroupQuaternions(a[0].value,
2147483647);k=this.vwr.getAtomGroupQuaternions(a[1].value,2147483647);k=JU.Quat.div(k,b,g,f);break}}h=d.ptValue(a[1],null);j=d.planeValue(a[0]);h=null!=h?JU.Quat.getQuaternionFrame(JU.P3.new3(0,0,0),c,h):JU.Quat.newVA(c,JS.SV.fValue(a[1]));break;case 3:if(9==a[0].tok)return g=8==a[2].tok?a[2].value:this.vwr.ms.getAtomSetCenter(a[2].value),d.addXStr(JU.Escape.drawQuat(JU.Quat.newP4(a[0].value),"q",JS.SV.sValue(a[1]),g,1));b=Array(3);for(h=0;3>h;h++)b[h]=8==a[h].tok?a[h].value:this.vwr.ms.getAtomSetCenter(a[h].value);
h=JU.Quat.getQuaternionFrame(b[0],b[1],b[2]);break;case 4:134221850==b?j=JU.P4.new4(JS.SV.fValue(a[1]),JS.SV.fValue(a[2]),JS.SV.fValue(a[3]),JS.SV.fValue(a[0])):h=JU.Quat.newVA(JU.P3.new3(JS.SV.fValue(a[0]),JS.SV.fValue(a[1]),JS.SV.fValue(a[2])),JS.SV.fValue(a[3]))}if(null!=k){if(2147483647!=g){g=new JU.Lst;for(h=0;h<k.length;h++)g.addLast(k[h].toPoint4f());return d.addXList(g)}h=0<k.length?k[0]:null}return d.addXPt4((null==h?JU.Quat.newP4(j):h).toPoint4f())},"JS.ScriptMathProcessor,~A,~N");l(c$,
"evaluateRandom",function(d,a){if(3<a.length)return!1;null==this.rand&&(this.rand=new java.util.Random);var b=0,c=1;switch(a.length){case 3:this.rand.setSeed(A(JS.SV.fValue(a[2])));case 2:c=JS.SV.fValue(a[1]);case 1:b=JS.SV.fValue(a[0]);case 0:break;default:return!1}return d.addXFloat(this.rand.nextFloat()*(c-b)+b)},"JS.ScriptMathProcessor,~A");l(c$,"evaluateRowCol",function(d,a,b){if(1!=a.length)return!1;a=a[0].asInt()-1;var c=d.getX();switch(c.tok){case 11:if(0>a||2<a)break;c=c.value;switch(b){case 1275068935:return b=
v(3,0),c.getRow(a,b),d.addXAF(b);default:return b=v(3,0),c.getColumn(a,b),d.addXAF(b)}case 12:if(0>a||2<a)break;c=c.value;switch(b){case 1275068935:return b=v(4,0),c.getRow(a,b),d.addXAF(b);default:return b=v(4,0),c.getColumn(a,b),d.addXAF(b)}case 7:b=c.getList();for(var c=new JU.Lst,e=0,g=b.size();e<g;e++){var f=b.get(e).getList();if(null==f)return d.addXStr("");c.addLast(a<f.size()?f.get(a):JS.SV.newS(""))}return d.addXList(c)}return!1},"JS.ScriptMathProcessor,~A,~N");l(c$,"evaluateIn",function(d,
a){var b=d.getX();switch(a.length){case 1:var c=a[0].getList();if(null!=c)for(var e=0,g=c.size();e<g;e++)if(JS.SV.areEqual(b,c.get(e)))return d.addXInt(e+1);break;default:for(e=0;e<a.length;e++)if(JS.SV.areEqual(b,a[e]))return d.addXInt(e+1)}return d.addXInt(0)},"JS.ScriptMathProcessor,~A");l(c$,"evaluateReplace",function(d,a){var b=!1,c,e;switch(a.length){case 0:b=!0;c=e=null;break;case 3:b=JS.SV.bValue(a[2]);case 2:c=JS.SV.sValue(a[0]);e=JS.SV.sValue(a[1]);break;default:return!1}var g=d.getX();
if(7==g.tok){for(var g=JS.SV.strListValue(g),f=Array(g.length),h=g.length;0<=--h;)f[h]=null==c?JU.PT.clean(g[h]):b?JU.PT.replaceAllCharacters(g[h],c,e):JU.PT.rep(g[h],c,e);return d.addXAS(f)}g=JS.SV.sValue(g);return d.addXStr(null==c?JU.PT.clean(g):b?JU.PT.replaceAllCharacters(g,c,e):JU.PT.rep(g,c,e))},"JS.ScriptMathProcessor,~A");l(c$,"evaluateScript",function(d,a,b){if((134222350==b||134238732==b)&&1!=a.length||0==a.length)return!1;var c=JS.SV.sValue(a[0]),e=new JU.SB;switch(b){case 134218759:return 2==
a.length?c.equalsIgnoreCase("JSON")&&d.addXObj(this.vwr.parseJSON(JS.SV.sValue(a[1]))):d.addXObj(this.vwr.evaluateExpressionAsVariable(c));case 134222850:a=2==a.length?JS.SV.sValue(a[1]):".";a.equals(".")||e.append(this.vwr.jsEval(a+"\u0001"+c));(a.equals(".")||a.equals("*"))&&this.e.runScriptBuffer(c,e,!0);break;case 134222350:this.e.runScriptBuffer("show "+c,e,!0);break;case 134238732:return d.addX(this.vwr.jsEvalSV(c))}var c=e.toString(),g;return Float.isNaN(g=JU.PT.parseFloatStrict(c))?d.addXStr(c):
0<=c.indexOf(".")?d.addXFloat(g):d.addXInt(JU.PT.parseInt(c))},"JS.ScriptMathProcessor,~A,~N");l(c$,"evaluateSort",function(d,a,b){if(1<a.length)return!1;if(1275068444==b){if(1==a.length&&4==a[0].tok)return d.addX(d.getX().sortMapArray(a[0].asString()));var c=0==a.length?0:a[0].asInt();return d.addX(d.getX().sortOrReverse(c))}b=d.getX();a=0==a.length?null:a[0];if(4==b.tok){var c=0,e=JS.SV.sValue(b);if(null==a)return d.addXInt(0);a=JS.SV.sValue(a);for(b=0;b<e.length;b++){b=e.indexOf(a,b);if(0>b)break;
c++}return d.addXInt(c)}var c=new JU.Lst,g=e=null,f=JS.SV.getVariable(b.value).sortOrReverse(0).getList();if(null==f)return null==a?d.addXStr(""):d.addXInt(0);b=0;for(var h=f.size();b<=h;b++){var k=b==h?null:f.get(b);if(!(null!=a&&null!=k&&!JS.SV.areEqual(k,a)))if(JS.SV.areEqual(k,e))g.intValue++;else{if(null!=e){var j=new JU.Lst;j.addLast(e);j.addLast(g);c.addLast(JS.SV.getVariableList(j))}g=JS.SV.newI(1);e=k}}return null==a?d.addX(JS.SV.getVariableList(c)):c.isEmpty()?d.addXInt(0):d.addX(c.get(0).getList().get(1))},
"JS.ScriptMathProcessor,~A,~N");l(c$,"evaluateString",function(d,a,b){var c=d.getX(),e=0<b.length?JS.SV.sValue(b[0]):1275068932==a?"":"\n";switch(b.length){case 0:break;case 1:if(1073742335==b[0].tok)return d.addX(JS.SV.getVariable(JU.PT.getTokens(c.asString())));break;case 2:if(7==c.tok)break;if(1275069447==a){c=JS.SV.getVariable(JU.PT.split(JU.PT.rep(c.value,"\n\r","\n").$replace("\r","\n"),"\n"));break}default:return!1}if(7==c.tok&&1275068932!=a&&(1275069447!=a||2==b.length))return d.addX(c),this.evaluateList(d,
a,b);b=1275069447==a&&10==c.tok||1275068932==a&&7==c.tok?null:JS.SV.sValue(c);switch(a){case 1275069447:if(10==c.tok){e=c.value;c=this.vwr.ms.mc;b=new JU.Lst;for(a=0;a<c;a++){var g=this.vwr.getModelUndeletedAtomsBitSet(a);g.and(e);b.addLast(JS.SV.getVariable(g))}return d.addXList(b)}return d.addXAS(JU.PT.split(b,e));case 1275069446:return 0<b.length&&"\n"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1)),d.addXStr(JU.PT.rep(b,"\n",e));case 1275068932:if(null!=b)return d.addXStr(JU.PT.trim(b,e));
c=JS.SV.strListValue(c);for(a=c.length;0<=--a;)c[a]=JU.PT.trim(c[a],e);return d.addXAS(c)}return d.addXStr("")},"JS.ScriptMathProcessor,~N,~A");l(c$,"evaluateSubstructure",function(d,a,b,c){if(0==a.length||c&&1<a.length)return!1;var e=new JU.BS,g=JS.SV.sValue(a[0]);if(0<g.length)try{var f=c?d.getX().value:2==a.length&&10==a[1].tok?a[1].value:null,e=this.vwr.getSmilesMatcher().getSubstructureSet(g,this.vwr.ms.at,this.vwr.ms.ac,f,134218757==b?1:2)}catch(h){if(C(h,Exception))this.e.evalError(h.getMessage(),
null);else throw h;}return d.addXBs(e)},"JS.ScriptMathProcessor,~A,~N,~B");l(c$,"evaluateSymop",function(d,a,b){b=b?d.getX():null;if(null!=b&&10!=b.tok)return!1;b=null==b?null:b.value;null==b&&1==this.vwr.ms.mc&&(b=this.vwr.getModelUndeletedAtomsBitSet(0));var c=a.length;if(0==c){if(b.isEmpty())return!1;a=JU.PT.split(JU.PT.trim(this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,null,this.vwr.ms.at[b.nextSetBit(0)].mi).get("symmetryInfo"),"\n"),"\n");b=new JU.Lst;for(var e=0,g=a.length;e<g;e++)b.addLast(JU.PT.split(a[e],
"\t"));return d.addXList(b)}var e=null,g=-2147483648,f=0;switch(a[0].tok){case 4:e=JS.SV.sValue(a[0]);f++;break;case 12:e=a[0].escape();f++;break;case 2:g=a[0].asInt(),f++}null==b&&(f<c&&10==a[f].tok&&(b=new JU.BS).or(a[f].value),f+1<c&&10==a[f+1].tok&&(null==b?b=new JU.BS:b).or(a[f+1].value));var h=null,k=null;null!=(h=c>f?d.ptValue(a[f],b):null)&&f++;null!=(k=c>f?d.ptValue(a[f],b):null)&&f++;var j=null!=k&&a.length>f&&-2147483648==g&&2==a[f].tok?a[f].intValue:0;0<j&&f++;-2147483648==g&&(g=0);c=
c==f?null!=k?"all":null!=h?"point":"matrix":JS.SV.sValue(a[f++]).toLowerCase();return null!=b&&!b.isEmpty()&&f==a.length&&d.addXObj(this.vwr.getSymTemp().getSymmetryInfoAtom(this.vwr.ms,b.nextSetBit(0),e,g,h,k,c,0,0,j))},"JS.ScriptMathProcessor,~A,~B");l(c$,"evaluateTensor",function(d,a){var b=d.getX();if(2<a.length||10!=b.tok)return!1;var b=b.value,c=0==a.length?null:JS.SV.sValue(a[0]).toLowerCase(),e=this.vwr.getNMRCalculation();if("unique".equals(c))return d.addXBs(e.getUniqueTensorSet(b));var g=
2>a.length?null:JS.SV.sValue(a[1]).toLowerCase();return d.addXList(e.getTensorInfo(c,g,b))},"JS.ScriptMathProcessor,~A");l(c$,"evaluateUserFunction",function(d,a,b,c,e){var g=null;if(e)switch(g=d.getX(),g.tok){case 10:break;case 6:if(0<b.length)return!1;g=g.getMap().get(a);return null==g?d.addXStr(""):d.addX(g);default:return!1}a=a.toLowerCase();d.wasX=!1;for(var f=new JU.Lst,h=0;h<b.length;h++)f.addLast(b[h]);if(e)return d.addXObj(this.e.getBitsetProperty(g.value,c,null,null,g.value,x(-1,[a,f]),
!1,g.index,!1));a=this.e.getUserFunctionResult(a,f,null);return null==a?!1:d.addX(a)},"JS.ScriptMathProcessor,~S,~A,~N,~B");l(c$,"evaluateWithin",function(d,a){if(1>a.length||5<a.length)return!1;var b=a.length;if(1==b&&10==a[0].tok)return d.addX(a[0]);var c=0,e=a[0].value,g=""+e,f=a[0].tok;4==f&&(f=JS.T.getTokFromName(g));var h=this.vwr.ms,k=!1,j=!1,l=!1,q=!1,r=null;switch(f){case 1648363544:k=!0,e=null;case 3:case 2:q=!0;if(2>b||3==b&&7==a[1].tok&&7!=a[2].tok)return!1;c=k?100:JS.SV.fValue(a[0]);
switch(f=a[1].tok){case 1073742335:case 1073742334:j=a[1].asBoolean();2<b&&JS.SV.sValue(a[2]).equalsIgnoreCase("unitcell")&&(f=1814695966);b=0;break;case 4:f=JS.SV.sValue(a[1]);if(f.startsWith("$"))return d.addXBs(this.getAtomsNearSurface(c,f.substring(1)));if(f.equalsIgnoreCase("group"))l=!0,f=1086324742;else if(f.equalsIgnoreCase("vanderwaals")||f.equalsIgnoreCase("vdw"))e=null,k=!0,f=1648363544;else if(f.equalsIgnoreCase("unitcell"))f=1814695966;else return!1}break;case 7:1==b&&(e=a[0].asString(),
f=0);break;case 1073742328:return 3==b&&s(a[1].value,JU.BS)&&s(a[2].value,JU.BS)&&d.addXBs(this.vwr.getBranchBitSet(a[2].value.nextSetBit(0),a[1].value.nextSetBit(0),!0));case 134218757:case 1237320707:case 134218756:c=null;e=!0;switch(b){case 2:break;case 3:if(e=10==a[2].tok)c=a[2].value;break;default:e=!1}e||this.e.invArg();return d.addXObj(this.e.getSmilesExt().getSmilesMatches(JS.SV.sValue(a[1]),null,c,null,134218756==f?2:1,d.asBitSet,!1))}if(s(e,String)){if(0==f){f=1073742362;if(2<b)return!1;
b=2}}else if(!q)return!1;switch(b){case 1:switch(f){case 136314895:case 2097184:case 1678381065:return d.addXBs(h.getAtoms(f,null));case 1073741863:return d.addXBs(h.getAtoms(f,""));case 1073742362:return d.addXBs(h.getAtoms(1086324744,g))}return!1;case 2:switch(f){case 1073742362:f=1086324744;break;case 1073741824:case 1086326786:case 1086326785:case 1073741863:case 1086324744:case 1111490587:case 1073742128:case 1073741925:case 1073742189:return d.addXBs(this.vwr.ms.getAtoms(f,JS.SV.sValue(a[a.length-
1])))}break;case 3:switch(f){case 1073742335:case 1073742334:case 1086324742:case 1648363544:case 1814695966:case 134217750:case 134219265:case 1073742329:case 8:case 7:break;case 1086324744:g=JS.SV.sValue(a[2]);break;default:return!1}}var n=null,e=b=null,t=a.length-1;switch(a[t].tok){case 9:n=a[t].value;break;case 8:b=a[t].value;JS.SV.sValue(a[1]).equalsIgnoreCase("hkl")&&(n=this.e.getHklPlane(b));break;case 7:e=2==t&&7==a[1].tok?a[1].getList():null,b=2==t?JS.SV.ptValue(a[1]):1==t?JU.P3.new3(NaN,
0,0):null}if(null!=n)return d.addXBs(h.getAtomsNearPlane(c,n));h=10==a[t].tok?a[t].value:null;if(0<t&&null==b&&null==e&&null==h)return!1;if(1814695966==f)return(null!=h||null!=b)&&d.addXObj(this.vwr.ms.getUnitCellPointsWithin(c,h,b,j));if(null!=b||null!=e){if(7==a[t].tok){k=a[t].getList();f=Array(k.size());for(g=f.length;0<=--g;)f[g]=JS.SV.ptValue(k.get(g));k=null;if(null!=e){k=Array(e.size());for(g=k.length;0<=--g;)k[g]=JS.SV.ptValue(e.get(g))}e=Array(1);switch(J.bspt.PointIterator.withinDistPoints(c,
b,f,k,e)){case 134217751:return d.addXPt(e[0]);case 1073742001:return d.addXList(e[0]);case 1275068418:return d.addXAI(e[0]);case 4:return d.addXStr(e[0]);default:return!1}}return d.addXBs(this.vwr.getAtomsNearPt(c,b))}if(1086324744==f)return d.addXBs(this.vwr.ms.getSequenceBits(g,h,new JU.BS));null==h&&(h=new JU.BS);if(!q)return d.addXBs(this.vwr.ms.getAtoms(f,h));if(l)return d.addXBs(this.vwr.getGroupsWithin(A(c),h));k&&(r=new J.atomdata.RadiusData(null,10<c?c/100:c,10<c?J.atomdata.RadiusData.EnumType.FACTOR:
J.atomdata.RadiusData.EnumType.OFFSET,J.c.VDW.AUTO),0>c&&(c=0));return d.addXBs(this.vwr.ms.getAtomsWithinRadius(c,h,j,r))},"JS.ScriptMathProcessor,~A");l(c$,"evaluateWrite",function(d,a){switch(a.length){case 0:return!1;case 1:if(!a[0].asString().toUpperCase().equals("PNGJ"))break;return d.addXMap(this.vwr.fm.getFileAsMap(null))}return d.addXStr(this.e.getCmdExt().dispatch(134221856,!0,a))},"JS.ScriptMathProcessor,~A");l(c$,"getAtomsNearSurface",function(d,a){var b=x(-1,[a,null,null]);if(this.e.getShapePropertyData(24,
"getVertices",b))return this.getAtomsNearPts(d,b[1],b[2]);b[1]=Integer.$valueOf(0);b[2]=Integer.$valueOf(-1);if(this.e.getShapePropertyData(22,"getCenter",b))return this.vwr.getAtomsNearPt(d,b[2]);b[1]=Float.$valueOf(d);return this.e.getShapePropertyData(21,"getAtomsWithin",b)?b[2]:new JU.BS},"~N,~S");l(c$,"getAtomsNearPts",function(d,a,b){var c=new JU.BS;if(0==a.length||null!=b&&b.isEmpty())return c;null==b&&(b=JU.BSUtil.setAll(a.length));for(var e=this.vwr.ms.at,g=this.vwr.ms.ac;0<=--g;)for(var f=
e[g],h=b.nextSetBit(0);0<=h;h=b.nextSetBit(h+1))if(f.distance(a[h])<d){c.set(g);break}return c},"~N,~A,JU.BS");l(c$,"getMinMax",function(d,a){for(var b=null,c=null,e=0,g=null;;){if(JU.AU.isAF(d)){if(1140850707==a)break;b=d;e=b.length;if(0==e)break}else if(s(d,JU.Lst))if(c=d,e=c.size(),0==e){if(1140850707!=a)break}else{var f=c.get(0);if(8==f.tok)return this.getMinMaxPoint(c,a);if(4==f.tok&&f.value.startsWith("{")){b=JS.SV.ptValue(f);if(s(b,JU.P3))return this.getMinMaxPoint(c,a);if(s(b,JU.P4))return this.getMinMaxQuaternion(c,
a);break}}else break;var h,k=!1;switch(a){case 1140850707:g=new java.util.Hashtable;f=h=0;break;case 32:k=!0;f=3.4028235E38;h=2147483647;break;case 64:f=-3.4028235E38;h=-2147483647;break;default:f=h=0}for(var j=0,l=0,q=!0,r=1140850707==a;0<=--e;){var n=null==c?JS.SV.vF:c.get(e),t=r?1:null==b?JS.SV.fValue(n):b[e];if(!Float.isNaN(t))switch(l++,a){case 160:case 192:j+=t*t;case 128:case 96:f+=t;break;case 1140850707:q=(new Boolean(q&2==n.tok)).valueOf();n=n.asString();t=g.get(n);g.put(n,null==t?new Integer(1):
new Integer(t.intValue()+1));break;case 32:case 64:q=(new Boolean(q&2==n.tok)).valueOf(),k==t<f&&(f=t,q&&(h=n.intValue))}}if(1140850707==a)return g;if(0==l)break;switch(a){case 96:f/=l;break;case 192:if(1==l)break;f=Math.sqrt((j-f*f/l)/(l-1));break;case 32:case 64:if(q)return Integer.$valueOf(h);break;case 160:f=j}return Float.$valueOf(f)}return"NaN"},"~O,~N");l(c$,"getMinMaxPoint",function(d,a){var b=null,c=null,e=0;s(d,Array)?(b=d,e=b.length):s(d,JU.Lst)&&(c=d,e=c.size());if(null==c&&null==b)return"NaN";
for(var g=new JU.P3,f=v(e,0),h=0;3>h;h++){for(var k=0;k<e;k++){var j=null==b?JS.SV.ptValue(c.get(k)):b[k];if(null==j)return"NaN";switch(h){case 0:f[k]=j.x;break;case 1:f[k]=j.y;break;case 2:f[k]=j.z}}k=this.getMinMax(f,a);if(!s(k,Number))return"NaN";k=k.floatValue();switch(h){case 0:g.x=k;break;case 1:g.y=k;break;case 2:g.z=k}}return g},"~O,~N");l(c$,"getMinMaxQuaternion",function(d,a){var b;switch(a){case 32:case 64:case 128:case 160:return"NaN"}for(;;){b=this.e.getQuaternionArray(d,1073742001);
if(null==b)break;var c=v(1,0);b=JU.Quat.sphereMean(b,c,1E-4);switch(a){case 96:return b;case 192:return Float.$valueOf(c[0])}break}return"NaN"},"JU.Lst,~N");l(c$,"getPatternMatcher",function(){return null==this.pm?this.pm=J.api.Interface.getUtil("PatternMatcher",this.e.vwr,"script"):this.pm});l(c$,"opTokenFor",function(d){switch(d){case 1275069441:case 1275069446:return JS.T.tokenPlus;case 1275068931:return JS.T.tokenMinus;case 1275068929:return JS.T.tokenTimes;case 1275068930:return JS.T.tokenMul3;
case 1275068928:return JS.T.tokenDivide}return null},"~N");l(c$,"setContactBitSets",function(d,a,b,c,e,g){var f,h;null==a?(a=JU.BSUtil.setAll(this.vwr.ms.ac),JU.BSUtil.andNot(a,this.vwr.slm.bsDeleted),a.andNot(d),f=!1):(h=JU.BSUtil.copy(d),h.or(a),h=this.vwr.ms.getModelBS(h,!1).cardinality(),f=1<h,g&&(1<h&&!this.e.tQuiet)&&this.e.showString(J.i18n.GT._("Note: More than one model is involved in this contact!")));if(!d.equals(a)){if(g=!b||d.cardinality()<a.cardinality())h=this.vwr.ms.getAtomsWithinRadius(c,
d,f,Float.isNaN(c)?e:null),a.and(h);b&&(h=this.vwr.ms.getAtomsWithinRadius(c,a,f,Float.isNaN(c)?e:null),d.and(h),g||(h=this.vwr.ms.getAtomsWithinRadius(c,d,f,Float.isNaN(c)?e:null),a.and(h)),h=JU.BSUtil.copy(a),h.and(d),h.equals(d)?a.andNot(d):h.equals(a)&&d.andNot(a))}return a},"JU.BS,JU.BS,~B,~N,J.atomdata.RadiusData,~B")})})(Clazz,Clazz.getClassName,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,
Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,
Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAB,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
