(function(Y,Z,$,aa,ba,N,I,O,Q,R,K,S,T,ca,M,D,U,L,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,Ma,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,null)},"~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;1765808134!=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):1073742333==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,g,f,j){e&&this.setShapeProperty(a,"set",g);-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<f&&(this.e.setMeshDisplayProperty(a,f,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 1073741866:d[0].value=this.prepareBinaryOutput(d[0]);break;case 4098:this.assign();break;case 134221829:this.cache();break;case 4102:this.calculate();break;case 4103:this.capture();break;case 4105:this.centerAt();break;case 134221831:this.compare();break;case 528395:this.console();break;case 4106:this.connect(1);break;case 1094717448:this.configuration();
break;case 134221834:this.data();break;case 1613238294:this.connect(0);break;case 4120:this.image();break;case 4124:this.macro();break;case 4125:this.mapProperty();break;case 4126:this.minimize();break;case 1275072532:this.modulation();break;case 4130:this.mutate();break;case 4131:this.navigate();break;case 4133:case 134221850:case 4138:this.plot(d);break;case 134222350:this.show();break;case 528443:this.stereo();break;case 1747587102:this.unitcell(c?2:1);break;case 134221856: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(M(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,g){var f=
!I(d,JM.BondSet);f&&(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||f&&0>j)return null==c&&(c=""),g?z(-1,[c]):c;var j=this.vwr.ms,A=0,n=j.getLabeler();d=f||!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 k=f||b?null:JM.LabelToken.getBondLabelValues();c=b?null:f?n.compile(this.vwr,c,"\x00",null):n.compile(this.vwr,c,"\u0001",
k);var l=h?1:a.cardinality(),m=Array(l),s=new JU.P3;for(e=h?e:a.nextSetBit(0);0<=e;e=a.nextSetBit(e+1)){var p;f?p=b?j.at[e].getInfo():n.formatLabelAtomArray(this.vwr,j.at[e],c,"\x00",d,s):(p=j.bo[e],p=b?p.getIdentity():n.formatLabelBond(this.vwr,p,c,k,d,s));p=JU.PT.formatStringI(p,"#",A+1);m[A++]=p;if(h)break}return 1==l&&!g?m[0]:m},"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,g=this.tokAt(a);if(1073742332==g||8==g)e=
this.getPoint3f(a,!1),a=b.iToken+1,g=this.tokAt(a);switch(g){case 1073741938:case 1073742080:case 1094713350:case 1073742163:case 1073742114:case 1073742152:case 1747587102:null==e&&(e=JU.P3.new3(555,555,-1)),b.iToken=a-1}g=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);1094713350==this.tokAt(a)&&(d.put("centroid",Boolean.TRUE),c.append(" CENTROID"),a=this.checkPacked(++a,d,c));if(1073742163==this.tokAt(a)){var f;c.append(" SUPERCELL ");
if(b.isPoint3f(++a)){f=this.getPoint3f(a,!1);if(f.x!=K(f.x)||f.y!=K(f.y)||f.z!=K(f.z)||1>f.x||1>f.y||1>f.z)b.iToken=a,this.invArg();a=b.iToken}else f=this.stringParameter(a);c.append(JU.Escape.e(f));d.put("supercell",f);a=this.checkPacked(++a,d,c)}f=0;1073742114==this.tokAt(a)&&(a++,f=this.floatParameter(a++),c.append(" range "+f));d.put("symmetryRange",Float.$valueOf(f));f=null;f=-2147483648;1073742152==this.tokAt(a)&&(++a,f=JU.PT.rep(this.paramAsStr(a++),"''",'"'),c.append(" spacegroup "+JU.PT.esc(f)),
f.equalsIgnoreCase("ignoreOperators")?f=-999:(0==f.length?(e=this.vwr.getCurrentUnitCell(),null!=e&&(f=e.getSpaceGroupName())):0<=f.indexOf(",")&&9>e.x&&(9>e.y&&0==e.z)&&(f+="#doNormalize=0"),d.put("spaceGroupName",f),f=-2));var j=null;if(1747587102==this.tokAt(a)){++a;0==b.optParameterAsString(a).length?(e=this.vwr.getCurrentUnitCell(),null!=e&&(j=e.getUnitCellAsArray(!0),g=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==f&&(f=-1);a=b.iToken+1}-2147483648!=f&&d.put("spaceGroupIndex",Integer.$valueOf(f))}null!=g?b.coordinatesAreFractional=!1:1073742066==this.tokAt(a)&&(g=this.getPoint3f(++a,!0));null!=g&&(b.coordinatesAreFractional?(g.setT(b.fractionalPoint),d.put("unitCellOffsetFractional",b.coordinatesAreFractional?Boolean.TRUE:Boolean.FALSE),c.append(" offset {"+g.x+" "+g.y+" "+g.z+"/1}")):c.append(" offset "+JU.Escape.eP(g)),
d.put("unitCellOffset",g),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 1747587102:case 1678381065: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 1747587102:if(b=this.vwr.getCurrentUnitCell(),
null!=b){b=JU.BoxInfo.getUnitCellPoints(b.getUnitCellVerticesNoOffset(),b.getCartesianOffset());break}case 1678381065: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 1275069441:case 1073742119:c=this.e.optParameterAsString(d++);case 1073741882:this.checkLength(d);this.chk||("all".equals(c)&&(c=null),c=this.vwr.cacheFileByName(c,
1275069441==a),this.showString(0>c?"cache cleared":c+" bytes "+(1275069441==a?" cached":" removed")));break;default:this.invArg()}});l(c$,"calculate",function(){var a=!1,c=!1,d=null,b=null,e=this.e,g=-2147483648;if(2<=(e.iToken=e.slen))switch(e.clearDefinedVariableAtomSets(),this.getToken(1).tok){case 1073741824:this.checkLength(2);break;case 1631586315:this.checkLength(2);if(this.chk)return;g=this.vwr.calculateFormalCharges(null);this.showString(J.i18n.GT.i(J.i18n.GT._("{0} charges modified"),g));
return;case 1075838996:this.checkLength(2);this.chk||this.vwr.ms.assignAromaticBondsBs(!0,null);return;case 1613238294:2!=e.slen&&(d=(c=1639976963==this.tokAt(++e.iToken))?this.vwr.bsA():this.atomExpressionAt(e.iToken),!c&&1639976963!=this.tokAt(++e.iToken)&&(b=this.atomExpressionAt(e.iToken)));if(this.chk)return;g=this.vwr.autoHbond(d,b,!1);-2147483648!=g&&e.report(J.i18n.GT.i(J.i18n.GT._("{0} hydrogen bonds"),Math.abs(g)),!1);return;case 1612709900:(a=1073742335==this.tokAt(2))&&e.iToken++;d=this.slen==
(a?3:2)?null:this.atomExpressionAt(a?3:2);e.checkLast(e.iToken);this.chk||(this.vwr.addHydrogens(d,!1,!1),a&&(null==d&&(d=this.vwr.bsA()),this.vwr.makeConnections(0.1,1E8,515,1073742025,d,d,null,!1,!1,0),this.vwr.ms.assignAromaticBondsBs(!0,null)));return;case 1111492619:e.iToken=1;d=2==this.slen?null:this.atomExpressionAt(2);e.checkLast(e.iToken);if(!this.chk)try{this.vwr.calculatePartialCharges(d)}catch(f){if(M(f,JV.JmolAsyncException))e.loadFileResourceAsync(f.getFileName());else throw f;}return;
case 1088421903:case 134217762:this.chk||(1275203608==e.tokAt(2)?this.showString(this.getShapePropertyIndex(21,"symmetry",1073742334==this.tokAt(3)?0:1)):this.showString(this.vwr.ms.calculatePointGroup(this.vwr.bsA())));return;case 1111490574:this.checkLength(2);this.chk||(this.vwr.calculateStraightness(),this.vwr.addStateScript("set quaternionFrame '"+this.vwr.getQuaternionFrame()+"'; calculate straightness",!1,!0));return;case 1639976963:d=4>this.slen?null:this.atomExpressionAt(2);switch(this.tokAt(++e.iToken)){case 4138:break;
case 1073741916:if(this.chk)return;e.showString(this.vwr.getAnnotationParser(!0).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 659482: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||(g=this.vwr.calculateStruts(d,b),0<g&&
(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"),g)));return;case 2097180:a=!0;case 1111490575:c=!1;switch(this.tokAt(2)){case 134217759: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,g="",f=1073742070!=
this.vwr.am.animationReplayMode,j=1,h=this.tokAt(j),A=603979967==h;A&&(h=this.tokAt(++j));switch(0==h?h=102409:h){case 4:g=this.e.optParameterAsString(j++);if(0==g.length){b=102409;break}c=g.toLowerCase();c.endsWith(".gift")||c.endsWith(".pngt")?(A=!0,g=g.substring(0,g.length-1),c=g.toLowerCase()):!c.endsWith(".gif")&&!c.contains(".png")&&(g+=".gif");c.endsWith(".png")?(c.endsWith("0.png")||(g=g.substring(0,g.length-4)+"0000.png"),c="PNG"):c="GIF";A&&(c+="T");a=g.indexOf("0000.");h=0>a||a!=g.lastIndexOf(".")-
4;a=!1;528411==this.tokAt(j)&&(f=!0,this.tokAt(++j));switch(this.tokAt(j)){case 1073742129:a=!0;case 1611141175:d=null;f="y";j++;a?(j<e&&2!=this.tokAt(j)&&(f=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&&(f=this.e.optParameterAsString(j++).toLowerCase()),d="rotate Y 360 30;");if(this.chk)return;this.vwr.setNavigationMode(!1);if(""===f||0>"xyz".indexOf(f))f="y";e=this.vwr.g.waitForMoveTo;
d="set waitformoveto true;"+JU.PT.rep(d,"Y",f)+";set waitformoveto "+e;d="capture "+(A?"transparent ":"")+JU.PT.esc(g)+" 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;A=this.vwr.getInt(553648132);h&&(a.put("streaming",Boolean.TRUE),f||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 "+A]))));a.put("captureFps",Integer.$valueOf(A));break;case 102409:case 1073741874:null!=a&&a.put("captureSilent",Boolean.TRUE);case 1073742335:case 1073742334:this.checkLength(-2);b=h;break;default:this.invArg()}this.chk||null==a||(a.put("type",c),A=Integer.$valueOf(this.vwr.getBackgroundArgb()),a.put("backgroundColor",A),a.put("fileName",g),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",f?Boolean.TRUE:Boolean.FALSE),g=this.vwr.processWriteOrCapture(a),null==g&&(g="canceled"),JU.Logger.info(g))}});l(c$,"centerAt",function(){var a=this.getToken(1).tok;switch(a){case 1073741826:case 96:case 1678381065: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,g=!1,f=null,j=null,h=null,A=null,n=null,k=null;a.iToken=0;var l=this.isFloatParameter(1)?this.floatParameter(++a.iToken):NaN,m=this.atomExpressionAt(++a.iToken),s=null,p=null;a.isArrayParameter(++a.iToken)?s=a.getPointArray(a.iToken,-1,!1):1140850689!=this.tokAt(a.iToken)&&(p=this.atomExpressionAt(a.iToken));var B=null,v=!1,x=null,w=JU.BSUtil.copy(m);null!=p&&w.or(p);for(var w=e=
null==s&&null!=p&&w.equals(m),r=a.iToken+1;r<this.slen;++r)switch(this.getToken(r).tok){case 4115:w=!0;break;case 134218757:if(v=!0,4!=this.tokAt(r+1)){x="*";break}case 134218756:x=this.stringParameter(++r);break;case 1677721602:d=g=!0;x=this.paramAsStr(++r);x.equalsIgnoreCase("SMILES")&&(v=!0,x="*");break;case 3:case 2:l=Math.abs(this.floatParameter(r));break;case 268435504:break;case 2109448:B=this.atomExpressionAt(++r);r=a.iToken;break;case 10:case 1073742325:null!=k&&this.invArg();var h=this.atomExpressionAt(a.iToken),
F=e?0:this.tokAt(a.iToken+1),A=null==s&&a.isArrayParameter(a.iToken+1)?null:10==F||1073742325==F?this.atomExpressionAt(++a.iToken):JU.BSUtil.copy(h);null!=B&&(h.and(B),null!=A&&A.and(B));null==A?s=a.getPointArray(++a.iToken,-1,!1):A.and(p);null==n&&(n=new JU.Lst);n.addLast(z(-1,[h,A]));r=a.iToken;break;case 7:null!=n&&this.invArg();c=!0;f=a.getQuaternionArray(a.theToken.getList(),1073742001);this.getToken(++r);j=a.getQuaternionArray(a.theToken.getList(),1073742001);null==k&&(k=new JU.Lst);k.addLast(z(-1,
[f,j]));break;case 1073742077:c=!0;break;case 134217751:case 1140850689:c=!1;break;case 528432:d=!0;break;case 4160:b=!0;break;default:this.invArg()}if(!this.chk){w&&(l=0);Float.isNaN(l)||0>l?l=1:!d&&!b&&(d=b=!0);e=0!=l;(F=!c&&null==x||null!=s)&&J.api.Interface.getInterface("JU.Eigen",this.vwr,"script");null==n&&null==k&&(null==B?(h=F?this.vwr.getAtomBitSet("spine"):new JU.BS,0>h.nextSetBit(0)?(h=m,A=p):(A=JU.BSUtil.copy(h),h.and(m),A.and(p))):(h=JU.BSUtil.copy(m),A=JU.BSUtil.copy(p),h.and(B),A.and(B),
h.and(m),A.and(p)),n=new JU.Lst,n.addLast(z(-1,[h,A])));if(w){m=this.vwr.ms.getModelBS(m,!1);B=Array(m.cardinality());r=0;for(A=m.nextSetBit(0);0<=A;A=m.nextSetBit(A+1),r++)B[r]=this.vwr.getModelUndeletedAtomsBitSet(A)}else B=z(-1,[m]);for(A=0;A<B.length;A++){for(var m=B[A],t=L(2,0),q=null,u=new JU.Lst,C=null,G=w?new JU.Lst:n,r=0;r<n.size();++r){var H=n.get(r);w&&G.addLast(H=z(-1,[JU.BSUtil.copy(H[0]),H[1]]));H[0].and(m)}var E=null,D=null;if(F){null!=s&&(G.clear(),G.addLast(z(-1,[h,s])));try{C=this.vwr.getCenterAndPoints(G,
!0)}catch(K){if(M(K,Exception))this.invArg();else throw K;}q=C[0].length-1;for(r=1;r<=q;r++){u=C[0][r];H=C[1][r];if(!I(u,JM.Atom)||!I(H,JM.Atom))break;JU.Logger.info(" atom 1 "+u.getInfo()+"\tatom 2 "+H.getInfo())}q=JU.Measure.calculateQuaternionRotation(C,t);r=Float.isNaN(t[1])?NaN:Math.round(100*t[0])/100;t=Float.isNaN(t[1])?NaN:Math.round(100*t[1])/100;this.showString("RMSD "+r+" --\x3e "+t+" Angstroms")}else if(c){if(null==k)for(r=0;r<G.size();r++){H=G.get(r);f=this.vwr.getAtomGroupQuaternions(H[0],
2147483647);j=this.vwr.getAtomGroupQuaternions(H[1],2147483647);for(q=0;q<f.length&&q<j.length;q++)u.addLast(j[q].div(f[q]))}else for(q=0;q<f.length&&q<j.length;q++)u.addLast(j[q].div(f[q]));t[0]=0;f=u.toArray(Array(u.size()));q=JU.Quat.sphereMean(f,t,1E-4);this.showString("RMSD = "+t[0]+" degrees")}else{r=new JU.M4;E=new JU.P3;if(("*".equals(x)||"".equals(x))&&null!=m)try{x=this.vwr.getSmiles(m)}catch(P){if(M(P,Exception))a.evalError(P.getMessage(),null);else throw P;}if(g){var N;if(null==m||null==
p||null==(N=a.getSmilesExt().getFlexFitList(m,p,x,!v)))break;this.vwr.setDihedrals(N,null,1)}t=a.getSmilesExt().getSmilesCorrelation(m,p,x,null,null,r,null,!1,null,E,!1,v?1:2);System.out.println("compare:\n"+r);if(Float.isNaN(t)){this.showString("structures do not match");break}b&&(D=new JU.V3,r.getTranslation(D));d&&(q=new JU.M3,r.getRotationScale(q),q=JU.Quat.newM(q));this.showString("RMSD = "+t+" Angstroms")}null!=C&&(E=C[0][0]);null==E&&(C=this.vwr.getCenterAndPoints(G,!0),E=C[0][0]);G=new JU.P3;
t=NaN;b&&(null==D&&(D=JU.V3.newVsub(C[1][0],E)),t=1E10);d&&(null==q&&a.evalError("option not implemented",null),G.add2(E,q.getNormal()),t=q.getTheta(),0==t&&b&&(0.01<D.length()?t=1E10:d=b=e=!1));if(!Float.isNaN(t)&&!Float.isNaN(G.x)&&(C=null,d&&(b&&0!=l)&&(C=this.vwr.ms.getAtomPointVector(m),r=JS.ScriptMathProcessor.getMatrix4f(q.getMatrix(),D),C=JU.Measure.transformPoints(C,r,E)),a.useThreads()||(e=!1),this.vwr.rotateAboutPointsInternal(a,E,G,t/l,t,e,m,D,C,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);if(this.chk)return;c=this.intParameter(this.e.checkLast(this.e.iToken+
1));this.vwr.addStateScript("configuration "+JU.Escape.eBS(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 1073742334: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 134218756:var e=this.stringParameter(3==this.slen?2:4);if(this.chk)return;var g=this.vwr.ms.at,c=this.vwr.ms.ac,d=null;try{d=this.vwr.getSmilesMatcher().getCorrelationMaps(e,g,c,this.vwr.bsA(),2)}catch(f){if(M(f,Exception))a.evalError(f.getMessage(),null);else throw f;}if(null==d)return;this.setShapeProperty(6,"maps",d);return}switch(this.slen){case 2:switch(this.getToken(1).tok){case 0:case 1073742335: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(1073742327==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,A=0,n=-1,k=-1,l=-1,m=D(5,0),s=L(-1,[3.4028235E38,
3.4028235E38]),p=!1,B=!1,v=!1,x=!0,w=null,r=null,e=268435538,z=g=null,t=new JU.Lst,q=new JU.BS,u=null,C=null,G=0,H=0,j=1;j<this.slen;++j)switch(this.getToken(j).tok){case 1073741974:1!=j&&this.invArg();c=a.optParameterAsString(++j);continue;case 1073741824:a.errorStr(24,"ALL, ALLCONNECTED, DELETE");break;default:this.error(15);break;case 268435568:134217736!=this.tokAt(j+1)&&this.invArg();j++;v=!0;break;case 134217736:case 1073741834:case 1073742327:B=1073741834==a.theTok;k=-1;p=!0;B&&v&&this.invArg();
break;case 1765808134:d=JU.C.getColix(a.getArgbParam(++j));j=a.iToken;break;case 1073742066:a.isPoint3f(++j)?(b=this.getPoint3f(j,!1),b=L(-1,[1,b.x,b.y,b.z,0,0,0])):b=a.floatParameterSet(j,7,7);j=a.iToken;break;case 1665140738:case 1073741917:H=K((1665140738==a.theTok?2E3:1E3)*this.floatParameter(++j));null!=c&&0>=H&&(H=-1);break;case 3:null!=w&&this.invArg();x=p=!0;l=(l+1)%2;s[l]=this.floatParameter(j);break;case 12291:268435538!=e&&this.invArg();e=12291;break;case 4114:var E=this.floatParameter(++j),
N=this.paramAsStr(++j),O=this.paramAsStr(++j);this.chk||(z=this.vwr.getFont3D(N,O,E));break;case 2:E=this.intParameter(j);if(p)x=!0,l=(l+1)%2,s[l]=E;else{k=this.vwr.ms.getFirstAtomIndexFromAtomNumber(E,this.vwr.getVisibleFramesBitSet());if(!this.chk&&0>k)return;null!=u&&this.invArg();4<(m[0]=++h)&&a.bad();m[h]=k}break;case 1094713359:n=this.intParameter(++j);break;case 1073742334:268435538!=e&&this.invArg();e=1073742334;break;case 1073742335:268435538!=e&&this.invArg();e=1073742335;break;case 1073742114:x=
p=!0;k=-1;break;case 1073741989:case 1073741990:r=Boolean.$valueOf(1073741989==a.theTok);p=!0;v=1073741990==a.theTok;break;case 1648363544:0<=l&&this.invArg();w=a.encodeRadiusParameter(j,!1,!0);if(null==w)return;w.values=s;j=a.iToken;p=v=!0;r=Boolean.$valueOf(!1);1==G&&(G++,h++,E=JU.BSUtil.copy(q),JU.BSUtil.invertInPlace(E,this.vwr.ms.ac),E.and(this.vwr.ms.getAtomsWithinRadius(5,q,!1,null)),t.addLast(E));break;case 10:case 1073742325:case 1073742332:case 8:case 1073742330:(10==a.theTok||1073742325==
a.theTok)&&G++;0<=k&&this.invArg();h=Array(1);u=a.centerParameter(j,h);if(I(h[0],JU.BS)&&(u=q=h[0],!this.chk&&0==q.length()))return;I(u,JU.P3)&&(j=new JU.Point3fi,j.setT(u),j.mi=n,u=j);4<(h=++A)&&a.bad();j=a.iToken;t.addLast(u);break;case 4:g=this.stringParameter(j);break;case 1073742164:C=a.tickParamAsStr(j,!1,!0,!0),j=a.iToken,e=12290}(null!=w&&(0<=l||2!=h)||2>h&&null==c&&(null==C||1==h))&&a.bad();null!=g&&0!=g.indexOf(h+":")&&(g=h+":"+g);x&&s[1]<s[0]&&(s[1]=s[0],s[0]=3.4028235E38==s[1]?3.4028235E38:
-200);if(!this.chk)if(null!=u||null!=C)null==w&&(w=new J.atomdata.RadiusData(s,0,null,null)),null==u&&(C.id="default"),null!=u&&(null!=g&&268435538==e)&&(e=12290),a=null,null!=z&&(a=J.api.Interface.getInterface("JM.Text",this.vwr,"script").newLabel(this.vwr,z,"",d,0,0,0)),null!=a&&(a.pymolOffset=b),this.setShapeProperty(6,"measure",this.vwr.newMeasurementData(c,t).set(e,null,w,g,null,C,B,v,r,p,H,d,a));else switch(a=null==c?m:c,e){case 12291:this.setShapeProperty(6,"delete",a);break;case 1073742335:this.setShapeProperty(6,
"show",a);break;case 1073742334:this.setShapeProperty(6,"hide",a);break;default:this.setShapeProperty(6,null==g?"toggle":"toggleOn",a),null!=g&&this.setShapeProperty(6,"setFormats",g)}});l(c$,"connect",function(a){var c=this.e,d=L(2,0),b=Array(2);b[0]=b[1]=this.vwr.bsA();var e=NaN,g=D(-1,[-2147483648]),f=0,j=131071,h=1073742026,A=!1,n=!1,k=!1,l=3.4028235E38,m=!1,s=0,p=0,B=new JU.BS,v=!1,x=0,w=0,r=0,F=!1;if(1==this.slen)this.chk||this.vwr.rebondState(c.$isStateScript);else{for(;a<this.slen;++a){switch(this.getToken(a).tok){case 1073742335:case 1073742334:this.checkLength(2);
this.chk||this.vwr.rebondState(c.$isStateScript);return;case 2:case 3:if(0<s){(n||m)&&c.error(23);j=JU.Edge.getBondOrderFromFloat(this.floatParameter(a));131071==j&&this.invArg();n=!0;break}2<++p&&c.bad();var t=this.floatParameter(a);268435634==this.tokAt(a+1)&&(t=-t/100,a++);d[f++]=t;break;case 10:case 1073742325:(2<s||v&&0<s)&&c.bad();(n||m)&&this.invArg();b[s++]=this.atomExpressionAt(a);v=c.isBondSet;if(2==s){for(var t=c.iToken,q=a;q<t;q++)if(1073741824==this.tokAt(q)&&this.paramAsStr(q).equals("_1")){x=
a;break}c.iToken=t}a=c.iToken;break;case 1086324742:F=!0;break;case 1765808134:case 603979967:case 1073742074:m=!0;l=this.getColorTrans(c,a,!1,g);a=c.iToken;break;case 1073742086:g=1073741852==this.tokAt(2);this.checkLength(g?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(g){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:k=!0;++a!=this.slen&&this.invArg();h=c.theTok;1073741852==h&&!(131071==j||2048==j||515==j)&&this.invArg();break;case 659482:m||(g[0]=16777215,l=0.5,e=this.vwr.getFloat(570425406),m=!0),k||(h=1073742026),k=!0;case 1073741824:if(c.isColorParam(a)){w=-a;break}case 1075838996:case 1613238294:j=
this.paramAsStr(a);131071==(j=JS.ScriptParam.getBondOrderFromString(j))&&this.invArg();n&&c.error(18);n=!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 1665140738:e=this.floatParameter(++a);m=!0;break;case 1073742333:case 12291:++a!=this.slen&&this.invArg();h=12291;A=!0;m=!1;
break;default:w=a}0<a&&(w==-a||w==a&&c.isColorParam(a)?(m=!0,g[0]=c.getArgbParam(a),a=c.iToken):w==a&&this.invArg())}if(!this.chk){2>f&&(0==f&&(d[0]=1E8),d[1]=d[0],d[0]=0.1);m&&(n||(j=65535),k||(h=1073742025));n=f=0;if(0<x){r=new JU.BS;this.vwr.definedAtomSets.put("_1",r);F=b[0];for(k=F.nextSetBit(0);0<=k;k=F.nextSetBit(k+1))r.set(k),b=this.vwr.makeConnections(d[0],d[1],j,h,r,this.atomExpressionAt(x),B,v,!1,0),f+=Math.abs(b[0]),n+=b[1],r.clear(k)}else b=this.vwr.makeConnections(d[0],d[1],j,h,b[0],
b[1],B,v,F,r),f+=Math.abs(b[0]),n+=b[1];d=c.doReport();A?d&&c.report(J.i18n.GT.i(J.i18n.GT._("{0} connections deleted"),n),!1):(m&&(this.vwr.selectBonds(B),Float.isNaN(e)||c.setShapeSizeBs(1,Math.round(2E3*e),null),this.finalizeObject(1,g[0],l,0,!1,null,0,B),this.vwr.selectBonds(null)),d&&c.report(J.i18n.GT.o(J.i18n.GT._("{0} new bonds; {1} modified"),z(-1,[Integer.$valueOf(f),Integer.$valueOf(n)])),!1))}}},"~N");l(c$,"console",function(){switch(this.getToken(1).tok){case 1073742334:this.chk||this.vwr.showConsole(!1);
break;case 1073742335:this.chk||this.vwr.showConsole(!0);break;case 1073741882:this.chk||this.vwr.sm.clearConsole();break;case 134221856: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.substring(0,(d+" ").indexOf(" ")).toLowerCase();if(e.equals("model")||e.equals("append"))a.cmdLoad();else if(!this.chk){var g=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=D(c+1,0);for(g=1;g<=c;g++)e[g]=g;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 f=JU.PT.getTokens(d);if(0==e.indexOf("property_")&&!(2==f.length&&f[1].equals("set"))){g=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(),n=b?0:this.vwr.getP("propertyDataColumnCount").intValue();!b&&0<=d.indexOf(" ")&&(3==f.length&&(j=JU.PT.parseInt(f[1]),l=JU.PT.parseInt(f[2])),
5==f.length&&(j=JU.PT.parseInt(f[1]),h=JU.PT.parseInt(f[2]),l=JU.PT.parseInt(f[3]),n=JU.PT.parseInt(f[4])));0>j&&(j=0);0>l&&(l=0);d=this.vwr.ms.ac;b=null;f=JU.BS.newN(d);if(0<j){for(var b=D(d+2,0),k=0;k<=d;k++)b[k]=-1;for(k=g.nextSetBit(0);0<=k;k=g.nextSetBit(k+1)){var y=this.vwr.ms.at[k].getAtomNumber();y>d+1||(0>y||f.get(y))||(f.set(y),b[y]=k)}a[2]=b}else a[2]=JU.BSUtil.copy(g);a[1]=c;a[3]=Integer.$valueOf(0);this.vwr.setData(e,a,d,j,h,l,n)}else"occupany".equals(e)&&(e="occupancy"),j=JM.AtomCollection.getUserSettableType(e),
-1<j?this.vwr.setAtomData(j,e,c,g):(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,g=!1;this.setShapeProperty(20,"thisID",null);switch(this.getToken(1).tok){case 1073742335:c=2147483647;break;case 1073742334:break;case 2:c=this.intParameter(1);break;case 36867:this.e.sm.loadShape(20);this.setShapeProperty(20,"select",this.paramAsStr(2));d=a.iToken;g=e=!0;break;case 1073741974:case 268435633:case 1073741824:this.e.sm.loadShape(20);
1073741974==a.theTok&&d++;this.setShapeId(20,d,!1);d=a.iToken;e=!0;break;default:this.invArg()}if(e){for(c=D(-1,[-2147483648]);++d<this.slen;){var e=this.paramAsStr(d),f=null;this.getToken(d);if(!g)switch(a.theTok){case 1073742330:e="points";f=Array(3);f[0]=a.objectNameParameter(++d);if(this.chk)continue;a.getShapePropertyData(24,"getVertices",f);break;case 1611272194:for(var f=Array(3),j=0;3>j;j++)f[j]=new JU.V3,f[j].setT(this.centerParameter(++d)),d=a.iToken;break;case 12289:f=this.centerParameter(++d);
d=a.iToken;break;case 1094713359:f=Integer.$valueOf(this.intParameter(++d));break;case 12291:f=Boolean.TRUE,this.checkLength(d+1)}if(null==f)switch(a.theTok){case 1073742335:e="on";f=Boolean.TRUE;break;case 1073742334:e="on";f=Boolean.FALSE;break;case 1073742138:f=Float.$valueOf(this.floatParameter(++d));break;case 10:case 1073742325:e="atoms";f=this.atomExpressionAt(d);d=a.iToken;break;case 1765808134:case 603979967:case 1073742074:b=this.getColorTrans(a,d,!0,c);d=a.iToken;continue;case 1073742075:f=
this.paramAsStr(++d)}null==f&&this.invArg();this.setShapeProperty(20,e.toLowerCase(),f)}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;1073741974==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,g=0,f=0,j=0,h=this.e;;){if(1113589787==this.tokAt(1))a=this.vwr.bsA(),c=this.atomExpressionAt(2),d=b="selected";else{a=this.atomExpressionAt(1);if(1073742336!=this.tokAt(++h.iToken)||!JS.T.tokAttr(g=this.tokAt(++h.iToken),1077936128))break;d=this.paramAsStr(h.iToken);c=this.atomExpressionAt(++h.iToken);if(1073742336!=this.tokAt(++h.iToken)||!JS.T.tokAttr(f=this.tokAt(++h.iToken),
2048))break;b=this.paramAsStr(h.iToken)}e=JS.T.tokAttr(j=this.tokAt(h.iToken+1),1077936128)?this.paramAsStr(++h.iToken):JS.T.nameOf(j=1094715393);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(g,1094713344,1111490560)&&JS.T.tokAttrOr(f,1094713344,1111490560)&&JS.T.tokAttrOr(j,1094713344,1111490560)){var n=this.getBitsetPropertyFloat(a,
g|224,null,NaN,NaN),k=this.getBitsetPropertyFloat(a,j|224,null,NaN,NaN),g=this.getBitsetPropertyFloat(c,j|224,null,NaN,NaN),y=1715472409==f,m=L(y?this.vwr.ms.ac:g.length,0),l=new JU.BS;if(n.length==k.length){for(var s=new java.util.Hashtable,j=0;j<n.length;j++)s.put(Float.$valueOf(k[j]),Float.$valueOf(n[j]));n=-1;for(j=k=0;j<g.length;j++){var n=c.nextSetBit(n+1),p=s.get(Float.$valueOf(g[j]));null!=p&&(l.set(n),m[y?n:k]=p.floatValue(),k++)}y?this.vwr.setData(b,z(-1,[b,m,l,Integer.$valueOf(1),Boolean.TRUE]),
this.vwr.ms.ac,0,0,2147483647,0):this.vwr.setAtomProperty(l,f,0,0,null,m,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(B){if(M(B,Exception))c=B,this.vwr.slm.setSelectionSubset(d),h.errorStr(-1,"Error: "+
c.getMessage());else if(M(B,Error))c=B,this.vwr.slm.setSelectionSubset(d),h.errorStr(-1,"Error: "+c.toString());else throw B;}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,g=null,f=!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=D(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,D(a,0),Float.$valueOf(c)]));return;case 1073741905:d=
this.floatParameter(++h);continue;case 1073741934:c=0;continue;case 12293:1!=h&&this.invArg();g=this.atomExpressionAt(++h);0>g.nextSetBit(0)&&(g=null);h=this.e.iToken;this.chk||this.vwr.getMinimizer(!0).setProperty("fixed",g);if(h+1==this.slen)return;continue;case 10:case 1073742325:f=!0;case 1275082245:1275082245==this.e.theTok&&h++;a=this.atomExpressionAt(h);h=this.e.iToken;1073742072==this.tokAt(h+1)&&(h++,f=!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,g,0,b,f,e,!1)}catch(l){if(M(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,g=1;switch(this.getToken(g).tok){case 1073742334:d=!1;case 0:case 1073742335:break;case 10:case 1073742325:e=this.atomExpressionAt(1);switch(this.tokAt(c.iToken+1)){case 1073742334:d=!1;case 1073742335:c.iToken++}c.checkLast(c.iToken);break;case 1073742332:case 8:a=
c.getPoint3f(1,!1);b=1073742335==this.tokAt(c.iToken+1);break;default:var f=c.theToken.value.toString();g++;f.equalsIgnoreCase("t")?c.theTok=3:f.equalsIgnoreCase("m")||f.equalsIgnoreCase("q")?c.theTok=2:this.invArg();case 3:case 2:switch(c.theTok){case 3:this.isFloatParameter(g)?(a=this.floatParameter(g),a=JU.P3.new3(a,a,a)):a=c.getPoint3f(g,!1);break;case 2:2==this.tokAt(g)?(b=this.intParameter(g),a=JU.P3.new3(b,b,b)):a=c.getPoint3f(g,!1),b=!0}break;case 1073742138:d=this.floatParameter(2);this.chk||
this.vwr.setFloatProperty("modulationScale",d);return}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 268435633: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 1073742335:case 1073742334: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(1073742335==a.theTok);return;case 1073742162:this.chk||this.vwr.tm.setNavXYZ(0,0,0);return;case 8:case 1112152078:break;default:this.invArg()}!this.chk&&
!this.vwr.getBoolean(603979889)&&a.setBooleanProperty("navigationMode",!0);for(var e=1;e<this.slen;e++){var g=this.isFloatParameter(e)?this.floatParameter(e++):2;0>g&&this.invArg();!this.chk&&0<g&&a.refresh(!1);switch(this.getToken(e).tok){case 8:case 1073742332: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(g),Float.$valueOf(b)]));
continue;case 12289:b=this.centerParameter(++e);e=a.iToken;this.chk||d.addLast(z(-1,[Integer.$valueOf(134217751),Float.$valueOf(g),b]));continue;case 528432:switch(this.getToken(++e).tok){case 1111492629:c.set(1,0,0);e++;break;case 1111492630:c.set(0,1,0);e++;break;case 1111492631:c.set(0,0,1);e++;break;case 8:case 1073742332: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(g),
c,Float.$valueOf(b)]));continue;case 4160:var f=b=NaN;if(this.isFloatParameter(++e))b=this.floatParameter(e),f=this.floatParameter(++e);else switch(this.tokAt(e)){case 1111492629:b=this.floatParameter(++e);break;case 1111492630:f=this.floatParameter(++e);break;default:b=this.centerParameter(e);e=a.iToken;this.chk||d.addLast(z(-1,[Integer.$valueOf(4160),Float.$valueOf(g),b]));continue}this.chk||d.addLast(z(-1,[Integer.$valueOf(268435634),Float.$valueOf(g),Float.$valueOf(b),Float.$valueOf(f)]));continue;
case 268435632:continue;case 1112152078:b=new JU.Lst;10==this.tokAt(e+1)||1073742325==this.tokAt(e+1)?(f=this.atomExpressionAt(++e),e=a.iToken):f=this.vwr.bsA();if(this.chk)return;this.vwr.getPolymerPointsAndVectors(f,b);var j;if(0<(j=b.size())){for(var f=Array(j),h=0;h<j;h++)f[h]=b.get(h);d.addLast(z(-1,[Integer.$valueOf(1112152078),Float.$valueOf(g),f]));continue}break;case 1073742084:if(1073742330==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();f=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(g),b,null,D(-1,[f,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(g),
b,null,D(-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,g=!0,f=this.st;e&&(c.st=this.st=a);var j=e?134222350:a[0].tok,h=e||134221850==j||4138==j?0:1,l=null,n=!0,k=!1;switch(j){case 135176:n=!1;k=!0;break;case 134222350:g=n=!1;break;case 134221856:n=!1,4==JS.CmdExt.tokAtArray(b,
a)?l=this.stringParameter(b--):1073742336==JS.CmdExt.tokAtArray(b-1,a)?(l=this.paramAsStr(b-2)+"."+this.paramAsStr(b),b-=3):(c.st=this.st=f,c.iToken=this.st.length,this.error(13)),c.slen=this.slen=b+1}var e="",y=null,m="",s=!1,p=!1,B=!1,v=!1,x=Array(3),w=D(3,0),r=JU.BSUtil.copy(this.vwr.bsA()),F="; select "+JU.Escape.eBS(r)+";\n ",v=c.optParameterAsString(b).toLowerCase(),t=null,q=null,u=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 134221834:c.iToken=1;v="data";F="";break;case 1715472409:c.iToken=h+1;for(a=0;3>a;a++){switch(this.tokAt(c.iToken)){case 4:w[a]=JS.T.getTokFromName(c.getToken(c.iToken).value);break;default:w[a]=this.tokAt(c.iToken);break;case 0:0==a&&this.invArg();case 1287653388:case 32:case 64:a=2;continue}1715472409!=w[a]&&!JS.T.tokAttr(w[a],1077936128)&&this.invArg();x[a]=this.getToken(c.iToken).value.toString();c.iToken++}1287653388==this.tokAt(c.iToken)&&(u=this.stringParameter(++c.iToken),g=!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++);v="property "+x[0]+(null==x[1]?"":" "+x[1])+(null==x[2]?"":" "+x[2]);0>r.nextSetBit(0)&&(r=this.vwr.getModelUndeletedAtomsBitSet(d));m="select "+JU.Escape.eBS(r)+";\n ";break;case 4138:v.equalsIgnoreCase("draw")&&(v=c.optParameterAsString(--b).toLowerCase());v=b>h&&v.startsWith("r");v="ramachandran"+(v?" r":"")+(135176==j?" draw":"");break;case 134221850:case 136314895:e=
' "'+this.vwr.getQuaternionFrame()+'"';m="set quaternionFrame"+e+";\n  ";s=!0;v.equalsIgnoreCase("draw")&&(k=!0,v=c.optParameterAsString(--b).toLowerCase());B=(p=v.startsWith("deriv")||v.startsWith("diff"))&&0<v.indexOf("2");p&&b--;if(v.equalsIgnoreCase("helix")||v.equalsIgnoreCase("axis"))p=k=!0,b=-1;v=((b<=h?"":c.optParameterAsString(b))+"w").substring(0,1);if(v.equals("a")||v.equals("r"))p=!0;JU.PT.isOneOf(v,";w;x;y;z;r;a;")||c.evalError("QUATERNION [w,x,y,z,a,r] [difference][2]",null);v="quaternion "+
v+(p?" difference":"")+(B?"2":"")+(k?" draw":"")}this.st=f;if(this.chk)return"";if(n&&(m+="plot "+v,f=this.vwr.ms.getJmolDataFrameIndex(d,m),0<f&&134221856!=j&&134222350!=j))return this.vwr.setCurrentModelIndexClear(f,!0),"";n=b=f=null;h=Array(3);if(1715472409==C){f=this.getBitsetPropertyFloat(r,w[0]|224,1715472409==w[0]?x[0]:null,null==t?NaN:t.x,null==q?NaN:q.x);h[0]=x[0]+" "+JU.Escape.eAF(f);null!=x[1]&&(b=this.getBitsetPropertyFloat(r,w[1]|224,1715472409==w[1]?x[1]:null,null==t?NaN:t.y,null==q?
NaN:q.y),h[1]=x[1]+" "+JU.Escape.eAF(b));null!=x[2]&&(n=this.getBitsetPropertyFloat(r,w[2]|224,1715472409==w[2]?x[2]:null,null==t?NaN:t.z,null==q?NaN:q.z),h[2]=x[2]+" "+JU.Escape.eAF(n));null==t&&(t=JU.P3.new3(this.getPlotMinMax(f,!1,w[0]),this.getPlotMinMax(b,!1,w[1]),this.getPlotMinMax(n,!1,w[2])));null==q&&(q=JU.P3.new3(this.getPlotMinMax(f,!0,w[0]),this.getPlotMinMax(b,!0,w[1]),this.getPlotMinMax(n,!0,w[2])));JU.Logger.info("plot min/max: "+t+" "+q);k=y=null;if(g){k=JU.P3.new3(1,1,1);y=new JU.P3;
y.ave(q,t);k.sub2(q,t);k.set(k.x/200,k.y/200,k.z/200);JS.T.tokAttr(w[0],1094713344)?(k.x=1,y.x=0):0.1<k.x&&10>=k.x&&(k.x=1);JS.T.tokAttr(w[1],1094713344)?(k.y=1,y.y=0):0.1<k.y&&10>=k.y&&(k.y=1);JS.T.tokAttr(w[2],1094713344)?(k.z=1,y.z=0):0.1<k.z&&10>=k.z&&(k.z=1);if(null==x[2]||null==x[1])y.z=t.z=q.z=k.z=0;for(a=0;a<f.length;a++)f[a]=(f[a]-y.x)/k.x;if(null!=x[1])for(a=0;a<b.length;a++)b[a]=(b[a]-y.y)/k.y;if(null!=x[2])for(a=0;a<n.length;a++)n[a]=(n[a]-y.z)/k.z}y=z(-1,[r,f,b,n,t,q,k,y,u,h])}if(134221856==
j)return this.vwr.writeFileData(l,"PLOT_"+v,d,y);g=v.equals("data")?"1 0 H 0 0 0 # Jmol PDB-encoded data":this.vwr.getPdbData(d,v,null,y,null,!0);if(134222350==j)return g;JU.Logger.debugging&&JU.Logger.debug(g);if(135176==j)return c.runScript(g),"";j=this.vwr.fm.getFileInfo();l=this.vwr.getBoolean(603979792);this.vwr.g.appendNew=!0;g=null!=g&&null==this.vwr.openStringInlineParamsAppend(g,null,!0);this.vwr.g.appendNew=l;this.vwr.fm.setFileInfo(j);if(!g)return"";j=this.vwr.ms.mc;this.vwr.ms.setJmolDataFrame(m,
d,j-1);1715472409!=C&&(m+=";\n"+F);m=this.vwr.addStateScript(m,!0,!1);g=150;switch(C){default:d="frame 0.0; frame last; reset;select visible;wireframe only;";g=10;break;case 1715472409:this.vwr.setFrameTitle(j-1,v+" plot for model "+this.vwr.getModelNumberDotted(d));d="frame 0.0; frame last; reset;select visible; spacefill 3.0; wireframe 0;draw plotAxisX"+j+' {100 -100 -100} {-100 -100 -100} "'+x[0]+'";draw plotAxisY'+j+' {-100 100 -100} {-100 -100 -100} "'+x[1]+'";';null!=x[2]&&(d+="draw plotAxisZ"+
j+' {-100 -100 100} {-100 -100 -100} "'+x[2]+'";');break;case 4138: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 134221850:case 136314895:this.vwr.setFrameTitle(j-1,v.$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+F);m.setModelIndex(this.vwr.am.cmi);this.vwr.setRotationRadius(g,!0);c.sm.loadShape(31);this.showString("frame "+
this.vwr.getModelNumberDotted(j-1)+(0<v.length?" created: "+v+(s?e:""):""));return""},"~A");l(c$,"polyhedra",function(){var a=this.e,c=1==this.slen,d=!1,b=c,e=!1,g=!1,f=!1,j=NaN,h=0;a.sm.loadShape(21);this.setShapeProperty(21,"init",Boolean.TRUE);for(var l=3.4028235E38,n=D(-1,[-2147483648]),k=null,y=null,m=1;m<this.slen;++m){var s=null,p=null;switch(this.getToken(m).tok){case 6:s="info";p=this.e.theToken.value;b=!0;break;case 1073742138:j=this.floatParameter(++m);continue;case 1747587102:null!=y&&
this.invArg();s="unitCell";p=Boolean.TRUE;b=!0;break;case 1073742072:this.e.restrictSelected(!1,!1),a.theTok=1073742335;case 1073742335:case 12291:case 1073742334:(m+1!=this.slen||b||1<h)&&this.error(18);s=1073742334==a.theTok?"off":1073742335==a.theTok?"on":"delete";e=!0;break;case 2:null!=y&&this.invArg();s="nVertices";p=Integer.$valueOf(this.intParameter(m));b=!0;268435504==this.tokAt(m+1)&&m++;break;case 1677721602:null!=y&&this.invArg();0<h&&this.invPO();b=!0;s="bonds";c=!0;break;case 1665140738:m++;
case 3:null!=y&&this.invArg();0<h&&this.invPO();s="radius";p=Float.$valueOf(this.floatParameter(m));b=!0;break;case 1073742066:if(!this.isFloatParameter(m+1)){k=this.getPoint3f(++m,!0);m=a.iToken;continue}case 1073741937:this.setShapeProperty(21,"collapsed",Boolean.TRUE);case 1073742099:case 1073741924:s=JS.T.nameOf(a.theTok);switch(this.tokAt(m+1)){case 268435860:case 268435504:m++}p=Float.$valueOf(this.floatParameter(++m));break;case 1094717454:null==y&&this.invArg();s="model";p=Integer.$valueOf(this.intParameter(++m));
break;case 1073742170:(1<h||null!=y&&!d)&&this.invPO();h=3;10==this.tokAt(++m)||1073742325==this.tokAt(m)?(s=b?"to":"toBitSet",p=this.atomExpressionAt(m)):a.isArrayParameter(m)?(s="toVertices",p=a.getPointArray(m,-1,!1)):this.error(19);m=a.iToken;b=!0;break;case 10:case 1073742325:g&&this.invPO();switch(++h){case 1:null!=y&&this.invArg();s="centers";break;case 2:s="to";b=!0;break;default:a.bad()}p=this.atomExpressionAt(m);m=a.iToken;b=(new Boolean(b|m+1==this.slen)).valueOf();break;case 1765808134:case 603979967:case 1073742074:l=
this.getColorTrans(a,m,!0,n);m=a.iToken;continue;case 1073741886:g&&this.error(18);g=!0;this.isFloatParameter(m+1)&&this.setShapeProperty(21,"faceCenterOffset",Float.$valueOf(this.floatParameter(++m)));s="collapsed";p=Boolean.TRUE;break;case 1073742044:case 1073741933:case 1073741956:f&&this.error(18);f=!0;s=JS.T.nameOf(a.theTok);break;case 1073742182:case 1073742060:case 1073741861:case 1073741958:case 1073741964:continue;case 1073741974:case 268435633:case 1073741824:case 4:if(!a.isColorParam(m)){1!=
m&&this.invPO();y=1073741974==a.theTok?this.stringParameter(++m):a.optParameterAsString(m);this.setShapeProperty(21,"thisID",y);this.setShapeProperty(21,"model",Integer.$valueOf(this.vwr.am.cmi));if(!a.isCenterParameter(m+1))continue;s="center";p=this.centerParameter(++m);m=a.iToken;d=!0;break}default:if(a.isColorParam(m)){n[0]=a.getArgbParam(m);m=a.iToken;continue}this.invArg()}null!=s&&this.setShapeProperty(21,s,p);if(e)return}b?(!g&&c&&this.setShapeProperty(21,"bonds",null),this.setShapeProperty(21,
"generate",null)):!f&&(null==k&&Float.isNaN(j))&&this.error(19);null!=k&&this.setShapeProperty(21,"offset",k);Float.isNaN(j)||this.setShapeProperty(21,"scale",Float.$valueOf(j));-2147483648!=n[0]&&this.setShapeProperty(21,"colorThis",Integer.$valueOf(n[0]));3.4028235E38!=l&&a.setShapeTranslucency(21,"","translucentThis",l,null);this.setShapeProperty(21,"init",Boolean.FALSE)});l(c$,"write",function(a){var c=this.e,d=1,b=1,e=null,g=null,f=null,j=null,h="SPT",g=!0,l=!1;null==a?(a=this.st,l=this.vwr.isApplet&&
!this.vwr.isSignedApplet||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL)||0<this.vwr.fm.getPathForAllFiles().length):(d=b=0,g=!1,l=!g);var n=JS.CmdExt.tokAtArray(d,a);if(4==n&&!g){var k=JS.T.getTokenFromName(JS.SV.sValue(a[0]).toLowerCase());null!=k&&(n=k.tok)}switch(n){case 0:break;case 134221850:case 4138:case 1715472409:return g=this.plot(a),l?g:this.writeMsg(g);case 134222850:c.isArrayParameter(d+1)&&(e=c.stringParameterSet(++d),j=f=".",b=d=c.iToken+1,n=this.tokAt(d));break;default:h=JS.SV.sValue(this.tokenAt(d,
a)).toUpperCase()}var y=this.vwr.getExportDriverList(),k=null,m=g?this.slen:a.length,s="",p=null,B=null,v=0,x="PNGJ",w=!1,r=null,z=-1,t=-1,q=!1,u=null;0!=n&&(g&&1<this.slen&&1073741848==this.tokAt(this.slen-2))&&(h=this.paramAsStr(this.slen-1).toUpperCase(),b=m,m-=2,n=0);switch(n){case 15:case 6:h="VAR";B=this.tokenAt(d++,a);break;case 1073741983:h="INLINE";k=JS.SV.sValue(this.tokenAt(++d,a));d++;break;case 134217762:h="PGRP";d++;s=JS.SV.sValue(this.tokenAt(d,a)).toLowerCase();s.equals("draw")&&d++;
break;case 1073742329:d++;w=!0;break;case 1073742158:case 134222850:for(p=JS.SV.sValue(this.tokenAt(++d,a)).toLowerCase();p.equals("localpath")||p.equals("remotepath");)p.equals("localpath")?f=JS.SV.sValue(this.tokenAt(++d,a)):j=JS.SV.sValue(this.tokenAt(++d,a)),p=JS.SV.sValue(this.tokenAt(++d,a)).toLowerCase();h="SPT";break;case 1228935687:case 134320141: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:var C;d+1<m&&1073742325==a[++d].tok||10==a[d].tok?(C=c.atomExpression(a,d,0,!0,!1,null,!0),d=c.iToken+1):C=this.vwr.getAllAtoms();this.chk||(r=this.vwr.ms.getModelBS(C,!0));break;case 4120:h="IMAGE";d++;break;case 1073742139:p=JS.SV.sValue(this.tokenAt(++d,a)).toUpperCase();JU.PT.isOneOf(p,";PNG;PNGJ;")&&(x=p,d++);break;case 4166:v=c.intParameterRange(++d,1,10);if(2147483647==
v)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,y.toUpperCase())){d++;h=h.substring(0,1).toUpperCase()+h.substring(1).toLowerCase();q=!0;g&&(u="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)&&(z=JS.SV.iValue(this.tokenAt(d++,
a)),t=JS.SV.iValue(this.tokenAt(d++,a)))}n=-2147483648;if(b<m){p=JS.SV.sValue(this.tokenAt(d,a));if(p.equalsIgnoreCase("clipboard")){if(this.chk)return""}else JU.PT.isOneOf(p.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)&&(z=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(p.toLowerCase(),";xyz;xyzrn;xyzvib;mol;sdf;v2000;v3000;json;pdb;pqr;cml;")&&
(h=p.toUpperCase(),d+1==m&&d++);h.equals("IMAGE")&&JU.PT.isOneOf(p.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;")&&(h=p.toUpperCase(),d++)}d+2==m&&(b=JS.SV.sValue(this.tokenAt(++d,a)),0<b.length&&"."!=b.charAt(0)&&(h=p.toUpperCase()));switch(JS.CmdExt.tokAtArray(d,a)){case 0:l=!0;break;case 1073741884:break;case 805306401:u=h.equals("IMAGE")?"?jmol.png":"?jmol."+h.toLowerCase();break;case 1073741824:case 4:u=JS.SV.sValue(this.tokenAt(d,a));if(u.equalsIgnoreCase("clipboard")||
!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL))u=null;break;default:this.invArg()}if(h.equals("IMAGE")||h.equals("FRAME")||h.equals("VIBRATION"))h=null!=u&&0<=u.indexOf(".")?u.substring(u.lastIndexOf(".")+1).toUpperCase():"JPG";p=JU.PT.isOneOf(h.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;");if(!p&&(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!=u&&0<=u.indexOf(".")?u.substring(u.lastIndexOf(".")+1).toUpperCase():"XYZ";null!=e&&(h.equals("PNG")&&(h="PNGJ"),!h.equals("PNGJ")&&(!h.equals("ZIPALL")&&!h.equals("ZIP"))&&this.invArg());!p&&(!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"+y.toUpperCase().$replace(";","|"));if(this.chk)return"";d=Array(1);b=this.vwr.getBoolean(603979934);if(q){b&&JU.Logger.startTimer("export");k=new java.util.Hashtable;k.put("type",h);null!=
u&&k.put("fileName",u);(g||null!=u)&&k.put("fullPath",d);k.put("width",Integer.$valueOf(z));k.put("height",Integer.$valueOf(t));k=this.vwr.generateOutputForExport(k);if(null==k||0==k.length)return"";if(l)return k;if(!h.equals("Povray")&&!h.equals("Idtf")||null==d[0])return this.writeMsg(k);l=h.equals("Idtf")?".tex":".ini";u=d[0]+l;a=new java.util.Hashtable;a.put("fileName",u);a.put("type",l);a.put("text",k);a.put("fullPath",d);g=this.vwr.processWriteOrCapture(a);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!=g&&((h=!g.startsWith("OK"))&&c.evalError(g,null),c.report(k,h));return""}q=null;y=!1;if(null==k){m=0;k=h.intern();if("MENU"===k)k=this.vwr.getMenu("");else if("PGRP"===k)k=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),s.equals("draw"),null,0,1);else if("PDB"===k||"PQR"===k)l?k=this.vwr.getPdbAtomData(null,null,"PQR"===k,w):(y=!0,h="PDB_"+k+"-coord "+w);else if("FILE"===k)"?".equals(u)&&
(u="?Jmol."+this.vwr.getP("_fileType")),l?k=this.vwr.getCurrentFileAsString("script"):y=!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",w,!1,k),k.startsWith("ERROR:")&&(q=k);else if("FUNCTION"===k)k=this.vwr.getFunctionCalls(null),h="TXT";else if("VAR"===k)null==B&&(B=c.getParameter(JS.SV.sValue(this.tokenAt(g?2:1,a)),1073742190,!0)),f=null,15==B.tok?(f=new JU.Lst,f.addLast(B.value.data)):
6==B.tok&&(f=null==u?new JU.Lst:this.prepareBinaryOutput(B)),null==f?(k=B.asString(),h="TXT"):null!=u&&(a=new java.util.Hashtable,a.put("data",f),null==(q=k=this.vwr.createZip(u,1==f.size()||u.endsWith(".png")||u.endsWith(".pngj")?"BINARY":"ZIPDATA",a))&&c.evalError("#CANCELED#",null));else if("SPT"===k)if(w)a=this.vwr.ms.getTaintedAtoms(2),this.vwr.setAtomCoordsRelative(JU.P3.new3(0,0,0),null),k=this.vwr.getStateInfo(),this.vwr.ms.setTaintedAtoms(a,2);else{if(k=this.vwr.getStateInfo(),null!=f||null!=
j)k=JV.FileManager.setScriptFileReferences(k,f,j,null)}else"ZIP"===k||"ZIPALL"===k?null!=u&&(a=new java.util.Hashtable,null!=e&&a.put("data",e),null==(q=k=this.vwr.createZip(u,h,a))&&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",l||this.showString(this.getShapeProperty(24,"jvxlFileInfo"))):(g&&(l&&null==u)&&(l=!1,u="\u0001"),m=-1,0>n&&(n=-1));null==k&&(k="");0==m&&(null==q||I(q,String))}if(!g)return k;if(l)return c.showStringPrint(k,!0),"";if(null!=q&&I(q,String))return this.writeMsg(q);if(y)return this.writeMsg(this.vwr.writeFileData(u,h,0,null));if(h.equals("SCENE"))q=x;else if(null==q&&(!p||null!=u))q=k;b&&JU.Logger.startTimer("write");p&&(c.refresh(!1),0>z&&(z=this.vwr.getScreenWidth()),
0>t&&(t=this.vwr.getScreenHeight()));a=new java.util.Hashtable;null!=u&&a.put("fileName",u);a.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb()));a.put("type",h);I(q,String)&&-2147483648==n?a.put("text",q):I(q,Array)&&a.put("bytes",q);null!=e&&a.put("scripts",e);null!=r&&a.put("bsFrames",r);a.put("fullPath",d);a.put("quality",Integer.$valueOf(n));a.put("width",Integer.$valueOf(z));a.put("height",Integer.$valueOf(t));a.put("nVibes",Integer.$valueOf(v));g=this.vwr.processWriteOrCapture(a);
null==g&&(g="canceled");p&&g.startsWith("OK")&&(g+="; width="+z+"; height="+t);b&&this.showString(JU.Logger.getTimerMsg("write",0));return this.writeMsg(g)},"~A");l(c$,"prepareBinaryOutput",function(a){var c=a.getMap();if(null==c||!c.containsKey("$_BINARY_$"))return null;a=new JU.Lst;for(var d,c=c.entrySet().iterator();c.hasNext()&&((d=c.next())||1);){var b=d.getKey();if(!b.equals("$_BINARY_$")){var e=d.getValue(),g=15==e.tok?e.value.data:null;null==g&&(e=e.asString(),g=e.startsWith(";base64,")?JU.Base64.decodeBase64(e):
e.getBytes());if(b.equals("_DATA_")){a=new JU.Lst;a.addLast(g);break}else b.equals("_IMAGE_")?(a.add(0,b),a.add(1,null),a.add(2,g)):(a.addLast(b),a.addLast(null),a.addLast(g))}}return a},"JS.SV");l(c$,"writeMsg",function(a){if(this.chk||null==a)return"";var c=!a.startsWith("OK");c&&(this.e.evalError(a,null),alert(a));this.e.report(a,c);return a},"~S");l(c$,"show",function(){var a=this.e,c=null,d=this.paramAsStr(1),b=null,e=null,g=2,e=this.getToken(1),f=I(e,JS.SV)&&1073741824!=e.tok?0:e.tok;4==f&&
(e=JS.T.getTokenFromName(d.toLowerCase()),null!=e&&(f=e.tok));1296041474!=f&&(1073742158!=f&&1715472409!=f)&&this.checkLength(-3);if(2==this.slen&&0<=d.indexOf("?"))this.showString(this.vwr.getAllSettings(d.substring(0,d.indexOf("?"))));else{switch(f){case 0:this.chk||(b=a.theToken.escape());break;case 1073741925:a.checkLength23();g=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 1715472409:b=this.plot(this.st);g=this.st.length;break;case 1073742189:a.checkLength23();g=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 134221829:this.chk||(b=JU.Escape.e(this.vwr.fm.cacheList()));break;case 1073741916:a.checkLength23();g=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<g?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 1275203608:this.chk||(f=Array(2),this.vwr.shm.getShapePropertyData(21,"allInfo",f),b=JS.SV.getVariable(f[1]).asString());break;case 1073742038:if(a.optParameterAsString(2).equalsIgnoreCase("1H")){g=
3;this.chk||(b=this.vwr.getNMRPredict(!1));break}this.chk||this.vwr.getNMRPredict(!0);return;case 1073741929:case 1073741879:case 134218757:this.checkLength(1073741879==f||134218757==f&&0!=this.tokAt(2)?g=3:2);if(this.chk)return;try{134218757!=f?(b=this.vwr.getDataBaseName(null),b=null!=b&&(b.startsWith("$")||b.startsWith(":"))?b.substring(1):null):a.optParameterAsString(2).equalsIgnoreCase("true")&&(b=this.vwr.getBioSmiles(null)),null==b&&(b=this.vwr.getSmiles(null))}catch(j){if(M(j,Exception))b=
j.getMessage();else throw j;}switch(f){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:g=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 1296041474:var f=0,h=e=null;
3<this.slen&&4!=this.tokAt(3)?(e=this.centerParameter(2),h=this.centerParameter(++a.iToken)):f=2==this.tokAt(2)?this.intParameter(2):0;var l=4==this.tokAt(a.iToken+1)?this.stringParameter(++a.iToken):null;this.checkLength(g=++a.iToken);this.chk||(b=this.vwr.ms.getSymTemp(!0).getSymmetryInfoString(this.vwr.ms,this.vwr.am.cmi,f,e,h,null,l));break;case 1648363544: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 134320141:a.checkLength23();this.chk||this.showString(this.vwr.getFunctionCalls(a.optParameterAsString(2)));return;case 36867:this.checkLength(2);this.chk||this.showString(this.vwr.getAllSettings(null));return;case 1073742184:if(2==this.slen){this.chk||this.vwr.showUrl(a.getFullPathName());return}e=this.paramAsStr(2);this.chk||this.vwr.showUrl(e);return;case 1765808134:d="defaultColorScheme";break;case 1610612740:d="scaleAngstromsPerInch";break;case 134221850:case 4138:if(this.chk)return;
0>this.vwr.am.cmi&&a.errorStr(30,"show "+a.theToken.value);b=this.plot(this.st);g=this.slen;break;case 14:case 1112152078:this.chk||(b=this.getContext(!1));break;case 1073741888:e=a.optParameterAsString(2);0<e.length&&(g=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==(g=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 1649022989:this.chk||(b="set strandCountForStrands "+this.vwr.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13));break;case 1613238294: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 1612709894:b="set selectHetero "+this.vwr.getBoolean(1612709894);break;case 1073741828:b=JU.Escape.eAP(this.vwr.getAdditionalHydrogens(null,!0,!0,null));break;case 1612709900:b="set selectHydrogens "+this.vwr.getBoolean(1612709900);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 1747587102:this.chk||(b=this.vwr.getUnitCellInfoText());break;case 1073742329:if(2==(g=this.slen)){this.chk||(b=this.vwr.getCoordinateState(this.vwr.bsA()));break}f=this.paramAsStr(2);this.chk||(b=this.vwr.stm.getSavedCoordinates(f));break;case 1073742158:!this.chk&&null==a.outputBuffer&&this.vwr.sm.clearConsole();if(2==(g=this.slen)){this.chk||(b=this.vwr.getStateInfo());break}e=
this.paramAsStr(2);if(e.startsWith("/")&&3==(g=this.slen)){if(!this.chk){e=e.substring(1).toLowerCase();f=JU.PT.split(this.vwr.getStateInfo(),"\n");b=new JU.SB;for(h=0;h<f.length;h++)0<=f[h].toLowerCase().indexOf(e)&&b.append(f[h]).appendC("\n");b=b.toString()}break}else if(1228935687==this.tokAt(2)&&4==(g=this.slen)){this.chk||(b=this.vwr.fm.getEmbeddedFileState(this.paramAsStr(3),!0));break}g=3;this.chk||(b=this.vwr.stm.getSavedState(e));break;case 1639976963:if(2==(g=this.slen)){this.chk||(b=this.vwr.ms.getProteinStructureState(this.vwr.bsA(),
134222350));break}f=this.paramAsStr(2);this.chk||(b=this.vwr.stm.getSavedStructure(f));break;case 134221834:f=3==(g=this.slen)?this.paramAsStr(2):null;this.chk||(b=this.vwr.getDataObj(f,null,-2),b=null==b?"no data":JU.Escape.encapsulateData(b[0],b[1],b[3].intValue()));break;case 1073742152:f=null;2==(g=this.slen)?this.chk||(f=this.vwr.ms.getSymTemp(!0).getSpaceGroupInfo(this.vwr.ms,null)):(e=this.paramAsStr(2),this.chk||(f=this.vwr.ms.getSymTemp(!0).getSpaceGroupInfo(this.vwr.ms,JU.PT.rep(e,"''",
'"'))));null!=f&&(b=""+f.get("spaceGroupInfo")+f.get("symmetryInfo"));break;case 1073742330:g=3;b=a.setObjectProperty();break;case 1678381065: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 1228935687:this.chk||this.vwr.sm.clearConsole();if(2==this.slen){this.chk||(b=this.vwr.getCurrentFileAsString("script"));null==b&&(b="<unavailable>");
break}g=3;c=this.paramAsStr(2);this.chk||(b=this.vwr.getFileAsString3(c,!0,null));break;case 4115:b=1073742327==this.tokAt(2)&&0<(g=3)?this.vwr.getModelFileInfoAll():this.vwr.getModelFileInfo();break;case 1610616855:f=2==(g=this.slen)?2147483647:this.intParameter(2);1>f&&this.invArg();this.chk||(this.vwr.sm.clearConsole(),0==a.scriptLevel&&this.vwr.removeCommand(),b=this.vwr.getSetHistory(f));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"),g=3):(e=2==(g=this.slen)?-2147483648:this.intParameter(2),this.chk||(b=this.getMoJvxl(e,1073877011==f)));break;case 1094717454:this.chk||(b=this.vwr.ms.getModelInfoAsString());break;case 537006096:this.chk||(b=this.vwr.getMeasurementInfoAsString());break;case 1073741863:g=3;!this.chk&&this.slen==g&&(b=this.vwr.getOrientationText(this.tokAt(2),null));break;case 1073742132:f=this.tokAt(2),0==f?f=1073742132:g=3;case 1073742178:case 4129:this.chk||
(b=this.vwr.getOrientationText(f,null));break;case 1073742077:g=2;if(3<this.slen)break;switch(f=this.tokAt(2)){case 1073742178:case 1073742132:case 4129:case 0:this.chk||(b=this.vwr.getOrientationText(f,null));break;default:e=a.optParameterAsString(2),b=this.vwr.getOrientationText(1073742035,e)}g=this.slen;break;case 1073742088:this.chk||(b=this.vwr.ms.getPDBHeader(this.vwr.am.cmi));break;case 134217762: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 1088421903: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 1665140738:d="solventProbeRadius";break;case 1086324744:if(3==(g=this.slen)&&1073742334==this.tokAt(2))f=1086324743;case 1073741864:case 1086324740:case 1073742120:case 1113589787:case 1086324742:case 1140850689:case 1073741982:this.chk||
(b=this.vwr.getChimeInfo(f));break;case 537022465:case 1610612738:case 20482:case 1612709912:c="?";break;case 1073742031:f=2==(g=this.slen)?null:this.paramAsStr(2);this.chk||(b=this.vwr.getBindingInfo(f));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(g++),e=a.getParameter(d,1073742190,!0),this.chk||(b=1073741992==f?e.toJSON():
e.escape())}this.checkLength(g);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,g=1;g<this.slen;++g)if(this.e.isColorParam(g))1<e&&this.e.bad(),0==e&&(b=D(2,0)),d||(c=3),b[e]=this.e.getArgbParam(g),0==e++&&(b[1]=~b[0]),g=this.e.iToken;else switch(this.getToken(g).tok){case 1073742335:this.e.checkLast(this.e.iToken=
1);this.e.iToken=1;break;case 1073742334:this.e.checkLast(this.e.iToken=1);a=J.c.STER.NONE;break;case 2:case 3:c=this.floatParameter(g);d=!0;break;case 1073741824:if(d||(c=3),a=J.c.STER.getStereoMode(this.paramAsStr(g)),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)||1073742335==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,g=c.tickParamAsStr(a,!0,!1,!1);a=c.iToken;var f=null,j=null,h=null,l=null,n=b=!1;switch(this.tokAt(++a)){case 4142:case 4141:n=!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 1073742330:f=c.objectNameParameter(++a);break;case 1678381065: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 1073742325:e=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 1073742325: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!=f?this.vwr.setCurrentCage(f):(n||null!=j)&&c.setCurrentCagePts(j,l),c.setObjectMad(33,"unitCell",b),null!=e&&this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),e,0),null!=g&&this.setShapeProperty(33,"tickInfo",g))},"~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 1140850689:this.e.clearDefinedVariableAtomSets();this.assignAtom(c,e,b);break;case 1677721602: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],g=JU.BSUtil.newAndSetBit(a);c=z(-1,[c]);var f=new JU.Lst;f.addLast(e);e=e.mi;this.vwr.sm.modifySend(a,e,3,this.e.fullCommand);try{g=this.vwr.addHydrogensInline(g,f,c),a=g.nextSetBit(0),this.vwr.ms.assignAtom(a,d,!1)}catch(j){if(!M(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(M(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]=L(-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 g=this.getShapeProperty(d,"moNumber");(null==g||0==g.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 1111490568:case 1111490569:case 1111490570:return c?180:-180;case 1111490565:case 1111490576:return c?
360:0;case 1111490574: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),g=0,f=0;g<b;f=d[g++])f=JU.PT.getTokens(a.substring(f,d[g])),JU.PT.parseFloatArrayData(f,e[g]=L(f.length,0));return e}f=JU.PT.getTokens(a.substring(0,d[0]));if(3!=f.length)return L(0,0,0,0);var j=JU.PT.parseInt(f[0]),
h=JU.PT.parseInt(f[1]),l=JU.PT.parseInt(f[2]);if(1>j||1>h||1>l)return L(1,1,1,0);for(var e=JU.AU.newFloat3(j,h),n=0,k=0,g=1,f=d[0];g<b&&n<j;f=d[g++])f=JU.PT.getTokens(a.substring(f,d[g])),f.length<l||(JU.PT.parseFloatArrayData(f,e[n][k]=L(f.length,0)),++k==h&&(n++,k=0));return n!=j?(System.out.println("Error reading 3D data -- nX = "+j+", but only "+n+" blocks read"),L(1,1,1,0)):e},"~S,~B");l(c$,"getBitsetPropertyFloat",function(a,c,d,b,e){c=null==d?this.e.getBitsetProperty(a,c,null,null,null,null,
!1,2147483647,!1):this.vwr.getDataObj(d,a,1);if(null==c||!JU.AU.isAF(c))return L(a.cardinality(),0);if(!Float.isNaN(b))for(a=0;a<c.length;a++)c[a]<b&&(c[a]=NaN);if(!Float.isNaN(e))for(a=0;a<c.length;a++)c[a]>e&&(c[a]=NaN);return c},"JU.BS,~N,~S,~N,~N");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.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);
