(function(Y,Z,$,aa,ba,N,I,O,Q,R,K,S,T,ca,L,F,U,M,V,da,W,ea,fa,ga,ha,ia,ja,ka,la,z,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,La,l,X){N("JS");c$=R(function(){this.e=this.vwr=null;this.chk=!1;this.st=null;this.slen=0;Q(this,arguments)},JS,"ScriptExt");l(c$,"init",function(a){this.e=a;this.vwr=this.e.vwr;return this},"~O");l(c$,"atomExpressionAt",function(a){return this.e.atomExpressionAt(a)},"~N");l(c$,"checkLength",function(a){this.e.checkLength(a)},"~N");l(c$,"error",
function(a){this.e.error(a)},"~N");l(c$,"invArg",function(){this.e.invArg()});l(c$,"invPO",function(){this.error(23)});l(c$,"getShapeProperty",function(a,c){return this.e.getShapeProperty(a,c)},"~N,~S");l(c$,"paramAsStr",function(a){return this.e.paramAsStr(a)},"~N");l(c$,"centerParameter",function(a){return this.e.centerParameter(a)},"~N");l(c$,"floatParameter",function(a){return this.e.floatParameter(a)},"~N");l(c$,"getPoint3f",function(a,c){return this.e.getPoint3f(a,c)},"~N,~B");l(c$,"intParameter",
function(a){return this.e.intParameter(a)},"~N");l(c$,"isFloatParameter",function(a){switch(this.e.tokAt(a)){case 2:case 3:return!0}return!1},"~N");l(c$,"setShapeProperty",function(a,c,d){this.e.setShapeProperty(a,c,d)},"~N,~S,~O");l(c$,"showString",function(a){this.e.showString(a)},"~S");l(c$,"stringParameter",function(a){return this.e.stringParameter(a)},"~N");l(c$,"getToken",function(a){return this.e.getToken(a)},"~N");l(c$,"tokAt",function(a){return this.e.tokAt(a)},"~N");l(c$,"setShapeId",function(a,
c,d){d&&this.invArg();c=this.e.setShapeNameParameter(c).toLowerCase();this.setShapeProperty(a,"thisID",c);return c},"~N,~N,~B");l(c$,"getColorTrans",function(a,c,d,b){d=3.4028235E38;1766856708!=a.theTok&&--c;switch(this.tokAt(c+1)){case 603979967:c++;d=this.isFloatParameter(c+1)?a.getTranslucentLevel(++c):this.vwr.getFloat(570425354);break;case 1073742074:c++,d=0}a.isColorParam(c+1)?b[0]=a.getArgbParam(++c):1048587==this.tokAt(c+1)?(b[0]=0,a.iToken=c+1):3.4028235E38==d?this.invArg():b[0]=-2147483648;
return d},"JS.ScriptEval,~N,~B,~A");l(c$,"finalizeObject",function(a,c,d,b,e,f,g,j){e&&this.setShapeProperty(a,"set",f);-2147483648!=c&&this.e.setShapePropertyBs(a,"color",Integer.$valueOf(c),j);3.4028235E38!=d&&this.e.setShapeTranslucency(a,"","translucent",d,j);0!=b&&this.setShapeProperty(a,"scale",Integer.$valueOf(b));0<g&&(this.e.setMeshDisplayProperty(a,g,0)||this.invArg())},"~N,~N,~N,~N,~B,~O,~N,JU.BS");N("JS");O(["JS.ScriptExt"],"JS.CmdExt","java.lang.Boolean $.Float $.Long java.util.Hashtable JU.AU $.BS $.Base64 $.Lst $.M3 $.M4 $.Measure $.P3 $.P4 $.PT $.Quat $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.c.STER $.VDW J.i18n.GT JM.Atom $.AtomCollection $.BondSet $.LabelToken JS.SV $.ScriptCompiler $.ScriptError $.ScriptEval $.ScriptInterruption $.ScriptMathProcessor $.ScriptParam $.T JU.BSUtil $.BoxInfo $.C $.Edge $.Elements $.Escape $.Logger $.Parser $.Point3fi JV.FileManager $.JC $.StateManager $.Viewer".split(" "),
function(){c$=V(JS,"CmdExt",JS.ScriptExt);T(c$,function(){W(this,JS.CmdExt,[])});X(c$,"dispatch",function(a,c,d){this.chk=this.e.chk;this.slen=this.e.slen;this.st=d;switch(a){case 4098:this.assign();break;case 135270423:this.cache();break;case 4102:this.calculate();break;case 4103:this.capture();break;case 4105:this.centerAt();break;case 135270405:this.compare();break;case 528395:this.console();break;case 4106:this.connect(1);break;case 1095766024:this.configuration();break;case 135270408:this.data();
break;case 1612189718:this.connect(0);break;case 4120:this.image();break;case 4124:this.macro();break;case 1052701:this.mapProperty();break;case 4126:this.minimize();break;case 1276121113:this.modulation();break;case 4130:this.mutate();break;case 4131:this.navigate();break;case 4133:case 135270418:case 1052714:this.plot(d);break;case 135270926:this.show();break;case 528443:this.stereo();break;case 1614417948:this.unitcell(c?2:1);break;case 135270422:return this.write(c?d:null);case 6:this.measure();
break;case 21:this.polyhedra();break;case 20:this.ellipsoid();break;case 4:this.struts()}return null},"~N,~B,~A");l(c$,"macro",function(){var a=this.e.optParameterAsString(1);if(0!=a.length&&!this.chk){var c=JV.JC.getMacro(a);null==c?this.showString("macro "+a+" could not be found. Current macros include:\n"+JV.JC.getMacroList()):(this.showString("running "+c),this.e.cmdScript(4124,c,null))}});l(c$,"evalParallel",function(a,c){this.chk=this.e.chk;this.slen=this.e.slen;var d=(new JS.ScriptEval).setViewer(this.vwr);
d.historyDisabled=!0;d.compiler=new JS.ScriptCompiler(this.vwr);d.sm=c;try{d.restoreScriptContext(a,!0,!1,!1),d.allowJSThreads=!1,d.dispatchCommands(!1,!1,!1)}catch(b){if(L(b,Exception))return this.e.vwr.setStringProperty("_errormessage",""+b),null==d.thisContext&&(JU.Logger.error("Error evaluating context "+b),this.vwr.isJS||b.printStackTrace()),!1;throw b;}return!0},"JS.ScriptContext,JV.ShapeManager");l(c$,"getBitsetIdent",function(a,c,d,b,e,f){var g=!I(d,JM.BondSet);g&&(null==c?c=this.vwr.getStandardLabelFormat(0):
0==c.length&&(c="%[label]"));var j=null==c?-1:c.indexOf("%"),h=2147483647!=e;if(null==a||this.chk||g&&0>j)return null==c&&(c=""),f?z(-1,[c]):c;var j=this.vwr.ms,y=0,m=j.getLabeler();d=g||!b?null:d.associatedAtoms;null==d&&(null!=c&&0<c.indexOf("%D"))&&(d=this.vwr.ms.getAtomIndices(a));b=null==c||0==c.length;var n=g||b?null:JM.LabelToken.getBondLabelValues();c=b?null:g?m.compile(this.vwr,c,"\x00",null):m.compile(this.vwr,c,"\u0001",n);var k=h?1:JU.BSUtil.cardinalityOf(a),p=Array(k),l=new JU.P3;for(e=
h?e:a.nextSetBit(0);0<=e;e=a.nextSetBit(e+1)){var v;g?v=b?j.at[e].getInfo():m.formatLabelAtomArray(this.vwr,j.at[e],c,"\x00",d,l):(v=j.bo[e],v=b?v.getIdentity():m.formatLabelBond(this.vwr,v,c,n,d,l));v=JU.PT.formatStringI(v,"#",y+1);p[y++]=v;if(h)break}return 1==k&&!f?p[0]:p},"JU.BS,~S,~O,~B,~N,~B");l(c$,"getLoadSymmetryParams",function(a,c,d){var b=this.e;this.chk=b.chk;this.slen=b.slen;var e=null,f=this.tokAt(a);if(1048586==f||8==f)e=this.getPoint3f(a,!1),a=b.iToken+1,f=this.tokAt(a);switch(f){case 1073741938:case 1073742080:case 1095761926:case 1073742163:case 1073742114:case 1073742152:case 1614417948:null==
e&&(e=JU.P3.new3(555,555,-1)),b.iToken=a-1}f=null;if(null!=e){d.put("lattice",e);a=b.iToken+1;c.append(" {"+K(e.x)+" "+K(e.y)+" "+K(e.z)+"}");a=this.checkPacked(a,d,c);1095761926==this.tokAt(a)&&(d.put("centroid",Boolean.TRUE),c.append(" CENTROID"),a=this.checkPacked(++a,d,c));if(1073742163==this.tokAt(a)){var g;c.append(" SUPERCELL ");if(b.isPoint3f(++a)){g=this.getPoint3f(a,!1);if(g.x!=K(g.x)||g.y!=K(g.y)||g.z!=K(g.z)||1>g.x||1>g.y||1>g.z)b.iToken=a,this.invArg();a=b.iToken}else g=this.stringParameter(a);
c.append(JU.Escape.e(g));d.put("supercell",g);a=this.checkPacked(++a,d,c)}g=0;1073742114==this.tokAt(a)&&(a++,g=this.floatParameter(a++),c.append(" range "+g));d.put("symmetryRange",Float.$valueOf(g));g=null;g=-2147483648;1073742152==this.tokAt(a)&&(++a,g=JU.PT.rep(this.paramAsStr(a++),"''",'"'),c.append(" spacegroup "+JU.PT.esc(g)),g.equalsIgnoreCase("ignoreOperators")?g=-999:(0==g.length?(e=this.vwr.getCurrentUnitCell(),null!=e&&(g=e.getSpaceGroupName())):0<=g.indexOf(",")&&9>e.x&&(9>e.y&&0==e.z)&&
(g+="#doNormalize=0"),d.put("spaceGroupName",g),g=-2));var j=null;if(1614417948==this.tokAt(a)){++a;0==b.optParameterAsString(a).length?(e=this.vwr.getCurrentUnitCell(),null!=e&&(j=e.getUnitCellAsArray(!0),f=e.getCartesianOffset())):j=b.floatParameterSet(a,6,9);(null==j||6!=j.length&&9!=j.length)&&this.invArg();c.append(" unitcell {");for(a=0;a<j.length;a++)c.append((0==a?"":" ")+j[a]);c.append("}");d.put("unitcell",j);-2147483648==g&&(g=-1);a=b.iToken+1}-2147483648!=g&&d.put("spaceGroupIndex",Integer.$valueOf(g))}null!=
f?b.coordinatesAreFractional=!1:1073742066==this.tokAt(a)&&(f=this.getPoint3f(++a,!0));null!=f&&(b.coordinatesAreFractional?(f.setT(b.fractionalPoint),d.put("unitCellOffsetFractional",b.coordinatesAreFractional?Boolean.TRUE:Boolean.FALSE),c.append(" offset {"+f.x+" "+f.y+" "+f.z+"/1}")):c.append(" offset "+JU.Escape.eP(f)),d.put("unitCellOffset",f),a=b.iToken+1);return a},"~N,JU.SB,java.util.Map");l(c$,"checkPacked",function(a,c,d){switch(this.tokAt(a)){case 1073741938:c.put("packed",Boolean.TRUE);
var b=null,e=this.tokAt(++a);switch(e){case 1614417948:case 1679429641:break;default:this.e.isArrayParameter(a)?(b=this.e.getPointArray(a,-1,!1),a=this.e.iToken):this.isFloatParameter(a)?(b=this.floatParameter(a),b=z(-1,[new JU.P3,JU.P3.new3(b,b,b)])):(b=[],--a)}a++;if(this.e.chk)break;switch(e){case 1614417948:if(b=this.vwr.getCurrentUnitCell(),null!=b){b=JU.BoxInfo.getUnitCellPoints(b.getUnitCellVerticesNoOffset(),b.getCartesianOffset());break}case 1679429641:b=JU.BoxInfo.getUnitCellPoints(this.vwr.ms.getBBoxVertices(),
null)}switch(b.length){case 2:e=b[1];b=z(-1,[b[0],JU.P3.newP(b[0]),new JU.P3,new JU.P3]);b[1].x=e.x;b[2].y=e.y;b[3].z=e.z;break;case 3:b=z(-1,[new JU.P3,b[0],b[1],b[2]]);break;case 4:break;default:b=z(-1,[new JU.P3,JU.P3.new3(10,0,0),JU.P3.new3(0,10,0),JU.P3.new3(0,0,10)])}c.put("fillRange",b);d.append(" FILL ["+b[0]+b[1]+b[2]+b[3]+"]");break;case 1073742080:b=NaN,this.isFloatParameter(++a)&&(b=this.floatParameter(a++)),this.e.chk||(c.put("packed",Boolean.TRUE),d.append(" PACKED"),Float.isNaN(b)||
(c.put("packingError",Float.$valueOf(b)),d.append(" "+b)))}return a},"~N,java.util.Map,JU.SB");l(c$,"cache",function(){var a=this.tokAt(1),c=null,d=2;switch(a){case 1276118017:case 1073742119:c=this.e.optParameterAsString(d++);case 1073741882:this.checkLength(d);this.chk||("all".equals(c)&&(c=null),c=this.vwr.cacheFileByName(c,1276118017==a),this.showString(0>c?"cache cleared":c+" bytes "+(1276118017==a?" cached":" removed")));break;default:this.invArg()}});l(c$,"calculate",function(){var a=!1,c=
!1,d=null,b=null,e=this.e,f=-2147483648;if(2<=(e.iToken=e.slen))switch(e.clearDefinedVariableAtomSets(),this.getToken(1).tok){case 1073741824:this.checkLength(2);break;case 1632634891:this.checkLength(2);if(this.chk)return;f=this.vwr.calculateFormalCharges(null);this.showString(J.i18n.GT.i(J.i18n.GT._("{0} charges modified"),f));return;case 1076887572:this.checkLength(2);this.chk||this.vwr.ms.assignAromaticBondsBs(!0,null);return;case 1612189718:2!=e.slen&&(d=(c=1641025539==this.tokAt(++e.iToken))?
this.vwr.bsA():this.atomExpressionAt(e.iToken),!c&&1641025539!=this.tokAt(++e.iToken)&&(b=this.atomExpressionAt(e.iToken)));if(this.chk)return;f=this.vwr.autoHbond(d,b,!1);-2147483648!=f&&e.report(J.i18n.GT.i(J.i18n.GT._("{0} hydrogen bonds"),Math.abs(f)));return;case 1613758476:d=2==this.slen?null:this.atomExpressionAt(2);e.checkLast(e.iToken);this.chk||this.vwr.addHydrogens(d,!1,!1);return;case 1112541195:e.iToken=1;d=2==this.slen?null:this.atomExpressionAt(2);e.checkLast(e.iToken);if(!this.chk)try{this.vwr.calculatePartialCharges(d)}catch(g){if(L(g,
JV.JmolAsyncException))e.loadFileResourceAsync(g.getFileName());else throw g;}return;case 1089470478:case 1073742102:this.chk||(1276252167==e.tokAt(2)?this.setShapeProperty(21,"symmetry",null):this.showString(this.vwr.ms.calculatePointGroup(this.vwr.bsA())));return;case 1112539150:this.checkLength(2);this.chk||(this.vwr.calculateStraightness(),this.vwr.addStateScript("set quaternionFrame '"+this.vwr.getQuaternionFrame()+"'; calculate straightness",!1,!0));return;case 1641025539:d=4>this.slen?null:
this.atomExpressionAt(2);switch(this.tokAt(++e.iToken)){case 1052714:break;case 1073741916:if(this.chk)return;e.showString(this.vwr.getAnnotationParser().calculateDSSRStructure(this.vwr,d));return;case 1073741915:c=!0;break;case 0:c=this.vwr.getBoolean(603979826);break;default:this.invArg()}this.chk||this.showString(this.vwr.calculateStructures(d,c,!0));return;case 1708058:d=e.iToken+1<this.slen?this.atomExpressionAt(++e.iToken):null;b=e.iToken+1<this.slen?this.atomExpressionAt(++e.iToken):null;this.checkLength(++e.iToken);
this.chk||(f=this.vwr.calculateStruts(d,b),0<f&&(this.setShapeProperty(1,"type",Integer.$valueOf(32768)),e.setShapePropertyBs(1,"color",Integer.$valueOf(16777215),null),e.setShapeTranslucency(1,"","translucent",0.5,null),this.setShapeProperty(1,"type",Integer.$valueOf(1023))),this.showString(J.i18n.GT.i(J.i18n.GT._("{0} struts added"),f)));return;case 3145756:a=!0;case 1112539151:c=!1;switch(this.tokAt(2)){case 135266325:e.iToken++;break;case 0:c=!a;break;case 1073741952:c=!0;e.iToken++;break;default:c=
!0}d=e.iToken+1<this.slen?this.atomExpressionAt(++e.iToken):this.vwr.bsA();this.checkLength(++e.iToken);this.chk||this.vwr.calculateSurface(d,c?3.4028235E38:-1);return}e.errorStr2(53,"CALCULATE","aromatic? hbonds? hydrogen? formalCharge? partialCharge? pointgroup? straightness? structure? struts? surfaceDistance FROM? surfaceDistance WITHIN?")});l(c$,"capture",function(){if(!this.chk&&!this.vwr.allowCapture())this.showString("Cannot capture on this platform");else{var a=this.vwr.captureParams,c=null==
a?"GIF":a.get("type"),d=0,b=0,e=this.e.slen,f="",g=1073742070!=this.vwr.am.animationReplayMode,j=1,h=this.tokAt(j),y=603979967==h;y&&(h=this.tokAt(++j));switch(0==h?h=1150985:h){case 4:f=this.e.optParameterAsString(j++);if(0==f.length){b=1150985;break}c=f.toLowerCase();c.endsWith(".gift")||c.endsWith(".pngt")?(y=!0,f=f.substring(0,f.length-1),c=f.toLowerCase()):!c.endsWith(".gif")&&!c.contains(".png")&&(f+=".gif");c.endsWith(".png")?(c.endsWith("0.png")||(f=f.substring(0,f.length-4)+"0000.png"),c=
"PNG"):c="GIF";y&&(c+="T");a=f.indexOf("0000.");h=0>a||a!=f.lastIndexOf(".")-4;a=!1;528411==this.tokAt(j)&&(g=!0,this.tokAt(++j));switch(this.tokAt(j)){case 1073742129:a=!0;case 1611141175:d=null;g="y";j++;a?(j<e&&2!=this.tokAt(j)&&(g=this.e.optParameterAsString(j++).toLowerCase()),d=JU.PT.rep("rotate Y 10 10;rotate Y -10 -10;rotate Y -10 -10;rotate Y 10 10","10",""+(j<e?this.intParameter(j++):5))):(j<e&&(g=this.e.optParameterAsString(j++).toLowerCase()),d="rotate Y 360 30;");if(this.chk)return;this.vwr.setNavigationMode(!1);
if(""===g||0>"xyz".indexOf(g))g="y";e=this.vwr.g.waitForMoveTo;d="set waitformoveto true;"+JU.PT.rep(d,"Y",g)+";set waitformoveto "+e;d="capture "+(y?"transparent ":"")+JU.PT.esc(f)+" LOOP;"+d+";capture end;";this.e.cmdScript(0,null,d);return;case 3:case 2:d=this.floatParameter(j++)}if(this.chk)return;b=1073742032;a=new java.util.Hashtable;y=this.vwr.getInt(553648132);h&&(a.put("streaming",Boolean.TRUE),g||this.showString(J.i18n.GT.o(J.i18n.GT._("Note: Enable looping using {0}"),z(-1,["ANIMATION MODE LOOP"]))),
this.showString(J.i18n.GT.o(J.i18n.GT._("Animation delay based on: {0}"),z(-1,["ANIMATION FPS "+y]))));a.put("captureFps",Integer.$valueOf(y));break;case 1150985:case 1073741874:null!=a&&a.put("captureSilent",Boolean.TRUE);case 1048589:case 1048588:this.checkLength(-2);b=h;break;default:this.invArg()}this.chk||null==a||(a.put("type",c),y=Integer.$valueOf(this.vwr.getBackgroundArgb()),a.put("backgroundColor",y),a.put("fileName",f),a.put("quality",Integer.$valueOf(-1)),a.put("endTime",Long.$valueOf(0>=
d?-1:System.currentTimeMillis()+S(1E3*d))),a.put("captureMode",JS.T.nameOf(b).toLowerCase()),a.put("captureLooping",g?Boolean.TRUE:Boolean.FALSE),f=this.vwr.processWriteOrCapture(a),null==f&&(f="canceled"),JU.Logger.info(f))}});l(c$,"centerAt",function(){var a=this.getToken(1).tok;switch(a){case 1073741826:case 96:case 1679429641:break;default:this.invArg()}var c=JU.P3.new3(0,0,0);5==this.slen?(c.x=this.floatParameter(2),c.y=this.floatParameter(3),c.z=this.floatParameter(4)):this.e.isCenterParameter(2)?
(c=this.centerParameter(2),this.e.checkLast(this.e.iToken)):this.checkLength(2);!this.chk&&!this.vwr.isJmolDataFrame()&&this.vwr.tm.setCenterAt(a,c)});l(c$,"compare",function(){var a=this.e,c=!1,d=!1,b=!1,e=!1,f=!1,g=null,j=null,h=null,y=null,m=null,n=null;a.iToken=0;var k=this.isFloatParameter(1)?this.floatParameter(++a.iToken):NaN,p=this.atomExpressionAt(++a.iToken),l=null,v=null;a.isArrayParameter(++a.iToken)?l=a.getPointArray(a.iToken,-1,!1):1141899265!=this.tokAt(a.iToken)&&(v=this.atomExpressionAt(a.iToken));
var s=null,u=!1,B=null,x=JU.BSUtil.copy(p);null!=v&&x.or(v);for(var x=e=null==l&&null!=v&&x.equals(p),r=a.iToken+1;r<this.slen;++r)switch(this.getToken(r).tok){case 4115:x=!0;break;case 135267336:if(u=!0,4!=this.tokAt(r+1)){B="*";break}case 135267335:B=this.stringParameter(++r);break;case 1678770178:d=f=!0;B=this.paramAsStr(++r);B.equalsIgnoreCase("SMILES")&&(u=!0,B="*");break;case 3:case 2:k=Math.abs(this.floatParameter(r));break;case 269484080:break;case 3158024:s=this.atomExpressionAt(++r);r=a.iToken;
break;case 10:case 1048577:null!=n&&this.invArg();var h=this.atomExpressionAt(a.iToken),E=e?0:this.tokAt(a.iToken+1),y=null==l&&a.isArrayParameter(a.iToken+1)?null:10==E||1048577==E?this.atomExpressionAt(++a.iToken):JU.BSUtil.copy(h);null!=s&&(h.and(s),null!=y&&y.and(s));null==y?l=a.getPointArray(++a.iToken,-1,!1):y.and(v);null==m&&(m=new JU.Lst);m.addLast(z(-1,[h,y]));r=a.iToken;break;case 7:null!=m&&this.invArg();c=!0;g=a.getQuaternionArray(a.theToken.getList(),1073742001);this.getToken(++r);j=
a.getQuaternionArray(a.theToken.getList(),1073742001);null==n&&(n=new JU.Lst);n.addLast(z(-1,[g,j]));break;case 1073742077:c=!0;break;case 135266320:case 1141899265:c=!1;break;case 528432:d=!0;break;case 4160:b=!0;break;default:this.invArg()}if(!this.chk){x&&(k=0);Float.isNaN(k)||0>k?k=1:!d&&!b&&(d=b=!0);e=0!=k;(E=!c&&null==B||null!=l)&&J.api.Interface.getInterface("JU.Eigen",this.vwr,"script");null==m&&null==n&&(null==s?(h=E?this.vwr.getAtomBitSet("spine"):new JU.BS,0>h.nextSetBit(0)?(h=p,y=v):(y=
JU.BSUtil.copy(h),h.and(p),y.and(v))):(h=JU.BSUtil.copy(p),y=JU.BSUtil.copy(v),h.and(s),y.and(s),h.and(p),y.and(v)),m=new JU.Lst,m.addLast(z(-1,[h,y])));if(x){p=this.vwr.ms.getModelBS(p,!1);s=Array(p.cardinality());r=0;for(y=p.nextSetBit(0);0<=y;y=p.nextSetBit(y+1),r++)s[r]=this.vwr.getModelUndeletedAtomsBitSet(y)}else s=z(-1,[p]);for(y=0;y<s.length;y++){for(var p=s[y],w=M(2,0),t=null,q=new JU.Lst,D=null,C=x?new JU.Lst:m,r=0;r<m.size();++r){var H=m.get(r);x&&C.addLast(H=z(-1,[JU.BSUtil.copy(H[0]),
H[1]]));H[0].and(p)}var G=null,F=null;if(E){null!=l&&(C.clear(),C.addLast(z(-1,[h,l])));try{D=this.vwr.getCenterAndPoints(C,!0)}catch(K){if(L(K,Exception))this.invArg();else throw K;}t=D[0].length-1;for(r=1;r<=t;r++){q=D[0][r];H=D[1][r];if(!I(q,JM.Atom)||!I(H,JM.Atom))break;JU.Logger.info(" atom 1 "+q.getInfo()+"\tatom 2 "+H.getInfo())}t=JU.Measure.calculateQuaternionRotation(D,w);r=Float.isNaN(w[1])?NaN:Math.round(100*w[0])/100;w=Float.isNaN(w[1])?NaN:Math.round(100*w[1])/100;this.showString("RMSD "+
r+" --\x3e "+w+" Angstroms")}else if(c){if(null==n)for(r=0;r<C.size();r++){H=C.get(r);g=this.vwr.getAtomGroupQuaternions(H[0],2147483647);j=this.vwr.getAtomGroupQuaternions(H[1],2147483647);for(t=0;t<g.length&&t<j.length;t++)q.addLast(j[t].div(g[t]))}else for(t=0;t<g.length&&t<j.length;t++)q.addLast(j[t].div(g[t]));w[0]=0;g=q.toArray(Array(q.size()));t=JU.Quat.sphereMean(g,w,1E-4);this.showString("RMSD = "+w[0]+" degrees")}else{r=new JU.M4;G=new JU.P3;if(("*".equals(B)||"".equals(B))&&null!=p)try{B=
this.vwr.getSmiles(p)}catch(P){if(L(P,Exception))a.evalError(P.getMessage(),null);else throw P;}if(f){var N;if(null==p||null==v||null==(N=a.getSmilesExt().getFlexFitList(p,v,B,!u)))break;this.vwr.setDihedrals(N,null,1)}w=a.getSmilesExt().getSmilesCorrelation(p,v,B,null,null,r,null,!1,null,G,!1,u?65536:131072);if(Float.isNaN(w)){this.showString("structures do not match");break}b&&(F=new JU.V3,r.getTranslation(F));d&&(t=new JU.M3,r.getRotationScale(t),t=JU.Quat.newM(t));this.showString("RMSD = "+w+
" Angstroms")}null!=D&&(G=D[0][0]);null==G&&(D=this.vwr.getCenterAndPoints(C,!0),G=D[0][0]);C=new JU.P3;w=NaN;b&&(null==F&&(F=JU.V3.newVsub(D[1][0],G)),w=1E10);d&&(null==t&&a.evalError("option not implemented",null),C.add2(G,t.getNormal()),w=t.getTheta(),0==w&&b&&(0.01<F.length()?w=1E10:d=b=e=!1));if(!Float.isNaN(w)&&!Float.isNaN(C.x)&&(D=null,d&&(b&&0!=k)&&(D=this.vwr.ms.getAtomPointVector(p),r=JS.ScriptMathProcessor.getMatrix4f(t.getMatrix(),F),D=JU.Measure.transformPoints(D,r,G)),a.useThreads()||
(e=!1),this.vwr.rotateAboutPointsInternal(a,G,C,w/k,w,e,p,F,D,null,null)&&e&&a.isJS))throw new JS.ScriptInterruption(a,"compare",1);}}});l(c$,"configuration",function(){var a=null,c=this.vwr.bsA();if(1==this.slen){if(this.chk)return;a=this.vwr.ms.setConformation(c);this.vwr.ms.addStateScript("select",null,c,null,"configuration",!0,!1)}else if(this.isFloatParameter(1)){c=this.intParameter(this.e.checkLast(1));if(this.chk)return;a=this.vwr.ms.getConformation(this.vwr.am.cmi,c-1,!0,null);this.vwr.addStateScript("configuration "+
c+";",!0,!1)}else a=this.atomExpressionAt(1),c=this.intParameter(this.e.checkLast(this.e.iToken+1)),this.vwr.addStateScript("configuration "+a+" "+c+";",!0,!1),a=this.vwr.ms.getConformation(this.vwr.am.cmi,c-1,!0,a);this.setShapeProperty(1,"type",Integer.$valueOf(30720));this.e.setShapeSizeBs(1,0,a);this.vwr.autoHbond(a,a,!0);this.vwr.select(a,!1,0,this.e.tQuiet)});l(c$,"measure",function(){var a=this.e,c=null,d=0,b=null;if(2==this.slen)switch(this.tokAt(1)){case 1048588:this.setShapeProperty(6,"hideAll",
Boolean.TRUE);return;case 12291:this.chk||this.vwr.clearAllMeasurements();return}this.vwr.shm.loadShape(6);switch(this.tokAt(1)){case 135267335:var e=this.stringParameter(3==this.slen?2:4);if(this.chk)return;var f=this.vwr.ms.at,c=this.vwr.ms.ac,d=null;try{d=this.vwr.getSmilesMatcher().getCorrelationMaps(e,f,c,this.vwr.bsA(),131072)}catch(g){if(L(g,Exception))a.evalError(g.getMessage(),null);else throw g;}if(null==d)return;this.setShapeProperty(6,"maps",d);return}switch(this.slen){case 2:switch(this.getToken(1).tok){case 0:case 1048589:this.vwr.shm.loadShape(6);
this.setShapeProperty(6,"hideAll",Boolean.FALSE);return;case 1073742001:this.chk||a.showStringPrint(this.vwr.getMeasurementInfoAsString(),!1);return;case 4:this.setShapeProperty(6,"setFormats",this.stringParameter(1));return}a.errorStr(24,"ON, OFF, DELETE");break;case 3:switch(this.getToken(1).tok){case 12291:if(1048579==this.getToken(2).tok)this.chk||this.vwr.clearAllMeasurements();else{var j=this.intParameter(2)-1;this.chk||this.vwr.deleteMeasurement(j)}return}}for(var h=0,y=0,m=-1,n=-1,k=-1,p=
F(5,0),l=M(-1,[3.4028235E38,3.4028235E38]),v=!1,s=!1,u=!1,B=!0,x=null,r=null,e=269484114,z=f=null,w=new JU.Lst,t=new JU.BS,q=null,D=null,C=0,H=0,j=1;j<this.slen;++j)switch(this.getToken(j).tok){case 1074790550:1!=j&&this.invArg();c=a.optParameterAsString(++j);continue;case 1073741824:a.errorStr(24,"ALL, ALLCONNECTED, DELETE");break;default:this.error(15);break;case 269484144:135266310!=this.tokAt(j+1)&&this.invArg();j++;u=!0;break;case 135266310:case 1073741834:case 1048579:s=1073741834==a.theTok;
n=-1;v=!0;s&&u&&this.invArg();break;case 1766856708:d=JU.C.getColix(a.getArgbParam(++j));j=a.iToken;break;case 1073742066:a.isPoint3f(++j)?(b=this.getPoint3f(j,!1),b=M(-1,[1,b.x,b.y,b.z,0,0,0])):b=a.floatParameterSet(j,7,7);j=a.iToken;break;case 1666189314:case 1073741917:H=K((1666189314==a.theTok?2E3:1E3)*this.floatParameter(++j));null!=c&&0>=H&&(H=-1);break;case 3:null!=x&&this.invArg();B=v=!0;k=(k+1)%2;l[k]=this.floatParameter(j);break;case 12291:269484114!=e&&this.invArg();e=12291;break;case 4114:var G=
this.floatParameter(++j),N=this.paramAsStr(++j),O=this.paramAsStr(++j);this.chk||(z=this.vwr.getFont3D(N,O,G));break;case 2:G=this.intParameter(j);if(v)B=!0,k=(k+1)%2,l[k]=G;else{n=this.vwr.ms.getFirstAtomIndexFromAtomNumber(G,this.vwr.getVisibleFramesBitSet());if(!this.chk&&0>n)return;null!=q&&this.invArg();4<(p[0]=++h)&&a.bad();p[h]=n}break;case 1095761935:m=this.intParameter(++j);break;case 1048588:269484114!=e&&this.invArg();e=1048588;break;case 1048589:269484114!=e&&this.invArg();e=1048589;break;
case 1073742114:B=v=!0;n=-1;break;case 1073741989:case 1073741990:r=Boolean.$valueOf(1073741989==a.theTok);v=!0;u=1073741990==a.theTok;break;case 1649412120:0<=k&&this.invArg();x=a.encodeRadiusParameter(j,!1,!0);if(null==x)return;x.values=l;j=a.iToken;v=u=!0;r=Boolean.$valueOf(!1);1==C&&(C++,h++,G=JU.BSUtil.copy(t),JU.BSUtil.invertInPlace(G,this.vwr.ms.ac),G.and(this.vwr.ms.getAtomsWithinRadius(5,t,!1,null)),w.addLast(G));break;case 10:case 1048577:case 1048586:case 8:case 1048582:(10==a.theTok||
1048577==a.theTok)&&C++;0<=n&&this.invArg();a.expressionResult=Boolean.FALSE;q=this.centerParameter(j);if(I(a.expressionResult,JU.BS)&&(q=t=a.expressionResult,!this.chk&&0==t.length()))return;I(q,JU.P3)&&(h=new JU.Point3fi,h.setT(q),h.mi=m,q=h);4<(h=++y)&&a.bad();j=a.iToken;w.addLast(q);break;case 4:f=this.stringParameter(j);break;case 1073742164:D=a.tickParamAsStr(j,!1,!0,!0),j=a.iToken,e=1060866}(null!=x&&(0<=k||2!=h)||2>h&&null==c&&(null==D||1==h))&&a.bad();null!=f&&0!=f.indexOf(h+":")&&(f=h+":"+
f);B&&l[1]<l[0]&&(l[1]=l[0],l[0]=3.4028235E38==l[1]?3.4028235E38:-200);if(!this.chk)if(null!=q||null!=D)null==x&&(x=new J.atomdata.RadiusData(l,0,null,null)),null==q&&(D.id="default"),null!=q&&(null!=f&&269484114==e)&&(e=1060866),a=null,null!=z&&(a=J.api.Interface.getInterface("JM.Text",this.vwr,"script").newLabel(this.vwr,z,"",d,0,0,0,null)),null!=a&&(a.pymolOffset=b),this.setShapeProperty(6,"measure",this.vwr.newMeasurementData(c,w).set(e,null,x,f,null,D,s,u,r,v,H,d,a));else switch(a=null==c?p:
c,e){case 12291:this.setShapeProperty(6,"delete",a);break;case 1048589:this.setShapeProperty(6,"show",a);break;case 1048588:this.setShapeProperty(6,"hide",a);break;default:this.setShapeProperty(6,null==f?"toggle":"toggleOn",a),null!=f&&this.setShapeProperty(6,"setFormats",f)}});l(c$,"connect",function(a){var c=this.e,d=M(2,0),b=Array(2);b[0]=b[1]=this.vwr.bsA();var e=NaN,f=F(-1,[-2147483648]),g=0,j=131071,h=1073742026,l=!1,m=!1,n=!1,k=3.4028235E38,p=!1,A=0,v=0,s=new JU.BS,u=!1,B=0,x=0,r=0,E=!1;if(1==
this.slen)this.chk||this.vwr.rebondState(c.$isStateScript);else{for(;a<this.slen;++a){switch(this.getToken(a).tok){case 1048589:case 1048588:this.checkLength(2);this.chk||this.vwr.rebondState(c.$isStateScript);return;case 2:case 3:if(0<A){(m||p)&&c.error(23);j=JU.Edge.getBondOrderFromFloat(this.floatParameter(a));131071==j&&this.invArg();m=!0;break}2<++v&&c.bad();var w=this.floatParameter(a);269484210==this.tokAt(a+1)&&(w=-w/100,a++);d[g++]=w;break;case 10:case 1048577:(2<A||u&&0<A)&&c.bad();(m||
p)&&this.invArg();b[A++]=this.atomExpressionAt(a);u=c.isBondSet;if(2==A){for(var w=c.iToken,t=a;t<w;t++)if(1073741824==this.tokAt(t)&&this.paramAsStr(t).equals("_1")){B=a;break}c.iToken=w}a=c.iToken;break;case 1087373318:E=!0;break;case 1766856708:case 603979967:case 1073742074:p=!0;k=this.getColorTrans(c,a,!1,f);a=c.iToken;break;case 1074790662:f=1073741852==this.tokAt(2);this.checkLength(f?3:2);if(this.chk)return;this.vwr.clearModelDependentObjects();this.vwr.ms.deleteAllBonds();e=new JU.BS;this.vwr.ms.setPdbConectBonding(0,
0,e);if(f){c=c.$isStateScript&&this.vwr.getBoolean(603979873);this.vwr.ms.autoBondBs4(null,null,e,null,this.vwr.getMadBond(),c);this.vwr.addStateScript(c?"set legacyAutoBonding TRUE;connect PDB AUTO;set legacyAutoBonding FALSE;":"connect PDB auto;",!1,!0);return}this.vwr.addStateScript("connect PDB;",!1,!0);return;case 1073741830:case 1073741852:case 1073741904:case 1073742025:case 1073742026:n=!0;++a!=this.slen&&this.invArg();h=c.theTok;1073741852==h&&!(131071==j||2048==j||515==j)&&this.invArg();
break;case 1708058:p||(f[0]=16777215,k=0.5,e=this.vwr.getFloat(570425406),p=!0),n||(h=1073742026),n=!0;case 1073741824:if(c.isColorParam(a)){x=-a;break}case 1076887572:case 1612189718:j=this.paramAsStr(a);131071==(j=JS.ScriptParam.getBondOrderFromString(j))&&this.invArg();m&&c.error(18);m=!0;switch(j){case 33:switch(this.tokAt(a+1)){case 3:j=JS.ScriptParam.getPartialBondOrderFromFloatEncodedInt(this.st[++a].intValue);break;case 2:j=this.intParameter(++a)}break;case 2048:2==this.tokAt(a+1)&&(j=this.intParameter(++a)<<
11,r=this.floatParameter(++a))}break;case 1666189314:e=this.floatParameter(++a);p=!0;break;case 1048587:case 12291:++a!=this.slen&&this.invArg();h=12291;l=!0;p=!1;break;default:x=a}0<a&&(x==-a||x==a&&c.isColorParam(a)?(p=!0,f[0]=c.getArgbParam(a),a=c.iToken):x==a&&this.invArg())}if(!this.chk){2>g&&(0==g&&(d[0]=1E8),d[1]=d[0],d[0]=0.1);p&&(m||(j=65535),n||(h=1073742025));m=g=0;if(0<B){r=new JU.BS;this.vwr.definedAtomSets.put("_1",r);E=b[0];for(n=E.nextSetBit(0);0<=n;n=E.nextSetBit(n+1))r.set(n),b=
this.vwr.makeConnections(d[0],d[1],j,h,r,this.atomExpressionAt(B),s,u,!1,0),g+=Math.abs(b[0]),m+=b[1],r.clear(n)}else b=this.vwr.makeConnections(d[0],d[1],j,h,b[0],b[1],s,u,E,r),g+=Math.abs(b[0]),m+=b[1];d=c.doReport();l?d&&c.report(J.i18n.GT.i(J.i18n.GT._("{0} connections deleted"),m)):(p&&(this.vwr.selectBonds(s),Float.isNaN(e)||c.setShapeSizeBs(1,Math.round(2E3*e),null),this.finalizeObject(1,f[0],k,0,!1,null,0,s),this.vwr.selectBonds(null)),d&&c.report(J.i18n.GT.o(J.i18n.GT._("{0} new bonds; {1} modified"),
z(-1,[Integer.$valueOf(g),Integer.$valueOf(m)]))))}}},"~N");l(c$,"console",function(){switch(this.getToken(1).tok){case 1048588:this.chk||this.vwr.showConsole(!1);break;case 1048589:this.chk||this.vwr.showConsole(!0);break;case 1073741882:this.chk||this.vwr.sm.clearConsole();break;case 135270422:this.showString(this.stringParameter(2));break;default:this.invArg()}});l(c$,"data",function(){var a=this.e,c=null,d=null,b=!1,e;switch(a.iToken=this.slen){case 5:c=this.paramAsStr(2);case 4:case 2:d=this.paramAsStr(1);
if(d.equalsIgnoreCase("clear")){this.chk||this.vwr.setData(null,null,0,0,0,0,0);return}if(0<=(e=d.indexOf("@")))c=""+a.getParameter(d.substring(e+1),4,!0),d=d.substring(0,e).trim();else if(null==c&&0<=(e=d.indexOf(" ")))c=d.substring(e+1).trim(),d=d.substring(0,e).trim(),b=!0;break;default:a.bad()}e=d+" ";e=e.substring(0,e.indexOf(" ")).toLowerCase();if(e.equals("model")||e.equals("append"))a.cmdLoad();else if(!this.chk){var f=0<=d.toLowerCase().indexOf("(default)");if(e.equals("connect_atoms"))this.vwr.ms.connect(this.parseDataArray(c,
!1));else if(0==e.indexOf("ligand_"))this.vwr.setLigandModel(d.substring(7).toUpperCase()+"_data",c.trim());else if(0==e.indexOf("file_"))this.vwr.setLigandModel(d.substring(5)+"_file",c.trim());else if(a=Array(4),e.equals("element_vdw")){a[0]=e;a[1]=c.$replace(";","\n");c=JU.Elements.elementNumberMax;e=F(c+1,0);for(f=1;f<=c;f++)e[f]=f;a[2]=e;a[3]=Integer.$valueOf(0);this.vwr.setData("element_vdw",a,c,0,0,0,0)}else if(0==e.indexOf("data2d_"))a[0]=d,a[1]=this.parseDataArray(c,!1),a[3]=Integer.$valueOf(2),
this.vwr.setData(d,a,0,0,0,0,0);else if(0==e.indexOf("data3d_"))a[0]=d,a[1]=this.parseDataArray(c,!0),a[3]=Integer.$valueOf(3),this.vwr.setData(d,a,0,0,0,0,0);else{var g=JU.PT.getTokens(d);if(0==e.indexOf("property_")&&!(2==g.length&&g[1].equals("set"))){f=this.vwr.bsA();a[0]=e;var j=b?0:this.vwr.getP("propertyAtomNumberField").intValue(),h=b?0:this.vwr.getP("propertyAtomNumberColumnCount").intValue(),l=b?-2147483648:this.vwr.getP("propertyDataField").intValue(),m=b?0:this.vwr.getP("propertyDataColumnCount").intValue();
!b&&0<=d.indexOf(" ")&&(3==g.length&&(j=JU.PT.parseInt(g[1]),l=JU.PT.parseInt(g[2])),5==g.length&&(j=JU.PT.parseInt(g[1]),h=JU.PT.parseInt(g[2]),l=JU.PT.parseInt(g[3]),m=JU.PT.parseInt(g[4])));0>j&&(j=0);0>l&&(l=0);d=this.vwr.ms.ac;b=null;g=JU.BS.newN(d);if(0<j){for(var b=F(d+2,0),n=0;n<=d;n++)b[n]=-1;for(n=f.nextSetBit(0);0<=n;n=f.nextSetBit(n+1)){var k=this.vwr.ms.at[n].getAtomNumber();k>d+1||(0>k||g.get(k))||(g.set(k),b[k]=n)}a[2]=b}else a[2]=JU.BSUtil.copy(f);a[1]=c;a[3]=Integer.$valueOf(0);this.vwr.setData(e,
a,d,j,h,l,m)}else"occupany".equals(e)&&(e="occupancy"),j=JM.AtomCollection.getUserSettableType(e),0<=j?this.vwr.setAtomData(j,e,c,f):(a[0]=d,a[1]=c,a[3]=Integer.$valueOf(0),this.vwr.setData(e,a,0,0,0,0,0))}}});l(c$,"ellipsoid",function(){var a=this.e,c=0,d=1,b=3.4028235E38,e=!1,f=!1;this.setShapeProperty(20,"thisID",null);switch(this.getToken(1).tok){case 1048589:c=2147483647;break;case 1048588:break;case 2:c=this.intParameter(1);break;case 1085443:this.e.sm.loadShape(20);this.setShapeProperty(20,
"select",this.paramAsStr(2));d=a.iToken;f=e=!0;break;case 1074790550:case 269484209:case 1073741824:this.e.sm.loadShape(20);1074790550==a.theTok&&d++;this.setShapeId(20,d,!1);d=a.iToken;e=!0;break;default:this.invArg()}if(e){for(c=F(-1,[-2147483648]);++d<this.slen;){var e=this.paramAsStr(d),g=null;this.getToken(d);if(!f)switch(a.theTok){case 1048582:e="points";g=Array(3);g[0]=a.objectNameParameter(++d);if(this.chk)continue;a.getShapePropertyData(24,"getVertices",g);break;case 1611272194:for(var g=
Array(3),j=0;3>j;j++)g[j]=new JU.V3,g[j].setT(this.centerParameter(++d)),d=a.iToken;break;case 12289:g=this.centerParameter(++d);d=a.iToken;break;case 1095761935:g=Integer.$valueOf(this.intParameter(++d));break;case 12291:g=Boolean.TRUE,this.checkLength(d+1)}if(null==g)switch(a.theTok){case 1048589:e="on";g=Boolean.TRUE;break;case 1048588:e="on";g=Boolean.FALSE;break;case 1073742138:g=Float.$valueOf(this.floatParameter(++d));break;case 10:case 1048577:e="atoms";g=this.atomExpressionAt(d);d=a.iToken;
break;case 1766856708:case 603979967:case 1073742074:b=this.getColorTrans(a,d,!0,c);d=a.iToken;continue;case 1073742075:g=this.paramAsStr(++d)}null==g&&this.invArg();this.setShapeProperty(20,e.toLowerCase(),g)}this.finalizeObject(20,c[0],b,0,!1,null,0,null);this.setShapeProperty(20,"thisID",null)}else a.setShapeSizeBs(20,c,null)});l(c$,"image",function(){this.chk||this.vwr.getConsole();var a=1,c=null;1074790550==this.tokAt(1)&&(c=this.e.optParameterAsString(++a),a++);var d=this.e.optParameterAsString(a),
b=this.e.optParameterAsString(this.slen-1).equalsIgnoreCase("close");if(!b&&(this.slen==a||this.slen==a+2))d=this.slen==a+2?this.intParameter(a++):-1,a=0>d?-1:this.intParameter(a),b=new java.util.Hashtable,b.put("fileName","\u0001\u0001"+c),b.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb())),b.put("type","png"),b.put("quality",Integer.$valueOf(-1)),b.put("width",Integer.$valueOf(d)),b.put("height",Integer.$valueOf(a)),this.chk||this.vwr.processWriteOrCapture(b);else{if(b)switch(this.slen){case 2:d=
"closeall";break;case 3:case 4:break;default:this.checkLength(0)}this.chk||this.vwr.fm.loadImage(b?"\u0001close":d,"\u0001"+d+"\u0001"+("".equals(c)||null==c?null:c),!1)}});l(c$,"mapProperty",function(){for(var a,c,d,b,e,f=0,g=0,j=0,h=this.e;;){if(1114638363==this.tokAt(1))a=this.vwr.bsA(),c=this.atomExpressionAt(2),d=b="selected";else{a=this.atomExpressionAt(1);if(1048583!=this.tokAt(++h.iToken)||!JS.T.tokAttr(f=this.tokAt(++h.iToken),1078984704))break;d=this.paramAsStr(h.iToken);c=this.atomExpressionAt(++h.iToken);
if(1048583!=this.tokAt(++h.iToken)||!JS.T.tokAttr(g=this.tokAt(++h.iToken),2048))break;b=this.paramAsStr(h.iToken)}e=JS.T.tokAttr(j=this.tokAt(h.iToken+1),1078984704)?this.paramAsStr(++h.iToken):JS.T.nameOf(j=1095763969);h.checkLast(h.iToken);if(this.chk)return;var l=null;this.showString("mapping "+d.toUpperCase()+" for "+a.cardinality()+" atoms to "+b.toUpperCase()+" for "+c.cardinality()+" atoms using "+e.toUpperCase());if(JS.T.tokAttrOr(f,1095761920,1112539136)&&JS.T.tokAttrOr(g,1095761920,1112539136)&&
JS.T.tokAttrOr(j,1095761920,1112539136)){var m=h.getBitsetPropertyFloat(a,f|224,NaN,NaN),n=h.getBitsetPropertyFloat(a,j|224,NaN,NaN),f=h.getBitsetPropertyFloat(c,j|224,NaN,NaN),k=1716520985==g,p=M(k?this.vwr.ms.ac:f.length,0),l=new JU.BS;if(m.length==n.length){for(var A=new java.util.Hashtable,j=0;j<m.length;j++)A.put(Float.$valueOf(n[j]),Float.$valueOf(m[j]));m=-1;for(j=n=0;j<f.length;j++){var m=c.nextSetBit(m+1),v=A.get(Float.$valueOf(f[j]));null!=v&&(l.set(m),p[k?m:n]=v.floatValue(),n++)}k?this.vwr.setData(b,
z(-1,[b,p,l,Integer.$valueOf(1),Boolean.TRUE]),this.vwr.ms.ac,0,0,2147483647,0):this.vwr.setAtomProperty(l,g,0,0,null,p,null)}}if(null==l){d=this.getBitsetIdent(a,"{"+e+"=%["+e+"]}."+b+" = %["+d+"]",null,!1,2147483647,!1);a=new JU.SB;for(j=0;j<d.length;j++)0>d[j].indexOf("null")&&a.append(d[j]).appendC("\n");JU.Logger.debugging&&JU.Logger.debug(a.toString());d=JU.BSUtil.copy(this.vwr.slm.bsSubset);this.vwr.slm.setSelectionSubset(c);try{h.runScript(a.toString())}catch(s){if(L(s,Exception))c=s,this.vwr.slm.setSelectionSubset(d),
h.errorStr(-1,"Error: "+c.getMessage());else if(L(s,Error))c=s,this.vwr.slm.setSelectionSubset(d),h.errorStr(-1,"Error: "+c.toString());else throw s;}this.vwr.slm.setSelectionSubset(d)}this.showString("DONE");return}this.invArg()});l(c$,"minimize",function(){for(var a=null,c=2147483647,d=0,b=!1,e=!1,f=null,g=!1,j=this.vwr.getMinimizer(!1),h=1;h<this.slen;h++)switch(this.getToken(h).tok){case 1073741828:b=!0;continue;case 1073741874:case 1073742162:this.checkLength(2);if(this.chk||null==j)return;j.setProperty(this.paramAsStr(h),
null);return;case 1073741882:this.checkLength(2);if(this.chk||null==j)return;j.setProperty("clear",null);return;case 1073741894:1!=h&&this.invArg();c=a=0;d=F(5,0);if(1073741882==this.tokAt(++h))this.checkLength(3);else{for(;4>a&&!this.isFloatParameter(h);)d[++a]=this.atomExpressionAt(h).nextSetBit(0),h=this.e.iToken+1;d[0]=a;1==a&&this.invArg();c=this.floatParameter(this.e.checkLast(h))}this.chk||this.vwr.getMinimizer(!0).setProperty("constraint",z(-1,[d,F(a,0),Float.$valueOf(c)]));return;case 1073741905:d=
this.floatParameter(++h);continue;case 1073741934:c=0;continue;case 1060869:1!=h&&this.invArg();f=this.atomExpressionAt(++h);0>f.nextSetBit(0)&&(f=null);h=this.e.iToken;this.chk||this.vwr.getMinimizer(!0).setProperty("fixed",f);if(h+1==this.slen)return;continue;case 10:case 1048577:g=!0;case 135280133:135280133==this.e.theTok&&h++;a=this.atomExpressionAt(h);h=this.e.iToken;1073742072==this.tokAt(h+1)&&(h++,g=!0);continue;case 1073742148:e=!0;break;case 266298:c=this.intParameter(++h);continue;default:this.invArg()}if(!this.chk)try{this.vwr.minimize(this.e,
c,d,a,f,0,b,g,e,!1)}catch(l){if(L(l,Exception))throw new JS.ScriptInterruption(this.e,"minimize",1);throw l;}});l(c$,"modulation",function(){var a=null,c=this.e,d=!0,b=!1,e=null,f=1;switch(this.getToken(f).tok){case 1048588:d=!1;case 0:case 1048589:break;case 10:case 1048577:e=this.atomExpressionAt(1);switch(this.tokAt(c.iToken+1)){case 1048588:d=!1;case 1048589:c.iToken++}c.checkLast(c.iToken);break;case 1048586:case 8:a=c.getPoint3f(1,!1);b=1048589==this.tokAt(c.iToken+1);break;case 1073741824:var g=
c.theToken.value.toString();f++;g.equalsIgnoreCase("t")?c.theTok=3:g.equalsIgnoreCase("m")||g.equalsIgnoreCase("q")?c.theTok=2:this.invArg();case 3:case 2:switch(c.theTok){case 3:this.isFloatParameter(f)?(a=this.floatParameter(f),a=JU.P3.new3(a,a,a)):a=c.getPoint3f(f,!1);break;case 2:2==this.tokAt(f)?(b=this.intParameter(f),a=JU.P3.new3(b,b,b)):a=c.getPoint3f(f,!1),b=!0}break;case 1073742138:d=this.floatParameter(2);this.chk||this.vwr.setFloatProperty("modulationScale",d);return;default:this.invArg()}this.chk||
(this.vwr.tm.setVibrationPeriod(0),this.vwr.setModulation(e,d,a,b))});l(c$,"mutate",function(){var a,c;switch(this.tokAt(1)){case 2:this.st[1]=JS.T.o(4,""+this.st[1].value);default:a=this.atomExpressionAt(1);c=++this.e.iToken;break;case 269484209:a=this.vwr.getAllAtoms(),c=2}a.and(this.vwr.getModelUndeletedAtomsBitSet(this.vwr.ms.mc-1));var d=a.length()-1;if(!(0>d||this.vwr.ms.at[d].mi+1!=this.vwr.ms.mc||this.vwr.ms.isTrajectory(this.vwr.ms.at[d].mi)))if(d=this.e.optParameterAsString(c),this.e.checkLast(c),
!this.chk&&this.vwr.ms.am[this.vwr.ms.mc-1].isBioModel){var b=null;if(4==this.tokAt(c)&&!d.startsWith("~"))b=z(-1,[d]),d=null;else{d=JU.PT.replaceAllCharacters(d,",; \t\n"," ").trim().toUpperCase();if((c=d.startsWith("~"))||3!=d.length||!this.vwr.getJBR().isKnownPDBGroup(d,20))d=this.vwr.getJBR().toStdAmino3(c?d.substring(1):d);b=JU.PT.getTokens(d)}0<b.length&&this.vwr.ms.bioModelset.mutate(a,d,b)}});l(c$,"navigate",function(){var a=this.e;if(1==this.slen)a.setBooleanProperty("navigationMode",!0);
else{var c=JU.V3.new3(0,1,0),d=new JU.Lst,b;if(2==this.slen)switch(this.getToken(1).tok){case 1048589:case 1048588:if(this.chk)return;a.setObjectMad(34,"axes",1);this.setShapeProperty(34,"position",JU.P3.new3(50,50,3.4028235E38));a.setBooleanProperty("navigationMode",!0);this.vwr.tm.setNavOn(1048589==a.theTok);return;case 1073742162:this.chk||this.vwr.tm.setNavXYZ(0,0,0);return;case 8:case 1113200654:break;default:this.invArg()}!this.chk&&!this.vwr.getBoolean(603979888)&&a.setBooleanProperty("navigationMode",
!0);for(var e=1;e<this.slen;e++){var f=this.isFloatParameter(e)?this.floatParameter(e++):2;0>f&&this.invArg();!this.chk&&0<f&&a.refresh(!1);switch(this.getToken(e).tok){case 8:case 1048586:b=this.getPoint3f(e,!0);a.iToken++;a.iToken!=this.slen&&this.invArg();this.chk||this.vwr.tm.setNavXYZ(b.x,b.y,b.z);return;case 554176526:b=this.floatParameter(++e);this.chk||d.addLast(z(-1,[Integer.$valueOf(554176526),Float.$valueOf(f),Float.$valueOf(b)]));continue;case 12289:b=this.centerParameter(++e);e=a.iToken;
this.chk||d.addLast(z(-1,[Integer.$valueOf(135266320),Float.$valueOf(f),b]));continue;case 528432:switch(this.getToken(++e).tok){case 1112541205:c.set(1,0,0);e++;break;case 1112541206:c.set(0,1,0);e++;break;case 1112541207:c.set(0,0,1);e++;break;case 8:case 1048586:c.setT(this.getPoint3f(e,!0));e=a.iToken+1;break;case 1073741824:this.invArg()}b=this.floatParameter(e);this.chk||d.addLast(z(-1,[Integer.$valueOf(528432),Float.$valueOf(f),c,Float.$valueOf(b)]));continue;case 4160:var g=b=NaN;if(this.isFloatParameter(++e))b=
this.floatParameter(e),g=this.floatParameter(++e);else switch(this.tokAt(e)){case 1112541205:b=this.floatParameter(++e);break;case 1112541206:g=this.floatParameter(++e);break;default:b=this.centerParameter(e);e=a.iToken;this.chk||d.addLast(z(-1,[Integer.$valueOf(4160),Float.$valueOf(f),b]));continue}this.chk||d.addLast(z(-1,[Integer.$valueOf(269484210),Float.$valueOf(f),Float.$valueOf(b),Float.$valueOf(g)]));continue;case 269484208:continue;case 1113200654:b=new JU.Lst;10==this.tokAt(e+1)||1048577==
this.tokAt(e+1)?(g=this.atomExpressionAt(++e),e=a.iToken):g=this.vwr.bsA();if(this.chk)return;this.vwr.getPolymerPointsAndVectors(g,b);var j;if(0<(j=b.size())){for(var g=Array(j),h=0;h<j;h++)g[h]=b.get(h);d.addLast(z(-1,[Integer.$valueOf(1113200654),Float.$valueOf(f),g]));continue}break;case 1073742084:if(1048582==this.getToken(e+1).tok){e++;b=a.objectNameParameter(++e);if(this.chk)return;this.setShapeProperty(22,"thisID",b);b=this.getShapeProperty(22,"vertices");a.refresh(!1);null==b&&this.invArg();
g=K(this.isFloatParameter(e+1)?this.floatParameter(++e):0);j=K(this.isFloatParameter(e+1)?this.floatParameter(++e):2147483647);d.addLast(z(-1,[Integer.$valueOf(1073742084),Float.$valueOf(f),b,null,F(-1,[g,j])]));continue}for(b=new JU.Lst;a.isCenterParameter(e+1);)b.addLast(this.centerParameter(++e)),e=a.iToken;if(0<b.size()){b=b.toArray(Array(b.size()));this.chk||d.addLast(z(-1,[Integer.$valueOf(1073742084),Float.$valueOf(f),b,null,F(-1,[0,2147483647])]));continue}default:this.invArg()}}!this.chk&&
!this.vwr.isJmolDataFrame()&&this.vwr.tm.navigateList(a,d)}});l(c$,"plot",function(a){var c=this.e,d=this.vwr.am.cmi;0>d&&c.errorStr(30,"plot");var d=this.vwr.ms.getJmolDataSourceFrame(d),b=a.length-1,e=a!==this.st,f=!0,g=this.st;e&&(c.st=this.st=a);var j=e?135270926:a[0].tok,h=e||135270418==j||1052714==j?0:1,l=null,m=!0,n=!1;switch(j){case 135176:m=!1;n=!0;break;case 135270926:f=m=!1;break;case 135270422:m=!1,4==JS.CmdExt.tokAtArray(b,a)?l=this.stringParameter(b--):1048583==JS.CmdExt.tokAtArray(b-
1,a)?(l=this.paramAsStr(b-2)+"."+this.paramAsStr(b),b-=3):(c.st=this.st=g,c.iToken=this.st.length,this.error(13))}var e="",k=null,p="",A=!1,v=!1,s=!1,u=!1,B=0,x=0,r=0,E=JU.BSUtil.copy(this.vwr.bsA()),w="; select "+JU.Escape.eBS(E)+";\n ",u=c.optParameterAsString(b).toLowerCase(),t=null,q=null,D=null,C=JS.CmdExt.tokAtArray(h,a);4==C&&(C=JS.T.getTokFromName(a[h].value));switch(C){default:c.iToken=1;this.invArg();break;case 135270408:c.iToken=1;u="data";w="";break;case 1716520985:c.iToken=h+1;B=this.plotProp();
0==B&&this.invArg();x=this.plotProp();r=this.plotProp();1288701959==this.tokAt(c.iToken)&&(D=this.stringParameter(++c.iToken),f=!1,c.iToken++);32==this.tokAt(c.iToken)&&(t=this.getPoint3f(++c.iToken,!1),c.iToken++);64==this.tokAt(c.iToken)&&(q=this.getPoint3f(++c.iToken,!1),c.iToken++);u="property "+JS.T.nameOf(B)+(0==x?"":" "+JS.T.nameOf(x))+(0==r?"":" "+JS.T.nameOf(r));0>E.nextSetBit(0)&&(E=this.vwr.getModelUndeletedAtomsBitSet(d));p="select "+JU.Escape.eBS(E)+";\n ";break;case 1052714:u.equalsIgnoreCase("draw")&&
(u=c.optParameterAsString(--b).toLowerCase());u=b>h&&u.startsWith("r");u="ramachandran"+(u?" r":"")+(135176==j?" draw":"");break;case 135270418:case 137363467:e=' "'+this.vwr.getQuaternionFrame()+'"';p="set quaternionFrame"+e+";\n  ";A=!0;u.equalsIgnoreCase("draw")&&(n=!0,u=c.optParameterAsString(--b).toLowerCase());s=(v=u.startsWith("deriv")||u.startsWith("diff"))&&0<u.indexOf("2");v&&b--;if(u.equalsIgnoreCase("helix")||u.equalsIgnoreCase("axis"))v=n=!0,b=-1;u=((b<=h?"":c.optParameterAsString(b))+
"w").substring(0,1);if(u.equals("a")||u.equals("r"))v=!0;JU.PT.isOneOf(u,";w;x;y;z;r;a;")||c.evalError("QUATERNION [w,x,y,z,a,r] [difference][2]",null);u="quaternion "+u+(v?" difference":"")+(s?"2":"")+(n?" draw":"")}this.st=g;if(this.chk)return"";if(m&&(p+="plot "+u,a=this.vwr.ms.getJmolDataFrameIndex(d,p),0<a&&135270422!=j&&135270926!=j))return this.vwr.setCurrentModelIndexClear(a,!0),"";g=b=a=null;if(1716520985==C){a=c.getBitsetPropertyFloat(E,B|224,null==t?NaN:t.x,null==q?NaN:q.x);0!=x&&(b=c.getBitsetPropertyFloat(E,
x|224,null==t?NaN:t.y,null==q?NaN:q.y));0!=r&&(g=c.getBitsetPropertyFloat(E,r|224,null==t?NaN:t.z,null==q?NaN:q.z));null==t&&(t=JU.P3.new3(this.getPlotMinMax(a,!1,B),this.getPlotMinMax(b,!1,x),this.getPlotMinMax(g,!1,r)));null==q&&(q=JU.P3.new3(this.getPlotMinMax(a,!0,B),this.getPlotMinMax(b,!0,x),this.getPlotMinMax(g,!0,r)));JU.Logger.info("plot min/max: "+t+" "+q);h=k=null;if(f){h=JU.P3.new3(1,1,1);k=new JU.P3;k.ave(q,t);h.sub2(q,t);h.set(h.x/200,h.y/200,h.z/200);JS.T.tokAttr(B,1095761920)?(h.x=
1,k.x=0):0.1<h.x&&10>=h.x&&(h.x=1);JS.T.tokAttr(x,1095761920)?(h.y=1,k.y=0):0.1<h.y&&10>=h.y&&(h.y=1);JS.T.tokAttr(r,1095761920)?(h.z=1,k.z=0):0.1<h.z&&10>=h.z&&(h.z=1);if(0==r||0==x)k.z=t.z=q.z=h.z=0;for(f=0;f<a.length;f++)a[f]=(a[f]-k.x)/h.x;if(0!=x)for(f=0;f<b.length;f++)b[f]=(b[f]-k.y)/h.y;if(0!=r)for(f=0;f<g.length;f++)g[f]=(g[f]-k.z)/h.z}k=z(-1,[E,a,b,g,t,q,h,k,D])}if(135270422==j)return this.vwr.writeFileData(l,"PLOT_"+u,d,k);f=u.equals("data")?"1 0 H 0 0 0 # Jmol PDB-encoded data":this.vwr.getPdbData(d,
u,null,k,null,!0);if(135270926==j)return f;JU.Logger.debugging&&JU.Logger.debug(f);if(135176==j)return c.runScript(f),"";j=this.vwr.fm.getFileInfo();l=this.vwr.getBoolean(603979792);this.vwr.g.appendNew=!0;f=null!=f&&null==this.vwr.openStringInlineParamsAppend(f,null,!0);this.vwr.g.appendNew=l;this.vwr.fm.setFileInfo(j);if(!f)return"";j=this.vwr.ms.mc;this.vwr.ms.setJmolDataFrame(p,d,j-1);1716520985!=C&&(p+=";\n"+w);p=this.vwr.addStateScript(p,!0,!1);f=150;switch(C){default:d="frame 0.0; frame last; reset;select visible;wireframe only;";
f=10;break;case 1716520985:this.vwr.setFrameTitle(j-1,u+" plot for model "+this.vwr.getModelNumberDotted(d));d="frame 0.0; frame last; reset;select visible; spacefill 3; wireframe 0;draw plotAxisX"+j+' {100 -100 -100} {-100 -100 -100} "'+JS.T.nameOf(B)+'";draw plotAxisY'+j+' {-100 100 -100} {-100 -100 -100} "'+JS.T.nameOf(x)+'";';0!=r&&(d+="draw plotAxisZ"+j+' {-100 -100 100} {-100 -100 -100} "'+JS.T.nameOf(r)+'";');break;case 1052714:this.vwr.setFrameTitle(j-1,"ramachandran plot for model "+this.vwr.getModelNumberDotted(d));
d="frame 0.0; frame last; reset;select visible; color structure; spacefill 3.0; wireframe 0;draw ramaAxisX"+j+' {100 0 0} {-100 0 0} "phi";draw ramaAxisY'+j+' {0 100 0} {0 -100 0} "psi";';break;case 135270418:case 137363467:this.vwr.setFrameTitle(j-1,u.$replace("w"," ")+e+" for model "+this.vwr.getModelNumberDotted(d)),d=JU.C.getHexCode(this.vwr.cm.colixBackgroundContrast),d="frame 0.0; frame last; reset;select visible; wireframe 0; spacefill 3.0; isosurface quatSphere"+j+" color "+d+" sphere 100.0 mesh nofill frontonly translucent 0.8;draw quatAxis"+
j+'X {100 0 0} {-100 0 0} color red "x";draw quatAxis'+j+'Y {0 100 0} {0 -100 0} color green "y";draw quatAxis'+j+'Z {0 0 100} {0 0 -100} color blue "z";color structure;draw quatCenter'+j+"{0 0 0} scale 0.02;"}c.runScript(d+w);p.setModelIndex(this.vwr.am.cmi);this.vwr.setRotationRadius(f,!0);c.sm.loadShape(31);this.showString("frame "+this.vwr.getModelNumberDotted(j-1)+(0<u.length?" created: "+u+(A?e:""):""));return""},"~A");l(c$,"plotProp",function(){var a=0;switch(this.tokAt(this.e.iToken)){case 1288701959:case 32:case 64:break;
default:JS.T.tokAttr(a=this.tokAt(this.e.iToken),1078984704)&&this.e.iToken++}return a});l(c$,"polyhedra",function(){var a=this.e,c=!1,d=!1,b=!1,e=!1,f=!1,g=0,j=0;this.e.sm.loadShape(21);this.setShapeProperty(21,"init",Boolean.TRUE);for(var h="centers",l="radius_",m=3.4028235E38,n=F(-1,[-2147483648]),k=1;k<this.slen;++k){var p=null,A=null;switch(this.getToken(k).tok){case 6:p="info";A=this.e.theToken.value;c=!0;break;case 1614417948:p="unitCell";A=Boolean.TRUE;break;case 1073742072:this.e.restrictSelected(!1,
!1),a.theTok=1048589;case 1048589:case 12291:case 1048588:(k+1!=this.slen||c||1<j||0==j&&"to".equals(h))&&this.error(18);p=1048588==a.theTok?"off":1048589==a.theTok?"on":"delete";d=!0;break;case 269484436:case 269484080:continue;case 1678770178:0<j&&this.invPO();c=!0;p="bonds";break;case 1666189314:l="radius";continue;case 2:case 3:0<j&&!f&&this.invPO();if(2==a.theTok&&"radius_"===l){p="nVertices";A=Integer.$valueOf(this.intParameter(k));c=!0;break}p="radius_"===l?"radius":l;A=Float.$valueOf(this.floatParameter(k));
l="radius_";f=!1;c=!0;break;case 10:case 1048577:b&&this.invPO();2<++j&&a.bad();"to".equals(h)&&(c=!0);p=h;h="to";A=this.atomExpressionAt(k);k=a.iToken;break;case 1074790746:1<j&&this.invPO();if(10==this.tokAt(k+1)||1048577==this.tokAt(k+1)&&!c){p="toBitSet";A=this.atomExpressionAt(++k);k=a.iToken;c=!0;break}else if(a.isArrayParameter(k+1)){p="toVertices";A=a.getPointArray(k+1,-1,!1);k=a.iToken;c=!0;break}else c||this.error(19);h="to";continue;case 1073741937:case 1073742099:case 1073741924:0==j&&
this.error(19);l=JS.T.nameOf(a.theTok);f=!0;continue;case 1766856708:case 603979967:case 1073742074:m=this.getColorTrans(a,k,!0,n);k=a.iToken;continue;case 1073741886:case 1073741948:p="collapsed";A=1073741886==a.theTok?Boolean.TRUE:Boolean.FALSE;b&&this.error(18);b=!0;break;case 1073742182:case 1073742060:p="token";A=Integer.$valueOf(this.e.theTok);break;case 1073742044:case 1073741933:case 1073741956:e&&this.error(18);p=this.paramAsStr(k);e=!0;break;case 1073741964:g=a.theTok;continue;default:if(a.isColorParam(k)){n[0]=
a.getArgbParam(k);k=a.iToken;continue}this.invArg()}this.setShapeProperty(21,p,A);if(d)return!1}!c&&(!b&&!e&&0==g)&&this.error(19);c&&this.setShapeProperty(21,"generate",null);-2147483648!=n[0]&&this.setShapeProperty(21,"colorThis",Integer.$valueOf(n[0]));3.4028235E38!=m&&a.setShapeTranslucency(21,"","translucentThis",m,null);0!=g&&this.setShapeProperty(21,"token",Integer.$valueOf(g));this.setShapeProperty(21,"init",Boolean.FALSE);return!0});l(c$,"write",function(a){var c=this.e,d=1,b=1,e=null,f=
null,g=null,j=null,h="SPT",l=!0,m=!1;null==a?(a=this.st,m=this.vwr.isApplet&&!this.vwr.isSignedApplet||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL)||0<this.vwr.fm.getPathForAllFiles().length):(d=b=0,l=!1,m=!l);var n=JS.CmdExt.tokAtArray(d,a);if(4==n&&!l){var k=JS.T.getTokenFromName(JS.SV.sValue(a[0]).toLowerCase());null!=k&&(n=k.tok)}switch(n){case 0:break;case 135270418:case 1052714:case 1716520985:return f=this.plot(a),m?f:this.writeMsg(f);case 135271429:c.isArrayParameter(d+1)&&(e=c.stringParameterSet(++d),
j=g=".",b=d=c.iToken+1,n=this.tokAt(d));break;default:h=JS.SV.sValue(this.tokenAt(d,a)).toUpperCase()}var p=this.vwr.getExportDriverList(),k=null,A=l?this.slen:a.length,v="",s=null,u=null,B=0,x="PNGJ",r=!1,z=null,w=-1,t=-1,q=!1,f=null;0!=n&&(l&&1<this.slen&&1073741848==this.tokAt(this.slen-2))&&(h=this.paramAsStr(this.slen-1).toUpperCase(),b=A,A-=2,n=0);switch(n){case 15:case 6:h="VAR";u=this.tokenAt(d++,a);break;case 1073741983:h="INLINE";k=JS.SV.sValue(this.tokenAt(++d,a));d++;break;case 1073742102:h=
"PGRP";d++;v=JS.SV.sValue(this.tokenAt(d,a)).toLowerCase();v.equals("draw")&&d++;break;case 1048581:d++;r=!0;break;case 1073742158:case 135271429:for(s=JS.SV.sValue(this.tokenAt(++d,a)).toLowerCase();s.equals("localpath")||s.equals("remotepath");)s.equals("localpath")?g=JS.SV.sValue(this.tokenAt(++d,a)):j=JS.SV.sValue(this.tokenAt(++d,a)),s=JS.SV.sValue(this.tokenAt(++d,a)).toLowerCase();h="SPT";break;case 1229984263:case 135368713:case 1610616855:case 135180:case 1073742015:case 1073742018:case 1073877011:case 1073877010:case 135188:d++;
break;case 1073741991:h="ZIPALL";d++;break;case 36868:h="VAR";d+=2;break;case 4115:case 4120:case 1073742139:case 4166:case 1073741824:case 4:switch(n){case 4115:d+1<A&&1048577==a[++d].tok||10==a[d].tok?(s=c.atomExpression(a,d,0,!0,!1,!0,!0),d=c.iToken+1):s=this.vwr.getAllAtoms();this.chk||(z=this.vwr.ms.getModelBS(s,!0));break;case 4120:h="IMAGE";d++;break;case 1073742139:s=JS.SV.sValue(this.tokenAt(++d,a)).toUpperCase();JU.PT.isOneOf(s,";PNG;PNGJ;")&&(x=s,d++);break;case 4166:B=c.intParameterRange(++d,
1,10);if(2147483647==B)return"";this.chk||(this.vwr.tm.setVibrationPeriod(0),c.isJS||c.delayScript(100));d++;break;default:n=4120}if(4120==n&&d<a.length)if(n=JS.T.getTokenFromName(JS.SV.sValue(a[d]).toLowerCase()),null!=n&&(h=JS.SV.sValue(n).toUpperCase()),JU.PT.isOneOf(h,p.toUpperCase())){d++;h=h.substring(0,1).toUpperCase()+h.substring(1).toLowerCase();q=!0;l&&(f="Jmol."+h.toLowerCase());break}else if(JU.PT.isOneOf(h,";ZIP;ZIPALL;SPT;STATE;")){d++;break}else h="IMAGE";2==JS.CmdExt.tokAtArray(d,
a)&&(w=JS.SV.iValue(this.tokenAt(d++,a)),t=JS.SV.iValue(this.tokenAt(d++,a)))}n=-2147483648;if(b<A){s=JS.SV.sValue(this.tokenAt(d,a));if(s.equalsIgnoreCase("clipboard")){if(this.chk)return""}else JU.PT.isOneOf(s.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;")?(2==JS.CmdExt.tokAtArray(d+1,a)&&2==JS.CmdExt.tokAtArray(d+2,a)&&(w=JS.SV.iValue(this.tokenAt(++d,a)),t=JS.SV.iValue(this.tokenAt(++d,a))),2==JS.CmdExt.tokAtArray(d+1,a)&&(n=JS.SV.iValue(this.tokenAt(++d,a)))):JU.PT.isOneOf(s.toLowerCase(),
";xyz;xyzrn;xyzvib;mol;sdf;v2000;v3000;json;pdb;pqr;cml;")&&(h=s.toUpperCase(),d+1==A&&d++);h.equals("IMAGE")&&JU.PT.isOneOf(s.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;")&&(h=s.toUpperCase(),d++)}d+2==A&&(s=JS.SV.sValue(this.tokenAt(++d,a)),0<s.length&&"."!=s.charAt(0)&&(h=s.toUpperCase()));switch(JS.CmdExt.tokAtArray(d,a)){case 0:m=!0;break;case 1073741884:break;case 806354977:f=h.equals("IMAGE")?"?jmol.png":"?jmol."+h.toLowerCase();break;case 1073741824:case 4:f=
JS.SV.sValue(this.tokenAt(d,a));if(f.equalsIgnoreCase("clipboard")||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL))f=null;break;default:this.invArg()}if(h.equals("IMAGE")||h.equals("FRAME")||h.equals("VIBRATION"))h=null!=f&&0<=f.indexOf(".")?f.substring(f.lastIndexOf(".")+1).toUpperCase():"JPG";A=JU.PT.isOneOf(h.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;");if(!A&&(h.equals("MNU")?h="MENU":h.equals("WRL")||h.equals("VRML")?(h="Vrml",q=!0):h.equals("X3D")?(h="X3d",q=!0):
h.equals("IDTF")?(h="Idtf",q=!0):h.equals("MA")?(h="Maya",q=!0):h.equals("JS")?(h="Js",q=!0):h.equals("OBJ")?(h="Obj",q=!0):h.equals("JVXL")?h="ISOSURFACE":h.equals("XJVXL")?h="ISOSURFACE":h.equals("JMOL")?h="ZIPALL":h.equals("HIS")&&(h="HISTORY"),h.equals("COORD")||h.equals("COORDS")))h=null!=f&&0<=f.indexOf(".")?f.substring(f.lastIndexOf(".")+1).toUpperCase():"XYZ";null!=e&&(h.equals("PNG")&&(h="PNGJ"),!h.equals("PNGJ")&&(!h.equals("ZIPALL")&&!h.equals("ZIP"))&&this.invArg());!A&&(!q&&!JU.PT.isOneOf(h,
";SCENE;JMOL;ZIP;ZIPALL;SPT;HISTORY;MO;NBO;ISOSURFACE;MESH;PMESH;VAR;FILE;FUNCTION;CML;JSON;XYZ;XYZRN;XYZVIB;MENU;MOL;PDB;PGRP;PQR;QUAT;RAMA;SDF;V2000;V3000;INLINE;"))&&c.errorStr2(54,"COORDS|FILE|FUNCTIONS|HISTORY|IMAGE|INLINE|ISOSURFACE|JMOL|MENU|MO|NBO|POINTGROUP|QUATERNION [w,x,y,z] [derivative]|RAMACHANDRAN|SPT|STATE|VAR x|ZIP|ZIPALL  CLIPBOARD","CML|GIF|GIFT|JPG|JPG64|JMOL|JVXL|MESH|MOL|PDB|PMESH|PNG|PNGJ|PNGT|PPM|PQR|SDF|CD|JSON|V2000|V3000|SPT|XJVXL|XYZ|XYZRN|XYZVIB|ZIP"+p.toUpperCase().$replace(";",
"|"));if(this.chk)return"";d=Array(1);b=this.vwr.getBoolean(603979934);if(q){b&&JU.Logger.startTimer("export");e=new java.util.Hashtable;e.put("type",h);null!=f&&e.put("fileName",f);(l||null!=f)&&e.put("fullPath",d);e.put("width",Integer.$valueOf(w));e.put("height",Integer.$valueOf(t));k=this.vwr.generateOutputForExport(e);if(null==k||0==k.length)return"";if(m)return k;if(!h.equals("Povray")&&!h.equals("Idtf")||null==d[0])return this.writeMsg(k);e=h.equals("Idtf")?".tex":".ini";f=d[0]+e;m=new java.util.Hashtable;
m.put("fileName",f);m.put("type",e);m.put("text",k);m.put("fullPath",d);f=this.vwr.processWriteOrCapture(m);h.equals("Idtf")&&(k=k.substring(0,k.indexOf("\\begin{comment}")));k="Created "+d[0]+":\n\n"+k;b&&this.showString(JU.Logger.getTimerMsg("export",0));null!=f&&(f.startsWith("OK")||c.evalError(f,null),c.report(k));return""}q=null;p=!1;if(null==k){var D=0,k=h.intern();if("MENU"===k)k=this.vwr.getMenu("");else if("PGRP"===k)k=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),v.equals("draw"),null,
0,1);else if("PDB"===k||"PQR"===k)m?k=this.vwr.getPdbAtomData(null,null,"PQR"===k,r):(p=!0,h="PDB_"+k+"-coord "+r);else if("FILE"===k)"?".equals(f)&&(f="?Jmol."+this.vwr.getP("_fileType")),m?k=this.vwr.getCurrentFileAsString("script"):p=!0;else if("SDF"===k||"MOL"===k||"V2000"===k||"V3000"===k||"CD"===k||"JSON"===k||"XYZ"===k||"XYZRN"===k||"XYZVIB"===k||"CML"===k)k=this.vwr.getModelExtract("selected",r,!1,k),k.startsWith("ERROR:")&&(q=k);else if("FUNCTION"===k)k=this.vwr.getFunctionCalls(null),h=
"TXT";else if("VAR"===k){null==u&&(u=c.getParameter(JS.SV.sValue(this.tokenAt(l?2:1,a)),1073742190,!0));a=null;if(15==u.tok)a=new JU.Lst,a.addLast(u.value.data);else if(6==u.tok&&(g=u.value,g.containsKey("$_BINARY_$")&&(a=new JU.Lst,null!=f)))for(var C,g=g.entrySet().iterator();g.hasNext()&&((C=g.next())||1);)if(j=C.getKey(),!j.equals("$_BINARY_$"))if(v=C.getValue(),q=15==v.tok?v.value.data:null,null==q&&(s=v.asString(),q=s.startsWith(";base64,")?JU.Base64.decodeBase64(s):s.getBytes()),j.equals("_DATA_")){a=
null;null==q&&(q=v.value.data);break}else j.equals("_IMAGE_")?(a.add(0,j),a.add(1,null),a.add(2,q)):(a.addLast(j),a.addLast(null),a.addLast(q));null==a?null==q&&(k=u.asString(),h="TXT"):null!=f&&null==(q=k=this.vwr.createZip(f,1==a.size()?"BINARY":"ZIPDATA",a))&&c.evalError("#CANCELED#",null)}else if("SPT"===k)if(r)C=this.vwr.ms.getTaintedAtoms(2),this.vwr.setAtomCoordsRelative(JU.P3.new3(0,0,0),null),k=this.vwr.getStateInfo(),this.vwr.ms.setTaintedAtoms(C,2);else{if(k=this.vwr.getStateInfo(),null!=
g||null!=j)k=JV.FileManager.setScriptFileReferences(k,g,j,null)}else"ZIP"===k||"ZIPALL"===k?null!=f&&null==(q=k=this.vwr.createZip(f,h,e))&&c.evalError("#CANCELED#",null):"HISTORY"===k?(k=this.vwr.getSetHistory(2147483647),h="SPT"):"MO"===k||"NBO"===k?(k=this.getMoJvxl(2147483647,"NBO"===k),h="XJVXL"):"PMESH"===k?(null==(k=this.getIsosurfaceJvxl(!0,29))&&this.error(31),h="XJVXL"):"ISOSURFACE"===k||"MESH"===k?(null==(k=this.getIsosurfaceJvxl("MESH"===k,24))&&this.error(31),h=0<=k.indexOf("<?xml")?
"XJVXL":"JVXL",m||this.showString(this.getShapeProperty(24,"jvxlFileInfo"))):(l&&(m&&null==f)&&(m=!1,f="\u0001"),D=-1,0>n&&(n=-1));null==k&&(k="");0==D&&(null==q||I(q,String))}if(!l)return k;if(m)return c.showStringPrint(k,!0),"";if(null!=q&&I(q,String))return this.writeMsg(q);if(p)return this.writeMsg(this.vwr.writeFileData(f,h,0,null));if(h.equals("SCENE"))q=x;else if(null==q&&(!A||null!=f))q=k;b&&JU.Logger.startTimer("write");A&&(c.refresh(!1),0>w&&(w=this.vwr.getScreenWidth()),0>t&&(t=this.vwr.getScreenHeight()));
m=new java.util.Hashtable;null!=f&&m.put("fileName",f);m.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb()));m.put("type",h);I(q,String)&&-2147483648==n?m.put("text",q):I(q,Array)&&m.put("bytes",q);null!=e&&m.put("scripts",e);null!=z&&m.put("bsFrames",z);m.put("fullPath",d);m.put("quality",Integer.$valueOf(n));m.put("width",Integer.$valueOf(w));m.put("height",Integer.$valueOf(t));m.put("nVibes",Integer.$valueOf(B));f=this.vwr.processWriteOrCapture(m);null==f&&(f="canceled");A&&f.startsWith("OK")&&
(f+="; width="+w+"; height="+t);b&&this.showString(JU.Logger.getTimerMsg("write",0));return this.writeMsg(f)},"~A");l(c$,"writeMsg",function(a){if(this.chk||null==a)return"";a.startsWith("OK")||(this.e.evalError(a,null),alert(a));this.e.report(a);return a},"~S");l(c$,"show",function(){var a=this.e,c=null,d=this.paramAsStr(1),b=null,e=null,f=2,e=this.getToken(1),g=I(e,JS.SV)?0:e.tok;4==g&&(e=JS.T.getTokenFromName(d.toLowerCase()),null!=e&&(g=e.tok));1297090050!=g&&(1073742158!=g&&1716520985!=g)&&this.checkLength(-3);
if(2==this.slen&&0<=d.indexOf("?"))this.showString(this.vwr.getAllSettings(d.substring(0,d.indexOf("?"))));else{switch(g){case 0:this.chk||(b=a.theToken.escape());break;case 1073741925:a.checkLength23();f=this.st.length;this.chk||(b=this.vwr.ms.getInfo(this.vwr.am.cmi,"domains"),b=I(b,JS.SV)?this.vwr.getAnnotationInfo(b,a.optParameterAsString(2),1073741925):"domain information has not been loaded");break;case 1716520985:b=this.plot(this.st);f=this.st.length;break;case 1073742189:a.checkLength23();
f=this.st.length;this.chk||(b=this.vwr.ms.getInfo(this.vwr.am.cmi,"validation"),b=I(b,JS.SV)?this.vwr.getAnnotationInfo(b,a.optParameterAsString(2),1073742189):"validation information has not been loaded");break;case 135270423:this.chk||(b=JU.Escape.e(this.vwr.fm.cacheList()));break;case 1073741916:a.checkLength23();f=this.st.length;this.chk||(b=this.vwr.ms.getInfo(this.vwr.am.cmi,"dssr"),b=null==b?"no DSSR information has been read":2<f?JS.SV.getVariable(this.vwr.extractProperty(b,this.stringParameter(2),
-1)).asString():""+JS.SV.getVariable(b).asString());break;case 1073741915:this.checkLength(2);this.chk||(b=this.vwr.calculateStructures(null,!0,!1));break;case 545259571:this.checkLength(2);this.chk||(b=this.vwr.fm.getPathForAllFiles());break;case 1073742038:if(a.optParameterAsString(2).equalsIgnoreCase("1H")){f=3;this.chk||(b=this.vwr.getNMRPredict(!1));break}this.chk||this.vwr.getNMRPredict(!0);return;case 1073741929:case 1073741879:case 135267336:this.checkLength(1073741879==g?3:2);if(this.chk)return;
try{135267336!=g&&(b=this.vwr.getDataBaseName(null)),b=null!=b&&(b.startsWith("$")||b.startsWith(":"))?b.substring(1):null,null==b&&(b=this.vwr.getSmiles(null))}catch(j){if(L(j,Exception))b=j.getMessage();else throw j;}switch(g){case 1073741929:if(0<b.length){this.vwr.fm.loadImage(this.vwr.setLoadFormat("_"+b,"2",!1),"\u0001"+b,!1);return}b="Could not show drawing -- Either insufficient atoms are selected or the model is a PDB file.";break;case 1073741879:f=3,0<b.length?(b=this.vwr.getChemicalInfo(b,
this.getToken(2)),0<=b.indexOf("FileNotFound")&&(b="?")):b="Could not show name -- Either insufficient atoms are selected or the model is a PDB file."}break;case 1297090050:var g=0,h=e=null;3<this.slen&&4!=this.tokAt(3)?(e=this.centerParameter(2),h=this.centerParameter(++a.iToken)):g=2==this.tokAt(2)?this.intParameter(2):0;var l=4==this.tokAt(a.iToken+1)?this.stringParameter(++a.iToken):null;this.checkLength(f=++a.iToken);this.chk||(b=this.vwr.ms.getSymTemp(!0).getSymmetryInfoString(this.vwr.ms,this.vwr.am.cmi,
g,e,h,null,l));break;case 1649412120:a=null;2<this.slen&&(a=J.c.VDW.getVdwType(this.paramAsStr(2)),null==a&&this.invArg());this.chk||this.showString(this.vwr.getDefaultVdwNameOrData(0,a,null));return;case 135368713:a.checkLength23();this.chk||this.showString(this.vwr.getFunctionCalls(a.optParameterAsString(2)));return;case 1085443:this.checkLength(2);this.chk||this.showString(this.vwr.getAllSettings(null));return;case 1074790760:if(2==this.slen){this.chk||this.vwr.showUrl(a.getFullPathName());return}e=
this.paramAsStr(2);this.chk||this.vwr.showUrl(e);return;case 1766856708:d="defaultColorScheme";break;case 1610612740:d="scaleAngstromsPerInch";break;case 135270418:case 1052714:if(this.chk)return;0>this.vwr.am.cmi&&a.errorStr(30,"show "+a.theToken.value);b=this.plot(this.st);f=this.slen;break;case 14:case 1113200654:this.chk||(b=this.getContext(!1));break;case 1073741888:e=a.optParameterAsString(2);0<e.length&&(f=3);this.chk||(c=this.vwr.cm.getColorSchemeList(e));break;case 1073742192:this.chk||(b=
this.vwr.getAtomDefs(this.vwr.definedAtomSets)+this.vwr.g.getVariableList()+this.getContext(!0));break;case 536870926:this.chk||(b=this.vwr.getTrajectoryState());break;case 553648148:c=""+JS.ScriptEval.commandHistoryLevelMax;break;case 553648150:c=""+JU.Logger.getLogLevel();break;case 603979825:c=""+this.vwr.getBoolean(603979825);break;case 553648178:b="set strandCountForStrands "+this.vwr.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13);break;case 536875070:b=this.vwr.showTimeout(2==
(f=this.slen)?null:this.paramAsStr(2));break;case 536870918:c=JU.Escape.eP(this.vwr.getDefaultLattice());break;case 4126:this.chk||(b=this.vwr.getMinimizationInfo());break;case 1611272194:switch(this.vwr.g.axesMode){case 603979808:b="set axesUnitcell";break;case 603979804:b="set axesMolecular";break;default:b="set axesWindow"}break;case 1610612737:b="set bondMode "+(this.vwr.getBoolean(603979812)?"OR":"AND");break;case 1650071565:this.chk||(b="set strandCountForStrands "+this.vwr.getStrandCount(12)+
"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13));break;case 1612189718:b="set hbondsBackbone "+this.vwr.getBoolean(603979852)+";set hbondsSolid "+this.vwr.getBoolean(603979854);break;case 1611141175:this.chk||(b=this.vwr.getSpinState());break;case 1611141176:b="set ssbondsBackbone "+this.vwr.getBoolean(603979952);break;case 1610625028:case 1611141171:b="selectionHalos "+(this.vwr.getSelectionHalosEnabled()?"ON":"OFF");break;case 1613758470:b="set selectHetero "+this.vwr.getBoolean(1613758470);
break;case 1073741828:b=JU.Escape.eAP(this.vwr.getAdditionalHydrogens(null,!0,!0,null));break;case 1613758476:b="set selectHydrogens "+this.vwr.getBoolean(1613758476);break;case 553648130:case 553648142:case 536870924:case 553648176:case 553648172:case 1073741995:this.chk||(b=this.vwr.getLightingState());break;case 1073742136:case 4146:this.chk||(b=this.vwr.stm.listSavedStates());break;case 1614417948:this.chk||(b=this.vwr.getUnitCellInfoText());break;case 1048581:if(2==(f=this.slen)){this.chk||(b=
this.vwr.getCoordinateState(this.vwr.bsA()));break}g=this.paramAsStr(2);this.chk||(b=this.vwr.stm.getSavedCoordinates(g));break;case 1073742158:!this.chk&&null==a.outputBuffer&&this.vwr.sm.clearConsole();if(2==(f=this.slen)){this.chk||(b=this.vwr.getStateInfo());break}e=this.paramAsStr(2);if(e.startsWith("/")&&3==(f=this.slen)){if(!this.chk){e=e.substring(1).toLowerCase();g=JU.PT.split(this.vwr.getStateInfo(),"\n");b=new JU.SB;for(h=0;h<g.length;h++)0<=g[h].toLowerCase().indexOf(e)&&b.append(g[h]).appendC("\n");
b=b.toString()}break}else if(1229984263==this.tokAt(2)&&4==(f=this.slen)){this.chk||(b=this.vwr.fm.getEmbeddedFileState(this.paramAsStr(3),!0));break}f=3;this.chk||(b=this.vwr.stm.getSavedState(e));break;case 1641025539:if(2==(f=this.slen)){this.chk||(b=this.vwr.ms.getProteinStructureState(this.vwr.bsA(),135270926));break}g=this.paramAsStr(2);this.chk||(b=this.vwr.stm.getSavedStructure(g));break;case 135270408:g=3==(f=this.slen)?this.paramAsStr(2):null;this.chk||(b=this.vwr.getData(g),b=null==b?"no data":
JU.Escape.encapsulateData(b[0],b[1],b[3].intValue()));break;case 1073742152:g=null;2==(f=this.slen)?this.chk||(g=this.vwr.ms.getSymTemp(!0).getSpaceGroupInfo(this.vwr.ms,null)):(e=this.paramAsStr(2),this.chk||(g=this.vwr.ms.getSymTemp(!0).getSpaceGroupInfo(this.vwr.ms,JU.PT.rep(e,"''",'"'))));null!=g&&(b=""+g.get("spaceGroupInfo")+g.get("symmetryInfo"));break;case 1048582:f=3;b=a.setObjectProperty();break;case 1679429641:this.chk||(b=this.vwr.ms.getBoundBoxCommand(!0));break;case 12289:this.chk||
(b="center "+JU.Escape.eP(this.vwr.tm.fixedRotationCenter));break;case 135176:this.chk||(b=this.getShapeProperty(22,"command"));break;case 1229984263:this.chk||this.vwr.sm.clearConsole();if(2==this.slen){this.chk||(b=this.vwr.getCurrentFileAsString("script"));null==b&&(b="<unavailable>");break}f=3;c=this.paramAsStr(2);this.chk||(b=this.vwr.getFileAsString3(c,!0,null));break;case 4115:b=1048579==this.tokAt(2)&&0<(f=3)?this.vwr.getModelFileInfoAll():this.vwr.getModelFileInfo();break;case 1610616855:g=
2==(f=this.slen)?2147483647:this.intParameter(2);1>g&&this.invArg();this.chk||(this.vwr.sm.clearConsole(),0==a.scriptLevel&&this.vwr.removeCommand(),b=this.vwr.getSetHistory(g));break;case 135180:this.chk||(b=this.getShapeProperty(24,"jvxlDataXml"));break;case 1073877011:case 1073877010:a.optParameterAsString(2).equalsIgnoreCase("list")?(this.e.sm.loadShape(27),b=this.chk?"":this.getShapeProperty(27,"list -1"),f=3):(e=2==(f=this.slen)?-2147483648:this.intParameter(2),this.chk||(b=this.getMoJvxl(e,
1073877011==g)));break;case 1095766030:this.chk||(b=this.vwr.ms.getModelInfoAsString());break;case 537006096:this.chk||(b=this.vwr.getMeasurementInfoAsString());break;case 1073741863:f=3;!this.chk&&this.slen==f&&(b=this.vwr.getOrientationText(this.tokAt(2),null));break;case 1073742132:g=this.tokAt(2),0==g?g=1073742132:f=3;case 1073742178:case 4129:this.chk||(b=this.vwr.getOrientationText(g,null));break;case 1073742077:f=2;if(3<this.slen)break;switch(g=this.tokAt(2)){case 1073742178:case 1073742132:case 4129:case 0:this.chk||
(b=this.vwr.getOrientationText(g,null));break;default:e=a.optParameterAsString(2),b=this.vwr.getOrientationText(1073742035,e)}f=this.slen;break;case 1073742088:this.chk||(b=this.vwr.ms.getPDBHeader(this.vwr.am.cmi));break;case 1073742102:a=a.optParameterAsString(2);0==a.length&&(a=null);this.chk||this.showString(this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),!1,"show:"+a,0,0));return;case 1089470478:this.chk||(b=this.vwr.ms.getSymmetryInfoAsString());break;case 1073742176:this.chk||(b="transform:\n"+
this.vwr.tm.matrixRotate.toString());break;case 4168:b="zoom "+(this.vwr.tm.zoomEnabled?""+this.vwr.tm.getZoomSetting():"off");break;case 1611272202:b=this.vwr.getShowFrank()?"frank ON":"frank OFF";break;case 1666189314:d="solventProbeRadius";break;case 1087373320:if(3==(f=this.slen)&&1048588==this.tokAt(2))g=1087373319;case 1073741864:case 1087373316:case 1073742120:case 1114638363:case 1087373318:case 1141899265:case 1073741982:this.chk||(b=this.vwr.getChimeInfo(g));break;case 537022465:case 1610612738:case 20482:case 1613758488:c=
"?";break;case 1073742031:g=2==(f=this.slen)?null:this.paramAsStr(2);this.chk||(b=this.vwr.getBindingInfo(g));break;case 1073742015:this.chk||(c=this.vwr.getMenu(""));break;case 1073741824:d.equalsIgnoreCase("fileHeader")&&(this.chk||(b=this.vwr.ms.getPDBHeader(this.vwr.am.cmi)));break;case 1073741992:case 36868:d=this.paramAsStr(f++),e=a.getParameter(d,1073742190,!0),this.chk||(b=1073741992==g?e.toJSON():e.escape())}this.checkLength(f);this.chk||(null!=b?this.showString(b):null!=c?this.showString(d+
" = "+c):null!=d&&(0<=d.indexOf(" ")?this.showString(d):this.showString(d+" = "+a.getParameter(d,1073742190,!0).escape())))}});l(c$,"stereo",function(){for(var a=J.c.STER.DOUBLE,c=-5,d=!1,b=null,e=0,f=1;f<this.slen;++f)if(this.e.isColorParam(f))1<e&&this.e.bad(),0==e&&(b=F(2,0)),d||(c=3),b[e]=this.e.getArgbParam(f),0==e++&&(b[1]=~b[0]),f=this.e.iToken;else switch(this.getToken(f).tok){case 1048589:this.e.checkLast(this.e.iToken=1);this.e.iToken=1;break;case 1048588:this.e.checkLast(this.e.iToken=
1);a=J.c.STER.NONE;break;case 2:case 3:c=this.floatParameter(f);d=!0;break;case 1073741824:if(d||(c=3),a=J.c.STER.getStereoMode(this.paramAsStr(f)),null!=a)break;default:this.invArg()}this.chk||this.vwr.setStereoMode(b,a,c)});l(c$,"struts",function(){var a=this.e,c=1073742072==this.tokAt(1)||1048589==this.tokAt(1)||1==this.slen,d=a.getMadParameter();if(2147483647==d)return!1;c&&(d=Math.round(2E3*this.vwr.getFloat(570425406)));this.setShapeProperty(1,"type",Integer.$valueOf(32768));a.setShapeSizeBs(1,
d,null);this.setShapeProperty(1,"type",Integer.$valueOf(1023));return!0});l(c$,"unitcell",function(a){var c=this.e,d=2147483647,b=2147483647,e=null,f=c.tickParamAsStr(a,!0,!1,!1);a=c.iToken;var g=null,j=null,h=null,l=null,m=b=!1;switch(this.tokAt(++a)){case 4142:case 4141:m=!0;e=JU.P4.new4(0,0,0,-1);c.iToken++;break;case 4:case 1073741824:l=b=this.paramAsStr(a).toLowerCase();0>b.indexOf(",")&&!this.chk&&(c.setCurrentCagePts(null,null),JU.PT.isOneOf(b,";parent;standard;primitive;")&&(h=this.vwr.ms.getInfo(this.vwr.am.cmi,
"unitcell_conventional"),null!=h&&c.setCurrentCagePts(this.vwr.getV0abc(h),""+h)),b=this.vwr.ms.getInfo(this.vwr.am.cmi,"unitcell_"+b),this.showString(b));h=b;break;case 135180:case 1048582:g=c.objectNameParameter(++a);break;case 1679429641:j=JU.P3.newP(this.vwr.getBoundBoxCenter());e=this.vwr.getBoundBoxCornerVector();j.sub(e);j=z(-1,[j,JU.P3.new3(2*e.x,0,0),JU.P3.new3(0,2*e.y,0),JU.P3.new3(0,0,2*e.z)]);e=null;c.iToken=a;break;case 11:case 12:h=this.getToken(a).value;break;case 12289:switch(this.tokAt(++a)){case 10:case 1048577:e=
JU.P3.newP(this.vwr.ms.getAtomSetCenter(this.atomExpressionAt(a)));this.vwr.toFractional(e,!0);a=c.iToken;break;default:if(c.isCenterParameter(a)){e=this.centerParameter(a);a=c.iToken;break}this.invArg()}e.x-=0.5;e.y-=0.5;e.z-=0.5;break;case 10:case 1048577:a=this.atomExpressionAt(a).nextSetBit(0);this.chk||(this.vwr.am.cai=a);if(0>a)return;a=c.iToken;break;case 1073742066:b=!0;case 1073742114:e=c.getPointOrPlane(++a,!1,!0,!1,!0,3,3);e=JU.P4.new4(e.x,e.y,e.z,b?1:0);a=c.iToken;break;case 3:case 2:if(111>
this.floatParameter(a)){a--;break}d=this.intParameter(a);break;default:c.isArrayParameter(a)?(j=c.getPointArray(a,4,!1),a=c.iToken):this.slen>a+1?(e=c.getPointOrPlane(a,!1,!0,!1,!0,3,3),a=c.iToken):a--}b=c.getSetAxesTypeMad(++a);c.checkLast(c.iToken);this.chk||2147483647==b||(2147483647==b&&(this.vwr.am.cai=-1),null!=h&&(j=this.vwr.getV0abc(h)),2147483647!=d?this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),null,d):null!=g?this.vwr.setCurrentCage(g):(m||null!=j)&&c.setCurrentCagePts(j,l),
c.setObjectMad(33,"unitCell",b),null!=e&&this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),e,0),null!=f&&this.setShapeProperty(33,"tickInfo",f))},"~N");l(c$,"assign",function(){var a=this.tokAt(1),c=this.atomExpressionAt(2).nextSetBit(0),d=-1,b=null;if(!(0>c)){4106==a?d=this.atomExpressionAt(++this.e.iToken).nextSetBit(0):b=this.paramAsStr(++this.e.iToken);var e=++this.e.iToken<this.slen?this.centerParameter(this.e.iToken):null;if(!this.chk)switch(a){case 1141899265:this.e.clearDefinedVariableAtomSets();
this.assignAtom(c,e,b);break;case 1678770178:this.assignBond(c,(b+"p").charAt(0));break;case 4106:this.assignConnect(c,d)}}});l(c$,"assignAtom",function(a,c,d){d.equals("X")&&this.vwr.setRotateBondIndex(-1);if(this.vwr.ms.at[a].mi==this.vwr.ms.mc-1){this.vwr.clearModelDependentObjects();var b=this.vwr.ms.ac;if(null==c)this.vwr.sm.modifySend(a,this.vwr.ms.at[a].mi,1,this.e.fullCommand),this.vwr.ms.assignAtom(a,d,!0),JU.PT.isOneOf(d,";Mi;Pl;X;")||this.vwr.ms.setAtomNamesAndNumbers(a,-b,null),this.vwr.sm.modifySend(a,
this.vwr.ms.at[a].mi,-1,"OK"),this.vwr.refresh(3,"assignAtom");else{var e=this.vwr.ms.at[a],f=JU.BSUtil.newAndSetBit(a);c=z(-1,[c]);var g=new JU.Lst;g.addLast(e);e=e.mi;this.vwr.sm.modifySend(a,e,3,this.e.fullCommand);try{f=this.vwr.addHydrogensInline(f,g,c),a=f.nextSetBit(0),this.vwr.ms.assignAtom(a,d,!1)}catch(j){if(!L(j,Exception))throw j;}this.vwr.ms.setAtomNamesAndNumbers(a,-b,null);this.vwr.sm.modifySend(a,e,-3,"OK")}}},"~N,JU.P3,~S");l(c$,"assignBond",function(a,c){var d=-1;try{d=this.vwr.ms.bo[a].atom1.mi;
this.vwr.sm.modifySend(a,d,2,this.e.fullCommand);var b=this.vwr.ms.setBondOrder(a,c);null==b||"0"==c?this.vwr.refresh(3,"setBondOrder"):this.vwr.addHydrogens(b,!1,!0);this.vwr.sm.modifySend(a,d,-2,""+c)}catch(e){if(L(e,Exception))JU.Logger.error("assignBond failed"),this.vwr.sm.modifySend(a,d,-2,"ERROR "+e);else throw e;}},"~N,~S");l(c$,"assignConnect",function(a,c){this.vwr.clearModelDependentObjects();var d=JU.AU.newFloat2(1);d[0]=M(-1,[a,c]);var b=this.vwr.ms.at[a].mi;this.vwr.sm.modifySend(a,
b,2,this.e.fullCommand);this.vwr.ms.connect(d);this.vwr.ms.assignAtom(a,".",!0);this.vwr.ms.assignAtom(c,".",!0);this.vwr.sm.modifySend(a,b,-2,"OK");this.vwr.refresh(3,"assignConnect")},"~N,~N");l(c$,"getContext",function(a){for(var c=new JU.SB,d=this.e.thisContext;null!=d;)a?null!=d.vars&&(c.append(this.getScriptID(d)),c.append(JV.StateManager.getVariableList(d.vars,80,!0,!1))):c.append(JS.ScriptError.getErrorLineMessage(d.functionName,d.scriptFileName,this.e.getLinenumber(d),d.pc,JS.ScriptEval.statementAsString(this.vwr,
d.statement,-9999,this.e.debugHigh))),d=d.parentContext;a?null!=this.e.contextVariables&&(c.append(this.getScriptID(null)),c.append(JV.StateManager.getVariableList(this.e.contextVariables,80,!0,!1))):c.append(this.e.getErrorLineMessage2());return c.toString()},"~B");l(c$,"getIsosurfaceJvxl",function(a,c){return this.chk?"":this.getShapeProperty(c,a?"jvxlMeshX":"jvxlDataXml")},"~B,~N");l(c$,"getMoJvxl",function(a,c){var d=c?28:27;this.e.sm.loadShape(d);var b=this.vwr.am.cmi;0>b&&this.e.errorStr(30,
"show/write MO/NBO");var e=this.vwr.ms.getInfo(b,"moData");null==e&&this.error(27);var f=this.getShapeProperty(d,"moNumber");(null==f||0==f.intValue())&&this.setShapeProperty(d,"init",Integer.$valueOf(b));this.setShapeProperty(d,"moData",e);return this.getShapePropertyIndex(d,"showMO",a)},"~N,~B");l(c$,"getScriptID",function(a){return"\n# "+(null==a?this.e.functionName:"function "+a.functionName)+" (file "+(null==a?this.e.scriptFileName:a.scriptFileName)+(null==a?"":" context "+a.id)+")\n"},"JS.ScriptContext");
l(c$,"getShapePropertyIndex",function(a,c,d){return this.e.sm.getShapePropertyIndex(a,c,d)},"~N,~S,~N");l(c$,"tokenAt",function(a,c){return a<c.length?c[a]:null},"~N,~A");c$.tokAtArray=l(c$,"tokAtArray",function(a,c){return a<c.length&&null!=c[a]?c[a].tok:0},"~N,~A");l(c$,"getPlotMinMax",function(a,c,d){if(null==a)return 0;switch(d){case 1112539144:case 1112539145:case 1112539146:return c?180:-180;case 1112539141:case 1112539152:return c?360:0;case 1112539150:return c?1:-1}d=c?-1E10:1E10;for(var b=
a.length;0<=--b;){var e=a[b];Float.isNaN(e)||c==e>d&&(d=e)}return d},"~A,~B,~N");l(c$,"parseDataArray",function(a,c){a=JU.Parser.fixDataString(a);var d=JU.Parser.markLines(a,"\n"),b=d.length;if(!c){for(var e=JU.AU.newFloat2(b),f=0,g=0;f<b;g=d[f++])g=JU.PT.getTokens(a.substring(g,d[f])),JU.PT.parseFloatArrayData(g,e[f]=M(g.length,0));return e}g=JU.PT.getTokens(a.substring(0,d[0]));if(3!=g.length)return M(0,0,0,0);var j=JU.PT.parseInt(g[0]),h=JU.PT.parseInt(g[1]),l=JU.PT.parseInt(g[2]);if(1>j||1>h||
1>l)return M(1,1,1,0);for(var e=JU.AU.newFloat3(j,h),m=0,n=0,f=1,g=d[0];f<b&&m<j;g=d[f++])g=JU.PT.getTokens(a.substring(g,d[f])),g.length<l||(JU.PT.parseFloatArrayData(g,e[m][n]=M(g.length,0)),++n==h&&(m++,n=0));return m!=j?(System.out.println("Error reading 3D data -- nX = "+j+", but only "+m+" blocks read"),M(1,1,1,0)):e},"~S,~B");U(c$,"ERROR_invalidArgument",22)})})(Clazz,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.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);
