(function(ca,da,ea,fa,ga,ha,R,N,S,W,X,E,Y,Z,ia,P,D,O,$,ja,aa,ka,la,ma,na,oa,pa,A,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,n,ba){R("JS");S(null,"JS.ScriptExt",["JU.AU"],function(){var k=X(function(){this.e=this.vwr=null;this.chk=!1;this.st=null;this.slen=0;W(this,arguments)},JS,"ScriptExt",null);n(k,"init",function(a){this.e=a;this.vwr=this.e.vwr;return this},"~O");n(k,"atomExpressionAt",function(a){return this.e.atomExpressionAt(a)},"~N");n(k,"checkLength",
function(a){this.e.checkLength(a)},"~N");n(k,"error",function(a){this.e.error(a)},"~N");n(k,"invArg",function(){this.e.invArg()});n(k,"invPO",function(){this.error(23)});n(k,"getShapeProperty",function(a,c){return this.e.getShapeProperty(a,c)},"~N,~S");n(k,"paramAsStr",function(a){return this.e.paramAsStr(a)},"~N");n(k,"centerParameter",function(a){return this.e.centerParameter(a,null)},"~N");n(k,"floatParameter",function(a){return this.e.floatParameter(a)},"~N");n(k,"getPoint3f",function(a,c){return this.e.getPoint3f(a,
c,!0)},"~N,~B");n(k,"intParameter",function(a){return this.e.intParameter(a)},"~N");n(k,"isFloatParameter",function(a){switch(this.e.tokAt(a)){case 2:case 3:return!0}return!1},"~N");n(k,"setShapeProperty",function(a,c,b){this.e.setShapeProperty(a,c,b)},"~N,~S,~O");n(k,"showString",function(a){this.e.showString(a)},"~S");n(k,"stringParameter",function(a){return this.e.stringParameter(a)},"~N");n(k,"getToken",function(a){return this.e.getToken(a)},"~N");n(k,"tokAt",function(a){return this.e.tokAt(a)},
"~N");n(k,"setShapeId",function(a,c,b){b&&this.invArg();c=this.e.setShapeNameParameter(c).toLowerCase();this.setShapeProperty(a,"thisID",c);return c},"~N,~N,~B");n(k,"getColorTrans",function(a,c,b,f){b=3.4028235E38;1765808134!=a.theTok&&--c;switch(this.tokAt(c+1)){case 1111490588:c++;b=this.isFloatParameter(c+1)?a.getTranslucentLevel(++c):this.vwr.getFloat(570425353);break;case 1073742074:c++,b=0}a.isColorParam(c+1)?f[0]=a.getArgbParam(++c):1073742333==this.tokAt(c+1)?(f[0]=0,a.iToken=c+1):3.4028235E38==
b?this.invArg():f[0]=-2147483648;return b},"JS.ScriptEval,~N,~B,~A");n(k,"finalizeObject",function(a,c,b,f,e,d,h,j){e&&this.setShapeProperty(a,"set",d);-2147483648!=c&&this.e.setShapePropertyBs(a,"color",Integer.$valueOf(c),j);3.4028235E38!=b&&this.e.setShapeTranslucency(a,"","translucent",b,j);0!=f&&this.setShapeProperty(a,"scale",Integer.$valueOf(f));0>h&&(h=-1-h,this.setShapeProperty(a,"token",Integer.$valueOf(1073742018)),this.setShapeProperty(a,"token",Integer.$valueOf(1073742046)));0<h&&(this.e.setMeshDisplayProperty(a,
h,0)||this.invArg())},"~N,~N,~N,~N,~B,~O,~N,JU.BS");n(k,"getIntArray2",function(a){a=this.e.getToken(a).getList();for(var c=JU.AU.newInt2(a.size()),b=c.length;0<=--b;){var f=a.get(b).getList();null==f&&this.invArg();c[b]=D(f.size(),0);for(var e=c[b].length;0<=--e;)c[b][e]=f.get(e).intValue}return c},"~N");n(k,"getAllPoints",function(a,c){var b=null,f=null;try{switch(this.e.tokAt(a)){case 7:b=this.e.getPointArray(a,-1,!1,!0);break;case 12290:case 10:case 1073742325:f=this.atomExpressionAt(a)}null==
b&&(null==f&&(f=this.vwr.getAllAtoms()),b=this.bsToArray(f))}catch(e){if(!P(e,Exception))throw e;}(null==b||b.length<c)&&this.invArg();return b},"~N,~N");n(k,"bsToArray",function(a){for(var c=Array(a.cardinality()),b=a.nextSetBit(0),f=0;0<=b;b=a.nextSetBit(b+1))c[f++]=this.vwr.ms.at[b];return c},"JU.BS")});R("JS");S(["JS.ScriptExt"],"JS.CmdExt","java.util.Hashtable JU.AU $.BS $.Base64 $.Lst $.M3 $.M4 $.Measure $.P3 $.P4 $.PT $.Quat $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.c.STER $.VDW J.i18n.GT JM.AtomCollection $.LabelToken $.Measurement $.Text JS.SV $.ScriptCompiler $.ScriptError $.ScriptEval $.ScriptInterruption $.ScriptMathProcessor $.ScriptParam $.T JU.BSUtil $.BoxInfo $.C $.Edge $.Elements $.Escape $.Logger $.Parser $.Point3fi $.SimpleUnitCell JV.FileManager $.JC $.StateManager $.Viewer".split(" "),
function(){var k=$(JS,"CmdExt",JS.ScriptExt);Z(k,function(){aa(this,JS.CmdExt,[])});ba(k,"dispatch",function(a,c,b){this.chk=this.e.chk;this.slen=this.e.slen;this.st=b;switch(a){case 4108:this.audio();break;case 1073741866:b[0].value=this.prepareBinaryOutput(b[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(!1);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(b);break;
case 134222350:this.show();break;case 528443:this.stereo();break;case 4156:this.sync();break;case 1814695966:this.unitcell(c?2:1,0);break;case 134221856:return this.write(c?b: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");n(k,"audio",function(){var a=new java.util.Hashtable,c=null,b=null,b=null,f=this.e.iToken+1;if(1073742334==this.tokAt(f))this.checkLength(f+1),this.chk||this.vwr.sm.stopAudio(null);else{for(;f<
this.slen;f++)switch(this.tokAt(f)){case 1073741974:null!=c&&this.invArg();c=this.paramAsStr(++f);break;case 4:b=this.stringParameter(f);a.put("audioFile",b);break;case 1073741940:b=this.stringParameter(++f);c=this.addFilterAttribute(a,b,"id");this.addFilterAttribute(a,b,"loop");this.addFilterAttribute(a,b,"start");this.addFilterAttribute(a,b,"pause");this.addFilterAttribute(a,b,"play");this.addFilterAttribute(a,b,"ended");this.addFilterAttribute(a,b,"action");break;default:this.checkLength(f+1),
a.containsKey("action")&&this.invArg(),b=this.paramAsStr(f),a.put("autoclose",Boolean.FALSE),a.put("action",b)}!this.chk&&!a.isEmpty()&&(null==c&&(c="audio1"),a.put("id",c),this.vwr.sm.playAudio(a))}});n(k,"addFilterAttribute",function(a,c,b){c=JU.PT.getQuotedOrUnquotedAttribute(c,b);null!=c&&0<c.length&&a.put(b,c);return c},"java.util.Map,~S,~S");n(k,"macro",function(){if(!this.chk){var a=this.e.optParameterAsString(1);if(0==a.length)this.showString(this.vwr.getMacro(null));else{var c=this.vwr.getMacro(a);
null==c?this.showString("macro "+a+" could not be found. Current macros include:\n"+this.vwr.getMacro(null)):(this.showString("running "+c),this.e.cmdScript(4124,c,null,null))}}});n(k,"evalParallel",function(a,c){this.chk=this.e.chk;this.slen=this.e.slen;var b=(new JS.ScriptEval).setViewer(this.vwr);b.historyDisabled=!0;b.compiler=new JS.ScriptCompiler(this.vwr);b.sm=c;try{b.restoreScriptContext(a,!0,!1,!1),b.setAllowJSThreads(!1),b.dispatchCommands(!1,!1,!1)}catch(f){if(P(f,Exception))return this.e.vwr.setStringProperty("_errormessage",
""+f),null==b.thisContext&&(JU.Logger.error("Error evaluating context "+f),f.printStackTrace()),!1;throw f;}return!0},"JS.ScriptContext,JV.ShapeManager");n(k,"getBitsetIdent",function(a,c,b,f,e,d){return this.getBitsetIdentFull(a,c,f,e,d,null)},"JU.BS,~S,~O,~B,~N,~B");n(k,"getBitsetIdentFull",function(a,c,b,f,e,d){var h=!N(a,"JM.BondSet");h?null==c?c=this.vwr.getStandardLabelFormat(0):0==c.length&&(c="%[label]"):null!=c&&0==c.length?c="[%a1 #%i1] %4.3LENGTH [%a2 #%i2] #%#":"%U".equals(c)&&(c="");
var j=null==c?-1:c.indexOf("%"),g=2147483647!=f;if(null==a||this.chk||h&&0>j)return null==c&&(c=""),e?A(-1,[c]):c;var j=this.vwr.ms,q=0;null==JS.CmdExt.labeler&&(JS.CmdExt.labeler=j.getLabeler());b=h||!b?null:a.getAssociatedAtoms(j);var l=null==c||0==c.length,u=h||l?null:JS.CmdExt.labeler.getBondLabelValues();c=l?null:h?JS.CmdExt.labeler.compile(this.vwr,c,"\x00",null):JS.CmdExt.labeler.compile(this.vwr,c,"\u0001",u);var Q=g?1:a.cardinality(),m=null!=d;m||(d=Array(Q));var B=new JU.P3;for(f=g?f:a.nextSetBit(0);0<=
f;f=a.nextSetBit(f+1)){var r;if(h)r=l?j.at[f].getInfo():JS.CmdExt.labeler.formatLabelAtomArray(this.vwr,j.at[f],c,"\x00",b,B);else{r=j.bo[f];if(null==r)continue;r=l?r.getIdentity():JS.CmdExt.labeler.formatLabelBond(this.vwr,r,c,u,b,B)}r=JU.PT.formatStringI(r,"#",q+1);d[m?f:q]=r;q++;if(g)break}return 1==Q&&!e?d[0]:d},"JU.BS,~S,~B,~N,~B,~A");n(k,"getLoadSymmetryParams",function(a,c,b){var f=this.e;this.chk=f.chk;this.slen=f.slen;var e=!1,d=null,h=this.tokAt(a);if(1073742332==h||8==h)d=f.getFractionalPoint(a),
h=this.tokAt(a=f.iToken+1);switch(h){case 134217764:e=b.get("isEmptyLoad")===Boolean.TRUE;case 1073741938:case 1073742080:case 1094713350:case 1073742163:case 1073742114:case 1814695966:null==d&&(d=JU.P3.new3(555,555,-1)),f.iToken=a-1}h=null;if(null!=d){b.put("lattice",d);a=f.iToken+1;c.append(" "+JU.SimpleUnitCell.escapeMultiplier(d));a=this.checkPacked(a,0,b,c);if(1094713350==this.tokAt(a)){b.put("centroid",Boolean.TRUE);c.append(" CENTROID");var j=0;this.isFloatParameter(a+1)&&(--a,j=1073742080);
a=this.checkPacked(++a,j,b,c)}if(1073742163==this.tokAt(a)){c.append(" SUPERCELL ");if(f.isPoint3f(++a)){j=this.getPoint3f(a,!1);if(j.x!=E(j.x)||j.y!=E(j.y)||j.z!=E(j.z)||1>j.x||1>j.y||1>j.z)f.iToken=a,this.invArg();a=f.iToken}else j=this.stringParameter(a);c.append(JU.Escape.e(j));b.put("supercell",j);a=this.checkPacked(++a,0,b,c)}j=0;1073742114==this.tokAt(a)&&(a++,j=this.floatParameter(a++),c.append(" range "+j));b.put("symmetryRange",Float.$valueOf(j));var j=null,g,q=-2147483648;134217764==this.tokAt(a)&&
(++a,j=JU.PT.rep(this.paramAsStr(a++),"''",'"'),c.append(" spacegroup "+JU.PT.esc(j)),j.equalsIgnoreCase("ignoreOperators")?q=-999:(0==j.length?(g=this.vwr.getCurrentUnitCell(),null!=g&&(j=g.getSpaceGroupName())):0<=j.indexOf(",")&&9>d.x&&(9>d.y&&0==d.z)&&(j+="#doNormalize=0"),b.put("spaceGroupName",j),q=-2));d=null;if(1814695966==this.tokAt(a)){++a;g=f.optParameterAsString(a);0==g.length?(g=this.vwr.getCurrentUnitCell(),null!=g&&(d=g.getUnitCellAsArray(!0),h=g.getCartesianOffset())):4==this.tokAt(a)?
(d=O(6,0),JU.SimpleUnitCell.setAbc(g,d,null)):d=f.floatParameterSet(a,6,9);(null==d||6!=d.length&&9!=d.length)&&this.invArg();c.append(" unitcell [");for(a=0;a<d.length;a++)c.append((0==a?"":" ")+d[a]);c.append("]");b.put("unitcell",d);-2147483648==q&&(q=-1);a=f.iToken+1}-2147483648!=q&&b.put("spaceGroupIndex",Integer.$valueOf(q));e&&null==d&&null!=j&&JU.PT.parseInt(j)}e=!1;null==h&&1073742066==this.tokAt(a)&&(h=this.getPoint3f(++a,!0),e=f.coordinatesAreFractional);null!=h&&(e?(h.setT(f.fractionalPoint),
b.put("unitCellOffsetFractional",e?Boolean.TRUE:Boolean.FALSE),c.append(" offset {"+h.x+" "+h.y+" "+h.z+"/1}")):c.append(" offset "+JU.Escape.eP(h)),b.put("unitCellOffset",h),a=f.iToken+1);return a},"~N,JU.SB,java.util.Map");n(k,"checkPacked",function(a,c,b,f){0==c&&(c=this.tokAt(a));switch(c){case 1073741938:b.put("packed",Boolean.TRUE);var e=null;c=this.tokAt(++a);switch(c){case 1812599299:case 1814695966:case 4:break;default:this.e.isArrayParameter(a)?(e=this.e.getPointArray(a,-1,!1,!0),a=this.e.iToken):
this.isFloatParameter(a)?(e=this.floatParameter(a),e=A(-1,[new JU.P3,JU.P3.new3(e,e,e)])):(e=[],--a)}a++;if(this.e.chk)break;var d=!1;switch(c){case 4:d=!0;case 1095241729:a--;case 1814695966:e=this.e.optParameterAsString(a++).toLowerCase();if(d||JU.PT.isOneOf(e,";spin;conventional;primitive;rhombohedral;trigonal;")||0<=e.indexOf(",")&&0<=e.indexOf("a")&&0<=e.indexOf("b")&&0<=e.indexOf("c"))return b.put("fillRange",e),f.append(" FILL "+(d?"":'UNITCELL "'+e+'"')),a;e=this.vwr.getCurrentUnitCell();
if(null!=e){e=JU.BoxInfo.toOABC(e.getUnitCellVerticesNoOffset(),e.getCartesianOffset());break}case 1812599299:e=JU.BoxInfo.toOABC(this.vwr.ms.getBBoxVertices(),null)}switch(e.length){case 2:c=e[1];e=A(-1,[e[0],JU.P3.newP(e[0]),new JU.P3,new JU.P3]);e[1].x=c.x;e[2].y=c.y;e[3].z=c.z;break;case 3:e=A(-1,[new JU.P3,e[0],e[1],e[2]]);break;case 4:break;default:0!=c&&this.invArg(),e=A(-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",e);f.append(" FILL ["+e[0]+e[1]+
e[2]+e[3]+"]");break;case 1073742080:c=NaN,this.isFloatParameter(++a)&&(c=this.floatParameter(a++)),this.e.chk||(b.put("packed",Boolean.TRUE),f.append(" PACKED"),Float.isNaN(c)||(b.put("packingRange",Float.$valueOf(c)),f.append(" "+c)))}return a},"~N,~N,java.util.Map,JU.SB");n(k,"cache",function(){var a=this.tokAt(1),c=null,b=2;switch(a){case 1275069441:case 1073742119:c=this.e.optParameterAsString(b++);case 1073741882:this.checkLength(b);this.chk||("all".equals(c)&&(c=null),c=this.vwr.cacheFileByName(c,
1275069441==a),this.showString(0>c?"cache cleared":c+" bytes "+(1275069441==a?" cached":" removed")));break;default:this.invArg()}});n(k,"calculate",function(){var a=!1,c=!1,b=null,f=null,e=this.e,d=-2147483648,d=-1;if(2<=(e.iToken=e.slen))switch(e.clearDefinedVariableAtomSets(),this.getToken(1).tok){case 2:if(3!=this.intParameter(1)||!this.paramAsStr(2).equalsIgnoreCase("D"))break;0>this.vwr.am.cmi&&e.errorStr(30,"calculate 3D");b="load append $ filter '2D';select visible;center selected";e.optParameterAsString(3).equalsIgnoreCase("ZAP")&&
(b+=";zap modelIndex="+Math.max(this.vwr.am.cmi,0));this.chk||e.runScript(b);return;case 1073741824:this.checkLength(2);break;case 134217764:e.iToken=1;b=2==this.slen?null:this.atomExpressionAt(2);e.checkLast(e.iToken);this.chk||e.showString(""+this.vwr.findSpaceGroup(null,b,null,null,null,null,1));return;case 1086324752:e.iToken=1;b=2==this.slen?null:this.atomExpressionAt(2);e.checkLast(e.iToken);this.chk||e.showString(this.vwr.calculateChirality(b));return;case 1631586315:this.checkLength(2);if(this.chk)return;
d=this.vwr.calculateFormalCharges(null);this.showString(J.i18n.GT.i(J.i18n.GT.$("{0} charges modified"),d));return;case 1075838996:this.checkLength(2);this.chk||this.vwr.ms.assignAromaticBondsBs(!0,null);return;case 1613238294:2!=e.slen&&(b=(c=1639976963==this.tokAt(++e.iToken))?this.vwr.bsA():this.atomExpressionAt(e.iToken),!c&&1639976963!=this.tokAt(++e.iToken)&&(f=this.atomExpressionAt(e.iToken)));if(this.chk)return;d=this.vwr.autoHbond(b,f,!1);-2147483648!=d&&e.report(J.i18n.GT.i(J.i18n.GT.$("{0} hydrogen bonds"),
Math.abs(d)),!1);return;case 1612709900:a=this.tokAt(2);(c=1073742335==a)?e.iToken++:528443==a&&e.iToken++;b=this.slen==e.iToken+1?null:this.atomExpressionAt(e.iToken+1);null==b&&528443==a&&(b=this.vwr.getAtomBitSet("_C & connected(3) & !connected(double)"));e.checkLast(e.iToken);this.chk||(this.vwr.addHydrogens(b,0),c&&(null==b&&(b=this.vwr.bsA()),this.vwr.makeConnections(0.1,1E8,515,1073742025,b,b,null,!1,!1,0),this.vwr.ms.assignAromaticBondsBs(!0,null)));return;case 1111492619:e.iToken=1;b=2==
this.slen?null:this.atomExpressionAt(2);e.checkLast(e.iToken);this.chk||e.getPartialCharges(b);return;case 1088421903:case 1275068447:this.chk||(1275203608==this.tokAt(2)?(a=4==this.tokAt(3)?this.stringParameter(3):null,b=null!=a||3==this.slen?null:this.atomExpressionAt(3),b=A(-1,[a,null,b]),this.showString(e.getShapePropertyData(21,"symmetry",b)?b[1]:"")):(b=2==this.slen?this.vwr.bsA():this.atomExpressionAt(2),a=null,12289==this.tokAt(e.iToken)&&(a=e.centerParameter(e.iToken+1,null)),this.showString(this.vwr.ms.calculatePointGroup(b,
a))));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:b=4>this.slen||this.isFloatParameter(3)?null:this.atomExpressionAt(2);switch(this.tokAt(++e.iToken)){case 4138:break;case 1111490587:if(this.chk)return;e.showString(this.vwr.getAnnotationParser(!0).calculateDSSRStructure(this.vwr,b));return;case 1073741915:c=!0;d=this.slen==
e.iToken+1?-1:E(this.floatParameter(++e.iToken));break;case 0:c=this.vwr.getBoolean(603979826);break;default:this.invArg()}this.chk||this.showString(this.vwr.calculateStructures(b,c,!0,d));return;case 659482:b=e.iToken+1<this.slen?this.atomExpressionAt(++e.iToken):null;f=e.iToken+1<this.slen?this.atomExpressionAt(++e.iToken):null;this.checkLength(++e.iToken);this.chk||(d=this.vwr.calculateStruts(b,f),0<d&&(this.setShapeProperty(1,"type",Integer.$valueOf(32768)),e.setShapePropertyBs(1,"color",Integer.$valueOf(16777215),
null),e.setShapeTranslucency(1,"","translucent",0.5,null),this.setShapeProperty(1,"type",Integer.$valueOf(1023))),this.showString(J.i18n.GT.i(J.i18n.GT.$("{0} struts added"),d)));return;case 2097180:a=!0;case 1111490575:c=!1;switch(this.tokAt(2)){case 134217759:e.iToken++;break;case 0:c=!a;break;case 1073741952:c=!0;e.iToken++;break;default:c=!0}b=e.iToken+1<this.slen?this.atomExpressionAt(++e.iToken):this.vwr.bsA();this.checkLength(++e.iToken);this.chk||this.vwr.calculateSurface(b,c?3.4028235E38:
-1);return}e.errorStr2(53,"CALCULATE","3D? aromatic? hbonds? hydrogen? formalCharge? partialCharge? pointgroup? straightness? structure? struts? surfaceDistance FROM? surfaceDistance WITHIN?")});n(k,"capture",function(){if(!this.chk&&!this.vwr.allowCapture())this.showString("Cannot capture on this platform");else{var a=this.vwr.captureParams,c=null==a?"GIF":a.get("type"),b=0,f=0,e=this.e.slen,d="",h=1073742070!=this.vwr.am.animationReplayMode,j=1,g=this.tokAt(j),q=1111490588==g;q&&(g=this.tokAt(++j));
var l=null;switch(0==g?g=102409:g){case 4:d=this.e.optParameterAsString(j++);if(0==d.length){f=102409;break}c=d.toLowerCase();c.endsWith(".gift")||c.endsWith(".pngt")?(q=!0,d=d.substring(0,d.length-1),c=d.toLowerCase()):!c.endsWith(".gif")&&!c.contains(".png")&&(d+=".gif");c.endsWith(".png")?(c.endsWith("0.png")||(d=d.substring(0,d.length-4)+"0000.png"),c="PNG"):c="GIF";q&&(c+="T");g=d.indexOf("0000.");g=0>g||g!=d.lastIndexOf(".")-4;f=!1;528411==this.tokAt(j)&&(h=!0,this.tokAt(++j));switch(this.tokAt(j)){case 134222850:l=
this.stringParameter(++j);break;case 1073742129:f=!0;case 1095241729:a="y";h=!0;j++;f?(j<e&&2!=this.tokAt(j)&&(a=this.e.optParameterAsString(j++).toLowerCase()),l="rotate Y 10 10;rotate Y -10 -10;rotate Y -10 -10;rotate Y 10 10",e=j<e?this.intParameter(j++):5,l=0>e?JU.PT.rep(l,"10;",""+-e+";"):JU.PT.rep(l,"10",""+e)):(j<e&&(a=this.e.optParameterAsString(j++).toLowerCase()),l="rotate Y 360 30;");if(this.chk)return;this.vwr.setNavigationMode(!1);if(""===a||0>"xyz".indexOf(a))a="y";l=JU.PT.rep(l,"Y",
a);break;case 3:case 2:b=this.floatParameter(j++)}if(this.chk)return;if(null!=l){l="set waitformoveto true;"+l+";set waitformoveto "+this.vwr.g.waitForMoveTo;l="capture "+(q?"transparent ":"")+JU.PT.esc(d)+(h?" LOOP;":";")+l+";capture end;";this.e.cmdScript(0,null,l,null);return}f=1073742031;a=new java.util.Hashtable;q=this.vwr.getInt(553648132);g&&(a.put("streaming",Boolean.TRUE),h||this.showString(J.i18n.GT.o(J.i18n.GT.$("Note: Enable looping using the LOOP keyword just after the file name or {0}"),
A(-1,["ANIMATION MODE LOOP"]))),this.showString(J.i18n.GT.o(J.i18n.GT.$("Animation delay based on: {0}"),A(-1,["ANIMATION FPS "+q]))));a.put("captureFps",Integer.$valueOf(q));break;case 102409:case 1073741874:null!=a&&a.put("captureSilent",Boolean.TRUE);case 1073742335:case 1073742334:this.checkLength(-2);f=g;break;default:this.invArg()}this.chk||null==a||(a.put("type",c),c=Integer.$valueOf(this.vwr.getBackgroundArgb()),a.put("backgroundColor",c),a.put("fileName",d),a.put("quality",Integer.$valueOf(-1)),
a.put("endTime",Long.$valueOf(0>=b?-1:System.currentTimeMillis()+Y(1E3*b))),a.put("captureMode",JS.T.nameOf(f).toLowerCase()),a.put("captureLooping",h?Boolean.TRUE:Boolean.FALSE),b=this.vwr.processWriteOrCapture(a),null==b&&(b="canceled"),JU.Logger.info(b))}});n(k,"centerAt",function(){var a=this.getToken(1).tok;switch(a){case 1073741826:case 96:case 1812599299:break;default:this.invArg()}var c=JU.P3.new3(0,0,0);5==this.slen?(c.x=this.floatParameter(2),c.y=this.floatParameter(3),c.z=this.floatParameter(4)):
this.e.isCenterParameter(2)?(c=this.centerParameter(2),this.e.checkLast(this.e.iToken)):this.checkLength(2);!this.chk&&!this.vwr.isJmolDataFrame()&&this.vwr.tm.setCenterAt(a,c)});n(k,"compare",function(){var a=this.e,c=!1,b=!1,f=!1,e=!1,d=!1,h=!1,j=null,g=null,q=null,l=null,u=null,Q=null;a.iToken=0;var m=this.isFloatParameter(1)?this.floatParameter(++a.iToken):NaN,B=null,r=null,t=null,e=0;if(4115==this.tokAt(1))r=this.vwr.bsA();else if(r=this.atomExpressionAt(1),a.isArrayParameter(++a.iToken))B=a.getPointArray(a.iToken,
-1,!1,!0);else if(1153433601!=(e=this.tokAt(a.iToken))&&4115!=e)t=this.atomExpressionAt(a.iToken);var k=null,n=!1,p=!1,v=null,s=JU.BSUtil.copy(r);null!=t&&s.or(t);for(var z=null==B&&null!=t&&s.equals(r),s=z,L=1153433601==e,U=!1,w=a.iToken+1;w<this.slen;++w)switch(this.getToken(w).tok){case 4115:s=!0;null==t&&(t=JU.BSUtil.copy(r));break;case 134218757:if(n=!0,e=this.tokAt(w+1),4!=e&&1275203608!=e){v="*";break}case 134218756:v=(p=1275203608==this.tokAt(++w))?"polyhedra":this.stringParameter(w);if(v.equalsIgnoreCase("polyhedra")||
v.equalsIgnoreCase("polyhedron"))p=!0;break;case 1677721602:b=d=!0;v=this.paramAsStr(++w);v.equalsIgnoreCase("SMILES")&&(n=!0,1612709900==this.e.tokAt(w+1)?(v="H",w++):v="*");break;case 3:case 2:m=Math.abs(this.floatParameter(w));break;case 268436992:break;case 2109448:k=this.atomExpressionAt(++w);w=a.iToken;break;case 10:case 1073742325:null!=Q&&this.invArg();q=this.atomExpressionAt(a.iToken);e=z?0:this.tokAt(a.iToken+1);l=null==B&&a.isArrayParameter(a.iToken+1)?null:10==e||1073742325==e?this.atomExpressionAt(++a.iToken):
JU.BSUtil.copy(q);null!=k&&(q.and(k),null!=l&&l.and(k));null==l?(e=a.iToken,B=a.getPointArray(a.iToken+1,-1,!1,!0),null==B?a.iToken=e:U=!0):null!=t&&l.and(t);null==u&&(u=new JU.Lst);u.addLast(A(-1,[q,null==l?B:l]));L&&(B=null);w=a.iToken;break;case 1275203608:n=p=!0;break;case 4125:break;case 7:null!=u&&this.invArg();c=!0;j=a.getQuaternionArray(a.theToken.getList(),1073742001);this.getToken(++w);g=a.getQuaternionArray(a.theToken.getList(),1073742001);null==Q&&(Q=new JU.Lst);Q.addLast(A(-1,[j,g]));
break;case 1073742077:c=!0;break;case 1153433601:L=!0;c=!1;break;case 134217751:c=!1;break;case 1073742029:h=!0;break;case 528432:b=!0;break;case 4160:f=!0;break;default:this.invArg()}if(!this.chk){s&&(m=0);Float.isNaN(m)||0>m?m=1:!h&&(!b&&!f)&&(b=f=!0);e=0!=m;(L=!c&&null==v&&!p||null!=B)&&J.api.Interface.getInterface("JU.Eigen",this.vwr,"script");null==u&&null==Q&&(p&&null==k&&(k=this.vwr.getAtomBitSet("polyhedra")),null==k?(q=L?this.vwr.getAtomBitSet("spine"):new JU.BS,0>q.nextSetBit(0)?(q=r,l=
t):(l=JU.BSUtil.copy(q),q.and(r),l.and(t))):(q=JU.BSUtil.copy(r),l=JU.BSUtil.copy(t),q.and(k),q.and(r),null!=l&&(l.and(k),l.and(t))),u=new JU.Lst,u.addLast(A(-1,[q,l])));z=null;if(s)for(var z=this.vwr.ms.getModelBS(r,!1),k=Array(z.cardinality()),w=0,C=z.nextSetBit(0);0<=C;C=z.nextSetBit(C+1),w++)k[w]=this.vwr.getModelUndeletedAtomsBitSet(C);else z=JU.BSUtil.newAndSetBit(0),k=A(-1,[r]);for(var H=0,C=z.nextSetBit(0);H<k.length;H++,C=z.nextSetBit(C+1)){var r=k[H],y=O(2,0);if(s&&p&&0==H)t=r;else{var F=
null,I=new JU.Lst,K=null,M=s?new JU.Lst:u;if(!U)for(w=0;w<u.size();++w){var G=u.get(w);s&&M.addLast(G=A(-1,[JU.BSUtil.copy(G[0]),G[1]]));G[0].and(r)}var E=null,D=null;if(L){null!=B&&(M.clear(),M.addLast(A(-1,[q,B])));try{K=this.vwr.getCenterAndPoints(M,!h)}catch(R){if(P(R,Exception))this.invArg();else throw R;}if(!h){F=K[0].length-1;for(w=1;w<=F;w++){I=K[0][w];G=K[1][w];if(!N(I,"JM.Atom")||!N(G,"JM.Atom"))break;s||JU.Logger.info(" atom 1 "+I.getInfo()+"\tatom 2 "+G.getInfo())}F=JU.Measure.calculateQuaternionRotation(K,
y);w=Float.isNaN(y[1])?NaN:Math.round(100*y[0])/100;y=Float.isNaN(y[1])?NaN:Math.round(100*y[1])/100;this.showString("RMSD "+w+" --\x3e "+y+" Angstroms")}}else if(c){if(null==Q)for(w=0;w<M.size();w++){G=M.get(w);j=this.vwr.getAtomGroupQuaternions(G[0],2147483647);g=this.vwr.getAtomGroupQuaternions(G[1],2147483647);for(F=0;F<j.length&&F<g.length;F++)I.addLast(g[F].div(j[F]))}else for(F=0;F<j.length&&F<g.length;F++)I.addLast(g[F].div(j[F]));y[0]=0;j=I.toArray(Array(I.size()));F=JU.Quat.sphereMean(j,
y,1E-4);this.showString("RMSD = "+y[0]+" degrees")}else{w=new JU.M4;E=new JU.P3;if(null!=r&&null!=v&&("H".equals(v)||"*".equals(v)||"".equals(v)))try{v=this.vwr.getSmilesOpt(null==q?r:q,-1,-1,32768|("H".equals(v)?4096:0),null)}catch(V){if(P(V,Exception))a.evalError(V.getMessage(),null);else throw V;}if(d){var S;if(null==r||null==t||null==(S=a.getSmilesExt().getFlexFitList(r,t,v,!n)))break;this.vwr.setDihedrals(S,null,1)}p?(y=JU.BS.copy(q),y.and(r),I=JU.BS.copy(l),I.and(t),y=a.getSmilesExt().mapPolyhedra(y.nextSetBit(0),
I.nextSetBit(0),n,w)):(this.showString("COMPARE using "+(n?"SMILES ":"SMARTS ")+v),G=new JU.Lst,y=new JU.Lst,y=a.getSmilesExt().getSmilesCorrelation(null==q?r:q,null==l?t:l,v,G,y,w,null,!1,null,E,!1,32|(n?1:2)));if(Float.isNaN(y)){this.showString("structures do not match from "+r+" to "+t);break}f&&(D=new JU.V3,w.getTranslation(D));b&&(F=new JU.M3,w.getRotationScale(F),F=JU.Quat.newM(F));this.showString("RMSD = "+y+" Angstroms");s&&(w=this.vwr.getV0abc(C,A(-1,[w])),null!=w&&this.vwr.ms.setModelCagePts(C,
w,null))}null!=K&&(E=K[0][0]);null==E&&(K=this.vwr.getCenterAndPoints(M,!0),E=K[0][0]);M=new JU.P3;I=NaN;if(h)I=1E10;else if(f&&(null==D&&(D=JU.V3.newVsub(K[1][0],E)),I=1E10),b&&(null==F&&a.evalError("option not implemented",null),M.add2(E,F.getNormal()),I=F.getTheta(),0==I&&f))if(0.01<D.length())I=1E10;else if(s)continue;else b=f=e=!1;if(!Float.isNaN(I)&&!Float.isNaN(M.x)){y=null;if(h){y=new JU.Lst;F=K[0].length;for(w=0;w<F;w++)y.addLast(K[1][w])}else b&&(f&&0!=m)&&(G=this.vwr.ms.getAtomPointVector(r),
w=JS.ScriptMathProcessor.getMatrix4f(F.getMatrix(),D),y=JS.ScriptParam.transformPoints(G,w,E));a.useThreads(!0)||(e=!1);if(this.vwr.rotateAboutPointsInternal(a,E,M,I/m,I,e,r,D,y,null,null,null,!1,h?K:null)&&e&&a.isJS)throw new JS.ScriptInterruption(a,"compare",1);}}}}});n(k,"configuration",function(){var a=null,c=this.chk?null:this.vwr.bsA();if(1==this.slen){if(this.chk)return;a=this.vwr.ms.setConformation(c);this.vwr.ms.addStateScript("select",null,c,null,";configuration",!0,!1)}else{var c=-2147483648,
b=null;4==this.tokAt(1)?c=-1E3-(this.stringParameter(this.e.checkLast(1))+" ").codePointAt(0):2==this.tokAt(1)?c=this.intParameter(this.e.checkLast(1)):(b=a=this.atomExpressionAt(1),c=4==this.tokAt(this.e.iToken)?-1E3-(this.stringParameter(this.e.checkLast(this.e.iToken+1))+" ").codePointAt(0):this.intParameter(this.e.checkLast(this.e.iToken+1)));if(this.chk)return;this.vwr.addStateScript("configuration "+(null==b?"":JU.Escape.eBS(a)+" ")+c+";",!0,!1);a=this.vwr.ms.getConformation(this.vwr.am.cmi,
c,!0,b)}this.setShapeProperty(1,"type",Integer.$valueOf(30720));this.e.setShapeSizeBs(1,0,a);this.vwr.autoHbond(a,a,!0);this.vwr.selectStatus(a,!1,0,!this.e.doReport(),!1)});n(k,"measure",function(){var a=this.e,c=null,b=0,f=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;case 1113589787:this.chk||this.showMeasureCount(!0);return}this.vwr.shm.loadShape(6);switch(this.tokAt(1)){case 134218756:var e=
this.stringParameter(3==this.slen?2:4);if(this.chk)return;var d=this.vwr.ms.at,h=this.vwr.ms.ac,c=null;try{c=this.vwr.getSmilesMatcher().getCorrelationMaps(e,d,h,this.vwr.bsA(),2)}catch(j){if(P(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 q=0,l=0,u=-1,k=-1,m=-1,n=D(5,0),r=O(-1,[3.4028235E38,3.4028235E38]),t=!1,x=!1,A=!1,p=!0,v=!1,s=null,z=null,e=268438018,L=d=null,U=h=null,w=new JU.Lst,v=new JU.BS,
C=null,H=null,y=null,F=0,I=0,K=NaN,M=null,g=1;g<this.slen;++g)switch(this.getToken(g).tok){default:this.error(15);break;case 1073741974:1!=g&&this.invArg();c=a.optParameterAsString(++g);continue;case 1073741824:a.errorStr(24,"ALL, ALLCONNECTED, DELETE");break;case 1275082241:e=1275082241;if(1073742327==this.tokAt(g+1)&&this.slen==g+2){this.chk||(this.vwr.setShapeProperty(6,"selectall",null),this.showMeasureCount(!0));return}break;case 1113589787:(0<w.size()||0<F||null!=c)&&this.invArg();e=1275082241;
if(this.chk)C=new JU.BS;else if(C=this.vwr.getShapeProperty(6,"selected"),0==C.cardinality())return;t=!0;break;case 268439040:134217736!=this.tokAt(g+1)&&this.invArg();g++;A=!0;break;case 1073741832:M=this.paramAsStr(++g).toLowerCase();break;case 134217736:case 1073741834:case 1073742327:x=1073741834==a.theTok;k=-1;t=!0;x&&A&&this.invArg();break;case 1765808134:b=JU.C.getColix(a.getArgbParam(++g));g=a.iToken;break;case 1073742066:a.isPoint3f(++g)?(f=this.getPoint3f(g,!1),f=O(-1,[1,f.x,f.y,f.z,0,0,
0])):f=a.floatParameterSet(g,7,7);g=a.iToken;break;case 1665140738:case 1073741917:I=E((1665140738==a.theTok?2E3:1E3)*this.floatParameter(++g));null!=c&&0>=I&&(I=-1);break;case 3:null!=s&&this.invArg();p=t=!0;m=(m+1)%2;r[m]=this.floatParameter(g);break;case 12291:268438018!=e&&1275082241!=e&&this.invArg();e=12291;break;case 4114:var G=this.floatParameter(++g),R=this.paramAsStr(++g),S=this.paramAsStr(++g);this.chk||(U=this.vwr.getFont3D(R,S,G));break;case 2:G=this.intParameter(g);if(t)p=!0,m=(m+1)%
2,r[m]=G;else{k=this.vwr.ms.getFirstAtomIndexFromAtomNumber(G,this.vwr.getVisibleFramesBitSet());if(!this.chk&&0>k)return;null!=H&&this.invArg();4<(n[0]=++q)&&a.bad();n[q]=k}break;case 1094713359:u=this.intParameter(++g);break;case 1073742334:268438018!=e&&this.invArg();e=1073742334;break;case 1073742335:268438018!=e&&this.invArg();e=1073742335;break;case 1073742114:p=t=!0;k=-1;break;case 1073741989:case 1073741990:z=Boolean.$valueOf(1073741989==a.theTok);t=!0;A=1073741990==a.theTok;break;case 1648363544:0<=
m&&this.invArg();s=a.encodeRadiusParameter(g,!1,!0);if(null==s)return;s.values=r;g=a.iToken;t=A=!0;z=Boolean.$valueOf(!1);1==F&&(F++,q++,G=JU.BSUtil.copy(v),JU.BSUtil.invertInPlace(G,this.vwr.ms.ac),G.and(this.vwr.ms.getAtomsWithinRadius(5,v,!1,null,null)),w.addLast(G));break;case 12290:case 10:case 1073742325:F++;case 1073742332:case 8:case 1073742330:(0<=k||null!=C)&&this.invArg();q=Array(1);H=a.centerParameter(g,q);if(N(q[0],"JU.BS")&&(H=v=q[0],!this.chk&&0==v.length()))return;N(H,"JU.P3")&&(H=
JU.Point3fi.newPF(H,u));4<(q=++l)&&a.bad();g=a.iToken;w.addLast(H);break;case 1715472409:L=this.paramAsStr(g);break;case 1073742188:K=this.floatParameter(++g);break;case 4:G=this.stringParameter(g);JM.Measurement.isUnits(G)||G.equals("default")?h=G:d=G;break;case 1073742164:y=a.tickParamAsStr(g,!1,!0,!0),g=a.iToken,e=12290}(null!=s&&(0<=m||2!=q)||1275082241!=e&&null==C&&2>q&&null==c&&(null==y||1==q))&&a.bad();null!=d&&0!=d.indexOf(q+":")&&(d=q+":"+d);p&&r[1]<r[0]&&(r[1]=r[0],r[0]=3.4028235E38==r[1]?
3.4028235E38:-200);if(!this.chk)if(v=null!=c&&null==H&&268438018==e,null!=H||null!=C||null!=y||v){null==s&&(s=new J.atomdata.RadiusData(r,0,null,null));null!=y&&(y.id="default");if(v)e=266284;else if(null!=H&&(null!=L||null!=d)&&268438018==e)e=12290;a=null;if(null!=U||null!=M||0!=b||null!=d&&(v||0<=d.indexOf("\n")))a=JM.Text.newMeasure(this.vwr,U,b);null!=a&&(a.pymolOffset=f,a.setAlignmentLCR(M));this.setShapeProperty(6,"measure",this.vwr.newMeasurementData(c,w).set(e,null,s,L,d,h,y,x,A,z,t,I,b,a,
K,C));1275082241==e&&this.showMeasureCount(!1)}else switch(a=null==c?n:c,e){case 12291:this.setShapeProperty(6,"delete",a);break;case 1073742335:this.setShapeProperty(6,"show",a);break;case 1073742334:this.setShapeProperty(6,"hide",a);break;default:this.setShapeProperty(6,null==d&&null==h?"toggle":"toggleOn",a),null!=d&&this.setShapeProperty(6,"setFormats",d)}});n(k,"showMeasureCount",function(a){var c=this.vwr.getShapeProperty(6,"selected"),b=c.cardinality();if(a)for(a=c.nextSetBit(0);0<=a;a=c.nextSetBit(a+
1))this.showString(this.vwr.shm.getShape(6).getInfoAsString(a));this.showString(b+(1==b?" measure":" measures")+" selected")},"~B");n(k,"connect",function(a){var c=this.e,b=O(2,0),f=Array(2);f[0]=f[1]=this.vwr.bsA();var e=NaN,d=D(-1,[-2147483648]),h=0,j=131071,g=1073742026,q=!1,l=!1,u=!1,k=3.4028235E38,m=!1,n=0,r=0,t=new JU.BS,x=!1,T=0,p=0,v=0,s=!1;if(1==this.slen)this.chk||this.vwr.rebondState(c.$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(c.$isStateScript);return;case 2:case 3:if(0<n){(l||m)&&c.error(23);j=JU.Edge.getBondOrderFromFloat(this.floatParameter(a));131071==j&&this.invArg();l=!0;break}2<++r&&c.bad();var z=this.floatParameter(a);268441090==this.tokAt(a+1)&&(z=-z/100,a++);b[h++]=z;break;case 12290:case 10:case 1073742325:(2<n||x&&0<n)&&c.bad();(l||m)&&this.invArg();f[n++]=this.atomExpressionAt(a);
x=c.isBondSet;if(2==n){for(var z=c.iToken,L=a;L<z;L++)if(1073741824==this.tokAt(L)&&this.paramAsStr(L).equals("_1")){T=a;break}c.iToken=z}a=c.iToken;break;case 1086324742:s=!0;break;case 1765808134:case 1111490588:case 1073742074:m=!0;k=this.getColorTrans(c,a,!1,d);a=c.iToken;break;case 1073742086:d=1073741852==this.tokAt(2);this.checkLength(d?3:2);if(this.chk)return;this.vwr.clearModelDependentObjects();this.vwr.ms.deleteAllBonds();e=new JU.BS;this.vwr.ms.setPdbConectBonding(0,0,e);if(d){c=c.$isStateScript&&
this.vwr.getBoolean(603979872);this.vwr.ms.autoBondBs4(null,null,e,null,this.vwr.getMadBond(),c,null);this.vwr.addStateScript(c?"set legacyAutoBonding TRUE;connect PDB AUTO;set legacyAutoBonding FALSE;":"connect PDB auto;",!1,!0);return}this.vwr.addStateScript("connect PDB;",!1,!0);return;case 1073741852:case 1073741904:case 1073742025:case 1073742026:u=!0;++a!=this.slen&&this.invArg();g=c.theTok;1073741852==g&&!(131071==j||2048==j||515==j)&&this.invArg();break;case 659482:m||(d[0]=16777215,k=0.5,
e=this.vwr.getFloat(570425406),m=!0),u||(g=1073742026,u=!0);case 1073741824:if(c.isColorParam(a)){p=-a;break}case 1075838996:case 1613238294:j=this.paramAsStr(a);131071==(j=JU.Edge.getBondOrderFromString(j))&&this.invArg();l&&c.error(18);l=!0;switch(j){case 33:switch(this.tokAt(a+1)){case 3:j=JU.Edge.getPartialBondOrderFromFloatEncodedInt(this.st[++a].intValue);break;case 2:j=this.intParameter(++a)}break;case 2048:2==this.tokAt(a+1)&&(j=this.intParameter(++a)<<11,v=this.floatParameter(++a));break;
case 65537:u||(g=1073742025,u=!0)}break;case 1665140738:e=this.floatParameter(++a);m=!0;break;case 1073742333:++a!=this.slen&&this.invArg();case 12291:g=12291;q=!0;m=!1;break;default:p=a}0<a&&(p==-a||p==a&&c.isColorParam(a)?(m=!0,d[0]=c.getArgbParam(a),a=c.iToken):p==a&&this.invArg())}if(!this.chk){2>h&&(0==h&&(b[0]=1E8),b[1]=b[0],b[0]=0.1);m&&(l||(j=65535),u||(g=1073742025));l=h=0;if(0<T){v=new JU.BS;this.vwr.definedAtomSets.put("_1",v);s=f[0];for(u=s.nextSetBit(0);0<=u;u=s.nextSetBit(u+1))v.set(u),
f=this.vwr.makeConnections(b[0],b[1],j,g,v,this.atomExpressionAt(T),t,x,!1,0),h+=Math.abs(f[0]),l+=f[1],v.clear(u)}else f=this.vwr.makeConnections(b[0],b[1],j,g,f[0],f[1],t,x,s,v),h+=Math.abs(f[0]),l+=f[1];b=c.doReport();q?b&&c.report(J.i18n.GT.i(J.i18n.GT.$("{0} connections deleted"),l),!1):(m&&(this.vwr.selectBonds(t),Float.isNaN(e)||c.setShapeSizeBs(1,Math.round(2E3*e),null),this.finalizeObject(1,d[0],k,0,!1,null,0,t),this.vwr.selectBonds(null)),b&&c.report(J.i18n.GT.o(J.i18n.GT.$("{0} new bonds; {1} modified"),
A(-1,[Integer.$valueOf(h),Integer.$valueOf(l)])),!1))}}},"~N");n(k,"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()}});n(k,"data",function(){var a=this.e,c=null,b=null,f=!1,e;switch(a.iToken=this.slen){case 5:c=this.paramAsStr(2);case 4:case 2:b=
this.paramAsStr(1);if(b.equalsIgnoreCase("clear")){this.chk||this.vwr.setData(null,null,0,0,0,0,0);return}if(0<=(e=b.indexOf("@")))c=""+a.getParameter(b.substring(e+1),4,!0),b=b.substring(0,e).trim();else if(null==c&&0<=(e=b.indexOf(" ")))c=b.substring(e+1).trim(),b=b.substring(0,e).trim(),f=!0;break;default:a.bad()}e=b.substring(0,(b+" ").indexOf(" ")).toLowerCase();if(e.equals("model")||e.equals("append"))a.cmdLoad();else if(!this.chk){var d=0<=b.toLowerCase().indexOf("(default)");if(e.equals("connect_atoms"))this.vwr.ms.connect(this.parseDataArray(c,
!1));else if(0==e.indexOf("ligand_"))this.vwr.setLigandModel(b.substring(7).toUpperCase()+"_data",c.trim());else if(0==e.indexOf("file_"))this.vwr.setLigandModel(b.substring(5)+"_file",c.trim());else if(a=Array(4),e.equals("element_vdw")){a[0]=e;a[1]=c.$replace(";","\n");c=JU.Elements.elementNumberMax;e=D(c+1,0);for(d=1;d<=c;d++)e[d]=d;a[2]=e;a[3]=Integer.$valueOf(0);this.vwr.setData("element_vdw",a,c,0,0,0,0)}else if(0==e.indexOf("data2d_"))a[0]=b,a[1]=this.parseDataArray(c,!1),a[3]=Integer.$valueOf(2),
this.vwr.setData(b,a,0,0,0,0,0);else if(0==e.indexOf("data3d_"))a[0]=b,a[1]=this.parseDataArray(c,!0),a[3]=Integer.$valueOf(3),this.vwr.setData(b,a,0,0,0,0,0);else{var h=JU.PT.getTokens(b);if(0==e.indexOf("property_")&&!(2==h.length&&h[1].equals("set"))){d=this.vwr.bsA();a[0]=e;var j=f?0:this.vwr.getP("propertyAtomNumberField").intValue(),g=f?0:this.vwr.getP("propertyAtomNumberColumnCount").intValue(),q=f?-2147483648:this.vwr.getP("propertyDataField").intValue(),l=f?0:this.vwr.getP("propertyDataColumnCount").intValue();
!f&&0<=b.indexOf(" ")&&(3==h.length&&(j=JU.PT.parseInt(h[1]),q=JU.PT.parseInt(h[2])),5==h.length&&(j=JU.PT.parseInt(h[1]),g=JU.PT.parseInt(h[2]),q=JU.PT.parseInt(h[3]),l=JU.PT.parseInt(h[4])));0>j&&(j=0);0>q&&(q=0);b=this.vwr.ms.ac;f=null;h=JU.BS.newN(b);if(0<j){for(var f=D(b+2,0),u=0;u<=b;u++)f[u]=-1;for(u=d.nextSetBit(0);0<=u;u=d.nextSetBit(u+1)){var k=this.vwr.ms.at[u].getAtomNumber();k>b+1||(0>k||h.get(k))||(h.set(k),f[k]=u)}a[2]=f}else a[2]=JU.BSUtil.copy(d);a[1]=c;a[3]=Integer.$valueOf(0);this.vwr.setData(e,
a,b,j,g,q,l)}else"occupany".equals(e)&&(e="occupancy"),j=JM.AtomCollection.getUserSettableType(e),-1<j?this.vwr.setAtomData(j,e,c,d):(a[0]=b,a[1]=c,a[3]=Integer.$valueOf(0),this.vwr.setData(e,a,0,0,0,0,0))}}});n(k,"ellipsoid",function(){var a=this.e,c=0,b=1,f=3.4028235E38,e=!1,d=!1;this.setShapeProperty(20,"thisID",null);switch(this.getToken(1).tok){case 1073742335:c=2147483647;break;case 1073742334:break;case 2:c=this.intParameter(1);break;case 36867:this.e.sm.loadShape(20);this.setShapeProperty(20,
"select",this.paramAsStr(2));b=a.iToken;d=e=!0;break;case 1073741974:case 268441089:case 1073741824:this.e.sm.loadShape(20);1073741974==a.theTok&&b++;this.setShapeId(20,b,!1);b=a.iToken;e=!0;break;default:this.invArg()}if(e){for(c=D(-1,[-2147483648]);++b<this.slen;){var e=this.paramAsStr(b),h=null;this.getToken(b);if(!d)switch(a.theTok){case 1073742330:e="points";h=Array(3);h[0]=a.objectNameParameter(++b);if(this.chk)continue;a.getShapePropertyData(24,"getVertices",h);break;case 1825200146:h=this.e.optParameterAsString(++b);
if(0==h.length)continue;break;case 1611272194:var h=Array(3),j=null;switch(this.getToken(b+1).tok){case 11:for(var b=a.theToken.value,g=3;0<=--g;)b.getColumnV(g,h[g]=new JU.V3);break;case 1073742195:b+=2;case 268437504:j=new JU.Lst;for(g=3;0<=--g;){switch(this.tokAt(++b)){case 268437504:break;default:a.isCenterParameter(b)?j.addLast(JS.SV.newV(8,this.centerParameter(b))):268437504!=this.tokAt(b)&&j.addLast(this.getToken(b))}b=a.iToken}268437505!=this.getToken(++b).tok&&this.invArg();break;case 7:j=
a.theToken.getList();switch(j.size()){case 1:j=new JU.Lst;for(g=3;0<=--g;)j.addLast(this.getToken(++b));break;case 3:break;default:this.invArg()}break;default:for(g=0;3>g;g++)h[g]=new JU.V3,h[g].setT(this.centerParameter(++b)),b=a.iToken}if(null!=j)for(b=3;0<=--b;)switch(g=j.get(b),g.tok){case 7:h[b]=JU.V3.new3(JS.SV.fValue(g.getList().get(0)),JS.SV.fValue(g.getList().get(1)),JS.SV.fValue(g.getList().get(2)));break;case 8:h[b]=JU.V3.newV(g.value)}b=a.iToken;break;case 12289:h=this.centerParameter(++b);
b=a.iToken;break;case 1094713359:h=Integer.$valueOf(this.intParameter(++b));break;case 12291:h=Boolean.TRUE,this.checkLength(b+1)}if(null==h)switch(a.theTok){case 1073742335:e="on";h=Boolean.TRUE;break;case 1073742334:e="on";h=Boolean.FALSE;break;case 536875059:this.isFloatParameter(b+1)?h=Float.$valueOf(this.floatParameter(++b)):a.isCenterParameter(b)?(b=this.centerParameter(b),h=O(-1,[b.x,b.y,b.z])):h=a.floatParameterSet(++b,3,3);b=a.iToken;break;case 12290:case 10:case 1073742325:e="atoms";h=this.atomExpressionAt(b);
b=a.iToken;break;case 1765808134:case 1111490588:case 1073742074:f=this.getColorTrans(a,b,!0,c);b=a.iToken;continue;case 1073742075:h=this.paramAsStr(++b)}null==h&&this.invArg();this.setShapeProperty(20,e.toLowerCase(),h)}this.finalizeObject(20,c[0],f,0,!1,null,0,null);this.setShapeProperty(20,"thisID",null)}else a.setShapeSizeBs(20,c,null)});n(k,"image",function(){this.chk||this.vwr.getConsole();var a=1,c=null;1073741974==this.tokAt(1)&&(c=this.e.optParameterAsString(++a),a++);var b=this.e.optParameterAsString(a),
f=this.e.optParameterAsString(this.slen-1).equalsIgnoreCase("close");if(!f&&(this.slen==a||this.slen==a+2))b=this.slen==a+2?this.intParameter(a++):-1,a=0>b?-1:this.intParameter(a),f=new java.util.Hashtable,f.put("fileName","\u0001\u0001"+c),f.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb())),f.put("type","png"),f.put("quality",Integer.$valueOf(-1)),f.put("width",Integer.$valueOf(b)),f.put("height",Integer.$valueOf(a)),this.chk||this.vwr.processWriteOrCapture(f);else{if(f)switch(this.slen){case 2:b=
"closeall";break;case 3:case 4:break;default:this.checkLength(0)}this.chk||this.vwr.fm.loadImage(f?"\u0001close":b,"\u0001"+b+"\u0001"+("".equals(c)||null==c?null:c),!1)}});n(k,"invertSelected",function(){var a=this.e,c=null,b=null,f=null,e=-2147483648,d=1;switch(this.tokAt(1)){case 0:if(this.chk)return;f=this.vwr.bsA();c=this.vwr.ms.getAtomSetCenter(f);this.vwr.invertAtomCoord(c,null,f,-1,!1);return;case 528443:case 1153433601:d++;case 10:case 1073742325:case 12290:f=this.atomExpressionAt(d);if(!a.isAtomExpression(a.iToken+
1)){a.checkLengthErrorPt(a.iToken+1,a.iToken+1);if(!this.chk)for(a=f.nextSetBit(0);0<=a;a=f.nextSetBit(a+1))this.vwr.invertAtomCoord(null,null,f,a,!1);return}e=f.nextSetBit(0);f=this.atomExpressionAt(a.iToken+1);break;case 134217751:c=a.centerParameter(2,null);break;case 134217750:b=a.planeParameter(1,!1);break;case 134219777:b=a.hklParameter(2,null,!0)}a.checkLengthErrorPt(a.iToken+1,1);null==b&&(null==c&&-2147483648==e)&&this.invArg();this.chk||-1!=e&&this.vwr.invertSelected(c,b,e,f)});n(k,"mapProperty",
function(){for(var a,c,b,f,e,d=0,h=0,j=0,g=this.e;;){if(1113589787==this.tokAt(1))a=this.vwr.bsA(),c=this.atomExpressionAt(2),b=f="selected";else{a=this.atomExpressionAt(1);if(1073742336!=this.tokAt(++g.iToken)||!JS.T.tokAttr(d=this.tokAt(++g.iToken),1077936128))break;b=this.paramAsStr(g.iToken);c=this.atomExpressionAt(++g.iToken);if(1073742336!=this.tokAt(++g.iToken)||!JS.T.tokAttr(h=this.tokAt(++g.iToken),2048))break;f=this.paramAsStr(g.iToken)}e=JS.T.tokAttr(j=this.tokAt(g.iToken+1),1077936128)?
this.paramAsStr(++g.iToken):JS.T.nameOf(j=1094715393);g.checkLast(g.iToken);if(this.chk)return;var q=null;this.showString("mapping "+b.toUpperCase()+" for "+a.cardinality()+" atoms to "+f.toUpperCase()+" for "+c.cardinality()+" atoms using "+e.toUpperCase());if(JS.T.tokAttrOr(d,1094713344,1111490560)&&JS.T.tokAttrOr(h,1094713344,1111490560)&&JS.T.tokAttrOr(j,1094713344,1111490560)){var l=g.getBitsetPropertyFloat(a,d|224,null,NaN,NaN),u=g.getBitsetPropertyFloat(a,j|224,null,NaN,NaN),d=g.getBitsetPropertyFloat(c,
j|224,null,NaN,NaN),k=1715472409==h,m=O(k?this.vwr.ms.ac:d.length,0),q=new JU.BS;if(l.length==u.length){for(var n=new java.util.Hashtable,j=0;j<l.length;j++)n.put(Float.$valueOf(u[j]),Float.$valueOf(l[j]));l=-1;for(j=u=0;j<d.length;j++){var l=c.nextSetBit(l+1),r=n.get(Float.$valueOf(d[j]));null!=r&&(q.set(l),m[k?l:u]=r.floatValue(),u++)}k?this.vwr.setData(f,A(-1,[f,m,q,Integer.$valueOf(1),Boolean.TRUE]),this.vwr.ms.ac,0,0,2147483647,0):JS.T.tokAttr(h,2048)?this.vwr.setAtomProperty(q,h,0,0,null,m,
null):this.error(56)}}if(null==q){b=this.getBitsetIdent(a,"{"+e+"=%["+e+"]}."+f+" = %["+b+"]",null,!1,2147483647,!1);a=new JU.SB;for(j=0;j<b.length;j++)0>b[j].indexOf("null")&&a.append(b[j]).appendC("\n");JU.Logger.debugging&&JU.Logger.debug(a.toString());b=JU.BSUtil.copy(this.vwr.slm.bsSubset);this.vwr.slm.setSelectionSubset(c);try{g.runScript(a.toString())}catch(t){if(P(t,Exception))c=t,this.vwr.slm.setSelectionSubset(b),g.errorStr(-1,"Error: "+c.getMessage());else if(P(t,Error))c=t,this.vwr.slm.setSelectionSubset(b),
g.errorStr(-1,"Error: "+c.toString());else throw t;}this.vwr.slm.setSelectionSubset(b)}this.showString("DONE");return}this.invArg()});n(k,"minimize",function(a){for(var c=null,b=2147483647,f=0,e=!1,d=!1,h=null,j=!1,g=!1,q=this.vwr.getMinimizer(!1),l=0,u=a?2:1;u<this.slen;u++)switch(this.getToken(u).tok){case 1073741905:f=this.floatParameter(++u);continue;case 1073742114:l=this.floatParameter(++u);continue;case 1073741935:b=0;continue;case 1073741874:case 1073742162:this.checkLength(2);if(this.chk||
null==q)return;q.setProperty(this.paramAsStr(u),null);return;case 1073741882:this.checkLength(2);if(this.chk||null==q)return;q.setProperty("clear",null);return;case 1073741894:1!=u&&this.invArg();c=a=0;b=D(5,0);if(1073741882==this.tokAt(++u))this.checkLength(3);else{for(;4>a&&!this.isFloatParameter(u);)b[++a]=this.atomExpressionAt(u).nextSetBit(0),u=this.e.iToken+1;b[0]=a;1==a&&this.invArg();c=this.floatParameter(this.e.checkLast(u))}this.chk||this.vwr.getMinimizer(!0).setProperty("constraint",A(-1,
[b,Float.$valueOf(c)]));return;case 12293:1!=u&&this.invArg();if(this.slen==++u){this.chk||(u=this.vwr.getMinimizer(!0).getProperty("fixed",0),null==u?this.e.showString("no atoms are fixed for minimization"):(a=u.cardinality(),this.e.showString(a+(1==a?" atom is":" atoms are")+" fixed for minimization: "+u+"\nunfix them with MINIMIZE FIX NONE")));return}h=this.atomExpressionAt(u);0>h.nextSetBit(0)&&(h=null);u=this.e.iToken;this.chk||this.vwr.getMinimizer(!0).setProperty("fixed",h);if(u+1==this.slen)return;
continue;case 1073741828:e=!0;continue;case 1073742072:case 1113589787:j=!0;break;case 1086324742:g=!0;break;case 1073742148:d=!0;break;case 266298:b=this.intParameter(++u);continue;case 10:case 1073742325:j=!0;case 1275082241:1275082241==this.e.theTok&&u++;c=this.atomExpressionAt(u);u=this.e.iToken;1073742072==this.tokAt(u+1)&&(u++,j=!0);continue;default:this.invArg()}a&&(e||j||g)&&this.invArg();if(!this.chk)try{this.vwr.minimize(this.e,b,f,c,h,null,l,(e?16:0)|(a?256:0)|(j?32:0)|(g?64:0)|(d?1:0))}catch(k){if(P(k,
Exception))throw new JS.ScriptInterruption(this.e,"minimize",1);throw k;}},"~B");n(k,"modulation",function(){var a=null,c=this.e,b=!0,f=!1,e=null,d=1;switch(this.getToken(d).tok){case 1073742334:b=!1;case 0:case 1073742335:break;case 12290:case 10:case 1073742325:e=this.atomExpressionAt(1);switch(this.tokAt(c.iToken+1)){case 1073742334:b=!1;case 1073742335:c.iToken++}c.checkLast(c.iToken);break;case 1073742332:case 8:a=c.getPoint3f(1,!1,!0);f=1073742335==this.tokAt(c.iToken+1);break;default:var h=
c.theToken.value.toString();d++;h.equalsIgnoreCase("t")?c.theTok=3:h.equalsIgnoreCase("m")||h.equalsIgnoreCase("q")?c.theTok=2:this.invArg();case 3:case 2:switch(c.theTok){case 3:this.isFloatParameter(d)?(a=this.floatParameter(d),a=JU.P3.new3(a,a,a)):a=c.getPoint3f(d,!1,!0);break;case 2:2==this.tokAt(d)?(f=this.intParameter(d),a=JU.P3.new3(f,f,f)):a=c.getPoint3f(d,!1,!0),f=!0}break;case 536875059:b=this.floatParameter(2);this.chk||this.vwr.setFloatProperty("modulationScale",b);return}this.chk||(this.vwr.tm.setVibrationPeriod(0),
this.vwr.setModulation(e,b,a,f))});n(k,"mutate",function(){var a=this.e.iToken,c,b=null,f=null,e=null,d=!1;switch(this.tokAt(++a)){case 1073741904:b="alpha";d=!0;c=null;switch(this.tokAt(++a)){case 0:this.invArg();break;default:switch(f=this.e.paramAsStr(a),a=this.e.iToken,this.tokAt(a+1)){case 0:break;case 268437504:case 1073742195:case 7:b=null;e=this.e.floatParameterSet(++a,2,2147483647);1==e.length%2&&this.invArg();a=this.e.iToken;break;default:b=this.e.paramAsStr(++a),a=this.e.iToken}}break;
case 2:this.st[1]=JS.T.o(4,""+this.st[1].value);default:c=this.atomExpressionAt(a);a=++this.e.iToken;break;case 268441089:c=this.vwr.getFrameAtoms(),a=++this.e.iToken}if(!this.chk&&null!=c){c.and(this.vwr.getFrameAtoms());var h=c.nextSetBit(0);0>h&&this.invArg();h=this.vwr.ms.at[h].mi;if(this.vwr.ms.isTrajectory(h)||!this.vwr.ms.am[h].isBioModel)return}null==f&&(f=this.e.optParameterAsString(a));this.e.checkLast(a);if(!this.chk){a=f.startsWith("~");if(!a&&!d&&(0<=f.indexOf(".")||0>f.indexOf("-")&&
3<f.length&&f.startsWith("==")))d=A(-1,[f]),f=null;else if(f=JU.PT.replaceAllCharacters(f,",; \t\n"," ").trim().toUpperCase(),!a&&0<=f.indexOf("-"))d=JU.PT.split(f,"-");else{if(a||3!=f.length||!this.vwr.getJBR().isKnownPDBGroup(f,20))f=this.vwr.getJBR().toStdAmino3(a?f.substring(1):f);d=JU.PT.getTokens(f)}this.e.iToken=this.e.slen;0<d.length&&!this.vwr.getJBR().getBioModelSet(this.vwr.ms).mutate(c,f,d,b,e)&&this.invArg()}});n(k,"navigate",function(){var a=this.e;if(1==this.slen)a.setBooleanProperty("navigationMode",
!0);else{var c=JU.V3.new3(0,1,0),b=new JU.Lst,f;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 e=1;e<this.slen;e++){var d=this.isFloatParameter(e)?this.floatParameter(e++):2;0>d&&this.invArg();!this.chk&&0<d&&a.refresh(!1);switch(this.getToken(e).tok){case 8:case 1073742332:f=this.getPoint3f(e,!0);a.iToken++;a.iToken!=this.slen&&this.invArg();this.chk||this.vwr.tm.setNavXYZ(f.x,f.y,f.z);return;case 554176526:f=this.floatParameter(++e);this.chk||b.addLast(A(-1,[Integer.$valueOf(554176526),Float.$valueOf(d),Float.$valueOf(f)]));continue;case 12289:f=this.centerParameter(++e);e=a.iToken;
this.chk||b.addLast(A(-1,[Integer.$valueOf(134217751),Float.$valueOf(d),f]));continue;case 528432:switch(this.getToken(++e).tok){case 1111492629:c.set(1,0,0);e++;break;case 1111492630:c.set(0,1,0);e++;break;case 1111492631:c.set(0,0,1);e++;break;case 8:case 1073742332:c.setT(this.getPoint3f(e,!0));e=a.iToken+1;break;case 1073741824:this.invArg()}f=this.floatParameter(e);this.chk||b.addLast(A(-1,[Integer.$valueOf(528432),Float.$valueOf(d),c,Float.$valueOf(f)]));continue;case 4160:var h=f=NaN;if(this.isFloatParameter(++e))f=
this.floatParameter(e),h=this.floatParameter(++e);else switch(this.tokAt(e)){case 1111492629:f=this.floatParameter(++e);break;case 1111492630:h=this.floatParameter(++e);break;default:f=this.centerParameter(e);e=a.iToken;this.chk||b.addLast(A(-1,[Integer.$valueOf(4160),Float.$valueOf(d),f]));continue}this.chk||b.addLast(A(-1,[Integer.$valueOf(268441090),Float.$valueOf(d),Float.$valueOf(f),Float.$valueOf(h)]));continue;case 268441088:continue;case 1112152078:f=new JU.Lst;a.isAtomExpression(e+1)?(h=
this.atomExpressionAt(++e),e=a.iToken):h=this.vwr.bsA();if(this.chk)return;this.vwr.getPolymerPointsAndVectors(h,f);var j;if(0<(j=f.size())){for(var h=Array(j),g=0;g<j;g++)h[g]=f.get(g);b.addLast(A(-1,[Integer.$valueOf(1112152078),Float.$valueOf(d),h]));continue}break;case 1073742084:if(1073742330==this.getToken(e+1).tok){e++;f=a.objectNameParameter(++e);if(this.chk)return;this.setShapeProperty(22,"thisID",f);f=this.getShapeProperty(22,"vertices");a.refresh(!1);null==f&&this.invArg();h=E(this.isFloatParameter(e+
1)?this.floatParameter(++e):0);j=E(this.isFloatParameter(e+1)?this.floatParameter(++e):2147483647);b.addLast(A(-1,[Integer.$valueOf(1073742084),Float.$valueOf(d),f,null,D(-1,[h,j])]));continue}for(f=new JU.Lst;a.isCenterParameter(e+1);)f.addLast(this.centerParameter(++e)),e=a.iToken;if(0<f.size()){f=f.toArray(Array(f.size()));this.chk||b.addLast(A(-1,[Integer.$valueOf(1073742084),Float.$valueOf(d),f,null,D(-1,[0,2147483647])]));continue}default:this.invArg()}}!this.chk&&(!this.vwr.isJmolDataFrame()&&
!this.vwr.is2D())&&this.vwr.tm.navigateList(a,b)}});n(k,"plot",function(a){var c=this.e,b=this.vwr.am.cmi;0>b&&c.errorStr(30,"plot");var b=this.vwr.ms.getJmolDataSourceFrame(b),f=a.length-1,e=a!==this.st,d=!1,h=!0,j=!1,g=this.st;e&&(c.st=this.st=a);var q=e?134222350:a[0].tok,l=e||134221850==q||4138==q?0:1,u=null,k=!0,m=!1,n=!1;switch(q){case 4133:case 134221850:case 4138:if(j=1275069447==this.tokAt(f))c.slen=this.slen=f--;break;case 135176:k=!1;m=!0;break;case 134222350:h=k=!1;break;case 134221856:k=
!1,4==JS.CmdExt.tokAtArray(f,a)?u=this.stringParameter(f--):1073742336==JS.CmdExt.tokAtArray(f-1,a)?(u=this.paramAsStr(f-2)+"."+this.paramAsStr(f),f-=3):(c.st=this.st=g,c.iToken=this.st.length,this.error(13)),c.slen=this.slen=f+1}var r=e="",t="",x=!1,A=!1,p=!1,v=Array(3),s=D(3,0),z=JU.BSUtil.copy(this.vwr.bsA()),L="; select "+JU.Escape.eBS(z)+";\n ",p=c.optParameterAsString(f).toLowerCase(),E=null,w=null,C=null,H=JS.CmdExt.tokAtArray(l,a);4==H&&(H=JS.T.getTokFromName(a[l].value));switch(H){default:c.iToken=
1;this.invArg();break;case 134221834:c.iToken=1;p="data";L="";break;case 1073741872:p="brillouin";0>z.nextSetBit(0)&&(z=this.vwr.getModelUndeletedAtomsBitSet(b));break;case 1095241729:if(!this.chk){p="spin";n=1275068447==this.tokAt(l+1);s[0]=1111492626;s[1]=1111492627;s[2]=1111492628;v[0]="spinX";v[1]="spinY";v[2]="spinZ";z=this.vwr.fm.getJmolDataReader().getPlotSpinSet(this.vwr,z,b,E=new JU.P3,w=new JU.P3);if(null==z||0==z.cardinality())return null;a=this.vwr.ms.getJmolDataFrameInt(b,1095241729);
0<=a&&this.vwr.deleteModels(a,null);this.vwr.setSelectionSet(z)}break;case 1715472409:c.iToken=l+1;for(p=0;3>p;p++){switch(this.tokAt(c.iToken)){case 4:s[p]=JS.T.getTokFromName(c.getToken(c.iToken).value);break;default:s[p]=this.tokAt(c.iToken);break;case 0:0==p&&this.invArg();case 1287653388:case 32:case 64:p=2;continue}1715472409!=s[p]&&!JS.T.tokAttr(s[p],1077936128)&&this.invArg();v[p]=this.getToken(c.iToken).value.toString();c.iToken++}1287653388==this.tokAt(c.iToken)&&(C=this.stringParameter(++c.iToken),
h=!1,c.iToken++);32==this.tokAt(c.iToken)&&(E=this.getPoint3f(++c.iToken,!1),c.iToken++);64==this.tokAt(c.iToken)&&(w=this.getPoint3f(++c.iToken,!1),c.iToken++);p="property "+v[0]+(null==v[1]?"":" "+v[1])+(null==v[2]?"":" "+v[2]);0>z.nextSetBit(0)&&(z=this.vwr.getModelUndeletedAtomsBitSet(b));r="select "+JU.Escape.eBS(z)+";\n ";break;case 4138:p.equalsIgnoreCase("draw")&&(p=c.optParameterAsString(--f).toLowerCase());p=f>l&&p.startsWith("r");p="ramachandran"+(p?" r":"")+(135176==q?" draw":"");break;
case 134221850:case 136314895:e=' "'+this.vwr.getQuaternionFrame()+'"';r="set quaternionFrame"+e+";\n  ";d=!0;p.equalsIgnoreCase("draw")&&(m=!0,p=c.optParameterAsString(--f).toLowerCase());A=(x=p.startsWith("deriv")||p.startsWith("diff"))&&0<p.indexOf("2");x&&f--;if(p.equalsIgnoreCase("helix")||p.equalsIgnoreCase("axis"))x=m=!0,f=-1;p=((f<=l?"":c.optParameterAsString(f))+"w").substring(0,1);if(p.equals("a")||p.equals("r"))x=!0;JU.PT.isOneOf(p,";w;x;y;z;r;a;")||c.evalError("QUATERNION [w,x,y,z,a,r] [difference][2]",
null);p="quaternion "+p+(x?" difference":"")+(A?"2":"")+(m?" draw":"")}this.st=g;if(this.chk)return"";if(k&&(j&&(t+=" split"),r+="plot "+p+t,g=this.vwr.ms.getJmolDataFrameIndex(b,r),0<g&&134221856!=q&&134222350!=q))return this.vwr.setCurrentModelIndexClear(g,!0),"";g=this.vwr.fm.getJmolDataReader();h=1715472409==H||1095241729==H?g.getJmolDataFrameProperties(c,H,s,v,z,E,w,C,h):null;if(134221856==q)return this.vwr.writeFileData(u,"PLOT_"+p,b,h);switch(p.substring(0,4)){case "data":h="1 0 H 0 0 0 # Jmol PDB-encoded data";
break;default:h=this.vwr.getPdbData(b,p,null,h,null,!0)}if(134222350==q)return h;JU.Logger.debugging&&JU.Logger.debug(h);if(135176==q)return c.runScript(h),"";q=this.vwr.fm.getFileInfo();u=this.vwr.getBoolean(603979792);this.vwr.g.appendNew=!0;h=null!=h&&null==this.vwr.openStringInlineParamsAppend(h,null,!0);this.vwr.g.appendNew=u;this.vwr.fm.setFileInfo(q);if(!h)return"";q=this.vwr.ms.mc;g.setJmolDataFrame(this.vwr.ms,r,b,q-1);1715472409!=H&&(r+=";\n"+L);r=this.vwr.addStateScript(r,!0,!1);b=g.getJmolDataFrameScripts(this.vwr,
H,b,q,p,e,v,n);c.runScript(b[0]+L);r.setModelIndex(this.vwr.am.cmi);switch(H){case 1715472409:case 4138:case 134221850:case 136314895:case 1095241729:L=180;break;default:L=10}this.vwr.setRotationRadius(L,!0);c.sm.loadShape(31);null!=b[1]&&c.runScript(b[1]);j&&(j=this.vwr.getP("_modelNumber"),c.runScript("frame 1.1 "+j+" split;"));this.showString("frame "+this.vwr.getModelNumberDotted(this.vwr.ms.mc-1)+(0<p.length?" created: "+p+(d?e:""):""));return""},"~A");n(k,"polyhedra",function(){var a=this.e,
c=1==this.slen,b=!1,f=c,e=!1,d=!1,h=!1,j=NaN,g=0;a.sm.loadShape(21);this.setShapeProperty(21,"init",Boolean.TRUE);var q=3.4028235E38,l=-1,u=D(-1,[-2147483648]),k=-1,m=-1,n=null,r=0,t=null,x=!1,E=!1,p=null,v=null;if(2==this.slen&&1073742001==this.tokAt(1))this.chk||a.showStringPrint(this.getShapeProperty(21,"list"),!1);else{for(var s=1;s<this.slen;++s){var z=null,p=null;switch(this.getToken(s).tok){case 1073742197:j=NaN;case 1073741872:a=1073742197==this.e.theTok?-1:2==this.tokAt(s+1)?this.intParameter(++s):
1;8<a&&this.invArg();this.chk||J.api.Interface.getInterface("JU.BZone",this.vwr,"script").createBZ(this.vwr,a,null,!1,t,j,r,n);return;case 6:z="info";p=this.e.theToken.value;f=!0;break;case 134217751:z="points";p=Float.$valueOf(1073742334==this.tokAt(++s)?0:this.e.floatParameter(s));x=!0;break;case 536875059:j=this.floatParameter(++s);x=!0;continue;case 1814695966:null!=t&&this.invArg();z="unitCell";p=Boolean.TRUE;f=!0;break;case 1073742072:this.e.restrictSelected(!1,!1),a.theTok=1073742335;case 1073742335:case 12291:case 1073742334:(s+
1!=this.slen||f||1<g)&&this.error(18);z=1073742334==a.theTok?"off":1073742335==a.theTok?"on":"delete";e=!0;break;case 7:(null==t||f)&&this.invArg();f=!0;p=this.getIntArray2(s);v=this.getAllPoints(a.iToken+1,3);s=a.iToken;N(v[0],"JM.Atom")&&this.setShapeProperty(21,"model",Integer.$valueOf(v[0].getModelIndex()));z="definedFaces";p=A(-1,[p,v]);break;case 1073741961:z="full";break;case 2:null!=t&&this.invArg();z="nVertices";p=Integer.$valueOf(this.intParameter(s));f=!0;268436992==this.tokAt(s+1)&&s++;
break;case 1677721602:null!=t&&this.invArg();0<g&&this.invPO();f=!0;z="bonds";c=!0;break;case 1073741852:-1!=l&&this.invArg(),l=0,s--;case 1665140738:s++;case 3:null!=t&&this.invArg();0<g&&this.invPO();z=0>=l?"radius":"radius1";p=Float.$valueOf(l=0==l?0:this.floatParameter(s));f=!0;break;case 1073742066:this.isFloatParameter(s+1)?r=this.floatParameter(++s):(n=this.e.centerParameter(++s,null),s=a.iToken);x=!0;continue;case 1073741937:this.setShapeProperty(21,"collapsed",null);case 1073742099:case 1073741924:z=
JS.T.nameOf(a.theTok);switch(this.tokAt(s+1)){case 268440324:case 268436992:s++}p=Float.$valueOf(this.floatParameter(++s));break;case 1094717454:null==t&&this.invArg();z="model";p=Integer.$valueOf(this.intParameter(++s));break;case 1073742170:(1<g||null!=t&&!b||k==s)&&this.invPO();g=3;a.isAtomExpression(++s)?(z=f||b?"to":"toBitSet",p=this.atomExpressionAt(s)):a.isArrayParameter(s)?(z="toVertices",p=a.getPointArray(s,-1,!1,!0)):this.error(19);s=a.iToken;f=!0;break;case 12290:case 10:case 1073742325:d&&
this.invPO();switch(++g){case 1:null!=t&&this.invArg();z="centers";break;case 2:z="to";f=!0;break;default:a.bad()}p=this.atomExpressionAt(s);m=s=a.iToken;f=(new Boolean(f|s+1==this.slen)).valueOf();break;case 1073741948:case 1073741886:f=!0;E=1==s;d&&this.error(18);d=!0;z=1073741886==this.e.theTok?"collapsed":null;this.isFloatParameter(s+1)&&this.setShapeProperty(21,"faceCenterOffset",Float.$valueOf(this.floatParameter(++s)));break;case 1765808134:case 1111490588:case 1073742074:m==s-1&&(f=!0);q=
this.getColorTrans(a,s,!0,u);x=!0;s=a.iToken;continue;case 1073742044:case 1073741933:case 1073741956:case 1073741934:m==s-1&&(f=!0);h&&this.error(18);x=h=!0;z=JS.T.nameOf(a.theTok);break;case 1073742182:case 1073742060:case 1073741861:case 1073741958:case 1073741964:continue;case 1073741974:case 268441089:case 1073741824:case 4:if(!a.isColorParam(s)){1!=s&&this.invPO();t=1073741974==a.theTok?this.stringParameter(++s):a.optParameterAsString(s);268441089==this.tokAt(s+1)&&(t+=this.paramAsStr(++s));
this.setShapeProperty(21,"thisID",t);this.setShapeProperty(21,"model",Integer.$valueOf(this.vwr.am.cmi));if(!a.isCenterParameter(s+1))continue;z="center";p=this.centerParameter(++s);s=a.iToken;b=!0;break}default:if(a.isColorParam(s)){m==s-1&&(f=!0);u[0]=a.getArgbParam(s);a.isCenterParameter(s)&&(k=a.iToken+1);s=a.iToken;continue}this.invArg()}null!=z&&this.setShapeProperty(21,z,p);if(e)return}f?(!d&&c&&this.setShapeProperty(21,"bonds",null),this.setShapeProperty(21,"generate",Boolean.$valueOf(E))):
x||this.error(19);null!=n&&this.setShapeProperty(21,"offset",n);Float.isNaN(j)||this.setShapeProperty(21,"scale",Float.$valueOf(j));-2147483648!=u[0]&&this.setShapeProperty(21,"colorThis",Integer.$valueOf(u[0]));3.4028235E38!=q&&a.setShapeTranslucency(21,"","translucentThis",q,null);this.setShapeProperty(21,"init",Boolean.FALSE)}});n(k,"write",function(a){null==a&&this.vwr.haveAccessInternal(null)&&this.invArg();var c=this.e,b=1,f=1,e=null,d=null,h=null,j=null,g="SPT",q=!0,l=!1,u=!1;null==a?(a=this.st,
l=this.vwr.isApplet&&!this.vwr.isSignedApplet||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL)||0<this.vwr.fm.getPathForAllFiles().length):(b=f=0,q=!1,l=!q);var k=JS.CmdExt.tokAtArray(b,a);if(4==k&&!q){var m=JS.T.getTokenFromName(JS.SV.sValue(a[0]).toLowerCase());null!=m&&(k=m.tok)}switch(k){case 0:break;case 7:case 6:g="VAR";break;case 1095241729:case 1073741872:this.invArg();break;case 134221850:case 4138:case 1715472409:return d=this.plot(a),l?d:this.writeMsg(d);case 134222850:c.isArrayParameter(b+
1)&&(e=c.stringParameterSet(++b),j=h=".",f=b=c.iToken+1,k=this.tokAt(b));break;default:g=JS.SV.sValue(this.tokenAt(b,a)).toUpperCase()}var n=this.vwr.getExportDriverList(),m=null,r=q?this.slen:a.length,t="",x=null,A=!1,p=null,v=0,s=null,z=!1,E=null,D=-1,w=-1,C=!1,H=!1,y=null,F=-2147483648;if(0!=k&&q&&1<this.slen&&1073741848==this.tokAt(this.slen-2)){x=this.paramAsStr(this.slen-1).toUpperCase();x.equals("JSON")&&(H=!0,r-=2);if(!H||!g.equals("VAR"))g=x,f=r,k=0;r-=2}switch(k){case 7:case 6:g="VAR";p=
this.tokenAt(b++,a);break;case 1073741984:g="INLINE";m=JS.SV.sValue(this.tokenAt(++b,a));b++;break;case 1275068447:g="PGRP";b++;t=JS.SV.sValue(this.tokenAt(b,a)).toLowerCase();t.equals("draw")&&b++;break;case 1073742329:b++;z=!0;break;case 1073742158:case 134222850:for(x=JS.SV.sValue(this.tokenAt(++b,a)).toLowerCase();x.equals("localpath")||x.equals("remotepath");)x.equals("localpath")?h=JS.SV.sValue(this.tokenAt(++b,a)):j=JS.SV.sValue(this.tokenAt(++b,a)),x=JS.SV.sValue(this.tokenAt(++b,a)).toLowerCase();
g="SPT";break;case 1228935687:case 134320141:case 1610616855:case 135180:case 1073742015:case 1073742018:case 1073877011:case 1073877010:case 135188:b++;break;case 1073741991:g="ZIPALL";b++;break;case 36868:g="VAR";b+=2;break;case 1073741929:case 4115:case 4120:case 1073742062:case 1073742139:case 4166:case 1073741824:case 4:switch(k){case 4115:b+1<r&&1073742325==a[++b].tok||10==a[b].tok?(x=c.atomExpression(a,b,0,!0,!1,null,!0),b=c.iToken+1):x=this.vwr.getAllAtoms();this.chk||(E=this.vwr.ms.getModelBS(x,
!0));break;case 1073741929:k=4120,A=!0;case 4120:g="IMAGE";b++;break;case 1073742139:x=JS.SV.sValue(this.tokenAt(++b,a)).toUpperCase();JU.PT.isOneOf(x,";PNG;PNGJ;")?(s=x,b++):s="PNG";break;case 4166:v=c.intParameterRange(++b,1,10);if(2147483647==v)return"";this.chk||(this.vwr.tm.setVibrationPeriod(0),c.isJS||c.delayScript(100));b++;break;default:k=4120}if(4120==k&&b<a.length)if(k=JS.T.getTokenFromName(JS.SV.sValue(a[b]).toLowerCase()),null!=k&&(g=JS.SV.sValue(k).toUpperCase()),JU.PT.isOneOf(g,n.toUpperCase())){b++;
g=g.substring(0,1).toUpperCase()+g.substring(1).toLowerCase();C=!0;q&&(y="Jmol."+g.toLowerCase());break}else if(JU.PT.isOneOf(g,";ZIP;ZIPALL;SPT;STATE;")){b++;break}else g="IMAGE";2==JS.CmdExt.tokAtArray(b,a)&&(D=JS.SV.iValue(this.tokenAt(b++,a)),0>=D&&this.invArg(),w=JS.SV.iValue(this.tokenAt(b++,a)),0>=w&&this.invArg(),2==JS.CmdExt.tokAtArray(b,a)&&(F=JS.SV.iValue(this.tokenAt(b++,a))))}if(f<r){x=JS.SV.sValue(this.tokenAt(b,a));if(x.equalsIgnoreCase("clipboard")){if(this.chk)return""}else JU.PT.isOneOf(x.toLowerCase(),
";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;")?(2==JS.CmdExt.tokAtArray(b+1,a)&&2==JS.CmdExt.tokAtArray(b+2,a)&&(D=JS.SV.iValue(this.tokenAt(++b,a)),0>=D&&this.invArg(),w=JS.SV.iValue(this.tokenAt(++b,a)),0>=w&&this.invArg()),2==JS.CmdExt.tokAtArray(b+1,a)&&(F=JS.SV.iValue(this.tokenAt(++b,a)))):!"VAR".equals(g)&&JU.PT.isOneOf(x.toLowerCase(),";xyz;xyzrn;xyzvib;mol;mol67;sdf;v2000;v3000;json;pdb;pqr;cml;cif;scif;cifp1;pwmat;pwslab;qcjson;xsf;")&&(g=x.toUpperCase(),b+1==r&&b++);g.equals("IMAGE")&&
JU.PT.isOneOf(x.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;")&&(g=x.toUpperCase(),b++)}b+2==r&&++b;switch(JS.CmdExt.tokAtArray(b,a)){case 0:l=!0;break;case 1073741884:break;case 805307393:y=g.equals("IMAGE")?"?jmol.png":"?jmol."+g.toLowerCase();break;case 6:case 7:break;case 1073741824:case 4:y=JS.SV.sValue(this.tokenAt(b,a));if(y.equalsIgnoreCase("clipboard")||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL))y=null;break;default:this.invArg()}switch(g){case "IMAGE":case "FRAME":case "VIBRATION":g=
this.getWriteType(y,"JPG");break;case "CONTACT":u=!0;case "ISOSURFACE":g=this.getWriteType(y,"JVXL");case "PLB":switch(g){case "PMESH":g="ISOMESH";break;case "PMB":g="ISOMESHBIN";break;case "PLY":g="ISOPLY";break;case "PLB":g="ISOPLYBIN"}}k=JU.PT.isOneOf(g.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;");if(!k)switch(g){case "MNU":g="MENU";break;case "WRL":case "VRML":g="Vrml";C=!0;break;case "X3D":g="X3d";C=!0;break;case "STL":g="Stl";C=!0;break;case "IDTF":g="Idtf";
C=!0;break;case "MA":g="Maya";C=!0;break;case "JS":g="Js";C=!0;break;case "OBJ":g="Obj";C=!0;break;case "JVXL":case "XJVXL":g="ISOSURFACE";break;case "JMOL":g="ZIPALL";break;case "HIS":g="HISTORY";break;case "COORD":case "COORDS":g=this.getWriteType(y,"XYZ")}null!=e&&(JV.FileManager.isJmolType(g)||this.invArg(),g.equals("PNG")&&(g="PNGJ"));!k&&(!C&&!JU.PT.isOneOf(g,";SCENE;JMOL;ZIP;ZIPALL;SPT;HISTORY;MO;NBO;ISOSURFACE;MESH;PMESH;PMB;PLY;PLB;ISOMESHBIN;ISOMESH;ISOPLY;ISOPLYBIN;VAR;FILE;FUNCTION;CFI;CIF;SCIF;CIFP1;CML;JSON;XYZ;XYZRN;XYZVIB;MENU;MOL;MOL67;PDB;PGRP;PQR;PWMAT;PWSLAB;QUAT;RAMA;SDF;V2000;V3000;QCJSON;XSF;INLINE;"))&&
c.errorStr2(54,"COORDS|FILE|FUNCTIONS|HISTORY|IMAGE|INLINE|ISOSURFACE|JMOL|MENU|MO|NBO|POINTGROUP|QUATERNION [w,x,y,z] [derivative]|RAMACHANDRAN|SPT|STATE|VAR x|ZIP|ZIPALL|CLIPBOARD","CIF|SCIF|CIFP1|CML|CFI|GIF|GIFT|JPG|JPG64|JMOL|JVXL|MESH|MOL|PDB|PMESH|PNG|PNGJ|PNGT|PPM|PQR|PWMAT|PWSLAB|SDF|CD|JSON|QCJSON|V2000|V3000|SPT|XJVXL|XSF|XYZ|XYZRN|XYZVIB|ZIP"+n.toUpperCase().$replace(";","|"));if(this.chk)return"";b=Array(1);f=this.vwr.getBoolean(603979934);if(C){f&&JU.Logger.startTimer("export");d=new java.util.Hashtable;
d.put("type",g);null!=y&&d.put("fileName",y);(q||null!=y)&&d.put("fullPath",b);d.put("width",Integer.$valueOf(D));d.put("height",Integer.$valueOf(w));try{m=this.vwr.generateOutputForExport(d)}catch(I){if(P(I,Exception))return m=I.toString();throw I;}if(null==m||0==m.length)return"";if(l)return m;if(!g.equals("Povray")&&!g.equals("Idtf")||null==b[0])return this.writeMsg(m);d=g.equals("Idtf")?".tex":".ini";y=b[0]+d;p=new java.util.Hashtable;p.put("fileName",y);p.put("type",d);p.put("text",m);p.put("fullPath",
b);d=this.vwr.processWriteOrCapture(p);g.equals("Idtf")&&(m=m.substring(0,m.indexOf("\\begin{comment}")));m="Created "+b[0]+":\n\n"+m;f&&this.showString(JU.Logger.getTimerMsg("export",0));null!=d&&((g=!d.startsWith("OK"))&&c.evalError(d,null),c.report(m,g));return""}C=null;n=!1;if(null==m){m=g.intern();switch(m){case "MENU":m=this.vwr.getMenu("");break;case "PGRP":m=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),null,0,1,null,null,t.equals("draw")?"":null);break;case "PDB":case "PQR":l?m=this.vwr.getPdbAtomData(null,
null,"PQR"===m,z):(n=!0,g="PDB_"+m+"-coord "+z);break;case "FILE":"?".equals(y)&&(y="?Jmol."+this.vwr.getP("_fileType"));l?m=this.e.getCurrentModelFileAsString(null):n=!0;break;case "CFI":m=this.vwr.getModelFileData("selected","cfi",!1);break;case "FUNCTION":m=this.vwr.getFunctionCalls(null);g="TXT";break;case "VAR":if(null==p){var K=this.tokenAt(q?2:1,a);switch(K.tok){case 7:case 6:break;default:p=c.getParameter(JS.SV.sValue(K),1073742190,!0)}}null!=y&&y.endsWith(".json")&&(H=!0);K=null;switch(p.tok){case 15:K=
new JU.Lst;K.addLast(p.value.data);break;case 6:K=null==y?null:this.prepareBinaryOutput(p)}null==K?(m=H?p.toJSON():p.asString(),g="TXT"):null!=y&&(p=new java.util.Hashtable,p.put("data",K),null==(C=m=this.vwr.createZip(y,1==K.size()||y.endsWith(".png")||y.endsWith(".pngj")?"BINARY":"ZIPDATA",p))&&c.evalError("#CANCELED#",null));break;case "SPT":if(z)p=this.vwr.ms.getTaintedAtoms(2),this.vwr.setAtomCoordsRelative(JU.P3.new3(0,0,0),null),m=this.vwr.getStateInfo(),this.vwr.ms.setTaintedAtoms(p,2);else if(m=
this.vwr.getStateInfo(),null!=h||null!=j)m=JV.FileManager.setScriptFileReferences(m,h,j,null);break;case "ZIP":case "ZIPALL":null!=y&&(p=new java.util.Hashtable,null!=e&&p.put("data",e),null==(C=m=this.vwr.createZip(y,g,p))&&c.evalError("#CANCELED#",null));break;case "HISTORY":m=this.vwr.getSetHistory(2147483647);g="SPT";break;case "MO":case "NBO":m=this.getMoJvxl(2147483647,"NBO"===m);g="XJVXL";break;case "PMESH":case "PMB":null==(m=this.getIsosurfaceJvxl(29,m))&&this.error(31);g="XJVXL";break;case "ISOMESH":null==
(m=this.getIsosurfaceJvxl(24,m))&&this.error(31);g="PMESH";break;case "ISOMESHBIN":null==(C=this.getIsosurfaceJvxl(24,"ISOMESHBIN"))&&this.error(31);g="PMB";break;case "ISOPLY":null==(m=this.getIsosurfaceJvxl(24,m))&&this.error(31);g="PLY";break;case "ISOPLYBIN":null==(C=this.getIsosurfaceJvxl(24,"ISOPLYBIN"))&&this.error(31);g="PLB";break;case "ISOSURFACE":case "MESH":null==(m=this.getIsosurfaceJvxl(u?25:24,m))&&this.error(31);g=0<=m.indexOf("<?xml")?"XJVXL":"JVXL";l||this.showString(this.getShapeProperty(u?
25:24,"jvxlFileInfo"));break;default:if(JU.PT.isOneOf(m,";CIF;SCIF;CIFP1;SDF;MOL;MOL67;V2000;V3000;CD;JSON;XYZ;XYZRN;XYZVIB;CML;QCJSON;PWMAT;PWSLAB;XSF;")){p=this.vwr.bsA();this.vwr.setErrorMessage(null," ("+p.cardinality()+" atoms)");m=this.vwr.getModelExtract(p,z,!1,m);d=this.vwr.getErrorMessageUn();this.vwr.setErrorMessage(null,null);if(0<=this.vwr.am.cmi&&!p.equals(K=this.vwr.getModelUndeletedAtomsBitSet(this.vwr.am.cmi)))d+="\nNote! Selected atom set "+p+" is not the same as the current model "+
K;m.startsWith("ERROR:")&&(C=m)}else q&&(l&&null==y)&&(l=!1,y="\u0001"),null==s&&0>F&&(F=-1)}null==m&&(m="")}if(!q)return m;if(l)return c.showStringPrint(m,!0),"";if(null!=C&&"string"==typeof C)return this.writeMsg(C);if(n)return this.writeMsg(this.vwr.writeFileData(y,g,0,null));if(g.equals("SCENE"))C=s;else if(null==C&&(!k||null!=y))C=m;f&&JU.Logger.startTimer("write");k&&(c.refresh(!1),0>D&&(D=A?250:this.vwr.getScreenWidth()),0>w&&(w=A?250:this.vwr.getScreenHeight()));p=new java.util.Hashtable;
null!=y&&p.put("fileName",y);p.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb()));p.put("type",g);if(A){p.put("is2D",Boolean.TRUE);var M,c="smiles could not be generated";try{if(M=this.vwr.getOpenSmiles(null),0<M.length){var G=this.vwr.setLoadFormat(!0,"_"+M,"2",!1),G=G+("?width="+D+"&height="+w+"&format="+g.toLowerCase());this.showString(G);c=this.vwr.fm.getFileAsBytes(G,null)}}catch(O){if(!P(O,Exception))throw O;}if("string"==typeof c)return this.showString(c),null;C=c}"string"==
typeof C&&-2147483648==F?p.put("text",C):N(C,Array)&&p.put("bytes",C);null!=e&&p.put("scripts",e);null!=E&&p.put("bsFrames",E);p.put("fullPath",b);p.put("quality",Integer.$valueOf(F));p.put("width",Integer.$valueOf(D));p.put("height",Integer.$valueOf(w));p.put("nVibes",Integer.$valueOf(v));c=this.vwr.processWriteOrCapture(p);null==c&&(c="canceled");k&&c.startsWith("OK")&&(c+="; width="+D+"; height="+w);f&&this.showString(JU.Logger.getTimerMsg("write",0));return this.writeMsg(c+(null==d?"":d))},"~A");
n(k,"getWriteType",function(a,c){if(null!=a){var b=a.indexOf(".");if(0<=b)return a.substring(b+1).toUpperCase()}return c},"~S,~S");n(k,"prepareBinaryOutput",function(a){var c=a.getMap();if(null==c||!c.containsKey("$_BINARY_$"))return null;a=new JU.Lst;for(var b,c=c.entrySet().iterator();c.hasNext()&&((b=c.next())||1);){var f=b.getKey();if(!f.equals("$_BINARY_$")){var e=b.getValue(),d=15==e.tok?e.value.data:null;null==d&&(e=e.asString(),d=e.startsWith(JV.JC.BASE64_TAG)?JU.Base64.decodeBase64(e):e.getBytes());
if(f.equals("_DATA_")){a=new JU.Lst;a.addLast(d);break}else f.equals("_IMAGE_")?(a.add(0,f),a.add(1,null),a.add(2,d)):(a.addLast(f),a.addLast(null),a.addLast(d))}}return a},"JS.SV");n(k,"writeMsg",function(a){if(this.chk||null==a)return"";var c=!a.startsWith("OK");c&&(this.e.evalError(a,null),alert(a));this.e.report(a,c);return a},"~S");n(k,"show",function(){var a=this.e,c=null,b=this.paramAsStr(1),f=null,e=0;3<this.slen&&268441088==this.tokAt(this.slen-3)&&268439040==this.tokAt(this.slen-2)?(f="!/"+
this.paramAsStr(this.slen-1),this.slen-=3,e=3):2<this.slen&&268441088==this.tokAt(this.slen-2)?(f="/"+this.paramAsStr(this.slen-1),this.slen-=2,e=2):0==(f=this.paramAsStr(this.slen-1)).lastIndexOf("/")?(this.slen--,e=1):f=null;var d=null,h=null,j=2,g=this.getToken(1),h=N(g,"JS.SV")&&1073741824!=g.tok?0:g.tok;4==h&&(g=JS.T.getTokenFromName(b.toLowerCase()),null!=g&&(h=g.tok));1296041986!=h&&(1073742158!=h&&1715472409!=h&&1228935687!=h)&&this.checkLength(-3);2==this.slen&&0<=b.indexOf("?")&&(d=this.vwr.getAllSettings(b.substring(0,
b.indexOf("?"))),h=-1);switch(h){case 0:this.chk||(d=a.theToken.escape());break;case 603984065:this.chk||(d=this.vwr.stm.getUndoInfo());break;case 1073741925:a.checkLength23();j=this.st.length;this.chk||(d=this.vwr.getModelInfo("domains"),d=N(d,"JS.SV")?this.vwr.getAnnotationInfo(d,a.optParameterAsString(2),1073741925):"domain information has not been loaded");break;case 1715472409:d=this.plot(this.st);j=this.st.length;break;case 1073742189:a.checkLength23();j=this.st.length;this.chk||(d=this.vwr.getModelInfo("validation"),
d=N(d,"JS.SV")?this.vwr.getAnnotationInfo(d,a.optParameterAsString(2),1073742189):"validation information has not been loaded");break;case 134221829:this.chk||(d=JU.Escape.e(this.vwr.fm.cacheList()));break;case 1111490587:a.checkLength23();j=this.st.length;this.chk||(d=this.vwr.getModelInfo("dssr"),d=null==d?"no DSSR information has been read":2<j?JS.SV.getVariable(this.vwr.extractProperty(d,this.stringParameter(2),-1)).asString():""+JS.SV.getVariable(d).asString());break;case 1073741915:h=2;3==this.slen?
h=E(this.floatParameter((j=3)-1)):this.checkLength(2+e);this.chk||(d=this.vwr.calculateStructures(null,!0,!1,h));break;case 545259572:this.checkLength(2+e);this.chk||(d=this.vwr.fm.getPathForAllFiles());break;case 1275203608:if(!this.chk){var q=Array(2);this.vwr.shm.getShapePropertyData(21,"allInfo",q);d=JS.SV.getVariable(q[1]).asString()}break;case 1073742038:this.chk||this.vwr.getNMRPredict(a.optParameterAsString(2));return;case 603983903:!this.chk&&3==this.slen&&(d=""+this.vwr.getModelkitPropertySafely(a.stringParameter(2)),
j=3);break;case 1275068433:case 1073741978:case 1073741929:case 1073741879:case 134218757:this.checkLength((1073741879==h||134218757==h&&1073742335==this.tokAt(2)?j=3:2)+e);if(this.chk)return;var l=a.optParameterAsString(2);1073741879==h&&("mf".equals(l)&&(l="formula"),"formula".equals(l)&&(d=this.vwr.getModelInfo("formula"),null!=d&&(d=JU.PT.rep(d," ",""))));if(null==d){try{switch(h){case 1275068433:d=this.vwr.getInchi(this.vwr.bsA(),null,null);null==d&&(d="?");break;case 1073741978:d=this.vwr.getInchi(this.vwr.bsA(),
null,"key");break;case 134218757:l.equalsIgnoreCase("true")?(d=this.vwr.getBioSmiles(null),f=null):null!=f&&(d=this.vwr.getSmilesOpt(null,-1,-1,1,f+"///"),f=null);break;default:d=this.vwr.ms.getModelDataBaseName(this.vwr.bsA()),d=null!=d&&(d.startsWith("$")||d.startsWith(":"))?d.substring(1):null}if(null==d){var k=JU.Logger.getLogLevel();JU.Logger.setLogLevel(4);d=134218757==h?this.vwr.getSmiles(null):this.vwr.getOpenSmiles(null);JU.Logger.setLogLevel(k)}}catch(n){if(P(n,Exception))d=n.getMessage(),
null==d&&(d=""),n.printStackTrace();else throw n;}switch(h){case 1073741929:if(0<d.length){this.vwr.fm.loadImage(this.vwr.setLoadFormat(!1,"_"+d,"2",!1),"\u0001"+d,!1);return}d="Could not show drawing -- Either insufficient atoms are selected or the model is a PDB file.";break;case 1073741879:j=3,0<d.length?(d=this.vwr.getChemicalInfo(d,l,this.vwr.bsA()),0<=d.indexOf("FileNotFound")&&(d="?")):d="Could not show name -- Either insufficient atoms are selected or the model is a PDB file."}}break;case 1086324755:case 1086324754:if(this.chk)break;
d=(""+this.vwr.evaluateExpression("symop('wyckoff"+(1086324755==h?"m":"")+"')")).trim();break;case 134217764:case 1296041986:k=this.vwr.getOperativeSymmetry();switch(h){case 134217764:var l=a.optParameterAsString(2),g=l.toLowerCase().equals("names"),q=l.toLowerCase().startsWith("subgroups"),m=l.toLowerCase().startsWith("diagram"),B=l.startsWith("diagramITA"),r=l.toLowerCase().startsWith("table"),j=this.slen,t=-1;if(g){if(this.chk)break}else if(q||m||r||B){if(this.chk)break;l=JU.PT.trim(l.substring(B?
10:q?9:m?7:5).trim(),'"');if(0==l.length){if(null==k){d="Include a space group name or number to view its diagram, table, or subgroups";break}if("/"==k.getSpaceGroupClegId().charAt(1)){d="special group information is not implemented yet";break}l=k.getIntTableNumber();if(null==l||l.equals("0")){d="Can't display a table; don't have an ITA number.";break}}if(null!=d)break;t=JU.PT.parseInt(l);if(-2147483648==t){null==k&&(k=this.vwr.getSymStatic());q=k.getSpaceGroupInfo(this.vwr.ms,JU.PT.rep(l,"''",'"'),
-1,!0,null);if(null==q){d="Could not find space group "+l;break}t=q.get("spaceGroupInfo").get("ita").intValue()}}if(g||0<t){d=h=g?"https://www.cryst.ehu.es/cgi-bin/cryst/programs/nph-getgen":JV.JC.resolveDataBase(B?"itadiagramita":m?"itadiagram":"itatable",JU.PT.formatS(""+t,3,0,!1,!0),null);this.vwr.showUrl(h);break}case 1296041986:d="";q=null;if(2==(j=this.slen)){if(this.chk)break;null==k&&(k=this.vwr.getSymTemp());q=k.getSpaceGroupInfo(this.vwr.ms,null,-1,!1,null)}else if(134217764==h){k=this.paramAsStr(2);
j=3;if(this.chk)break;k.startsWith("list/")&&(f=k.substring(4),k="list");q=this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,JU.PT.rep(k,"''",'"'),-1,!1,null)}if(null!=q){d=(134217764==h?""+q.get("spaceGroupInfo")+q.get("spaceGroupNote"):"")+(q.containsKey("symmetryInfo")?q.get("symmetryInfo"):"");break}h=2==this.tokAt(2)?this.intParameter(2):0;k=4==this.tokAt(2)||12==this.tokAt(2)?this.paramAsStr(2):null;g=l=null;m=-1;if(3<this.slen&&4!=this.tokAt(3)){j=A(-1,[null,this.vwr.getFrameAtoms()]);l=
a.centerParameter(2+(0==h?0:1),j);if(null!=j[0]&&j[0].isEmpty()){j=this.slen;break}j[0]=null;if(0!=this.tokAt(a.iToken+1)&&4!=this.tokAt(a.iToken+1)&&(g=a.centerParameter(++a.iToken,j),null!=j[0]&&j[0].isEmpty())){j=this.slen;break}0==h&&2==this.tokAt(a.iToken+1)&&(m=a.getToken(++a.iToken).intValue)}B=1<a.iToken&&4==this.tokAt(a.iToken+1)?this.stringParameter(++a.iToken):null==l&&null==g?"label":null;this.checkLength((j=++a.iToken)+e);this.chk||(d=this.vwr.getSymmetryInfo(this.vwr.getAllAtoms().nextSetBit(0),
k,h,null,l,g,0,B,0,m,0,null),d=null==d?"":N(d,"java.util.Map")?JS.SV.getVariable(d).asString():d.toString())}break;case 1648363544:h=null;2<this.slen&&(j=this.slen,h=J.c.VDW.getVdwType(this.paramAsStr(2)),null==h&&this.invArg());this.chk||(d=this.vwr.getDefaultVdwNameOrData(0,h,null));break;case 134320141:a.checkLength23();j=this.slen;h=a.optParameterAsString(2);if(null==f&&0<=(l=h.indexOf("/")))f=h.substring(l+1),h=h.substring(0,l);this.chk||(d=this.vwr.getFunctionCalls(h));break;case 36867:this.checkLength(2+
e);this.chk||(d=this.vwr.getAllSettings(null));break;case 1073742166:d=this.vwr.getFrameTitle();break;case 1073742184:2==this.slen?this.chk||this.vwr.showUrl(a.getFullPathName(!1)):(h=this.paramAsStr(2),this.chk||this.vwr.showUrl(h));return;case 1765808134:b="defaultColorScheme";break;case 1610612740:b="scaleAngstromsPerInch";break;case 134221850:case 4138:if(this.chk)return;0>this.vwr.am.cmi&&a.errorStr(30,"show "+a.theToken.value);d=this.plot(this.st);j=this.slen;break;case 14:case 1112152078:this.chk||
(d=this.getContext(!1));break;case 1073741888:h=a.optParameterAsString(2);0<h.length&&(j=3);this.chk||(c=this.vwr.cm.getColorSchemeList(h));break;case 1073742192:this.chk||(d=this.vwr.getAtomDefs(this.vwr.definedAtomSets)+this.vwr.g.getVariableList()+this.getContext(!0));break;case 536870926:this.chk||(d=this.vwr.getTrajectoryState());break;case 553648144:c=""+JS.ScriptEval.commandHistoryLevelMax;break;case 553648148:c=""+JU.Logger.getLogLevel();break;case 603979825:c=""+this.vwr.getBoolean(603979825);
break;case 553648178:d="set strandCountForStrands "+this.vwr.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13);break;case 536875070:d=this.vwr.showTimeout(2==(j=this.slen)?null:this.paramAsStr(2));break;case 536870918:c=JU.Escape.eP(this.vwr.getDefaultLattice());break;case 4126:this.chk||(d=this.vwr.getMinimizationInfo());break;case 1611272194:switch(this.vwr.g.axesMode){case 603979808:d="set axesUnitcell";break;case 603979804:d="set axesMolecular";break;default:d="set axesWindow"}break;
case 1610612737:d="set bondMode "+(this.vwr.getBoolean(603979812)?"OR":"AND");break;case 1649022989:this.chk||(d="set strandCountForStrands "+this.vwr.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13));break;case 1613238294:d="set hbondsBackbone "+this.vwr.getBoolean(603979852)+";set hbondsSolid "+this.vwr.getBoolean(603979854);break;case 1095241729:this.chk||(d=this.vwr.getSpinState());break;case 1611141176:d="set ssbondsBackbone "+this.vwr.getBoolean(603979952);break;
case 1610625028:case 1611141172:d="selectionHalos "+(this.vwr.getSelectionHalosEnabled()?"ON":"OFF");break;case 1612709894:d="set selectHetero "+this.vwr.getBoolean(1612709894);break;case 1073741828:d=JU.Escape.eAP(this.vwr.getAdditionalHydrogens(null,null,768));break;case 1612709900:d="set selectHydrogens "+this.vwr.getBoolean(1612709900);break;case 553648130:case 553648138:case 536870924:case 553648176:case 553648172:case 1073741995:this.chk||(d=this.vwr.getLightingState());break;case 1073742136:case 4146:this.chk||
(d=this.vwr.stm.listSavedStates());break;case 1814695966:this.chk||(d=3==(j=this.slen)?this.vwr.stm.getSavedUnitCell(this.paramAsStr(2)):this.vwr.getUnitCellInfoText());break;case 1073742329:if(2==(j=this.slen)){this.chk||(d=this.vwr.getCoordinateState(this.vwr.bsA()));break}h=this.paramAsStr(2);this.chk||(d=this.vwr.stm.getSavedCoordinates(h));break;case 1073742158:!this.chk&&(null==a.outputBuffer&&null==f)&&this.vwr.sm.clearConsole();if(2==(j=this.slen)){this.chk||(d=this.vwr.getStateInfo());break}if(null!=
f&&3==this.slen){this.chk||(d=this.vwr.getStateInfo());break}else if(1228935687==this.tokAt(2)&&4==(j=this.slen)){this.chk||(d=this.vwr.fm.getEmbeddedFileState(this.paramAsStr(3),!0,"state.spt"));break}j=3;h=this.paramAsStr(2);this.chk||(d=this.vwr.stm.getSavedState(h));break;case 1639976963:if(2==(j=this.slen)){this.chk||(d=this.vwr.ms.getProteinStructureState(this.vwr.bsA(),134222350));break}h=this.paramAsStr(2);this.chk||(d=this.vwr.stm.getSavedStructure(h));break;case 134221834:l=3==(j=this.slen)?
this.paramAsStr(2):null;this.chk||(k=this.vwr.getDataObj(l,null,-2),l=(h=null!=l&&"types".equals(l.toLowerCase()))||"*".equals(l),null==k?d="no data":N(k,"JU.Lst")?k=k.toArray(Array(k.size())):l||(d=k,d=JU.Escape.encapsulateData(d[0],d[1],d[3].intValue())),null==d&&(d=k,h&&(d[1]=d[1].$replace("\n",",")),d=JU.Escape.e(d)));break;case 1073742330:j=3;d=a.setObjectProperty();break;case 1812599299:this.chk||(d=this.vwr.ms.getBoundBoxCommand(!0));break;case 12289:this.chk||(d="center "+JU.Escape.eP(this.vwr.tm.fixedRotationCenter));
break;case 135176:this.chk||(d=this.getShapeProperty(22,"command"));break;case 1228935687:if(2==this.slen){this.chk||(null==f&&!a.isFuncReturn&&this.vwr.sm.clearConsole(),d=this.e.getCurrentModelFileAsString(null));null==d&&(d="<unavailable>");break}j=3;c=this.paramAsStr(2);this.chk||(null==f&&this.vwr.sm.clearConsole(),d=this.vwr.getFileAsString3(c,!0,null));break;case 4115:d=1073742327==this.tokAt(2)&&0<(j=3)?this.vwr.getModelFileInfoAll():this.vwr.getModelFileInfo();break;case 1610616855:h=2==
(j=this.slen)?2147483647:this.intParameter(2);1>h&&this.invArg();this.chk||(this.vwr.sm.clearConsole(),0==a.scriptLevel&&this.vwr.removeCommand(),d=this.vwr.getSetHistory(h));break;case 135180:this.chk||(d=this.getShapeProperty(24,"jvxlDataXml"));break;case 1073877011:case 1073877010:a.optParameterAsString(2).equalsIgnoreCase("list")?(this.e.sm.loadShape(27),d=this.chk?"":this.getShapeProperty(27,"list -1"),j=3):(k=2==(j=this.slen)?-2147483648:this.intParameter(2),this.chk||(d=this.getMoJvxl(k,1073877011==
h)));break;case 1094717454:this.chk||(d=this.vwr.ms.getModelInfoAsString());break;case 537006096:this.chk||(d=this.vwr.getMeasurementInfoAsString());break;case 1073741864:j=3;!this.chk&&this.slen==j&&(d=this.paramAsStr(2),d=this.vwr.getOrientation(JS.T.getTokFromName(d.equals("box")?"volume":d.equals("rotation")?"best":d),"best",null,null).toString());break;case 1073742132:h=this.tokAt(2),0==h?h=1073742132:j=3;case 1073742178:case 4129:this.chk||(d=this.vwr.getOrientation(h,null,null,null).toString());
break;case 1073742077:j=2;if(3<this.slen)break;switch(h=this.tokAt(2)){case 1073742178:case 1073742132:case 4129:case 0:this.chk||(d=this.vwr.getOrientation(h,null,null,null).toString());break;default:h=a.optParameterAsString(2),d=this.vwr.getOrientation(1073742034,h,null,null).toString()}j=this.slen;break;case 1073742088:this.chk||(d=this.vwr.ms.getPDBHeader(this.vwr.am.cmi));break;case 1275068447:h=a.optParameterAsString(2);0==h.length&&(h=null);j=this.slen;this.chk||(d=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),
"show:"+h,0,0,null,null,null));break;case 1088421903:this.chk||(d=this.vwr.ms.getSymmetryInfoAsString());break;case 1073742176:this.chk||(d="transform:\n"+this.vwr.tm.matrixRotate.toString());break;case 4168:d="zoom "+(this.vwr.tm.zoomEnabled?""+this.vwr.tm.getZoomSetting():"off");break;case 1611272202:d=this.vwr.getShowFrank()?"frank ON":"frank OFF";break;case 1665140738:b="solventProbeRadius";break;case 1086324744:if(3==(j=this.slen)&&1073742334==this.tokAt(2))h=1086324743;case 1073741863:case 1086326788:case 1073742120:case 1113589787:case 1086324742:case 1153433601:case 1073741982:this.chk||
(d=this.vwr.getChimeInfo(h));break;case 537022465:case 1610612738:case 20482:case 1612709912:c="?";break;case 1073742030:h=2==(j=this.slen)?null:this.paramAsStr(2);this.chk||(d=this.vwr.getBindingInfo(h));break;case 1073742015:this.chk||(c=this.vwr.getMenu(""));break;case 1073741824:b.equalsIgnoreCase("fileHeader")&&(this.chk||(d=this.vwr.ms.getPDBHeader(this.vwr.am.cmi)));break;case 1073741992:case 36868:b=this.paramAsStr(j++),k=a.getParameter(b,1073742190,!0),this.chk||(d=1073741992==h?k.toJSON():
k.escape())}this.checkLength(j+e);this.chk||(null!=d?this.showString(this.filterShow(d,f)):null!=c?this.showString(b+" = "+c):null!=b&&(0<=b.indexOf(" ")?this.showString(b):this.showString(b+" = "+a.getParameter(b,1073742190,!0).escape())))});n(k,"filterShow",function(a,c){if(null==c)return a;var b=c.startsWith("!/");c=c.substring(b?2:1).toLowerCase();for(var f=JU.PT.split(a,"\n"),e=new JU.SB,d=0;d<f.length;d++)0>f[d].toLowerCase().indexOf(c)==b&&e.append(f[d]).appendC("\n");return e.toString()},
"~S,~S");n(k,"stereo",function(){for(var a=J.c.STER.DOUBLE,c=-5,b=!1,f=null,e=0,d=1;d<this.slen;++d)if(this.e.isColorParam(d))1<e&&this.e.bad(),0==e&&(f=D(2,0)),b||(c=3),f[e]=this.e.getArgbParam(d),0==e++&&(f[1]=~f[0]),d=this.e.iToken;else switch(this.getToken(d).tok){case 1073742335:this.e.checkLast(this.e.iToken=1);this.e.iToken=1;break;case 1073742334:this.e.checkLast(this.e.iToken=1);a=J.c.STER.NONE;break;case 2:case 3:c=this.floatParameter(d);b=!0;break;case 1073741824:if(b||(c=3),a=J.c.STER.getStereoMode(this.paramAsStr(d)),
null!=a)break;default:this.invArg()}this.chk||this.vwr.setStereoMode(f,a,c)});n(k,"struts",function(){var a=this.e,c=1073742072==this.tokAt(1)||1073742335==this.tokAt(1)||1==this.slen,b=a.getMadParameter();if(2147483647==b)return!1;c&&(b=Math.round(2E3*this.vwr.getFloat(570425406)));this.setShapeProperty(1,"type",Integer.$valueOf(32768));a.setShapeSizeBs(1,b,null);this.setShapeProperty(1,"type",Integer.$valueOf(1023));return!0});n(k,"unitcell",function(a,c){var b=this.e,f=2147483647,e=2147483647,
d=null,h=b.tickParamAsStr(a,!0,!1,!1);a=b.iToken;var j=null,g=null,k=null,l=null,n=e=!1,D=-1,m=this.chk?null:this.vwr.getCurrentUnitCell(),B=this.tokAt(++a);switch(B){case 1073742333:this.chk||this.vwr.ms.clearUnitCell(this.vwr.am.cmi);return;case 4142:case 4141:n=!0;d=JU.P4.new4(0,0,0,-1);b.iToken++;break;case 2097180:e=b.hklParameter(a+1,null,!1);B=b.getPointOrPlane(a+1,7);a=b.iToken;var r=NaN;this.isFloatParameter(a+1)&&(r=this.floatParameter(++a),268441090==this.tokAt(a+1)&&(r=-r/100,a++));var t=
NaN,x=!1;this.isFloatParameter(a+1)&&(t=this.floatParameter(++a),268441090==this.tokAt(a+1)&&(x=!0,a++));var T=1073742172==this.tokAt(a+1);T&&a++;b.iToken=a;if(this.chk)break;N(B,"JU.P3")?B=JU.P4.new4(B.x,B.y,B.z,0):Float.isNaN(t)&&(t=B.w);var g=this.getUVBoxFromHKL(m,B,e),l=new JU.P3,p=new JU.V3;JU.Measure.getPlaneProjection(new JU.P3,e,l,p);0<r?(g[3].normalize(),g[3].scale(r)):0>r&&g[3].scale(-r);!Float.isNaN(t)&&0!=t&&(x&&(t=t/100*g[3].length()),g[0].scaleAdd2(t,p,g[0]));T&&g[0].scaleAdd2(-g[3].length(),
p,g[0]);l="surface"+E(B.x)+E(B.y)+E(B.z);break;case 536875059:case 1073742163:d=536875059==B?b.getPointOrPlane(++a,19):b.checkHKL(b.getFractionalPoint(++a));a=b.iToken;if(this.chk)break;g=m.getUnitCellVectors();g[1].scale(Math.abs(d.x));g[2].scale(Math.abs(d.y));g[3].scale(Math.abs(d.z));d=null;l="supercell";break;case 1073741938:d=b.getFractionalPoint(++a);a=b.iToken;if(this.chk)break;d=JU.SimpleUnitCell.ptToIJK(b.checkHKL(d),1);break;case 135180:case 1073742330:j=b.objectNameParameter(++a);break;
case 1812599299:b.iToken=a;if(this.chk)break;g=JU.P3.newP(this.vwr.getBoundBoxCenter());d=this.vwr.getBoundBoxCornerVector();g.sub(d);g=A(-1,[g,JU.P3.new3(2*d.x,0,0),JU.P3.new3(0,2*d.y,0),JU.P3.new3(0,0,2*d.z)]);d=null;break;case 1073742176:12!=this.tokAt(++a)&&this.invArg();if(this.chk)break;k=A(-1,[this.getToken(a).value]);break;case 11:case 12:k=this.getToken(a).value;break;case 12289:switch(this.tokAt(++a)){case 12290:case 10:case 1073742325:d=this.vwr.ms.getAtomSetCenter(this.atomExpressionAt(a));
a=b.iToken;if(this.chk)break;this.vwr.toFractional(d,!0);break;default:if(b.isCenterParameter(a)){d=this.centerParameter(a);a=b.iToken;break}this.invArg()}d.x-=0.5;d.y-=0.5;d.z-=0.5;break;case 12290:case 10:case 1073742325:e=this.atomExpressionAt(a).nextSetBit(0);a=b.iToken;this.chk||this.vwr.setUnitCellAtomIndex(e);if(0>e)return;break;case 1073742066:if(e=!0,b.isAtomExpression(a+1)){d=b.centerParameter(++a,null);a=b.iToken;if(this.chk)break;this.vwr.toFractional(d,!1);break}case 1073742114:d=b.getFractionalPoint(++a);
if(N(d,"JU.P4"))e&&this.invArg();else{a=b.iToken;if(this.chk)break;d=!e&&555>d.x?JU.SimpleUnitCell.ptToIJK(b.checkHKL(d),1):JU.P4.new4(d.x,d.y,d.z,e?1:0)}break;case 3:case 2:if(111>this.floatParameter(a)){a--;break}f=this.intParameter(a);break;case 1095241729:case 4:case 1814695966:case 1073741824:r=this.paramAsStr(a).toLowerCase();if(r.equals("rhombohedral")||r.equals("r")){if(null!=m&&0==m.getUnitCellInfoType(8))return;r="2/3a+1/3b+1/3c,-1/3a+1/3b+1/3c,-1/3a-2/3b+1/3c"}else if(r.equals("trigonal")||
r.equals("hexagonal")){if(null!=m&&0==m.getUnitCellInfoType(9))return;r="a-b,b-c,a+b+c"}l=r;if(0<=r.indexOf(",")||this.chk){k=r;break}if(!r.startsWith("unitcell_")){e=null;this.vwr.ms.setModelCagePts(-1,null,null);k=this.vwr.getModelInfo("unitcell_conventional");B=null!=this.vwr.getModelInfo("isprimitive");if(JU.PT.isOneOf(l,";parent;standard;primitive;")){if(null==k&&B){this.showString("Cannot convert unit cell when file data is primitive and have no lattice information");return}l.equals("primitive")&&
4==this.tokAt(a+1)&&(e=this.paramAsStr(++a).toUpperCase())}N(k,Array)&&(g=k);null==e&&(e=this.vwr.getModelInfo("latticeType"));null!=k&&(this.vwr.ms.setModelCagePts(-1,this.vwr.getV0abc(-1,k),""+k),k=null);if(!l.equals("conventional"))if(this.setShapeProperty(34,"labels",null),r=this.vwr.getModelInfo("unitcell_"+l),null==r){if((r=l.equals("primitive"))||l.equals("reciprocal")){t=this.slen==a+1?1:2==this.tokAt(a+1)?3.141592653589793*this.intParameter(++a):this.floatParameter(++a);l=(null==m?"":m.getSpaceGroupName()+
" ")+l;g=null==m?A(-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)]):m.getUnitCellVectors();null==e&&(e=this.vwr.getSymmetryInfo(this.vwr.getFrameAtoms().nextSetBit(0),null,0,null,null,null,1073741994,null,0,-1,0,null));null==m&&(m=this.vwr.getSymTemp());B||m.toFromPrimitive(!0,0==e.length?"P":e.charAt(0),g,this.vwr.getCurrentModelAuxInfo().get("primitiveToCrystal"));r||JU.SimpleUnitCell.getReciprocal(g,g,t);break}}else l=r,0<=r.indexOf(",")&&(k=r);break}default:if(e=Array(1),
this.getUnitCellParameter(a,e)?g=e[0]:k=e[0],null==k&&null==g)this.slen>a+1?(d=b.getFractionalPoint(a),a=b.iToken):a--;else if(null!=k){if(!this.chk&&0!=c)if(null==m){if(1073741938==c)return;this.assignSpaceGroup(null,"P1",k,D,!1,"unitcell")}else 1073741938!=c&&m.fixUnitCell(k)&&b.invArgStr("Unit cell is incompatible with current space group");a=b.iToken}else null!=g&&(a=b.iToken)}switch(c){case 1073741938:b.isFloatParameter(a+1)?(D=this.floatParameter(++a),b.iToken=a):D=0;e=0;break;case 1814695966:1073742080==
this.tokAt(a+1)&&(D=b.isFloatParameter(++a+1)?this.floatParameter(++a):0,b.iToken=a);default:e=b.getSetAxesTypeMad10(++a)}b.checkLast(b.iToken);if(!(this.chk||2147483647==e))if(null==g&&null!=k&&(g=this.vwr.getV0abc(-1,k)),1073741938==c)(null==m||2147483647!=f||null!=j||n)&&this.invArg(),null==g&&(g=m.getUnitCellVectors(),null==d&&(d=new JU.P3),m.toCartesian(d,!0),g[0]=d),this.vwr.getModelkit(!1).cmdFillOABC(g,D,this.e.fullCommand);else{if(2147483647!=f)null!=m&&m.setOffset(f);else if(null!=j)this.vwr.setCurrentCage(j);
else if(n||null!=g)if(n=1814695966==c||null==m?this.vwr.getModelkit(!1).transformAtomsToUnitCell(m,g,l):!0){if(1814695966==c&&null!=m){this.vwr.ms.setSpaceGroup(this.vwr.am.cmi,m.getUnitCell(g,!1,null),null);return}this.vwr.ms.setModelCagePts(-1,g,l);null==m&&this.vwr.setNewRotationCenter(this.vwr.getUnitCellCenter())}f=1814695966==c?this.vwr.ms.getUnitCell(-1-this.vwr.am.cmi):null;b.setObjectMad10(33,"unitCell",e);null!=d&&(m=this.vwr.ms.getUnitCell(-2147483648),null!=m&&m.setOffsetPt(d));1814695966==
c&&null==m.getFractionalOffset(!0)&&(m.setSpaceGroupTo(f),0<=D&&this.vwr.getModelkit(!1).cmdPackUnitCell(m,this.vwr.getModelUndeletedAtomsBitSet(this.vwr.am.cmi),D));null!=h&&this.setShapeProperty(33,"tickInfo",h);null!=l&&this.showString(l+(null==g?"":" "+JU.Escape.e(g)))}},"~N,~N");n(k,"getUVBoxFromHKL",function(a,c,b){var f=E(c.x),e=E(c.y),d=E(c.z);for((0==f&&0==e&&0==d||f!=c.x||e!=c.y||d!=c.z)&&this.invArg();0==f%2&&0==e%2&&0==d%2;)f/=2,e/=2,d/=2;c=a.getUnitCellVectors();for(var h=b.w,j=JU.P4.new4(b.x,
b.y,b.z,0),g=Math.max(Math.max(f,e),d),g=JU.Measure.getLatticePoints(a.getLatticeCentering(),g,g,g),k=g.size();0<=--k;)a.toCartesian(g.get(k),!0);for(var g=JU.Measure.getPointsOnPlane(g.toArray(Array(g.size())),j),j=new JU.P3,k=-179,l=3.4028235E38,n=3.4028235E38,A=a=null,m=k,B=3.4028235E38,r,t,x,D,p=g.size();0<=--p;){var v=g.get(p);r=v.length();x=!1;if(!(0.01>r||null!=a&&(m=Math.abs(JU.Measure.computeTorsion(a,j,b,v,!0)))>-k))if(D=1>m,null==a)a=v,l=r;else{if(r<l-0.01)x=!0,m=B=3.4028235E38;else if(r<
n-0.01)B=3.4028235E38;else if(!(r>=n+0.01))continue;x||(t=89<m)&&r<l+0.1&&-0.01<=v.x&&0.01>=v.y&&(3.4028235E38==B||89>B)?(D?(A=null,n=3.4028235E38):(A=a,n=l),a=v,l=r,!x&&m<B&&(B=m)):t&&r<n+0.1&&(A=v,n=r,m<B&&(B=m))}}null==a&&this.invArg();t=null;if(null==A)for(p=g.size();0<=--p;)v=g.get(p),m=JU.Measure.computeTorsion(a,j,b,v,!0),-89.9>m&&m>k+0.01&&(k=m,t=v);else m=JU.Measure.computeTorsion(a,j,b,A,!0),1<m?(t=a,a=A):t=A;null==t&&this.invArg();c[1]=t;c[2]=a;b=1==((0>f?1:0)+(0>e?1:0)+(0>d?1:0))%2;g=
c[3];j=JU.P3.newP(t);k=JU.P3.newP(a);0==f&&0==e?(k.scale(-1),j.scale(-1),c[1]=j,c[2]=k):!(0==f&&0==d)&&(0==e&&0==d)&&(j.scale(-1),k.scale(-1),c[1]=k,c[2]=j);b&&(j=c[1],c[1]=c[2],c[2]=j);g.cross(a,t);g.normalize();g.scale(h);return c},"J.api.SymmetryInterface,JU.P4,JU.P4");n(k,"modelkit",function(){var a=0,c=this.tokAt(1);switch(c){case 603984065:case 4139:this.chk&&this.e.cmdUndoRedo(603984065==c?4165:4140);return;case 1073742334:if(this.e.$isStateScript&&this.vwr.getModelkit(!1).setProperty("updatekeysfromstate",
null),2==this.slen&&null==this.vwr.getModelkitPropertySafely("exists"))return;case 0:case 1073742335:this.chk||this.vwr.setBooleanProperty("modelkitmode",1073742334!=c);if(0==this.tokAt(a+1))return;a=++this.e.iToken;break;case 4126:0>this.vwr.am.cmi&&this.e.errorStr(30,"MODELKIT MINIMIZE");this.minimize(!0);return;case 528432:case 4145:this.e.cmdRotate(!1,!0);return;case 4098:++this.e.iToken;case 134217764:case 4106:case 12291:case 1275069441:case 4129:case 1073742080:case 12297:case 135176:this.assign(!0);
return;case 4130:++this.e.iToken;this.mutate();return}for(var b=this.vwr.getModelkit(!1);0!=(c=this.tokAt(++a));){var f=this.paramAsStr(a).toLowerCase(),e=null;switch(c){case 1073742335:case 1073742334:this.chk||(this.vwr.setBooleanProperty("modelkitmode",1073742335==c),1073742334==c&&this.vwr.setStringProperty("picking","identify"));continue;case 1610625028:case 12294:f="hidden";e=Boolean.$valueOf(1610625028!=c);break;case 12293:var f="constraint",e="",d=c=null,h=null;switch(this.tokAt(++a)){case 1073742334:case 1073742333:this.chk||
this.vwr.setBooleanProperty("dragPicking",!1);break;case 135198:c=this.e.getPoint3f(++a,!0,!0);a=this.e.iToken;d=this.e.getPoint3f(++a,!0,!0);e=null;break;case 134219777:h=this.e.hklParameter(++a,null,!0);e=null;break;case 134217750:h=this.e.planeParameter(++a,!1);e=null;break;default:this.invArg()}null==e?((null==c||null==d)==(null==h)&&this.invArg(),e=A(-1,[c,d,h])):e=null;a=this.e.iToken;break;case 36867:f=this.paramAsStr(++a);e=0==this.tokAt(++a)?"true":this.paramAsStr(a);break;case 4166:f="vibration";
switch(this.tokAt(++a)){case 1073742334:e="off";break;case 1086324754:e="wyckoff";break;default:this.invArg()}break;case 1296041986:switch(this.tokAt(++a)){case 4:case 1073742333:e=this.paramAsStr(a);break;case 12:e=this.getToken(a).value;break;case 2:e=Integer.$valueOf(this.getToken(a).intValue);break;default:this.e.isCenterParameter(a)?(f="center",e=this.e.centerParameter(a,null),a=this.e.iToken):this.invArg()}break;case 1073742066:if(e=this.paramAsStr(a+1),e.equals("none")){++a;break}case 134217751:case 12289:e=
this.e.atomCenterOrCoordinateParameter(++a,null);a=this.e.iToken;break;case 1073742024:e=this.paramAsStr(++a).toLowerCase();this.vwr.isModelKitOption("M",e)||this.invArg();break;case 1073741938:case 1814695966:if(this.e.isArrayParameter(a+1)){this.unitcell(2,c);return}e=4==this.tokAt(a+1)||1814695966==this.tokAt(a+1)?this.paramAsStr(++a).toLowerCase():null;if(null==e||!this.vwr.isModelKitOption("U",e)){this.unitcell(2,c);return}break;case 1088421903:e=this.paramAsStr(++a).toLowerCase();this.vwr.isModelKitOption("S",
e)||this.invArg();break;default:if(this.vwr.isModelKitOption("B",f)){e=Boolean.$valueOf(0==(c=this.tokAt(++a))||1073742335==c);break}if(this.vwr.isModelKitOption("M",f)){e=f;f="mode";break}if(this.vwr.isModelKitOption("U",f)){e=f;f="unitcell";break}this.invArg()}!this.chk&&(null!=e&&null!=(e=b.setProperty(f,e))&&"hidden"!==f&&!b.isHidden())&&this.vwr.showString("modelkit SET "+f+" "+e.toString(),!1)}});n(k,"assign",function(a){0>this.vwr.am.cmi&&this.invArg();var c=this.vwr.getThisModelAtoms(),b=
++this.e.iToken,f=!1,e=!1,d=this.tokAt(b);135176==d&&(134217764!=this.tokAt(2)&&this.invArg(),f=!0,d=12297);if(12297==d&&(a||this.invArg(),e=!0,d=this.tokAt(++b),0==d))return;var h=1153433601==d,j=1677721602==d,g=1275069441==d,k=4106==d,l=12291==d,n=4129==d,D=134217764==d,m=-1;1073742080==d&&(m=this.e.isFloatParameter(b+1)?this.floatParameter(++b):0);(0<=m||D)&&!a&&this.invArg();h||j||k||D||l||n||g||0<=m?b++:(h=!0,d=1153433601);var B=-1,r=-1;a=null;if(j){if(2==this.tokAt(b))B=this.e.intParameter(b);
else if(N(this.getToken(b).value,"JM.BondSet"))B=this.getToken(b).value.nextSetBit(0);else switch(a=this.expFor(b,c),B=a.nextSetBit(0),a.cardinality()){case 1:a=this.expFor(++this.e.iToken,c),r=a.nextSetBit(0),0>r&&this.invArg(),a.set(B);case 2:a=this.vwr.ms.getBondsForSelectedAtoms(a,!1);a.isEmpty()?(k=!0,d=4106):B=a.nextSetBit(0);break;default:this.invArg()}b=++this.e.iToken}else if(0<=m)a=c;else if(!(h&&4==this.tokAt(b)||1275069441==d))if(!D||this.e.isAtomExpression(b)){a=this.expFor(b,c);B=a.nextSetBit(0);
if(0>B)return;b=++this.e.iToken}var j=this.vwr.getOperativeSymmetry(),t=l=null,x=null,E=null,p=null;if(g)switch(this.e.isAtomExpression(b)?(a=this.expFor(++this.e.iToken,c),b=this.e.iToken,l=this.e.optParameterAsString(b+1),b=this.e.iToken,l.toLowerCase().equals("packed")&&(m=this.e.isFloatParameter(b+1)?this.floatParameter(++b):0,this.e.iToken=b,l="")):1086324754==this.e.tokAt(b)?(this.e.iToken=b-1,l="O"):l=this.e.optParameterAsString(b),this.e.isPoint3f(this.e.iToken+1)?t=this.getPoint3f(++this.e.iToken,
!0):this.e.isArrayParameter(this.e.iToken+1)&&(p=this.e.getPointArray(this.e.iToken+1,-1,!1,!0)),0==l.length&&(l=null),this.tokAt(this.e.iToken+1)){case 1073742080:this.e.iToken++;m=this.e.isFloatParameter(this.e.iToken+1)?this.floatParameter(++this.e.iToken):0;break;case 1086324754:++this.e.iToken,x=this.paramAsStr(++this.e.iToken),c=x.equalsIgnoreCase("all")?"L":x.equalsIgnoreCase("general")?"G":1<x.length||0==x.length?"\x00":x.charAt(0),("a">c&&"A"!=c&&"G"!=c&&"L"!=c||"z"<c)&&this.invArg(),x=""+
c,"packed".equals(this.e.optParameterAsString(this.e.iToken+1))&&(m=this.e.isFloatParameter(++this.e.iToken+1)?this.floatParameter(++this.e.iToken):0)}else n?(this.e.isArrayParameter(b)?p=this.e.getPointArray(b,-1,!1,!0):t=this.getPoint3f(b,!0),b=this.e.iToken):D?(l=this.e.optParameterAsString(b),0==l.length&&(l="."),j=this.vwr.getOperativeSymmetry(),l.equals(".")&&(l=null==j?"P1":b==this.slen?null:j.getSpaceGroupClegId()),"packed".equalsIgnoreCase(l)&&(m=this.e.isFloatParameter(this.e.iToken+1)?
this.floatParameter(++this.e.iToken):0,l=j.getSpaceGroupClegId()),1814695966==this.tokAt(this.e.iToken+1)&&(E=Array(1),this.getUnitCellParameter(this.e.iToken+2,E),E=E[0],null==E&&this.invArg()),0>m&&1073742080==this.tokAt(this.e.iToken+1)&&(m=this.e.isFloatParameter(this.e.iToken+1)?this.floatParameter(++this.e.iToken):0)):k?0>r&&(a=this.expFor(b,c),r=a.nextSetBit(0),l=this.e.optParameterAsString(++this.e.iToken)):(l=this.e.optParameterAsString(b),h&&(t=++this.e.iToken<this.slen?this.centerParameter(this.e.iToken):
null));if(!this.chk)switch(this.vwr.pushState(),d){case 1153433601:this.e.clearDefinedVariableAtomSets();this.vwr.getModelkit(!1).cmdAssignAtom(a,t,l,this.e.fullCommand);break;case 1677721602:this.vwr.getModelkit(!1).cmdAssignBond(B,(l+"-").charAt(0),this.e.fullCommand);break;case 4106:this.vwr.getModelkit(!1).cmdAssignConnect(B,r,(l+"1").charAt(0),this.e.fullCommand);break;case 1073742080:l=null;case 1275069441:case 1086324754:null==p&&(null!=t?p=A(-1,[t]):null==a&&null==x&&(null==l?this.invArg():
x="G"));f=this.vwr.getModelkit(!1).cmdAssignAddAtoms(null==l?null:l+(null!=x?":"+x:""),p,a,m,this.e.fullCommand);this.e.doReport()&&this.e.report(J.i18n.GT.i(J.i18n.GT.$("{0} atoms added"),f),!1);break;case 12291:f=this.vwr.getModelkit(!1).cmdAssignDeleteAtoms(a);this.e.doReport()&&this.e.report(J.i18n.GT.i(J.i18n.GT.$("{0} atoms deleted"),f),!1);break;case 4129:f=this.vwr.getModelkit(!1).cmdAssignMoveAtoms(a,B,JU.P3.newP(t),p,!0,!1,!0);0<f&&this.vwr.checkCoordinatesChanged(a);this.e.doReport()&&
this.e.report(J.i18n.GT.i(J.i18n.GT.$("{0} atoms moved"),f),!1);break;case 134217764:e&&(this.vwr.zap(!1,!1,!1),j=null);if(0<=m&&l.equalsIgnoreCase("packed"))l=null,null==j&&this.invArg();else{if(0>m){for(d=e=b+1;d<this.slen;d++)if(1073742080==this.tokAt(d)){m=this.e.isFloatParameter(d+1)?this.floatParameter(++d):0;e=d;break}e<this.slen&&(l=null)}null==l&&(l=this.concatString(b,0<=m?"packed":"unitcell"));if(0<l.length&&0>l.indexOf(":")&&0>l.indexOf(">")&&(0<l.indexOf(",")||0<="rh".indexOf(l)))null==
j&&this.invArg(),b=j.getSpaceGroupClegId(),l=(null==b?"["+j.getSpaceGroupName()+"]:":b.substring(0,b.indexOf(":")+1))+l}f=this.assignSpaceGroup(a,l,E,m,f,this.e.fullCommand);f.endsWith("!")&&this.e.invArgStr(f);this.e.doReport()&&this.e.showString(f)}},"~B");n(k,"assignSpaceGroup",function(a,c,b,f,e,d){var h=new JU.SB;a=this.vwr.getSymStatic().staticTransformSpaceGroup(a,c,b,h);if(a.endsWith("!"))return a;(0<=f||e)&&this.vwr.getModelkit(!1).cmdAssignSpaceGroup(a,h,d,f,e);return h.toString()},"JU.BS,~S,~O,~N,~B,~S");
n(k,"concatString",function(a,c){for(var b="";a<this.slen;a++){var f=JS.SV.sValue(this.e.getToken(a));if(f.equals(c)){this.e.iToken--;break}b+=f}return b},"~N,~S");n(k,"getUnitCellParameter",function(a,c){c[0]=null;var b=this.tokAt(a),f=this.e.iToken,e=!1;268439040==b&&(e=!0,b=this.tokAt(++a));switch(b){case 8:return!1;case 1073741824:case 4:case 1814695966:var f=this.paramAsStr(a).toLowerCase(),d=this.vwr.getCurrentUnitCell();null==d&&this.invArg();this.chk||(f=f.equalsIgnoreCase("unitcell")?"a,b,c":
f.startsWith("unitcell_")?this.vwr.getCurrentModelAuxInfo().get(f):JU.SimpleUnitCell.parseSimpleMath(this.vwr,f),e&&(f="!"+f),c[0]=d.getV0abc(f,null));return!0}if(this.e.isArrayParameter(a)){this.e.ignoreError=!0;if(1073742332!=this.tokAt(a+2))try{return c[0]=this.e.floatParameterSet(a,6,6),this.e.ignoreError=!1}catch(h){if(!P(h,Exception))throw h;}try{return c[0]=this.e.getPointArray(a,4,!1,!0),!0}catch(j){if(P(j,Exception))this.e.iToken=f;else throw j;}try{if(1073742195==this.tokAt(a)){a+=2;d=Array(4);
for(e=0;4>e;e++){if(this.e.isArrayParameter(a)){var g=this.e.floatParameterSet(a,3,3);d[e]=JU.P3.newA(g);a=this.e.iToken+1;268436992==this.tokAt(a)&&a++;this.e.iToken=a}else if(3==e){for(a=e;0<a;--a)d[a]=d[a-1];d[0]=new JU.P3}else break;if(3==e)return c[0]=d,!0}}}catch(k){if(P(k,Exception))this.e.iToken=f;else throw k;}this.e.ignoreError=!1}return!0},"~N,~A");n(k,"expFor",function(a,c){var b=JU.BS.copy(this.atomExpressionAt(a));b.and(c);return b},"~N,JU.BS");n(k,"getContext",function(a){for(var c=
new JU.SB,b=this.e.thisContext;null!=b;)a?null!=b.vars&&(c.append(this.getScriptID(b)),c.append(JV.StateManager.getVariableList(b.vars,80,!0,!1))):c.append(JS.ScriptError.getErrorLineMessage(b.functionName,b.scriptFileName,this.e.getLinenumber(b),b.pc,JS.ScriptEval.statementAsString(this.vwr,b.statement,-9999,this.e.debugHigh))),b=b.parentContext;a?null!=this.e.contextVariables&&(c.append(this.getScriptID(null)),c.append(JV.StateManager.getVariableList(this.e.contextVariables,80,!0,!1))):c.append(this.e.getErrorLineMessage2());
return c.toString()},"~B");n(k,"getIsosurfaceJvxl",function(a,c){switch(c){case "PMESH":case "MESH":c="jvxlMeshXml";break;case "ISOMESH":c="pmesh";break;case "ISOMESHBIN":case "PMB":c="pmeshbin";break;case "ISOPLY":c="ply";break;case "ISOPLYBIN":case "PLB":c="plybin";break;default:c="jvxlDataXml"}return this.chk?"":this.getShapeProperty(a,c)},"~N,~S");n(k,"getMoJvxl",function(a,c){var b=c?28:27;this.e.sm.loadShape(b);var f=this.vwr.am.cmi;0>f&&this.e.errorStr(30,"show/write MO/NBO");var e=this.vwr.ms.getInfo(f,
"moData");null==e&&this.error(27);var d=this.getShapeProperty(b,"moNumber");(null==d||0==d.intValue())&&this.setShapeProperty(b,"init",Integer.$valueOf(f));this.setShapeProperty(b,"moData",e);return this.e.sm.getShapePropertyIndex(b,"showMO",a)},"~N,~B");n(k,"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");n(k,"tokenAt",function(a,c){return a<
c.length?c[a]:null},"~N,~A");k.tokAtArray=n(k,"tokAtArray",function(a,c){return a<c.length&&null!=c[a]?c[a].tok:0},"~N,~A");n(k,"parseDataArray",function(a,c){a=JU.Parser.fixDataString(a);var b=JU.Parser.markLines(a,"\n"),f=b.length;if(!c){for(var e=JU.AU.newFloat2(f),d=0,h=0;d<f;h=b[d++])h=JU.PT.getTokens(a.substring(h,b[d])),JU.PT.parseFloatArrayData(h,e[d]=O(h.length,0));return e}h=JU.PT.getTokens(a.substring(0,b[0]));if(3!=h.length)return O(0,0,0,0);var j=JU.PT.parseInt(h[0]),g=JU.PT.parseInt(h[1]),
k=JU.PT.parseInt(h[2]);if(1>j||1>g||1>k)return O(1,1,1,0);for(var e=JU.AU.newFloat3(j,g),l=0,n=0,d=1,h=b[0];d<f&&l<j;h=b[d++])h=JU.PT.getTokens(a.substring(h,b[d])),h.length<k||(JU.PT.parseFloatArrayData(h,e[l][n]=O(h.length,0)),++n==g&&(l++,n=0));return l!=j?(System.out.println("Error reading 3D data -- nX = "+j+", but only "+l+" blocks read"),O(1,1,1,0)):e},"~S,~B");n(k,"sync",function(){var a="",c="",b=JU.PT.parseInt(this.e.optParameterAsString(1));if(-2147483648==b)switch(this.checkLength(-3),
b=0,this.slen){case 1:c="*";a="ON";break;case 2:c=this.paramAsStr(1);if(0==c.indexOf("jmolApplet")||JU.PT.isOneOf(c,";*;.;^;")){a="ON";this.chk||this.vwr.syncScript(a,c,0);c=".";break}a=c;c="*";break;case 3:c=this.paramAsStr(1),a=528443==this.tokAt(2)?"GET_GRAPHICS":this.paramAsStr(2)}else{a=null;if(2<this.slen&&null==(a=this.e.setVariable(2,-1,"",!1)))return;a=2==this.slen?null:6==a.tok?a.toJSON():a.asString();c=null}this.chk||this.vwr.syncScript(a,c,b)});k.labeler=null})})(Clazz,Clazz.getClassName,
Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,
Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAB,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,
Clazz.cloneFinals);
