Clazz.declarePackage("J.script");Clazz.declareInterface(J.script,"JmolScriptExtension");Clazz.declarePackage("J.scriptext");
Clazz.load(["J.script.JmolScriptExtension"],"J.scriptext.ScriptExt","java.lang.Boolean $.Float $.Short java.util.Date $.Hashtable JU.ArrayUtil $.BS $.List $.M3 $.M4 $.P3 $.P4 $.ParserJS $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.constant.EnumAxesMode $.EnumVdw J.i18n.GT J.modelset.Atom $.AtomCollection $.Bond $.LabelToken J.script.SV $.ScriptCompiler $.ScriptEvaluator $.ScriptInterruption $.ScriptMathProcessor $.T J.util.BSUtil $.BoxInfo $.C $.ColorEncoder $.ColorUtil $.Elements $.Escape $.JmolMolecule $.Logger $.Measure $.Parser $.ParserBS $.Point3fi $.Quaternion $.TempArray $.Txt J.viewer.FileManager $.JC $.StateManager $.Viewer".split(" "),function(){c$=
Clazz.decorateAsClass(function(){this.sm=this.mp=this.eval=this.viewer=null;this.chk=!1;this.st=this.thisCommand=this.fullCommand=null;this.slen=0;this.pm=this.$data=null;Clazz.instantialize(this,arguments)},J.scriptext,"ScriptExt",null,J.script.JmolScriptExtension);Clazz.makeConstructor(c$,function(){});Clazz.overrideMethod(c$,"init",function(a){this.eval=a;this.viewer=this.eval.viewer;this.sm=this.eval.sm;return this},"~O");Clazz.overrideMethod(c$,"dispatch",function(a,b,c){this.chk=this.eval.chk;
this.fullCommand=this.eval.fullCommand;this.thisCommand=this.eval.thisCommand;this.slen=this.eval.slen;this.st=c;switch(a){case 4102:this.calculate();break;case 135270405:this.compare();break;case 1095766022:this.configuration();break;case 1052700:this.mapProperty();break;case 4126:this.minimize();break;case 135270424:this.modulation();break;case 4133:case 135270417:case 1052714:this.plot(c);break;case 4131:this.navigate();break;case 135270407:this.data();break;case 4148:this.show();break;case 135270421:this.write(null);
break;case 23:return this.cgo();case 25:return this.contact();case 17:return this.dipole();case 22:return this.draw();case 24:case 29:case 28:return this.isosurface(a);case 26:return this.lcaoCartoon();case 6:return this.measure(),!0;case 27:return this.mo(b);case 21:return this.polyhedra();case 4:return this.struts()}return!1},"~N,~B,~A");$_M(c$,"atomExpressionAt",($fz=function(a){return this.eval.atomExpressionAt(a)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"error",($fz=function(a){this.eval.error(a)},
$fz.isPrivate=!0,$fz),"~N");$_M(c$,"invArg",($fz=function(){this.error(22)},$fz.isPrivate=!0,$fz));$_M(c$,"invPO",($fz=function(){this.error(23)},$fz.isPrivate=!0,$fz));$_M(c$,"getShapeProperty",($fz=function(a,b){return this.eval.getShapeProperty(a,b)},$fz.isPrivate=!0,$fz),"~N,~S");$_M(c$,"parameterAsString",($fz=function(a){return this.eval.parameterAsString(a)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"centerParameter",($fz=function(a){return this.eval.centerParameter(a)},$fz.isPrivate=!0,$fz),"~N");
$_M(c$,"floatParameter",($fz=function(a){return this.eval.floatParameter(a)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getPoint3f",($fz=function(a,b){return this.eval.getPoint3f(a,b)},$fz.isPrivate=!0,$fz),"~N,~B");$_M(c$,"getPoint4f",($fz=function(a){return this.eval.getPoint4f(a)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"intParameter",($fz=function(a){return this.eval.intParameter(a)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"isFloatParameter",($fz=function(a){return this.eval.isFloatParameter(a)},$fz.isPrivate=
!0,$fz),"~N");$_M(c$,"setShapeId",($fz=function(a,b,c){return this.eval.setShapeId(a,b,c)},$fz.isPrivate=!0,$fz),"~N,~N,~B");$_M(c$,"setShapeProperty",($fz=function(a,b,c){this.eval.setShapeProperty(a,b,c)},$fz.isPrivate=!0,$fz),"~N,~S,~O");$_M(c$,"stringParameter",($fz=function(a){return this.eval.stringParameter(a)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getToken",($fz=function(a){return this.eval.getToken(a)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"tokAt",($fz=function(a){return this.eval.tokAt(a)},$fz.isPrivate=
!0,$fz),"~N");$_M(c$,"cgo",($fz=function(){var a=this.eval;this.sm.loadShape(23);if(1073742001==this.tokAt(1)&&this.listIsosurface(23))return!1;var b=0,c=null!=this.initIsosurface(23),d=c&&null==this.getShapeProperty(23,"ID"),e=!1,f=null,g=3.4028235E38;a.colorArgb[0]=-2147483648;for(var h=0,j=a.iToken;j<this.slen;++j){var m=null,l=null;switch(this.getToken(j).tok){case 7:case 269484096:case 1073742195:(null!=f||d)&&this.invArg();f=a.listParameter(j,2,2147483647);j=a.iToken;continue;case 1073742138:++j>=
this.slen&&this.error(34);switch(this.getToken(j).tok){case 2:h=this.intParameter(j);continue;case 3:h=Math.round(100*this.floatParameter(j));continue}this.error(34);break;case 1766856708:case 603979967:case 1073742074:g=a.getColorTrans(j,!1);j=a.iToken;c=!0;continue;case 1074790550:this.setShapeId(23,++j,c);d=null==this.getShapeProperty(23,"ID");j=a.iToken;break;default:if(!a.setMeshDisplayProperty(23,0,a.theTok)){if(269484209==a.theTok||J.script.T.tokAttr(a.theTok,1073741824)){this.setShapeId(23,
j,c);j=a.iToken;break}this.invArg()}0==b&&(b=j);j=a.iToken;continue}c=12291!=a.theTok;null!=f&&!e&&(m="points",l=Integer.$valueOf(h),e=!0,h=0);null!=m&&this.setShapeProperty(23,m,l)}a.finalizeObject(23,a.colorArgb[0],g,h,null!=f,f,b,null);return!0},$fz.isPrivate=!0,$fz));$_M(c$,"contact",($fz=function(){var a=this.eval;this.sm.loadShape(25);if(1073742001==this.tokAt(1)&&this.listIsosurface(25))return!1;var b=0;a.iToken=1;for(var c=null!=this.initIsosurface(25),d=c&&null==this.getShapeProperty(25,
"ID"),e=null,f=null,g=null,h=null,j=null,m=!1,l=new JU.SB,n=2147483647,r=135266319,z=0,p=NaN,A=NaN,y=!0,s=null,u=null,t=0,G=!1,D=1<a.iToken,w=a.iToken;w<this.slen;++w){switch(g=this.getToken(w).tok){default:D=!0;if(!a.setMeshDisplayProperty(25,0,a.theTok)){269484209!=a.theTok&&!J.script.T.tokAttr(a.theTok,1073741824)&&this.invArg();this.setShapeId(25,w,c);w=a.iToken;break}0==b&&(b=w);w=a.iToken;continue;case 1074790550:D=!0;this.setShapeId(25,++w,c);d=null==this.getShapeProperty(25,"ID");w=a.iToken;
break;case 1766856708:switch(this.tokAt(w+1)){case 1073741914:g=0;m=!0;l.append(" color density");w++;break;case 1141899272:g=0,G=!0,l.append(" color type"),w++}if(0==g)break;case 603979967:case 1073742074:D=!0;0==t&&(t=w);a.setMeshDisplayProperty(25,w,a.theTok);w=a.iToken;break;case 554176565:D=!0;u=this.getCapSlabObject(w,!1);this.setShapeProperty(25,"slab",u);w=a.iToken;break;case 1073741914:m=!0;l.append(" density");this.isFloatParameter(w+1)&&(null==j&&(j=Clazz.newFloatArray(1,0)),j[0]=-Math.abs(this.floatParameter(++w)),
l.append(" "+-j[0]));break;case 1073742122:c=this.floatParameter(++w);0<c&&(l.append(" resolution ").appendF(c),this.setShapeProperty(25,"resolution",Float.$valueOf(c)));break;case 135266324:case 1276118018:p=this.floatParameter(++w);l.append(" within ").appendF(p);break;case 269484193:case 2:case 3:h=a.encodeRadiusParameter(w,!1,!1);l.append(" ").appendO(h);w=a.iToken;break;case 1073741990:case 1073741989:s=1073741989==g?Boolean.TRUE:Boolean.FALSE;l.append(" ").appendO(a.theToken.value);break;case 1073742020:n=
this.intParameter(++w);break;case 1612189718:case 1073741881:case 1649412120:z=g;l.append(" ").appendO(a.theToken.value);break;case 1073742136:this.isFloatParameter(w+1)&&(A=this.floatParameter(++w));case 1074790451:case 1073742036:case 3145756:y=!1;case 1276117510:case 1073741961:case 135266319:case 4106:r=g;l.append(" ").appendO(a.theToken.value);1073742136==g&&l.append(" ").appendF(A);break;case 1073742083:j=a.floatParameterSet(++w,1,10);w=a.iToken;break;case 10:case 1048577:(d||null!=f)&&this.invArg(),
g=J.util.BSUtil.copy(this.atomExpressionAt(w)),w=a.iToken,null==e?e=g:f=g,l.append(" ").append(J.util.Escape.eBS(g))}c=12291!=a.theTok}!D&&null==e&&this.error(13);if(this.chk)return!1;if(null!=e){1649412120==z&&null==h&&(h=new J.atomdata.RadiusData(null,0,J.atomdata.RadiusData.EnumType.OFFSET,J.constant.EnumVdw.AUTO));w=null==h?new J.atomdata.RadiusData(null,0.26,J.atomdata.RadiusData.EnumType.OFFSET,J.constant.EnumVdw.AUTO):h;f=1073742036==r&&null==f&&null!=s&&s.booleanValue()?e:this.setContactBitSets(e,
f,y,p,w,!0);switch(r){case 1074790451:case 1073742136:w=a.lookupIdentifierValue("solvent");e.andNot(w);f.andNot(w);f.andNot(e);break;case 3145756:f.andNot(e);break;case 1073742036:2147483647==n&&(n=100),this.setShapeProperty(25,"minset",Integer.$valueOf(n)),l.append(" minSet ").appendI(n),null==j&&(j=[0.5,2])}null!=s&&(j=null==j?Clazz.newFloatArray(2,0):JU.ArrayUtil.ensureLengthA(j,2),j[1]=s.booleanValue()?1:2);null!=j&&l.append(" parameters ").append(J.util.Escape.eAF(j));this.setShapeProperty(25,
"set",[Integer.$valueOf(z),Integer.$valueOf(r),Boolean.$valueOf(m),Boolean.$valueOf(G),e,f,h,Float.$valueOf(A),j,l.toString()]);0<t&&a.setMeshDisplayProperty(25,t,0)}0<b&&(a.setMeshDisplayProperty(25,b,0)||this.invArg());null!=u&&null!=e&&this.setShapeProperty(25,"slab",u);if(null!=e&&(1073742036==r||y)){a=this.getShapeProperty(25,"volume");if(J.util.Escape.isAD(a)){for(w=b=0;w<a.length;w++)b+=Math.abs(a[w]);a=Float.$valueOf(b)}b=this.getShapeProperty(25,"nSets").intValue();if(m||1276117510!=r)this.showString((0==
b?"":b+" contacts with ")+"net volume "+a+" A^3")}return!0},$fz.isPrivate=!0,$fz));$_M(c$,"dipole",($fz=function(){var a=this.eval,b=null,c=null,d=!1,e=!1,f=!1;this.sm.loadShape(17);if(1073742001==this.tokAt(1)&&this.listIsosurface(17))return!1;this.setShapeProperty(17,"init",null);if(1==this.slen)return this.setShapeProperty(17,"thisID",null),!1;for(var g=1;g<this.slen;++g){c=b=null;switch(this.getToken(g).tok){case 1048589:b="on";break;case 1048588:b="off";break;case 12291:b="delete";break;case 2:case 3:b=
"value";c=Float.$valueOf(this.floatParameter(g));break;case 10:b="atomBitset";case 1048577:null==b&&(b=d||e?"endSet":"startSet");c=this.atomExpressionAt(g);g=a.iToken;d=!0;break;case 1048586:case 8:c=this.getPoint3f(g,!0);g=a.iToken;b=d||e?"endCoord":"startCoord";e=!0;break;case 1678770178:b="bonds";break;case 4102:b="calculate";break;case 1074790550:this.setShapeId(17,++g,f);g=a.iToken;break;case 135267329:b="cross";c=Boolean.TRUE;break;case 1073742040:b="cross";c=Boolean.FALSE;break;case 1073742066:c=
this.floatParameter(++g);2==a.theTok?(b="offsetPercent",c=Integer.$valueOf(Clazz.floatToInt(c))):(b="offset",c=Float.$valueOf(c));break;case 1073742068:b="offsetSide";c=Float.$valueOf(this.floatParameter(++g));break;case 1073742188:b="value";c=Float.$valueOf(this.floatParameter(++g));break;case 1073742196:b="width";c=Float.$valueOf(this.floatParameter(++g));break;default:if(269484209==a.theTok||J.script.T.tokAttr(a.theTok,1073741824)){this.setShapeId(17,g,f);g=a.iToken;break}this.invArg()}f=12291!=
a.theTok&&4102!=a.theTok;null!=b&&this.setShapeProperty(17,b,c)}(e||d)&&this.setShapeProperty(17,"set",null);return!0},$fz.isPrivate=!0,$fz));$_M(c$,"draw",($fz=function(){var a=this.eval;this.sm.loadShape(22);switch(this.tokAt(1)){case 1073742001:if(this.listIsosurface(22))return!1;break;case 1073742102:return this.pointGroup(),!1;case 137363468:case 135270417:case 1052714:return this.plot(this.st),!1}var b=!1,c=!1,d=!1,e=!1,f=!1,g,h=0,j=3.4028235E38;a.colorArgb[0]=-2147483648;for(var m=0,l="",n=
0,r=null,z=this.initIsosurface(22),p=(g=null!=z)&&null==this.getShapeProperty(22,"ID"),A=null,y=0,s=a.iToken;s<this.slen;++s){var u=null,t=null;switch(this.getToken(s).tok){case 1614417948:case 1679429641:if(this.chk)break;b=this.viewer.getPlaneIntersection(a.theTok,null,m/100,0);m=0;u="polygon";t=b;b=!0;break;case 4106:A=Clazz.newIntArray(4,0);y=4;b=a.floatParameterSet(++s,4,4);s=a.iToken;for(g=0;4>g;g++)A[g]=Clazz.floatToInt(b[g]);b=!0;break;case 1678770178:case 1141899265:if(null==A||y>(1095761924==
a.theTok?2:3))y=0,A=[-1,-1,-1,-1];A[y++]=this.atomExpressionAt(++s).nextSetBit(0);s=a.iToken;A[y++]=1678770178==a.theTok?this.atomExpressionAt(++s).nextSetBit(0):-1;s=a.iToken;b=!0;break;case 554176565:switch(this.getToken(++s).tok){case 1048583:u="slab";t=a.objectNameParameter(++s);s=a.iToken;b=!0;break;default:this.invArg()}break;case 135267842:switch(this.getToken(++s).tok){case 1614417948:case 1679429641:h=a.theTok;e=!0;continue;case 1048583:u="intersect";t=a.objectNameParameter(++s);s=a.iToken;
b=e=!0;break;default:this.invArg()}break;case 1073742106:var u="polygon",b=!0,t=new JU.List,G=0,D=0,w=null,E=null;if(a.isArrayParameter(++s))w=a.getPointArray(s,-1),G=w.length;else{G=Math.max(0,this.intParameter(s));w=Array(G);for(g=0;g<G;g++)w[g]=this.centerParameter(++a.iToken)}switch(this.getToken(++a.iToken).tok){case 11:case 12:s=J.script.SV.newScriptVariableToken(a.theToken);s.toArray();E=s.getList();D=E.size();break;case 7:E=a.theToken.getList();D=E.size();break;default:D=Math.max(0,this.intParameter(a.iToken))}s=
JU.ArrayUtil.newInt2(D);for(g=0;g<D;g++){var F=null==E?a.floatParameterSet(++a.iToken,3,4):J.script.SV.flistValue(E.get(g),0);(3>F.length||4<F.length)&&this.invArg();s[g]=[Clazz.floatToInt(F[0]),Clazz.floatToInt(F[1]),Clazz.floatToInt(F[2]),3==F.length?7:Clazz.floatToInt(F[3])]}0<G?(t.addLast(w),t.addLast(s)):t=null;s=a.iToken;break;case 1297090050:c=null;d=0;e=null;switch(this.tokAt(++s)){case 4:c=this.stringParameter(s);break;case 12:c=J.script.SV.sValue(this.getToken(s));break;default:a.isCenterParameter(s)||
(d=this.intParameter(s++));a.isCenterParameter(s)&&(r=this.centerParameter(s));a.isCenterParameter(a.iToken+1)&&(e=this.centerParameter(++a.iToken));if(this.chk)return!1;s=a.iToken}f=null;null==r&&s+1<this.slen&&(r=this.centerParameter(++s),f=10==this.tokAt(s)||1048577==this.tokAt(s)?this.atomExpressionAt(s):null);a.checkLast(a.iToken);this.chk||a.runScript(this.viewer.getSymmetryInfo(f,c,d,r,e,z,135176));return!1;case 4115:f=!0;continue;case 1048586:case 9:case 8:if(9==a.theTok||!a.isPoint3f(s)){t=
this.getPoint4f(s);if(f)return a.checkLast(a.iToken),this.chk||a.runScript(J.util.Quaternion.newP4(t).draw(null==z?"frame":z," "+l,null==r?new JU.P3:r,m/100)),!1;u="planedef"}else t=r=this.getPoint3f(s,!0),u="coord";s=a.iToken;b=!0;break;case 135267841:case 135266319:if(!b&&!e&&0==h&&135267841!=a.theTok){u="plane";break}g=135266319==a.theTok?a.planeParameter(++s):a.hklParameter(++s);s=a.iToken;if(0!=h){if(this.chk)break;b=this.viewer.getPlaneIntersection(h,g,m/100,0);m=0;u="polygon";t=b}else t=g,
u="planedef";b=!0;break;case 1073742E3:u="lineData";t=a.floatParameterSet(++s,0,2147483647);s=a.iToken;b=!0;break;case 10:case 1048577:u="atomSet";t=this.atomExpressionAt(s);f&&(r=this.centerParameter(s));s=a.iToken;b=!0;break;case 7:u="modelBasedPoints";t=J.script.SV.listValue(a.theToken);b=!0;break;case 1073742195:case 269484080:break;case 269484096:t=a.xypParameter(s);if(null!=t){s=a.iToken;u="coord";b=!0;break}d&&this.invArg();d=!0;break;case 269484097:d||this.invArg();d=!1;break;case 1141899269:u=
"reverse";break;case 4:t=this.stringParameter(s);u="title";break;case 135198:u="vector";break;case 1141899267:t=Float.$valueOf(this.floatParameter(++s));u="length";break;case 3:t=Float.$valueOf(this.floatParameter(s));u="length";break;case 1095761933:u="modelIndex";t=Integer.$valueOf(this.intParameter(++s));break;case 2:d?(u="modelIndex",t=Integer.$valueOf(this.intParameter(s))):m=this.intParameter(s);break;case 1073742138:++s>=this.slen&&this.error(34);switch(this.getToken(s).tok){case 2:m=this.intParameter(s);
continue;case 3:m=Math.round(100*this.floatParameter(s));continue}this.error(34);break;case 1074790550:z=this.setShapeId(22,++s,g);p=null==this.getShapeProperty(22,"ID");s=a.iToken;break;case 1073742028:u="fixed";t=Boolean.FALSE;break;case 1060869:u="fixed";t=Boolean.TRUE;break;case 1073742066:g=this.getPoint3f(++s,!0);s=a.iToken;u="offset";t=g;break;case 1073741906:u="crossed";break;case 1073742196:t=Float.$valueOf(this.floatParameter(++s));u="width";l=u+" "+t;break;case 1073741998:u="line";t=Boolean.TRUE;
break;case 1073741908:u="curve";break;case 1074790416:u="arc";break;case 1073741846:u="arrow";break;case 1073741880:u="circle";break;case 1073741912:u="cylinder";break;case 1073742194:u="vertices";break;case 1073742048:u="nohead";break;case 1073741861:u="isbarb";break;case 1073742130:u="rotate45";break;case 1073742092:u="perp";break;case 1666189314:case 1073741916:l=1666189314==a.theTok;F=this.floatParameter(++s);l&&(F*=2);t=Float.$valueOf(F);u=l||3==this.tokAt(s)?"width":"diameter";l=u+(3==this.tokAt(s)?
" "+F:" "+Clazz.floatToInt(F));break;case 1048583:if(269484096==this.tokAt(s+2)||f){b=r=this.centerParameter(s);s=a.iToken;u="coord";t=b;b=!0;break}t=a.objectNameParameter(++s);u="identifier";b=!0;break;case 1766856708:case 603979967:case 1073742074:g=!0;j=a.getColorTrans(s,!1);s=a.iToken;continue;default:if(!a.setMeshDisplayProperty(22,0,a.theTok)){if(269484209==a.theTok||J.script.T.tokAttr(a.theTok,1073741824)){z=this.setShapeId(22,s,g);s=a.iToken;break}this.invArg()}0==n&&(n=s);s=a.iToken;continue}g=
12291!=a.theTok;b&&(!c&&!f)&&(this.setShapeProperty(22,"points",Integer.$valueOf(m)),c=!0,m=0);b&&p&&this.invArg();null!=u&&this.setShapeProperty(22,u,t)}a.finalizeObject(22,a.colorArgb[0],j,m,b,A,n,null);return!0},$fz.isPrivate=!0,$fz));$_M(c$,"isosurface",($fz=function(a){var b=this.eval;this.sm.loadShape(a);if(1073742001==this.tokAt(1)&&this.listIsosurface(a))return!1;var c=0,d=24==a,e=28==a,f=29==a,g=26==a,h=!1,j=!1,m=!1,l=!1,n=!1,r=!1,z=!1,p=!1,A=!1,y=!1,s=!1,u=!1,t=!1,G=null,D=null,w=-2147483648,
E,F,H,L,v,K=NaN,P=NaN,la=0,da=null,ma=2147483647,M=null,Q=null,Ea=null,q=new JU.SB,I,na=null,Fa=null,ea,U=null,N=this.chk?0:-2147483648;b.setCursorWait(!0);var ba=null!=this.initIsosurface(a),Za=ba&&null==this.getShapeProperty(a,"ID"),$a=!1,Ga=!1,oa=null,Ha=null,W=null,Ia=null,pa=null,C=new JU.List,ab=!1;(e||f)&&this.addShapeProperty(C,"fileType","Pmesh");for(var k=b.iToken;k<this.slen;++k){var B=null,x=null;this.getToken(k);1073741824==b.theTok&&(U=this.parameterAsString(k));switch(b.theTok){case 603979871:da=
1048589==this.getToken(++k).tok?Boolean.TRUE:1048588==b.theTok?Boolean.FALSE:null;null==da&&this.invArg();continue;case 553648149:ma=this.intParameter(++k);continue;case 4128:B="moveIsosurface";12!=this.tokAt(++k)&&this.invArg();x=this.getToken(k++).value;break;case 1073742066:B="offset";x=this.centerParameter(++k);k=b.iToken;break;case 528432:B="rotate";x=1048587==this.tokAt(b.iToken=++k)?null:this.getPoint4f(k);k=b.iToken;break;case 1610612740:B="scale3d";x=Float.$valueOf(this.floatParameter(++k));
break;case 1073742090:q.append(" periodic");B="periodic";break;case 1073742078:case 266298:case 135266320:B=b.theToken.value.toString();q.append(" ").appendO(b.theToken.value);x=this.centerParameter(++k);q.append(" ").append(J.util.Escape.eP(x));k=b.iToken;break;case 1679429641:if(0<=this.fullCommand.indexOf("# BBOX=")){var bb=J.util.Txt.split(J.util.Parser.getQuotedAttribute(this.fullCommand,"# BBOX"),",");ea=[J.util.Escape.uP(bb[0]),J.util.Escape.uP(bb[1])]}else b.isCenterParameter(k+1)?(ea=[this.getPoint3f(k+
1,!0),this.getPoint3f(b.iToken+1,!0)],k=b.iToken):ea=this.viewer.getBoundBoxVertices();q.append(" boundBox "+J.util.Escape.eP(ea[0])+" "+J.util.Escape.eP(ea[ea.length-1]));B="boundingBox";x=ea;break;case 135188:e=!0;q.append(" pmesh");B="fileType";x="Pmesh";break;case 135267842:Q=this.atomExpressionAt(++k);this.chk?M=new JU.BS:1048577==this.tokAt(b.iToken+1)||10==this.tokAt(b.iToken+1)?(M=this.atomExpressionAt(++b.iToken),M.and(this.viewer.getAtomsWithinRadius(5,Q,!1,null))):(M=this.viewer.getAtomsWithinRadius(5,
Q,!0,null),M.andNot(this.viewer.getAtomBits(1095761934,Q)));M.andNot(Q);q.append(" intersection ").append(J.util.Escape.eBS(Q)).append(" ").append(J.util.Escape.eBS(M));k=b.iToken;if(135368713==this.tokAt(k+1)){k++;var qa=this.getToken(++k).value;q.append(" function ").append(J.util.Escape.eS(qa));this.chk||this.addShapeProperty(C,"func",qa.equals("a+b")||qa.equals("a-b")?qa:this.createFunction("__iso__","a,b",qa))}else t=!0;B="intersection";x=[Q,M];break;case 1610625028:case 135266324:var Ja=1610625028==
b.theTok;if(Ja){q.append(" display");var c=k,Z=this.tokAt(k+1);if(0==Z)continue;k++;this.addShapeProperty(C,"token",Integer.$valueOf(1048589));if(10==Z||1048579==Z){B="bsDisplay";1048579==Z?q.append(" all"):(x=this.st[k].value,q.append(" ").append(J.util.Escape.eBS(x)));b.checkLast(k);break}else 135266324!=Z&&(b.iToken=k,this.invArg())}else la=k;var xa,fa=null,M=null,Ka=!1;1048577==this.tokAt(k+1)?(xa=this.floatParameter(k+3),b.isPoint3f(k+4)?(fa=this.centerParameter(k+4),Ka=!0,b.iToken+=2):b.isPoint3f(k+
5)?(fa=this.centerParameter(k+5),Ka=!0,b.iToken+=2):(M=b.atomExpression(this.st,k+5,this.slen,!0,!1,!1,!0),null==M&&this.invArg())):(xa=this.floatParameter(++k),fa=this.centerParameter(++k));Ja&&b.checkLast(b.iToken);k=b.iToken;0<=this.fullCommand.indexOf("# WITHIN=")?M=J.util.Escape.uB(J.util.Parser.getQuotedAttribute(this.fullCommand,"# WITHIN")):Ka||(M=Clazz.instanceOf(b.expressionResult,JU.BS)?b.expressionResult:null);this.chk||(null!=M&&0<=N&&M.and(this.viewer.getModelUndeletedAtomsBitSet(N)),
null==fa&&(fa=this.viewer.getAtomSetCenter(M)),this.getWithinDistanceVector(C,xa,fa,M,Ja),q.append(" within ").appendF(xa).append(" ").append(null==M?J.util.Escape.eP(fa):J.util.Escape.eBS(M)));continue;case 1073742083:var B="parameters",cb=b.floatParameterSet(++k,1,10),k=b.iToken,x=cb;q.append(" parameters ").append(J.util.Escape.eAF(cb));break;case 1716520985:case 1073742190:var oa=b.theToken.value,ub=1073742190==b.theTok,ra=this.tokAt(k+1);if(null==Ia){!h&&(!m&&!j)&&(this.addShapeProperty(C,"sasurface",
Float.$valueOf(0)),q.append(" vdw"),h=!0);B="property";if(null==da){var db=!0;switch(ra){case 1095761923:case 1095763969:case 1095763976:case 1766856708:case 1095761937:db=!1}da=db&&1==this.viewer.getIsosurfacePropertySmoothing(!1)?Boolean.TRUE:Boolean.FALSE}this.addShapeProperty(C,"propertySmoothing",da);q.append(" isosurfacePropertySmoothing "+da);da===Boolean.TRUE&&(2147483647==ma&&(ma=this.viewer.getIsosurfacePropertySmoothing(!0)),this.addShapeProperty(C,"propertySmoothingPower",Integer.$valueOf(ma)),
q.append(" isosurfacePropertySmoothingPower "+ma));this.viewer.global.rangeSelected&&this.addShapeProperty(C,"rangeSelected",Boolean.TRUE)}else B=Ia;U=this.parameterAsString(k);q.append(" ").append(U);if(0==U.toLowerCase().indexOf("property_")){G=Clazz.newFloatArray(this.viewer.getAtomCount(),0);if(this.chk)continue;G=this.viewer.getDataFloat(U);null==G&&this.invArg();this.addShapeProperty(C,B,G);continue}var sa=this.viewer.getAtomCount(),G=Clazz.newFloatArray(sa,0);if(ub){var eb=this.parameterAsString(++k);
0==eb.length?G=b.floatParameterSet(k,sa,sa):(G=Clazz.newFloatArray(sa,0),this.chk||J.util.ParserBS.parseStringInfestedFloatArray(""+b.getParameter(eb,4),null,G));this.chk||q.append(' "" ').append(J.util.Escape.eAF(G))}else{this.getToken(++k);if(!this.chk){q.append(" "+b.theToken.value);var vb=this.viewer.modelSet.atoms;this.viewer.autoCalculate(ra);if(1766856708!=ra)for(var La=sa;0<=--La;)G[La]=J.modelset.Atom.atomPropertyFloat(this.viewer,vb[La],ra)}1766856708==ra&&(W="inherit");if(135266324==this.tokAt(k+
1)){var fb=this.floatParameter(k+=2);q.append(" within "+fb);this.addShapeProperty(C,"propertyDistanceMax",Float.$valueOf(fb))}}x=G;break;case 1095761933:case 1095766028:h&&this.invArg();N=1095761933==b.theTok?this.intParameter(++k):b.modelNumberParameter(++k);q.append(" modelIndex "+N);if(0>N){B="fixed";x=Boolean.TRUE;break}B="modelIndex";x=Integer.$valueOf(N);break;case 135280132:var B="select",Ma=this.atomExpressionAt(++k),x=Ma,k=b.iToken;if(1073742072==this.tokAt(k+1)){k++;var Na=J.util.BSUtil.copy(Ma);
J.util.BSUtil.invertInPlace(Na,this.viewer.getAtomCount());this.addShapeProperty(C,"ignore",Na);q.append(" ignore ").append(J.util.Escape.eBS(Na))}h||m?q.append(" select "+J.util.Escape.eBS(Ma)):(Q=x,0>N&&0<=Q.nextSetBit(0)&&(N=this.viewer.getAtomModelIndex(Q.nextSetBit(0))));break;case 1085443:w=this.intParameter(++k);break;case 12289:B="center";x=this.centerParameter(++k);q.append(" center "+J.util.Escape.eP(x));k=b.iToken;break;case 1073742147:case 1766856708:var Y,ba=!0,Oa=1073742147==b.theTok;
if(Oa)q.append(" sign"),this.addShapeProperty(C,"sign",Boolean.TRUE);else{if(1073741914==this.tokAt(k+1)){k++;B="colorDensity";q.append(" color density");if(this.isFloatParameter(k+1)){var gb=this.floatParameter(++k);q.append(" "+gb);x=Float.$valueOf(gb)}break}if(4==this.getToken(k+1).tok)W=this.parameterAsString(++k),0<W.indexOf(" ")&&(pa=J.util.C.getColixArray(W),null==pa&&this.error(4));else if(1073742018==b.theTok){k++;q.append(" color mesh");Y=b.getArgbParam(++k);this.addShapeProperty(C,"meshcolor",
Integer.$valueOf(Y));q.append(" ").append(J.util.Escape.escapeColor(Y));k=b.iToken;continue}if(603979967==(b.theTok=this.tokAt(k+1))||1073742074==b.theTok){q.append(" color");Ha=this.setColorOptions(q,k+1,24,-2);k=b.iToken;continue}switch(this.tokAt(k+1)){case 1073741826:case 1073742114:this.getToken(++k);q.append(" color range");this.addShapeProperty(C,"rangeAll",null);if(1048579==this.tokAt(k+1)){k++;q.append(" all");continue}var hb=this.floatParameter(++k),ib=this.floatParameter(++k);this.addShapeProperty(C,
"red",Float.$valueOf(hb));this.addShapeProperty(C,"blue",Float.$valueOf(ib));q.append(" ").appendF(hb).append(" ").appendF(ib);continue}if(b.isColorParam(k+1)&&(Y=b.getArgbParam(k+1),1074790746==this.tokAt(k+2))){W=b.getColorRange(k+1);k=b.iToken;break}q.append(" color")}b.isColorParam(k+1)?(Y=b.getArgbParam(++k),q.append(" ").append(J.util.Escape.escapeColor(Y)),k=b.iToken,this.addShapeProperty(C,"colorRGB",Integer.$valueOf(Y)),ba=!0,b.isColorParam(k+1)?(Y=b.getArgbParam(++k),k=b.iToken,this.addShapeProperty(C,
"colorRGB",Integer.$valueOf(Y)),q.append(" ").append(J.util.Escape.escapeColor(Y)),l=!0):Oa&&this.invPO()):!Oa&&null==pa&&this.invPO();continue;case 135270422:d||this.invArg();y=!this.chk;continue;case 1229984263:4!=this.tokAt(k+1)&&this.invPO();continue;case 1112541195:case 1649412120:q.append(" ").appendO(b.theToken.value);var ya=b.encodeRadiusParameter(k,!1,!0);q.append(" ").appendO(ya);Float.isNaN(ya.value)&&(ya.value=100);x=ya;B="radius";A=!0;m&&(h=!1);k=b.iToken;break;case 135266319:j=!0;B=
"plane";x=b.planeParameter(++k);k=b.iToken;q.append(" plane ").append(J.util.Escape.eP4(x));break;case 1073742138:B="scale";x=Float.$valueOf(this.floatParameter(++k));q.append(" scale ").appendO(x);break;case 1048579:ba&&this.invArg();B="thisID";break;case 1113198596:h=!0;++k;x=this.getPoint4f(k);B="ellipsoid";k=b.iToken;q.append(" ellipsoid ").append(J.util.Escape.eP4(x));break;case 135267841:j=!0;B="plane";x=b.hklParameter(++k);k=b.iToken;q.append(" plane ").append(J.util.Escape.eP4(x));break;case 135182:var h=
!0,za=this.parameterAsString(++k);this.addShapeProperty(C,"lcaoType",za);q.append(" lcaocartoon ").append(J.util.Escape.eS(za));switch(this.getToken(++k).tok){case 10:case 1048577:B="lcaoCartoon";M=this.atomExpressionAt(k);k=b.iToken;if(this.chk)continue;var ta=M.nextSetBit(0);0>ta&&this.error(14);q.append(" ({").appendI(ta).append("})");N=this.viewer.getAtomModelIndex(ta);this.addShapeProperty(C,"modelIndex",Integer.$valueOf(N));var Pa=[new JU.V3,new JU.V3,JU.V3.newV(this.viewer.getAtomPoint3f(ta)),
new JU.V3];if(!za.equalsIgnoreCase("s")&&null==this.viewer.getHybridizationAndAxes(ta,Pa[0],Pa[1],za))return!1;x=Pa;break;default:this.error(14)}break;case 1183762:var ua=2147483647,ja=2147483647,Qa=269484192==this.tokAt(k+1);Qa&&k++;var va=null;switch(this.tokAt(++k)){case 0:this.error(2);break;case 1073741914:q.append("mo [1] squared ");this.addShapeProperty(C,"squareLinear",Boolean.TRUE);va=[1];ja=ua=0;k++;break;case 1073741973:case 1073742008:ja=this.moOffset(k);ua=0;k=b.iToken;q.append(" mo "+
(Qa?"-":"")+"HOMO ");0<ja&&q.append("+");0!=ja&&q.appendI(ja);break;case 2:ua=this.intParameter(k);q.append(" mo ").appendI(ua);break;default:b.isArrayParameter(k)&&(va=b.floatParameterSet(k,1,2147483647),k=b.iToken)}if(1073742156==this.tokAt(k+1))this.addShapeProperty(C,"squareLinear",Boolean.TRUE),q.append(" squared"),null==va&&(va=Clazz.newFloatArray(0,0));else if(135266320==this.tokAt(k+1)){++k;var jb=this.intParameter(++k),kb=2==this.tokAt(k+1)?this.intParameter(++k):-System.currentTimeMillis()%
1E4;this.addShapeProperty(C,"monteCarloCount",Integer.$valueOf(jb));this.addShapeProperty(C,"randomSeed",Integer.$valueOf(kb));q.append(" points ").appendI(jb).appendC(" ").appendI(kb)}this.setMoData(C,ua,va,ja,Qa,N,null);h=!0;continue;case 1073742036:B="nci";q.append(" "+B);var Z=this.tokAt(k+1),lb=1229984263!=Z&&4!=Z&&1073742033!=Z,x=Boolean.$valueOf(lb);lb&&(h=!0);break;case 1073742016:case 1073742022:var Ra=1073742016==b.theTok,B=Ra?"mep":"mlp";q.append(" "+B);var Aa=null,Sa=-1,h=!0;2==this.tokAt(k+
1)&&(Sa=this.intParameter(++k),q.append(" "+Sa),this.addShapeProperty(C,"mepCalcType",Integer.$valueOf(Sa)));if(4==this.tokAt(k+1))Aa=this.stringParameter(++k),q.append(" /*file*/"+J.util.Escape.eS(Aa));else if(1716520985==this.tokAt(k+1)){Ia=B;continue}if(!this.chk)try{G=null==Aa&&Ra?this.viewer.getPartialCharges():this.viewer.getAtomicPotentials(Ra,Q,Ea,Aa)}catch(mb){if(!Clazz.exceptionOf(mb,Exception))throw mb;}!this.chk&&null==G&&this.error(32);x=G;break;case 1313866247:z=!this.chk;q.append(" volume");
break;case 1074790550:this.setShapeId(a,++k,ba);Za=null==this.getShapeProperty(a,"ID");k=b.iToken;break;case 1073741888:603979967==this.tokAt(k+1)&&($a=!0,k++);W=this.parameterAsString(++k).toLowerCase();W.equals("sets")?q.append(' colorScheme "sets"'):b.isColorParam(k)&&(W=b.getColorRange(k),k=b.iToken);break;case 1073741828:B="addHydrogens";x=Boolean.TRUE;q.append(" mp.addHydrogens");break;case 1073741836:B="angstroms";q.append(" angstroms");break;case 1073741838:B="anisotropy";x=this.getPoint3f(++k,
!1);q.append(" anisotropy").append(J.util.Escape.eP(x));k=b.iToken;break;case 1073741842:r=!this.chk;q.append(" area");break;case 1073741850:case 1073742076:h=!0;l&&!n&&(q.append(' phase "_orb"'),this.addShapeProperty(C,"phase","_orb"));var S=Clazz.newFloatArray(7,0);S[0]=this.intParameter(++k);S[1]=this.intParameter(++k);S[2]=this.intParameter(++k);S[3]=this.isFloatParameter(k+1)?this.floatParameter(++k):6;q.append(" atomicOrbital ").appendI(Clazz.floatToInt(S[0])).append(" ").appendI(Clazz.floatToInt(S[1])).append(" ").appendI(Clazz.floatToInt(S[2])).append(" ").appendF(S[3]);
135266320==this.tokAt(k+1)&&(k+=2,S[4]=this.intParameter(k),S[5]=3==this.tokAt(k+1)?this.floatParameter(++k):0,S[6]=2==this.tokAt(k+1)?this.intParameter(++k):-System.currentTimeMillis()%1E4,q.append(" points ").appendI(Clazz.floatToInt(S[4])).appendC(" ").appendF(S[5]).appendC(" ").appendI(Clazz.floatToInt(S[6])));B="hydrogenOrbital";x=S;break;case 1073741866:q.append(" binary");continue;case 1073741868:q.append(" blockData");B="blockData";x=Boolean.TRUE;break;case 1074790451:case 554176565:u=!0;
B=b.theToken.value;x=this.getCapSlabObject(k,!1);k=b.iToken;break;case 1073741876:d||this.invArg();p=!0;if(this.chk)continue;var nb=this.isFloatParameter(k+1)?this.floatParameter(++k):1.2,Ta=this.isFloatParameter(k+1)?this.floatParameter(++k):10;10<Ta&&b.integerOutOfRange(0,10);q.append(" cavity ").appendF(nb).append(" ").appendF(Ta);this.addShapeProperty(C,"envelopeRadius",Float.$valueOf(Ta));this.addShapeProperty(C,"cavityRadius",Float.$valueOf(nb));B="cavity";break;case 1073741896:case 1073741900:B=
"contour";q.append(" contour");switch(this.tokAt(k+1)){case 1073741920:x=b.floatParameterSet(k+2,1,2147483647);q.append(" discrete ").append(J.util.Escape.eAF(x));k=b.iToken;break;case 1073741981:I=this.getPoint3f(k+2,!1);(0>=I.z||I.y<I.x)&&this.invArg();I.z==Clazz.floatToInt(I.z)&&I.z>I.y-I.x&&(I.z=(I.y-I.x)/I.z);x=I;k=b.iToken;q.append(" increment ").append(J.util.Escape.eP(I));break;default:x=Integer.$valueOf(2==this.tokAt(k+1)?this.intParameter(++k):0),q.append(" ").appendO(x)}break;case 3:case 2:case 269484193:case 1073741910:q.append(" cutoff ");
1073741910==b.theTok&&k++;269484193==this.tokAt(k)?(B="cutoffPositive",x=Float.$valueOf(P=this.floatParameter(++k)),q.append("+").appendO(x)):this.isFloatParameter(k)?(B="cutoff",x=Float.$valueOf(P=this.floatParameter(k)),q.appendO(x)):(B="cutoffRange",x=b.floatParameterSet(k,2,2),this.addShapeProperty(C,"cutoff",Float.$valueOf(0)),q.append(J.util.Escape.eAF(x)),k=b.iToken);break;case 1073741928:B="downsample";x=Integer.$valueOf(this.intParameter(++k));q.append(" downsample ").appendO(x);break;case 1073741930:B=
"eccentricity";x=this.getPoint4f(++k);q.append(" eccentricity ").append(J.util.Escape.eP4(x));k=b.iToken;break;case 1074790508:q.append(" ed");this.setMoData(C,-1,null,0,!1,N,null);h=!0;continue;case 536870916:case 1073742041:q.append(" ").appendO(b.theToken.value);B="debug";x=536870916==b.theTok?Boolean.TRUE:Boolean.FALSE;break;case 1060869:q.append(" fixed");B="fixed";x=Boolean.TRUE;break;case 1073741962:q.append(" fullPlane");B="fullPlane";x=Boolean.TRUE;break;case 1073741966:case 1073741968:var wb=
1073741968==b.theTok,B=""+b.theToken.value,$=new JU.List,x=$,s=h=!0;q.append(" ").append(B);var T=this.parameterAsString(++k);if(T.equals("=")){q.append(" =");T=this.parameterAsString(++k);q.append(" ").append(J.util.Escape.eS(T));$.addLast(T);this.chk||this.addShapeProperty(C,"func",this.createFunction("__iso__","x,y,z",T));break}var Ua=J.util.Parser.getQuotedAttribute(this.fullCommand,"# DATA"+(s?"2":""));null==Ua?Ua="inline":T=Ua;var ob=0==T.indexOf("data2d_"),xb=0==T.indexOf("data3d_"),Ga=T.equals("inline");
q.append(" inline");$.addLast(T);var pb=this.getPoint3f(++k,!1);q.append(" ").append(J.util.Escape.eP(pb));$.addLast(pb);var aa;L=++b.iToken;$.addLast(aa=this.getPoint4f(L));q.append(" ").append(J.util.Escape.eP4(aa));E=Clazz.floatToInt(aa.x);v=++b.iToken;$.addLast(aa=this.getPoint4f(v));q.append(" ").append(J.util.Escape.eP4(aa));F=Clazz.floatToInt(aa.x);$.addLast(aa=this.getPoint4f(++b.iToken));q.append(" ").append(J.util.Escape.eP4(aa));H=Clazz.floatToInt(aa.x);(0==E||0==F||0==H)&&this.invArg();
if(!this.chk){var V=null,X=null;if(wb){Ga?(E=Math.abs(E),F=Math.abs(F),H=Math.abs(H),X=this.floatArraySetXYZ(++b.iToken,E,F,H)):X=xb?this.viewer.getDataFloat3D(T):this.viewer.functionXYZ(T,E,F,H);E=Math.abs(E);F=Math.abs(F);H=Math.abs(H);null==X&&(b.iToken=L,b.errorStr(53,"xyzdata is null."));if(X.length!=E||X[0].length!=F||X[0][0].length!=H)b.iToken=L,b.errorStr(53,"xyzdata["+X.length+"]["+X[0].length+"]["+X[0][0].length+"] is not of size ["+E+"]["+F+"]["+H+"]");$.addLast(X);q.append(" ").append(J.util.Escape.e(X))}else{Ga?
(E=Math.abs(E),F=Math.abs(F),V=this.floatArraySet(++b.iToken,E,F)):ob?(V=this.viewer.getDataFloat2D(T),E=null==V?0:V.length,F=3):(V=this.viewer.functionXY(T,E,F),E=Math.abs(E),F=Math.abs(F));null==V&&(b.iToken=L,b.errorStr(53,"fdata is null."));V.length!=E&&!ob&&(b.iToken=L,b.errorStr(53,"fdata length is not correct: "+V.length+" "+E+"."));for(var ga=0;ga<E;ga++)null==V[ga]&&(b.iToken=v,b.errorStr(53,"fdata["+ga+"] is null.")),V[ga].length!=F&&(b.iToken=v,b.errorStr(53,"fdata["+ga+"] is not the right length: "+
V[ga].length+" "+F+"."));$.addLast(V);q.append(" ").append(J.util.Escape.e(V))}}k=b.iToken;break;case 1073741970:B="gridPoints";q.append(" gridPoints");break;case 1073741976:B="ignore";x=Ea=this.atomExpressionAt(++k);q.append(" ignore ").append(J.util.Escape.eBS(Ea));k=b.iToken;break;case 1073741984:B="insideOut";q.append(" insideout");break;case 1073741988:case 1073741986:case 1073742100:q.append(" ").appendO(b.theToken.value);B="pocket";x=1073742100==b.theTok?Boolean.TRUE:Boolean.FALSE;break;case 1073742002:B=
"lobe";x=this.getPoint4f(++k);k=b.iToken;q.append(" lobe ").append(J.util.Escape.eP4(x));h=!0;break;case 1073742004:case 1073742006:B="lp";x=this.getPoint4f(++k);k=b.iToken;q.append(" lp ").append(J.util.Escape.eP4(x));h=!0;break;case 1052700:(m||this.slen==k+1)&&this.invArg();m=!0;if((p||A||t)&&!h)h=!0,this.addShapeProperty(C,"bsSolvent",A||t?new JU.BS:b.lookupIdentifierValue("solvent")),this.addShapeProperty(C,"sasurface",Float.$valueOf(0));0==q.length()?(na=this.getShapeProperty(24,"plane"),null==
na?null!=this.getShapeProperty(24,"contours")&&this.addShapeProperty(C,"nocontour",null):(this.addShapeProperty(C,"plane",na),q.append("plane ").append(J.util.Escape.eP4(na)),j=!0,na=null)):!h&&!j&&this.invArg();q.append("; isosurface map");this.addShapeProperty(C,"map",h?Boolean.TRUE:Boolean.FALSE);break;case 1073742014:B="maxset";x=Integer.$valueOf(this.intParameter(++k));q.append(" maxSet ").appendO(x);break;case 1073742020:B="minset";x=Integer.$valueOf(this.intParameter(++k));q.append(" minSet ").appendO(x);
break;case 1073742112:h=!0;B="rad";x=this.getPoint4f(++k);k=b.iToken;q.append(" radical ").append(J.util.Escape.eP4(x));break;case 1073742028:B="fixed";x=Boolean.FALSE;q.append(" modelBased");break;case 1073742029:case 1073742136:case 1613758488:var oa=b.theToken.value,Ba;1073742029==b.theTok?(B="molecular",q.append(" molecular"),Ba=this.isFloatParameter(k+1)?this.floatParameter(++k):1.4):(this.addShapeProperty(C,"bsSolvent",b.lookupIdentifierValue("solvent")),B=1073742136==b.theTok?"sasurface":"solvent",
q.append(" ").appendO(b.theToken.value),Ba=this.isFloatParameter(k+1)?this.floatParameter(++k):this.viewer.getFloat(570425394));q.append(" ").appendF(Ba);x=Float.$valueOf(Ba);1073741961==this.tokAt(k+1)&&(this.addShapeProperty(C,"doFullMolecular",null),q.append(" full"),k++);h=!0;break;case 1073742033:this.addShapeProperty(C,"fileType","Mrc");q.append(" mrc");continue;case 1073742064:case 1073742062:this.addShapeProperty(C,"fileType","Obj");q.append(" obj");continue;case 1073742034:this.addShapeProperty(C,
"fileType","Msms");q.append(" msms");continue;case 1073742094:h&&this.invArg();B="phase";n=!0;x=4==this.tokAt(k+1)?this.stringParameter(++k):"_orb";q.append(" phase ").append(J.util.Escape.eS(x));break;case 1073742104:case 1073742122:B="resolution";x=Float.$valueOf(this.floatParameter(++k));q.append(" resolution ").appendO(x);break;case 1073742124:B="reverseColor";x=Boolean.TRUE;q.append(" reversecolor");break;case 1073742146:B="sigma";x=Float.$valueOf(K=this.floatParameter(++k));q.append(" sigma ").appendO(x);
break;case 1113198597:B="geodesic";x=Float.$valueOf(this.floatParameter(++k));q.append(" geosurface ").appendO(x);h=!0;break;case 1073742154:B="sphere";x=Float.$valueOf(this.floatParameter(++k));q.append(" sphere ").appendO(x);h=!0;break;case 1073742156:B="squareData";x=Boolean.TRUE;q.append(" squared");break;case 1073741983:B=!h&&!j&&!m?"readFile":"mapColor";U=this.stringParameter(++k);null==U&&this.invArg();e&&(U=J.util.Txt.replaceAllCharacter(U,"{,}|"," "));b.logMessages&&J.util.Logger.debug("pmesh inline data:\n"+
U);x=this.chk?null:U;this.addShapeProperty(C,"fileName","");q.append(" INLINE ").append(J.util.Escape.eS(U));h=!0;break;case 4:var Ca=!h&&!j,B=Ca&&!m?"readFile":"mapColor",R=this.parameterAsString(k);if(R.startsWith("=")&&1<R.length){var qb=this.viewer.setLoadFormat(R,"_",!1),R=qb[0],rb=!Ca||!Float.isNaN(P)?null:qb[1];null!=rb&&!this.chk&&(P=J.script.SV.fValue(J.script.SV.getVariable(this.viewer.evaluateExpression(rb))),0<P&&(Float.isNaN(K)||(P*=K,K=NaN,this.addShapeProperty(C,"sigma",Float.$valueOf(K))),
this.addShapeProperty(C,"cutoff",Float.$valueOf(P)),q.append(" cutoff ").appendF(P)));0==la&&(oa="=xxxx",0>N&&(N=this.viewer.getCurrentModelIndex()),M=this.viewer.getModelUndeletedAtomsBitSet(N),this.getWithinDistanceVector(C,2,null,M,!1),q.append(" within 2.0 ").append(J.util.Escape.eBS(M)));Ca&&(ab=!0)}Ca&&(this.viewer.getParameter("_fileType").equals("Pdb")&&Float.isNaN(K)&&Float.isNaN(P))&&(this.addShapeProperty(C,"sigma",Float.$valueOf(-1)),q.append(" sigma -1.0"));0==R.length&&(0>N&&(N=this.viewer.getCurrentModelIndex()),
R=b.getFullPathName(),x=this.viewer.getModelAuxiliaryInfoValue(N,"jmolSurfaceInfo"));var Va=-1;null==x&&2==this.tokAt(k+1)&&this.addShapeProperty(C,"fileIndex",Integer.$valueOf(Va=this.intParameter(++k)));var wa=4==this.tokAt(k+1)?this.stringParameter(++k):null,h=!0;if(this.chk)break;var ka,ca=null;null==x&&(0<=this.fullCommand.indexOf("# FILE0=")?(R=J.util.Parser.getQuotedAttribute(this.fullCommand,"# FILE0"),1073741848==this.tokAt(k+1)&&(k+=2)):1073741848==this.tokAt(k+1)&&(ca=this.viewer.getFilePath(this.stringParameter(b.iToken=
k+=2),!1),ka=this.viewer.getFullPathNameOrError(ca),ca=ka[0],""!==this.viewer.getPathForAllFiles()?(R=ca,ca=null):this.addShapeProperty(C,"localName",ca)));!R.startsWith("cache://")&&null==wa&&(ka=this.viewer.getFullPathNameOrError(R),R=ka[0],null!=ka[1]&&b.errorStr(17,R+":"+ka[1]));J.util.Logger.info("reading isosurface data from "+R);null!=wa&&(x=this.viewer.cacheGet(R),this.addShapeProperty(C,"calculationType",wa));null==x&&(this.addShapeProperty(C,"fileName",R),null!=ca&&(R=ca),0<=Va&&q.append(" ").appendI(Va));
q.append(" /*file*/").append(J.util.Escape.eS(R));null!=wa&&q.append(" ").append(J.util.Escape.eS(wa));break;case 4106:B="connections";switch(this.tokAt(++k)){case 10:case 1048577:x=[this.atomExpressionAt(k).nextSetBit(0)];break;default:x=[Clazz.floatToInt(b.floatParameterSet(k,1,1)[0])]}k=b.iToken;break;case 1095761923:B="atomIndex";x=Integer.$valueOf(this.intParameter(++k));break;case 1073741999:B="link";q.append(" link");break;case 1073741994:24!=a&&this.invArg();I=this.getPoint3f(b.iToken+1,!1);
k=b.iToken;if(0>=I.x||0>=I.y||0>=I.z)break;I.x=Clazz.floatToInt(I.x);I.y=Clazz.floatToInt(I.y);I.z=Clazz.floatToInt(I.z);q.append(" lattice ").append(J.util.Escape.eP(I));m?(B="mapLattice",x=I):Fa=I;break;default:1073741824==b.theTok&&(B="thisID",x=U);if(!b.setMeshDisplayProperty(a,0,b.theTok)){if(J.script.T.tokAttr(b.theTok,1073741824)&&!ba){this.setShapeId(a,k,ba);k=b.iToken;break}this.invArg()}0==c&&(c=k);k=this.slen-1}ba=12291!=b.theTok;Za&&h&&this.invArg();null!=B&&this.addShapeProperty(C,B,
x)}if(!this.chk){if((p||A)&&!h)h=!0,this.addShapeProperty(C,"bsSolvent",A?new JU.BS:b.lookupIdentifierValue("solvent")),this.addShapeProperty(C,"sasurface",Float.$valueOf(0));j&&(!h&&!m)&&(this.addShapeProperty(C,"nomap",Float.$valueOf(0)),h=!0);-1<=w&&this.addShapeProperty(C,"getSurfaceSets",Integer.$valueOf(w-1));if(null!=pa)this.addShapeProperty(C,"colorDiscrete",pa);else if("sets".equals(W))this.addShapeProperty(C,"setColorScheme",null);else if(null!=W){var Da=this.viewer.getColorEncoder(W);null!=
Da&&(Da.isTranslucent=$a,Da.hi=3.4028235E38,this.addShapeProperty(C,"remapColor",Da))}if(h&&!g&&0!=q.indexOf(";")){C.add(0,["newObject",null]);var sb=null==Q;sb&&(Q=J.util.BSUtil.copy(this.viewer.getSelectionSet(!1)));0>N&&(N=this.viewer.getCurrentModelIndex());Q.and(this.viewer.getModelUndeletedAtomsBitSet(N));null!=oa&&(1!=this.viewer.getModelBitSet(Q,!1).cardinality()&&b.errorStr(30,"ISOSURFACE "+oa),sb&&(C.add(0,["select",Q]),0==q.indexOf("; isosurface map")&&(q=(new JU.SB).append("; isosurface map select ").append(J.util.Escape.eBS(Q)).append(q.substring(16)))))}t&&
!u&&(h||this.addShapeProperty(C,"sasurface",Float.$valueOf(0)),m||(this.addShapeProperty(C,"map",Boolean.TRUE),this.addShapeProperty(C,"select",M),this.addShapeProperty(C,"sasurface",Float.$valueOf(0))),this.addShapeProperty(C,"slab",this.getCapSlabObject(-100,!1)));var tb=h&&this.viewer.getBoolean(603979934);tb&&J.util.Logger.startTimer("isosurface");this.setShapeProperty(a,"setProperties",C);tb&&this.showString(J.util.Logger.getTimerMsg("isosurface",0));ab&&(this.setShapeProperty(a,"token",Integer.$valueOf(1073742018)),
this.setShapeProperty(a,"token",Integer.$valueOf(1073742046)),this.setShapeProperty(a,"token",Integer.$valueOf(1073741960)),q.append(" mesh nofill frontOnly"))}null!=Fa&&this.setShapeProperty(24,"lattice",Fa);0<c&&(b.setMeshDisplayProperty(a,c,0)||this.invArg());if(this.chk)return!1;var ha=null,ia=null;r&&(ha=this.getShapeProperty(a,"area"),Clazz.instanceOf(ha,Float)?this.viewer.setFloatProperty("isosurfaceArea",ha.floatValue()):this.viewer.setUserVariable("isosurfaceArea",J.script.SV.getVariableAD(ha)));
z&&(ia=z?this.getShapeProperty(a,"volume"):null,Clazz.instanceOf(ia,Float)?this.viewer.setFloatProperty("isosurfaceVolume",ia.floatValue()):this.viewer.setUserVariable("isosurfaceVolume",J.script.SV.getVariableAD(ia)));if(!g){var O=null;if(m&&!h)this.setShapeProperty(a,"finalize",q.toString());else if(h&&(D=q.toString(),this.setShapeProperty(a,"finalize",(0==D.indexOf("; isosurface map")?"":" select "+J.util.Escape.eBS(Q)+" ")+D),O=this.getShapeProperty(a,"ID"),null!=O&&!b.tQuiet)){P=this.getShapeProperty(a,
"cutoff").floatValue();Float.isNaN(P)&&!Float.isNaN(K)&&J.util.Logger.error("sigma not supported");O+=" created";d&&(O+=" with cutoff="+P);var Wa=this.getShapeProperty(a,"minMaxInfo");3.4028235E38!=Wa[0]&&(O+=" min="+Wa[0]+" max="+Wa[1]);O+="; "+J.viewer.JC.shapeClassBases[a].toLowerCase()+" count: "+this.getShapeProperty(a,"count");O+=b.getIsosurfaceDataRange(a,"\n")}var Xa,Ya;if(r||z)Xa=r?"isosurfaceArea = "+(Clazz.instanceOf(ha,Float)?""+ha:J.util.Escape.eAD(ha)):null,Ya=z?"isosurfaceVolume = "+
(Clazz.instanceOf(ia,Float)?""+ia:J.util.Escape.eAD(ia)):null,null==O?(r&&this.showString(Xa),z&&this.showString(Ya)):(r&&(O+="\n"+Xa),z&&(O+="\n"+Ya));null!=O&&this.showString(O)}null!=Ha&&this.setShapeProperty(a,"translucency",Ha);this.setShapeProperty(a,"clear",null);y&&this.setShapeProperty(a,"cache",null);return!0},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"lcaoCartoon",($fz=function(){var a=this.eval;this.sm.loadShape(26);if(1073742001==this.tokAt(1)&&this.listIsosurface(26))return!1;this.setShapeProperty(26,
"init",this.fullCommand);if(1==this.slen)return this.setShapeProperty(26,"lcaoID",null),!1;for(var b=!1,c=null,c=1;c<this.slen;c++){var d=null,e=null;switch(this.getToken(c).tok){case 1074790451:case 554176565:d=a.theToken.value;1048588==this.tokAt(c+1)&&(a.iToken=c+1);e=this.getCapSlabObject(c,!0);c=a.iToken;break;case 12289:return this.isosurface(26),!1;case 528432:var f=e=0,g=0;switch(this.getToken(++c).tok){case 1112541205:e=0.017453292*this.floatParameter(++c);break;case 1112541206:f=0.017453292*
this.floatParameter(++c);break;case 1112541207:g=0.017453292*this.floatParameter(++c);break;default:this.invArg()}d="rotationAxis";e=JU.V3.new3(e,f,g);break;case 1048589:case 1610625028:case 3145768:d="on";break;case 1048588:case 12294:case 3145770:d="off";break;case 12291:d="delete";break;case 10:case 1048577:d="select";e=this.atomExpressionAt(c);c=a.iToken;break;case 1766856708:c=this.setColorOptions(null,c+1,26,-2);null!=c&&this.setShapeProperty(26,"settranslucency",c);c=a.iToken;b=!0;continue;
case 603979967:case 1073742074:a.setMeshDisplayProperty(26,c,a.theTok);c=a.iToken;b=!0;continue;case 1113200651:case 4:e=this.parameterAsString(c).toLowerCase();e.equals("spacefill")&&(e="cpk");d="create";a.optParameterAsString(c+1).equalsIgnoreCase("molecular")&&(c++,d="molecular");break;case 135280132:10==this.tokAt(c+1)||1048577==this.tokAt(c+1)?(d="select",e=this.atomExpressionAt(c+1),c=a.iToken):(d="selectType",e=this.parameterAsString(++c),e.equals("spacefill")&&(e="cpk"));break;case 1073742138:d=
"scale";e=Float.$valueOf(this.floatParameter(++c));break;case 1073742004:case 1073742006:d="lonePair";break;case 1073742112:case 1073742111:d="radical";break;case 1073742029:d="molecular";break;case 1073741904:e=this.parameterAsString(++c);d="create";a.optParameterAsString(c+1).equalsIgnoreCase("molecular")&&(c++,d="molecular");break;case 1074790550:e=a.getShapeNameParameter(++c);c=a.iToken;b&&this.invArg();d="lcaoID";break;default:if(269484209==a.theTok||J.script.T.tokAttr(a.theTok,1073741824))269484209!=
a.theTok&&(e=this.parameterAsString(c)),b&&this.invArg(),d="lcaoID"}12291!=a.theTok&&(b=!0);null==d&&this.invArg();this.setShapeProperty(26,d,e)}this.setShapeProperty(26,"clear",null);return!0},$fz.isPrivate=!0,$fz));$_M(c$,"getCapSlabObject",($fz=function(a,b){if(0>a)return J.util.TempArray.getSlabWithinRange(a,0);var c=this.eval,d=null,e=554176565==this.tokAt(a),f=this.tokAt(a+1),g=null,h=g=null,j=null,m=null;if(603979967==f)switch(j=this.isFloatParameter(++a+1)?this.floatParameter(++a):0.5,c.isColorParam(a+
1)?(j=Short.$valueOf(J.util.C.getColixTranslucent3(J.util.C.getColix(c.getArgbParam(a+1)),0!=j,j)),a=c.iToken):j=Short.$valueOf(J.util.C.getColixTranslucent3(1,0!=j,j)),f=this.tokAt(a+1)){case 1073742018:case 1073741938:m=Integer.$valueOf(f);f=this.tokAt(++a+1);break;default:m=Integer.$valueOf(1073741938)}switch(f){case 10:case 1048577:d=this.atomExpressionAt(a+1);f=3;c.iToken++;break;case 1048588:return c.iToken=a+1,Integer.$valueOf(-2147483648);case 1048587:c.iToken=a+1;break;case 1048583:a++;d=
[Float.$valueOf(1),this.parameterAsString(++a)];f=1073742018;break;case 135266324:a++;if(1073742114==this.tokAt(++a))d=this.floatParameter(++a),f=this.floatParameter(++a),d=[Float.$valueOf(d),Float.$valueOf(f)],f=1073742114;else if(this.isFloatParameter(a)){d=this.floatParameter(a);if(c.isCenterParameter(++a))if(g=this.centerParameter(a),this.chk||!Clazz.instanceOf(c.expressionResult,JU.BS))g=[g];else for(var l=this.viewer.modelSet.atoms,h=c.expressionResult,g=Array(h.cardinality()),n=0,r=h.nextSetBit(0);0<=
r;r=h.nextSetBit(r+1),n++)g[n]=l[r];else g=c.getPointArray(a,-1);0==g.length&&(c.iToken=a,this.invArg());d=[Float.$valueOf(d),g,h]}else d=c.getPointArray(a,4),f=1679429641;break;case 1679429641:c.iToken=a+1;d=J.util.BoxInfo.getCriticalPoints(this.viewer.getBoundBoxVertices(),null);break;case 1073741872:case 1614417948:c.iToken=a+1;c=this.viewer.getCurrentUnitCell();if(null==c)1614417948==f&&this.invArg();else{g=J.util.BoxInfo.getCriticalPoints(c.getUnitCellVertices(),c.getCartesianOffset());c=Clazz.floatToInt(c.getUnitCellInfoType(6));
d=h=null;switch(c){case 1:d=JU.V3.newVsub(g[2],g[0]),d.scale(1E3);case 2:h=JU.V3.newVsub(g[1],g[0]),h.scale(1E3),g[0].sub(h),g[1].scale(2E3),1==c&&(g[0].sub(d),g[2].scale(2E3))}d=g}break;default:if(!b&&e&&this.isFloatParameter(a+1)){d=this.floatParameter(++a);if(!this.isFloatParameter(a+1))return Integer.$valueOf(Clazz.floatToInt(d));f=this.floatParameter(++a);d=[Float.$valueOf(d),Float.$valueOf(f)];f=1073742114;break}g=c.planeParameter(++a);f=this.isFloatParameter(c.iToken+1)?this.floatParameter(++c.iToken):
NaN;Float.isNaN(f)||(g.w-=f);d=g;f=135266319}return J.util.TempArray.getSlabObjectType(f,d,!e,null==m?null:[m,j])},$fz.isPrivate=!0,$fz),"~N,~B");$_M(c$,"mo",($fz=function(a){var b=this.eval,c=2147483647,d=!1,e=this.viewer.getVisibleFramesBitSet(),f=new JU.List,g=1;if(1095766028==this.tokAt(1)||4115==this.tokAt(1))g=b.modelNumberParameter(2),0>g&&this.invArg(),e.clearAll(),e.set(g),g=3;for(var h=e.nextSetBit(0);0<=h;h=e.nextSetBit(h+1)){this.sm.loadShape(27);var j=g;if(1073742001==this.tokAt(j)&&
this.listIsosurface(27))break;this.setShapeProperty(27,"init",Integer.$valueOf(h));var m=null,l=this.getShapeProperty(27,"moNumber").intValue(),n=this.getShapeProperty(27,"moLinearCombination");if(a)break;0==l&&(l=2147483647);var r=null,z=null;switch(this.getToken(j).tok){case 1074790451:case 554176565:r=b.theToken.value;z=this.getCapSlabObject(j,!1);break;case 1073741914:r="squareLinear";z=Boolean.TRUE;n=[1];c=l=0;break;case 2:l=this.intParameter(j);n=this.moCombo(f);null==n&&0>l&&(n=[-100,-l]);
break;case 269484192:switch(this.tokAt(++j)){case 1073741973:case 1073742008:break;default:this.invArg()}d=!0;case 1073741973:case 1073742008:2147483647==(c=this.moOffset(j))&&this.invArg();l=0;n=this.moCombo(f);break;case 1073742037:l=1073742037;n=this.moCombo(f);break;case 1073742108:l=1073742108;n=this.moCombo(f);break;case 1766856708:this.setColorOptions(null,j+1,27,2);break;case 135266319:r="plane";z=b.planeParameter(j+1);break;case 135266320:this.addShapeProperty(f,"randomSeed",2==this.tokAt(j+
2)?Integer.$valueOf(this.intParameter(j+2)):null);r="monteCarloCount";z=Integer.$valueOf(this.intParameter(j+1));break;case 1073742138:r="scale";z=Float.$valueOf(this.floatParameter(j+1));break;case 1073741910:269484193==this.tokAt(j+1)?(r="cutoffPositive",z=Float.$valueOf(this.floatParameter(j+2))):(r="cutoff",z=Float.$valueOf(this.floatParameter(j+1)));break;case 536870916:r="debug";break;case 1073742054:r="plane";break;case 1073742104:case 1073742122:r="resolution";z=Float.$valueOf(this.floatParameter(j+
1));break;case 1073742156:r="squareData";z=Boolean.TRUE;break;case 1073742168:j+1<this.slen&&4==this.tokAt(j+1)&&(r="titleFormat",z=this.parameterAsString(j+1));break;case 1073741824:this.invArg();break;default:if(b.isArrayParameter(j)){n=b.floatParameterSet(j,1,2147483647);1073742156==this.tokAt(b.iToken+1)&&(this.addShapeProperty(f,"squareLinear",Boolean.TRUE),b.iToken++);break}a=b.iToken;b.setMeshDisplayProperty(27,0,b.theTok)||this.invArg();this.setShapeProperty(27,"setProperties",f);b.setMeshDisplayProperty(27,
a,this.tokAt(a));return!0}null!=r&&this.addShapeProperty(f,r,z);if(2147483647!=l||null!=n)4==this.tokAt(b.iToken+1)&&(m=this.parameterAsString(++b.iToken)),b.setCursorWait(!0),this.setMoData(f,l,n,c,d,h,m),this.addShapeProperty(f,"finalize",null);0<f.size()&&this.setShapeProperty(27,"setProperties",f);f.clear()}return!0},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"moCombo",($fz=function(a){if(1073742156!=this.tokAt(this.eval.iToken+1))return null;this.addShapeProperty(a,"squareLinear",Boolean.TRUE);this.eval.iToken++;
return Clazz.newFloatArray(0,0)},$fz.isPrivate=!0,$fz),"JU.List");$_M(c$,"moOffset",($fz=function(a){var b=1073741973==this.getToken(a).tok?0:1,c=this.tokAt(++a);2==c&&0>this.intParameter(a)?b+=this.intParameter(a):269484193==c?b+=this.intParameter(++a):269484192==c&&(b-=this.intParameter(++a));return b},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"setMoData",($fz=function(a,b,c,d,e,f,g){var h=this.eval;if(!this.chk){0>f&&(f=this.viewer.getCurrentModelIndex(),0>f&&h.errorStr(30,"MO isosurfaces"));f=this.viewer.getModelAuxiliaryInfoValue(f,
"moData");var j=null,m,l,n=0;if(null==c||2>c.length){null!=c&&1==c.length&&(d=0);null==f&&this.error(27);var r=f.containsKey("lastMoNumber")?f.get("lastMoNumber").intValue():0,j=f.containsKey("lastMoCount")?f.get("lastMoCount").intValue():1;1073742108==b?b=r-1:1073742037==b&&(b=r+j);j=f.get("mos");n=null==j?0:j.size();0==n&&this.error(25);1==n&&1<b&&this.error(29);if(2147483647!=d){if(f.containsKey("HOMO"))b=f.get("HOMO").intValue()+d;else{b=-1;for(r=0;r<n;r++)if(m=j.get(r),null!=(l=m.get("occupancy"))){if(0.5>
l.floatValue()){b=r;break}}else if(null!=(l=m.get("energy"))){if(0<l.floatValue()){b=r;break}}else break;0>b&&this.error(28);b+=d}J.util.Logger.info("MO "+b)}(1>b||b>n)&&h.errorStr(26,""+n)}b=Math.abs(b);f.put("lastMoNumber",Integer.$valueOf(b));f.put("lastMoCount",Integer.$valueOf(1));e&&null==c&&(c=[-100,b]);if(null!=c&&2>c.length){m=j.get(b-1);if(null==(l=m.get("energy")))c=[100,b];else{h=l.floatValue();d=JU.BS.newN(n);e=0;c=1==c.length&&1==c[0];for(r=0;r<n;r++)if(null!=(l=j.get(r).get("energy")))if(l=
l.floatValue(),c?l<=h:l==h)d.set(r+1),e+=2;c=Clazz.newFloatArray(e,0);for(j=r=0;r<e;r+=2)c[r]=1,c[r+1]=j=d.nextSetBit(j+1);f.put("lastMoNumber",Integer.$valueOf(d.nextSetBit(0)));f.put("lastMoCount",Integer.$valueOf(Clazz.doubleToInt(e/2)))}this.addShapeProperty(a,"squareLinear",Boolean.TRUE)}this.addShapeProperty(a,"moData",f);null!=g&&this.addShapeProperty(a,"title",g);this.addShapeProperty(a,"molecularOrbital",null!=c?c:Integer.$valueOf(Math.abs(b)));this.addShapeProperty(a,"clear",null)}},$fz.isPrivate=
!0,$fz),"JU.List,~N,~A,~N,~B,~N,~S");Clazz.overrideMethod(c$,"plot",function(a){this.st=this.eval.st;this.chk=this.eval.chk;var b=this.viewer.getCurrentModelIndex();0>b&&this.eval.errorStr(30,"plot");var b=this.viewer.getJmolDataSourceFrame(b),c=a.length-1,d=a!==this.st,e=this.st;d&&(this.eval.st=this.st=a);var f=d?4148:a[0].tok,g=d||135270417==f||1052714==f?0:1,h=null,j=!0,m=!1;switch(f){case 135176:j=!1;m=!0;break;case 4148:j=!1;break;case 135270421:j=!1,4==J.scriptext.ScriptExt.tokAtArray(c,a)?
h=this.stringParameter(c--):1048584==J.scriptext.ScriptExt.tokAtArray(c-1,a)?(h=this.parameterAsString(c-2)+"."+this.parameterAsString(c),c-=3):(this.eval.st=this.st=e,this.eval.iToken=this.st.length,this.error(13))}var d="",l=null,n="",r=!1,z=!1,p=!1,A=!1,y=0,s=0,u=0,t=J.util.BSUtil.copy(this.viewer.getSelectionSet(!1)),G="; select "+J.util.Escape.eBS(t)+";\n ",A=this.eval.optParameterAsString(c).toLowerCase(),D=null,w=null,E=J.scriptext.ScriptExt.tokAtArray(g,a);4==E&&(E=J.script.T.getTokFromName(a[g].value));
switch(E){default:this.eval.iToken=1;this.invArg();break;case 135270407:this.eval.iToken=1;A="data";G="";break;case 1716520985:this.eval.iToken=g+1;(!J.script.T.tokAttr(y=this.tokAt(this.eval.iToken++),1078984704)||!J.script.T.tokAttr(s=this.tokAt(this.eval.iToken++),1078984704))&&this.invArg();J.script.T.tokAttr(u=this.tokAt(this.eval.iToken),1078984704)?this.eval.iToken++:u=0;32==this.tokAt(this.eval.iToken)&&(D=this.getPoint3f(++this.eval.iToken,!1),this.eval.iToken++);64==this.tokAt(this.eval.iToken)&&
(w=this.getPoint3f(++this.eval.iToken,!1),this.eval.iToken++);A="property "+J.script.T.nameOf(y)+" "+J.script.T.nameOf(s)+(0==u?"":" "+J.script.T.nameOf(u));0>t.nextSetBit(0)&&(t=this.viewer.getModelUndeletedAtomsBitSet(b));n="select "+J.util.Escape.eBS(t)+";\n ";break;case 1052714:A.equalsIgnoreCase("draw")&&(A=this.eval.optParameterAsString(--c).toLowerCase());A=c>g&&A.startsWith("r");A="ramachandran"+(A?" r":"")+(135176==f?" draw":"");break;case 135270417:case 137363468:d=' "'+this.viewer.getQuaternionFrame()+
'"';n="set quaternionFrame"+d+";\n  ";r=!0;A.equalsIgnoreCase("draw")&&(m=!0,A=this.eval.optParameterAsString(--c).toLowerCase());p=(z=A.startsWith("deriv")||A.startsWith("diff"))&&0<A.indexOf("2");z&&c--;if(A.equalsIgnoreCase("helix")||A.equalsIgnoreCase("axis"))z=m=!0,c=-1;A=((c<=g?"":this.eval.optParameterAsString(c))+"w").substring(0,1);if(A.equals("a")||A.equals("r"))z=!0;J.util.Parser.isOneOf(A,";w;x;y;z;r;a;")||this.eval.evalError("QUATERNION [w,x,y,z,a,r] [difference][2]",null);A="quaternion "+
A+(z?" difference":"")+(p?"2":"")+(m?" draw":"")}this.st=e;if(this.chk)return"";if(j&&(n+="plot "+A,a=this.viewer.getJmolDataFrameIndex(b,n),0<a&&135270421!=f&&4148!=f))return this.viewer.setCurrentModelIndexClear(a,!0),"";e=c=a=null;g=JU.P3.new3(1,1,1);if(1716520985==E){a=this.eval.getBitsetPropertyFloat(t,y|224,null==D?NaN:D.x,null==w?NaN:w.x);c=this.eval.getBitsetPropertyFloat(t,s|224,null==D?NaN:D.y,null==w?NaN:w.y);0!=u&&(e=this.eval.getBitsetPropertyFloat(t,u|224,null==D?NaN:D.z,null==w?NaN:
w.z));null==D&&(D=JU.P3.new3(this.getPlotMinMax(a,!1,y),this.getPlotMinMax(c,!1,s),this.getPlotMinMax(e,!1,u)));null==w&&(w=JU.P3.new3(this.getPlotMinMax(a,!0,y),this.getPlotMinMax(c,!0,s),this.getPlotMinMax(e,!0,u)));J.util.Logger.info("plot min/max: "+D+" "+w);l=JU.P3.newP(w);l.add(D);l.scale(0.5);g.setT(w);g.sub(D);g.set(g.x/200,g.y/200,g.z/200);J.script.T.tokAttr(y,1095761920)?(g.x=1,l.x=0):0.1<g.x&&10>=g.x&&(g.x=1);J.script.T.tokAttr(s,1095761920)?(g.y=1,l.y=0):0.1<g.y&&10>=g.y&&(g.y=1);J.script.T.tokAttr(u,
1095761920)?(g.z=1,l.z=0):0.1<g.z&&10>=g.z&&(g.z=1);0==u&&(l.z=D.z=w.z=g.z=0);for(j=0;j<a.length;j++)a[j]=(a[j]-l.x)/g.x;for(j=0;j<c.length;j++)c[j]=(c[j]-l.y)/g.y;if(0!=u)for(j=0;j<e.length;j++)e[j]=(e[j]-l.z)/g.z;l=[t,a,c,e,D,w,g,l]}if(135270421==f)return this.viewer.writeFileData(h,"PLOT_"+A,b,l);h=A.equals("data")?"1 0 H 0 0 0 # Jmol PDB-encoded data":this.viewer.getPdbData(b,A,l);if(4148==f)return h;J.util.Logger.debugging&&J.util.Logger.debug(h);if(135176==f)return this.eval.runScript(h),"";
f=this.viewer.getFileInfo();t=this.viewer.getBoolean(603979792);this.viewer.setAppendNew(!0);h=null!=h&&null==this.viewer.openStringInlineParamsAppend(h,null,!0);this.viewer.setAppendNew(t);this.viewer.setFileInfo(f);if(!h)return"";f=this.viewer.getModelCount();this.viewer.setJmolDataFrame(n,b,f-1);1716520985!=E&&(n+=";\n"+G);n=this.viewer.addStateScript(n,!0,!1);h=150;switch(E){default:b="frame 0.0; frame last; reset;select visible;wireframe only;";h=10;break;case 1716520985:this.viewer.setFrameTitle(f-
1,A+" plot for model "+this.viewer.getModelNumberDotted(b));b="frame 0.0; frame last; reset;select visible; spacefill 3; wireframe 0;draw plotAxisX"+f+' {100 -100 -100} {-100 -100 -100} "'+J.script.T.nameOf(y)+'";draw plotAxisY'+f+' {-100 100 -100} {-100 -100 -100} "'+J.script.T.nameOf(s)+'";';0!=u&&(b+="draw plotAxisZ"+f+' {-100 -100 100} {-100 -100 -100} "'+J.script.T.nameOf(u)+'";');break;case 1052714:this.viewer.setFrameTitle(f-1,"ramachandran plot for model "+this.viewer.getModelNumberDotted(b));
b="frame 0.0; frame last; reset;select visible; color structure; spacefill 3.0; wireframe 0;draw ramaAxisX"+f+' {100 0 0} {-100 0 0} "phi";draw ramaAxisY'+f+' {0 100 0} {0 -100 0} "psi";';break;case 135270417:case 137363468:this.viewer.setFrameTitle(f-1,A.$replace("w"," ")+d+" for model "+this.viewer.getModelNumberDotted(b)),b=J.util.C.getHexCode(this.viewer.getColixBackgroundContrast()),b="frame 0.0; frame last; reset;select visible; wireframe 0; spacefill 3.0; isosurface quatSphere"+f+" color "+
b+" sphere 100.0 mesh nofill frontonly translucent 0.8;draw quatAxis"+f+'X {100 0 0} {-100 0 0} color red "x";draw quatAxis'+f+'Y {0 100 0} {0 -100 0} color green "y";draw quatAxis'+f+'Z {0 0 100} {0 0 -100} color blue "z";color structure;draw quatCenter'+f+"{0 0 0} scale 0.02;"}this.eval.runScript(b+G);n.setModelIndex(this.viewer.getCurrentModelIndex());this.viewer.setRotationRadius(h,!0);this.sm.loadShape(30);this.showString("frame "+this.viewer.getModelNumberDotted(f-1)+(0<A.length?" created: "+
A+(r?d:""):""));return""},"~A");$_M(c$,"getPlotMinMax",($fz=function(a,b,c){if(null==a)return 0;switch(c){case 1112539144:case 1112539145:case 1112539146:return b?180:-180;case 1112539141:case 1112539152:return b?360:0;case 1112539150:return b?1:-1}c=b?-1E10:1E10;for(var d=a.length;0<=--d;){var e=a[d];Float.isNaN(e)||b==e>c&&(c=e)}return c},$fz.isPrivate=!0,$fz),"~A,~B,~N");$_M(c$,"polyhedra",($fz=function(){var a=this.eval,b=!1,c=!1,d=!1,e=!1,f=!1,g=0,h=0;this.sm.loadShape(21);this.setShapeProperty(21,
"init",Boolean.TRUE);var j="centers",m="radius_",l=3.4028235E38;a.colorArgb[0]=-2147483648;for(var n=1;n<this.slen;++n){var r=null,z=null;switch(this.getToken(n).tok){case 12291:case 1048589:case 1048588:(n+1!=this.slen||b||1<h||0==h&&"to".equals(j))&&this.error(18);r=1048588==a.theTok?"off":1048589==a.theTok?"on":"delete";c=!0;break;case 269484436:case 269484080:continue;case 1678770178:0<h&&this.invPO();b=!0;r="bonds";break;case 1666189314:m="radius";continue;case 2:case 3:0<h&&!f&&this.invPO();
if(2==a.theTok&&"radius_"===m){r="nVertices";z=Integer.$valueOf(this.intParameter(n));b=!0;break}r="radius_"===m?"radius":m;z=Float.$valueOf(this.floatParameter(n));m="radius_";f=!1;b=!0;break;case 10:case 1048577:d&&this.invPO();2<++h&&this.error(2);"to".equals(j)&&(b=!0);r=j;j="to";z=this.atomExpressionAt(n);n=a.iToken;break;case 1074790746:1<h&&this.invPO();if(10==this.tokAt(n+1)||1048577==this.tokAt(n+1)&&!b){r="toBitSet";z=this.atomExpressionAt(++n);n=a.iToken;b=!0;break}else b||this.error(19);
j="to";continue;case 1073741937:b||this.error(19);m="faceCenterOffset";f=!0;continue;case 1073741924:0==h&&this.error(19);m="distanceFactor";f=!0;continue;case 1766856708:case 603979967:case 1073742074:l=a.getColorTrans(n,!0);n=a.iToken;continue;case 1073741886:case 1073741948:r="collapsed";z=1073741886==a.theTok?Boolean.TRUE:Boolean.FALSE;d&&this.error(18);d=!0;break;case 1073742044:case 1073741933:case 1073741956:e&&this.error(18);r=this.parameterAsString(n);e=!0;break;case 1073741964:g=a.theTok;
continue;default:if(a.isColorParam(n)){a.colorArgb[0]=a.getArgbParam(n);n=a.iToken;continue}this.invArg()}this.setShapeProperty(21,r,z);if(c)return!1}!b&&(!d&&!e&&0==g)&&this.error(19);b&&this.setShapeProperty(21,"generate",null);-2147483648!=a.colorArgb[0]&&this.setShapeProperty(21,"colorThis",Integer.$valueOf(a.colorArgb[0]));3.4028235E38!=l&&a.setShapeTranslucency(21,"","translucentThis",l,null);0!=g&&this.setShapeProperty(21,"token",Integer.$valueOf(g));this.setShapeProperty(21,"init",Boolean.FALSE);
return!0},$fz.isPrivate=!0,$fz));$_M(c$,"struts",($fz=function(){var a=this.eval,b=1073742072==this.tokAt(1)||1048589==this.tokAt(1)||1==this.slen,c=a.getMadParameter();b&&(c=Math.round(2E3*this.viewer.getFloat(570425406)));this.setShapeProperty(1,"type",Integer.$valueOf(32768));a.setShapeSizeBs(1,c,null);this.setShapeProperty(1,"type",Integer.$valueOf(1023));return!0},$fz.isPrivate=!0,$fz));$_M(c$,"initIsosurface",($fz=function(a){var b=this.eval;this.setShapeProperty(a,"init",this.fullCommand);
b.iToken=0;var c=this.tokAt(1),d=this.tokAt(2);if(12291==c||12291==d&&1048579==this.tokAt(++b.iToken))return this.setShapeProperty(a,"delete",null),b.iToken+=2,this.slen>b.iToken&&(this.setShapeProperty(a,"init",this.fullCommand),this.setShapeProperty(a,"thisID","+PREVIOUS_MESH+")),null;b.iToken=1;return!b.setMeshDisplayProperty(a,0,c)&&(this.setShapeProperty(a,"thisID","+PREVIOUS_MESH+"),22!=a&&this.setShapeProperty(a,"title",[this.thisCommand]),1074790550!=c&&(269484209==d||269484209==c&&b.setMeshDisplayProperty(a,
0,d)))?(a=this.setShapeId(a,1,!1),b.iToken++,a):null},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getWithinDistanceVector",($fz=function(a,b,c,d,e){var f=new JU.List,g=Array(2);if(null==d){var h=JU.P3.new3(b,b,b),j=JU.P3.newP(c);j.sub(h);h.add(c);g[0]=j;g[1]=h;f.addLast(c)}else c=this.viewer.getBoxInfo(d,-Math.abs(b)),g[0]=c.getBoundBoxVertices()[0],g[1]=c.getBoundBoxVertices()[7],1==d.cardinality()&&f.addLast(this.viewer.getAtomPoint3f(d.nextSetBit(0)));1==f.size()&&!e&&(this.addShapeProperty(a,"withinDistance",
Float.$valueOf(b)),this.addShapeProperty(a,"withinPoint",f.get(0)));this.addShapeProperty(a,e?"displayWithin":"withinPoints",[Float.$valueOf(b),g,d,f])},$fz.isPrivate=!0,$fz),"JU.List,~N,JU.P3,JU.BS,~B");$_M(c$,"setColorOptions",($fz=function(a,b,c,d){var e=this.eval;this.getToken(b);var f="opaque";if(603979967==e.theTok)if(f="translucent",0>d){var g=this.isFloatParameter(b+1)?this.floatParameter(++b):3.4028235E38;e.setShapeTranslucency(c,null,"translucent",g,null);null!=a&&(a.append(" translucent"),
3.4028235E38!=g&&a.append(" ").appendF(g))}else e.setMeshDisplayProperty(c,b,e.theTok);else 1073742074==e.theTok?0<=d&&e.setMeshDisplayProperty(c,b,e.theTok):e.iToken--;d=Math.abs(d);for(g=0;g<d;g++)if(e.isColorParam(e.iToken+1)){var h=e.getArgbParam(++e.iToken);this.setShapeProperty(c,"colorRGB",Integer.$valueOf(h));null!=a&&a.append(" ").append(J.util.Escape.escapeColor(h))}else if(e.iToken<b)this.invArg();else break;return f},$fz.isPrivate=!0,$fz),"JU.SB,~N,~N,~N");$_M(c$,"addShapeProperty",($fz=
function(a,b,c){this.chk||a.addLast([b,c])},$fz.isPrivate=!0,$fz),"JU.List,~S,~O");$_M(c$,"createFunction",($fz=function(a,b,c){var d=new J.script.ScriptEvaluator;d.setViewer(this.viewer);try{d.compileScript(null,"function "+a+"("+b+") { return "+c+"}",!1);var e=new JU.List;for(a=0;a<b.length;a+=2)e.addLast(J.script.SV.newVariable(3,Float.$valueOf(0)).setName(b.substring(a,a+1)));return[d.aatoken[0][1].value,e]}catch(f){if(Clazz.exceptionOf(f,Exception))return null;throw f;}},$fz.isPrivate=!0,$fz),
"~S,~S,~S");$_M(c$,"floatArraySet",($fz=function(a,b,c){var d=this.tokAt(a++);1073742195==d&&(d=this.tokAt(a++));269484096!=d&&this.invArg();for(var e=JU.ArrayUtil.newFloat2(b),f=0;269484097!=d;)switch(d=this.getToken(a).tok,d){case 1073742195:case 269484097:continue;case 269484080:a++;break;case 269484096:a++;d=Clazz.newFloatArray(c,0);e[f++]=d;for(var g=0;g<c;g++)d[g]=this.floatParameter(a++),269484080==this.tokAt(a)&&a++;269484097!=this.tokAt(a++)&&this.invArg();d=0;f==b&&269484097!=this.tokAt(a)&&
this.invArg();break;default:this.invArg()}return e},$fz.isPrivate=!0,$fz),"~N,~N,~N");$_M(c$,"floatArraySetXYZ",($fz=function(a,b,c,d){var e=this.eval,f=this.tokAt(a++);1073742195==f&&(f=this.tokAt(a++));(269484096!=f||0>=b)&&this.invArg();for(var g=JU.ArrayUtil.newFloat3(b,-1),h=0;269484097!=f;)switch(f=this.getToken(a).tok,f){case 1073742195:case 269484097:continue;case 269484080:a++;break;case 269484096:g[h++]=this.floatArraySet(a,c,d);a=++e.iToken;f=0;h==b&&269484097!=this.tokAt(a)&&this.invArg();
break;default:this.invArg()}return g},$fz.isPrivate=!0,$fz),"~N,~N,~N,~N");$_M(c$,"listIsosurface",($fz=function(a){this.eval.checkLength23();this.chk||this.showString(this.getShapeProperty(a,"list"+(0==this.tokAt(2)?"":" "+this.getToken(2).value)));return!0},$fz.isPrivate=!0,$fz),"~N");Clazz.overrideMethod(c$,"getBitsetIdent",function(a,b,c,d,e,f){var g=!Clazz.instanceOf(c,J.modelset.Bond.BondSet);g&&(null==b?b=this.viewer.getStandardLabelFormat(0):0==b.length&&(b="%[label]"));var h=null==b?-1:b.indexOf("%"),
j=2147483647!=e;if(null==a||this.chk||g&&0>h)return null==b&&(b=""),f?[b]:b;var h=this.viewer.modelSet,m=0,l=h.getLabeler();c=g||!d?null:c.getAssociatedAtoms();null==c&&(null!=b&&0<b.indexOf("%D"))&&(c=this.viewer.getAtomIndices(a));d=null==b||0==b.length;var n=g||d?null:J.modelset.LabelToken.getBondLabelValues();b=d?null:g?l.compile(this.viewer,b,"\x00",null):l.compile(this.viewer,b,"\u0001",n);var r=j?1:J.util.BSUtil.cardinalityOf(a),z=Array(r);for(e=j?e:a.nextSetBit(0);0<=e;e=a.nextSetBit(e+1)){var p;
g?p=d?h.atoms[e].getInfo():l.formatLabelAtomArray(this.viewer,h.atoms[e],b,"\x00",c):(p=h.getBondAt(e),p=d?p.getIdentity():l.formatLabelBond(this.viewer,p,b,n,c));p=J.util.Txt.formatStringI(p,"#",m+1);z[m++]=p;if(j)break}return 1==r&&!f?z[0]:z},"JU.BS,~S,~O,~B,~N,~B");$_M(c$,"data",function(){var a=this.eval,b=null,c=null,d=!1,e;switch(a.iToken=this.slen){case 5:b=this.parameterAsString(2);case 4:case 2:c=this.parameterAsString(1);if(c.equalsIgnoreCase("clear")){this.chk||this.viewer.setData(null,
null,0,0,0,0,0);return}if(0<=(e=c.indexOf("@")))b=""+a.getParameter(c.substring(e+1),4),c=c.substring(0,e).trim();else if(null==b&&0<=(e=c.indexOf(" ")))b=c.substring(e+1).trim(),c=c.substring(0,e).trim(),d=!0;break;default:this.error(2)}e=c+" ";e=e.substring(0,e.indexOf(" ")).toLowerCase();if(e.equals("model")||e.equals("append"))a.load();else if(!this.chk)if(a=0<=c.toLowerCase().indexOf("(default)"),this.$data=Array(4),e.equals("element_vdw")){this.$data[0]=e;this.$data[1]=b.$replace(";","\n");
b=J.util.Elements.elementNumberMax;e=Clazz.newIntArray(b+1,0);for(a=1;a<=b;a++)e[a]=a;this.$data[2]=e;this.$data[3]=Integer.$valueOf(0);this.viewer.setData("element_vdw",this.$data,b,0,0,0,0)}else if(e.equals("connect_atoms"))this.viewer.connect(J.util.Parser.parseFloatArray2d(b));else if(0==e.indexOf("ligand_"))this.viewer.setLigandModel(c.substring(7).toUpperCase()+"_data",b.trim());else if(0==e.indexOf("file_"))this.viewer.setLigandModel(c.substring(5).toUpperCase()+"_file",b.trim());else if(0==
e.indexOf("data2d_"))this.$data[0]=c,this.$data[1]=J.util.Parser.parseFloatArray2d(b),this.$data[3]=Integer.$valueOf(2),this.viewer.setData(c,this.$data,0,0,0,0,0);else if(0==e.indexOf("data3d_"))this.$data[0]=c,this.$data[1]=J.util.Parser.parseFloatArray3d(b),this.$data[3]=Integer.$valueOf(3),this.viewer.setData(c,this.$data,0,0,0,0,0);else{var f=JU.ParserJS.getTokens(c);if(0==e.indexOf("property_")&&!(2==f.length&&f[1].equals("set"))){a=this.viewer.getSelectionSet(!1);this.$data[0]=e;var g=d?0:
this.viewer.getParameter("propertyAtomNumberField").intValue(),h=d?0:this.viewer.getParameter("propertyAtomNumberColumnCount").intValue(),j=d?-2147483648:this.viewer.getParameter("propertyDataField").intValue(),m=d?0:this.viewer.getParameter("propertyDataColumnCount").intValue();!d&&0<=c.indexOf(" ")&&(3==f.length&&(g=JU.ParserJS.parseInt(f[1]),j=JU.ParserJS.parseInt(f[2])),5==f.length&&(g=JU.ParserJS.parseInt(f[1]),h=JU.ParserJS.parseInt(f[2]),j=JU.ParserJS.parseInt(f[3]),m=JU.ParserJS.parseInt(f[4])));
0>g&&(g=0);0>j&&(j=0);c=this.viewer.getAtomCount();d=null;f=J.util.BSUtil.newBitSet(c);if(0<g){for(var d=Clazz.newIntArray(c+2,0),l=0;l<=c;l++)d[l]=-1;for(l=a.nextSetBit(0);0<=l;l=a.nextSetBit(l+1)){var n=this.viewer.getAtomNumber(l);n>c+1||(0>n||f.get(n))||(f.set(n),d[n]=l)}this.$data[2]=d}else this.$data[2]=J.util.BSUtil.copy(a);this.$data[1]=b;this.$data[3]=Integer.$valueOf(0);this.viewer.setData(e,this.$data,c,g,h,j,m)}else g=J.modelset.AtomCollection.getUserSettableType(e),0<=g?this.viewer.setAtomData(g,
e,b,a):(this.$data[0]=c,this.$data[1]=b,this.$data[3]=Integer.$valueOf(0),this.viewer.setData(e,this.$data,0,0,0,0,0))}});$_M(c$,"navigate",function(){var a=this.eval;if(1==this.slen)a.setBooleanProperty("navigationMode",!0);else{var b=JU.V3.new3(0,1,0),c=new JU.List,d;if(2==this.slen)switch(this.getToken(1).tok){case 1048589:case 1048588:if(this.chk)return;a.setObjectMad(31,"axes",1);this.setShapeProperty(31,"position",JU.P3.new3(50,50,3.4028235E38));a.setBooleanProperty("navigationMode",!0);this.viewer.setNavOn(1048589==
a.theTok);return;case 1073742162:this.chk||this.viewer.setNavXYZ(0,0,0);return;case 8:case 1113200654:break;default:this.invArg()}!this.chk&&!this.viewer.getBoolean(603979887)&&a.setBooleanProperty("navigationMode",!0);for(var e=1;e<this.slen;e++){var f=this.isFloatParameter(e)?this.floatParameter(e++):2;0>f&&this.invArg();!this.chk&&0<f&&a.refresh();switch(this.getToken(e).tok){case 8:case 1048586:d=this.getPoint3f(e,!0);a.iToken++;a.iToken!=this.slen&&this.invArg();this.chk||this.viewer.setNavXYZ(d.x,
d.y,d.z);return;case 554176526:d=this.floatParameter(++e);this.chk||c.addLast([Integer.$valueOf(554176526),Float.$valueOf(f),Float.$valueOf(d)]);continue;case 12289:d=this.centerParameter(++e);e=a.iToken;this.chk||c.addLast([Integer.$valueOf(135266320),Float.$valueOf(f),d]);continue;case 528432:switch(this.getToken(++e).tok){case 1112541205:b.set(1,0,0);e++;break;case 1112541206:b.set(0,1,0);e++;break;case 1112541207:b.set(0,0,1);e++;break;case 8:case 1048586:b.setT(this.getPoint3f(e,!0));e=a.iToken+
1;break;case 1073741824:this.invArg()}d=this.floatParameter(e);this.chk||c.addLast([Integer.$valueOf(528432),Float.$valueOf(f),b,Float.$valueOf(d)]);continue;case 4160:var g=d=NaN;if(this.isFloatParameter(++e))d=this.floatParameter(e),g=this.floatParameter(++e);else switch(this.tokAt(e)){case 1112541205:d=this.floatParameter(++e);break;case 1112541206:g=this.floatParameter(++e);break;default:d=this.centerParameter(e);e=a.iToken;this.chk||c.addLast([Integer.$valueOf(4160),Float.$valueOf(f),d]);continue}this.chk||
c.addLast([Integer.$valueOf(269484210),Float.$valueOf(f),Float.$valueOf(d),Float.$valueOf(g)]);continue;case 269484208:continue;case 1113200654:d=new JU.List;10==this.tokAt(e+1)||1048577==this.tokAt(e+1)?(g=this.atomExpressionAt(++e),e=a.iToken):g=this.viewer.getSelectionSet(!1);if(this.chk)return;this.viewer.getPolymerPointsAndVectors(g,d);var h;if(0<(h=d.size())){for(var g=Array(h),j=0;j<h;j++)g[j]=d.get(j);c.addLast([Integer.$valueOf(1113200654),Float.$valueOf(f),g]);continue}break;case 1073742084:if(1048583==
this.getToken(e+1).tok){e++;d=a.objectNameParameter(++e);if(this.chk)return;this.setShapeProperty(22,"thisID",d);d=this.getShapeProperty(22,"vertices");a.refresh();null==d&&this.invArg();g=Clazz.floatToInt(this.isFloatParameter(e+1)?this.floatParameter(++e):0);h=Clazz.floatToInt(this.isFloatParameter(e+1)?this.floatParameter(++e):2147483647);c.addLast([Integer.$valueOf(1073742084),Float.$valueOf(f),d,null,[g,h]]);continue}for(d=new JU.List;a.isCenterParameter(e+1);)d.addLast(this.centerParameter(++e)),
e=a.iToken;if(0<d.size()){d=d.toArray(Array(d.size()));this.chk||c.addLast([Integer.$valueOf(1073742084),Float.$valueOf(f),d,null,[0,2147483647]]);continue}default:this.invArg()}}this.chk||this.viewer.navigateList(a,c)}});Clazz.overrideMethod(c$,"evaluateParallel",function(a,b){var c=new J.script.ScriptEvaluator;c.setViewer(this.viewer);c.historyDisabled=!0;c.compiler=new J.script.ScriptCompiler(this.viewer);c.sm=b;try{c.restoreScriptContext(a,!0,!1,!1),c.allowJSThreads=!1,c.dispatchCommands(!1,!1)}catch(d){if(Clazz.exceptionOf(d,
Exception))return this.eval.viewer.setStringProperty("_errormessage",""+d),null==c.thisContext&&(J.util.Logger.error("Error evaluating context "+d),this.viewer.isJS||d.printStackTrace()),!1;throw d;}return!0},"J.script.ScriptContext,J.viewer.ShapeManager");Clazz.overrideMethod(c$,"write",function(a){var b=0,c=0,d,e;null==a?(a=this.st,b=c=1,d=!0,e=this.viewer.isApplet()&&!this.viewer.isSignedApplet()||!this.viewer.haveAccess(J.viewer.Viewer.ACCESS.ALL)||0<this.viewer.getPathForAllFiles().length):(d=
!1,e=!0);var f=d?this.slen:a.length,g=0,h=0,j=-1,m=-1,l=-2147483648,n=this.viewer.getBoolean(603979934),r=this.viewer.getExportDriverList(),z="PNGJ",p=null,A="",y=null,s=null,u=null,t=null,G=null,D=Array(1),w=!1,E=!1,F=!1,H=null,L=null,v="SPT",K=d&&1==a.length?1073741884:J.scriptext.ScriptExt.tokAtArray(b,a);switch(K){case 0:break;case 135271429:this.eval.isArrayParameter(b+1)&&(L=this.eval.stringParameterSet(++b),u=s=".",c=b=this.eval.iToken+1,K=this.tokAt(b));break;default:v=J.script.SV.sValue(this.tokenAt(b,
a)).toUpperCase()}switch(K){case 135270417:case 1052714:case 1716520985:G=this.plot(a);if(!d)return G;break;case 1073741983:v="INLINE";p=J.script.SV.sValue(this.tokenAt(++b,a));b++;break;case 1073742102:v="PGRP";b++;A=J.script.SV.sValue(this.tokenAt(b,a)).toLowerCase();A.equals("draw")&&b++;break;case 1048582:b++;w=!0;break;case 1073742158:case 135271429:for(t=J.script.SV.sValue(this.tokenAt(++b,a)).toLowerCase();t.equals("localpath")||t.equals("remotepath");)t.equals("localpath")?s=J.script.SV.sValue(this.tokenAt(++b,
a)):u=J.script.SV.sValue(this.tokenAt(++b,a)),t=J.script.SV.sValue(this.tokenAt(++b,a)).toLowerCase();v="SPT";break;case 1229984263:case 135368713:case 1610616855:case 135180:case 1073742015:case 1073742018:case 1183762:case 135188:b++;break;case 1073741992:v="ZIPALL";b++;break;case 36868:v="VAR";b+=2;break;case 4115:case 1073741824:case 1073741979:case 1073742139:case 4:case 4166:switch(K){case 1073741979:b++;break;case 4166:h=this.eval.intParameterRange(++b,1,10);this.chk||(this.viewer.setVibrationOff(),
this.eval.isJS||this.eval.delayScript(100));b++;break;case 4115:b+1<f&&1048577==a[++b].tok||10==a[b].tok?(t=this.eval.atomExpression(a,b,0,!0,!1,!0,!0),b=this.eval.iToken+1):t=this.viewer.getModelUndeletedAtomsBitSet(-1);this.chk||(H=this.viewer.getModelBitSet(t,!0));break;case 1073742139:t=J.script.SV.sValue(this.tokenAt(++b,a)).toUpperCase();J.util.Parser.isOneOf(t,";PNG;PNGJ;")&&(z=t,b++);break;default:K=1073741979}if(1073741979==K)if(K=J.script.T.getTokenFromName(J.script.SV.sValue(a[b]).toLowerCase()),
null!=K&&(v=J.script.SV.sValue(K).toUpperCase()),J.util.Parser.isOneOf(v,r.toUpperCase())){b++;v=v.substring(0,1).toUpperCase()+v.substring(1).toLowerCase();E=!0;d&&(y="Jmol."+v.toLowerCase());break}else if(J.util.Parser.isOneOf(v,";ZIP;ZIPALL;SPT;STATE;")){b++;break}else v="(image)";2==J.scriptext.ScriptExt.tokAtArray(b,a)&&(j=J.script.SV.iValue(this.tokenAt(b++,a)),m=J.script.SV.iValue(this.tokenAt(b++,a)))}if(null==G){t=J.script.SV.sValue(this.tokenAt(b,a));if(t.equalsIgnoreCase("clipboard")){if(this.chk)return""}else J.util.Parser.isOneOf(t.toLowerCase(),
";jpg;jpeg;jpg64;jpeg64;gif;ppm;png;pngj;pngt;")?(2==J.scriptext.ScriptExt.tokAtArray(b+1,a)&&2==J.scriptext.ScriptExt.tokAtArray(b+2,a)&&(j=J.script.SV.iValue(this.tokenAt(++b,a)),m=J.script.SV.iValue(this.tokenAt(++b,a))),2==J.scriptext.ScriptExt.tokAtArray(b+1,a)&&(l=J.script.SV.iValue(this.tokenAt(++b,a)))):J.util.Parser.isOneOf(t.toLowerCase(),";xyz;xyzrn;xyzvib;mol;sdf;v2000;v3000;cd;pdb;pqr;cml;")&&(v=t.toUpperCase(),b+1==f&&b++);v.equals("(image)")&&J.util.Parser.isOneOf(t.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;ppm;png;pngj;pngt;scene;")&&
(v=t.toUpperCase(),b++);b+2==f&&(p=J.script.SV.sValue(this.tokenAt(++b,a)),0<p.length&&"."!=p.charAt(0)&&(v=t.toUpperCase()));switch(J.scriptext.ScriptExt.tokAtArray(b,a)){case 0:e=!0;break;case 1073741884:break;case 1073741824:case 4:y=J.script.SV.sValue(this.tokenAt(b,a));b==f-3&&1048584==J.scriptext.ScriptExt.tokAtArray(b+1,a)&&(y+="."+J.script.SV.sValue(this.tokenAt(b+2,a)));if("VAR"!==v&&b==c)v="IMAGE";else if(0<y.length&&"."==y.charAt(0)&&(b==c+1||b==c+2))y=J.script.SV.sValue(this.tokenAt(b-
1,a))+y,"VAR"!==v&&b==c+1&&(v="IMAGE");if(y.equalsIgnoreCase("clipboard")||!this.viewer.haveAccess(J.viewer.Viewer.ACCESS.ALL))y=null;break;default:this.invArg()}if(v.equals("IMAGE")||v.equals("(image)")||v.equals("FRAME")||v.equals("VIBRATION"))v=null!=y&&0<=y.indexOf(".")?y.substring(y.lastIndexOf(".")+1).toUpperCase():"JPG";v.equals("MNU")?v="MENU":v.equals("WRL")||v.equals("VRML")?(v="Vrml",E=!0):v.equals("X3D")?(v="X3d",E=!0):v.equals("IDTF")?(v="Idtf",E=!0):v.equals("MA")?(v="Maya",E=!0):v.equals("JS")?
(v="Js",E=!0):v.equals("OBJ")?(v="Obj",E=!0):v.equals("JVXL")?v="ISOSURFACE":v.equals("XJVXL")?v="ISOSURFACE":v.equals("JMOL")?v="ZIPALL":v.equals("HIS")&&(v="HISTORY");v.equals("COORD")&&(v=null!=y&&0<=y.indexOf(".")?y.substring(y.lastIndexOf(".")+1).toUpperCase():"XYZ");F=J.util.Parser.isOneOf(v.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;ppm;png;pngj;pngt;scene;");null!=L&&(v.equals("PNG")&&(v="PNGJ"),!v.equals("PNGJ")&&!v.equals("ZIPALL")&&this.invArg());!F&&(!E&&!J.util.Parser.isOneOf(v,";SCENE;JMOL;ZIP;ZIPALL;SPT;HISTORY;MO;ISOSURFACE;MESH;PMESH;VAR;FILE;FUNCTION;CD;CML;XYZ;XYZRN;XYZVIB;MENU;MOL;PDB;PGRP;PQR;QUAT;RAMA;SDF;V2000;V3000;INLINE;"))&&
this.eval.errorStr2(54,"COORDS|FILE|FUNCTIONS|HISTORY|IMAGE|INLINE|ISOSURFACE|JMOL|MENU|MO|POINTGROUP|QUATERNION [w,x,y,z] [derivative]|RAMACHANDRAN|SPT|STATE|VAR x|ZIP|ZIPALL  CLIPBOARD","CML|GIF|JPG|JPG64|JMOL|JVXL|MESH|MOL|PDB|PMESH|PNG|PNGJ|PNGT|PPM|PQR|SDF|V2000|V3000|SPT|XJVXL|XYZ|XYZRN|XYZVIB|ZIP"+r.toUpperCase().$replace(";","|"));if(this.chk)return"";b=null;c=!1;if(null==p||E){p=v.intern();if(E){n&&J.util.Logger.startTimer("export");h=new java.util.Hashtable;h.put("type",p);null!=y&&h.put("fileName",
y);(d||null!=y)&&h.put("fullPath",D);h.put("width",Integer.$valueOf(j));h.put("height",Integer.$valueOf(m));p=this.viewer.generateOutputForExport(h);if(null==p||0==p.length)return"";if(!d)return p;(v.equals("Povray")||v.equals("Idtf"))&&null!=D[0]?(j=v.equals("Idtf")?".tex":".ini",y=D[0]+j,d=new java.util.Hashtable,d.put("fileName",y),d.put("type",j),d.put("text",p),d.put("fullPath",D),G=this.viewer.processWriteOrCapture(d),v.equals("Idtf")&&(p=p.substring(0,p.indexOf("\\begin{comment}"))),p="Created "+
D[0]+":\n\n"+p,n&&this.showString(J.util.Logger.getTimerMsg("export",0))):G=p;null!=G&&(G.startsWith("OK")||this.eval.evalError(G,null),this.eval.scriptStatusOrBuffer(p));return""}if("MENU"===p)p=this.viewer.getMenu("");else if("PGRP"===p)p=this.viewer.getPointGroupAsString(A.equals("draw"),null,0,1);else if("PDB"===p||"PQR"===p)e?p=this.viewer.getPdbAtomData(null,null):c=!0;else if("FILE"===p)e?p=this.viewer.getCurrentFileAsString():c=!0,"?".equals(y)&&(y="?Jmol."+this.viewer.getParameter("_fileType"));
else if(("SDF"===p||"MOL"===p||"V2000"===p||"V3000"===p||"CD"===p)&&w)p=this.viewer.getModelExtract("selected",!0,!1,p),p.startsWith("ERROR:")&&(b=p);else if("XYZ"===p||"XYZRN"===p||"XYZVIB"===p||"MOL"===p||"SDF"===p||"V2000"===p||"V3000"===p||"CML"===p||"CD"===p)p=this.viewer.getData("selected",p),p.startsWith("ERROR:")&&(b=p);else if("FUNCTION"===p)p=this.viewer.getFunctionCalls(null),v="TXT";else if("VAR"===p)p=this.eval.getParameter(J.script.SV.sValue(this.tokenAt(d?2:1,a)),1073742190).asString(),
v="TXT";else if("SPT"===p)if(w)a=this.viewer.getTaintedAtoms(2),this.viewer.setAtomCoordsRelative(JU.P3.new3(0,0,0),null),p=this.viewer.getStateInfo(),this.viewer.setTaintedAtoms(a,2);else{if(p=this.viewer.getStateInfo(),null!=s||null!=u)p=J.viewer.FileManager.setScriptFileReferences(p,s,u,null)}else"ZIP"===p||"ZIPALL"===p?null!=y&&null==(b=p=this.viewer.createZip(y,v,L))&&this.eval.evalError("#CANCELED#",null):"HISTORY"===p?(p=this.viewer.getSetHistory(2147483647),v="SPT"):"MO"===p?(p=this.getMoJvxl(2147483647),
v="XJVXL"):"PMESH"===p?(null==(p=this.getIsosurfaceJvxl(!0,28))&&this.error(31),v="XJVXL"):"ISOSURFACE"===p||"MESH"===p?(null==(p=this.getIsosurfaceJvxl("MESH"===p,24))&&this.error(31),v=0<=p.indexOf("<?xml")?"XJVXL":"JVXL",e||this.showString(this.getShapeProperty(24,"jvxlFileInfo"))):(g=-1,0>l&&(l=-1));null==p&&!c&&(p="");0==g&&!c&&(null==b||Clazz.instanceOf(b,String));F&&(this.eval.refresh(),0>j&&(j=this.viewer.getScreenWidth()),0>m&&(m=this.viewer.getScreenHeight()))}if(!d)return p;if(e)return this.eval.showStringPrint(p,
!0),"";if(null!=b&&Clazz.instanceOf(b,String))return 0!=b.indexOf("OK")&&alert(b),this.eval.scriptStatusOrBuffer(b),b;if(v.equals("SCENE"))b=z;else if(null==b&&(!F||null!=y))b=p;n&&J.util.Logger.startTimer("write");c?G=this.viewer.writeFileData(y,v,0,null):(d=new java.util.Hashtable,null!=y&&d.put("fileName",y),d.put("type",v),Clazz.instanceOf(b,String)&&-2147483648==l?d.put("text",b):Clazz.instanceOf(b,Array)&&d.put("bytes",b),null!=L&&d.put("scripts",L),null!=H&&d.put("bsFrames",H),d.put("fullPath",
D),d.put("quality",Integer.$valueOf(l)),d.put("width",Integer.$valueOf(j)),d.put("height",Integer.$valueOf(m)),d.put("nVibes",Integer.$valueOf(h)),G=this.viewer.processWriteOrCapture(d));n&&this.showString(J.util.Logger.getTimerMsg("write",0))}return!this.chk&&null!=G?(G.startsWith("OK")||(this.eval.evalError(G,null),alert(G)),this.eval.scriptStatusOrBuffer(G+(F?"; width="+j+"; height="+m:"")),G):""},"~A");$_M(c$,"show",($fz=function(){var a=null,b=this.parameterAsString(1),c=null,d=null,e=2,f=this.getToken(1),
d=Clazz.instanceOf(f,J.script.SV)?0:f.tok;4==d&&(f=J.script.T.getTokenFromName(b.toLowerCase()),null!=f&&(d=f.tok));1297090050!=d&&1073742158!=d&&this.checkLength(-3);if(2==this.slen&&0<=b.indexOf("?"))this.showString(this.viewer.getAllSettings(b.substring(0,b.indexOf("?"))));else{switch(d){case 0:this.chk||(c=this.eval.theToken.escape());break;case 135270422:this.chk||(c=J.util.Escape.e(this.viewer.cacheList()));break;case 1073741915:this.checkLength(2);this.chk||(c=this.viewer.calculateStructures(null,
!0,!1));break;case 545259571:this.checkLength(2);this.chk||(c=this.viewer.getPathForAllFiles());break;case 1073742038:if(this.eval.optParameterAsString(2).equalsIgnoreCase("1H")){e=3;this.chk||(c=this.viewer.getNMRPredict(!1));break}this.chk||this.viewer.getNMRPredict(!0);return;case 135267336:case 1073741929:case 1073741879:this.checkLength(1073741879==d?3:2);if(this.chk)return;c=this.viewer.getSmiles(0,0,this.viewer.getSelectionSet(!1),!1,!0,!1,!1);switch(d){case 1073741929:if(0<c.length){this.viewer.show2D(c);
return}c="Could not show drawing -- Either insufficient atoms are selected or the model is a PDB file.";break;case 1073741879:if(e=3,f=null,0<c.length){d="/";switch(this.getToken(2).tok){case 1073741977:d="I";break;case 1073741978:d="K";break;case 1073742035:d="N";break;default:f=this.parameterAsString(2)}c=this.viewer.getChemicalInfo(c,d,f);0<=c.indexOf("FileNotFound")&&(c="?")}else c="Could not show name -- Either insufficient atoms are selected or the model is a PDB file."}break;case 1297090050:3<
this.slen?(e=this.centerParameter(2),f=this.centerParameter(++this.eval.iToken),this.chk||(c=this.viewer.getSymmetryOperation(null,0,e,f,!1)),e=++this.eval.iToken):(e=2==this.eval.checkLength23()?0:this.intParameter(2),this.chk||(c=this.viewer.getSymmetryOperation(null,e,null,null,!1)),e=-3);break;case 1649412120:a=null;2<this.slen&&(a=J.constant.EnumVdw.getVdwType(this.parameterAsString(2)),null==a&&this.invArg());this.chk||this.showString(this.viewer.getDefaultVdwTypeNameOrData(0,a));return;case 135368713:this.eval.checkLength23();
this.chk||this.showString(this.viewer.getFunctionCalls(this.eval.optParameterAsString(2)));return;case 1085443:this.checkLength(2);this.chk||this.showString(this.viewer.getAllSettings(null));return;case 1074790760:if(2==this.slen){this.chk||this.viewer.showUrl(this.eval.getFullPathName());return}d=this.parameterAsString(2);this.chk||this.viewer.showUrl(d);return;case 1766856708:b="defaultColorScheme";break;case 1610612740:b="scaleAngstromsPerInch";break;case 135270417:case 1052714:if(this.chk)return;
0>this.viewer.getCurrentModelIndex()&&this.eval.errorStr(30,"show "+this.eval.theToken.value);c=this.plot(this.st);e=this.slen;break;case 1113200654:this.chk||(c=this.getContext(!1));break;case 1073741888:d=this.eval.optParameterAsString(2);0<d.length&&(e=3);this.chk||(a=this.viewer.getColorSchemeList(d));break;case 1073742192:this.chk||(c=this.viewer.getAtomDefs(this.eval.definedAtomSets)+this.viewer.getVariableList()+this.getContext(!0));break;case 536870926:this.chk||(c=this.viewer.getTrajectoryState());
break;case 553648148:a=""+this.eval.commandHistoryLevelMax;break;case 553648150:a=""+J.util.Logger.getLogLevel();break;case 603979824:a=""+this.viewer.getBoolean(603979824);break;case 553648178:c="set strandCountForStrands "+this.viewer.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.viewer.getStrandCount(13);break;case 536875070:c=this.viewer.showTimeout(2==(e=this.slen)?null:this.parameterAsString(2));break;case 536870918:a=J.util.Escape.eP(this.viewer.getDefaultLattice());break;case 4126:this.chk||
(c=this.viewer.getMinimizationInfo());break;case 1611272194:switch(this.viewer.getAxesMode()){case J.constant.EnumAxesMode.UNITCELL:c="set axesUnitcell";break;case J.constant.EnumAxesMode.BOUNDBOX:c="set axesWindow";break;default:c="set axesMolecular"}break;case 1610612737:c="set bondMode "+(this.viewer.getBoolean(603979812)?"OR":"AND");break;case 1650071565:this.chk||(c="set strandCountForStrands "+this.viewer.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.viewer.getStrandCount(13));break;
case 1612189718:c="set hbondsBackbone "+this.viewer.getBoolean(603979852)+";set hbondsSolid "+this.viewer.getBoolean(603979854);break;case 1611141175:this.chk||(c=this.viewer.getSpinState());break;case 1611141176:c="set ssbondsBackbone "+this.viewer.getBoolean(603979952);break;case 1610625028:case 1611141171:c="selectionHalos "+(this.viewer.getSelectionHaloEnabled(!1)?"ON":"OFF");break;case 1613758470:c="set selectHetero "+this.viewer.getBoolean(1613758470);break;case 1073741828:c=J.util.Escape.eAP(this.viewer.getAdditionalHydrogens(null,
!0,!0,null));break;case 1613758476:c="set selectHydrogens "+this.viewer.getBoolean(1613758476);break;case 553648130:case 553648142:case 536870924:case 553648176:case 553648172:case 1073741995:this.chk||(c=this.viewer.getSpecularState());break;case 4146:this.chk||(c=this.viewer.listSavedStates());break;case 1614417948:this.chk||(c=this.viewer.getUnitCellInfoText());break;case 1048582:if(2==(e=this.slen)){this.chk||(c=this.viewer.getCoordinateState(this.viewer.getSelectionSet(!1)));break}f=this.parameterAsString(2);
this.chk||(c=this.viewer.getSavedCoordinates(f));break;case 1073742158:this.chk||this.viewer.clearConsole();if(2==(e=this.slen)){this.chk||(c=this.viewer.getStateInfo());break}d=this.parameterAsString(2);if(d.equals("/")&&4==(e=this.slen)){d=this.parameterAsString(3).toLowerCase();if(!this.chk){for(var f=J.util.Txt.split(this.viewer.getStateInfo(),"\n"),c=new JU.SB,g=0;g<f.length;g++)0<=f[g].toLowerCase().indexOf(d)&&c.append(f[g]).appendC("\n");c=c.toString()}break}else if(1229984263==this.tokAt(2)&&
4==(e=this.slen)){this.chk||(c=this.viewer.getEmbeddedFileState(this.parameterAsString(3)));break}e=3;this.chk||(c=this.viewer.getSavedState(d));break;case 1641025539:if(2==(e=this.slen)){this.chk||(c=this.viewer.getProteinStructureState());break}f=this.parameterAsString(2);this.chk||(c=this.viewer.getSavedStructure(f));break;case 135270407:d=3==(e=this.slen)?this.parameterAsString(2):null;this.chk||(c=null==d?this.$data:this.viewer.getData(d),c=null==c?"no data":J.util.Escape.encapsulateData(c[0],
c[1],c[3].intValue()));break;case 1073742152:f=null;2==(e=this.slen)?this.chk||(f=this.viewer.getSpaceGroupInfo(null)):(d=this.parameterAsString(2),this.chk||(f=this.viewer.getSpaceGroupInfo(J.util.Txt.simpleReplace(d,"''",'"'))));null!=f&&(c=""+f.get("spaceGroupInfo")+f.get("symmetryInfo"));break;case 1048583:e=3;c=this.eval.setObjectProperty();break;case 1679429641:this.chk||(c=this.viewer.getBoundBoxCommand(!0));break;case 12289:this.chk||(c="center "+J.util.Escape.eP(this.viewer.getRotationCenter()));
break;case 135176:this.chk||(c=this.getShapeProperty(22,"command"));break;case 1229984263:this.chk||this.viewer.clearConsole();if(2==this.slen){this.chk||(c=this.viewer.getCurrentFileAsString());null==c&&(c="<unavailable>");break}e=3;a=this.parameterAsString(2);this.chk||(c=this.viewer.getFileAsString(a));break;case 4115:c=1048579==this.tokAt(2)&&0<(e=3)?this.viewer.getModelFileInfoAll():this.viewer.getModelFileInfo();break;case 1610616855:f=2==(e=this.slen)?2147483647:this.intParameter(2);1>f&&this.invArg();
this.chk||(this.viewer.clearConsole(),0==this.eval.scriptLevel&&this.viewer.removeCommand(),c=this.viewer.getSetHistory(f));break;case 135180:this.chk||(c=this.getShapeProperty(24,"jvxlDataXml"));break;case 1183762:this.eval.optParameterAsString(2).equalsIgnoreCase("list")?(c=this.viewer.getMoInfo(-1),e=3):(f=2==(e=this.slen)?-2147483648:this.intParameter(2),this.chk||(c=this.getMoJvxl(f)));break;case 1095766028:this.chk||(c=this.viewer.getModelInfoAsString());break;case 537006096:this.chk||(c=this.viewer.getMeasurementInfoAsString());
break;case 1073741863:e=3;!this.chk&&this.slen==e&&(c=this.viewer.getOrientationText(this.tokAt(2),null));break;case 1073742132:d=this.tokAt(2),0==d?d=1073742132:e=3;case 1073742178:case 4130:this.chk||(c=this.viewer.getOrientationText(d,null));break;case 1073742077:e=2;if(3<this.slen)break;switch(d=this.tokAt(2)){case 1073742178:case 1073742132:case 4130:case 0:this.chk||(c=this.viewer.getOrientationText(d,null));break;default:d=this.eval.optParameterAsString(2),c=this.viewer.getOrientationText(1073742035,
d)}e=this.slen;break;case 1073742088:this.chk||(c=this.viewer.getPDBHeader());break;case 1073742102:this.pointGroup();return;case 1089470478:this.chk||(c=this.viewer.getSymmetryInfoAsString());break;case 1073742176:this.chk||(c="transform:\n"+this.viewer.getTransformText());break;case 4168:c="zoom "+(this.viewer.getZoomEnabled()?""+this.viewer.getZoomSetting():"off");break;case 1611272202:c=this.viewer.getShowFrank()?"frank ON":"frank OFF";break;case 1666189314:b="solventProbeRadius";break;case 1073741864:case 1087373316:case 1087373320:case 1073742120:case 1114638363:case 1087373318:case 1141899265:case 1073741982:c=
this.viewer.getChimeInfo(d);break;case 537022465:case 1610612738:case 1716520985:case 20482:case 1613758488:a="?";break;case 1073741824:b.equalsIgnoreCase("fileHeader")?this.chk||(c=this.viewer.getPDBHeader()):b.equalsIgnoreCase("menu")?this.chk||(a=this.viewer.getMenu("")):b.equalsIgnoreCase("mouse")&&(f=2==(e=this.slen)?null:this.parameterAsString(2),this.chk||(c=this.viewer.getBindingInfo(f)))}this.checkLength(e);this.chk||(null!=c?this.showString(c):null!=a?this.showString(b+" = "+a):null!=b&&
(0<=b.indexOf(" ")?this.showString(b):this.showString(b+" = "+this.getParameterEscaped(b))))}},$fz.isPrivate=!0,$fz));$_M(c$,"showString",($fz=function(a){this.eval.showString(a)},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"checkLength",($fz=function(a){this.eval.checkLength(a)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getIsosurfaceJvxl",($fz=function(a,b){return this.chk?"":this.getShapeProperty(b,a?"jvxlMeshX":"jvxlDataXml")},$fz.isPrivate=!0,$fz),"~B,~N");$_M(c$,"getMoJvxl",($fz=function(a){this.sm.loadShape(27);
var b=this.viewer.getCurrentModelIndex();0>b&&this.eval.errorStr(30,"MO isosurfaces");var c=this.viewer.getModelAuxiliaryInfoValue(b,"moData");null==c&&this.error(27);var d=this.getShapeProperty(27,"moNumber");(null==d||0==d.intValue())&&this.setShapeProperty(27,"init",Integer.$valueOf(b));this.setShapeProperty(27,"moData",c);return this.getShapePropertyIndex(27,"showMO",a)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getParameterEscaped",($fz=function(a){var b=this.eval.getContextVariableAsVariable(a);return null==
b?""+this.viewer.getParameterEscaped(a):b.escape()},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"getContext",($fz=function(a){for(var b=new JU.SB,c=this.eval.thisContext;null!=c;)a?null!=c.contextVariables&&(b.append(this.getScriptID(c)),b.append(J.viewer.StateManager.getVariableList(c.contextVariables,80,!0,!1))):b.append(J.script.ScriptEvaluator.getErrorLineMessage(c.functionName,c.scriptFileName,this.eval.getLinenumber(c),c.pc,J.script.ScriptEvaluator.statementAsString(this.viewer,c.statement,-9999,this.eval.logMessages))),
c=c.parentContext;a?null!=this.eval.contextVariables&&(b.append(this.getScriptID(null)),b.append(J.viewer.StateManager.getVariableList(this.eval.contextVariables,80,!0,!1))):b.append(this.eval.getErrorLineMessage2());return b.toString()},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"getScriptID",($fz=function(a){return"\n# "+(null==a?this.eval.functionName:"function "+a.functionName)+" (file "+(null==a?this.eval.scriptFileName:a.scriptFileName)+(null==a?"":" context "+a.id)+")\n"},$fz.isPrivate=!0,$fz),"J.script.ScriptContext");
$_M(c$,"getShapePropertyIndex",($fz=function(a,b,c){return this.sm.getShapePropertyIndex(a,b,c)},$fz.isPrivate=!0,$fz),"~N,~S,~N");$_M(c$,"tokenAt",($fz=function(a,b){return a<b.length?b[a]:null},$fz.isPrivate=!0,$fz),"~N,~A");c$.tokAtArray=$_M(c$,"tokAtArray",($fz=function(a,b){return a<b.length&&null!=b[a]?b[a].tok:0},$fz.isPrivate=!0,$fz),"~N,~A");$_M(c$,"calculate",($fz=function(){var a=!1,b=!1,c=null,d=null,e=-2147483648;if(2<=(this.eval.iToken=this.eval.slen))switch(this.eval.clearDefinedVariableAtomSets(),
this.getToken(1).tok){case 1073741824:this.checkLength(2);break;case 1632634889:this.checkLength(2);if(this.chk)return;e=this.viewer.calculateFormalCharges(null);this.showString(J.i18n.GT._("{0} charges modified",e));return;case 1076887572:this.checkLength(2);this.chk||this.viewer.assignAromaticBonds();return;case 1612189718:2!=this.eval.slen&&(c=(b=1641025539==this.tokAt(++this.eval.iToken))?this.viewer.getSelectionSet(!1):this.atomExpressionAt(this.eval.iToken),!b&&1641025539!=this.tokAt(++this.eval.iToken)&&
(d=this.atomExpressionAt(this.eval.iToken)));if(this.chk)return;e=this.viewer.autoHbond(c,d,!1);-2147483648!=e&&this.eval.scriptStatusOrBuffer(J.i18n.GT._("{0} hydrogen bonds",Math.abs(e)));return;case 1613758476:c=2==this.slen?null:this.atomExpressionAt(2);this.eval.checkLast(this.eval.iToken);this.chk||this.viewer.addHydrogens(c,!1,!1);return;case 1112541196:this.eval.iToken=1;c=2==this.slen?null:this.atomExpressionAt(2);this.eval.checkLast(this.eval.iToken);this.chk||this.viewer.calculatePartialCharges(c);
return;case 1073742102:this.pointGroup();return;case 1112539150:this.checkLength(2);this.chk||(this.viewer.calculateStraightness(),this.viewer.addStateScript("set quaternionFrame '"+this.viewer.getQuaternionFrame()+"'; calculate straightness",!1,!0));return;case 1641025539:c=4>this.slen?null:this.atomExpressionAt(2);switch(this.tokAt(++this.eval.iToken)){case 1052714:break;case 1073741915:b=!0;break;case 0:b=this.viewer.getBoolean(603979825);break;default:this.invArg()}this.chk||this.showString(this.viewer.calculateStructures(c,
b,!0));return;case 1708058:c=this.eval.iToken+1<this.slen?this.atomExpressionAt(++this.eval.iToken):null;d=this.eval.iToken+1<this.slen?this.atomExpressionAt(++this.eval.iToken):null;this.checkLength(++this.eval.iToken);this.chk||(e=this.viewer.calculateStruts(c,d),0<e&&(this.setShapeProperty(1,"type",Integer.$valueOf(32768)),this.eval.setShapePropertyBs(1,"color",Integer.$valueOf(16777215),null),this.eval.setShapeTranslucency(1,"","translucent",0.5,null),this.setShapeProperty(1,"type",Integer.$valueOf(1023))),
this.showString(J.i18n.GT._("{0} struts mp.added",e)));return;case 3145756:a=!0;case 1112539151:b=!1;switch(this.tokAt(2)){case 135266324:this.eval.iToken++;break;case 0:b=!a;break;case 1073741952:b=!0;this.eval.iToken++;break;default:b=!0}c=this.eval.iToken+1<this.slen?this.atomExpressionAt(++this.eval.iToken):this.viewer.getSelectionSet(!1);this.checkLength(++this.eval.iToken);this.chk||this.viewer.calculateSurface(c,b?3.4028235E38:-1);return}this.eval.errorStr2(53,"CALCULATE","aromatic? hbonds? hydrogen? formalCharge? partialCharge? pointgroup? straightness? structure? struts? surfaceDistance FROM? surfaceDistance WITHIN?")},
$fz.isPrivate=!0,$fz));$_M(c$,"pointGroup",($fz=function(){switch(this.tokAt(0)){case 4102:this.chk||this.showString(this.viewer.calculatePointGroup());return;case 4148:this.chk||this.showString(this.viewer.getPointGroupAsString(!1,null,0,0));return}var a=2,b=1073742138==this.tokAt(a)?"":this.eval.optParameterAsString(a);b.equals("chemicalShift")&&(b="cs");var c=1,d=0;0<b.length&&this.isFloatParameter(++a)&&(d=this.intParameter(a++));1073742138==this.tokAt(a)&&(c=this.floatParameter(++a));this.chk||
this.eval.runScript(this.viewer.getPointGroupAsString(!0,b,d,c))},$fz.isPrivate=!0,$fz));$_M(c$,"mapProperty",($fz=function(){for(var a,b,c,d,e,f=0,g=0,h=0;;){if(1114638363==this.tokAt(1))a=this.viewer.getSelectionSet(!1),b=this.atomExpressionAt(2),c=d="selected";else{a=this.atomExpressionAt(1);if(1048584!=this.tokAt(++this.eval.iToken)||!J.script.T.tokAttr(f=this.tokAt(++this.eval.iToken),1078984704))break;c=this.parameterAsString(this.eval.iToken);b=this.atomExpressionAt(++this.eval.iToken);if(1048584!=
this.tokAt(++this.eval.iToken)||!J.script.T.tokAttr(g=this.tokAt(++this.eval.iToken),2048))break;d=this.parameterAsString(this.eval.iToken)}e=J.script.T.tokAttr(h=this.tokAt(this.eval.iToken+1),1078984704)?this.parameterAsString(++this.eval.iToken):J.script.T.nameOf(h=1095763969);this.eval.checkLast(this.eval.iToken);if(this.chk)return;var j=null;this.showString("mapping "+c.toUpperCase()+" for "+a.cardinality()+" atoms to "+d.toUpperCase()+" for "+b.cardinality()+" atoms using "+e.toUpperCase());
if(J.script.T.tokAttrOr(f,1095761920,1112539136)&&J.script.T.tokAttrOr(g,1095761920,1112539136)&&J.script.T.tokAttrOr(h,1095761920,1112539136)){var m=this.eval.getBitsetPropertyFloat(a,f|224,NaN,NaN),l=this.eval.getBitsetPropertyFloat(a,h|224,NaN,NaN),f=this.eval.getBitsetPropertyFloat(b,h|224,NaN,NaN),n=1716520985==g,r=Clazz.newFloatArray(n?this.viewer.getAtomCount():f.length,0),j=new JU.BS;if(m.length==l.length){for(var z=new java.util.Hashtable,h=0;h<m.length;h++)z.put(Float.$valueOf(l[h]),Float.$valueOf(m[h]));
m=-1;for(h=l=0;h<f.length;h++){var m=b.nextSetBit(m+1),p=z.get(Float.$valueOf(f[h]));null!=p&&(j.set(m),r[n?m:l]=p.floatValue(),l++)}n?this.viewer.setData(d,[d,r,j,Integer.$valueOf(0)],this.viewer.getAtomCount(),0,0,2147483647,0):this.viewer.setAtomProperty(j,g,0,0,null,r,null)}}if(null==j){c=this.getBitsetIdent(a,"{"+e+"=%["+e+"]}."+d+" = %["+c+"]",null,!1,2147483647,!1);a=new JU.SB;for(h=0;h<c.length;h++)0>c[h].indexOf("null")&&a.append(c[h]).appendC("\n");J.util.Logger.debugging&&J.util.Logger.debug(a.toString());
c=J.util.BSUtil.copy(this.viewer.getSelectionSubset());this.viewer.setSelectionSubset(b);try{this.eval.runScript(a.toString())}catch(A){if(Clazz.exceptionOf(A,Exception))b=A,this.viewer.setSelectionSubset(c),this.eval.errorStr(-1,"Error: "+b.toString());else if(Clazz.exceptionOf(A,Error))b=A,this.viewer.setSelectionSubset(c),this.eval.errorStr(-1,"Error: "+b.toString());else throw A;}this.viewer.setSelectionSubset(c)}this.showString("DONE");return}this.invArg()},$fz.isPrivate=!0,$fz));$_M(c$,"minimize",
($fz=function(){for(var a=null,b=2147483647,c=0,d=!1,e=!1,f=null,g=this.viewer.getMinimizer(!1),h=1;h<this.slen;h++)switch(this.getToken(h).tok){case 1073741828:d=!0;continue;case 1073741874:case 1073742162:this.checkLength(2);if(this.chk||null==g)return;g.setProperty(this.parameterAsString(h),null);return;case 1073741882:this.checkLength(2);if(this.chk||null==g)return;g.setProperty("clear",null);return;case 1073741894:1!=h&&this.invArg();b=a=0;c=Clazz.newIntArray(5,0);if(1073741882==this.tokAt(++h))this.checkLength(3);
else{for(;4>a&&!this.isFloatParameter(h);)c[++a]=this.atomExpressionAt(h).nextSetBit(0),h=this.eval.iToken+1;c[0]=a;1==a&&this.invArg();b=this.floatParameter(this.eval.checkLast(h))}this.chk||this.viewer.getMinimizer(!0).setProperty("constraint",[c,Clazz.newIntArray(a,0),Float.$valueOf(b)]);return;case 1073741905:c=this.floatParameter(++h);continue;case 1073741934:b=0;continue;case 1060869:1!=h&&this.invArg();f=this.atomExpressionAt(++h);0>f.nextSetBit(0)&&(f=null);h=this.eval.iToken;this.chk||this.viewer.getMinimizer(!0).setProperty("fixed",
f);if(h+1==this.slen)return;continue;case 135280132:a=this.atomExpressionAt(++h);h=this.eval.iToken;continue;case 1073742148:e=!0;break;case 266298:b=this.intParameter(++h);continue;default:this.invArg()}this.chk||this.viewer.minimize(b,c,a,f,0,d,e,!1)},$fz.isPrivate=!0,$fz));$_M(c$,"modulation",($fz=function(){var a=!1;switch(this.getToken(1).tok){case 1048589:a=!0;case 1048588:this.chk||this.viewer.setModulation(a,null,2147483647,!1);break;case 2:this.chk||this.viewer.setModulation(!0,[this.intParameter(1)],
2147483647,!1);break;case 1074790526:this.chk||this.viewer.setModulationFps(this.floatParameter(2));break;case 1073742096:this.chk||this.viewer.setModulation(!0,[this.intParameter(2)],this.intParameter(3),!1)}},$fz.isPrivate=!0,$fz));$_M(c$,"setContactBitSets",($fz=function(a,b,c,d,e,f){var g,h;null==b?(b=J.util.BSUtil.setAll(this.viewer.getAtomCount()),J.util.BSUtil.andNot(b,this.viewer.getDeletedAtoms()),b.andNot(a),g=!1):(h=J.util.BSUtil.copy(a),h.or(b),h=this.viewer.getModelBitSet(h,!1).cardinality(),
g=1<h,f&&(1<h&&!this.eval.tQuiet)&&this.showString(J.i18n.GT._("Note: More than one model is involved in this contact!")));if(!a.equals(b)){if(f=!c||a.cardinality()<b.cardinality())h=this.viewer.getAtomsWithinRadius(d,a,g,Float.isNaN(d)?e:null),b.and(h);c&&(h=this.viewer.getAtomsWithinRadius(d,b,g,Float.isNaN(d)?e:null),a.and(h),f||(h=this.viewer.getAtomsWithinRadius(d,a,g,Float.isNaN(d)?e:null),b.and(h)),h=J.util.BSUtil.copy(b),h.and(a),h.equals(a)?b.andNot(a):h.equals(b)&&a.andNot(b))}return b},
$fz.isPrivate=!0,$fz),"JU.BS,JU.BS,~B,~N,J.atomdata.RadiusData,~B");$_M(c$,"compare",($fz=function(){var a=!1,b=!1,c=!1,d=!1,e=!1,f=null,g=null,h=null,j=null,m=null,l=null;this.eval.iToken=0;var n=this.isFloatParameter(1)?this.floatParameter(++this.eval.iToken):NaN,r=this.atomExpressionAt(++this.eval.iToken),z=null,p=null;this.eval.isArrayParameter(++this.eval.iToken)?z=this.eval.getPointArray(this.eval.iToken,-1):1141899265!=this.tokAt(this.eval.iToken)&&(p=this.atomExpressionAt(this.eval.iToken));
var A=null,y=!1,s=null,u=J.util.BSUtil.copy(r);null!=p&&u.or(p);for(var u=d=null==z&&null!=p&&u.equals(r),t=this.eval.iToken+1;t<this.slen;++t)switch(this.getToken(t).tok){case 4115:u=!0;break;case 135267336:y=!0;case 135267335:s=this.stringParameter(++t);break;case 1678770178:b=e=!0;s=this.stringParameter(++t);break;case 3:case 2:n=Math.abs(this.floatParameter(t));break;case 269484080:break;case 3158024:A=this.atomExpressionAt(++t);t=this.eval.iToken;break;case 10:case 1048577:null!=l&&this.invArg();
var h=this.atomExpressionAt(this.eval.iToken),G=d?0:this.tokAt(this.eval.iToken+1),j=null==z&&this.eval.isArrayParameter(this.eval.iToken+1)?null:10==G||1048577==G?this.atomExpressionAt(++this.eval.iToken):J.util.BSUtil.copy(h);null!=A&&(h.and(A),null!=j&&j.and(A));null==j?z=this.eval.getPointArray(++this.eval.iToken,-1):j.and(p);null==m&&(m=new JU.List);m.addLast([h,j]);t=this.eval.iToken;break;case 7:null!=m&&this.invArg();a=!0;f=this.getQuaternionArray(this.eval.theToken.getList(),1073742001);
this.getToken(++t);g=this.getQuaternionArray(this.eval.theToken.getList(),1073742001);null==l&&(l=new JU.List);l.addLast([f,g]);break;case 1073742077:a=!0;break;case 135266320:case 1141899265:a=!1;break;case 528432:b=!0;break;case 4160:c=!0;break;default:this.invArg()}if(!this.chk){u&&(n=0);Float.isNaN(n)||0>n?n=1:!b&&!c&&(b=c=!0);d=0!=n;G=!a&&null==s||null!=z;null==m&&null==l&&(null==A?(h=G?this.viewer.getAtomBitSet("spine"):new JU.BS,0>h.nextSetBit(0)?(h=r,j=p):(j=J.util.BSUtil.copy(h),h.and(r),
j.and(p))):(h=J.util.BSUtil.copy(r),j=J.util.BSUtil.copy(p),h.and(A),j.and(A),h.and(r),j.and(p)),m=new JU.List,m.addLast([h,j]));if(u){r=this.viewer.getModelBitSet(r,!1);A=Array(r.cardinality());t=0;for(j=r.nextSetBit(0);0<=j;j=r.nextSetBit(j+1),t++)A[t]=this.viewer.getModelUndeletedAtomsBitSet(j)}else A=[r];for(j=0;j<A.length;j++){for(var r=A[j],D=Clazz.newFloatArray(2,0),w=null,E=new JU.List,F=null,H=u?new JU.List:m,t=0;t<m.size();++t){var L=m.get(t);u&&H.addLast(L=[J.util.BSUtil.copy(L[0]),L[1]]);
L[0].and(r)}var v=null,K=null;if(G){null!=z&&(H.clear(),H.addLast([h,z]));try{F=this.viewer.getCenterAndPoints(H,!0)}catch(P){if(Clazz.exceptionOf(P,Exception))this.invArg();else throw P;}w=J.util.Measure.calculateQuaternionRotation(F,D,!0);t=Float.isNaN(D[1])?NaN:Math.round(100*D[0])/100;D=Float.isNaN(D[1])?NaN:Math.round(100*D[1])/100;this.showString("RMSD "+t+" --\x3e "+D+" Angstroms")}else if(a){if(null==l)for(t=0;t<H.size();t++){L=H.get(t);f=this.viewer.getAtomGroupQuaternions(L[0],2147483647);
g=this.viewer.getAtomGroupQuaternions(L[1],2147483647);for(w=0;w<f.length&&w<g.length;w++)E.addLast(g[w].div(f[w]))}else for(w=0;w<f.length&&w<g.length;w++)E.addLast(g[w].div(f[w]));D[0]=0;f=E.toArray(Array(E.size()));w=J.util.Quaternion.sphereMean(f,D,1E-4);this.showString("RMSD = "+D[0]+" degrees")}else{t=new JU.M4;v=new JU.P3;if(e){var la;if(null==r||null==p||null==(la=this.getFlexFitList(r,p,s)))break;this.viewer.setDihedrals(la,null,1)}D=this.getSmilesCorrelation(r,p,s,null,null,t,null,!y,!1,
null,v);Float.isNaN(D)&&this.invArg();c&&(K=new JU.V3,t.get(K));b&&(w=new JU.M3,t.getRotationScale(w),w=J.util.Quaternion.newM(w));this.showString("RMSD = "+D+" Angstroms")}null!=F&&(v=F[0][0]);null==v&&(F=this.viewer.getCenterAndPoints(H,!0),v=F[0][0]);H=new JU.P3;D=NaN;c&&(null==K&&(K=JU.V3.newVsub(F[1][0],v)),D=0);b&&(null==w&&this.eval.evalError("option not implemented",null),H.setT(v),H.add(w.getNormal()),D=w.getTheta());if(!Float.isNaN(D)&&!Float.isNaN(H.x)&&(F=null,b&&(c&&0!=n)&&(F=this.viewer.getAtomPointVector(r),
t=J.script.ScriptMathProcessor.getMatrix4f(w.getMatrix(),K),F=J.util.Measure.transformPoints(F,t,v)),this.eval.useThreads()||(d=!1),this.viewer.rotateAboutPointsInternal(this.eval,v,H,D/n,D,d,r,K,F,null)&&d&&this.eval.isJS))throw new J.script.ScriptInterruption(this.eval,"compare",1);}}},$fz.isPrivate=!0,$fz));$_M(c$,"configuration",($fz=function(){var a;if(1==this.slen)a=this.viewer.setConformation(),this.viewer.addStateScriptRet("select",null,this.viewer.getSelectionSet(!1),null,"configuration",
!0,!1);else{var b=this.intParameter(this.eval.checkLast(1));if(this.chk)return;a=this.viewer.getConformation(this.viewer.getCurrentModelIndex(),b-1,!0);this.viewer.addStateScript("configuration "+b+";",!0,!1)}this.chk||(this.setShapeProperty(1,"type",Integer.$valueOf(30720)),this.eval.setShapeSizeBs(1,0,a),this.viewer.autoHbond(a,a,!0),this.viewer.select(a,!1,0,this.eval.tQuiet))},$fz.isPrivate=!0,$fz));$_M(c$,"measure",($fz=function(){var a=this.eval,b=null,c=0,d=null;if(2==this.slen)switch(this.tokAt(1)){case 1048588:this.setShapeProperty(6,
"hideAll",Boolean.TRUE);return;case 12291:this.chk||this.viewer.clearAllMeasurements();return}this.viewer.loadShape(6);switch(this.tokAt(1)){case 135267335:var e=this.stringParameter(3==this.slen?2:4);if(this.chk)return;var f=this.viewer.modelSet.atoms,b=this.viewer.getAtomCount(),e=this.viewer.getSmilesMatcher().getCorrelationMaps(e,f,b,this.viewer.getSelectionSet(!1),!0,!1);if(null==e)return;this.setShapeProperty(6,"maps",e);return}switch(this.slen){case 2:switch(this.getToken(1).tok){case 0:case 1048589:this.viewer.loadShape(6);
this.setShapeProperty(6,"hideAll",Boolean.FALSE);return;case 1073742001:this.chk||a.showStringPrint(this.viewer.getMeasurementInfoAsString(),!1);return;case 4:this.setShapeProperty(6,"setFormats",this.stringParameter(1));return}a.errorStr(24,"ON, OFF, DELETE");break;case 3:switch(this.getToken(1).tok){case 12291:if(1048579==this.getToken(2).tok)this.chk||this.viewer.clearAllMeasurements();else{var g=this.intParameter(2)-1;this.chk||this.viewer.deleteMeasurement(g)}return}}for(var h=0,j=0,m=-1,l=-1,
n=-1,r=Clazz.newIntArray(5,0),z=[3.4028235E38,3.4028235E38],p=!1,A=!1,y=!1,s=!0,u=null,t=null,e=269484114,G=f=null,D=new JU.List,w=new JU.BS,E=null,F=null,H=0,L=0,g=1;g<this.slen;++g)switch(this.getToken(g).tok){case 1074790550:1!=g&&this.invArg();b=a.optParameterAsString(++g);continue;case 1073741824:a.errorStr(24,"ALL, ALLCONNECTED, DELETE");break;default:this.error(15);break;case 269484144:135266310!=this.tokAt(g+1)&&this.invArg();g++;y=!0;break;case 135266310:case 1073741834:case 1048579:A=1073741834==
a.theTok;l=-1;p=!0;A&&y&&this.invArg();break;case 1766856708:c=J.util.C.getColix(a.getArgbParam(++g));g=a.iToken;break;case 1073742066:a.isPoint3f(++g)?(d=this.getPoint3f(g,!1),d=[1,d.x,d.y,d.z,0,0,0]):d=a.floatParameterSet(g,7,7);g=a.iToken;break;case 1666189314:case 1073741916:L=Clazz.floatToInt((1666189314==a.theTok?2E3:1E3)*this.floatParameter(++g));null!=b&&0>=L&&(L=-1);break;case 3:null!=u&&this.invArg();s=p=!0;n=(n+1)%2;z[n]=this.floatParameter(g);break;case 12291:269484114!=e&&this.invArg();
e=12291;break;case 4114:var v=this.floatParameter(++g),K=this.parameterAsString(++g),P=this.parameterAsString(++g);this.chk||(G=this.viewer.getFont3D(K,P,v));break;case 2:v=this.intParameter(g);if(p)s=!0,n=(n+1)%2,z[n]=v;else{l=this.viewer.getAtomIndexFromAtomNumber(v);if(!this.chk&&0>l)return;null!=E&&this.invArg();4<(r[0]=++h)&&this.error(2);r[h]=l}break;case 1095761933:m=this.intParameter(++g);break;case 1048588:269484114!=e&&this.invArg();e=1048588;break;case 1048589:269484114!=e&&this.invArg();
e=1048589;break;case 1073742114:s=p=!0;l=-1;break;case 1073741989:case 1073741990:t=Boolean.$valueOf(1073741989==a.theTok);p=!0;y=1073741990==a.theTok;break;case 1649412120:0<=n&&this.invArg();u=a.encodeRadiusParameter(g,!1,!0);u.values=z;g=a.iToken;p=y=!0;t=Boolean.$valueOf(!1);1==H&&(H++,h++,v=J.util.BSUtil.copy(w),J.util.BSUtil.invertInPlace(v,this.viewer.getAtomCount()),v.and(this.viewer.getAtomsWithinRadius(5,w,!1,null)),D.addLast(v));break;case 10:case 1048577:case 1048586:case 8:case 1048583:(10==
a.theTok||1048577==a.theTok)&&H++;0<=l&&this.invArg();a.expressionResult=Boolean.FALSE;E=this.centerParameter(g);if(Clazz.instanceOf(a.expressionResult,JU.BS)&&(E=w=a.expressionResult,!this.chk&&0==w.length()))return;Clazz.instanceOf(E,JU.P3)&&(h=new J.util.Point3fi,h.setT(E),h.modelIndex=m,E=h);4<(h=++j)&&this.error(2);g=a.iToken;D.addLast(E);break;case 4:f=this.stringParameter(g);break;case 1073742164:F=a.checkTicks(g,!1,!0,!0),g=a.iToken,e=1060866}(null!=u&&(0<=n||2!=h)||2>h&&null==b&&(null==F||
1==h))&&this.error(2);null!=f&&0!=f.indexOf(h+":")&&(f=h+":"+f);s&&z[1]<z[0]&&(z[1]=z[0],z[0]=3.4028235E38==z[1]?3.4028235E38:-200);if(!this.chk)if(null!=E||null!=F)null==u&&(u=new J.atomdata.RadiusData(z,0,null,null)),null==E&&(F.id="default"),null!=E&&(null!=f&&269484114==e)&&(e=1060866),a=null,null!=G&&(a=J.api.Interface.getOptionInterface("modelset.Text").newLabel(this.viewer.getGraphicsData(),G,"",c,0,0,0,null)),null!=a&&(a.pymolOffset=d),this.setShapeProperty(6,"measure",this.newMeasurementData(b,
D).set(e,null,u,f,null,F,A,y,t,p,L,c,a));else switch(b=null==b?r:b,e){case 12291:this.setShapeProperty(6,"delete",b);break;case 1048589:this.setShapeProperty(6,"show",b);break;case 1048588:this.setShapeProperty(6,"hide",b);break;default:this.setShapeProperty(6,null==f?"toggle":"toggleOn",b),null!=f&&this.setShapeProperty(6,"setFormats",f)}},$fz.isPrivate=!0,$fz));$_M(c$,"getFlexFitList",($fz=function(a,b,c){var d=JU.ArrayUtil.newInt2(2);this.getSmilesCorrelation(a,b,c,null,null,null,null,!0,!1,d,
null);a=this.viewer.getDihedralMap(d[0]);b=null==a?null:this.viewer.getDihedralMap(d[1]);if(null==b||b.length!=a.length)return null;d=Clazz.newFloatArray(a.length,3,0);c=this.viewer.modelSet.atoms;J.scriptext.ScriptExt.getTorsions(c,b,d,0);J.scriptext.ScriptExt.getTorsions(c,a,d,1);b=Clazz.newFloatArray(6*a.length,0);for(var e=c=0;c<a.length;c++){var f=a[c];b[e++]=f[0];b[e++]=f[1];b[e++]=f[2];b[e++]=f[3];b[e++]=d[c][0];b[e++]=d[c][1]}return b},$fz.isPrivate=!0,$fz),"JU.BS,JU.BS,~S");c$.getTorsions=
$_M(c$,"getTorsions",($fz=function(a,b,c,d){for(var e=b.length;0<=--e;){var f=b[e],f=J.util.Measure.computeTorsion(a[f[0]],a[f[1]],a[f[2]],a[f[3]],!0);1==d&&(180<f-c[e][0]?f-=360:-180>=f-c[e][0]&&(f+=360));c[e][d]=f}},$fz.isPrivate=!0,$fz),"~A,~A,~A,~N");$_M(c$,"getSmilesCorrelation",($fz=function(a,b,c,d,e,f,g,h,j,m,l){var n=null==m?0.1:3.4028235E38;try{null==d&&(d=new JU.List,e=new JU.List);var r=new JU.M4,z=new JU.P3,p=this.viewer.modelSet.atoms,A=this.viewer.getAtomCount(),y=this.viewer.getSmilesMatcher().getCorrelationMaps(c,
p,A,a,h,!0);null==y&&this.eval.evalError(this.viewer.getSmilesMatcher().getLastException(),null);if(0==y.length)return NaN;var s=y[0];for(a=0;a<s.length;a++)d.addLast(p[s[a]]);y=this.viewer.getSmilesMatcher().getCorrelationMaps(c,p,A,b,h,!1);null==y&&this.eval.evalError(this.viewer.getSmilesMatcher().getLastException(),null);if(0==y.length)return NaN;if(j){for(a=0;a<y.length;a++)for(var u=0;u<y[a].length;u++)e.addLast(p[y[a][u]]);return 0}b=3.4028235E38;c=null;for(a=0;a<y.length;a++){e.clear();for(u=
0;u<y[a].length;u++)e.addLast(p[y[a][u]]);var t=J.util.Measure.getTransformMatrix4(d,e,r,z);J.util.Logger.info("getSmilesCorrelation stddev="+t);if(null!=g&&t<n){for(var G=new JU.BS,u=0;u<y[a].length;u++)G.set(y[a][u]);g.addLast(G)}t<b&&(c=y[a],null!=f&&f.setM(r),null!=l&&l.setT(z),b=t)}null!=m&&(m[0]=s,m[1]=c);e.clear();for(a=0;a<c.length;a++)e.addLast(p[c[a]]);return b}catch(D){if(Clazz.exceptionOf(D,Exception))return this.eval.evalError(D.toString(),null),0;throw D;}},$fz.isPrivate=!0,$fz),"JU.BS,JU.BS,~S,JU.List,JU.List,JU.M4,JU.List,~B,~B,~A,JU.P3");
Clazz.overrideMethod(c$,"getSmilesMatches",function(a,b,c,d,e,f){if(this.chk)return f?new JU.BS:["({})"];if(0==a.length){var g=this.viewer.getSmiles(0,0,c,!f,!1,!0,!0);null==g&&this.eval.evalError(this.viewer.getSmilesMatcher().getLastException(),null);return g}g=!0;if(null==d){if(a=(g=null==b)?this.viewer.getSmilesMatcher().getSubstructureSetArray(a,this.viewer.modelSet.atoms,this.viewer.getAtomCount(),c,null,e,!1):this.viewer.getSmilesMatcher().find(a,b,e,!1),null==a)return this.eval.showStringPrint(this.viewer.getSmilesMatcher().getLastException(),
!1),!g&&!e?Integer.$valueOf(-1):"?"}else{b=new JU.List;a=this.getSmilesCorrelation(d,c,a,null,null,null,b,e,!1,null,null);if(Float.isNaN(a))return f?new JU.BS:[];this.showString("RMSD "+a+" Angstroms");a=b.toArray(Array(b.size()))}if(f){f=new JU.BS;for(c=0;c<a.length;c++)f.or(a[c]);if(g)return f;if(!e)return Integer.$valueOf(f.cardinality());g=Clazz.newIntArray(f.cardinality(),0);e=0;for(a=f.nextSetBit(0);0<=a;a=f.nextSetBit(a+1))g[e++]=a+1;return g}e=Array(a.length);for(c=0;c<a.length;c++)e[c]=g?
J.util.Escape.eBS(a[c]):J.util.Escape.eBond(a[c]);return e},"~S,~S,JU.BS,JU.BS,~B,~B");Clazz.overrideMethod(c$,"evaluate",function(a,b,c,d){this.mp=a;switch(d){case 135266826:case 135266819:case 135266821:case 135266318:case 135266820:case 135266822:return this.evaluateMath(c,d);case 1276118017:case 1276117504:case 1276117507:case 1276117509:return this.evaluateList(b.intValue,c);case 135266306:case 269484096:return this.evaluateArray(c,269484096==d);case 135266307:case 135270417:return this.evaluateQuaternion(c,
d);case 1276118529:return this.evaluateBin(c);case 1276117512:case 1276117513:return this.evaluateRowCol(c,d);case 1766856708:return this.evaluateColor(c);case 135270405:return this.evaluateCompare(c);case 135266310:return this.evaluateConnected(c);case 135267329:return this.evaluateCross(c);case 135270407:return this.evaluateData(c);case 1276118018:case 1276117505:if(269484241==b.tok)return this.evaluateDot(c,d,b.intValue);case 135266305:case 1746538509:return this.evaluateMeasure(c,b.tok);case 1229984263:case 135271426:return this.evaluateLoad(c,
d);case 1276118531:return this.evaluateFind(c);case 135368713:return this.evaluateUserFunction(b.value,c,b.intValue,269484241==b.tok);case 1288701960:case 1826248715:return this.evaluateLabel(b.intValue,c);case 135270410:return this.evaluateGetProperty(c);case 137363468:return this.evaluateHelix(c);case 135267841:case 135266319:case 135267842:return this.evaluatePlane(c,d);case 135287308:case 135271429:return this.evaluateScript(c,d);case 1276117506:case 1276117508:case 1276117510:return this.evaluateString(b.intValue,
c);case 135266320:return this.evaluatePoint(c);case 135304707:return this.evaluatePrompt(c);case 135267332:return this.evaluateRandom(c);case 1276118019:return this.evaluateReplace(c);case 135267335:case 135267336:case 1238369286:return this.evaluateSubstructure(c,d);case 135270422:return this.evaluateCache(c);case 1276117010:case 1276117011:return this.evaluateSort(c,d);case 1297090050:return this.evaluateSymop(c,269484241==b.tok);case 1276117015:return this.evaluateTensor(c);case 135266324:return this.evaluateWithin(c);
case 135402505:return this.evaluateContact(c);case 135270421:return this.evaluateWrite(c)}return!1},"J.script.ScriptMathProcessor,J.script.T,~A,~N");$_M(c$,"evaluateTensor",($fz=function(a){if(2<a.length)return!1;var b=J.script.SV.getBitSet(this.mp.getX(),!1),c=0==a.length?null:J.script.SV.sValue(a[0]).toLowerCase(),d=this.viewer.getNMRCalculation();if("unique".equals(c))return this.mp.addXBs(d.getUniqueTensorSet(b));a=2>a.length?null:J.script.SV.sValue(a[1]).toLowerCase();return this.mp.addXList(d.getTensorInfo(c,
a,b))},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateCache",($fz=function(a){return 0<a.length?!1:this.mp.addXMap(this.viewer.cacheList())},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateCompare",($fz=function(a){if(2>a.length||5<a.length)return!1;var b;b=J.script.SV.sValue(a[a.length-1]);var c=b.equalsIgnoreCase("stddev"),d=b.equalsIgnoreCase("ISOMER"),e=b.equalsIgnoreCase("BONDS"),f=e||!d&&a.length>(c?3:2),g=10==a[0].tok?a[0].value:null,h=10==a[1].tok?a[1].value:null,j=null==g?J.script.SV.sValue(a[0]):
"",m=null==h?J.script.SV.sValue(a[1]):"",l=new JU.M4;b=NaN;if(f&&(null==g||null==h))return!1;if(e){if(4!=a.length)return!1;j=J.script.SV.sValue(a[2]);h=this.getFlexFitList(g,h,j);return null==h?this.mp.addXStr(""):this.mp.addXAF(h)}if(d){if(3!=a.length)return!1;if(null==g&&null==h)return this.mp.addXStr(this.viewer.getSmilesMatcher().getRelationship(j,m).toUpperCase());a=null==g?this.viewer.getSmilesMatcher().getMolecularFormula(j,!1):J.util.JmolMolecule.getMolecularFormula(this.viewer.getModelSet().atoms,
g,!1);c=null==h?this.viewer.getSmilesMatcher().getMolecularFormula(m,!1):J.util.JmolMolecule.getMolecularFormula(this.viewer.getModelSet().atoms,h,!1);if(!a.equals(c))return this.mp.addXStr("NONE");null!=g&&(j=this.getSmilesMatches("",null,g,null,!1,!0));a=null==h?0<this.viewer.getSmilesMatcher().areEqual(m,j):0<=this.getSmilesMatches(j,null,h,null,!1,!0).nextSetBit(0);if(!a){g=j+m;if(0<=g.indexOf("/")||0<=g.indexOf("\\")||0<=g.indexOf("@")){if(0<=j.indexOf("@")&&(null!=h||0<=m.indexOf("@")))if(j=
this.viewer.getSmilesMatcher().reverseChirality(j),a=null==h?0<this.viewer.getSmilesMatcher().areEqual(j,m):0<=this.getSmilesMatches(j,null,h,null,!1,!0).nextSetBit(0))return this.mp.addXStr("ENANTIOMERS");null==h?a=0<this.viewer.getSmilesMatcher().areEqual("/nostereo/"+m,j):(h=this.getSmilesMatches("/nostereo/"+j,null,h,null,!1,!0),a=0<=h.nextSetBit(0));if(a)return this.mp.addXStr("DIASTERIOMERS")}return this.mp.addXStr("CONSTITUTIONAL ISOMERS")}if(null==g||null==h)return this.mp.addXStr("IDENTICAL");
b=this.getSmilesCorrelation(g,h,j,null,null,null,null,!1,!1,null,null);return this.mp.addXStr(0.2>b?"IDENTICAL":"IDENTICAL or CONFORMATIONAL ISOMERS (RMSD="+b+")")}if(f){j=new JU.List;m=new JU.List;b=J.script.SV.sValue(a[2]);d=b.equalsIgnoreCase("MAP");f=b.equalsIgnoreCase("SMILES");e=d||b.equalsIgnoreCase("SMARTS");if(f||e)b=3<a.length?J.script.SV.sValue(a[3]):null;if(null==b)return!1;b=this.getSmilesCorrelation(g,h,b,j,m,l,null,!f,d,null,null);if(d){g=j.size();if(0==g)return this.mp.addXStr("");
a=Clazz.doubleToInt(m.size()/g);h=new JU.List;for(f=c=0;c<a;c++){l=JU.ArrayUtil.newInt2(g);h.addLast(l);for(b=0;b<g;b++,f++)l[b]=[j.get(b).index,m.get(f).index]}return this.mp.addXList(h)}}else j=this.eval.getPointVector(a[0],0),m=this.eval.getPointVector(a[1],0),null!=j&&null!=m&&(b=J.util.Measure.getTransformMatrix4(j,m,l,null));return c||Float.isNaN(b)?this.mp.addXFloat(b):this.mp.addXM4(l)},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateContact",($fz=function(a){if(1>a.length||3<a.length)return!1;
var b=0,c=100;switch(a[0].tok){case 3:case 2:c=J.script.SV.fValue(a[b++]);break;case 10:break;default:return!1}if(b==a.length||!Clazz.instanceOf(a[b].value,JU.BS))return!1;var d=J.util.BSUtil.copy(J.script.SV.bsSelectVar(a[b++]));if(this.chk)return this.mp.addXBs(new JU.BS);a=b<a.length?J.util.BSUtil.copy(J.script.SV.bsSelectVar(a[b])):null;c=new J.atomdata.RadiusData(null,10<c?c/100:c,10<c?J.atomdata.RadiusData.EnumType.FACTOR:J.atomdata.RadiusData.EnumType.OFFSET,J.constant.EnumVdw.AUTO);a=this.setContactBitSets(d,
a,!0,NaN,c,!1);a.or(d);return this.mp.addXBs(a)},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateSort",($fz=function(a,b){if(1<a.length)return!1;if(1276117010==b){var c=0==a.length?0:a[0].asInt();return this.mp.addXVar(this.mp.getX().sortOrReverse(c))}var d=this.mp.getX(),e=0==a.length?null:a[0];if(4==d.tok){var c=0,f=J.script.SV.sValue(d);if(null==e)return this.mp.addXInt(0);e=J.script.SV.sValue(e);for(d=0;d<f.length;d++){d=f.indexOf(e,d);if(0>d)break;c++}return this.mp.addXInt(c)}var c=new JU.List,
g=f=null,h=J.script.SV.getVariable(d.value).sortOrReverse(0).getList();if(null==h)return null==e?this.mp.addXStr(""):this.mp.addXInt(0);for(var d=0,j=h.size();d<=j;d++){var m=d==j?null:h.get(d);if(!(null!=e&&null!=m&&!J.script.SV.areEqual(m,e)))if(J.script.SV.areEqual(m,f))g.intValue++;else{if(null!=f){var l=new JU.List;l.addLast(f);l.addLast(g);c.addLast(J.script.SV.getVariableList(l))}g=J.script.SV.newScriptVariableInt(1);f=m}}return null==e?this.mp.addXVar(J.script.SV.getVariableList(c)):c.isEmpty()?
this.mp.addXInt(0):this.mp.addXVar(c.get(0).getList().get(1))},$fz.isPrivate=!0,$fz),"~A,~N");$_M(c$,"evaluateSymop",($fz=function(a,b){if(0==a.length)return!1;var c=b?this.mp.getX():null;if(null!=c&&10!=c.tok)return!1;var c=null!=c?c.value:2<a.length&&10==a[1].tok?a[1].value:this.viewer.getModelUndeletedAtomsBitSet(-1),d;switch(a[0].tok){case 4:d=J.script.SV.sValue(a[0]);break;case 12:d=a[0].escape();break;default:d=null}var e=null==d?a[0].asInt():0,f=1<a.length?this.mp.ptValue(a[1],!0):null;if(2==
a.length&&!Float.isNaN(f.x))return this.mp.addXObj(this.viewer.getSymmetryInfo(c,d,e,f,null,null,135266320));var g=(1==a.length?"":J.script.SV.sValue(a[a.length-1])).toLowerCase(),h=135176;1==a.length||g.equalsIgnoreCase("matrix")?h=12:g.equalsIgnoreCase("array")||g.equalsIgnoreCase("list")?h=1073742001:g.equalsIgnoreCase("description")?h=1826248715:g.equalsIgnoreCase("xyz")?h=1073741982:g.equalsIgnoreCase("translation")?h=1073742178:g.equalsIgnoreCase("axis")?h=1073741854:g.equalsIgnoreCase("plane")?
h=135266319:g.equalsIgnoreCase("angle")?h=135266305:g.equalsIgnoreCase("axispoint")?h=135266320:g.equalsIgnoreCase("center")&&(h=12289);return this.mp.addXObj(this.viewer.getSymmetryInfo(c,d,e,f,null,g,h))},$fz.isPrivate=!0,$fz),"~A,~B");$_M(c$,"evaluateBin",($fz=function(a){if(3!=a.length)return!1;var b=this.mp.getX(),c=13==b.tok;if(!c&&7!=b.tok)return this.mp.addXVar(b);var d=J.script.SV.fValue(a[0]),e=J.script.SV.fValue(a[1]);a=J.script.SV.fValue(a[2]);if(c)b=b.value;else for(var f=b.getList(),
b=Clazz.newFloatArray(f.size(),0),c=f.size();0<=--c;)b[c]=J.script.SV.fValue(f.get(c));for(var e=Clazz.doubleToInt(Math.floor((e-d)/a+0.01)),f=Clazz.newIntArray(e,0),g=b.length,c=0;c<g;c++){var h=Clazz.doubleToInt(Math.floor((b[c]-d)/a));0>h?h=0:h>=e&&(h=e-1);f[h]++}return this.mp.addXAI(f)},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateHelix",($fz=function(a){if(1>a.length||5<a.length)return!1;var b=2<a.length?3:1,c=b>=a.length?"array":J.script.SV.sValue(a[b]),b=J.script.T.getTokFromName(c);if(2<a.length){var d=
this.mp.ptValue(a[0],!0),e=this.mp.ptValue(a[1],!0);if(9!=a[2].tok)return!1;a=J.util.Quaternion.newP4(a[2].value);switch(b){case 0:break;case 135266320:case 1073741854:case 1666189314:case 135266305:case 1746538509:return this.mp.addXObj(J.util.Measure.computeHelicalAxis(null,b,d,e,a));case 135266306:b=J.util.Measure.computeHelicalAxis(null,1073742001,d,e,a);if(null==b)break;return this.mp.addXAS(b);default:return this.mp.addXObj(J.util.Measure.computeHelicalAxis(c,135176,d,e,a))}}else switch(a=Clazz.instanceOf(a[0].value,
JU.BS)?a[0].value:this.eval.compareInt(1095761937,269484436,a[0].asInt()),b){case 135266320:return this.mp.addXObj(this.viewer.getHelixData(a,135266320));case 1073741854:return this.mp.addXObj(this.viewer.getHelixData(a,1073741854));case 1666189314:return this.mp.addXObj(this.viewer.getHelixData(a,1666189314));case 135266305:return this.mp.addXFloat(this.viewer.getHelixData(a,135266305).floatValue());case 135176:case 1746538509:return this.mp.addXObj(this.viewer.getHelixData(a,b));case 135266306:b=
this.viewer.getHelixData(a,1073742001);if(null==b)break;return this.mp.addXAS(b)}return!1},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateDot",($fz=function(a,b,c){if(1!=a.length)return!1;var d=this.mp.getX(),e=a[0];a=7==e.tok?null:this.mp.ptValue(e,!1);var f=this.mp.planeValue(e);if(1276118018==b){var g=c&480;switch(d.tok){case 10:switch(e.tok){case 10:b=J.script.SV.bsSelectVar(d);if(32==g||64==g){for(var e=J.script.SV.bsSelectVar(e),g=Clazz.newFloatArray(b.cardinality(),0),h=this.viewer.modelSet.atoms,
j=b.nextSetBit(0);0<=j;j=b.nextSetBit(j+1))a=h[j],g[j]=this.eval.getBitsetProperty(e,c,a,f,d.value,null,!1,d.index,!1).floatValue();return this.mp.addXAF(g)}return this.mp.addXObj(this.eval.getBitsetProperty(b,c,a,f,d.value,null,!1,d.index,!1))}}}return this.mp.addXFloat(this.getDistance(d,e,b))},$fz.isPrivate=!0,$fz),"~A,~N,~N");$_M(c$,"getDistance",($fz=function(a,b,c){var d=this.mp.ptValue(a,!0);a=this.mp.planeValue(a);var e=this.mp.ptValue(b,!0);b=this.mp.planeValue(b);if(1276117505==c){if(null!=
a&&null!=b)return a.x*b.x+a.y*b.y+a.z*b.z+a.w*b.w;null!=a&&(d=JU.P3.new3(a.x,a.y,a.z));null!=b&&(e=JU.P3.new3(b.x,b.y,b.z));return d.x*e.x+d.y*e.y+d.z*e.z}return null==a?null==b?e.distance(d):J.util.Measure.distanceToPlane(b,d):J.util.Measure.distanceToPlane(a,e)},$fz.isPrivate=!0,$fz),"J.script.SV,J.script.SV,~N");$_M(c$,"evaluateMeasure",($fz=function(a,b){var c=0;switch(b){case 1746538509:for(var d=new JU.List,e=[3.4028235E38,3.4028235E38],f=null,g=null,h=!1,j=!1,m=0,l=!1,n=null,r=0,z=3.4028235E38,
p=!1,A=!1,n=0;n<a.length;n++)switch(a[n].tok){case 10:var y=a[n].value;0==y.length()&&(l=!0);d.addLast(y);c++;r++;break;case 8:y=new J.util.Point3fi;y.setT(a[n].value);d.addLast(y);c++;break;case 2:case 3:e[m++%2]=J.script.SV.fValue(a[n]);break;case 4:y=J.script.SV.sValue(a[n]);y.equalsIgnoreCase("vdw")||y.equalsIgnoreCase("vanderwaals")?z=(n+1<a.length&&2==a[n+1].tok?a[++n].asInt():100)/100:y.equalsIgnoreCase("notConnected")?j=!0:y.equalsIgnoreCase("connected")?h=!0:y.equalsIgnoreCase("minArray")?
p=1<=r:y.equalsIgnoreCase("asArray")?A=1<=r:J.util.Parser.isOneOf(y.toLowerCase(),";nm;nanometers;pm;picometers;angstroms;ang;au;")||y.endsWith("hz")?g=y.toLowerCase():f=c+":"+y;break;default:return!1}if(2>c||4<c||2<m||j&&h)return!1;if(l||3.4028235E38!=z&&(2!=r||2!=c))return this.mp.addXStr("");n=3.4028235E38==z?new J.atomdata.RadiusData(e,0,null,null):new J.atomdata.RadiusData(null,z,J.atomdata.RadiusData.EnumType.FACTOR,J.constant.EnumVdw.AUTO);return this.mp.addXObj(this.newMeasurementData(null,
d).set(0,null,n,f,g,null,h,j,null,!0,0,0,null).getMeasurements(A,p));case 135266305:if(3!=(c=a.length)&&4!=c)return!1;break;default:if(2!=(c=a.length))return!1}d=Array(c);for(n=0;n<c;n++)d[n]=this.mp.ptValue(a[n],!0);switch(c){case 2:return this.mp.addXFloat(d[0].distance(d[1]));case 3:return this.mp.addXFloat(J.util.Measure.computeAngleABC(d[0],d[1],d[2],!0));case 4:return this.mp.addXFloat(J.util.Measure.computeTorsion(d[0],d[1],d[2],d[3],!0))}return!1},$fz.isPrivate=!0,$fz),"~A,~N");$_M(c$,"newMeasurementData",
($fz=function(a,b){return J.api.Interface.getOptionInterface("modelset.MeasurementData").init(a,this.viewer,b)},$fz.isPrivate=!0,$fz),"~S,JU.List");$_M(c$,"evaluateUserFunction",($fz=function(a,b,c,d){var e=null;if(d&&(e=this.mp.getX(),10!=e.tok))return!1;this.mp.wasX=!1;for(var f=new JU.List,g=0;g<b.length;g++)f.addLast(b[g]);if(d)return this.mp.addXObj(this.eval.getBitsetProperty(J.script.SV.bsSelectVar(e),c,null,null,e.value,[a,f],!1,e.index,!1));a=this.eval.runFunctionRet(null,a,f,null,!0,!0,
!1);return null==a?!1:this.mp.addXVar(a)},$fz.isPrivate=!0,$fz),"~S,~A,~N,~B");$_M(c$,"evaluateFind",($fz=function(a){if(0==a.length)return!1;var b=this.mp.getX(),c=J.script.SV.sValue(a[0]),d=1<a.length&&1048589!=a[1].tok&&1048588!=a[1].tok?J.script.SV.sValue(a[1]):"",e=c.equalsIgnoreCase("SEQUENCE"),f=c.equalsIgnoreCase("SMILES"),g=c.equalsIgnoreCase("SMARTS"),h=c.equalsIgnoreCase("MF");if(f||g||10==b.tok){var j=f||g?2:1,j=j<a.length&&10==a[j].tok?a[j++].value:null,m="bonds".equalsIgnoreCase(J.script.SV.sValue(a[a.length-
1]));a=m||1048589==a[a.length-1].tok;var l=null;switch(b.tok){case 4:c=J.script.SV.sValue(b);if(null!=j)return!1;d.equalsIgnoreCase("mf")?(l=this.viewer.getSmilesMatcher().getMolecularFormula(c,g),null==l&&this.eval.evalError(this.viewer.getSmilesMatcher().getLastException(),null)):l=this.getSmilesMatches(d,c,null,null,g,!a);break;case 10:if(h)return this.mp.addXStr(J.util.JmolMolecule.getMolecularFormula(this.viewer.getModelSet().atoms,b.value,!1));if(e)return this.mp.addXStr(this.viewer.getSmiles(-1,
-1,b.value,!0,a,a,!1));if(f||g)c=d;m?(c=this.viewer.getSmilesMatcher().getCorrelationMaps(c,this.viewer.modelSet.atoms,this.viewer.getAtomCount(),b.value,!f,!0),l=0<c.length?this.viewer.getDihedralMap(c[0]):Clazz.newIntArray(0,0)):l=this.getSmilesMatches(c,null,b.value,j,!f,!a)}null==l&&this.eval.error(22);return this.mp.addXObj(l)}g=0<=d.indexOf("v");f=0<=d.indexOf("i");d=0<=d.indexOf("m");e=7==b.tok;a=2==a.length;if(e||a){h=this.getPatternMatcher();a=null;try{a=h.compile(c,f)}catch(n){if(Clazz.exceptionOf(n,
Exception))this.eval.evalError(n.toString(),null);else throw n;}b=J.script.SV.listValue(b);J.util.Logger.debugging&&J.util.Logger.debug("finding "+c);c=new JU.BS;f=m=0;l=null;h=d?new JU.List:null;for(j=0;j<b.length;j++){var r=b[j],l=a.matcher(r),z=l.find();if(d&&z||!d&&z==!g)f++,m=j,c.set(j),d&&h.addLast(g?r.substring(0,l.start())+r.substring(l.end()):l.group())}if(!e)return d?this.mp.addXStr(1==h.size()?h.get(0):""):g?this.mp.addXBool(1==f):d?this.mp.addXStr(0==f?"":l.group()):this.mp.addXInt(0==
f?0:l.start()+1);if(1==f)return this.mp.addXStr(d?h.get(0):b[m]);g=Array(f);if(0<f)for(j=b.length;0<=--j;)c.get(j)&&(--f,g[f]=d?h.get(f):b[j]);return this.mp.addXAS(g)}return this.mp.addXInt(J.script.SV.sValue(b).indexOf(c)+1)},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"getPatternMatcher",($fz=function(){return null==this.pm?this.pm=J.api.Interface.getOptionInterface("util.PatternMatcher"):this.pm},$fz.isPrivate=!0,$fz));$_M(c$,"evaluateGetProperty",($fz=function(a){var b=0,c=a.length>b?J.script.SV.sValue(a[b++]).toLowerCase():
"";c.startsWith("$");var d="";if(c.equalsIgnoreCase("fileContents")&&2<a.length){b=J.script.SV.sValue(a[1]);for(d=2;d<a.length;d++)b+="|"+J.script.SV.sValue(a[d]);d=b;b=a.length}else if(a.length>b)switch(a[b].tok){case 10:d=J.script.SV.bsSelectVar(a[b++]);c.equalsIgnoreCase("bondInfo")&&(a.length>b&&10==a[b].tok)&&(d=[d,J.script.SV.bsSelectVar(a[b])]);break;case 4:this.viewer.checkPropertyParameter(c)&&(d=a[b++].value)}d=this.viewer.getProperty(null,c,d);b<a.length&&(d=this.viewer.extractProperty(d,
a,b));return this.mp.addXObj(J.script.SV.isVariableType(d)?d:J.util.Escape.toReadable(c,d))},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluatePlane",($fz=function(a,b){if(135267841==b&&3!=a.length||135267842==b&&2!=a.length&&3!=a.length||0==a.length||4<a.length)return!1;var c,d,e,f,g,h;switch(a.length){case 1:if(10==a[0].tok&&(g=J.script.SV.getBitSet(a[0],!1),3==g.cardinality())){g=this.viewer.getAtomPointVector(g);d=new JU.V3;h=new JU.V3;var j=new JU.V3;f=new JU.P4;J.util.Measure.getPlaneThroughPoints(g.get(0),
g.get(1),g.get(2),d,h,j,f);return this.mp.addXPt4(f)}g=J.util.Escape.uP(J.script.SV.sValue(a[0]));return Clazz.instanceOf(g,JU.P4)?this.mp.addXPt4(g):this.mp.addXStr(""+g);case 2:if(135267842==b){if(9!=a[1].tok)return!1;e=new JU.P3;g=new JU.V3;h=new JU.V3;f=a[1].value;if(9==a[0].tok)return g=J.util.Measure.getIntersectionPP(a[0].value,f),null==g?this.mp.addXStr(""):this.mp.addXList(g);d=this.mp.ptValue(a[0],!1);return null==d?this.mp.addXStr(""):this.mp.addXPt(J.util.Measure.getIntersection(d,null,
f,e,g,h))}case 3:case 4:switch(b){case 135267841:return this.mp.addXPt4(this.eval.getHklPlane(JU.P3.new3(J.script.SV.fValue(a[0]),J.script.SV.fValue(a[1]),J.script.SV.fValue(a[2]))));case 135267842:c=this.mp.ptValue(a[0],!1);d=this.mp.ptValue(a[1],!1);if(null==c||null==d)return this.mp.addXStr("");d=JU.V3.newV(d);d.normalize();if(9==a[2].tok)return e=new JU.P3,g=new JU.V3,h=new JU.V3,c=J.util.Measure.getIntersection(c,d,a[2].value,e,g,h),null==c?this.mp.addXStr(""):this.mp.addXPt(c);e=this.mp.ptValue(a[2],
!1);if(null==e)return this.mp.addXStr("");g=new JU.V3;J.util.Measure.projectOntoAxis(e,c,d,g);return this.mp.addXPt(e)}switch(a[0].tok){case 2:case 3:if(3==a.length)return c=J.script.SV.fValue(a[0]),e=J.script.SV.fValue(a[1]),f=J.script.SV.fValue(a[2]),g=JU.V3.new3(0,0,1),d=JU.P3.new3(0,1,0),f=J.util.Quaternion.newVA(d,f),f.getMatrix().transform(g),d.set(0,0,1),f=J.util.Quaternion.newVA(d,e),f.getMatrix().transform(g),d.setT(g),d.scale(c),f=new JU.P4,J.util.Measure.getPlaneThroughPoint(d,g,f),this.mp.addXPt4(f);
break;case 10:case 8:c=this.mp.ptValue(a[0],!1);d=this.mp.ptValue(a[1],!1);if(null==d)return!1;e=2<a.length&&(10==a[2].tok||8==a[2].tok)?this.mp.ptValue(a[2],!1):null;g=JU.V3.newV(d);if(null==e)return f=new JU.P4,2==a.length||!a[2].asBoolean()?(e=JU.P3.newP(c),e.add(d),e.scale(0.5),g.sub(c),g.normalize()):e=c,J.util.Measure.getPlaneThroughPoint(e,g,f),this.mp.addXPt4(f);h=new JU.V3;j=new JU.V3;d=J.util.Measure.getDirectedNormalThroughPoints(c,d,e,4==a.length?this.mp.ptValue(a[3],!0):null,g,h,j);return this.mp.addXPt4(JU.P4.new4(g.x,
g.y,g.z,d))}}if(4!=a.length)return!1;g=J.script.SV.fValue(a[0]);d=J.script.SV.fValue(a[1]);c=J.script.SV.fValue(a[2]);e=J.script.SV.fValue(a[3]);return this.mp.addXPt4(JU.P4.new4(g,d,c,e))},$fz.isPrivate=!0,$fz),"~A,~N");$_M(c$,"evaluatePoint",($fz=function(a){if(1!=a.length&&3!=a.length&&4!=a.length)return!1;switch(a.length){case 1:if(3==a[0].tok||2==a[0].tok)return this.mp.addXInt(a[0].asInt());var b=J.script.SV.sValue(a[0]);7==a[0].tok&&(b="{"+b+"}");a=J.util.Escape.uP(b);return Clazz.instanceOf(a,
JU.P3)?this.mp.addXPt(a):this.mp.addXStr(""+a);case 3:return this.mp.addXPt(JU.P3.new3(a[0].asFloat(),a[1].asFloat(),a[2].asFloat()));case 4:return this.mp.addXPt4(JU.P4.new4(a[0].asFloat(),a[1].asFloat(),a[2].asFloat(),a[3].asFloat()))}return!1},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluatePrompt",($fz=function(a){if(1!=a.length&&2!=a.length&&3!=a.length)return!1;var b=J.script.SV.sValue(a[0]),c=1<a.length&&7==a[1].tok?J.script.SV.listValue(a[1]):null,d=null!=c||1==a.length||3==a.length&&a[2].asBoolean();
a=null!=c?null:2<=a.length?J.script.SV.sValue(a[1]):"OK";b=""+this.viewer.prompt(b,a,c,d);return d&&null!=c?this.mp.addXInt(Integer.parseInt(b)+1):this.mp.addXStr(b)},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateReplace",($fz=function(a){if(2!=a.length)return!1;var b=this.mp.getX(),c=J.script.SV.sValue(a[0]);a=J.script.SV.sValue(a[1]);var d=7==b.tok?null:J.script.SV.sValue(b);if(null!=d)return this.mp.addXStr(J.util.Txt.simpleReplace(d,c,a));b=J.script.SV.listValue(b);for(d=b.length;0<=--d;)b[d]=J.util.Txt.simpleReplace(b[d],
c,a);return this.mp.addXAS(b)},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateString",($fz=function(a,b){if(1<b.length)return!1;var c=this.mp.getX(),d=1276117508==a&&10==c.tok||1276117510==a&&7==c.tok?null:J.script.SV.sValue(c),e=1==b.length?J.script.SV.sValue(b[0]):1276117510==a?"":"\n";switch(a){case 1276117508:if(10==c.tok)for(var f=J.script.SV.bsSelectVar(c),e="\n",g=this.viewer.getModelCount(),d="",c=0;c<g;c++){var d=d+(0==c?"":"\n"),h=this.viewer.getModelUndeletedAtomsBitSet(c);h.and(f);d+=J.util.Escape.eBS(h)}return this.mp.addXAS(J.util.Txt.split(d,
e));case 1276117506:return 0<d.length&&"\n"==d.charAt(d.length-1)&&(d=d.substring(0,d.length-1)),this.mp.addXStr(J.util.Txt.simpleReplace(d,"\n",e));case 1276117510:if(null!=d)return this.mp.addXStr(J.util.Txt.trim(d,e));d=J.script.SV.listValue(c);for(c=d.length;0<=--c;)d[c]=J.util.Txt.trim(d[c],e);return this.mp.addXAS(d)}return this.mp.addXStr("")},$fz.isPrivate=!0,$fz),"~N,~A");$_M(c$,"evaluateList",($fz=function(a,b){if(1!=b.length&&!(1276118017==a&&(0==b.length||2==b.length)))return!1;var c=
this.mp.getX(),d,e,f=null,g=null;d=null;if(2==b.length){e=4==b[0].tok?0:1;var h=J.script.SV.sValue(b[e]),f=7==c.tok?J.script.SV.listValue(c):J.util.Txt.split(J.script.SV.sValue(c),"\n");d=b[1-e];g=7==d.tok?J.script.SV.listValue(d):J.util.Txt.split(J.script.SV.sValue(d),"\n");d=Array(e=Math.max(f.length,g.length));for(var j=0;j<e;j++)d[j]=(j>=f.length?"":f[j])+h+(j>=g.length?"":g[j]);return this.mp.addXAS(d)}d=0==b.length?J.script.SV.newVariable(1048579,"all"):b[0];j=1048579==d.tok;if(7!=c.tok&&4!=
c.tok){this.mp.wasX=!1;this.mp.addOp(J.script.T.tokenLeftParen);this.mp.addXVar(c);switch(a){case 1276118017:this.mp.addOp(J.script.T.tokenPlus);break;case 1276117509:this.mp.addOp(J.script.T.tokenMinus);break;case 1276117507:this.mp.addOp(J.script.T.tokenTimes);break;case 1276117504:this.mp.addOp(J.script.T.tokenDivide)}this.mp.addXVar(d);return this.mp.addOp(J.script.T.tokenRightParen)}var m=7!=d.tok&&0>J.script.SV.sValue(d).indexOf("\n"),l=h=null,n=c.getList(),r=d.getList();7==c.tok?e=n.size():
(f=J.util.Txt.split(c.value,"\n"),h=Clazz.newFloatArray(e=f.length,0),JU.ParserJS.parseFloatArrayData(f,h));if(j){f=0;if(7==c.tok)for(j=e;0<=--j;)f+=J.script.SV.fValue(n.get(j));else for(j=e;0<=--j;)f+=h[j];return this.mp.addXFloat(f)}var z=null;m?z=d:7==d.tok?e=Math.min(e,r.size()):(g=J.util.Txt.split(d.value,"\n"),l=Clazz.newFloatArray(g.length,0),JU.ParserJS.parseFloatArrayData(g,l),e=Math.min(h.length,l.length));var p=null;switch(a){case 1276118017:p=J.script.T.tokenPlus;break;case 1276117509:p=
J.script.T.tokenMinus;break;case 1276117507:p=J.script.T.tokenTimes;break;case 1276117504:p=J.script.T.tokenDivide}for(var A=Array(e),j=0;j<e;j++)if(7==c.tok?this.mp.addXVar(n.get(j)):Float.isNaN(h[j])?this.mp.addXObj(J.script.SV.unescapePointOrBitsetAsVariable(f[j])):this.mp.addXFloat(h[j]),m?this.mp.addXVar(z):7==d.tok?this.mp.addXVar(r.get(j)):Float.isNaN(l[j])?this.mp.addXObj(J.script.SV.unescapePointOrBitsetAsVariable(g[j])):this.mp.addXFloat(l[j]),null==(A[j]=this.mp.evalOp(p)))return!1;return this.mp.addXAV(A)},
$fz.isPrivate=!0,$fz),"~N,~A");$_M(c$,"evaluateRowCol",($fz=function(a,b){if(1!=a.length)return!1;var c=a[0].asInt()-1,d=this.mp.getX();switch(d.tok){case 11:if(0>c||2<c)break;var e=d.value;switch(b){case 1276117513:return d=Clazz.newFloatArray(3,0),e.getRow(c,d),this.mp.addXAF(d);default:return d=Clazz.newFloatArray(3,0),e.getColumn(c,d),this.mp.addXAF(d)}case 12:if(0>c||2<c)break;e=d.value;switch(b){case 1276117513:return d=Clazz.newFloatArray(4,0),e.getRow(c,d),this.mp.addXAF(d);default:return d=
Clazz.newFloatArray(4,0),e.getColumn(c,d),this.mp.addXAF(d)}}return!1},$fz.isPrivate=!0,$fz),"~A,~N");$_M(c$,"evaluateArray",($fz=function(a,b){var c=a.length;if(b&&(4==c||3==c)){for(var d=!0,e=0;e<c&&d;e++)d=7==a[e].tok&&a[e].getList().size()==c;if(d){for(var f=Clazz.newFloatArray(c*c,0),g=0,e=0;e<c&&d;e++)for(var h=a[e].getList(),j=0;j<c;j++){var m=J.script.SV.fValue(h.get(j));if(Float.isNaN(m)){d=!1;break}f[g++]=m}if(d)return 3==c?this.mp.addXM3(JU.M3.newA(f)):this.mp.addXM4(JU.M4.newA(f))}}c=
Array(a.length);for(e=c.length;0<=--e;)c[e]=J.script.SV.newScriptVariableToken(a[e]);return this.mp.addXAV(c)},$fz.isPrivate=!0,$fz),"~A,~B");$_M(c$,"evaluateMath",($fz=function(a,b){if(135266318==b)return 1==a.length&&4==a[0].tok?this.mp.addXStr(new java.util.Date+"\t"+J.script.SV.sValue(a[0])):this.mp.addXInt((System.currentTimeMillis()&2147483647)-(0==a.length?0:a[0].asInt()));if(1!=a.length)return!1;if(135266826==b)return 2==a[0].tok?this.mp.addXInt(Math.abs(a[0].asInt())):this.mp.addXFloat(Math.abs(a[0].asFloat()));
var c=J.script.SV.fValue(a[0]);switch(b){case 135266819:return this.mp.addXFloat(180*Math.acos(c)/3.141592653589793);case 135266821:return this.mp.addXFloat(Math.cos(3.141592653589793*c/180));case 135266820:return this.mp.addXFloat(Math.sin(3.141592653589793*c/180));case 135266822:return this.mp.addXFloat(Math.sqrt(c))}return!1},$fz.isPrivate=!0,$fz),"~A,~N");$_M(c$,"evaluateQuaternion",($fz=function(a,b){var c=null,d=a.length,e=2147483647,f=!1;135270417==b&&(1<d&&(4==a[d-1].tok&&a[d-1].value.equalsIgnoreCase("relative"))&&
(d--,f=!0),1<d&&(2==a[d-1].tok&&10==a[0].tok)&&(e=a[d-1].asInt(),0>=e&&(e=2147483646),d--));switch(d){case 0:case 1:case 4:break;case 2:if(135270417==b){if(7==a[0].tok&&7==a[1].tok)break;if(10==a[0].tok&&(2==a[1].tok||10==a[1].tok))break}if(null==(c=this.mp.ptValue(a[0],!1))||135270417!=b&&8==a[1].tok)return!1;break;case 3:if(135270417!=b)return!1;if(9==a[0].tok){if(8!=a[2].tok&&10!=a[2].tok)return!1;break}for(var g=0;3>g;g++)if(8!=a[g].tok&&10!=a[g].tok)return!1;break;default:return!1}var h=g=null,
j=null;switch(d){case 0:return this.mp.addXPt4(J.util.Quaternion.newQ(this.viewer.getRotationQuaternion()).toPoint4f());default:if(135270417==b&&7==a[0].tok){c=this.getQuaternionArray(a[0].getList(),1073742001);g=J.util.Quaternion.sphereMean(c,null,1E-4);g=Clazz.instanceOf(g,J.util.Quaternion)?g:null;break}else if(135270417==b&&10==a[0].tok)h=this.viewer.getAtomGroupQuaternions(a[0].value,e);else if(11==a[0].tok)g=J.util.Quaternion.newM(a[0].value);else if(9==a[0].tok)j=a[0].value;else if(j=J.script.SV.sValue(a[0]),
j=J.util.Escape.uP(j.equalsIgnoreCase("best")?this.viewer.getOrientationText(1073741863,null):j),!Clazz.instanceOf(j,JU.P4))return!1;135266307==b&&(g=J.util.Quaternion.newVA(JU.P3.new3(j.x,j.y,j.z),j.w));break;case 2:if(135270417==b){if(7==a[0].tok&&7==a[1].tok){c=this.getQuaternionArray(a[0].getList(),1073742001);h=this.getQuaternionArray(a[1].getList(),1073742001);h=J.util.Quaternion.div(h,c,e,f);break}if(10==a[0].tok&&10==a[1].tok){c=this.viewer.getAtomGroupQuaternions(a[0].value,2147483647);h=
this.viewer.getAtomGroupQuaternions(a[1].value,2147483647);h=J.util.Quaternion.div(h,c,e,f);break}}g=this.mp.ptValue(a[1],!1);j=this.mp.planeValue(a[0]);g=null!=g?J.util.Quaternion.getQuaternionFrame(JU.P3.new3(0,0,0),c,g):J.util.Quaternion.newVA(c,J.script.SV.fValue(a[1]));break;case 3:if(9==a[0].tok)return e=8==a[2].tok?a[2].value:this.viewer.getAtomSetCenter(a[2].value),this.mp.addXStr(J.util.Quaternion.newP4(a[0].value).draw("q",J.script.SV.sValue(a[1]),e,1));f=Array(3);for(g=0;3>g;g++)f[g]=8==
a[g].tok?a[g].value:this.viewer.getAtomSetCenter(a[g].value);g=J.util.Quaternion.getQuaternionFrame(f[0],f[1],f[2]);break;case 4:135270417==b?j=JU.P4.new4(J.script.SV.fValue(a[1]),J.script.SV.fValue(a[2]),J.script.SV.fValue(a[3]),J.script.SV.fValue(a[0])):g=J.util.Quaternion.newVA(JU.P3.new3(J.script.SV.fValue(a[0]),J.script.SV.fValue(a[1]),J.script.SV.fValue(a[2])),J.script.SV.fValue(a[3]))}if(null!=h){if(2147483647!=e){e=new JU.List;for(g=0;g<h.length;g++)e.addLast(h[g].toPoint4f());return this.mp.addXList(e)}g=
0<h.length?h[0]:null}return this.mp.addXPt4((null==g?J.util.Quaternion.newP4(j):g).toPoint4f())},$fz.isPrivate=!0,$fz),"~A,~N");$_M(c$,"evaluateRandom",($fz=function(a){if(2<a.length)return!1;var b=2>a.length?0:J.script.SV.fValue(a[0]);a=0==a.length?1:J.script.SV.fValue(a[a.length-1]);return this.mp.addXFloat(Math.random()*(a-b)+b)},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateCross",($fz=function(a){if(2!=a.length)return!1;var b=a[0];a=a[1];if(8!=b.tok||8!=a.tok)return!1;b=JU.V3.newV(b.value);a=JU.V3.newV(a.value);
b.cross(b,a);return this.mp.addXPt(JU.P3.newP(b))},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateLoad",($fz=function(a,b){if(2<a.length||1>a.length)return!1;var c=J.script.SV.sValue(a[0]),d=2==a.length?a[1].asInt():-1;if(this.viewer.isJS&&c.startsWith("?")){if(1229984263==b)return this.mp.addXStr("");c=this.eval.loadFileAsync("load()_",c,this.mp.oPt,!0)}return this.mp.addXStr(135271426==b?this.viewer.getFileAsString4(c,d,!1,!1):this.viewer.getFilePath(c,!1))},$fz.isPrivate=!0,$fz),"~A,~N");$_M(c$,"evaluateWrite",
($fz=function(a){return 0==a.length?!1:this.mp.addXStr(this.write(a))},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateScript",($fz=function(a,b){if(135287308==b&&1!=a.length||0==a.length||2<a.length)return!1;var c=J.script.SV.sValue(a[0]),d=new JU.SB;switch(b){case 135271429:var e=2==a.length?J.script.SV.sValue(a[1]):".";e.equals(".")||d.append(this.viewer.jsEval(e+"\u0001"+c));(e.equals(".")||e.equals("*"))&&this.eval.runScriptBuffer(c,d);break;case 135287308:d.append(this.viewer.jsEval(c))}var c=d.toString(),
f;return Float.isNaN(f=JU.ParserJS.parseFloatStrict(c))?this.mp.addXStr(c):0<=c.indexOf(".")?this.mp.addXFloat(f):this.mp.addXInt(JU.ParserJS.parseInt(c))},$fz.isPrivate=!0,$fz),"~A,~N");$_M(c$,"evaluateData",($fz=function(a){if(1!=a.length&&2!=a.length&&4!=a.length)return!1;var b=J.script.SV.sValue(a[0]),c=2==a.length?J.script.SV.sValue(a[1]):"";if(4==a.length){var c=a[1].asInt(),d=a[2].asInt();a=a[3].asInt();a=J.util.ParserBS.extractData(b,c,d,a);return this.mp.addXStr(J.util.Escape.escapeFloatA(a,
!1))}if(0==b.indexOf("data2d_"))return b=this.viewer.getDataFloat2D(b),null==b?this.mp.addXStr(""):2==a.length&&2==a[1].tok?(a=a[1].intValue,0>a&&(a+=b.length),0<=a&&a<b.length?this.mp.addXStr(J.util.Escape.escapeFloatA(b[a],!1)):this.mp.addXStr("")):this.mp.addXStr(J.util.Escape.escapeFloatAA(b,!1));if(0==b.indexOf("property_")){b=this.viewer.getDataFloat(b);if(null==b)return this.mp.addXStr("");a=0==c.indexOf("property_")?this.viewer.getDataFloat(c):null;if(null!=a){b=JU.ArrayUtil.arrayCopyF(b,
-1);for(c=Math.min(b.length,a.length);0<=--c;)b[c]+=a[c]}return this.mp.addXStr(J.util.Escape.escapeFloatA(b,!1))}return 1==a.length?(a=this.viewer.getData(b),this.mp.addXStr(null==a?"":""+a[1])):this.mp.addXStr(this.viewer.getData(b,c))},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateLabel",($fz=function(a,b){var c=2>b.length?this.mp.getX():null,d=0==b.length?"%U":J.script.SV.sValue(b[0]),e=J.script.T.tokAttr(a,480);if(null==c)return this.mp.addXStr(J.script.SV.sprintfArray(b));var f=J.script.SV.getBitSet(c,
!0);return null==f?this.mp.addXObj(J.script.SV.sprintf(J.util.Txt.formatCheck(d),c)):this.mp.addXObj(this.getBitsetIdent(f,d,c.value,!0,c.index,e))},$fz.isPrivate=!0,$fz),"~N,~A");$_M(c$,"evaluateWithin",($fz=function(a){if(1>a.length||5<a.length)return!1;var b=a.length,c=0,d=a[0].value,e=""+d,f=a[0].tok;4==f&&(f=J.script.T.getTokFromName(e));var g=1649412120==f;g&&(c=100,d=null);var h=!1,j=!1,m=g||3==f||2==f,l=null;switch(f){case 1048580:return 3!=b||!Clazz.instanceOf(a[1].value,JU.BS)||!Clazz.instanceOf(a[2].value,
JU.BS)?!1:this.mp.addXBs(this.viewer.getBranchBitSet(a[2].value.nextSetBit(0),a[1].value.nextSetBit(0),!0));case 135267336:case 1238369286:case 135267335:c=null;e=!0;switch(b){case 2:break;case 3:if(e=10==a[2].tok)c=a[2].value;break;default:e=!1}e||this.eval.error(22);return this.mp.addXObj(this.getSmilesMatches(J.script.SV.sValue(a[1]),null,c,null,135267335==f,this.mp.asBitSet))}if(Clazz.instanceOf(d,String)){if(0==f){f=1048614;if(2<b)return!1;b=2}}else if(m){g||(c=J.script.SV.fValue(a[0]));if(2>
b)return!1;switch(f=a[1].tok){case 1048589:case 1048588:h=a[1].asBoolean();b=0;break;case 4:f=J.script.SV.sValue(a[1]);if(f.startsWith("$"))return this.mp.addXBs(this.getAtomsNearSurface(c,f.substring(1)));j=f.equalsIgnoreCase("group");f=(g=f.equalsIgnoreCase("vanderwaals"))?1649412120:1087373318}}else return!1;var n=d=null;switch(b){case 1:switch(f){case 137363468:case 3145760:case 1679429641:return this.mp.addXBs(this.viewer.getAtomBits(f,null));case 1073741864:return this.mp.addXBs(this.viewer.getAtomBits(f,
""));case 1048614:return this.mp.addXBs(this.viewer.getAtomBits(1087373320,e))}return!1;case 2:switch(f){case 1048614:f=1087373320;break;case 1087375362:case 1087375361:case 1073741864:case 1087373320:return this.mp.addXBs(this.viewer.getAtomBits(f,J.script.SV.sValue(a[a.length-1])))}break;case 3:switch(f){case 1048589:case 1048588:case 1087373318:case 1649412120:case 135266319:case 135267841:case 1048582:break;case 1087373320:e=J.script.SV.sValue(a[2]);break;default:return!1}}b=a.length-1;Clazz.instanceOf(a[b].value,
JU.P4)?n=a[b].value:Clazz.instanceOf(a[b].value,JU.P3)&&(d=a[b].value,J.script.SV.sValue(a[1]).equalsIgnoreCase("hkl")&&(n=this.eval.getHklPlane(d)));if(0<b&&null==n&&null==d&&!Clazz.instanceOf(a[b].value,JU.BS))return!1;if(null!=n)return this.mp.addXBs(this.viewer.getAtomsNearPlane(c,n));if(null!=d)return this.mp.addXBs(this.viewer.getAtomsNearPt(c,d));a=10==a[b].tok?J.script.SV.bsSelectVar(a[b]):null;if(1087373320==f)return this.mp.addXBs(this.viewer.getSequenceBits(e,a));null==a&&(a=new JU.BS);
if(!m)return this.mp.addXBs(this.viewer.getAtomBits(f,a));if(j)return this.mp.addXBs(this.viewer.getGroupsWithin(Clazz.floatToInt(c),a));g&&(l=new J.atomdata.RadiusData(null,10<c?c/100:c,10<c?J.atomdata.RadiusData.EnumType.FACTOR:J.atomdata.RadiusData.EnumType.OFFSET,J.constant.EnumVdw.AUTO));return this.mp.addXBs(this.viewer.getAtomsWithinRadius(c,a,h,l))},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"getAtomsNearSurface",($fz=function(a,b){var c=[b,null,null];if(this.chk)return new JU.BS;if(this.eval.getShapePropertyData(24,
"getVertices",c))return this.viewer.getAtomsNearPts(a,c[1],c[2]);c[1]=Integer.$valueOf(0);c[2]=Integer.$valueOf(-1);return this.eval.getShapePropertyData(22,"getCenter",c)?this.viewer.getAtomsNearPt(a,c[2]):new JU.BS},$fz.isPrivate=!0,$fz),"~N,~S");$_M(c$,"evaluateColor",($fz=function(a){var b=0<a.length?J.script.SV.sValue(a[0]):"";if(b.equalsIgnoreCase("hsl")&&2==a.length){var c=JU.P3.newP(J.script.SV.ptValue(a[1])),d=Clazz.newFloatArray(3,0);J.util.ColorEncoder.RGBtoHSL(c.x,c.y,c.z,d);c.set(360*
d[0],100*d[1],100*d[2]);return this.mp.addXPt(c)}var e=b.startsWith("$"),d=e?null:this.viewer.getColorEncoder(b);if(!e&&null==d)return this.mp.addXStr("");var c=1<a.length?J.script.SV.fValue(a[1]):3.4028235E38,f=2<a.length?J.script.SV.fValue(a[2]):3.4028235E38;a=3<a.length?J.script.SV.fValue(a[3]):3.4028235E38;var g=3.4028235E38!=a||3.4028235E38!=c&&3.4028235E38==f;3.4028235E38==f&&0==b.length&&(a=c,f=this.viewer.getCurrentColorRange(),c=f[0],f=f[1]);if(e){d=[b.substring(1),null];if(!this.viewer.getShapePropertyData(24,
"colorEncoder",d))return this.mp.addXStr("");d=d[1]}else d.setRange(c,f,c>f);b=d.getColorKey();return g?this.mp.addXPt(J.util.ColorUtil.colorPointFromInt2(d.getArgb(3.4028235E38==f?c:a))):this.mp.addXVar(J.script.SV.getVariableMap(b))},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateConnected",($fz=function(a){if(5<a.length)return!1;for(var b=-2147483648,c=2147483647,d=0,e=3.4028235E38,f=65535,g=null,h=null,j=!1,m=!1,l=0;l<a.length;l++){var n=a[l];switch(n.tok){case 10:if((m=Clazz.instanceOf(n.value,
J.modelset.Bond.BondSet))&&null!=g)return!1;if(null==g)g=J.script.SV.bsSelectVar(n);else if(null==h)h=J.script.SV.bsSelectVar(n);else return!1;break;case 4:f=J.script.SV.sValue(n);f=f.equalsIgnoreCase("hbond")?30720:J.script.ScriptEvaluator.getBondOrderFromString(f);if(131071==f)return!1;break;case 3:j=!0;default:var r=n.asInt(),n=n.asFloat();if(2147483647!=c)return!1;-2147483648==b?(b=Math.max(r,0),d=n):(c=r,e=n)}}-2147483648==b?(b=1,c=100,d=0.1,e=1E8):2147483647==c&&(c=b,e=d,d=0.1);null==g&&(g=
this.viewer.getModelUndeletedAtomsBitSet(-1));j&&null==h&&(h=g);return null!=h?(a=new JU.BS,this.viewer.makeConnections(d,e,f,1087373321,g,h,a,m,!1,0),this.mp.addXVar(J.script.SV.newVariable(10,new J.modelset.Bond.BondSet(a,this.viewer.getAtomIndices(this.viewer.getAtomBits(1678770178,a)))))):this.mp.addXBs(this.viewer.getAtomsConnected(b,c,f,g))},$fz.isPrivate=!0,$fz),"~A");$_M(c$,"evaluateSubstructure",($fz=function(a,b){if(0==a.length)return!1;var c=new JU.BS,d=J.script.SV.sValue(a[0]);if(0<d.length)try{var e=
2==a.length&&10==a[1].tok?J.script.SV.bsSelectVar(a[1]):null,c=this.viewer.getSmilesMatcher().getSubstructureSet(d,this.viewer.getModelSet().atoms,this.viewer.getAtomCount(),e,135267336!=b&&1238369286!=b,!1)}catch(f){if(Clazz.exceptionOf(f,Exception))this.eval.evalError(f.toString(),null);else throw f;}return this.mp.addXBs(c)},$fz.isPrivate=!0,$fz),"~A,~N");$_M(c$,"getMinMaxPoint",($fz=function(a,b){var c=null,d=null,e=0;Clazz.instanceOf(a,Array)?(c=a,e=c.length):Clazz.instanceOf(a,JU.List)&&(d=
a,e=d.size());if(null!=d||null!=c){for(var f=new JU.P3,g=Clazz.newFloatArray(e,0),h=!0,j=0;3>j&&h;j++){for(var m=0;m<e;m++){var l=null==c?J.script.SV.ptValue(d.get(m)):c[m];if(null==l){h=!1;break}switch(j){case 0:g[m]=l.x;break;case 1:g[m]=l.y;break;case 2:g[m]=l.z}}if(!h)break;m=this.getMinMax(g,b);if(Clazz.instanceOf(m,Float))switch(m=m.floatValue(),j){case 0:f.x=m;break;case 1:f.y=m;break;case 2:f.z=m}else break}return f}return"NaN"},$fz.isPrivate=!0,$fz),"~O,~N");$_M(c$,"getMinMaxQuaternion",
($fz=function(a,b){var c;switch(b){case 32:case 64:case 128:case 160:return"NaN"}for(;;){c=this.getQuaternionArray(a,1073742001);if(null==c)break;var d=Clazz.newFloatArray(1,0);c=J.util.Quaternion.sphereMean(c,d,1E-4);switch(b){case 96:return c;case 192:return Float.$valueOf(d[0])}break}return"NaN"},$fz.isPrivate=!0,$fz),"JU.List,~N");$_M(c$,"getQuaternionArray",($fz=function(a,b){var c;switch(b){case 135270417:c=a;break;case 9:c=Array(a.length);for(var d=0;d<a.length;d++)c[d]=J.util.Quaternion.newP4(a[d]);
break;case 1073742001:c=Array(a.size());for(d=0;d<a.size();d++){var e=J.script.SV.pt4Value(a.get(d));if(null==e)return null;c[d]=J.util.Quaternion.newP4(e)}break;default:return null}return c},$fz.isPrivate=!0,$fz),"~O,~N");Clazz.overrideMethod(c$,"getMinMax",function(a,b){for(var c=null,d=null,e=0;;){if(J.util.Escape.isAF(a)){if(c=a,e=c.length,0==e)break}else if(Clazz.instanceOf(a,JU.List)){d=a;e=d.size();if(0==e)break;var f=d.get(0);if(4==f.tok&&f.value.startsWith("{")){c=J.script.SV.ptValue(f);
if(Clazz.instanceOf(c,JU.P3))return this.getMinMaxPoint(d,b);if(Clazz.instanceOf(c,JU.P4))return this.getMinMaxQuaternion(d,b);break}}else break;switch(b){case 32:f=3.4028235E38;break;case 64:f=-3.4028235E38;break;default:f=0}for(var g=0,h=0;0<=--e;){var j=null==c?J.script.SV.fValue(d.get(e)):c[e];if(!Float.isNaN(j))switch(h++,b){case 160:case 192:g+=j*j;case 128:case 96:f+=j;break;case 32:j<f&&(f=j);break;case 64:j>f&&(f=j)}}if(0==h)break;switch(b){case 96:f/=h;break;case 192:if(1==h)break;f=Math.sqrt((g-
f*f/h)/(h-1));break;case 160:f=g}return Float.$valueOf(f)}return"NaN"},"~O,~N");Clazz.defineStatics(c$,"ERROR_invalidArgument",22)});
