(function(aa,ba,ca,da,ea,fa,Q,L,R,T,U,P,V,W,ga,N,F,X,I,Y,ha,Z,ia,ja,ka,la,ma,na,oa,pa,B,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La,Ma,Na,Oa,Pa,Qa,k,$){Q("JS");R(null,"JS.ScriptExt",["JU.AU"],function(){c$=U(function(){this.e=this.vwr=null;this.chk=!1;this.st=null;this.slen=0;T(this,arguments)},JS,"ScriptExt");k(c$,"init",function(a){this.e=a;this.vwr=this.e.vwr;return this},"~O");k(c$,"atomExpressionAt",function(a){return this.e.atomExpressionAt(a)},"~N");k(c$,"checkLength",
function(a){this.e.checkLength(a)},"~N");k(c$,"error",function(a){this.e.error(a)},"~N");k(c$,"invArg",function(){this.e.invArg()});k(c$,"invPO",function(){this.error(23)});k(c$,"getShapeProperty",function(a,b){return this.e.getShapeProperty(a,b)},"~N,~S");k(c$,"paramAsStr",function(a){return this.e.paramAsStr(a)},"~N");k(c$,"centerParameter",function(a){return this.e.centerParameter(a,null)},"~N");k(c$,"floatParameter",function(a){return this.e.floatParameter(a)},"~N");k(c$,"getPoint3f",function(a,
b){return this.e.getPoint3f(a,b,!0)},"~N,~B");k(c$,"intParameter",function(a){return this.e.intParameter(a)},"~N");k(c$,"isFloatParameter",function(a){switch(this.e.tokAt(a)){case 2:case 3:return!0}return!1},"~N");k(c$,"setShapeProperty",function(a,b,c){this.e.setShapeProperty(a,b,c)},"~N,~S,~O");k(c$,"showString",function(a){this.e.showString(a)},"~S");k(c$,"stringParameter",function(a){return this.e.stringParameter(a)},"~N");k(c$,"getToken",function(a){return this.e.getToken(a)},"~N");k(c$,"tokAt",
function(a){return this.e.tokAt(a)},"~N");k(c$,"setShapeId",function(a,b,c){c&&this.invArg();b=this.e.setShapeNameParameter(b).toLowerCase();this.setShapeProperty(a,"thisID",b);return b},"~N,~N,~B");k(c$,"getColorTrans",function(a,b,c,d){c=3.4028235E38;1765808134!=a.theTok&&--b;switch(this.tokAt(b+1)){case 603979967:b++;c=this.isFloatParameter(b+1)?a.getTranslucentLevel(++b):this.vwr.getFloat(570425354);break;case 1073742074:b++,c=0}a.isColorParam(b+1)?d[0]=a.getArgbParam(++b):1073742333==this.tokAt(b+
1)?(d[0]=0,a.iToken=b+1):3.4028235E38==c?this.invArg():d[0]=-2147483648;return c},"JS.ScriptEval,~N,~B,~A");k(c$,"finalizeObject",function(a,b,c,d,f,e,j,g){f&&this.setShapeProperty(a,"set",e);-2147483648!=b&&this.e.setShapePropertyBs(a,"color",Integer.$valueOf(b),g);3.4028235E38!=c&&this.e.setShapeTranslucency(a,"","translucent",c,g);0!=d&&this.setShapeProperty(a,"scale",Integer.$valueOf(d));0<j&&(this.e.setMeshDisplayProperty(a,j,0)||this.invArg())},"~N,~N,~N,~N,~B,~O,~N,JU.BS");k(c$,"getIntArray2",
function(a){a=this.e.getToken(a).getList();for(var b=JU.AU.newInt2(a.size()),c=b.length;0<=--c;){var d=a.get(c).getList();null==d&&this.invArg();b[c]=F(d.size(),0);for(var f=b[c].length;0<=--f;)b[c][f]=d.get(f).intValue}return b},"~N");k(c$,"getAllPoints",function(a){var b=null,c=null;try{switch(this.e.tokAt(a)){case 7:b=this.e.getPointArray(a,-1,!1);break;case 12290:case 10:case 1073742325:c=this.atomExpressionAt(a)}if(null==b){null==c&&(c=this.vwr.getAllAtoms());var b=Array(c.cardinality()),d=c.nextSetBit(0);
for(a=0;0<=d;d=c.nextSetBit(d+1))b[a++]=this.vwr.ms.at[d]}}catch(f){if(!N(f,Exception))throw f;}3>b.length&&this.invArg();return b},"~N")});Q("JS");R(["JS.ScriptExt"],"JS.CmdExt","java.lang.Boolean $.Float $.Long java.util.Hashtable $.Map 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 $.Measurement JS.SV $.ScriptCompiler $.ScriptError $.ScriptEval $.ScriptInterruption $.ScriptMathProcessor $.ScriptParam $.T JU.BSUtil $.BoxInfo $.C $.Edge $.Elements $.Escape $.Logger $.Parser $.Point3fi $.SimpleUnitCell JV.FileManager $.StateManager $.Viewer".split(" "),
function(){c$=Y(JS,"CmdExt",JS.ScriptExt);W(c$,function(){Z(this,JS.CmdExt,[])});$(c$,"dispatch",function(a,b,c){this.chk=this.e.chk;this.slen=this.e.slen;this.st=c;switch(a){case 1073741866:c[0].value=this.prepareBinaryOutput(c[0]);break;case 4098:this.assign(1);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 4122:this.invertSelected();break;case 4124:this.macro();break;case 4125:this.mapProperty();break;case 4126:this.minimize();break;case 603983903:this.modelkit();break;case 1275072532:this.modulation();break;case 4130:this.mutate();break;case 4131:this.navigate();break;case 4133:case 134221850:case 4138:this.plot(c);break;case 134222350:this.show();break;
case 528443:this.stereo();break;case 1814695966:this.unitcell(b?2:1);break;case 134221856:return this.write(b?c: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");k(c$,"modelkit",function(){var a=!0,b=0;switch(this.tokAt(1)){case 1073742334:a=!1;case 0:case 1073742335:this.chk||this.vwr.setBooleanProperty("modelkitmode",a);return;case 528432:this.e.cmdRotate(!1,!1);return;case 4145:this.e.cmdRotate(!1,!0);return;
case 4098:this.assign(2);return}for(var c=this.vwr.getModelkit(!1),a=0;0!=(a=this.tokAt(++b));){var d=this.paramAsStr(b).toLowerCase(),f=null;switch(a){case 36867:d=this.paramAsStr(++b);f=this.paramAsStr(++b);break;case 1073742024:f=this.paramAsStr(++b).toLowerCase();JU.PT.isOneOf(f,";view;edit;molecular;")||this.invArg();break;case 1814695966:f=this.paramAsStr(++b).toLowerCase();JU.PT.isOneOf(f,";packed;extend;")||this.invArg();break;case 1296041986:switch(this.tokAt(++b)){case 4:case 1073742333:f=
this.paramAsStr(b);break;case 12:f=this.getToken(b).value;break;case 2:f=Integer.$valueOf(this.getToken(b).intValue);break;default:this.e.isCenterParameter(b)?(d="center",f=this.e.centerParameter(b,null),b=this.e.iToken):this.invArg()}break;case 1088421903:f=this.paramAsStr(++b).toLowerCase();JU.PT.isOneOf(f,";none;applylocal;retainlocal;applyfull;")||this.invArg();break;case 1073742066:if(f=this.paramAsStr(b+1),f.equals("none")){++b;break}case 12289:case 134217751:f=this.e.atomCenterOrCoordinateParameter(++b,
null);b=this.e.iToken;break;default:if(JU.PT.isOneOf(d,";showsymopinfo;clicktosetelement;addhydrogen;addhydrogens;")){a=0==a||1073742335==this.tokAt(++b);f=Boolean.$valueOf(a);break}if(JU.PT.isOneOf(d,";view;edit;molecular;")){f=d;d="mode";break}if(JU.PT.isOneOf(d,";packed;extend;")){f=d;d="unitcell";break}this.invArg()}null!=f&&!this.chk&&c.setProperty(d,f)}});k(c$,"macro",function(){if(!this.chk){var a=this.e.optParameterAsString(1);if(0==a.length)this.showString(this.vwr.getMacro(null));else{var b=
this.vwr.getMacro(a);null==b?this.showString("macro "+a+" could not be found. Current macros include:\n"+this.vwr.getMacro(null)):(this.showString("running "+b),this.e.cmdScript(4124,b,null))}}});k(c$,"evalParallel",function(a,b){this.chk=this.e.chk;this.slen=this.e.slen;var c=(new JS.ScriptEval).setViewer(this.vwr);c.historyDisabled=!0;c.compiler=new JS.ScriptCompiler(this.vwr);c.sm=b;try{c.restoreScriptContext(a,!0,!1,!1),c.setAllowJSThreads(!1),c.dispatchCommands(!1,!1,!1)}catch(d){if(N(d,Exception))return this.e.vwr.setStringProperty("_errormessage",
""+d),null==c.thisContext&&(JU.Logger.error("Error evaluating context "+d),d.printStackTrace()),!1;throw d;}return!0},"JS.ScriptContext,JV.ShapeManager");k(c$,"getBitsetIdent",function(a,b,c,d,f,e){var j=!L(c,JM.BondSet);j&&(null==b?b=this.vwr.getStandardLabelFormat(0):0==b.length&&(b="%[label]"));var g=null==b?-1:b.indexOf("%"),h=2147483647!=f;if(null==a||this.chk||j&&0>g)return null==b&&(b=""),e?B(-1,[b]):b;var g=this.vwr.ms,s=0,m=g.getLabeler();c=j||!d?null:c.associatedAtoms;null==c&&(null!=b&&
0<b.indexOf("%D"))&&(c=this.vwr.ms.getAtomIndices(a));d=null==b||0==b.length;var p=j||d?null:JM.LabelToken.getBondLabelValues();b=d?null:j?m.compile(this.vwr,b,"\x00",null):m.compile(this.vwr,b,"\u0001",p);var v=h?1:a.cardinality(),l=Array(v),k=new JU.P3;for(f=h?f:a.nextSetBit(0);0<=f;f=a.nextSetBit(f+1)){var u;j?u=d?g.at[f].getInfo():m.formatLabelAtomArray(this.vwr,g.at[f],b,"\x00",c,k):(u=g.bo[f],u=d?u.getIdentity():m.formatLabelBond(this.vwr,u,b,p,c,k));u=JU.PT.formatStringI(u,"#",s+1);l[s++]=
u;if(h)break}return 1==v&&!e?l[0]:l},"JU.BS,~S,~O,~B,~N,~B");k(c$,"getLoadSymmetryParams",function(a,b,c){var d=this.e;this.chk=d.chk;this.slen=d.slen;var f=null,e=this.tokAt(a);if(1073742332==e||8==e)f=d.getPointOrPlane(a,!1,!0,!1,!0,3,3,!0),e=this.tokAt(a=d.iToken+1);switch(e){case 1073741938:case 1073742080:case 1094713350:case 1073742163:case 1073742114:case 134217764:case 1814695966:null==f&&(f=JU.P3.new3(555,555,-1)),d.iToken=a-1}e=null;if(null!=f){c.put("lattice",f);a=d.iToken+1;b.append(" "+
JU.SimpleUnitCell.escapeMultiplier(f));a=this.checkPacked(a,c,b);1094713350==this.tokAt(a)&&(c.put("centroid",Boolean.TRUE),b.append(" CENTROID"),a=this.checkPacked(++a,c,b));if(1073742163==this.tokAt(a)){var j;b.append(" SUPERCELL ");if(d.isPoint3f(++a)){j=this.getPoint3f(a,!1);if(j.x!=P(j.x)||j.y!=P(j.y)||j.z!=P(j.z)||1>j.x||1>j.y||1>j.z)d.iToken=a,this.invArg();a=d.iToken}else j=this.stringParameter(a);b.append(JU.Escape.e(j));c.put("supercell",j);a=this.checkPacked(++a,c,b)}j=0;1073742114==this.tokAt(a)&&
(a++,j=this.floatParameter(a++),b.append(" range "+j));c.put("symmetryRange",Float.$valueOf(j));j=null;var g;j=-2147483648;134217764==this.tokAt(a)&&(++a,j=JU.PT.rep(this.paramAsStr(a++),"''",'"'),b.append(" spacegroup "+JU.PT.esc(j)),j.equalsIgnoreCase("ignoreOperators")?j=-999:(0==j.length?(g=this.vwr.getCurrentUnitCell(),null!=g&&(j=g.getSpaceGroupName())):0<=j.indexOf(",")&&9>f.x&&(9>f.y&&0==f.z)&&(j+="#doNormalize=0"),c.put("spaceGroupName",j),j=-2));f=null;if(1814695966==this.tokAt(a)){++a;
g=d.optParameterAsString(a);0==g.length?(g=this.vwr.getCurrentUnitCell(),null!=g&&(f=g.getUnitCellAsArray(!0),e=g.getCartesianOffset())):4==this.tokAt(a)?(f=I(6,0),JU.SimpleUnitCell.setOabc(g,f,null)):f=d.floatParameterSet(a,6,9);(null==f||6!=f.length&&9!=f.length)&&this.invArg();b.append(" unitcell [");for(a=0;a<f.length;a++)b.append((0==a?"":" ")+f[a]);b.append("]");c.put("unitcell",f);-2147483648==j&&(j=-1);a=d.iToken+1}-2147483648!=j&&c.put("spaceGroupIndex",Integer.$valueOf(j))}null!=e?d.coordinatesAreFractional=
!1:1073742066==this.tokAt(a)&&(e=this.getPoint3f(++a,!0));null!=e&&(d.coordinatesAreFractional?(e.setT(d.fractionalPoint),c.put("unitCellOffsetFractional",d.coordinatesAreFractional?Boolean.TRUE:Boolean.FALSE),b.append(" offset {"+e.x+" "+e.y+" "+e.z+"/1}")):b.append(" offset "+JU.Escape.eP(e)),c.put("unitCellOffset",e),a=d.iToken+1);return a},"~N,JU.SB,java.util.Map");k(c$,"checkPacked",function(a,b,c){switch(this.tokAt(a)){case 1073741938:b.put("packed",Boolean.TRUE);var d=null,f=this.tokAt(++a);
switch(f){case 1814695966:case 1678381065:break;default:this.e.isArrayParameter(a)?(d=this.e.getPointArray(a,-1,!1),a=this.e.iToken):this.isFloatParameter(a)?(d=this.floatParameter(a),d=B(-1,[new JU.P3,JU.P3.new3(d,d,d)])):(d=[],--a)}a++;if(this.e.chk)break;switch(f){case 1814695966:d=this.e.optParameterAsString(a++).toLowerCase();if(JU.PT.isOneOf(d,";conventional;primitive;"))return b.put("fillRange",d),c.append(' FILL UNITCELL "'+d+'"'),a;d=this.vwr.getCurrentUnitCell();if(null!=d){d=JU.BoxInfo.toOABC(d.getUnitCellVerticesNoOffset(),
d.getCartesianOffset());break}case 1678381065:d=JU.BoxInfo.toOABC(this.vwr.ms.getBBoxVertices(),null)}switch(d.length){case 2:f=d[1];d=B(-1,[d[0],JU.P3.newP(d[0]),new JU.P3,new JU.P3]);d[1].x=f.x;d[2].y=f.y;d[3].z=f.z;break;case 3:d=B(-1,[new JU.P3,d[0],d[1],d[2]]);break;case 4:break;default:d=B(-1,[new JU.P3,JU.P3.new3(10,0,0),JU.P3.new3(0,10,0),JU.P3.new3(0,0,10)])}b.put("fillRange",d);c.append(" FILL ["+d[0]+d[1]+d[2]+d[3]+"]");break;case 1073742080:d=NaN,this.isFloatParameter(++a)&&(d=this.floatParameter(a++)),
this.e.chk||(b.put("packed",Boolean.TRUE),c.append(" PACKED"),Float.isNaN(d)||(b.put("packingError",Float.$valueOf(d)),c.append(" "+d)))}return a},"~N,java.util.Map,JU.SB");k(c$,"cache",function(){var a=this.tokAt(1),b=null,c=2;switch(a){case 1275069441:case 1073742119:b=this.e.optParameterAsString(c++);case 1073741882:this.checkLength(c);this.chk||("all".equals(b)&&(b=null),b=this.vwr.cacheFileByName(b,1275069441==a),this.showString(0>b?"cache cleared":b+" bytes "+(1275069441==a?" cached":" removed")));
break;default:this.invArg()}});k(c$,"calculate",function(){var a=!1,b=!1,c=null,d=null,f=this.e,e=-2147483648,e=2;if(2<=(f.iToken=f.slen))switch(f.clearDefinedVariableAtomSets(),this.getToken(1).tok){case 1073741824:this.checkLength(2);break;case 1086324752:f.iToken=1;c=2==this.slen?null:this.atomExpressionAt(2);f.checkLast(f.iToken);this.chk||f.showString(this.vwr.calculateChirality(c));return;case 1631586315:this.checkLength(2);if(this.chk)return;e=this.vwr.calculateFormalCharges(null);this.showString(J.i18n.GT.i(J.i18n.GT.$("{0} charges modified"),
e));return;case 1075838996:this.checkLength(2);this.chk||this.vwr.ms.assignAromaticBondsBs(!0,null);return;case 1613238294:2!=f.slen&&(c=(b=1639976963==this.tokAt(++f.iToken))?this.vwr.bsA():this.atomExpressionAt(f.iToken),!b&&1639976963!=this.tokAt(++f.iToken)&&(d=this.atomExpressionAt(f.iToken)));if(this.chk)return;e=this.vwr.autoHbond(c,d,!1);-2147483648!=e&&f.report(J.i18n.GT.i(J.i18n.GT.$("{0} hydrogen bonds"),Math.abs(e)),!1);return;case 1612709900:(a=1073742335==this.tokAt(2))&&f.iToken++;
c=this.slen==(a?3:2)?null:this.atomExpressionAt(a?3:2);f.checkLast(f.iToken);this.chk||(this.vwr.addHydrogens(c,!1,!1),a&&(null==c&&(c=this.vwr.bsA()),this.vwr.makeConnections(0.1,1E8,515,1073742025,c,c,null,!1,!1,0),this.vwr.ms.assignAromaticBondsBs(!0,null)));return;case 1111492619:f.iToken=1;c=2==this.slen?null:this.atomExpressionAt(2);f.checkLast(f.iToken);this.chk||f.getPartialCharges(c);return;case 1088421903:case 134217762:this.chk||(1275203608==this.tokAt(2)?(a=4==this.tokAt(3)?this.stringParameter(3):
null,c=null!=a||3==this.slen?null:this.atomExpressionAt(3),c=B(-1,[a,null,c]),this.showString(f.getShapePropertyData(21,"symmetry",c)?c[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:c=4>this.slen||this.isFloatParameter(3)?null:this.atomExpressionAt(2);
switch(this.tokAt(++f.iToken)){case 4138:break;case 1111490587:if(this.chk)return;f.showString(this.vwr.getAnnotationParser(!0).calculateDSSRStructure(this.vwr,c));return;case 1073741915:b=!0;e=this.slen==f.iToken+1?2:P(this.floatParameter(++f.iToken));break;case 0:b=this.vwr.getBoolean(603979826);break;default:this.invArg()}this.chk||this.showString(this.vwr.calculateStructures(c,b,!0,e));return;case 659482:c=f.iToken+1<this.slen?this.atomExpressionAt(++f.iToken):null;d=f.iToken+1<this.slen?this.atomExpressionAt(++f.iToken):
null;this.checkLength(++f.iToken);this.chk||(e=this.vwr.calculateStruts(c,d),0<e&&(this.setShapeProperty(1,"type",Integer.$valueOf(32768)),f.setShapePropertyBs(1,"color",Integer.$valueOf(16777215),null),f.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"),e)));return;case 2097180:a=!0;case 1111490575:b=!1;switch(this.tokAt(2)){case 134217759:f.iToken++;break;case 0:b=!a;break;case 1073741952:b=
!0;f.iToken++;break;default:b=!0}c=f.iToken+1<this.slen?this.atomExpressionAt(++f.iToken):this.vwr.bsA();this.checkLength(++f.iToken);this.chk||this.vwr.calculateSurface(c,b?3.4028235E38:-1);return}f.errorStr2(53,"CALCULATE","aromatic? hbonds? hydrogen? formalCharge? partialCharge? pointgroup? straightness? structure? struts? surfaceDistance FROM? surfaceDistance WITHIN?")});k(c$,"capture",function(){if(!this.chk&&!this.vwr.allowCapture())this.showString("Cannot capture on this platform");else{var a=
this.vwr.captureParams,b=null==a?"GIF":a.get("type"),c=0,d=0,f=this.e.slen,e="",j=1073742070!=this.vwr.am.animationReplayMode,g=1,h=this.tokAt(g),s=603979967==h;s&&(h=this.tokAt(++g));var m=null;switch(0==h?h=102409:h){case 4:e=this.e.optParameterAsString(g++);if(0==e.length){d=102409;break}b=e.toLowerCase();b.endsWith(".gift")||b.endsWith(".pngt")?(s=!0,e=e.substring(0,e.length-1),b=e.toLowerCase()):!b.endsWith(".gif")&&!b.contains(".png")&&(e+=".gif");b.endsWith(".png")?(b.endsWith("0.png")||(e=
e.substring(0,e.length-4)+"0000.png"),b="PNG"):b="GIF";s&&(b+="T");h=e.indexOf("0000.");h=0>h||h!=e.lastIndexOf(".")-4;d=!1;528411==this.tokAt(g)&&(j=!0,this.tokAt(++g));switch(this.tokAt(g)){case 134222850:m=this.stringParameter(++g);break;case 1073742129:d=!0;case 1611141175:a="y";j=!0;g++;d?(g<f&&2!=this.tokAt(g)&&(a=this.e.optParameterAsString(g++).toLowerCase()),m="rotate Y 10 10;rotate Y -10 -10;rotate Y -10 -10;rotate Y 10 10",f=g<f?this.intParameter(g++):5,m=0>f?JU.PT.rep(m,"10;",""+-f+";"):
JU.PT.rep(m,"10",""+f)):(g<f&&(a=this.e.optParameterAsString(g++).toLowerCase()),m="rotate Y 360 30;");if(this.chk)return;this.vwr.setNavigationMode(!1);if(""===a||0>"xyz".indexOf(a))a="y";m=JU.PT.rep(m,"Y",a);break;case 3:case 2:c=this.floatParameter(g++)}if(this.chk)return;if(null!=m){m="set waitformoveto true;"+m+";set waitformoveto "+this.vwr.g.waitForMoveTo;m="capture "+(s?"transparent ":"")+JU.PT.esc(e)+(j?" LOOP;":";")+m+";capture end;";this.e.cmdScript(0,null,m);return}d=1073742031;a=new java.util.Hashtable;
s=this.vwr.getInt(553648132);h&&(a.put("streaming",Boolean.TRUE),j||this.showString(J.i18n.GT.o(J.i18n.GT.$("Note: Enable looping using the LOOP keyword just after the file name or {0}"),B(-1,["ANIMATION MODE LOOP"]))),this.showString(J.i18n.GT.o(J.i18n.GT.$("Animation delay based on: {0}"),B(-1,["ANIMATION FPS "+s]))));a.put("captureFps",Integer.$valueOf(s));break;case 102409:case 1073741874:null!=a&&a.put("captureSilent",Boolean.TRUE);case 1073742335:case 1073742334:this.checkLength(-2);d=h;break;
default:this.invArg()}this.chk||null==a||(a.put("type",b),b=Integer.$valueOf(this.vwr.getBackgroundArgb()),a.put("backgroundColor",b),a.put("fileName",e),a.put("quality",Integer.$valueOf(-1)),a.put("endTime",Long.$valueOf(0>=c?-1:System.currentTimeMillis()+V(1E3*c))),a.put("captureMode",JS.T.nameOf(d).toLowerCase()),a.put("captureLooping",j?Boolean.TRUE:Boolean.FALSE),c=this.vwr.processWriteOrCapture(a),null==c&&(c="canceled"),JU.Logger.info(c))}});k(c$,"centerAt",function(){var a=this.getToken(1).tok;
switch(a){case 1073741826:case 96:case 1678381065:break;default:this.invArg()}var b=JU.P3.new3(0,0,0);5==this.slen?(b.x=this.floatParameter(2),b.y=this.floatParameter(3),b.z=this.floatParameter(4)):this.e.isCenterParameter(2)?(b=this.centerParameter(2),this.e.checkLast(this.e.iToken)):this.checkLength(2);!this.chk&&!this.vwr.isJmolDataFrame()&&this.vwr.tm.setCenterAt(a,b)});k(c$,"compare",function(){var a=this.e,b=!1,c=!1,d=!1,f=!1,e=!1,j=null,g=null,h=null,s=null,m=null,p=null;a.iToken=0;var v=this.isFloatParameter(1)?
this.floatParameter(++a.iToken):NaN,l=this.atomExpressionAt(++a.iToken),k=null,u=null;a.isArrayParameter(++a.iToken)?k=a.getPointArray(a.iToken,-1,!1):1140850689!=this.tokAt(a.iToken)&&(u=this.atomExpressionAt(a.iToken));var y=null,r=!1,n=null,q=JU.BSUtil.copy(l);null!=u&&q.or(u);for(var q=f=null==k&&null!=u&&q.equals(l),t=a.iToken+1;t<this.slen;++t)switch(this.getToken(t).tok){case 4115:q=!0;break;case 134218757:if(r=!0,4!=this.tokAt(t+1)){n="*";break}case 134218756:n=this.stringParameter(++t);break;
case 1677721602:c=e=!0;n=this.paramAsStr(++t);n.equalsIgnoreCase("SMILES")&&(r=!0,n="*");break;case 3:case 2:v=Math.abs(this.floatParameter(t));break;case 268435504:break;case 2109448:y=this.atomExpressionAt(++t);t=a.iToken;break;case 10:case 1073742325:null!=p&&this.invArg();var h=this.atomExpressionAt(a.iToken),M=f?0:this.tokAt(a.iToken+1),s=null==k&&a.isArrayParameter(a.iToken+1)?null:10==M||1073742325==M?this.atomExpressionAt(++a.iToken):JU.BSUtil.copy(h);null!=y&&(h.and(y),null!=s&&s.and(y));
null==s?k=a.getPointArray(++a.iToken,-1,!1):null!=u&&s.and(u);null==m&&(m=new JU.Lst);m.addLast(B(-1,[h,s]));t=a.iToken;break;case 7:null!=m&&this.invArg();b=!0;j=a.getQuaternionArray(a.theToken.getList(),1073742001);this.getToken(++t);g=a.getQuaternionArray(a.theToken.getList(),1073742001);null==p&&(p=new JU.Lst);p.addLast(B(-1,[j,g]));break;case 1073742077:b=!0;break;case 134217751:case 1140850689:b=!1;break;case 528432:c=!0;break;case 4160:d=!0;break;default:this.invArg()}if(!this.chk){q&&(v=0);
Float.isNaN(v)||0>v?v=1:!c&&!d&&(c=d=!0);f=0!=v;(M=!b&&null==n||null!=k)&&J.api.Interface.getInterface("JU.Eigen",this.vwr,"script");null==m&&null==p&&(null==y?(h=M?this.vwr.getAtomBitSet("spine"):new JU.BS,0>h.nextSetBit(0)?(h=l,s=u):(s=JU.BSUtil.copy(h),h.and(l),s.and(u))):(h=JU.BSUtil.copy(l),s=JU.BSUtil.copy(u),h.and(y),h.and(l),null!=s&&(s.and(y),s.and(u))),m=new JU.Lst,m.addLast(B(-1,[h,s])));if(q){l=this.vwr.ms.getModelBS(l,!1);y=Array(l.cardinality());t=0;for(s=l.nextSetBit(0);0<=s;s=l.nextSetBit(s+
1),t++)y[t]=this.vwr.getModelUndeletedAtomsBitSet(s)}else y=B(-1,[l]);for(s=0;s<y.length;s++){for(var l=y[s],x=I(2,0),z=null,G=new JU.Lst,D=null,A=q?new JU.Lst:m,t=0;t<m.size();++t){var w=m.get(t);q&&A.addLast(w=B(-1,[JU.BSUtil.copy(w[0]),w[1]]));w[0].and(l)}var H=null,C=null;if(M){null!=k&&(A.clear(),A.addLast(B(-1,[h,k])));try{D=this.vwr.getCenterAndPoints(A,!0)}catch(F){if(N(F,Exception))this.invArg();else throw F;}z=D[0].length-1;for(t=1;t<=z;t++){G=D[0][t];w=D[1][t];if(!L(G,JM.Atom)||!L(w,JM.Atom))break;
JU.Logger.info(" atom 1 "+G.getInfo()+"\tatom 2 "+w.getInfo())}z=JU.Measure.calculateQuaternionRotation(D,x);t=Float.isNaN(x[1])?NaN:Math.round(100*x[0])/100;x=Float.isNaN(x[1])?NaN:Math.round(100*x[1])/100;this.showString("RMSD "+t+" --\x3e "+x+" Angstroms")}else if(b){if(null==p)for(t=0;t<A.size();t++){w=A.get(t);j=this.vwr.getAtomGroupQuaternions(w[0],2147483647);g=this.vwr.getAtomGroupQuaternions(w[1],2147483647);for(z=0;z<j.length&&z<g.length;z++)G.addLast(g[z].div(j[z]))}else for(z=0;z<j.length&&
z<g.length;z++)G.addLast(g[z].div(j[z]));x[0]=0;j=G.toArray(Array(G.size()));z=JU.Quat.sphereMean(j,x,1E-4);this.showString("RMSD = "+x[0]+" degrees")}else{t=new JU.M4;H=new JU.P3;if(("*".equals(n)||"".equals(n))&&null!=l)try{n=this.vwr.getSmiles(l)}catch(O){if(N(O,Exception))a.evalError(O.getMessage(),null);else throw O;}if(e){var K;if(null==l||null==u||null==(K=a.getSmilesExt().getFlexFitList(l,u,n,!r)))break;this.vwr.setDihedrals(K,null,1)}x=a.getSmilesExt().getSmilesCorrelation(l,u,n,null,null,
t,null,!1,null,H,!1,32|(r?1:2));if(Float.isNaN(x)){this.showString("structures do not match");break}d&&(C=new JU.V3,t.getTranslation(C));c&&(z=new JU.M3,t.getRotationScale(z),z=JU.Quat.newM(z));this.showString("RMSD = "+x+" Angstroms")}null!=D&&(H=D[0][0]);null==H&&(D=this.vwr.getCenterAndPoints(A,!0),H=D[0][0]);A=new JU.P3;x=NaN;d&&(null==C&&(C=JU.V3.newVsub(D[1][0],H)),x=1E10);c&&(null==z&&a.evalError("option not implemented",null),A.add2(H,z.getNormal()),x=z.getTheta(),0==x&&d&&(0.01<C.length()?
x=1E10:c=d=f=!1));if(!Float.isNaN(x)&&!Float.isNaN(A.x)&&(D=null,c&&(d&&0!=v)&&(D=this.vwr.ms.getAtomPointVector(l),t=JS.ScriptMathProcessor.getMatrix4f(z.getMatrix(),C),D=JU.Measure.transformPoints(D,t,H)),a.useThreads()||(f=!1),this.vwr.rotateAboutPointsInternal(a,H,A,x/v,x,f,l,C,D,null,null)&&f&&a.isJS))throw new JS.ScriptInterruption(a,"compare",1);}}});k(c$,"configuration",function(){var a=null,b=this.vwr.bsA();if(1==this.slen){if(this.chk)return;a=this.vwr.ms.setConformation(b);this.vwr.ms.addStateScript("select",
null,b,null,"configuration",!0,!1)}else if(this.isFloatParameter(1)){b=this.intParameter(this.e.checkLast(1));if(this.chk)return;a=this.vwr.ms.getConformation(this.vwr.am.cmi,b-1,!0,null);this.vwr.addStateScript("configuration "+b+";",!0,!1)}else{a=this.atomExpressionAt(1);if(this.chk)return;b=this.intParameter(this.e.checkLast(this.e.iToken+1));this.vwr.addStateScript("configuration "+JU.Escape.eBS(a)+" "+b+";",!0,!1);a=this.vwr.ms.getConformation(this.vwr.am.cmi,b-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)});k(c$,"measure",function(){var a=this.e,b=null,c=0,d=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 f=this.stringParameter(3==this.slen?2:4);if(this.chk)return;var e=this.vwr.ms.at,
b=this.vwr.ms.ac,c=null;try{c=this.vwr.getSmilesMatcher().getCorrelationMaps(f,e,b,this.vwr.bsA(),2)}catch(j){if(N(j,Exception))a.evalError(j.getMessage(),null);else throw j;}if(null==c)return;this.setShapeProperty(6,"maps",c);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 g=this.intParameter(2)-1;this.chk||this.vwr.deleteMeasurement(g)}return}}for(var h=0,s=0,m=-1,p=-1,k=-1,l=F(5,0),E=I(-1,[3.4028235E38,3.4028235E38]),u=!1,y=!1,r=!1,n=!0,q=null,t=null,f=268435538,B=e=null,x=null,z=null,G=new JU.Lst,D=new JU.BS,A=null,w=null,H=0,C=0,S=NaN,O=null,g=1;g<
this.slen;++g)switch(this.getToken(g).tok){case 1073741974:1!=g&&this.invArg();b=a.optParameterAsString(++g);continue;case 1073741824:a.errorStr(24,"ALL, ALLCONNECTED, DELETE");break;default:this.error(15);break;case 268435568:134217736!=this.tokAt(g+1)&&this.invArg();g++;r=!0;break;case 1073741832:O=this.paramAsStr(++g).toLowerCase();break;case 134217736:case 1073741834:case 1073742327:y=1073741834==a.theTok;p=-1;u=!0;y&&r&&this.invArg();break;case 1765808134:c=JU.C.getColix(a.getArgbParam(++g));
g=a.iToken;break;case 1073742066:a.isPoint3f(++g)?(d=this.getPoint3f(g,!1),d=I(-1,[1,d.x,d.y,d.z,0,0,0])):d=a.floatParameterSet(g,7,7);g=a.iToken;break;case 1665140738:case 1073741917:C=P((1665140738==a.theTok?2E3:1E3)*this.floatParameter(++g));null!=b&&0>=C&&(C=-1);break;case 3:null!=q&&this.invArg();n=u=!0;k=(k+1)%2;E[k]=this.floatParameter(g);break;case 12291:268435538!=f&&this.invArg();f=12291;break;case 4114:var K=this.floatParameter(++g),Q=this.paramAsStr(++g),R=this.paramAsStr(++g);this.chk||
(B=this.vwr.getFont3D(Q,R,K));break;case 2:K=this.intParameter(g);if(u)n=!0,k=(k+1)%2,E[k]=K;else{p=this.vwr.ms.getFirstAtomIndexFromAtomNumber(K,this.vwr.getVisibleFramesBitSet());if(!this.chk&&0>p)return;null!=A&&this.invArg();4<(l[0]=++h)&&a.bad();l[h]=p}break;case 1094713359:m=this.intParameter(++g);break;case 1073742334:268435538!=f&&this.invArg();f=1073742334;break;case 1073742335:268435538!=f&&this.invArg();f=1073742335;break;case 1073742114:n=u=!0;p=-1;break;case 1073741989:case 1073741990:t=
Boolean.$valueOf(1073741989==a.theTok);u=!0;r=1073741990==a.theTok;break;case 1648363544:0<=k&&this.invArg();q=a.encodeRadiusParameter(g,!1,!0);if(null==q)return;q.values=E;g=a.iToken;u=r=!0;t=Boolean.$valueOf(!1);1==H&&(H++,h++,K=JU.BSUtil.copy(D),JU.BSUtil.invertInPlace(K,this.vwr.ms.ac),K.and(this.vwr.ms.getAtomsWithinRadius(5,D,!1,null)),G.addLast(K));break;case 12290:case 10:case 1073742325:H++;case 1073742332:case 8:case 1073742330:0<=p&&this.invArg();h=Array(1);A=a.centerParameter(g,h);if(L(h[0],
JU.BS)&&(A=D=h[0],!this.chk&&0==D.length()))return;L(A,JU.P3)&&(g=new JU.Point3fi,g.setT(A),g.mi=m,A=g);4<(h=++s)&&a.bad();g=a.iToken;G.addLast(A);break;case 1715472409:x=this.paramAsStr(g);break;case 1073742188:S=this.floatParameter(++g);break;case 4:K=this.stringParameter(g);JM.Measurement.isUnits(K)?z=K:e=K;break;case 1073742164:w=a.tickParamAsStr(g,!1,!0,!0),g=a.iToken,f=12290}(null!=q&&(0<=k||2!=h)||2>h&&null==b&&(null==w||1==h))&&a.bad();null!=e&&0!=e.indexOf(h+":")&&(e=h+":"+e);n&&E[1]<E[0]&&
(E[1]=E[0],E[0]=3.4028235E38==E[1]?3.4028235E38:-200);if(!this.chk)if(a=null!=b&&null==A&&268435538==f,null!=A||null!=w||a){null==q&&(q=new J.atomdata.RadiusData(E,0,null,null));null!=w&&(w.id="default");if(a)f=266284;else if(null!=A&&(null!=x||null!=e)&&268435538==f)f=12290;l=null;if(null!=B||null!=O||0!=c||null!=e&&(a||0<=e.indexOf("\n")))l=J.api.Interface.getInterface("JM.Text",this.vwr,"script").newMeasure(this.vwr,B,c);null!=l&&(l.pymolOffset=d,l.setAlignmentLCR(O));this.setShapeProperty(6,"measure",
this.vwr.newMeasurementData(b,G).set(f,null,q,x,e,z,w,y,r,t,u,C,c,l,S))}else switch(a=null==b?l:b,f){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==e?"toggle":"toggleOn",a),null!=e&&this.setShapeProperty(6,"setFormats",e)}});k(c$,"connect",function(a){var b=this.e,c=I(2,0),d=Array(2);d[0]=d[1]=this.vwr.bsA();var f=NaN,e=F(-1,[-2147483648]),j=0,
g=131071,h=1073742026,s=!1,m=!1,p=!1,k=3.4028235E38,l=!1,E=0,u=0,y=new JU.BS,r=!1,n=0,q=0,t=0,M=!1;if(1==this.slen)this.chk||this.vwr.rebondState(b.$isStateScript);else if(1073877011==this.tokAt(1))this.chk||this.vwr.connectNBO(this.e.optParameterAsString(2));else{for(;a<this.slen;++a){switch(this.getToken(a).tok){case 1073742335:case 1073742334:this.checkLength(2);this.chk||this.vwr.rebondState(b.$isStateScript);return;case 2:case 3:if(0<E){(m||l)&&b.error(23);g=JU.Edge.getBondOrderFromFloat(this.floatParameter(a));
131071==g&&this.invArg();m=!0;break}2<++u&&b.bad();var x=this.floatParameter(a);268435634==this.tokAt(a+1)&&(x=-x/100,a++);c[j++]=x;break;case 12290:case 10:case 1073742325:(2<E||r&&0<E)&&b.bad();(m||l)&&this.invArg();d[E++]=this.atomExpressionAt(a);r=b.isBondSet;if(2==E){for(var x=b.iToken,z=a;z<x;z++)if(1073741824==this.tokAt(z)&&this.paramAsStr(z).equals("_1")){n=a;break}b.iToken=x}a=b.iToken;break;case 1086324742:M=!0;break;case 1765808134:case 603979967:case 1073742074:l=!0;k=this.getColorTrans(b,
a,!1,e);a=b.iToken;break;case 1073742086:e=1073741852==this.tokAt(2);this.checkLength(e?3:2);if(this.chk)return;this.vwr.clearModelDependentObjects();this.vwr.ms.deleteAllBonds();f=new JU.BS;this.vwr.ms.setPdbConectBonding(0,0,f);if(e){b=b.$isStateScript&&this.vwr.getBoolean(603979872);this.vwr.ms.autoBondBs4(null,null,f,null,this.vwr.getMadBond(),b);this.vwr.addStateScript(b?"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:p=!0;++a!=this.slen&&this.invArg();h=b.theTok;1073741852==h&&!(131071==g||2048==g||515==g)&&this.invArg();break;case 659482:l||(e[0]=16777215,k=0.5,f=this.vwr.getFloat(570425406),l=!0),p||(h=1073742026,p=!0);case 1073741824:if(b.isColorParam(a)){q=-a;break}case 1075838996:case 1613238294:g=this.paramAsStr(a);131071==(g=JS.ScriptParam.getBondOrderFromString(g))&&this.invArg();m&&b.error(18);m=!0;switch(g){case 33:switch(this.tokAt(a+
1)){case 3:g=JS.ScriptParam.getPartialBondOrderFromFloatEncodedInt(this.st[++a].intValue);break;case 2:g=this.intParameter(++a)}break;case 2048:2==this.tokAt(a+1)&&(g=this.intParameter(++a)<<11,t=this.floatParameter(++a));break;case 65537:p||(h=1073742025,p=!0)}break;case 1665140738:f=this.floatParameter(++a);l=!0;break;case 1073742333:case 12291:++a!=this.slen&&this.invArg();h=12291;s=!0;l=!1;break;default:q=a}0<a&&(q==-a||q==a&&b.isColorParam(a)?(l=!0,e[0]=b.getArgbParam(a),a=b.iToken):q==a&&this.invArg())}if(!this.chk){2>
j&&(0==j&&(c[0]=1E8),c[1]=c[0],c[0]=0.1);l&&(m||(g=65535),p||(h=1073742025));m=j=0;if(0<n){t=new JU.BS;this.vwr.definedAtomSets.put("_1",t);M=d[0];for(p=M.nextSetBit(0);0<=p;p=M.nextSetBit(p+1))t.set(p),d=this.vwr.makeConnections(c[0],c[1],g,h,t,this.atomExpressionAt(n),y,r,!1,0),j+=Math.abs(d[0]),m+=d[1],t.clear(p)}else d=this.vwr.makeConnections(c[0],c[1],g,h,d[0],d[1],y,r,M,t),j+=Math.abs(d[0]),m+=d[1];c=b.doReport();s?c&&b.report(J.i18n.GT.i(J.i18n.GT.$("{0} connections deleted"),m),!1):(l&&(this.vwr.selectBonds(y),
Float.isNaN(f)||b.setShapeSizeBs(1,Math.round(2E3*f),null),this.finalizeObject(1,e[0],k,0,!1,null,0,y),this.vwr.selectBonds(null)),c&&b.report(J.i18n.GT.o(J.i18n.GT.$("{0} new bonds; {1} modified"),B(-1,[Integer.$valueOf(j),Integer.$valueOf(m)])),!1))}}},"~N");k(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()}});k(c$,"data",function(){var a=this.e,b=null,c=null,d=!1,f;switch(a.iToken=this.slen){case 5:b=this.paramAsStr(2);case 4:case 2:c=this.paramAsStr(1);if(c.equalsIgnoreCase("clear")){this.chk||this.vwr.setData(null,null,0,0,0,0,0);return}if(0<=(f=c.indexOf("@")))b=""+a.getParameter(c.substring(f+1),4,!0),c=c.substring(0,f).trim();else if(null==b&&0<=(f=c.indexOf(" ")))b=c.substring(f+1).trim(),c=c.substring(0,f).trim(),d=!0;break;default:a.bad()}f=c.substring(0,(c+" ").indexOf(" ")).toLowerCase();
if(f.equals("model")||f.equals("append"))a.cmdLoad();else if(!this.chk){var e=0<=c.toLowerCase().indexOf("(default)");if(f.equals("connect_atoms"))this.vwr.ms.connect(this.parseDataArray(b,!1));else if(0==f.indexOf("ligand_"))this.vwr.setLigandModel(c.substring(7).toUpperCase()+"_data",b.trim());else if(0==f.indexOf("file_"))this.vwr.setLigandModel(c.substring(5)+"_file",b.trim());else if(a=Array(4),f.equals("element_vdw")){a[0]=f;a[1]=b.$replace(";","\n");b=JU.Elements.elementNumberMax;f=F(b+1,0);
for(e=1;e<=b;e++)f[e]=e;a[2]=f;a[3]=Integer.$valueOf(0);this.vwr.setData("element_vdw",a,b,0,0,0,0)}else if(0==f.indexOf("data2d_"))a[0]=c,a[1]=this.parseDataArray(b,!1),a[3]=Integer.$valueOf(2),this.vwr.setData(c,a,0,0,0,0,0);else if(0==f.indexOf("data3d_"))a[0]=c,a[1]=this.parseDataArray(b,!0),a[3]=Integer.$valueOf(3),this.vwr.setData(c,a,0,0,0,0,0);else{var j=JU.PT.getTokens(c);if(0==f.indexOf("property_")&&!(2==j.length&&j[1].equals("set"))){e=this.vwr.bsA();a[0]=f;var g=d?0:this.vwr.getP("propertyAtomNumberField").intValue(),
h=d?0:this.vwr.getP("propertyAtomNumberColumnCount").intValue(),s=d?-2147483648:this.vwr.getP("propertyDataField").intValue(),m=d?0:this.vwr.getP("propertyDataColumnCount").intValue();!d&&0<=c.indexOf(" ")&&(3==j.length&&(g=JU.PT.parseInt(j[1]),s=JU.PT.parseInt(j[2])),5==j.length&&(g=JU.PT.parseInt(j[1]),h=JU.PT.parseInt(j[2]),s=JU.PT.parseInt(j[3]),m=JU.PT.parseInt(j[4])));0>g&&(g=0);0>s&&(s=0);c=this.vwr.ms.ac;d=null;j=JU.BS.newN(c);if(0<g){for(var d=F(c+2,0),p=0;p<=c;p++)d[p]=-1;for(p=e.nextSetBit(0);0<=
p;p=e.nextSetBit(p+1)){var k=this.vwr.ms.at[p].getAtomNumber();k>c+1||(0>k||j.get(k))||(j.set(k),d[k]=p)}a[2]=d}else a[2]=JU.BSUtil.copy(e);a[1]=b;a[3]=Integer.$valueOf(0);this.vwr.setData(f,a,c,g,h,s,m)}else"occupany".equals(f)&&(f="occupancy"),g=JM.AtomCollection.getUserSettableType(f),-1<g?this.vwr.setAtomData(g,f,b,e):(a[0]=c,a[1]=b,a[3]=Integer.$valueOf(0),this.vwr.setData(f,a,0,0,0,0,0))}}});k(c$,"ellipsoid",function(){var a=this.e,b=0,c=1,d=3.4028235E38,f=!1,e=!1;this.setShapeProperty(20,"thisID",
null);switch(this.getToken(1).tok){case 1073742335:b=2147483647;break;case 1073742334:break;case 2:b=this.intParameter(1);break;case 36867:this.e.sm.loadShape(20);this.setShapeProperty(20,"select",this.paramAsStr(2));c=a.iToken;e=f=!0;break;case 1073741974:case 268435633:case 1073741824:this.e.sm.loadShape(20);1073741974==a.theTok&&c++;this.setShapeId(20,c,!1);c=a.iToken;f=!0;break;default:this.invArg()}if(f){for(b=F(-1,[-2147483648]);++c<this.slen;){var f=this.paramAsStr(c),j=null;this.getToken(c);
if(!e)switch(a.theTok){case 1073742330:f="points";j=Array(3);j[0]=a.objectNameParameter(++c);if(this.chk)continue;a.getShapePropertyData(24,"getVertices",j);break;case 1825200146:j=this.e.optParameterAsString(++c);if(0==j.length)continue;break;case 1611272194:var j=Array(3),g=null;switch(this.getToken(c+1).tok){case 11:for(var c=a.theToken.value,h=3;0<=--h;)c.getColumnV(h,j[h]=new JU.V3);break;case 1073742195:c+=2;case 268435520:g=new JU.Lst;for(h=3;0<=--h;){switch(this.tokAt(++c)){case 268435520:break;
default:a.isCenterParameter(c)?g.addLast(JS.SV.newV(8,this.centerParameter(c))):268435520!=this.tokAt(c)&&g.addLast(this.getToken(c))}c=a.iToken}268435521!=this.getToken(++c).tok&&this.invArg();break;case 7:g=a.theToken.getList();switch(g.size()){case 1:g=new JU.Lst;for(h=3;0<=--h;)g.addLast(this.getToken(++c));break;case 3:break;default:this.invArg()}break;default:for(h=0;3>h;h++)j[h]=new JU.V3,j[h].setT(this.centerParameter(++c)),c=a.iToken}if(null!=g)for(c=3;0<=--c;)switch(h=g.get(c),h.tok){case 7:j[c]=
JU.V3.new3(JS.SV.fValue(h.getList().get(0)),JS.SV.fValue(h.getList().get(1)),JS.SV.fValue(h.getList().get(2)));break;case 8:j[c]=JU.V3.newV(h.value)}c=a.iToken;break;case 12289:j=this.centerParameter(++c);c=a.iToken;break;case 1094713359:j=Integer.$valueOf(this.intParameter(++c));break;case 12291:j=Boolean.TRUE,this.checkLength(c+1)}if(null==j)switch(a.theTok){case 1073742335:f="on";j=Boolean.TRUE;break;case 1073742334:f="on";j=Boolean.FALSE;break;case 1073742138:this.isFloatParameter(c+1)?j=Float.$valueOf(this.floatParameter(++c)):
a.isCenterParameter(c)?(c=this.centerParameter(c),j=I(-1,[c.x,c.y,c.z])):j=a.floatParameterSet(++c,3,3);c=a.iToken;break;case 12290:case 10:case 1073742325:f="atoms";j=this.atomExpressionAt(c);c=a.iToken;break;case 1765808134:case 603979967:case 1073742074:d=this.getColorTrans(a,c,!0,b);c=a.iToken;continue;case 1073742075:j=this.paramAsStr(++c)}null==j&&this.invArg();this.setShapeProperty(20,f.toLowerCase(),j)}this.finalizeObject(20,b[0],d,0,!1,null,0,null);this.setShapeProperty(20,"thisID",null)}else a.setShapeSizeBs(20,
b,null)});k(c$,"image",function(){this.chk||this.vwr.getConsole();var a=1,b=null;1073741974==this.tokAt(1)&&(b=this.e.optParameterAsString(++a),a++);var c=this.e.optParameterAsString(a),d=this.e.optParameterAsString(this.slen-1).equalsIgnoreCase("close");if(!d&&(this.slen==a||this.slen==a+2))c=this.slen==a+2?this.intParameter(a++):-1,a=0>c?-1:this.intParameter(a),d=new java.util.Hashtable,d.put("fileName","\u0001\u0001"+b),d.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb())),d.put("type",
"png"),d.put("quality",Integer.$valueOf(-1)),d.put("width",Integer.$valueOf(c)),d.put("height",Integer.$valueOf(a)),this.chk||this.vwr.processWriteOrCapture(d);else{if(d)switch(this.slen){case 2:c="closeall";break;case 3:case 4:break;default:this.checkLength(0)}this.chk||this.vwr.fm.loadImage(d?"\u0001close":c,"\u0001"+c+"\u0001"+("".equals(b)||null==b?null:b),!1)}});k(c$,"invertSelected",function(){var a=this.e,b=null,c=null,d=null,f=-2147483648,e=1;switch(this.tokAt(1)){case 0:if(this.chk)return;
d=this.vwr.bsA();b=this.vwr.ms.getAtomSetCenter(d);this.vwr.invertAtomCoordPt(b,d);return;case 528443:case 1140850689:e++;case 10:case 1073742325:case 12290:d=this.atomExpressionAt(e);if(!a.isAtomExpression(a.iToken+1)){a.checkLengthErrorPt(a.iToken+1,a.iToken+1);if(!this.chk)for(a=d.nextSetBit(0);0<=a;a=d.nextSetBit(a+1))this.vwr.invertRingAt(a,!1);return}f=d.nextSetBit(0);d=this.atomExpressionAt(a.iToken+1);break;case 134217751:b=a.centerParameter(2,null);break;case 134217750:c=a.planeParameter(1);
break;case 134219265:c=a.hklParameter(2)}a.checkLengthErrorPt(a.iToken+1,1);null==c&&(null==b&&-2147483648==f)&&this.invArg();this.chk||-1!=f&&this.vwr.invertSelected(b,c,f,d)});k(c$,"mapProperty",function(){for(var a,b,c,d,f,e=0,j=0,g=0,h=this.e;;){if(1113589787==this.tokAt(1))a=this.vwr.bsA(),b=this.atomExpressionAt(2),c=d="selected";else{a=this.atomExpressionAt(1);if(1073742336!=this.tokAt(++h.iToken)||!JS.T.tokAttr(e=this.tokAt(++h.iToken),1077936128))break;c=this.paramAsStr(h.iToken);b=this.atomExpressionAt(++h.iToken);
if(1073742336!=this.tokAt(++h.iToken)||!JS.T.tokAttr(j=this.tokAt(++h.iToken),2048))break;d=this.paramAsStr(h.iToken)}f=JS.T.tokAttr(g=this.tokAt(h.iToken+1),1077936128)?this.paramAsStr(++h.iToken):JS.T.nameOf(g=1094715393);h.checkLast(h.iToken);if(this.chk)return;var s=null;this.showString("mapping "+c.toUpperCase()+" for "+a.cardinality()+" atoms to "+d.toUpperCase()+" for "+b.cardinality()+" atoms using "+f.toUpperCase());if(JS.T.tokAttrOr(e,1094713344,1111490560)&&JS.T.tokAttrOr(j,1094713344,
1111490560)&&JS.T.tokAttrOr(g,1094713344,1111490560)){var m=this.getBitsetPropertyFloat(a,e|224,null,NaN,NaN),p=this.getBitsetPropertyFloat(a,g|224,null,NaN,NaN),e=this.getBitsetPropertyFloat(b,g|224,null,NaN,NaN),k=1715472409==j,l=I(k?this.vwr.ms.ac:e.length,0),s=new JU.BS;if(m.length==p.length){for(var E=new java.util.Hashtable,g=0;g<m.length;g++)E.put(Float.$valueOf(p[g]),Float.$valueOf(m[g]));m=-1;for(g=p=0;g<e.length;g++){var m=b.nextSetBit(m+1),u=E.get(Float.$valueOf(e[g]));null!=u&&(s.set(m),
l[k?m:p]=u.floatValue(),p++)}k?this.vwr.setData(d,B(-1,[d,l,s,Integer.$valueOf(1),Boolean.TRUE]),this.vwr.ms.ac,0,0,2147483647,0):JS.T.tokAttr(j,2048)?this.vwr.setAtomProperty(s,j,0,0,null,l,null):this.error(56)}}if(null==s){c=this.getBitsetIdent(a,"{"+f+"=%["+f+"]}."+d+" = %["+c+"]",null,!1,2147483647,!1);a=new JU.SB;for(g=0;g<c.length;g++)0>c[g].indexOf("null")&&a.append(c[g]).appendC("\n");JU.Logger.debugging&&JU.Logger.debug(a.toString());c=JU.BSUtil.copy(this.vwr.slm.bsSubset);this.vwr.slm.setSelectionSubset(b);
try{h.runScript(a.toString())}catch(y){if(N(y,Exception))b=y,this.vwr.slm.setSelectionSubset(c),h.errorStr(-1,"Error: "+b.getMessage());else if(N(y,Error))b=y,this.vwr.slm.setSelectionSubset(c),h.errorStr(-1,"Error: "+b.toString());else throw y;}this.vwr.slm.setSelectionSubset(c)}this.showString("DONE");return}this.invArg()});k(c$,"minimize",function(){for(var a=null,b=2147483647,c=0,d=!1,f=!1,e=null,j=!1,g=this.vwr.getMinimizer(!1),h=1;h<this.slen;h++)switch(this.getToken(h).tok){case 1073741828:d=
!0;continue;case 1073741874:case 1073742162:this.checkLength(2);if(this.chk||null==g)return;g.setProperty(this.paramAsStr(h),null);return;case 1073741882:this.checkLength(2);if(this.chk||null==g)return;g.setProperty("clear",null);return;case 1073741894:1!=h&&this.invArg();b=a=0;c=F(5,0);if(1073741882==this.tokAt(++h))this.checkLength(3);else{for(;4>a&&!this.isFloatParameter(h);)c[++a]=this.atomExpressionAt(h).nextSetBit(0),h=this.e.iToken+1;c[0]=a;1==a&&this.invArg();b=this.floatParameter(this.e.checkLast(h))}this.chk||
this.vwr.getMinimizer(!0).setProperty("constraint",B(-1,[c,Float.$valueOf(b)]));return;case 1073741905:c=this.floatParameter(++h);continue;case 1073741935:b=0;continue;case 12293:1!=h&&this.invArg();e=this.atomExpressionAt(++h);0>e.nextSetBit(0)&&(e=null);h=this.e.iToken;this.chk||this.vwr.getMinimizer(!0).setProperty("fixed",e);if(h+1==this.slen)return;continue;case 10:case 1073742325:j=!0;case 1275082245:1275082245==this.e.theTok&&h++;a=this.atomExpressionAt(h);h=this.e.iToken;1073742072==this.tokAt(h+
1)&&(h++,j=!0);continue;case 1073742148:f=!0;break;case 266298:b=this.intParameter(++h);continue;default:this.invArg()}if(!this.chk)try{this.vwr.minimize(this.e,b,c,a,e,0,d,j,f,!1)}catch(s){if(N(s,Exception))throw new JS.ScriptInterruption(this.e,"minimize",1);throw s;}});k(c$,"modulation",function(){var a=null,b=this.e,c=!0,d=!1,f=null,e=1;switch(this.getToken(e).tok){case 1073742334:c=!1;case 0:case 1073742335:break;case 12290:case 10:case 1073742325:f=this.atomExpressionAt(1);switch(this.tokAt(b.iToken+
1)){case 1073742334:c=!1;case 1073742335:b.iToken++}b.checkLast(b.iToken);break;case 1073742332:case 8:a=b.getPoint3f(1,!1,!0);d=1073742335==this.tokAt(b.iToken+1);break;default:var j=b.theToken.value.toString();e++;j.equalsIgnoreCase("t")?b.theTok=3:j.equalsIgnoreCase("m")||j.equalsIgnoreCase("q")?b.theTok=2:this.invArg();case 3:case 2:switch(b.theTok){case 3:this.isFloatParameter(e)?(a=this.floatParameter(e),a=JU.P3.new3(a,a,a)):a=b.getPoint3f(e,!1,!0);break;case 2:2==this.tokAt(e)?(d=this.intParameter(e),
a=JU.P3.new3(d,d,d)):a=b.getPoint3f(e,!1,!0),d=!0}break;case 1073742138:c=this.floatParameter(2);this.chk||this.vwr.setFloatProperty("modulationScale",c);return}this.chk||(this.vwr.tm.setVibrationPeriod(0),this.vwr.setModulation(f,c,a,d))});k(c$,"mutate",function(){var a,b;switch(this.tokAt(1)){case 2:this.st[1]=JS.T.o(4,""+this.st[1].value);default:a=this.atomExpressionAt(1);b=++this.e.iToken;break;case 268435633:a=this.vwr.getAllAtoms(),b=2}a.and(this.vwr.getModelUndeletedAtomsBitSet(this.vwr.ms.mc-
1));var c=a.length()-1,d=0;if(!(0>c||(d=this.vwr.ms.at[c].mi)!=this.vwr.ms.mc-1||this.vwr.ms.isTrajectory(d)))if(c=this.e.optParameterAsString(b),this.e.checkLast(b),!this.chk&&this.vwr.ms.am[d].isBioModel){d=null;if(4==this.tokAt(b)&&!c.startsWith("~"))d=B(-1,[c]),c=null;else{c=JU.PT.replaceAllCharacters(c,",; \t\n"," ").trim().toUpperCase();if((b=c.startsWith("~"))||3!=c.length||!this.vwr.getJBR().isKnownPDBGroup(c,20))c=this.vwr.getJBR().toStdAmino3(b?c.substring(1):c);d=JU.PT.getTokens(c)}0<d.length&&
this.vwr.ms.bioModelset.mutate(a,c,d)}});k(c$,"navigate",function(){var a=this.e;if(1==this.slen)a.setBooleanProperty("navigationMode",!0);else{var b=JU.V3.new3(0,1,0),c=new JU.Lst,d;if(2==this.slen)switch(this.getToken(1).tok){case 1073742335:case 1073742334:if(this.chk)return;a.setObjectMad10(34,"axes",10);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 f=1;f<this.slen;f++){var e=this.isFloatParameter(f)?this.floatParameter(f++):2;0>e&&this.invArg();!this.chk&&0<e&&a.refresh(!1);switch(this.getToken(f).tok){case 8:case 1073742332:d=this.getPoint3f(f,!0);a.iToken++;a.iToken!=this.slen&&this.invArg();this.chk||this.vwr.tm.setNavXYZ(d.x,d.y,d.z);return;case 554176526:d=this.floatParameter(++f);
this.chk||c.addLast(B(-1,[Integer.$valueOf(554176526),Float.$valueOf(e),Float.$valueOf(d)]));continue;case 12289:d=this.centerParameter(++f);f=a.iToken;this.chk||c.addLast(B(-1,[Integer.$valueOf(134217751),Float.$valueOf(e),d]));continue;case 528432:switch(this.getToken(++f).tok){case 1111492629:b.set(1,0,0);f++;break;case 1111492630:b.set(0,1,0);f++;break;case 1111492631:b.set(0,0,1);f++;break;case 8:case 1073742332:b.setT(this.getPoint3f(f,!0));f=a.iToken+1;break;case 1073741824:this.invArg()}d=
this.floatParameter(f);this.chk||c.addLast(B(-1,[Integer.$valueOf(528432),Float.$valueOf(e),b,Float.$valueOf(d)]));continue;case 4160:var j=d=NaN;if(this.isFloatParameter(++f))d=this.floatParameter(f),j=this.floatParameter(++f);else switch(this.tokAt(f)){case 1111492629:d=this.floatParameter(++f);break;case 1111492630:j=this.floatParameter(++f);break;default:d=this.centerParameter(f);f=a.iToken;this.chk||c.addLast(B(-1,[Integer.$valueOf(4160),Float.$valueOf(e),d]));continue}this.chk||c.addLast(B(-1,
[Integer.$valueOf(268435634),Float.$valueOf(e),Float.$valueOf(d),Float.$valueOf(j)]));continue;case 268435632:continue;case 1112152078:d=new JU.Lst;a.isAtomExpression(f+1)?(j=this.atomExpressionAt(++f),f=a.iToken):j=this.vwr.bsA();if(this.chk)return;this.vwr.getPolymerPointsAndVectors(j,d);var g;if(0<(g=d.size())){for(var j=Array(g),h=0;h<g;h++)j[h]=d.get(h);c.addLast(B(-1,[Integer.$valueOf(1112152078),Float.$valueOf(e),j]));continue}break;case 1073742084:if(1073742330==this.getToken(f+1).tok){f++;
d=a.objectNameParameter(++f);if(this.chk)return;this.setShapeProperty(22,"thisID",d);d=this.getShapeProperty(22,"vertices");a.refresh(!1);null==d&&this.invArg();j=P(this.isFloatParameter(f+1)?this.floatParameter(++f):0);g=P(this.isFloatParameter(f+1)?this.floatParameter(++f):2147483647);c.addLast(B(-1,[Integer.$valueOf(1073742084),Float.$valueOf(e),d,null,F(-1,[j,g])]));continue}for(d=new JU.Lst;a.isCenterParameter(f+1);)d.addLast(this.centerParameter(++f)),f=a.iToken;if(0<d.size()){d=d.toArray(Array(d.size()));
this.chk||c.addLast(B(-1,[Integer.$valueOf(1073742084),Float.$valueOf(e),d,null,F(-1,[0,2147483647])]));continue}default:this.invArg()}}!this.chk&&!this.vwr.isJmolDataFrame()&&this.vwr.tm.navigateList(a,c)}});k(c$,"plot",function(a){var b=this.e,c=this.vwr.am.cmi;0>c&&b.errorStr(30,"plot");var c=this.vwr.ms.getJmolDataSourceFrame(c),d=a.length-1,f=a!==this.st,e=!0,j=this.st;f&&(b.st=this.st=a);var g=f?134222350:a[0].tok,h=f||134221850==g||4138==g?0:1,s=null,m=!0,k=!1;switch(g){case 135176:m=!1;k=
!0;break;case 134222350:e=m=!1;break;case 134221856:m=!1,4==JS.CmdExt.tokAtArray(d,a)?s=this.stringParameter(d--):1073742336==JS.CmdExt.tokAtArray(d-1,a)?(s=this.paramAsStr(d-2)+"."+this.paramAsStr(d),d-=3):(b.st=this.st=j,b.iToken=this.st.length,this.error(13)),b.slen=this.slen=d+1}var f="",v=null,l="",E=!1,u=!1,y=!1,r=!1,n=Array(3),q=F(3,0),t=JU.BSUtil.copy(this.vwr.bsA()),M="; select "+JU.Escape.eBS(t)+";\n ",r=b.optParameterAsString(d).toLowerCase(),x=null,z=null,G=null,D=JS.CmdExt.tokAtArray(h,
a);4==D&&(D=JS.T.getTokFromName(a[h].value));switch(D){default:b.iToken=1;this.invArg();break;case 134221834:b.iToken=1;r="data";M="";break;case 1715472409:b.iToken=h+1;for(a=0;3>a;a++){switch(this.tokAt(b.iToken)){case 4:q[a]=JS.T.getTokFromName(b.getToken(b.iToken).value);break;default:q[a]=this.tokAt(b.iToken);break;case 0:0==a&&this.invArg();case 1287653388:case 32:case 64:a=2;continue}1715472409!=q[a]&&!JS.T.tokAttr(q[a],1077936128)&&this.invArg();n[a]=this.getToken(b.iToken).value.toString();
b.iToken++}1287653388==this.tokAt(b.iToken)&&(G=this.stringParameter(++b.iToken),e=!1,b.iToken++);32==this.tokAt(b.iToken)&&(x=this.getPoint3f(++b.iToken,!1),b.iToken++);64==this.tokAt(b.iToken)&&(z=this.getPoint3f(++b.iToken,!1),b.iToken++);r="property "+n[0]+(null==n[1]?"":" "+n[1])+(null==n[2]?"":" "+n[2]);0>t.nextSetBit(0)&&(t=this.vwr.getModelUndeletedAtomsBitSet(c));l="select "+JU.Escape.eBS(t)+";\n ";break;case 4138:r.equalsIgnoreCase("draw")&&(r=b.optParameterAsString(--d).toLowerCase());
r=d>h&&r.startsWith("r");r="ramachandran"+(r?" r":"")+(135176==g?" draw":"");break;case 134221850:case 136314895:f=' "'+this.vwr.getQuaternionFrame()+'"';l="set quaternionFrame"+f+";\n  ";E=!0;r.equalsIgnoreCase("draw")&&(k=!0,r=b.optParameterAsString(--d).toLowerCase());y=(u=r.startsWith("deriv")||r.startsWith("diff"))&&0<r.indexOf("2");u&&d--;if(r.equalsIgnoreCase("helix")||r.equalsIgnoreCase("axis"))u=k=!0,d=-1;r=((d<=h?"":b.optParameterAsString(d))+"w").substring(0,1);if(r.equals("a")||r.equals("r"))u=
!0;JU.PT.isOneOf(r,";w;x;y;z;r;a;")||b.evalError("QUATERNION [w,x,y,z,a,r] [difference][2]",null);r="quaternion "+r+(u?" difference":"")+(y?"2":"")+(k?" draw":"")}this.st=j;if(this.chk)return"";if(m&&(l+="plot "+r,j=this.vwr.ms.getJmolDataFrameIndex(c,l),0<j&&134221856!=g&&134222350!=g))return this.vwr.setCurrentModelIndexClear(j,!0),"";m=d=j=null;h=Array(3);if(1715472409==D){j=this.getBitsetPropertyFloat(t,q[0]|224,1715472409==q[0]?n[0]:null,null==x?NaN:x.x,null==z?NaN:z.x);h[0]=n[0]+" "+JU.Escape.eAF(j);
null!=n[1]&&(d=this.getBitsetPropertyFloat(t,q[1]|224,1715472409==q[1]?n[1]:null,null==x?NaN:x.y,null==z?NaN:z.y),h[1]=n[1]+" "+JU.Escape.eAF(d));null!=n[2]&&(m=this.getBitsetPropertyFloat(t,q[2]|224,1715472409==q[2]?n[2]:null,null==x?NaN:x.z,null==z?NaN:z.z),h[2]=n[2]+" "+JU.Escape.eAF(m));null==x&&(x=JU.P3.new3(this.getPlotMinMax(j,!1,q[0]),this.getPlotMinMax(d,!1,q[1]),this.getPlotMinMax(m,!1,q[2])));null==z&&(z=JU.P3.new3(this.getPlotMinMax(j,!0,q[0]),this.getPlotMinMax(d,!0,q[1]),this.getPlotMinMax(m,
!0,q[2])));JU.Logger.info("plot min/max: "+x+" "+z);k=v=null;if(e){k=JU.P3.new3(1,1,1);v=new JU.P3;v.ave(z,x);k.sub2(z,x);k.set(k.x/200,k.y/200,k.z/200);JS.T.tokAttr(q[0],1094713344)?(k.x=1,v.x=0):0.1<k.x&&10>=k.x&&(k.x=1);JS.T.tokAttr(q[1],1094713344)?(k.y=1,v.y=0):0.1<k.y&&10>=k.y&&(k.y=1);JS.T.tokAttr(q[2],1094713344)?(k.z=1,v.z=0):0.1<k.z&&10>=k.z&&(k.z=1);if(null==n[2]||null==n[1])v.z=x.z=z.z=k.z=0;for(a=0;a<j.length;a++)j[a]=(j[a]-v.x)/k.x;if(null!=n[1])for(a=0;a<d.length;a++)d[a]=(d[a]-v.y)/
k.y;if(null!=n[2])for(a=0;a<m.length;a++)m[a]=(m[a]-v.z)/k.z}v=B(-1,[t,j,d,m,x,z,k,v,G,h])}if(134221856==g)return this.vwr.writeFileData(s,"PLOT_"+r,c,v);e=r.equals("data")?"1 0 H 0 0 0 # Jmol PDB-encoded data":this.vwr.getPdbData(c,r,null,v,null,!0);if(134222350==g)return e;JU.Logger.debugging&&JU.Logger.debug(e);if(135176==g)return b.runScript(e),"";g=this.vwr.fm.getFileInfo();s=this.vwr.getBoolean(603979792);this.vwr.g.appendNew=!0;e=null!=e&&null==this.vwr.openStringInlineParamsAppend(e,null,
!0);this.vwr.g.appendNew=s;this.vwr.fm.setFileInfo(g);if(!e)return"";g=this.vwr.ms.mc;this.vwr.ms.setJmolDataFrame(l,c,g-1);1715472409!=D&&(l+=";\n"+M);l=this.vwr.addStateScript(l,!0,!1);e=150;switch(D){default:c="frame 0.0; frame last; reset;select visible;wireframe only;";e=10;break;case 1715472409:this.vwr.setFrameTitle(g-1,r+" plot for model "+this.vwr.getModelNumberDotted(c));c="frame 0.0; frame last; reset;select visible; spacefill 3.0; wireframe 0;draw plotAxisX"+g+' {100 -100 -100} {-100 -100 -100} "'+
n[0]+'";draw plotAxisY'+g+' {-100 100 -100} {-100 -100 -100} "'+n[1]+'";';null!=n[2]&&(c+="draw plotAxisZ"+g+' {-100 -100 100} {-100 -100 -100} "'+n[2]+'";');break;case 4138:this.vwr.setFrameTitle(g-1,"ramachandran plot for model "+this.vwr.getModelNumberDotted(c));c="frame 0.0; frame last; reset;select visible; color structure; spacefill 3.0; wireframe 0;draw ramaAxisX"+g+' {100 0 0} {-100 0 0} "phi";draw ramaAxisY'+g+' {0 100 0} {0 -100 0} "psi";';break;case 134221850:case 136314895:this.vwr.setFrameTitle(g-
1,r.$replace("w"," ")+f+" for model "+this.vwr.getModelNumberDotted(c)),c=JU.C.getHexCode(this.vwr.cm.colixBackgroundContrast),c="frame 0.0; frame last; reset;select visible; wireframe 0; spacefill 3.0; isosurface quatSphere"+g+" color "+c+" sphere 100.0 mesh nofill frontonly translucent 0.8;draw quatAxis"+g+'X {100 0 0} {-100 0 0} color red "x";draw quatAxis'+g+'Y {0 100 0} {0 -100 0} color green "y";draw quatAxis'+g+'Z {0 0 100} {0 0 -100} color blue "z";color structure;draw quatCenter'+g+"{0 0 0} scale 0.02;"}b.runScript(c+
M);l.setModelIndex(this.vwr.am.cmi);this.vwr.setRotationRadius(e,!0);b.sm.loadShape(31);this.showString("frame "+this.vwr.getModelNumberDotted(g-1)+(0<r.length?" created: "+r+(E?f:""):""));return""},"~A");k(c$,"polyhedra",function(){var a=this.e,b=1==this.slen,c=!1,d=b,f=!1,e=!1,j=!1,g=NaN,h=0;a.sm.loadShape(21);this.setShapeProperty(21,"init",Boolean.TRUE);for(var k=3.4028235E38,m=-1,p=F(-1,[-2147483648]),v=-1,l=null,E=null,u=!1,y=null,r=null,n=1;n<this.slen;++n){var q=null,y=null;switch(this.getToken(n).tok){case 1073742197:g=
NaN;case 1073741872:a=1073742197==this.e.theTok?-1:2==this.tokAt(n+1)?this.intParameter(++n):1;this.chk||J.api.Interface.getInterface("JU.BZone",this.vwr,"script").setViewer(this.vwr).createBZ(a,null,!1,E,g);this.setShapeProperty(21,"init",Boolean.FALSE);return;case 6:q="info";y=this.e.theToken.value;d=!0;break;case 134217751:q="points";y=Float.$valueOf(1073742334==this.tokAt(++n)?0:this.e.floatParameter(n));u=!0;break;case 1073742138:g=this.floatParameter(++n);u=!0;continue;case 1814695966:null!=
E&&this.invArg();q="unitCell";y=Boolean.TRUE;d=!0;break;case 1073742072:this.e.restrictSelected(!1,!1),a.theTok=1073742335;case 1073742335:case 12291:case 1073742334:(n+1!=this.slen||d||1<h)&&this.error(18);q=1073742334==a.theTok?"off":1073742335==a.theTok?"on":"delete";f=!0;break;case 7:(null==E||d)&&this.invArg();d=!0;y=this.getIntArray2(n);r=this.getAllPoints(a.iToken+1);n=a.iToken;L(r[0],JM.Atom)&&this.setShapeProperty(21,"model",Integer.$valueOf(r[0].getModelIndex()));q="definedFaces";y=B(-1,
[y,r]);break;case 1073741961:q="full";break;case 2:null!=E&&this.invArg();q="nVertices";y=Integer.$valueOf(this.intParameter(n));d=!0;268435504==this.tokAt(n+1)&&n++;break;case 1677721602:null!=E&&this.invArg();0<h&&this.invPO();d=!0;q="bonds";b=!0;break;case 1073741852:-1!=m&&this.invArg(),m=0,n--;case 1665140738:n++;case 3:null!=E&&this.invArg();0<h&&this.invPO();q=0>=m?"radius":"radius1";y=Float.$valueOf(m=0==m?0:this.floatParameter(n));d=!0;break;case 1073742066:if(!this.isFloatParameter(n+1)){l=
this.e.centerParameter(++n,null);n=a.iToken;u=!0;continue}case 1073741937:this.setShapeProperty(21,"collapsed",null);case 1073742099:case 1073741924:q=JS.T.nameOf(a.theTok);switch(this.tokAt(n+1)){case 268435860:case 268435504:n++}y=Float.$valueOf(this.floatParameter(++n));break;case 1094717454:null==E&&this.invArg();q="model";y=Integer.$valueOf(this.intParameter(++n));break;case 1073742170:(1<h||null!=E&&!c||v==n)&&this.invPO();h=3;a.isAtomExpression(++n)?(q=d||c?"to":"toBitSet",y=this.atomExpressionAt(n)):
a.isArrayParameter(n)?(q="toVertices",y=a.getPointArray(n,-1,!1)):this.error(19);n=a.iToken;d=!0;break;case 12290:case 10:case 1073742325:e&&this.invPO();switch(++h){case 1:null!=E&&this.invArg();q="centers";break;case 2:q="to";d=!0;break;default:a.bad()}y=this.atomExpressionAt(n);n=a.iToken;d=(new Boolean(d|n+1==this.slen)).valueOf();break;case 1765808134:case 603979967:case 1073742074:k=this.getColorTrans(a,n,!0,p);n=a.iToken;continue;case 1073741948:case 1073741886:e&&this.error(18);e=!0;this.isFloatParameter(n+
1)&&this.setShapeProperty(21,"faceCenterOffset",Float.$valueOf(this.floatParameter(++n)));q=1073741886==this.e.theTok?"collapsed":null;break;case 1073742044:case 1073741933:case 1073741956:case 1073741934:j&&this.error(18);u=j=!0;q=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(n)){1!=n&&this.invPO();E=1073741974==a.theTok?this.stringParameter(++n):a.optParameterAsString(n);
this.setShapeProperty(21,"thisID",E);this.setShapeProperty(21,"model",Integer.$valueOf(this.vwr.am.cmi));if(!a.isCenterParameter(n+1))continue;q="center";y=this.centerParameter(++n);n=a.iToken;c=!0;break}default:if(a.isColorParam(n)){p[0]=a.getArgbParam(n);a.isCenterParameter(n)&&(v=a.iToken+1);n=a.iToken;continue}this.invArg()}null!=q&&this.setShapeProperty(21,q,y);if(f)return}d?(!e&&b&&this.setShapeProperty(21,"bonds",null),this.setShapeProperty(21,"generate",null)):u||this.error(19);null!=l&&this.setShapeProperty(21,
"offset",l);Float.isNaN(g)||this.setShapeProperty(21,"scale",Float.$valueOf(g));-2147483648!=p[0]&&this.setShapeProperty(21,"colorThis",Integer.$valueOf(p[0]));3.4028235E38!=k&&a.setShapeTranslucency(21,"","translucentThis",k,null);this.setShapeProperty(21,"init",Boolean.FALSE)});k(c$,"write",function(a){var b=this.e,c=1,d=1,f=null,e=null,j=null,g=null,h="SPT",k=!0,m=!1,p=!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):
(c=d=0,k=!1,m=!k);var v=JS.CmdExt.tokAtArray(c,a);if(4==v&&!k){var l=JS.T.getTokenFromName(JS.SV.sValue(a[0]).toLowerCase());null!=l&&(v=l.tok)}switch(v){case 0:break;case 134221850:case 4138:case 1715472409:return e=this.plot(a),m?e:this.writeMsg(e);case 134222850:b.isArrayParameter(c+1)&&(f=b.stringParameterSet(++c),g=j=".",d=c=b.iToken+1,v=this.tokAt(c));break;default:h=JS.SV.sValue(this.tokenAt(c,a)).toUpperCase()}var B=this.vwr.getExportDriverList(),l=null,u=k?this.slen:a.length,y="",r=null,
n=!1,q=null,t=0,F=null,x=!1,z=null,G=-1,D=-1,A=!1,w=null,H=-2147483648;0!=v&&(k&&1<this.slen&&1073741848==this.tokAt(this.slen-2))&&(h=this.paramAsStr(this.slen-1).toUpperCase(),d=u,u-=2,v=0);switch(v){case 15:case 6:h="VAR";q=this.tokenAt(c++,a);break;case 1073741984:h="INLINE";l=JS.SV.sValue(this.tokenAt(++c,a));c++;break;case 134217762:h="PGRP";c++;y=JS.SV.sValue(this.tokenAt(c,a)).toLowerCase();y.equals("draw")&&c++;break;case 1073742329:c++;x=!0;break;case 1073742158:case 134222850:for(r=JS.SV.sValue(this.tokenAt(++c,
a)).toLowerCase();r.equals("localpath")||r.equals("remotepath");)r.equals("localpath")?j=JS.SV.sValue(this.tokenAt(++c,a)):g=JS.SV.sValue(this.tokenAt(++c,a)),r=JS.SV.sValue(this.tokenAt(++c,a)).toLowerCase();h="SPT";break;case 1228935687:case 134320141:case 1610616855:case 135180:case 1073742015:case 1073742018:case 1073877011:case 1073877010:case 135188:c++;break;case 1073741991:h="ZIPALL";c++;break;case 36868:h="VAR";c+=2;break;case 1073741929:case 4115:case 4120:case 1073742139:case 4166:case 1073741824:case 4:switch(v){case 4115:c+
1<u&&1073742325==a[++c].tok||10==a[c].tok?(r=b.atomExpression(a,c,0,!0,!1,null,!0),c=b.iToken+1):r=this.vwr.getAllAtoms();this.chk||(z=this.vwr.ms.getModelBS(r,!0));break;case 1073741929:v=4120,n=!0;case 4120:h="IMAGE";c++;break;case 1073742139:r=JS.SV.sValue(this.tokenAt(++c,a)).toUpperCase();JU.PT.isOneOf(r,";PNG;PNGJ;")?(F=r,c++):F="PNG";break;case 4166:t=b.intParameterRange(++c,1,10);if(2147483647==t)return"";this.chk||(this.vwr.tm.setVibrationPeriod(0),b.isJS||b.delayScript(100));c++;break;default:v=
4120}if(4120==v&&c<a.length)if(v=JS.T.getTokenFromName(JS.SV.sValue(a[c]).toLowerCase()),null!=v&&(h=JS.SV.sValue(v).toUpperCase()),JU.PT.isOneOf(h,B.toUpperCase())){c++;h=h.substring(0,1).toUpperCase()+h.substring(1).toLowerCase();A=!0;k&&(w="Jmol."+h.toLowerCase());break}else if(JU.PT.isOneOf(h,";ZIP;ZIPALL;SPT;STATE;")){c++;break}else h="IMAGE";2==JS.CmdExt.tokAtArray(c,a)&&(G=JS.SV.iValue(this.tokenAt(c++,a)),0>=G&&this.invArg(),D=JS.SV.iValue(this.tokenAt(c++,a)),0>=D&&this.invArg())}if(d<u){r=
JS.SV.sValue(this.tokenAt(c,a));if(r.equalsIgnoreCase("clipboard")){if(this.chk)return""}else JU.PT.isOneOf(r.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;")?(2==JS.CmdExt.tokAtArray(c+1,a)&&2==JS.CmdExt.tokAtArray(c+2,a)&&(G=JS.SV.iValue(this.tokenAt(++c,a)),0>=G&&this.invArg(),D=JS.SV.iValue(this.tokenAt(++c,a)),0>=D&&this.invArg()),2==JS.CmdExt.tokAtArray(c+1,a)&&(H=JS.SV.iValue(this.tokenAt(++c,a)))):JU.PT.isOneOf(r.toLowerCase(),";xyz;xyzrn;xyzvib;mol;mol67;sdf;v2000;v3000;json;pdb;pqr;cml;cif;qcjson;")&&
(h=r.toUpperCase(),c+1==u&&c++);h.equals("IMAGE")&&JU.PT.isOneOf(r.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;")&&(h=r.toUpperCase(),H=-2147483648,c++)}c+2==u&&JS.SV.sValue(this.tokenAt(++c,a));switch(JS.CmdExt.tokAtArray(c,a)){case 0:m=!0;break;case 1073741884:break;case 805306401:w=h.equals("IMAGE")?"?jmol.png":"?jmol."+h.toLowerCase();break;case 1073741824:case 4:w=JS.SV.sValue(this.tokenAt(c,a));if(w.equalsIgnoreCase("clipboard")||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL))w=
null;break;default:this.invArg()}if(h.equals("IMAGE")||h.equals("FRAME")||h.equals("VIBRATION"))h=null!=w&&0<=w.indexOf(".")?w.substring(w.lastIndexOf(".")+1).toUpperCase():"JPG";if(h.equals("ISOSURFACE")||h.equals("CONTACT"))p=h.equals("CONTACT"),h=null!=w&&0<=w.indexOf(".")?w.substring(w.lastIndexOf(".")+1).toUpperCase():"JVXL",h.equals("PMESH")?h="ISOMESH":h.equals("PMB")&&(h="ISOMESHBIN");v=JU.PT.isOneOf(h.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;");if(!v&&(h.equals("MNU")?
h="MENU":h.equals("WRL")||h.equals("VRML")?(h="Vrml",A=!0):h.equals("X3D")?(h="X3d",A=!0):h.equals("STL")?(h="Stl",A=!0):h.equals("IDTF")?(h="Idtf",A=!0):h.equals("MA")?(h="Maya",A=!0):h.equals("JS")?(h="Js",A=!0):h.equals("OBJ")?(h="Obj",A=!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!=w&&0<=w.indexOf(".")?w.substring(w.lastIndexOf(".")+1).toUpperCase():"XYZ";null!=f&&(h.equals("PNG")&&
(h="PNGJ"),!h.equals("PNGJ")&&(!h.equals("ZIPALL")&&!h.equals("ZIP"))&&this.invArg());!v&&(!A&&!JU.PT.isOneOf(h,";SCENE;JMOL;ZIP;ZIPALL;SPT;HISTORY;MO;NBO;ISOSURFACE;MESH;PMESH;PMB;ISOMESHBIN;ISOMESH;VAR;FILE;FUNCTION;CFI;CIF;CML;JSON;XYZ;XYZRN;XYZVIB;MENU;MOL;MOL67;PDB;PGRP;PQR;QUAT;RAMA;SDF;V2000;V3000;QCJSON;INLINE;"))&&b.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",
"CIF|CML|CFI|GIF|GIFT|JPG|JPG64|JMOL|JVXL|MESH|MOL|PDB|PMESH|PNG|PNGJ|PNGT|PPM|PQR|SDF|CD|JSON|QCJSON|V2000|V3000|SPT|XJVXL|XYZ|XYZRN|XYZVIB|ZIP"+B.toUpperCase().$replace(";","|"));if(this.chk)return"";var c=Array(1),C,d=this.vwr.getBoolean(603979934);if(A){d&&JU.Logger.startTimer("export");e=new java.util.Hashtable;e.put("type",h);null!=w&&e.put("fileName",w);(k||null!=w)&&e.put("fullPath",c);e.put("width",Integer.$valueOf(G));e.put("height",Integer.$valueOf(D));l=this.vwr.generateOutputForExport(e);
if(null==l||0==l.length)return"";if(m)return l;if(!h.equals("Povray")&&!h.equals("Idtf")||null==c[0])return this.writeMsg(l);e=h.equals("Idtf")?".tex":".ini";w=c[0]+e;C=new java.util.Hashtable;C.put("fileName",w);C.put("type",e);C.put("text",l);C.put("fullPath",c);e=this.vwr.processWriteOrCapture(C);h.equals("Idtf")&&(l=l.substring(0,l.indexOf("\\begin{comment}")));l="Created "+c[0]+":\n\n"+l;d&&this.showString(JU.Logger.getTimerMsg("export",0));null!=e&&((h=!e.startsWith("OK"))&&b.evalError(e,null),
b.report(l,h));return""}A=null;B=!1;if(null==l){u=0;l=h.intern();if("MENU"===l)l=this.vwr.getMenu("");else if("PGRP"===l)l=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),null,0,1,null,null,y.equals("draw")?"":null);else if("PDB"===l||"PQR"===l)m?l=this.vwr.getPdbAtomData(null,null,"PQR"===l,x):(B=!0,h="PDB_"+l+"-coord "+x);else if("FILE"===l)"?".equals(w)&&(w="?Jmol."+this.vwr.getP("_fileType")),m?l=this.vwr.getCurrentFileAsString("script"):B=!0;else if("CIF"===l||"SDF"===l||"MOL"===l||"MOL67"===
l||"V2000"===l||"V3000"===l||"CD"===l||"JSON"===l||"XYZ"===l||"XYZRN"===l||"XYZVIB"===l||"CML"===l||"QCJSON"===l){a=this.vwr.bsA();e=" ("+a.cardinality()+" atoms)";if(0<=this.vwr.am.cmi&&!a.equals(C=this.vwr.getModelUndeletedAtomsBitSet(this.vwr.am.cmi)))e+="\nNote! Selected atom set "+a+" is not the same as the current model "+C;l=this.vwr.getModelExtract(a,x,!1,l);l.startsWith("ERROR:")&&(A=l)}else if("CFI"===l)l=this.vwr.getModelFileData("selected","cfi",!1);else if("FUNCTION"===l)l=this.vwr.getFunctionCalls(null),
h="TXT";else if("VAR"===l)null==q&&(q=b.getParameter(JS.SV.sValue(this.tokenAt(k?2:1,a)),1073742190,!0)),a=null,15==q.tok?(a=new JU.Lst,a.addLast(q.value.data)):6==q.tok&&(a=null==w?new JU.Lst:this.prepareBinaryOutput(q)),null==a?(l=q.asString(),h="TXT"):null!=w&&(C=new java.util.Hashtable,C.put("data",a),null==(A=l=this.vwr.createZip(w,1==a.size()||w.endsWith(".png")||w.endsWith(".pngj")?"BINARY":"ZIPDATA",C))&&b.evalError("#CANCELED#",null));else if("SPT"===l)if(x)C=this.vwr.ms.getTaintedAtoms(2),
this.vwr.setAtomCoordsRelative(JU.P3.new3(0,0,0),null),l=this.vwr.getStateInfo(),this.vwr.ms.setTaintedAtoms(C,2);else{if(l=this.vwr.getStateInfo(),null!=j||null!=g)l=JV.FileManager.setScriptFileReferences(l,j,g,null)}else"ZIP"===l||"ZIPALL"===l?null!=w&&(C=new java.util.Hashtable,null!=f&&C.put("data",f),null==(A=l=this.vwr.createZip(w,h,C))&&b.evalError("#CANCELED#",null)):"HISTORY"===l?(l=this.vwr.getSetHistory(2147483647),h="SPT"):"MO"===l||"NBO"===l?(l=this.getMoJvxl(2147483647,"NBO"===l),h=
"XJVXL"):"PMESH"===l||"PMB"===l?(null==(l=this.getIsosurfaceJvxl(29,l))&&this.error(31),h="XJVXL"):"ISOMESH"===l?(null==(l=this.getIsosurfaceJvxl(24,l))&&this.error(31),h="PMESH"):"ISOMESHBIN"===l?(null==(A=this.getIsosurfaceJvxl(24,"ISOMESHBIN"))&&this.error(31),h="PMB"):"ISOSURFACE"===l||"MESH"===l?(null==(l=this.getIsosurfaceJvxl(p?25:24,l))&&this.error(31),h=0<=l.indexOf("<?xml")?"XJVXL":"JVXL",m||this.showString(this.getShapeProperty(p?25:24,"jvxlFileInfo"))):(k&&(m&&null==w)&&(m=!1,w="\u0001"),
u=-1,null==F&&0>H&&(H=-1));null==l&&(l="");0==u&&(null==A||L(A,String))}if(!k)return l;if(m)return b.showStringPrint(l,!0),"";if(null!=A&&L(A,String))return this.writeMsg(A);if(B)return this.writeMsg(this.vwr.writeFileData(w,h,0,null));if(h.equals("SCENE"))A=F;else if(null==A&&(!v||null!=w))A=l;d&&JU.Logger.startTimer("write");v&&(b.refresh(!1),0>G&&(G=n?250:this.vwr.getScreenWidth()),0>D&&(D=n?250:this.vwr.getScreenHeight()));C=new java.util.Hashtable;null!=w&&C.put("fileName",w);C.put("backgroundColor",
Integer.$valueOf(this.vwr.getBackgroundArgb()));C.put("type",h);if(n){C.put("is2D",Boolean.TRUE);var I,b="smiles could not be generated";try{if(I=this.vwr.getOpenSmiles(null),0<I.length){var O=this.vwr.setLoadFormat("_"+I,"2",!1),O=O+("?width="+G+"&height="+D+"&format="+h.toLowerCase());this.showString(O);b=this.vwr.fm.getFileAsBytes(O,null)}}catch(K){if(!N(K,Exception))throw K;}if(L(b,String))return this.showString(b),null;A=b}L(A,String)&&-2147483648==H?C.put("text",A):L(A,Array)&&C.put("bytes",
A);null!=f&&C.put("scripts",f);null!=z&&C.put("bsFrames",z);C.put("fullPath",c);C.put("quality",Integer.$valueOf(H));C.put("width",Integer.$valueOf(G));C.put("height",Integer.$valueOf(D));C.put("nVibes",Integer.$valueOf(t));b=this.vwr.processWriteOrCapture(C);null==b&&(b="canceled");v&&b.startsWith("OK")&&(b+="; width="+G+"; height="+D);d&&this.showString(JU.Logger.getTimerMsg("write",0));return this.writeMsg(b+(null==e?"":e))},"~A");k(c$,"prepareBinaryOutput",function(a){var b=a.getMap();if(null==
b||!b.containsKey("$_BINARY_$"))return null;a=new JU.Lst;for(var c,b=b.entrySet().iterator();b.hasNext()&&((c=b.next())||1);){var d=c.getKey();if(!d.equals("$_BINARY_$")){var f=c.getValue(),e=15==f.tok?f.value.data:null;null==e&&(f=f.asString(),e=f.startsWith(";base64,")?JU.Base64.decodeBase64(f):f.getBytes());if(d.equals("_DATA_")){a=new JU.Lst;a.addLast(e);break}else d.equals("_IMAGE_")?(a.add(0,d),a.add(1,null),a.add(2,e)):(a.addLast(d),a.addLast(null),a.addLast(e))}}return a},"JS.SV");k(c$,"writeMsg",
function(a){if(this.chk||null==a)return"";var b=!a.startsWith("OK");b&&(this.e.evalError(a,null),alert(a));this.e.report(a,b);return a},"~S");k(c$,"show",function(){var a=this.e,b=null,c=this.paramAsStr(1),d=null,f=0;3<this.slen&&268435632==this.tokAt(this.slen-3)&&268435568==this.tokAt(this.slen-2)?(d="!/"+this.paramAsStr(this.slen-1),this.slen-=3,f=3):2<this.slen&&268435632==this.tokAt(this.slen-2)?(d="/"+this.paramAsStr(this.slen-1),this.slen-=2,f=2):0==(d=this.paramAsStr(this.slen-1)).lastIndexOf("/")?
(this.slen--,f=1):d=null;var e=null,j=null,g=2,h=this.getToken(1),j=L(h,JS.SV)&&1073741824!=h.tok?0:h.tok;4==j&&(h=JS.T.getTokenFromName(c.toLowerCase()),null!=h&&(j=h.tok));1296041986!=j&&(1073742158!=j&&1715472409!=j&&1228935687!=j)&&this.checkLength(-3);2==this.slen&&0<=c.indexOf("?")&&(e=this.vwr.getAllSettings(c.substring(0,c.indexOf("?"))),j=-1);switch(j){case 0:this.chk||(e=a.theToken.escape());break;case 1073741925:a.checkLength23();g=this.st.length;this.chk||(e=this.vwr.getModelInfo("domains"),
e=L(e,JS.SV)?this.vwr.getAnnotationInfo(e,a.optParameterAsString(2),1073741925):"domain information has not been loaded");break;case 1715472409:e=this.plot(this.st);g=this.st.length;break;case 1073742189:a.checkLength23();g=this.st.length;this.chk||(e=this.vwr.getModelInfo("validation"),e=L(e,JS.SV)?this.vwr.getAnnotationInfo(e,a.optParameterAsString(2),1073742189):"validation information has not been loaded");break;case 134221829:this.chk||(e=JU.Escape.e(this.vwr.fm.cacheList()));break;case 1111490587:a.checkLength23();
g=this.st.length;this.chk||(e=this.vwr.getModelInfo("dssr"),e=null==e?"no DSSR information has been read":2<g?JS.SV.getVariable(this.vwr.extractProperty(e,this.stringParameter(2),-1)).asString():""+JS.SV.getVariable(e).asString());break;case 1073741915:j=2;3==this.slen?j=P(this.floatParameter((g=3)-1)):this.checkLength(2+f);this.chk||(e=this.vwr.calculateStructures(null,!0,!1,j));break;case 545259572:this.checkLength(2+f);this.chk||(e=this.vwr.fm.getPathForAllFiles());break;case 1275203608:if(!this.chk){var k=
Array(2);this.vwr.shm.getShapePropertyData(21,"allInfo",k);e=JS.SV.getVariable(k[1]).asString()}break;case 1073742038:this.chk||this.vwr.getNMRPredict(a.optParameterAsString(2));return;case 1073741929:case 1073741879:case 134218757:this.checkLength((1073741879==j||134218757==j&&1073742335==this.tokAt(2)?g=3:2)+f);if(this.chk)return;var m=a.optParameterAsString(2);1073741879==j&&("mf".equals(m)&&(m="formula"),"formula".equals(m)&&(e=this.vwr.getModelInfo("formula"),null!=e&&(e=JU.PT.rep(e," ",""))));
if(null==e){try{134218757!=j?(e=this.vwr.ms.getModelDataBaseName(this.vwr.bsA()),e=null!=e&&(e.startsWith("$")||e.startsWith(":"))?e.substring(1):null):m.equalsIgnoreCase("true")?(e=this.vwr.getBioSmiles(null),d=null):null!=d&&(e=this.vwr.getSmilesOpt(null,-1,-1,1,d+"///"),d=null),null==e&&(k=JU.Logger.getLogLevel(),JU.Logger.setLogLevel(4),e=134218757==j?this.vwr.getSmiles(null):this.vwr.getOpenSmiles(null),JU.Logger.setLogLevel(k))}catch(p){if(N(p,Exception))e=p.getMessage(),null==e&&(e=""),p.printStackTrace();
else throw p;}switch(j){case 1073741929:if(0<e.length){this.vwr.fm.loadImage(this.vwr.setLoadFormat("_"+e,"2",!1),"\u0001"+e,!1);return}e="Could not show drawing -- Either insufficient atoms are selected or the model is a PDB file.";break;case 1073741879:g=3,0<e.length?(e=this.vwr.getChemicalInfo(e,m,this.vwr.bsA()),0<=e.indexOf("FileNotFound")&&(e="?")):e="Could not show name -- Either insufficient atoms are selected or the model is a PDB file."}}break;case 134217764:case 1296041986:e="";k=null;
if(2==(g=this.slen)){if(this.chk)break;k=this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,null,-1,!1,null)}else if(134217764==j){k=this.paramAsStr(2);g=3;if(this.chk)break;k=this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,JU.PT.rep(k,"''",'"'),-1,!1,null)}if(null!=k){e=(134217764==j?""+k.get("spaceGroupInfo")+k.get("spaceGroupNote"):"")+k.get("symmetryInfo");break}var j=2==this.tokAt(2)?this.intParameter(2):0,k=4==this.tokAt(2)?this.paramAsStr(2):null,h=m=null,v=-1;if(3<this.slen&&4!=this.tokAt(3)){g=
B(-1,[null,this.vwr.getFrameAtoms()]);m=a.centerParameter(2+(0==j?0:1),g);if(null!=g[0]&&0==g[0].cardinality()){g=this.slen;break}g[0]=null;if(0==j&&(h=a.centerParameter(++a.iToken,g),null!=g[0]&&0==g[0].cardinality())){g=this.slen;break}2==this.tokAt(a.iToken+1)&&(v=a.getToken(++a.iToken).intValue)}var l=1<a.iToken&&4==this.tokAt(a.iToken+1)?this.stringParameter(++a.iToken):null;this.checkLength((g=++a.iToken)+f);this.chk||(e=this.vwr.getSymmetryInfo(this.vwr.getAllAtoms().nextSetBit(0),k,j,m,h,
0,l,0,v,0),e=L(e,java.util.Map)?JS.SV.getVariable(e).asString():e.toString());break;case 1648363544:j=null;2<this.slen&&(g=this.slen,j=J.c.VDW.getVdwType(this.paramAsStr(2)),null==j&&this.invArg());this.chk||(e=this.vwr.getDefaultVdwNameOrData(0,j,null));break;case 134320141:a.checkLength23();g=this.slen;j=a.optParameterAsString(2);if(null==d&&0<=(m=j.indexOf("/")))d=j.substring(m+1),j=j.substring(0,m);this.chk||(e=this.vwr.getFunctionCalls(j));break;case 36867:this.checkLength(2+f);this.chk||(e=
this.vwr.getAllSettings(null));break;case 1073742166:e=this.vwr.getFrameTitle();break;case 1073742184:2==this.slen?this.chk||this.vwr.showUrl(a.getFullPathName()):(j=this.paramAsStr(2),this.chk||this.vwr.showUrl(j));return;case 1765808134:c="defaultColorScheme";break;case 1610612740:c="scaleAngstromsPerInch";break;case 134221850:case 4138:if(this.chk)return;0>this.vwr.am.cmi&&a.errorStr(30,"show "+a.theToken.value);e=this.plot(this.st);g=this.slen;break;case 14:case 1112152078:this.chk||(e=this.getContext(!1));
break;case 1073741888:j=a.optParameterAsString(2);0<j.length&&(g=3);this.chk||(b=this.vwr.cm.getColorSchemeList(j));break;case 1073742192:this.chk||(e=this.vwr.getAtomDefs(this.vwr.definedAtomSets)+this.vwr.g.getVariableList()+this.getContext(!0));break;case 536870926:this.chk||(e=this.vwr.getTrajectoryState());break;case 553648146:b=""+JS.ScriptEval.commandHistoryLevelMax;break;case 553648149:b=""+JU.Logger.getLogLevel();break;case 603979825:b=""+this.vwr.getBoolean(603979825);break;case 553648178:e=
"set strandCountForStrands "+this.vwr.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13);break;case 536875070:e=this.vwr.showTimeout(2==(g=this.slen)?null:this.paramAsStr(2));break;case 536870918:b=JU.Escape.eP(this.vwr.getDefaultLattice());break;case 4126:this.chk||(e=this.vwr.getMinimizationInfo());break;case 1611272194:switch(this.vwr.g.axesMode){case 603979808:e="set axesUnitcell";break;case 603979804:e="set axesMolecular";break;default:e="set axesWindow"}break;case 1610612737:e=
"set bondMode "+(this.vwr.getBoolean(603979812)?"OR":"AND");break;case 1649022989:this.chk||(e="set strandCountForStrands "+this.vwr.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13));break;case 1613238294:e="set hbondsBackbone "+this.vwr.getBoolean(603979852)+";set hbondsSolid "+this.vwr.getBoolean(603979854);break;case 1611141175:this.chk||(e=this.vwr.getSpinState());break;case 1611141176:e="set ssbondsBackbone "+this.vwr.getBoolean(603979952);break;case 1610625028:case 1611141171:e=
"selectionHalos "+(this.vwr.getSelectionHalosEnabled()?"ON":"OFF");break;case 1612709894:e="set selectHetero "+this.vwr.getBoolean(1612709894);break;case 1073741828:e=JU.Escape.eAP(this.vwr.getAdditionalHydrogens(null,!0,!0,null));break;case 1612709900:e="set selectHydrogens "+this.vwr.getBoolean(1612709900);break;case 553648130:case 553648140:case 536870924:case 553648176:case 553648172:case 1073741995:this.chk||(e=this.vwr.getLightingState());break;case 1073742136:case 4146:this.chk||(e=this.vwr.stm.listSavedStates());
break;case 1814695966:this.chk||(e=this.vwr.getUnitCellInfoText());break;case 1073742329:if(2==(g=this.slen)){this.chk||(e=this.vwr.getCoordinateState(this.vwr.bsA()));break}j=this.paramAsStr(2);this.chk||(e=this.vwr.stm.getSavedCoordinates(j));break;case 1073742158:!this.chk&&null==a.outputBuffer&&this.vwr.sm.clearConsole();if(2==(g=this.slen)){this.chk||(e=this.vwr.getStateInfo());break}if(null!=d&&3==this.slen){this.chk||(e=this.vwr.getStateInfo());break}else if(1228935687==this.tokAt(2)&&4==(g=
this.slen)){this.chk||(e=this.vwr.fm.getEmbeddedFileState(this.paramAsStr(3),!0,"state.spt"));break}g=3;j=this.paramAsStr(2);this.chk||(e=this.vwr.stm.getSavedState(j));break;case 1639976963:if(2==(g=this.slen)){this.chk||(e=this.vwr.ms.getProteinStructureState(this.vwr.bsA(),134222350));break}j=this.paramAsStr(2);this.chk||(e=this.vwr.stm.getSavedStructure(j));break;case 134221834:j=3==(g=this.slen)?this.paramAsStr(2):null;this.chk||(e=this.vwr.getDataObj(j,null,-2),e=null==e?"no data":JU.Escape.encapsulateData(e[0],
e[1],e[3].intValue()));break;case 1073742330:g=3;e=a.setObjectProperty();break;case 1678381065:this.chk||(e=this.vwr.ms.getBoundBoxCommand(!0));break;case 12289:this.chk||(e="center "+JU.Escape.eP(this.vwr.tm.fixedRotationCenter));break;case 135176:this.chk||(e=this.getShapeProperty(22,"command"));break;case 1228935687:if(2==this.slen){this.chk||(null==d&&this.vwr.sm.clearConsole(),e=this.vwr.getCurrentFileAsString("script"));null==e&&(e="<unavailable>");break}g=3;b=this.paramAsStr(2);this.chk||(null==
d&&this.vwr.sm.clearConsole(),e=this.vwr.getFileAsString3(b,!0,null));break;case 4115:e=1073742327==this.tokAt(2)&&0<(g=3)?this.vwr.getModelFileInfoAll():this.vwr.getModelFileInfo();break;case 1610616855:j=2==(g=this.slen)?2147483647:this.intParameter(2);1>j&&this.invArg();this.chk||(this.vwr.sm.clearConsole(),0==a.scriptLevel&&this.vwr.removeCommand(),e=this.vwr.getSetHistory(j));break;case 135180:this.chk||(e=this.getShapeProperty(24,"jvxlDataXml"));break;case 1073877011:case 1073877010:a.optParameterAsString(2).equalsIgnoreCase("list")?
(this.e.sm.loadShape(27),e=this.chk?"":this.getShapeProperty(27,"list -1"),g=3):(k=2==(g=this.slen)?-2147483648:this.intParameter(2),this.chk||(e=this.getMoJvxl(k,1073877011==j)));break;case 1094717454:this.chk||(e=this.vwr.ms.getModelInfoAsString());break;case 537006096:this.chk||(e=this.vwr.getMeasurementInfoAsString());break;case 1073741864:g=3;!this.chk&&this.slen==g&&(e=this.paramAsStr(2),e=this.vwr.getOrientationText(JS.T.getTokFromName(e.equals("box")?"volume":e.equals("rotation")?"best":e),
"best",null).toString());break;case 1073742132:j=this.tokAt(2),0==j?j=1073742132:g=3;case 1073742178:case 4129:this.chk||(e=this.vwr.getOrientationText(j,null,null).toString());break;case 1073742077:g=2;if(3<this.slen)break;switch(j=this.tokAt(2)){case 1073742178:case 1073742132:case 4129:case 0:this.chk||(e=this.vwr.getOrientationText(j,null,null).toString());break;default:j=a.optParameterAsString(2),e=this.vwr.getOrientationText(1073742034,j,null).toString()}g=this.slen;break;case 1073742088:this.chk||
(e=this.vwr.ms.getPDBHeader(this.vwr.am.cmi));break;case 134217762:j=a.optParameterAsString(2);0==j.length&&(j=null);g=this.slen;this.chk||(e=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),"show:"+j,0,0,null,null,null));break;case 1088421903:this.chk||(e=this.vwr.ms.getSymmetryInfoAsString());break;case 1073742176:this.chk||(e="transform:\n"+this.vwr.tm.matrixRotate.toString());break;case 4168:e="zoom "+(this.vwr.tm.zoomEnabled?""+this.vwr.tm.getZoomSetting():"off");break;case 1611272202:e=this.vwr.getShowFrank()?
"frank ON":"frank OFF";break;case 1665140738:c="solventProbeRadius";break;case 1086324744:if(3==(g=this.slen)&&1073742334==this.tokAt(2))j=1086324743;case 1073741863:case 1086326788:case 1073742120:case 1113589787:case 1086324742:case 1140850689:case 1073741982:this.chk||(e=this.vwr.getChimeInfo(j));break;case 537022465:case 1610612738:case 20482:case 1612709912:b="?";break;case 1073742030:j=2==(g=this.slen)?null:this.paramAsStr(2);this.chk||(e=this.vwr.getBindingInfo(j));break;case 1073742015:this.chk||
(b=this.vwr.getMenu(""));break;case 1073741824:c.equalsIgnoreCase("fileHeader")&&(this.chk||(e=this.vwr.ms.getPDBHeader(this.vwr.am.cmi)));break;case 1073741992:case 36868:c=this.paramAsStr(g++),k=a.getParameter(c,1073742190,!0),this.chk||(e=1073741992==j?k.toJSON():k.escape())}this.checkLength(g+f);this.chk||(null!=e?this.showString(this.filterShow(e,d)):null!=b?this.showString(c+" = "+b):null!=c&&(0<=c.indexOf(" ")?this.showString(c):this.showString(c+" = "+a.getParameter(c,1073742190,!0).escape())))});
k(c$,"filterShow",function(a,b){if(null==b)return a;var c=b.startsWith("!/");b=b.substring(c?2:1).toLowerCase();for(var d=JU.PT.split(a,"\n"),f=new JU.SB,e=0;e<d.length;e++)0>d[e].toLowerCase().indexOf(b)==c&&f.append(d[e]).appendC("\n");return f.toString()},"~S,~S");k(c$,"stereo",function(){for(var a=J.c.STER.DOUBLE,b=-5,c=!1,d=null,f=0,e=1;e<this.slen;++e)if(this.e.isColorParam(e))1<f&&this.e.bad(),0==f&&(d=F(2,0)),c||(b=3),d[f]=this.e.getArgbParam(e),0==f++&&(d[1]=~d[0]),e=this.e.iToken;else switch(this.getToken(e).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:b=this.floatParameter(e);c=!0;break;case 1073741824:if(c||(b=3),a=J.c.STER.getStereoMode(this.paramAsStr(e)),null!=a)break;default:this.invArg()}this.chk||this.vwr.setStereoMode(d,a,b)});k(c$,"struts",function(){var a=this.e,b=1073742072==this.tokAt(1)||1073742335==this.tokAt(1)||1==this.slen,c=a.getMadParameter();if(2147483647==c)return!1;b&&(c=Math.round(2E3*this.vwr.getFloat(570425406)));
this.setShapeProperty(1,"type",Integer.$valueOf(32768));a.setShapeSizeBs(1,c,null);this.setShapeProperty(1,"type",Integer.$valueOf(1023));return!0});k(c$,"unitcell",function(a){var b=this.e,c=2147483647,d=2147483647,f=null,e=b.tickParamAsStr(a,!0,!1,!1);a=b.iToken;var j=null,g=null,h=null,k=null,m=d=!1;switch(this.tokAt(++a)){case 4142:case 4141:m=!0;f=JU.P4.new4(0,0,0,-1);b.iToken++;break;case 4:case 1073741824:var p=this.paramAsStr(a).toLowerCase(),k=p;if(0<=p.indexOf(",")||this.chk){h=p;break}d=
null;b.setCurrentCagePts(null,null);h=this.vwr.getModelInfo("unitcell_conventional");if(JU.PT.isOneOf(k,";parent;standard;primitive;")){if(null==h&&null!=this.vwr.getModelInfo("isprimitive")){this.showString("Cannot convert unit cell when file data is primitive and have no lattice information");return}k.equals("primitive")&&4==this.tokAt(a+1)&&(d=this.paramAsStr(++a).toUpperCase())}L(h,Array)&&(g=h);null==d&&(d=this.vwr.getModelInfo("latticeType"));null!=h&&b.setCurrentCagePts(this.vwr.getV0abc(h),
""+h);if(!k.equals("conventional")){p=this.vwr.getModelInfo("unitcell_"+k);if(null==p){if((p=k.equals("primitive"))||k.equals("reciprocal")){var v=this.slen==a+1?1:2==this.tokAt(a+1)?3.141592653589793*this.intParameter(++a):this.floatParameter(++a),l=this.vwr.getCurrentUnitCell(),k=(null==l?"":l.getSpaceGroupName()+" ")+k,g=null==l?B(-1,[JU.P3.new3(0,0,0),JU.P3.new3(1,0,0),JU.P3.new3(0,1,0),JU.P3.new3(0,0,1)]):l.getUnitCellVectors();null==d&&(d=this.vwr.getSymmetryInfo(this.vwr.getFrameAtoms().nextSetBit(0),
null,0,null,null,1073741994,null,0,-1,0));null==l&&(l=this.vwr.getSymTemp());l.toFromPrimitive(!0,0==d.length?"P":d.charAt(0),g,this.vwr.getCurrentModelAuxInfo().get("primitiveToCrystal"));p||JU.SimpleUnitCell.getReciprocal(g,g,v);break}}else k=p,0<=p.indexOf(",")&&(h=p);this.showString(k)}break;case 135180:case 1073742330:j=b.objectNameParameter(++a);break;case 1678381065:g=JU.P3.newP(this.vwr.getBoundBoxCenter());f=this.vwr.getBoundBoxCornerVector();g.sub(f);g=B(-1,[g,JU.P3.new3(2*f.x,0,0),JU.P3.new3(0,
2*f.y,0),JU.P3.new3(0,0,2*f.z)]);f=null;b.iToken=a;break;case 1073742176:12!=this.tokAt(++a)&&this.invArg();h=B(-1,[this.getToken(a).value]);break;case 11:case 12:h=this.getToken(a).value;break;case 12289:switch(this.tokAt(++a)){case 12290:case 10:case 1073742325:f=this.vwr.ms.getAtomSetCenter(this.atomExpressionAt(a));this.vwr.toFractional(f,!0);a=b.iToken;break;default:if(b.isCenterParameter(a)){f=this.centerParameter(a);a=b.iToken;break}this.invArg()}f.x-=0.5;f.y-=0.5;f.z-=0.5;break;case 12290:case 10:case 1073742325:a=
this.atomExpressionAt(a).nextSetBit(0);this.chk||(this.vwr.am.cai=a);if(0>a)return;a=b.iToken;break;case 1073742066:d=!0;case 1073742114:f=b.getPointOrPlane(++a,!1,!0,!1,!0,3,3,!0);f=JU.P4.new4(f.x,f.y,f.z,d?1:0);a=b.iToken;break;case 3:case 2:if(111>this.floatParameter(a)){a--;break}c=this.intParameter(a);break;default:b.isArrayParameter(a)?(g=b.getPointArray(a,4,!1),a=b.iToken):this.slen>a+1?(f=b.getPointOrPlane(a,!1,!0,!1,!0,3,3,!0),a=b.iToken):a--}d=b.getSetAxesTypeMad10(++a);b.checkLast(b.iToken);
this.chk||2147483647==d||(2147483647==d&&(this.vwr.am.cai=-1),null==g&&null!=h&&(g=this.vwr.getV0abc(h)),2147483647!=c?this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),null,c):null!=j?this.vwr.setCurrentCage(j):(m||null!=g)&&b.setCurrentCagePts(g,k),b.setObjectMad10(33,"unitCell",d),null!=f&&this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),f,0),null!=e&&this.setShapeProperty(33,"tickInfo",e))},"~N");k(c$,"assign",function(a){var b=this.tokAt(a++),c=-1,d=-1;if(1140850689==b&&
4==this.tokAt(a))this.e.iToken++;else if(c=this.atomExpressionAt(a).nextSetBit(0),0>c)return;a=null;4106==b?d=this.atomExpressionAt(++this.e.iToken).nextSetBit(0):a=this.paramAsStr(++this.e.iToken);var f=++this.e.iToken<this.slen?this.centerParameter(this.e.iToken):null;if(!this.chk)switch(this.vwr.pushState(),b){case 1140850689:this.e.clearDefinedVariableAtomSets();this.assignAtom(c,f,a);break;case 1677721602:this.assignBond(c,(a+"p").charAt(0));break;case 4106:this.assignConnect(c,d)}},"~N");k(c$,
"assignAtom",function(a,b,c){c.equals("X")&&this.vwr.setModelKitRotateBondIndex(-1);if(!(0<=a&&this.vwr.ms.at[a].mi!=this.vwr.ms.mc-1)){this.vwr.clearModelDependentObjects();var d=this.vwr.ms.ac;if(null==b)0>a||(this.vwr.sm.modifySend(a,this.vwr.ms.at[a].mi,1,this.e.fullCommand),this.vwr.setModelkitProperty("assignAtom",B(-1,[c,F(-1,[a,1,1])])),JU.PT.isOneOf(c,";Mi;Pl;X;")||this.vwr.ms.setAtomNamesAndNumbers(a,-d,null),this.vwr.sm.modifySend(a,this.vwr.ms.at[a].mi,-1,"OK"),this.vwr.refresh(3,"assignAtom"));
else{var f=0>a?null:this.vwr.ms.at[a],e=0>a?new JU.BS:JU.BSUtil.newAndSetBit(a);b=B(-1,[b]);var j=new JU.Lst,g=-1;null!=f&&(j.addLast(f),g=f.mi,this.vwr.sm.modifySend(a,g,3,this.e.fullCommand));try{var e=this.vwr.addHydrogensInline(e,j,b),h=e.nextSetBit(0);this.vwr.setModelkitProperty("assignAtom",B(-1,[c,F(-1,[h,-1,a])]));a=h}catch(k){if(!N(k,Exception))throw k;}this.vwr.ms.setAtomNamesAndNumbers(a,-d,null);this.vwr.sm.modifySend(a,g,-3,"OK")}}},"~N,JU.P3,~S");k(c$,"assignBond",function(a,b){var c=
-1;try{c=this.vwr.ms.bo[a].atom1.mi,this.vwr.sm.modifySend(a,c,2,this.e.fullCommand),(null==this.vwr.setModelkitProperty("assignBond",F(-1,[a,b]))||"0"==b)&&this.vwr.refresh(3,"setBondOrder"),this.vwr.sm.modifySend(a,c,-2,""+b)}catch(d){if(N(d,Exception))JU.Logger.error("assignBond failed"),this.vwr.sm.modifySend(a,c,-2,"ERROR "+d);else throw d;}},"~N,~S");k(c$,"assignConnect",function(a,b){this.vwr.clearModelDependentObjects();var c=JU.AU.newFloat2(1);c[0]=I(-1,[a,b]);var d=this.vwr.ms.at[a].mi;
this.vwr.sm.modifySend(a,d,2,this.e.fullCommand);this.vwr.ms.connect(c);this.vwr.setModelkitProperty("assignAtom",B(-1,[".",F(-1,[a,1,1])]));this.vwr.setModelkitProperty("assignAtom",B(-1,[".",F(-1,[b,1,1])]));this.vwr.sm.modifySend(a,d,-2,"OK");this.vwr.refresh(3,"assignConnect")},"~N,~N");k(c$,"getContext",function(a){for(var b=new JU.SB,c=this.e.thisContext;null!=c;)a?null!=c.vars&&(b.append(this.getScriptID(c)),b.append(JV.StateManager.getVariableList(c.vars,80,!0,!1))):b.append(JS.ScriptError.getErrorLineMessage(c.functionName,
c.scriptFileName,this.e.getLinenumber(c),c.pc,JS.ScriptEval.statementAsString(this.vwr,c.statement,-9999,this.e.debugHigh))),c=c.parentContext;a?null!=this.e.contextVariables&&(b.append(this.getScriptID(null)),b.append(JV.StateManager.getVariableList(this.e.contextVariables,80,!0,!1))):b.append(this.e.getErrorLineMessage2());return b.toString()},"~B");k(c$,"getIsosurfaceJvxl",function(a,b){return this.chk?"":this.getShapeProperty(a,"PMESH"===b||"MESH"===b?"jvxlMeshX":"ISOMESH"===b?"pmesh":"ISOMESHBIN"===
b||"PMB"===b?"pmeshbin":"jvxlDataXml")},"~N,~S");k(c$,"getMoJvxl",function(a,b){var c=b?28:27;this.e.sm.loadShape(c);var d=this.vwr.am.cmi;0>d&&this.e.errorStr(30,"show/write MO/NBO");var f=this.vwr.ms.getInfo(d,"moData");null==f&&this.error(27);var e=this.getShapeProperty(c,"moNumber");(null==e||0==e.intValue())&&this.setShapeProperty(c,"init",Integer.$valueOf(d));this.setShapeProperty(c,"moData",f);return this.e.sm.getShapePropertyIndex(c,"showMO",a)},"~N,~B");k(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");k(c$,"tokenAt",function(a,b){return a<b.length?b[a]:null},"~N,~A");c$.tokAtArray=k(c$,"tokAtArray",function(a,b){return a<b.length&&null!=b[a]?b[a].tok:0},"~N,~A");k(c$,"getPlotMinMax",function(a,b,c){if(null==a)return 0;switch(c){case 1111490568:case 1111490569:case 1111490570:return b?180:-180;case 1111490565:case 1111490576:return b?
360:0;case 1111490574:return b?1:-1}c=b?-1E10:1E10;for(var d=a.length;0<=--d;){var f=a[d];Float.isNaN(f)||b==f>c&&(c=f)}return c},"~A,~B,~N");k(c$,"parseDataArray",function(a,b){a=JU.Parser.fixDataString(a);var c=JU.Parser.markLines(a,"\n"),d=c.length;if(!b){for(var f=JU.AU.newFloat2(d),e=0,j=0;e<d;j=c[e++])j=JU.PT.getTokens(a.substring(j,c[e])),JU.PT.parseFloatArrayData(j,f[e]=I(j.length,0));return f}j=JU.PT.getTokens(a.substring(0,c[0]));if(3!=j.length)return I(0,0,0,0);var g=JU.PT.parseInt(j[0]),
h=JU.PT.parseInt(j[1]),k=JU.PT.parseInt(j[2]);if(1>g||1>h||1>k)return I(1,1,1,0);for(var f=JU.AU.newFloat3(g,h),m=0,p=0,e=1,j=c[0];e<d&&m<g;j=c[e++])j=JU.PT.getTokens(a.substring(j,c[e])),j.length<k||(JU.PT.parseFloatArrayData(j,f[m][p]=I(j.length,0)),++p==h&&(m++,p=0));return m!=g?(System.out.println("Error reading 3D data -- nX = "+g+", but only "+m+" blocks read"),I(1,1,1,0)):f},"~S,~B");k(c$,"getBitsetPropertyFloat",function(a,b,c,d,f){b=null==c||1111490843==b?this.e.getBitsetProperty(a,null,
b,null,null,c,null,!1,2147483647,!1):this.vwr.getDataObj(c,a,1);if(null==b||!JU.AU.isAF(b))return null==a?null:I(a.cardinality(),0);if(!Float.isNaN(d))for(a=0;a<b.length;a++)b[a]<d&&(b[a]=NaN);if(!Float.isNaN(f))for(a=0;a<b.length;a++)b[a]>f&&(b[a]=NaN);return b},"JU.BS,~N,~S,~N,~N");X(c$,"ERROR_invalidArgument",22)})})(Clazz,Clazz.getClassName,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,
Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,
Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAB,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
