(function(Z,ea,fa,ga,T,ha,H,x,L,K,M,I,ba,S,ia,G,O,Q,$,X,W,ja,Y,aa,ka,la,ma,P,na,oa,pa,qa,ca,da,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La,f,r){H("J.api");Y(J.api,"JmolParallelProcessor");H("J.api");Y(J.api,"JmolScriptEvaluator");H("J.api");Y(J.api,"JmolScriptFunction");H("J.api");Y(J.api,"JmolScriptManager");H("JS");L(["J.thread.JmolThread"],"JS.CommandWatcherThread",["JU.Logger"],function(){var d=M(function(){this.scriptManager=null;K(this,arguments)},JS,"CommandWatcherThread",
J.thread.JmolThread);S(d,function(){W(this,JS.CommandWatcherThread,[])});r(d,"setManager",function(a,b){this.scriptManager=a;this.setViewer(b,"CommmandWatcherThread");return 0},"~O,JV.Viewer,~O");r(d,"run",function(){for(Thread.currentThread().setPriority(1);!this.stopped;)try{Thread.sleep(50),this.stopped||this.scriptManager.runScriptNow()}catch(a){if(G(a,"InterruptedException")){var b=a;JU.Logger.warn("CommandWatcher InterruptedException! "+this);break}else if(G(a,Exception)){b=a;JU.Logger.warn("CommandWatcher Exception! script processing ERROR:\n\n"+
b.toString());break}else throw a;}});r(d,"run1",function(){},"~N")});H("JS");L(["J.thread.JmolThread"],"JS.FileLoadThread",["JV.Viewer"],function(){var d=M(function(){this.key=this.cacheName=this.fileName=null;K(this,arguments)},JS,"FileLoadThread",J.thread.JmolThread);S(d,function(){W(this,JS.FileLoadThread,[])});f(d,"initialize",function(a,b,c,e,g){this.setViewer(b,"FileLoadThread");this.fileName=c;this.key=e;this.cacheName=g;this.setEval(a);this.sc.pc--;return this},"J.api.JmolScriptEvaluator,JV.Viewer,~S,~S,~S");
r(d,"run1",function(a){for(;;)switch(a){case -1:a=0;break;case 0:if(this.stopped||!this.vwr.testAsync&&this.eval.isStopped()){a=-2;break}null!=JV.Viewer.jmolObject&&JV.Viewer.jmolObject.loadFileAsynchronously(this,this.vwr.html5Applet,this.fileName,null);return;case 1:a=this.vwr.fm.getFileAsBytes(this.fileName,null);this.setData(this.fileName,this.fileName,a,null);return;case -2:this.resumeEval();return}},"~N");f(d,"setData",function(a,b,c){var e=a.equals("#CANCELED#");this.sc.parentContext.htFileCache.put(this.key,
e?a:this.cacheName=this.cacheName.substring(0,this.cacheName.lastIndexOf("_")+1)+a);this.vwr.cachePut(this.cacheName,c);null!=b&&this.vwr.cachePut(this.vwr.fm.getFilePath(a,!0,!1),c);this.run1(-2)},"~S,~S,~O,~O")});H("JS");L(["JS.ScriptTokenParser","JU.Lst"],"JS.ScriptCompiler","java.util.Hashtable JU.AU $.BS $.PT $.SB J.api.Interface J.i18n.GT JM.BondSet $.Group JS.ContextToken $.SV $.ScriptContext $.ScriptError $.ScriptFlowContext $.ScriptFunction $.ScriptManager $.T JU.Edge $.Escape $.Logger JV.FileManager $.Viewer".split(" "),
function(){var d=M(function(){this.filename=null;this.isSilent=!1;this.lineIndices=this.lineNumbers=this.aatokenCompiled=this.contextVariables=null;this.lnLength=8;this.isPrivateScript=this.isPrivateFunc=this.haveComments=this.isCheckOnly=this.isShowScriptOutput=this.preDefining=!1;this.vBraces=this.lltoken=this.ltoken=this.flowContext=this.thisFunction=this.scriptExtensions=null;this.iBrace=this.setEqualPt=this.forPoint3=this.ptSemi=this.bracketCount=this.setBraceCount=this.braceCount=this.parenCount=
this.nSemiSkip=this.cchScript=this.cchToken=this.ichBrace=0;this.endOfLine=this.needRightParen=this.isEndOfCommand=this.iHaveQuotedString=!1;this.comment=null;this.tokLastMath=0;this.checkImpliedScriptCmd=!1;this.vFunctionStack=null;this.implicitString=this.isUserToken=this.isComment=this.isShowCommand=this.allowMissingEnd=!1;this.afterWhite=this.tokInitialPlusPlus=0;this.isDotDot=!1;this.vPush=this.identLC=this.ident=null;this.pushCount=0;this.forceFlowContext=null;this.haveENDIF=this.isWhere=!1;
this.chFirst="\x00";this.afterMath=0;K(this,arguments)},JS,"ScriptCompiler",JS.ScriptTokenParser);X(d,function(){this.vPush=new JU.Lst});S(d,function(a){W(this,JS.ScriptCompiler,[]);this.vwr=a},"JV.Viewer");f(d,"compile",function(a,b,c,e,g,p){this.isCheckOnly=p;this.filename=a;this.isSilent=e;this.script=b;this.isWhere=b.startsWith("w_h_e_r_e = ");this.logMessages=!e&&!c&&g;this.preDefining="#predefine"===a;a=this.compile0(!0);this.atokenInfix=null;a||this.handleError();c=new JS.ScriptContext;a=0==
this.iBrace&&0==this.parenCount&&0==this.braceCount&&0==this.bracketCount;c.isComplete=a;c.script=b;c.scriptExtensions=this.scriptExtensions;c.isEditor=null!=this.scriptExtensions&&0<=this.scriptExtensions.indexOf("\u0001## ISEDITOR");c.errorType=this.errorType;null!=this.errorType&&(c.iCommandError=this.iCommand,this.setAaTokenCompiled());c.saveTokens(this.aatokenCompiled);c.errorMessage=this.errorMessage;c.errorMessageUntranslated=null==this.errorMessageUntranslated?this.errorMessage:this.errorMessageUntranslated;
this.allowMissingEnd&&(null!=c.errorMessage&&0<=c.errorMessageUntranslated.indexOf("missing END"))&&(c.errorMessage=c.errorMessageUntranslated);c.lineIndices=this.lineIndices;c.lineNumbers=this.lineNumbers;c.vars=this.contextVariables;return c},"~S,~S,~B,~B,~B,~B");f(d,"newContextVariable",function(a){this.theToken=JS.T.o(1073741824,a);if(0<this.pushCount){var b=this.vPush.get(this.pushCount-1);b.addName(a);if(364558!=b.tok)return}null==this.thisFunction?(null==this.contextVariables&&(this.contextVariables=
new java.util.Hashtable),JS.ScriptCompiler.addContextVariable(this.contextVariables,a)):this.thisFunction.addVariable(a,!1)},"~S");d.addContextVariable=f(d,"addContextVariable",function(a,b){a.put(b,JS.SV.newS("").setName(b))},"java.util.Map,~S");f(d,"isContextVariable",function(a){for(var b=this.vPush.size();0<=--b;){var c=this.vPush.get(b);if(null!=c.contextVariables&&c.contextVariables.containsKey(a))return!0}return null!=this.thisFunction?this.thisFunction.isVariable(a):null!=this.contextVariables&&
this.contextVariables.containsKey(a)},"~S");f(d,"cleanScriptComments",function(a){0<=a.indexOf("\u00a0")&&(a=a.$replace("\u00a0"," "));0<=a.indexOf("\u201c")&&(a=a.$replace("\u201c",'"'));0<=a.indexOf("\u201d")&&(a=a.$replace("\u201d",'"'));0<=a.indexOf("\ufeff")&&(a=a.$replace("\ufeff"," "));var b=a.indexOf("\u0001##");0<=b&&(this.allowMissingEnd=0<=a.indexOf("\u0001##NOENDCHECK",b),this.scriptExtensions=a.substring(b),a=a.substring(0,b));this.haveComments=0<=a.indexOf("#");return JV.FileManager.getEmbeddedScript(a)},
"~S");f(d,"addTokenToPrefix",function(a){this.logMessages&&JU.Logger.info("addTokenToPrefix"+this.lineCurrent+" "+this.iCommand+" "+a);this.ltoken.addLast(a);0!=a.tok&&(this.lastToken=a)},"JS.T");f(d,"compile0",function(a){this.haveENDIF=!1;this.script=this.cleanScriptComments(this.script);this.ichToken=this.script.indexOf("# Jmol state version ");(this.isStateScript=0<=this.ichToken&&10>this.ichToken)?(this.ptSemi=this.script.indexOf(";",this.ichToken),this.ptSemi>=this.ichToken&&JS.ScriptManager.setStateScriptVersion(this.vwr,
this.script.substring(this.ichToken+21,this.ptSemi).trim())):this.haveENDIF=0<=this.script.indexOf("endif");this.cchScript=this.script.length;a:for(;;){this.vFunctionStack=new JU.Lst;this.htUserFunctions=new java.util.Hashtable;this.errorLine=this.errorMessageUntranslated=this.errorMessage=this.errorType=this.flowContext=this.thisFunction=this.aatokenCompiled=this.lineIndices=this.lineNumbers=this.contextVariables=null;this.isPrivateFunc=this.isPrivateScript=!1;this.ichBrace=this.ichComment=this.ichCurrentCommand=
this.ichToken=this.nSemiSkip=0;this.lineCurrent=1;this.tokLastMath=this.iCommand=0;this.lastToken=JS.T.tokenOff;this.vBraces=new JU.Lst;this.vPush=new JU.Lst;this.parenCount=this.braceCount=this.iBrace=this.pushCount=0;this.isDotDot=!1;this.ptSemi=-10;this.cchToken=0;this.lnLength=8;this.lineNumbers=aa(this.lnLength,0);this.lineIndices=O(this.lnLength,2,0);this.isNewSet=this.isSetBrace=!1;this.ptNewSetModifier=1;this.checkImpliedScriptCmd=this.iHaveQuotedString=this.isShowScriptOutput=!1;this.lltoken=
new JU.Lst;this.ltoken=new JU.Lst;this.tokCommand=0;this.tokenAndEquals=this.lastFlowCommand=null;this.bracketCount=this.setBraceCount=this.tokInitialPlusPlus=0;this.forPoint3=-1;this.setEqualPt=2147483647;this.endOfLine=!1;this.comment=null;this.needRightParen=this.isEndOfCommand=!1;this.forceFlowContext=this.lastFlowCommand=null;this.theTok=0;for(var b=1;;this.ichToken+=this.cchToken){if(0==(this.nTokens=this.ltoken.size()))null!=this.thisFunction&&0==this.thisFunction.chpt0&&(this.thisFunction.chpt0=
this.ichToken),this.ichCurrentCommand=this.ichToken,b=this.lineCurrent;if(!this.lookingAtLeadingWhitespace()){this.endOfLine=!1;if(!this.isEndOfCommand){this.endOfLine=this.lookingAtEndOfLine();switch(this.endOfLine?0:this.lookingAtComment()){case 2:continue;case 3:this.isEndOfCommand=!0;continue;case 1:this.isEndOfCommand=!0,this.comment=this.script.substring(this.ichToken,this.ichToken+this.cchToken).trim()}this.isEndOfCommand=this.isEndOfCommand||this.endOfLine||this.lookingAtTerminator()}if(this.isEndOfCommand){this.isEndOfCommand=
!1;switch(this.processTokenList(b,a)){case 2:continue;case 4:return!1}this.checkImpliedScriptCmd=!1;if(this.ichToken<this.cchScript)continue;if(null!=this.flowContext){for(this.ichCurrentCommand=this.ichToken=this.cchScript;null!=this.flowContext;)if(this.fixFlowAddLine(this.flowContext),!this.haveENDIF&&this.flowContext.checkForceEndIf(0))this.forceFlowEnd(this.flowContext.token),this.processTokenList(b,a);else return this.lineCurrent=this.flowContext.lineStart,this.iCommand=this.flowContext.pt0,
this.ichCurrentCommand=this.lineIndices[this.iCommand][0],this.ichToken=this.ichEnd=this.lineIndices[this.iCommand][1],this.errorStr(11,null==this.flowContext.$function?JS.T.nameOf(this.flowContext.token.tok):this.flowContext.$function.getSignature());this.lltoken.addLast(P(-1,[JS.T.o(0,"// end of script")]))}this.setAaTokenCompiled();return!0}if(0<this.nTokens&&!this.isDotDot)switch(this.checkSpecialParameterSyntax()){case 2:continue;case 4:return!1}if(this.lookingAtLookupToken(this.ichToken)){switch(this.parseKnownToken()){case 2:continue;
case 4:return!1;case 5:this.haveENDIF=!0;continue a}switch(this.parseCommandParameter(b,a)){case 2:continue;case 4:return!1;case 5:this.haveENDIF=!0;continue a}this.addTokenToPrefix(this.theToken)}else{if(0==this.nTokens||(this.isNewSet||this.isSetBrace)&&this.nTokens==this.ptNewSetModifier){if(0==this.nTokens){if(this.lookingAtString(!0)){this.addTokenToPrefix(this.setCommand(JS.T.tokenScript));this.cchToken=0;continue}this.lookingAtImpliedString(!0,!0,!0,!1)&&(this.ichEnd=this.ichToken+this.cchToken)}return this.commandExpected()}return this.errorStr(19,
this.script.substring(this.ichToken,this.ichToken+1))}}}}},"~B");f(d,"setAaTokenCompiled",function(){this.aatokenCompiled=this.lltoken.toArray(Array(this.lltoken.size()))});f(d,"lookingAtLeadingWhitespace",function(){for(var a=this.ichToken;JS.ScriptCompiler.isSpaceOrTab(this.charAt(a));)++a;this.isLineContinuation(a,!0)&&(a+=1+this.nCharNewLine(a+1));this.cchToken=a-this.ichToken;if(0==this.cchToken)return!1;this.afterWhite=a;return!0});f(d,"isLineContinuation",function(a,b){var c=a+2<this.cchScript&&
"\\"==this.script.charAt(a)&&0<this.nCharNewLine(a+1)||!this.isShowScriptOutput&&b&&this.lookingAtMathContinuation(a);c&&this.lineCurrent++;return c},"~N,~B");f(d,"lookingAtMathContinuation",function(a){var b;if(0==(b=this.nCharNewLine(a))||1073742332==this.lastToken.tok)return!1;if(0<this.parenCount||0<this.bracketCount)return!0;switch(this.tokCommand){case 134320141:case 102436:return this.flowContext.forceEndIf=!1;case 134320648:case 102406:case 134320649:case 364547:case 102402:return this.haveENDIF||
(this.flowContext.addLine=1,this.flowContext.forceEndIf=!0),!1;case 36867:if(1<this.nTokens&&537022465==this.ltoken.get(1).tok)return!1;case 36865:case 36869:break;default:return!1}if(this.lastToken.tok==this.tokLastMath)return!0;for(a+=b;JS.ScriptCompiler.isSpaceOrTab(this.charAt(a));)++a;return this.lookingAtLookupToken(a)&&1==this.tokLastMath},"~N");f(d,"lookingAtEndOfLine",function(){return this.ichToken>=this.cchScript?(this.ichEnd=this.cchScript,!0):0<(this.cchToken=this.nCharNewLine(this.ichEnd=
this.ichToken))});f(d,"nCharNewLine",function(a){var b;return"\r"!=(b=this.charAt(a))?"\n"==b?1:0:"\n"==this.charAt(++a)?2:1},"~N");f(d,"lookingAtTerminator",function(){var a=";"==this.script.charAt(this.ichToken);a&&0<this.nTokens&&(this.ptSemi=this.nTokens);if(!a||0<this.nSemiSkip--)return!1;this.cchToken=1;return!0});f(d,"lookingAtComment",function(){var a=this.script.charAt(this.ichToken),b=this.ichToken,c=-1;if(this.ichToken==this.ichCurrentCommand&&"$"==a&&(this.isShowScriptOutput||0==this.ichToken)){this.isShowCommand=
this.isShowScriptOutput=!0;if("["==this.charAt(++b))for(;"]"!=a&&!this.eol(a=this.charAt(b));)++b;this.cchToken=b-this.ichToken;return 2}this.isShowScriptOutput&&!this.isShowCommand&&(c=b);if("/"==a&&b+1<this.cchScript)switch(this.script.charAt(++b).charCodeAt(0)){case 47:c=this.ichToken;this.ichEnd=b-1;break;case 42:this.ichEnd=b-1;b="*"==(a=this.charAt(++b))?"**/":"*/";b=this.script.indexOf(b,this.ichToken+2);if(0>b)return this.ichToken=this.cchScript,3;this.incrementLineCount(this.script.substring(this.ichToken,
b));this.cchToken=b+("*"==a?3:2)-this.ichToken;return 2;default:return 0}var e=0>c;if(e&&!this.haveComments)return 0;this.ichComment>b&&(b=this.ichComment);for(;b<this.cchScript;b++){if(this.eol(a=this.script.charAt(b))){this.ichEnd=b;if(0<b&&this.isLineContinuation(b-1,!1)){b+=this.nCharNewLine(b);continue}if(!e&&";"==a)continue;break}0<=c||"#"==a&&(c=b)}if(0>c)return 0;this.ichComment=c;if(e&&0==this.nTokens&&3<=this.cchScript-c&&"j"==this.script.charAt(c+1)&&"c"==this.script.charAt(c+2))return this.cchToken=
b-this.ichToken,2;if(c!=this.ichToken)return 0;if(e&&this.cchScript>this.ichToken+3&&"j"==this.script.charAt(this.ichToken+1)&&"x"==this.script.charAt(this.ichToken+2)&&JS.ScriptCompiler.isSpaceOrTab(this.script.charAt(this.ichToken+3)))return this.cchToken=4,2;if(b==this.ichToken)return 0;this.cchToken=b-this.ichToken;!e&&(10==this.cchToken&&this.script.substring(this.ichToken,b).equals("//@private"))&&(this.isPrivateScript=!0);return 0==this.nTokens?1:2});f(d,"charAt",function(a){return a<this.cchScript?
this.script.charAt(a):"\x00"},"~N");f(d,"processTokenList",function(a,b){var c=this.ltoken.size();if(0<c||null!=this.comment){if(0==c)this.ichCurrentCommand=this.ichToken,null!=this.comment&&(this.isComment=!0,this.addTokenToPrefix(JS.T.o(0,this.comment)));else if(0<this.setBraceCount&&this.endOfLine&&this.ichToken<this.cchScript)return 2;if(this.wasImpliedScript())return 2;this.isNewSet&&2<c&&1073742336==this.tokAt(2)&&(1275068444==this.tokAt(3)||1140850693==this.tokAt(3)||1275335685==this.tokAt(3)||
1275334681==this.tokAt(3))?(this.ltoken.set(0,JS.T.tokenSet),this.ltoken.add(1,1275334681==this.tokAt(3)?JS.T.tokenAll:this.ltoken.get(1))):0!=this.tokInitialPlusPlus&&(this.isNewSet||this.checkNewSetCommand(),this.tokenizePlusPlus(this.tokInitialPlusPlus,!0),this.ichCurrentCommand-=2);this.iCommand=this.lltoken.size();null!=this.thisFunction&&0>this.thisFunction.cmdpt0&&(this.thisFunction.cmdpt0=this.iCommand);if(1==c&&1==this.braceCount)if(null==this.lastFlowCommand){this.parenCount=this.setBraceCount=
this.braceCount=0;this.ltoken.removeItemAt(0);var e=JS.ContextToken.newContext(!0);this.addTokenToPrefix(this.setCommand(e));this.pushContext(e);this.addBrace(this.tokenCommand)}else this.parenCount=this.setBraceCount=0,this.setCommand(this.lastFlowCommand),102439!=this.lastFlowCommand.tok&&1073742332==this.tokAt(0)&&this.ltoken.removeItemAt(0),this.lastFlowCommand=null,this.forceFlowContext=this.flowContext;if(0<this.bracketCount||0<this.setBraceCount||0<this.parenCount||1==this.braceCount&&!this.checkFlowStartBrace(!0))return this.error(1==
c?2:4),4;this.needRightParen&&(this.addTokenToPrefix(JS.T.tokenRightParen),this.needRightParen=!1);if(1073741974==this.tokAt(1)&&JS.T.tokAttr(this.tokCommand,135168))switch(this.tokAt(2)){case 0:case 4:case 12290:break;default:e=this.ltoken.removeItemAt(2),this.ltoken.add(2,JS.T.o(4,2==e.tok?""+e.intValue:e.value.toString()))}if(0<this.ltoken.size()){if(b&&!this.compileCommand())return 4;this.logMessages&&JU.Logger.info("-------------------------------------");e=!0;switch(this.tokCommand){case 364558:case 102436:case 134320141:case 102409:e=
0<this.atokenInfix.length&&2147483647!=this.atokenInfix[0].intValue}e&&(this.iCommand==this.lnLength&&(this.lineNumbers=JU.AU.doubleLengthShort(this.lineNumbers),e=O(2*this.lnLength,2,0),System.arraycopy(this.lineIndices,0,e,0,this.lnLength),this.lineIndices=e,this.lnLength*=2),this.lineNumbers[this.iCommand]=this.lineNumbers[this.lineNumbers.length-1]=a,this.lineIndices[this.iCommand][0]=this.ichCurrentCommand,this.lineIndices[this.iCommand][1]=Math.max(this.ichCurrentCommand,Math.min(this.cchScript,
this.ichEnd==this.ichCurrentCommand?this.ichToken:this.ichEnd)),this.lltoken.addLast(this.atokenInfix),this.iCommand=this.lltoken.size());36867==this.tokCommand&&(this.lastFlowCommand=null)}this.setCommand(null);this.comment=null;this.iHaveQuotedString=this.isNewSet=this.isSetBrace=this.needRightParen=!1;this.ptNewSetModifier=1;this.ltoken.clear();this.tokInitialPlusPlus=this.nTokens=this.nSemiSkip=0;this.tokenAndEquals=null;this.ptSemi=-10;this.forPoint3=-1;this.setEqualPt=2147483647}var e=null!=
this.flowContext&&0==this.flowContext.addLine,g=(this.endOfLine||!e)&&!this.haveENDIF&&null!=this.flowContext&&this.flowContext.checkForceEndIf(-1);if(this.endOfLine){if(g){if(this.isComment)e||(this.flowContext.addLine++,this.flowContext.forceEndIf=!0);else if(0<c&&!this.haveENDIF||e)this.forceFlowEnd(this.flowContext.token),e||(this.forceFlowContext.forceEndIf=!0);this.isEndOfCommand=!0;this.cchToken=0;this.ichCurrentCommand=this.ichToken;return 2}this.isShowCommand=this.isComment=!1;++this.lineCurrent}else g&&
(this.forceFlowEnd(this.flowContext.token),this.forceFlowContext.forceEndIf=!0);if(this.ichToken>=this.cchScript){this.setCommand(JS.T.tokenAll);this.theTok=0;switch(this.checkFlowEndBrace()){case 4:return 4;case 2:return this.isEndOfCommand=!0,this.cchToken=0,2}this.ichToken=this.cchScript}return 0},"~N,~B");f(d,"addBrace",function(a){this.vBraces.addLast(a);this.iBrace++},"JS.T");f(d,"pushContext",function(a){this.pushCount++;this.vPush.addLast(a)},"JS.T");f(d,"wasImpliedScript",function(){if(this.checkImpliedScriptCmd&&
2<=this.nTokens&&(134222850==this.tokCommand||4124==this.tokCommand)){var a=2==this.nTokens?this.lastToken.value.toString().toUpperCase():null;if(2<this.nTokens?!(268435968==this.tokAt(2)&&this.ltoken.get(1).value.toString().endsWith(".spt")):a.endsWith(".SORT")||a.endsWith(".REVERSE")||a.endsWith(".POP")||0<=a.indexOf(".SORT(")||0<=a.indexOf(".REVERSE(")||0<=a.indexOf(".POP(")||0<=a.indexOf(".PUSH(")||a.endsWith("++")||a.endsWith("--")||a.endsWith("=")||0!=this.tokInitialPlusPlus)return this.ichToken=
this.ichCurrentCommand,this.nTokens=0,this.ltoken.clear(),this.tokCommand=this.cchToken=0,!0}return!1});f(d,"compileCommand",function(){switch(this.ltoken.size()){case 0:return this.atokenInfix=[],!0;case 4:if(this.isNewSet&&this.tokenAt(2).value.equals(".")&&this.tokenAt(3).value.equals("spt")){var a=this.tokenAt(1).value+"."+this.tokenAt(3).value;this.ltoken.clear();this.addTokenToPrefix(JS.T.tokenScript);this.addTokenToPrefix(JS.T.o(4,a));this.isNewSet=!1}}this.setCommand(this.tokenAt(0));a=this.ltoken.size();
1==a&&JS.T.tokAttr(this.tokCommand,524288)&&this.addTokenToPrefix(JS.T.tokenOn);if(null!=this.tokenAndEquals){for(var b,c=0,c=1;c<a&&268442114!=this.tokAt(c);c++);a=c;c++;if(this.ltoken.size()<c)JU.Logger.error("COMPILER ERROR! - andEquals ");else{for(b=1;b<a;b++,c++)this.ltoken.add(c,this.tokenAt(b));this.ltoken.set(a,JS.T.tokenEquals);this.ltoken.add(c,this.tokenAndEquals);this.ltoken.add(++c,JS.T.tokenLeftParen);this.addTokenToPrefix(JS.T.tokenRightParen)}}this.atokenInfix=this.ltoken.toArray(Array(this.ltoken.size()));
return this.compileExpressions()});f(d,"tokenAt",function(a){return this.ltoken.get(a)},"~N");r(d,"tokAt",function(a){return a<this.ltoken.size()?this.tokenAt(a).tok:0},"~N");f(d,"setCommand",function(a){this.tokenCommand=a;null==a?this.tokCommand=0:(this.tokCommand=this.tokenCommand.tok,this.isMathExpressionCommand=1073741824==this.tokCommand||JS.T.tokAttr(this.tokCommand,36864),this.isSetOrDefine=36867==this.tokCommand||12290==this.tokCommand,this.isCommaAsOrAllowed=JS.T.tokAttr(this.tokCommand,
12288),this.implicitString=JS.T.tokAttr(this.tokCommand,20480));return a},"JS.T");f(d,"replaceCommand",function(a){this.ltoken.removeItemAt(0);this.ltoken.add(0,this.setCommand(a))},"JS.T");f(d,"getPrefixToken",function(){this.ident=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(this.ident.equals("NaN"))return this.addTokenToPrefix(JS.SV.vNaN),3;this.identLC=this.ident.toLowerCase();var a=1073742336!=this.lastToken.tok&&!this.isDotDot&&this.isContextVariable(this.identLC),b=this.ident,
c=null;0==this.nTokens&&(this.isUserToken=a);if(1==this.nTokens&&(134320141==this.tokCommand||102436==this.tokCommand||36868==this.tokCommand)||0!=this.nTokens&&a||!this.isDotDot&&this.isUserFunction(this.identLC)&&null!=(c=this.ident)&&(null==this.thisFunction||!this.thisFunction.name.equals(this.identLC)))this.ident=null==c?this.identLC:c,this.theToken=null;else if(1==this.ident.length||268436482==this.lastToken.tok){if(null==(this.theToken=JS.T.getTokenFromName(this.ident))&&null!=(this.theToken=
JS.T.getTokenFromName(this.identLC)))this.theToken=JS.T.tv(this.theToken.tok,this.theToken.intValue,this.ident)}else if(this.theToken=JS.T.getTokenFromName(this.identLC),a&&(null!=this.theToken&&!this.theToken.value.toString().equalsIgnoreCase(this.identLC))&&(this.theToken=null),null!=this.theToken)switch(this.lastToken.tok){default:if(!this.isWhere)break;case 1073742336:case 268437504:case 268436992:this.theToken=JS.T.o(this.theToken.tok,this.ident)}null==this.theToken&&(this.theToken=JS.SV.newSV(0==
this.identLC.indexOf("property_")?1715472409:1073741824,2147483647,this.ident).setName(b));return this.theTok=this.theToken.tok});f(d,"checkSpecialParameterSyntax",function(){if(this.lookingAtString(!this.implicitString)){if(0>this.cchToken)return this.ERROR(4);var a=this.getUnescapedStringLiteral(null!=this.lastToken&&!this.iHaveQuotedString&&1073741984!=this.lastToken.tok&&(36867==this.tokCommand&&2==this.nTokens&&545259546==this.lastToken.tok||134223363==this.tokCommand||1610616835==this.tokCommand||
134222850==this.tokCommand||4124==this.tokCommand));this.iHaveQuotedString=!0;if(JS.ScriptCompiler.allowsData(this.tokCommand)&&134221834==this.lastToken.tok||134221834==this.tokCommand&&0>a.indexOf("@")){if(!this.getData(a))return this.ERROR(11,"data")}else this.addTokenToPrefix(JS.T.o(4,a)),this.implicitString&&(this.ichEnd=this.ichToken+this.cchToken,this.isEndOfCommand=!0);return 2}if(this.nTokens==this.ptNewSetModifier){var a=this.script.charAt(this.ichToken),b=0<="+-\\*/&|=".indexOf(a),c=b||
"."==a||"["==a,e=this.charAt(this.ichToken+1);if(!this.isNewSet&&this.isUserToken&&c&&("="==a||e==a||"="==e))this.isNewSet=!0;if(this.isNewSet||36867==this.tokCommand||JS.T.tokAttr(this.tokCommand,536870912))if("="==a&&(this.setEqualPt=this.ichToken),JS.T.tokAttr(this.tokCommand,536870912)&&"="==a||(this.isNewSet||this.isSetBrace)&&c)switch(this.setCommand(b?JS.T.tokenSet:"["==a&&!this.isSetBrace||"."==a&&"."==e?JS.T.tokenSetArray:JS.T.tokenSetProperty),this.ltoken.add(0,this.tokenCommand),this.cchToken=
1,a.charCodeAt(0)){case 91:return this.tokLastMath=1,this.addTokenToPrefix(JS.T.tokenArrayOpen),this.bracketCount++,2;case 46:if("."==e)return this.addTokenToPrefix(JS.T.tokenArrayOpen),this.cchToken=2,this.isDotDot=!0,2;this.addTokenToPrefix(JS.T.o(1073742336,"."));return 2;case 45:case 43:case 42:case 47:case 92:case 38:case 124:if(0==e.charCodeAt(0))return this.ERROR(4);if(e!=a&&"="!=e)return this.ERROR(1,'"'+a+'"');break;default:return this.lastToken=JS.T.tokenMinus,2}}a:switch(this.tokCommand){case 134222350:switch(this.lastToken.tok){case 4120:case 1296041986:case 1715472409:case 1073877010:2==
this.nTokens&&(this.iHaveQuotedString=!0);break;case 1073741925:case 1073742189:break;default:if(!this.iHaveQuotedString&&2!=this.nTokens)return 0;break}case 134223363:case 134222850:case 4124:case 1275072526:if("@"==this.script.charAt(this.ichToken))return this.iHaveQuotedString=!0,0;switch(this.tokCommand){case 4124:this.haveMacro=!0;break a;case 134223363:a=1073741839==this.tokAt(1);if(1==this.nTokens||a&&(2==this.nTokens||3==this.nTokens&&2==this.tokAt(2))){if(a&&2==this.nTokens&&JU.PT.isDigit(this.charAt(this.ichToken)))break a;
a=JV.Viewer.isDatabaseCode(this.charAt(this.ichToken));if(this.lookingAtLoadFormat(a)){var g=this.script.substring(this.ichToken,this.ichToken+this.cchToken),p=JS.T.getTokenFromName(g.toLowerCase());switch(null==p?0:p.tok){case 1073742015:case 1073742077:case 1073741839:case 1610616855:case 4130:case 1073877011:if(1!=this.nTokens)return 4;case 36868:case 134221834:case 1228935687:case 134217764:case 1073741984:case 1094717454:case 134218757:case 536870926:case 1073741849:case 4108:this.addTokenToPrefix(p);
break;default:p=a?4:JU.PT.isOneOf(g=g.toLowerCase(),";xyz;vxyz;vibration;temperature;occupancy;partialcharge;")?1073741824:0,0!=p&&(this.addTokenToPrefix(JS.T.o(p,g)),this.iHaveQuotedString=4==p)}return 2}break}if("{"==this.script.charAt(this.ichToken)||0<this.parenCount)break a;if(null!=(a=this.lookingAtBitset()))return this.addTokenToPrefix(JS.T.o(10,a)),2}if(!this.iHaveQuotedString&&this.lookingAtImpliedString(134222350==this.tokCommand,134223363==this.tokCommand,1<this.nTokens||134222850!=this.tokCommand&&
4124!=this.tokCommand,!1)){a=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(134222850==this.tokCommand)if(a.startsWith("javascript:"))this.lookingAtImpliedString(!0,!0,!0,!1),a=this.script.substring(this.ichToken,this.ichToken+this.cchToken);else if(0<=a.toUpperCase().indexOf(".PUSH("))return this.cchToken=0,this.iHaveQuotedString=!0,2;this.iHaveQuotedString=!0;this.addTokenToPrefix(JS.T.o(4,a));return 2}break;case 4156:if(1==this.nTokens&&this.lookForSyncID())return g=this.script.substring(this.ichToken,
this.ichToken+this.cchToken),p=JU.PT.parseInt(g),-2147483648==p||1E3>Math.abs(p)?this.addTokenToPrefix(JS.T.o(1073741824,g)):this.addTokenToPrefix(JS.T.i(p)),2;break;case 603983903:if(2==this.nTokens&&134217764==this.lastToken.tok&&this.lookingAtImpliedString(!1,!1,!1,!0))return";"==this.script.charAt(this.ichToken+this.cchToken-1)&&--this.cchToken,g=this.script.substring(this.ichToken,this.ichToken+this.cchToken),this.addTokenToPrefix(JS.T.o(4,g)),2;break;case 134221856:if(2==this.nTokens&&4115==
this.lastToken.tok&&(this.iHaveQuotedString=!0),!this.iHaveQuotedString){if("@"==this.script.charAt(this.ichToken))return this.iHaveQuotedString=!0,0;if(this.lookingAtImpliedString(!0,!0,!0,!1)&&(a=this.script.substring(this.ichToken,this.ichToken+this.cchToken),b=a.indexOf(" as "),0<b&&(a=a.substring(0,this.cchToken=b)),0>a.indexOf(" ")&&0<=a.indexOf(".")))return this.addTokenToPrefix(JS.T.o(4,a)),this.iHaveQuotedString=!0,2}}if((this.implicitString=(new Boolean(this.implicitString&1==this.nTokens)).valueOf())&&
(!(134222850==this.tokCommand||4124==this.tokCommand)||!this.iHaveQuotedString)&&this.lookingAtImpliedString(!0,!0,!0,!1))return a=this.script.substring(this.ichToken,this.ichToken+this.cchToken),1825200146==this.tokCommand&&JU.PT.isOneOf(a.toLowerCase(),";on;off;hide;display;")?this.addTokenToPrefix(JS.T.getTokenFromName(a.toLowerCase())):this.addTokenToPrefix(JS.T.o(4,a)),2;if(this.lookingAtObjectID())return this.addTokenToPrefix(JS.T.getTokenFromName("$")),this.addTokenToPrefix(JS.T.o(1073741824,
this.script.substring(this.ichToken,this.ichToken+this.cchToken))),2;a=this.lookingAtExponential();if(null!=a)return this.addNumber(3,2147483647,a),2;if(this.lookingAtDecimal())return a=Float.$valueOf(this.script.substring(this.ichToken,this.ichToken+this.cchToken)),g=JU.Edge.getFloatEncodedInt(this.script.substring(this.ichToken,this.ichToken+this.cchToken)),this.addNumber(3,g,a),2;if(this.lookingAtSeqcode()){a=this.script.charAt(this.ichToken);try{g="*"==a||"^"==a?2147483647:Integer.parseInt(this.script.substring(this.ichToken,
this.ichToken+this.cchToken-2));p=this.script.charAt(this.ichToken+this.cchToken-1);"^"==p&&(p=" ");0>g&&(g=-g,this.addTokenToPrefix(JS.T.tokenMinus));var j=JM.Group.getSeqcodeFor(g,p);this.addTokenToPrefix(JS.T.tv(5,j,"seqcode"))}catch(d){if(G(d,"NumberFormatException"))return this.ERROR(9,""+a);throw d;}return 2}g=this.lookingAtInteger();if(2147483647!=g){p=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(102407==this.tokCommand||102408==this.tokCommand){if(1!=this.nTokens)return this.ERROR(0);
j=null==this.flowContext?null:this.flowContext.getBreakableContext(g=Math.abs(g));if(null==j)return this.ERROR(1,this.tokenCommand.value);this.tokenAt(0).intValue=j.pt0}this.addNumber(2,g,p);return 2}if(!this.isMathExpressionCommand&&0==this.parenCount||1073741824!=this.lastToken.tok&&!JS.ScriptTokenParser.tokenAttr(this.lastToken,134217728)){g="["==this.script.charAt(this.ichToken);a=this.lookingAtBitset();if(null!=a)return this.addTokenToPrefix(JS.T.o(10,g?JM.BondSet.newBS(a):a)),2;if(g&&(g=this.lookingAtMatrix(),
x(g,"JU.M34")))return this.addTokenToPrefix(JS.T.o(x(g,"JU.M4")?12:11,g)),2}return 0});d.allowsData=f(d,"allowsData",function(a){switch(a){case 134223363:case 135174:case 135180:return!0;default:return!1}},"~N");f(d,"addNumber",function(a,b,c){this.addTokenToPrefix(this.afterWhite==this.ichToken?JS.SV.newSV(a,b,c):JS.T.tv(a,b,c))},"~N,~N,~O");f(d,"lookingAtMatrix",function(){var a,b;if(this.ichToken+4>=this.cchScript||"["!=this.script.charAt(this.ichToken)||"["!=this.script.charAt(this.ichToken+1)||
0>(a=this.script.indexOf("]]",this.ichToken))||null==(b=JU.Escape.unescapeMatrix(this.script.substring(this.ichToken,a+2))))return null;this.cchToken=a+2-this.ichToken;return b});f(d,"parseKnownToken",function(){var a=this.getPrefixToken();if(3==a)return 2;var b;if(this.isDotDot)return 268437504==a?this.bracketCount++:(this.addTokenToPrefix(JS.T.o(4,this.ident)),this.addTokenToPrefix(JS.T.tokenArrayClose)),this.isDotDot=!1,2;0!=this.tokLastMath&&(this.tokLastMath=a);if(null!=this.flowContext&&102410==
this.flowContext.token.tok&&null!=this.flowContext.$var&&102411!=a&&102413!=a&&102410!=this.lastToken.tok)return this.ERROR(1,this.ident);if(12290==this.lastToken.tok&&1073742332!=a&&1!=this.nTokens)return this.addTokenToPrefix(12290==a?this.lastToken:JS.T.o(4,this.ident)),2;switch(a){case 1073741824:if(0==this.nTokens&&!this.checkImpliedScriptCmd){if("'"==this.ident.charAt(0))return this.addTokenToPrefix(this.setCommand(JS.T.tokenScript)),this.cchToken=0,2;if("."==this.charAt(this.ichToken+this.cchToken))return this.addTokenToPrefix(this.setCommand(JS.T.tokenScript)),
this.nTokens=1,this.cchToken=0,this.checkImpliedScriptCmd=!0,2}break;case 268442114:if(this.nSemiSkip==this.forPoint3&&this.nTokens==this.ptSemi+2)return b=this.lastToken,this.addTokenToPrefix(JS.T.tokenEquals),this.addTokenToPrefix(b),b=JS.T.getTokenFromName(this.ident.substring(0,1)),this.addTokenToPrefix(b),this.addTokenToPrefix(JS.T.tokenLeftParen),this.needRightParen=!0,2;this.checkNewSetCommand();return 36867==this.tokCommand?(this.tokenAndEquals=JS.T.getTokenFromName(this.ident.substring(0,
1)),this.setEqualPt=this.ichToken,0):554176565==this.tokCommand||554176526==this.tokCommand?(this.addTokenToPrefix(this.tokenCommand),this.replaceCommand(JS.T.tokenSet),this.tokenAndEquals=JS.T.getTokenFromName(this.ident.substring(0,1)),this.setEqualPt=this.ichToken,0):2;case 268441601:case 268441602:if(0==this.nTokens)return this.tokInitialPlusPlus=this.theToken.tok,2;if(this.afterWhite==this.ichToken||this.afterMath==this.ichToken)this.theToken=JS.T.tv(this.theToken.tok,-1,this.theToken.value);
!this.isNewSet&&1==this.nTokens&&this.checkNewSetCommand();if(this.isNewSet&&0==this.parenCount&&0==this.bracketCount&&this.ichToken<=this.setEqualPt)return this.tokenizePlusPlus(a,!1),2;if(this.nSemiSkip==this.forPoint3&&this.nTokens==this.ptSemi+2)return b=this.lastToken,this.addTokenToPrefix(JS.T.tokenEquals),this.addTokenToPrefix(b),this.addTokenToPrefix(268441601==a?JS.T.tokenMinus:JS.T.tokenPlus),this.addTokenToPrefix(JS.T.i(1)),2;break;case 268440324:0==this.parenCount&&0==this.bracketCount&&
(this.setEqualPt=this.ichToken);break;case 1073742336:36867==this.tokCommand&&(0==this.parenCount&&0==this.bracketCount&&this.ichToken<this.setEqualPt&&1<this.ltoken.size()&&1073742332==this.ltoken.get(1).tok)&&(this.ltoken.set(0,JS.T.tokenSetProperty),this.ltoken.add(1,JS.T.tokenExpressionBegin),this.addTokenToPrefix(JS.T.tokenExpressionEnd),this.setEqualPt=0);break;case 1073742332:if(1==++this.braceCount&&0==this.parenCount&&this.checkFlowStartBrace(!1))return this.isEndOfCommand=!0,a=null!=this.flowContext&&
0==this.flowContext.addLine||null==this.forceFlowContext?this.flowContext:this.forceFlowContext,null!=a&&(a.addLine=0,a.forceEndIf=!1,this.lastToken=JS.T.tokenLeftBrace,this.forceFlowContext=a),2;this.parenCount++;break;case 268435968:this.parenCount++;if(1<this.nTokens&&(1275082241==this.lastToken.tok||134320648==this.lastToken.tok||134320649==this.lastToken.tok))this.nSemiSkip+=2;break;case 1073742338:if(0<this.iBrace&&0==this.parenCount&&0==this.braceCount)if(this.ichBrace=this.ichToken,0==this.nTokens)this.braceCount=
this.parenCount=1;else return this.wasImpliedScript()||(this.braceCount=this.parenCount=this.nSemiSkip=0,this.addBrace(this.theToken),this.isEndOfCommand=!0,this.ichEnd=this.ichToken),2;this.braceCount--;case 268435969:if(0>--this.parenCount)return this.ERROR(16,this.ident);0==this.parenCount&&(this.nSemiSkip=0);this.needRightParen&&(this.addTokenToPrefix(JS.T.tokenRightParen),this.needRightParen=!1);break;case 268437504:0<this.ichToken&&JU.PT.isWhitespace(this.script.charAt(this.ichToken-1))&&this.addTokenToPrefix(JS.T.tokenSpaceBeforeSquare);
this.bracketCount++;break;case 268437505:this.bracketCount--;if(0>this.bracketCount)return this.ERROR(16,"]");break;case 1073742337:return this.isDotDot=!0,this.addTokenToPrefix(JS.T.tokenArrayOpen),2}switch(this.lastToken.tok){case 1073742336:case 1073742337:case 268436992:case 268437504:return 0}switch(a){case 4134:return this.isPrivateFunc=!0,2;case 102409:if(135174==this.tokCommand||4103==this.tokCommand&&1==this.nTokens)break;if(!this.haveENDIF)return 5;case 364548:null!=this.flowContext&&(this.flowContext.forceEndIf=
!1);case 364547:if(0<this.nTokens)return this.isEndOfCommand=!0,this.cchToken=0,2;break;case 134320648:case 102411:case 102413:case 102402:case 134320649:case 102410:case 102406:case 102412:if(1<this.nTokens&&36867!=this.tokCommand&&0==this.nSemiSkip)return this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!0),this.cchToken=0,2}return 0});f(d,"tokenizePlusPlus",function(a,b){b&&(this.setCommand(JS.T.tokenSet),1==this.nTokens&&this.ltoken.add(0,this.tokenCommand));this.nTokens=
this.ltoken.size();this.addTokenToPrefix(JS.T.tokenEquals);this.setEqualPt=0;for(var c=1;c<this.nTokens;c++)this.addTokenToPrefix(this.ltoken.get(c));this.addTokenToPrefix(268441601==a?JS.T.tokenMinus:JS.T.tokenPlus);this.addTokenToPrefix(JS.T.i(1))},"~N,~B");f(d,"checkNewSetCommand",function(){var a=0==this.nTokens?"":this.ltoken.get(0).value.toString();if(0<this.nTokens&&!this.isContextVariable(a.toLowerCase()))return!1;a=this.setNewSetCommand(!1,a);this.setCommand(JS.T.tokenSet);this.ltoken.add(0,
this.tokenCommand);0==this.nTokens?this.ltoken.addLast(a):this.ltoken.set(1,a);return!0});f(d,"parseCommandParameter",function(a,b){this.nTokens=this.ltoken.size();switch(this.tokCommand){case 0:this.lastToken=JS.T.tokenOff;this.ichCurrentCommand=this.ichEnd=this.ichToken;this.setCommand(this.theToken);this.logMessages&&JU.Logger.info("compiling "+this.theToken);var c=JS.T.tokAttr(this.tokCommand,102400);c&&(this.lastFlowCommand=this.tokenCommand);var e=this.checkFlowEndBrace();if(4==e)return 4;if(2==
e)return this.isEndOfCommand=!0,this.cchToken=0,268435968==this.theTok&&this.parenCount--,2;switch(this.theTok){case 1073742332:break;case 268436482:return this.braceCount++,this.isEndOfCommand=!0,0;case 102409:return 0;case 364547:case 102402:if(this.fixFlowAddLine(this.flowContext),102409==this.lltoken.get(this.iCommand-1)[0].tok&&null!=this.forceFlowContext&&this.forceFlowContext.forceEndIf&&0<this.forceFlowContext.addLine&&this.isFlowIfContextOK(this.forceFlowContext))this.flowContext=this.forceFlowContext,
this.flowContext.forceEndIf=!0,this.lltoken.removeItemAt(--this.iCommand);else if(null!=this.flowContext&&0<this.flowContext.addLine)for(;null!=this.flowContext&&!this.isFlowIfContextOK(this.flowContext);)if(this.flowContext.checkForceEndIf(0))this.forceFlowEnd(this.flowContext.token),this.processTokenList(a,b),this.fixFlowAddLine(this.flowContext),this.setCommand(this.theToken),this.theTok=this.theToken.tok;else break;default:if(c)switch(this.checkFlowCommand(this.tokenCommand.value)){case 4:return 4;
case 2:return 2;case 5:return 5;case 0:return this.theToken=this.tokenCommand,102411==this.theTok&&(this.addTokenToPrefix(this.tokenCommand),this.theToken=JS.T.tokenLeftParen),0}if(null!=this.flowContext&&!this.haveENDIF&&0<this.flowContext.addLine)for(this.fixFlowAddLine(this.flowContext);null!=this.flowContext;)if(this.flowContext.checkForceEndIf(0))this.forceFlowEnd(this.flowContext.token),this.processTokenList(a,b),this.setCommand(this.theToken),this.theTok=this.theToken.tok;else break;if(1073742338==
this.theTok)return this.forceFlowContext=null,this.addBrace(this.tokenCommand),this.tokCommand=0,2;this.lastFlowCommand=null}if(268438528==this.theTok){this.setCommand(this.theToken=JS.T.o(4143,"resume"));this.addTokenToPrefix(this.theToken);this.theToken=JS.T.o(14,"context");break}if(JS.T.tokAttr(this.tokCommand,4096))break;if(this.isSetBrace=1073742332==this.theTok)this.lookingAtSetBraceSyntax()||(this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!1));else switch(this.theTok){case 268441602:case 268441601:return this.tokInitialPlusPlus=
this.theTok,this.tokCommand=0,2;case 1073741824:case 36868:case 12290:case 268435968:break;default:if(!JS.T.tokAttr(this.theTok,1073741824)&&!JS.T.tokAttr(this.theTok,536870912)&&!this.isContextVariable(this.identLC))return this.commandExpected(),4}this.theToken=this.setNewSetCommand(this.isSetBrace,this.ident);break;case 102412:switch(this.nTokens){case 1:if(268435968!=this.theTok)return this.ERROR(15,"(");break;case 2:268435969!=this.theTok&&(this.tokenCommand.name0=this.ident);this.newContextVariable(this.ident);
break;case 3:if(268435969!=this.theTok)return this.ERROR(15,")");this.isEndOfCommand=!0;this.ichEnd=this.ichToken+1;this.flowContext.setLine();break;default:return this.ERROR(0)}break;case 102436:case 134320141:if(0==this.tokenCommand.intValue){if(1!=this.nTokens)break;this.tokenCommand.value=this.ident;return 2}if(1==this.nTokens){null!=this.thisFunction&&this.vFunctionStack.add(0,this.thisFunction);this.thisFunction=102436==this.tokCommand?J.api.Interface.getInterface("JS.ScriptParallelProcessor",
null,null):new JS.ScriptFunction(this.ident,this.tokCommand);this.thisFunction.set(this.ident,this.tokCommand);this.thisFunction.isPrivate=this.isStateScript||this.isPrivateScript||this.isPrivateFunc;this.isPrivateFunc=!1;this.htUserFunctions.put(this.ident,Boolean.TRUE);this.flowContext.setFunction(this.thisFunction);break}if(2==this.nTokens){if(268435968!=this.theTok)return this.ERROR(15,"(");break}if(3==this.nTokens&&268435969==this.theTok)break;if(0==this.nTokens%2){if(268436992!=this.theTok&&
268435969!=this.theTok)return this.ERROR(15,")");break}this.thisFunction.addVariable(this.ident,!0);break;case 102411:if(1<this.nTokens&&0==this.parenCount&&0==this.braceCount&&268436482==this.theTok)return this.addTokenToPrefix(JS.T.tokenRightParen),this.braceCount=1,this.isEndOfCommand=!0,this.cchToken=0,2;break;case 102413:if(1<this.nTokens)return this.braceCount=1,this.isEndOfCommand=!0,this.cchToken=0,2;break;case 364547:if(1==this.nTokens&&134320649!=this.theTok)return this.isEndOfCommand=!0,
this.cchToken=0,2;if(1!=this.nTokens||134320649!=this.theTok&&1073742332!=this.theTok)return this.ERROR(0);this.replaceCommand(this.flowContext.token=JS.ContextToken.newCmd(102402,"elseif"));this.tokCommand=102402;return 2;case 102409:if(1!=this.nTokens)return this.ERROR(0);if(!this.checkFlowEnd(this.theTok,this.ident,this.ichCurrentCommand,!0))return 4;if(134320141==this.theTok||102436==this.theTok)return 2;break;case 134320648:if(1==this.nTokens){if(268435968!=this.theTok)return this.ERROR(19,this.ident);
this.forPoint3=this.nSemiSkip=0;this.nSemiSkip+=2;break}if(3==this.nTokens&&36868==this.tokAt(2)){this.newContextVariable(this.ident);break}if((3==this.nTokens||4==this.nTokens)&&1275068432==this.theTok){this.nSemiSkip-=2;this.forPoint3=2;this.addTokenToPrefix(this.theToken);this.theToken=JS.T.tokenLeftParen;break}case 102410:case 102406:case 102402:case 134320649:if(2>=this.nTokens||0!=this.braceCount||0!=this.parenCount)break;case 102439:this.isEndOfCommand=!0;this.ichEnd=this.ichToken+1;this.flowContext.setLine();
break;case 36868:if(1==this.nTokens){this.replaceCommand(JS.T.tokenSetVar);this.newContextVariable(this.ident);break}else{if(this.ident.equals(","))return 2;if(JU.PT.isLetter(this.ident.charAt(0))){this.newContextVariable(this.ident);break}else{if(2!=this.nTokens||this.ident.equals("["))return this.ERROR(0);this.replaceCommand(JS.T.tokenSet)}}case 36867:1073742332==this.theTok?this.setBraceCount++:1073742338==this.theTok&&(this.setBraceCount--,this.isSetBrace&&(0==this.setBraceCount&&2147483647==
this.ptNewSetModifier)&&(this.ptNewSetModifier=this.nTokens+1));if(this.nTokens==this.ptNewSetModifier){c=this.tokenAt(0);if(268435968==this.theTok||this.isUserFunction(c.value.toString())){this.ltoken.set(0,this.setCommand(JS.T.tv(1073741824,0,c.value)));this.setBraceCount=0;break}if(1111490588!=this.theTok&&1073741824!=this.theTok&&268442114!=this.theTok&&12290!=this.theTok&&!JS.T.tokAttr(this.theTok,536870912))return this.isNewSet?this.commandExpected():this.errorIntStr2(18,"SET",": "+this.ident),
4;if(1==this.nTokens&&(268441602==this.lastToken.tok||268441601==this.lastToken.tok)){this.replaceCommand(JS.T.tokenSet);this.addTokenToPrefix(this.lastToken);break}}break;case 134223363:if(12290==this.theTok&&(1==this.nTokens||1073741940==this.lastToken.tok||134217764==this.lastToken.tok))return this.addTokenToPrefix(JS.T.tokenDefineString),2;1073741848==this.theTok&&(this.iHaveQuotedString=!1);break;case 12290:if(1==this.nTokens){if(1073741824!=this.theTok)if(this.preDefining){if(!JS.T.tokAttr(this.theTok,
2097152))return this.errorStr2("ERROR IN Token.java or JmolConstants.java -- the following term was used in JmolConstants.java but not listed as predefinedset in Token.java: "+this.ident,null),4}else JS.T.tokAttr(this.theTok,2097152)?JU.Logger.warn("WARNING: predefined term '"+this.ident+"' has been redefined by the user until the next file load."):!this.isCheckOnly&&1<this.ident.length&&(JU.Logger.warn("WARNING: redefining "+this.ident+"; was "+this.theToken+"not all commands may continue to be functional for the life of the applet!"),
this.theTok=this.theToken.tok=1073741824,JS.T.addToken(this.ident,this.theToken));this.addTokenToPrefix(this.theToken);this.lastToken=JS.T.tokenComma;return 2}if(2==this.nTokens&&268440324==this.theTok)return this.ltoken.add(0,JS.T.tokenSet),2;break;case 135190:case 135188:case 135180:c=this.charAt(this.ichToken+this.cchToken),0==this.parenCount&&(0==this.bracketCount&&0<=".:/\\+-!?".indexOf(c)&&!("-"==c&&this.ident.equals("=")))&&this.checkUnquotedFileName()}return 0},"~N,~B");f(d,"setNewSetCommand",
function(a,b){this.tokCommand=36867;this.isNewSet=!a&&!this.isUserFunction(b);this.setBraceCount=a?1:0;this.bracketCount=0;this.setEqualPt=2147483647;this.ptNewSetModifier=this.isNewSet?b.equals("(")?2:1:2147483647;return a||268435968==this.theToken.tok||536870918==this.theToken.tok||268441602==this.theToken.tok||268441601==this.theToken.tok?this.theToken:JS.T.o(1073741824,b)},"~B,~S");f(d,"checkUnquotedFileName",function(){for(var a=this.ichToken,b;++a<this.cchScript&&!JU.PT.isWhitespace(b=this.script.charAt(a))&&
"#"!=b&&";"!=b&&"}"!=b;);b=this.script.substring(this.ichToken,a).$replace("\\","/");this.cchToken=a-this.ichToken;this.theToken=JS.T.o(4,b)});f(d,"checkFlowStartBrace",function(a){var b=this.tokCommand;switch(b){default:if(JS.T.tokAttr(b,102400)){if(a){switch(b){case 102411:case 102413:break;default:this.flowContext.addLine=0,this.addBrace(this.tokenCommand),this.lastFlowCommand=null}this.parenCount=this.braceCount=0}return!0}case 102407:case 102408:return!1}},"~B");f(d,"checkFlowEndBrace",function(){if(0>=
this.iBrace||1073742338!=this.vBraces.get(this.iBrace-1).tok)return 0;this.vBraces.removeItemAt(--this.iBrace);var a=this.vBraces.removeItemAt(--this.iBrace);1073742332==this.theTok&&(this.braceCount--,this.parenCount--);if(1275335685==a.tok)return this.vPush.removeItemAt(--this.pushCount),this.addTokenToPrefix(this.setCommand(JS.ContextToken.newContext(!1))),this.isEndOfCommand=!0,2;switch(null==this.flowContext?0:this.flowContext.token.tok){case 134320649:case 102402:case 364547:if(364547==this.tokCommand||
102402==this.tokCommand)return 0;break;case 102410:case 102411:case 102413:if(102411==this.tokCommand||102413==this.tokCommand)return 0}return this.forceFlowEnd(a)});f(d,"forceFlowEnd",function(a){var b=this.tokenCommand;this.forceFlowContext=this.flowContext;a=this.flowStart(a);if(!this.checkFlowEnd(a.tok,a.value,this.ichBrace,!1))return 4;switch(a.tok){case 134320141:case 102436:case 364558:break;default:this.addTokenToPrefix(a)}this.setCommand(b);return 2},"JS.T");f(d,"flowStart",function(a){switch(a.tok){case 134320649:case 364547:case 102402:return JS.T.tokenIf;
case 102413:case 102411:return JS.T.tokenSwitch;default:return JS.T.getTokenFromName(a.value)}},"JS.T");d.isBreakableContext=f(d,"isBreakableContext",function(a){return 134320648==a||102439==a||102406==a||102411==a||102413==a},"~N");f(d,"checkFlowCommand",function(a){var b=this.lltoken.size();switch(this.tokCommand){case 364548:if(!this.isFlowIfContextOK(this.flowContext)){if(!this.haveENDIF)return 5;this.errorStr(1,a);return 4}this.flowContext.token.intValue=this.flowContext.setPt0(b,!1);this.setFlowEnd(this.tokCommand,
a);this.flowContext=this.flowContext.parent;return 0;case 102407:case 102408:b=null==this.flowContext?null:this.flowContext.getBreakableContext(0);if(102408==this.tokCommand)for(;null!=b&&134320648!=b.token.tok&&102406!=b.token.tok;)b=b.parent;if(null==b)return this.errorStr(1,a),4;this.setCommand(JS.T.tv(this.tokCommand,b.pt0,a));this.theToken=this.tokenCommand;return 1;case 134320141:case 102436:if(null!=this.flowContext)return this.errorStr(1,JS.T.nameOf(this.tokCommand)),4;break;case 102402:case 364547:null!=
this.flowContext&&!this.isFlowIfContextOK(this.flowContext)&&(this.flowContext=this.flowContext.parent);if(!this.isFlowIfContextOK(this.flowContext)){if(!this.haveENDIF)return 5;this.errorStr(1,a);return 4}this.flowContext.token.intValue=this.flowContext.setPt0(b,!1);break;case 102411:case 102413:if(null==this.flowContext||102410!=this.flowContext.token.tok&&102411!=this.flowContext.token.tok&&(102413==this.tokCommand?0<this.flowContext.ptDefault:102413!=this.flowContext.token.tok))return this.errorStr(1,
a),4;this.flowContext.token.intValue=this.flowContext.setPt0(b,102413==this.tokCommand)}a=JS.ContextToken.newCmd(this.tokCommand,this.tokenCommand.value);102410==this.tokCommand&&a.addName("_var");this.setCommand(a);switch(this.tokCommand){case 364558:this.flowContext=new JS.ScriptFlowContext(this,a,b,this.flowContext,this.ichCurrentCommand,this.lineCurrent);null!=this.thisFunction&&this.vFunctionStack.add(0,this.thisFunction);this.thisFunction=new JS.ScriptFunction("",364558);this.flowContext.setFunction(this.thisFunction);
this.pushContext(a);break;case 102411:case 102413:a.contextVariables=this.flowContext.token.contextVariables;case 364547:case 102402:this.flowContext.token=a;break;case 102439:case 134320648:case 102406:case 102412:this.pushContext(a);default:this.flowContext=new JS.ScriptFlowContext(this,a,b,this.flowContext,this.ichCurrentCommand,this.lineCurrent)}return 0},"~S");f(d,"setFlowEnd",function(a,b){this.setCommand(JS.T.tv(a,0<this.flowContext.ptDefault?this.flowContext.ptDefault:-this.flowContext.pt0,
b))},"~N,~S");f(d,"isFlowIfContextOK",function(a){switch(null==a?0:a.token.tok){case 134320649:case 102402:return!0;case 364547:return 364547!=this.tokCommand}return!1},"JS.ScriptFlowContext");f(d,"checkFlowEnd",function(a,b,c,e){if(e){if(null==this.flowContext)return this.errorStr(1,"end "+b);this.flowContext.addLine=0;this.flowContext.forceEndIf=!1;switch(this.flowContext.token.tok){case 134320141:case 102436:case 364558:break;default:this.setFlowEnd(102409,"end"),this.ltoken.set(0,this.tokenCommand)}}else this.setFlowEnd(102409,
"end"),this.addTokenToPrefix(this.tokenCommand);if(null==this.flowContext||a!=this.flowContext.tok0)return this.errorStr(1,"end "+b);var g=this.lltoken.size();this.flowContext.token.intValue=102412==this.tokCommand?-g:g;switch(a){case 134320649:case 102410:break;case 102412:case 134320648:case 102439:case 102406:e||this.vPush.removeItemAt(--this.pushCount);break;case 102436:case 134320141:case 364558:this.isCheckOnly||(this.addTokenToPrefix(JS.T.o(a,this.thisFunction)),JS.ScriptFunction.setFunction(this.thisFunction,
this.script,c,this.lltoken.size(),this.lineNumbers,this.lineIndices,this.lltoken));this.thisFunction=0==this.vFunctionStack.size()?null:this.vFunctionStack.removeItemAt(0);this.tokenCommand.intValue=0;364558==a&&this.vPush.removeItemAt(--this.pushCount);break;default:return this.errorStr(19,"end "+b)}this.flowContext=this.flowContext.parent;this.fixFlowAddLine(this.flowContext);return!0},"~N,~S,~N,~B");f(d,"fixFlowAddLine",function(a){for(;null!=a;){if(0<a.addLine||a.forceEndIf)a.addLine=this.lineCurrent-
a.ptLine,a.forceEndIf=!0;a=a.parent}},"JS.ScriptFlowContext");f(d,"getData",function(a){this.addTokenToPrefix(JS.T.o(4,a));this.ichToken+=a.length+2;"\r"==this.charAt(this.ichToken)&&(this.lineCurrent++,this.ichToken++);"\n"==this.charAt(this.ichToken)&&(this.lineCurrent++,this.ichToken++);var b=this.script.indexOf(this.chFirst+a+this.chFirst,this.ichToken)-4;if(0>b||!this.script.substring(b,b+4).equalsIgnoreCase("END "))return!1;var c=this.script.substring(this.ichToken,b);this.incrementLineCount(c);
this.addTokenToPrefix(JS.T.o(134221834,c));this.addTokenToPrefix(JS.T.o(1073741824,"end"));this.addTokenToPrefix(JS.T.o(4,a));this.cchToken=b-this.ichToken+a.length+6;return!0},"~S");f(d,"incrementLineCount",function(a){var b,c=a.indexOf("\r"),e=a.indexOf("\n");if(0>c&&0>e)return 0;var g=this.lineCurrent;if(0>c||e<c)c=e;for(e=a.length;--e>=c;)("\n"==(b=a.charAt(e))||"\r"==b)&&this.lineCurrent++;return this.lineCurrent-g},"~S");d.isSpaceOrTab=f(d,"isSpaceOrTab",function(a){return" "==a||"\t"==a||8194==
a.charCodeAt(0)||160==a.charCodeAt(0)},"~S");f(d,"eol",function(a){return"\x00"==a||"\r"==a||"\n"==a||";"==a&&0>=this.nSemiSkip},"~S");f(d,"lookingAtSetBraceSyntax",function(){for(var a=this.ichToken,b=1;++a<this.cchScript&&0<b;)switch(this.script.charAt(a).charCodeAt(0)){case 123:b++;break;case 125:b--}if("["==this.charAt(a)&&1==++b)for(;++a<this.cchScript&&0<b;)switch(this.script.charAt(a).charCodeAt(0)){case 91:b++;break;case 93:"["==this.charAt(a+1)?a++:b--}return"."==this.charAt(a)&&0==b?!0:
!1});f(d,"lookingAtString",function(a){if(this.ichToken+2>this.cchScript)return!1;this.chFirst=this.script.charAt(this.ichToken);if('"'!=this.chFirst&&(!a||"'"!=this.chFirst))return!1;a=this.ichToken;for(var b,c=!1;++a<this.cchScript;){b=this.script.charAt(a);if(b==this.chFirst&&!c)break;c="\\"==b?!c:!1}a==this.cchScript?(this.cchToken=-1,this.ichEnd=this.cchScript):this.cchToken=++a-this.ichToken;return!0},"~B");f(d,"getUnescapedStringLiteral",function(a){return a&&(a=this.script.substring(this.ichToken+
1,this.ichToken+this.cchToken-1),0<=a.indexOf("\\u")&&(a=JU.Escape.unescapeUnicode(a)),0!=a.indexOf(";base64,"))?a:JS.ScriptCompiler.unescapeString(this.script,this.ichToken+1,this.cchToken-2)},"~B");d.unescapeString=f(d,"unescapeString",function(a,b,c){var e=JU.SB.newN(c);for(c=b+c;b<c;){var g=a.charAt(b++);if("\\"==g&&b<c)switch(g=a.charAt(b++),g.charCodeAt(0)){case 110:g="\n";break;case 116:g="\t";break;case 114:g="\r";case 34:case 92:case 39:break;case 120:case 117:var p="x"==g?2:4;if(b<c){for(g=
0;0<=--p&&b<c;){var j=a.charAt(b),j=JU.Escape.getHexitValue(j);if(0>j)break;g<<=4;g+=j;++b}g=String.fromCharCode(g)}}e.appendC(g)}return e.toString()},"~S,~N,~N");f(d,"lookingAtLoadFormat",function(a){for(var b=this.ichToken,c;JU.PT.isLetterOrDigit(c=this.charAt(b))&&(a||JU.PT.isLetter(c))||a&&!this.eol(c)&&!JU.PT.isWhitespace(c);)++b;if(!a&&b==this.ichToken||!JS.ScriptCompiler.isSpaceOrTab(c))return!1;this.cchToken=b-this.ichToken;return!0},"~B");f(d,"lookingAtImpliedString",function(a,b,c,e){var g=
this.ichToken,p=this.script.charAt(g),j=1073741974==this.lastToken.tok,d=JS.T.tokAttr(this.tokCommand,20480)&&1==(this.tokCommand&1),f="@"==p;if(f&&(g+3<this.cchScript&&"{"==this.script.charAt(g+1))&&(j||!d))return!1;for(var d=j=-1,q=!0,k=0;q&&(!this.eol(p=this.charAt(g))||e&&";"==p);){switch(p.charCodeAt(0)){case 59:if(g+5>this.cchScript||g+2<this.cchScript&&(0>".01234567890-".indexOf(this.script.charAt(g+1))||"-"==this.script.charAt(g+2))){q=!1;continue}break;case 40:if(!c&&(4124==this.tokCommand||
5<=g&&(this.script.substring(g-4,g).equals(".spt")||this.script.substring(g-4,g).equals(".png")||this.script.substring(g-5,g).equals(".pngj")))){q=!1;continue}break;case 61:if(!b){q=!1;continue}break;case 123:k++;break;case 125:if(k--,0>k&&(0<this.braceCount||0<this.iBrace)){q=!1;continue}default:JU.PT.isWhitespace(p)?0>j&&(j=g):d=g}++g}if(f&&(0>j||j>d))return!1;a?g=d+1:0<j&&(g=j);return f&&(!a||0>j&&0>=k&&1<g-this.ichToken)?!1:0<(this.cchToken=g-this.ichToken)},"~B,~B,~B,~B");f(d,"lookingAtExponential",
function(){if(this.ichToken==this.cchScript)return null;var a=this.ichToken,b=a;"-"==this.script.charAt(a)&&++a;for(var c=!1,e="X";JU.PT.isDigit(e=this.charAt(a));)++a,c=!0;for(a<this.cchScript&&"."==e&&++a;JU.PT.isDigit(e=this.charAt(a));)++a,c=!0;if(a==this.cchScript||!c||(c="E"!=e&&"e"!=e)||++a==this.cchScript)return null;e=this.script.charAt(a);for(("-"==e||"+"==e)&&a++;JU.PT.isDigit(this.charAt(a));)a++,c=!0;if(!c)return null;this.cchToken=a-this.ichToken;return Float.$valueOf(JU.PT.dVal(this.script.substring(b,
a)))});f(d,"lookingAtDecimal",function(){if(this.ichToken==this.cchScript)return!1;var a=this.ichToken;"-"==this.script.charAt(a)&&++a;for(var b=!1,c;JU.PT.isDigit(c=this.charAt(a++));)b=!0;if("."!=c)return!1;c=this.charAt(a);if(!JS.ScriptCompiler.isSpaceOrTab(c)&&!this.eol(c)&&(JU.PT.isLetter(c)||"?"==c||"*"==c||"_"==c||JU.PT.isLetter(c=this.charAt(a+1))||"?"==c))return!1;for(;JU.PT.isDigit(this.charAt(a));)++a,b=!0;this.cchToken=a-this.ichToken;return b});f(d,"lookingAtSeqcode",function(){var a=
this.ichToken,b;if("^"==this.charAt(a+1)&&"*"==this.script.charAt(a))b="^",++a;else for("-"==this.script.charAt(a)&&++a;JU.PT.isDigit(b=this.charAt(a));)++a;if("^"!=b)return!1;a++;b=a==this.cchScript?" ":this.script.charAt(a++);if(" "!=b&&"*"!=b&&"?"!=b&&!JU.PT.isLetter(b))return!1;this.cchToken=a-this.ichToken;return!0});f(d,"lookingAtInteger",function(){if(this.ichToken==this.cchScript)return 2147483647;var a=this.ichToken;"-"==this.script.charAt(this.ichToken)&&++a;for(var b=a;JU.PT.isDigit(this.charAt(a));)++a;
if(b==a)return 2147483647;this.cchToken=a-this.ichToken;try{return Integer.parseInt(this.ident=this.script.substring(this.ichToken,a))}catch(c){if(!G(c,"NumberFormatException"))throw c;}return 2147483647});f(d,"lookingAtBitset",function(){if(this.script.indexOf("({null})",this.ichToken)==this.ichToken)return this.cchToken=8,new JU.BS;var a;if(this.ichToken+4>this.cchScript||"{"!=this.script.charAt(this.ichToken+1)||0>(a=this.script.indexOf("}",this.ichToken))||a+1==this.cchScript)return null;var b=
JU.BS.unescape(this.script.substring(this.ichToken,a+2));null!=b&&(this.cchToken=a+2-this.ichToken);return b});f(d,"lookingAtObjectID",function(){var a=1==this.nTokens,b=this.ichToken;if("$"!=this.charAt(b)||'"'==this.charAt(++b))return!1;for(;b<this.cchScript;){var c;if(JU.PT.isWhitespace(c=this.script.charAt(b))){if(b==this.ichToken+1)return!1;break}if(!JU.PT.isLetterOrDigit(c))switch(c.charCodeAt(0)){default:return!1;case 42:if(!a)return!1;case 126:case 95:}b++}this.cchToken=b-++this.ichToken;
return!0});f(d,"lookingAtLookupToken",function(a){if(a==this.cchScript)return!1;var b=a;this.afterMath=0!=this.tokLastMath?a:0;this.tokLastMath=0;var c;switch((c=this.script.charAt(a++)).charCodeAt(0)){case 45:case 43:case 38:case 124:case 42:if(a<this.cchScript)if(this.script.charAt(a)==c){++a;if("-"==c||"+"==c)break;"&"==c&&this.charAt(a)==c&&++a}else"="==this.script.charAt(a)&&++a;this.tokLastMath=1;break;case 47:if("/"==this.charAt(a))break;case 92:case 33:"="==this.charAt(a)&&++a;this.tokLastMath=
1;break;case 41:case 93:case 125:break;case 46:"."==this.charAt(a)&&++a;this.tokLastMath=1;break;case 64:case 123:this.tokLastMath=2;break;case 58:this.tokLastMath=1;break;case 40:case 44:case 36:case 59:case 91:case 37:this.tokLastMath=1;break;case 60:case 61:case 62:("<"==(c=this.charAt(a))||"="==c||">"==c)&&++a;this.tokLastMath=1;break;default:if(!JU.PT.isLetter(c)&&!this.isDotDot)return!1;case 126:case 95:case 39:case 63:"?"==c&&(this.tokLastMath=1);for(;JU.PT.isLetterOrDigit(c=this.charAt(a))||
"_"==c||"*"==c&&"?"==this.charAt(a-1)||"?"==c||"~"==c||"'"==c||"\\"==c&&"?"==this.charAt(a+1)||"^"==c&&a>b&&JU.PT.isDigit(this.charAt(a-1));)++a}this.cchToken=a-b;return!0},"~N");f(d,"lookForSyncID",function(){var a;if('"'==(a=this.charAt(this.ichToken))||"@"==a||"\x00"==a)return!1;for(var b=this.ichToken;!JS.ScriptCompiler.isSpaceOrTab(a=this.charAt(b))&&"#"!=a&&"}"!=a&&!this.eol(a);)++b;this.cchToken=b-this.ichToken;return!0});f(d,"ERROR",function(a){this.errorIntStr2(a,null,null);return 4},"~N");
f(d,"ERROR",function(a,b){this.errorStr(a,b);return 4},"~N,~S");f(d,"handleError",function(){this.errorType=this.errorMessage;var a=this.script,b=a.indexOf("; ## GUI ##");0>b&&(b=this.ichEnd);this.errorLine=a.substring(this.ichCurrentCommand,Math.min(b,this.ichEnd<=this.ichCurrentCommand?this.ichToken+this.cchToken:this.ichEnd));a=(this.ichToken<this.ichEnd?this.errorLine.substring(0,this.ichToken-this.ichCurrentCommand)+" >>>> "+this.errorLine.substring(this.ichToken-this.ichCurrentCommand):this.errorLine)+
" <<<<";this.errorMessage=J.i18n.GT.$("script compiler ERROR: ")+this.errorMessage+JS.ScriptError.getErrorLineMessage(null,this.filename,this.lineCurrent,this.iCommand,a);if(!this.isSilent){for(this.ichToken=Math.max(this.ichEnd,this.ichToken);!this.lookingAtEndOfLine()&&!this.lookingAtTerminator();)this.ichToken++;this.errorLine=this.script.substring(this.ichCurrentCommand,this.ichToken);this.vwr.addCommand(this.errorLine+"#??");JU.Logger.error(this.errorMessage)}return!1})});H("JS");L(["J.thread.JmolThread"],
"JS.ScriptDelayThread",null,function(){var d=M(function(){this.millis=0;this.script=null;this.seconds=0;this.isPauseDelay=this.doPopPush=!1;K(this,arguments)},JS,"ScriptDelayThread",J.thread.JmolThread);S(d,function(a,b,c){W(this,JS.ScriptDelayThread,[]);this.setViewer(b,"ScriptDelayThread");this.millis=c;this.setEval(a)},"J.api.JmolScriptEvaluator,JV.Viewer,~N");r(d,"run1",function(a){for(;;)switch(a){case -1:var b;this.doPopPush=0<this.millis;this.isPauseDelay=-100==this.millis;if(this.doPopPush){if(0<
(b=this.vwr.getDelayMaximumMs())&&this.millis>b)this.millis=b}else this.millis=-this.millis;this.millis-=System.currentTimeMillis()-this.startTime;this.isJS?this.seconds=0:(this.seconds=T(this.millis/1E3),this.millis-=1E3*this.seconds,0>=this.millis&&(this.millis=1));this.doPopPush&&this.vwr.popHoldRepaint("scriptDelayThread INIT");a=0;break;case 0:if(this.stopped||this.eval.isStopped()){a=-2;break}if(!this.runSleep(0<this.seconds--?1E3:this.millis,-2))return;0>this.seconds&&(this.millis=0);a=0<this.seconds||
0<this.millis?0:-2;break;case -2:this.doPopPush&&this.vwr.pushHoldRepaintWhy("scriptdelaythread FINISH");this.isPauseDelay&&this.eval.notifyResumeStatus();if(null!=this.script){this.eval.popContext(!1,!1);this.vwr.script(this.script);return}this.resumeEval();return}},"~N");f(d,"setScript",function(a){this.script=a},"~S")});H("JS");L(["J.api.JmolScriptEvaluator"],"JS.ScriptError",["JU.PT","J.i18n.GT","JS.ScriptException"],function(){var d=M(function(){this.vwr=null;this.$error=this.ignoreError=this.fromMenu=
this.chk=!1;this.errorType=this.errorMessageUntranslated=this.errorMessage=null;this.iCommandError=0;K(this,arguments)},JS,"ScriptError",null,J.api.JmolScriptEvaluator);r(d,"getErrorMessage",function(){return this.errorMessage});r(d,"getErrorMessageUntranslated",function(){return null==this.errorMessageUntranslated?this.errorMessage:this.errorMessageUntranslated});f(d,"invArg",function(){this.error(22)});f(d,"invArgStr",function(a){this.errorOrWarn(22,a,null,null,!1)},"~S");f(d,"bad",function(){this.error(2)});
f(d,"integerOutOfRange",function(a,b){this.errorOrWarn(21,""+a,""+b,null,!0)},"~N,~N");f(d,"numberOutOfRange",function(a,b){this.errorOrWarn(36,""+a,""+b,null,!0)},"~N,~N");f(d,"error",function(a){this.errorOrWarn(a,null,null,null,!1)},"~N");f(d,"errorStr",function(a,b){this.errorOrWarn(a,b,null,null,!1)},"~N,~S");f(d,"errorStr2",function(a,b,c){this.errorOrWarn(a,b,c,null,!1)},"~N,~S,~S");f(d,"errorMore",function(a,b,c,e){this.errorOrWarn(a,b,c,e,!1)},"~N,~S,~S,~S");f(d,"warning",function(a,b,c){this.errorOrWarn(a,
b,c,null,!0)},"~N,~S,~S");f(d,"errorOrWarn",function(a,b,c,e,g){var p=this.ignoreError?null:JS.ScriptError.errorString(a,b,c,e,!0);a=this.ignoreError||!J.i18n.GT.getDoTranslate()?null:JS.ScriptError.errorString(a,b,c,e,!1);g||this.evalError(p,a);this.showStringPrint(p,!0)},"~N,~S,~S,~S,~B");f(d,"evalError",function(a,b){if(this.ignoreError)throw new NullPointerException;null==b&&(b=a);this.chk||(this.fromMenu&&this.vwr.alert("Script Error: "+a),this.setCursorWait(!1),this.vwr.setBooleanProperty("refreshing",
!0),this.vwr.setStringProperty("_errormessage",b));throw new JS.ScriptException(this,a,b,!0);},"~S,~S");f(d,"setCursorWait",function(a){this.chk||this.vwr.setCursor(a?3:0)},"~B");d.errorString=f(d,"errorString",function(a,b,c,e,g){e=!1;!g&&!0==(e=J.i18n.GT.getDoTranslate())&&J.i18n.GT.setDoTranslate(!1);switch(a){default:a="Unknown error message number: "+a;break;case 0:a=J.i18n.GT.$("x y z axis expected");break;case 1:a=J.i18n.GT.$("{0} not allowed with background model displayed");break;case 2:a=
J.i18n.GT.$("bad argument count");break;case 3:a=J.i18n.GT.$("Miller indices cannot all be zero.");break;case 4:a=J.i18n.GT.$("bad [R,G,B] color");break;case 5:a=J.i18n.GT.$("boolean expected");break;case 6:a=J.i18n.GT.$("boolean or number expected");break;case 7:a=J.i18n.GT.$("boolean, number, or {0} expected");break;case 56:a=J.i18n.GT.$("cannot set value");break;case 8:a=J.i18n.GT.$("color expected");break;case 9:a=J.i18n.GT.$("a color or palette name (Jmol, Rasmol) is required");break;case 10:a=
J.i18n.GT.$("command expected");break;case 11:a=J.i18n.GT.$("{x y z} or $name or (atom expression) required");break;case 12:a=J.i18n.GT.$("draw object not defined");break;case 13:a=J.i18n.GT.$("unexpected end of script command");break;case 14:a=J.i18n.GT.$("valid (atom expression) expected");break;case 15:a=J.i18n.GT.$("(atom expression) or integer expected");break;case 16:a=J.i18n.GT.$("filename expected");break;case 17:a=J.i18n.GT.$("file not found");break;case 18:a=J.i18n.GT.$("incompatible arguments");
break;case 19:a=J.i18n.GT.$("insufficient arguments");break;case 20:a=J.i18n.GT.$("integer expected");break;case 21:a=J.i18n.GT.$("integer out of range ({0} - {1})");break;case 22:a=J.i18n.GT.$("invalid argument");null!=c&&(a+=": "+c);break;case 23:a=J.i18n.GT.$("invalid parameter order");break;case 24:a=J.i18n.GT.$("keyword expected");break;case 25:a=J.i18n.GT.$("no MO coefficient data available");break;case 26:a=J.i18n.GT.$("An MO index from 1 to {0} is required");break;case 27:a=J.i18n.GT.$("no MO basis/coefficient data available for this frame");
break;case 28:a=J.i18n.GT.$("no MO occupancy data available");break;case 29:a=J.i18n.GT.$("Only one molecular orbital is available in this file");break;case 30:a=J.i18n.GT.$("{0} requires that only one model be displayed");break;case 55:a=J.i18n.GT.$("{0} requires that only one model be loaded");break;case 31:a=J.i18n.GT.$("No data available");break;case 32:a=J.i18n.GT.$("No partial charges were read from the file; Jmol needs these to render the MEP data.");break;case 33:a=J.i18n.GT.$("No unit cell");
break;case 34:a=J.i18n.GT.$("number expected");break;case 35:a=J.i18n.GT.$("number must be ({0} or {1})");break;case 36:a=J.i18n.GT.$("decimal number out of range ({0} - {1})");break;case 57:a=J.i18n.GT.$("operation canceled");break;case 37:a=J.i18n.GT.$("object name expected after '$'");break;case 38:a=J.i18n.GT.$("plane expected -- either three points or atom expressions or {0} or {1} or {2}");break;case 39:a=J.i18n.GT.$("property name expected");break;case 40:a=J.i18n.GT.$("space group {0} was not found.");
break;case 41:a=J.i18n.GT.$("quoted string expected");break;case 42:a=J.i18n.GT.$("quoted string or identifier expected");break;case 43:a=J.i18n.GT.$("too many rotation points were specified");break;case 44:a=J.i18n.GT.$("too many script levels");break;case 45:a=J.i18n.GT.$("unrecognized atom property");break;case 46:a=J.i18n.GT.$("unrecognized bond property");break;case 47:a=J.i18n.GT.$("unrecognized command");break;case 48:a=J.i18n.GT.$("runtime unrecognized expression");break;case 49:a=J.i18n.GT.$("unrecognized object");
break;case 50:a=J.i18n.GT.$("unrecognized {0} parameter");break;case 51:a=J.i18n.GT.$("unrecognized {0} parameter in Jmol state script (set anyway)");break;case 52:a=J.i18n.GT.$("unrecognized SHOW parameter --  use {0}");break;case 53:a="{0}";break;case 54:a=J.i18n.GT.$('write what? {0} or {1} "filename"')}0>a.indexOf("{0}")?null!=b&&(a+=": "+b):(a=JU.PT.rep(a,"{0}",b),0<=a.indexOf("{1}")?a=JU.PT.rep(a,"{1}",c):null!=c&&(a+=": "+c),0<=a.indexOf("{2}")&&(a=JU.PT.rep(a,"{2}",c)));e&&J.i18n.GT.setDoTranslate(!0);
return a},"~N,~S,~S,~S,~B");d.getErrorLineMessage=f(d,"getErrorLineMessage",function(a,b,c,e,g){var p="\n----";if(null!=b||null!=a)p+="line "+c+" command "+(e+1)+" of "+(null==a?b:a.equals("try")?"try":"function "+a)+":";return p+("\n         "+g)},"~S,~S,~N,~N,~S");f(d,"setErrorMessage",function(a){this.errorMessageUntranslated=null;null==a?(this.$error=!1,this.errorMessage=this.errorType=null,this.iCommandError=-1):(this.$error=!0,null==this.errorMessage&&(this.errorMessage=J.i18n.GT.$("script ERROR: ")),
this.errorMessage+=a)},"~S")});H("JS");L(["JS.ScriptExpr"],"JS.ScriptEval","java.util.Arrays $.Hashtable JU.AU $.BArray $.BS $.Base64 $.Lst $.M3 $.M4 $.Measure $.P3 $.P4 $.PT $.Quat $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.c.PAL $.STR $.VDW J.i18n.GT JM.BondSet $.Group $.Measurement JS.SV $.ScriptCompiler $.ScriptContext $.ScriptDelayThread $.ScriptInterruption $.ScriptManager $.ScriptMathProcessor $.T JU.BSUtil $.ColorEncoder $.Edge $.Elements $.Escape $.Font $.Logger $.Parser $.SimpleUnitCell JV.ActionManager $.FileManager $.JC $.StateManager $.Viewer".split(" "),
function(){var d=M(function(){this.sm=null;this.isJS=!1;this.scriptDelayThread=this.fdThread=null;this.allowJSThreads=!0;this.isEditor=this.executing=this.executionStepping=this.executionPaused=this.executionStopped=this.tQuiet=this.listCommands=this.isCmdLine_c_or_C_Option=this.isCmdLine_C_Option=this.debugScript=this.historyDisabled=this.isFuncReturn=!1;this.timeEndExecution=this.timeBeginExecution=0;this.mustResumeEval=!1;this.outputBuffer=this.compiler=this.currentThread=null;this.contextPath=
"";this.functionName=this.scriptFileName=null;this.$isStateScript=!1;this.scriptLevel=0;this.scriptExtensions=this.script=this.lineIndices=this.lineNumbers=this.aatoken=null;this.pc=0;this.fullCommand=this.thisCommand=null;this.pcEnd=this.lineEnd=0;this.isGUI=this.isEmbedded=this.forceNoAddHydrogens=!1;this.parallelProcessor=null;this.pcResume=-1;K(this,arguments)},JS,"ScriptEval",JS.ScriptExpr);S(d,function(){W(this,JS.ScriptEval,[]);this.currentThread=Thread.currentThread()});r(d,"getAllowJSThreads",
function(){return this.allowJSThreads});f(d,"setAllowJSThreads",function(a){this.allowJSThreads=a},"~B");f(d,"doReport",function(){return!this.tQuiet&&this.scriptLevel<=JS.ScriptEval.scriptReportingLevel});r(d,"isStateScript",function(){return this.$isStateScript});r(d,"setStatic",function(a,b){switch(a){case 553648167:return 10<=b&&(JS.ScriptEval.contextDepthMax=b),JS.ScriptEval.contextDepthMax;case 553648144:return 0<=b&&(JS.ScriptEval.commandHistoryLevelMax=b),JS.ScriptEval.commandHistoryLevelMax;
case 553648168:return 0<=b&&(JS.ScriptEval.scriptReportingLevel=b),JS.ScriptEval.scriptReportingLevel}return 0},"~N,~N");r(d,"getScript",function(){return this.script});r(d,"setViewer",function(a){this.vwr=a;this.compiler=null==this.compiler?a.compiler:this.compiler;this.isJS=a.isSingleThreaded;return this},"JV.Viewer");r(d,"setCompiler",function(){this.vwr.compiler=this.compiler=new JS.ScriptCompiler(this.vwr)});r(d,"compileScriptString",function(a,b){this.clearState(b);this.contextPath="[script]";
return this.compileScript(null,a,this.debugScript)},"~S,~B");r(d,"evaluateCompiledScript",function(a,b,c,e,g,p,j){var d=this.isCmdLine_C_Option;this.isCmdLine_C_Option=c;this.chk=this.isCmdLine_c_or_C_Option=b;this.historyDisabled=e;this.outputBuffer=p;this.privateFuncs=null;this.currentThread=Thread.currentThread();this.setAllowJSThreads((new Boolean(j&!this.vwr.getBoolean(603979892))).valueOf());this.listCommands=g;this.timeBeginExecution=System.currentTimeMillis();this.executionStepping=this.executionStopped=
this.executionPaused=!1;this.executing=!0;this.vwr.pushHoldRepaintWhy("runEval"+(null==a?"":"+params"));this.setScriptExtensions();this.vwr.hasSelected=!1;this.executeCommands(a,!1,!0);this.isCmdLine_C_Option=d;this.$isStateScript&&JS.ScriptManager.setStateScriptVersion(this.vwr,null);this.vwr.hasSelected&&this.isGUI&&this.vwr.setStatusSelect(null);this.vwr.hasSelected=!1},"~A,~B,~B,~B,~B,JU.SB,~B");f(d,"useThreads",function(a){return!this.chk&&(a&&this.vwr.g.waitForMoveTo||!this.vwr.headless&&!this.vwr.autoExit&&
this.vwr.haveDisplay&&null==this.outputBuffer&&this.allowJSThreads)},"~B");f(d,"executeCommands",function(a,b,c){var e=!1;try{null!=a&&(this.pushContext(null,"runCallback"),this.contextPath+=" >> "+a[0]+"callback ",this.setScriptArguments(a,!0));if(!this.dispatchCommands(!1,!1,b))return-1;null!=a&&this.popContext(!1,!1)}catch(g){if(G(g,"JS.ScriptException")){if(x(g,"JS.ScriptInterruption")&&(!b||!g.isError))return-1;if(b)return this.vwr.setStringProperty("_errormessage",""+g),1;this.setErrorMessage(g.toString());
this.errorMessageUntranslated=g.getErrorMessageUntranslated();this.report(this.errorMessage,!0);this.vwr.notifyError(null!=this.errorMessage&&0<=this.errorMessage.indexOf("java.lang.OutOfMemoryError")?"Error":"ScriptException",this.errorMessage,this.errorMessageUntranslated)}else this.vwr.handleError(g,!1),this.setErrorMessage(""+g+" "+this.vwr.getShapeErrorState()),this.errorMessageUntranslated=""+g,this.report(this.errorMessage,!0);e=!0}if(e||!this.isJS||!this.allowJSThreads||null!=a)this.vwr.setTainted(!0),
this.vwr.popHoldRepaint("CLEAR HOLD - executeCommands "+(0<this.scriptLevel?"\u0001## REPAINT_IGNORE ##":"")),e&&this.resumeViewer("exception",!0);this.timeEndExecution=System.currentTimeMillis();null==this.errorMessage&&this.executionStopped?this.setErrorMessage("execution interrupted"):!this.tQuiet&&c&&this.vwr.scriptStatus("Script completed");this.executing=this.chk=this.isCmdLine_c_or_C_Option=this.historyDisabled=!1;a=this.getErrorMessageUntranslated();this.vwr.setErrorMessage(this.errorMessage,
a);!this.tQuiet&&c&&this.vwr.setScriptStatus("Jmol script terminated",this.errorMessage,1+(this.timeEndExecution-this.timeBeginExecution),a);return e?1:0},"~A,~B,~B");r(d,"resumeEval",function(a){this.setErrorMessage(null);if(this.executionStopped||null==a||!a.mustResumeEval)this.resumeViewer("resumeEval",this.executionStopped);else{this.thisContext=a;0<a.scriptLevel&&"getEvalContextAndHoldQueue"!==a.why&&(this.scriptLevel=a.scriptLevel-1);a.isTryCatch?(this.postProcessTry(null),this.pcResume=-1):
(this.executionPaused||a.pc++,this.restoreScriptContext(a,!0,!1,!1),this.pcResume=a.pc);switch(this.executeCommands(null,null!=this.thisContext&&this.thisContext.isTryCatch,0>=this.scriptLevel)){case 1:case 0:this.postProcessTry(null),this.executing&&this.executeCommands(null,!0,!1)}this.pcResume=-1}},"~O");f(d,"resumeViewer",function(a,b){this.vwr.setTainted(!0);this.vwr.popHoldRepaint(a+(this.chk?"\u0001## REPAINT_IGNORE ##":""));this.vwr.queueOnHold=!1;b&&(this.vwr.clearScriptQueue(),this.vwr.scm.queueThreadFinished(-1))},
"~S,~B");r(d,"runScript",function(a){this.vwr.isPreviewOnly||this.runScriptBuffer(a,this.outputBuffer,!1)},"~S");r(d,"runScriptBuffer",function(a,b,c){this.pushContext(null,"runScriptBuffer");this.contextPath+=" >> script() ";this.outputBuffer=b;this.setAllowJSThreads(!1);b=this.isFuncReturn;this.isFuncReturn=(new Boolean(this.isFuncReturn|c)).valueOf();this.compileScript(null,a+"\u0001## EDITOR_IGNORE ##\u0001## REPAINT_IGNORE ##",!1)&&this.dispatchCommands(!1,!1,!1);this.popContext(!1,!1);this.isFuncReturn=
b},"~S,JU.SB,~B");r(d,"checkScriptSilent",function(a){a=this.compiler.compile(null,a,!1,!0,!1,!0);if(null!=a.errorType)return a;this.restoreScriptContext(a,!1,!1,!1);this.chk=!0;this.isCmdLine_c_or_C_Option=this.isCmdLine_C_Option=!1;this.pc=0;try{this.dispatchCommands(!1,!1,!1)}catch(b){if(G(b,"JS.ScriptException"))this.setErrorMessage(b.toString()),a=this.getScriptContext("checkScriptSilent");else throw b;}this.chk=!1;return a},"~S");d.getContextTrace=f(d,"getContextTrace",function(a,b,c,e){null==
c&&(c=new JU.SB);var g=null==b.lineNumbers?b.pc:Math.min(b.pc,b.lineNumbers[b.lineNumbers.length-1]);c.append(JS.ScriptError.getErrorLineMessage(b.functionName,b.scriptFileName,null==b.lineNumbers?0:b.lineNumbers[g],g,JS.ScriptEval.statementAsString(a,b.statement,e?b.iToken:9999,!1)));null!=b.parentContext&&JS.ScriptEval.getContextTrace(a,b.parentContext,c,!1);return c},"JV.Viewer,JS.ScriptContext,JU.SB,~B");r(d,"setDebugging",function(){this.debugHigh=(this.debugScript=this.vwr.getBoolean(603979825))&&
JU.Logger.debugging});r(d,"haltExecution",function(){this.isEmbedded&&(this.vwr.setBooleanProperty("allowEmbeddedScripts",!0),this.isEmbedded=!1);this.resumePausedExecution();this.executionStopped=!0});r(d,"pauseExecution",function(a){!this.chk&&!this.vwr.headless&&(a&&!this.isJS&&this.delayScript(-100),this.vwr.popHoldRepaint("pauseExecution "+a),this.executionStepping=!1,this.executionPaused=!0)},"~B");r(d,"stepPausedExecution",function(){this.executionStepping=!0;this.executionPaused=!1});r(d,
"resumePausedExecution",function(){this.executionStepping=this.executionPaused=!1;this.tQuiet||this.vwr.setScriptStatus("Jmol script resumed",this.errorMessage,1+(this.timeEndExecution-this.timeBeginExecution),"resumed")});r(d,"isExecuting",function(){return this.executing&&!this.executionStopped});r(d,"isPaused",function(){return this.executionPaused});r(d,"isStepping",function(){return this.executionStepping});r(d,"isStopped",function(){return this.executionStopped||!this.isJS&&this.currentThread!==
Thread.currentThread()});r(d,"getNextStatement",function(){return this.pc<this.aatoken.length?JS.ScriptError.getErrorLineMessage(this.functionName,this.scriptFileName,this.getLinenumber(null),this.pc,JS.ScriptEval.statementAsString(this.vwr,this.aatoken[this.pc],-9999,this.debugHigh)):""});f(d,"getCommand",function(a,b){if(a>=this.lineIndices.length)return"";if(b){for(var c=-1,e=this.script,g=e.length,p=0;p<this.lineNumbers.length;p++)if(this.lineNumbers[p]==this.lineNumbers[a])0>c&&(c=this.lineIndices[p][0]),
g=this.lineIndices[p][1];else if(0==this.lineNumbers[p]||this.lineNumbers[p]>this.lineNumbers[a])break;0<=e.indexOf("\u0001")&&(e=e.substring(0,e.indexOf("\u0001")));p=e.length;g==p-1&&e.endsWith("}")&&g++;return c>=p||g<c||0>g?"":e.substring(Math.max(c,0),Math.min(p,g))}c=this.lineIndices[a][0];g=this.lineIndices[a][1];e="";if(0>c||g<=c||g>this.script.length)return"";try{e=this.script.substring(c,g),0<=e.indexOf("\\\n")&&(e=JU.PT.rep(e,"\\\n","  ")),0<=e.indexOf("\\\r")&&(e=JU.PT.rep(e,"\\\r","  ")),
0<e.length&&!e.endsWith(";")&&(e+=";")}catch(j){if(G(j,Exception))JU.Logger.error("darn problem in Eval getCommand: ichBegin="+c+" ichEnd="+g+" len = "+this.script.length+"\n"+j);else throw j;}return e},"~N,~B,~B");f(d,"logDebugScript",function(a,b){var c=this.iToken;this.iToken=-9999;if(this.debugHigh){0<a.length&&JU.Logger.debug(a[0].toString());for(var e=1;e<a.length;++e)null!=a[e]&&JU.Logger.debug(a[e].toString());var e=new JU.SB,g=0<b?"                          ".substring(0,2*b):"";e.append(g).append(JS.ScriptEval.statementAsString(this.vwr,
a,this.iToken,this.debugHigh));this.vwr.scriptStatus(e.toString())}else e=this.getCommand(this.pc,!1,!1),""!==e&&this.vwr.scriptStatus(e);this.iToken=c},"~A,~N");r(d,"evaluateExpression",function(a,b,c){var e=(new JS.ScriptEval).setViewer(this.vwr);try{e.thisContext=this.thisContext,e.contextVariables=this.contextVariables,e.pushContext(null,"evalExp"),e.setAllowJSThreads(!1)}catch(g){if(!G(g,"JS.ScriptException"))throw g;}var p=this.executing;a=e.evaluate(a,b,c);this.executing=p;return a},"~O,~B,~B");
f(d,"runBufferedSafely",function(a,b){null==b&&(b=this.outputBuffer);var c=(new JS.ScriptEval).setViewer(this.vwr),e=this.executing;try{c.runScriptBuffer(a,b,!1)}catch(g){if(G(g,"JS.ScriptException"))g.printStackTrace();else throw g;}this.executing=e},"~S,JU.SB");d.runUserAction=f(d,"runUserAction",function(a,b,c){var e=(new JS.ScriptEval).setViewer(c);a=c.getFunction(a.toLowerCase());if(null==a)return null;try{var g=JS.SV.getVariableAO(b).getList();e.restoreFunction(a,g,null);e.dispatchCommands(!1,
!0,!1)}catch(p){if(G(p,"JS.ScriptException"))return null;throw p;}b=e.getContextVariableAsVariable("_retval",!1);return null==b?JS.SV.vT:b},"~S,~A,JV.Viewer");f(d,"evaluate",function(a,b,c){try{if("string"==typeof a){if(this.compileScript(null,(c?"w_h_e_r_e":"e_x_p_r_e_s_s_i_o_n")+" = "+a,!1)){if(c)return this.aatoken[0];this.setStatement(this.aatoken[0],1);return b?this.parameterExpressionList(2,-1,!1).get(0):this.parameterExpressionString(2,0)}}else{if(x(a,Array)&&x(a[0],Array))return this.setStatement(a[0],
1),b?this.parameterExpressionList(0,-1,!1).get(0):this.parameterExpressionString(0,-1);if(x(a,Array)){var e=this.atomExpression(a,0,0,!0,!1,null,!1);return b?JS.SV.newV(10,e):e}}}catch(g){if(G(g,Exception))JU.Logger.error("Error evaluating: "+a+"\n"+g);else throw g;}return b?JS.SV.getVariable("ERROR"):"ERROR"},"~O,~B,~B");r(d,"checkSelect",function(a,b){var c=!1;try{this.pushContext(null,"checkSelect"),c=this.parameterExpressionSelect(a,b)}catch(e){if(!G(e,Exception))throw e;}this.popContext(!1,!1);
return c},"java.util.Map,~A");r(d,"getAtomBitSet",function(a){if(x(a,"JU.BS"))return a;if("string"==typeof a&&a.startsWith(";base90+35,"))return JS.SV.decodeBase90_35(a);var b=new JU.BS,c=this.executing;try{this.pushContext(null,"getAtomBitSet");var e="select ("+a+")",e=JU.PT.replaceAllCharacters(e,"\n\r","),("),e=JU.PT.rep(e,"()","(none)");this.compileScript(null,e,!1)&&(this.st=this.aatoken[0],this.setStatement(this.st,0),b=this.atomExpression(this.st,1,0,!1,!1,null,!0));this.popContext(!1,!1)}catch(g){if(G(g,
Exception))JU.Logger.error("getAtomBitSet "+a+"\n"+g);else throw g;}this.executing=c;return b},"~O");f(d,"compileScript",function(a,b,c){this.scriptFileName=a;b=this.fixScriptPath(b,a);a=this.compiler.compile(a,b,!1,!1,c&&JU.Logger.debugging,!1);this.addFunction(null);c=this.privateFuncs;this.restoreScriptContext(a,!1,!1,!1);this.privateFuncs=null;null!=this.thisContext&&(this.thisContext.privateFuncs=c);this.forceNoAddHydrogens=(this.$isStateScript=this.compiler.isStateScript)&&0>this.script.indexOf("pdbAddHydrogens");
a=this.script;(this.isGUI=0<=a.indexOf("; ## GUI ##"))&&(a=JU.PT.rep(a,"; ## GUI ##",""));this.pc=this.setScriptExtensions();!this.chk&&(this.vwr.scriptEditorVisible&&0>b.indexOf("\u0001## EDITOR_IGNORE ##"))&&this.vwr.scriptStatus("");this.script=a;return!this.$error},"~S,~S,~B");f(d,"fixScriptPath",function(a,b){if(null!=b&&0<=a.indexOf("$SCRIPT_PATH$")){var c=b,e=Math.max(b.lastIndexOf("|"),b.lastIndexOf("/")),c=c.substring(0,e+1);a=JU.PT.rep(a,"$SCRIPT_PATH$/",c);a=JU.PT.rep(a,"$SCRIPT_PATH$",
c)}return a},"~S,~S");f(d,"setScriptExtensions",function(){this.fromMenu=!1;var a=this.scriptExtensions;if(null==a)return 0;this.fromMenu=0<=a.indexOf("\u0001##MENU");0<=a.indexOf("\u0001##SCRIPT_STEP")&&(this.executionStepping=!0);var b=a.indexOf("\u0001##SCRIPT_START");if(0>b)return 0;b=JU.PT.parseInt(a.substring(b+15));if(-2147483648==b)return 0;for(this.pc=0;this.pc<this.lineIndices.length&&!(this.lineIndices[this.pc][0]>b||this.lineIndices[this.pc][1]>=b);this.pc++);0<this.pc&&(this.pc<this.lineIndices.length&&
this.lineIndices[this.pc][0]>b)&&--this.pc;return this.pc});f(d,"getScriptFileInternal",function(a,b,c,e){if(0==a.toLowerCase().indexOf("javascript:"))return this.vwr.jsEval(a.substring(11));var g=Array(2);g[0]=a;if(!this.vwr.fm.getFileDataAsString(g,-1,!1,!0,!1))return this.setErrorMessage("io error reading "+g[0]+": "+g[1]),null;var p="";if(0<=("\n"+g[1]).indexOf("\nJmolManifest.txt\n")){var j;if(a.endsWith(".all.pngj")||a.endsWith(".all.png"))j="|state.spt",a+="|";else{0<=g[1].indexOf("movie.spt")&&
(g[0]=a+"|movie.spt",this.vwr.fm.getFileDataAsString(g,-1,!1,!0,!1)&&(p=g[1]));a+="|JmolManifest.txt";g[0]=a;if(!this.vwr.fm.getFileDataAsString(g,-1,!1,!0,!1))return this.setErrorMessage("io error reading "+g[0]+": "+g[1]),null;j=JV.FileManager.getManifestScriptPath(g[1])}if(null!=j&&0<j.length&&(g[0]=a=a.substring(0,a.lastIndexOf("|"))+j,!this.vwr.fm.getFileDataAsString(g,-1,!1,!0,!1)))return this.setErrorMessage("io error reading "+g[0]+": "+g[1]),null;a.endsWith("|state.spt")&&this.vwr.g.setO("_pngjFile",
a.substring(0,a.length-10)+"?")}this.scriptFileName=a;g[1]=JV.FileManager.getEmbeddedScript(g[1]);var g=this.fixScriptPath(g[1],g[0]),d=-1;null==e&&(j=this.vwr.fm.getFilePath(a,!1,!1),e=j.substring(0,Math.max(d=j.lastIndexOf("|"),j.lastIndexOf("/"))),0<d&&(g=this.checkFixBondDelete(g),this.vwr.setAccessInternal(j.substring(0,d))));return JV.FileManager.setScriptFileReferences(g,b,c,e)+p},"~S,~S,~S,~S");f(d,"checkFixBondDelete",function(a){var b=a.indexOf("select BONDS ({");if(0>b)return a;var c=a.indexOf("delete ({",
b+20);if(0>c)return a;var e=a.substring(b,a.indexOf("\n\n",b)+2),c=a.indexOf("\n",c);a=a.substring(0,c+1)+e.$replace("select BONDS","select /*FIXED*/ BONDS")+a.substring(c+2);return a=a.substring(0,b)+a.substring(b+e.length)},"~S");r(d,"evalFunctionFloat",function(a,b,c){try{for(var e=0;e<c.length;e++)b.get(e).value=Float.$valueOf(c[e]);return JS.SV.fValue(this.runFunctionAndRet(a,a.name,b,null,!0,!1,!1))}catch(g){if(G(g,Exception))return NaN;throw g;}},"~O,~O,~A");f(d,"getUserFunctionResult",function(a,
b,c){return this.runFunctionAndRet(null,a,b,c,!0,!0,!1)},"~S,JU.Lst,JS.SV");f(d,"runFunctionAndRet",function(a,b,c,e,g,p,j){if(null==a){b=b.toLowerCase();a=this.getFunction(b);if(null==a)return null;p&&(this.contextPath+=" >> function "+b)}else p&&(this.contextPath+=" >> "+b);this.pushContext(null,"runFunctionAndRet ");this.allowJSThreads&&this.setAllowJSThreads(j);p=364558==a.getTok();this.thisContext.isTryCatch=p;this.thisContext.isFunction=!p;this.functionName=b;if(p){this.resetError();this.thisContext.displayLoadErrorsSave=
this.vwr.displayLoadErrors;this.thisContext.tryPt=++this.vwr.tryPt;this.vwr.displayLoadErrors=!1;this.restoreFunction(a,c,e);this.contextVariables.put("_breakval",JS.SV.newI(2147483647));this.contextVariables.put("_errorval",JS.SV.newS(""));a=this.contextVariables;switch(this.executeCommands(null,!0,!1)){case 1:case 0:this.postProcessTry(a)}return null}x(a,"J.api.JmolParallelProcessor")?(this.parallelProcessor=a,this.restoreFunction(a,c,e),this.dispatchCommands(!1,!0,!1),a.runAllProcesses(this.vwr)):
(this.restoreFunction(a,c,e),this.dispatchCommands(!1,!0,!1));a=g?this.getContextVariableAsVariable("_retval",!1):null;this.popContext(!1,!1);return a},"J.api.JmolScriptFunction,~S,JU.Lst,JS.SV,~B,~B,~B");f(d,"postProcessTry",function(a){if(null!=this.thisContext){for(;this.thisContext.tryPt>this.vwr.tryPt;)this.popContext(!1,!1);var b=null==a;b&&(a=this.contextVariables);this.vwr.displayLoadErrors=this.thisContext.displayLoadErrorsSave;this.popContext(!1,!1);var c=this.vwr.getP("_errormessage");
0<c.length&&(a.put("_errorval",JS.SV.newS(c)),this.resetError());a.put("_tryret",a.get("_retval"));c=a.get("_tryret");if(null!=c.value||2147483647!=c.intValue)try{this.cmdReturn(c)}catch(e){if(G(e,"JS.ScriptException"))e.printStackTrace();else throw e;}else{c=a.get("_errorval").value;if(0==c.length&&(a=a.get("_breakval").intValue,2147483647!=a)){this.breakAt(this.pc-a);return}this.pc+1<this.aatoken.length&&102412==this.aatoken[this.pc+1][0].tok&&(a=this.aatoken[this.pc+1][0],null!=a.contextVariables&&
null!=a.name0&&a.contextVariables.put(a.name0,JS.SV.newS(c)),a.intValue=(0<c.length?1:-1)*Math.abs(a.intValue));b&&this.pc++}}},"java.util.Map");f(d,"breakAt",function(a){if(0>a)this.getContextVariableAsVariable("_breakval",!1).intValue=-a,this.pcEnd=this.pc;else{var b=Math.abs(this.aatoken[a][0].intValue),c=this.aatoken[a][0].tok;if(102411==c||102413==c)this.theToken=this.aatoken[b--][0],a=Math.abs(this.theToken.intValue),102409!=this.theToken.tok&&(this.theToken.intValue=-a);else for(this.pc=-1;this.pc!=
a&&null!=this.thisContext;){for(;null!=this.thisContext&&!JS.ScriptCompiler.isBreakableContext(this.thisContext.token.tok);)this.popContext(!0,!1);this.pc=this.thisContext.pc;this.popContext(!0,!1)}this.pc=b}},"~N");f(d,"restoreFunction",function(a,b,c){this.aatoken=a.aatoken;this.lineNumbers=a.lineNumbers;this.lineIndices=a.lineIndices;this.script=a.script;this.pc=0;null!=a.names&&(this.contextVariables=new java.util.Hashtable,a.setVariables(this.contextVariables,b));null!=c&&this.contextVariables.put("_x",
c)},"J.api.JmolScriptFunction,JU.Lst,JS.SV");f(d,"clearDefinedVariableAtomSets",function(){this.vwr.definedAtomSets.remove("# variable")});f(d,"defineSets",function(){if(!this.vwr.definedAtomSets.containsKey("# static")){for(var a=0;a<JV.JC.predefinedStatic.length;a++)this.defineAtomSet(JV.JC.predefinedStatic[a]);this.defineAtomSet("# static")}if(!this.vwr.definedAtomSets.containsKey("# variable")){for(a=0;a<JV.JC.predefinedVariable.length;a++)this.defineAtomSet(JV.JC.predefinedVariable[a]);for(a=
JU.Elements.elementNumberMax;0<=--a;){var b=" elemno="+a;this.defineAtomSet("@"+JU.Elements.elementNameFromNumber(a)+b);this.defineAtomSet("@_"+JU.Elements.elementSymbolFromNumber(a)+b)}for(a=4;0<=--a;)b="@"+JU.Elements.altElementNameFromIndex(a)+" _e="+JU.Elements.altElementNumberFromIndex(a),this.defineAtomSet(b);for(a=JU.Elements.altElementMax;4<=--a;){var c=JU.Elements.altElementNumberFromIndex(a),e=" _e="+c,b="@_"+JU.Elements.altElementSymbolFromIndex(a);this.defineAtomSet(b+e);b="@_"+JU.Elements.altIsotopeSymbolFromIndex(a);
this.defineAtomSet(b+e);b="@_"+JU.Elements.altIsotopeSymbolFromIndex2(a);this.defineAtomSet(b+e);b="@"+JU.Elements.altElementNameFromIndex(a);1<b.length&&this.defineAtomSet(b+e);b=JU.Elements.getElementNumber(c);c=JU.Elements.getNaturalIsotope(b);0<c&&(e=JU.Elements.elementSymbolFromNumber(b),this.defineAtomSet("@_"+e+c+" _e="+b),this.defineAtomSet("@_"+c+e+" _e="+b))}this.defineAtomSet("# variable")}});f(d,"defineAtomSet",function(a){if(0==a.indexOf("#"))this.vwr.definedAtomSets.put(a,Boolean.TRUE);
else{var b=this.compiler.compile("#predefine",a,!0,!1,!1,!1);if(null!=b.errorType)this.vwr.scriptStatus("JmolConstants.java ERROR: predefined set compile error:"+a+"\ncompile error:"+b.errorMessageUntranslated);else if(1!=b.getTokenCount())this.vwr.scriptStatus("JmolConstants.java ERROR: predefinition does not have exactly 1 command:"+a);else if(b=b.getToken(0),2>=b.length)this.vwr.scriptStatus("JmolConstants.java ERROR: bad predefinition length:"+a);else{var c=b[1].tok;!JS.T.tokAttr(c,1073741824)&&
!JS.T.tokAttr(c,2097152)?this.vwr.scriptStatus("JmolConstants.java ERROR: invalid variable name:"+a):(a=b[1].value.toLowerCase(),a.startsWith("dynamic_")&&(a="!"+a.substring(8)),this.vwr.definedAtomSets.put(a,b))}}},"~S");f(d,"lookupIdentifierValue",function(a){var b=this.lookupValue(a,!1);if(null!=b)return JU.BSUtil.copy(b);b=this.getAtomBits(1073741824,a);return null==b?new JU.BS:b},"~S");f(d,"lookupValue",function(a,b){if(this.chk)return new JU.BS;this.defineSets();a=a.toLowerCase();var c=this.vwr.definedAtomSets.get(a),
e=!1;null==c&&(c=this.vwr.definedAtomSets.get("!"+a),e=null!=c);if(x(c,"JU.BS"))return c;if(x(c,Array))return this.pushContext(null,"lookupValue"),c=this.atomExpression(c,-2,0,!0,!1,null,!0),this.popContext(!1,!1),e||this.vwr.definedAtomSets.put(a,c),c;if(a.equals("water"))return c=this.vwr.ms.getAtoms(1612709912,null),e||this.vwr.definedAtomSets.put(a,c),c;if(b)return null;e=a.length;if(5>e||"s"!=a.charAt(e-1))return null;a=a.endsWith("ies")?a.substring(0,e-3)+"y":a.substring(0,e-1);return this.lookupValue(a,
!0)},"~S,~B");r(d,"deleteAtomsInVariables",function(a){for(var b,c=this.vwr.definedAtomSets.entrySet().iterator();c.hasNext()&&((b=c.next())||1);){var e=b.getValue();x(e,"JU.BS")&&(JU.BSUtil.deleteBits(e,a),b.getKey().startsWith("!")||this.vwr.g.setUserVariable("@"+b.getKey(),JS.SV.newV(10,e)))}},"JU.BS");r(d,"getThisContext",function(){return this.thisContext});f(d,"clearState",function(a){this.thisContext=null;this.scriptLevel=0;this.setErrorMessage(null);this.contextPath="";this.tQuiet=a},"~B");
r(d,"pushContextDown",function(a){this.scriptLevel--;this.pushContext2(null,a)},"~S");f(d,"pushContext",function(a,b){this.scriptLevel==JS.ScriptEval.contextDepthMax&&this.error(44);this.pushContext2(a,b)},"JS.ContextToken,~S");f(d,"pushContext2",function(a,b){this.thisContext=this.getScriptContext(b);this.thisContext.token=a;if(null==a)this.scriptLevel=++this.thisContext.scriptLevel;else if(this.thisContext.scriptLevel=-1,this.contextVariables=new java.util.Hashtable,null!=a.contextVariables)for(var c,
e=a.contextVariables.keySet().iterator();e.hasNext()&&((c=e.next())||1);)JS.ScriptCompiler.addContextVariable(this.contextVariables,c);(this.debugHigh||this.isCmdLine_c_or_C_Option)&&JU.Logger.info("--\x3e>----------------------".substring(0,Math.min(15,this.scriptLevel+5))+this.scriptLevel+" "+this.scriptFileName+" "+a+" "+this.thisContext.id+" "+b+" path="+this.thisContext.contextPath)},"JS.ContextToken,~S");r(d,"getScriptContext",function(a){var b=new JS.ScriptContext;this.debugHigh&&JU.Logger.info("creating context "+
b.id+" for "+a+" path="+this.contextPath);b.why=a;b.scriptLevel=this.scriptLevel;b.parentContext=this.thisContext;b.contextPath=this.contextPath;b.scriptFileName=this.scriptFileName;b.parallelProcessor=this.parallelProcessor;b.functionName=this.functionName;b.script=this.script;b.lineNumbers=this.lineNumbers;b.lineIndices=this.lineIndices;b.saveTokens(this.aatoken);b.statement=this.st;b.statementLength=this.slen;b.pc=b.pc0=this.pc;b.lineEnd=this.lineEnd;b.pcEnd=this.pcEnd;b.iToken=this.iToken;b.theToken=
this.theToken;b.theTok=this.theTok;b.outputBuffer=this.outputBuffer;b.vars=this.contextVariables;b.isStateScript=this.$isStateScript;b.errorMessage=this.errorMessage;b.errorType=this.errorType;b.iCommandError=this.iCommandError;b.chk=this.chk;b.executionStepping=this.executionStepping;b.executionPaused=this.executionPaused;b.scriptExtensions=this.scriptExtensions;b.isEditor=this.isEditor;b.mustResumeEval=this.mustResumeEval;b.allowJSThreads=this.allowJSThreads;return b},"~S");f(d,"popContext",function(a,
b){if(null!=this.thisContext){0<this.thisContext.scriptLevel&&(this.scriptLevel=this.thisContext.scriptLevel-1);var c=a?this.getScriptContext("popFlow"):null;this.restoreScriptContext(this.thisContext,!0,a,b);null!=c&&this.restoreScriptContext(c,!0,!1,!0);if(this.debugHigh||this.isCmdLine_c_or_C_Option)JU.Logger.info("--<<------------".substring(0,Math.min(15,this.scriptLevel+5))+(this.scriptLevel+1)+" "+this.scriptFileName+" isFlow "+a+" thisContext="+(null==this.thisContext?"":""+this.thisContext.id)+
" pc="+this.pc+"--\x3e"+this.pc+" path="+(null==this.thisContext?"":this.thisContext.contextPath))}},"~B,~B");f(d,"restoreScriptContext",function(a,b,c,e){this.executing=!this.chk;if(null!=a){if(!c&&(this.st=a.statement,this.slen=a.statementLength,this.pc=a.pc,this.lineEnd=a.lineEnd,this.pcEnd=a.pcEnd,e))return;null!=a.privateFuncs&&(this.privateFuncs=a.privateFuncs);this.mustResumeEval=a.mustResumeEval;this.script=a.script;this.lineNumbers=a.lineNumbers;this.lineIndices=a.lineIndices;this.aatoken=
a.restoreTokens();this.contextVariables=a.vars;this.scriptExtensions=a.scriptExtensions;this.isEditor=a.isEditor;b?(this.contextPath=a.contextPath,e=null==this.contextPath?-1:this.contextPath.indexOf(" >> "),0<=e&&(this.contextPath=this.contextPath.substring(0,e)),this.scriptFileName=a.scriptFileName,this.parallelProcessor=a.parallelProcessor,this.functionName=a.functionName,this.iToken=a.iToken,this.theToken=a.theToken,this.theTok=a.theTok,this.outputBuffer=a.outputBuffer,this.$isStateScript=a.isStateScript,
this.thisContext=a.parentContext,this.allowJSThreads=a.allowJSThreads,(this.debugHigh||this.isCmdLine_c_or_C_Option)&&JU.Logger.info("--r------------".substring(0,Math.min(15,this.scriptLevel+5))+this.scriptLevel+" "+this.scriptFileName+" isPop "+b+" isFlow "+c+" context.id="+a.id+" pc="+this.pc+"--\x3e"+a.pc+" "+this.contextPath)):(this.$error=null!=a.errorType,this.errorMessage=a.errorMessage,this.errorMessageUntranslated=a.errorMessageUntranslated,this.iCommandError=a.iCommandError,this.errorType=
a.errorType)}},"JS.ScriptContext,~B,~B,~B");f(d,"setException",function(a,b,c){a.untranslated=null==c?b:c;c="!".equals(c);this.errorType=b;this.iCommandError=this.pc;if(null==a.message)a.message="";else{for(var e=JS.ScriptEval.getContextTrace(this.vwr,this.getScriptContext("setException"),null,!0).toString();null!=this.thisContext&&!this.thisContext.isTryCatch;)this.popContext(!1,!1);0>a.message.indexOf(e)&&(a.message+=e,a.untranslated+=e);a=c||null!=this.thisContext||this.chk||0<=b.indexOf("NOTE: file recognized as a script file: ");
this.resumeViewer(c?"throw context":"scriptException",c);a||(this.isFuncReturn=!1,0>e.indexOf("w_h_e_r_e =")&&JU.Logger.error("eval ERROR: "+e+"\n"+this.toString()),this.vwr.setAccessInternal(null),this.vwr.autoExit&&this.vwr.exitJmol())}},"JS.ScriptException,~S,~S");d.statementAsString=f(d,"statementAsString",function(a,b,c,e){if(null==b||0==b.length)return"";var g=new JU.SB,p=b[0].tok;switch(p){case 0:return b[0].value;case 102409:if(2==b.length&&(134320141==b[1].tok||102436==b[1].tok))return b[1].value.toString()}for(var j=
!0,d=!1,f=!1,p=1<b.length&&36867==p&&b[0].value.equals("")&&(61==b[0].intValue||35==b[0].intValue)&&1073742325!=b[1].tok,q=b.length,k=0;k<q;++k){var m=b[k];if(null==m)break;c==k-1&&g.append(" <<");0!=k&&g.appendC(" ");if(2==k&&p&&((p=268440324!=m.tok)||35==b[0].intValue))if(g.append(p?"= ":"== "),!p)continue;var n=m.value;switch(m.tok){case 1073742325:j&&g.append("{");continue;case 1073742326:f&&k==b.length-1&&(j=!1);j&&g.append("}");continue;case 268437504:case 268437505:break;case 1073742332:case 1073742338:d=
1073742332==m.tok;break;case 12290:if(0<k&&m.value.equals("define")){g.append("@");k+1<b.length&&1073742325==b[k+1].tok&&(j||(f=!0),j=!0);continue}break;case 1073742335:g.append("true");n=null;break;case 1073742334:g.append("false");n=null;break;case 1275082241:break;case 2:g.appendI(m.intValue);n=null;break;case 8:case 9:case 10:g.append(JS.SV.sValue(m));n=null;break;case 6:if(Boolean.TRUE===m.value.get("$_BINARY_$")){g.append("<BINARY DATA>");n=null;break}case 7:g.append(m.escape());n=null;break;
case 5:g.appendC("^");n=null;break;case 1073742363:2147483647!=m.intValue?g.appendI(m.intValue):g.append(JM.Group.getSeqcodeStringFor(JS.ScriptExpr.getSeqCode(m))),m=b[++k],g.appendC(" "),g.append(d?"-":"- ");case 1073742362:2147483647!=m.intValue?g.appendI(m.intValue):g.append(JM.Group.getSeqcodeStringFor(JS.ScriptExpr.getSeqCode(m)));n=null;break;case 1073742357:g.append("*:");g.append(a.getChainIDStr(m.intValue));n=null;break;case 1073742355:g.append("*%");null!=m.value&&g.append(m.value.toString());
n=null;break;case 1073742358:g.append("*/");case 1073742359:case 3:2147483647>m.intValue?g.append(JU.Escape.escapeModelFileNumber(m.intValue)):g.append(""+m.value);n=null;break;case 1073742361:g.appendC("[");n=6*m.intValue+1;g.append(JM.Group.standardGroupList.substring(n,n+3).trim());g.appendC("]");n=null;break;case 1073742360:g.appendC("[");g.appendO(m.value);g.appendC("]");n=null;break;case 1073742356:g.append("*.");break;case 1094713349:if(x(m.value,"JU.P3")){n=m.value;g.append("cell=").append(JU.Escape.eP(n));
n=null;break}break;case 4:g.append('"').appendO(m.value).append('"');n=null;break;case 268440324:case 268440322:case 268440321:case 268440320:case 268440323:case 268440325:1715472409==m.intValue?g.append(b[++k].value).append(" "):2147483647!=m.intValue&&g.append(JS.T.nameOf(m.intValue)).append(" ");break;case 364558:n=null;break;case 102409:g.append("end");n=null;break;default:if(JS.T.tokAttr(m.tok,1073741824)||!e)break;g.appendC("\n").append(m.toString()).appendC("\n");n=null}null!=n&&g.append(m.value.toString());
c==k&&g.append("<<<<")}return g.toString()},"JV.Viewer,~A,~N,~B");r(d,"setObjectPropSafe",function(a,b){try{return this.setObjectProp(a,b,-1)}catch(c){if(G(c,"JS.ScriptException"))return null;throw c;}},"~S,~N");f(d,"setAtomProp",function(a,b,c){this.setShapePropertyBs(0,a,b,c)},"~S,~O,JU.BS");f(d,"restrictSelected",function(a,b){this.chk||this.sm.restrictSelected(a,b)},"~B,~B");f(d,"showString",function(a){this.showStringPrint(a,!1)},"~S");r(d,"showStringPrint",function(a,b){this.chk||null==a||(null==
this.outputBuffer?this.vwr.showString(a,b):this.appendBuffer(a,b))},"~S,~B");f(d,"report",function(a,b){this.chk||b&&0<=a.indexOf(" of try:")||(null==this.outputBuffer?this.vwr.scriptStatus(a):this.appendBuffer(a,b))},"~S,~B");f(d,"appendBuffer",function(a,b){(b||this.isFuncReturn||JU.Logger.isActiveLevel(4))&&this.outputBuffer.append(a).appendC("\n")},"~S,~B");f(d,"addProcess",function(a,b,c){if(null!=this.parallelProcessor){for(var e=Array(c),g=0;g<a.size();g++)e[g+1-b]=a.get(g);a=this.getScriptContext("addProcess");
a.saveTokens(e);a.pc=1-b;a.pcEnd=c;this.parallelProcessor.addProcess("p"+ ++JS.ScriptEval.iProcess,a)}},"JU.Lst,~N,~N");f(d,"checkContinue",function(){if(this.executionStopped)return!1;if(this.executionStepping&&this.isCommandDisplayable(this.pc))this.vwr.scriptStatusMsg("Next: "+this.getNextStatement(),"stepping -- type RESUME to continue"),this.executionPaused=!0;else if(!this.executionPaused)return!0;JU.Logger.debugging&&JU.Logger.debug("script execution paused at command "+(this.pc+1)+" level "+
this.scriptLevel+": "+this.thisCommand);this.refresh(!1);for(var a=!0;this.executionPaused;){this.isJS||Thread.yield();this.isEditor&&a&&this.notifyScriptEditor(this.pc);a=!1;this.vwr.popHoldRepaint("pause \u0001## REPAINT_IGNORE ##");var b=this.vwr.getInsertedCommand();if(0<b.length){this.resumePausedExecution();this.setErrorMessage(null);var c=this.getScriptContext("script insertion");this.pc--;try{this.runScript(b)}catch(e){if(G(e,Exception))this.setErrorMessage(""+e);else if(G(e,Error))this.setErrorMessage(""+
e);else throw e;}this.$error&&(this.report(this.errorMessage,!0),this.setErrorMessage(null));this.restoreScriptContext(c,!0,!1,!1);!b.startsWith("resume\u0001")&&!b.startsWith("step\u0001")&&this.pauseExecution(!1)}this.doDelay(-100,null);this.vwr.pushHoldRepaintWhy("pause")}this.notifyResumeStatus();return!this.$error&&!this.executionStopped});f(d,"delayScript",function(a){this.delayScriptAndRun(a,null)},"~N");f(d,"delayScriptAndRun",function(a,b){this.vwr.autoExit||(this.stopScriptThreads(),null!=
this.vwr.captureParams&&0<a&&this.vwr.captureParams.put("captureDelayMS",Integer.$valueOf(a)),this.scriptDelayThread=new JS.ScriptDelayThread(this,this.vwr,a),this.scriptDelayThread.setScript(b),this.isJS&&this.allowJSThreads&&(this.pc=this.aatoken.length),this.scriptDelayThread.run())},"~N,~S");f(d,"doDelay",function(a,b){if(this.useThreads(!1)){if(this.isJS)throw new JS.ScriptInterruption(this,"delay"+(null==b?"":":"+b),a);this.delayScriptAndRun(a,b)}},"~N,~S");r(d,"evalParallel",function(a,b){return this.getCmdExt().evalParallel(a,
b)},"JS.ScriptContext,JV.ShapeManager");f(d,"isCommandDisplayable",function(a){return a>=this.aatoken.length||a>=this.pcEnd||null==this.aatoken[a]?!1:this.lineIndices[a][1]>this.lineIndices[a][0]},"~N");r(d,"loadFileResourceAsync",function(a){this.loadFileAsync(null,a,-Math.abs(a.hashCode()),!1)},"~S");f(d,"loadFileAsync",function(a,b,c,e){if(!b.startsWith("?")){var g=this.vwr.getFullPathNameOrError(b);b=g[0];null!=g[1]&&this.errorStr(17,b+":"+g[1])}if(null!=this.vwr.fm.cacheGet(b,!1))return this.cancelFDThread("FileLoad"),
b;null!=a&&(a="cache://local"+a);var g=this.pc+"_"+c+"_"+b,p;null==this.thisContext&&this.pushContext(null,"FileLoad");null==this.thisContext.htFileCache&&(this.thisContext.htFileCache=new java.util.Hashtable);p=this.thisContext.htFileCache.get(g);if(null!=p&&0<p.length)return this.cancelFDThread("FileLoad"),this.vwr.queueOnHold=!1,("#CANCELED#".equals(p)||"#CANCELED#".equals(this.vwr.fm.cacheGet(p,!1)))&&this.evalError("#CANCELED#",null),p;this.thisContext.htFileCache.put(g,p=a+System.currentTimeMillis());
e&&this.vwr.cacheFileByName(a+"*",!1);this.fdThread=this.newAsyncThread("FileLoad").initialize(this,this.vwr,b,g,p);this.vwr.testAsync?this.fdThread.start():this.fdThread.run();0>c&&(this.fdThread=null);throw new JS.ScriptInterruption(this,"load",1);},"~S,~S,~N,~B");f(d,"cancelFDThread",function(a){this.fdThread=null;null!=this.thisContext&&this.thisContext.why===a&&this.popContext(!1,!1)},"~S");r(d,"promptAsync",function(a,b){null==this.thisContext&&this.pushContext(null,"Dialog");null==this.thisContext.htFileCache&&
(this.thisContext.htFileCache=new java.util.Hashtable);var c=this.thisContext.htFileCache.get("cache:// DIALOG");if(null!=c)return this.cancelFDThread("Dialog"),"#CANCELED#"===c?null:c;this.fdThread=this.newAsyncThread("Dialog").initialize(this,this.vwr,a,b);this.fdThread.run();this.fdThread=null;throw new JS.ScriptInterruption(this,"prompt",1);},"~S,~A");f(d,"newAsyncThread",function(a){return J.api.Interface.getInterface("JS."+a+"Thread",null,"async")},"~S");f(d,"logLoadInfo",function(a,b){0<a.length&&
JU.Logger.info(a);var c=new JU.SB,e=this.vwr.ms.mc;1<e&&!b&&c.append((this.vwr.am.isMovie?this.vwr.am.getFrameCount()+" frames":e+" models")+"\n");for(var g=0;g<e;g++){var p=this.vwr.ms.getInfo(g,"moData");null!=p&&p.containsKey("mos")&&c.appendI(p.get("mos").size()).append(" molecular orbitals in model ").append(this.vwr.getModelNumberDotted(g)).append("\n")}0<c.length()&&this.showString(c.toString())},"~S,~B");r(d,"notifyResumeStatus",function(){!this.chk&&(!this.executionStopped&&!this.executionStepping&&
!this.executionPaused)&&this.vwr.scriptStatus("script execution "+(this.$error||this.executionStopped?"interrupted":"resumed"))});f(d,"refresh",function(a){this.chk||(this.vwr.setTainted(!0),this.vwr.requestRepaintAndWait("refresh cmd"),this.isJS&&a&&this.doDelay(10,null))},"~B");r(d,"stopScriptThreads",function(){null!=this.scriptDelayThread&&(this.scriptDelayThread.interrupt(),this.scriptDelayThread=null);null!=this.fdThread&&(this.fdThread.interrupt(),this.fdThread.resumeEval(),this.cancelFDThread("FileLoad"),
this.cancelFDThread("Dialog"))});f(d,"getErrorLineMessage2",function(){return JS.ScriptError.getErrorLineMessage(this.functionName,this.scriptFileName,this.getLinenumber(null),this.pc,JS.ScriptEval.statementAsString(this.vwr,this.st,-9999,this.debugHigh))});f(d,"getLinenumber",function(a){return null==a?this.lineNumbers[this.pc]:a.lineNumbers[a.pc]},"JS.ScriptContext");f(d,"dispatchCommands",function(a,b,c){null==this.sm&&(this.sm=this.vwr.shm);this.debugScript=this.debugHigh=!1;this.chk||this.setDebugging();
0==this.pcEnd&&(this.pcEnd=2147483647);0==this.lineEnd&&(this.lineEnd=2147483647);if(null==this.aatoken)return!0;this.tQuiet||(this.tQuiet=0>this.vwr.getInt(536870922));var e=this.isJS&&!b&&this.useThreads(!1)&&0<=this.vwr.getInt(536870922);this.commandLoop(e);if(this.chk)return!0;var g=this.vwr.getInsertedCommand();"".equals(g)?a&&(this.debugScript&&this.vwr.getBoolean(603979879))&&this.vwr.getChimeMessenger().update(null):this.runScriptBuffer(g,null,!1);return!this.mustResumeEval&&!e||b?!0:!c&&
this.mustResumeEval||null==this.thisContext?(a=null==this.thisContext,this.resumeEval(this.thisContext),this.mustResumeEval=!1,a):!0},"~B,~B,~B");f(d,"commandLoop",function(a){var b="",c=!1,e=null,g=System.currentTimeMillis();if(this.debugScript&&this.debugHigh&&!this.chk){for(var p=this.pc;p<this.aatoken.length&&p<this.pcEnd;p++)JU.Logger.info("Command "+p),this.debugScript&&this.logDebugScript(this.aatoken[p],0);JU.Logger.info("-----")}for(p=!0;this.pc<this.aatoken.length&&this.pc<this.pcEnd;this.pc++){a&&
(!this.executionPaused&&1E6<System.currentTimeMillis()-g&&(this.pc--,this.doDelay(-1,null)),g=System.currentTimeMillis());if(!this.chk&&(!this.executionStepping||!p)&&!this.checkContinue())break;p=!1;if(this.pc>=this.lineNumbers.length||this.lineNumbers[this.pc]>this.lineEnd)break;if(this.debugHigh){var j=0,j=System.currentTimeMillis();this.vwr.scriptStatus("Eval.dispatchCommands():"+j);this.vwr.scriptStatus(this.script)}this.debugScript&&!this.chk&&JU.Logger.info("Command "+this.pc+(null==this.thisContext?
"":" path="+this.thisContext.contextPath));this.theToken=0==this.aatoken[this.pc].length?null:this.aatoken[this.pc][0];if(!this.historyDisabled&&(!this.chk&&this.scriptLevel<=JS.ScriptEval.commandHistoryLevelMax&&!this.tQuiet)&&(j=this.getCommand(this.pc,!0,!0),null!=this.theToken&&0<j.length&&!j.equals(b)&&(134320141==this.theToken.tok||102436==this.theToken.tok||!JS.T.tokAttr(this.theToken.tok,102400))))this.vwr.addCommand(b=j);!this.chk&&a&&(j=this.vwr.getInsertedCommand(),"".equals(j)||this.runScript(j));
if(this.setStatement(this.aatoken[this.pc],1)){this.thisCommand=this.getCommand(this.pc,!1,!0);(this.debugHigh||this.debugScript)&&JU.Logger.info(this.thisCommand);j=this.getCommand(this.pc+1,!1,!0);this.fullCommand=this.thisCommand+(j.startsWith("#")?j:"");this.getToken(0);this.iToken=0;if((this.listCommands||!this.chk&&0<this.scriptLevel)&&!this.isJS)if(j=this.vwr.getInt(536870922),this.listCommands||0<j)0<j&&this.delayScript(-j),this.vwr.scriptEcho("$["+this.scriptLevel+"."+this.lineNumbers[this.pc]+
"."+(this.pc+1)+"] "+this.thisCommand);if(null!=e&&(102409!=this.theTok||2>this.slen||102439!=this.st[1].tok))e.addLast(this.st);else{if(this.chk){if(this.isCmdLine_c_or_C_Option&&JU.Logger.info(this.thisCommand),1==this.slen&&134320141!=this.st[0].tok&&102436!=this.st[0].tok)continue}else if(this.debugScript&&this.logDebugScript(this.st,0),0==this.scriptLevel&&this.vwr.g.logCommands&&this.vwr.log(this.thisCommand),this.debugHigh&&null!=this.theToken&&JU.Logger.debug(this.theToken.toString()),!this.isJS&&
this.isEditor&&0==this.scriptLevel){this.notifyScriptEditor(this.pc);try{Thread.sleep(100)}catch(d){if(!G(d,"InterruptedException"))throw d;}}if(null!=this.theToken)switch(j=this.theToken.tok,j){case 36867:this.cmdSet();continue;case 134320648:c=this.cmdFor(j,c);continue;case 102439:this.pushContext(this.theToken,"PROCESS");null!=this.parallelProcessor&&(e=new JU.Lst);continue;default:if(JS.T.tokAttr(j,102400)){c=this.cmdFlow(j,c,e);102439==this.theTok&&(e=null);continue}this.processCommand(j);this.setCursorWait(!1);
266298!=j&&this.executionStepping&&(this.executionPaused=this.isCommandDisplayable(this.pc+1))}}}}},"~B");f(d,"notifyScriptEditor",function(a){this.vwr.notifyScriptEditor(this.lineIndices[a][0]<<16|this.lineIndices[a][1],null)},"~N");f(d,"processCommand",function(a){if(JS.T.tokAttr(this.theToken.tok,135168))this.processShapeCommand(a);else switch(a){case 0:!this.chk&&this.vwr.getBoolean(603979879)&&this.vwr.getChimeMessenger().showHash(this.outputBuffer,this.theToken.value);break;case 1275335685:this.pushContext(this.theToken,
"PUSH");break;case 1275334681:this.popContext(!0,!1);break;case 268436482:break;case 4097:this.cmdAnimation();break;case 1610616835:this.cmdBackground(1);break;case 4100:this.cmdBind();break;case 4101:this.cmdBondorder();break;case 20488:this.cmdCD();break;case 12289:this.cmdCenter(1);break;case 1765808134:this.cmdColor();break;case 12290:this.cmdDefine();break;case 528397:this.cmdDelay();break;case 12291:this.cmdDelete();break;case 554176526:this.cmdSlab(!0);break;case 1610625028:this.cmdDisplay(!0);
break;case 266255:case 266281:if(this.chk)break;0<this.pc&&(266255==this.theToken.tok&&!this.vwr.autoExit)&&this.vwr.clearScriptQueue();this.executionStopped=0<this.pc||!this.vwr.g.useScriptQueue;break;case 266256:if(this.chk)break;null!=this.outputBuffer&&JU.Logger.warn(this.outputBuffer.toString());this.vwr.exitJmol();break;case 1228935687:this.cmdFile();break;case 12293:this.cmdFixed();break;case 4114:this.cmdFont(-1,0);break;case 4115:case 1094717454:this.cmdModel(1);break;case 1073741824:this.cmdFunc();
break;case 1275072526:this.cmdGetProperty();break;case 20500:if(this.vwr.headless)break;this.cmdGoto(!0);break;case 20482:this.cmdHelp();break;case 12294:this.cmdDisplay(!1);break;case 1613238294:this.cmdHbond();break;case 1610616855:this.cmdHistory(1);break;case 544771:this.cmdHover();break;case 4121:switch(this.slen){case 1:this.chk||this.vwr.initialize(!this.$isStateScript,!1);break;case 2:if(1275068433==this.tokAt(1)){this.vwr.getInchi(null,null,null);!this.chk&&JV.Viewer.isJS&&(this.vwr.showString("InChI module initialized",
!1),this.doDelay(1,null));break}default:this.bad()}break;case 134238732:this.cmdScript(134238732,null,null,null);break;case 134223363:this.cmdLoad();break;case 36869:this.cmdLog();break;case 528411:this.cmdLoop();break;case 20485:this.cmdMessage();break;case 4128:this.cmdMove();break;case 4129:this.cmdMoveto();break;case 20487:this.cmdPause();break;case 36865:this.cmdPrint();break;case 134256129:this.cmdPrompt();break;case 536875059:this.cmdScale(1);break;case 603984065:case 4139:case 4140:case 4165:this.cmdUndoRedo(a);
break;case 266284:this.refresh(!0);break;case 4141:this.cmdReset();break;case 12295:this.cmdRestrict();break;case 4143:if(1==this.slen){this.chk||this.resumePausedExecution();break}case 4142:this.cmdRestore();break;case 36866:this.cmdReturn(null);break;case 528432:this.cmdRotate(!1,!1);break;case 4145:this.cmdRotate(!1,!0);break;case 4146:this.cmdSave();break;case 134222850:this.cmdScript(134222850,null,null,null);break;case 1275082241:this.cmdSelect(1);break;case 1611141172:this.cmdSelectionHalos(1);
break;case 554176565:this.cmdSlab(!1);break;case 1095241729:this.cmdRotate(!0,!1);break;case 1611141176:this.cmdSsbond();break;case 266298:this.cmdPause()&&this.stepPausedExecution();break;case 1639976963:this.cmdStructure();break;case 2109448:this.cmdSubset();break;case 36870:this.cmdThrow();break;case 536875070:this.cmdTimeout(1);break;case 4160:this.cmdTranslate(!1);break;case 4162:this.cmdTranslate(!0);break;case 4163:this.cmdUnbind();break;case 36868:break;case 4166:this.cmdVibration();break;
case 12297:this.cmdZap(!0);break;case 4168:this.cmdZoom(!1);break;case 4170:this.cmdZoom(!0);break;default:this.checkExtension(this.theToken.tok)}},"~N");f(d,"checkExtension",function(a){switch(a){case 4098:case 4108:case 134221829:case 4102:case 4103:case 4105:case 134221831:case 1094717448:case 4106:case 528395:case 1613238294:case 4120:case 4122:case 528443:case 4124:case 4125:case 4126:case 603983903:case 1275072532:case 4130:case 134221834:case 4131:case 4133:case 134221850:case 4138:case 134222350:case 4156:case 20489:case 134221856:this.getCmdExt().dispatch(a,
!1,this.st);break;default:System.out.println(JS.T.nameOf(a)+" is not a command"),this.error(47)}},"~N");f(d,"processShapeCommand",function(a){var b=0;switch(a){case 1611272194:b=34;break;case 1114249217:b=9;break;case 1812599299:b=32;break;case 1112152066:b=11;break;case 135174:b=23;break;case 134353926:b=25;break;case 135175:b=17;break;case 1112150019:b=16;break;case 135176:b=22;break;case 537022465:b=31;break;case 1112150020:b=20;break;case 1611272202:b=36;break;case 1112150021:b=19;break;case 1112152070:b=
8;break;case 135180:b=24;break;case 1825200146:b=5;break;case 135182:b=26;break;case 537006096:case 1745489939:b=6;break;case 1112152071:b=13;break;case 1073877010:b=27;break;case 1073877011:b=28;break;case 135190:b=30;break;case 135188:b=29;break;case 1275203608:b=21;break;case 1112152073:b=14;break;case 1112152074:b=15;break;case 1112152075:b=0;break;case 1112152076:b=7;break;case 1649022989:b=12;break;case 659482:b=4;break;case 1112152078:b=10;break;case 1814695966:b=33;break;case 135198:b=18;
break;case 659488:b=1;break;default:this.error(47)}if(null==this.sm.getShape(b)&&2==this.slen)switch(this.st[1].tok){case 1073742334:case 12291:case 1073742333:return}switch(a){case 1114249217:case 1112152066:case 1112152071:case 1112152073:case 1112152074:case 1649022989:case 1112152078:this.setSizeBio(b);return;case 1112150019:case 1112150021:this.cmdDots(b);return;case 1112152070:case 1112152075:case 1112152076:this.setSize(b,1112152070==a?-1E3:1);return;case 1825200146:this.cmdLabel(1,null);return;
case 135198:this.cmdVector();return;case 659488:this.cmdWireframe();return}switch(a){case 1611272194:this.cmdAxes(1);break;case 1812599299:this.cmdBoundbox(1);break;case 537022465:this.cmdEcho(1);break;case 1611272202:this.cmdFrank(1);break;case 1814695966:this.cmdUnitcell(1);break;case 1112150020:case 537006096:case 1745489939:case 1275203608:case 659482:this.getCmdExt().dispatch(b,!1,this.st);break;case 135174:case 134353926:case 135175:case 135176:case 135180:case 135182:case 1073877010:case 1073877011:case 135190:case 135188:this.getIsoExt().dispatch(b,
!1,this.st)}},"~N");f(d,"cmdAnimation",function(){var a=!1;switch(this.getToken(1).tok){case 1073742335:a=!0;case 1073742334:this.chk||this.vwr.setAnimationOn(a);break;case 1073742029:a=I(this.floatParameter(2));this.chk||this.vwr.am.setMorphCount(Math.abs(a));break;case 1610625028:this.iToken=2;a=1073742327==this.tokAt(2)?null:this.atomExpressionAt(2);this.checkLength(this.iToken+1);this.chk||this.vwr.setAnimDisplay(a);break;case 4115:this.isArrayParameter(2)?this.setFrameSet(2):this.cmdModel(2);
break;case 1073742024:var b=a=1;5<this.slen&&this.bad();var c=JS.T.getTokFromName(this.paramAsStr(2));switch(c){case 1073742070:a=b=0;break;case 528411:case 1073742082:break;default:this.invArg()}4<=this.slen&&(a=b=this.floatParameter(3),5==this.slen&&(b=this.floatParameter(4)));this.chk||this.vwr.am.setAnimationReplayMode(c,a,b);break;case 1073741918:a=2;b=0;switch(this.tokAt(a)){case 268440576:b=-this.intParameter(++a);break;case 268440577:b=this.intParameter(++a);break;case 2:b=this.intParameter(a);
break;default:this.invArg()}this.checkLength(++a);1!=b&&-1!=b&&this.errorStr2(35,"-1","1");this.chk||this.vwr.am.setAnimationDirection(b);break;case 1073741950:this.setIntProperty("animationFps",this.intParameter(this.checkLast(2)));break;default:this.frameControl(1)}});f(d,"setFrameSet",function(a){a=this.expandFloatArray(this.floatParameterSet(a,0,2147483647),1,!1);this.checkLength(this.iToken+1);if(!this.chk){var b=new java.util.Hashtable;0<a.length&&b.put("frames",a);b.put("currentFrame",Integer.$valueOf(0));
this.vwr.am.setMovie(b)}},"~N");f(d,"cmdAxes",function(a){var b=this.tickParamAsStr(a,!0,!0,!1);a=this.iToken+1;var c=this.tokAt(a),e=this.optParameterAsString(a).toLowerCase();if(this.slen==a+1&&JU.PT.isOneOf(e,";window;unitcell;molecular;"))this.setBooleanProperty("axes"+e,!0);else{switch(c){case 1073742066:this.setFloatProperty("axisOffset",this.floatParameter(++a));this.checkLast(this.iToken);return;case 12289:this.setShapeProperty(34,"origin",this.centerParameter(a+1,null));this.checkLast(this.iToken);
return;case 1140850696:a=this.stringParameter(a+1);JU.PT.isOneOf(a,";a;b;c;ab;ac;bc;abc;")||(a=null);this.setShapeProperty(34,"type",a);this.checkLast(this.iToken);return;case 536875059:this.setFloatProperty("axesScale",this.floatParameter(this.checkLast(++a)));return;case 1825200146:switch(c=this.tokAt(a+1)){case 1073742334:case 1073742335:this.checkLength(a+2);this.setShapeProperty(34,"labels"+(1073742335==c?"On":"Off"),null);return}b=null;switch(this.slen-a){case 7:this.setShapeProperty(34,"labels",
P(-1,[this.paramAsStr(++a),this.paramAsStr(++a),this.paramAsStr(++a),this.paramAsStr(++a),this.paramAsStr(++a),this.paramAsStr(++a)]));break;case 5:b=this.paramAsStr(a+4);case 4:this.setShapeProperty(34,"labels",P(-1,[this.paramAsStr(++a),this.paramAsStr(++a),this.paramAsStr(++a),b]));break;default:this.bad()}return}e.equals("position")?(1073742334==this.tokAt(++a)?b=new JU.P3:(b=this.xypParameter(a),null==b&&this.invArg(),a=this.iToken,this.setShapeProperty(34,"axes2",4==this.tokAt(a+1)?this.stringParameter(++a):
null)),this.setShapeProperty(34,"position",b)):(a=this.getSetAxesTypeMad10(a),this.chk||2147483647==a||(this.setObjectMad10(34,"axes",a),null!=b&&this.setShapeProperty(34,"tickInfo",b)))}},"~N");f(d,"cmdBackground",function(a){this.getToken(a);if(4120==this.theTok){var b=null;switch(this.tokAt(++a)){case 15:case 6:b=this.getToken(a).value;break;default:a=this.paramAsStr(this.checkLast(a));if(this.chk)return;if(a.equalsIgnoreCase("none")||0==a.length){this.vwr.setBackgroundImage(null,null);return}b=
a.startsWith(";base64,")?new JU.BArray(JU.Base64.decodeBase64(a)):a}if(this.vwr.fm.loadImage(b,null,!this.useThreads(!1)))throw new JS.ScriptInterruption(this,"backgroundImage",1);}else 1073742333==this.theTok||this.isColorParam(a)?(a=this.getArgbParamLast(a,!0),this.chk||(this.setObjectArgb("background",a),this.vwr.setBackgroundImage(null,null))):this.colorShape(-this.theTok,a+1,!0)},"~N");f(d,"cmdBind",function(){var a=this.stringParameter(1),b=this.paramAsStr(2);this.checkLength(3);this.chk||this.vwr.bindAction(a,
b)});f(d,"cmdBondorder",function(){this.checkLength(-3);var a=0;switch(this.getToken(1).tok){case 2:case 3:131071==(a=JU.Edge.getBondOrderFromFloat(this.floatParameter(1)))&&this.invArg();break;default:131071==(a=JU.Edge.getBondOrderFromString(this.paramAsStr(1)))&&this.invArg(),33==a&&3==this.tokAt(2)&&(a=JU.Edge.getPartialBondOrderFromFloatEncodedInt(this.st[2].intValue))}this.setShapeProperty(1,"bondOrder",Integer.$valueOf(a))});f(d,"cmdBoundbox",function(a){var b=this.tickParamAsStr(a,!1,!0,!1);
a=this.iToken+1;var c=1;if(536875059==this.tokAt(a)){if(c=this.floatParameter(++a),a++,a==this.slen){this.chk||this.vwr.ms.setBoundBox(null,null,!0,c);return}}else if(4141==this.tokAt(a)){this.chk||this.vwr.ms.setBoundBox(null,null,!0,0);return}var e=1073741902==this.tokAt(a);e&&a++;if(this.isCenterParameter(a)){var g=Array(1),p=a,j=this.centerParameter(a,g);a=this.iToken+1;if(e||this.isCenterParameter(a))g=e?this.centerParameter(a,g):this.getPoint3f(a,!0,!0),a=this.iToken+1,this.chk||this.vwr.ms.setBoundBox(j,
g,e,c);else if(null!=g[0]&&x(g[0],"JU.BS"))this.chk||this.vwr.calcBoundBoxDimensions(g[0],c);else if(null==g[0]&&1073742330==this.tokAt(p)){if(this.chk)return;a=this.getObjectBoundingBox(this.objectNameParameter(++p));null==a&&this.invArg();this.vwr.ms.setBoundBox(a[0],a[1],!0,c);a=this.iToken+1}else this.invArg();if(a==this.slen)return}c=this.getSetAxesTypeMad10(a);this.chk||2147483647==c||(null!=b&&this.setShapeProperty(32,"tickInfo",b),this.setObjectMad10(32,"boundbox",c))},"~N");f(d,"cmdCD",function(){if(!this.chk){var a=
1==this.slen?null:this.paramAsStr(1);this.showString(this.vwr.cd(a))}});f(d,"cmdCenter",function(a){1==this.slen?this.vwr.setNewRotationCenter(null):(4==this.slen&&1814695966==this.tokAt(2)&&(a=2),a=this.centerParameter(a,null),null==a&&this.invArg(),this.chk||this.vwr.setNewRotationCenter(a))},"~N");f(d,"cmdColor",function(){var a=1,b=4==this.tokAt(1)?this.stringParameter(1):null;if(this.isColorParam(1))this.theTok=1153433601;else{var c=0,a=2,e=this.getToken(1).tok;if(4==e&&(e=JS.T.getTokFromName(b),
0==e||1073742186==e))e=4;switch(e){case 1073742330:this.setObjectProperty();return;case 1086324739:case 2097154:case 2097166:case 1086326788:case 1073741946:case 1631586315:case 1086324742:case 1113589786:case 1086324746:case 1073741991:case 1094713360:case 1094713361:case 1073742333:case 1073742074:case 1111492619:case 1094713362:case 1715472409:case 1073742116:case 1073742110:case 1275082241:case 1112152075:case 1073742144:case 1111490574:case 1639976963:case 1111490575:case 1111492620:case 1111490588:case 1648363544:case 1145047055:this.theTok=
1153433601;a=1;break;case 4:a=2;this.isArrayParameter(a)&&(b=b+="="+JS.SV.sValue(JS.SV.getVariableAS(this.stringParameterSet(a))).$replace("\n"," "),a=this.iToken+1);c=1111490588==this.tokAt(a);this.chk||this.vwr.setPropertyColorScheme(b,c,!0);c&&++a;if(1073742114==this.tokAt(a)||1073741826==this.tokAt(a))b=this.floatParameter(++a),a=this.floatParameter(++a),this.chk||this.vwr.cm.setPropertyColorRange(b,a);return;case 1073742114:case 1073741826:b=this.floatParameter(2);a=this.floatParameter(this.checkLast(3));
this.chk||this.vwr.cm.setPropertyColorRange(b,a);return;case 1610616835:c=this.getArgbParamLast(2,!0);this.chk||this.setObjectArgb("background",c);return;case 12290:case 10:case 1073742325:a=-1;this.theTok=1153433601;break;case 1073742134:c=this.getArgbParamLast(2,!1);this.chk||this.vwr.cm.setRubberbandArgb(c);return;case 536870920:case 1611141172:a=2;1073742074==this.tokAt(2)&&a++;c=this.getArgbParamLast(a,!0);if(this.chk)return;this.sm.loadShape(8);this.setShapeProperty(8,1611141172==e?"argbSelection":
"argbHighlight",Integer.$valueOf(c));return;case 1611272194:case 1812599299:case 1814695966:case 1073741824:case 1612709900:b=this.paramAsStr(1);if(this.checkToken(2))switch(c=this.getToken(2).tok,c){case 1073742333:c=1073741991;break;case 1073741991:case 1073742116:case 1073742110:break;default:c=this.getArgbParam(2)}0==c&&this.error(9);this.checkLast(this.iToken);if(b.equalsIgnoreCase("axes")||0<=JV.StateManager.getObjectIdFromName(b)){this.setObjectArgb(b,c);return}if(this.setElementColor(b,c))return;
this.invArg();break;case 135180:case 134353926:this.setShapeProperty(JV.JC.shapeTokenIndex(e),"thisID","+PREVIOUS_MESH+")}}this.colorShape(-this.theTok,a,!1)});f(d,"cmdDefine",function(){(3>this.slen||"string"!=typeof this.getToken(1).value)&&this.invArg();var a=this.getToken(1).value.toLowerCase();-2147483648!=JU.PT.parseInt(a)&&this.invArg();if(!this.chk){var b=a.startsWith("site_");if(0==a.indexOf("dynamic_")||b){for(var c=Array(this.slen),e=this.slen;0<=--e;)c[e]=this.st[e];this.vwr.definedAtomSets.put("!"+
(b?a:a.substring(8)),c)}else b=this.atomExpressionAt(2),this.vwr.definedAtomSets.put(a,b),this.chk||this.vwr.g.setUserVariable("@"+a,JS.SV.newV(10,b))}});f(d,"cmdDelay",function(){var a=0;switch(this.getToken(1).tok){case 1073742335:a=1;break;case 2:a=1E3*this.intParameter(1);break;case 3:a=I(1E3*this.floatParameter(1));break;default:this.error(34)}this.refresh(!1);this.doDelay(Math.abs(a),3==this.slen&&4==this.tokAt(2)?JS.SV.sValue(this.getToken(2)):null)});f(d,"cmdDelete",function(){if(1073742330==
this.tokAt(1))4==this.slen&&this.optParameterAsString(2).equals("saved")&&4==this.slen?(this.vwr.stm.deleteSaved(this.optParameterAsString(3)),this.doReport()&&this.report(J.i18n.GT.o(J.i18n.GT.$("show saved: {0}"),this.vwr.stm.listSavedStates()),!1)):this.setObjectProperty();else{var a=1==this.slen?null:this.atomExpression(this.st,1,0,!0,!1,null,!1);this.chk||(null==a&&(a=this.vwr.getAllAtoms()),a=this.vwr.deleteAtoms(a,!1),this.doReport()&&this.report(J.i18n.GT.i(J.i18n.GT.$("{0} atoms deleted"),
a),!1))}});f(d,"cmdDisplay",function(a){var b=null,c=0,e=1,g;switch(g=this.tokAt(1)){case 1275069441:case 1073742119:c=g,g=this.tokAt(++e)}var p=1086324742==g;p&&(g=this.tokAt(++e));switch(g){case 1073742330:this.setObjectProperty();return;case 0:break;default:b=4==this.slen&&1677721602==this.tokAt(2)?JM.BondSet.newBS(JU.BSUtil.newBitSet2(0,this.vwr.ms.bondCount)):this.atomExpressionAt(e)}this.chk||(x(b,"JM.BondSet")?this.vwr.ms.displayBonds(b,a):this.vwr.displayAtoms(b,a,p,c,this.tQuiet))},"~B");
f(d,"cmdDots",function(a){this.chk||this.sm.loadShape(a);this.setShapeProperty(a,"init",null);for(var b=NaN,c=J.atomdata.RadiusData.EnumType.ABSOLUTE,e=1,g=!1;;){switch(this.getToken(e).tok){case 1073742072:g=!0;case 1073742335:b=1;c=J.atomdata.RadiusData.EnumType.FACTOR;break;case 1073742334:b=0;break;case 1073741976:this.setShapeProperty(a,"ignore",this.atomExpressionAt(e+1));e=this.iToken+1;continue;case 3:g=1073742072==this.tokAt(e+1)||0>this.floatParameter(e);break;case 2:var p=this.intParameter(e);
if(1665140738==this.tokAt(e+1)){e++;this.setShapeProperty(a,"atom",Integer.$valueOf(p));this.setShapeProperty(a,"radius",Float.$valueOf(this.floatParameter(++e)));1765808134==this.tokAt(++e)&&(this.setShapeProperty(a,"colorRGB",Integer.$valueOf(this.getArgbParam(++e))),e++);10!=this.getToken(e).tok&&this.invArg();this.setShapeProperty(a,"dots",this.st[e].value);return}}break}b=Float.isNaN(b)?this.encodeRadiusParameter(e,g,!0):new J.atomdata.RadiusData(null,b,c,J.c.VDW.AUTO);null!=b&&(Float.isNaN(b.value)&&
this.invArg(),g&&this.restrictSelected(!1,!1),this.setShapeSize(a,b))},"~N");f(d,"cmdEcho",function(a){if(!this.chk){a=this.optParameterAsString(a);var b=!0;this.vwr.ms.getEchoStateActive()&&(a.startsWith("\u0001")&&(a=a.substring(1),b=!1),null!=a&&this.setShapeProperty(31,"text",a));b&&(this.vwr.getRefreshing()&&null!=a&&!a.startsWith("%SCALE"))&&this.showString(this.vwr.formatText(a))}},"~N");f(d,"cmdFile",function(){var a=this.intParameter(this.checkLast(1));if(!this.chk){var b=this.vwr.ms.getModelNumberIndex(1E6*
a+1,!1,!1),c=-1;0<=b&&(c=this.vwr.ms.getModelNumberIndex(1E6*(a+1)+1,!1,!1),0>c&&(c=this.vwr.ms.mc),c--);this.vwr.setAnimationOn(!1);this.vwr.am.setAnimationDirection(1);this.vwr.setAnimationRange(b,c);this.vwr.setCurrentModelIndex(-1)}});f(d,"cmdFixed",function(){var a=1==this.slen?null:this.atomExpressionAt(1);this.chk||this.vwr.setMotionFixedAtoms(a)});f(d,"cmdFor",function(a,b){var c=this.theToken,e=this.st[0].intValue,g=c.forVars,p=O(2,0),j=null,d=null,f=null,q=0,k=!0,m=!1,n=0,t=null;if(b&&null!=
g)if(a=1275068432,f=g[0],d=g[1],j=g[1].value,n=++d.intValue,2==d.tok){m=0>n;p=j[0];k=j[1];if(k=p!=k&&k<p==m)f.intValue=j[0]=p+(m?-1:1);n=-1}else 7==d.tok?((k=n<=j.size())&&f.setv(JS.SV.selectItemVar(d)),n=-1):(this.isBondSet=x(j,"JM.BondSet"),n=j.nextSetBit(n),k=0<=n);else{for(var B=!1,v=1,u=0;v<this.slen&&2>n;v++)switch(a=this.tokAt(v)){case 36868:B=!0;break;case 1073742339:0<u?u--:p[n++]=v;break;case 1275068432:case 1073741952:t=this.paramAsStr(v-1);u-=2;if(this.isAtomExpression(++v))q=10,j=this.atomExpressionAt(v),
this.isBondSet&&(j=JM.BondSet.newBS(j)),k=0<=j.nextSetBit(0);else switch(q=this.parameterExpressionList(-v,1,!1),(null==q||1>q.size())&&this.invArg(),v=q.get(0),q=v.tok){case 10:j=v.value;k=!j.isEmpty();break;case 7:j=v.getList();n=j.size();if((k=0<n)&&1073741952==a)j=O(-1,[JS.SV.iValue(j.get(0)),JS.SV.iValue(j.get(n-1))]),m=j[1]<j[0],a=1275068432,q=2;break;case 6:var v=v.getMap(),r=v.keySet().size();if(k=0<r)j=Array(r),v.keySet().toArray(j),java.util.Arrays.sort(j);break;default:this.invArg()}v=
this.iToken;break;case 1275082241:u+=2}b||(this.pushContext(c,"FOR"),this.thisContext.forVars=g,g=null);null==t&&(n=b?null==j?p[1]+1:2:2,36868==this.tokAt(n)&&n++,t=this.paramAsStr(n),(m=t.equals("--")||t.equals("++"))&&(t=this.paramAsStr(++n)));if(k)if(1275068432==a){f=this.getContextVariableAsVariable(t,B);null==f&&!B&&(f=this.vwr.g.getAndSetNewVariable(t,!1));if(null==f||null==f.myName)t.startsWith("_")&&this.invArg(),B?this.contextVariables.put(t.toLowerCase(),f=JS.SV.newI(0)):f=this.vwr.g.getAndSetNewVariable(t,
!0);2==q?(f.tok=2,f.intValue=j[0],d=JS.SV.newV(2,j),d.intValue=m?-2147483648:0,n=-1):(d=JS.SV.getVariable(j),10==q?(n=j.nextSetBit(0),d.intValue=0):(d.intValue=1,f.setv(JS.SV.selectItemVar(d)),n=-1));null==g&&(g=c.forVars=Array(2));g[0]=f;g[1]=d}else{k=this.tokAt(n);if(1073742339!=k&&(JS.T.tokAttr(k,1073741824)||null!=(d=this.getContextVariableAsVariable(t,!1))))!m&&268440324!=this.getToken(++n).tok&&this.invArg(),m&&(n-=2),this.setVariable(++n,this.slen-1,t,!1);k=p[0]+1==p[1]||this.parameterExpressionBoolean(p[0]+
1,p[1])}}k&&(1275068432==a&&0<=n)&&(d.intValue=n,f.tok=10,this.isBondSet?(f.value=new JM.BondSet,f.value.set(n)):f.value=JU.BSUtil.newAndSetBit(n));e++;k||(c.forVars=this.thisContext.forVars,this.popContext(!0,!1));b=!1;!k&&!this.chk&&(this.pc=Math.abs(e)-1);return b},"~N,~B");f(d,"cmdFlow",function(a,b,c){var e,g=this.st[0].intValue,p=0>g&&!this.chk;e=!0;var d=0;switch(a){case 134320141:case 102436:return this.cmdFunc(),b;case 364558:return b;case 102412:e=this.theToken;this.pushContext(e,"CATCH");
!p&&null!=e.name0&&this.contextVariables.put(e.name0,e.contextVariables.get(e.name0));e=!p;this.st[0].intValue=-Math.abs(g);break;case 102410:case 102413:case 102411:d=Math.abs(this.aatoken[Math.abs(g)][0].intValue);switch(p?0:this.cmdFlowSwitch(this.theToken,a)){case 0:d=-d;e=!1;break;case -1:e=!1}this.aatoken[this.pc][0].intValue=Math.abs(g);this.theToken=this.aatoken[Math.abs(g)][0];102409!=this.theToken.tok&&(this.theToken.intValue=d);break;case 134320649:case 102402:e=!p&&this.parameterExpressionBoolean(1,
0);if(this.chk)break;d=Math.abs(this.aatoken[Math.abs(g)][0].intValue);this.aatoken[Math.abs(g)][0].intValue=p||e?-d:d;102412==a&&(this.aatoken[this.pc][0].intValue=-g);break;case 364547:this.checkLength(1);0>g&&!this.chk&&(this.pc=-g-1);break;case 364548:this.checkLength(1);break;case 102406:b||this.pushContext(this.theToken,"WHILE");b=!1;!this.parameterExpressionBoolean(1,0)&&!this.chk&&(this.pc=g,this.popContext(!0,!1));break;case 102407:if(!this.chk){this.breakAt(g);break}if(1==this.slen)break;
p=this.intParameter(this.checkLast(1));if(this.chk)break;for(a=0;a<p;a++)this.popContext(!0,!1);break;case 102408:b=!0;this.chk||(this.pc=g-1);1<this.slen&&this.intParameter(this.checkLast(1));break;case 102409:switch(this.getToken(this.checkLast(1)).tok){case 364558:b=this.getToken(1).value;if(this.chk)return!1;this.runFunctionAndRet(b,"try",null,null,!0,!0,!0);return!1;case 134320141:case 102436:return this.addFunction(this.theToken.value),b;case 102412:this.popContext(!0,!1);break;case 102439:this.addProcess(c,
g,this.pc);this.popContext(!0,!1);break;case 102410:if(0<g&&-1==this.cmdFlowSwitch(this.aatoken[g][0],0)){for(;g<this.pc&&!(102413!=(a=this.aatoken[g][0].tok)&&102411!=a);g++);e=this.pc==g}break;case 134320648:case 102406:e=!1,b=!0}}!e&&!this.chk&&(this.pc=Math.abs(g)-1);return b},"~N,~B,JU.Lst");f(d,"cmdFlowSwitch",function(a,b){102410==b&&a.addName("_var");var c=a.contextVariables.get("_var");if(null==c)return 1;if(0==b)return a.contextVariables.remove("_var"),-1;if(102413==b)return-1;var e=this.parameterExpressionToken(1);
if(102411==b)return(c=JS.SV.areEqual(c,e))&&a.contextVariables.remove("_var"),c?1:-1;a.contextVariables.put("_var",e);return 1},"JS.ContextToken,~N");f(d,"cmdFont",function(a,b){var c="SansSerif",e="Plain",g="font",p=0,d=-1;switch(this.iToken=this.slen){case 6:d=this.floatParameter(5),5<=d&&(d=this.vwr.tm.getZoomSetting()/d/this.vwr.getScalePixelsPerAngstrom(!1));case 5:1073741824!=this.getToken(4).tok&&this.invArg(),e=this.paramAsStr(4);case 4:1073741824!=this.getToken(3).tok&&this.invArg();c=this.paramAsStr(3);
this.isFloatParameter(2)||this.error(34);b=this.floatParameter(2);a=-1;break;case 3:this.isFloatParameter(2)||this.error(34);-1==a?b=this.floatParameter(2):(1<=b&&(b+=p=5),c=null);break;default:if(5==a){b=13;g="fontsize";break}this.bad()}var f=536875059==this.tokAt(1);-1==a&&(a=f?31:this.getShapeType(this.getToken(1).tok));if(5==a){if(0==b||1<=b&&(6>b||63<b)){this.integerOutOfRange(6-p,63-p);return}this.chk||this.setShapeProperty(5,"setDefaults",0==b?this.vwr.slm.noneSelected:Boolean.FALSE)}this.chk||
("font"===g?(0<=JU.Font.getFontStyleID(c)&&(e=c,c="SansSerif"),c=this.vwr.getFont3D(c,e,b)):c=Float.$valueOf(b),this.sm.loadShape(a),f&&this.setShapeProperty(31,"target","%SCALE"),this.setShapeProperty(a,g,c),0<=d&&this.setShapeProperty(a,"scalereference",Float.$valueOf(d)),f&&this.setShapeProperty(31,"thisID",null))},"~N,~N");f(d,"cmdFrank",function(a){var b=!0;if(this.slen>a)switch(this.getToken(this.checkLast(a)).tok){case 1073742335:break;case 1073742334:b=!1;break;default:this.error(5)}this.setBooleanProperty("frank",
b)},"~N");f(d,"cmdFunc",function(){if(!this.chk||this.isCmdLine_c_or_C_Option){var a=this.getToken(0).value.toLowerCase();if(268440324==this.tokAt(1)&&1073742333==this.tokAt(2))this.vwr.removeFunction(a);else{this.isFunction(a)||this.error(10);var b=1==this.slen||3==this.slen&&268435968==this.tokAt(1)&&268435969==this.tokAt(2)?null:this.parameterExpressionList(1,-1,!1);this.chk||this.runFunctionAndRet(null,a,b,null,!1,!0,!0)}}});f(d,"cmdGetProperty",function(){if(!this.chk){var a="",b=a=this.optParameterAsString(1);
0<=b.indexOf(".")&&(b=b.substring(0,b.indexOf(".")));0<=b.indexOf("[")&&(b=b.substring(0,b.indexOf("[")));var b=this.vwr.getPropertyNumber(b),c="";switch(this.tokAt(2)){default:c=this.optParameterAsString(2);break;case 12290:case 1073742325:case 10:c=this.atomExpressionAt(2),a.equalsIgnoreCase("bondInfo")&&this.isAtomExpression(++this.iToken)&&(c=P(-1,[c,this.atomExpressionAt(this.iToken)]))}if(0<a.length&&0>b)c=a="";else if(0<=b&&3>this.slen){if((c=this.vwr.getDefaultPropertyParam(b)).equals("(visible)"))c=
this.vwr.ms.getVisibleSet(!0)}else if(b==this.vwr.getPropertyNumber("fileContents")){b=c.toString();for(c=3;c<this.slen;c++)b+=this.paramAsStr(c);c=b}a=this.vwr.getProperty("readable",a,c);this.showString(a)}});f(d,"cmdGoto",function(a){a=a?this.paramAsStr(this.checkLast(1)):null;for(var b=null==a?this.aatoken.length-1:-1,c=null,e=b+1;e<this.aatoken.length;e++){var c=this.aatoken[e],g=c[0].tok;switch(g){case 20485:case 0:c=c[c.length-1].value;0==g&&(c=c.substring(c.startsWith("#")?1:2));break;default:continue}if(c.equalsIgnoreCase(a)){b=
e;break}}0>b&&this.invArg();null==a&&(b=0);g=b<this.pc?1:-1;c=0;for(e=b;e!=this.pc;e+=g)switch(this.aatoken[e][0].tok){case 1275335685:case 102439:case 134320648:case 102412:case 102406:c++;break;case 1275334681:c--;break;case 102409:switch(this.aatoken[e][1].tok){case 102439:case 134320648:case 102412:case 102406:c--}}if(null==a)for(b=2147483647;0<c;--c)this.popContext(!1,!1);0!=c&&this.invArg();this.chk||(this.pc=b-1)},"~B");f(d,"cmdHbond",function(){if(2==this.slen&&4102==this.getToken(1).tok){if(!this.chk){var a=
this.vwr.autoHbond(null,null,!1);this.report(J.i18n.GT.i(J.i18n.GT.$("{0} hydrogen bonds"),Math.abs(a)),!1)}}else 2==this.slen&&12291==this.getToken(1).tok?this.chk||this.checkExtension(1613238294):(a=this.getMadParameter(),2147483647!=a&&(this.setShapeProperty(1,"type",Integer.$valueOf(30720)),this.setShapeSizeBs(1,a,null),this.setShapeProperty(1,"type",Integer.$valueOf(1023))))});f(d,"cmdHelp",function(){if(!this.chk){var a=this.optParameterAsString(1).toLowerCase(),b=0;a.startsWith("mouse")&&0<=
(b=a.indexOf(" "))&&b==a.lastIndexOf(" ")?this.showString(this.vwr.getBindingInfo(a.substring(b+1))):(JS.T.tokAttr(JS.T.getTokFromName(a),4096)&&(a="?command="+a),this.vwr.getHelp(a))}});f(d,"cmdHistory",function(a){if(1==this.slen)this.showString(this.vwr.getSetHistory(2147483647));else if(2==a)a=this.intParameter(this.checkLast(2)),0>a&&this.invArg(),this.chk||this.vwr.getSetHistory(0==a?0:-2-a);else switch(this.getToken(this.checkLast(1)).tok){case 1073742335:case 1073741882:this.chk||this.vwr.getSetHistory(-2147483648);
break;case 1073742334:this.chk||this.vwr.getSetHistory(0);break;default:this.errorStr(24,"ON, OFF, CLEAR")}},"~N");f(d,"cmdHover",function(){if(!this.chk){var a=1==this.slen?"on":this.paramAsStr(1);a.equalsIgnoreCase("on")?a="%U":a.equalsIgnoreCase("off")&&(a=null);this.vwr.setHoverLabel(a)}});f(d,"cmdLabel",function(a,b){if(!this.chk){this.sm.loadShape(5);var c=null;switch(this.getToken(a).tok){case 1073742335:c=this.vwr.getStandardLabelFormat(0);break;case 1073742334:break;case 12294:case 1610625028:this.setShapeProperty(5,
"display",1610625028==this.theTok?Boolean.TRUE:Boolean.FALSE);return;case 7:c=this.theToken.value;break;default:c=this.paramAsStr(a)}this.sm.setLabel(c,null==b?this.vwr.bsA():b)}},"~N,JU.BS");f(d,"cmdLoad",function(){var a=!this.chk||this.isCmdLine_C_Option,b=!1,c=!1,e=!1,g=!1,p=!1,d=this.vwr.async,f=!1,l=!1,q=this.vwr.getBoolean(603979792),k=null,m,n=134221834==this.tokAt(0)?0:1,t=null,B=this.vwr.ms.mc-(this.vwr.fm.getFileName().equals("zapped")?1:0),v=this.vwr.ms.ac,u=(new JU.SB).append("load"),
r=1,w=new java.util.Hashtable;this.$isStateScript&&(w.put("isStateScript",Boolean.TRUE),this.forceNoAddHydrogens&&w.put("doNotAddHydrogens",Boolean.TRUE));var E=null,C=null,s=null,A=null,A=new JU.SB,D=0,y;if(1==this.slen)n=0;else{E=6==this.tokAt(1)?"@":this.paramAsStr(n);if(2==this.slen&&!this.chk&&(E.endsWith(".spt")||E.endsWith(".png")||E.endsWith(".pngj"))){this.cmdScript(0,E,null,null);return}y=this.tokAt(n);switch(y){case 1073742077:l=!0,u.append(" orientation"),this.vwr.stm.saveOrientation("preload",
null),E=this.paramAsStr(++n),y=JS.T.getTokFromName(E)}switch(y){case 1073741839:E=this.optParameterAsString(++n);m=JU.PT.parseInt(E);(b=!this.$isStateScript||0<this.vwr.ms.mc)&&u.append(" append");0<=m&&(E=this.optParameterAsString(++n),b&&(u.append(" "+m),q=!1,w.put("appendToModelIndex",Integer.$valueOf(m))));y=JS.T.getTokFromName(E);break;case 4108:this.checkExtension(4108);return;case 1073877011:case 1610616855:case 1073742015:b=this.paramAsStr(this.checkLast(2));if(!this.chk)switch(y){case 1073877011:w.put("service",
"nbo");w.put("mode",Integer.$valueOf(1));w.put("action","load");w.put("value",b);w.put("sync",Boolean.TRUE);this.vwr.sm.processService(w);this.runScript(w.get("ret"));break;case 1610616855:this.vwr.setHistory(b);break;case 1073742015:this.vwr.setMenu(b,!0)}return;case 4130:g=b=!0;q=!1;u.append(" mutate");E=this.optParameterAsString(++n);y=JS.T.getTokFromName(E);w.put("appendToModelIndex",Integer.$valueOf(this.vwr.am.cmi));break;case 1073741824:n++,u.append(" "+E),D=1073741824==y&&JU.PT.isOneOf(E.toLowerCase(),
";xyz;vxyz;vibration;temperature;occupancy;partialcharge;")?JS.T.getTokFromName(E):0,0!=D&&(w.put("atomDataOnly",Boolean.TRUE),w.put("modelNumber",Integer.$valueOf(1)),4166==D&&(D=1145047055),s=this.vwr.fm.getFileInfo(),b=!0)}switch(y){case 36868:k="@"+this.paramAsStr(++n);break;case 1228935687:n++;u.append(" "+E);this.optParameterAsString(n).equals("+")&&(f=!0,n++,u.append(" +"));this.optParameterAsString(n).equals("-")&&(f=!0,n++,u.append(" -"));7==this.tokAt(n)&&(C=this.stringParameterSet(n),n=
this.iToken,n+1!=this.slen&&this.invArg(),null!=C&&(r=C.length));break;case 134217764:this.slen<n+4&&this.invArg(),n-=2,k="0",w.put("isEmptyLoad",Boolean.TRUE);case 1073741984:c=!0;n++;u.append(" inline");break;case 134218757:e=!0;n++;break;case 1073741849:d=!0;w.put("async",Boolean.TRUE);n++;break;case 536870926:case 1094717454:n++;u.append(" "+E);536870926==y&&w.put("isTrajectory",Boolean.TRUE);if(this.isPoint3f(n)){var F=this.getPoint3f(n,!1,!0),n=this.iToken+1;w.put("firstLastStep",O(-1,[I(F.x),
I(F.y),I(F.z)]));u.append(" "+JU.Escape.eP(F))}else switch(this.tokAt(n)){case 10:m=this.getToken(n++).value;w.put("bsModels",m);u.append(" "+JU.Escape.eBS(m));break;default:w.put("firstLastStep",O(-1,[0,-1,1]))}break;case 1073741824:break;case 134221834:p=this.stringParameter(++n).toLowerCase();E=this.optParameterAsString(n+1);if((b=p.startsWith("append"))&&p.startsWith("append modelindex="))m=JU.PT.parseInt(p.substring(18)),0<=m&&(q=!1,w.put("appendToModelIndex",Integer.$valueOf(m)));l=0<=p.indexOf("orientation");
n=this.addLoadData(u,p,w,n);p=!0;break;default:E="fileset"}!c&&(null==k&&null==C&&4!=this.getToken(n).tok)&&this.error(16)}var G=n,F=n+1;m=null;1073741848==this.tokAt(F)&&(m=this.stringParameter(n=F+1),""!==this.vwr.fm.getPathForAllFiles()&&(m=null,G=n));var H=F=null;e&&1073741940==this.tokAt(n+1)&&(++n,t=this.stringParameter(++n));if(this.slen==n+1){if(null==k&&(0==n||null==C&&0==(k=this.paramAsStr(G)).length))k=this.getFullPathName(!0);if(null==k&&null==C){this.cmdZap(!1);return}if(null==C&&!c)if(e)k=
"$"+k;else{if(k.equals("String[]"))return;0==k.indexOf("[")&&(C=JU.Escape.unescapeStringArray(k),null!=C&&(1==n&&u.append(" files"),r=C.length))}if(null!=C)for(e=0;e<r;e++)u.append(" /*file*/").append(JU.PT.esc(C[e]))}else if(this.isLoadOption(this.getToken(n+1).tok)){if(null==k&&0==(k=this.paramAsStr(G)).length&&null==(k=this.getFullPathName(!0))){this.cmdZap(!1);return}(G==n||null!=m)&&n++;if(k.equals("String[]"))return;if(1073742010==(y=this.tokAt(n)))e=this.stringParameter(++n),w.put("manifest",
e),A.append(" MANIFEST "+JU.PT.esc(e)),y=this.tokAt(++n);switch(y){case 2:case 7:case 268437504:case 1073742195:n=this.getLoadModelIndex(n,A,w)}n=this.getCmdExt().getLoadSymmetryParams(n,A,w);1073741839==this.tokAt(n)&&(134221834==this.tokAt(++n)?(n+=2,F=this.getToken(n++).value,H=this.stringParameter(++n),++n):(H=this.stringParameter(n++),F=this.stringParameter(n++)),w.put(H,F));1073741940==this.tokAt(n)&&(t=this.stringParameter(++n))}else r=new JU.Lst,1==n&&(268440577==this.tokAt(n+1)||268440576==
this.tokAt(n+1)?E="files":n++,u.append(" "+E)),268440576==this.tokAt(n+1)&&(f=!0),t=this.getLoadFilesList(n,u,A,w,r),C=r.toArray(Array(r=r.size())),!f&&0<=u.indexOf("/*concat*/")&&(f=!0);if(a){null!=C&&(k="fileSet");null!=F&&A.append(' APPEND data "'+H+'"\n'+F+(F.endsWith("\n")?"":"\n")+'end "'+H+'"');null==t&&(t=this.vwr.g.defaultLoadFilter);0<t.length&&(0<=t.toUpperCase().indexOf("DOCACHE")&&!this.$isStateScript&&(!b&&!JV.Viewer.isJS)&&this.vwr.cacheClear(),w.put("filter",t),t.equalsIgnoreCase("2d")&&
(t="2D-noMin"),A.append(" FILTER "+JU.PT.esc(t)));a=!1;if(null==C)if(0<=this.vwr.am.cmi&&("::"+k).endsWith("::string")&&(k=this.vwr.getCurrentModelFile("null",!1),u=(new JU.SB).append("load inline "),c=!0),c)w.put("fileData",k);else if(k.startsWith("@")&&1<k.length){d=this.getVarParameter(k.substring(1),!1);if(x(d,"java.util.Map")&&d.containsKey("state.spt")){this.checkLength(n+1);this.loadPNGJVar(k,d,w);return}a=!0;x(d,"java.util.Map")&&d.containsKey("_DATA_")?(d=d.get("_DATA_"),d=JU.Base64.getBase64(d.data)):
d=""+d;u=(new JU.SB).append("{\n    var ").append(k.substring(1)).append(" = ").append(JU.PT.esc(d)).append(";\n    ").appendSB(u);w.put("fileData",d)}else if(!p&&!((k.startsWith("=")||k.startsWith("*"))&&0<k.indexOf("/"))){n="";F=k.indexOf("::");0<F&&20>F&&(n=k.substring(0,F+2),k=k.substring(F+2));if(k.startsWith("cache://"))m=null;else if(!g||0<k.length)k=this.checkFileExists("LOAD"+(b?"_APPEND_":"_"),d,k,G,!b&&this.pc!=this.pcResume),null==k&&this.error(57),k=n+k;k.startsWith("cache://")&&(m=null)}n=
d=null;null!=m&&(m.equals(".")&&(m=this.vwr.fm.getFilePath(k,!1,!0)),(0==m.length||this.vwr.fm.getFilePath(m,!1,!1).equalsIgnoreCase(this.vwr.fm.getFilePath(k,!1,!1)))&&this.invArg(),t=P(-1,[m]),d=this.vwr.getOutputChannel(m,t),null==d?JU.Logger.error("Could not create output stream for "+t[0]):w.put("outputChannel",d));if(null==C&&0==D){u.append(" ");a||c?u.append(0<=k.indexOf("\n")||a?JU.PT.esc(k):k):p||(null!=m&&(m=this.vwr.fm.getFilePath(m,!1,!1)),k.equals("String[]")||u.append("/*file*/").append(null!=
m?JU.PT.esc(m):"$FILENAME$"));if(!f&&(k.startsWith("=")||k.startsWith("*"))&&0<k.indexOf("/")){var f=!0,F=k.indexOf("/"),V;1==F&&null!=(V=this.vwr.getPdbID())?(k=k.substring(0,1)+V+k.substring(1),F=k.indexOf("/")):V=k.substring(1,F);c=k.substring(F+1);k=k.substring(0,F);if(0<=(F=k.indexOf(".")))k=k.substring(0,F);0<=";dssr;rna3d;dom;val;".indexOf(";"+c+";")||c.startsWith("dssr--")?(k.startsWith("=")&&(k+=".cif"),C=c.equals("all")?P(-1,[k,"*dom/"+V,"*val/"+V]):P(-1,[k,"*"+c+"/"+V]),k="fileSet",u=null,
a=!1,n="-"):k+="/"+c}null!=u&&(0<A.length()&&u.append(" /*options*/ ").append(A.toString()),a&&u.append("\n  }"),w.put("loadScript",u))}this.setCursorWait(!0);(V=this.vwr.getBoolean(603979934))&&JU.Logger.startTimer("load");!this.$isStateScript&&(!b&&!this.vwr.getBoolean(603979831))&&this.vwr.setBooleanProperty("legacyJavaFloat",!1);g&&w.put("isMutate",Boolean.TRUE);w.put("eval",this);A=this.vwr.loadModelFromFile(null,k,C,null,b,w,u,A,D,null!=n?n:f?"+":" ");V&&this.showString(JU.Logger.getTimerMsg("load",
0));null!=d&&(this.vwr.fm.setFileInfo(P(-1,[m])),JU.Logger.info(J.i18n.GT.o(J.i18n.GT.$("file {0} created"),m)),this.showString(this.vwr.fm.getFilePath(m,!1,!1)+" created"),d.closeChannel());if(0<D)this.vwr.fm.setFileInfo(s),null!=A&&!this.isCmdLine_c_or_C_Option&&this.evalError(A,null);else{if(null!=A&&!this.isCmdLine_c_or_C_Option){if(0==A.indexOf("NOTE: file recognized as a script file: ")){k=A.substring(40).trim();if(0<=k.indexOf("png|")&&k.endsWith("pdb|state.spt")){k=k.substring(0,k.lastIndexOf("|"));
k+=k.substring(k.lastIndexOf("|"));this.runScript('load "'+k+'"');return}this.cmdScript(0,k,null,null);return}if(this.vwr.async&&A.startsWith("File reader was not found:"))throw new JS.ScriptInterruption(this,"async",1);this.evalError(A,null)}this.debugHigh&&this.report("Successfully loaded:"+(null==C?w.get("fullPathName"):E),!1);this.finalizeLoad(b,q,f,l,r,v,B,p)}}});f(d,"checkFileExists",function(a,b,c,e,g){if(this.chk||c.startsWith("cache://"))return c;if((this.vwr.testAsync||JV.Viewer.isJS)&&
(b||c.startsWith("?"))||this.vwr.apiPlatform.forceAsyncLoad(c))c=this.loadFileAsync(a,c,e,g);a=this.vwr.getFullPathNameOrError(c);c=a[0];if(null==c)return null;null!=a[1]&&this.errorStr(17,c+":"+a[1]);return c},"~S,~B,~S,~N,~B");f(d,"addLoadData",function(a,b,c,e){a.append(" /*data*/ data");var g=b.indexOf("@");0<=g&&(b=b.$replace("@","_"));a.append(" ").append(JU.PT.esc(b));var p=0<=g?""+this.getParameter(b.substring(g+1),4,!0):this.paramAsStr(++e);p.startsWith(";base64,")||(p=JV.Viewer.fixInlineString(p,
this.vwr.getInlineChar()));c.put("fileData",p);c.put("isData",Boolean.TRUE);a.appendC("\n").append(p).append(" end ").append(JU.PT.esc(b));0>g&&(e+=2);return e},"JU.SB,~S,java.util.Map,~N");f(d,"loadPNGJVar",function(a,b,c){b=P(-1,[JS.SV.newV(6,b)]);this.getCmdExt().dispatch(1073741866,!1,b);c.put("imageData",b[0].value);b=this.vwr.getOutputChannel(null,null);c.put("outputChannel",b);this.vwr.createZip("","ZIPDATA",c);a="cache://VAR_"+a;this.vwr.cacheFileByName("cache://VAR_*",!1);this.vwr.cachePut(a,
b.toByteArray());this.cmdScript(0,a,null,null)},"~S,~O,java.util.Map");f(d,"getLoadFilesList",function(a,b,c,e,g){for(var p=null,d=null,f=null,l=null;a<this.slen;){switch(this.tokAt(a)){case 268440577:b.append("/*concat*/ +");++a;continue;case 268440576:b.append(" -");++a;continue;case 2:case 7:case 268437504:case 1073742195:a=this.getLoadModelIndex(a,c,e);continue;case 1073741940:d=this.stringParameter(++a);++a;continue;case 1073742329:e.remove("isTrajectory");null==p&&(p=new JU.Lst,f=JU.P3.new3(0,
-1,1));this.isPoint3f(++a)?(f=this.getPoint3f(a,!1,!0),a=this.iToken+1):10==this.tokAt(a)&&(l=this.getToken(a).value,f=null,a=this.iToken+1);break;case 1073741824:this.invArg()}g.addLast(this.paramAsStr(a++));null!=f?(p.addLast(O(-1,[I(f.x),I(f.y),I(f.z)])),b.append(" COORD "+JU.Escape.eP(f))):null!=l&&(p.addLast(l),b.append(" COORD "+JU.Escape.eBS(l)));b.append(" /*file*/$FILENAME"+g.size()+"$")}null!=p&&e.put("firstLastSteps",p);return d},"~N,JU.SB,JU.SB,java.util.Map,JU.Lst");f(d,"isLoadOption",
function(a){switch(a){case 1073742010:case 2:case 7:case 268437504:case 1073742195:case 1073742332:case 8:case 1073742080:case 1094713350:case 1073742163:case 1073741938:case 1073742114:case 134217764:case 1814695966:case 1073742066:case 134221834:case 1073741839:return!0;case 1073741940:case 1073741824:return 1073742329!=this.tokAt(this.iToken+2)}return!1},"~N");f(d,"getLoadModelIndex",function(a,b,c){switch(this.tokAt(a)){case 2:c.remove("firstLastStep");c.remove("bsModel");c.put("useFileModelNumbers",
Boolean.TRUE);a=this.intParameter(a);b.append(" ").appendI(a);0>a?c.put("vibrationNumber",Integer.$valueOf(-a)):c.put("modelNumber",Integer.$valueOf(a));break;case 7:case 268437504:case 1073742195:c.remove("firstLastStep");for(var e=this.floatParameterSet(a,1,2147483647),g=new JU.BS,p=O(e.length,0),d=0;d<e.length;d++)a=I(e[d]),1<=e[d]&&e[d]==a?g.set(a-1):this.invArg(),p[d]=a;b.append(" "+JU.Escape.eAI(p));c.put("bsModels",g);c.put("useFileModelNumbers",Boolean.TRUE)}return this.iToken+1},"~N,JU.SB,java.util.Map");
f(d,"finalizeLoad",function(a,b,c,e,g,p,d,f){p=JU.BSUtil.newBitSet2(a?p:0,this.vwr.ms.ac);if(a&&(b||1<g))this.vwr.setAnimationRange(-1,-1),this.vwr.setCurrentModelIndex(d);this.vwr.setModelkitPropertySafely("updateatomkeys",p);var l;0==this.scriptLevel&&(!a&&(c||2>g)&&null!=(l=this.vwr.ms.getInfoM("modelLoadNote")))&&this.showString(l);l=this.vwr.ms.getInfoM("centroidMinMax");JU.AU.isAI(l)&&0<this.vwr.ms.ac&&this.vwr.ms.setCentroid(p,l);a=this.vwr.g.defaultLoadScript;l="";0<a.length&&(l+="\nUsing defaultLoadScript: "+
a);var q;b=this.vwr.ms.msInfo;null!=b&&this.vwr.allowEmbeddedScripts()&&null!=(q=b.remove("jmolscript"))&&0<q.length?(l+="\nAdding embedded #jmolscript: "+q,a+=";"+q,this.setStringProperty("_loadScript",a),a="allowEmbeddedScripts = false;try{"+a+"} allowEmbeddedScripts = true;",this.isEmbedded=!this.isCmdLine_c_or_C_Option):this.setStringProperty("_loadScript","");this.logLoadInfo(l,f);f=null==b?null:b.remove("sitescript");null!=f&&(a=f+";"+a);e&&(a+=";restore orientation preload");0<a.length&&!this.isCmdLine_c_or_C_Option&&
this.runScript(a);this.isEmbedded=!1},"~B,~B,~B,~B,~N,~N,~N,~B");f(d,"cmdLog",function(){1==this.slen&&this.bad();if(!this.chk){var a=this.parameterExpressionString(1,0);1073742334==this.tokAt(1)?this.setStringProperty("logFile",""):this.vwr.log(a)}});f(d,"cmdLoop",function(){this.vwr.headless||(this.chk||(this.pc=-1),this.cmdDelay())});f(d,"cmdMessage",function(){var a=this.paramAsStr(this.checkLast(1));this.chk||(a=this.vwr.formatText(a),null==this.outputBuffer&&!this.vwr.isPrintOnly&&JU.Logger.warn(a),
a.startsWith("_")||this.report(a,!1))});f(d,"cmdModel",function(a){var b=4115==this.theTok||1<this.vwr.ms.mc,c=O(-1,[-1,-1]),e=0,g=!0,p=-1;if(1==this.slen&&1==a){var p=this.vwr.am.cmi,d;if(!this.chk&&0<=p&&0<=(d=this.vwr.ms.getJmolDataSourceFrame(p)))this.vwr.setCurrentModelIndex(d==p?-2147483648:d)}else{switch(this.tokAt(1)){case 1073877010:if(!this.chk&&b&&2==this.slen){for(;++p<this.vwr.ms.mc;)if(this.vwr.ms.am[p].auxiliaryInfo.containsKey("moData")){this.vwr.am.setFrame(p);this.showString("Frame set to "+
(p+1));return}this.showString("No molecular orbitals")}return;case 2:if(b&&2==this.slen){this.chk||this.vwr.am.setFrame(this.intParameter(1)-1);return}break;case 1073742325:case 10:p=this.atomExpressionAt(1).nextSetBit(0);if(this.chk||0>p||p>=this.vwr.ms.ac)return;p=this.vwr.ms.at[p].mi;if(this.iToken+1==this.slen){this.vwr.setCurrentModelIndex(p);return}c[e++]=p;a=this.iToken+1;g=!1;break;case 1073741904:this.iToken=1;p=2==this.tokAt(2)?this.intParameter(++this.iToken):1;this.checkLength(this.iToken+
1);!this.chk&&0<p&&this.vwr.ms.createModels(p);return;case 1073741974:this.checkLength(3);p=this.stringParameter(2);-2147483648!=JU.PT.parseInt(p)&&this.invArg();this.chk||this.vwr.setCurrentModelID(p);return;case 528397:p=0;this.checkLength(3);switch(this.getToken(2).tok){case 2:case 3:p=ba(1E3*this.floatParameter(2));break;default:this.error(20)}this.chk||this.vwr.setFrameDelayMs(p);return;case 1073742166:0<this.checkLength23()&&(this.chk||this.vwr.setFrameTitleObj(2==this.slen?"@{_modelName}":
7==this.tokAt(2)?JS.SV.strListValue(this.st[2]):this.paramAsStr(2)));return;case 1073742077:if(3==this.tokAt(2)&&12==this.tokAt(3)){p=this.vwr.ms.getModelNumberIndex(this.getToken(2).intValue,!1,!1);c=this.getToken(3).value;0<=p&&(this.vwr.ms.am[p].mat4=c);return}break;case 1073741832:c=1073742333==this.tokAt(2);p=2==this.slen||c?null:this.atomExpressionAt(2);c&&(this.iToken=2);c=12293==this.tokAt(this.iToken+1);this.checkLength(this.iToken+(c?2:1));this.chk||this.vwr.setFrameOffsets(p,c);return}if(268440576==
this.getToken(a).tok)++a,(2!=this.getToken(this.checkLast(a)).tok||1!=this.intParameter(a))&&this.invArg(),this.chk||this.vwr.setAnimation(1073742108);else{var f=d=b=!1,l=null,q=null,k=!1,l=!1,m=0,n=null,t=this.vwr.haveFileSet();if(this.isArrayParameter(1))this.setFrameSet(1),k=!0;else for(var B=a;B<this.slen;B++)switch(this.getToken(B).tok){case 1275069447:switch(B==this.slen-1?e:-1){case 2:break;case 0:if(2==this.vwr.ms.mc){c[0]=0;c[1]=1;e=2;break}default:this.invArg()}f=!0;break;case 1073741832:2!=
B&&this.invArg();n=this.centerParameter(3,null);this.checkLength(B=this.iToken+1);break;case 1073742327:case 268441089:this.checkLength(a+(d?2:1));k=!0;break;case 268440576:1!=e&&this.invArg();l=!0;break;case 1073742333:this.checkLength(a+1);break;case 3:if(g=!1,0>(m=this.floatParameter(B))){this.checkLength(B+1);this.chk||this.vwr.am.morph(-m);return}case 2:case 4:2==e&&this.invArg();var v=4==this.theTok?JU.Edge.getFloatEncodedInt(this.theToken.value):this.theToken.intValue;0>v&&1==e&&(l=!0,v=-v,
t&&1E6>v&&(v*=1E6));3==this.theTok&&(t&&m==I(m))&&(v=1E6*I(m));if(2147483647==v){g=!1;c[e++]=this.chk||1!=B?0:this.vwr.getModelIndexFromId(this.theToken.value.toString());break}if(-1==v){this.checkLength(a+1);this.chk||this.vwr.setAnimation(1073742108);return}1E3<=v&&(1E6>v&&t)&&(v=1E6*T(v/1E3)+v%1E3);!g&&(0==v&&0==e)&&(k=!0);1E6<=v&&(g=!1);c[e++]=v;break;case 1073742096:b=!0;break;case 1073742114:d=!0;break;case 1715472409:if(0>p&&0>(p=this.vwr.am.cmi))return;l=this.paramAsStr(++B);c=this.setVariable(++B,
-1,"",!1);if(null!=c&&!this.chk){if(l.equalsIgnoreCase("dssr")){this.loadDssr(p,c.value);return}q=JS.SV.oValue(c)}this.chk||this.vwr.ms.setInfo(p,l,q);return;default:this.frameControl(a);return}if(!this.chk)if(d&&0==e&&(k=!0),k)this.vwr.setAnimationOn(!1),this.vwr.setAnimationRange(-1,-1),d||this.vwr.setCurrentModelIndex(-1);else{2==e&&(!d&&!f)&&(l=!0);if(t)g=!1;else if(g)for(B=0;B<e;B++)0<=c[B]&&(c[B]%=1E6);p=this.vwr.ms.getModelNumberIndex(c[0],g,!1);if(null!=n)0<=p&&(this.vwr.ms.translateModel(p,
null),this.vwr.ms.translateModel(p,n));else{a=-1;if(t&&0>p&&0!=c[0])if(1E6>c[0]&&(c[0]*=1E6),2==e&&1E6>c[1]&&(c[1]*=1E6),0==c[0]%1E6)c[0]++,p=this.vwr.ms.getModelNumberIndex(c[0],!1,!1),0<=p&&(a=this.vwr.ms.getModelNumberIndex(1==e?c[0]+1E6:0==c[1]?-1:0==c[1]%1E6?c[1]+1000001:c[1]+1,!1,!1),0>a&&(a=this.vwr.ms.mc),a--,d?e=2:!l&&a!=p&&(l=!0),d=d||p==a);else return;(!b&&!d||0<=p)&&this.vwr.setCurrentModelIndexClear(p,!1);if(b&&2==e||d||l||f)0>a&&(a=this.vwr.ms.getModelNumberIndex(c[1],g,!1)),this.vwr.setAnimationOn(!1),
this.vwr.am.setAnimationDirection(1),f||this.vwr.setAnimationRange(p,a),this.vwr.setCurrentModelIndexClear(l&&!d?-1:0<=p?p:0,!1);f?this.vwr.am.setSplitFrame(p,a):this.vwr.am.setSplitFrame(-1,-1);b&&this.vwr.setAnimation(4143)}}}}},"~N");f(d,"loadDssr",function(a,b){0>a&&0>(a=this.vwr.am.cmi)&&this.errorStr(30,"load <dssr file>");b.startsWith("{")||(b=this.vwr.getFileAsString3(b,!0,"script"));this.clearDefinedVariableAtomSets();var c=this.vwr.parseJSONMap(b);this.showString(this.vwr.getAnnotationParser(1111490587).fixDSSRJSONMap(c));
this.vwr.ms.setInfo(a,"dssr",c)},"~N,~S");f(d,"cmdMove",function(){this.checkLength(-11);var a=JU.V3.new3(this.floatParameter(1),this.floatParameter(2),this.floatParameter(3)),b=this.floatParameter(4),c=JU.V3.new3(this.intParameter(5),this.intParameter(6),this.intParameter(7)),e=this.floatParameter(8),g=this.floatParameter(9),p=11==this.slen?this.intParameter(10):30;if(!this.chk&&(this.refresh(!1),this.useThreads(!0)||(g=0),this.vwr.move(this,a,b,c,e,g,p),0<g&&this.isJS))throw new JS.ScriptInterruption(this,
"move",1);});f(d,"cmdMoveto",function(){if(2==this.slen&&1073742162==this.tokAt(1))this.chk||this.vwr.tm.stopMotion();else{var a;if(2==this.slen&&this.isFloatParameter(1)){if(a=this.floatParameter(1),!this.chk&&(this.useThreads(!0)||(a=0),0<a&&this.refresh(!1),this.vwr.movetoHome(this,a),this.isJS&&0<a&&this.vwr.g.waitForMoveTo))throw new JS.ScriptInterruption(this,"moveTo",1);}else{var b=JU.V3.new3(NaN,0,0),c=null,e=1;a=this.isFloatParameter(e)?this.floatParameter(e++):2;var g=90,p=null,d=!0,f=d=
!1,l=null,q=null,k=null,m=0,n=0,t=NaN,B=NaN,v=this.vwr.tm.getZoomSetting(),u=null,r=NaN,w=NaN,E=NaN,C=NaN,s=NaN,A=NaN,D=null,y=null,F=this.getToken(e).tok;switch(F){case 1073742110:D=this.floatParameterSet(++e,18,21);e=this.iToken+1;if(this.chk&&0<this.checkLength(e))return;break;case 134221850:1073742028==this.tokAt(++e)&&(d=!0,e++);this.isAtomExpression(e)?(d=!0,y=Array(1),c=this.centerParameter(e,y),x(y[0],"JU.BS")||this.invArg(),p=y[0],y=this.chk?new JU.Quat:this.vwr.ms.getQuaternion(p.nextSetBit(0),
this.vwr.getQuaternionFrame())):y=this.getQuaternionParameter(e,null,!1);e=this.iToken+1;null==y&&this.invArg();break;case 9:case 8:case 1073742332:this.isPoint3f(e)?(b.setT(this.getPoint3f(e,!0,!0)),e=this.iToken+1,g=this.floatParameter(e++)):(g=this.getPoint4f(e),e=this.iToken+1,b.set(g.x,g.y,g.z),g=0==g.x&&0==g.y&&0==g.z?NaN:g.w);break;case 1073741954:b.set(1,0,0);g=0;this.checkLength(++e);break;case 1073741858:b.set(0,1,0);g=180;this.checkLength(++e);break;case 1073741996:b.set(0,1,0);this.checkLength(++e);
break;case 1073742126:b.set(0,-1,0);this.checkLength(++e);break;case 1073742172:b.set(1,0,0);this.checkLength(++e);break;case 1073741871:b.set(-1,0,0);this.checkLength(++e);break;case 134219777:case 1073742187:f=d=!0;q=new JU.P3;l=this.hklParameter(e+1,null,!0,q);Double.isNaN(q.x)&&(q=null);this.checkLength(e=this.iToken+1);break;case 134217750:case 1073741918:e=this.planeParameter(e,!1);y=JU.V3.new3(0,0,1);y.cross(y,e);0.001>y.length()&&(y.set(0,1,0),y.cross(y,e));e.cross(y,e);y=JU.Quat.getQuaternionFrame(null,
e,y).inv();e=this.iToken+1;break;case 1073741854:k=this.paramAsStr(++e);k.equals("-")&&(k+=this.paramAsStr(++e));this.checkLength(++e);switch("xyz".indexOf(k)){case 0:y=JU.Quat.new4(0.5,0.5,0.5,-0.5);break;case 1:y=JU.Quat.new4(0.5,0.5,0.5,0.5);break;case 2:y=JU.Quat.new4(0,0,0,1);break;default:f=!0}break;default:b=JU.V3.new3(this.floatParameter(e++),this.floatParameter(e++),this.floatParameter(e++)),g=this.floatParameter(e++)}f&&(f=this.vwr.getCurrentUnitCell(),null==l?(null==f&&(f=this.vwr.getSymTemp().setUnitCellFromParams(null,
!1,NaN)),y=f.getQuaternionRotation(k)):null!=f&&(y=f.getQuaternionRotationForUVW(q,l)),null==y&&this.invArg());null!=y&&(g=y.toAxisAngle4f(),b.set(g.x,g.y,g.z),g=(d?-1:1)*(180*g.angle/3.141592653589793));Float.isNaN(b.x)||Float.isNaN(b.y)||Float.isNaN(b.z)?b.set(0,0,0):0==b.length()&&0==g&&(g=NaN);d=134221850==F||!this.vwr.tm.isInPosition(b,g);this.isFloatParameter(e)&&(t=this.floatParameter(e++));this.isFloatParameter(e)&&!this.isCenterParameter(e)&&(m=this.floatParameter(e++),n=this.floatParameter(e++),
!d&&1<=Math.abs(m-this.vwr.tm.getTranslationXPercent())&&(d=!0),!d&&1<=Math.abs(n-this.vwr.tm.getTranslationYPercent())&&(d=!0));null==p&&e!=this.slen&&(y=Array(1),c=this.centerParameter(e,y),x(y[0],"JU.BS")&&(p=y[0]),e=this.iToken+1);if(null!=c){!d&&0.1<=c.distance(this.vwr.tm.fixedRotationCenter)&&(d=!0);this.isFloatParameter(e)&&(B=this.floatParameter(e++));this.isCenterParameter(e)||((0==B||Float.isNaN(B))&&(0==t||Float.isNaN(t))?(p=Math.abs(this.getZoom(0,e,p,0==t?0:v)),e=this.iToken+1,t=p):
!d&&0.1<=Math.abs(B-this.vwr.getFloat(570425388))&&(d=!0));if(0==t||Float.isNaN(t))t=100;Float.isNaN(B)&&(B=0);!d&&1<=Math.abs(t-v)&&(d=!0);e!=this.slen&&(u=this.centerParameter(e,null),e=this.iToken+1,e!=this.slen&&(r=this.floatParameter(e++),w=this.floatParameter(e++)),e!=this.slen&&(E=this.floatParameter(e++)),e!=this.slen&&(C=this.floatParameter(e++),!d&&0.01<=Math.abs(C-this.vwr.tm.getCameraDepth())&&(d=!0)),e+1<this.slen&&(s=this.floatParameter(e++),A=this.floatParameter(e++),!d&&0.01<=Math.abs(s-
this.vwr.tm.camera.x)&&(d=!0),!d&&0.01<=Math.abs(A-this.vwr.tm.camera.y)&&(d=!0)))}this.checkLength(e);if(!this.chk&&(d||(a=0),0<a&&this.refresh(!1),this.useThreads(!0)||(a=0),0==C&&(C=s=A=NaN),null!=D?this.vwr.tm.moveToPyMOL(this,a,D):this.vwr.moveTo(this,a,c,b,g,null,t,m,n,B,u,r,w,E,C,s,A),this.isJS&&0<a&&this.vwr.g.waitForMoveTo))throw new JS.ScriptInterruption(this,"moveTo",1);}}});f(d,"isAtomExpression",function(a){switch(this.tokAt(a)){case 12290:case 10:case 1073742325:return!0;default:return!1}},
"~N");f(d,"cmdPause",function(){if(this.chk||this.isJS&&!this.allowJSThreads)return!1;var a=this.optParameterAsString(1);this.vwr.getBooleanProperty("_useCommandThread");if(this.vwr.autoExit||!this.vwr.haveDisplay&&!this.vwr.isWebGL)return!1;if(0==this.scriptLevel&&this.pc==this.aatoken.length-1)return this.vwr.scriptStatus("nothing to pause: "+a),!1;a=0==a.length?": RESUME to continue.":": "+this.vwr.formatText(a);this.pauseExecution(!0);this.vwr.scriptStatusMsg("script execution paused"+a,"script paused for RESUME");
return!0});f(d,"cmdPrint",function(){1==this.slen?this.chk||this.showStringPrint("\x00",!0):this.showStringPrint(this.parameterExpressionString(1,0),!0)});f(d,"cmdPrompt",function(){var a=null;1==this.slen?this.chk||(a=JS.ScriptEval.getContextTrace(this.vwr,this.getScriptContext("prompt"),null,!0).toString()):a=this.parameterExpressionString(1,0);this.chk||this.vwr.prompt(a,null,!1)});f(d,"cmdReset",function(){if(3==this.slen&&134320141==this.tokAt(1))this.chk||this.vwr.removeFunction(this.stringParameter(2));
else if(this.checkLength(-2),!this.chk)if(1==this.slen)this.vwr.reset(!1);else{switch(this.tokAt(1)){case 36865:null!=this.outputBuffer&&this.outputBuffer.setLength(0);return;case 134221829:this.vwr.cacheClear();return;case 1073741936:this.resetError();return;case 1073741995:this.vwr.stm.resetLighting();return;case 1086324748:this.vwr.resetShapes(!0);return;case 134320141:this.vwr.clearFunctions();return;case 1812599299:this.vwr.ms.setBoundBox(null,null,!0,0);return;case 1639976963:var a=new JU.BS;
this.runScript(this.vwr.ms.getDefaultStructure(this.vwr.bsA(),a));this.vwr.shm.resetBioshapes(a);return;case 1648363544:this.vwr.setData("element_vdw",P(-1,[null,""]),0,0,0,0,0);return;case 1075838996:this.vwr.ms.resetAromatic();return;case 1095241729:this.vwr.reset(!0);return;case 135198:this.vwr.rotateModelSpinVectors(-1,null);return}a=this.paramAsStr(1);"_"==a.charAt(0)&&this.invArg();this.vwr.unsetProperty(a)}});f(d,"resetError",function(){this.vwr.g.removeParam("_errormessage")});f(d,"cmdRestrict",
function(){var a=1677721602==this.tokAt(1);this.cmdSelect(a?2:1);this.restrictSelected(a,!0)});f(d,"cmdReturn",function(a){if(!this.chk){var b=this.getContextVariableAsVariable("_retval",!1);if(null!=b){var c=null!=a||1==this.slen?null:this.parameterExpressionToken(1);null==a&&(a=null==c?JS.SV.newI(0):c);b.value=a.value;b.intValue=a.intValue;b.tok=a.tok}this.cmdGoto(!1)}},"JS.SV");f(d,"cmdRotate",function(a,b){var c=this.vwr.is2D();if(!a||!c){if(2==this.slen)switch(this.getToken(1).tok){case 1073742335:this.chk||
this.vwr.tm.setSpinOn();return;case 1073742334:this.chk||this.vwr.tm.setSpinOff();return;case 135198:if(a)break;this.chk||this.vwr.rotateModelSpinVectors(-1,null);return}for(var e=null,g=null,p=1.4E-45,d=0,f=3.4028235E38,l=!1,q=!1,k=!1,m=null,n=null,t=Array(2),B=JU.V3.new3(0,1,0),v=null,u=null,r=null,w=!1,x=1,C,s=null,A=!1,D=!1,y=!1,F=null,G=null,I=null,H=null,O=this.vwr.getBoolean(603979806),R=!1,z=1;z<this.slen;++z){switch(C=this.getToken(z).tok){case 528432:case 4145:R=null!=this.vwr.getOperativeSymmetry();
continue;case 12290:case 10:case 1073742325:if(g=this.atomExpressionAt(z),null!=v||null!=s||2==d){e=g;F=null;b=!0;break}case 1073742332:case 8:case 1073742330:q=!0;2==d&&(d=0);if(k){1==d&&this.invArg();B=JU.V3.newV(this.getPoint3f(z,!0,!0));a&&this.slen==this.iToken+1&&(p=2);break}n=this.centerParameterForModel(z,this.vwr.am.cmi,null);!this.chk&&(1073742330==C&&268437504!=this.tokAt(z+2))&&(l=!0,B=P(-1,[this.objectNameParameter(++z),Integer.$valueOf(this.vwr.am.cmi),null]),B=this.getShapePropertyData(22,
"getSpinAxis",B)?B[2]:null);t[d++]=n;break;case 135198:l=k=!0;r=this.getMatrixParam(z+1,3,!1);null==r&&(z=this.getPoint4fNoError(z+1),null!=z&&(s=JU.Quat.newP4(z)));z=this.iToken;this.isFloatParameter(z+1)&&(B.x=NaN);break;case 1095241729:a=!0;continue;case 1073741988:case 1073742028:l=!0;continue;case 1113589787:b=!0;break;case 268436992:continue;case 2:case 3:a?1.4E-45==p?p=this.floatParameter(z):3.4028235E38==f?(f=p,p=this.floatParameter(z)):this.invArg():3.4028235E38==f?f=this.floatParameter(z):
1.4E-45==p?(p=this.floatParameter(z),a=!0):this.invArg();if(z==this.slen-2&&(1073741824==this.tokAt(z+1)||4==this.tokAt(z+1)))z=this.paramAsStr(++z).toLowerCase(),z.equals("dps")?D=!0:z.equals("sec")&&(y=!0);break;case 268440576:x=-1;continue;case 1111492629:if(c)return;q=!0;B.set(x,0,0);continue;case 1111492630:if(c)return;q=!0;B.set(0,x,0);continue;case 1111492631:q=!0;B.set(0,0,O&&!l?-x:x);continue;case 9:case 134221850:case 1073741864:134221850==C&&z++;q=!0;if(null!=(s=this.getQuaternionParameter(z,
g,1073741864==C)))0==s.q0&&(s.q0=1E-10),B.setT(s.getNormal()),f=s.getTheta();break;case 134217750:if(this.paramAsStr(z+1).equalsIgnoreCase("picked")){n=this.vwr.getPOrNull("pickedList");z=n.size();if(3>z)return;f=Array(3);for(s=0;3>s;s++)f[s]=this.vwr.ms.getAtomSetCenter(JS.SV.getBitSet(n.get(z-3+s),!1))}else if(this.isArrayParameter(z+1))f=this.getPointArray(++z,-1,!1,!0);else{f=Array(3);for(s=0;3>s;s++)f[s]=this.centerParameter(++z,null),z=this.iToken}z=f.length;if(3>z)return;s=JU.Quat.getQuaternionFrame(f[z-
3],f[z-2],f[z-1]);s=JU.Quat.new4(1,0,0,0).mulQ(s.inv().div(this.vwr.tm.getRotationQ()));B.setT(s.getNormal());f=s.getTheta();break;case 134217731:q=!0;if(this.isPoint3f(++z)){B.setT(this.centerParameter(z,null));break}z=this.getPoint4f(z);B.set(z.x,z.y,z.z);f=z.w;s=JU.Quat.newVA(B,f);break;case 1073742328:q=l=b=!0;if(this.isArrayParameter(++z))m=this.floatParameterSet(z,6,2147483647);else{d=this.atomExpressionAt(z).nextSetBit(0);z=this.atomExpressionAt(++this.iToken).nextSetBit(0);if(0>d||0>z)return;
e=this.vwr.getBranchBitSet(z,d,!0);t[0]=this.vwr.ms.at[d];t[1]=this.vwr.ms.at[z];d=2}break;case 4160:v=JU.V3.newV(this.centerParameter(++z,null));l=b=!0;break;case 136314895:A=!0;continue;case 1296041986:n=this.intParameter(++z);if(this.chk)continue;v=this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,null,-1,!1,null);l=null==v?null:v.get("operations");(0==n||null==l||l.length<Math.abs(n))&&this.invArg();l=l[Math.abs(n)-1];v=l[5];I=l[6];t[0]=l[7];null!=l[8]&&(B=l[8]);f=l[9].intValue();0>n&&(f=-f,
null!=v&&v.scale(-1));0==f&&null!=t[0]&&(B.normalize(),JU.Measure.getPlaneThroughPoint(t[0],B,H=new JU.P4));s=JU.Quat.newVA(B,f);d=null==t[0]?0:1;b=q=l=!0;continue;case 134221831:G=this.atomExpressionAt(++z);n=this.vwr.ms.getAtomPointVector(G);null==n&&(this.iToken=z,this.invArg());z=this.iToken;F=this.getPointVector(this.getToken(++z),z);if(null==F||n.size()!=F.size())this.iToken=z,this.invArg();u=new JU.M4;t[0]=new JU.P3;d=1;J.api.Interface.getInterface("JU.Eigen",this.vwr,"script");if(0.001<(this.chk?
0:JU.Measure.getTransformMatrix4(n,F,u,t[0])))F=null;case 12:case 11:q=!0;r=new JU.M3;12==C&&(w=!0,u=this.theToken.value);null!=u?(t[0]=null,e=g,F=null,d=0,v=new JU.V3,u.getTranslation(v),u.getRotationScale(r)):r=this.theToken.value;s=this.chk?new JU.Quat:JU.Quat.newM(r);B.setT(s.getNormal());f=s.getTheta();l=!0;break;default:this.invArg()}z=this.iToken}if(!this.chk){null!=m&&3.4028235E38!=f&&(a=!0,p=f);b&&null==e&&(e=this.vwr.bsA());null!=G&&(b=!0,null==e&&(e=G));null!=s&&(!y&&!D)&&(D=0<p,y=!D);
c=1.4E-45==p?10:3.4028235E38==f?p:D?p:y?(0>f?-1:1)*Math.abs(f/p):0>p==(null==s?0<f:!0)?-f/p:p;null==s&&(0>f&&0<c)&&(c=-c);if(null!=m){if(!a){this.vwr.setDihedrals(m,null,1);return}v=null}null!=s&&(0==d&&(null!=v&&!w)&&(t[0]=this.vwr.ms.getAtomSetCenter(null!=e?e:b?this.vwr.bsA():this.vwr.getAllAtoms())),A&&null!=v&&(t[1]=JU.P3.newP(t[0]),t[1].add(v),u=JU.Measure.computeHelicalAxis(t[0],t[1],s),t[0]=u[0],A=u[3].x,0!=A&&(v=u[1],B=JU.V3.newV(v),0>A&&B.scale(-1)),u=null),a&&null==u&&(u=JS.ScriptMathProcessor.getMatrix4f(s.getMatrix(),
v)),null!=t[0]&&(d=1));if(null!=I||null!=H)if(this.vwr.invertAtomCoord(I,null,e,-1,!1),null==B)return;H=a&&(!this.vwr.headless||3.4028235E38==f);a&&!H&&(a=!1);if(!R&&2>d&&null==m){if(!l){if(H&&(null==e&&!this.useThreads(!0))&&(a=!1,3.4028235E38==f))return;if(this.vwr.rotateAxisAngleAtCenter(this,t[0],B,c,f,a,e)&&this.isJS&&a&&null==e&&this.vwr.g.waitForMoveTo&&3.4028235E38!=f)throw new JS.ScriptInterruption(this,"rotate",1);return}0==d&&(t[0]=new JU.P3);t[1]=JU.P3.newP(t[0]);t[1].add(B);d=2}0==d&&
(t[0]=new JU.P3);if(2>d||0==t[0].distance(t[1]))t[1]=JU.P3.newP(t[0]),t[1].y+=1;3.4028235E38==f&&(f=0);if(R)0!=f&&((null==e||2!=d||a||null!=v||null!=m||null!=F||w)&&this.invArg(),e=this.vwr.getModelkit(!1).cmdRotateAtoms(e,t,f),this.doReport()&&this.report(J.i18n.GT.i(J.i18n.GT.$("{0} atoms rotated"),e),!1));else{0!=f&&(null!=v&&!q)&&v.scale(f/v.length());if(a&&null!=v&&(0==f||0==p))f=0.01,c=1.4E-45==p?0.01:0>p?-f/p:0.01*p/v.length(),p=0.01;null!=e&&(a&&null==F&&null!=u)&&(n=this.vwr.ms.getAtomPointVector(e),
F=JU.Measure.transformPoints(n,u,t[0]));if(null!=e&&!a&&null!=F)this.vwr.setAtomCoords(e,1145047049,F);else if(!H||this.useThreads(!1)){if(k&&(0>this.vwr.am.cmi&&this.errorStr(30,"rotate VECTOR"),null==s&&1.7976931348623157E308==f&&this.invArg(),R=a?p:f,null==s&&(s=null==r?JU.Quat.newVA(B,R):JU.Quat.newM(r)),r=s.getMatrix(),0==B.lengthSquared()&&(r.m00=NaN),Float.isNaN(r.getElement(0,0))&&r.setElement(1,1,R),!a||0>=p)){this.vwr.tm.setSpinOff();this.vwr.rotateModelSpinVectors(-1,r);return}if(this.vwr.rotateAboutPointsInternal(this,
t[0],t[1],c,f,a,e,v,F,m,k?r:null,w?u:null,!1,null)&&this.isJS&&a)throw new JS.ScriptInterruption(this,"rotate",1);}}}}},"~B,~B");f(d,"cmdRestore",function(){if(1<this.slen){var a=this.optParameterAsString(2),b=this.tokAt(1);switch(b){case 1073742077:case 1073742132:case 1073742139:var c=3<this.slen?this.floatParameter(3):0;0>c&&this.invArg();if(this.chk)return;var e="";switch(b){case 1073742077:e="Orientation";this.vwr.stm.restoreOrientation(a,c,!0);break;case 1073742132:e="Rotation";this.vwr.stm.restoreOrientation(a,
c,!1);break;case 1073742139:e="Scene",this.vwr.stm.restoreScene(a,c)}if(this.isJS&&0<c&&this.vwr.g.waitForMoveTo)throw new JS.ScriptInterruption(this,"restore"+e,1);return}this.checkLength23();switch(b){case 1677721602:this.chk||this.vwr.stm.restoreBonds(a);return;case 14:if(this.chk)return;a=this.vwr.stm.getContext(a);null!=a&&(this.restoreScriptContext(a,!0,!1,!1),null!=this.thisContext&&(this.thisContext.setMustResume(),this.tQuiet=this.mustResumeEval=!0));return;case 1073742329:if(this.chk)return;
a=this.vwr.stm.getSavedCoordinates(a);null==a&&this.invArg();this.runScript(a);this.vwr.checkCoordinatesChanged(null);return;case 1073742140:this.chk||this.vwr.stm.restoreSelection(a);return;case 1073742158:if(this.chk)return;b=this.vwr.stm.getSavedState(a);if(null==b){if(a.equalsIgnoreCase("UNDO"))return;this.invArg()}this.runScript(b);return;case 1639976963:if(this.chk)return;a=this.vwr.stm.getSavedStructure(a);null==a&&this.invArg();this.runScript(a);return;case 1814695966:this.chk||this.vwr.stm.restoreUnitCell(a);
return}}this.errorStr2(53,"RESTORE","bonds? context? coordinates? orientation? rotation? selection? state? structure?")});f(d,"cmdSave",function(){if(1<this.slen){var a=this.optParameterAsString(2);switch(this.tokAt(1)){case 1677721602:this.chk||this.vwr.stm.saveBonds(a);return;case 14:this.chk||this.saveContext(a);return;case 1073742329:this.chk||this.vwr.stm.saveCoordinates(a,this.vwr.bsA());return;case 1073742077:case 1073742132:this.chk||this.vwr.stm.saveOrientation(a,null);return;case 1073742140:this.chk||
(this.vwr.stm.saveSelection(a,this.vwr.bsA()),this.vwr.stm.restoreSelection(a));return;case 1073742158:!this.chk&&this.vwr.getBoolean(603979898)&&(this.vwr.stm.saveState(a),0==a.length&&this.showString(this.vwr.stm.getUndoInfo()));return;case 1639976963:this.chk||this.vwr.stm.saveStructure(a);return;case 1814695966:this.chk||this.vwr.stm.saveUnitCell(a);return}}this.errorStr2(53,"SAVE","bonds? context? coordinates? orientation? rotation? selection? state? structure?")});f(d,"cmdScript",function(a,
b,c,e){if(134238732==a)this.vwr.haveAccessInternal(null)&&this.error(10),this.checkLength(2),this.chk||this.vwr.jsEval(this.paramAsStr(1));else{var g=!0,d=!1,f=!1,h=this.vwr.async,l=0,q=0,k=0,m=0,n=1,t=null,r=null,v=null;4124==a&&(n=-2);if(null==b&&null==c)if(a=this.tokAt(n),4!=a&&this.error(16),b=this.paramAsStr(n),b.equalsIgnoreCase("async")&&(h=!0,b=this.paramAsStr(++n)),b.equalsIgnoreCase("applet")){b=null;a=this.paramAsStr(++n);c=this.parameterExpressionString(++n,0);this.checkLast(this.iToken);
if(this.chk)return;if(0==a.length||a.equals("all"))a="*";if(!a.equals(".")&&(this.vwr.jsEval(a+"\u0001"+c),!a.equals("*")))return}else{a=this.tokAt(this.slen-1);f=266298==a;if(b.equalsIgnoreCase("inline"))b=null,c=this.parameterExpressionString(++n,f?this.slen-1:0),n=this.iToken;else{for(;b.equalsIgnoreCase("localPath")||b.equalsIgnoreCase("remotePath")||b.equalsIgnoreCase("scriptPath");)b.equalsIgnoreCase("localPath")?t=this.paramAsStr(++n):b.equalsIgnoreCase("scriptPath")?v=this.paramAsStr(++n):
r=this.paramAsStr(++n),b=this.paramAsStr(++n);b.startsWith("spt::")&&(b=b.substring(5));b=this.checkFileExists("SCRIPT_",h,b,n,!0)}if(1073741877==(a=this.tokAt(++n)))d=!0,a=this.tokAt(++n);1073742050==a&&(g=!1,a=this.tokAt(++n));if(1073741998==a||1140850692==a)n++,k=l=Math.max(this.intParameter(n++),0),this.checkToken(n)&&(k=268440576==this.getToken(n).tok?this.checkToken(++n)?this.intParameter(n++):0:-this.intParameter(n++),0>=k&&this.invArg());else if(1073741890==a||1073741892==a)n++,q=Math.max(this.intParameter(n++)-
1,0),m=q+1,this.checkToken(n)&&(m=268440576==this.getToken(n).tok?this.checkToken(++n)?this.intParameter(n++):0:-this.intParameter(n++),0>=m&&this.invArg());n=-n}else null!=b&&h&&(b=this.checkFileExists("SCRIPT_",h,b,n,!0));if(0>n){if(268435968==this.tokAt(n=-n))e=this.parameterExpressionList(n,-1,!1),n=this.iToken+1;this.checkLength(f?n+1:n)}if(!this.chk||this.isCmdLine_c_or_C_Option)if(this.isCmdLine_c_or_C_Option&&(d=!0),n=!1,null==c&&(c=this.getScriptFileInternal(b,t,r,v),null==c&&this.invArg(),
n=this.vwr.haveAccessInternal(null)),this.isMenu(c))this.vwr.setMenu(c,!1);else{t=this.chk;r=this.isCmdLine_c_or_C_Option;d&&(this.chk=this.isCmdLine_c_or_C_Option=!0);this.pushContext(null,"SCRIPT");this.contextPath+=" >> "+b;if(this.compileScript(b,c,null!=b&&this.debugScript)){this.pcEnd=m;for(this.lineEnd=k;q<this.lineNumbers.length&&this.lineNumbers[q]<l;)q++;this.pc=q;b=this.isCmdLine_C_Option;this.isCmdLine_C_Option=(new Boolean(this.isCmdLine_C_Option&g)).valueOf();this.executionStepping=
(new Boolean(this.executionStepping|f)).valueOf();this.setScriptArguments(e,!1);d&&(this.listCommands=!0);(e=this.vwr.getBoolean(603979934))&&JU.Logger.startTimer("script");this.privateFuncs=null;this.dispatchCommands(!1,!1,!1);this.$isStateScript&&JS.ScriptManager.setStateScriptVersion(this.vwr,null);n&&this.vwr.setAccessInternal(null);e&&this.showString(JU.Logger.getTimerMsg("script",0));this.isCmdLine_C_Option=b;this.popContext(!1,!1)}else JU.Logger.error(J.i18n.GT.$("script ERROR: ")+this.errorMessage),
this.popContext(!1,!1),r?this.setErrorMessage(null):this.evalError(null,null);this.chk=t;this.isCmdLine_c_or_C_Option=r}}},"~N,~S,~S,JU.Lst");f(d,"isMenu",function(a){var b=null==a?-1:a.indexOf("Menu Structure");return 0<b&&a.startsWith("#")&&b<a.indexOf("\n")},"~S");f(d,"cmdSelect",function(a){if(1==this.slen)this.vwr.selectStatus(null,!1,0,!this.doReport(),!1);else if(!(2==this.slen&&1073742072==this.tokAt(1))){var b=this.tokAt(2),c=null;switch(b){case 10:if(x(this.getToken(2).value,"JM.BondSet")||
1677721602==b&&10==this.getToken(3).tok){this.slen!=this.iToken+2&&this.invArg();this.chk||this.vwr.selectBonds(this.theToken.value);return}break;case 1745489939:case 1677721602:5==this.slen&&10==this.tokAt(3)?(c=this.getToken(3).value,null!=this.thisCommand&&0<this.thisCommand.indexOf("/*FIXED*/")&&(c=this.vwr.ms.fixDeletedBonds(c)),this.iToken++):this.isArrayParameter(4)?a=-4:this.isArrayParameter(3)&&(a=-3);if(0>a){for(var c=new JU.BS,e=this.expandFloatArray(this.floatParameterSet(-a,0,2147483647),
0,!1),g=e.length;0<=--g;)0<=e[g]&&c.set(e[g]);-3==a&&this.iToken++}this.checkLast(this.iToken);if(this.chk)return;null==c&&this.invArg();1745489939==b?this.setShapeProperty(6,"select",c):this.vwr.selectBonds(c);return}e=0;b=!1;(g=268436992==this.tokAt(a))&&a++;if(0==this.getToken(1).intValue&&1073742334!=this.theTok)c=this.parameterExpressionToken(0).value,x(c,"JU.BS")||this.invArg(),this.checkLast(this.iToken);else{b=this.tokAt(a);switch(b){case 1073742335:case 1073742334:if(this.chk||this.vwr.setSelectionHalosEnabled(1073742335==
b),b=this.tokAt(++a),0==b)return}switch(b){case 1275069441:case 1073742119:e=b,b=this.tokAt(++a)}(b=1086324742==b)&&this.tokAt(++a);c=this.atomExpressionAt(a)}this.chk||(this.isBondSet?this.vwr.selectBonds(c):(c.length()>this.vwr.ms.ac&&(a=this.vwr.getAllAtoms(),a.and(c),c=a),this.vwr.selectStatus(c,b,e,!this.doReport(),g),this.vwr.slm.noneSelected=Boolean.$valueOf(4==this.slen&&1073742333==this.tokAt(2))))}},"~N");f(d,"cmdSelectionHalos",function(a){var b=!1;switch(a==this.slen?1073742335:this.getToken(a).tok){case 1073742335:case 1113589787:b=
!0;case 1073742334:case 1073742333:case 1073742056:this.setBooleanProperty("selectionHalos",b);break;default:this.invArg()}},"~N");f(d,"cmdSet",function(){if(1==this.slen)this.showString(this.vwr.getAllSettings(null));else{var a=this.paramAsStr(0).equals("set"),b=this.optParameterAsString(1);if(a&&2==this.slen&&0<=b.indexOf("?"))this.showString(this.vwr.getAllSettings(b.substring(0,b.indexOf("?"))));else{var c=this.getToken(1).tok,e=0,g,d=2147483647,f=!this.chk&&this.doReport()&&!this.st[0].value.equals("var");
switch(c){case 553648144:case 603979865:case 603979903:case 603979924:case 603979960:case 603979962:case 603979964:case 603979965:case 603979970:if(this.$isStateScript)return;break;case 1611272194:this.cmdAxes(2);return;case 1610616835:this.cmdBackground(2);return;case 1812599299:this.cmdBoundbox(2);return;case 1611272202:this.cmdFrank(2);return;case 1610616855:this.cmdHistory(2);return;case 1825200146:this.cmdLabel(2,null);return;case 1814695966:this.cmdUnitcell(2);return;case 536870920:this.sm.loadShape(8);
this.setShapeProperty(8,"highlight",1073742334==this.tokAt(2)?null:this.atomExpressionAt(2));return;case 1610625028:case 1611141172:this.cmdSelectionHalos(2);return;case 536875070:this.cmdTimeout(2);return;case 536870932:c=this.isArrayParameter(2)?this.floatParameterSet(2,2,2):2==this.tokAt(2)?Q(-1,[this.intParameter(2),this.intParameter(3)]):this.stringParameter(2);this.checkLast(this.iToken);if(this.chk)return;if("string"==typeof c){if(this.vwr.fm.loadImage(c,"\x00windowImage",!this.useThreads(!1)))throw new JS.ScriptInterruption(this,
"windowImage",1);}else this.vwr.setWindowDimensions(c);return;case 1639976963:c=J.c.STR.getProteinStructureType(this.paramAsStr(2));c===J.c.STR.NOT&&this.invArg();f=this.floatParameterSet(3,0,2147483647);0!=f.length%4&&this.invArg();this.vwr.setStructureList(f,c);this.checkLast(this.iToken);return;case 1111490588:3<this.slen&&this.checkLast(2);this.setBooleanProperty("translucent",2==this.slen||JS.SV.bValue(this.getToken(2)));return;case 545259526:d=this.getArgbParam(2);this.chk||this.setObjectArgb("axes",
d);return;case 1610612737:c=!1;switch(this.getToken(this.checkLast(2)).tok){case 268438528:break;case 268438016:c=!0;break;default:this.invArg()}this.setBooleanProperty("bondModeOr",c);return;case 536870916:case 536870917:if(this.chk)return;c=1073742334==this.tokAt(2)||2==this.tokAt(2)&&0==this.intParameter(2)?4:536870917==c?6:5;JU.Logger.setLogLevel(c);this.setIntProperty("logLevel",c);4==c&&(this.vwr.setDebugScript(!1),f&&this.vwr.showParameter("debugScript",!0,80));this.setDebugging();f&&this.vwr.showParameter("logLevel",
!0,80);return;case 537022465:this.cmdSetEcho(0);return;case 536875059:this.cmdScale(2);return;case 1610612738:this.cmdFont(5,2==this.checkLength23()?0:this.floatParameter(2));return;case 1613238294:c=!1;switch(this.tokAt(this.checkLast(2))){case 1114249217:c=!0;case 2097178:this.setBooleanProperty("hbondsBackbone",c);break;case 1073742150:c=!0;case 1073741926:this.setBooleanProperty("hbondsSolid",c);break;default:this.invArg()}return;case 1745489939:case 537006096:switch(c=this.tokAt(this.checkLast(2))){case 1073742335:case 1073742334:this.setBooleanProperty("measurementlabels",
1073742335==c);return;case 1073741926:case 2:case 3:this.vwr.shm.loadShape(6);f=this.getSetAxesTypeMad10(2);2147483647!=f&&this.setShapeSizeBs(6,3==c?T(f/10):f,null);return}this.setUnits(this.paramAsStr(2),545259568);return;case 1611141176:c=!1;switch(this.tokAt(this.checkLast(2))){case 1114249217:c=!0;break;case 2097178:break;default:this.invArg()}this.setBooleanProperty("ssbondsBackbone",c);return;case 1610612741:this.cmdSetLabel("toggle");return;case 536870930:c=new JU.Lst;for(a=2;a<this.slen;a++)f=
this.getArgbParam(a),c.addLast(Integer.$valueOf(f)),a=this.iToken;if(this.chk)return;a=c.size();for(f=O(a,0);0<=--a;)f[a]=c.get(a).intValue();this.vwr.cm.ce.setUserScale(f);return;case 553648188:this.isFloatParameter(2)?(this.checkLength(3),this.setIntProperty("zSlab",I(this.floatParameter(2))),g=null):(this.isCenterParameter(2)||this.invArg(),g=this.centerParameter(2,null),this.checkLength(this.iToken+1));this.chk||(this.vwr.tm.zSlabPoint=null==g?null:JU.P3.newP(g));return}var h=!0;switch(c){case 536870914:if(2<
this.slen){f=this.getSettingStr(2,!1);c=!1;0>f.indexOf(".")?(f=JU.PT.parseInt(f),c=!0):f=JU.Edge.getFloatEncodedInt(f);if(this.chk)return;c=this.vwr.ms.getModelNumberIndex(f,c,!0);this.vwr.setBackgroundModelIndex(c);return}break;case 1648363544:if(this.chk)return;this.vwr.setAtomProperty(this.vwr.getAllAtoms(),1648363544,-1,NaN,null,null,null);if(2<this.slen&&"probe".equalsIgnoreCase(this.getSettingStr(2,!1))){this.runScript("#VDW radii for PROBE;{_H}.vdw = 1.0;{_H and connected(_C) and not connected(within(smiles,'[a]'))}.vdw = 1.17;{_C}.vdw = 1.75;{_C and connected(3) and connected(_O)}.vdw = 1.65;{_N}.vdw = 1.55;{_O}.vdw = 1.4;{_P}.vdw = 1.8;{_S}.vdw = 1.8;message VDW radii for H, C, N, O, P, and S set according to Word, et al., J. Mol. Biol. (1999) 285, 1711-1733");
return}e=545259555;case 545259555:2<this.slen&&(g=this.paramAsStr(2),3==this.slen&&(null==J.c.VDW.getVdwType(g)&&null==J.c.VDW.getVdwType(g=this.getSettingStr(2,!1)))&&this.invArg(),this.setStringProperty(b,g));break;case 536870918:if(2<this.slen){var l=this.parameterExpressionToken(2);8==l.tok?g=l.value:(g=new JU.P3,l=l.asInt(),100<=l&&JU.SimpleUnitCell.ijkToPoint3f(l,g,-1,0));this.chk||this.vwr.setDefaultLattice(g)}break;case 545259552:case 545259545:2<this.slen&&(g=1073741991==(this.theTok=this.tokAt(2))||
1073742116==this.theTok?this.paramAsStr(this.checkLast(2)):this.getSettingStr(2,!1),this.setStringProperty(b,g));break;case 1631586315:d=this.getSettingInt(2);-2147483648==d&&this.invArg();this.chk||this.vwr.ms.setFormalCharges(this.vwr.bsA(),d);return;case 545259563:2<this.slen&&this.setStringProperty(b,this.getSettingStr(2,a));break;case 545259568:case 545259558:2<this.slen&&this.setUnits(this.getSettingStr(2,a),c);break;case 545259573:this.chk||this.vwr.setPicked(-1,!1);if(2<this.slen){this.cmdSetPicking();
return}break;case 545259574:if(2<this.slen){this.cmdSetPickingStyle();return}break;case 1715472409:break;case 536870924:d=this.getSettingInt(2);if(-2147483648==d||0==d||1==d){h=!1;break}c=553648174;b="specularPercent";this.setIntProperty(b,d);break;case 1649022989:c=553648178;b="strandCount";this.setIntProperty(b,this.getSettingInt(2));break;default:h=!1}if(!h||f){l=!h&&!a&&null!=this.getContextVariableAsVariable(b,!1);if(!h&&!l)switch(c){case 1677721602:e=603979928;break;case 1612709894:e=603979908;
break;case 1612709900:e=603979910;break;case 1610612739:e=603979878;break;case 1665140738:e=570425394;this.setFloatProperty("solventProbeRadius",this.getSettingFloat(2));h=!0;break;case 1610612740:e=570425390;break;case 1612709912:e=603979948;break;case 1765808134:e=545259545;break;case 1095241729:g=this.paramAsStr(2).toLowerCase();switch("x;y;z;fps;".indexOf(g+";")){case 0:e=570425398;break;case 2:e=570425400;break;case 4:e=570425402;break;case 6:e=570425396;break;default:this.errorStr2(50,"set SPIN ",
g)}this.chk||this.vwr.setSpin(g,I(this.floatParameter(this.checkLast(3))));h=!0}if(0!=e)b=JS.T.nameOf(c=e);else if(!l&&!h){(0==b.length||"_"==b.charAt(0)&&268437504!=this.tokAt(2))&&this.error(56);e=b.toLowerCase();if(0==e.indexOf("label")&&JU.PT.isOneOf(e.substring(5),";front;group;atom;offset;offsetexact;offsetabsolute;pointer;alignment;toggle;scalereference;for;")&&this.cmdSetLabel(e.substring(5)))return;if(a&&0==e.indexOf("shift_")){c=this.floatParameter(2);this.checkLength(3);this.chk||this.vwr.getNMRCalculation().setChemicalShiftReference(e.substring(6),
c);return}e.endsWith("callback")&&(c=536870912)}a&&!JS.T.tokAttr(c,536870912)&&(this.iToken=1,this.$isStateScript||this.errorStr2(50,"SET",b),this.warning(51,"SET",b));if(!h&&a)switch(this.slen){case 2:this.setBooleanProperty(b,!0);h=!0;break;case 3:2147483647!=d&&(this.setIntProperty(b,d),h=!0)}!h&&(!a&&1073742333==this.tokAt(2))&&(this.chk||this.vwr.removeUserVariable(b.toLowerCase()),h=!0);if(!h&&(this.setVariable(1,0,b,!0),!a))return;f&&this.vwr.showParameter(b,!0,80)}}}});f(d,"cmdScale",function(a){if(!this.chk){var b=
"%SCALE";switch(this.tokAt(a)){case 1073742334:this.setShapeProperty(31,"%SCALE",null);this.checkLast(a);return;case 1073742335:a++;break;default:var c=JM.Measurement.fixUnits(this.optParameterAsString(a));0!=JM.Measurement.fromUnits(1,c)?(b+=" "+c,a++):b=null}this.setShapeProperty(31,"thisID","%SCALE");0==this.tokAt(a)?(this.vwr.ms.setEchoStateActive(!0),null==this.vwr.shm.loadShape(31).scaleObject&&this.setShapeProperty(31,"target","bottom")):(this.setShapeProperty(31,"target","%SCALE"),this.cmdSetEcho(a));
null!=b&&this.setShapeProperty(31,"text",b);this.setShapeProperty(31,"thisID",null);this.refresh(!1)}},"~N");f(d,"cmdSetEcho",function(a){var b=null,c=null,e=null,g=!0,d=0<a;a=0==a?2:a;switch(d?0:this.getToken(a).tok){case 1073742334:e=b="allOff";this.checkLength(++a);break;case 1073742333:g=!1;case 1073742327:e=this.paramAsStr(2),this.checkLength(++a)}switch(d?this.tokAt(2):this.getToken(2).tok){case 1073741974:a++;case 1073741996:case 12289:case 1073742126:case 1073742172:case 1073742019:case 1073741871:case 1073741824:case 4:e=
this.paramAsStr(a++)}this.chk||(this.vwr.ms.setEchoStateActive(g),this.sm.loadShape(31),null!=e&&(null==b&&!d&&this.setShapeProperty(31,"thisID",null),this.setShapeProperty(31,null==b?"target":b,e)));if(a<this.slen){if(d)switch(this.tokAt(a)){case 536875059:case 4120:case 4:this.invArg()}switch(this.getToken(a++).tok){case 1073741832:b="align";switch(this.getToken(a).tok){case 1073741996:case 1073742126:case 12289:c=this.paramAsStr(a++);break;default:this.invArg()}break;case 12289:case 1073741996:case 1073742126:b=
"align";c=this.paramAsStr(a-1);break;case 554176526:b="%zpos";c=Integer.$valueOf(I(this.floatParameter(a++)));break;case 1610625028:case 2097192:case 1073742335:b="hidden";c=Boolean.FALSE;break;case 12294:case 2097194:b="hidden";c=Boolean.TRUE;break;case 1094717454:c=this.modelNumberParameter(a++);c>=this.vwr.ms.mc&&this.invArg();b="model";c=Integer.$valueOf(c);break;case 268437504:case 1073742195:b="xypos";c=this.xypParameter(--a);null==c&&this.invArg();a=this.iToken+1;break;case 2:e=this.intParameter(a-
1);g="xpos";268441090==this.tokAt(a)&&(g="%xpos",a++);b="ypos";c=Integer.$valueOf(this.intParameter(a++));268441090==this.tokAt(a)&&(b="%ypos",a++);this.checkLength(a);this.setShapeProperty(31,g,Integer.$valueOf(e));break;case 1073742066:b="offset";this.isPoint3f(a)?(a=this.getPoint3f(a,!1,!0),c=Q(-1,[-1,a.x,a.y,a.z,0,0,0]),a=this.iToken+1):this.isArrayParameter(a)?(c=this.floatParameterSet(a,7,7),a=this.iToken+1):1073742333==this.tokAt(a)&&a++;break;case 1073742334:b="off";break;case 536875059:b=
"scale";c=Float.$valueOf(this.floatParameter(a++));break;case 134222850:b="script";c=this.paramAsStr(a++);break;case 4120:a++;case 4:b=4!=this.theTok;this.checkLength(a--);if(b){null==e&&(b=Array(1),this.getShapePropertyData(31,"currentTarget",b),e=b[0]);if(!this.chk&&this.vwr.ms.getEchoStateActive()&&this.vwr.fm.loadImage(this.getToken(a).value,e,!this.useThreads(!1)))throw new JS.ScriptInterruption(this,"setEchoImage",1);return}this.cmdEcho(a);return;case 134217751:b="point";c=this.isCenterParameter(a)?
this.centerParameter(a,null):null;a=this.iToken+1;break;default:if(this.isCenterParameter(a-1)){b="xyz";c=this.centerParameter(a-1,null);a=this.iToken+1;break}this.invArg()}}this.checkLength(a);!this.chk&&null!=b&&this.setShapeProperty(31,b,c)},"~N");f(d,"cmdSetLabel",function(a){this.sm.loadShape(5);var b=null;for(this.setShapeProperty(5,"setDefaults",this.vwr.slm.noneSelected);;){if(a.equals("for")){var c=this.atomExpressionAt(2);this.cmdLabel(this.iToken+1,c);return!0}if(a.equals("scalereference")){c=
this.floatParameter(2);5<=c&&(c=this.vwr.tm.getZoomSetting()/c/this.vwr.getScalePixelsPerAngstrom(!1));b=Float.$valueOf(c);break}c=!1;if(a.equals("offset")||(c=a.equals("offsetabsolute")||a.equals("offsetexact"))){a="offset";if(this.isPoint3f(2))c=this.getPoint3f(2,!1,!0),b=Q(-1,[-1,c.x,c.y,c.z,0,0,0]);else if(this.isArrayParameter(2))b=this.floatParameterSet(2,7,7);else{var b=this.intParameterRange(2,-500,500),e=this.intParameterRange(3,-500,500);if(2147483647==b||2147483647==e)return!0;b=Integer.$valueOf(JV.JC.getOffset(b,
e,c))}break}if(a.equals("alignment")){switch(this.getToken(2).tok){case 1073741996:case 1073742126:case 12289:a="align";b=this.theToken.value;break;default:this.invArg()}break}if(a.equals("pointer")){c=0;switch(this.getToken(2).tok){case 1073742334:case 1073742333:break;case 1610616835:c|=2;case 1073742335:c|=1;break;default:this.invArg()}b=Integer.$valueOf(c);break}if(a.equals("toggle")){this.iToken=1;c=2==this.slen?this.vwr.bsA():this.atomExpressionAt(2);this.checkLast(this.iToken);if(this.chk)return!0;
this.vwr.shm.loadShape(5);this.vwr.shm.setShapePropertyBs(5,"toggleLabel",null,c);return!0}this.iToken=1;c=2==this.slen||1073742335==this.getToken(2).tok;if(a.equals("front")||a.equals("group")){!c&&1073742334!=this.tokAt(2)&&this.invArg();c||(a="front");b=c?Boolean.TRUE:Boolean.FALSE;break}if(a.equals("atom")){!c&&1073742334!=this.tokAt(2)&&this.invArg();a="front";b=c?Boolean.FALSE:Boolean.TRUE;break}return!1}c=this.iToken+1<this.slen?this.atomExpressionAt(++this.iToken):null;this.checkLast(this.iToken);
if(this.chk)return!0;null==c?this.setShapeProperty(5,a,b):this.setShapePropertyBs(5,a,b,c);return!0},"~S");f(d,"cmdSetPicking",function(){if(2==this.slen)this.setStringProperty("picking","identify");else if(4<this.slen||4==this.tokAt(2))this.setStringProperty("picking",this.getSettingStr(2,!1));else{var a=2,b="SELECT";switch(this.getToken(2).tok){case 1275082241:case 1745489939:case 1095241729:4==this.checkLength34()&&(b=this.paramAsStr(2).toUpperCase(),b.equals("SPIN")?this.setIntProperty("pickingSpinRate",
this.intParameter(3)):a=3);break;case 12291:break;default:this.checkLength(3)}var c=this.paramAsStr(a);switch(this.getToken(a).tok){case 1073742335:case 1073742056:c="identify";break;case 1073742334:case 1073742333:c="off";break;case 1275082241:c="atom";break;case 1825200146:c="label";break;case 1677721602:c="bond";break;case 12291:this.checkLength(4),1677721602!=this.tokAt(3)&&this.invArg(),c="deleteBond"}var e=0<=(e=c.indexOf("_"))?e:c.length,e=JV.ActionManager.getPickingMode(c.substring(0,e));
0>e&&this.errorStr2(50,"SET PICKING "+b,c);this.setStringProperty("picking",c)}});f(d,"cmdSetPickingStyle",function(){if(4<this.slen||4==this.tokAt(2))this.setStringProperty("pickingStyle",this.getSettingStr(2,!1));else{var a=2,b=!1,c="SELECT";switch(this.getToken(2).tok){case 1745489939:b=!0,c="MEASURE";case 1275082241:4==this.checkLength34()&&(a=3);break;default:this.checkLength(3)}var e=this.paramAsStr(a);switch(this.getToken(a).tok){case 1073742333:case 1073742334:e=b?"measureoff":"toggle";break;
case 1073742335:b&&(e="measure")}0>JV.ActionManager.getPickingStyleIndex(e)&&this.errorStr2(50,"SET PICKINGSTYLE "+c,e);this.setStringProperty("pickingStyle",e)}});f(d,"cmdSlab",function(a){var b=!1,c=null;if(this.isCenterParameter(1)||9==this.tokAt(1))c=this.planeParameter(1,!1);else switch(this.getToken(1).tok){case 2:c=this.intParameter(this.checkLast(1));this.chk||(a?this.vwr.tm.depthToPercent(c):this.vwr.tm.slabToPercent(c));return;case 1073742335:b=!0;case 1073742334:this.checkLength(2);this.setBooleanProperty("slabEnabled",
b);return;case 4141:this.checkLength(2);if(this.chk)return;this.vwr.tm.slabReset();this.setBooleanProperty("slabEnabled",!0);return;case 36867:this.checkLength(2);this.chk||this.vwr.tm.setSlabDepthInternal(a);return;case 268440576:b=this.paramAsStr(2);b.equalsIgnoreCase("hkl")?c=this.hklParameter(3,null,!0,null):b.equalsIgnoreCase("plane")&&(c=this.planeParameter(2,!1));null==c&&this.invArg();c.scale4(-1);break;case 134217750:switch(this.getToken(2).tok){case 1073742333:break;default:c=this.planeParameter(1,
!1)}break;case 134219777:c=1073742333==this.getToken(2).tok?null:this.hklParameter(2,null,!0,null);break;case 1073742118:return;default:this.invArg()}this.chk||this.vwr.tm.slabInternal(c,a)},"~B");f(d,"cmdSsbond",function(){var a=this.getMadParameter();2147483647!=a&&(this.setShapeProperty(1,"type",Integer.$valueOf(256)),this.setShapeSizeBs(1,a,null),this.setShapeProperty(1,"type",Integer.$valueOf(1023)))});f(d,"cmdStructure",function(){var a=J.c.STR.getProteinStructureType(this.paramAsStr(1));a===
J.c.STR.NOT&&this.invArg();var b=null;switch(this.tokAt(2)){case 12290:case 10:case 1073742325:b=this.atomExpressionAt(2);this.checkLast(this.iToken);break;default:this.checkLength(2)}this.chk||(this.clearDefinedVariableAtomSets(),this.vwr.setProteinType(a,b))});f(d,"cmdSubset",function(){var a=null;this.chk||this.vwr.slm.setSelectionSubset(null);if(1!=this.slen&&(4!=this.slen||!this.getToken(2).value.equals("off")))a=this.atomExpressionAt(1);this.chk||this.vwr.slm.setSelectionSubset(a)});f(d,"cmdThrow",
function(){if(!this.chk){var a=14==this.tokAt(1)?2:1,b=(1==a?this.setVariable(1,this.slen,"thrown_value",!1):this.vwr.g.setUserVariable("thrown_value",JS.SV.newS(this.optParameterAsString(2)))).asString();if(0==b.length&&0==(b=this.optParameterAsString(1)).length)b="context";if(2==a)throw this.saveContext(b),this.doReport()&&this.report(J.i18n.GT.o(J.i18n.GT.$("to resume, enter: &{0}"),b),!1),new JS.ScriptInterruption(this,b,-2147483648);this.evalError(b,null)}});f(d,"saveContext",function(a){var b=
this.getScriptContext("Context_"+a);this.vwr.stm.saveContext(a,b);this.vwr.g.setUserVariable(a,JS.SV.newV(14,b));return b},"~S");f(d,"cmdTimeout",function(a){var b=null,c=null,e=0;if(this.slen==a)this.showString(this.vwr.showTimeout(null));else{for(;a<this.slen;a++)switch(this.getToken(a).tok){case 1073741974:b=this.paramAsStr(++a);if(3==this.slen){this.chk||this.vwr.triggerTimeout(b);return}break;case 1073742334:break;case 2:e=this.intParameter(a);break;case 3:e=Math.round(1E3*this.floatParameter(a));
break;default:null==b?b=this.paramAsStr(a):null==c?c=this.paramAsStr(a):this.invArg()}this.chk||this.vwr.setTimeout(b,e,c)}},"~N");f(d,"cmdTranslate",function(a){var b=null,c=1,b=0;1113589787==this.tokAt(1)&&(a=!0,b=1,c=2);if(this.isPoint3f(c))a=this.getPoint3f(c,!0,!0),b=this.iToken+1<this.slen?this.atomExpressionAt(++this.iToken):null,this.checkLast(this.iToken),this.chk||this.vwr.setAtomCoordsRelative(a,b);else{var e=(this.paramAsStr(c).toLowerCase()+" ").charAt(0);0>"xyz".indexOf(e)&&this.error(0);
var g=this.floatParameter(++c);switch(this.tokAt(++c)){case 0:case 12290:case 10:case 1073742325:c="\x00";break;default:c=(this.optParameterAsString(c).toLowerCase()+"\x00").charAt(0)}0==g&&"\x00"!=c||(this.iToken=b+("\x00"==c?2:3),b=a?this.vwr.bsA():this.iToken+1<this.slen?this.atomExpressionAt(++this.iToken):null,this.checkLast(this.iToken),this.chk||(this.vwr.translate(e,g,c,b),this.refresh(!1)))}},"~B");f(d,"cmdUnbind",function(){1!=this.slen&&this.checkLength23();var a=this.optParameterAsString(1),
b=this.optParameterAsString(2);if(0==a.length||1073742327==this.tokAt(1))a=null;if(0==b.length||1073742327==this.tokAt(2))b=null;null==b&&(null!=a&&0<=JV.ActionManager.getActionFromName(a))&&(b=a,a=null);this.chk||this.vwr.unBindAction(a,b)});f(d,"cmdUndoRedo",function(a){var b=1,c=2;switch(a){case 603984065:case 4139:a=this.vwr.stm.getUndoRedoState(a);null!=a&&this.runScript(a);return}switch(this.tokAt(1)){case 0:c=1;break;case 1073742327:b=0;break;case 2:b=this.intParameter(1);break;default:this.invArg()}this.checkLength(c);
this.chk||this.vwr.undoMoveAction(a,b)},"~N");f(d,"cmdUnitcell",function(a){this.getCmdExt().dispatch(1814695966,2==a,null)},"~N");f(d,"cmdVector",function(){var a=J.atomdata.RadiusData.EnumType.SCREEN,b=1;this.checkLength(-3);switch(this.iToken=this.slen){case 2:switch(this.getToken(1).tok){case 1073742335:break;case 1073742334:b=0;break;case 2:b=this.intParameterRange(1,0,19);if(2147483647==b)return;break;case 3:a=J.atomdata.RadiusData.EnumType.ABSOLUTE;if(Float.isNaN(b=this.floatParameterRange(1,
0,3)))return;break;default:this.error(6)}break;case 3:switch(this.tokAt(1)){case 1112152078:this.setIntProperty("vectorTrace",this.intParameterRange(2,0,20));return;case 536875059:Float.isNaN(b=this.floatParameterRange(2,-100,100))||this.setFloatProperty("vectorScale",b);return;case 64:a=this.floatParameter(2);this.chk||this.vwr.ms.scaleVectorsToMax(a);return}}this.setShapeSize(18,new J.atomdata.RadiusData(null,b,a,null))});f(d,"cmdVibration",function(){this.checkLength(-3);var a=0;switch(this.getToken(1).tok){case 1073742335:this.checkLength(2);
a=this.vwr.getFloat(570425412);break;case 1073742334:this.checkLength(2);a=0;break;case 2:case 3:this.checkLength(2);a=this.floatParameter(1);break;case 536875059:Float.isNaN(a=this.floatParameterRange(2,-100,100))||this.setFloatProperty("vibrationScale",a);return;case 64:var b=this.floatParameter(2);this.chk||this.vwr.ms.scaleVectorsToMax(b);break;case 1073742090:this.setFloatProperty("vibrationPeriod",this.floatParameter(2));return;case 1073741824:this.invArg();break;default:a=-1}0>a&&this.invArg();
this.chk||(0==a?this.vwr.tm.setVibrationPeriod(0):this.vwr.setVibrationPeriod(-a))});f(d,"cmdWireframe",function(){var a=-2147483648;4141==this.tokAt(1)?this.checkLast(1):a=this.getMadParameter();this.chk||2147483647==a||(this.setShapeProperty(1,"type",Integer.$valueOf(1023)),this.setShapeSizeBs(1,-2147483648==a?300:a,null))});f(d,"cmdZap",function(a){if(1==this.slen||!a)(a=a&&!this.$isStateScript)&&this.vwr.cacheClear(),this.vwr.zap(!0,a,!0),this.refresh(!1);else if(a=this.atomExpressionAt(1),!this.chk)if(0>
a.nextSetBit(0)&&4==this.slen&&1073742359==this.tokAt(2))a=this.vwr.ms.getModelNumberIndex(this.getToken(2).intValue,!1,!0),0<=a&&this.vwr.deleteModels(a,null);else{a=this.vwr.deleteAtoms(a,!0);var b=!this.doReport();b||this.report(J.i18n.GT.i(J.i18n.GT.$("{0} atoms deleted"),a),!1);this.vwr.selectStatus(null,!1,0,b,!1)}},"~B");f(d,"cmdZoom",function(a){if(!a){var b=1<this.slen?this.getToken(1).tok:1073742335;switch(b){case 1073742335:case 1073742334:2<this.slen&&this.bad();this.chk||this.setBooleanProperty("zoomEnabled",
1073742335==b);return}}var c=null,e=1,b=a?this.isFloatParameter(e)?this.floatParameter(e++):1:0;0>b&&(e--,b=0);var g=0,d=null;if(1814695966==this.tokAt(e)||this.isCenterParameter(e)){var g=e,f=Array(1),c=this.centerParameter(e,f);x(f[0],"JU.BS")&&(d=f[0]);e=this.iToken+1}else 2==this.tokAt(e)&&0==this.getToken(e).intValue&&(d=this.vwr.getAtomBitSet("visible"),c=this.vwr.ms.getAtomSetCenter(d));var f=this.vwr.tm.getZoomSetting(),d=this.getZoom(g,e,d,f),e=this.iToken+1,h=f=NaN;e!=this.slen&&(f=this.floatParameter(e++),
h=this.floatParameter(e++));e!=this.slen&&this.invArg();0>d&&(d=-d,a&&(1==this.slen?d*=2:null==c&&(d/=2)));(5>d||2E5<d)&&this.numberOutOfRange(5,2E5);this.vwr.tm.isWindowCentered()||(null!=c&&(a=this.atomExpressionAt(g),this.chk||this.vwr.setCenterBitSet(a,!1)),c=this.vwr.tm.fixedRotationCenter,Float.isNaN(f)&&(f=this.vwr.tm.getTranslationXPercent()),Float.isNaN(h)&&(h=this.vwr.tm.getTranslationYPercent()));if(!this.chk&&(Float.isNaN(f)&&(f=0),Float.isNaN(h)&&(h=0),this.useThreads(!0)||(b=0),this.vwr.moveTo(this,
b,c,JV.JC.center,NaN,null,d,f,h,NaN,null,NaN,NaN,NaN,NaN,NaN,NaN),this.isJS&&0<b&&this.vwr.g.waitForMoveTo))throw new JS.ScriptInterruption(this,"zoomTo",1);},"~B");f(d,"colorShape",function(a,b,c){var e=536875059==Math.abs(a);e?a=31:0>a&&(a=this.getShapeType(-a));var g=null,d=null,f=null,h=null,l=2==b&&1073741859==this.tokAt(1)?"ball":"",q=24==a||25==a,k=!1,m=3.4028235E38;0>b&&(h=this.atomExpressionAt(-b),b=this.iToken+1,this.isBondSet&&(k=!0,a=1));var n=this.getToken(b).tok,t=1275082241==n;t&&(n=
this.getToken(++b).tok);c?this.getToken(b):!0==(c=1610616835==n)&&this.getToken(++b);if(c)l="bg";else if(q)switch(n=!1,1073742194==this.theTok&&(this.getToken(++b),n=!0),this.theTok){case 1073742018:this.getToken(++b);l="mesh";break;case 1073742094:b=this.getArgbParamOrNone(++b,!1);f=0==b?null:Integer.$valueOf(b);this.getToken(b=this.iToken+1);break;case 12290:case 10:case 1073742325:x(this.theToken.value,"JM.BondSet")?(h=this.theToken.value,l="vertex"):n&&x(this.theToken.value,"JU.BS")?(h=this.theToken.value,
l="vertex"):(h=this.atomExpressionAt(b),l="atom"),this.getToken(b=this.iToken+1)}if(this.chk||!((27==a||28==a)&&null!=this.getIsoExt().dispatch(a,!0,this.st))){var r=1111490588==this.theTok;if(r||1073742074==this.theTok)1.4E-45==m&&this.invArg(),g=this.paramAsStr(b++),r&&this.isFloatParameter(b)&&(m=this.getTranslucentLevel(b++));n=0;if(c=b<this.slen&&1073742335!=this.tokAt(b)&&1073742334!=this.tokAt(b)){var v=0,n=this.getToken(b).tok;if((!q||1073742170!=this.tokAt(b+1))&&(t&&1073742333==n||this.isColorParam(b))){b=
this.getArgbParamOrNone(b,t);d=0==b?null:Integer.$valueOf(b);if(0!=this.tokAt(b=this.iToken+1)&&null==g)if(this.getToken(b),(r=1111490588==this.theTok)||1073742074==this.theTok)g=this.paramAsStr(b++),r&&this.isFloatParameter(b)&&(m=this.getTranslucentLevel(b++));n=this.tokAt(b);if(t&&1073742333==n||this.isColorParam(b))v=this.getArgbParamOrNone(b,t),f=0==v?null:Integer.$valueOf(v),b=this.iToken+1;this.checkLength(b);if(t){this.chk||this.vwr.setSelectionColors(d,f,g,m);return}}else if(26==a)this.iToken--;
else{var t=this.paramAsStr(b).toLowerCase(),u=0==t.indexOf("byelement"),G=u||0==t.indexOf("byresidue"),d=G||q?J.c.PAL.PROPERTY:1112152075==n?J.c.PAL.CPK:J.c.PAL.getPalette(t);(d===J.c.PAL.UNKNOWN||(d===J.c.PAL.TYPE||d===J.c.PAL.ENERGY)&&2!=a)&&this.invArg();var v=null,w=d!==J.c.PAL.PROPERTY&&d!==J.c.PAL.VARIABLE||!this.vwr.g.rangeSelected?null:this.vwr.bsA();d===J.c.PAL.PROPERTY?G?this.chk||(v=this.getBitsetPropertyFloat(w,(u?1094715402:1094713356)|256,null,NaN,NaN)):(u=t.equals("property"))&&JS.T.tokAttr(n=
this.getToken(++b).tok,1077936128)&&(1086324754==n||!JS.T.tokAttr(n,1086324736))?(n=this.getToken(b).tok,u=1111490587==n?"property_dssr."+this.getToken(++b).value.toString():1086324754==n||1145047055==n?"color":null,this.chk||(v=this.getBitsetPropertyFloat(w,n|256,u,NaN,NaN)),b++):!u&&!q&&b++:d===J.c.PAL.VARIABLE&&(b++,t=this.paramAsStr(b++),v=Q(this.vwr.ms.ac,0),JU.Parser.parseStringInfestedFloatArray(""+this.getParameter(t,4,!0),null,v),d=J.c.PAL.PROPERTY);if(d===J.c.PAL.PROPERTY){u=null;4==this.tokAt(b)?
(u=this.paramAsStr(b++),0>u.indexOf("/")&&(u=u.toLowerCase()),this.isArrayParameter(b)&&(u+="="+JS.SV.sValue(JS.SV.getVariableAS(this.stringParameterSet(b))).$replace("\n"," "),b=this.iToken+1)):q&&this.isColorParam(b)&&(u=this.getColorRange(b),b=this.iToken+1);null!=u&&!q&&(this.setStringProperty("propertyColorScheme",(r&&3.4028235E38==m?"translucent ":"")+u),G=0==u.indexOf("byelement")||0==u.indexOf("byresidue"));var E=0,C=3.4028235E38;if(!G&&(1073741826==this.tokAt(b)||1073742114==this.tokAt(b)))E=
this.floatParameter(b+1),C=this.floatParameter(b+2),b+=3,E==C&&q?(G=this.getShapeProperty(a,"dataRange"),null!=G&&(E=G[0],C=G[1])):E==C&&(C=3.4028235E38);q||(null==v?this.chk||this.vwr.setCurrentColorRange(t):this.chk||this.vwr.cm.setPropertyColorRangeData(v,w));if(q){this.checkLength(b);if(this.chk)return;c=!1;t=null==u?this.getShapeProperty(a,"colorEncoder"):null;if(null==t&&null==(t=this.vwr.cm.getColorEncoder(u)))return;t.isTranslucent=r&&3.4028235E38==m;t.setRange(E,C,E>C);3.4028235E38==C&&(t.hi=
C);this.setShapeProperty(a,"remapColor",t);this.showString(this.getShapeProperty(a,"dataRangeStr").$replace("\n"," "));if(3.4028235E38==m)return}else 3.4028235E38!=C&&this.vwr.cm.setPropertyColorRange(E,C)}else b++;this.checkLength(b)}}if(!(this.chk||0>a)){e&&this.setShapeProperty(31,"target","%SCALE");switch(a){case 4:b=32768;break;case 2:b=30720;break;case 3:b=256;break;case 1:b=1023;break;default:b=0}0==b?(this.sm.loadShape(a),5==a&&this.setShapeProperty(5,"setDefaults",this.vwr.slm.noneSelected)):
(null!=h&&(this.vwr.selectBonds(h),h=null),a=1,this.setShapeProperty(a,"type",Integer.$valueOf(b)));if(c){switch(n){case 1111492619:this.getPartialCharges(h);break;case 1111490575:case 1111490574:this.vwr.autoCalculate(n,null);break;case 1111492620:this.vwr.g.rangeSelected&&this.vwr.ms.clearBfactorRange();break;case 1086324742:this.vwr.ms.calcSelectedGroupsCount();break;case 1094713362:case 1094713361:this.vwr.ms.calcSelectedMonomersCount();break;case 1639976963:this.vwr.ms.getStructureAssignments();
break;case 1094713360:this.vwr.ms.calcSelectedMoleculesCount()}null!=f&&(q||11==a||14==a||21==a)?this.setShapeProperty(a,"colorPhase",P(-1,[f,d])):null==h?this.setShapeProperty(a,l+"color",d):"vertex"===l?this.setShapePropertyBs(a,"vertexcolor",P(-1,[d,Double.$valueOf(m)]),h):this.setShapePropertyBs(a,l+"color",d,h)}null!=g&&"vertex"!==l&&this.setShapeTranslucency(a,l,g,m,h);e&&this.setShapeProperty(31,"thisID",null);0!=b&&this.setShapeProperty(1,"type",Integer.$valueOf(1023));k&&this.vwr.selectBonds(null);
0==a&&(this.vwr.shm.checkInheritedShapes(),this.vwr.sm.setStatusStructureModified(-1,-1,1,null,0,h))}}},"~N,~N,~B");f(d,"getPartialCharges",function(a){try{this.vwr.getOrCalcPartialCharges(a,null)}catch(b){if(G(b,Exception))throw new JS.ScriptInterruption(this,"partialcharge",1);throw b;}},"JU.BS");f(d,"encodeRadiusParameter",function(a,b,c){var e=NaN,g=J.atomdata.RadiusData.EnumType.ABSOLUTE,d=null,f=-1==a?1648363544:this.getToken(a).tok;switch(f){case 1111490561:case 1111490562:case 1111492618:case 1113589786:case 1111492620:case 1648363544:e=
1,g=J.atomdata.RadiusData.EnumType.FACTOR,d=1648363544==f?null:J.c.VDW.getVdwType2(JS.T.nameOf(f)),f=this.tokAt(++a)}switch(f){case 4141:return this.vwr.rd;case 1073741852:case 1073742116:case 1073741856:case 1073741857:case 1073741991:e=1;g=J.atomdata.RadiusData.EnumType.FACTOR;this.iToken=a-1;break;case 268440577:case 2:case 3:if(268440577==f)a++;else if(268441090==this.tokAt(a+1)){e=Math.round(this.floatParameter(a));this.iToken=++a;g=J.atomdata.RadiusData.EnumType.FACTOR;if(200<Math.abs(e))return this.integerOutOfRange(0,
200),null;b&&(e=-e);e/=100;break}else if(2==f){e=this.intParameter(a);if(749<e||-200>e)return this.integerOutOfRange(-200,749),null;0<e?(e/=250,g=J.atomdata.RadiusData.EnumType.ABSOLUTE):(e/=-100,g=J.atomdata.RadiusData.EnumType.FACTOR);break}268440577==f||!c?(g=J.atomdata.RadiusData.EnumType.OFFSET,e=16):(g=J.atomdata.RadiusData.EnumType.ABSOLUTE,d=J.c.VDW.NADA,e=100);e=this.floatParameterRange(a,b||!c?-e:0,e);if(Float.isNaN(e))return null;b&&(e=-e);16<e&&(e=16.1);break;default:1==e&&a--}null==d&&
(d=J.c.VDW.getVdwType(this.optParameterAsString(++this.iToken)),null==d&&(this.iToken=a,d=J.c.VDW.AUTO));return new J.atomdata.RadiusData(null,e,g,d)},"~N,~B,~B");f(d,"expandFloatArray",function(a,b,c){var e=a.length,g=!1,d=c?new JU.BS:null;try{for(var f=0;f<a.length;f++)0>a[f]&&(e+=Math.abs(a[f-1]+a[f])-1,g=!0);if(g){for(var h=c?null:Q(e,0),f=g=0;f<a.length;f++)if(e=I(a[f]),0<=e)e<b&&this.invArg(),c?d.set(e-1):h[g++]=e;else for(var l=I(a[f-1]),q=l<=-e?1:-1,k=-e;l!=k;l+=q,g++)c?d.set(l):h[g]=l+q;
a=h;c||(e=a.length)}if(c){for(f=e;0<=--f;)d.set(I(a[f])-1);return d}for(var m=O(e,0),f=e;0<=--f;)m[f]=I(a[f]);return m}catch(n){if(G(n,Exception))return this.invArg(),null;throw n;}},"~A,~N,~B");f(d,"frameControl",function(a){switch(this.getToken(this.checkLast(a)).tok){case 1073742098:case 1073742096:case 4143:case 20487:case 1073742037:case 1073742108:case 1073742125:case 1073741942:case 1073741993:this.chk||this.vwr.setAnimation(this.theTok);return}this.invArg()},"~N");f(d,"getColorRange",function(a){a=
this.getArgbParam(a);1073742170!=this.tokAt(++this.iToken)&&this.invArg();var b=this.getArgbParam(++this.iToken),c=2==this.tokAt(this.iToken+1)?this.intParameter(++this.iToken):0;return JU.ColorEncoder.getColorSchemeList(JU.ColorEncoder.getPaletteAtoB(a,b,c))},"~N");f(d,"getFullPathName",function(a){var b=!this.chk||this.isCmdLine_C_Option?this.vwr.fm.getFullPathName(!0):"test.xyz";null==b&&this.invArg();a&&(!"string".equals(b)&&!"zapped".equals(b))&&(a=this.vwr.fm.getLastReadFileType(),null!=a&&
0<a.length&&(b=a+"::"+b));return b},"~B");f(d,"getObjectBoundingBox",function(a){a=P(-1,[a,null,null]);return this.getShapePropertyData(24,"getBoundingBox",a)||this.getShapePropertyData(29,"getBoundingBox",a)||this.getShapePropertyData(25,"getBoundingBox",a)||this.getShapePropertyData(28,"getBoundingBox",a)||this.getShapePropertyData(27,"getBoundingBox",a)?a[2]:null},"~S");f(d,"getObjectCenter",function(a,b,c){a=P(-1,[a,Integer.$valueOf(b),Integer.$valueOf(c)]);return this.getShapePropertyData(22,
"getCenter",a)||this.getShapePropertyData(24,"getCenter",a)||this.getShapePropertyData(29,"getCenter",a)||this.getShapePropertyData(25,"getCenter",a)||this.getShapePropertyData(28,"getCenter",a)||this.getShapePropertyData(27,"getCenter",a)?a[2]:null},"~S,~N,~N");f(d,"getPlaneForObject",function(a,b){switch(this.sm.getShapeIdFromObjectName(a)){case 22:this.setShapeProperty(22,"thisID",a);var c=this.getShapeProperty(22,"vertices");if(null==c||3>c.length||null==c[0]||null==c[1]||null==c[2])break;return JU.Measure.getPlaneThroughPoints(c[0],
c[1],c[2],new JU.V3,b,new JU.P4);case 24:return this.setShapeProperty(24,"thisID",a),this.getShapeProperty(24,"plane")}return null},"~S,JU.V3");f(d,"getQuaternionArray",function(a,b){var c;switch(b){case 134221850:c=a;break;case 9:c=Array(a.length);for(var e=0;e<a.length;e++)c[e]=JU.Quat.newP4(a[e]);break;case 1073742001:c=Array(a.size());for(e=0;e<a.size();e++){var g=JS.SV.pt4Value(a.get(e));if(null==g)return null;c[e]=JU.Quat.newP4(g)}break;default:return null}return c},"~O,~N");f(d,"getSetAxesTypeMad10",
function(a){if(a==this.slen)return 1;switch(this.getToken(this.checkLast(a)).tok){case 1073742335:return 1;case 1073742334:return 0;case 1073741926:return-1;case 2:return this.intParameterRange(a,-1,19);case 3:return a=this.floatParameterRange(a,0,2),Float.isNaN(a)?2147483647:T(Math.floor(2E4*a))}this.chk||this.errorStr(7,'"DOTTED"');return 0},"~N");f(d,"getSettingFloat",function(a){return a>=this.slen?NaN:JS.SV.fValue(this.parameterExpressionToken(a))},"~N");f(d,"getSettingInt",function(a){return a>=
this.slen?-2147483648:this.parameterExpressionToken(a).asInt()},"~N");f(d,"getSettingStr",function(a,b){return b&&this.slen==a+1?this.paramAsStr(a):this.parameterExpressionToken(a).asString()},"~N,~B");f(d,"getShapeProperty",function(a,b){return this.sm.getShapePropertyIndex(a,b,-2147483648)},"~N,~S");f(d,"getShapePropertyData",function(a,b,c){return this.sm.getShapePropertyData(a,b,c)},"~N,~S,~A");f(d,"getShapeType",function(a){a=JV.JC.shapeTokenIndex(a);0>a&&this.error(49);return a},"~N");f(d,"getTranslucentLevel",
function(a){a=this.floatParameter(a);return 2==this.theTok&&0<a&&9>a?a+1:a},"~N");f(d,"getZoom",function(a,b,c,e){var g=this.isFloatParameter(b)?this.floatParameter(b++):NaN;if(0==g||0==e){e=NaN;if(null==c)switch(this.tokAt(a)){case 1814695966:e=this.vwr.getCurrentUnitCell();null==e&&this.invArg();g=e.getUnitCellVerticesNoOffset();a=new JU.P3;for(var d=0;8>d;d++)a.add(g[d]);a.scale(0.125);for(d=e=0;8>d;d++){var f=g[d].distanceSquared(a);f>e&&(e=f)}0==e&&this.invArg();e=Math.sqrt(e);break;case 1073742330:g=
this.getObjectBoundingBox(this.objectNameParameter(a+1)),(null==g||0==(e=g[0].distance(g[1])/2))&&this.invArg()}else e=this.vwr.ms.calcRotationRadiusBs(c);Float.isNaN(e)&&this.invArg();e=100*(this.vwr.getFloat(570425388)/e);g=NaN}if(0>g)g+=e;else if(Float.isNaN(g))switch(a=this.tokAt(b),a){case 1073742079:case 1275068432:g=e*(1073742079==a?0.5:2);b++;break;case 268441088:case 268441089:case 268440577:c=this.floatParameter(++b);b++;switch(a){case 268441088:g=e/c;break;case 268441089:g=e*c;break;case 268440577:g=
e+c}break;default:g=null==c?-e:e}this.iToken=b-1;return g},"~N,~N,JU.BS,~N");f(d,"setElementColor",function(a,b){var c=-1,e="_"==a.charAt(0);a:for(;;){if(e){a=a.substring(1);for(e=JU.Elements.elementNumberMax;0<=--e;)if(a.equalsIgnoreCase(JU.Elements.elementSymbolFromNumber(e))){c=e;break a}for(e=JU.Elements.altElementMax;4<=--e;)if(a.equalsIgnoreCase(JU.Elements.altElementSymbolFromIndex(e))||a.equalsIgnoreCase(JU.Elements.altIsotopeSymbolFromIndex(e))){c=JU.Elements.altElementNumberFromIndex(e);
break a}}else{for(e=JU.Elements.elementNumberMax;0<=--e;)if(a.equalsIgnoreCase(JU.Elements.elementNameFromNumber(e))){c=e;break a}for(e=JU.Elements.altElementMax;0<=--e;)if(a.equalsIgnoreCase(JU.Elements.altElementNameFromIndex(e))){c=JU.Elements.altElementNumberFromIndex(e);break a}}break}if(this.chk||0>c)return!1;this.vwr.setElementArgb(c,b);return!0},"~S,~N");f(d,"setMeshDisplayProperty",function(a,b,c){var e=null,g=null,d=25==a,f=0==b;f||(c=this.getToken(b).tok);switch(c){case 1765808134:if(d)this.iToken++;
else break;case 1073742074:case 1111490588:return f||this.colorShape(a,this.iToken,!1),!0;case 0:case 12291:case 1073742335:case 1073742072:case 1073742334:case 12294:case 2097194:case 1610625028:case 2097192:1==this.iToken&&(0<=a&&0==this.tokAt(2))&&this.setShapeProperty(a,"thisID",null);if(0==c)return 1==this.iToken;if(f)return!0;switch(c){case 12291:return this.setShapeProperty(a,"delete",null),!0;case 2097194:case 12294:c=1073742334;break;case 2097192:c=1073742335;break;case 1610625028:b+1==this.slen&&
(c=1073742335);break}case 1073741958:case 1073741861:case 1073741964:case 1073741898:case 1073742039:case 1112150019:case 1073742042:case 1073742018:case 1073742052:case 1073741938:case 1073742046:case 1073741862:case 1073742057:case 1073742182:case 1073742060:case 1073741960:case 1073742058:e="token",g=Integer.$valueOf(c)}if(null==e)return!1;if(f)return!0;this.setShapeProperty(a,e,g);0!=this.tokAt(this.iToken+1)&&(this.setMeshDisplayProperty(a,++this.iToken,0)||--this.iToken);return!0},"~N,~N,~N");
f(d,"setObjectArgb",function(a,b){this.chk||this.vwr.setObjectArgb(a,b)},"~S,~N");f(d,"setObjectMad10",function(a,b,c){this.chk||this.vwr.setObjectMad10(a,b,c)},"~N,~S,~N");f(d,"setObjectProp",function(a,b,c){for(var e=P(-1,[a,null]),g="",d=JU.PT.isWild(a),f=17;;){if(this.getShapePropertyData(f,"checkID",e)){this.setShapeProperty(f,"thisID",a);switch(b){case 12291:this.setShapeProperty(f,"delete",null);break;case 12294:case 1610625028:this.setShapeProperty(f,"hidden",1610625028==b?Boolean.FALSE:Boolean.TRUE);
break;case 134222350:g+=this.getShapeProperty(f,"command")+"\n";break;case 1765808134:0<=c&&this.colorShape(f,c+1,!1)}if(!d)break}switch(f){case 17:f=20;continue;case 20:f=32}switch(--f){case 27:f--;break;case 28:f-=2}if(21>f)break}return g},"~S,~N,~N");f(d,"setObjectProperty",function(){var a=this.setShapeNameParameter(2);return this.chk?"":this.setObjectProp(a,this.tokAt(0),this.iToken)});f(d,"setShapeNameParameter",function(a){var b=this.paramAsStr(a),c=b.equals("*");0==b.length&&this.invArg();
if(c)switch(this.tokAt(a+1)){case 0:case 1073742335:case 1073742072:case 1073742334:case 2097192:case 2097194:case 1765808134:case 12291:break;default:if(this.setMeshDisplayProperty(-1,0,this.tokAt(a+1)))break;b+=this.optParameterAsString(++a)}268441089==this.tokAt(a+1)&&(b+=this.paramAsStr(++a));this.iToken=a;return b},"~N");f(d,"setShapeProperty",function(a,b,c){this.chk||this.sm.setShapePropertyBs(a,b,c,null)},"~N,~S,~O");f(d,"setShapePropertyBs",function(a,b,c,e){this.chk||this.sm.setShapePropertyBs(a,
b,c,e)},"~N,~S,~O,JU.BS");f(d,"setShapeSize",function(a,b){this.chk||this.sm.setShapeSizeBs(a,0,b,null)},"~N,J.atomdata.RadiusData");f(d,"setShapeSizeBs",function(a,b,c){this.chk||this.sm.setShapeSizeBs(a,b,null,c)},"~N,~N,JU.BS");f(d,"setShapeTranslucency",function(a,b,c,e,g){3.4028235E38==e&&(e=this.vwr.getFloat(570425353));this.setShapeProperty(a,"translucentLevel",Float.$valueOf(e));null!=b&&(null==g?this.setShapeProperty(a,b+"translucency",c):this.chk||this.setShapePropertyBs(a,b+"translucency",
c,g))},"~N,~S,~S,~N,JU.BS");f(d,"setSize",function(a,b){var c=null,e=this.tokAt(1),g=!1;switch(e){case 1073742072:this.restrictSelected(!1,!1);case 1073742335:break;case 1073742334:b=0;break;case 3:case 2:g=0>this.floatParameter(1)&&(3==e||268441090==this.tokAt(2));default:c=this.encodeRadiusParameter(1,g,!0);if(null==c)return;Float.isNaN(c.value)&&this.invArg()}null==c&&(c=new J.atomdata.RadiusData(null,b,J.atomdata.RadiusData.EnumType.FACTOR,J.c.VDW.AUTO));g&&this.restrictSelected(!1,!1);this.setShapeSize(a,
c)},"~N,~N");f(d,"setSizeBio",function(a){var b=0;switch(this.getToken(1).tok){case 1073742072:this.restrictSelected(!1,!1);case 1073742335:b=-1;break;case 1073742334:break;case 1639976963:b=-2;break;case 1111492620:case 1073741922:b=-4;break;case 2:if(2147483647==(b=8*this.intParameterRange(1,0,1E3)))return;break;case 3:b=Math.round(2E3*this.floatParameterRange(1,-4,4));if(2147483647==b)return;0>b&&(this.restrictSelected(!1,!1),b=-b);break;case 10:this.chk||this.sm.loadShape(a);this.setShapeProperty(a,
"bitset",this.theToken.value);return;default:this.error(6)}this.setShapeSizeBs(a,b,null)},"~N");f(d,"setUnits",function(a,b){545259568==b&&(a.toLowerCase().endsWith("hz")||JU.PT.isOneOf(a.toLowerCase(),";default;angstroms;au;bohr;nanometers;nm;picometers;pm;vanderwaals;vdw;"))?this.chk||this.vwr.setUnits(a,!0):545259558==b&&JU.PT.isOneOf(a.toLowerCase(),";kcal;kj;")?this.chk||this.vwr.setUnits(a,!1):this.errorStr2(50,"set "+JS.T.nameOf(b),a);return!0},"~S,~N");f(d,"toString",function(){var a=new JU.SB;
a.append("Eval\n pc:");a.appendI(this.pc);a.append("\n");a.appendI(this.aatoken.length);a.append(" statements\n");for(var b=0;b<this.aatoken.length;++b){a.append("----\n");for(var c=this.aatoken[b],e=0;e<c.length;++e)a.appendO(c[e]),a.appendC("\n");a.appendC("\n")}a.append("END\n");return a.toString()});d.iProcess=0;d.commandHistoryLevelMax=0;d.contextDepthMax=100;d.scriptReportingLevel=0});H("JS");L(["JS.ScriptParam"],"JS.ScriptExpr","java.util.Hashtable JU.AU $.BS $.CU $.Lst $.Measure $.P3 $.PT $.SB J.api.Interface JM.AtomCollection $.BondSet $.Group $.ModelSet JS.SV $.ScriptMathProcessor $.T JU.BSUtil $.Edge $.Elements $.Escape".split(" "),
function(){var d=M(function(){this.debugHigh=!1;this.ptTemp=this.tempStatement=this.smilesExt=this.mathExt=this.isoExt=this.cmdExt=this.privateFuncs=null;K(this,arguments)},JS,"ScriptExpr",JS.ScriptParam);f(d,"getCmdExt",function(){return null==this.cmdExt?this.cmdExt=this.getExt("Cmd").init(this):this.cmdExt});f(d,"getIsoExt",function(){return null==this.isoExt?this.isoExt=this.getExt("Iso").init(this):this.isoExt});f(d,"getMathExt",function(){return null==this.mathExt?(this.mathExt=this.getExt("Math")).init(this):
this.mathExt});f(d,"getSmilesExt",function(){return null==this.smilesExt?(this.smilesExt=this.getExt("Smiles")).init(this):this.smilesExt});f(d,"getExt",function(a){return J.api.Interface.getInterface("JS."+a+"Ext",this.vwr,"script")},"~S");f(d,"parameterExpressionList",function(a,b,c){return this.parameterExpression(a,-1,null,!0,!0,b,c,null,null,!1)},"~N,~N,~B");f(d,"parameterExpressionString",function(a,b){return this.parameterExpression(a,b,"",!0,!1,-1,!1,null,null,!1)},"~N,~N");f(d,"parameterExpressionBoolean",
function(a,b){return this.parameterExpression(a,b,null,!0,!1,-1,!1,null,null,!1).booleanValue()},"~N,~N");f(d,"parameterExpressionToken",function(a){a=this.parameterExpressionList(a,-1,!1);return 0<a.size()?a.get(0):JS.SV.newS("")},"~N");f(d,"parameterExpressionSelect",function(a,b){this.st=b;this.slen=this.st.length;return this.parameterExpression(2,-2147483648,null,!0,!1,-1,!1,a,null,!1).booleanValue()},"java.util.Map,~A");f(d,"parameterExpression",function(a,b,c,e,g,d,f,h,l,q){var k=null!=l,m=
null==l&&null!=h,n=0>a,t=!g&&null==c,r=!g&&null!=c&&0==c.length;n&&(a=-a);var v=null==h||-2147483648!=b;b<a&&(b=this.slen);var u=q?0:1,I=-1;c=new JS.ScriptMathProcessor(this,q,f,g,!1,!1,c);var w,E;f=g=0;var C=!0,s=a;a:for(;s<b;s++){w=null;var A=this.getToken(s).tok;if(k&&1073742336!=this.tokAt(s+1)){var D=null!=h&&h.containsKey(this.theToken.value)?null:this.getBitsetPropertySelector(s,10);if(null!=D){c.addX(h.get(l));c.addOpAllowMath(D,268435968==this.tokAt(s+1),0)||this.invArg();if((134320141==
D.intValue||102436==D.intValue)&&268435968!=this.tokAt(this.iToken+1))c.addOp(JS.T.tokenLeftParen),c.addOp(JS.T.tokenRightParen);s=this.iToken;continue}}switch(A){case 268437505:case 1073742338:if(!e&&C)break a;1073742338==A&&this.invArg();q&&(1==g&&268440324==this.tokAt(s+1))&&(q=c.endAssignment())}switch(A){case 12290:if(1073742325==(A=this.tokAt(++s)))w=this.parameterExpressionToken(++s),s=this.iToken;else if(2==A){w=this.vwr.ms.getAtoms(1094715393,Integer.$valueOf(this.st[s].intValue));break}else if(12290==
A&&2==this.tokAt(s+1)){w=this.vwr.ms.getAtomsFromAtomNumberInFrame(this.st[++s].intValue);break}else w=this.getParameter(JS.SV.sValue(this.st[s]),1073742190,!0);w=this.getParameter(w.asString(),1073742190,!0);break;case 134320649:268435968!=this.getToken(++s).tok&&this.invArg();null==h&&(h=new java.util.Hashtable);E=this.parameterExpression(++s,-1,null,e,!1,-1,!1,h,l,!1);D=E.booleanValue();A=this.iToken;1073742339!=this.getToken(A++).tok&&this.invArg();this.parameterExpressionBoolean(A,-1);var y=
this.iToken;1073742339!=this.tokAt(y++)&&this.invArg();this.parameterExpression(-y,-1,null,e,!1,1,!1,h,l,!1);s=this.iToken;268435969!=this.tokAt(s)&&this.invArg();w=this.parameterExpression(D?A:y,D?y:s,"XXX",e,!1,1,!1,h,l,!1);s=this.iToken=s;break;case 134320648:case 1275082241:A=(D=0<a)&&134320648==A;D?((268435968!=this.getToken(++s).tok||!JS.T.tokAttr(this.getToken(++s).tok,1073741824))&&this.invArg(),y=this.paramAsStr(s),1073742339!=this.getToken(++s).tok&&this.invArg()):y="_x";w=this.parameterExpressionToken(-++s).value;
x(w,"JU.BS")||this.invArg();s=this.iToken;D&&1073742339!=this.getToken(s++).tok&&this.invArg();var F=new JU.BS,H=new JU.BS,O=A?Array(w.cardinality()):null;null==h&&(h=new java.util.Hashtable);H.set(0);var P=JS.SV.newV(10,H);P.index=0;h.put(y,P.setName(y));var Q=-1;if(D){Q=s-1;E=0;for(var R;0<=E&&++Q<b;)268435969==(R=this.tokAt(Q))?E--:268435968==R&&E++}var z=0,L=0,N=w.nextSetBit(0);if(0>N||this.chk)this.iToken=Q-1;else for(;0<=N;N=w.nextSetBit(N+1))0<=L&&H.clear(L),L=N,H.set(N),P.index=N,E=this.parameterExpression(s,
Q,A?"XXX":null,e,A,N,!1,h,D?null:y,!1),A?((null==E||0==E.size())&&this.invArg(),O[z++]=E.get(0).asString()):E.booleanValue()&&F.set(N);if(A)w=O;else if(D)w=F;else return this.listBS(F);s=this.iToken+1;break;case 1073742339:break a;case 2:if(1073742336==this.tokAt(this.iToken+1)&&(805307393==(A=this.tokAt(this.iToken+2))||268441089==A))this.theToken.value=Float.$valueOf(this.theToken.intValue),this.theToken.tok=3,this.theToken.intValue=2147483647,s++;case 3:case 1073742362:c.addXNum(this.theToken);
break;case 134217750:if(268435968==this.tokAt(this.iToken+1)){c.addOpAllowMath(this.theToken,!0,0)||this.invArg();break}case 1073742335:case 1073742334:case 4:case 8:case 9:case 11:case 12:case 7:case 10:case 6:case 14:c.addX(JS.SV.newT(this.theToken));break;case 1073742330:if(1073742336==this.tokAt(s+2)&&1275072526==this.tokAt(s+3))c.addXStr("$"+this.paramAsStr(++s));else{this.ignoreError=!0;var K;try{K=this.centerParameter(s,null),c.addX(JS.SV.newV(8,K))}catch(M){if(G(M,Exception))c.addXStr("");
else throw M;}this.ignoreError=!1;s=this.iToken}break;case 1073742332:if(4==this.tokAt(s+1)){if(1073742338==this.tokAt(s+2)){w=this.chk?new JU.BS:this.getAtomBitSet(this.stringParameter(s+1));s+=2;break}w=this.getAssocArray(s)}else w=this.getPointOrPlane(s,55);s=this.iToken;break;case 1073742340:w=this.vwr.getVisibleFrameAtomsNoSplitData();s=this.iToken;break;case 1073742325:if(1073742326==this.tokAt(s+1)){w=new java.util.Hashtable;s++;break}else 1073742327==this.tokAt(s+1)&&1073742326==this.tokAt(s+
2)&&(A=1073742327,this.iToken+=2);case 1073742327:w=1073742327==A?this.vwr.getAllAtoms():this.atomExpression(this.st,s,0,!0,!0,null,!0);s=this.iToken;if(0==f&&n)return this.iToken++,this.listBS(w);break;case 1073742195:c.addOp(this.theToken);continue;case 1073742326:break a;case 268436992:if(!e&&C)break a;c.addOp(this.theToken)||this.invArg();break;case 1073742337:case 1073742336:q&&(C&&268440324==this.tokAt(s+2))&&(q=c.endAssignment());if(0==u&&C)switch(this.tokAt(s+1)){case 0:break;case 1275335685:case 1275334681:case 1140850694:case 1140850706:case 1140850696:case 1275068418:if(1073742336==
A)break;default:c.addOp(JS.T.tokenArrayOpen);c.addXStr(this.optParameterAsString(++s));c.addOp(JS.T.tokenArrayClose);continue}D=this.getBitsetPropertySelector(s+1,c.getXTok());y=D.intValue;s=134320141==y;A=!0;R=this.tokAt(this.iToken+2);if(1073742336==this.tokAt(this.iToken+1))switch(R){case 1073742327:R=480,1073742336==this.tokAt(this.iToken+3)&&1275068420==this.tokAt(this.iToken+4)&&(R=224);case 1275068725:case 32:case 64:case 192:case 128:case 160:case 96:A=s||1275069443==y||480==R||224==R||1275068725==
R,D.intValue|=R&480,this.getToken(this.iToken+2),268435968==this.tokAt(this.iToken+1)&&1275069443!=y&&(this.iToken+=2)}y=this.tokAt(this.iToken+1);A=(new Boolean(A&(268435968==y||s))).valueOf();c.addOpAllowMath(D,A,s?y:0)||this.invArg();s=this.iToken;134320141==D.intValue&&268435968!=y&&(c.addOp(JS.T.tokenLeftParen),c.addOp(JS.T.tokenRightParen));break;case 1153433601:case 1086326786:case 1086326785:case 1073742328:case 1812599299:case 1086326788:case 1073742329:case 1111490587:case 1086326789:case 1086324742:case 1094717454:case 1094713360:case 1073742128:case 134218756:case 1086324744:case 1094713369:case 134218757:case 1237320707:case 1639976963:case 1145047055:if(!m&&
s==I&&268436992==this.tokAt(s+1)){c.addX(JS.SV.newT(this.theToken));break}default:if(268437504==this.theTok&&268436482==this.tokAt(s+2)){w=this.getAssocArray(s);s=this.iToken;break}if(JS.T.tokAttr(this.theTok,268435456)||JS.T.tokAttr(this.theTok,134217728)&&268435968==this.tokAt(this.iToken+1)){if(!c.addOp(this.theToken)){if(0<=d)break a;this.invArg()}switch(this.theTok){case 134217759:I=s+2;break;case 268440324:C&&(u=s);break;case 268435968:f++;C=!1;break;case 268435969:if(0>=--f&&0==g){if(n){this.iToken++;
break a}C=!0}break;case 268437504:g++;C=!1;break;case 268437505:if(0==--g&&0==f){if(n){this.iToken++;break a}C=!0}}}else{D=this.paramAsStr(s).toLowerCase();A=268435968==this.tokAt(s+1);if(!A)if(this.chk)w=D;else if(null==h||null==(w=JU.PT.getMapValueNoCase(h,D))&&v)if(D.startsWith("_")&&(w=D.equals("_")?this.vwr.getModelSetAuxiliaryInfo():D.equals("_m")?this.vwr.getCurrentModelAuxInfo():null),null==w){if(w=this.getContextVariableAsVariable(D,!1),null==w)switch(D){case "all":w=this.vwr.bsA();break;
case "this":w=this.vwr.getFrameAtoms()}}else 0==u&&this.invArg();if(null==w)if(JS.T.tokAttr(this.theTok,1073741824)&&this.isFunction(D))c.addOp(JS.SV.newV(134320141,this.theToken.value))||this.invArg(),A||(c.addOp(JS.T.tokenLeftParen),c.addOp(JS.T.tokenRightParen));else{D=this.vwr.g.getAndSetNewVariable(D,!1);switch(D.tok){case 2:case 3:if(this.noCopy(s,-1)||this.noCopy(s,1))break;c.addXCopy(D);continue}c.addX(D)}}}null!=w&&(x(w,"JU.BS")?c.addXBs(w):c.addXObj(w))}a=c.getResult();null==a&&(this.chk||
c.dumpStacks("null result"),this.error(13));if(135198==a.tok)return q&&0==u?(q=new JU.Lst,q.addLast(new JS.SV),q):a.value;if(this.chk){if(t)return Boolean.TRUE;if(r)return""}else{if(t)return Boolean.$valueOf(a.asBoolean());if(r)return 4==a.tok&&(a.intValue=2147483647),a.asString()}switch(a.tok){case 1073742335:case 1073742334:return Boolean.$valueOf(1==a.intValue);case 2:return Integer.$valueOf(a.intValue);default:return a.value}},"~N,~N,~S,~B,~B,~N,~B,java.util.Map,~S,~B");f(d,"atomExpressionAt",
function(a){this.checkToken(a)||(this.iToken=a,this.bad());return this.atomExpression(this.st,a,0,!0,!1,null,!0)},"~N");f(d,"atomExpression",function(a,b,c,e,g,d){this.isBondSet=!1;a!==this.st&&(this.tempStatement=this.st,this.st=a);var f=new JS.ScriptMathProcessor(this,!1,!1,!1,null==d,g,null),h,l=!1;this.iToken=1E3;var q=0>b,k=!1,m,n=0,t=this.vwr.ms.ac,r=-10;q&&(b=-b);q=(new Boolean(q|this.chk)).valueOf();0==c&&a.length>b&&(c=b+1);a:for(;b<c;++b){this.iToken=b;h=a[b];if(null==h)break;m=h.value;
switch(h.tok){case 1073742325:c=a.length;n++;break;case 1073742326:n--;if(0<n)continue;break a;case 1073742332:if(this.isPoint3f(b)&&(m=this.getPoint3f(b,!0,!0),null!=m)){f.addXPt(m);b=this.iToken;break}break;case 1073742338:0<b&&1073742332==a[b-1].tok&&f.addXBs(new JU.BS);break;case 268437504:k=!0;f.addOp(h);break;case 268437505:k=!1;f.addOp(h);break;case 12290:f.addXBs(this.getAtomBitSet(m));break;case 7:if(m=JS.SV.getBitSet(h,!1),null!=m){f.addXBs(m);break}case 6:f.addXBs(this.vwr.ms.getAtoms(1086324744,
h.asString()));break;case 134219777:f.addX(JS.SV.newT(h));f.addX(JS.SV.newV(9,this.hklParameter(b+2,null,!0,null)));b=this.iToken;break;case 134217750:f.addX(JS.SV.newT(h));f.addX(JS.SV.newV(9,this.planeParameter(b+2,!1)));b=this.iToken;break;case 1073742329:f.addX(JS.SV.newT(h));f.addXPt(this.getPoint3f(b+2,!0,!0));b=this.iToken;break;case 4:switch((0==m.length?"0":m.charAt(0)).charCodeAt(0)){case 40:if(0==m.indexOf("({")&&(m=JU.BS.unescape(m),null!=m)){f.addXBs(m);break}break;case 59:if(m.startsWith(";base90+35,")){f.addXBs(JS.SV.decodeBase90_35(m));
break}default:if(0<=m.indexOf("|")&&r!=b-4){f.addXBs(this.vwr.ms.getAtoms(1086324744,m));break}f.addX(JS.SV.newT(h));m.equals("hkl")&&(f.addX(JS.SV.newV(9,this.hklParameter(b+2,null,!0,null))),b=this.iToken)}break;case 134217759:r=b;case 134218757:case 134218756:case 1237320707:case 134353926:case 134217736:case 268436992:case 1275203608:f.addOp(h);break;case 1073742327:f.addXBs(this.vwr.getAllAtoms());break;case 1073742333:f.addXBs(new JU.BS);break;case 1073742335:case 1073742334:f.addX(JS.SV.newT(h));
break;case 1113589787:f.addXBs(JU.BSUtil.copy(this.vwr.bsA()));break;case 2097194:f.addXBs(JU.BSUtil.copy(this.vwr.slm.getHiddenSet()));break;case 12293:f.addXBs(this.vwr.getMotionFixedAtoms(null,null));break;case 2097192:f.addXBs(JU.BSUtil.copyInvert(this.vwr.slm.getHiddenSet(),t));break;case 2097200:f.addXBs(this.vwr.getBaseModelBitSet());break;case 2097198:f.addXBs(this.chk?new JU.BS:JU.BSUtil.copy(this.vwr.ms.getVisibleSet(!l)));l=!0;break;case 2097190:!this.chk&&e&&this.refresh(!1);f.addXBs(this.chk?
new JU.BS:this.vwr.ms.getClickableSet(!e));e=!1;break;case 1073742356:if(1!=this.vwr.ms.mc||this.vwr.ms.haveBioModels){var v=h.intValue;0<v?(m=this.compareInt(1094713346,268440324,v),2==v&&m.or(this.compareInt(1086326789,268440324,20)),f.addXBs(m)):f.addXBs(this.getAtomBits(h.tok,m))}else f.addXBs(this.lookupIdentifierValue("_"+m));break;case 2097155:case 2097188:case 2097156:case 1612709894:case 1073742331:case 2097166:case 2097165:case 2097168:case 2097170:case 2097172:case 2097174:case 1073742360:case 1073742355:case 2097196:case 1088421903:case 1814695966:f.addXBs(this.getAtomBits(h.tok,
m));break;case 1073742358:case 1073742359:h=h.intValue;if(2147483647==h&&x(m,Integer)){h=m.intValue();if(!this.vwr.haveFileSet()){f.addXBs(this.getAtomBits(1073742358,Integer.$valueOf(h)));break}2147>=h&&(h*=1E6)}f.addXBs(this.bitSetForModelFileNumber(h));break;case 1073742361:case 1073742357:f.addXBs(this.getAtomBits(h.tok,Integer.$valueOf(h.intValue)));break;case 1073742362:k?f.addXNum(h):f.addXBs(this.getAtomBits(1073742362,Integer.$valueOf(JS.ScriptExpr.getSeqCode(h))));break;case 1073742363:if(k){f.addXNum(h);
f.addOp(JS.T.tokenMinus);f.addXNum(a[++b]);break}m=b+3<a.length&&268439552==a[b+2].tok&&1073742357==a[b+3].tok?a[b+3].intValue:-1;f.addXBs(this.getAtomBits(1073742363,O(-1,[JS.ScriptExpr.getSeqCode(h),JS.ScriptExpr.getSeqCode(a[++b]),m])));-1!=m&&(b+=2);break;case 1094713350:case 1094713349:f.addXBs(this.getAtomBits(h.tok,m));break;case 1073742340:case 2097182:f.addXBs(this.vwr.getVisibleFrameAtomsNoSplitData());break;case 1612709900:case 2097154:case 1114249217:case 1612709912:case 136314895:case 2097159:case 2097160:case 2097162:case 2097178:case 2097180:f.addXBs(this.lookupIdentifierValue(m));
break;case 268440323:case 268440322:case 268440321:case 268440320:case 268440324:case 268440325:case 268440326:case 268440327:v=h.tok;h=h.intValue;1094717448==h&&268440324!=v&&this.invArg();var u=null;if(1715472409==h&&(b+2==a.length&&this.invArg(),!this.chk)){var u=a[++b].myName,G=u.startsWith("property_dssr.")?4:1,u=this.vwr.getDataObj(u,null,G);if(null==u)return new JU.BS}++b==a.length&&this.invArg();f.addXBs(this.chk?new JU.BS:this.getComparison(a[b],h,v,m,u));break;case 3:case 2:f.addXNum(h);
break;case 10:m=x(m,"JM.BondSet")?m:JU.BSUtil.copy(m);f.addXBs(m);break;case 8:f.addXPt(m);break;default:if(JS.T.tokAttr(h.tok,268435456)){f.addOp(h)||this.invArg();break}if("string"!=typeof m){f.addXObj(m);break}h=this.getParameter(m,0,!0);if(k){f.addXObj(h);break}if("string"==typeof h||x(h,"JU.Lst"))h=this.getStringObjectAsVariable(h);"string"==typeof h&&(h=this.lookupIdentifierValue(m));f.addXObj(h)}}a=f.getResult();if(null==a){if(g)return null;this.chk||f.dumpStacks("after getResult");this.error(13)}g=
a.value;if("string"==typeof g&&(null==d||g.startsWith("({")))g=this.chk?new JU.BS:this.getAtomBitSet(g);if(null!=d&&!x(g,"JU.BS"))return d[0]=g,null;m=x(g,"JU.BS")?g:new JU.BS;this.isBondSet=x(g,"JM.BondSet");!this.isBondSet&&(m=this.vwr.slm.excludeAtoms(m,q)).length()>this.vwr.ms.ac&&m.clearAll();null!=this.tempStatement&&(this.st=this.tempStatement,this.tempStatement=null);return m},"~A,~N,~N,~B,~B,~A,~B");f(d,"getComparison",function(a,b,c,e,g){var d=a.tok;if(7==d){d=new JU.BS;268440324!=c&&d.setBits(0,
this.vwr.ms.ac);a=a.getList();for(var f=a.size();0<=--f;){var h=this.getComparison(a.get(f),b,c,e,g);268440324==c?d.or(h):d.and(h)}return d}var l=a.value,q=a.intValue,f=NaN,h=1094717454==b,k,m,n,t;m=x(g,"JM.ModelSet.DataList")?g:null;if(null!=m)g=m.getData(),k=!1,m=m.isFloat(),n=!m,m?f="string"==typeof l?JU.PT.parseFloat(l):l.floatValue():"string"!=typeof l&&(l=l.toString());else{k=JS.T.tokAttr(b,1094713344);m=JS.T.tokAttr(b,1111490560)||1077936128==(b&1136656384);t=k&&m;n=!k&&JS.T.tokAttr(b,1086324736);
1086326789==b&&(k=!(n=!1));if(JS.T.tokAttr(d,1073741824))if("_modelNumber".equalsIgnoreCase(l))l=this.vwr.am.cmi,l=Integer.$valueOf(q=0>l?0:this.vwr.getModelFileNumber(l));else{var r=this.getParameter(l,1073742190,!1);if(null!=r){if(7==r.tok)return this.getComparison(r,b,c,e,g);q=r.intValue;l=n||1094717448==b&&2!=r.tok?JS.SV.sValue(r):JS.SV.nValue(r);a=r}}x(l,"JU.P3")?1765808134==b&&(q=JU.CU.colorPtToFFRGB(l),d=2,k=!0):"string"==typeof l&&(1765808134==b?(q=JU.CU.getArgbFromString(l),0==q&&JS.T.tokAttr(d,
1073741824)&&(l=this.getVarParameter(l,!0),l.startsWith("{")?(l=JU.Escape.uP(l),q=x(l,"JU.P3")?JU.CU.colorPtToFFRGB(l):0):q=JU.CU.getArgbFromString(l)),d=2,k=!0):n||(1094717448==b?l=Integer.$valueOf(2==a.tok?a.intValue:-1E3-(l+" ").codePointAt(0)):1639976963==b||1237320707==b||1086326789==b?n=!(k=2147483647!=q):l=JS.SV.nValue(a),x(l,Integer)?f=q=l.intValue():x(l,Float)&&h&&(q=JM.ModelSet.modelFileNumberFromFloat(l.floatValue()))));n&&"string"!=typeof l&&(l=""+l);x(l,Integer)||2==d?h?1E6<=q&&(b=-1094717454):
t||m&&(f=q):x(l,Float)||x(l,Double)?h?b=-1094717454:(f=l.floatValue(),t?k=!1:k&&(q=I(f))):n||(this.iToken++,this.invArg());h&&(1E6<=q&&0==q%1E6)&&(q/=1E6,b=1228935687);if(-1094717454==b&&268440324==c)return this.bitSetForModelFileNumber(q);null!=e&&0<=e.indexOf("-")&&(k?q=-q:Float.isNaN(f)||(f=-f))}return k?this.compareInt(b,c,q):n||268440326==c||268440327==c?this.compareString(b,g,c,l):this.compareFloatData(b,g,c,f)},"JS.T,~N,~N,~S,~O");f(d,"noCopy",function(a,b){switch(this.tokAt(a+b)){case 268441602:case 268441601:return-1==
this.st[a+b].intValue==(-1==b);default:return!1}},"~N,~N");f(d,"getAssocArray",function(a){var b=new java.util.Hashtable,c=1073742332==this.tokAt(a)?1073742338:268437505;for(a+=1;a<this.slen&&this.tokAt(a)!=c;a++){var e=null;x(this.st[a],"JS.SV")&&(e=this.st[a].myName);null==e&&(e=JS.SV.sValue(this.st[a]));a++;268436482!=this.tokAt(a++)&&this.invArg();a=this.parameterExpression(a,0,null,!1,!0,-1,!1,null,null,!1);0==a.size()&&this.invArg();b.put(e,JS.SV.copySafely(a.get(0)));a=this.iToken;if(268436992!=
this.tokAt(a))break}this.iToken=a;this.tokAt(a)!=c&&this.invArg();return b},"~N");f(d,"listBS",function(a){var b=new JU.Lst;b.addLast(JS.SV.newV(10,a));return b},"JU.BS");f(d,"compareFloatData",function(a,b,c,e){var g=new JU.BS,d=this.vwr.ms.ac,f=this.vwr.ms.at,h=0;this.vwr.autoCalculate(a,null);var l=1715472409==a;!l&&null==this.ptTemp&&(this.ptTemp=new JU.P3);for(;0<=--d;)if(h=!1,h=f[d],!JM.AtomCollection.isDeleted(h)){if(l){if(null==b||b.length<=d)continue;h=b[d]}else h=h.atomPropertyFloat(this.vwr,
a,this.ptTemp);(h=this.compareFloat(c,h,e))&&g.set(d)}return g},"~N,~A,~N,~N");f(d,"compareFloat",function(a,b,c){if(b==b!=(c==c))return 268440325==a;switch(a){case 268440323:return b<c;case 268440322:return b<=c||b!=b;case 268440321:return b>=c||b!=b;case 268440320:return b>c;case 268440324:return b==c||b!=b;case 268440325:return b!=c&&b==b}return!1},"~N,~N,~N");f(d,"compareString",function(a,b,c,e){var g=new JU.BS,d=this.vwr.ms.at,f=this.vwr.ms.ac,h=268440326==c||268440327==c||1086326788==a&&this.vwr.getBoolean(603979822);
h||(e=e.toLowerCase());var l=1715472409==a,q=null;if(l&&null!=b){if(!JU.AU.isAS(b))return g;q=b}for(b=f;0<=--b;)if(null!=d[b]){if(l){if(null==q||q.length<=b)continue;f=q[b];if(null==f)continue}else f=d[b].atomPropertyString(this.vwr,a);h||(f=f.toLowerCase());this.compareStringValues(c,f,e)&&g.set(b)}return g},"~N,~O,~N,~S");f(d,"compareStringValues",function(a,b,c){switch(a){case 268440324:case 268440325:return JU.PT.isMatch(b,c,!0,!0)==(268440324==a);case 268440326:return JU.PT.isLike(b,c);case 268440327:return b.contains(c);
default:this.invArg()}return!1},"~N,~S,~S");f(d,"compareInt",function(a,b,c){var e=2147483647,g=null,d=b,f=c,h=this.vwr.ms,l=h.at,q=h.ac,k=-1,m=0,n=-1,r=null,x=0,v;switch(a){case 1296041986:switch(d){case 268440321:case 268440320:k=2147483647}break;case 1094713347:try{switch(b){case 268440323:return JU.BSUtil.newBitSet2(0,c);case 268440322:return JU.BSUtil.newBitSet2(0,c+1);case 268440321:return JU.BSUtil.newBitSet2(c,q);case 268440320:return JU.BSUtil.newBitSet2(c+1,q);case 268440324:return c<q?
JU.BSUtil.newBitSet2(c,c+1):new JU.BS;default:return v=JU.BSUtil.setAll(q),0<=c&&v.clear(c),v}}catch(u){if(G(u,Exception))return new JU.BS;throw u;}}v=JU.BS.newN(q);for(var H=0;H<q;++H){var w=!1,E=l[H];if(!JM.AtomCollection.isDeleted(E)){switch(a){default:e=E.atomPropertyInt(this.vwr,a);break;case 1094713371:case 1094717448:return JU.BSUtil.copy(this.vwr.ms.getConformation(-1,c,!1,null));case 1296041986:g=E.atomSymmetry;if(null==g)continue;E.mi!=n&&(n=E.mi,r=h.getModelCellRange(n),x=h.getModelSymmetryCount(n));
if(200<=f){if(null==r)continue;c=f%1E3;var C=T(f/1E3)-1;if(0>C)w=!0;else if(0==x||0<=C&&!(w=g.get(C)))continue;d=1073742333;e=0>C?E.getCellTranslation(c,r,x):E.getSymmetryTranslation(C,r,x)}else if(0<x){if(c>x&&268440323!=d&&268440322!=d)continue;if(268440325==d){0<c&&(c<=x&&!g.get(c))&&v.set(H);continue}g=JU.BSUtil.copy(g);g.clearBits(x,g.length())}switch(d){case 268440323:k=c-1;break;case 268440322:k=c;break;case 268440321:m=c-1;break;case 268440320:m=c;break;case 268440324:k=c;m=c-1;break;case 268440325:w=
!g.get(c)}0>m&&(m=0);m<k&&(g=g.nextSetBit(m),0<=g&&g<k&&(w=!0));if(!w||2147483647==e)b=1073742333}switch(b){case 268440323:w=e<c;break;case 268440322:w=e<=c;break;case 268440321:w=e>=c;break;case 268440320:w=e>c;break;case 268440324:w=e==c;break;case 268440325:w=e!=c}w&&v.set(H)}}return v},"~N,~N,~N");f(d,"getBitsetPropertySelector",function(a,b){var c=this.getToken(a).tok;switch(c){case 1275068725:case 32:case 64:case 96:case 192:case 128:case 160:case 1715472409:break;default:if(JS.T.tokAttrOr(c,
1077936128,1140850688)||6==b)break;if(805307393!=c&&!JS.T.tokAttr(c,1073741824))break;var e=this.paramAsStr(a);this.isFunction(e.toLowerCase())&&(c=134320141)}return JS.SV.newSV(268442113,c,this.paramAsStr(a))},"~N,~N");f(d,"getBitsetPropertyFloat",function(a,b,c,e,g){b=null==c||1086325010==b||1145047311==b||1111490843==b?this.getBitsetProperty(a,null,b,null,null,c,null,!1,2147483647,!1):this.vwr.getDataObj(c,a,1);if(null==b||!JU.AU.isAF(b))return null==a?null:Q(a.cardinality(),0);if(!Float.isNaN(e))for(a=
0;a<b.length;a++)b[a]<e&&(b[a]=NaN);if(!Float.isNaN(g))for(a=0;a<b.length;a++)b[a]>g&&(b[a]=NaN);return b},"JU.BS,~N,~S,~N,~N");f(d,"getBitsetProperty",function(a,b,c,e,g,d,f,h,l,q){var k=2147483647!=l,m=k||!x(d,"JM.BondSet")&&!x(a,"JM.BondSet"),n=c&480,r=224==n,B=288==n;B&&(n=480);var v=this.vwr.ms.ac,u=256==n?Q(v,0):null,G=480==n||r;c&=-481;var w=null;0==c&&(c=m?1153433601:1677721602);var E=!1,C=!1,s=!1,A=!1;switch(c){case 1275068446:return this.vwr.getModelSetAuxiliaryInfoForAtoms(a).get("models");
case 1145047049:case 1145047055:case 1145047050:case 1145047053:case 1145045008:case 1145045006:case 1765808134:case 1145047052:E=!0;break;case 1275203608:C=!0;w=P(-1,[null,null]);break;case 134320141:case 1275069443:break;case 1145045003:A=!0;break;case 1086324754:s="color"===d;A=!s;break;default:s=JS.T.tokAttr(c,1094713344)&&!JS.T.tokAttr(c,1111490560),A=!s&&JS.T.tokAttr(c,1086324736)}var D=E||!m?new JU.P3:null;if(G||A&&!k&&256!=n&&32!=n)n=1073742327;var y=1073742327==n?new JU.Lst:null,F=null,H=
F=null,I=null,O=null,L=null,R=null,z=null;switch(c){case 1153433601:if(m)break;case 1677721602:if(this.chk)return a;F=1153433601==c?this.vwr.ms.getAtoms(1677721602,a):m?JM.BondSet.newBS(this.vwr.getBondsForSelectedAtoms(a)):a;switch(n){case 32:l=F.nextSetBit(0);break;case 64:l=F.length()-1;break;case 192:case 128:case 160:return Float.$valueOf(NaN);default:return F}F.clearAll();0<=l&&F.set(l);return F;case 1086324745:switch(n){case 0:case 32:case 1073742327:return this.getCmdExt().getBitsetIdent(a,
null,d,h,l,G)}return"";case 134320141:F=f[0];H=f[1];I=JU.BS.newN(v);O=JS.SV.newV(10,I);break;case 1111490574:case 1111490575:this.vwr.autoCalculate(c,d);break;case 1275069443:if(null==e&&null==g)return new JU.P3;break;case 1765808134:L=new JU.P3;break;case 1111490587:R=this.vwr.getDataObj(f,null,4);break;case 1715472409:R=this.vwr.getDataObj(f,null,1),null==R&&(z=this.vwr.getDataObj(f,null,2)),null!=z&&(n=1073742327,y=new JU.Lst)}var K=h=f=0,N=0,M=0;switch(n){case 32:h=2147483647;K=3.4028235E38;break;
case 64:h=-2147483648,K=-3.4028235E38}var S=this.vwr.ms;d=null!=z?5:C?4:E?3:A?2:s?1:0;if(m){L=null!=a;null!=b?(m=0,v=b.size()):k?(m=l,v=l+1):L?(m=a.nextSetBit(0),v=Math.min(v,a.length())):m=0;this.chk&&(v=0);for(l=m;0<=l&&l<v;l=L?a.nextSetBit(l+1):l+1){f++;var U;if(null==b){if(U=S.at[l],JM.AtomCollection.isDeleted(U))continue}else U=null;switch(d){case 0:m=3.4028235E38;switch(c){case 134320141:I.set(l);m=JS.SV.fValue(this.getUserFunctionResult(F,H,O));I.clear(l);break;case 1715472409:m=null==R||l>=
R.length?0:R[l];break;case 1275069443:m=null!=g?JU.Measure.distanceToPlane(g,U):null!=b?JS.SV.ptValue(b.get(l)).distance(e):U!==e||32!=n?U.distance(e):NaN;break;default:m=U.atomPropertyFloat(this.vwr,c,this.ptTemp)}if(3.4028235E38==m||Float.isNaN(m)&&1073742327!=n){f--;continue}switch(n){case 32:m<K&&(K=m);break;case 64:m>K&&(K=m);break;case 256:u[l]=m;break;case 1073742327:y.addLast(Float.$valueOf(m));break;case 160:case 192:M+=m*m;default:N+=m}break;case 1:m=0;switch(c){case 1094717448:case 1094713349:this.errorStr(45,
JS.T.nameOf(c));break;case 1086324754:m=U.getWyckoffPosition(!1).charAt(0).charCodeAt(0);switch(m){case 63:m=0;break;case 65:m=27;break;default:m&=31}break;default:m=U.atomPropertyInt(this.vwr,c)}switch(n){case 32:m<h&&(h=m);break;case 64:m>h&&(h=m);break;case 256:u[l]=m;break;case 1073742327:y.addLast(Integer.$valueOf(m));break;case 160:case 192:M+=m*m;default:N+=m}break;case 2:m=U.atomPropertyString(this.vwr,c);switch(n){case 256:u[l]=JU.PT.parseFloat(m);break;default:if(null==y)return m;y.addLast(m)}break;
case 3:m=U.atomPropertyTuple(this.vwr,c,this.ptTemp);switch(n){case 256:1145047055==c&&(null!=m&&null!=D)&&(null==this.ptTemp&&(this.ptTemp=new JU.P3),this.ptTemp.set(0.91,-0.41,1));u[l]=null==D?-1:null==m?0:1145047055==c?m.dot(this.ptTemp):m.length();break;case 1073742327:y.addLast(null==m?Integer.$valueOf(-1):JU.P3.newP(m));break;default:null==m?f--:D.add(m)}break;case 4:switch(c){case 1275203608:if(w[0]=Integer.$valueOf(l),w[1]="",this.vwr.shm.getShapePropertyData(21,"info",w),null!=w[1]){if(null==
y)return w[1];y.addLast(w[1])}}break;case 5:y.addLast(z[l])}if(k)break}}else{m=(b=null==a)?0:a.nextSetBit(0);v=this.vwr.ms.bondCount;for(l=m;0<=l&&l<v;l=b?l+1:a.nextSetBit(l+1))if(e=S.bo[l],null!=e)switch(f++,c){case 1275068435:m=e.atom1.distance(e.atom2);switch(n){case 32:m<K&&(K=m);break;case 64:m>K&&(K=m);break;case 1073742327:y.addLast(Float.$valueOf(m));break;case 160:case 192:M+=m*m;default:N+=m}break;case 1145047049:switch(n){case 1073742327:D.ave(e.atom1,e.atom2);y.addLast(JU.P3.newP(D));
break;default:D.add(e.atom1),D.add(e.atom2),f++}break;case 1765808134:JU.CU.colorPtFromInt(this.vwr.gdata.getColorArgbOrGray(e.colix),L);switch(n){case 1073742327:y.addLast(JU.P3.newP(L));break;default:D.add(L)}break;default:this.errorStr(46,JS.T.nameOf(c))}}if(256==n)return u;if(1073742327==n){if(q)return B?this.getMathExt().getMinMax(y,1275068725,!1):y;a=y.size();if((A||C)&&!G&&1==a)return y.get(0);if(r){u=Q(a,0);for(l=a;0<=--l;)switch(c=y.get(l),d){case 0:u[l]=c.floatValue();break;case 1:u[l]=
c.floatValue();break;case 2:u[l]=JU.PT.parseFloat(c);break;case 3:u[l]=null==c?-1:c.length()}return u}if(1086324744==c){u=new JU.SB;for(l=0;l<a;l++)u.append(y.get(l));return u.toString()}u=Array(a);for(l=a;0<=--l;)c=y.get(l),u[l]=x(c,"JU.P3")?JU.Escape.eP(c):""+y.get(l);return u}if(E)return 0==f?Integer.$valueOf(-1):JU.P3.new3(D.x/f,D.y/f,D.z/f);if(C)return new java.util.Hashtable;if(0==f||1==f&&192==n)return Float.$valueOf(NaN);if(s)switch(n){case 32:case 64:return Integer.$valueOf(h);case 160:case 192:break;
case 128:return Integer.$valueOf(T(N));default:return N/f==T(N/f)?Integer.$valueOf(T(N/f)):Float.$valueOf(N/f)}switch(n){case 32:case 64:N=K;break;case 128:break;case 160:N=M;break;case 192:N=Math.sqrt((M-N*N/f)/(f-1));break;default:N/=f}return Float.$valueOf(N)},"JU.BS,JU.Lst,~N,JU.P3,JU.P4,~O,~O,~B,~N,~B");f(d,"bitSetForModelFileNumber",function(a){var b=JU.BS.newN(this.vwr.ms.ac);if(this.chk)return b;var c=this.vwr.ms.mc,e=this.vwr.haveFileSet();1E6>a&&e&&(a*=1E6);if(0==a%1E6){e=this.vwr.ms.getModelNumberIndex(a+
1,!1,!1);if(0>e)return b;a=0==a?c:this.vwr.ms.getModelNumberIndex(a+1000001,!1,!1);0>e&&(e=0);0>a&&(a=c);this.vwr.ms.isTrajectory(e)&&(a=e+1);for(c=e;c<a;c++)b.or(this.vwr.getModelUndeletedAtomsBitSet(c))}else c=this.vwr.ms.getModelNumberIndex(a,!1,!0),0<=c&&b.or(this.vwr.getModelUndeletedAtomsBitSet(c));return b},"~N");f(d,"getStringObjectAsVariable",function(a){if(null==a)return a;if("string"==typeof a)return 0==a.length?a:JS.SV.unescapePointOrBitsetAsVariable(a);if(0==a.size())return"";var b=a.get(0);
if(null!=JS.SV.ptValue(b))return a;if(a.get(0).asString().contains("|"))return this.vwr.ms.getAtoms(1086324744,JS.SV.newV(7,a).asString());a=JS.SV.unEscapeBitSetArray(a,!0);return null==a?"":a},"~O");f(d,"getAtomBits",function(a,b){return this.chk?new JU.BS:this.vwr.ms.getAtoms(a,b)},"~N,~O");d.getSeqCode=f(d,"getSeqCode",function(a){return 2147483647==a.intValue?a.value.intValue():JM.Group.getSeqcodeFor(a.intValue," ")},"JS.T");f(d,"setVariable",function(a,b,c,e){var g=null,d="",g=c.startsWith("property_"),
f=c.equals("thrown_value"),d=1073742325==this.tokAt(1)||268435968==this.tokAt(1),h=g?null:0==c.length?new JS.SV:this.getContextVariableAsVariable(c,!1);if(e&&!d)switch(this.tokAt(2)){default:a=2;break;case 268440324:a=3;break;case 1073742195:case 268437504:if(61==this.st[0].intValue){a=2;break}case 1073742336:case 1073742337:c=null}d=0;e=this.parameterExpression(a,b,c,!0,!0,-1,!1,null,null,e&&1==a);d=e.size();0==d&&this.invArg();if(this.chk||0==e.get(0).tok)return null;b=JS.SV.selectItemVar(JS.SV.copySafely(e.get(d-
1)));if(1<d){c=2<d?e.get(1):null;h=e.get(0);e=!1;switch(h.tok){case 6:case 14:3<d&&this.invArg();h.mapPut(c.asString(),b);break;case 7:d>2+(null==c?0:1)&&this.invArg();null==c?c=h:h=JS.SV.selectItemVar(h);e=!0;break;case 4:if(2!=c.tok){h.value=JU.PT.rep(h.asString(),c.asString(),b.asString());h.intValue=2147483647;break}case 11:case 12:2147483647==h.intValue?e=!0:h.setSelectedValue(h.intValue,c.asInt(),b);break;case 8:a=h.value=JU.P3.newP(h.value);g=b.asFloat();switch(JS.T.getTokFromName(c.asString())){case 1111492629:a.x=
g;break;case 1111492630:a.y=g;break;case 1111492631:a.z=g}break;case 10:var g=JS.SV.getBitSet(h,!0),f=this.vwr.ms.ac,l=g.cardinality(),d=c.asString(),q=JS.T.getTokFromName(d);switch(q){case 0:if(d.startsWith("property_")){7==b.tok?(a=b.getList().size()==l?l:f,a=1<JS.SV.getArrayDepth(b)?JS.SV.fflistValue(b,a):JS.SV.flistValue(b,a)):a=b.asString();this.vwr.setData(d,P(-1,[d,a,JU.BSUtil.copy(g),Integer.$valueOf(-1)]),f,0,0,7==b.tok?2147483647:-2147483648,0);break}this.iToken=a;this.error(56);break;case 1825200146:case 1287653388:this.vwr.shm.loadShape(5);
default:this.setBitsetProperty(g,q,b.asInt(),b.asFloat(),b)}}e&&h.setSelectedValue(c.intValue,2147483647,b);return null}if(!g&&(null==h&&(f||!("string"==typeof b.value||2==b.tok||x(b.value,Integer)||x(b.value,Float)||x(b.value,Boolean))))&&null!=c)(c.startsWith("_")||null==(h=this.vwr.g.getAndSetNewVariable(c,!0)))&&this.errorStr(22,c);if(null!=h)return h.setv(b);h=JS.SV.oValue(b);if(g)return 7==b.tok&&(h=b.asString()),this.vwr.setData(c,P(-1,[c,""+h,JU.BSUtil.copy(this.vwr.bsA()),Integer.$valueOf(0)]),
this.vwr.ms.ac,0,0,-2147483648,0),null;x(h,Boolean)?this.setBooleanProperty(c,h.booleanValue()):x(h,Integer)?this.setIntProperty(c,h.intValue()):x(h,Float)?this.setFloatProperty(c,h.floatValue()):"string"==typeof h&&this.setStringProperty(c,h);return b},"~N,~N,~S,~B");f(d,"setBitsetProperty",function(a,b,c,e,g){if(!this.chk&&!a.isEmpty()){var d=null,f=null,h=null,l,q=null;l=0;var k=JS.T.tokAttr(b,1086324736);if(7==g.tok&&(q=g.getList(),0==(l=q.size())))return;switch(b){case 1145047049:case 1145047050:case 1145047053:case 1145047055:switch(g.tok){case 8:this.vwr.setAtomCoords(a,
b,g.value);break;case 7:this.theToken=g,this.vwr.setAtomCoords(a,b,this.getPointArray(-1,l,!0,!0))}return;case 1765808134:var m=null;b="color";switch(g.tok){case 7:g=O(l,0);for(m=l;0<=--m;)b=q.get(m),l=JS.SV.ptValue(b),null!=l?g[m]=JU.CU.colorPtToFFRGB(l):2==b.tok?g[m]=b.intValue:(g[m]=JU.CU.getArgbFromString(b.asString()),0==g[m]&&(g[m]=b.asInt())),0==g[m]&&this.errorStr2(50,"ARRAY",b.asString());m=g;b="colorValues";break;case 8:m=Integer.$valueOf(JU.CU.colorPtToFFRGB(g.value));break;case 4:m=g.value;
break;default:m=Integer.$valueOf(JS.SV.iValue(g))}this.setAtomProp(b,m,a);return;case 1825200146:case 1287653388:7!=g.tok&&(f=JS.SV.sValue(g));break;case 1086326789:case 1094715402:this.clearDefinedVariableAtomSets(),k=!1}switch(g.tok){case 7:k?d=JS.SV.strListValue(g):h=JS.SV.flistValue(g,l);break;case 4:null==f&&(d=JU.PT.getTokens(JS.SV.sValue(g)))}if(null!=d){l=d.length;if(!k){h=Q(l,0);for(m=l;0<=--m;)h[m]=1086326789==b?JU.Elements.elementNumberFromSymbol(d[m],!1):JU.PT.parseFloat(d[m])}7!=g.tok&&
1==l&&(k?f=d[0]:e=h[0],c=I(e),h=d=null)}JS.T.tokAttr(b,2048)||this.error(56);this.vwr.setAtomProperty(a,b,c,e,f,h,d)}},"JU.BS,~N,~N,~N,JS.T");f(d,"setStatement",function(a,b){this.st=a;this.slen=this.st.length;if(0==this.slen)return!0;var c,e,g;for(e=b;e<this.slen;e++){if(null==this.st[e])return this.slen=e,!0;if(12290==this.st[e].tok)break}if(e==this.slen||this.chk)return e==this.slen;switch(this.st[0].tok){case 102436:case 134320141:case 1073741824:if(268435968==this.tokAt(1))return!0}c=Array(this.slen);
c[0]=this.st[0];var d=!1,f=b;for(e=b;e<this.slen;e++)if(null!=this.st[e]){switch(g=this.getToken(e).tok){default:c[f]=this.st[e];break;case 1073742325:case 1073742326:d=1073742325==g;c[f]=this.st[e];break;case 12290:++e==this.slen&&this.invArg();var h,l=1073741984==this.st[e-2].tok||4==this.theToken.intValue,q=this.paramAsStr(e),k=1073742325==this.tokAt(e),m=1==b&&1==f&&this.st[0]===JS.T.tokenSetCmd;if(k){e=this.parameterExpressionToken(++e);if(this.chk)h=null;else if(7!=e.tok)h=JS.SV.oValue(e);else if(d)if(g=
JS.SV.getBitSet(e,!0),null==g){var n=JS.SV.sValue(e);h=0>n.indexOf("|")?this.getAtomBitSet(n):n}else h=g;else h=e;e=this.iToken}else this.chk?h=new JU.BS:(h=2==this.tokAt(e)?this.vwr.ms.getAtoms(1094715393,Integer.$valueOf(this.st[e].intValue)):12290==this.tokAt(e)&&2==this.tokAt(e+1)?this.vwr.ms.getAtomsFromAtomNumberInFrame(this.st[++e].intValue):this.getParameter(q,0,!0),!d&&!m&&(k=!0));g=this.tokAt(0);l=(new Boolean(l|(JS.T.tokAttr(g,20480)||134222850==g))).valueOf();if(null==h)c[f]=JS.T.tokenAll;
else if(x(h,"JS.SV"))c[f]=h;else if(x(h,Boolean))c[f]=h.booleanValue()?JS.T.tokenOn:JS.T.tokenOff;else if(x(h,Integer))c[f]=JS.T.tv(2,h.intValue(),h);else if(x(h,Float))c[f]=JS.T.tv(3,JU.Edge.getFloatEncodedInt(""+h),h);else if("string"==typeof h){if(!l&&!d){if((36867!=g||1<f&&537022465!=this.st[1].tok&&!"labelfor".equalsIgnoreCase(this.st[1].value.toString()))&&JS.T.tokAttr(g,36864))h=this.getParameter(h,1073742190,!0);"string"==typeof h&&(h=this.getStringObjectAsVariable(h))}x(h,"JS.SV")?c[f]=h:
x(h,"JU.BS")?c[f]=JS.T.o(10,h):(g=h,d&&!l?c[f]=0<=g.indexOf("|")||JS.T.tokAttr(c[f-1].tok,268435712)?JS.T.o(4,g):JS.T.o(10,this.getAtomBitSet(g)):(g=m?JS.T.getTokFromName(g):k||l||0==g.length||0<=g.indexOf(".")||0<=g.indexOf(" ")||0<=g.indexOf("=")||0<=g.indexOf(";")||0<=g.indexOf("[")||0<=g.indexOf("{")?4:1073741824,c[f]=JS.T.o(g,h)))}else if(x(h,"JU.BArray"))c[f]=JS.SV.newV(15,h);else if(x(h,"JU.BS"))c[f]=JS.SV.newV(10,h);else if(x(h,"JU.P3"))c[f]=JS.SV.newV(8,h);else if(x(h,"JU.P4"))c[f]=JS.SV.newV(9,
h);else if(x(h,"JU.M34"))c[f]=JS.SV.newV(x(h,"JU.M4")?12:11,h);else if(x(h,"java.util.Map")||x(h,"JS.ScriptContext")&&null!=(h=h.getFullMap()))c[f]=JS.SV.newV(6,d?h:JS.SV.deepCopy(h,!0,!0));else if(x(h,"JU.Lst")){if(!d){c[f]=JS.SV.newV(7,JS.SV.deepCopy(h,!1,!0));break}n=h;g=null;for(l=0;l<n.size();l++){k=n.get(l);if(10!=k.tok){g=null;break}null==g&&(g=new JU.BS);g.or(k.value)}c[f]=null==g?JS.SV.getVariable(h):JS.T.o(10,g)}else h=this.getObjectCenter(q,-2147483648,-2147483648),null==h&&this.invArg(),
c[f]=JS.T.o(8,h);m&&!JS.T.tokAttr(c[f].tok,536870912)&&this.invArg()}f++}this.st=c;for(e=f;e<this.st.length;e++)this.st[e]=null;this.slen=f;return!0},"~A,~N");f(d,"isFunction",function(a){return null!=this.getFunction(a)},"~S");f(d,"addFunction",function(a){null==a||a.isPrivate?(null==this.privateFuncs&&(this.privateFuncs=new java.util.Hashtable),null!=a&&this.privateFuncs.put(a.name,a)):this.vwr.addFunction(a)},"JS.ScriptFunction");f(d,"getFunction",function(a){var b=null==this.privateFuncs?null:
this.privateFuncs.get(a);return null==b?this.vwr.getFunction(a):b},"~S")});H("JS");L(null,"JS.ScriptFlowContext",["JS.ScriptCompiler"],function(){var d=M(function(){this.token=this.compiler=null;this.ptDefault=this.pt0=0;this.parent=this.$var=this.$function=null;this.ptCommand=this.ptLine=this.commandStart=this.lineStart=0;this.forceEndIf=!0;this.ident=null;this.line0=this.ichCommand=this.tok0=this.addLine=0;K(this,arguments)},JS,"ScriptFlowContext",null);S(d,function(a,b,c,e,g,d){this.compiler=a;
this.token=b;this.tok0=b.tok;this.ident=b.value;this.pt0=c;this.line0=d;this.parent=e;this.ichCommand=g;this.lineStart=this.ptLine=this.compiler.lineCurrent;this.commandStart=this.ptCommand=this.compiler.iCommand},"JS.ScriptCompiler,JS.ContextToken,~N,JS.ScriptFlowContext,~N,~N");f(d,"getBreakableContext",function(a){for(var b=this;null!=b&&(!JS.ScriptCompiler.isBreakableContext(b.token.tok)||0<a--);)b=b.parent;return b},"~N");f(d,"checkForceEndIf",function(a){this.ptCommand==this.compiler.iCommand&&
0<this.addLine&&this.addLine++;if(a=this.forceEndIf&&this.ptCommand<this.compiler.iCommand&&this.ptLine+(0==this.addLine?0:this.addLine+a)==this.compiler.lineCurrent)this.forceEndIf=!1;return a},"~N");f(d,"setPt0",function(a,b){this.pt0=a;b&&(this.ptDefault=a);this.setLine();return a},"~N,~B");f(d,"setLine",function(){this.ptLine=this.compiler.lineCurrent;this.ptCommand=this.compiler.iCommand+1});r(d,"toString",function(){return"ident "+this.ident+" line "+this.lineStart+" command "+this.commandStart});
f(d,"path",function(){for(var a="",b=this;null!=b;)a=b.ident+"-"+a,b=b.parent;return"["+a+"]"});f(d,"setFunction",function(a){this.$function=a},"JS.ScriptFunction")});H("JS");L(["J.api.JmolScriptFunction","java.util.Hashtable","JU.Lst"],"JS.ScriptFunction",["JU.AU","$.SB","JS.SV","$.T"],function(){var d=M(function(){this.chpt0=this.pt0=0;this.cmdpt0=-1;this.name=this.typeName=null;this.nParameters=0;this.names=null;this.tok=0;this.script=this.lineNumbers=this.lineIndices=this.aatoken=this.returnValue=
this.variables=null;this.isPrivate=!1;K(this,arguments)},JS,"ScriptFunction",null,J.api.JmolScriptFunction);X(d,function(){this.names=new JU.Lst;this.variables=new java.util.Hashtable});S(d,function(){});S(d,function(a,b){this.set(a,b);this.typeName=JS.T.nameOf(b)},"~S,~N");f(d,"isVariable",function(a){return this.variables.containsKey(a)},"~S");f(d,"set",function(a,b){this.name=a;this.tok=b},"~S,~N");f(d,"setVariables",function(a,b){for(var c=null==b?0:b.size(),e=this.names.size();0<=--e;){var g=
this.names.get(e).toLowerCase(),d=e<this.nParameters&&e<c?b.get(e):null;null!=d&&7!=d.tok&&(d=JS.SV.newT(d));a.put(g,null==d?JS.SV.newS("").setName(g):d)}364558!=this.tok&&(a.put("_argcount",JS.SV.newI(null==b?0:b.size())),a.put("_arguments",null==b?JS.SV.getVariableAI(O(-1,[])):JS.SV.getVariableList(b)));a.put("_retval",JS.SV.newI(364558==this.tok?2147483647:0))},"java.util.Map,JU.Lst");f(d,"unsetVariables",function(a,b){var c=null==b?0:b.size(),e=this.names.size();if(!(0==c||0==e))for(var d=0;d<
e&&d<c;d++){var f=b.get(d);if(7==f.tok){var j=a.get(this.names.get(d).toLowerCase());7==j.tok&&(f.value=j.value)}}},"java.util.Map,JU.Lst");f(d,"addVariable",function(a,b){this.variables.put(a,a);this.names.addLast(a);b&&this.nParameters++},"~S,~B");d.setFunction=f(d,"setFunction",function(a,b,c,e,d,f,j){var h=a.cmdpt0,l=a.chpt0,q=e-h;a.setScript(b.substring(l,c));b=a.aatoken=Array(q);a.lineIndices=JU.AU.newInt2(q);a.lineNumbers=aa(q,0);c=d[h]-1;for(var k=0;k<q;k++)if(a.lineNumbers[k]=d[h+k]-c,a.lineIndices[k]=
O(-1,[f[h+k][0]-l,f[h+k][1]-l]),b[k]=j.get(h+k),0<b[k].length){var m=b[k][0];JS.T.tokAttr(m.tok,102400)&&(m.intValue-=0>m.intValue?-h:h)}for(k=e;--k>=h;)j.removeItemAt(k),f[k][0]=f[k][1]=0},"JS.ScriptFunction,~S,~N,~N,~A,~A,JU.Lst");f(d,"setScript",function(a){this.script=a;null!=this.script&&(""!==this.script&&!this.script.endsWith("\n"))&&(this.script+="\n")},"~S");r(d,"toString",function(){var a=(new JU.SB).append("/*\n * ").append(this.name).append("\n */\n").append(this.getSignature()).append(" {\n");
null!=this.script&&a.append(this.script);a.append("}\n");return a.toString()});r(d,"getSignature",function(){if(null==this.typeName)return JS.T.nameOf(this.tok);for(var a=(new JU.SB).append(this.typeName).append(" ").append(this.name).append("("),b=0;b<this.nParameters;b++)0<b&&a.append(", "),a.append(this.names.get(b));a.append(")");return a.toString()});r(d,"geTokens",function(){return this.aatoken});r(d,"getName",function(){return this.name});r(d,"getTok",function(){return this.tok})});H("JS");
L(["JS.ScriptException"],"JS.ScriptInterruption",null,function(){var d=$(JS,"ScriptInterruption",JS.ScriptException);S(d,function(a,b,c){W(this,JS.ScriptInterruption,[a,b,"!",-2147483648==c||a.vwr.autoExit]);if(b.startsWith("delay")){var e=b.indexOf(":");b=0<e?b.substring(e+1):null;a.delayScriptAndRun(c,b)}},"JS.ScriptEval,~S,~N")});H("JS");L(["J.api.JmolScriptManager","JU.Lst"],"JS.ScriptManager","java.util.Hashtable JU.PT $.SB J.api.Interface JS.ScriptQueueThread JU.Elements $.Logger".split(" "),
function(){var d=M(function(){this.scriptQueue=this.commandWatcherThread=this.scriptQueueRunning=this.queueThreads=this.evalTemp=this.eval=this.vwr=null;this.useCommandWatcherThread=!1;this.scriptIndex=0;this.$isScriptQueued=!0;K(this,arguments)},JS,"ScriptManager",null,J.api.JmolScriptManager);X(d,function(){this.queueThreads=Array(2);this.scriptQueueRunning=ca(2,!1);this.scriptQueue=new JU.Lst});S(d,function(){});r(d,"getScriptQueue",function(){return this.scriptQueue});r(d,"isScriptQueued",function(){return this.$isScriptQueued});
r(d,"setViewer",function(a){this.vwr=a;this.eval=this.newScriptEvaluator();this.eval.setCompiler();return this.eval},"JV.Viewer");f(d,"newScriptEvaluator",function(){return J.api.Interface.getInterface("JS.ScriptEval",this.vwr,"setOptions").setViewer(this.vwr)});r(d,"clear",function(a){a?(this.startCommandWatcher(!1),this.interruptQueueThreads()):this.evalTemp=null},"~B");f(d,"addScript",function(a,b,c){return this.addScr("String",a,b,"",c)},"~S,~A,~B");f(d,"addScr",function(a,b,c,e,d){this.useCommandWatcherThread=
!1;this.vwr.g.useScriptQueue||(this.clearQueue(),this.vwr.haltScriptExecution());null==this.commandWatcherThread&&this.useCommandWatcherThread&&this.startCommandWatcher(!0);if(null!=this.commandWatcherThread&&0<=b.indexOf("/*SPLIT*/")){b=JU.PT.split(b,"/*SPLIT*/");for(var f=0;f<b.length;f++)this.addScr(a,b[f],c,e,d);return"split into "+b.length+" sections for processing"}var f=null!=this.commandWatcherThread&&(0>b.indexOf("javascript")||0<=b.indexOf("#javascript ")),j=new JU.Lst;j.addLast(b);j.addLast(e);
j.addLast(a);j.addLast(d?Boolean.TRUE:Boolean.FALSE);j.addLast(Integer.$valueOf(f?-1:1));j.addLast(c);this.scriptQueue.addLast(j);this.startScriptQueue(!1);return"pending"},"~S,~S,~A,~S,~B");r(d,"clearQueue",function(){this.scriptQueue.clear()});r(d,"waitForQueue",function(){if(!this.vwr.isSingleThreaded)for(var a=0;this.isQueueProcessing();)try{Thread.sleep(100),0==a++%10&&JU.Logger.debugging&&JU.Logger.debug("...scriptManager waiting for queue: "+this.scriptQueue.size()+" thread="+Thread.currentThread().getName())}catch(b){if(!G(b,
"InterruptedException"))throw b;}});r(d,"isQueueProcessing",function(){return null!=this.queueThreads[0]||null!=this.queueThreads[1]});f(d,"flushQueue",function(a){for(var b=this.scriptQueue.size();0<=--b;){var c=this.scriptQueue.get(b).get(0);0==c.indexOf(a)&&(this.scriptQueue.removeItemAt(b),JU.Logger.debugging&&JU.Logger.debug(this.scriptQueue.size()+" scripts; removed: "+c))}},"~S");f(d,"startScriptQueue",function(a){var b=a?1:0;this.scriptQueueRunning[b]||(this.scriptQueueRunning[b]=!0,this.queueThreads[b]=
new JS.ScriptQueueThread(this,this.vwr,a,b),this.queueThreads[b].start())},"~B");r(d,"getScriptItem",function(a,b){if(this.vwr.isSingleThreaded&&this.vwr.queueOnHold)return null;var c=this.scriptQueue.get(0),e=c.get(4).intValue();return(a?0>e:b?0==e:1==e)?c:null},"~B,~B");r(d,"startCommandWatcher",function(a){if(this.useCommandWatcherThread=a){if(null!=this.commandWatcherThread)return;this.commandWatcherThread=J.api.Interface.getInterface("JS.CommandWatcherThread",this.vwr,"setOptions");this.commandWatcherThread.setManager(this,
this.vwr,null);this.commandWatcherThread.start()}else{if(null==this.commandWatcherThread)return;this.clearCommandWatcherThread()}JU.Logger.debugging&&JU.Logger.debug("command watcher "+(a?"started":"stopped")+this.commandWatcherThread)},"~B");f(d,"interruptQueueThreads",function(){for(var a=0;a<this.queueThreads.length;a++)null!=this.queueThreads[a]&&this.queueThreads[a].interrupt()});f(d,"clearCommandWatcherThread",function(){null!=this.commandWatcherThread&&(this.commandWatcherThread.interrupt(),
this.commandWatcherThread=null)});r(d,"queueThreadFinished",function(a){0>a?(this.queueThreadFinished(0),this.queueThreadFinished(1)):null!=this.queueThreads[a]&&(this.queueThreads[a].interrupt(),this.scriptQueueRunning[a]=!1,this.queueThreads[a]=null,this.vwr.setSyncDriver(4),this.vwr.queueOnHold=!1)},"~N");f(d,"runScriptNow",function(){if(0<this.scriptQueue.size()){var a=this.getScriptItem(!0,!0);null!=a&&(a.set(4,Integer.$valueOf(0)),this.startScriptQueue(!0))}});r(d,"evalFile",function(a){return this.evalFileArgs(a,
null)},"~S");r(d,"evalFileArgs",function(a,b){var c=a.indexOf(" -noqueue");return 0<=c?this.evalStringWaitStatusQueued("String","script "+JU.PT.esc(a.substring(0,c)),"",!1,!1):this.addScript("script "+JU.PT.esc(a)+(null==b?"":"("+b+")"),null,!1)},"~S,~S");r(d,"evalStringWaitStatusQueued",function(a,b,c,e,d){return this.evalStringWaitParamsStatusQueued(a,b,null,c,e,d)},"~S,~S,~S,~B,~B");f(d,"evalStringWaitParamsStatusQueued",function(a,b,c,e,d,f){if(null==b)return null;var j=this.checkScriptExecution(b,
!1);if(null!=j)return j;if(this.vwr.checkConsoleScript(b))return null;var h=null==e||e.equals("output")?new JU.SB:null,j=this.vwr.sm.statusList;this.vwr.getStatusChanged(e);this.vwr.isSyntaxCheck&&JU.Logger.info("--checking script:\n"+this.eval.getScript()+"\n----\n");var l=0==b.indexOf(")");l&&(b=b.substring(1));l=l||!f;this.vwr.setErrorMessage(null,null);var q=f&&null==c?this.eval:this.newScriptEvaluator(),k=q.compileScriptString(b,d),m=q.getErrorMessage(),n=q.getErrorMessageUntranslated();this.vwr.setErrorMessage(m,
n);this.vwr.refresh(7,"script complete");k?(this.$isScriptQueued=f,d||this.vwr.setScriptStatus(null,b,-2-++this.scriptIndex,null),q.evaluateCompiledScript(c,this.vwr.isSyntaxCheck,this.vwr.isSyntaxAndFileCheck,l,this.vwr.listCommands,h,f)):(this.vwr.scriptStatus(m),this.vwr.setScriptStatus("Jmol script terminated",m,1,n),q.isStateScript()&&JS.ScriptManager.setStateScriptVersion(this.vwr,null));null!=m&&this.vwr.autoExit&&this.vwr.exitJmol();this.vwr.isSyntaxCheck&&(null==m?JU.Logger.info("--script check ok"):
JU.Logger.error("--script check error\n"+n),JU.Logger.info("(use 'exit' to stop checking)"));this.$isScriptQueued=!0;if(a.equalsIgnoreCase("String"))return n;if(null!=h)return null==n?h.toString():n;a=this.vwr.getProperty(a,"jmolStatus",e);this.vwr.getStatusChanged(j);return a},"~S,~S,~A,~S,~B,~B");f(d,"checkScriptExecution",function(a,b){var c=a,e=c.indexOf("; ## GUI ##");0<=e&&(c=c.substring(0,e));if(0<=(e=c.indexOf("\u0001##")))c=c.substring(0,e);if(this.checkResume(c))return"script processing resumed";
if(this.checkStepping(c))return"script processing stepped";if(this.checkHalt(c,b))return"script execution halted";this.vwr.wasmInchiHack(a);return null},"~S,~B");f(d,"checkResume",function(a){return a.equalsIgnoreCase("resume")?(this.vwr.scriptStatusMsg("","execution resumed"),this.eval.resumePausedExecution(),!0):!1},"~S");f(d,"checkStepping",function(a){return a.equalsIgnoreCase("step")?(this.eval.stepPausedExecution(),!0):a.equalsIgnoreCase("?")?(this.vwr.scriptStatus(this.eval.getNextStatement()),
!0):!1},"~S");r(d,"evalStringQuietSync",function(a,b,c){return this.evalStringParamsQuietSync(a,null,b,c)},"~S,~B,~B");f(d,"evalStringParamsQuietSync",function(a,b,c,e){e&&(this.vwr.sm.syncingScripts&&0>a.indexOf("#NOSYNC;"))&&this.vwr.syncScript(a+" #NOSYNC;",null,0);this.eval.isPaused()&&"!"!=a.charAt(0)&&(a="!"+JU.PT.trim(a,"\n\r\t "));(e=null==b&&0<a.length&&"!"==a.charAt(0))&&(a=a.substring(1));var d=this.checkScriptExecution(a,e);if(null!=d)return d;if(this.vwr.isScriptExecuting()&&(e||this.eval.isPaused()))return this.vwr.setInsertedCommand(a),
0==a.indexOf("moveto ")&&this.flushQueue("moveto "),"!"+a;this.vwr.setInsertedCommand("");c&&null==b&&(a+="\u0001## EDITOR_IGNORE ##");return this.addScript(a,b,c&&!this.vwr.getBoolean(603979879))},"~S,~A,~B,~B");r(d,"checkHalt",function(a,b){if(a.equalsIgnoreCase("pause")||a.equalsIgnoreCase("pause\u0001##"))return this.vwr.pauseScriptExecution(),this.vwr.scriptEditorVisible&&this.vwr.setScriptStatus("","paused -- type RESUME to continue",0,null),!0;if(a.equalsIgnoreCase("menu"))return this.vwr.getProperty("DATA_API",
"getPopupMenu","\x00"),!0;a=a.toLowerCase();var c=!1,e=null;a.startsWith("exit")?(this.vwr.haltScriptExecution(),this.vwr.clearScriptQueue(),this.vwr.clearTimeouts(),c=a.equals(e="exit")):a.startsWith("quit")&&(this.vwr.haltScriptExecution(),c=a.equals(e="quit"));if(null==e)return!1;b&&(this.vwr.clearThreads(),this.vwr.queueOnHold=!1);(b||this.vwr.g.waitForMoveTo)&&this.vwr.tm.stopMotion();JU.Logger.info(this.vwr.isSyntaxCheck?e+" -- stops script checking":(b?"!":"")+e+" received");this.vwr.isSyntaxCheck=
!1;return c},"~S,~B");r(d,"getAtomBitSetEval",function(a,b){null==a&&(a=this.evalTemp,null==a&&(a=this.evalTemp=this.newScriptEvaluator()));return this.vwr.slm.excludeAtoms(a.getAtomBitSet(b),!1)},"J.api.JmolScriptEvaluator,~O");r(d,"scriptCheckRet",function(a,b){if(0==a.indexOf(")")||0==a.indexOf("!"))a=a.substring(1);a=this.vwr.wasmInchiHack(a);var c=this.newScriptEvaluator().checkScriptSilent(a);return b||null==c.errorMessage?c:c.errorMessage},"~S,~B");d.setStateScriptVersion=f(d,"setStateScriptVersion",
function(a,b){if(null!=b){JS.ScriptManager.prevCovalentVersion=JU.Elements.bondingVersion;var c=JU.PT.getTokens(b.$replace("."," ").$replace("_"," "));try{var e=JU.PT.parseInt(c[0]),d=JU.PT.parseInt(c[1]),f=JU.PT.parseInt(c[2]);-2147483648==f&&(f=0);if(-2147483648!=e&&-2147483648!=d){var j=a.stateScriptVersionInt=1E4*e+100*d+f;a.setBooleanProperty("legacyautobonding",110924>j);a.setBooleanProperty("legacyHAddition",130117>j);a.getBoolean(603979831)||a.setBooleanProperty("legacyjavafloat",140206>j||
140300<=j&&140306>j);a.setIntProperty("bondingVersion",140111>j?0:1);return}}catch(h){if(!G(h,Exception))throw h;}}a.setIntProperty("bondingVersion",JS.ScriptManager.prevCovalentVersion);a.setBooleanProperty("legacyautobonding",!1);a.setBooleanProperty("legacyHAddition",!1);a.stateScriptVersionInt=2147483647},"JV.Viewer,~S");r(d,"addHydrogensInline",function(a,b,c,e){a=null==a?-1:a.nextSetBit(0);null==e&&(e=new java.util.Hashtable);a=0>a?this.vwr.am.cmi:this.vwr.ms.at[a].mi;0>a&&(a=this.vwr.ms.mc-
1);e.put("appendToModelIndex",Integer.$valueOf(a));var d=e.containsKey("fixedSite"),f=this.vwr.getModelUndeletedAtomsBitSet(a),j=this.vwr.g.appendNew;this.vwr.g.appendNew=!1;for(var h=0,l=f.nextSetBit(0);0<=l;l=f.nextSetBit(l+1)){var q=this.vwr.ms.at[l].getAtomNumber();q>h&&(h=q)}for(var q=new JU.SB,l=0,k=this.vwr.ms.ac;l<b.size();l++,k++){var m=b.get(l);null!=m&&q.append(";  connect 0 100 ").append("({"+k+"}) ").append("({"+m.i+"}) group;")}b=new JU.SB;b.appendI(c.length).append("\n").append("Viewer.AddHydrogens").append("#noautobond").append("\n");
k=e.get("element");k=(null==k?"H":k)+" ";for(l=0;l<c.length;l++)b.append(k).appendF(c[l].x).append(" ").appendF(c[l].y).append(" ").appendF(c[l].z).append(" - - - - ").appendI(++h).appendC("\n");c=this.vwr.getBoolean(603979900);this.vwr.setBooleanProperty("refreshing",!1);this.vwr.openStringInlineParamsAppend(b.toString(),e,!0);0<q.length()&&this.vwr.runScript(q.toString());this.vwr.setBooleanProperty("refreshing",c);e=this.vwr.getModelUndeletedAtomsBitSet(a);e.andNot(f);this.vwr.g.appendNew=j;d||
(f=this.vwr.ms.am[a].bsAsymmetricUnit,null!=f&&f.or(e));return e},"JU.BS,JU.Lst,~A,java.util.Map");r(d,"evalCallback",function(a,b,c){c?this.evalStringWaitParamsStatusQueued("String",a,b,"",!0,!0):this.evalStringParamsQuietSync(a,b,!0,!0)},"~S,~A,~B");f(d,"runScriptFromThread",function(a){var b=a.get(0),c=a.get(1),e=a.get(2),d=a.get(3).booleanValue();a=a.get(5);this.evalStringWaitParamsStatusQueued(e,b,a,c,d,!0)},"JU.Lst");d.prevCovalentVersion=0});H("JS");L(null,"JS.ScriptMathProcessor","java.util.Hashtable JU.A4 $.AU $.BS $.CU $.DF $.Lst $.M3 $.M4 $.P3 $.P4 $.PT $.Quat $.V3 JM.BondSet JS.SV $.T JU.BSUtil $.Escape $.Logger".split(" "),
function(){var d=M(function(){this.asBitSet=this.wasX=!1;this.oPt=-1;this.debugHigh=this.wasSyntaxCheck=this.chk=!1;this.ifStack=this.xStack=this.oStack=this.vwr=this.eval=null;this.xPt=this.ifPt=-1;this.braceCount=this.squareCount=this.parenCount=0;this.haveSpaceBeforeSquare=this.asVector=this.isArrayItem=!1;this.ptid=this.equalCount=0;this.pto=this.ptx=2147483647;this.isSpecialAssignment=!1;this.doSelections=!0;this.skipping=this.isAssignment=this.allowUnderflow=this.assignLeft=!1;this.lastAssignedString=
null;K(this,arguments)},JS,"ScriptMathProcessor",null);X(d,function(){this.oStack=Array(8);this.xStack=Array(8);this.ifStack=da(8,"\x00")});S(d,function(a,b,c,e,d,f,j){this.eval=a;this.isAssignment=(this.isSpecialAssignment=this.assignLeft=b)||null!=j;this.vwr=a.vwr;this.debugHigh=a.debugHigh;this.chk=this.wasSyntaxCheck=a.chk;this.isArrayItem=c;this.asVector=e||c;this.asBitSet=d;this.allowUnderflow=f;this.wasX=c;this.debugHigh&&JU.Logger.debug("initialize RPN")},"JS.ScriptExpr,~B,~B,~B,~B,~B,~S");
f(d,"endAssignment",function(){return this.doSelections=this.assignLeft=!1});f(d,"getResult",function(){for(var a=!0;a&&0<=this.oPt&&null!=this.oStack[this.oPt];)a=this.operate();if(a){if(this.asVector){this.isAssignment&&(0<this.xPt&&0>this.oPt||0<=this.oPt&&null!=this.oStack[this.oPt])&&this.eval.invArg();for(var a=new JU.Lst,b=0;b<=this.xPt;b++)a.addLast(this.isSpecialAssignment?this.xStack[b]:JS.SV.selectItemVar(this.xStack[b]));null!=this.lastAssignedString&&(a.removeItemAt(0),a.add(0,this.lastAssignedString),
this.lastAssignedString.intValue=this.xStack[0].intValue);return JS.SV.newV(135198,a)}if(0==this.xPt){a=this.xStack[0];if(this.chk)return this.asBitSet?JS.SV.newV(10,new JU.BS):a;if(10==a.tok||7==a.tok||15==a.tok||4==a.tok||11==a.tok||12==a.tok)a=JS.SV.selectItemVar(a);this.asBitSet&&7==a.tok&&(a=JS.SV.newV(10,JS.SV.unEscapeBitSetArray(a.value,!1)));return a}}!this.allowUnderflow&&(0<=this.xPt||0<=this.oPt)&&this.eval.invArg();return null});f(d,"putX",function(a){if(!this.skipping){if(this.wasX)try{this.addOp(JS.T.tokenComma)}catch(b){if(!G(b,
"JS.ScriptException"))throw b;}++this.xPt==this.xStack.length&&(this.xStack=JU.AU.doubleLength(this.xStack));0>this.xPt&&System.out.println("testing scriptemaafe");this.xStack[this.xPt]=a;this.ptx=++this.ptid;this.debugHigh&&JU.Logger.debug("\nputx= "+a+" ptx="+this.ptid)}},"JS.SV");f(d,"putOp",function(a){++this.oPt>=this.oStack.length&&(this.oStack=JU.AU.doubleLength(this.oStack));this.oStack[this.oPt]=a;this.pto=++this.ptid;this.debugHigh&&JU.Logger.debug("\nputop="+a+" pto="+this.ptid)},"JS.T");
f(d,"putIf",function(a){++this.ifPt>=this.ifStack.length&&(this.ifStack=JU.AU.doubleLength(this.ifStack));this.ifStack[this.ifPt]=a},"~S");f(d,"addXCopy",function(a){switch(a.tok){case 2:a=JS.SV.newI(a.intValue);break;case 3:a=JS.SV.newV(3,a.value)}return this.addX(a)},"JS.SV");f(d,"addX",function(a){this.putX(a);return this.wasX=!0},"JS.SV");f(d,"addXObj",function(a){a=JS.SV.getVariable(a);if(null==a)return!1;this.putX(a);return this.wasX=!0},"~O");f(d,"addXStr",function(a){this.putX(JS.SV.newS(a));
return this.wasX=!0},"~S");f(d,"addXBool",function(a){this.putX(JS.SV.getBoolean(a));return this.wasX=!0},"~B");f(d,"addXInt",function(a){this.putX(JS.SV.newI(a));return this.wasX=!0},"~N");f(d,"addXList",function(a){this.putX(JS.SV.getVariableList(a));return this.wasX=!0},"JU.Lst");f(d,"addXMap",function(a){this.putX(JS.SV.getVariableMap(a));return this.wasX=!0},"java.util.Map");f(d,"addXM3",function(a){this.putX(JS.SV.newV(11,a));return this.wasX=!0},"JU.M3");f(d,"addXM4",function(a){this.putX(JS.SV.newV(12,
a));return this.wasX=!0},"JU.M4");f(d,"addXFloat",function(a){this.putX(JS.SV.newF(a));return this.wasX=!0},"~N");f(d,"addXBs",function(a){this.putX(JS.SV.newV(10,a));return this.wasX=!0},"JU.BS");f(d,"addXPt",function(a){this.putX(JS.SV.newV(8,a));return this.wasX=!0},"JU.P3");f(d,"addXPt4",function(a){this.putX(JS.SV.newV(9,a));return this.wasX=!0},"JU.P4");f(d,"addXNum",function(a){if(!x(a,"JS.SV"))switch(a.tok){case 3:if(this.wasX){var b=a.value.floatValue();if(0>b||0==b&&-Infinity==1/b){this.addOp(JS.T.tokenMinus);
a=JS.SV.newF(-b);break}}a=JS.SV.newV(3,a.value);break;default:a=a.intValue,this.wasX&&0>a&&(this.addOp(JS.T.tokenMinus),a=-a),a=JS.SV.newI(a)}this.putX(a);return this.wasX=!0},"JS.T");f(d,"addXAV",function(a){this.putX(JS.SV.getVariableAV(a));return this.wasX=!0},"~A");f(d,"addXAD",function(a){this.putX(JS.SV.getVariableAD(a));return this.wasX=!0},"~A");f(d,"addXAS",function(a){this.putX(JS.SV.getVariableAS(a));return this.wasX=!0},"~A");f(d,"addXAI",function(a){this.putX(JS.SV.getVariableAI(a));
return this.wasX=!0},"~A");f(d,"addXAII",function(a){this.putX(JS.SV.getVariableAII(a));return this.wasX=!0},"~A");f(d,"addXAF",function(a){this.putX(JS.SV.getVariableAF(a));return this.wasX=!0},"~A");f(d,"addXAFF",function(a){this.putX(JS.SV.getVariableAFF(a));return this.wasX=!0},"~A");d.isOpFunc=f(d,"isOpFunc",function(a){return null!=a&&(JS.T.tokAttr(a.tok,134217728)&&a!==JS.T.tokenArraySquare||268442113==a.tok&&JS.T.tokAttr(a.intValue,134217728))},"JS.T");f(d,"addOp",function(a){return this.addOpAllowMath(a,
!0,0)},"JS.T");f(d,"addOpAllowMath",function(a,b,c){this.debugHigh&&this.dumpStacks("adding "+a+" wasx="+this.wasX);var e=0<=this.oPt&&null!=this.oStack[this.oPt]?this.oStack[this.oPt].tok:0;if(this.skipping=0<=this.ifPt&&("F"==this.ifStack[this.ifPt]||"X"==this.ifStack[this.ifPt]))return this.checkSkip(a,e);var d=268442113==a.tok;if(d&&!this.wasX)return!1;var f=b&&JS.ScriptMathProcessor.isOpFunc(a);1<=this.oPt&&(268435968!=a.tok&&134217750==e)&&(e=this.oStack[--this.oPt].tok);var j=null,h=!1;switch(a.tok){case 1073742195:return this.haveSpaceBeforeSquare=
!0;case 268436992:if(!this.wasX)return!1;break;case 268441601:case 268441602:if(this.wasX&&-1==a.intValue&&this.addOp(JS.T.tokenComma))return this.addOp(a);break;case 268437505:break;case 268435969:if(!this.wasX&&1<=this.oPt&&268435968==e&&!JS.ScriptMathProcessor.isOpFunc(this.oStack[this.oPt-1]))return!1;break;case 268440576:this.wasX||(a=JS.SV.newV(268441600,"-"));break;case 1275068725:case 32:case 64:case 96:case 128:case 160:case 192:case 480:e=0>this.oPt?0:e;if(!this.wasX||!(268442113==e||1677721602==
e||1153433601==e))return!1;this.oStack[this.oPt].intValue|=a.tok;return!0;case 268437504:h=!0;if(!this.wasX||this.haveSpaceBeforeSquare)this.squareCount++,a=j=JS.T.tokenArraySquare,this.haveSpaceBeforeSquare=!1;break;case 268439040:case 268435968:h=!0;default:if(f){f=1<=this.oPt&&268435968==e;if(d){if(268435968==c&&6==this.xStack[this.xPt].tok)return!1}else if(this.wasX&&!f)return!1;j=a;h=!0;break}if(this.wasX==h&&268442113!=e){if(!this.wasX||!b)return!1;if(this.addOp(JS.T.tokenComma))return this.addOp(a)}}for(;0<=
this.oPt&&268436482!=e&&(268441601!=a.tok&&268441602!=a.tok||this.wasX)&&(!h||268442113==e&&(268442113==a.tok||268437504==a.tok))&&this.checkPrecedence(e,a.tok)&&(268441600!=e||268441600!=a.tok);){if(268435969==a.tok&&268435968==e){0<=this.xPt&&(this.xStack[this.xPt]=JS.SV.selectItemVar(this.xStack[this.xPt]));this.wasX=!0;break}if(268437505==a.tok&&1275068418==e)break;if(268437505==a.tok&&268437504==e){if(this.isArrayItem&&1==this.squareCount&&0==this.equalCount){this.wasX=!1;this.addX(JS.SV.newT(JS.T.tokenArrayOpen));
break}if(!this.doSelection())return!1;this.wasX=!0;break}if(!this.operate())return!1;e=0<=this.oPt&&null!=this.oStack[this.oPt]?this.oStack[this.oPt].tok:0}null!=j&&(this.wasX=!1,this.addX(JS.SV.newV(268440324,j)));switch(a.tok){case 268435968:this.parenCount++;this.wasX=!1;break;case 805307393:return a=this.getX().asBoolean(),268436482==e?this.ifPt--:this.putOp(JS.T.tokenColon),this.putIf(a?"T":"F"),this.skipping=!a,this.wasX=!1,!0;case 268436482:if(268436482!=e||0>this.ifPt)return!1;this.ifStack[this.ifPt]=
"X";this.wasX=!1;return this.skipping=!0;case 268435969:this.wasX=!0;if(0>=this.parenCount--)return!1;268436482==e&&(this.ifPt--,this.oPt--);this.oPt--;if(0>this.oPt)return!0;if(JS.ScriptMathProcessor.isOpFunc(this.oStack[this.oPt])&&(this.wasX=!1,!this.evaluateFunction(0)))return!1;this.skipping=0<=this.ifPt&&"X"==this.ifStack[this.ifPt];return!0;case 268436992:return this.wasX=!1,!0;case 268437504:this.squareCount++;this.wasX=!1;break;case 268437505:this.wasX=!0;if(0>=this.squareCount--||0>this.oPt||
!this.doSelections)return!this.doSelections;if(1275068418==this.oStack[this.oPt].tok)return this.evaluateFunction(268437504);this.oPt--;return!0;case 268442113:this.wasX=!b||!JS.T.tokAttr(a.intValue,134217728);break;case 1073742332:this.braceCount++;this.wasX=!1;break;case 1073742338:if(0>=this.braceCount--)return!1;this.wasX=!1;break;case 268438528:case 268438016:if(!this.wasSyntaxCheck&&0>this.xPt)return!1;if(!this.wasSyntaxCheck)switch(this.xStack[this.xPt].tok){case 10:case 7:break;case 11:if(268438016==
a.tok)break;default:e=this.getX().asBoolean(),this.addX(JS.SV.getBoolean(e)),e==(268438016==a.tok)&&(this.chk=!0,a=268438016==a.tok?JS.T.tokenOrTRUE:JS.T.tokenAndFALSE)}this.wasX=!1;break;case 268441602:case 268441601:break;case 268440324:0==this.squareCount&&(this.doSelections=!0,this.assignLeft=!1,this.equalCount++);this.wasX=!1;break;default:this.wasX=!1}this.putOp(a);switch(a.tok){case 268442113:return 134320141==(a.intValue&-481)&&134320141!=a.intValue?this.evaluateFunction(0):!0;case 268441602:case 268441601:return this.wasX?
this.operate():!0}return!0},"JS.T,~B,~N");f(d,"checkPrecedence",function(a,b){if(268439040==a&&0<=this.xPt)switch(this.xStack[this.xPt].tok){case 11:case 12:return!0}return JS.T.getPrecedence(a)>=JS.T.getPrecedence(b)},"~N,~N");f(d,"checkSkip",function(a,b){switch(a.tok){case 268435968:this.putOp(a);break;case 268436482:if(268436482!=b||"X"==this.ifStack[this.ifPt])break;this.ifStack[this.ifPt]="T";this.skipping=this.wasX=!1;break;case 268435969:if(268435968==b){this.oPt--;break}if(268436482!=b){this.putOp(a);
break}this.wasX=!0;this.ifPt--;this.oPt-=2;this.skipping=!1}return!0},"JS.T,~N");f(d,"doSelection",function(){if(0>this.xPt||0==this.xPt&&!this.isArrayItem)return!1;var a=this.xStack[this.xPt--],b=this.xStack[this.xPt];if((7==b.tok||15==b.tok)&&2147483647!=b.intValue)if(4==a.tok||this.assignLeft&&1==this.squareCount)this.xStack[this.xPt]=b=JS.SV.selectItemTok(b,-2147483648);this.assignLeft&&4!=b.tok&&(this.lastAssignedString=null);switch(b.tok){case 6:case 14:this.doSelections?(a=b.mapValue(JS.SV.sValue(a)),
this.xStack[this.xPt]=null==a?JS.SV.newS(""):a):(this.xPt++,this.putOp(null));break;default:b=JS.SV.newS(JS.SV.sValue(b));case 10:case 15:case 7:case 4:case 11:case 12:this.doSelections||7==b.tok&&2147483647==b.intValue?(this.xStack[this.xPt]=JS.SV.selectItemTok(b,a.asInt()),this.assignLeft&&(4==b.tok&&1==this.squareCount)&&(this.lastAssignedString=b)):this.xPt++,this.doSelections||this.putOp(null)}return!0});f(d,"dumpStacks",function(a){JU.Logger.debug("\n\n------------------\nRPN stacks: "+a+"\n");
for(a=0;a<=this.xPt;a++)JU.Logger.debug("x["+a+"]: "+this.xStack[a]);JU.Logger.debug("\n");for(a=0;a<=this.oPt;a++)JU.Logger.debug("o["+a+"]: "+this.oStack[a]+" prec="+(null==this.oStack[a]?"--":""+JS.T.getPrecedence(this.oStack[a].tok)));JU.Logger.debug(" ifStack = "+String.instantialize(this.ifStack).substring(0,this.ifPt+1))},"~S");f(d,"getX",function(){0>this.xPt&&this.eval.error(13);var a=JS.SV.selectItemVar(this.xStack[this.xPt]);this.xStack[this.xPt--]=null;this.wasX=!1;return a});f(d,"getXTok",
function(){return 0>this.xPt?0:this.xStack[this.xPt].tok});f(d,"evaluateFunction",function(a){var b=this.oStack[this.oPt--];0==a&&(a=268442113==b.tok?b.intValue&-481:b.tok);for(var c=JS.T.getMaxMathParams(a),e=0,d=this.xPt;0<=d&&this.xStack[d--].value!==b;)e++;if(0<c&&e>c)return!1;for(c=Array(e);0<=--e;)c[e]=this.getX();this.xPt--;if(!this.chk)return this.eval.getMathExt().evaluate(this,b,c,a);268442113==b.tok&&this.xPt--;0>this.xPt&&(this.xPt=0);switch(a){case 134217736:case 1275203608:case 134218756:case 134218757:case 134217759:case 134353926:return this.addXBs(new JU.BS)}return this.addXBool(!0)},
"~N");f(d,"operate",function(){var a=this.oStack[this.oPt--],b,c;this.debugHigh&&this.dumpStacks("operate: "+a);if(268440324==a.tok&&(this.isArrayItem&&0==this.squareCount&&1==this.equalCount&&0>this.oPt||0<=this.oPt&&null==this.oStack[this.oPt]))return!0;a:switch(a.tok){case 268441601:case 268441602:switch(0<=this.xPt?this.xStack[this.xPt].tok:0){case 2:case 3:b=this.xStack[this.xPt--];this.wasX=!1;break a;case 12:case 11:return!0}default:b=this.getX()}if(b===JS.T.tokenArrayOpen)return!1;switch(a.tok){case 268441601:case 268441602:c=
b;if(!this.chk){this.ptx<this.pto&&(c=(new JS.SV).setv(b));if(!b.increment(268441602==a.tok?1:-1))return!1;this.ptx>this.pto&&(c=(new JS.SV).setv(b))}this.wasX=!1;this.putX(c);return this.wasX=!0;case 268441600:switch(b.tok){case 2:return this.addXInt(-b.asInt());case 8:return b=JU.P3.newP(b.value),b.scale(-1),this.addXPt(b);case 9:return b=JU.P4.newPt(b.value),b.scale4(-1),this.addXPt4(b);case 11:return b=JU.M3.newM3(b.value),b.transpose(),this.addXM3(b);case 12:return b=JU.M4.newM4(b.value),b.transpose(),
this.addXM4(b);case 10:return this.addXBs(JU.BSUtil.copyInvert(b.value,x(b.value,"JM.BondSet")?this.vwr.ms.bondCount:this.vwr.ms.ac))}return this.addXFloat(-b.asFloat());case 268439040:if(this.chk)return this.addXBool(!0);switch(b.tok){case 9:return this.addXPt4(JU.Quat.newP4(b.value).inv().toPoint4f());case 11:return b=JU.M3.newM3(b.value),b.invert(),this.addXM3(b);case 12:return this.addXM4(JU.M4.newM4(b.value).invert());case 10:return a=x(b.value,"JM.BondSet"),b=JU.BSUtil.copyInvert(b.value,a?
this.vwr.ms.bondCount:this.vwr.ms.ac),a?b=JM.BondSet.newBS(b):JU.BSUtil.andNot(b,this.vwr.slm.bsDeleted),this.addXBs(b);default:return this.addXBool(!b.asBoolean())}case 268442113:return this.propOp(a,b)}c=this.getX();if(this.chk){if(a===JS.T.tokenAndFALSE||a===JS.T.tokenOrTRUE)this.chk=!1;return this.addX(JS.SV.newT(c))}return this.binaryOp(a,c,b)});f(d,"propOp",function(a,b){var c=805307393==a.intValue?805307393:a.intValue&-481;if(this.chk)return this.addXObj(JS.SV.newS(""));switch(b.tok){case 6:case 14:switch(c){case 1275068418:case 1140850706:case 1140850694:case 1140850696:break;
default:return c=b.mapValue(a.value),this.addXObj(null==c?JS.SV.newS(""):c)}}switch(c){case 1275068418:return this.addX(b.toArray());case 805307393:case 1073741824:return 10==b.tok&&(this.chk?this.addXStr(""):this.getAllProperties(b,a.value));case 1140850696:return this.addXStr(JS.ScriptMathProcessor.typeOf(b));case 1140850706:return c=b.getKeys(480==(a.intValue&480)),null==c?this.addXStr(""):this.addXAS(c);case 1275068435:if(8==b.tok)return this.addXFloat(b.value.distance(JS.SV.pt0));case 1275068425:case 1140850694:if(1275068435==
c&&x(b.value,"JM.BondSet"))break;return this.addXInt(JS.SV.sizeOf(b));case 1140850692:switch(b.tok){case 11:case 12:c=JS.SV.sValue(b);c=JU.PT.rep(c.substring(1,c.length-1),"],[","]\n[");break;case 4:c=b.value;break;default:c=JS.SV.sValue(b)}c=JU.PT.rep(c,"\n\r","\n").$replace("\r","\n");return this.addXAS(JU.PT.split(c,"\n"));case 1765808134:switch(b.tok){case 4:case 7:return this.addXPt(JU.CU.colorPtFromString(JS.SV.sValue(b)));case 2:case 3:return this.addXPt(this.vwr.getColorPointForPropertyValue(JS.SV.fValue(b)));
case 8:return this.addXStr(JU.Escape.escapeColor(JU.CU.colorPtToFFRGB(b.value)))}break;case 1812599299:return this.chk?this.addXStr("x"):this.getBoundBox(b)}if(this.chk)return this.addXStr(JS.SV.sValue(b));if(4==b.tok){c=JS.SV.unescapePointOrBitsetAsVariable(JS.SV.sValue(b));if(!x(c,"JS.SV"))return!1;b=c}a.tok==b.tok&&(b=this.getX());return this.getPointOrBitsetOperation(a,b)},"JS.T,JS.SV");f(d,"binaryOp",function(a,b,c){var e,d;switch(a.tok){case 268439552:case 268438528:switch(b.tok){case 10:var f=
b.value;switch(c.tok){case 2:return a=c.asInt(),this.addXBool(0>a?!1:f.get(a));case 10:return f=JU.BSUtil.copy(f),f.and(c.value),this.addXBs(x(b.value,"JM.BondSet")?JM.BondSet.newBS(f):f)}}return this.addXBool(b.asBoolean()&&c.asBoolean());case 268438016:switch(b.tok){case 10:f=null;switch(c.tok){case 10:f=JU.BSUtil.copy(b.value);f.or(c.value);break;case 2:f=JU.BSUtil.copy(b.value);a=c.asInt();0<=a&&f.set(a);break;case 4:c.value.startsWith(";base90+35,")&&(f=JU.BSUtil.copy(b.value),f.or(JS.SV.decodeBase90_35(c.value)));
break;case 7:f=JU.BSUtil.copy(b.value);d=c.value;for(a=d.size();0<=--a;)e=d.get(a).asInt(),0<=e&&f.set(e)}if(null==f)break;return this.addXBs(x(b.value,"JM.BondSet")?JM.BondSet.newBS(f):f);case 7:return this.addX(JS.SV.concatList(b,c,!1));case 11:if(8==c.tok)return this.addXM4(JU.M4.newMV(b.value,c.value))}return this.addXBool(b.asBoolean()||c.asBoolean());case 268438017:if(10==b.tok&&10==c.tok)return f=JU.BSUtil.copy(b.value),f.xor(c.value),this.addXBs(x(b.value,"JM.BondSet")?JM.BondSet.newBS(f):
f);b=b.asBoolean();e=c.asBoolean();return this.addXBool(b&&!e||e&&!b);case 268438018:return 10!=b.tok||10!=c.tok?!1:this.addXBs(JU.BSUtil.toggleInPlace(JU.BSUtil.copy(b.value),c.value));case 268440322:return this.addXBool(2==b.tok&&2==c.tok?b.intValue<=c.intValue:b.isNaN()&&c.isNaN()||b.asFloat()<=c.asFloat());case 268440321:return this.addXBool(2==b.tok&&2==c.tok?b.intValue>=c.intValue:b.isNaN()&&c.isNaN()||b.asFloat()>=c.asFloat());case 268440320:return this.addXBool(2==b.tok&&2==c.tok?b.intValue>
c.intValue:b.asFloat()>c.asFloat());case 268440323:return this.addXBool(2==b.tok&&2==c.tok?b.intValue<c.intValue:b.asFloat()<c.asFloat());case 268440324:return this.addXBool(JS.SV.areEqual(b,c));case 268440325:return this.addXBool(!JS.SV.areEqual(b,c));case 268440326:return this.addXBool(JS.SV.isLike(b,c));case 268440327:return this.addXBool(JS.SV.contains(b,c));case 268440577:switch(b.tok){case 6:return b=new java.util.Hashtable(b.value),c=c.getMap(),null!=c&&b.putAll(c),this.addX(JS.SV.getVariableMap(b));
case 2:if(!this.isDecimal(c))return this.addXInt(b.intValue+c.asInt());break;case 4:return this.addX(JS.SV.newS(JS.SV.sValue(b)+JS.SV.sValue(c)));case 8:switch(a=JU.P3.newP(b.value),c.tok){case 8:return a.add(c.value),this.addXPt(a);case 9:return e=c.value,a.add(JU.P3.new3(e.x,e.y,e.z)),this.addXPt(a);default:return e=c.asFloat(),this.addXPt(JU.P3.new3(a.x+e,a.y+e,a.z+e))}case 11:switch(c.tok){case 11:return b=JU.M3.newM3(b.value),b.add(c.value),this.addXM3(b);case 8:return this.addXM4(JS.ScriptMathProcessor.getMatrix4f(b.value,
c.value))}break;case 12:switch(c.tok){case 8:return a=JU.M4.newM4(b.value),a.add(c.value),this.addXM4(a)}break;case 9:switch(b=JU.Quat.newP4(b.value),c.tok){default:return this.addXPt4(b.add(c.asFloat()).toPoint4f());case 9:return this.addXPt4(b.mulQ(JU.Quat.newP4(c.value)).toPoint4f())}case 7:return this.addX(JS.SV.concatList(b,c,!0))}return this.addXFloat(b.asFloat()+c.asFloat());case 268440576:switch(b.tok){case 2:if(!this.isDecimal(c))return this.addXInt(b.intValue-c.asInt());break;case 4:if(!this.isDecimal(c)&&
!this.isDecimal(b))return this.addXInt(b.asInt()-c.asInt());break;case 6:return b=new java.util.Hashtable(b.value),b.remove(JS.SV.sValue(c)),this.addX(JS.SV.getVariableMap(b));case 11:if(11!=c.tok)break;b=JU.M3.newM3(b.value);b.sub(c.value);return this.addXM3(b);case 12:if(12!=c.tok)break;b=JU.M4.newM4(b.value);b.sub(c.value);return this.addXM4(b);case 8:a=JU.P3.newP(b.value);switch(c.tok){case 8:return a.sub(c.value),this.addXPt(a);case 9:return e=c.value,a.sub(JU.P3.new3(e.x,e.y,e.z)),this.addXPt(a)}e=
c.asFloat();return this.addXPt(JU.P3.new3(a.x-e,a.y-e,a.z-e));case 9:return b=JU.Quat.newP4(b.value),9==c.tok?(c=JU.Quat.newP4(c.value),this.addXPt4(c.mulQ(b.inv()).toPoint4f())):this.addXPt4(b.add(-c.asFloat()).toPoint4f())}return this.addXFloat(b.asFloat()-c.asFloat());case 1275068930:if(8==b.tok&&8==c.tok)return a=b.value,c=c.value,this.addXPt(JU.P3.new3(a.x*c.x,a.y*c.y,a.z*c.z));case 268441089:switch(b.tok){case 2:return this.isDecimal(c)?this.addXFloat(b.intValue*c.asFloat()):this.addXInt(b.intValue*
c.asInt());case 4:return this.isDecimal(c)||this.isDecimal(b)?this.addXFloat(b.asFloat()*c.asFloat()):this.addXInt(b.asInt()*c.asInt())}a=11==b.tok||12==b.tok?this.ptValue(c,null):11==c.tok?this.ptValue(b,null):null;e=12==b.tok?this.eval.planeValue(c):12==c.tok?this.eval.planeValue(b):null;switch(c.tok){case 11:if(null!=a)return c=JU.M3.newM3(c.value),c.transpose(),e=JU.P3.newP(a),c.rotate(e),7==b.tok?this.addX(JS.SV.getVariableAF(Q(-1,[e.x,e.y,e.z]))):this.addXPt(e);if(null!=e)return this.addXPt4(JU.Quat.newP4(e).mulQ(JU.Quat.newM(c.value)).toPoint4f());
break;case 12:if(null!=e)return a=JU.M4.newM4(c.value),a.transpose(),c=JU.P4.newPt(e),a.transform(c),7==b.tok?this.addX(JS.SV.getVariableAF(Q(-1,[c.x,c.y,c.z,c.w]))):this.addXPt4(c)}switch(b.tok){case 11:f=b.value;if(null!=a)return e=JU.P3.newP(a),f.rotate(e),7==c.tok?this.addX(JS.SV.getVariableAF(Q(-1,[e.x,e.y,e.z]))):this.addXPt(e);switch(c.tok){case 11:return b=JU.M3.newM3(c.value),b.mul2(f,b),this.addXM3(b);case 9:return this.addXM3(JU.Quat.newM(f).mulQ(JU.Quat.newP4(c.value)).getMatrix());case 7:c=
c.getList();d=new JU.Lst;for(a=c.size();0<=--a;){e=JS.SV.ptValue(c.get(a));if(null==e)return!1;e=JU.P3.newP(e);f.rotate(e);d.addLast(e)}return this.addXList(d)}e=c.asFloat();c=new JU.A4;c.setM(f);c.angle*=e;return this.addXM3((new JU.M3).setAA(c));case 12:b=b.value;if(null!=a)return e=JU.P3.newP(a),b.rotTrans(e),7==c.tok?this.addX(JS.SV.getVariableAF(Q(-1,[e.x,e.y,e.z]))):this.addXPt(e);if(null!=e)return b.transform(e),7==c.tok?this.addX(JS.SV.getVariableAF(Q(-1,[e.x,e.y,e.z,e.w]))):this.addXPt4(e);
switch(c.tok){case 12:return a=JU.M4.newM4(c.value),a.mul2(b,a),this.addXM4(a);case 7:c=c.getList();d=new JU.Lst;for(a=c.size();0<=--a;)e=JU.P3.newP(JS.SV.ptValue(c.get(a))),b.rotTrans(e),d.addLast(e);return this.addXList(d)}return this.addXFloat(NaN);case 8:a=JU.P3.newP(b.value);switch(c.tok){case 8:return c=c.value,this.addXFloat(a.x*c.x+a.y*c.y+a.z*c.z)}e=c.asFloat();return this.addXPt(JU.P3.new3(a.x*e,a.y*e,a.z*e));case 9:return 9==c.tok?this.addXPt4(JU.Quat.newP4(b.value).mulQ(JU.Quat.newP4(c.value)).toPoint4f()):
this.addXPt4(JU.Quat.newP4(b.value).mul(c.asFloat()).toPoint4f())}return this.addXFloat(b.asFloat()*c.asFloat());case 268441088:switch(b.tok){case 2:if(2==c.tok&&0!=c.intValue)return this.addXInt(T(b.intValue/c.intValue));f=this.isDecimal(c)?0:c.asInt();if(0!=f)return this.addXInt(T(b.intValue/f));break;case 4:if(!this.isDecimal(b)&&!this.isDecimal(c)&&0!=(e=c.asInt()))return this.addXInt(T(b.asInt()/e));break;case 8:return a=JU.P3.newP(b.value),this.addXPt(0==(f=c.asFloat())?JU.P3.new3(NaN,NaN,NaN):
JU.P3.new3(a.x/f,a.y/f,a.z/f));case 9:return this.addXPt4(9==c.tok?JU.Quat.newP4(b.value).div(JU.Quat.newP4(c.value)).toPoint4f():0==(f=c.asFloat())?JU.P4.new4(NaN,NaN,NaN,NaN):JU.Quat.newP4(b.value).mul(1/f).toPoint4f())}return this.addXFloat(b.asFloat()/c.asFloat());case 268441091:return e=c.asFloat(),9==b.tok?0==e?this.addXPt4(JU.P4.new4(NaN,NaN,NaN,NaN)):9==c.tok?this.addXPt4(JU.Quat.newP4(b.value).divLeft(JU.Quat.newP4(c.value)).toPoint4f()):this.addXPt4(JU.Quat.newP4(b.value).mul(1/e).toPoint4f()):
this.addXInt(0==e?0:T(Math.floor(b.asFloat()/c.asFloat())));case 268441603:return e=Math.pow(b.asFloat(),c.asFloat()),2==b.tok&&2==c.tok?this.addXInt(I(e)):this.addXFloat(e);case 268441090:d=null;f=c.asInt();switch(b.tok){case 3:e=b.asFloat();if(0==f)return this.addXInt(Math.round(e));d=JU.DF.formatDecimal(e,f);return this.addXStr(d);case 4:return d=b.value,this.addXStr(0==f?JU.PT.trim(d,"\n\t "):9999==f?d.toUpperCase():-9999==f?d.toLowerCase():0<f?JU.PT.formatS(d,f,f,!1,!1):JU.PT.formatS(d,f,f-1,
!0,!1));case 7:c=JS.SV.strListValue(b);for(a=0;a<c.length;a++)c[a]=0==f?c[a].trim():0<f?JU.PT.formatS(c[a],f,f,!0,!1):JU.PT.formatS(d,-f,f,!1,!1);return this.addXAS(c);case 8:return a=JU.P3.newP(b.value),this.vwr.toUnitCell(a,JU.P3.new3(f,f,f)),this.addXPt(a);case 9:e=b.value;if(8==c.tok)return this.addXPt(JU.Quat.newP4(e).transform2(c.value,new JU.P3));if(9==c.tok)return c=JU.P4.newPt(c.value),JU.Quat.newP4(e).getThetaDirected(c),this.addXPt4(c);0==f&&4==c.tok&&(d=" "+c.value.toString().trim().toLowerCase()+
":",a=" w:0 x:1 y:2 z:3 normal:4 eulerzxz:5 eulerzyz:6 vector:-1 theta:-2 axisx:-3 axisy:-4 axisz:-5 axisangle:-6 matrix:-9".indexOf(d),f=0<=a?JU.PT.parseInt(" w:0 x:1 y:2 z:3 normal:4 eulerzxz:5 eulerzyz:6 vector:-1 theta:-2 axisx:-3 axisy:-4 axisz:-5 axisangle:-6 matrix:-9".substring(a+d.length)):-99);switch(f){case 0:return this.addXFloat(e.w);case 1:return this.addXFloat(e.x);case 2:return this.addXFloat(e.y);case 3:return this.addXFloat(e.z)}c=JU.Quat.newP4(e);switch(f){case 4:return this.addXPt(JU.P3.newP(c.getNormal()));
case 5:return this.addXAF(c.getEulerZXZ());case 6:return this.addXAF(c.getEulerZYZ());case -1:return this.addXPt(JU.P3.newP(c.getVector(-1)));case -2:return this.addXFloat(c.getTheta());case -3:return this.addXPt(JU.P3.newP(c.getVector(0)));case -4:return this.addXPt(JU.P3.newP(c.getVector(1)));case -5:return this.addXPt(JU.P3.newP(c.getVector(2)));case -6:return c=c.toAxisAngle4f(),this.addXPt4(JU.P4.new4(c.x,c.y,c.z,180*c.angle/3.141592653589793));case -9:return this.addXM3(c.getMatrix());default:return this.addXStr("NaN")}case 11:switch(c=
b.value,f){case 1:return this.addXFloat(c.m00+c.m11+c.m22);case 2:return this.addXFloat(c.determinant3());default:return!1}case 12:switch(b=b.value,f){case 1:return f=new JU.M3,b.getRotationScale(f),this.addXM3(f);case 2:return c=new JU.V3,b.getTranslation(c),this.addXPt(JU.P3.newP(c));default:return!1}case 10:return this.addXBs(JS.SV.bsSelectRange(b,f))}return this.addXInt(0==f?b.asInt():b.asInt()%f)}return!0},"JS.T,JS.SV,JS.SV");f(d,"isDecimal",function(a){var b;return 3==a.tok||4==a.tok&&(0<=(b=
JS.SV.sValue(a).trim()).indexOf(".")||0<b.indexOf("+")||0<b.lastIndexOf("-"))},"JS.SV");f(d,"ptValue",function(a,b){var c;switch(a.tok){case 8:return a.value;case 10:c=a.value;if(c.isEmpty()||x(c,"JM.BondSet"))break;null!=b&&(c=JU.BSUtil.copy(c),c.and(b));return c.isEmpty()?null:this.eval.getBitsetProperty(c,null,1145047049,null,null,a.value,null,!1,2147483647,!1);case 4:c=JU.Escape.uP(JS.SV.sValue(a));if(x(c,"JU.P3"))return c;break;case 7:if(c=JU.Escape.uP("{"+JS.SV.sValue(a).$replace("]"," ").$replace("[",
" ")+"}"),x(c,"JU.P3"))return c}return null},"JS.SV,JU.BS");d.typeOf=f(d,"typeOf",function(a){var b=null==a?0:a.tok;switch(b){case 1073742335:case 1073742334:return"boolean";case 10:return x(a.value,"JM.BondSet")?"bondset":"bitset";case 2:case 3:case 8:case 9:case 4:case 7:case 6:case 15:case 11:case 12:case 14:return JS.T.astrType[b]}return"?"},"JS.SV");f(d,"getAllProperties",function(a,b){var c=a.value,e,d=c.cardinality();if(0==d||!b.endsWith("?")||null==(e=JS.T.getAtomPropertiesLike(b.substring(0,
b.length-1))))return this.addXStr("");for(var f=new java.util.Hashtable,d=1==d?c.nextSetBit(0):2147483647,j=e.size();0<=--j;){var h=e.get(j),l=h.tok;switch(l){case 1094717448:case 1094713349:continue;default:2147483647==d&&(l|=480),f.put(h.value,JS.SV.getVariable(this.eval.getBitsetProperty(c,null,l,null,null,null,null,!1,d,!0)))}}return this.addXMap(f)},"JS.SV,~S");d.getMatrix4f=f(d,"getMatrix4f",function(a,b){return JU.M4.newMV(a,null==b?new JU.V3:JU.V3.newV(b))},"JU.M3,JU.T3");f(d,"getBoundBox",
function(a){if(10!=a.tok||x(a.value,"JM.BondSet"))return!1;a=this.vwr.ms.getBoxInfo(a.value,1).getBoundBoxPoints(!0);for(var b=new JU.Lst,c=0;4>c;c++)b.addLast(a[c]);return this.addXList(b)},"JS.SV");f(d,"getPointOrBitsetOperation",function(a,b){switch(b.tok){case 7:switch(a.intValue){case 32:case 64:case 96:case 192:case 128:case 160:case 1275068725:return this.addXObj(this.eval.getMathExt().getMinMax(b.getList(),a.intValue,!0));case 1275334681:return this.addX(b.pushPop(null,null));case 1275068444:case 1140850693:return this.addX(b.sortOrReverse(1140850693==
a.intValue?-2147483648:1))}for(var c=Array(b.getList().size()),e=0;e<c.length;e++){var d=JS.SV.unescapePointOrBitsetAsVariable(b.getList().get(e));if(!x(d,"JS.SV")||!this.getPointOrBitsetOperation(a,d))return!1;c[e]=this.xStack[this.xPt--]}return this.addXAV(c);case 8:switch(a.intValue){case 1111492609:case 1111492629:return this.addXFloat(b.value.x);case 1111492610:case 1111492630:return this.addXFloat(b.value.y);case 1111492611:case 1111492631:return this.addXFloat(b.value.z);case 1145047049:return c=
JU.P3.newP(b.value),this.vwr.toCartesian(c,!1),this.addXPt(c);case 1111492612:case 1111492613:case 1111492614:case 1145047050:return c=JU.P3.newP(b.value),this.vwr.toFractional(c,!1),1145047050==a.intValue?this.addXPt(c):this.addXFloat(1111492612==a.intValue?c.x:1111492613==a.intValue?c.y:c.z);case 1145045003:return this.addXStr(this.vwr.getSymStatic().staticToRationalXYZ(JU.P3.newP(b.value)," "));case 1111492615:case 1111492616:case 1111492617:case 1145047053:return c=JU.P3.newP(b.value),this.vwr.toFractional(c,
!0),1145047053==a.intValue?this.addXPt(c):this.addXFloat(1111492615==a.intValue?c.x:1111492616==a.intValue?c.y:c.z);case 1111490577:case 1111490578:case 1111490579:case 1145045006:return c=JU.P3.newP(b.value),this.vwr.toUnitCell(c,null),this.vwr.toFractional(c,!1),1145045006==a.intValue?this.addXPt(c):this.addXFloat(1111490577==a.intValue?c.x:1111490578==a.intValue?c.y:c.z);case 1094713365:case 1094713366:case 1094713367:case 1145047052:return c=JU.P3.newP(b.value),e=this.vwr.tm.transformPt(c),c.set(e.x,
e.y,e.z),1145047052==a.intValue?this.addXPt(c):this.addXFloat(1094713365==a.intValue?c.x:1094713366==a.intValue?c.y:c.z)}break;case 9:switch(a.intValue){case 1111492609:case 1111492629:return this.addXFloat(b.value.x);case 1111492610:case 1111492630:return this.addXFloat(b.value.y);case 1111492611:case 1111492631:return this.addXFloat(b.value.z);case 1140850705:return this.addXFloat(b.value.w)}break;case 12:switch(a.intValue){case 1145045003:return this.addXStr(this.vwr.getSymStatic().staticConvertOperation(null,
b.value,"rxyz"))}break;case 11:switch(a.intValue){case 1145045003:return this.addXStr(this.vwr.getSymStatic().staticConvertOperation(null,b.value,"rxyz"))}break;case 10:c=1677721602!=a.intValue;if(!c&&x(b.value,"JM.BondSet"))return this.addX(b);e=b.value;c&&(1==e.cardinality()&&0==(a.intValue&480))&&(a.intValue|=32);e=this.eval.getBitsetProperty(e,null,a.intValue,null,null,null,a.value,!1,b.index,!0);return c?this.addXObj(e):this.addXBs(JM.BondSet.newBS(e))}return!1},"JS.T,JS.SV")});H("JS");L(["JS.ScriptError"],
"JS.ScriptParam","java.util.Hashtable JU.BArray $.BS $.Base64 $.CU $.Lst $.M3 $.M4 $.Measure $.P3 $.P4 $.PT $.Quat $.SB $.V3 JM.TickInfo JS.SV $.T JU.BSUtil $.Edge $.Escape $.Logger".split(" "),function(){var d=M(function(){this.thisContext=this.contextFunctions=this.contextVariables=null;this.theTok=this.iToken=0;this.st=this.theToken=null;this.slen=0;this.fractionalPoint=null;this.isBondSet=this.coordinatesAreFractional=!1;K(this,arguments)},JS,"ScriptParam",JS.ScriptError);f(d,"getToken",function(a){this.checkToken(a)||
this.error(13);this.theToken=this.st[a];this.theTok=this.theToken.tok;return this.theToken},"~N");f(d,"tokAt",function(a){return a<this.slen&&null!=this.st[a]?this.st[a].tok:0},"~N");f(d,"checkToken",function(a){return(this.iToken=a)<this.slen},"~N");f(d,"getParameter",function(a,b,c){var e=this.getContextVariableAsVariable(a,!1);if(null==e)if(c)e=this.vwr.getP(a);else if(null==(e=this.vwr.getPOrNull(a)))return null;switch(b){case 1073742190:return JS.SV.getVariable(e);case 4:if(!x(e,"JU.Lst"))break;
a=e;b=new JU.SB;for(c=0;c<a.size();c++)b.append(a.get(c).asString()).appendC("\n");return b.toString()}return JS.SV.oValue(e)},"~S,~N,~B");f(d,"getVarParameter",function(a,b){var c=this.getContextVariableAsVariable(a,!1);if(null!=c)return b?c.asString():JS.SV.oValue(c);c=this.vwr.getP(a);return b&&0==(""+c).length?a:c},"~S,~B");f(d,"getContextVariableAsVariable",function(a,b){if(0==a.length||a.equals("expressionBegin"))return null;if("_"==a.charAt(0)){var c=a.equalsIgnoreCase("_callers");if(c||a.equalsIgnoreCase("_caller")){for(var e=
this.thisContext,d=new java.util.Hashtable,f=null,j;null!=e&&(!e.isFunction||!(null==f?f=d:(j=new java.util.Hashtable,f.put("_caller",JS.SV.newV(6,j)),f=j),f.putAll(e.vars),f.put("_name",JS.SV.newS(e.functionName)),!c));)e=e.parentContext;return JS.SV.newV(6,d)}if(a.equalsIgnoreCase("_name")){for(e=this.thisContext;null!=e;){if(e.isFunction)return JS.SV.newS(JS.SV.sValue(e.statement[0]));e=e.parentContext}return JS.SV.newS("")}}else{if(a.startsWith(";base90+35,"))return JS.SV.newV(10,JS.SV.decodeBase90_35(a));
if(a.startsWith(";base64,"))return JS.SV.newV(15,new JU.BArray(JU.Base64.decodeBase64(a)))}a=a.toLowerCase();c=null==this.contextVariables?null:this.contextVariables.get(a);null==c&&(!b&&null!=this.thisContext)&&(c=this.thisContext.getVariable(a));return null!=c&&1275068418==c.tok?c.arrayToList(c):c},"~S,~B");f(d,"paramAsStr",function(a){this.getToken(a);null==this.theToken&&this.error(13);return JS.SV.sValue(this.theToken)},"~N");f(d,"stringParameter",function(a){(!this.checkToken(a)||4!=this.getToken(a).tok)&&
this.error(41);return this.theToken.value},"~N");f(d,"stringParameterSet",function(a){switch(this.tokAt(a)){case 4:var b=this.stringParameter(a);return b.startsWith('["')&&(a=this.vwr.evaluateExpression(b),"string"==typeof a)?JU.PT.split(a,"\n"):P(-1,[b]);case 1073742195:a+=2;break;case 268437504:++a;break;case 7:return JS.SV.strListValue(this.getToken(a));default:this.invArg()}for(var c,b=new JU.Lst;268437505!=(c=this.tokAt(a));){switch(c){case 268436992:break;case 4:b.addLast(this.stringParameter(a));
break;default:case 0:this.invArg()}a++}this.iToken=a;a=b.size();c=Array(a);for(var e=0;e<a;e++)c[e]=b.get(e);return c},"~N");f(d,"objectNameParameter",function(a){this.checkToken(a)||this.error(37);return this.paramAsStr(a)},"~N");f(d,"atomCenterOrCoordinateParameter",function(a,b){switch(this.getToken(a).tok){case 10:case 1073742325:var c=this.atomExpression(this.st,a,0,!0,!1,b,!0);if(null==c)return(null==b||!x(b[0],"JU.P3"))&&this.invArg(),b[0];null!=b&&(2==b.length&&x(b[1],"JU.BS")&&(c=JU.BSUtil.copy(c),
c.and(b[1])),b[0]=c);return 1==c.cardinality()?this.vwr.ms.at[c.nextSetBit(0)]:this.vwr.ms.getAtomSetCenter(c);case 1073742332:case 8:return this.getPoint3f(a,!0,!0)}this.invArg();return null},"~N,~A");f(d,"isCenterParameter",function(a){a=this.tokAt(a);return 1073742330==a||1073742332==a||1073742325==a||8==a||10==a},"~N");f(d,"centerParameter",function(a,b){return this.centerParameterForModel(a,-2147483648,b)},"~N,~A");f(d,"centerParameterForModel",function(a,b,c){var e=null;if(this.checkToken(a))switch(this.getToken(a).tok){case 1814695966:return this.vwr.getUnitCellCenter();
case 1073742330:c=this.objectNameParameter(++a);e=-2147483648;268437504==this.tokAt(a+1)&&(e=this.parameterExpressionList(-a-1,-1,!0).get(0).asInt(),268437505!=this.getToken(--this.iToken).tok&&this.invArg());if(this.chk)return new JU.P3;if(1073742336==this.tokAt(a+1)&&(1275068435==this.tokAt(a+2)||1140850694==this.tokAt(a+2)))e=2147483647,this.iToken=a+2;null==(e=this.getObjectCenter(c,e,b))&&this.errorStr(12,c);break;case 10:case 1073742325:case 1073742332:case 8:null==c&&(c=Array(1)),e=this.atomCenterOrCoordinateParameter(a,
c)}null==e&&this.error(11);return e},"~N,~N,~A");f(d,"planeParameter",function(a,b){var c=new JU.V3,e=new JU.V3,d=null,f=null,j=null,h=null,l=!1;134217750==this.tokAt(a)&&a++;var q=null,k=268440576==this.tokAt(a);k&&a++;try{if(a<this.slen){switch(this.getToken(a).tok){case 1073742330:var m=this.objectNameParameter(++a);if(this.chk)return new JU.P4;d=this.getPlaneForObject(m,c);break;case 1111492629:(!this.checkToken(++a)||268440324!=this.getToken(a++).tok)&&this.evalError("x=?",null);d=JU.P4.new4(1,
0,0,-this.floatParameter(a));break;case 1111492630:(!this.checkToken(++a)||268440324!=this.getToken(a++).tok)&&this.evalError("y=?",null);d=JU.P4.new4(0,1,0,-this.floatParameter(a));break;case 1111492631:(!this.checkToken(++a)||268440324!=this.getToken(a++).tok)&&this.evalError("z=?",null);d=JU.P4.new4(0,0,1,-this.floatParameter(a));break;case 1073741824:case 4:case 9:d=this.planeValue(this.theToken);break;case 1073742332:case 8:if(!this.isPoint3f(a)){d=this.getPoint4f(a);break}case 10:case 1073742325:if(b)for(var n=
this.getAtomsStartingAt(a),q=Array(n.cardinality()),e=0,r=n.nextSetBit(0);0<=r;r=n.nextSetBit(r+1))q[e++]=this.vwr.ms.at[r];else if(f=this.atomCenterOrCoordinateParameter(a,null),268436992==this.getToken(++this.iToken).tok&&++this.iToken,j=this.atomCenterOrCoordinateParameter(this.iToken,null),268436992==this.getToken(++this.iToken).tok&&++this.iToken,this.isFloatParameter(this.iToken)){var x=this.floatParameter(this.iToken),d=new JU.P4;c.sub2(j,f);c.scale(2*x);JU.Measure.getBisectingPlane(f,c,e,
c,d)}else h=this.atomCenterOrCoordinateParameter(this.iToken,null),l=!0;break;default:if(this.isArrayParameter(a))if(b)q=this.getPointArray(a,-1,!1,!0);else if(7==this.tokAt(a)){var v=this.getPointOrCenterVector(this.getToken(a));3!=v.size()&&this.invArg();f=v.get(0);j=v.get(1);h=v.get(2);l=!0}else null==this.vwr.getCurrentUnitCell()&&this.invArg(),d=new JU.P4,d.setT(JU.P3.newA(this.floatParameterSet(a+1,3,3))),this.vwr.toCartesian(d,!0)}if(b)d=new JU.P4,JU.Measure.calcBestPlaneThroughPoints(q,-1,
d);else if(l){var d=new JU.P4,u=new JU.P3,H=JU.Measure.getNormalThroughPoints(f,j,h,u,c);d.set4(u.x,u.y,u.z,H)}!this.chk&&JU.Logger.debugging&&JU.Logger.debug(" defined plane: "+d)}}catch(w){if(G(w,Exception))d=null;else throw w;}null==d&&this.errorMore(38,"{a b c d}",'"xy" "xz" "yz" "x=..." "y=..." "z=..." "ab" "bc" "ac" "ab1" "bc1" "ac1"',"$xxxxx");k&&d.scale4(-1);return d},"~N,~B");f(d,"getAtomsStartingAt",function(a){var b=new JU.BS;for(a--;10==this.tokAt(++a)||1073742325==this.tokAt(a);)b.or(this.atomExpressionAt(a)),
a=this.iToken;return b},"~N");f(d,"getPointOrCenterVector",function(a){var b=new JU.Lst,c,e;a=a.getList();null==a&&this.invArg();for(var d=0;d<a.size();d++)null!=(c=JS.SV.ptValue(a.get(d)))?b.addLast(c):null!=(e=JS.SV.getBitSet(a.get(d),!0))?b.addLast(1==e.cardinality()?JU.P3.newP(this.vwr.ms.at[e.nextSetBit(0)]):this.vwr.ms.getAtomSetCenter(e)):this.invArg();return b},"JS.T");f(d,"hklParameter",function(a,b,c,e){return this.hklParameterUC(a,b,c,null,e)},"~N,JU.Lst,~B,JU.P3");f(d,"hklParameterUC",
function(a,b,c,e,d){!this.chk&&(null==e&&null==this.vwr.getCurrentUnitCell())&&this.error(33);var f=null;a:for(;;){switch(this.tokAt(a)){case 4:case 805307393:a=this.paramAsStr(a);a.equals("?")&&(a=this.chk?"1 1 1":this.vwr.prompt("Enter h k l","",!1));a=JU.PT.clean(JU.PT.rep(a,","," "));a=JU.PT.split(a," ");3!=a.length&&this.error(3);for(var j=O(3,0),h=0;3>h;h++)if(j[h]=JU.PT.parseInt(a[h]),-2147483648==j[h])break a;f=JU.P3.new3(j[0],j[1],j[2]);break;case 2:f=JU.P3.new3(this.intParameter(a++),this.intParameter(a++),
this.intParameter(a++));break;default:f=this.getPointOrPlane(a,71)}a=x(f,"JU.P4");null!=d&&(a?d.setT(f):d.x=NaN);d=NaN;c&&(d=x(f,"JU.P4")?f.w:NaN,1073742066==this.tokAt(this.iToken+1)&&(this.iToken++,d=this.floatParameter(++this.iToken)));f=this.getHklPlane(f,d,b,e);break}null==f&&this.error(3);!this.chk&&JU.Logger.debugging&&JU.Logger.debug("defined plane: "+f);return f},"~N,JU.Lst,~B,J.api.SymmetryInterface,JU.P3");f(d,"getHklPlane",function(a,b,c,e){var d=JU.P3.new3(0==a.x?1:1/a.x,0,0),f=JU.P3.new3(0,
0==a.y?1:1/a.y,0),j=JU.P3.new3(0,0,0==a.z?1:1/a.z);if(0==a.x&&0==a.y&&0==a.z)return null;0==a.x&&0==a.y?(d.set(1,0,j.z),f.set(0,1,j.z)):0==a.y&&0==a.z?(f.set(d.x,0,1),j.set(d.x,1,0)):0==a.z&&0==a.x?(j.set(0,f.y,1),d.set(1,f.y,0)):0==a.x?d.set(1,f.y,0):0==a.y?f.set(0,1,j.z):0==a.z&&j.set(d.x,0,1);null==e?(this.vwr.toCartesian(d,!1),this.vwr.toCartesian(f,!1),this.vwr.toCartesian(j,!1)):(e.toCartesian(d,!1),e.toCartesian(f,!1),e.toCartesian(j,!1));a=new JU.V3;e=JU.Measure.getPlaneThroughPoints(d,f,
j,new JU.V3,a,new JU.P4);Double.isNaN(b)||(e.w=-b,null!=c&&(JU.Measure.getPlaneProjection(d,e,d,a),JU.Measure.getPlaneProjection(f,e,f,a),JU.Measure.getPlaneProjection(j,e,j,a)));null!=c&&(c.addLast(d),c.addLast(f),c.addLast(j));return e},"JU.T3,~N,JU.Lst,J.api.SymmetryInterface");f(d,"getPointOrPlane",function(a,b){var c=Q(6,0),e=O(6,0),d=!1,f=0,j=4==(b&7)?4:3,h=3==(b&7)?3:4,l=0!=(b&64),q=0!=(b&8),k=!0,m=this.iToken;try{this.coordinatesAreFractional=l;if(8==this.tokAt(a)){if(3>=j&&3<=h)return this.getToken(a).value;
k=!1;return null}if(9==this.tokAt(a)){if(4>=j&&4<=h)return this.getToken(a).value;k=!1;return null}var n=1,r=a;a:for(;r<this.slen;r++)switch(this.getToken(r).tok){case 1073742332:case 268436992:case 268438528:case 268439552:break;case 1073742338:break a;case 268440576:n=-1;break;case 1073742363:if(6==f)return k=!1,null;c[f++]=this.theToken.intValue;n=-1;break;case 2:case 1073742362:(6==f||2147483647==this.theToken.intValue)&&this.invArg();l&&999999999<this.theToken.intValue&&(d=!0);e[f]=this.theToken.intValue;
c[f++]=this.theToken.intValue*n;n=1;break;case 268441088:case 1073742358:if(!l&&0==(b&16))return k=!1,null;268441088==this.theTok&&this.getToken(++r);f--;if(0>f||q)return k=!1,null;x(this.theToken.value,Integer)||2==this.theTok?c[f++]/=2147483647==this.theToken.intValue?this.theToken.value.intValue():this.theToken.intValue:x(this.theToken.value,Float)&&(c[f++]/=this.theToken.value.floatValue());this.coordinatesAreFractional=!0;break;case 1073742357:case 1073741824:c[f++]=NaN;break;case 3:case 1073742359:if(q||
6==f)return k=!1,null;c[f++]=this.theToken.value.floatValue();break;default:this.iToken--;break a}if(f<j||f>h)return k=!1,null;if(3==f){if(d)return JU.P4.new4(c[0],c[1],c[2],1E3*(e[0]%1E3)+e[1]%1E3+1E6);var B=JU.P3.new3(c[0],c[1],c[2]);this.coordinatesAreFractional&&0!=(b&32)&&(this.fractionalPoint=JU.P3.newP(B),this.chk||this.vwr.toCartesian(B,!1));return B}if(4==f&&(l||!this.coordinatesAreFractional))return JU.P4.new4(c[0],c[1],c[2],c[3]);k=!1;return null}finally{k||(this.iToken=m,0==(b&128)&&this.invArg())}},
"~N,~N");f(d,"isPoint3f",function(a){var b=this.tokAt(a);if(0==b)return!1;var c;if((c=8==b)||9==b||this.isFloatParameter(a+1)&&this.isFloatParameter(a+2)&&this.isFloatParameter(a+3)&&this.isFloatParameter(a+4))return c;this.ignoreError=!0;b=this.iToken;c=!0;try{null==this.getPoint3f(a,!0,!1)&&(c=!1)}catch(e){if(G(e,Exception))c=!1;else throw e;}this.ignoreError=!1;this.iToken=b;return c},"~N");f(d,"getPoint3f",function(a,b,c){return this.getPointOrPlane(a,35|(b?16:0)|(c?0:128))},"~N,~B,~B");f(d,"getFractionalPoint",
function(a){return this.getPointOrPlane(a,71)},"~N");f(d,"getPoint4f",function(a){return this.getPointOrPlane(a,4)},"~N");f(d,"getPoint4fNoError",function(a){return this.getPointOrPlane(a,132)},"~N");f(d,"xypParameter",function(a){var b=this.tokAt(a);1073742195==b&&(b=this.tokAt(++a));if(268437504!=b||!this.isFloatParameter(++a))return null;b=new JU.P3;b.x=this.floatParameter(a);268436992==this.tokAt(++a)&&a++;if(!this.isFloatParameter(a))return null;b.y=this.floatParameter(a);var c=268441090==this.tokAt(++a);
c&&++a;if(268437505!=this.tokAt(a))return null;this.iToken=a;b.z=3.4028235E38*(c?-1:1);return b},"~N");f(d,"xyzpParameter",function(a){var b=this.tokAt(a);1073742195==b&&(b=this.tokAt(++a));if(268437504!=b||!this.isFloatParameter(++a))return null;b=new JU.P4;b.x=this.floatParameter(a);268436992==this.tokAt(++a)&&a++;if(!this.isFloatParameter(a))return null;b.y=this.floatParameter(a);268436992==this.tokAt(++a)&&a++;if(!this.isFloatParameter(a))return null;b.z=this.floatParameter(a);var c=268441090==
this.tokAt(++a);c&&++a;if(268437505!=this.tokAt(a))return null;this.iToken=a;b.w=3.4028235E38*(c?-1:1);return b},"~N");f(d,"optParameterAsString",function(a){return a>=this.slen?"":this.paramAsStr(a)},"~N");f(d,"intParameter",function(a){if(this.checkToken(a)&&2==this.getToken(a).tok)return this.theToken.intValue;this.error(20);return 0},"~N");f(d,"isFloatParameter",function(a){switch(this.tokAt(a)){case 2:case 3:return!0}return!1},"~N");f(d,"floatParameter",function(a){if(this.checkToken(a))switch(this.getToken(a),
this.theTok){case 1073742363:return-this.theToken.intValue;case 1073742362:case 2:return this.theToken.intValue;case 1073742359:case 3:return this.theToken.value.floatValue()}this.error(34);return 0},"~N");f(d,"getPointArray",function(a,b,c,e){2147483647==b&&(b=-1);var d=0>b?null:Array(b),f=0>b?new JU.Lst:null,j=0>a?7:this.getToken(a++).tok;switch(j){case 7:f=this.theToken.getList();0<=b&&f.size()!=b&&this.invArg();b=f.size();null==d&&(d=Array(b));for(j=0;j<b;j++)null==(d[j]=JS.SV.ptValue(f.get(j)))&&
!c&&this.invArg();return d;case 1073742195:j=this.tokAt(a++);break;case 268437504:break;default:if(this.iToken--,!e)return null}268437504!=j&&this.invArg();for(c=0;268437505!=j&&0!=j;)switch(j=this.getToken(a).tok,j){case 0:case 268437505:break;case 268436992:a++;break;default:if(0<=b&&c==b){j=0;break}a=this.centerParameter(a,null);null==d?f.addLast(a):d[c]=a;c++;a=this.iToken+1}268437505!=j&&this.invArg();null==d&&(d=f.toArray(Array(f.size())));0<b&&null==d[b-1]&&this.invArg();return d},"~N,~N,~B,~B");
f(d,"listParameter",function(a,b,c){return this.listParameter4(a,b,c,!1)},"~N,~N,~N");f(d,"listParameter4",function(a,b,c,e){var d=new JU.Lst,f=this.tokAt(a);1073742195==f&&(f=this.tokAt(++a));var j=1073742332==f,h=268437504==f;(j||h)&&a++;for(var l=0;l<c;){f=this.tokAt(a);if(j&&1073742338==f||h&&268437505==f)break;switch(f){case 268436992:case 268440576:case 1073742332:case 1073742338:break;case 4:e&&d.addLast(this.stringParameter(a));break;case 9:f=this.getPoint4f(a);d.addLast(Float.$valueOf(f.x));
d.addLast(Float.$valueOf(f.y));d.addLast(Float.$valueOf(f.z));d.addLast(Float.$valueOf(f.w));l+=4;break;default:if(this.isCenterParameter(a)){f=this.centerParameter(a,null);a=this.iToken;d.addLast(Float.$valueOf(f.x));d.addLast(Float.$valueOf(f.y));d.addLast(Float.$valueOf(f.z));l+=3;break}d.addLast(Float.$valueOf(this.floatParameter(a)));l++}a+=l==c&&h&&1073742338==this.tokAt(a+1)?2:1}(j&&1073742338!=this.tokAt(a++)||h&&268437505!=this.tokAt(a++)||l<b||l>c)&&this.invArg();this.iToken=a-1;return d},
"~N,~N,~N,~B");f(d,"floatParameterSet",function(a,b,c){var e=null,d=null,f=0,f=null;this.iToken=a;switch(this.tokAt(a)){case 4:f=JS.SV.sValue(this.st[a]);f=JU.PT.replaceWithCharacter(f,"{},[]\"'"," ");d=JU.PT.parseFloatArray(f);f=d.length;break;case 7:d=JS.SV.flistValue(this.st[a],0);f=d.length;break;default:e=this.listParameter(a,b,c),f=e.size()}(f<b||f>c)&&this.invArg();if(null==d){d=Q(f,0);for(a=0;a<f;a++)d[a]=e.get(a).floatValue()}return d},"~N,~N,~N");f(d,"isArrayParameter",function(a){switch(this.tokAt(a)){case 7:case 11:case 12:case 1073742195:case 268437504:return!0}return!1},
"~N");f(d,"getQuaternionParameter",function(a,b,c){switch(this.tokAt(a)){case 7:return a=this.getToken(a).getList(),b=null,(0==a.size()||null==(b=JS.SV.pt4Value(a.get(0))))&&this.invArg(),JU.Quat.newP4(b);case 1073741864:return this.chk?null:this.vwr.getOrientation(1073741864,c?"best":"",b,null);default:return JU.Quat.newP4(this.getPoint4f(a))}},"~N,JU.BS,~B");f(d,"checkLast",function(a){return this.checkLength(a+1)-1},"~N");f(d,"checkLength",function(a){if(0<=a)return this.checkLengthErrorPt(a,0);
this.slen>-a&&(this.iToken=-a,this.bad());return this.slen},"~N");f(d,"checkLengthErrorPt",function(a,b){this.slen!=a&&(this.iToken=0<b?b:this.slen,0<b?this.invArg():this.bad());return this.slen},"~N,~N");f(d,"checkLength23",function(){this.iToken=this.slen;2!=this.slen&&3!=this.slen&&this.bad();return this.slen});f(d,"checkLength34",function(){this.iToken=this.slen;3!=this.slen&&4!=this.slen&&this.bad();return this.slen});f(d,"modelNumberParameter",function(a){var b=0,c=!1;switch(this.tokAt(a)){case 2:c=
!0;case 3:b=this.getToken(a).intValue;break;case 4:b=JU.Edge.getFloatEncodedInt(this.stringParameter(a));break;default:this.invArg()}return this.vwr.ms.getModelNumberIndex(b,c,!0)},"~N");f(d,"getMadParameter",function(){var a=1;switch(this.getToken(1).tok){case 1073742072:this.restrictSelected(!1,!1);case 1073742335:break;case 1073742334:a=0;break;case 2:a=8*this.intParameterRange(1,0,750);break;case 3:a=this.floatParameterRange(1,-3,3);a=Float.isNaN(a)?2147483647:T(Math.floor(2E3*a));0>a&&(this.restrictSelected(!1,
!1),a=-a);break;default:this.error(6)}return a});f(d,"intParameterRange",function(a,b,c){a=this.intParameter(a);return a<b||a>c?(this.integerOutOfRange(b,c),2147483647):a},"~N,~N,~N");f(d,"floatParameterRange",function(a,b,c){a=this.floatParameter(a);return a<b||a>c?(this.numberOutOfRange(b,c),NaN):a},"~N,~N,~N");f(d,"getPointVector",function(a,b){switch(a.tok){case 10:return this.vwr.ms.getAtomPointVector(a.value);case 7:for(var c=new JU.Lst,e,d=a.getList(),f=0;f<d.size();f++){e=d.get(f);if(null==
(e=10==e.tok?this.vwr.ms.getAtomSetCenter(JS.SV.getBitSet(e,!1)):JS.SV.ptValue(e)))return null;c.addLast(e)}return c}return 0<b?this.vwr.ms.getAtomPointVector(this.atomExpressionAt(b)):null},"JS.T,~N");f(d,"isColorParam",function(a){var b=this.tokAt(a);return 0!=b&&(570425378==b||134218255==b||1073742195==b||268437504==b||7==b||8==b||this.isPoint3f(a)||(4==b||JS.T.tokAttr(b,1073741824))&&0!=JU.CU.getArgbFromString(this.st[a].value))},"~N");f(d,"getArgbParam",function(a){return this.getArgbParamOrNone(a,
!1)},"~N");f(d,"getArgbParamLast",function(a,b){var c=this.getArgbParamOrNone(a,b);this.checkLast(this.iToken);return c},"~N,~B");f(d,"getArgbParamOrNone",function(a,b){var c=null;if(this.checkToken(a))switch(this.getToken(a).tok){default:if(!JS.T.tokAttr(this.theTok,1073741824))break;case 570425378:case 134218255:case 4:return JU.CU.getArgbFromString(this.paramAsStr(a));case 1073742195:return this.getColorTriad(a+2);case 268437504:return this.getColorTriad(++a);case 7:var e=JS.SV.flistValue(this.theToken,
3);null!=e&&3!=e.length&&(c=JU.P3.new3(e[0],e[1],e[2]));break;case 8:c=this.theToken.value;break;case 1073742332:c=this.getPoint3f(a,!1,!0);break;case 1073742333:if(b)return 0}null==c&&this.error(8);return JU.CU.colorPtToFFRGB(c)},"~N,~B");f(d,"getColorTriad",function(a){var b=Q(3,0),c=0,e="";this.getToken(a);var d=null,f=0;a:switch(this.theTok){case 2:case 1073742362:case 3:for(;a<this.slen;a++){switch(this.getToken(a).tok){case 268436992:continue;case 1073741824:(1!=c||0!=b[0])&&this.error(4);e=
"0"+this.paramAsStr(a);break a;case 3:2<c&&this.error(4);f=this.floatParameter(a);break;case 2:2<c&&this.error(4);f=this.theToken.intValue;break;case 1073742362:2<c&&this.error(4);f=this.theToken.value.intValue()%256;break;case 268437505:3!=c&&this.error(4);--a;d=JU.P3.new3(b[0],b[1],b[2]);break a;default:this.error(4)}b[c++]=f}this.error(4);break;case 8:d=this.theToken.value;break;case 1073741824:e=this.paramAsStr(a);break;default:this.error(4)}268437505!=this.getToken(++a).tok&&this.error(4);if(null!=
d)return JU.CU.colorPtToFFRGB(d);0==(c=JU.CU.getArgbFromString("["+e+"]"))&&this.error(4);return c},"~N");f(d,"tickParamAsStr",function(a,b,c,e){this.iToken=a-1;if(1073742164!=this.tokAt(a))return null;var d=" ";switch(this.tokAt(a+1)){case 1111492629:case 1111492630:case 1111492631:d=this.paramAsStr(++a).toLowerCase();break;case 1073741824:this.invArg()}if(1073742333==this.tokAt(++a))return b=new JM.TickInfo(null),b.type=d.charAt(0),this.iToken=a,b;b=new JM.TickInfo(this.getPointOrPlane(a,19));if(this.coordinatesAreFractional||
1814695966==this.tokAt(this.iToken+1))b.scale=JU.P3.new3(NaN,NaN,NaN),c=!1;1814695966==this.tokAt(this.iToken+1)&&this.iToken++;b.type=d.charAt(0);1287653388==this.tokAt(this.iToken+1)&&(b.tickLabelFormats=this.stringParameterSet(this.iToken+2));if(!c)return b;536875059==this.tokAt(this.iToken+1)&&(this.isFloatParameter(this.iToken+2)?(a=this.floatParameter(this.iToken+2),b.scale=JU.P3.new3(a,a,a)):b.scale=this.getPoint3f(this.iToken+2,!0,!0));e&&1073741942==this.tokAt(this.iToken+1)&&(b.first=this.floatParameter(this.iToken+
2));return b},"~N,~B,~B,~B");f(d,"setBooleanProperty",function(a,b){this.chk||this.vwr.setBooleanProperty(a,b)},"~S,~B");f(d,"setIntProperty",function(a,b){this.chk||this.vwr.setIntProperty(a,b);return!0},"~S,~N");f(d,"setFloatProperty",function(a,b){this.chk||this.vwr.setFloatProperty(a,b);return!0},"~S,~N");f(d,"setStringProperty",function(a,b){this.chk||this.vwr.setStringProperty(a,b)},"~S,~S");f(d,"checkHKL",function(a){(1>Math.abs(a.x)||1>Math.abs(a.y)||1>Math.abs(a.z)||a.x!=I(a.x)||a.y!=I(a.y)||
a.z!=I(a.z))&&this.invArg();return a},"JU.T3");f(d,"planeValue",function(a){var b=null,c=NaN,e=null;switch(a.tok){case 9:return a.value;case 7:break;case 4:case 1073741824:var d=a.value,f=d.startsWith("-"),j=f?-1:1;f&&(d=d.substring(1));var h=null,l=d.length,q=2>l?-1:"xy yz xz x= y= z= ab bc ac a= b= c=".indexOf(d.substring(0,2).toLowerCase());if(18<=q&&null==(b=this.vwr.getCurrentUnitCell()))q-=18;var k=0>d.indexOf("=");2<l&&(k?Float.isNaN(c)&&(18<=q&&"1"==d.charAt(2))&&(c=-1):c=-j*JU.PT.parseFloat(d.substring(2)));
switch(q){case 0:return JU.P4.new4(1,1,0,j);case 3:return JU.P4.new4(0,1,1,j);case 6:return JU.P4.new4(1,0,1,j);case 9:h=JU.P4.new4(1,0,0,-j*JU.PT.parseFloat(d.substring(2)));break;case 12:h=JU.P4.new4(0,1,0,-j*JU.PT.parseFloat(d.substring(2)));break;case 15:h=JU.P4.new4(0,0,1,-j*JU.PT.parseFloat(d.substring(2)));break;case 18:Float.isNaN(c)&&(c=0);case 33:h=this.getHklPlane(e=JU.P3.new3(0,0,1),0,null,null);h.scale4(-j);break;case 21:Float.isNaN(c)&&(c=0);case 27:h=this.getHklPlane(e=JU.P3.new3(1,
0,0),0,null,null);h.scale4(- -j);break;case 24:Float.isNaN(c)&&(c=0);case 30:h=this.getHklPlane(e=JU.P3.new3(0,1,0),0,null,null),h.scale4(-j)}if(null==h||Float.isNaN(h.w))break;if(null!=b&&!Float.isNaN(c)){b.toCartesian(e,!0);if(k||!f)c=-c;h.w=e.dot(h)*c;(!k||0!=c)&&h.scale(-1)}return h;default:return null}a=JU.Escape.uP(JS.SV.sValue(a));return x(a,"JU.P4")?a:null},"JS.T");d.transformPoints=f(d,"transformPoints",function(a,b,c){for(var e=new JU.Lst,d=0;d<a.size();d++){var f=JU.P3.newP(a.get(d));f.sub(c);
b.rotTrans(f);f.add(c);e.addLast(f)}return e},"JU.Lst,JU.M4,JU.P3");d.getTransformMatrix4=f(d,"getTransformMatrix4",function(a,b,c,e){a=JU.Measure.getCenterAndPoints(a);var d=JU.Measure.getCenterAndPoints(b);b=Q(2,0);var f=JU.Measure.calculateQuaternionRotation(P(-1,[a,d]),b).getMatrix();null==e?f.rotate(a[0]):e.setT(a[0]);e=JU.V3.newVsub(d[0],a[0]);c.setMV(f,e);return b[1]},"JU.Lst,JU.Lst,JU.M4,JU.P3");f(d,"setScriptArguments",function(a,b){null==this.contextVariables&&(this.contextVariables=new java.util.Hashtable);
this.contextVariables.put("_arguments",null==a?JS.SV.getVariableAI(O(-1,[])):b?JS.SV.newV(1275068418,a):JS.SV.getVariableList(a));this.contextVariables.put("_argcount",JS.SV.newI(null==a?0:b?a.length:a.size()))},"~O,~B");f(d,"getCallbackParameter",function(a){var b=null==this.contextVariables?null:this.contextVariables.get("_arguments");if(null==b&&(null==this.thisContext||null==(b=this.thisContext.getVariable("_arguments"))))return null;if(1275068418==b.tok){if(-2147483648==a)return b.arrayToList(b);
b=b.value;return 0>--a||a>=b.length?null:b[a]=JS.SV.getVariable(b[a])}var c=b.getList();return-2147483648==a?b:0>--a||a>=c.size()?JS.SV.newV(7,new JU.Lst):c.get(a)},"~N");f(d,"getMatrixParam",function(a,b,c){switch(this.tokAt(a)){case 11:if(3!=b)break;return this.getToken(a).value;case 12:return c=this.getToken(a).value,3==b?(b=new JU.M3,c.getRotationScale(b),b):c;default:a=this.getPointArray(a,b,!1,!1);if(null==a)break;var e=new JU.M3;e.setRowV(0,a[0]);e.setRowV(1,a[1]);e.setRowV(2,a[2]);switch(b){case 3:return e;
case 4:return b=new JU.M4,b.setRotationScale(e),b.setTranslation(a[3]),b}}c&&this.invArg();return null},"~N,~N,~B")});H("JS");Z=M(function(){this.context=this.processName=null;K(this,arguments)},JS,"ScriptProcess",null);S(Z,function(d,a){this.processName=d;this.context=a},"~S,JS.ScriptContext");H("JS");L(null,"JS.ScriptProcessRunnable",["JU.Logger"],function(){var d=M(function(){this.shapeManager=this.processLock=this.process=this.parallelProcessor=null;K(this,arguments)},JS,"ScriptProcessRunnable",
null,Runnable);S(d,function(a,b,c,e){this.parallelProcessor=a;this.process=b;this.processLock=c;this.shapeManager=e},"JS.ScriptParallelProcessor,JS.ScriptProcess,~O,JV.ShapeManager");r(d,"run",function(){try{null==this.parallelProcessor.error&&(JU.Logger.debugging&&JU.Logger.debug("Running process "+this.process.processName+" "+this.process.context.pc+" - "+(this.process.context.pcEnd-1)),this.parallelProcessor.eval(this.process.context,this.shapeManager),JU.Logger.debugging&&JU.Logger.debug("Process "+
this.process.processName+" complete"))}catch(a){if(G(a,Exception))a.printStackTrace();else if(G(a,Error))this.parallelProcessor.clearShapeManager(a);else throw a;}finally{--this.parallelProcessor.counter,this.processLock.notifyAll()}})});H("JS");L(["J.thread.JmolThread"],"JS.ScriptQueueThread",["JU.Logger"],function(){var d=M(function(){this.scriptManager=null;this.startedByCommandThread=!1;this.pt=0;K(this,arguments)},JS,"ScriptQueueThread",J.thread.JmolThread);S(d,function(a,b,c,e){this.setViewer(b,
"QueueThread"+e);this.scriptManager=a;this.vwr=b;this.startedByCommandThread=c;this.pt=e},"JS.ScriptManager,JV.Viewer,~B,~N");r(d,"run1",function(a){for(;;)switch(a){case -1:a=0;break;case 0:if(this.stopped||0==this.scriptManager.getScriptQueue().size()){a=-2;break}if(!this.runNextScript()&&!this.runSleep(100,0))return;break;case -2:this.scriptManager.queueThreadFinished(this.pt);return}},"~N");f(d,"runNextScript",function(){var a=this.scriptManager.getScriptQueue();if(0==a.size())return!1;var b=
this.scriptManager.getScriptItem(!1,this.startedByCommandThread);if(null==b)return!1;JU.Logger.debugging&&JU.Logger.debug("Queue["+this.pt+"]["+a.size()+"] scripts; running: "+b.get(0));a.removeItemAt(0);this.scriptManager.runScriptFromThread(b);return 0==a.size()?!1:!0})});H("JS");L(null,"JS.ScriptTokenParser","JU.Lst $.P3 $.PT J.i18n.GT JS.SV $.T JU.Edge $.Logger $.SimpleUnitCell".split(" "),function(){var d=M(function(){this.script=this.htUserFunctions=this.vwr=null;this.isStateScript=!1;this.ichToken=
this.ichEnd=this.ichComment=this.ichCurrentCommand=this.iCommand=this.lineCurrent=0;this.tokenAndEquals=this.lastToken=this.tokenCommand=this.lastFlowCommand=this.theToken=null;this.ptNewSetModifier=this.tokCommand=this.nTokens=this.theTok=0;this.haveMacro=this.isNewSet=!1;this.logMessages=!0;this.atokenInfix=null;this.itokenInfix=0;this.isSetOrDefine=this.isMathExpressionCommand=this.isSetBrace=!1;this.ltokenPostfix=null;this.isCommaAsOrAllowed=this.isEmbeddedExpression=!1;this.theValue=null;this.residueSpecCodeGenerated=
this.haveString=!1;this.errorType=this.errorLine=this.errorMessageUntranslated=this.errorMessage=null;K(this,arguments)},JS,"ScriptTokenParser",null);f(d,"compileExpressions",function(){var a=(134222850==this.tokCommand||4124==this.tokCommand)&&268435968==this.tokAt(2);this.isEmbeddedExpression=a||0!=this.tokCommand&&(134320141!=this.tokCommand&&102436!=this.tokCommand&&364558!=this.tokCommand&&102412!=this.tokCommand||2147483647!=this.tokenCommand.intValue)&&102409!=this.tokCommand&&!JS.T.tokAttr(this.tokCommand,
12288)&&(2<this.nTokens||!JS.T.tokAttr(this.tokCommand,20480));this.isMathExpressionCommand=1073741824==this.tokCommand||a||JS.T.tokAttr(this.tokCommand,36864);a=this.isEmbeddedExpression||JS.T.tokAttr(this.tokCommand,12288);1073742330==this.tokAt(1)&&JS.T.tokAttr(this.tokCommand,12288)&&(a=!1);if(a&&!this.compileExpression())return!1;for(var a=this.atokenInfix.length,b=0,c=1;c<a;c++)12290==this.tokAt(c)&&b++;a-=b;this.isNewSet&&1==a&&(this.atokenInfix[0]=JS.T.tv(134320141,0,this.atokenInfix[0].value),
this.isNewSet=!1);if((this.isNewSet||this.isSetBrace)&&2147483647!=this.ptNewSetModifier&&a<this.ptNewSetModifier+2){if(!this.isNewSet||!this.haveMacro)return this.commandExpected();this.htUserFunctions.put(this.atokenInfix[0].value,Boolean.TRUE)}return 1==a||!JS.T.tokAttr(this.tokCommand,262144)?!0:this.error(0)});f(d,"compileExpression",function(){var a=this.isSetOrDefine&&!this.isSetBrace?2:1;this.ltokenPostfix=new JU.Lst;this.itokenInfix=0;var b=null,c=this.tokAt(1);switch(this.tokCommand){case 12290:c=
12290==this.tokAt(1)?2:1;if(2==this.tokAt(c)&&1073742336==this.tokAt(c+1)&&268440324==this.tokAt(c+3)){this.tokCommand=36867;this.isSetBrace=!0;this.ptNewSetModifier=c+3;this.isEmbeddedExpression=this.isMathExpressionCommand=!0;this.addTokenToPostfixToken(JS.T.tokenSetProperty);this.addTokenToPostfixToken(JS.T.tokenExpressionBegin);for(a=0;a++<=c;)this.addNextToken();this.addTokenToPostfixToken(JS.T.tokenExpressionEnd);a=0}break;case 12295:1677721602==c&&(a=2);break;case 1275082241:switch(c){case 1073742335:case 1073742334:case 268436992:c=
this.tokAt(++a);break}case 12294:case 1610625028:switch(c){case 1275069441:case 1073742119:c=this.tokAt(++a)}1086324742==c&&!JS.T.tokAttr(this.tokAt(a+1),268435456)&&a++}for(c=0;c<a&&this.addNextToken();c++);for(;this.moreTokens();){if(this.isEmbeddedExpression){for(;!this.isExpressionNext();){if(this.tokPeekIs(1073741824)&&!(134223363==this.tokCommand&&1==this.itokenInfix)&&(a=this.atokenInfix[this.itokenInfix].value,c=JS.T.getTokenFromName(a),null!=c&&(!this.isMathExpressionCommand&&12290!=this.lastToken.tok||
(1073742336==this.lastToken.tok||268435968==this.tokAt(this.itokenInfix+1))&&!this.isUserFunction(a))))this.atokenInfix[this.itokenInfix]=c;if(!this.addNextToken())break}if(!this.moreTokens())break}if(12290==this.lastToken.tok){if(!this.clauseDefine(!0,!1))return!1}else{this.isMathExpressionCommand||this.addTokenToPostfixToken(b=JS.T.o(1073742325,"implicitExpressionBegin"));if(!this.clauseOr(this.isCommaAsOrAllowed||!this.isMathExpressionCommand&&this.tokPeekIs(268435968)))return!1;!this.isMathExpressionCommand&&
!(this.isEmbeddedExpression&&this.lastToken===JS.T.tokenCoordinateEnd)&&this.addTokenToPostfixToken(JS.T.tokenExpressionEnd);if(this.moreTokens()){if(1275082241!=this.tokCommand&&12291!=this.tokCommand&&!this.isEmbeddedExpression)return this.error(5);1275082241==this.tokCommand&&(this.tokCommand=b.intValue=0,this.isMathExpressionCommand=this.isEmbeddedExpression=!0,this.isCommaAsOrAllowed=!1)}}}this.atokenInfix=this.ltokenPostfix.toArray(Array(this.ltokenPostfix.size()));return!0});f(d,"isUserFunction",
function(a){a=a.toLowerCase();return!this.isStateScript&&(this.vwr.isFunction(a)||this.htUserFunctions.containsKey(a))},"~S");f(d,"isExpressionNext",function(){return this.tokPeekIs(1073742332)&&!(4==this.tokAt(this.itokenInfix+1)&&268436482==this.tokAt(this.itokenInfix+2))||!this.isMathExpressionCommand&&this.tokPeekIs(268435968)});d.tokenAttr=f(d,"tokenAttr",function(a,b){return null!=a&&JS.T.tokAttr(a.tok,b)},"JS.T,~N");f(d,"moreTokens",function(){return this.itokenInfix<this.atokenInfix.length});
f(d,"tokAt",function(a){return a<this.atokenInfix.length?this.atokenInfix[a].tok:0},"~N");f(d,"tokPeek",function(){return this.itokenInfix>=this.atokenInfix.length?0:this.atokenInfix[this.itokenInfix].tok});f(d,"tokPeekIs",function(a){return this.tokAt(this.itokenInfix)==a},"~N");f(d,"intPeek",function(){return this.itokenInfix>=this.atokenInfix.length?2147483647:this.atokenInfix[this.itokenInfix].intValue});f(d,"valuePeek",function(){return this.moreTokens()?this.atokenInfix[this.itokenInfix].value:
""});f(d,"tokenNext",function(){return this.itokenInfix>=this.atokenInfix.length?null:this.atokenInfix[this.itokenInfix++]});f(d,"tokenNextTok",function(a){var b=this.tokenNext();return null!=b&&b.tok==a},"~N");f(d,"returnToken",function(){this.itokenInfix--;return!1});f(d,"getToken",function(){this.theValue=null==(this.theToken=this.tokenNext())?null:this.theToken.value;return this.theToken});f(d,"getNumericalToken",function(){return null!=this.getToken()&&(2==this.theToken.tok||3==this.theToken.tok)});
f(d,"floatValue",function(){switch(this.theToken.tok){case 2:return this.theToken.intValue;case 3:return this.theValue.floatValue()}return 0});f(d,"addTokenToPostfix",function(a,b){return this.addTokenToPostfixToken(JS.T.o(a,b))},"~N,~O");f(d,"addTokenToPostfixInt",function(a,b,c){return this.addTokenToPostfixToken(JS.T.tv(a,b,c))},"~N,~N,~O");f(d,"addTokenToPostfixToken",function(a){if(null==a)return!1;this.logMessages&&JU.Logger.debug("addTokenToPostfix"+a);if(268437504==a.tok&&(1073742336==this.lastToken.tok||
1073742337==this.lastToken.tok)){var b=this.ltokenPostfix.size()-1;this.ltokenPostfix.removeItemAt(b);this.ltokenPostfix.addLast(JS.T.tokenRightParen);for(var c=0,e,d=this.ltokenPostfix.size();0<=--d&&0<=c;)switch(e=this.ltokenPostfix.get(d).tok){case 268435969:case 268437505:c++;break;case 268435968:case 268437504:c--;var f;if(1==c&&268435969!=(f=this.ltokenPostfix.get(d-1).tok)&&268437505!=f)b=268437504==e?d-1:d,c=-10;break;default:f=0==d?0:this.ltokenPostfix.get(d-1).tok;if(1073742336==f||1073742337==
f){b=d-1;break}d==b-1&&(b=d,c=-10)}-10==c&&this.ltokenPostfix.add(b,JS.T.tokenLeftParen)}this.ltokenPostfix.addLast(a);this.lastToken=a;return!0},"JS.T");f(d,"addNextToken",function(){return this.addTokenToPostfixToken(this.tokenNext())});f(d,"addNextTokenIf",function(a){return this.tokPeekIs(a)&&this.addNextToken()},"~N");f(d,"addSubstituteTokenIf",function(a,b){if(!this.tokPeekIs(a))return!1;this.itokenInfix++;return this.addTokenToPostfixToken(b)},"~N,JS.T");f(d,"clauseOr",function(a){this.haveString=
!1;if(!this.clauseAnd())return!1;if(this.isEmbeddedExpression&&1073742326==this.lastToken.tok)return!0;for(var b;268438016==(b=this.tokPeek())||268438017==b||268438018==b||a&&268436992==b;){268436992==b&&!this.haveString?this.addSubstituteTokenIf(268436992,JS.T.tokenOr):this.addNextToken();if(!this.clauseAnd())return!1;if(a&&(1073742338==this.lastToken.tok||10==this.lastToken.tok))this.haveString=!0}return!0},"~B");f(d,"clauseAnd",function(){if(!this.clauseNot())return!1;if(this.isEmbeddedExpression&&
1073742326==this.lastToken.tok)return!0;for(;this.tokPeekIs(268438528);)if(this.addNextToken(),!this.clauseNot())return!1;return!0});f(d,"clauseNot",function(){return this.tokPeekIs(268439040)?(this.addNextToken(),this.clauseNot()):this.clausePrimitive()});f(d,"clausePrimitive",function(){var a=this.tokPeek();switch(a){case 1073742195:return this.itokenInfix++,this.clausePrimitive();case 0:return this.error(4);case 1073742327:case 10:case 268441088:case 136314895:case 2097160:case 2097159:case 2097162:case 1073742331:case 1073742333:case 2097184:return this.addNextToken();
case 4:return this.haveString=!0,this.addNextToken();case 3:return this.addTokenToPostfixInt(1073742359,this.fixModelSpec(this.getToken()),this.theValue);case 1094713349:case 1094713350:return this.clauseCell(a);case 134217736:case 1275203608:return this.clauseConnected(1275203608==a);case 134218756:case 134218757:return this.clauseSubstructure();case 134217759:case 134353926:return this.clauseWithin(134217759==a);case 12290:return this.clauseDefine(!1,!1);case 1677721602:case 1745489939:this.addNextToken();
if(this.tokPeekIs(10))this.addNextToken();else if(this.tokPeekIs(12290))return this.clauseDefine(!1,!1);return!0;case 268435968:return this.addNextToken(),!this.clauseOr(!0)?!1:!this.addNextTokenIf(268435969)?this.errorStr(15,")"):this.checkForItemSelector(!0);case 1073742332:return this.checkForCoordinate(this.isMathExpressionCommand);default:if(this.clauseResidueSpec())return!0;if(this.isError())return!1;if(JS.T.tokAttr(a,1077936128)){var b=this.itokenInfix,c=this.clauseComparator(!0);if(c||0<=
this.itokenInfix&&this.itokenInfix!=b)return c;0>this.itokenInfix&&(this.itokenInfix=-this.itokenInfix);if(1237320707==a)return this.clauseSubstructure()}return this.addNextToken()}});f(d,"getPropertyDotted",function(){var a=this.tokenNext();if(!this.tokPeekIs(1073742336)&&!this.tokPeekIs(268437504))return a;for(var b="";this.tokPeekIs(1073742336)||this.tokPeekIs(268437504);){if(this.tokPeekIs(268437504)){this.getToken();for(b+=this.theToken.value;!this.tokPeekIs(0)&&!this.tokPeekIs(268437505);)this.getToken(),
b+=this.theToken.value;this.tokPeekIs(0)||(b+=this.getToken().value.toString())}for(;this.tokPeekIs(1073742336);)this.getToken(),b+=".",this.tokPeekIs(0)||(b+=this.getToken().value.toString())}var c=1715472409==a.tok?a:null;null==c&&(a="property_"+a.value.toString().toLowerCase(),c=JS.SV.newV(1715472409,a),c.myName=a);c.myName+=b;return c});f(d,"checkForCoordinate",function(a){var b=!1,c=this.ltokenPostfix.size();a?(this.addTokenToPostfixToken(JS.T.tokenExpressionBegin),this.tokenNext()):this.isEmbeddedExpression?
(this.tokenNext(),c--):this.addNextToken();var e=this.tokPeekIs(4);if(e){a=!1;this.returnToken();this.ltokenPostfix.removeItemAt(this.ltokenPostfix.size()-1);this.addNextToken();for(var d=1;0!=d;){if(this.tokPeekIs(1073742332))if(this.isExpressionNext()){this.addTokenToPostfixToken(JS.T.o(1073742325,"implicitExpressionBegin"));if(!this.clauseOr(!1))return!1;this.lastToken!==JS.T.tokenCoordinateEnd&&this.addTokenToPostfixToken(JS.T.tokenExpressionEnd)}else d++;this.tokPeekIs(1073742338)&&d--;this.addNextToken()}}else{if(!this.tokPeekIs(1073742338)&&
!this.clauseOr(!1))return!1;for(b=1;!this.tokPeekIs(1073742338);){d=this.addNextTokenIf(268436992);if(!this.clauseOr(!1))return d||3>b?!1:this.errorStr(15,"}");b++}b=2<=b}b&&(a||this.isEmbeddedExpression)?(this.ltokenPostfix.set(c,JS.T.tokenCoordinateBegin),this.addTokenToPostfixToken(JS.T.tokenCoordinateEnd),this.tokenNext()):a?(this.addTokenToPostfixToken(JS.T.tokenExpressionEnd),this.tokenNext()):this.isEmbeddedExpression?e||this.tokenNext():this.addNextToken();return this.checkForItemSelector(!e)},
"~B");f(d,"checkForItemSelector",function(a){var b;if(268437504==(b=this.tokAt(this.itokenInfix+1))||a&&1073742332==b)return!0;for(;this.addNextTokenIf(268437504);){if(!this.clauseItemSelector())return!1;if(!this.addNextTokenIf(268437505))return this.errorStr(15,"]")}return!0},"~B");f(d,"clauseWithin",function(a){this.addNextToken();if(!this.addNextTokenIf(268435968)||null==this.getToken())return!1;var b=3.4028235E38,c=null,e=a,d,f=this.theToken.tok;if(!a){d=-1;for(var j=this.itokenInfix;0!=d;j++)switch(d=
this.tokAt(j)){case 268436992:d=0;break;case 1073742332:case 268435968:case 268435969:b=100,this.returnToken(),f=d=0}}switch(f){case 268440576:if(null==this.getToken())return!1;if(2!=this.theToken.tok)return this.error(12);b=-this.theToken.intValue;break;case 2:case 3:b=this.floatValue();break;case 12290:this.addTokenToPostfixToken(this.theToken);if(!this.clauseDefine(!0,!1))return!1;c="";e=!1}if(a&&3.4028235E38==b)switch(f){case 12290:break;case 1094713350:case 1094713349:this.addTokenToPostfix(4,
this.theValue);this.clauseCell(8);c="";break;case 1111490587:case 1073742128:case 134218756:case 134218757:case 1237320707:case 1073741925:case 1073742189:this.addTokenToPostfix(4,this.theValue);if(!this.addNextTokenIf(268436992))return!1;e=!1;d=this.tokPeek();switch(d){case 0:return!1;case 4:this.addNextToken();c="";break;case 12290:if(!this.clauseDefine(!1,!0))return!1;c="";break;default:return!1}break;case 1073742328:e=!1;case 1086326785:case 1086326786:case 1073741863:case 1812599299:case 1086326788:case 1073742329:case 1086326789:case 1086324742:case 1814695966:case 136314895:case 1094717454:case 1094713360:case 134217750:case 134219777:case 1094713362:case 1086324744:case 2097184:case 1094713369:case 1639976963:case 4:case 1648363544:c=
this.theValue;break;case 1145047055:c="vxyz";break;default:c=this.theValue.toLowerCase()}null==c?this.addTokenToPostfix(3,Float.$valueOf(b)):0<c.length&&this.addTokenToPostfix(4,c);for(j=!1;!j&&(0==f||this.addNextTokenIf(268436992));){0==f&&(f=134353926);var h=!1;d=this.tokPeek();if(a){switch(f){case 2:case 3:if(1073742335==d||1073742334==d){this.addTokenToPostfixToken(this.getToken());if(!this.addNextTokenIf(268436992))break;d=this.tokPeek()}else if(2==d||3==d)e=!1}if(null==c){switch(d){case 134219777:case 1073742329:case 134217750:h=
!0;this.addNextToken();break;case 1073742330:this.getToken();this.getToken();this.addTokenToPostfix(4,"$"+this.theValue);j=!0;break;case 1814695966:this.ltokenPostfix.size();this.getToken();this.addTokenToPostfix(4,JS.T.nameOf(d));268435969==this.tokPeek()&&(j=!0);break;case 1086324742:case 1648363544:this.getToken();this.addTokenToPostfix(4,JS.T.nameOf(d));break;case 1073742332:this.returnToken(),h=!0,this.addTokenToPostfixToken(JS.T.getTokenFromName(3.4028235E38==b?"plane":"coord"))}j||this.addNextTokenIf(268436992)}}this.tokPeek();
if(j)break;if(h)for(;!this.tokPeekIs(268435969);)switch(this.tokPeek()){case 0:return this.error(4);case 268435968:this.addTokenToPostfixToken(JS.T.tokenExpressionBegin);this.addNextToken();if(!this.clauseOr(!1))return this.errorIntStr2(18,"WITHIN",": ?");if(!this.addNextTokenIf(268435969))return this.errorStr(15,", / )");this.addTokenToPostfixToken(JS.T.tokenExpressionEnd);break;case 12290:if(!this.clauseDefine(!1,!1))return!1;break;default:this.addTokenToPostfixToken(this.getToken())}else this.clauseOr(e)}return!this.addNextTokenIf(268435969)?
this.errorStr(15,")"):!0},"~B");f(d,"clauseConnected",function(a){this.addNextToken();if(!this.addNextTokenIf(268435968))return this.addTokenToPostfixToken(JS.T.tokenLeftParen),this.addTokenToPostfixToken(JS.T.tokenRightParen),!0;for(;;){if(this.addNextTokenIf(2)){if(!this.addNextTokenIf(268436992))break;if(a){this.returnToken();break}}else if(a&&(this.addNextTokenIf(4)||this.addNextTokenIf(1073741824)))break;if(this.addNextTokenIf(2)&&!this.addNextTokenIf(268436992))break;if(this.addNextTokenIf(3)&&
!this.addNextTokenIf(268436992))break;if(this.addNextTokenIf(3)&&!this.addNextTokenIf(268436992))break;a=this.getToken().value;a="string"==typeof a?a:" ";if(131071==JU.Edge.getBondOrderFromString(a))this.returnToken();else if(this.addTokenToPostfix(4,a),!this.addNextTokenIf(268436992))break;if(this.addNextTokenIf(268435969))return!0;if(!this.clauseOr(this.tokPeekIs(268435968)))return!1;if(this.addNextTokenIf(268435969))return!0;if(!this.addNextTokenIf(268436992)||!this.clauseOr(this.tokPeekIs(268435968)))return!1;
break}return!this.addNextTokenIf(268435969)?this.errorStr(15,")"):!0},"~B");f(d,"clauseSubstructure",function(){this.addNextToken();if(!this.addNextTokenIf(268435968))return!1;if(this.tokPeekIs(12290)){if(!this.clauseDefine(!1,!0))return!1}else if(!this.addNextTokenIf(4))return this.errorStr(15,'"..."');return this.addNextTokenIf(268436992)&&!this.clauseOr(this.tokPeekIs(268435968))?!1:!this.addNextTokenIf(268435969)?this.errorStr(15,")"):!0});f(d,"clauseItemSelector",function(){for(var a,b=0;0!=
(a=this.tokPeek())&&268437505!=a;)this.addNextToken(),268437504==a&&b++,268437505==this.tokPeek()&&0<b--&&this.addNextToken();return!0});f(d,"clauseComparator",function(a){var b=this.itokenInfix,c=this.getPropertyDotted(),e=this.itokenInfix-1,d=this.tokenNext();if(!JS.ScriptTokenParser.tokenAttr(d,268435712)){if(!a)return this.errorStr(15,"== != < > <= >=");null!=d&&this.returnToken();if(e==b)return this.returnToken(),!1;this.itokenInfix=-e;return!1}if(JS.ScriptTokenParser.tokenAttr(c,1086324736)&&
268440324!=d.tok&&268440326!=d.tok&&268440327!=d.tok&&268440325!=d.tok)return this.errorStr(15,"== !=");if(268437504==this.tokPeek()){this.getToken();for(this.addTokenToPostfixToken(JS.T.tokenLeftParen);;){if(!this.addCompare(c,d))return!1;if(268436992==this.tokPeek())this.getToken();else if(268437505==this.tokPeek())break;this.addTokenToPostfixToken(268440325==d.tok?JS.T.tokenAnd:JS.T.tokenOr)}this.getToken();this.addTokenToPostfixToken(JS.T.tokenRightParen);return!0}return this.addCompare(c,d)},
"~B");f(d,"addCompare",function(a,b){if(null==this.getToken())return this.errorStr(17,""+this.valuePeek());var c=268440576==this.theToken.tok;if(c&&null==this.getToken())return this.error(12);switch(this.theToken.tok){case 2:case 3:case 1073741824:case 4:case 1073742332:case 12290:break;default:if(!JS.T.tokAttr(this.theToken.tok,1073741824))return this.error(13)}this.addTokenToPostfixInt(b.tok,a.tok,b.value+(c?" -":""));1715472409==a.tok&&this.addTokenToPostfixToken(a);if(1073742332==this.theToken.tok)return this.returnToken(),
this.clausePrimitive();this.addTokenToPostfixToken(this.theToken);return 12290==this.theToken.tok?this.clauseDefine(!0,!1):!0},"JS.T,JS.T");f(d,"clauseCell",function(a){var b=new JU.P3;this.tokenNext();if(8!=a&&!this.tokenNextTok(268440324))return this.errorStr(15,"=");if(null==this.getToken())return this.error(3);if(2==this.theToken.tok)JU.SimpleUnitCell.ijkToPoint3f(this.theToken.intValue,b,1,0);else{if(1073742332!=this.theToken.tok||!this.getNumericalToken())return this.error(3);b.x=this.floatValue();
this.tokPeekIs(268436992)&&this.tokenNext();if(!this.getNumericalToken())return this.error(3);b.y=this.floatValue();this.tokPeekIs(268436992)&&this.tokenNext();if(!this.getNumericalToken()||!this.tokenNextTok(1073742338))return this.error(3);b.z=this.floatValue()}return this.addTokenToPostfix(a,b)},"~N");f(d,"clauseDefine",function(a,b){if(!a){var c=this.tokenNext();b&&(c=JS.T.tokenDefineString);this.addTokenToPostfixToken(c)}if(this.tokPeekIs(0))return this.error(4);if(!this.addSubstituteTokenIf(1073742332,
JS.T.tokenExpressionBegin))return 12290==this.tokPeek()&&this.addNextToken(),this.addNextToken()&&this.checkForItemSelector(!0);for(;this.moreTokens()&&!this.tokPeekIs(1073742338);)if(this.tokPeekIs(1073742332)){if(!this.checkForCoordinate(!0))return!1}else this.addNextToken();return this.addSubstituteTokenIf(1073742338,JS.T.tokenExpressionEnd)&&this.checkForItemSelector(!0)},"~B,~B");f(d,"generateResidueSpecCode",function(a){this.residueSpecCodeGenerated&&this.addTokenToPostfixToken(JS.T.tokenAndSpec);
this.addTokenToPostfixToken(a);return this.residueSpecCodeGenerated=!0},"JS.T");f(d,"clauseResidueSpec",function(){var a=this.tokPeek(),b=this.residueSpecCodeGenerated=!1;switch(a){case 0:case 2097156:case 2097174:return!1;case 2:case 268436482:case 268441090:case 5:break;case 268441089:case 268437504:case 1073741824:b=!0;break;default:if(JS.T.tokAttr(a,268435712))return!1;b=""+this.valuePeek();b=2==b.length||3==b.length;if(!b)return!1}var c=!1;if(b){if(!this.clauseResNameSpec())return!1;c=!0;a=this.tokPeek()}if(2==
a||268441089==a||5==a){if(!this.clauseSequenceSpec())return!1;c=!0;a=this.tokPeek()}if(268436482==a){if(!this.clauseChainSpec(a))return!1;c=!0;a=this.tokPeek()}if(1073742336==a){if(!this.clauseAtomSpec())return!1;c=!0;a=this.tokPeek()}if(268441090==a){if(!this.clauseAlternateSpec())return!1;c=!0;a=this.tokPeek()}if(268441088==a){if(!this.clauseModelSpec())return!1;c=!0;this.tokPeek()}if(!c)return this.error(14);this.residueSpecCodeGenerated||this.addTokenToPostfixToken(JS.T.tokenAll);return!0});f(d,
"clauseResNameSpec",function(){this.getToken();var a=this.tokPeek();switch(this.theToken.tok){case 268441089:return!0;case 268437504:for(a="";null!=this.getToken()&&268437505!=this.theToken.tok;)a+=this.theValue;if(null==this.theToken)return!1;if(""===a)return!0;var b;return 0<a.length&&0<=(b=a.indexOf("*"))&&b!=a.length-1?this.error(14):this.generateResidueSpecCode(JS.T.o(1073742360,a.toUpperCase()));default:if(JS.T.tokAttr(a,268435712))return this.returnToken(),!1;b=this.theValue;268441089==a&&
(b=this.theValue+"*",this.getToken());return this.generateResidueSpecCode(JS.T.o(1073741824,b))}});f(d,"clauseSequenceSpec",function(){if(268441089==this.tokPeek())return null!=this.getToken();var a=this.getSequenceCode(!1);if(null==a)return!1;var b=this.tokPeek();return 268440576==b||2==b&&0>this.intPeek()?(268440576==b?this.tokenNext():(b=-this.intPeek(),this.tokenNext().intValue=b,this.returnToken()),a.tok=1073742363,this.generateResidueSpecCode(a),this.addTokenToPostfixToken(this.getSequenceCode(!0))):
this.generateResidueSpecCode(a)});f(d,"getSequenceCode",function(a){var b=2147483647,c=2147483647;switch(this.tokPeek()){case 5:b=this.tokenNext().intValue;break;case 2:c=this.tokenNext().intValue;break;default:if(!a)return null}return JS.T.tv(1073742362,c,Integer.$valueOf(b))},"~B");f(d,"clauseChainSpec",function(a){this.tokenNext();a=this.tokPeek();if(this.isTerminator(a))a=" ";else{switch(a){case 268441089:return null!=this.getToken();case 2:this.getToken();a=this.theToken.intValue;if(0>a||9999<
a)return this.error(8);a=""+a;break;case 4:this.vwr.getChainID("a",!0);default:a=""+this.getToken().value}if(0==a.length)a=" ";else if(a.equals("?"))return!0}a=this.vwr.getChainID(a,!1);return this.generateResidueSpecCode(JS.T.tv(1073742357,a,"spec_chain"))},"~N");f(d,"clauseAlternateSpec",function(){this.tokenNext();if(this.isTerminator(this.tokPeek()))return this.generateResidueSpecCode(JS.T.o(1073742355,null));switch(this.getToken().tok){case 268441089:case 4:case 2:case 1073741824:case 805307393:case 1111492629:case 1111492630:case 1111492631:case 1140850705:break;
default:return this.error(10)}return this.generateResidueSpecCode(JS.T.o(1073742355,this.theToken.value))});f(d,"isTerminator",function(a){switch(a){case 0:case 268441088:case 268438528:case 268438016:case 268439040:case 268436992:case 268435969:case 1073742338:return!0;default:return!1}},"~N");f(d,"clauseModelSpec",function(){this.getToken();switch(this.tokPeek()){case 268441089:return this.getToken(),!0;case 2:return this.generateResidueSpecCode(JS.T.o(1073742358,Integer.$valueOf(this.getToken().intValue)));
case 3:return this.generateResidueSpecCode(JS.T.tv(1073742358,this.fixModelSpec(this.getToken()),this.theValue));case 268436992:case 1073742338:case 0:return this.generateResidueSpecCode(JS.T.o(1073742358,Integer.$valueOf(1)))}return this.error(10)});f(d,"fixModelSpec",function(a){a=a.intValue;if(2147483647==a){var b=this.theValue.floatValue();b==I(b)&&(a=1E6*I(b));0>a&&(a=2147483647)}return a},"JS.T");f(d,"clauseAtomSpec",function(){if(!this.tokenNextTok(1073742336))return this.error(7);if(null==
this.getToken())return!0;var a="";if(2==this.theToken.tok&&(a+=""+this.theToken.intValue,null==this.getToken()))return this.error(7);if(268441089==this.theToken.tok)return!0;a+=""+this.theToken.value;this.tokPeekIs(268441089)&&(this.tokenNext(),a+="'");return this.generateResidueSpecCode(JS.T.tv(1073742356,this.vwr.getJBR().lookupSpecialAtomID(a.toUpperCase()),a))});d.errorString=f(d,"errorString",function(a,b,c,e){var d=!1;!e&&!0==(d=J.i18n.GT.getDoTranslate())&&J.i18n.GT.setDoTranslate(!1);switch(a){default:a=
"Unknown compiler error message number: "+a;break;case 0:a=J.i18n.GT.$("bad argument count");break;case 1:a=J.i18n.GT.$("invalid context for {0}");break;case 2:a=J.i18n.GT.$("command expected");break;case 3:a=J.i18n.GT.$("{ number number number } expected");break;case 4:a=J.i18n.GT.$("unexpected end of script command");break;case 5:a=J.i18n.GT.$("end of expression expected");break;case 6:a=J.i18n.GT.$("identifier or residue specification expected");break;case 7:a=J.i18n.GT.$("invalid atom specification");
break;case 8:a=J.i18n.GT.$("invalid chain specification");break;case 9:a=J.i18n.GT.$("invalid expression token: {0}");break;case 10:a=J.i18n.GT.$("invalid model specification");break;case 11:a=J.i18n.GT.$("missing END for {0}");break;case 12:a=J.i18n.GT.$("number expected");break;case 13:a=J.i18n.GT.$("number or variable name expected");break;case 14:a=J.i18n.GT.$("residue specification (ALA, AL?, A*) expected");break;case 15:a=J.i18n.GT.$("{0} expected");break;case 16:a=J.i18n.GT.$("{0} unexpected");
break;case 17:a=J.i18n.GT.$("unrecognized expression token: {0}");break;case 18:a=J.i18n.GT.$("unrecognized {0} parameter");break;case 19:a=J.i18n.GT.$("unrecognized token: {0}")}0>a.indexOf("{0}")?null!=b&&(a+=": "+b):(a=JU.PT.rep(a,"{0}",b),0<=a.indexOf("{1}")?a=JU.PT.rep(a,"{1}",c):null!=c&&(a+=": "+c));e||J.i18n.GT.setDoTranslate(d);return a},"~N,~S,~S,~B");f(d,"commandExpected",function(){this.ichToken=this.ichCurrentCommand;return this.error(2)});f(d,"error",function(a){return this.errorIntStr2(a,
null,null)},"~N");f(d,"errorStr",function(a,b){return this.errorIntStr2(a,b,null)},"~N,~S");f(d,"errorIntStr2",function(a,b,c){var e=JS.ScriptTokenParser.errorString(a,b,c,!0);a=J.i18n.GT.getDoTranslate()?JS.ScriptTokenParser.errorString(a,b,c,!1):null;return this.errorStr2(e,a)},"~N,~S,~S");f(d,"isError",function(){return null!=this.errorMessage});f(d,"errorStr2",function(a,b){this.errorMessage=a;this.errorMessageUntranslated=b;return!1},"~S,~S")});H("JV");L(["JV.JmolStateCreator","java.util.Hashtable"],
"JV.StateCreator","java.util.Arrays $.Date JU.BS $.Lst $.P3 $.PT $.SB J.c.PAL $.STR $.VDW JM.AtomCollection $.Bond $.BondSet JS.T J.shape.Shape JU.BSUtil $.C $.ColorEncoder $.Edge $.Escape $.Font $.Logger JV.GlobalSettings $.JC $.StateManager $.Viewer".split(" "),function(){var d=M(function(){this.undoWorking=!1;this.temp4=this.temp3=this.temp2=this.temp=this.vwr=this.actionStatesRedo=this.actionStates=null;K(this,arguments)},JV,"StateCreator",JV.JmolStateCreator);X(d,function(){this.temp=new java.util.Hashtable;
this.temp2=new java.util.Hashtable;this.temp3=new java.util.Hashtable;this.temp4=new java.util.Hashtable});S(d,function(){W(this,JV.StateCreator,[]);this.actionStates=new JU.Lst;this.actionStatesRedo=new JU.Lst});r(d,"setViewer",function(a){this.vwr=a},"JV.Viewer");r(d,"getStateScript",function(a,b,c){var e=null==a||a.equalsIgnoreCase("all"),d=new JU.SB,f=e?(new JU.SB).append("function _setState() {\n"):null;e&&(d.append("# Jmol state version "+JV.Viewer.getJmolVersion()+";\n"),this.vwr.isApplet&&
(this.app(d,"# fullName = "+JU.PT.esc(this.vwr.fullName)),this.app(d,"# documentBase = "+JU.PT.esc(JV.Viewer.appletDocumentBase)),this.app(d,"# codeBase = "+JU.PT.esc(JV.Viewer.appletCodeBase)),d.append("\n")));var j=this.vwr.g;(e||a.equalsIgnoreCase("windowState"))&&d.append(this.getWindowState(f,b,c));(e||a.equalsIgnoreCase("fileState"))&&d.append(this.getFileState(f));(e||a.equalsIgnoreCase("definedState"))&&d.append(this.getDefinedState(f,!0));(e||a.equalsIgnoreCase("variableState"))&&d.append(this.getParameterState(j,
f));(e||a.equalsIgnoreCase("dataState"))&&d.append(this.getDataState(f));(e||a.equalsIgnoreCase("modelState"))&&d.append(this.getModelState(f,!0,this.vwr.getBooleanProperty("saveProteinStructureState")));(e||a.equalsIgnoreCase("colorState"))&&d.append(this.getColorState(this.vwr.cm,f));(e||a.equalsIgnoreCase("frameState"))&&d.append(this.getAnimState(this.vwr.am,f));(e||a.equalsIgnoreCase("perspectiveState"))&&d.append(this.getViewState(this.vwr.tm,f));(e||a.equalsIgnoreCase("selectionState"))&&d.append(this.getSelectionState(this.vwr.slm,
f));null!=f&&(this.app(f,"set refreshing true"),this.app(f,"set antialiasDisplay "+j.antialiasDisplay),this.app(f,"set antialiasTranslucent "+j.antialiasTranslucent),this.app(f,"set antialiasImages "+j.antialiasImages),this.vwr.tm.spinOn&&!this.vwr.tm.vectorSpinOnly&&this.app(f,"spin on"),f.append("}\n\n_setState;\n"));e&&d.appendSB(f);return d.toString()},"~S,~N,~N");f(d,"getDataState",function(a){var b=new JU.SB,c=!1,e=this.getAtomicPropertyState(-1,null);0<e.length&&(c=!0,b.append(e));null!=this.vwr.userVdws&&
(e=this.vwr.getDefaultVdwNameOrData(0,J.c.VDW.USER,this.vwr.bsUserVdws),0<e.length&&(c=!0,b.append(e)));null!=this.vwr.nmrCalculation&&(c=(new Boolean(c|this.vwr.nmrCalculation.getState(b))).valueOf());null!=this.vwr.dm&&(c=(new Boolean(c|this.vwr.dm.getDataState(this,b))).valueOf());if(!c)return"";c="";null!=a&&(a.append("  _setDataState;\n"),c="function _setDataState() {\n",b.append("}\n\n"));return c+b.toString()},"JU.SB");f(d,"getDefinedState",function(a,b){var c=this.vwr.ms,e=c.stateScripts.size();
if(0==e)return"";for(var d=!1,f=new JU.SB,j,h=0;h<e;h++){var l=c.stateScripts.get(h);if(l.inDefinedStateBlock&&0<(j=l.toString()).length)this.app(f,j),d=!0}if(!d)return"";j="";b&&null!=a&&(a.append("  _setDefinedState;\n"),j="function _setDefinedState() {\n\n");null!=a&&f.append("\n}\n\n");return j+f.toString()},"JU.SB,~B");r(d,"getModelState",function(a,b,c){var e=new JU.SB;b&&null!=a&&(a.append("  _setModelState;\n"),e.append("function _setModelState() {\n"));var d,f=this.vwr.ms,j=f.bo,h=f.am,l=
f.mc;if(b){for(var q=f.stateScripts.size(),k=0;k<q;k++){var m=f.stateScripts.get(k);!m.inDefinedStateBlock&&0<(d=m.toString()).length&&this.app(e,d)}d=new JU.SB;q=!1;if(null!=f.unitCells){m=!1;for(k=0;k<l;k++){var n=f.getUnitCell(k);null!=n&&(d.setLength(0),n.getState(f,k,d)&&(q=!0,e.append("  frame ").append(f.getModelNumberDotted(k)).appendSB(d).append(";\n")),m=(new Boolean(m|0<=this.vwr.ms.getLastVibrationVector(k,1275072532))).valueOf())}q&&this.vwr.shm.loadShape(33);this.getShapeStatePriv(e,
b,33);if(m){q=new java.util.Hashtable;for(k=l;0<=--k;)if(0<=(m=this.vwr.ms.getLastVibrationVector(k,1275072532)))for(n=h[k].firstAtomIndex;n<=m;n++){var r=f.getModulation(n);null!=r&&JU.BSUtil.setMapBitSet(q,n,n,r.getState())}e.append(this.getCommands(q,null,"select"))}}d.setLength(0);for(k=0;k<f.bondCount;k++)if(null!=j[k]&&!h[j[k].atom1.mi].isModelKit&&(j[k].isHydrogen()||0!=(j[k].order&131072)))q=j[k],m=q.atom1.i,q.atom1.group.isAdded(m)&&(m=-1-m),d.appendI(m).appendC("\t").appendI(q.atom2.i).appendC("\t").appendI(q.order&
131071).appendC("\t").appendD(q.mad/1E3).appendC("\t").appendD(q.getEnergy()).appendC("\t").append(JU.Edge.getBondOrderNameFromOrder(q.order)).append(";\n");0<d.length()&&e.append('data "connect_atoms"\n').appendSB(d).append('end "connect_atoms";\n');e.append("\n")}if(f.haveHiddenBonds){d=new JM.BondSet;for(k=f.bondCount;0<=--k;)null!=j[k]&&(0!=j[k].mad&&0==(j[k].shapeVisibilityFlags&JM.Bond.myVisibilityFlag))&&d.set(k);d.isEmpty()?f.haveHiddenBonds=!1:e.append("  hide ").append(JU.Escape.eBond(d)).append(";\n")}this.vwr.setModelVisibility();
c&&e.append(f.getProteinStructureState(null,b?1073742327:1073742158));for(k=0;k<l;k++)null!=h[k].mat4&&e.append("  frame orientation "+f.getModelNumberDotted(k)+JU.Escape.matrixToScript(h[k].mat4)+";\n");this.getShapeStatePriv(e,b,2147483647);if(b){c=!1;for(k=0;k<l;k++)if(h[k].isJmolDataFrame){c=!0;break}d=new JU.SB;for(k=0;k<l;k++)j=h[k],d.setLength(0),q=f.getInfo(k,"modelID"),null!=q&&!q.equals(f.getInfo(k,"modelID0"))&&d.append("  frame ID ").append(JU.PT.esc(q)).append(";\n"),q=f.frameTitles[k],
null!=q&&0<q.length&&d.append("  frame title ").append(JU.PT.esc(q)).append(";\n"),c&&(null!=j.orientation&&!f.isTrajectorySubFrame(k))&&d.append("  ").append(j.orientation.getMoveToText(!1)).append(";\n"),0!=j.frameDelay&&!f.isTrajectorySubFrame(k)&&d.append("  frame delay ").appendF(j.frameDelay/1E3).append(";\n"),null!=j.simpleCage&&(d.append("  unitcell ").append(JU.Escape.eAP(j.simpleCage.getUnitCellVectors())).append(";\n"),this.getShapeStatePriv(d,b,33)),0<d.length()&&e.append("  frame "+f.getModelNumberDotted(k)+
";\n").appendSB(d);e.append("  set fontScaling "+this.vwr.getBoolean(603979847)+";\n");this.vwr.is2D()&&e.append("  set mode2d TRUE;\n")}null!=a&&e.append("\n}\n\n");return e.toString()},"JU.SB,~B,~B");f(d,"getWindowState",function(a,b,c){var e=this.vwr.g,d=new JU.SB;null!=a&&(a.append("  initialize;\n  set refreshing false;\n  _setWindowState;\n"),d.append("\nfunction _setWindowState() {\n"));0!=b&&d.append("# preferredWidthHeight ").appendI(b).append(" ").appendI(c).append(";\n");d.append("# width ").appendI(0==
b?this.vwr.getScreenWidth():b).append(";\n# height ").appendI(0==c?this.vwr.getScreenHeight():c).append(";\n");this.app(d,"stateVersion = "+JV.JC.versionInt);this.app(d,"background "+JU.Escape.escapeColor(e.objColors[0]));for(b=1;7>b;b++)0!=e.objColors[b]&&this.app(d,JV.StateManager.getObjectNameFromId(b)+'Color = "'+JU.Escape.escapeColor(e.objColors[b])+'"');null!=e.backgroundImageFileName&&this.app(d,"background IMAGE "+(e.backgroundImageFileName.startsWith(";base64,")?"":"/*file*/")+JU.PT.esc(e.backgroundImageFileName));
d.append(this.getLightingState(!1));null!=a&&d.append("}\n\n");return d.toString()},"JU.SB,~N,~N");r(d,"getLightingState",function(a){var b=new JU.SB,c=this.vwr.gdata;this.app(b,"set ambientPercent "+c.getAmbientPercent());this.app(b,"set diffusePercent "+c.getDiffusePercent());this.app(b,"set specular "+c.getSpecular());this.app(b,"set specularPercent "+c.getSpecularPercent());this.app(b,"set specularPower "+c.getSpecularPower());var e=c.getSpecularExponent(),d=c.getPhongExponent();this.app(b,Math.pow(2,
e)==d?"set specularExponent "+e:"set phongExponent "+d);this.app(b,"set celShading "+c.getCel());this.app(b,"set celShadingPower "+c.getCelPower());this.app(b,"set zShadePower "+this.vwr.g.zShadePower);a&&this.getZshadeState(b,this.vwr.tm,!0);return b.toString()},"~B");f(d,"getFileState",function(a){var b=new JU.SB;null!=a&&(a.append("  _setFileState;\n"),b.append("function _setFileState() {\n\n"));0>b.indexOf("append")&&this.vwr.getModelSetFileName().equals("zapped")&&b.append("  zap;\n");this.appendLoadStates(b);
null!=a&&b.append("\n}\n\n");return b.toString()},"JU.SB");f(d,"appendLoadStates",function(a){var b=this.vwr.ligandModelSet;if(null!=b)for(var c,b=b.keySet().iterator();b.hasNext()&&((c=b.next())||1);){var e=this.vwr.ligandModels.get(c+"_data");null!=e&&a.append("  ").append(JU.Escape.encapsulateData("ligand_"+c,e.trim()+"\n",0));e=this.vwr.ligandModels.get(c+"_file");null!=e&&a.append("  ").append(JU.Escape.encapsulateData("file_"+c,e.trim()+"\n",0))}var b=new JU.SB,e=this.vwr.ms,d=e.am,f=e.mc;for(c=
0;c<f;c++)if(!e.isJmolDataFrame(c)&&!e.isTrajectorySubFrame(c)){var j=d[c],h=b.indexOf(j.loadState);(0>h||h!=b.lastIndexOf(j.loadState))&&b.append(d[c].loadState);if(d[c].isModelKit)h=e.getModelAtomBitSetIncludingDeleted(c,!1),null!=e.tainted&&(null!=e.tainted[2]&&e.tainted[2].andNot(h),null!=e.tainted[3]&&e.tainted[3].andNot(h)),j.loadScript=new JU.SB,this.getInlineData(b,this.vwr.getModelExtract(h,!1,!0,"MOL"),0<c,null,null);else if(b.appendSB(j.loadScript),h=j.auxiliaryInfo.get("auxFiles"),null!=
h)for(j=0;j<h.size();j++)b.append(";#FILE1="+JU.PT.esc(h.get(j))+";")}b=b.toString();if(0>b.indexOf('data "append ')){c=b.indexOf("load /*data*/");j=b.indexOf("load /*file*/");0<=j&&j<c&&(c=j);if(0<=(j=b.indexOf('load "@'))&&j<c)c=j;0<=c&&(b=b.substring(0,c)+"zap;"+b.substring(c))}a.append(b)},"JU.SB");r(d,"getInlineData",function(a,b,c,e,d){c=(c?"append"+(null!=e&&e.intValue()!=this.vwr.ms.mc-1?" modelindex="+e:""):"model")+" inline";a.append('load /*data*/ data "').append(c).append('"\n').append(b).append('end "').append(c).append(null==
d||0==d.length?"":" filter"+JU.PT.esc(d)).append('";')},"JU.SB,~S,~B,Integer,~S");f(d,"getColorState",function(a,b){var c=new JU.SB,e=this.getCEState(a.ce,c);0<e&&null!=b&&b.append("\n  _setColorState\n");return 0<e&&null!=b?"function _setColorState() {\n"+c.append("}\n\n").toString():c.toString()},"JV.ColorManager,JU.SB");f(d,"getCEState",function(a,b){for(var c=0,e,d=a.schemes.entrySet().iterator();d.hasNext()&&((e=d.next())||1);){var f=e.getKey();0<f.length&&(!f.startsWith("=")&&0<=c++)&&b.append('color "'+
f+"="+JU.ColorEncoder.getColorSchemeList(e.getValue())+'";\n')}return c},"JU.ColorEncoder,JU.SB");f(d,"getAnimState",function(a,b){var c=this.vwr.ms.mc;if(2>c)return"";var e=new JU.SB;null!=b&&(b.append("  _setFrameState;\n"),e.append("function _setFrameState() {\n"));e.append("# frame state;\n");e.append("# modelCount ").appendI(c).append(";\n# first ").append(this.vwr.getModelNumberDotted(0)).append(";\n# last ").append(this.vwr.getModelNumberDotted(c-1)).append(";\n");0<=a.backgroundModelIndex&&
this.app(e,"set backgroundModel "+this.vwr.getModelNumberDotted(a.backgroundModelIndex));if(null!=this.vwr.tm.bsFrameOffsets)this.app(e,"frame align "+JU.Escape.eBS(this.vwr.tm.bsFrameOffsets));else if(null!=this.vwr.ms.translations)for(;0<=--c;){var d=this.vwr.ms.getTranslation(c);null!=d&&this.app(e,"frame "+this.vwr.ms.getModelNumberDotted(c)+" align "+d)}this.app(e,"frame RANGE "+a.getModelSpecial(-1)+" "+a.getModelSpecial(1));this.app(e,"animation DIRECTION "+(1==a.animationDirection?"+1":"-1"));
this.app(e,"animation FPS "+a.animationFps);this.app(e,"animation MODE "+JS.T.nameOf(a.animationReplayMode)+" "+a.firstFrameDelay+" "+a.lastFrameDelay);0<a.morphCount&&this.app(e,"animation MORPH "+a.morphCount);c=!0;null!=a.animationFrames&&(this.app(e,"anim frames "+JU.Escape.eAI(a.animationFrames)),c=a.caf,this.app(e,"frame "+(c+1)),c=a.cmi!=a.modelIndexForFrame(c));c&&(c=a.getModelSpecial(0),this.app(e,c.equals("0")?"frame *":"model "+c));this.app(e,"animation "+(!a.animationOn?"OFF":1==a.currentDirection?
"PLAY":"PLAYREV"));a.animationOn&&a.animationPaused&&this.app(e,"animation PAUSE");a.splitFrame&&this.app(e,"frame "+this.vwr.getModelNumberDotted(a.getSplitFrameModelIndex(0))+" "+this.vwr.getModelNumberDotted(a.getSplitFrameModelIndex(1))+" split");null!=b&&e.append("}\n\n");return e.toString()},"JV.AnimationManager,JU.SB");f(d,"getParameterState",function(a,b){var c=Array(a.htBooleanParameterFlags.size()+a.htNonbooleanParameterValues.size()),e=new JU.SB;null!=b&&(b.append("  _setParameterState;\n"),
e.append("function _setParameterState() {\n\n"));for(var d=0,f,j=a.htBooleanParameterFlags.keySet().iterator();j.hasNext()&&((f=j.next())||1);)JV.GlobalSettings.doReportProperty(f)&&(c[d++]="set "+f+" "+a.htBooleanParameterFlags.get(f));for(j=a.htNonbooleanParameterValues.keySet().iterator();j.hasNext()&&((f=j.next())||1);)if(JV.GlobalSettings.doReportProperty(f)){var h=a.htNonbooleanParameterValues.get(f);"="==f.charAt(0)?f=f.substring(1):(f=(0==f.indexOf("default")?" ":"")+"set "+f,h=JU.Escape.e(h));
c[d++]=f+" "+h}switch(a.axesMode){case 603979808:c[d++]="set axes unitcell";break;case 603979804:c[d++]="set axes molecular";break;default:c[d++]="set axes window"}java.util.Arrays.sort(c,0,d);for(f=0;f<d;f++)null!=c[f]&&this.app(e,c[f]);c=JV.StateManager.getVariableList(a.htUserVariables,0,!1,!0);0<c.length&&(e.append("\n#user-defined atom sets; \n"),e.append(c));null!=this.vwr.shm.getShape(5)&&e.append(this.getDefaultLabelState(this.vwr.shm.shapes[5]));a.haveSetStructureList&&(c=a.structureList,
e.append("struture HELIX set "+JU.Escape.eAF(c.get(J.c.STR.HELIX))),e.append("struture SHEET set "+JU.Escape.eAF(c.get(J.c.STR.SHEET))),e.append("struture TURN set "+JU.Escape.eAF(c.get(J.c.STR.TURN))));null!=b&&e.append("\n}\n\n");return e.toString()},"JV.GlobalSettings,JU.SB");f(d,"getDefaultLabelState",function(a){var b=(new JU.SB).append("\n# label defaults;\n");this.app(b,"select none");this.app(b,J.shape.Shape.getColorCommand("label",a.defaultPaletteID,a.defaultColix,a.translucentAllowed));
this.app(b,"background label "+J.shape.Shape.encodeColor(a.defaultBgcolix));this.app(b,"set labelOffset "+JV.JC.getXOffset(a.defaultOffset)+" "+JV.JC.getYOffset(a.defaultOffset));var c=JV.JC.getHorizAlignmentName(a.defaultAlignment);this.app(b,"set labelAlignment "+(5>c.length?"left":c));c=JV.JC.getPointerName(a.defaultPointer);this.app(b,"set labelPointer "+(0==c.length?"off":c));0!=(a.defaultZPos&32)?this.app(b,"set labelFront"):0!=(a.defaultZPos&16)&&this.app(b,"set labelGroup");this.app(b,J.shape.Shape.getFontCommand("label",
JU.Font.getFont3D(a.defaultFontId)));return b.toString()},"J.shape.Labels");f(d,"getSelectionState",function(a,b){var c=new JU.SB;null!=b&&(b.append("  _setSelectionState;\n"),c.append("function _setSelectionState() {\n"));null!=this.vwr.ms.trajectory&&this.app(c,this.vwr.ms.trajectory.getState());var e=new java.util.Hashtable,d=null;this.addBs(c,"hide ",a.bsHidden);this.addBs(c,"subset ",a.bsSubset);this.addBs(c,"delete ",a.bsDeleted);this.addBs(c,"fix ",a.bsFixed);e.put("-",this.vwr.slm.getSelectedAtomsNoSubset());
d=this.getCommands(e,null,"select");null==d?this.app(c,"select none"):c.append(d);this.app(c,"set hideNotSelected "+a.hideNotSelected);c.append(this.vwr.getShapeProperty(1,"selectionState"));this.vwr.getSelectionHalosEnabled()&&this.app(c,"SelectionHalos ON");null!=b&&c.append("}\n\n");return c.toString()},"JV.SelectionManager,JU.SB");f(d,"getViewState",function(a,b){var c=new JU.SB,e=a.getMoveToText(0,!1);null!=b&&(b.append("  _setPerspectiveState;\n"),c.append("function _setPerspectiveState() {\n"));
this.app(c,"set perspectiveModel "+a.perspectiveModel);this.app(c,"set scaleAngstromsPerInch "+a.scale3DAngstromsPerInch);this.app(c,"set perspectiveDepth "+a.perspectiveDepth);this.app(c,"set visualRange "+a.visualRangeAngstroms);a.isWindowCentered()||this.app(c,"set windowCentered false");this.app(c,"set cameraDepth "+a.cameraDepth);var d=1==a.mode;d&&this.app(c,"set navigationMode true");this.app(c,this.vwr.ms.getBoundBoxCommand(!1));this.app(c,"center "+JU.Escape.eP(a.fixedRotationCenter));c.append(this.vwr.getOrientation(1073742034,
null,null,null).toString());this.app(c,e);!d&&!a.zoomEnabled&&this.app(c,"zoom off");c.append("  slab ").appendI(a.slabPercentSetting).append(";depth ").appendI(a.depthPercentSetting).append(a.slabEnabled&&!d?";slab on":"").append(";\n");c.append("  set slabRange ").appendF(a.slabRange).append(";\n");null!=a.slabPlane&&c.append("  slab plane ").append(JU.Escape.eP4(a.slabPlane)).append(";\n");null!=a.depthPlane&&c.append("  depth plane ").append(JU.Escape.eP4(a.depthPlane)).append(";\n");this.getZshadeState(c,
a,!1);c.append(this.getSpinState(!0)).append("\n");this.vwr.ms.modelSetHasVibrationVectors()&&a.vibrationOn&&this.app(c,"set vibrationPeriod "+a.vibrationPeriod+";vibration on");e=null!=a.depthPlane||null!=a.slabPlane;d&&c.append(a.getNavigationState());!a.slabEnabled&&e&&c.append("  slab off;\n");null!=b&&c.append("}\n\n");return c.toString()},"JV.TransformManager,JU.SB");f(d,"getZshadeState",function(a,b,c){c&&(this.app(a,"set zDepth "+b.zDepthPercentSetting),this.app(a,"set zSlab "+b.zSlabPercentSetting),
b.zShadeEnabled||this.app(a,"set zShade false"));b.zShadeEnabled&&this.app(a,"set zShade true");try{null!=b.zSlabPoint&&this.app(a,"set zSlab "+JU.Escape.eP(b.zSlabPoint))}catch(e){if(!G(e,Exception))throw e;}},"JU.SB,JV.TransformManager,~B");r(d,"getSpinState",function(){var a=this.vwr.tm,b="  set spinX "+I(a.spinX)+"; set spinY "+I(a.spinY)+"; set spinZ "+I(a.spinZ)+"; set spinFps "+I(a.spinFps)+";";Float.isNaN(a.navFps)||(b+="  set navX "+I(a.navX)+"; set navY "+I(a.navY)+"; set navZ "+I(a.navZ)+
"; set navFps "+I(a.navFps)+";");a.navOn&&(b+=" navigation on;");if(!a.spinOn||a.vectorSpinOnly)return b;var c=a.isSpinSelected?"\n  select "+JU.Escape.eBS(this.vwr.bsA())+";\n  rotateSelected":"\n ";if(a.isSpinInternal){var e=JU.P3.newP(a.internalRotationCenter);e.sub(a.rotationAxis);b+=c+" spin "+a.rotationRate+" "+JU.Escape.eP(a.internalRotationCenter)+" "+JU.Escape.eP(e)}else b=a.isSpinFixed?b+(c+" spin axisangle "+JU.Escape.eP(a.rotationAxis)+" "+a.rotationRate):b+" spin on";return b+";"},"~B");
r(d,"getCommands",function(a,b,c){var e=new JU.SB;a=this.getCommands2(a,e,null,c);null!=b&&this.getCommands2(b,e,a,"select");return e.toString()},"java.util.Map,java.util.Map,~S");f(d,"getCommands2",function(a,b,c,e){if(null==a)return"";var d;for(a=a.entrySet().iterator();a.hasNext()&&((d=a.next())||1);){var f=d.getKey(),j=JU.Escape.eBS(d.getValue());5>j.length||(j=e+" "+j,j.equals(c)||this.app(b,j),c=j,0!=f.indexOf("-")&&this.app(b,f))}return c},"java.util.Map,JU.SB,~S,~S");f(d,"app",function(a,
b){0!=b.length&&a.append("  ").append(b).append(";\n")},"JU.SB,~S");f(d,"addBs",function(a,b,c){null==c||0==c.length()||this.app(a,b+JU.Escape.eBS(c))},"JU.SB,~S,JU.BS");f(d,"getFontState",function(a,b){var c=JV.StateManager.getObjectIdFromName(a.equalsIgnoreCase("axes")?"axis":a);if(0>c)return"";var e=this.vwr.getObjectMad10(c),c=(new JU.SB).append("\n");this.app(c,a+(0==e?" off":1==e?" on":-1==e?" dotted":20>e?" "+e:" "+e/2E4));if(3>c.length())return"";e=J.shape.Shape.getFontCommand(a,b);0<e.length&&
(e="  "+e+";\n");return c+e},"~S,JU.Font");f(d,"appendTickInfo",function(a,b,c){b.append("  ");b.append(a);JV.StateCreator.addTickInfo(b,c,!1);b.append(";\n")},"~S,JU.SB,JM.TickInfo");d.addTickInfo=f(d,"addTickInfo",function(a,b,c){a.append(" ticks ").appendC(b.type).append(" ").append(JU.Escape.eP(b.ticks));var e=null!=b.scale&&Float.isNaN(b.scale.x);e&&a.append(" UNITCELL");null!=b.tickLabelFormats&&a.append(" format ").append(JU.Escape.eAS(b.tickLabelFormats,!1));!e&&null!=b.scale&&a.append(" scale ").append(JU.Escape.eP(b.scale));
c&&(!Float.isNaN(b.first)&&0!=b.first)&&a.append(" first ").appendF(b.first);null!=b.reference&&a.append(" point ").append(JU.Escape.eP(b.reference))},"JU.SB,JM.TickInfo,~B");f(d,"getMeasurementState",function(a){var b=a.measurements,c=a.measurementCount,e=a.font3d,d=a.defaultTickInfo,f=new JU.SB;this.app(f,"measures delete");for(var j=0;j<c;j++){var h=b.get(j),l=null!=h.property;if(!l||!Float.isNaN(h.value)){var q=h.count,k=(new JU.SB).append("measure");null!=h.thisID&&k.append(" ID ").append(JU.PT.esc(h.thisID));
0!=h.mad&&k.append(" radius ").appendF(null==h.thisID||0<h.mad?h.mad/2E3:0);0!=h.colix&&k.append(" color ").append(JU.Escape.escapeColor(JU.C.getArgb(h.colix)));null!=h.text&&(null!=h.text.font&&k.append(" font ").append(h.text.font.getInfo()),0!=h.text.align&&k.append(" align ").append(JV.JC.getHorizAlignmentName(h.text.align)),null!=h.text.getPymolOffset()&&k.append(" offset ").append(JU.Escape.eAF(h.text.getPymolOffset())));var m=h.tickInfo;null!=m&&JV.StateCreator.addTickInfo(k,m,!0);for(m=1;m<=
q;m++)k.append(" ").append(h.getLabel(m,!0,!0));l?k.append(" "+h.property+" value "+(Float.isNaN(h.value)?0:h.value)).append(" "+JU.PT.esc(h.getString())):2==q&&(h=h.getDistanceFormatForState(),null!=h&&k.append(" ").append(JU.PT.esc(h)));l||k.append("; # "+a.getInfoAsString(j));this.app(f,k.toString())}}this.app(f,J.shape.Shape.getFontCommand("measures",e));e=0;l=new java.util.Hashtable;k=JU.BS.newN(c);for(j=0;j<c;j++)h=b.get(j),h.isHidden&&(e++,k.set(j)),null!=a.bsColixSet&&a.bsColixSet.get(j)&&
JU.BSUtil.setMapBitSet(l,j,j,J.shape.Shape.getColorCommandUnk("measure",h.colix,a.translucentAllowed));if(0<e)if(e==c)this.app(f,"measures off; # lines and numbers off");else for(j=0;j<c;j++)k.get(j)&&JU.BSUtil.setMapBitSet(l,j,j,"measure off");null!=d&&(f.append(" measure "),JV.StateCreator.addTickInfo(f,d,!0),f.append(";\n"));0<=a.mad&&f.append(" set measurements ").appendF(a.mad/2E3).append(";\n");h=this.getCommands(l,null,"select measures");null!=h&&0!=h.length&&(f.append(h),this.app(f,"select measures ({null})"));
return f.toString()},"J.shape.Measures");f(d,"getShapeStatePriv",function(a,b,c){var e=this.vwr.shm.shapes;if(null!=e){var d;2147483647==c?(c=0,d=37):d=c+1;for(;c<d;++c){var f=e[c];if(null!=f&&(b||9<=c&&16>c))f=this.getShapeState(f),null!=f&&1<f.length&&a.append(f)}a.append("  select *;\n")}},"JU.SB,~B,~N");f(d,"getBondState",function(a){var b=a.bsOrderSet,c=a.reportAll;this.clearTemp();var e=this.vwr.ms,d=e.bo,f=e.bondCount,j;if(c||null!=a.bsSizeSet)for(e=c?f-1:a.bsSizeSet.nextSetBit(0);0<=e;e=c?
e-1:a.bsSizeSet.nextSetBit(e+1))null!=d[e]&&JU.BSUtil.setMapBitSet(this.temp,e,e,"wireframe "+(1==(j=d[e].mad)?"on":""+JU.PT.escF(j/2E3)));if(c||null!=b)for(e=c?f-1:b.nextSetBit(0);0<=e;e=c?e-1:b.nextSetBit(e+1))j=d[e],null!=j&&(c||0==(j.order&131072))&&JU.BSUtil.setMapBitSet(this.temp,e,e,"bondOrder "+JU.Edge.getBondOrderNameFromOrder(j.order));if(null!=a.bsColixSet)for(e=a.bsColixSet.nextSetBit(0);0<=e;e=a.bsColixSet.nextSetBit(e+1))null!=d[e]&&(b=d[e].colix,2==(b&-30721)?JU.BSUtil.setMapBitSet(this.temp,
e,e,J.shape.Shape.getColorCommand("bonds",J.c.PAL.CPK.id,b,a.translucentAllowed)):JU.BSUtil.setMapBitSet(this.temp,e,e,J.shape.Shape.getColorCommandUnk("bonds",b,a.translucentAllowed)));a=this.getCommands(this.temp,null,"select /*16.2*/ BONDS")+"\n";this.clearTemp();return a},"J.shape.Sticks");f(d,"clearTemp",function(){this.temp.clear();this.temp2.clear()});f(d,"getShapeState",function(a){var b;switch(a.shapeID){case 34:b=this.getAxesState(a);break;case 33:if(!this.vwr.ms.haveUnitCells)return"";
a=b=this.getFontLineShapeState(a);var c=this.vwr.am.getUnitCellAtomIndex();0<=c&&(b+="  unitcell ({"+c+"});\n");c=this.vwr.getCurrentUnitCell();null!=c&&(b+=c.getUnitCellState(),b+=a);break;case 32:b=this.getFontLineShapeState(a);break;case 36:b=this.getFontState(a.myType,a.baseFont3d);break;case 6:b=this.getMeasurementState(a);break;case 7:case 18:b=this.getAtomShapeState(a);break;case 1:b=this.getBondState(a);break;case 31:b=new JU.SB;b.append('\n  set echo off;set echo "%SCALE" off;\n');this.getEchoState(b,
a.scaleObject);var c=!1,e;for(a=a.objects.values().iterator();a.hasNext()&&((e=a.next())||1);)c=(new Boolean(c|this.getEchoState(b,e))).valueOf();c&&b.append("  modelkit OFF;//to check for element keys\n");b=b.toString();break;case 8:b=this.getAtomShapeState(a)+(2==a.colixSelection?"":0==a.colixSelection?"  color SelectionHalos NONE;\n":J.shape.Shape.getColorCommandUnk("selectionHalos",a.colixSelection,a.translucentAllowed)+";\n");null!=a.bsHighlight&&(b+="  set highlight "+JU.Escape.eBS(a.bsHighlight)+
"; "+J.shape.Shape.getColorCommandUnk("highlight",a.colixHighlight,a.translucentAllowed)+";\n");break;case 35:this.clearTemp();if(null!=a.atomFormats){c=this.vwr.ms.at;for(b=this.vwr.ms.ac;0<=--b;)null==c[b]&&(a.atomFormats[b]=null),null!=a.atomFormats[b]&&JU.BSUtil.setMapBitSet(this.temp,b,b,"set hoverLabel "+JU.PT.esc(a.atomFormats[b]))}b="\n  hover "+JU.PT.esc(null==a.labelFormat?"":a.labelFormat)+";\n"+this.getCommands(this.temp,null,"select");this.clearTemp();break;case 5:if(!a.isActive||null==
a.bsSizeSet)return"";this.clearTemp();var d=this.vwr.getAllAtoms(),c=!1;for(b=a.bsSizeSet.nextSetBit(0);0<=b;b=a.bsSizeSet.nextSetBit(b+1))if(d.get(b)){e=a.getLabel(b);var f="label ";null==e?f+=JU.PT.esc(a.formats[b]):(f+=JU.PT.esc(e.textUnformatted),null!=e.getPymolOffset()&&(f+=";set labelOffset "+JU.Escape.eAF(e.getPymolOffset())));JU.BSUtil.setMapBitSet(this.temp,b,b,f);null!=a.bsColixSet&&a.bsColixSet.get(b)&&JU.BSUtil.setMapBitSet(this.temp2,b,b,J.shape.Shape.getColorCommand("label",a.paletteIDs[b],
a.colixes[b],a.translucentAllowed));null!=a.bsBgColixSet&&a.bsBgColixSet.get(b)&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"background label "+J.shape.Shape.encodeColor(a.bgcolixes[b]));e=a.getLabel(b);e=null!=e?e.scalePixelsPerMicron:0;0<e&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"set labelScaleReference "+1E4/e);if(null!=a.offsets&&a.offsets.length>b){e=a.offsets[b];JU.BSUtil.setMapBitSet(this.temp2,b,b,"set "+(JV.JC.isOffsetAbsolute(e)?"labelOffsetAbsolute ":"labelOffset ")+JV.JC.getXOffset(e)+" "+JV.JC.getYOffset(e));
var f=JV.JC.getHorizAlignmentName(e>>2),j=JV.JC.getPointerName(e);0<j.length&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"set labelPointer "+j);0!=(e&32)?JU.BSUtil.setMapBitSet(this.temp2,b,b,"set labelFront"):0!=(e&16)&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"set labelGroup");0<f.length&&JU.BSUtil.setMapBitSet(this.temp3,b,b,"set labelAlignment "+f)}null!=a.mads&&0>a.mads[b]&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"set toggleLabel");null!=a.bsFontSet&&a.bsFontSet.get(b)&&(e=JU.Font.getFont3D(a.fids[b]),
0<e.fontSizeAngstroms&&(c=!0),JU.BSUtil.setMapBitSet(this.temp4,b,b,J.shape.Shape.getFontCommand("label",e)))}a=this.getCommands(null,this.temp4,"select");c&&(a="  try{\n"+a+"  }catch{}\n");b=this.getCommands(this.temp,this.temp2,"select")+a+this.getCommands(null,this.temp3,"select");this.temp4.clear();this.temp3.clear();this.clearTemp();break;case 0:this.clearTemp();c=this.vwr.ms.ac;d=this.vwr.ms.at;e=a.colixes;f=a.paletteIDs;for(b=j=0;b<c;b++)if(null!=d[b]&&(null!=a.bsSizeSet&&a.bsSizeSet.get(b)&&
(0>(j=d[b].madAtom)?JU.BSUtil.setMapBitSet(this.temp,b,b,"Spacefill on"):JU.BSUtil.setMapBitSet(this.temp,b,b,"Spacefill "+JU.PT.escF(j/2E3))),null!=a.bsColixSet&&a.bsColixSet.get(b))){var h=d[b].paletteID;(h!=J.c.PAL.CPK.id||JU.C.isColixTranslucent(d[b].colixAtom))&&JU.BSUtil.setMapBitSet(this.temp,b,b,J.shape.Shape.getColorCommand("atoms",h,d[b].colixAtom,a.translucentAllowed));null!=e&&b<e.length&&JU.BSUtil.setMapBitSet(this.temp2,b,b,J.shape.Shape.getColorCommand("balls",f[b],e[b],a.translucentAllowed))}b=
this.getCommands(this.temp,this.temp2,"select");this.clearTemp();break;default:b=a.getShapeState()}return b},"J.shape.Shape");f(d,"getFontLineShapeState",function(a){var b=this.getFontState(a.myType,a.font3d);if(null==a.tickInfos)return b;var c=0<=b.indexOf(" off"),e=new JU.SB;e.append(b);for(b=0;4>b;b++)null!=a.tickInfos[b]&&this.appendTickInfo(a.myType,e,a.tickInfos[b]);c&&e.append("  "+a.myType+" off;\n");return e.toString()},"J.shape.FontLineShape");f(d,"getAxesState",function(a){var b=new JU.SB;
b.append(this.getFontLineShapeState(a));return a.getAxesState(b)},"J.shape.Axes");r(d,"getAtomShapeState",function(a){if(!a.isActive)return"";this.clearTemp();var b=JV.JC.shapeClassBases[a.shapeID],c=18==a.shapeID,e,d=this.vwr.getAllAtoms();if(null!=a.bsSizeSet)for(var f=a.bsSizeSet.nextSetBit(0);0<=f;f=a.bsSizeSet.nextSetBit(f+1))d.get(f)&&JU.BSUtil.setMapBitSet(this.temp,f,f,b+" "+(0>(e=a.mads[f])?c&&-1>e?""+-e:"on":JU.PT.escF(e/2E3)));if(null!=a.bsColixSet)for(f=a.bsColixSet.nextSetBit(0);0<=f;f=
a.bsColixSet.nextSetBit(f+1))JU.BSUtil.setMapBitSet(this.temp2,f,f,J.shape.Shape.getColorCommand(b,a.paletteIDs[f],a.colixes[f],a.translucentAllowed));a=this.getCommands(this.temp,this.temp2,"select");this.clearTemp();return a},"J.shape.AtomShape");f(d,"getEchoState",function(a,b){var c=null!=b&&0<b.barPixels,e=null==b?null:c?b.textUnformatted:b.getStateText();if(null==e||!b.isEcho||b.target.equals("error"))return!1;var d=null!=b.image,f=null,j="set echo ID "+JU.PT.esc(c?"%SCALE":b.target);switch(b.valign){case 3:f=
2147483647==b.movableXPercent||2147483647==b.movableYPercent?(2147483647==b.movableXPercent?b.movableX+" ":b.movableXPercent+"% ")+(2147483647==b.movableYPercent?b.movableY+"":b.movableYPercent+"%"):"["+b.movableXPercent+" "+b.movableYPercent+"%]";case 4:null==f&&(f=JU.Escape.eP(b.xyz));a.append("  ").append(j).append(" ").append(f);4!=b.align&&a.append(";  ").append(j).append(" ").append(JV.JC.getHorizAlignmentName(b.align));break;default:a.append("  set echo ").append(JV.JC.getEchoName(b.valign)).append(" ").append(JV.JC.getHorizAlignmentName(b.align))}2147483647!=
b.movableZPercent&&a.append(";  ").append(j).append(" depth ").appendI(b.movableZPercent);d?a.append("; ").append(j).append(" IMAGE /*file*/"):a.append("; echo ");a.append(JU.PT.esc(e));a.append(";\n");d&&1!=b.imageScale&&a.append("  ").append(j).append(" scale ").appendF(b.imageScale).append(";\n");null!=b.script&&a.append("  ").append(j).append(" script ").append(JU.PT.esc(b.script)).append(";\n");0<=b.modelIndex&&a.append("  ").append(j).append(" model ").append(this.vwr.getModelNumberDotted(b.modelIndex)).append(";\n");
null!=b.pointerPt&&a.append("  ").append(j).append(" point ").append(x(b.pointerPt,"JM.Atom")?"({"+b.pointerPt.i+"})":JU.Escape.eP(b.pointerPt)).append(";\n");null!=b.getPymolOffset()&&a.append("  ").append(j).append(" offset ").append(JU.Escape.escapeFloatA(b.getPymolOffset(),!0)).append(";\n");b.appendFontCmd(a);a.append("; color echo");JU.C.isColixTranslucent(b.colix)&&a.append(" ").append(JU.C.getColixTranslucencyLabel(b.colix));a.append(" ").append(JU.C.getHexCode(b.colix));0!=b.bgcolix&&(a.append("; color echo background "),
JU.C.isColixTranslucent(b.bgcolix)&&a.append(JU.C.getColixTranslucencyLabel(b.bgcolix)).append(" "),a.append(JU.C.getHexCode(b.bgcolix)));a.append(";\n");b.hidden&&(c?a.append('  set echo "%SCALE" hidden;\n'):a.append("  set echo ID ").append(JU.PT.esc(b.target)).append(" hidden;\n"));return b.target.startsWith("_!_elkey_")},"JU.SB,JM.Text");r(d,"getAllSettings",function(a){for(var b=this.vwr.g,c=new JU.SB,e=Array(b.htBooleanParameterFlags.size()+b.htNonbooleanParameterValues.size()+b.htUserVariables.size()),
d=0,f="_"+a,j,h=b.htBooleanParameterFlags.keySet().iterator();h.hasNext()&&((j=h.next())||1);)if(null==a||0==j.indexOf(a)||0==j.indexOf(f))e[d++]=(0==j.indexOf("_")?j+" = ":"set "+j+" ")+b.htBooleanParameterFlags.get(j);for(h=b.htNonbooleanParameterValues.keySet().iterator();h.hasNext()&&((j=h.next())||1);)if("@"!=j.charAt(0)&&(null==a||0==j.indexOf(a)||0==j.indexOf(f))){var l=b.htNonbooleanParameterValues.get(j);"string"==typeof l&&(l=JV.StateCreator.chop(JU.PT.esc(l)));e[d++]=(0==j.indexOf("_")?
j+" = ":"set "+j+" ")+l}for(h=b.htUserVariables.keySet().iterator();h.hasNext()&&((j=h.next())||1);)if(null==a||0==j.indexOf(a))l=b.htUserVariables.get(j),f=l.escape(),e[d++]=j+" "+(j.startsWith("@")?"":"= ")+(4==l.tok?JV.StateCreator.chop(JU.PT.esc(f)):f);java.util.Arrays.sort(e,0,d);for(a=0;a<d;a++)null!=e[a]&&this.app(c,e[a]);c.append("\n");return c.toString()},"~S");d.chop=f(d,"chop",function(a){var b=a.length;if(512>b)return a;for(var c=new JU.SB,e=0,d=72;d<b;e=d,d+=72){for(;"\\"==a.charAt(d-
1);)d++;c.append(0==e?"":'"\\\n    + "').append(a.substring(e,d))}c.append('"\\\n    + "').append(a.substring(e,b));return c.toString()},"~S");r(d,"getFunctionCalls",function(a){null==a&&(a="");var b=new JU.SB,c=a.indexOf("*"),e=0<=c,d=JV.Viewer.isStaticFunction(a),f=a.equalsIgnoreCase("names")||a.equalsIgnoreCase("static_names");f&&(a="");e&&(a=a.substring(0,c));a=a.toLowerCase();(d||0==a.length)&&this.addFunctions(b,JV.Viewer.staticFunctions,a,e,f);(!d||0==a.length)&&this.addFunctions(b,this.vwr.localFunctions,
a,e,f);return b.toString()},"~S");f(d,"addFunctions",function(a,b,c,e,d){for(var f=Array(b.size()),j=0,h,l=b.keySet().iterator();l.hasNext()&&((h=l.next())||1);)if(0==c.length&&!h.startsWith("_")||h.equalsIgnoreCase(c)||e&&0==h.toLowerCase().indexOf(c))f[j++]=h;java.util.Arrays.sort(f,0,j);for(c=0;c<j;c++)e=b.get(f[c]),a.append(d?e.getSignature():e.toString()),a.appendC("\n")},"JU.SB,java.util.Map,~S,~B,~B");d.isTainted=f(d,"isTainted",function(a,b,c){return null!=a&&null!=a[c]&&a[c].get(b)},"~A,~N,~N");
r(d,"getAtomicPropertyState",function(a,b){for(var c,e=new JU.SB,d=0;18>d;d++)if(0>a||d==a)null!=(c=null!=b?b:this.vwr.ms.getTaintedAtoms(d))&&this.getAtomicPropertyStateBuffer(e,d,c,null,null);return e.toString()},"~N,JU.BS");r(d,"getAtomicPropertyStateBuffer",function(a,b,c,e,d){if(this.vwr.g.preserveState){var f=new JU.SB;e=(null==e?JM.AtomCollection.userSettableValues[b]:e)+" set";var j=0,h=2==b,l=this.vwr.ms.at,q=this.vwr.ms.tainted;if(null!=c)for(var k=c.nextSetBit(0);0<=k;k=c.nextSetBit(k+
1))if(!(k>=l.length||JM.AtomCollection.isDeleted(l[k]))){f.appendI(k+1).append(" ").append(l[k].getElementSymbol()).append(" ").append(l[k].getInfo().$replace(" ","_")).append(" ");switch(b){case 18:k<d.length&&f.appendF(d[k]);break;case 13:f.appendI(l[k].getAtomNumber());break;case 16:f.append(l[k].getChainIDStr());break;case 15:f.appendI(l[k].group.getResno());break;case 14:f.appendI(l[k].getSeqID());break;case 0:f.append(l[k].getAtomName());break;case 1:f.append(l[k].getAtomType());break;case 2:JV.StateCreator.isTainted(q,
k,2)&&(h=!1);f.appendF(l[k].x).append(" ").appendF(l[k].y).append(" ").appendF(l[k].z);break;case 12:var m=l[k].getVibrationVector();if(null==m)f.append("0 0 0");else if(Float.isNaN(m.modScale)){switch(m.modDim){case -3:continue}f.appendF(m.x).append(" ").appendF(m.y).append(" ").appendD(m.z).append(" ").appendD(m.modDim).append(" ").appendF(m.magMoment)}else f.appendF(1.4E-45).append(" ").appendD(1.4E-45).append(" ").appendD(m.modScale);break;case 17:f.appendI(l[k].getAtomSite());break;case 3:f.appendI(l[k].getAtomicAndIsotopeNumber());
break;case 4:f.appendI(l[k].getFormalCharge());break;case 6:f.appendF(l[k].getBondingRadius());break;case 7:f.appendI(l[k].getOccupancy100());break;case 8:f.appendF(l[k].getPartialCharge());break;case 9:f.appendF(l[k].getBfactor100()/100);break;case 10:f.appendI(l[k].getValence());break;case 11:f.appendF(l[k].getVanderwaalsRadiusFloat(this.vwr,J.c.VDW.AUTO))}f.append(" ;\n");++j}0!=j&&(h&&(e+="(default)"),a.append('\n  DATA "'+e+'"\n').appendI(j).append(" ;\nJmol Property Data Format 1 -- Jmol ").append(JV.Viewer.getJmolVersion()).append(";\n"),
a.appendSB(f),a.append('  end "'+e+'";\n'))}},"JU.SB,~N,JU.BS,~S,~A");r(d,"undoMoveAction",function(a,b){switch(a){case 4165:case 4140:switch(b){case 1275068425:return(4165==a?this.actionStates:this.actionStatesRedo).size();case -2:this.actionStates.clear();this.actionStatesRedo.clear();break;case -1:(4165==a?this.actionStates:this.actionStatesRedo).clear();break;case 0:b=2147483647;default:100<b&&(b=(4165==a?this.actionStates:this.actionStatesRedo).size());for(var c=0;c<b;c++)this.undoMoveActionClear(0,
a,!0)}}return 0},"~N,~N");r(d,"undoMoveActionClear",function(a,b,c){if(this.vwr.g.preserveState){var e=0<=a&&null!=this.vwr.ms.at[a]?this.vwr.ms.at[a].mi:this.vwr.ms.mc-1;switch(b){case 4140:case 4165:this.vwr.stopMinimization();var d="";switch(b){default:case 4165:d=this.actionStates;a=this.actionStatesRedo;break;case 4140:if(d=this.actionStatesRedo,a=this.actionStates,1==this.actionStatesRedo.size())return}if(0==d.size()||this.undoWorking)return;this.undoWorking=!0;a.add(0,d.removeItemAt(0));d=
this.actionStatesRedo.get(0);4165==b&&1==a.size()&&(a=O(-1,[1]),b=JU.PT.parseIntNext(d,a),a=JU.PT.parseIntNext(d,a),this.undoMoveActionClear(a,b,!1));this.vwr.ms.am[e].isModelKit||0>d.indexOf("zap ")?(JU.Logger.debugging&&this.vwr.log(d),this.vwr.evalStringQuiet(d)):this.actionStates.clear();break;default:if(this.undoWorking&&c)return;this.undoWorking=!0;d=new JU.SB;d.append("#"+b+" "+a+" "+new java.util.Date+"\n");0<=a?(e=this.vwr.getModelUndeletedAtomsBitSet(e),this.vwr.ms.taintAtoms(e,b),d.append(this.getAtomicPropertyState(-1,
null))):(e=this.vwr.getModelUndeletedAtomsBitSet(e),d.append("zap "),d.append(JU.Escape.eBS(e)).append(";"),this.getInlineData(d,this.vwr.getModelExtract(e,!1,!0,"MOL"),!0,null,null),d.append("set refreshing false;").append(this.vwr.acm.getPickingState()).append(this.vwr.tm.getMoveToText(0,!1)).append("set refreshing true;"));c?(this.actionStates.add(0,d.toString()),this.actionStatesRedo.clear()):this.actionStatesRedo.add(1,d.toString());100==this.actionStates.size()&&this.actionStates.removeItemAt(99)}this.undoWorking=
!c}},"~N,~N,~B")});H("JV");$(JV,"JmolStateCreator",null)})(Clazz,Clazz.getClassName,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.newShortArray,
Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAB,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,
Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
