(function(la,ma,na,oa,U,pa,V,A,W,Z,$,aa,qa,ka,ra,L,M,C,ja,sa,ta,ua,va,wa,xa,ya,za,H,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La,Ma,Na,Oa,Pa,Qa,Ra,Sa,Ta,Ua,Va,Wa,Xa,Ya,Za,$a,t){V("JS");W(null,"JS.MathExt","java.util.Date $.Hashtable $.Random JU.AU $.BArray $.BS $.CU $.Lst $.M3 $.M4 $.Measure $.OC $.P3 $.P4 $.PT $.Quat $.Rdr $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.bspt.PointIterator J.c.VDW J.i18n.GT JM.BondSet $.Measurement JS.SV $.T JU.BSUtil $.BoxInfo $.Edge $.Escape $.JmolMolecule $.Logger $.Parser $.Point3fi $.SimpleUnitCell JV.FileManager $.JC $.Viewer".split(" "),
function(){var p=$(function(){this.pm=this.rand=this.e=this.vwr=null;Z(this,arguments)},JS,"MathExt",null);t(p,"init",function(d){this.e=d;this.vwr=this.e.vwr;return this},"~O");t(p,"evaluate",function(d,a,b,c){switch(c){case 134218760:return 1<=b.length&&4==b[0].tok?d.addXStr((1==b.length?(new java.util.Date).toString():this.vwr.apiPlatform.getDateFormat(JS.SV.sValue(b[1])))+"\t"+JS.SV.sValue(b[0]).trim()):d.addXInt(System.currentTimeMillis()-JS.MathExt.t0-(0==b.length?0:b[0].asInt()));case 134218250:return 1==
b.length&&2==b[0].tok?d.addXInt(b[0].intValue):d.addXFloat(Math.abs(b[0].asFloat()));case 134218241:case 134218245:case 134218244:case 134218246:return 1==b.length&&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 268437504:0==b.length&&(d.wasX=!1);case 1275068418:return this.evaluateArray(d,b,1275068418==c&&268442113==a.tok);case 134217765:return this.evaluateCallbackParam(d,
b);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 1228931586:case 134217736:case 1275203608:return this.evaluateConnected(d,b,c,a.intValue);case 1812599299:case 1814695966:return this.evaluateUnitCell(d,b,268442113==a.tok,268442113==
a.tok?a.intValue: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(268442113==a.tok)return this.evaluateDotDist(d,b,c,a.intValue);case 134217729:case 1745489939:return this.evaluateMeasure(d,b,a.tok);case 1228935687:case 134223363:return this.evaluateLoad(d,b,1228935687==c);case 1275068427:return this.evaluateFind(d,b);case 1275068433:return this.evaluateInChI(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,268442113==a.tok);case 1275068437:c=1275068725;case 1275068446:case 1275068725:case 1275082241:case 1275072526:return this.evaluateGetProperty(d,b,c,268442113==a.tok);case 136314895:return this.evaluateHelix(d,b);case 134219777:case 134217750:case 134217763: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 1275068447:return this.evaluatePointGroup(d,b,268442113==a.tok);case 134256129:return this.evaluatePrompt(d,b);case 134219266: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 134218753:case 134218756:case 134218757:case 1237320707:return this.evaluateSubstructure(d,
b,c,268442113==a.tok);case 1275068444:case 1275068425:return this.evaluateSort(d,b,c);case 134217764:return this.evaluateSpacegroup(d,b);case 1296041985:return this.evaluateSymop(d,b,268442113==a.tok);case 1275068445:return this.evaluateTensor(d,b);case 134217759:return this.evaluateWithin(d,b,268442113==a.tok);case 134221856:return this.evaluateWrite(d,b)}return!1},"JS.ScriptMathProcessor,JS.T,~A,~N");t(p,"evaluateCallbackParam",function(d,a){return d.addX(this.e.getCallbackParameter(0==a.length?
-2147483648:a[0].asInt()))},"JS.ScriptMathProcessor,~A");t(p,"evaluateSpacegroup",function(d,a){var b=null;switch(a.length){case 0:return d.addXObj(this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,null,this.vwr.am.cmi,!0,null));case 2:b=JS.SV.flistValue(a[1],0);if(null==b||6!=b.length)return!1;b=JU.SimpleUnitCell.newParams(b,NaN);case 1:if(4==a[0].tok){var c=a[0].asString();return c.toUpperCase().startsWith("ITA/")?d.addXObj(this.vwr.getSymTemp().getSpaceGroupJSON(this.vwr,"ITA",c.substring(4),
0)):c.toUpperCase().startsWith("AFLOW/")?d.addXObj(this.vwr.getSymTemp().getSpaceGroupJSON(this.vwr,"AFLOW",c.substring(6),0)):0>c.indexOf("x")&&null==b?d.addXObj(this.vwr.getSymTemp().getSpaceGroupInfoObj(c,null,!0,!1)):d.addXObj(this.vwr.findSpaceGroup(null,c,b,null,!0,!1,!1))}c=JS.SV.getBitSet(a[0],!0);return null==c?d.addXObj(this.vwr.getSymTemp().getSpaceGroupInfoObj(""+a[0].asString(),b,!0,!1)):d.addXObj(this.vwr.findSpaceGroup(c,null,b,null,!0,!1,!1));default:return!1}},"JS.ScriptMathProcessor,~A");
t(p,"evaluatePointGroup",function(d,a,b){var c=null,e=null,f=-1,j=-1,g=null,h=!1;switch(a.length){case 4:j=a[3].asFloat();case 3:f=a[2].asFloat();case 2:switch(a[1].tok){case 8:e=JS.SV.ptValue(a[1]);break;case 10:g=JS.SV.getBitSet(a[1],!1),a[0].asString().equalsIgnoreCase("spaceGroup")&&(h=!0,2==a.length&&(f=0))}if(h)break;case 1:switch(a[0].tok){case 7:b=a[0].getList();c=Array(b.size());for(a=c.length;0<=--a;)c[a]=JS.SV.ptValue(b.get(a));break;case 10:g=JS.SV.getBitSet(a[0],!1);c=this.vwr.ms.at;
break;case 4:if(b){g=JS.SV.getBitSet(d.getX(),!0);if(null==g||g.isEmpty())return!1;h=a[0].asString();if("spacegroup".equals(h)){h=!0;break}}default:return!1}break;case 0:if(!b)return d.addXObj(this.vwr.ms.getPointGroupInfo(null));g=JS.SV.getBitSet(d.getX(),!1);break;default:return!1}if(null!=g){a=g.nextSetBit(0);if(0>a||a>=this.vwr.ms.ac||h&&1!=g.cardinality())return!1;if(h){e=this.vwr.ms.generateCrystalClass(a,JU.P3.new3(NaN,NaN,NaN));c=Array(e.size());for(a=c.length;0<=--a;)c[a]=e.get(a);e=new JU.P3}}c=
this.vwr.getSymTemp().setPointGroup(null,e,null==c?this.vwr.ms.at:c,g,!1,0>f?this.vwr.getFloat(570425382):f,0>j?this.vwr.getFloat(570425384):j,null==g?c.length:g.cardinality(),!0);return d.addXMap(c.getPointGroupInfo(-1,null,!0,null,0,1))},"JS.ScriptMathProcessor,~A,~B");t(p,"evaluateUnitCell",function(d,a,b,c){var e=b?JS.SV.getBitSet(d.getX(),!0):1812599299==c?this.vwr.getAllAtoms():null,f=(null==e?this.vwr.getAllAtoms():e).nextSetBit(0),j=a.length-1;b=1;switch(0>j?0:a[j].tok){case 2:case 3:b=a[j].asFloat(),
j--}var g=0>j?0:a[0].tok,h=null,k=null,l=null;switch(g){case 7:k=a[0].getList();break;case 4:if(l=a[0].asString(),1814695966==c)if(0==l.indexOf("a=")){for(var h=Array(4),s=0;4>s;s++)h[s]=new JU.P3;JU.SimpleUnitCell.setAbc(l,null,h)}else if(0<=l.indexOf(","))return d.addXObj(this.vwr.getV0abc(-1,l))}if(1812599299==c)return b=this.vwr.ms.getBoxInfo(e,1),d.addXObj(b.getInfo(l));c=null;s=null!=k;if(null==h&&s&&4>k.size())return!1;l=s?1:0;null==h&&(!s&&8!=g)&&(c=0>f?this.vwr.getCurrentUnitCell():this.vwr.ms.getUnitCell(this.vwr.ms.at[f].mi),
h=null==c?H(-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)]):c.getUnitCellVectors());if(null==h)if(h=Array(4),s)switch(k.size()){case 3:h[0]=new JU.P3;for(s=0;3>s;s++)h[s+1]=JU.P3.newP(JS.SV.ptValue(k.get(s)));break;case 4:for(s=0;4>s;s++)h[s]=JU.P3.newP(JS.SV.ptValue(k.get(s)));break;case 6:g=C(6,0);for(s=0;6>s;s++)g[s]=k.get(s).asFloat();JU.SimpleUnitCell.setAbc(null,g,h);break;default:return!1}else switch(h[0]=JS.SV.ptValue(a[0]),j){case 3:for(s=1;4>s;s++)(h[s]=JU.P3.newP(JS.SV.ptValue(a[s]))).sub(h[0]);
break;case 1:if(k=a[1].getList(),null!=k&&3==k.size()){for(s=0;3>s;s++)h[s+1]=JS.SV.ptValue(k.get(s));break}default:return!1}s=l<=j?a[l].asString():null;if((k="primitive".equalsIgnoreCase(s))||"conventional".equalsIgnoreCase(s)){a=++l>j?"":a[l].asString().toUpperCase();a.equals("BCC")?a="I":0==a.length&&(a=this.vwr.getSymmetryInfo(f,null,0,null,null,null,1073741994,null,0,-1,0,null));if(null==a||0==a.length)return!1;null==c&&(c=this.vwr.getSymTemp());f=this.vwr.getModelForAtomIndex(f).auxiliaryInfo.get("primitiveToCrystal");
if(!c.toFromPrimitive(k,a.charAt(0),h,f))return!1}else if("reciprocal".equalsIgnoreCase(s))h=JU.SimpleUnitCell.getReciprocal(h,null,b),b=1;else if("vertices".equalsIgnoreCase(s))return d.addXObj(JU.BoxInfo.getVerticesFromOABC(h));if(1!=b)for(s=1;4>s;s++)h[s].scale(b);return d.addXObj(h)},"JS.ScriptMathProcessor,~A,~B,~N");t(p,"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(),f=b.getMap(),j=b.getKeys(!1);b=0;for(a=j.length;b<a;b++)if(null==
f.get(j[b]).getMap())return!1;b=0;for(a=j.length;b<a;b++){var g=f.get(j[b]),g=g.getMap(),g=JS.SV.deepCopy(g,!0,!1);g.put(e,JS.SV.newS(j[b]));c.addLast(JS.SV.newV(6,g))}return d.addXList(c);case 7:c=new java.util.Hashtable;e=b.getList();f=a[0].asString();b=0;for(a=e.size();b<a;b++)if(g=e.get(b).getMap(),null==g||null==g.get(f))return!1;b=0;for(a=e.size();b<a;b++)g=e.get(b),g=JS.SV.deepCopy(g.getMap(),!0,!1),j=g.remove(f),c.put(j.asString(),JS.SV.newV(6,g));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");t(p,"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 f=JS.SV.fValue(a[0]),j=JS.SV.fValue(a[1]),g=JS.SV.fValue(a[2]),h=4<=b&&1073742335==a[b-1].tok,b=(5==b||4==b&&!h)&&1073742334!=a[3].tok?JS.SV.sValue(a[3]):null,k=null;if(e)c=c.value;else{e=c.getList();c=C(e.size(),0);null!=b&&(k=JU.AU.createArrayOfHashtable(e.size()));try{for(var l=
e.size();0<=--l;)c[l]=JS.SV.fValue(null==b?e.get(l):(k[l]=e.get(l).getMap()).get(b))}catch(s){if(L(s,Exception))return!1;throw s;}}for(var j=Math.max(U(Math.floor((j-f)/g+0.01)),1),e=M(j,0),m=c.length,l=0;l<m;l++){var r=U(Math.floor((c[l]-f)/g));if(!(0>r||r>=j))if(e[r]++,null!=b){var n=k[l];if(null!=n){n.put("_bin",JS.SV.newI(r));var q=f+g*r,p=q+g;n.put("_binMin",JS.SV.newF(0==r?-3.4028235E38:q));n.put("_binMax",JS.SV.newF(r==j-1?3.4028235E38:p))}}}if(h){h=new JU.Lst;for(l=0;l<j;l++)h.addLast(C(-1,
[f+g*l,e[l]]));return d.addXList(h)}return d.addXAI(e)},"JS.ScriptMathProcessor,~A");t(p,"evaluateCache",function(d,a){return 0<a.length?!1:d.addXMap(this.vwr.fm.cacheList())},"JS.ScriptMathProcessor,~A");t(p,"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())),f=JU.P3.newP(8==a[1].tok?JS.SV.ptValue(a[1]):JU.CU.colorPtFromString(a[1].asString())),j=1073742335==a[3].tok;j&&(e=JU.CU.rgbToHSL(e,!1),f=JU.CU.rgbToHSL(f,!1));var g=new JU.SB,f=JU.V3.newVsub(f,e),h=a[2].asInt();2>
h&&(h=20);f.scale(1/(h-1));for(b=0;b<h;b++)g.append(JU.Escape.escapeColor(JU.CU.colorPtToFFRGB(j?JU.CU.hslToRGB(e):e))),e.add(f);return d.addXStr(g.toString())}h=c?null:this.vwr.cm.getColorEncoder(b);if(!c&&null==h)return d.addXStr("");e=1<a.length?JS.SV.fValue(a[1]):3.4028235E38;f=2<a.length?JS.SV.fValue(a[2]):3.4028235E38;j=3<a.length?JS.SV.fValue(a[3]):3.4028235E38;g=3.4028235E38!=j||3.4028235E38!=e&&3.4028235E38==f;3.4028235E38==f&&0==b.length&&(j=e,f=this.vwr.getCurrentColorRange(),e=f[0],f=
f[1]);if(c){h=b.substring(1);h=H(-1,[h,null]);if(!this.vwr.shm.getShapePropertyData(24,"colorEncoder",h))return d.addXStr("");h=h[1]}else h.setRange(e,f,e>f);b=h.getColorKey();return g?d.addXPt(JU.CU.colorPtFromInt(h.getArgb(3.4028235E38==f?e:j),null)):d.addX(JS.SV.getVariableMap(b))},"JS.ScriptMathProcessor,~A");t(p,"evaluateCompare",function(d,a){var b=a.length;if(2>b||5<b)return!1;var c,e=1073742335==a[b-1].tok;(e||1073742334==a[b-1].tok)&&b--;var f=JS.SV.sValue(a[b-1]),j=f.equalsIgnoreCase("stddev"),
g=f.equalsIgnoreCase("ISOMER"),h=g&&e,k=f.equalsIgnoreCase("BONDS"),e=7==a[0].tok&&7==a[1].tok,l=3<=b?a[2].getList():null,s=null==l&&!e&&!g&&b>(j?3:2),e=10==a[0].tok?a[0].value:null,m=10==a[1].tok?a[1].value:null,r=null==e?JS.SV.sValue(a[0]):"",n=null==m?JS.SV.sValue(a[1]):"";c=NaN;try{if(k){if(4!=b)return!1;r=JS.SV.sValue(a[2]);s=r.equalsIgnoreCase("SMILES");try{s&&(r=this.vwr.getSmiles(e))}catch(q){if(L(q,Exception))this.e.evalError(q.getMessage(),null);else throw q;}var p=this.e.getSmilesExt().getFlexFitList(e,
m,r,!s);return null==p?d.addXStr(""):d.addXAF(p)}if(g){if(3!=b)return!1;if(null==e&&null==m){var u=this.vwr.getSmilesMatcher().getRelationship(r,n).toUpperCase();return d.addXStr(u)}var t=null==e?this.vwr.getSmilesMatcher().getMolecularFormula(r,!1,!1):JU.JmolMolecule.getMolecularFormulaAtoms(this.vwr.ms.at,e,null,!1),A=null==m?this.vwr.getSmilesMatcher().getMolecularFormula(n,!1,!1):JU.JmolMolecule.getMolecularFormulaAtoms(this.vwr.ms.at,m,null,!1);if(!t.equals(A))return d.addXStr("NONE");null!=
e&&(r=this.e.getSmilesExt().getSmilesMatches("/strict///",null,e,null,1,!0,!1));var z;null==m?z=0<this.vwr.getSmilesMatcher().areEqual(n,r):(n=this.e.getSmilesExt().getSmilesMatches("/strict///",null,m,null,1,!0,!1),z=0<=this.e.getSmilesExt().getSmilesMatches("/strict///"+r,null,m,null,1,!0,!1).nextSetBit(0));if(!z){var B=r+n;if(0<=B.indexOf("/")||0<=B.indexOf("\\")||0<=B.indexOf("@")){if(0<=r.indexOf("@")&&(null!=m||0<=n.indexOf("@"))&&0>r.indexOf("@SP")){var D=r.toLowerCase().indexOf("invertstereo"),
r=0<=D?"/strict/"+r.substring(0,D)+r.substring(D+12):"/invertstereo strict/"+r;if(z=null==m?0<this.vwr.getSmilesMatcher().areEqual(r,n):0<=this.e.getSmilesExt().getSmilesMatches(r,null,m,null,1,!0,!1).nextSetBit(0))return d.addXStr("ENANTIOMERS")}null==m?z=0<this.vwr.getSmilesMatcher().areEqual("/nostereo/"+n,r):(u=this.e.getSmilesExt().getSmilesMatches("/nostereo/"+r,null,m,null,1,!0,!1),z=0<=u.nextSetBit(0));if(z)return d.addXStr("DIASTEREOMERS")}u="CONSTITUTIONAL ISOMERS";if(h){var w=this.vwr.getInchi(e,
null,null);null!=w&&w.equals(this.vwr.getInchi(m,null,null))&&(u="TAUTOMERS")}return d.addXStr(u)}if(null==e||null==m)return d.addXStr("IDENTICAL");c=this.e.getSmilesExt().getSmilesCorrelation(e,m,r,null,null,null,null,!1,null,null,!1,1);return d.addXStr(0.2>c?"IDENTICAL":"IDENTICAL or CONFORMATIONAL ISOMERS (RMSD="+c+")")}var P=new JU.M4,w=z=null;if(s){if(null==e||null==m)return!1;var f=JS.SV.sValue(a[2]),C=f.equalsIgnoreCase("MAP"),s=f.equalsIgnoreCase("SMILES"),v=C||f.equalsIgnoreCase("SMARTS");
if(s||v)f=b>(j?4:3)?JS.SV.sValue(a[3]):null;var y="H".equalsIgnoreCase(f)||"allH".equalsIgnoreCase(f)||"bestH".equalsIgnoreCase(f),H=!y&&("polyhedra".equalsIgnoreCase(f)||"polyhedron".equalsIgnoreCase(f));if(H)c=this.e.getSmilesExt().mapPolyhedra(e.nextSetBit(0),m.nextSetBit(0),s,P);else{z=new JU.Lst;var w=new JU.Lst,B="all".equalsIgnoreCase(f)||"allH".equalsIgnoreCase(f),E="best".equalsIgnoreCase(f)||"bestH".equalsIgnoreCase(f);"stddev".equals(f)&&(f=null);var F=f;if(null==f||y||B||E){if(!C&&!s||
y&&H)return!1;F="/noaromatic"+(B||E?"/":" nostereo/")+this.e.getSmilesExt().getSmilesMatches(y?"H":"",null,e,null,32769,!0,!1)}else B=!0;c=this.e.getSmilesExt().getSmilesCorrelation(e,m,F,z,w,P,null,C,null,null,E,(s?1:2)|(!B&&!E?8:0));if(C){var G=z.size();if(0==G)return d.addXStr("");for(var da=U(w.size()/G),u=new JU.Lst,D=F=0;F<da;F++){var x=JU.AU.newInt2(G);u.addLast(x);for(f=0;f<G;f++,D++)x[f]=M(-1,[z.get(f).i,w.get(D).i])}return B?d.addXList(u):0<u.size()?d.addXAII(u.get(0)):d.addXStr("")}}}else{z=
this.e.getPointVector(a[0],0);w=this.e.getPointVector(a[1],0);if(null==z||null==w)return!1;if(null!=l){b--;var Q=l.size();if(Q>z.size()||Q!=w.size())return!1;for(var X=new JU.Lst,F=0;F<Q;F++)X.addLast(z.get(l.get(F).intValue-1));z=X}switch(b){case 2:break;case 3:if(j)break;default:return!1}z.size()==w.size()&&(J.api.Interface.getInterface("JU.Eigen",this.vwr,"script"),c=JU.Measure.getTransformMatrix4(z,w,P,null))}return j||Float.isNaN(c)?d.addXFloat(c):d.addXM4(P.round(1E-7))}catch(N){if(L(N,Exception))return this.e.evalError(null==
N.getMessage()?N.toString():N.getMessage(),null),!1;throw N;}},"JS.ScriptMathProcessor,~A");t(p,"evaluateConnected",function(d,a,b,c){if(5<a.length)return!1;var e=-2147483648,f=2147483647,j=0,g=3.4028235E38,h=65535,k=null,l=null,s=!1,m=!1;switch(b){case 1275203608:l=-2147483648;j=null;if(0<a.length)switch(a[0].tok){case 2:l=a[0].intValue;break;case 4:j=JS.SV.sValue(a[0])}1275203608==c&&(k=JS.SV.getBitSet(d.getX(),!0));k=H(-1,[Integer.$valueOf(l),j,k]);this.vwr.shm.getShapePropertyData(21,"getCenters",
k)||(k[1]=null);return d.addXBs(null==k[1]?new JU.BS:k[1]);case 1228931586:k=d.getX();if(10!=k.tok||1!=a.length||10!=a[0].tok)return!1;k=k.value;l=a[0].value;a=new JU.Lst;j=this.vwr.ms.at;for(c=k.nextSetBit(0);0<=c;c=k.nextSetBit(c+1)){b=0;g=j[c].bonds;for(m=g.length;0<=--m;)l.get(g[m].getOtherAtom(j[c]).i)&&b++;a.addLast(Integer.$valueOf(b))}return d.addXList(a)}for(c=0;c<a.length;c++){var r=a[c];switch(r.tok){case 10:if((m=A(r.value,"JM.BondSet"))&&null!=k)return!1;if(null==k)k=r.value;else if(null==
l)l=r.value;else return!1;break;case 4:b=JS.SV.sValue(r);h=b.equalsIgnoreCase("hbond")?30720:JU.Edge.getBondOrderFromString(b);if(131071==h)return!1;break;case 3:s=!0;default:b=r.asInt();r=r.asFloat();if(2147483647!=f)return!1;-2147483648==e?(e=Math.max(b,0),j=r):(f=b,g=r)}}-2147483648==e?(e=1,f=100,j=0.1,g=1E8):2147483647==f&&(f=e,g=j,j=0.1);null==k&&(k=this.vwr.getAllAtoms());s&&null==l&&(l=k);return null!=l?(a=new JU.BS,this.vwr.makeConnections(j,g,h,1086324745,k,l,a,m,!1,0),d.addX(JS.SV.newV(10,
JM.BondSet.newBS(a)))):d.addXBs(this.vwr.ms.getAtomsConnected(e,f,h,k))},"JS.ScriptMathProcessor,~A,~N,~N");t(p,"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||!A(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");t(p,"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(b.endsWith("*"))return d.addXList(this.vwr.getDataObj(b,null,0));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||2>b.length?"":""+b[1])},"JS.ScriptMathProcessor,~A");t(p,"evaluateDotDist",function(d,a,b,c){var e=1275069443==b,f,j,g=null;switch(a.length){case 2:if(2147483647==c){f=a[0];j=a[1];break}g=a[1];case 1:f=d.getX();j=a[0];break;case 0:if(e){f=d.getX();j=JS.SV.getVariable(new JU.P3);break}default:return!1}a=NaN;try{if(1275069442==b){var h=JU.P3.newP(d.ptValue(f,null));h.cross(h,d.ptValue(j,null));return d.addXPt(h)}var k=
7==j.tok?null:d.ptValue(j,null),l=this.e.planeValue(j);if(e){b=-2147483648==c?0:c&480;var h=32==b||64==b,s=480==b;switch(f.tok){case 7:case 10:var m=10==f.tok,r=10==j.tok,n=8==j.tok,q=m?f.value:null,p=r?j.value:null,u=m?null:f.getList(),t=r?null:j.getList(),A=h&&null!=g&&g.asBoolean();switch(j.tok){case 10:case 7:case 8:var z=this.vwr.ms.at;if(A){var B=NaN,D=2147483647;if(m){for(var w=q.nextSetBit(0);0<=w;w=q.nextSetBit(w+1)){var P=n?z[w].distanceSquared(k):this.e.getBitsetProperty(p,t,c,z[w],l,f.value,
null,!1,f.index,!1).floatValue();if(!(32==b?P>=B:P<=B))B=P,D=w}return d.addXBs(2147483647==D?new JU.BS:JU.BSUtil.newAndSetBit(D))}for(w=u.size();0<=--w;){var H=JS.SV.ptValue(u.get(w)),P=n?H.distanceSquared(k):this.e.getBitsetProperty(p,t,c,H,l,f.value,null,!1,2147483647,!1).floatValue();if(!(32==b?P>=B:P<=B))B=P,D=w}return d.addXInt(D)}if(s){if(null==p){for(var v=C(q.cardinality(),0),B=0,w=q.nextSetBit(0);0<=w;w=q.nextSetBit(w+1),B++)v[B]=z[w].distance(k);return d.addXAF(v)}D=C(q.cardinality(),p.cardinality(),
0);B=0;for(w=q.nextSetBit(0);0<=w;w=q.nextSetBit(w+1),B++){c=0;for(var y=p.nextSetBit(0);0<=y;y=p.nextSetBit(y+1),c++)D[B][c]=z[w].distance(z[y])}return d.addXAFF(D)}if(h){v=C(m?q.cardinality():u.size(),0);if(m){w=q.nextSetBit(0);for(B=0;0<=w;w=q.nextSetBit(w+1))v[B++]=this.e.getBitsetProperty(p,t,c,z[w],l,f.value,null,!1,f.index,!1).floatValue();return d.addXAF(v)}for(w=v.length;0<=--w;)v[w]=this.e.getBitsetProperty(p,t,c,JS.SV.ptValue(u.get(w)),l,null,null,!1,2147483647,!1).floatValue();return d.addXAF(v)}return d.addXObj(this.e.getBitsetProperty(q,
u,c,k,l,f.value,null,!1,f.index,!1))}}}var M=d.ptValue(f,null),E=this.e.planeValue(f);e?a=null!=l&&null!=g?JU.Measure.directedDistanceToPlane(M,l,JS.SV.ptValue(g)):null==E?null==l?k.distance(M):JU.Measure.distanceToPlane(l,M):JU.Measure.distanceToPlane(E,k):null!=E&&null!=l?a=E.x*l.x+E.y*l.y+E.z*l.z+E.w*l.w:(null!=E?M=JU.P3.new3(E.x,E.y,E.z):null!=l&&(k=JU.P3.new3(l.x,l.y,l.z)),a=M.dot(k))}catch(F){if(!L(F,Exception))throw F;}return d.addXFloat(a)},"JS.ScriptMathProcessor,~A,~N,~N");t(p,"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),f=d.ptValue(a[1],null);if(0==b||9!=a[2].tok||null==e||null==f)return!1;var j=JU.Quat.newP4(a[2].value),j=JU.Measure.computeHelicalAxis(e,f,j);return null==j?!1:d.addXObj(JU.Escape.escapeHelical(c,b,e,f,j))}c=A(a[0].value,"JU.BS")?a[0].value:this.vwr.ms.getAtoms(1094715412,Integer.$valueOf(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:j=this.getHelixData(c,1073742001);if(null==j)break;return d.addXAS(j)}return!1},"JS.ScriptMathProcessor,~A");t(p,"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(553648142))},"JU.BS,~N");t(p,"evaluateInChI",function(d,a){var b=d.getX(),
c=0<a.length?JS.SV.sValue(a[0]):"fixedh?";c.toLowerCase().equals("standard")&&(c="");var e=JS.SV.getBitSet(b,!0),b=null==e?JS.SV.sValue(b):null;return d.addXStr(this.vwr.getInchi(e,b,c))},"JS.ScriptMathProcessor,~A");t(p,"evaluateFind",function(d,a){var b=d.getX(),c=7==b.tok,e=10==b.tok,f=0==a.length,j=0==a.length?0:a[0].tok,g=f||4!=j?"":JS.SV.sValue(a[0]),h=1<a.length&&1073742334==a[1].tok,k=0==j?0:a[a.length-1].tok,l=0==k?JS.SV.vF:a[a.length-1],s=!c&&1073742335==k,m=1<a.length&&1073742335!=a[1].tok&&
1073742334!=a[1].tok&&10!=a[1].tok?JS.SV.sValue(a[1]):"",k=!c&&!h&&g.equalsIgnoreCase("SEQUENCE"),r=!c&&!h&&g.equalsIgnoreCase("SEQ");if(g.toUpperCase().startsWith("SMILES/")){g.endsWith("/")||(g+="/");var n=g.substring(6)+"//";JV.JC.isSmilesCanonical(n)?(m="SMILES",g="CHEMICAL"):(g="SMILES",m=n+m)}else g.toUpperCase().startsWith("SMARTS/")&&(g.endsWith("/")||(g+="/"),m=g.substring(6)+(0==m.length?"//":m),g="SMARTS");var q=null,n=!1;if(4==b.tok)switch(a.length){case 1:if(b.value.startsWith("InChI=")&&
g.equalsIgnoreCase("SMILES"))return d.addXStr(this.vwr.getInchi(null,b.value,"SMILES"+m));n=!0;break;case 2:h||s?n=!0:b.value.startsWith("InChI=")?g.equals("SMARTS")?q=this.vwr.getInchi(null,b.value,"SMILES"):n=!0:3>=m.length&&0==m.$replace("m"," ").$replace("i"," ").$replace("v"," ").trim().length&&(n=!0)}var p=!n&&g.equalsIgnoreCase("SMILES"),u=!n&&g.equalsIgnoreCase("SMARTS"),t=!c&&!n&&g.equalsIgnoreCase("CHEMICAL"),C=!c&&!n&&g.equalsIgnoreCase("MF"),z=!c&&!n&&g.equalsIgnoreCase("CELLFORMULA"),
B=e&&!c&&g.equalsIgnoreCase("INCHI"),D=e&&!c&&g.equalsIgnoreCase("INCHIKEY"),w=!p&&!u&&10==j&&0<=m.toLowerCase().indexOf("map"),n=!p&&!u&&(10==b.tok||8==b.tok||7==b.tok)&&g.toLowerCase().startsWith("equivalent");try{if(n)switch(b.tok){case 10:return d.addXBs(this.vwr.ms.getSymmetryEquivAtoms(b.value,null,null));case 8:return d.addXList(this.vwr.getSymmetryEquivPoints(b.value,g+m));case 7:for(var A=new JU.Lst,U=b.getList(),v=0,y=U.size();v<y;v++){var V=JS.SV.ptValue(U.get(v));if(null==V)return!1;A.addLast(V)}return d.addXList(this.vwr.getSymmetryEquivPointList(A,
g+m))}else if(B||D)return D&&(m+=" key"),d.addXStr(this.vwr.getInchi(JS.SV.getBitSet(b,!0),null,m));if(t){var E=e?b.value:null,F=null==E?JS.SV.sValue(b):this.vwr.getOpenSmiles(E),F=(0==F.length?"":this.vwr.getChemicalInfo(F,m.toLowerCase(),E)).trim();F.startsWith("InChI")&&(F=JU.PT.rep(JU.PT.rep(F,"InChI=",""),"InChIKey=",""));return d.addXStr(F)}if(p||u||e){var e=w?0:p||u?2:1,G=e<a.length&&10==a[e].tok?a[e++].value:null,da="bonds".equalsIgnoreCase(JS.SV.sValue(l)),A=da||s,e=null;switch(b.tok){case 7:case 4:null==
q&&!c&&(q=JS.SV.sValue(b));if((p||u)&&1==a.length||null!=G)return!1;if(m.equalsIgnoreCase("mf"))e=this.vwr.getSmilesMatcher().getMolecularFormula(q,u,s);else{var G=m,x=!0,v=!1;switch(a.length){case 4:x=JS.SV.bValue(a[3]);case 3:v=JS.SV.bValue(a[2])}var Q=G.equals("chirality"),y=!v&&(!x||!u&&!Q);try{if(e=this.e.getSmilesExt().getSmilesMatches(G,c?JS.SV.strListValue(b):q,null,null,u?2:1,!v,!x),c)return d.addXObj(e)}catch(X){if(L(X,Exception))return System.out.println(X.getMessage()),d.addXInt(-1);throw X;
}var N=Q?1:(JU.AU.isAI(e),e.length);0==N&&("MF_FAILED"!==this.vwr.getSmilesMatcher().getLastException()&&0>q.toLowerCase().indexOf("noaromatic")&&0>q.toLowerCase().indexOf("strict"))&&(e=this.e.getSmilesExt().getSmilesMatches(G,q,null,null,16|(u?2:1),!v,!x));if(y)return d.addXInt(!x&&0<N?1:N)}break;case 10:x=b.value;if(g.equalsIgnoreCase("spacegroup"))return d.addXObj(this.vwr.findSpaceGroup(x,null,null,null,!1,!1,"parent".equals(m.toLowerCase())));if(g.equalsIgnoreCase("crystalClass"))return y=x.nextSetBit(0),
x=null,2!=a.length&&(x=new JU.BS,x.set(y)),d.addXList(this.vwr.ms.generateCrystalClass(y,null!=x?this.vwr.ms.getAtomSetCenter(x):10==l.tok?this.vwr.ms.getAtomSetCenter(l.value):JS.SV.ptValue(l)));if(C&&0!=m.length)return d.addXBs(JU.JmolMolecule.getBitSetForMF(this.vwr.ms.at,x,m));if(C||z)return d.addXStr(this.vwr.getFormulaForAtoms(x,C?"MF":"CELLFORMULA",s));if(k||r){var W=l.asString().equalsIgnoreCase("H"),A=(new Boolean(A|W)).valueOf();return d.addXStr(this.vwr.getSmilesOpt(x,-1,-1,(A?7340032|
(W?9437184:0):0)|(r?34603008:1048576),null))}if(w){var I=null,N=Q=y=null,O=3==a.length?JS.SV.sValue(l):null,R=null==O||O.equals("%i")||O.equals("number")?"i":O.equals("%a")||O.equals("name")?"a":O.equals("%D")||O.equals("index")?"D":"?";null==O&&(O="number");l=null;m=m.$replace("map","").trim();g=this.vwr.getSmilesOpt(x,0,0,0,m);if(x.cardinality()!=G.cardinality())l="atom sets are not the same size";else try{0<m.length&&(g="/"+m+"/"+g);var y=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,
this.vwr.ms.ac,x,137)[0],Y=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,this.vwr.ms.ac,G,137);if(0<Y.length){I=M(x.length(),0);for(v=I.length;0<=--v;)I[v]=-1;Q=Y[0];for(v=y.length;0<=--v;)I[y[v]]=Q[v];var N=H(y.length,2,null),ea=JU.BS.copy(x);ea.or(G);var S="?"==R?Array(ea.length()):null;null!=S&&(S=this.e.getCmdExt().getBitsetIdentFull(ea,O,!1,2147483647,!1,S));for(var K=this.vwr.ms.at,Y=0,v=x.nextSetBit(0);0<=v;v=x.nextSetBit(v+1)){var ba=I[v];if(-1!=ba){var ca;switch(R.charCodeAt(0)){case 97:ca=
H(-1,[K[v].getAtomName(),K[ba].getAtomName()]);break;case 105:ca=H(-1,[Integer.$valueOf(K[v].getAtomNumber()),Integer.$valueOf(K[ba].getAtomNumber())]);break;case 68:ca=H(-1,[Integer.$valueOf(v),Integer.$valueOf(ba)]);break;default:ca=H(-1,[S[v],S[ba]])}N[Y++]=ca}}}}catch(fa){if(L(fa,Exception))l=fa.getMessage();else throw fa;}var T=new java.util.Hashtable;T.put("BS1",x);T.put("BS2",G);T.put("SMILES",g);null==l?(T.put("SMILEStoBS1",y),T.put("SMILEStoBS2",Q),T.put("BS1toBS2",I),T.put("MAP1to2",N),
T.put("key",O)):T.put("error",l);return d.addXMap(T)}if(p||u)g=1<a.length&&10==a[1].tok?this.vwr.getSmilesOpt(a[1].value,0,0,0,m):m;m=m.toUpperCase();if(0<=m.indexOf("INCHI"))return d.addXStr(this.vwr.getInchi(x,null,"SMILES/"+m));if(m.equals("MF"))q=this.e.getSmilesExt().getSmilesMatches("",null,x,G,1,!0,!1),e=this.vwr.getSmilesMatcher().getMolecularFormula(q,!1,s);else if(da)I=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,this.vwr.ms.ac,x,(p?1:2)|8),e=0<I.length?this.vwr.ms.getDihedralMap(I[0]):
M(0,0);else if(m.equals("MAP"))e=I=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,this.vwr.ms.ac,x,(p?1:2)|144);else{var Z=(p?0<=m.indexOf("OPEN")?5:1:2)|(s&&0==g.length?22020096:0);if(0<=m.indexOf("/MOLECULE/")){for(var ga=this.vwr.ms.getMolecules(),$=new JU.Lst,v=0;v<ga.length;v++)if(ga[v].atomList.intersects(x)){var aa=this.e.getSmilesExt().getSmilesMatches(g,null,ga[v].atomList,G,Z,!s,!1);aa.isEmpty()||$.addLast(aa)}e=$}else e=this.e.getSmilesExt().getSmilesMatches(g,null,x,G,
Z,!s,!1)}}null==e&&this.e.invArg();return d.addXObj(e)}}catch(ha){if(L(ha,Exception))this.e.evalError(ha.getMessage(),null);else throw ha;}x=new JU.BS;I=c?b.getList():null;if(c&&4!=j&&0!=j){b=a[0];v=0;for(y=I.size();v<y;v++)JS.SV.areEqual(I.get(v),b)&&x.set(v);e=M(x.cardinality(),0);Y=0;for(v=x.nextSetBit(0);0<=v;v=x.nextSetBit(v+1))e[Y++]=v+1;return d.addXAI(e)}j=0<=m.indexOf("v");v=0<=m.indexOf("i")||h;h=0<=m.indexOf("m");m=0==g.length;n=!m&&!n&&2==a.length;if(c||n){k=n?this.getPatternMatcher():
null;G=null;if(n)try{G=k.compile(g,v)}catch(ia){if(L(ia,Exception))this.e.evalError(ia.toString(),null);else throw ia;}k=m?null:JS.SV.strListValue(b);O=m?I.size():k.length;JU.Logger.debugging&&JU.Logger.debug("finding "+g);y=0;R=null;b=h?new JU.Lst:null;S="";for(v=0;v<O;v++){if(m)switch(K=I.get(v),K.tok){case 6:K=K.getMap().isEmpty()!=f;break;case 7:K=0==K.getList().size()!=f;break;case 4:K=0==K.asString().length!=f;break;default:K=!0}else n?(S=k[v],R=G.matcher(S),K=R.find()):K=0<=JS.SV.sValue(I.get(v)).indexOf(g);
if(h&&K||!h&&K==!j)y++,x.set(v),h&&b.addLast(j?S.substring(0,R.start())+S.substring(R.end()):R.group())}if(!c)return h?d.addXStr(1==b.size()?b.get(0):""):j?d.addXBool(1==y):h?d.addXStr(0==y?"":R.group()):d.addXInt(0==y?0:R.start()+1);if(h){c=Array(y);if(0<y)for(v=k.length;0<=--v;)x.get(v)&&(--y,c[y]=h?b.get(y):k[v]);return d.addXAS(c)}c=new JU.Lst;for(v=x.nextSetBit(0);0<=v;v=x.nextSetBit(v+1))c.addLast(I.get(v));return d.addXList(c)}return k?d.addXStr(this.vwr.getJBR().toStdAmino3(JS.SV.sValue(b))):
d.addXInt(JS.SV.sValue(b).indexOf(g)+1)},"JS.ScriptMathProcessor,~A");t(p,"evaluateGetProperty",function(d,a,b,c){var e=a.length,f=c&&1275082241==b,j=c&&1275068725==b,g=1275068446==b,h=0,k=0==e?0:a[0].tok;if(2==e&&(7==k||6==k||14==k))return d.addXObj(this.vwr.extractProperty(a[0].value,a[1].value.toString(),-1));var l=c&&1==e&&10==a[0].tok?a[0].value:null,s=null==l&&0<e?JS.SV.sValue(a[h++]):"",k=s,m=k.toLowerCase();!f&&0>m.indexOf("[select ")&&(k=m);var r=!1;k.equals("json")&&e>h&&(r=!0,k=JS.SV.sValue(a[h++]));
var n=null;if(c){n=d.getX();switch(n.tok){case 10:break;case 4:var q=n.value,e=Array(3);q.startsWith("$")?(q=q.substring(1),a=this.vwr.shm.getShapeIdFromObjectName(q),0<=a&&(e[0]=q,this.vwr.shm.getShapePropertyData(a,"index",e),null!=e[1]&&!s.equals("index")&&(q=e[1].intValue(),e[1]=this.vwr.shm.getShapePropertyIndex(a,s.intern(),q)))):(a=JV.JC.shapeTokenIndex(JS.T.getTokFromName(q)),0<=a&&(e[0]=s,e[1]=Integer.$valueOf(-1),this.vwr.shm.getShapePropertyData(a,s.intern(),e)));return null==e[1]?d.addXStr(""):
d.addXObj(e[1]);case 7:if(j){g=n.getList();if(0==e)return d.addXObj(this.getMinMax(g,1275068725,!0));c=new java.util.Hashtable;k=1<e?JS.SV.sValue(a[e-1]):null;null!=k&&e--;m=Array(e);for(q=0;q<e;q++)m[q]=JS.SV.sValue(a[q]);q=0;for(r=g.size();q<r;q++)if(h=g.get(q),6==h.tok){s=h.getMap();a="";for(n=0;n<e;n++)l=s.get(m[n]),a+=(0==n?"":k)+JS.SV.sValue(l);s=c.get(a);null==s&&c.put(a,s=JS.SV.newV(7,new JU.Lst));s.getList().addLast(h)}return d.addXMap(c)}if(null!=l){e=n.getList();a=new JU.Lst;for(q=l.nextSetBit(0);0<=
q;q=l.nextSetBit(q+1))a.addLast(e.get(q));return d.addXList(a)}default:if(1275068725==b&&6==n.tok){c=new java.util.Hashtable;for(e=n.getMap().entrySet().iterator();e.hasNext()&&((q=e.next())||1);)a=q.getKey(),h=q.getValue().asString(),g=c.get(h),null==g&&c.put(h,g=new JU.Lst),g.addLast(a);if("count".equals(m))for(e=c.entrySet().iterator();e.hasNext()&&((q=e.next())||1);)q.setValue(Integer.$valueOf(q.getValue().size()));return d.addXMap(c)}f&&(k="[SELECT "+k+"]");return d.addXObj(this.vwr.extractProperty(n,
k,-1))}!m.startsWith("bondinfo")&&(!m.startsWith("atominfo")&&!m.startsWith("modelkitinfo"))&&(k="atomInfo."+k)}q="";if(k.equalsIgnoreCase("fileContents")&&2<=e){h=JS.SV.sValue(a[1]);for(q=2;q<e;q++)h+="|"+JS.SV.sValue(a[q]);q=h;h=e}else if(e>h)switch(a[h].tok){case 10:q=a[h++].value;k.equalsIgnoreCase("bondInfo")&&(e>h&&10==a[h].tok)&&(q=H(-1,[q,a[h].value]));break;case 6:case 4:this.vwr.checkPropertyParameter(k)&&(q=a[h++].value)}if(c&&(q=n.value,0>q.nextSetBit(0)))return d.addXStr("");g&&!c&&(k=
"auxiliaryInfo.models."+k);k=JU.PT.rep(k,".[","[");q=this.vwr.getProperty(null,k,q);h<e&&(q=this.vwr.extractProperty(q,a,h));return d.addXObj(r?JS.SV.safeJSON("value",q):JS.SV.isVariableType(q)?q:JU.Escape.toReadable(k,q))},"JS.ScriptMathProcessor,~A,~N,~B");t(p,"evaluateFormat",function(d,a,b,c){var e=2>b.length||1287653388==a?d.getX():null,f=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!=f){if(2==b.length){var e=e.getList(),j=b[1].getList();if(null==
e||null==j)return!1;e=JS.SV.getVariableList(this.getSublist(e,j))}b=H(-1,[b[0],e]);e=null}if(null==e){if(null==f)return!1;a=c?-1:JS.SV.getFormatType(f);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),f.equalsIgnoreCase("json")?d.addXStr(b):d.addXObj(b);f=b[1].getList();b=H(-1,[b[0],null]);c=Array(f.size());for(e=c.length;0<=--e;)b[1]=f.get(e),c[e]=JS.SV.format(b,a).toString();return d.addXAS(c)}if(7==e.tok&&null==f)return e=e.getList(),j=b[0].getList(),f=
this.getSublist(e,j),d.addXList(f);b=10==e.tok?e.value:null;a=JS.T.tokAttr(a,480);return d.addXObj(null==f?"":null==b?JS.SV.sprintf(JU.PT.formatCheck(f),e):this.e.getCmdExt().getBitsetIdent(b,f,e.value,!0,e.index,a))},"JS.ScriptMathProcessor,~N,~A,~B");t(p,"getSublist",function(d,a){for(var b=new JU.Lst,c,e,f,j=0,g=d.size();j<g;j++)switch(e=d.get(j),e.tok){case 6:c=e.getMap();f=new JU.Lst;for(var h=0,k=a.size();h<k;h++)e=c.get(JS.SV.sValue(a.get(h))),f.addLast(null==e?JS.SV.newS(""):e);b.addLast(JS.SV.getVariableList(f));
break;case 7:c=new java.util.Hashtable;f=e.getList();h=0;for(k=Math.min(f.size(),a.size());h<k;h++)c.put(JS.SV.sValue(a.get(h)),f.get(h));b.addLast(JS.SV.getVariable(c))}return b},"JU.Lst,JU.Lst");t(p,"evaluateList",function(d,a,b){var c=b.length,e=d.getX(),f=7==e.tok,j;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 g=null,h=null,k=null;if(2==c){var l=JS.SV.sValue(b[0]);j=b[1];if(1275069441==a){g=f?JS.SV.strListValue(e):JU.PT.split(JS.SV.sValue(e),"\n");h=7==j.tok?JS.SV.strListValue(j):JU.PT.split(JS.SV.sValue(j),"\n");k=Array(c=Math.max(g.length,h.length));for(e=0;e<c;e++)k[e]=(e>=g.length?"":g[e])+l+(e>=h.length?"":h[e]);return d.addXAS(k)}if(1073742335!=j.tok)return!1;k=e.getList();(c=0==l.length)&&(l=",");if(1275069446==a){h=Array(k.size());
for(e=k.size();0<=--e;)if(b=k.get(e).getList(),null==b)h[e]=k.get(e);else{a=new JU.SB;f=0;for(g=b.size();f<g;f++)0<f&&a.append(l),j=b.get(f),a.append(c&&4==j.tok?'"'+JU.PT.rep(j.value,'"','""')+'"':""+j.asString());h[e]=JS.SV.newS(a.toString())}return d.addXAV(h)}a=new JU.Lst;c&&(l="\x00");h=M(2,0);e=0;for(j=k.size();e<j;e++){f=k.get(e).asString();if(c){h[1]=0;for(g=h[0]=0;;){b=JU.PT.getCSVString(f,h);if(null==b){if(-1==h[1]){f+=++e<j?"\n"+k.get(e).asString():'"';h[1]=g;continue}f=f.substring(0,g)+
f.substring(g).$replace(",","\x00");break}f=f.substring(0,g)+f.substring(g,h[0]).$replace(",","\x00")+b+f.substring(h[1]);h[1]=g=h[0]+b.length}}for(var s=f.$plit(l),m=new JU.Lst,f=0,g=s.length;f<g;f++){b=s[f];if(0>b.indexOf("."))try{m.addLast(JS.SV.newI(Integer.parseInt(b)));continue}catch(r){if(!L(r,Exception))throw r;}else try{m.addLast(JS.SV.getVariable(Float.$valueOf(Float.parseFloat(b))));continue}catch(n){if(!L(n,Exception))throw n;}m.addLast(JS.SV.newS(b))}a.addLast(JS.SV.getVariableList(m))}return d.addXObj(JS.SV.getVariableList(a))}j=
0==c?JS.SV.newV(1073742327,"all"):b[0];k=1073742327==j.tok;if(!f&&4!=e.tok)return d.binaryOp(this.opTokenFor(a),e,j);var s=JS.SV.isScalar(e),q=JS.SV.isScalar(j),p=m=null,l=e.getList(),u=j.getList();f?c=l.size():s?c=2147483647:(g=JU.PT.split(JS.SV.sValue(e),"\n"),m=C(c=g.length,0),JU.PT.parseFloatArrayData(g,m));if(k&&1275069446!=a){k=0;if(f)for(e=c;0<=--e;)k+=JS.SV.fValue(l.get(e));else if(!s)for(e=c;0<=--e;)k+=m[e];return d.addXFloat(k)}if(1275069446==a&&4==j.tok){a=new JU.SB;if(s)a.append(JS.SV.sValue(e));
else{b=k?"":j.value.toString();for(e=0;e<c;e++)a.append(0<e?b:"").append(JS.SV.sValue(l.get(e)))}return d.addXStr(a.toString())}var t=null;q?t=j:7==j.tok?c=Math.min(c,u.size()):(h=JU.PT.split(JS.SV.sValue(j),"\n"),p=C(h.length,0),JU.PT.parseFloatArrayData(h,p),c=Math.min(c,p.length));var A=this.opTokenFor(a);if(f&&k)return k=new JU.Lst,d.addXList(this.addAllLists(e.getList(),k));b=s?e:null;var z,B=2147483647==c;B&&(c=1);for(var D=Array(c),e=0;e<c;e++){z=q?t:7==j.tok?u.get(e):Float.isNaN(p[e])?JS.SV.getVariable(JS.SV.unescapePointOrBitsetAsVariable(h[e])):
JS.SV.newF(p[e]);s||(b=f?l.get(e):Float.isNaN(m[e])?JS.SV.getVariable(JS.SV.unescapePointOrBitsetAsVariable(g[e])):JS.SV.newF(m[e]));1275069446==a&&7!=b.tok&&(k=new JU.Lst,k.addLast(b),b=JS.SV.getVariableList(k));if(!d.binaryOp(A,b,z))return!1;D[e]=d.getX()}return B?d.addXObj(D[0]):d.addXAV(D)},"JS.ScriptMathProcessor,~N,~A");t(p,"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");t(p,"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,f=this.vwr.async||2<a.length&&1073742335==a[a.length-1].tok,j=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,null,!1));e=c.startsWith("?");if(JV.Viewer.isJS&&(e||f)){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,j,!1,!1,!0,"script");try{return a?d.addXObj(this.vwr.parseJSON(b)):d.addXStr(b)}catch(g){if(L(g,Exception))return!1;throw g;}},"JS.ScriptMathProcessor,~A,~B");t(p,"evaluateMath",function(d,a,b){a=JS.SV.fValue(a[0]);switch(b){case 134218246:a=Math.sqrt(a);break;case 134218244:a=Math.sin(3.141592653589793*a/180);break;case 134218245:a=Math.cos(3.141592653589793*a/180);break;case 134218241:a=180*Math.acos(a)/3.141592653589793}return d.addXFloat(a)},"JS.ScriptMathProcessor,~A,~N");
t(p,"evaluateMeasure",function(d,a,b){var c=0;switch(b){case 1745489939:b=null;for(var e=new JU.Lst,f=C(-1,[3.4028235E38,3.4028235E38]),j=null,g=null,h=!1,k=!1,l=0,s=!1,m=null,r=0,n=3.4028235E38,q=!1,p=!1,m=0;m<a.length;m++)switch(a[m].tok){case 10:var u=a[m].value;0==u.length()&&(s=!0);e.addLast(u);c++;r++;break;case 8:u=new JU.Point3fi;u.setT(a[m].value);e.addLast(u);c++;break;case 2:case 3:f[l++%2]=JS.SV.fValue(a[m]);break;case 4:u=JS.SV.sValue(a[m]);if(u.startsWith("property_")){b=u;break}u.equalsIgnoreCase("vdw")||
u.equalsIgnoreCase("vanderwaals")?n=(m+1<a.length&&2==a[m+1].tok?a[++m].asInt():100)/100:u.equalsIgnoreCase("notConnected")?k=!0:u.equalsIgnoreCase("connected")?h=!0:u.equalsIgnoreCase("minArray")?q=1<=r:u.equalsIgnoreCase("asArray")||0==u.length?p=1<=r:JM.Measurement.isUnits(u)?g=u.toLowerCase():j=c+":"+u;break;default:return!1}if(2>c||4<c||2<l||k&&h)return!1;if(s||3.4028235E38!=n&&(2!=r||2!=c))return d.addXStr("");m=3.4028235E38==n?new J.atomdata.RadiusData(f,0,null,null):new J.atomdata.RadiusData(null,
n,J.atomdata.RadiusData.EnumType.FACTOR,J.c.VDW.AUTO);a=this.vwr.newMeasurementData(null,e).set(0,null,m,b,j,g,null,h,k,null,!0,0,0,null,NaN,null).getMeasurements(p,q);return d.addXObj(a);case 134217729:if(3!=(c=a.length)&&4!=c)return!1;break;default:if(2!=(c=a.length))return!1}b=Array(c);for(m=0;m<c;m++)if(null==(b[m]=d.ptValue(a[m],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");t(p,"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");t(p,"evaluatePlane",function(d,a,b){if(134219777==b&&3!=a.length&&4!=a.length||134217763==b&&2!=a.length&&3!=a.length&&4!=a.length||0==a.length||4<a.length)return!1;var c,e,f=this.e.planeValue(a[0]),j,g;switch(a.length){case 1:return 10==a[0].tok&&(a=a[0].value,3==a.cardinality())?(a=this.vwr.ms.getAtomPointVector(a),d.addXPt4(JU.Measure.getPlaneThroughPoints(a.get(0),a.get(1),a.get(2),new JU.V3,new JU.V3,new JU.P4))):null!=f&&d.addXPt4(f);case 2:if(134217763==b){c=
this.e.planeValue(a[1]);if(null==c)return!1;b=new JU.P3;j=new JU.V3;g=new JU.V3;if(null!=f)return a=JU.Measure.getIntersectionPP(f,c),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,c,b,j,g))}case 3:case 4:switch(b){case 134219777:return b=4==a.length?JS.SV.fValue(a[3]):NaN,f=this.e.getHklPlane(JU.P3.new3(JS.SV.fValue(a[0]),JS.SV.fValue(a[1]),JS.SV.fValue(a[2])),b,null),null!=f&&d.addXPt4(f);case 134217763: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();f=this.e.planeValue(a[2]);if(null!=f)return b=new JU.P3,j=new JU.V3,g=new JU.V3,c=JU.Measure.getIntersection(c,e,f,b,j,g),null==c?d.addXStr(""):d.addXPt(c);b=d.ptValue(a[2],null);if(null==b)return d.addXStr("");j=new JU.V3;b=JU.P3.newP(b);if(3==a.length)return JU.Measure.projectOntoAxis(b,c,e,j),d.addXPt(b);f=JS.SV.fValue(a[3]);a=JU.P3.newP(b);JU.Measure.projectOntoAxis(b,c,e,j);a=a.distance(b);c=new JU.Lst;
a==f?c.addLast(b):a<f&&(a=Math.sqrt(f*f-a*a),j.scaleAdd2(a,e,b),c.addLast(JU.P3.newP(j)),j.scaleAdd2(-a,e,b),c.addLast(JU.P3.newP(j)));return d.addXList(c)}switch(a[0].tok){case 2:case 3:if(3==a.length)return f=JS.SV.fValue(a[0]),b=JS.SV.fValue(a[1]),a=JS.SV.fValue(a[2]),j=JU.V3.new3(0,0,1),e=JU.P3.new3(0,1,0),a=JU.Quat.newVA(e,a),a.getMatrix().rotate(j),e.set(0,0,1),a=JU.Quat.newVA(e,b),a.getMatrix().rotate(j),e.setT(j),e.scale(f),f=new JU.P4,JU.Measure.getPlaneThroughPoint(e,j,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;b=2<a.length&&(10==a[2].tok||8==a[2].tok)?d.ptValue(a[2],null):null;j=JU.V3.newV(e);if(null==b)return f=new JU.P4,2==a.length||2!=a[2].tok&&3!=a[2].tok&&!a[2].asBoolean()?(b=JU.P3.newP(c),b.add(e),b.scale(0.5),j.sub(c),j.normalize()):1073742335==a[2].tok?b=c:(j.sub(c),b=new JU.P3,b.scaleAdd2(a[2].asFloat(),j,c)),JU.Measure.getPlaneThroughPoint(b,j,f),d.addXPt4(f);f=new JU.V3;a=4==a.length?d.ptValue(a[3],null):null;a=
JU.Measure.getDirectedNormalThroughPoints(c,e,b,a,j,f);return d.addXPt4(JU.P4.new4(j.x,j.y,j.z,a))}}if(4!=a.length)return!1;b=JS.SV.fValue(a[0]);j=JS.SV.fValue(a[1]);c=JS.SV.fValue(a[2]);a=JS.SV.fValue(a[3]);return d.addXPt4(JU.P4.new4(b,j,c,a))},"JS.ScriptMathProcessor,~A,~N");t(p,"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=null;if(7==a[0].tok){var c=a[0].getList(),e=c.size();if(0==e)return!1;switch(c.get(0).tok){case 4:b=
c.get(0).value;if(!b.startsWith("{")||"string"==typeof JU.Escape.uP(b))break;for(var b=new JU.Lst,f=0;f<e;f++)b.addLast(JS.SV.getVariable(JU.Escape.uP(JS.SV.sValue(c.get(f)))));return d.addXList(b)}b="{"+JS.SV.sValue(a[0])+"}"}null==b&&(b=JS.SV.sValue(a[0]));c=JU.Escape.uP(b);return A(c,"JU.P3")?d.addXPt(c):d.addXStr(""+c);case 2:switch(a[1].tok){case 1073742334:case 1073742335:switch(a[0].tok){case 8:c=JU.P3.newP(a[0].value);break;case 10:c=this.vwr.ms.getAtomSetCenter(a[0].value);break;default:return!1}1073742335==
a[1].tok?(this.vwr.tm.transformPt3f(c,c),c.y=this.vwr.tm.height-c.y,this.vwr.antialiased&&c.scale(0.5)):(this.vwr.antialiased&&c.scale(2),c.y=this.vwr.tm.height-c.y,this.vwr.tm.unTransformPoint(c,c));break;case 8:e=a[0].getList();if(null==e||4!=e.size())return!1;b=JS.SV.ptValue(a[1]);c=JU.P3.newP(JS.SV.ptValue(e.get(0)));c.scaleAdd2(b.x,JS.SV.ptValue(e.get(1)),c);c.scaleAdd2(b.y,JS.SV.ptValue(e.get(2)),c);c.scaleAdd2(b.z,JS.SV.ptValue(e.get(3)),c);break;default:return!1}return d.addXPt(c);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");t(p,"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(),f=null!=c?null:2<=a.length?JS.SV.sValue(a[1]):"OK",b=""+this.vwr.prompt(b,f,c,e);return e&&null!=c?d.addXInt(Integer.parseInt(b)+
1):d.addXStr(b)},"JS.ScriptMathProcessor,~A");t(p,"evaluateQuaternion",function(d,a,b){var c=null,e=a.length,f=2147483647,j=!1;134221850==b&&(1<e&&(4==a[e-1].tok&&a[e-1].value.equalsIgnoreCase("relative"))&&(e--,j=!0),1<e&&(2==a[e-1].tok&&10==a[0].tok)&&(f=a[e-1].asInt(),0>=f&&(f=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 g=0;3>g;g++)if(8!=a[g].tok&&10!=a[g].tok)return!1;break;default:return!1}var h=g=null,k=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);g=A(a,"JU.Quat")?a:null;break}else if(134221850==b&&10==a[0].tok)h=
this.vwr.getAtomGroupQuaternions(a[0].value,f);else if(11==a[0].tok)g=JU.Quat.newM(a[0].value);else if(9==a[0].tok)k=a[0].value;else if(k=JS.SV.sValue(a[0]),k=JU.Escape.uP(k.equalsIgnoreCase("best")?this.vwr.getOrientation(1073741864,"best",null,null).toString():k),!A(k,"JU.P4"))return!1;134217731==b&&(g=JU.Quat.newVA(JU.P3.new3(k.x,k.y,k.z),k.w));break;case 2:if(134221850==b){if(7==a[0].tok&&7==a[1].tok){b=this.e.getQuaternionArray(a[0].getList(),1073742001);h=this.e.getQuaternionArray(a[1].getList(),
1073742001);h=JU.Quat.arrayDiv(h,b,f,j);break}if(7==a[0].tok&&1073742335==a[1].tok)return b=this.e.getQuaternionArray(a[0].getList(),1073742001),f=C(1,0),JU.Quat.sphereMean(b,f,1E-4),d.addXFloat(f[0]);if(10==a[0].tok&&10==a[1].tok){b=this.vwr.getAtomGroupQuaternions(a[0].value,2147483647);h=this.vwr.getAtomGroupQuaternions(a[1].value,2147483647);h=JU.Quat.arrayDiv(h,b,f,j);break}}g=d.ptValue(a[1],null);k=this.e.planeValue(a[0]);g=null!=g?JU.Quat.getQuaternionFrame(JU.P3.new3(0,0,0),c,g):JU.Quat.newVA(c,
JS.SV.fValue(a[1]));break;case 3:if(9==a[0].tok)return f=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]),f,1));b=Array(3);for(g=0;3>g;g++)b[g]=8==a[g].tok?a[g].value:this.vwr.ms.getAtomSetCenter(a[g].value);g=JU.Quat.getQuaternionFrame(b[0],b[1],b[2]);break;case 4:134221850==b?k=JU.P4.new4(JS.SV.fValue(a[1]),JS.SV.fValue(a[2]),JS.SV.fValue(a[3]),JS.SV.fValue(a[0])):g=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!=h){if(2147483647!=f){f=new JU.Lst;for(g=0;g<h.length;g++)f.addLast(h[g].toPoint4f());return d.addXList(f)}g=0<h.length?h[0]:null}return d.addXPt4((null==g?JU.Quat.newP4(k):g).toPoint4f())},"JS.ScriptMathProcessor,~A,~N");t(p,"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(aa(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");t(p,"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=C(3,0),c.getRow(a,b),d.addXAF(b);default:return b=C(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=C(4,0),c.getRow(a,b),d.addXAF(b);
default:return b=C(4,0),c.getColumn(a,b),d.addXAF(b)}case 7:b=c.getList();for(var c=new JU.Lst,e=0,f=b.size();e<f;e++){var j=b.get(e).getList();if(null==j)return d.addXStr("");c.addLast(a<j.size()?j.get(a):JS.SV.newS(""))}return d.addXList(c)}return!1},"JS.ScriptMathProcessor,~A,~N");t(p,"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,f=c.size();e<f;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");t(p,"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 f=d.getX();if(7==f.tok){for(var f=JS.SV.strListValue(f),j=Array(f.length),g=f.length;0<=--g;)j[g]=null==c?JU.PT.clean(f[g]):b?JU.PT.replaceAllCharacters(f[g],c,e):JU.PT.rep(f[g],c,e);return d.addXAS(j)}f=JS.SV.sValue(f);return d.addXStr(null==
c?JU.PT.clean(f):b?JU.PT.replaceAllCharacters(f,c,e):JU.PT.rep(f,c,e))},"JS.ScriptMathProcessor,~A");t(p,"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(),f;return Float.isNaN(f=JU.PT.parseFloatStrict(c))?d.addXStr(c):0<=c.indexOf(".")?d.addXFloat(f):d.addXInt(JU.PT.parseInt(c))},"JS.ScriptMathProcessor,~A,~N");t(p,"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,f=e=null,j=JS.SV.getVariable(b.value).sortOrReverse(0).getList();if(null==j)return null==a?d.addXStr(""):d.addXInt(0);b=0;for(var g=j.size();b<=g;b++){var h=b==g?null:j.get(b);if(!(null!=a&&null!=h&&!JS.SV.areEqual(h,
a)))if(JS.SV.areEqual(h,e))f.intValue++;else{if(null!=e){var k=new JU.Lst;k.addLast(e);k.addLast(f);c.addLast(JS.SV.getVariableList(k))}f=JS.SV.newI(1);e=h}}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");t(p,"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 f=this.vwr.getModelUndeletedAtomsBitSet(a);f.and(e);b.addLast(JS.SV.getVariable(f))}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");t(p,"evaluateSubstructure",function(d,a,b,c){if(0==a.length||c&&(134218753==b||1<a.length))return!1;var e=134218756==b&&!c&&134218756==a[0].tok?a[0].value:null;if(null!=
e&&2>a.length)return!1;var f=134218756==b&&!c&&10==a[0].tok,j=134218753==a[0].tok?a[0].value:null!=e&&134218753==a[1].tok?a[1].value:null;if(null!=e&&null==j)return!1;var g=f?null:JS.SV.sValue(a[0]),h=new JU.BS;if(f||0<g.length)try{if(f)return d.addX(JS.SV.newV(134218756,this.vwr.getSmilesMatcher().compileSearchTarget(this.vwr.ms.at,this.vwr.ms.ac,JS.SV.getBitSet(a[0],!1))));if(null!=e)return d.addXBs(this.vwr.getSmilesMatcher().getSubstructureSet(j,e,0,null,2));if(134218753==b)return d.addX(JS.SV.newV(134218753,
this.vwr.getSmilesMatcher().compileSmartsPattern(g)));var k=c?d.getX().value:2==a.length&&10==a[1].tok?a[1].value:this.vwr.getModelUndeletedAtomsBitSet(-1),h=this.vwr.getSmilesMatcher().getSubstructureSet(null==j?g:j,this.vwr.ms.at,this.vwr.ms.ac,k,134218757==b?1:2)}catch(l){if(L(l,Exception))this.e.evalError(l.getMessage(),null);else throw l;}return 134218753!=b&&d.addXBs(h)},"JS.ScriptMathProcessor,~A,~N,~B");t(p,"evaluateSymop",function(d,a,b){var c=a.length,e=null;if(2==a.length&&4==a[0].tok&&
4==a[1].tok&&a[1].value.equalsIgnoreCase("matrix"))return e=this.vwr.getSymTemp().convertOperation(a[0].value,null),null!=e&&d.addXObj(e);if(2==a.length&&12==a[0].tok&&4==a[1].tok&&a[1].value.equalsIgnoreCase("xyz"))return e=this.vwr.getSymTemp().convertOperation("",a[0].value),null!=e&&d.addXObj(e);var f=b?d.getX():null,j=!1;if(null!=f&&10!=f.tok&&!(j=8==f.tok))return!1;e=null==f||j?null:f.value;f=j?JS.SV.ptValue(f):null;!j&&null==e&&(e=this.vwr.getThisModelAtoms());if(0==c){for(var f=JU.PT.split(JU.PT.trim(this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,
null,null==e||e.isEmpty()?Math.max(0,this.vwr.am.cmi):this.vwr.ms.at[e.nextSetBit(0)].mi,!1,null).get("symmetryInfo"),"\n"),"\n"),g=new JU.Lst,h=0,k=f.length;h<k;h++)g.addLast(JU.PT.split(f[h],"\t"));return d.addXList(g)}var l=null,s=!1,m=!1,k=-2147483648,r=0,n=null,q=null;switch(a[0].tok){case 4:l=JS.SV.sValue(a[0]);if(null!=l){if(l.equalsIgnoreCase("count"))return h=this.vwr.getOperativeSymmetry(),1!=c?!1:d.addXInt(null==h?0:h.getSpaceGroupOperationCount());s=l.equalsIgnoreCase("invariant");m=l.equalsIgnoreCase("wyckoff")}r++;
break;case 12:l=a[0].escape();r++;break;case 2:k=a[0].asInt();r++;break;case 10:j||(q=1==a.length||10!=a[1].tok?e:null,e=this.vwr.getModelUndeletedAtomsBitSet(this.vwr.getModelIndexForAtom(e.nextSetBit(0))))}null==e&&(r<c&&10==a[r].tok&&(e=new JU.BS).or(a[r].value),r+1<c&&10==a[r+1].tok&&(null==e?e=new JU.BS:e).or(a[r+1].value));j=null;if(c>r&&7==a[r].tok){n=a[r++].getList();if(3!=n.size())return!1;j=JU.P3.new3(JS.SV.fValue(n.get(0)),JS.SV.fValue(n.get(1)),JS.SV.fValue(n.get(2)))}else c>r&&2==a[r].tok&&
JU.SimpleUnitCell.ijkToPoint3f(JS.SV.iValue(a[r++]),j=new JU.P3,0,0);null==f&&null!=(f=c>r?d.ptValue(a[r],e):null)&&r++;null!=(n=c>r?d.ptValue(a[r],e):null)&&r++;null!=f&&(null==n&&null!=q&&!q.isEmpty())&&(n=f,f=JU.P3.newP(this.vwr.ms.at[q.nextSetBit(0)]));q=null!=n&&a.length>r&&-2147483648==k&&2==a[r].tok?a[r].intValue:-1;0<=q&&r++;-2147483648==k&&!s&&(k=0);var p=null;!m&&(!s&&null!=l&&0>l.indexOf(","))&&(r==c?p=this.vwr.ms.getPointGroupInfo(null):6==a[r].tok&&(p=a[r].getMap()));if(null!=p){e=l.indexOf(".");
a=l.indexOf("^");0<a?q=JU.PT.parseInt(l.substring(a+1)):(a=l.length,q=1);0<e&&a>e+1?(k=JU.PT.parseInt(l.substring(e+1,a)),1>k&&(k=1),a=e):k=1;l=l.substring(0,a);e=p.get(l+"_m");if(null==e)return e=p.get(l),null==e?d.addXStr(""):d.addXObj(e);var u;try{if(A(e,"JS.SV"))if(u=p.get("center").value,11==e.tok)g=e.value;else if(7==e.tok)g=e.getList().get(k-1).value;else return!1;else u=p.get("center"),g=A(e,"JU.M3")?e:e.get(k-1);k=g;g=JU.M3.newM3(g);if(1<q)for(h=1;h<q;h++)g.mul(k);if(null==f)return d.addXObj(g);
f=JU.P3.newP(f);f.sub(u);g.rotate(f);f.add(u);return d.addXPt(f)}catch(t){if(!L(t,Exception))throw t;}return!1}u=c==r?m?"":s?"id":null!=n?"all":null!=f?"point":"matrix":JS.SV.sValue(a[r++]);c=(h=(!m||b)&&null!=e&&!e.isEmpty())?e.nextSetBit(0):-1;if(m){e=h?this.vwr.ms.getAtom(c):f;if(null==e)switch(u){case "":case "*":u="*";break;default:if(1==u.length)u+="*";else return!1}if(0==u.length||u.equalsIgnoreCase("label"))u=null;f=null==u?null:u.endsWith("*")||u.equalsIgnoreCase("coord")||u.equalsIgnoreCase("coords")?
u:u.substring(0,1);h=this.vwr.getOperativeSymmetry();return d.addXObj(null==h?null:h.getWyckoffPosition(this.vwr,e,f))}u=u.toLowerCase();if(s||u.equals("invariant")&&b)h&&null==f&&(f=this.vwr.ms.at[c]),0>c&&(c=this.vwr.getThisModelAtoms().nextSetBit(0));if(s&&-2147483648==k){l=null;h=this.vwr.getCurrentUnitCell();null!=f?l=null==h?M(0,0):h.getInvariantSymops(f,null):null!=e&&!e.isEmpty()&&(h=e.nextSetBit(0),f=this.vwr.ms.at[h],l=this.vwr.ms.getSymmetryInvariant(h));if(null!=l&&0<l.length){g=Array(l.length);
for(h=0;h<g.length;h++)k=l[h],g[h]=this.vwr.getSymmetryInfo(c,null,k,null,f,f,1275068418,u,0,-1,0,null);return d.addXObj(g)}return null!=l&&d.addXAI(l)}return r==a.length&&d.addXObj(this.vwr.getSymmetryInfo(c,l,k,j,f,n,1275068418,u,0,q,0,null))},"JS.ScriptMathProcessor,~A,~B");t(p,"evaluateTensor",function(d,a){var b=2==a.length&&1275068445==a[1].tok,c=b?null:d.getX();if(2<a.length||!b&&10!=c.tok)return!1;var c=c.value,e=b||0==a.length?null:JS.SV.sValue(a[0]).toLowerCase(),f=this.vwr.getNMRCalculation();
if("unique".equals(e))return d.addXBs(f.getUniqueTensorSet(c));var j=2>a.length?null:JS.SV.sValue(a[1]).toLowerCase();return b?d.addXObj(a[0].value.getInfo(j)):d.addXList(f.getTensorInfo(e,j,c))},"JS.ScriptMathProcessor,~A");t(p,"evaluateUserFunction",function(d,a,b,c,e){var f=null;if(e)switch(f=d.getX(),f.tok){case 10:break;case 6:if(0<b.length)return!1;f=f.getMap().get(a);return null==f?d.addXStr(""):d.addX(f);default:return!1}a=a.toLowerCase();d.wasX=!1;for(var j=new JU.Lst,g=0;g<b.length;g++)j.addLast(b[g]);
if(e)return d.addXObj(this.e.getBitsetProperty(f.value,null,c,null,null,f.value,H(-1,[a,j]),!1,f.index,!1));a=this.e.getUserFunctionResult(a,j,null);return null==a?!1:d.addX(a)},"JS.ScriptMathProcessor,~S,~A,~N,~B");t(p,"evaluateWithin",function(d,a,b){var c=a.length;if(1>c||5<c)return!1;if(1==c&&10==a[0].tok)return d.addX(a[0]);var e=b?JS.SV.getBitSet(d.getX(),!1):null,f=0,j=a[0].value,g=""+j,h=this.vwr.ms,k=!1,l=!1,p=!1,m=!1,r=null,n=a[0].tok;switch(4==n?n=JS.T.getTokFromName(g):n){case 1648363544:k=
!0,j=null;case 3:case 2:m=!0;if(2>c||3==c&&7==a[1].tok&&7!=a[2].tok)return!1;f=k?100:JS.SV.fValue(a[0]);switch(n=a[1].tok){case 1073742335:case 1073742334:l=a[1].asBoolean();if(2<c&&JS.SV.sValue(a[2]).equalsIgnoreCase("unitcell"))n=1814695966;else if(2<c&&10!=a[2].tok)return!1;c=0;break;case 4:n=JS.SV.sValue(a[1]);if(n.startsWith("$"))return d.addXBs(this.getAtomsNearSurface(f,n.substring(1)));if(n.equalsIgnoreCase("group"))p=!0,n=1086324742;else if(n.equalsIgnoreCase("vanderwaals")||n.equalsIgnoreCase("vdw"))j=
null,k=!0,n=1648363544;else if(n=JS.T.getTokFromName(n),0==n)return!1}break;case 7:1==c&&(j=a[0].asString(),n=0);break;case 1073742328:return 3==c&&A(a[1].value,"JU.BS")&&A(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:f=null;b=!0;switch(c){case 2:f=e;break;case 3:if(b=10==a[2].tok)f=a[2].value;break;default:b=!1}return b&&d.addXObj(this.e.getSmilesExt().getSmilesMatches(JS.SV.sValue(a[1]),
null,f,null,134218756==n?2:1,d.asBitSet,!1))}if("string"==typeof j){if(0==n){n=1073742362;if(2<c)return!1;c=2}}else if(!m)return!1;switch(c){case 1:switch(n){case 136314895:case 2097184:case 1812599299:case 1814695966:return d.addXBs(h.getAtoms(n,null));case 1073741863:return d.addXBs(h.getAtoms(n,""));case 1073742362:return d.addXBs(h.getAtoms(1086324744,g))}return!1;case 2:switch(n){case 1073742362:n=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(n,
JS.SV.sValue(a[1])));case 1094713349:case 1094713350:return d.addXBs(this.vwr.ms.getAtoms(n,JS.SV.ptValue(a[1])));case 1814695966:e=a[1].getList();if(null==e)return!1;f=f=null;if(4!=e.size())return!1;f=Array(4);for(a=0;4>a;a++)if(null==(f[a]=JS.SV.ptValue(e.get(a))))return!1;f=this.vwr.getSymTemp().getUnitCell(f,!1,null);return d.addXBs(this.vwr.ms.getAtoms(n,f))}break;case 3:switch(n){case 1073742335:case 1073742334:case 1086324742:case 1648363544:case 1814695966:case 134217750:case 134219777:case 1073742329:case 8:case 7:break;
case 1086324744:g=JS.SV.sValue(a[2]);break;default:return!1}}var q=null,j=c=null,t=a.length-1;switch(a[t].tok){case 9:q=a[t].value;break;case 8:c=a[t].value;JS.SV.sValue(a[1]).equalsIgnoreCase("hkl")&&(q=this.e.getHklPlane(c,NaN,null));break;case 7:j=2==t&&7==a[1].tok?a[1].getList():null,c=2==t?JS.SV.ptValue(a[1]):1==t?JU.P3.new3(NaN,0,0):null}if(null!=q)return d.addXBs(h.getAtomsNearPlane(f,q));h=10==a[t].tok?a[t].value:null;null==e&&(e=h);if(0<t&&null==c&&null==j&&null==e)return!1;if(1814695966==
n)return(null!=e||null!=c)&&d.addXObj(this.vwr.ms.getUnitCellPointsWithin(f,e,c,l));if(null!=c||null!=j){if(7==a[t].tok){b=a[t].getList();n=Array(b.size());for(a=n.length;0<=--a;)n[a]=JS.SV.ptValue(b.get(a));b=null;if(null!=j){b=Array(j.size());for(a=b.length;0<=--a;)b[a]=JS.SV.ptValue(j.get(a))}a=Array(1);null!=e&&(e.and(this.vwr.getAllAtoms()),b=this.vwr.ms.at);switch(J.bspt.PointIterator.withinDistPoints(f,c,n,b,e,a)){case 10:return d.addXBs(a[0]);case 134217751:return d.addXPt(a[0]);case 1073742001:return d.addXList(a[0]);
case 1275068418:return d.addXAI(a[0]);case 4:return d.addXStr(a[0]);default:return!1}}return d.addXBs(this.vwr.getAtomsNearPt(f,c,null))}if(1086324744==n)return d.addXBs(this.vwr.ms.getSequenceBits(g,e,new JU.BS));null==e&&(e=new JU.BS);if(!m)try{return d.addXBs(this.vwr.ms.getAtoms(n,e))}catch(u){if(L(u,Exception))return!1;throw u;}if(p)return d.addXBs(this.vwr.getGroupsWithin(aa(f),e));k&&(r=new J.atomdata.RadiusData(null,10<f?f/100:f,10<f?J.atomdata.RadiusData.EnumType.FACTOR:J.atomdata.RadiusData.EnumType.OFFSET,
J.c.VDW.AUTO),0>f&&(f=0));e=this.vwr.ms.getAtomsWithinRadius(f,b?h:e,l,r,b?e:null);b&&e.andNot(h);return d.addXBs(e)},"JS.ScriptMathProcessor,~A,~B");t(p,"evaluateWrite",function(d,a){var b=a.length,c=!1;2==b&&1073742335==a[1].tok&&(b=1,c=!0);switch(b){case 0:return!1;case 1:var e=a[0].asString().toUpperCase();if(e.equals("PNGJ"))return b=this.vwr.fm.getFileAsMap(null,"PNGJ",c),c?d.addX(JS.SV.newV(15,new JU.BArray(b))):d.addXMap(b);if(JU.PT.isOneOf(e,";ZIP;ZIPALL;JMOL;")){var b=new java.util.Hashtable,
f=new JU.OC;b.put("outputChannel",f);this.vwr.createZip(null,e,b);e=f.toByteArray();if(c)return d.addX(JS.SV.newV(15,new JU.BArray(e)));b=new java.util.Hashtable;this.vwr.readFileAsMap(JU.Rdr.getBIS(e),b,null);return d.addXMap(b)}}return d.addXStr(this.e.getCmdExt().dispatch(134221856,!0,a))},"JS.ScriptMathProcessor,~A");t(p,"getAtomsNearSurface",function(d,a){var b=H(-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],null);b[1]=Float.$valueOf(d);return this.e.getShapePropertyData(21,"getAtomsWithin",b)?b[2]:new JU.BS},"~N,~S");t(p,"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,f=this.vwr.ms.ac;0<=--f;){var j=e[f];if(null!=j)for(var g=b.nextSetBit(0);0<=g;g=b.nextSetBit(g+1))if(j.distance(a[g])<
d){c.set(f);break}}return c},"~N,~A,JU.BS");t(p,"getMinMax",function(d,a,b){for(var c=null,e=null,f=0,j=null;;){if(JU.AU.isAF(d)){if(1275068725==a)return Float.$valueOf(NaN);c=d;f=c.length;if(0==f)break}else if(A(d,"JU.Lst"))if(e=d,f=e.size(),0==f){if(1275068725!=a)break}else{if(1275068725!=a){d=e.get(0);if(8==d.tok)return this.getMinMaxPoint(e,a);if(4==d.tok&&d.value.startsWith("{")){b=JS.SV.ptValue(d);if(A(b,"JU.P3"))return this.getMinMaxPoint(e,a);if(A(b,"JU.P4"))return this.getMinMaxQuaternion(e,
a);break}}}else break;var g,h=!1;switch(a){case 1275068725:j=new java.util.Hashtable;d=g=0;break;case 32:h=!0;d=3.4028235E38;g=2147483647;break;case 64:d=-3.4028235E38;g=-2147483647;break;default:d=g=0}for(var k=0,l=0,p=!0,m=1275068725==a;0<=--f;){var r=null==e?null:e.get(f),n=!b?null:null==r?JS.SV.vF:r,q=m?1:null==c?JS.SV.fValue(n):c[f];if(!Float.isNaN(q))switch(l++,a){case 160:case 192:k+=q*q;case 128:case 96:d+=q;break;case 1275068725:r=null==n?r.toString():n.asString();n=j.get(r);j.put(r,null==
n?Integer.$valueOf(1):Integer.$valueOf(n.intValue()+1));break;case 32:case 64:p=(new Boolean(p&2==n.tok)).valueOf(),h==q<d&&(d=q,p&&(g=n.intValue))}}if(1275068725==a)return j;if(0==l)break;switch(a){case 96:d/=l;break;case 192:if(1==l)break;d=Math.sqrt((k-d*d/l)/(l-1));break;case 32:case 64:if(p)return Integer.$valueOf(g);break;case 160:d=k}return Float.$valueOf(d)}return JS.MathExt.nan},"~O,~N,~B");t(p,"getMinMaxPoint",function(d,a){var b=null,c=null,e=0;A(d,Array)?(b=d,e=b.length):A(d,"JU.Lst")&&
(c=d,e=c.size());if(null==c&&null==b)return JS.MathExt.nan;for(var f=new JU.P3,j=C(e,0),g=0;3>g;g++){for(var h=0;h<e;h++){var k=null==b?JS.SV.ptValue(c.get(h)):b[h];if(null==k)return JS.MathExt.nan;switch(g){case 0:j[h]=k.x;break;case 1:j[h]=k.y;break;case 2:j[h]=k.z}}h=this.getMinMax(j,a,!0);if(!A(h,Number))return JS.MathExt.nan;h=h.floatValue();switch(g){case 0:f.x=h;break;case 1:f.y=h;break;case 2:f.z=h}}return f},"~O,~N");t(p,"getMinMaxQuaternion",function(d,a){var b;switch(a){case 32:case 64:case 128:case 160:return JS.MathExt.nan}for(;;){b=
this.e.getQuaternionArray(d,1073742001);if(null==b)break;var c=C(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 JS.MathExt.nan},"JU.Lst,~N");t(p,"getPatternMatcher",function(){return null==this.pm?this.pm=J.api.Interface.getUtil("PatternMatcher",this.e.vwr,"script"):this.pm});t(p,"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");t(p,"setContactBitSets",function(d,a,b,c,e,f){var j,g;null==a?(a=JU.BSUtil.setAll(this.vwr.ms.ac),JU.BSUtil.andNot(a,this.vwr.slm.bsDeleted),a.andNot(d),j=!1):(g=JU.BSUtil.copy(d),g.or(a),g=this.vwr.ms.getModelBS(g,!1).cardinality(),j=1<g,f&&(1<g&&!this.e.tQuiet)&&this.e.showString(J.i18n.GT.$("Note: More than one model is involved in this contact!")));if(!d.equals(a)){if(f=!b||d.cardinality()<a.cardinality())g=
this.vwr.ms.getAtomsWithinRadius(c,d,j,Float.isNaN(c)?e:null,null),a.and(g);b&&(g=this.vwr.ms.getAtomsWithinRadius(c,a,j,Float.isNaN(c)?e:null,null),d.and(g),f||(g=this.vwr.ms.getAtomsWithinRadius(c,d,j,Float.isNaN(c)?e:null,null),a.and(g)),g=JU.BSUtil.copy(a),g.and(d),g.equals(d)?a.andNot(d):g.equals(a)&&d.andNot(a))}return a},"JU.BS,JU.BS,~B,~N,J.atomdata.RadiusData,~B");p.nan=Float.$valueOf(NaN);p.t0=System.currentTimeMillis()});V("J.bspt");W(null,"J.bspt.PointIterator","JU.BS $.Lst $.P3 J.bspt.Bspt JU.BSUtil $.Point3fi".split(" "),
function(){var p=ja(J.bspt,"PointIterator",null);p.withinDistPoints=t(p,"withinDistPoints",function(d,a,b,c,e,f){var j=new JU.Lst,g=new J.bspt.Bspt(3,0),h;if(null!=a&&Float.isNaN(a.x)){for(var k=Array(b.length),l=k.length;0<=--l;){h=b[l];if(null==h)return 0;null==e?(a=new JU.Point3fi,a.setT(h),a.i=l,k[l]=a,g.addTuple(a)):g.addTuple(h)}h=g.allocateCubeIterator();if(null!=e){b=JU.BS.newN(c.length);for(l=e.nextSetBit(0);0<=l;l=e.nextSetBit(l+1)){h.initialize(c[l],d,!1);for(g=d*d;h.hasMoreElements();)if(h.nextElement().distanceSquared(c[l])<=
g){b.set(l);break}}f[0]=b;return 10}b=JU.BSUtil.newBitSet2(0,b.length);for(l=k.length;0<=--l;){h.initialize(a=k[l],d,!1);g=d*d;for(e=0;h.hasMoreElements();)c=h.nextElement(),b.get(c.i)&&(c.distanceSquared(a)<=g&&1<++e)&&b.clear(c.i)}for(l=b.nextSetBit(0);0<=l;l=b.nextSetBit(l+1))j.addLast(JU.P3.newP(k[l]));f[0]=j;return 1073742001}if(0==d){if(null==c){g=3.4028235E38;k=null;for(l=b.length;0<=--l;)j=b[l],d=j.distanceSquared(a),d<g&&(k=j,g=d);f[0]=null==k?"":k;return null==k?4:134217751}k=M(c.length,
0);for(l=k.length;0<=--l;){g=3.4028235E38;e=-1;a=c[l];for(h=b.length;0<=--h;)j=b[h],d=j.distanceSquared(a),d<g&&(e=h,g=d);k[l]=e}f[0]=k;return 1275068418}for(l=b.length;0<=--l;)g.addTuple(b[l]);h=g.allocateCubeIterator();h.initialize(a,d,!1);for(g=d*d;h.hasMoreElements();)c=h.nextElement(),c.distanceSquared(a)<=g&&j.addLast(c);h.release();f[0]=j;return 1073742001},"~N,JU.P3,~A,~A,JU.BS,~A")});V("JU");W(null,"JU.PatternMatcher",["JV.Viewer"],function(){var p=ja(JU,"PatternMatcher",null);t(p,"compile",
function(d,a){if(JV.Viewer.isJS&&!JV.Viewer.isSwingJS)return new JU.PatternMatcher.JSPattern(d,a)},"~S,~B");p=$(function(){this.strString=this.regexp=null;this.rightBound=this.leftBound=-1;this.results=null;Z(this,arguments)},JU.PatternMatcher,"JSPattern",null);ka(p,function(d,a){this.regexp=RegExp(d,a?"gi":"g")},"~S,~B");t(p,"find",function(){var d=this.rightBound==this.strString.length?this.strString:this.strString.substring(0,this.rightBound);this.regexp.lastIndex=this.leftBound;this.results=this.regexp.exec(d);
this.leftBound=this.regexp.lastIndex;return null!=this.results});t(p,"start",function(){return this.regexp.lastIndex-this.results[0].length});t(p,"end",function(){return this.regexp.lastIndex});t(p,"group",function(){return null==this.results||0==this.results.length?null:this.results[0]});t(p,"matcher",function(d){this.strString=d;this.leftBound=0;this.rightBound=d.length;return this},"~S")})})(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.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,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);
