(function(Z,ea,fa,ga,U,ha,I,x,N,L,P,C,ba,T,ia,G,O,S,$,X,W,ja,Y,aa,ka,la,ma,Q,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,e,q){I("J.api");Y(J.api,"JmolParallelProcessor");I("J.api");Y(J.api,"JmolScriptEvaluator");I("J.api");Y(J.api,"JmolScriptFunction");I("J.api");Y(J.api,"JmolScriptManager");I("JS");N(["J.thread.JmolThread"],"JS.CommandWatcherThread",["JU.Logger"],function(){var d=P(function(){this.scriptManager=null;L(this,arguments)},JS,"CommandWatcherThread",
J.thread.JmolThread);T(d,function(){W(this,JS.CommandWatcherThread,[])});q(d,"setManager",function(a,b){this.scriptManager=a;this.setViewer(b,"CommmandWatcherThread");return 0},"~O,JV.Viewer,~O");q(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;}});q(d,"run1",function(){},"~N")});I("JS");N(["J.thread.JmolThread"],"JS.FileLoadThread",["JV.Viewer"],function(){var d=P(function(){this.key=this.cacheName=this.fileName=null;L(this,arguments)},JS,"FileLoadThread",J.thread.JmolThread);T(d,function(a,b,c,f,h){this.setViewer(b,"FileLoadThread");this.fileName=c;this.key=f;this.cacheName=h;this.setEval(a);this.sc.pc--},"J.api.JmolScriptEvaluator,JV.Viewer,~S,~S,~S");q(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");e(d,"setData",function(a,b,c){var f=a.equals("#CANCELED#");this.sc.parentContext.htFileCache.put(this.key,f?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")});I("JS");N(["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 $.JC $.Viewer".split(" "),function(){var d=
P(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;L(this,arguments)},JS,"ScriptCompiler",JS.ScriptTokenParser);X(d,function(){this.vPush=new JU.Lst});T(d,function(a){W(this,JS.ScriptCompiler,[]);this.vwr=a},"JV.Viewer");e(d,"compile",function(a,b,c,f,h,p){this.isCheckOnly=p;this.filename=a;this.isSilent=f;this.script=b;this.isWhere=b.startsWith("w_h_e_r_e = ");this.logMessages=!f&&!c&&h;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");e(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=e(d,"addContextVariable",function(a,b){a.put(b,JS.SV.newS("").setName(b))},"java.util.Map,~S");e(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");e(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");e(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");e(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(Q(-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");e(d,"setAaTokenCompiled",function(){this.aatokenCompiled=this.lltoken.toArray(Array(this.lltoken.size()))});e(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});e(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");e(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");e(d,"lookingAtEndOfLine",function(){return this.ichToken>=this.cchScript?(this.ichEnd=this.cchScript,!0):0<(this.cchToken=this.nCharNewLine(this.ichEnd=
this.ichToken))});e(d,"nCharNewLine",function(a){var b;return"\r"!=(b=this.charAt(a))?"\n"==b?1:0:"\n"==this.charAt(++a)?2:1},"~N");e(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});e(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 f=0>c;if(f&&!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(!f&&";"==a)continue;break}0<=c||"#"==a&&(c=b)}if(0>c)return 0;this.ichComment=c;if(f&&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(f&&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;!f&&(10==this.cchToken&&this.script.substring(this.ichToken,b).equals("//@private"))&&(this.isPrivateScript=!0);return 0==this.nTokens?1:2});e(d,"charAt",function(a){return a<this.cchScript?
this.script.charAt(a):"\x00"},"~N");e(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 f=JS.ContextToken.newContext(!0);this.addTokenToPrefix(this.setCommand(f));this.pushContext(f);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:f=this.ltoken.removeItemAt(2),this.ltoken.add(2,JS.T.o(4,2==f.tok?""+f.intValue:f.value.toString()))}if(0<this.ltoken.size()){if(b&&!this.compileCommand())return 4;this.logMessages&&JU.Logger.info("-------------------------------------");f=!0;switch(this.tokCommand){case 364558:case 102436:case 134320141:case 102409:f=
0<this.atokenInfix.length&&2147483647!=this.atokenInfix[0].intValue}f&&(this.iCommand==this.lnLength&&(this.lineNumbers=JU.AU.doubleLengthShort(this.lineNumbers),f=O(2*this.lnLength,2,0),System.arraycopy(this.lineIndices,0,f,0,this.lnLength),this.lineIndices=f,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 f=null!=
this.flowContext&&0==this.flowContext.addLine,h=(this.endOfLine||!f)&&!this.haveENDIF&&null!=this.flowContext&&this.flowContext.checkForceEndIf(-1);if(this.endOfLine){if(h){if(this.isComment)f||(this.flowContext.addLine++,this.flowContext.forceEndIf=!0);else if(0<c&&!this.haveENDIF||f)this.forceFlowEnd(this.flowContext.token),f||(this.forceFlowContext.forceEndIf=!0);this.isEndOfCommand=!0;this.cchToken=0;this.ichCurrentCommand=this.ichToken;return 2}this.isShowCommand=this.isComment=!1;++this.lineCurrent}else h&&
(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");e(d,"addBrace",function(a){this.vBraces.addLast(a);this.iBrace++},"JS.T");e(d,"pushContext",function(a){this.pushCount++;this.vPush.addLast(a)},"JS.T");e(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});e(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()});e(d,"tokenAt",function(a){return this.ltoken.get(a)},"~N");q(d,"tokAt",function(a){return a<this.ltoken.size()?this.tokenAt(a).tok:0},"~N");e(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");e(d,"replaceCommand",function(a){this.ltoken.removeItemAt(0);this.ltoken.add(0,this.setCommand(a))},"JS.T");e(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});e(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((134223363==this.tokCommand||135174==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,f=this.charAt(this.ichToken+1);if(!this.isNewSet&&this.isUserToken&&c&&("="==a||f==a||"="==f))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&&"."==f?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("."==f)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==f.charCodeAt(0))return this.ERROR(4);if(f!=a&&"="!=f)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 h=this.script.substring(this.ichToken,this.ichToken+this.cchToken),p=JS.T.getTokenFromName(h.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(h=h.toLowerCase(),";xyz;vxyz;vibration;temperature;occupancy;partialcharge;")?1073741824:0,0!=p&&(this.addTokenToPrefix(JS.T.o(p,h)),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 h=this.script.substring(this.ichToken,
this.ichToken+this.cchToken),p=JU.PT.parseInt(h),-2147483648==p||1E3>Math.abs(p)?this.addTokenToPrefix(JS.T.o(1073741824,h)):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,h=this.script.substring(this.ichToken,this.ichToken+this.cchToken),this.addTokenToPrefix(JS.T.o(4,h)),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)),h=JU.Edge.getFloatEncodedInt(this.script.substring(this.ichToken,this.ichToken+this.cchToken)),this.addNumber(3,h,a),2;if(this.lookingAtSeqcode()){a=this.script.charAt(this.ichToken);try{h="*"==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>h&&(h=-h,this.addTokenToPrefix(JS.T.tokenMinus));var d=JM.Group.getSeqcodeFor(h,p);this.addTokenToPrefix(JS.T.tv(5,d,"seqcode"))}catch(e){if(G(e,"NumberFormatException"))return this.ERROR(9,""+a);throw e;}return 2}h=this.lookingAtInteger();if(2147483647!=h){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);
d=null==this.flowContext?null:this.flowContext.getBreakableContext(h=Math.abs(h));if(null==d)return this.ERROR(1,this.tokenCommand.value);this.tokenAt(0).intValue=d.pt0}this.addNumber(2,h,p);return 2}if(!this.isMathExpressionCommand&&0==this.parenCount||1073741824!=this.lastToken.tok&&!JS.ScriptTokenParser.tokenAttr(this.lastToken,134217728)){h="["==this.script.charAt(this.ichToken);a=this.lookingAtBitset();if(null!=a)return this.addTokenToPrefix(JS.T.o(10,h?JM.BondSet.newBS(a):a)),2;if(h&&(h=this.lookingAtMatrix(),
x(h,"JU.M34")))return this.addTokenToPrefix(JS.T.o(x(h,"JU.M4")?12:11,h)),2}return 0});e(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");e(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});e(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});e(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");e(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);this.ltoken.set(1,a);return!0});e(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 f=this.checkFlowEndBrace();if(4==f)return 4;if(2==f)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");e(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");e(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)});e(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");e(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)});e(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");e(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=e(d,"isBreakableContext",function(a){return 134320648==a||102439==a||102406==a||102411==a||102413==a},"~N");e(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");e(d,"setFlowEnd",function(a,b){this.setCommand(JS.T.tv(a,0<this.flowContext.ptDefault?this.flowContext.ptDefault:-this.flowContext.pt0,
b))},"~N,~S");e(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");e(d,"checkFlowEnd",function(a,b,c,f){if(f){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 h=this.lltoken.size();this.flowContext.token.intValue=102412==this.tokCommand?-h:h;switch(a){case 134320649:case 102410:break;case 102412:case 134320648:case 102439:case 102406:f||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");e(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");e(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");e(d,"incrementLineCount",function(a){var b,c=a.indexOf("\r"),f=a.indexOf("\n");if(0>c&&0>f)return 0;var h=this.lineCurrent;if(0>c||f<c)c=f;for(f=a.length;--f>=c;)("\n"==(b=a.charAt(f))||"\r"==b)&&this.lineCurrent++;return this.lineCurrent-h},"~S");d.isSpaceOrTab=e(d,"isSpaceOrTab",function(a){return" "==a||"\t"==a||8194==
a.charCodeAt(0)||160==a.charCodeAt(0)},"~S");e(d,"eol",function(a){return"\x00"==a||"\r"==a||"\n"==a||";"==a&&0>=this.nSemiSkip},"~S");e(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});e(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");e(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(JV.JC.BASE64_TAG))?a:JS.ScriptCompiler.unescapeString(this.script,this.ichToken+1,this.cchToken-2)},"~B");d.unescapeString=e(d,"unescapeString",function(a,b,c){var f=JU.SB.newN(c);for(c=b+c;b<c;){var h=a.charAt(b++);if("\\"==h&&b<c)switch(h=a.charAt(b++),h.charCodeAt(0)){case 110:h="\n";break;case 116:h="\t";break;case 114:h="\r";case 34:case 92:case 39:break;case 120:case 117:var p="x"==h?2:4;if(b<
c){for(h=0;0<=--p&&b<c;){var d=a.charAt(b),d=JU.Escape.getHexitValue(d);if(0>d)break;h<<=4;h+=d;++b}h=String.fromCharCode(h)}}f.appendC(h)}return f.toString()},"~S,~N,~N");e(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");e(d,"lookingAtImpliedString",function(a,
b,c,f){var h=this.ichToken,p=this.script.charAt(h),d=1073741974==this.lastToken.tok,e=JS.T.tokAttr(this.tokCommand,20480)&&1==(this.tokCommand&1),k="@"==p;if(k&&(h+3<this.cchScript&&"{"==this.script.charAt(h+1))&&(d||!e))return!1;for(var e=d=-1,u=!0,l=0;u&&(!this.eol(p=this.charAt(h))||f&&";"==p);){switch(p.charCodeAt(0)){case 59:if(h+5>this.cchScript||h+2<this.cchScript&&(0>".01234567890-".indexOf(this.script.charAt(h+1))||"-"==this.script.charAt(h+2))){u=!1;continue}break;case 40:if(!c&&(4124==
this.tokCommand||5<=h&&(this.script.substring(h-4,h).equals(".spt")||this.script.substring(h-4,h).equals(".png")||this.script.substring(h-5,h).equals(".pngj")))){u=!1;continue}break;case 61:if(!b){u=!1;continue}break;case 123:l++;break;case 125:if(l--,0>l&&(0<this.braceCount||0<this.iBrace)){u=!1;continue}default:JU.PT.isWhitespace(p)?0>d&&(d=h):e=h}++h}if(k&&(0>d||d>e))return!1;a?h=e+1:0<d&&(h=d);return k&&(!a||0>d&&0>=l&&1<h-this.ichToken)?!1:0<(this.cchToken=h-this.ichToken)},"~B,~B,~B,~B");e(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,f="X";JU.PT.isDigit(f=this.charAt(a));)++a,c=!0;for(a<this.cchScript&&"."==f&&++a;JU.PT.isDigit(f=this.charAt(a));)++a,c=!0;if(a==this.cchScript||!c||(c="E"!=f&&"e"!=f)||++a==this.cchScript)return null;f=this.script.charAt(a);for(("-"==f||"+"==f)&&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)))});e(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});e(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});e(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});e(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});e(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});e(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");e(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});e(d,"ERROR",function(a){this.errorIntStr2(a,null,null);return 4},"~N");
e(d,"ERROR",function(a,b){this.errorStr(a,b);return 4},"~N,~S");e(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})});I("JS");N(["J.thread.JmolThread"],
"JS.ScriptDelayThread",null,function(){var d=P(function(){this.millis=0;this.script=null;this.seconds=0;this.isPauseDelay=this.doPopPush=!1;L(this,arguments)},JS,"ScriptDelayThread",J.thread.JmolThread);T(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");q(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=U(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");e(d,"setScript",function(a){this.script=a},"~S")});I("JS");N(["J.api.JmolScriptEvaluator"],"JS.ScriptError",["JU.PT","J.i18n.GT","JS.ScriptException"],function(){var d=P(function(){this.vwr=null;this.$error=this.ignoreError=this.chk=
!1;this.errorType=this.errorMessageUntranslated=this.errorMessage=null;this.iCommandError=0;L(this,arguments)},JS,"ScriptError",null,J.api.JmolScriptEvaluator);q(d,"getErrorMessage",function(){return this.errorMessage});q(d,"getErrorMessageUntranslated",function(){return null==this.errorMessageUntranslated?this.errorMessage:this.errorMessageUntranslated});e(d,"invArg",function(){this.error(22)});e(d,"invArgStr",function(a){this.errorOrWarn(22,a,null,null,!1)},"~S");e(d,"bad",function(){this.error(2)});
e(d,"integerOutOfRange",function(a,b){this.errorOrWarn(21,""+a,""+b,null,!0)},"~N,~N");e(d,"numberOutOfRange",function(a,b){this.errorOrWarn(36,""+a,""+b,null,!0)},"~N,~N");e(d,"error",function(a){this.errorOrWarn(a,null,null,null,!1)},"~N");e(d,"errorStr",function(a,b){this.errorOrWarn(a,b,null,null,!1)},"~N,~S");e(d,"errorStr2",function(a,b,c){this.errorOrWarn(a,b,c,null,!1)},"~N,~S,~S");e(d,"errorMore",function(a,b,c,f){this.errorOrWarn(a,b,c,f,!1)},"~N,~S,~S,~S");e(d,"warning",function(a,b,c){this.errorOrWarn(a,
b,c,null,!0)},"~N,~S,~S");e(d,"errorOrWarn",function(a,b,c,f,h){var p=this.ignoreError?null:JS.ScriptError.errorString(a,b,c,f,!0);a=this.ignoreError||!J.i18n.GT.getDoTranslate()?null:JS.ScriptError.errorString(a,b,c,f,!1);h||this.evalError(p,a);this.showStringPrint(p,!0)},"~N,~S,~S,~S,~B");e(d,"evalError",function(a,b){if(this.ignoreError)throw new NullPointerException;null==b&&(b=a);this.chk||(this.setCursorWait(!1),this.vwr.setBooleanProperty("refreshing",!0),this.vwr.setStringProperty("_errormessage",
b));throw new JS.ScriptException(this,a,b,!0);},"~S,~S");e(d,"setCursorWait",function(a){this.chk||this.vwr.setCursor(a?3:0)},"~B");d.errorString=e(d,"errorString",function(a,b,c,f,h){f=!1;!h&&!0==(f=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");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)));f&&J.i18n.GT.setDoTranslate(!0);return a},"~N,~S,~S,~S,~B");d.getErrorLineMessage=
e(d,"getErrorLineMessage",function(a,b,c,f,h){var p="\n----";if(null!=b||null!=a)p+="line "+c+" command "+(f+1)+" of "+(null==a?b:a.equals("try")?"try":"function "+a)+":";return p+("\n         "+h)},"~S,~S,~N,~N,~S");e(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")});I("JS");
N(["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.FileLoadThread $.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=P(function(){this.sm=null;this.isJS=!1;this.scriptDelayThread=this.fileLoadThread=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;L(this,arguments)},JS,"ScriptEval",JS.ScriptExpr);T(d,function(){W(this,JS.ScriptEval,[]);this.currentThread=Thread.currentThread()});q(d,"getAllowJSThreads",
function(){return this.allowJSThreads});e(d,"setAllowJSThreads",function(a){this.allowJSThreads=a},"~B");e(d,"doReport",function(){return!this.tQuiet&&this.scriptLevel<=JS.ScriptEval.scriptReportingLevel});q(d,"isStateScript",function(){return this.$isStateScript});q(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");q(d,"getScript",function(){return this.script});q(d,"setViewer",function(a){this.vwr=a;this.compiler=null==this.compiler?a.compiler:this.compiler;this.isJS=a.isSingleThreaded;return this},"JV.Viewer");q(d,"setCompiler",function(){this.vwr.compiler=this.compiler=new JS.ScriptCompiler(this.vwr)});q(d,"compileScriptString",function(a,b){this.clearState(b);this.contextPath="[script]";
return this.compileScript(null,a,this.debugScript)},"~S,~B");q(d,"evaluateCompiledScript",function(a,b,c,f,h,p,d){var e=this.isCmdLine_C_Option;this.isCmdLine_C_Option=c;this.chk=this.isCmdLine_c_or_C_Option=b;this.historyDisabled=f;this.outputBuffer=p;this.privateFuncs=null;this.currentThread=Thread.currentThread();this.setAllowJSThreads((new Boolean(d&!this.vwr.getBoolean(603979892))).valueOf());this.listCommands=h;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=e;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");e(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");e(d,"executeCommands",function(a,b,c){var f=!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(h){if(G(h,"JS.ScriptException")){if(x(h,"JS.ScriptInterruption")&&(!b||!h.isError))return-1;if(b)return this.vwr.setStringProperty("_errormessage",""+h),1;this.setErrorMessage(h.toString());
this.errorMessageUntranslated=h.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(h,!1),this.setErrorMessage(""+h+" "+this.vwr.getShapeErrorState()),this.errorMessageUntranslated=""+h,this.report(this.errorMessage,!0);f=!0}if(f||!this.isJS||!this.allowJSThreads||null!=a)this.vwr.setTainted(!0),
this.vwr.popHoldRepaint("CLEAR HOLD - executeCommands "+(0<this.scriptLevel?"\u0001## REPAINT_IGNORE ##":"")),f&&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 f?1:0},"~A,~B,~B");q(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");e(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");q(d,"runScript",function(a){this.vwr.isPreviewOnly||this.runScriptBuffer(a,this.outputBuffer,!1)},"~S");q(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");q(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=e(d,"getContextTrace",function(a,b,c,f){null==
c&&(c=new JU.SB);var h=null==b.lineNumbers?b.pc:Math.min(b.pc,b.lineNumbers[b.lineNumbers.length-1]);c.append(JS.ScriptError.getErrorLineMessage(b.functionName,b.scriptFileName,b.lineNumbers[h],h,JS.ScriptEval.statementAsString(a,b.statement,f?b.iToken:9999,!1)));null!=b.parentContext&&JS.ScriptEval.getContextTrace(a,b.parentContext,c,!1);return c},"JV.Viewer,JS.ScriptContext,JU.SB,~B");q(d,"setDebugging",function(){this.debugHigh=(this.debugScript=this.vwr.getBoolean(603979825))&&JU.Logger.debugging});
q(d,"haltExecution",function(){this.isEmbedded&&(this.vwr.setBooleanProperty("allowEmbeddedScripts",!0),this.isEmbedded=!1);this.resumePausedExecution();this.executionStopped=!0});q(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");q(d,"stepPausedExecution",function(){this.executionStepping=!0;this.executionPaused=!1});q(d,"resumePausedExecution",
function(){this.executionStepping=this.executionPaused=!1;this.tQuiet||this.vwr.setScriptStatus("Jmol script resumed",this.errorMessage,1+(this.timeEndExecution-this.timeBeginExecution),"resumed")});q(d,"isExecuting",function(){return this.executing&&!this.executionStopped});q(d,"isPaused",function(){return this.executionPaused});q(d,"isStepping",function(){return this.executionStepping});q(d,"isStopped",function(){return this.executionStopped||!this.isJS&&this.currentThread!==Thread.currentThread()});
q(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)):""});e(d,"getCommand",function(a,b){if(a>=this.lineIndices.length)return"";if(b){for(var c=-1,f=this.script,h=f.length,p=0;p<this.lineNumbers.length;p++)if(this.lineNumbers[p]==this.lineNumbers[a])0>c&&(c=this.lineIndices[p][0]),h=this.lineIndices[p][1];
else if(0==this.lineNumbers[p]||this.lineNumbers[p]>this.lineNumbers[a])break;0<=f.indexOf("\u0001")&&(f=f.substring(0,f.indexOf("\u0001")));p=f.length;h==p-1&&f.endsWith("}")&&h++;return c>=p||h<c||0>h?"":f.substring(Math.max(c,0),Math.min(p,h))}c=this.lineIndices[a][0];h=this.lineIndices[a][1];f="";if(0>c||h<=c||h>this.script.length)return"";try{f=this.script.substring(c,h),0<=f.indexOf("\\\n")&&(f=JU.PT.rep(f,"\\\n","  ")),0<=f.indexOf("\\\r")&&(f=JU.PT.rep(f,"\\\r","  ")),0<f.length&&!f.endsWith(";")&&
(f+=";")}catch(d){if(G(d,Exception))JU.Logger.error("darn problem in Eval getCommand: ichBegin="+c+" ichEnd="+h+" len = "+this.script.length+"\n"+d);else throw d;}return f},"~N,~B,~B");e(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 f=1;f<a.length;++f)null!=a[f]&&JU.Logger.debug(a[f].toString());var f=new JU.SB,h=0<b?"                          ".substring(0,2*b):"";f.append(h).append(JS.ScriptEval.statementAsString(this.vwr,
a,this.iToken,this.debugHigh));this.vwr.scriptStatus(f.toString())}else f=this.getCommand(this.pc,!1,!1),""!==f&&this.vwr.scriptStatus(f);this.iToken=c},"~A,~N");q(d,"evaluateExpression",function(a,b,c){var f=(new JS.ScriptEval).setViewer(this.vwr);try{f.thisContext=this.thisContext,f.contextVariables=this.contextVariables,f.pushContext(null,"evalExp"),f.setAllowJSThreads(!1)}catch(h){if(!G(h,"JS.ScriptException"))throw h;}var p=this.executing;a=f.evaluate(a,b,c);this.executing=p;return a},"~O,~B,~B");
e(d,"runBufferedSafely",function(a,b){null==b&&(b=this.outputBuffer);var c=(new JS.ScriptEval).setViewer(this.vwr),f=this.executing;try{c.runScriptBuffer(a,b,!1)}catch(h){if(G(h,"JS.ScriptException"))h.printStackTrace();else throw h;}this.executing=f},"~S,JU.SB");d.runUserAction=e(d,"runUserAction",function(a,b,c){var f=(new JS.ScriptEval).setViewer(c);a=c.getFunction(a.toLowerCase());if(null==a)return null;try{var h=JS.SV.getVariableAO(b).getList();f.restoreFunction(a,h,null);f.dispatchCommands(!1,
!0,!1)}catch(p){if(G(p,"JS.ScriptException"))return null;throw p;}b=f.getContextVariableAsVariable("_retval",!1);return null==b?JS.SV.vT:b},"~S,~A,JV.Viewer");e(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 f=this.atomExpression(a,0,0,!0,!1,null,!1);return b?JS.SV.newV(10,f):f}}}catch(h){if(G(h,Exception))JU.Logger.error("Error evaluating: "+a+"\n"+h);else throw h;}return b?JS.SV.getVariable("ERROR"):"ERROR"},"~O,~B,~B");q(d,"checkSelect",function(a,b){var c=!1;try{this.pushContext(null,"checkSelect"),c=this.parameterExpressionSelect(a,b)}catch(f){if(!G(f,Exception))throw f;}this.popContext(!1,!1);
return c},"java.util.Map,~A");q(d,"getAtomBitSet",function(a){if(x(a,"JU.BS"))return a;var b=new JU.BS,c=this.executing;try{this.pushContext(null,"getAtomBitSet");var f="select ("+a+")",f=JU.PT.replaceAllCharacters(f,"\n\r","),("),f=JU.PT.rep(f,"()","(none)");this.compileScript(null,f,!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(h){if(G(h,Exception))JU.Logger.error("getAtomBitSet "+a+"\n"+h);else throw h;
}this.executing=c;return b},"~O");e(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");e(d,"fixScriptPath",function(a,b){if(null!=b&&0<=a.indexOf("$SCRIPT_PATH$")){var c=b,f=Math.max(b.lastIndexOf("|"),b.lastIndexOf("/")),c=c.substring(0,f+1);a=JU.PT.rep(a,"$SCRIPT_PATH$/",c);a=JU.PT.rep(a,"$SCRIPT_PATH$",c)}return a},"~S,~S");e(d,"setScriptExtensions",function(){var a=
this.scriptExtensions;if(null==a)return 0;var b=a.indexOf("\u0001##SCRIPT_STEP");0<=b&&(this.executionStepping=!0);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});e(d,"getScriptFileInternal",function(a,b,
c,f){if(0==a.toLowerCase().indexOf("javascript:"))return this.vwr.jsEval(a.substring(11));var h=Array(2);h[0]=a;if(!this.vwr.fm.getFileDataAsString(h,-1,!1,!0,!1))return this.setErrorMessage("io error reading "+h[0]+": "+h[1]),null;var p="";if(0<=("\n"+h[1]).indexOf("\nJmolManifest.txt\n")){var d;if(a.endsWith(".all.pngj")||a.endsWith(".all.png"))d="|state.spt",a+="|";else{0<=h[1].indexOf("movie.spt")&&(h[0]=a+"|movie.spt",this.vwr.fm.getFileDataAsString(h,-1,!1,!0,!1)&&(p=h[1]));a+="|JmolManifest.txt";
h[0]=a;if(!this.vwr.fm.getFileDataAsString(h,-1,!1,!0,!1))return this.setErrorMessage("io error reading "+h[0]+": "+h[1]),null;d=JV.FileManager.getManifestScriptPath(h[1])}if(null!=d&&0<d.length&&(h[0]=a=a.substring(0,a.lastIndexOf("|"))+d,!this.vwr.fm.getFileDataAsString(h,-1,!1,!0,!1)))return this.setErrorMessage("io error reading "+h[0]+": "+h[1]),null;a.endsWith("|state.spt")&&this.vwr.g.setO("_pngjFile",a.substring(0,a.length-10)+"?")}this.scriptFileName=a;h[1]=JV.FileManager.getEmbeddedScript(h[1]);
var h=this.fixScriptPath(h[1],h[0]),e=-1;null==f&&(d=this.vwr.fm.getFilePath(a,!1,!1),f=d.substring(0,Math.max(e=d.lastIndexOf("|"),d.lastIndexOf("/"))),0<e&&(h=this.checkFixBondDelete(h),this.vwr.setAccessInternal(d.substring(0,e))));return JV.FileManager.setScriptFileReferences(h,b,c,f)+p},"~S,~S,~S,~S");e(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 f=a.substring(b,a.indexOf("\n\n",b)+2),c=a.indexOf("\n",
c);a=a.substring(0,c+1)+f.$replace("select BONDS","select /*FIXED*/ BONDS")+a.substring(c+2);return a=a.substring(0,b)+a.substring(b+f.length)},"~S");q(d,"evalFunctionFloat",function(a,b,c){try{for(var f=0;f<c.length;f++)b.get(f).value=Float.$valueOf(c[f]);return JS.SV.fValue(this.runFunctionAndRet(a,a.name,b,null,!0,!1,!1))}catch(h){if(G(h,Exception))return NaN;throw h;}},"~O,~O,~A");e(d,"getUserFunctionResult",function(a,b,c){return this.runFunctionAndRet(null,a,b,c,!0,!0,!1)},"~S,JU.Lst,JS.SV");
e(d,"runFunctionAndRet",function(a,b,c,f,h,p,d){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(d);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,f);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,f),this.dispatchCommands(!1,!0,!1),a.runAllProcesses(this.vwr)):(this.restoreFunction(a,c,f),this.dispatchCommands(!1,
!0,!1));a=h?this.getContextVariableAsVariable("_retval",!1):null;this.popContext(!1,!1);return a},"J.api.JmolScriptFunction,~S,JU.Lst,JS.SV,~B,~B,~B");e(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(f){if(G(f,"JS.ScriptException"))f.printStackTrace();else throw f;}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");e(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");e(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");
e(d,"clearDefinedVariableAtomSets",function(){this.vwr.definedAtomSets.remove("# variable")});e(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),f=" _e="+c,b="@_"+JU.Elements.altElementSymbolFromIndex(a);this.defineAtomSet(b+f);b="@_"+JU.Elements.altIsotopeSymbolFromIndex(a);this.defineAtomSet(b+
f);b="@_"+JU.Elements.altIsotopeSymbolFromIndex2(a);this.defineAtomSet(b+f);b="@"+JU.Elements.altElementNameFromIndex(a);1<b.length&&this.defineAtomSet(b+f);b=JU.Elements.getElementNumber(c);c=JU.Elements.getNaturalIsotope(b);0<c&&(f=JU.Elements.elementSymbolFromNumber(b),this.defineAtomSet("@_"+f+c+" _e="+b),this.defineAtomSet("@_"+c+f+" _e="+b))}this.defineAtomSet("# variable")}});e(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");e(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");e(d,"lookupValue",function(a,b){if(this.chk)return new JU.BS;this.defineSets();a=a.toLowerCase();var c=this.vwr.definedAtomSets.get(a),f=!1;null==c&&(c=this.vwr.definedAtomSets.get("!"+a),f=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),f||this.vwr.definedAtomSets.put(a,c),c;if(a.equals("water"))return c=this.vwr.ms.getAtoms(1612709912,null),f||this.vwr.definedAtomSets.put(a,c),c;if(b)return null;f=a.length;if(5>f||"s"!=a.charAt(f-1))return null;a=a.endsWith("ies")?a.substring(0,f-3)+"y":a.substring(0,f-1);return this.lookupValue(a,!0)},"~S,~B");q(d,"deleteAtomsInVariables",function(a){for(var b,
c=this.vwr.definedAtomSets.entrySet().iterator();c.hasNext()&&((b=c.next())||1);){var f=b.getValue();x(f,"JU.BS")&&(JU.BSUtil.deleteBits(f,a),b.getKey().startsWith("!")||this.vwr.g.setUserVariable("@"+b.getKey(),JS.SV.newV(10,f)))}},"JU.BS");q(d,"getThisContext",function(){return this.thisContext});e(d,"clearState",function(a){this.thisContext=null;this.scriptLevel=0;this.setErrorMessage(null);this.contextPath="";this.tQuiet=a},"~B");q(d,"pushContextDown",function(a){this.scriptLevel--;this.pushContext2(null,
a)},"~S");e(d,"pushContext",function(a,b){this.scriptLevel==JS.ScriptEval.contextDepthMax&&this.error(44);this.pushContext2(a,b)},"JS.ContextToken,~S");e(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,f=a.contextVariables.keySet().iterator();f.hasNext()&&((c=f.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");q(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");e(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");e(d,"restoreScriptContext",function(a,b,c,f){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,f))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,f=null==this.contextPath?-1:this.contextPath.indexOf(" >> "),0<=f&&(this.contextPath=this.contextPath.substring(0,f)),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");e(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 f=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(f)&&(a.message+=f,a.untranslated+=f);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>f.indexOf("w_h_e_r_e =")&&JU.Logger.error("eval ERROR: "+f+"\n"+this.toString()),this.vwr.setAccessInternal(null),this.vwr.autoExit&&this.vwr.exitJmol())}},"JS.ScriptException,~S,~S");d.statementAsString=e(d,"statementAsString",function(a,b,c,f){if(null==b||0==b.length)return"";var h=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 d=!0,e=
!1,k=!1,p=1<b.length&&36867==p&&b[0].value.equals("")&&(61==b[0].intValue||35==b[0].intValue)&&1073742325!=b[1].tok,u=b.length,l=0;l<u;++l){var m=b[l];if(null==m)break;c==l-1&&h.append(" <<");0!=l&&h.appendC(" ");if(2==l&&p&&((p=268440324!=m.tok)||35==b[0].intValue))if(h.append(p?"= ":"== "),!p)continue;var n=m.value;switch(m.tok){case 1073742325:d&&h.append("{");continue;case 1073742326:k&&l==b.length-1&&(d=!1);d&&h.append("}");continue;case 268437504:case 268437505:break;case 1073742332:case 1073742338:e=
1073742332==m.tok;break;case 12290:if(0<l&&m.value.equals("define")){h.append("@");l+1<b.length&&1073742325==b[l+1].tok&&(d||(k=!0),d=!0);continue}break;case 1073742335:h.append("true");n=null;break;case 1073742334:h.append("false");n=null;break;case 1275082241:break;case 2:h.appendI(m.intValue);n=null;break;case 8:case 9:case 10:h.append(JS.SV.sValue(m));n=null;break;case 6:if(Boolean.TRUE===m.value.get("$_BINARY_$")){h.append("<BINARY DATA>");n=null;break}case 7:h.append(m.escape());n=null;break;
case 5:h.appendC("^");n=null;break;case 1073742363:2147483647!=m.intValue?h.appendI(m.intValue):h.append(JM.Group.getSeqcodeStringFor(JS.ScriptExpr.getSeqCode(m))),m=b[++l],h.appendC(" "),h.append(e?"-":"- ");case 1073742362:2147483647!=m.intValue?h.appendI(m.intValue):h.append(JM.Group.getSeqcodeStringFor(JS.ScriptExpr.getSeqCode(m)));n=null;break;case 1073742357:h.append("*:");h.append(a.getChainIDStr(m.intValue));n=null;break;case 1073742355:h.append("*%");null!=m.value&&h.append(m.value.toString());
n=null;break;case 1073742358:h.append("*/");case 1073742359:case 3:2147483647>m.intValue?h.append(JU.Escape.escapeModelFileNumber(m.intValue)):h.append(""+m.value);n=null;break;case 1073742361:h.appendC("[");n=6*m.intValue+1;h.append(JM.Group.standardGroupList.substring(n,n+3).trim());h.appendC("]");n=null;break;case 1073742360:h.appendC("[");h.appendO(m.value);h.appendC("]");n=null;break;case 1073742356:h.append("*.");break;case 1094713349:if(x(m.value,"JU.P3")){n=m.value;h.append("cell=").append(JU.Escape.eP(n));
n=null;break}break;case 4:h.append('"').appendO(m.value).append('"');n=null;break;case 268440324:case 268440322:case 268440321:case 268440320:case 268440323:case 268440325:1715472409==m.intValue?h.append(b[++l].value).append(" "):2147483647!=m.intValue&&h.append(JS.T.nameOf(m.intValue)).append(" ");break;case 364558:n=null;break;case 102409:h.append("end");n=null;break;default:if(JS.T.tokAttr(m.tok,1073741824)||!f)break;h.appendC("\n").append(m.toString()).appendC("\n");n=null}null!=n&&h.append(m.value.toString());
c==l&&h.append("<<<<")}return h.toString()},"JV.Viewer,~A,~N,~B");q(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");e(d,"setAtomProp",function(a,b,c){this.setShapePropertyBs(0,a,b,c)},"~S,~O,JU.BS");e(d,"restrictSelected",function(a,b){this.chk||this.sm.restrictSelected(a,b)},"~B,~B");e(d,"showString",function(a){this.showStringPrint(a,!1)},"~S");q(d,"showStringPrint",function(a,b){this.chk||null==a||(null==
this.outputBuffer?this.vwr.showString(a,b):this.appendBuffer(a,b))},"~S,~B");e(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");e(d,"appendBuffer",function(a,b){(b||this.isFuncReturn||JU.Logger.isActiveLevel(4))&&this.outputBuffer.append(a).appendC("\n")},"~S,~B");e(d,"addProcess",function(a,b,c){if(null!=this.parallelProcessor){for(var f=Array(c),h=0;h<a.size();h++)f[h+1-b]=a.get(h);a=this.getScriptContext("addProcess");
a.saveTokens(f);a.pc=1-b;a.pcEnd=c;this.parallelProcessor.addProcess("p"+ ++JS.ScriptEval.iProcess,a)}},"JU.Lst,~N,~N");e(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(f){if(G(f,Exception))this.setErrorMessage(""+f);else if(G(f,Error))this.setErrorMessage(""+
f);else throw f;}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});e(d,"delayScript",function(a){this.delayScriptAndRun(a,null)},"~N");e(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");e(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");q(d,"evalParallel",function(a,b){return this.getCmdExt().evalParallel(a,
b)},"JS.ScriptContext,JV.ShapeManager");e(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");q(d,"loadFileResourceAsync",function(a){this.loadFileAsync(null,a,-Math.abs(a.hashCode()),!1)},"~S");e(d,"loadFileAsync",function(a,b,c,f){if(!b.startsWith("?")){var h=this.vwr.getFullPathNameOrError(b);b=h[0];null!=h[1]&&this.errorStr(17,b+":"+h[1])}if(null!=this.vwr.fm.cacheGet(b,!1))return this.cancelFileThread(),
b;null!=a&&(a="cache://local"+a);var h=this.pc+"_"+c+"_"+b,p;null==this.thisContext&&this.pushContext(null,"loadFileAsync");null==this.thisContext.htFileCache&&(this.thisContext.htFileCache=new java.util.Hashtable);p=this.thisContext.htFileCache.get(h);if(null!=p&&0<p.length)return this.cancelFileThread(),this.vwr.queueOnHold=!1,("#CANCELED#".equals(p)||"#CANCELED#".equals(this.vwr.fm.cacheGet(p,!1)))&&this.evalError("#CANCELED#",null),p;this.thisContext.htFileCache.put(h,p=a+System.currentTimeMillis());
f&&this.vwr.cacheFileByName(a+"*",!1);this.fileLoadThread=new JS.FileLoadThread(this,this.vwr,b,h,p);this.vwr.testAsync?this.fileLoadThread.start():this.fileLoadThread.run();0>c&&(this.fileLoadThread=null);throw new JS.ScriptInterruption(this,"load",1);},"~S,~S,~N,~B");e(d,"cancelFileThread",function(){this.fileLoadThread=null;null!=this.thisContext&&"loadFileAsync"===this.thisContext.why&&this.popContext(!1,!1)});e(d,"logLoadInfo",function(a,b){0<a.length&&JU.Logger.info(a);var c=new JU.SB,f=this.vwr.ms.mc;
1<f&&!b&&c.append((this.vwr.am.isMovie?this.vwr.am.getFrameCount()+" frames":f+" models")+"\n");for(var h=0;h<f;h++){var p=this.vwr.ms.getInfo(h,"moData");null!=p&&p.containsKey("mos")&&c.appendI(p.get("mos").size()).append(" molecular orbitals in model ").append(this.vwr.getModelNumberDotted(h)).append("\n")}0<c.length()&&this.showString(c.toString())},"~S,~B");q(d,"notifyResumeStatus",function(){!this.chk&&(!this.executionStopped&&!this.executionStepping&&!this.executionPaused)&&this.vwr.scriptStatus("script execution "+
(this.$error||this.executionStopped?"interrupted":"resumed"))});e(d,"refresh",function(a){this.chk||(this.vwr.setTainted(!0),this.vwr.requestRepaintAndWait("refresh cmd"),this.isJS&&a&&this.doDelay(10,null))},"~B");q(d,"stopScriptThreads",function(){null!=this.scriptDelayThread&&(this.scriptDelayThread.interrupt(),this.scriptDelayThread=null);null!=this.fileLoadThread&&(this.fileLoadThread.interrupt(),this.fileLoadThread.resumeEval(),this.cancelFileThread())});e(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))});e(d,"getLinenumber",function(a){return null==a?this.lineNumbers[this.pc]:a.lineNumbers[a.pc]},"JS.ScriptContext");e(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 f=this.isJS&&!b&&this.useThreads(!1)&&0<=this.vwr.getInt(536870922);this.commandLoop(f);if(this.chk)return!0;var h=this.vwr.getInsertedCommand();"".equals(h)?a&&(this.debugScript&&this.vwr.getBoolean(603979879))&&this.vwr.getChimeMessenger().update(null):this.runScriptBuffer(h,null,!1);return!this.mustResumeEval&&!f||b?!0:!c&&this.mustResumeEval||null==this.thisContext?(a=null==this.thisContext,this.resumeEval(this.thisContext),this.mustResumeEval=!1,
a):!0},"~B,~B,~B");e(d,"commandLoop",function(a){var b="",c=!1,f=null,h=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()-h&&(this.pc--,this.doDelay(-1,null)),h=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 d=0,d=System.currentTimeMillis();this.vwr.scriptStatus("Eval.dispatchCommands():"+d);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)&&(d=this.getCommand(this.pc,!0,!0),null!=this.theToken&&0<d.length&&!d.equals(b)&&(134320141==this.theToken.tok||102436==this.theToken.tok||!JS.T.tokAttr(this.theToken.tok,102400))))this.vwr.addCommand(b=d);!this.chk&&a&&(d=this.vwr.getInsertedCommand(),"".equals(d)||this.runScript(d));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);d=this.getCommand(this.pc+1,!1,!0);this.fullCommand=this.thisCommand+(d.startsWith("#")?d:"");this.getToken(0);this.iToken=0;if((this.listCommands||!this.chk&&0<this.scriptLevel)&&!this.isJS)if(d=this.vwr.getInt(536870922),this.listCommands||0<d)0<d&&this.delayScript(-d),this.vwr.scriptEcho("$["+this.scriptLevel+"."+this.lineNumbers[this.pc]+"."+(this.pc+1)+"] "+this.thisCommand);if(null!=f&&(102409!=this.theTok||2>this.slen||102439!=this.st[1].tok))f.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(e){if(!G(e,"InterruptedException"))throw e;
}}if(null!=this.theToken)switch(d=this.theToken.tok,d){case 36867:this.cmdSet();continue;case 134320648:c=this.cmdFor(d,c);continue;case 102439:this.pushContext(this.theToken,"PROCESS");null!=this.parallelProcessor&&(f=new JU.Lst);continue;default:if(JS.T.tokAttr(d,102400)){c=this.cmdFlow(d,c,f);102439==this.theTok&&(f=null);continue}this.processCommand(d);this.setCursorWait(!1);266298!=d&&this.executionStepping&&(this.executionPaused=this.isCommandDisplayable(this.pc+1))}}}}},"~B");e(d,"notifyScriptEditor",
function(a){this.vwr.notifyScriptEditor(this.lineIndices[a][0]<<16|this.lineIndices[a][1],null)},"~N");e(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");e(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 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");e(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");e(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=C(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)}});e(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");e(d,
"cmdAxes",function(a){var b=this.tickParamAsStr(a,!0,!0,!1);a=this.iToken+1;var c=this.tokAt(a),f=this.optParameterAsString(a).toLowerCase();if(this.slen==a+1&&JU.PT.isOneOf(f,";window;unitcell;molecular;"))this.setBooleanProperty("axes"+f,!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",Q(-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",Q(-1,[this.paramAsStr(++a),this.paramAsStr(++a),this.paramAsStr(++a),b]));break;default:this.bad()}return}f.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");e(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(JV.JC.BASE64_TAG)?
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");e(d,"cmdBind",function(){var a=this.stringParameter(1),b=this.paramAsStr(2);this.checkLength(3);this.chk||this.vwr.bindAction(a,b)});
e(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))});e(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 f=1073741902==this.tokAt(a);f&&a++;if(this.isCenterParameter(a)){var h=Array(1),p=a,d=this.centerParameter(a,h);a=this.iToken+1;if(f||this.isCenterParameter(a))h=f?this.centerParameter(a,h):this.getPoint3f(a,!0,!0),a=this.iToken+1,this.chk||this.vwr.ms.setBoundBox(d,
h,f,c);else if(null!=h[0]&&x(h[0],"JU.BS"))this.chk||this.vwr.calcBoundBoxDimensions(h[0],c);else if(null==h[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");e(d,"cmdCD",function(){if(!this.chk){var a=
1==this.slen?null:this.paramAsStr(1);this.showString(this.vwr.cd(a))}});e(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");e(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,f=this.getToken(1).tok;if(4==f&&(f=JS.T.getTokFromName(b),
0==f||1073742186==f))f=4;switch(f){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 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==f?"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(f),"thisID","+PREVIOUS_MESH+")}}this.colorShape(-this.theTok,a,!1)});e(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),f=this.slen;0<=--f;)c[f]=this.st[f];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))}});e(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=C(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)});e(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))}});e(d,"cmdDisplay",function(a){var b=null,c=0,f=1,h;switch(h=this.tokAt(1)){case 1275069441:case 1073742119:c=h,h=this.tokAt(++f)}var p=1086324742==h;p&&(h=this.tokAt(++f));switch(h){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(f)}this.chk||(x(b,"JM.BondSet")?this.vwr.ms.displayBonds(b,a):this.vwr.displayAtoms(b,a,p,c,this.tQuiet))},"~B");
e(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,f=1,h=!1;;){switch(this.getToken(f).tok){case 1073742072:h=!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(f+1));f=this.iToken+1;continue;case 3:h=1073742072==this.tokAt(f+1)||0>this.floatParameter(f);break;case 2:var p=this.intParameter(f);
if(1665140738==this.tokAt(f+1)){f++;this.setShapeProperty(a,"atom",Integer.$valueOf(p));this.setShapeProperty(a,"radius",Float.$valueOf(this.floatParameter(++f)));1765808134==this.tokAt(++f)&&(this.setShapeProperty(a,"colorRGB",Integer.$valueOf(this.getArgbParam(++f))),f++);10!=this.getToken(f).tok&&this.invArg();this.setShapeProperty(a,"dots",this.st[f].value);return}}break}b=Float.isNaN(b)?this.encodeRadiusParameter(f,h,!0):new J.atomdata.RadiusData(null,b,c,J.c.VDW.AUTO);null!=b&&(Float.isNaN(b.value)&&
this.invArg(),h&&this.restrictSelected(!1,!1),this.setShapeSize(a,b))},"~N");e(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");e(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)}});e(d,"cmdFixed",function(){var a=1==this.slen?null:this.atomExpressionAt(1);this.chk||this.vwr.setMotionFixedAtoms(a)});e(d,"cmdFor",function(a,b){var c=this.theToken,f=this.st[0].intValue,h=c.forVars,p=O(2,0),d=null,e=null,k=null,u=0,l=!0,m=!1,n=0,w=null;if(b&&null!=
h)if(a=1275068432,k=h[0],e=h[1],d=h[1].value,n=++e.intValue,2==e.tok){m=0>n;p=d[0];l=d[1];if(l=p!=l&&l<p==m)k.intValue=d[0]=p+(m?-1:1);n=-1}else 7==e.tok?((l=n<=d.size())&&k.setv(JS.SV.selectItemVar(e)),n=-1):(this.isBondSet=x(d,"JM.BondSet"),n=d.nextSetBit(n),l=0<=n);else{for(var z=!1,r=1,v=0;r<this.slen&&2>n;r++)switch(a=this.tokAt(r)){case 36868:z=!0;break;case 1073742339:0<v?v--:p[n++]=r;break;case 1275068432:case 1073741952:w=this.paramAsStr(r-1);v-=2;if(this.isAtomExpression(++r))u=10,d=this.atomExpressionAt(r),
this.isBondSet&&(d=JM.BondSet.newBS(d)),l=0<=d.nextSetBit(0);else switch(u=this.parameterExpressionList(-r,1,!1),(null==u||1>u.size())&&this.invArg(),r=u.get(0),u=r.tok){case 10:d=r.value;l=!d.isEmpty();break;case 7:d=r.getList();n=d.size();if((l=0<n)&&1073741952==a)d=O(-1,[JS.SV.iValue(d.get(0)),JS.SV.iValue(d.get(n-1))]),m=d[1]<d[0],a=1275068432,u=2;break;case 6:var r=r.getMap(),q=r.keySet().size();if(l=0<q)d=Array(q),r.keySet().toArray(d),java.util.Arrays.sort(d);break;default:this.invArg()}r=
this.iToken;break;case 1275082241:v+=2}b||(this.pushContext(c,"FOR"),this.thisContext.forVars=h,h=null);null==w&&(n=b?null==d?p[1]+1:2:2,36868==this.tokAt(n)&&n++,w=this.paramAsStr(n),(m=w.equals("--")||w.equals("++"))&&(w=this.paramAsStr(++n)));if(l)if(1275068432==a){k=this.getContextVariableAsVariable(w,z);null==k&&!z&&(k=this.vwr.g.getAndSetNewVariable(w,!1));if(null==k||null==k.myName)w.startsWith("_")&&this.invArg(),z?this.contextVariables.put(w.toLowerCase(),k=JS.SV.newI(0)):k=this.vwr.g.getAndSetNewVariable(w,
!0);2==u?(k.tok=2,k.intValue=d[0],e=JS.SV.newV(2,d),e.intValue=m?-2147483648:0,n=-1):(e=JS.SV.getVariable(d),10==u?(n=d.nextSetBit(0),e.intValue=0):(e.intValue=1,k.setv(JS.SV.selectItemVar(e)),n=-1));null==h&&(h=c.forVars=Array(2));h[0]=k;h[1]=e}else{l=this.tokAt(n);if(1073742339!=l&&(JS.T.tokAttr(l,1073741824)||null!=(e=this.getContextVariableAsVariable(w,!1))))!m&&268440324!=this.getToken(++n).tok&&this.invArg(),m&&(n-=2),this.setVariable(++n,this.slen-1,w,!1);l=p[0]+1==p[1]||this.parameterExpressionBoolean(p[0]+
1,p[1])}}l&&(1275068432==a&&0<=n)&&(e.intValue=n,k.tok=10,this.isBondSet?(k.value=new JM.BondSet,k.value.set(n)):k.value=JU.BSUtil.newAndSetBit(n));f++;l||(c.forVars=this.thisContext.forVars,this.popContext(!0,!1));b=!1;!l&&!this.chk&&(this.pc=Math.abs(f)-1);return b},"~N,~B");e(d,"cmdFlow",function(a,b,c){var f,h=this.st[0].intValue,p=0>h&&!this.chk;f=!0;var d=0;switch(a){case 134320141:case 102436:return this.cmdFunc(),b;case 364558:return b;case 102412:f=this.theToken;this.pushContext(f,"CATCH");
!p&&null!=f.name0&&this.contextVariables.put(f.name0,f.contextVariables.get(f.name0));f=!p;this.st[0].intValue=-Math.abs(h);break;case 102410:case 102413:case 102411:d=Math.abs(this.aatoken[Math.abs(h)][0].intValue);switch(p?0:this.cmdFlowSwitch(this.theToken,a)){case 0:d=-d;f=!1;break;case -1:f=!1}this.aatoken[this.pc][0].intValue=Math.abs(h);this.theToken=this.aatoken[Math.abs(h)][0];102409!=this.theToken.tok&&(this.theToken.intValue=d);break;case 134320649:case 102402:f=!p&&this.parameterExpressionBoolean(1,
0);if(this.chk)break;d=Math.abs(this.aatoken[Math.abs(h)][0].intValue);this.aatoken[Math.abs(h)][0].intValue=p||f?-d:d;102412==a&&(this.aatoken[this.pc][0].intValue=-h);break;case 364547:this.checkLength(1);0>h&&!this.chk&&(this.pc=-h-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=h,this.popContext(!0,!1));break;case 102407:if(!this.chk){this.breakAt(h);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=h-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,
h,this.pc);this.popContext(!0,!1);break;case 102410:if(0<h&&-1==this.cmdFlowSwitch(this.aatoken[h][0],0)){for(;h<this.pc&&!(102413!=(a=this.aatoken[h][0].tok)&&102411!=a);h++);f=this.pc==h}break;case 134320648:case 102406:f=!1,b=!0}}!f&&!this.chk&&(this.pc=Math.abs(h)-1);return b},"~N,~B,JU.Lst");e(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 f=this.parameterExpressionToken(1);
if(102411==b)return(c=JS.SV.areEqual(c,f))&&a.contextVariables.remove("_var"),c?1:-1;a.contextVariables.put("_var",f);return 1},"JS.ContextToken,~N");e(d,"cmdFont",function(a,b){var c="SansSerif",f="Plain",h="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(),f=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;h="fontsize";break}this.bad()}var e=536875059==this.tokAt(1);-1==a&&(a=e?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"===h?(0<=JU.Font.getFontStyleID(c)&&(f=c,c="SansSerif"),c=this.vwr.getFont3D(c,f,b)):c=Float.$valueOf(b),this.sm.loadShape(a),e&&this.setShapeProperty(31,"target","%SCALE"),this.setShapeProperty(a,h,c),0<=d&&this.setShapeProperty(a,"scalereference",Float.$valueOf(d)),e&&this.setShapeProperty(31,"thisID",null))},"~N,~N");e(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");e(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)}}});e(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=Q(-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)}});e(d,"cmdGoto",function(a){a=a?this.paramAsStr(this.checkLast(1)):null;for(var b=null==a?this.aatoken.length-1:-1,c=null,f=b+1;f<this.aatoken.length;f++){var c=this.aatoken[f],h=c[0].tok;switch(h){case 20485:case 0:c=c[c.length-1].value;0==h&&(c=c.substring(c.startsWith("#")?1:2));break;default:continue}if(c.equalsIgnoreCase(a)){b=
f;break}}0>b&&this.invArg();null==a&&(b=0);h=b<this.pc?1:-1;c=0;for(f=b;f!=this.pc;f+=h)switch(this.aatoken[f][0].tok){case 1275335685:case 102439:case 134320648:case 102412:case 102406:c++;break;case 1275334681:c--;break;case 102409:switch(this.aatoken[f][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");e(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))))});e(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))}});e(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");e(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)}});e(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");e(d,"cmdLoad",function(){var a=!this.chk||this.isCmdLine_C_Option,b=!1,c=!1,f=!1,h=!1,p=!1,d=this.vwr.async,e=!1,k=!1,u=this.vwr.getBoolean(603979792),l=null,m,n=134221834==this.tokAt(0)?0:1,w=null,z=this.vwr.ms.mc-(this.vwr.fm.getFileName().equals("zapped")?1:0),r=this.vwr.ms.ac,v=(new JU.SB).append("load"),
q=1,t=new java.util.Hashtable;this.$isStateScript&&(t.put("isStateScript",Boolean.TRUE),this.forceNoAddHydrogens&&t.put("doNotAddHydrogens",Boolean.TRUE));var D=null,y=null,s=null,B=null,B=new JU.SB,E=0,F;if(1==this.slen)n=0;else{D=this.paramAsStr(n);if(2==this.slen&&!this.chk&&(D.endsWith(".spt")||D.endsWith(".png")||D.endsWith(".pngj"))){this.cmdScript(0,D,null,null);return}F=this.tokAt(n);switch(F){case 1073742077:k=!0,v.append(" orientation"),this.vwr.stm.saveOrientation("preload",null),D=this.paramAsStr(++n),
F=JS.T.getTokFromName(D)}switch(F){case 1073741839:D=this.optParameterAsString(++n);m=JU.PT.parseInt(D);(b=!this.$isStateScript||0<this.vwr.ms.mc)&&v.append(" append");0<=m&&(D=this.optParameterAsString(++n),b&&(v.append(" "+m),u=!1,t.put("appendToModelIndex",Integer.$valueOf(m))));F=JS.T.getTokFromName(D);break;case 4108:this.checkExtension(4108);return;case 1073877011:case 1610616855:case 1073742015:b=this.paramAsStr(this.checkLast(2));if(!this.chk)switch(F){case 1073877011:t.put("service","nbo");
t.put("mode",Integer.$valueOf(1));t.put("action","load");t.put("value",b);t.put("sync",Boolean.TRUE);this.vwr.sm.processService(t);this.runScript(t.get("ret"));break;case 1610616855:this.vwr.setHistory(b);break;case 1073742015:this.vwr.setMenu(b,!0)}return;case 4130:h=b=!0;u=!1;v.append(" mutate");D=this.optParameterAsString(++n);F=JS.T.getTokFromName(D);t.put("appendToModelIndex",Integer.$valueOf(this.vwr.am.cmi));break;case 1073741824:n++,v.append(" "+D),E=1073741824==F&&JU.PT.isOneOf(D.toLowerCase(),
";xyz;vxyz;vibration;temperature;occupancy;partialcharge;")?JS.T.getTokFromName(D):0,0!=E&&(t.put("atomDataOnly",Boolean.TRUE),t.put("modelNumber",Integer.$valueOf(1)),4166==E&&(E=1145047055),s=this.vwr.fm.getFileInfo(),b=!0)}switch(F){case 36868:m=this.paramAsStr(++n);var l="@"+m,H=this.getVarParameter(m,!1);if(x(H,"java.util.Map")){this.checkLength(3);this.loadPNGJVar(l,H,t);return}break;case 1228935687:n++;v.append(" "+D);this.optParameterAsString(n).equals("+")&&(e=!0,n++,v.append(" +"));this.optParameterAsString(n).equals("-")&&
(e=!0,n++,v.append(" -"));7==this.tokAt(n)&&(y=this.stringParameterSet(n),n=this.iToken,n+1!=this.slen&&this.invArg(),null!=y&&(q=y.length));break;case 134217764:this.slen<n+4&&this.invArg(),n-=2,l="0",t.put("isEmptyLoad",Boolean.TRUE);case 1073741984:c=!0;n++;v.append(" inline");break;case 134218757:f=!0;n++;break;case 1073741849:d=!0;t.put("async",Boolean.TRUE);n++;break;case 536870926:case 1094717454:n++;v.append(" "+D);536870926==F&&t.put("isTrajectory",Boolean.TRUE);if(this.isPoint3f(n)){var K=
this.getPoint3f(n,!1,!0),n=this.iToken+1;t.put("firstLastStep",O(-1,[C(K.x),C(K.y),C(K.z)]));v.append(" "+JU.Escape.eP(K))}else switch(this.tokAt(n)){case 10:m=this.getToken(n++).value;t.put("bsModels",m);v.append(" "+JU.Escape.eBS(m));break;default:t.put("firstLastStep",O(-1,[0,-1,1]))}break;case 1073741824:break;case 134221834:p=this.stringParameter(++n).toLowerCase();D=this.optParameterAsString(n+1);if((b=p.startsWith("append"))&&p.startsWith("append modelindex="))m=JU.PT.parseInt(p.substring(18)),
0<=m&&(u=!1,t.put("appendToModelIndex",Integer.$valueOf(m)));k=0<=p.indexOf("orientation");n=this.addLoadData(v,p,t,n);p=!0;break;default:D="fileset"}!c&&(null==l&&null==y&&4!=this.getToken(n).tok)&&this.error(16)}H=n;K=n+1;m=null;1073741848==this.tokAt(K)&&(m=this.stringParameter(n=K+1),""!==this.vwr.fm.getPathForAllFiles()&&(m=null,H=n));var G=K=null;f&&1073741940==this.tokAt(n+1)&&(++n,w=this.stringParameter(++n));if(this.slen==n+1){if(null==l&&(0==n||null==y&&0==(l=this.paramAsStr(H)).length))l=
this.getFullPathName(!0);if(null==l&&null==y){this.cmdZap(!1);return}if(null==y&&!c)if(f)l="$"+l;else{if(l.equals("String[]"))return;0==l.indexOf("[")&&(y=JU.Escape.unescapeStringArray(l),null!=y&&(1==n&&v.append(" files"),q=y.length))}if(null!=y)for(f=0;f<q;f++)v.append(" /*file*/").append(JU.PT.esc(y[f]))}else if(this.isLoadOption(this.getToken(n+1).tok)){if(null==l&&0==(l=this.paramAsStr(H)).length&&null==(l=this.getFullPathName(!0))){this.cmdZap(!1);return}(H==n||null!=m)&&n++;if(l.equals("String[]"))return;
if(1073742010==(F=this.tokAt(n)))f=this.stringParameter(++n),t.put("manifest",f),B.append(" MANIFEST "+JU.PT.esc(f)),F=this.tokAt(++n);switch(F){case 2:case 7:case 268437504:case 1073742195:n=this.getLoadModelIndex(n,B,t)}n=this.getCmdExt().getLoadSymmetryParams(n,B,t);1073741839==this.tokAt(n)&&(134221834==this.tokAt(++n)?(n+=2,K=this.getToken(n++).value,G=this.stringParameter(++n),++n):(G=this.stringParameter(n++),K=this.stringParameter(n++)),t.put(G,K));1073741940==this.tokAt(n)&&(w=this.stringParameter(++n))}else q=
new JU.Lst,1==n&&(268440577==this.tokAt(n+1)||268440576==this.tokAt(n+1)?D="files":n++,v.append(" "+D)),268440576==this.tokAt(n+1)&&(e=!0),w=this.getLoadFilesList(n,v,B,t,q),y=q.toArray(Array(q=q.size())),!e&&0<=v.indexOf("/*concat*/")&&(e=!0);if(a){null!=y&&(l="fileSet");null!=K&&B.append(' APPEND data "'+G+'"\n'+K+(K.endsWith("\n")?"":"\n")+'end "'+G+'"');null==w&&(w=this.vwr.g.defaultLoadFilter);0<w.length&&(0<=w.toUpperCase().indexOf("DOCACHE")&&!this.$isStateScript&&!b&&this.vwr.cacheClear(),
t.put("filter",w),w.equalsIgnoreCase("2d")&&(w="2D-noMin"),B.append(" FILTER "+JU.PT.esc(w)));a=!1;if(null==y)if(0<=this.vwr.am.cmi&&("::"+l).endsWith("::string")&&(l=this.getCurrentModelFileAsString("null"),v=(new JU.SB).append("load inline "),c=!0),c)t.put("fileData",l);else if(l.startsWith("@")&&1<l.length){H=this.getVarParameter(l.substring(1),!1);if(x(H,"java.util.Map")){this.checkLength(n+1);this.loadPNGJVar(l,H,t);return}a=!0;H=""+H;v=(new JU.SB).append("{\n    var ").append(l.substring(1)).append(" = ").append(JU.PT.esc(H)).append(";\n    ").appendSB(v);
t.put("fileData",H)}else if(!p&&!((l.startsWith("=")||l.startsWith("*"))&&0<l.indexOf("/"))){n="";K=l.indexOf("::");0<K&&20>K&&(n=l.substring(0,K+2),l=l.substring(K+2));if(l.startsWith("cache://"))m=null;else if(!h||0<l.length)l=this.checkFileExists("LOAD"+(b?"_APPEND_":"_"),d,l,H,!b&&this.pc!=this.pcResume),null==l&&this.error(57),l=n+l;l.startsWith("cache://")&&(m=null)}n=d=null;null!=m&&(m.equals(".")&&(m=this.vwr.fm.getFilePath(l,!1,!0)),(0==m.length||this.vwr.fm.getFilePath(m,!1,!1).equalsIgnoreCase(this.vwr.fm.getFilePath(l,
!1,!1)))&&this.invArg(),w=Q(-1,[m]),d=this.vwr.getOutputChannel(m,w),null==d?JU.Logger.error("Could not create output stream for "+w[0]):t.put("outputChannel",d));if(null==y&&0==E){v.append(" ");a||c?v.append(0<=l.indexOf("\n")||a?JU.PT.esc(l):l):p||(null!=m&&(m=this.vwr.fm.getFilePath(m,!1,!1)),l.equals("String[]")||v.append("/*file*/").append(null!=m?JU.PT.esc(m):"$FILENAME$"));if(!e&&(l.startsWith("=")||l.startsWith("*"))&&0<l.indexOf("/")){var e=!0,K=l.indexOf("/"),I;1==K&&null!=(I=this.vwr.getPdbID())?
(l=l.substring(0,1)+I+l.substring(1),K=l.indexOf("/")):I=l.substring(1,K);c=l.substring(K+1);l=l.substring(0,K);if(0<=(K=l.indexOf(".")))l=l.substring(0,K);0<=";dssr;rna3d;dom;val;".indexOf(";"+c+";")||c.startsWith("dssr--")?(l.startsWith("=")&&(l+=".cif"),y=c.equals("all")?Q(-1,[l,"*dom/"+I,"*val/"+I]):Q(-1,[l,"*"+c+"/"+I]),l="fileSet",v=null,a=!1,n="-"):l+="/"+c}null!=v&&(0<B.length()&&v.append(" /*options*/ ").append(B.toString()),a&&v.append("\n  }"),t.put("loadScript",v))}this.setCursorWait(!0);
(I=this.vwr.getBoolean(603979934))&&JU.Logger.startTimer("load");!this.$isStateScript&&(!b&&!this.vwr.getBoolean(603979831))&&this.vwr.setBooleanProperty("legacyJavaFloat",!1);h&&t.put("isMutate",Boolean.TRUE);t.put("eval",this);B=this.vwr.loadModelFromFile(null,l,y,null,b,t,v,B,E,null!=n?n:e?"+":" ");I&&this.showString(JU.Logger.getTimerMsg("load",0));null!=d&&(this.vwr.fm.setFileInfo(Q(-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<E)this.vwr.fm.setFileInfo(s),null!=B&&!this.isCmdLine_c_or_C_Option&&this.evalError(B,null);else{if(null!=B&&!this.isCmdLine_c_or_C_Option){if(0==B.indexOf("NOTE: file recognized as a script file: ")){l=B.substring(40).trim();if(0<=l.indexOf("png|")&&l.endsWith("pdb|state.spt")){l=l.substring(0,l.lastIndexOf("|"));l+=l.substring(l.lastIndexOf("|"));this.runScript('load "'+l+'"');return}this.cmdScript(0,l,null,null);return}if(this.vwr.async&&B.startsWith(JV.JC.READER_NOT_FOUND))throw new JS.ScriptInterruption(this,
"async",1);this.evalError(B,null)}this.debugHigh&&this.report("Successfully loaded:"+(null==y?t.get("fullPathName"):D),!1);this.finalizeLoad(b,u,e,k,q,r,z,p)}}});e(d,"checkFileExists",function(a,b,c,f,h){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,f,h);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");e(d,"addLoadData",function(a,b,c,f){a.append(" /*data*/ data");var h=b.indexOf("@");0<=h&&(b=b.$replace("@","_"));a.append(" ").append(JU.PT.esc(b));var p=0<=h?""+this.getParameter(b.substring(h+1),4,!0):this.paramAsStr(++f);p.startsWith(JV.JC.BASE64_TAG)||(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>h&&(f+=2);return f},"JU.SB,~S,java.util.Map,~N");e(d,"loadPNGJVar",
function(a,b,c){b=Q(-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("","BINARY",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");e(d,"getLoadFilesList",function(a,b,c,f,h){for(var p=null,d=null,e=null,k=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,f);continue;case 1073741940:d=this.stringParameter(++a);++a;continue;case 1073742329:f.remove("isTrajectory");null==p&&(p=new JU.Lst,e=JU.P3.new3(0,-1,1));this.isPoint3f(++a)?(e=this.getPoint3f(a,!1,!0),a=this.iToken+1):10==this.tokAt(a)&&(k=this.getToken(a).value,e=null,a=this.iToken+1);break;case 1073741824:this.invArg()}h.addLast(this.paramAsStr(a++));null!=e?(p.addLast(O(-1,
[C(e.x),C(e.y),C(e.z)])),b.append(" COORD "+JU.Escape.eP(e))):null!=k&&(p.addLast(k),b.append(" COORD "+JU.Escape.eBS(k)));b.append(" /*file*/$FILENAME"+h.size()+"$")}null!=p&&f.put("firstLastSteps",p);return d},"~N,JU.SB,JU.SB,java.util.Map,JU.Lst");e(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");e(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 f=this.floatParameterSet(a,1,2147483647),
h=new JU.BS,p=O(f.length,0),d=0;d<f.length;d++)a=C(f[d]),1<=f[d]&&f[d]==a?h.set(a-1):this.invArg(),p[d]=a;b.append(" "+JU.Escape.eAI(p));c.put("bsModels",h);c.put("useFileModelNumbers",Boolean.TRUE)}return this.iToken+1},"~N,JU.SB,java.util.Map");e(d,"finalizeLoad",function(a,b,c,f,h,d,e,g){d=JU.BSUtil.newBitSet2(a?d:0,this.vwr.ms.ac);if(a&&(b||1<h))this.vwr.setAnimationRange(-1,-1),this.vwr.setCurrentModelIndex(e);this.vwr.setModelkitPropertySafely("updateatomkeys",d);var k;0==this.scriptLevel&&
(!a&&(c||2>h)&&null!=(k=this.vwr.ms.getInfoM("modelLoadNote")))&&this.showString(k);k=this.vwr.ms.getInfoM("centroidMinMax");JU.AU.isAI(k)&&0<this.vwr.ms.ac&&this.vwr.ms.setCentroid(d,k);a=this.vwr.g.defaultLoadScript;k="";0<a.length&&(k+="\nUsing defaultLoadScript: "+a);var u;b=this.vwr.ms.msInfo;null!=b&&this.vwr.allowEmbeddedScripts()&&null!=(u=b.remove("jmolscript"))&&0<u.length?(k+="\nAdding embedded #jmolscript: "+u,a+=";"+u,this.setStringProperty("_loadScript",a),a="allowEmbeddedScripts = false;try{"+
a+"} allowEmbeddedScripts = true;",this.isEmbedded=!this.isCmdLine_c_or_C_Option):this.setStringProperty("_loadScript","");this.logLoadInfo(k,g);g=null==b?null:b.remove("sitescript");null!=g&&(a=g+";"+a);f&&(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");e(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)}});e(d,"cmdLoop",function(){this.vwr.headless||(this.chk||(this.pc=-1),this.cmdDelay())});e(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))});e(d,"cmdModel",function(a){var b=4115==this.theTok||1<this.vwr.ms.mc,c=O(-1,[-1,-1]),f=0,h=!0,d=-1;if(1==this.slen&&1==a){var d=this.vwr.am.cmi,e;if(!this.chk&&0<=d&&0<=(e=this.vwr.ms.getJmolDataSourceFrame(d)))this.vwr.setCurrentModelIndex(e==
d?-2147483648:e)}else{switch(this.tokAt(1)){case 1073877010:if(!this.chk&&b&&2==this.slen){for(;++d<this.vwr.ms.mc;)if(this.vwr.ms.am[d].auxiliaryInfo.containsKey("moData")){this.vwr.am.setFrame(d);this.showString("Frame set to "+(d+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:d=this.atomExpressionAt(1).nextSetBit(0);if(this.chk||0>d||d>=this.vwr.ms.ac)return;d=this.vwr.ms.at[d].mi;
if(this.iToken+1==this.slen){this.vwr.setCurrentModelIndex(d);return}c[f++]=d;a=this.iToken+1;h=!1;break;case 1073741904:this.iToken=1;d=2==this.tokAt(2)?this.intParameter(++this.iToken):1;this.checkLength(this.iToken+1);!this.chk&&0<d&&this.vwr.ms.createModels(d);return;case 1073741974:this.checkLength(3);d=this.stringParameter(2);-2147483648!=JU.PT.parseInt(d)&&this.invArg();this.chk||this.vwr.setCurrentModelID(d);return;case 528397:d=0;this.checkLength(3);switch(this.getToken(2).tok){case 2:case 3:d=
ba(1E3*this.floatParameter(2));break;default:this.error(20)}this.chk||this.vwr.setFrameDelayMs(d);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)){d=this.vwr.ms.getModelNumberIndex(this.getToken(2).intValue,!1,!1);c=this.getToken(3).value;0<=d&&(this.vwr.ms.am[d].mat4=c);return}break;case 1073741832:c=1073742333==
this.tokAt(2);d=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(d,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 g=e=b=!1,k=null,u=null,l=!1,k=!1,m=0,n=null,w=this.vwr.haveFileSet();if(this.isArrayParameter(1))this.setFrameSet(1),l=!0;else for(var z=
a;z<this.slen;z++)switch(this.getToken(z).tok){case 1275069447:switch(z==this.slen-1?f:-1){case 2:break;case 0:if(2==this.vwr.ms.mc){c[0]=0;c[1]=1;f=2;break}default:this.invArg()}g=!0;break;case 1073741832:2!=z&&this.invArg();n=this.centerParameter(3,null);this.checkLength(z=this.iToken+1);break;case 1073742327:case 268441089:this.checkLength(a+(e?2:1));l=!0;break;case 268440576:1!=f&&this.invArg();k=!0;break;case 1073742333:this.checkLength(a+1);break;case 3:if(h=!1,0>(m=this.floatParameter(z))){this.checkLength(z+
1);this.chk||this.vwr.am.morph(-m);return}case 2:case 4:2==f&&this.invArg();var r=4==this.theTok?JU.Edge.getFloatEncodedInt(this.theToken.value):this.theToken.intValue;0>r&&1==f&&(k=!0,r=-r,w&&1E6>r&&(r*=1E6));3==this.theTok&&(w&&m==C(m))&&(r=1E6*C(m));if(2147483647==r){h=!1;c[f++]=this.chk||1!=z?0:this.vwr.getModelIndexFromId(this.theToken.value.toString());break}if(-1==r){this.checkLength(a+1);this.chk||this.vwr.setAnimation(1073742108);return}1E3<=r&&(1E6>r&&w)&&(r=1E6*U(r/1E3)+r%1E3);!h&&(0==
r&&0==f)&&(l=!0);1E6<=r&&(h=!1);c[f++]=r;break;case 1073742096:b=!0;break;case 1073742114:e=!0;break;case 1715472409:if(0>d&&0>(d=this.vwr.am.cmi))return;k=this.paramAsStr(++z);c=this.setVariable(++z,-1,"",!1);if(null!=c&&!this.chk){if(k.equalsIgnoreCase("DSSR")){this.loadDssr(d,c.value);return}u=JS.SV.oValue(c)}this.chk||this.vwr.ms.setInfo(d,k,u);return;default:this.frameControl(a);return}if(!this.chk)if(e&&0==f&&(l=!0),l)this.vwr.setAnimationOn(!1),this.vwr.setAnimationRange(-1,-1),e||this.vwr.setCurrentModelIndex(-1);
else{2==f&&(!e&&!g)&&(k=!0);if(w)h=!1;else if(h)for(z=0;z<f;z++)0<=c[z]&&(c[z]%=1E6);d=this.vwr.ms.getModelNumberIndex(c[0],h,!1);if(null!=n)0<=d&&(this.vwr.ms.translateModel(d,null),this.vwr.ms.translateModel(d,n));else{a=-1;if(w&&0>d&&0!=c[0])if(1E6>c[0]&&(c[0]*=1E6),2==f&&1E6>c[1]&&(c[1]*=1E6),0==c[0]%1E6)c[0]++,d=this.vwr.ms.getModelNumberIndex(c[0],!1,!1),0<=d&&(a=this.vwr.ms.getModelNumberIndex(1==f?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--,e?f=2:
!k&&a!=d&&(k=!0),e=e||d==a);else return;(!b&&!e||0<=d)&&this.vwr.setCurrentModelIndexClear(d,!1);if(b&&2==f||e||k||g)0>a&&(a=this.vwr.ms.getModelNumberIndex(c[1],h,!1)),this.vwr.setAnimationOn(!1),this.vwr.am.setAnimationDirection(1),g||this.vwr.setAnimationRange(d,a),this.vwr.setCurrentModelIndexClear(k&&!e?-1:0<=d?d:0,!1);g?this.vwr.am.setSplitFrame(d,a):this.vwr.am.setSplitFrame(-1,-1);b&&this.vwr.setAnimation(4143)}}}}},"~N");e(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(!0).fixDSSRJSONMap(c));this.vwr.ms.setInfo(a,"dssr",c)},"~N,~S");e(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)),f=this.floatParameter(8),
h=this.floatParameter(9),d=11==this.slen?this.intParameter(10):30;if(!this.chk&&(this.refresh(!1),this.useThreads(!0)||(h=0),this.vwr.move(this,a,b,c,f,h,d),0<h&&this.isJS))throw new JS.ScriptInterruption(this,"move",1);});e(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.moveTo(this,a,null,JV.JC.axisZ,
0,null,100,0,0,0,null,NaN,NaN,NaN,NaN,NaN,NaN),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,f=1;a=this.isFloatParameter(f)?this.floatParameter(f++):2;var h=90,d=null,e=!0,e=!1,g=0,k=0,u=NaN,l=NaN,m=this.vwr.tm.getZoomSetting(),n=null,w=NaN,z=NaN,r=NaN,v=NaN,q=NaN,t=NaN,D=null,y=null,s=this.getToken(f).tok;switch(s){case 1073742110:D=this.floatParameterSet(++f,18,21);f=this.iToken+1;if(this.chk&&0<this.checkLength(f))return;
break;case 134221850:1073742028==this.tokAt(++f)&&(e=!0,f++);this.isAtomExpression(f)?(e=!0,y=Array(1),c=this.centerParameter(f,y),x(y[0],"JU.BS")||this.invArg(),d=y[0],y=this.chk?new JU.Quat:this.vwr.ms.getQuaternion(d.nextSetBit(0),this.vwr.getQuaternionFrame())):y=this.getQuaternionParameter(f,null,!1);f=this.iToken+1;null==y&&this.invArg();break;case 9:case 8:case 1073742332:this.isPoint3f(f)?(b.setT(this.getPoint3f(f,!0,!0)),f=this.iToken+1,h=this.floatParameter(f++)):(h=this.getPoint4f(f),f=
this.iToken+1,b.set(h.x,h.y,h.z),h=0==h.x&&0==h.y&&0==h.z?NaN:h.w);break;case 1073741954:b.set(1,0,0);h=0;this.checkLength(++f);break;case 1073741858:b.set(0,1,0);h=180;this.checkLength(++f);break;case 1073741996:b.set(0,1,0);this.checkLength(++f);break;case 1073742126:b.set(0,-1,0);this.checkLength(++f);break;case 1073742172:b.set(1,0,0);this.checkLength(++f);break;case 1073741871:b.set(-1,0,0);this.checkLength(++f);break;case 134217750:case 1073741918:f=this.planeParameter(f,!1);y=JU.V3.new3(0,
0,1);y.cross(y,f);0.001>y.length()&&(y.set(0,1,0),y.cross(y,f));f.cross(y,f);y=JU.Quat.getQuaternionFrame(null,f,y).inv();f=this.iToken+1;break;case 1073741854:y=this.paramAsStr(++f);y.equals("-")&&(y+=this.paramAsStr(++f));this.checkLength(++f);switch("xyz".indexOf(y)){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:var B;B=this.vwr.getCurrentUnitCell();null==B&&(B=this.vwr.getSymTemp().setUnitCellFromParams(null,
!1,NaN));y=B.getQuaternionRotation(y);null==y&&this.invArg()}break;default:b=JU.V3.new3(this.floatParameter(f++),this.floatParameter(f++),this.floatParameter(f++)),h=this.floatParameter(f++)}null!=y&&(h=y.toAxisAngle4f(),b.set(h.x,h.y,h.z),h=(e?-1:1)*(180*h.angle/3.141592653589793));Float.isNaN(b.x)||Float.isNaN(b.y)||Float.isNaN(b.z)?b.set(0,0,0):0==b.length()&&0==h&&(h=NaN);e=134221850==s||!this.vwr.tm.isInPosition(b,h);this.isFloatParameter(f)&&(u=this.floatParameter(f++));this.isFloatParameter(f)&&
!this.isCenterParameter(f)&&(g=this.floatParameter(f++),k=this.floatParameter(f++),!e&&1<=Math.abs(g-this.vwr.tm.getTranslationXPercent())&&(e=!0),!e&&1<=Math.abs(k-this.vwr.tm.getTranslationYPercent())&&(e=!0));null==d&&f!=this.slen&&(y=Array(1),c=this.centerParameter(f,y),x(y[0],"JU.BS")&&(d=y[0]),f=this.iToken+1);if(null!=c){!e&&0.1<=c.distance(this.vwr.tm.fixedRotationCenter)&&(e=!0);this.isFloatParameter(f)&&(l=this.floatParameter(f++));this.isCenterParameter(f)||((0==l||Float.isNaN(l))&&(0==
u||Float.isNaN(u))?(d=Math.abs(this.getZoom(0,f,d,0==u?0:m)),f=this.iToken+1,u=d):!e&&0.1<=Math.abs(l-this.vwr.getFloat(570425388))&&(e=!0));if(0==u||Float.isNaN(u))u=100;Float.isNaN(l)&&(l=0);!e&&1<=Math.abs(u-m)&&(e=!0);f!=this.slen&&(n=this.centerParameter(f,null),f=this.iToken+1,f!=this.slen&&(w=this.floatParameter(f++),z=this.floatParameter(f++)),f!=this.slen&&(r=this.floatParameter(f++)),f!=this.slen&&(v=this.floatParameter(f++),!e&&0.01<=Math.abs(v-this.vwr.tm.getCameraDepth())&&(e=!0)),f+
1<this.slen&&(q=this.floatParameter(f++),t=this.floatParameter(f++),!e&&0.01<=Math.abs(q-this.vwr.tm.camera.x)&&(e=!0),!e&&0.01<=Math.abs(t-this.vwr.tm.camera.y)&&(e=!0)))}this.checkLength(f);if(!this.chk&&(e||(a=0),0<a&&this.refresh(!1),this.useThreads(!0)||(a=0),0==v&&(v=q=t=NaN),null!=D?this.vwr.tm.moveToPyMOL(this,a,D):this.vwr.moveTo(this,a,c,b,h,null,u,g,k,l,n,w,z,r,v,q,t),this.isJS&&0<a&&this.vwr.g.waitForMoveTo))throw new JS.ScriptInterruption(this,"moveTo",1);}}});e(d,"isAtomExpression",
function(a){switch(this.tokAt(a)){case 12290:case 10:case 1073742325:return!0;default:return!1}},"~N");e(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});e(d,"cmdPrint",function(){1==this.slen?this.chk||this.showStringPrint("\x00",!0):this.showStringPrint(this.parameterExpressionString(1,0),!0)});e(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,null,!0)});e(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",Q(-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)}});
e(d,"resetError",function(){this.vwr.g.removeParam("_errormessage")});e(d,"cmdRestrict",function(){var a=1677721602==this.tokAt(1);this.cmdSelect(a?2:1);this.restrictSelected(a,!0)});e(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");e(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 f=null,h=null,d=1.4E-45,e=0,g=3.4028235E38,k=!1,u=!1,l=!1,m=null,n=null,w=Array(2),z=JU.V3.new3(0,1,0),r=null,v=null,q=null,t=!1,x=1,y,s=null,B=!1,E=!1,F=!1,H=null,K=null,G=null,C=null,I=this.vwr.getBoolean(603979806),R=!1,A=
1;A<this.slen;++A){switch(y=this.getToken(A).tok){case 528432:case 4145:R=null!=this.vwr.getOperativeSymmetry();continue;case 12290:case 10:case 1073742325:if(h=this.atomExpressionAt(A),null!=r||null!=s||2==e){f=h;H=null;b=!0;break}case 1073742332:case 8:case 1073742330:u=!0;2==e&&(e=0);if(l){1==e&&this.invArg();z=JU.V3.newV(this.getPoint3f(A,!0,!0));a&&this.slen==this.iToken+1&&(d=2);break}n=this.centerParameterForModel(A,this.vwr.am.cmi,null);!this.chk&&(1073742330==y&&268437504!=this.tokAt(A+2))&&
(k=!0,z=Q(-1,[this.objectNameParameter(++A),Integer.$valueOf(this.vwr.am.cmi),null]),z=this.getShapePropertyData(22,"getSpinAxis",z)?z[2]:null);w[e++]=n;break;case 135198:k=l=!0;q=this.getMatrixParam(A+1,3,!1);null==q&&(A=this.getPoint4fNoError(A+1),null!=A&&(s=JU.Quat.newP4(A)));A=this.iToken;this.isFloatParameter(A+1)&&(z.x=NaN);break;case 1095241729:a=!0;continue;case 1073741988:case 1073742028:k=!0;continue;case 1113589787:b=!0;break;case 268436992:continue;case 2:case 3:a?1.4E-45==d?d=this.floatParameter(A):
3.4028235E38==g?(g=d,d=this.floatParameter(A)):this.invArg():3.4028235E38==g?g=this.floatParameter(A):1.4E-45==d?(d=this.floatParameter(A),a=!0):this.invArg();if(A==this.slen-2&&(1073741824==this.tokAt(A+1)||4==this.tokAt(A+1)))A=this.paramAsStr(++A).toLowerCase(),A.equals("dps")?E=!0:A.equals("sec")&&(F=!0);break;case 268440576:x=-1;continue;case 1111492629:if(c)return;u=!0;z.set(x,0,0);continue;case 1111492630:if(c)return;u=!0;z.set(0,x,0);continue;case 1111492631:u=!0;z.set(0,0,I&&!k?-x:x);continue;
case 9:case 134221850:case 1073741864:134221850==y&&A++;u=!0;if(null!=(s=this.getQuaternionParameter(A,h,1073741864==y)))0==s.q0&&(s.q0=1E-10),z.setT(s.getNormal()),g=s.getTheta();break;case 134217750:if(this.paramAsStr(A+1).equalsIgnoreCase("picked")){n=this.vwr.getPOrNull("pickedList");A=n.size();if(3>A)return;g=Array(3);for(s=0;3>s;s++)g[s]=this.vwr.ms.getAtomSetCenter(JS.SV.getBitSet(n.get(A-3+s),!1))}else if(this.isArrayParameter(A+1))g=this.getPointArray(++A,-1,!1,!0);else{g=Array(3);for(s=
0;3>s;s++)g[s]=this.centerParameter(++A,null),A=this.iToken}A=g.length;if(3>A)return;s=JU.Quat.getQuaternionFrame(g[A-3],g[A-2],g[A-1]);s=JU.Quat.new4(1,0,0,0).mulQ(s.inv().div(this.vwr.tm.getRotationQ()));z.setT(s.getNormal());g=s.getTheta();break;case 134217731:u=!0;if(this.isPoint3f(++A)){z.setT(this.centerParameter(A,null));break}A=this.getPoint4f(A);z.set(A.x,A.y,A.z);g=A.w;s=JU.Quat.newVA(z,g);break;case 1073742328:u=k=b=!0;if(this.isArrayParameter(++A))m=this.floatParameterSet(A,6,2147483647);
else{e=this.atomExpressionAt(A).nextSetBit(0);A=this.atomExpressionAt(++this.iToken).nextSetBit(0);if(0>e||0>A)return;f=this.vwr.getBranchBitSet(A,e,!0);w[0]=this.vwr.ms.at[e];w[1]=this.vwr.ms.at[A];e=2}break;case 4160:r=JU.V3.newV(this.centerParameter(++A,null));k=b=!0;break;case 136314895:B=!0;continue;case 1296041986:n=this.intParameter(++A);if(this.chk)continue;r=this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,null,-1,!1,null);k=null==r?null:r.get("operations");(0==n||null==k||k.length<Math.abs(n))&&
this.invArg();k=k[Math.abs(n)-1];r=k[5];G=k[6];w[0]=k[7];null!=k[8]&&(z=k[8]);g=k[9].intValue();0>n&&(g=-g,null!=r&&r.scale(-1));0==g&&null!=w[0]&&(z.normalize(),JU.Measure.getPlaneThroughPoint(w[0],z,C=new JU.P4));s=JU.Quat.newVA(z,g);e=null==w[0]?0:1;b=u=k=!0;continue;case 134221831:K=this.atomExpressionAt(++A);n=this.vwr.ms.getAtomPointVector(K);null==n&&(this.iToken=A,this.invArg());A=this.iToken;H=this.getPointVector(this.getToken(++A),A);if(null==H||n.size()!=H.size())this.iToken=A,this.invArg();
v=new JU.M4;w[0]=new JU.P3;e=1;J.api.Interface.getInterface("JU.Eigen",this.vwr,"script");if(0.001<(this.chk?0:JU.Measure.getTransformMatrix4(n,H,v,w[0])))H=null;case 12:case 11:u=!0;q=new JU.M3;12==y&&(t=!0,v=this.theToken.value);null!=v?(w[0]=null,f=h,H=null,e=0,r=new JU.V3,v.getTranslation(r),v.getRotationScale(q)):q=this.theToken.value;s=this.chk?new JU.Quat:JU.Quat.newM(q);z.setT(s.getNormal());g=s.getTheta();k=!0;break;default:this.invArg()}A=this.iToken}if(!this.chk){null!=m&&3.4028235E38!=
g&&(a=!0,d=g);b&&null==f&&(f=this.vwr.bsA());null!=K&&(b=!0,null==f&&(f=K));null!=s&&(!F&&!E)&&(E=0<d,F=!E);c=1.4E-45==d?10:3.4028235E38==g?d:E?d:F?(0>g?-1:1)*Math.abs(g/d):0>d==(null==s?0<g:!0)?-g/d:d;null==s&&(0>g&&0<c)&&(c=-c);if(null!=m){if(!a){this.vwr.setDihedrals(m,null,1);return}r=null}null!=s&&(0==e&&(null!=r&&!t)&&(w[0]=this.vwr.ms.getAtomSetCenter(null!=f?f:b?this.vwr.bsA():this.vwr.getAllAtoms())),B&&null!=r&&(w[1]=JU.P3.newP(w[0]),w[1].add(r),v=JU.Measure.computeHelicalAxis(w[0],w[1],
s),w[0]=v[0],B=v[3].x,0!=B&&(r=v[1],z=JU.V3.newV(r),0>B&&z.scale(-1)),v=null),a&&null==v&&(v=JS.ScriptMathProcessor.getMatrix4f(s.getMatrix(),r)),null!=w[0]&&(e=1));if(null!=G||null!=C)if(this.vwr.invertAtomCoord(G,null,f,-1,!1),null==z)return;C=a&&(!this.vwr.headless||3.4028235E38==g);a&&!C&&(a=!1);if(!R&&2>e&&null==m){if(!k){if(C&&(null==f&&!this.useThreads(!0))&&(a=!1,3.4028235E38==g))return;if(this.vwr.rotateAxisAngleAtCenter(this,w[0],z,c,g,a,f)&&this.isJS&&a&&null==f&&this.vwr.g.waitForMoveTo&&
3.4028235E38!=g)throw new JS.ScriptInterruption(this,"rotate",1);return}0==e&&(w[0]=new JU.P3);w[1]=JU.P3.newP(w[0]);w[1].add(z);e=2}0==e&&(w[0]=new JU.P3);if(2>e||0==w[0].distance(w[1]))w[1]=JU.P3.newP(w[0]),w[1].y+=1;3.4028235E38==g&&(g=0);if(R)0!=g&&((null==f||2!=e||a||null!=r||null!=m||null!=H||t)&&this.invArg(),f=this.vwr.getModelkit(!1).cmdRotateAtoms(f,w,g),this.doReport()&&this.report(J.i18n.GT.i(J.i18n.GT.$("{0} atoms rotated"),f),!1));else{0!=g&&(null!=r&&!u)&&r.scale(g/r.length());if(a&&
null!=r&&(0==g||0==d))g=0.01,c=1.4E-45==d?0.01:0>d?-g/d:0.01*d/r.length(),d=0.01;null!=f&&(a&&null==H&&null!=v)&&(n=this.vwr.ms.getAtomPointVector(f),H=JU.Measure.transformPoints(n,v,w[0]));if(null!=f&&!a&&null!=H)this.vwr.setAtomCoords(f,1145047049,H);else if(!C||this.useThreads(!1)){if(l&&(0>this.vwr.am.cmi&&this.errorStr(30,"rotate VECTOR"),null==s&&1.7976931348623157E308==g&&this.invArg(),R=a?d:g,null==s&&(s=null==q?JU.Quat.newVA(z,R):JU.Quat.newM(q)),q=s.getMatrix(),0==z.lengthSquared()&&(q.m00=
NaN),Float.isNaN(q.getElement(0,0))&&q.setElement(1,1,R),!a||0>=d)){this.vwr.tm.setSpinOff();this.vwr.rotateModelSpinVectors(-1,q);return}if(this.vwr.rotateAboutPointsInternal(this,w[0],w[1],c,g,a,f,r,H,m,l?q:null,t?v:null,!1,null)&&this.isJS&&a)throw new JS.ScriptInterruption(this,"rotate",1);}}}}},"~B,~B");e(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 f="";switch(b){case 1073742077:f="Orientation";this.vwr.stm.restoreOrientation(a,c,!0);break;case 1073742132:f="Rotation";this.vwr.stm.restoreOrientation(a,c,!1);break;case 1073742139:f="Scene",this.vwr.stm.restoreScene(a,c)}if(this.isJS&&0<c&&this.vwr.g.waitForMoveTo)throw new JS.ScriptInterruption(this,"restore"+f,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?")});e(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?")});e(d,"cmdScript",function(a,b,c,f){if(134238732==a)this.vwr.haveAccessInternal(null)&&this.error(10),this.checkLength(2),this.chk||this.vwr.jsEval(this.paramAsStr(1));else{var h=!0,d=!1,e=!1,g=this.vwr.async,k=0,u=0,l=0,m=0,n=1,w=null,q=null,r=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")&&
(g=!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);e=266298==a;if(b.equalsIgnoreCase("inline"))b=null,c=this.parameterExpressionString(++n,e?this.slen-1:0),n=this.iToken;else{for(;b.equalsIgnoreCase("localPath")||b.equalsIgnoreCase("remotePath")||
b.equalsIgnoreCase("scriptPath");)b.equalsIgnoreCase("localPath")?w=this.paramAsStr(++n):b.equalsIgnoreCase("scriptPath")?r=this.paramAsStr(++n):q=this.paramAsStr(++n),b=this.paramAsStr(++n);b.startsWith("spt::")&&(b=b.substring(5));b=this.checkFileExists("SCRIPT_",g,b,n,!0)}if(1073741877==(a=this.tokAt(++n)))d=!0,a=this.tokAt(++n);1073742050==a&&(h=!1,a=this.tokAt(++n));if(1073741998==a||1140850692==a)n++,l=k=Math.max(this.intParameter(n++),0),this.checkToken(n)&&(l=268440576==this.getToken(n).tok?
this.checkToken(++n)?this.intParameter(n++):0:-this.intParameter(n++),0>=l&&this.invArg());else if(1073741890==a||1073741892==a)n++,u=Math.max(this.intParameter(n++)-1,0),m=u+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&&g&&(b=this.checkFileExists("SCRIPT_",g,b,n,!0));if(0>n){if(268435968==this.tokAt(n=-n))f=this.parameterExpressionList(n,-1,!1),n=this.iToken+1;this.checkLength(e?
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,w,q,r),null==c&&this.invArg(),n=this.vwr.haveAccessInternal(null)),this.isMenu(c))this.vwr.setMenu(c,!1);else{w=this.chk;q=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=l;u<this.lineNumbers.length&&
this.lineNumbers[u]<k;)u++;this.pc=u;b=this.isCmdLine_C_Option;this.isCmdLine_C_Option=(new Boolean(this.isCmdLine_C_Option&h)).valueOf();this.executionStepping=(new Boolean(this.executionStepping|e)).valueOf();this.setScriptArguments(f,!1);d&&(this.listCommands=!0);(f=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);f&&
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),q?this.setErrorMessage(null):this.evalError(null,null);this.chk=w;this.isCmdLine_c_or_C_Option=q}}},"~N,~S,~S,JU.Lst");e(d,"isMenu",function(a){var b=null==a?-1:a.indexOf("Menu Structure");return 0<b&&a.startsWith("#")&&b<a.indexOf("\n")},"~S");e(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,f=this.expandFloatArray(this.floatParameterSet(-a,0,2147483647),0,!1),h=f.length;0<=--h;)0<=f[h]&&c.set(f[h]);-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}f=0;b=!1;(h=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:f=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,f,!this.doReport(),h),
this.vwr.slm.noneSelected=Boolean.$valueOf(4==this.slen&&1073742333==this.tokAt(2))))}},"~N");e(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");e(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,f=0,h,d=2147483647,e=!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)?
S(-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();e=this.floatParameterSet(3,0,2147483647);0!=e.length%4&&this.invArg();this.vwr.setStructureList(e,
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),e&&this.vwr.showParameter("debugScript",!0,80));this.setDebugging();e&&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);e=this.getSetAxesTypeMad10(2);2147483647!=e&&this.setShapeSizeBs(6,3==c?U(e/10):e,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++)e=this.getArgbParam(a),c.addLast(Integer.$valueOf(e)),a=this.iToken;if(this.chk)return;a=c.size();for(e=O(a,0);0<=--a;)e[a]=c.get(a).intValue();this.vwr.cm.ce.setUserScale(e);return;case 553648188:this.isFloatParameter(2)?
(this.checkLength(3),this.setIntProperty("zSlab",C(this.floatParameter(2))),h=null):(this.isCenterParameter(2)||this.invArg(),h=this.centerParameter(2,null),this.checkLength(this.iToken+1));this.chk||(this.vwr.tm.zSlabPoint=null==h?null:JU.P3.newP(h));return}var g=!0;switch(c){case 536870914:if(2<this.slen){e=this.getSettingStr(2,!1);c=!1;0>e.indexOf(".")?(e=JU.PT.parseInt(e),c=!0):e=JU.Edge.getFloatEncodedInt(e);if(this.chk)return;c=this.vwr.ms.getModelNumberIndex(e,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}f=545259555;case 545259555:2<this.slen&&(h=this.paramAsStr(2),3==this.slen&&(null==J.c.VDW.getVdwType(h)&&null==J.c.VDW.getVdwType(h=this.getSettingStr(2,!1)))&&this.invArg(),this.setStringProperty(b,h));break;case 536870918:if(2<this.slen){var k=this.parameterExpressionToken(2);8==k.tok?h=k.value:(h=new JU.P3,k=k.asInt(),100<=k&&JU.SimpleUnitCell.ijkToPoint3f(k,h,-1,0));this.chk||this.vwr.setDefaultLattice(h)}break;case 545259552:case 545259545:2<this.slen&&(h=1073741991==(this.theTok=this.tokAt(2))||
1073742116==this.theTok?this.paramAsStr(this.checkLast(2)):this.getSettingStr(2,!1),this.setStringProperty(b,h));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){g=!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:g=!1}if(!g||e){k=!g&&!a&&null!=this.getContextVariableAsVariable(b,!1);if(!g&&!k)switch(c){case 1677721602:f=603979928;break;case 1612709894:f=603979908;
break;case 1612709900:f=603979910;break;case 1610612739:f=603979878;break;case 1665140738:f=570425394;this.setFloatProperty("solventProbeRadius",this.getSettingFloat(2));g=!0;break;case 1610612740:f=570425390;break;case 1612709912:f=603979948;break;case 1765808134:f=545259545;break;case 1095241729:h=this.paramAsStr(2).toLowerCase();switch("x;y;z;fps;".indexOf(h+";")){case 0:f=570425398;break;case 2:f=570425400;break;case 4:f=570425402;break;case 6:f=570425396;break;default:this.errorStr2(50,"set SPIN ",
h)}this.chk||this.vwr.setSpin(h,C(this.floatParameter(this.checkLast(3))));g=!0}if(0!=f)b=JS.T.nameOf(c=f);else if(!k&&!g){(0==b.length||"_"==b.charAt(0)&&268437504!=this.tokAt(2))&&this.error(56);f=b.toLowerCase();if(0==f.indexOf("label")&&JU.PT.isOneOf(f.substring(5),";front;group;atom;offset;offsetexact;offsetabsolute;pointer;alignment;toggle;scalereference;for;")&&this.cmdSetLabel(f.substring(5)))return;if(a&&0==f.indexOf("shift_")){c=this.floatParameter(2);this.checkLength(3);this.chk||this.vwr.getNMRCalculation().setChemicalShiftReference(f.substring(6),
c);return}f.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(!g&&a)switch(this.slen){case 2:this.setBooleanProperty(b,!0);g=!0;break;case 3:2147483647!=d&&(this.setIntProperty(b,d),g=!0)}!g&&(!a&&1073742333==this.tokAt(2))&&(this.chk||this.vwr.removeUserVariable(b.toLowerCase()),g=!0);if(!g&&(this.setVariable(1,0,b,!0),!a))return;e&&this.vwr.showParameter(b,!0,80)}}}});e(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");e(d,"cmdSetEcho",function(a){var b=null,c=null,f=null,h=!0,d=0<a;a=0==a?2:a;switch(d?0:this.getToken(a).tok){case 1073742334:f=b="allOff";this.checkLength(++a);break;case 1073742333:h=!1;case 1073742327:f=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:f=
this.paramAsStr(a++)}this.chk||(this.vwr.ms.setEchoStateActive(h),this.sm.loadShape(31),null!=f&&(null==b&&!d&&this.setShapeProperty(31,"thisID",null),this.setShapeProperty(31,null==b?"target":b,f)));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(C(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:f=this.intParameter(a-
1);h="xpos";268441090==this.tokAt(a)&&(h="%xpos",a++);b="ypos";c=Integer.$valueOf(this.intParameter(a++));268441090==this.tokAt(a)&&(b="%ypos",a++);this.checkLength(a);this.setShapeProperty(31,h,Integer.$valueOf(f));break;case 1073742066:b="offset";this.isPoint3f(a)?(a=this.getPoint3f(a,!1,!0),c=S(-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==f&&(b=Array(1),this.getShapePropertyData(31,"currentTarget",b),f=b[0]);if(!this.chk&&this.vwr.ms.getEchoStateActive()&&this.vwr.fm.loadImage(this.getToken(a).value,f,!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");e(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=S(-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),f=this.intParameterRange(3,-500,500);if(2147483647==b||2147483647==f)return!0;b=Integer.$valueOf(JV.JC.getOffset(b,
f,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");e(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 f=0<=(f=c.indexOf("_"))?f:c.length,f=JV.ActionManager.getPickingMode(c.substring(0,f));
0>f&&this.errorStr2(50,"SET PICKING "+b,c);this.setStringProperty("picking",c)}});e(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 f=this.paramAsStr(a);switch(this.getToken(a).tok){case 1073742333:case 1073742334:f=b?"measureoff":"toggle";break;
case 1073742335:b&&(f="measure")}0>JV.ActionManager.getPickingStyleIndex(f)&&this.errorStr2(50,"SET PICKINGSTYLE "+c,f);this.setStringProperty("pickingStyle",f)}});e(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):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);break;case 1073742118:return;default:this.invArg()}this.chk||this.vwr.tm.slabInternal(c,a)},"~B");e(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)))});e(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))});e(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)});e(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)}});e(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");e(d,"cmdTimeout",function(a){var b=null,c=null,f=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:f=this.intParameter(a);break;case 3:f=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,f,c)}},"~N");e(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 f=(this.paramAsStr(c).toLowerCase()+" ").charAt(0);0>"xyz".indexOf(f)&&this.error(0);var h=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==h&&"\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(f,h,c,b),this.refresh(!1)))}},"~B");e(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)});e(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");e(d,"cmdUnitcell",function(a){this.getCmdExt().dispatch(1814695966,
2==a,null)},"~N");e(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))});e(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))});
e(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))});e(d,"cmdZap",function(a){if(1==this.slen||!a)(a=a&&!this.$isStateScript)&&this.vwr.cacheFileByName(null,!1),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");e(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,f=1,b=a?this.isFloatParameter(f)?this.floatParameter(f++):
1:0;0>b&&(f--,b=0);var h=0,d=null;if(1814695966==this.tokAt(f)||this.isCenterParameter(f)){var h=f,e=Array(1),c=this.centerParameter(f,e);x(e[0],"JU.BS")&&(d=e[0]);f=this.iToken+1}else 2==this.tokAt(f)&&0==this.getToken(f).intValue&&(d=this.vwr.getAtomBitSet("visible"),c=this.vwr.ms.getAtomSetCenter(d));var e=this.vwr.tm.getZoomSetting(),d=this.getZoom(h,f,d,e),f=this.iToken+1,g=e=NaN;f!=this.slen&&(e=this.floatParameter(f++),g=this.floatParameter(f++));f!=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(h),this.chk||this.vwr.setCenterBitSet(a,!1)),c=this.vwr.tm.fixedRotationCenter,Float.isNaN(e)&&(e=this.vwr.tm.getTranslationXPercent()),Float.isNaN(g)&&(g=this.vwr.tm.getTranslationYPercent()));if(!this.chk&&(Float.isNaN(e)&&(e=0),Float.isNaN(g)&&(g=0),this.useThreads(!0)||(b=0),this.vwr.moveTo(this,b,c,JV.JC.center,NaN,null,d,e,g,NaN,null,NaN,NaN,NaN,NaN,
NaN,NaN),this.isJS&&0<b&&this.vwr.g.waitForMoveTo))throw new JS.ScriptInterruption(this,"zoomTo",1);},"~B");e(d,"colorShape",function(a,b,c){var f=536875059==Math.abs(a);f?a=31:0>a&&(a=this.getShapeType(-a));var h=null,d=null,e=null,g=null,k=2==b&&1073741859==this.tokAt(1)?"ball":"",u=24==a||25==a,l=!1,m=3.4028235E38;0>b&&(g=this.atomExpressionAt(-b),b=this.iToken+1,this.isBondSet&&(l=!0,a=1));var n=this.getToken(b).tok;c?this.getToken(b):!0==(c=1610616835==n)&&this.getToken(++b);if(c)k="bg";else if(u)switch(n=
!1,1073742194==this.theTok&&(this.getToken(++b),n=!0),this.theTok){case 1073742018:this.getToken(++b);k="mesh";break;case 1073742094:b=this.getArgbParamOrNone(++b,!1);e=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")?(g=this.theToken.value,k="vertex"):n&&x(this.theToken.value,"JU.BS")?(g=this.theToken.value,k="vertex"):(g=this.atomExpressionAt(b),k="atom"),this.getToken(b=this.iToken+1)}if(this.chk||!((27==a||
28==a)&&null!=this.getIsoExt().dispatch(a,!0,this.st))){var w=1111490588==this.theTok;if(w||1073742074==this.theTok)1.4E-45==m&&this.invArg(),h=this.paramAsStr(b++),w&&this.isFloatParameter(b)&&(m=this.getTranslucentLevel(b++));n=0;if(c=b<this.slen&&1073742335!=this.tokAt(b)&&1073742334!=this.tokAt(b))if(n=this.getToken(b).tok,(!u||1073742170!=this.tokAt(b+1))&&this.isColorParam(b)){b=this.getArgbParamOrNone(b,!1);d=0==b?null:Integer.$valueOf(b);if(0!=this.tokAt(b=this.iToken+1)&&null==h)if(this.getToken(b),
(w=1111490588==this.theTok)||1073742074==this.theTok)h=this.paramAsStr(b++),w&&this.isFloatParameter(b)&&(m=this.getTranslucentLevel(b++));this.isColorParam(b)&&(b=this.getArgbParamOrNone(b,!1),e=0==b?null:Integer.$valueOf(b),b=this.iToken+1);this.checkLength(b)}else if(26==a)this.iToken--;else{var q=this.paramAsStr(b).toLowerCase(),r=0==q.indexOf("byelement"),v=r||0==q.indexOf("byresidue"),d=v||u?J.c.PAL.PROPERTY:1112152075==n?J.c.PAL.CPK:J.c.PAL.getPalette(q);(d===J.c.PAL.UNKNOWN||(d===J.c.PAL.TYPE||
d===J.c.PAL.ENERGY)&&2!=a)&&this.invArg();var C=null,t=d!==J.c.PAL.PROPERTY&&d!==J.c.PAL.VARIABLE||!this.vwr.g.rangeSelected?null:this.vwr.bsA();d===J.c.PAL.PROPERTY?v?this.chk||(C=this.getBitsetPropertyFloat(t,(r?1094715402:1094713356)|256,null,NaN,NaN)):(r=q.equals("property"))&&JS.T.tokAttr(n=this.getToken(++b).tok,1077936128)&&(1086324754==n||!JS.T.tokAttr(n,1086324736))?(n=this.getToken(b).tok,r=1111490587==n?this.getToken(++b).value.toString():1086324754==n||1145047055==n?"color":null,this.chk||
(C=this.getBitsetPropertyFloat(t,n|256,r,NaN,NaN)),b++):!r&&!u&&b++:d===J.c.PAL.VARIABLE&&(b++,q=this.paramAsStr(b++),C=S(this.vwr.ms.ac,0),JU.Parser.parseStringInfestedFloatArray(""+this.getParameter(q,4,!0),null,C),d=J.c.PAL.PROPERTY);if(d===J.c.PAL.PROPERTY){r=null;4==this.tokAt(b)?(r=this.paramAsStr(b++),0>r.indexOf("/")&&(r=r.toLowerCase()),this.isArrayParameter(b)&&(r+="="+JS.SV.sValue(JS.SV.getVariableAS(this.stringParameterSet(b))).$replace("\n"," "),b=this.iToken+1)):u&&this.isColorParam(b)&&
(r=this.getColorRange(b),b=this.iToken+1);null!=r&&!u&&(this.setStringProperty("propertyColorScheme",(w&&3.4028235E38==m?"translucent ":"")+r),v=0==r.indexOf("byelement")||0==r.indexOf("byresidue"));var D=0,y=3.4028235E38;if(!v&&(1073741826==this.tokAt(b)||1073742114==this.tokAt(b)))D=this.floatParameter(b+1),y=this.floatParameter(b+2),b+=3,D==y&&u?(v=this.getShapeProperty(a,"dataRange"),null!=v&&(D=v[0],y=v[1])):D==y&&(y=3.4028235E38);u||(null==C?this.chk||this.vwr.setCurrentColorRange(q):this.chk||
this.vwr.cm.setPropertyColorRangeData(C,t));if(u){this.checkLength(b);if(this.chk)return;c=!1;q=null==r?this.getShapeProperty(a,"colorEncoder"):null;if(null==q&&null==(q=this.vwr.cm.getColorEncoder(r)))return;q.isTranslucent=w&&3.4028235E38==m;q.setRange(D,y,D>y);3.4028235E38==y&&(q.hi=y);this.setShapeProperty(a,"remapColor",q);this.showString(this.getShapeProperty(a,"dataRangeStr").$replace("\n"," "));if(3.4028235E38==m)return}else 3.4028235E38!=y&&this.vwr.cm.setPropertyColorRange(D,y)}else b++;
this.checkLength(b)}if(!(this.chk||0>a)){f&&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!=g&&(this.vwr.selectBonds(g),g=null),a=1,this.setShapeProperty(a,"type",Integer.$valueOf(b)));if(c){switch(n){case 1111492619:this.getPartialCharges(g);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 1094713360:this.vwr.ms.calcSelectedMoleculesCount()}null!=e&&(u||11==a||14==a||21==a)?this.setShapeProperty(a,"colorPhase",Q(-1,[e,d])):null==g?this.setShapeProperty(a,k+"color",d):"vertex"===k?this.setShapePropertyBs(a,"vertexcolor",Q(-1,[d,Double.$valueOf(m)]),g):
this.setShapePropertyBs(a,k+"color",d,g)}null!=h&&"vertex"!==k&&this.setShapeTranslucency(a,k,h,m,g);f&&this.setShapeProperty(31,"thisID",null);0!=b&&this.setShapeProperty(1,"type",Integer.$valueOf(1023));l&&this.vwr.selectBonds(null);0==a&&this.vwr.shm.checkInheritedShapes()}}},"~N,~N,~B");e(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");e(d,"encodeRadiusParameter",
function(a,b,c){var f=NaN,h=J.atomdata.RadiusData.EnumType.ABSOLUTE,d=null,e=-1==a?1648363544:this.getToken(a).tok;switch(e){case 1111490561:case 1111490562:case 1111492618:case 1113589786:case 1111492620:case 1648363544:f=1,h=J.atomdata.RadiusData.EnumType.FACTOR,d=1648363544==e?null:J.c.VDW.getVdwType2(JS.T.nameOf(e)),e=this.tokAt(++a)}switch(e){case 4141:return this.vwr.rd;case 1073741852:case 1073742116:case 1073741856:case 1073741857:case 1073741991:f=1;h=J.atomdata.RadiusData.EnumType.FACTOR;
this.iToken=a-1;break;case 268440577:case 2:case 3:if(268440577==e)a++;else if(268441090==this.tokAt(a+1)){f=Math.round(this.floatParameter(a));this.iToken=++a;h=J.atomdata.RadiusData.EnumType.FACTOR;if(200<Math.abs(f))return this.integerOutOfRange(0,200),null;b&&(f=-f);f/=100;break}else if(2==e){f=this.intParameter(a);if(749<f||-200>f)return this.integerOutOfRange(-200,749),null;0<f?(f/=250,h=J.atomdata.RadiusData.EnumType.ABSOLUTE):(f/=-100,h=J.atomdata.RadiusData.EnumType.FACTOR);break}268440577==
e||!c?(h=J.atomdata.RadiusData.EnumType.OFFSET,f=16):(h=J.atomdata.RadiusData.EnumType.ABSOLUTE,d=J.c.VDW.NADA,f=100);f=this.floatParameterRange(a,b||!c?-f:0,f);if(Float.isNaN(f))return null;b&&(f=-f);16<f&&(f=16.1);break;default:1==f&&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,f,h,d)},"~N,~B,~B");e(d,"expandFloatArray",function(a,b,c){var f=a.length,h=!1,d=c?new JU.BS:null;try{for(var e=
0;e<a.length;e++)0>a[e]&&(f+=Math.abs(a[e-1]+a[e])-1,h=!0);if(h){for(var g=c?null:S(f,0),e=h=0;e<a.length;e++)if(f=C(a[e]),0<=f)f<b&&this.invArg(),c?d.set(f-1):g[h++]=f;else for(var k=C(a[e-1]),u=k<=-f?1:-1,l=-f;k!=l;k+=u,h++)c?d.set(k):g[h]=k+u;a=g;c||(f=a.length)}if(c){for(e=f;0<=--e;)d.set(C(a[e])-1);return d}for(var m=O(f,0),e=f;0<=--e;)m[e]=C(a[e]);return m}catch(n){if(G(n,Exception))return this.invArg(),null;throw n;}},"~A,~N,~B");e(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");e(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");e(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.getFileType(),null!=a&&0<a.length&&(b=a+"::"+b));return b},"~B");e(d,"getObjectBoundingBox",function(a){a=Q(-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");e(d,"getObjectCenter",function(a,b,c){a=
Q(-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");e(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");e(d,"getQuaternionArray",function(a,b){var c;switch(b){case 134221850:c=a;break;case 9:c=Array(a.length);for(var f=0;f<a.length;f++)c[f]=JU.Quat.newP4(a[f]);break;case 1073742001:c=Array(a.size());for(f=0;f<a.size();f++){var h=JS.SV.pt4Value(a.get(f));
if(null==h)return null;c[f]=JU.Quat.newP4(h)}break;default:return null}return c},"~O,~N");e(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:U(Math.floor(2E4*a))}this.chk||this.errorStr(7,'"DOTTED"');return 0},"~N");e(d,"getSettingFloat",function(a){return a>=
this.slen?NaN:JS.SV.fValue(this.parameterExpressionToken(a))},"~N");e(d,"getSettingInt",function(a){return a>=this.slen?-2147483648:this.parameterExpressionToken(a).asInt()},"~N");e(d,"getSettingStr",function(a,b){return b&&this.slen==a+1?this.paramAsStr(a):this.parameterExpressionToken(a).asString()},"~N,~B");e(d,"getShapeProperty",function(a,b){return this.sm.getShapePropertyIndex(a,b,-2147483648)},"~N,~S");e(d,"getShapePropertyData",function(a,b,c){return this.sm.getShapePropertyData(a,b,c)},"~N,~S,~A");
e(d,"getShapeType",function(a){a=JV.JC.shapeTokenIndex(a);0>a&&this.error(49);return a},"~N");e(d,"getTranslucentLevel",function(a){a=this.floatParameter(a);return 2==this.theTok&&0<a&&9>a?a+1:a},"~N");e(d,"getZoom",function(a,b,c,f){var h=this.isFloatParameter(b)?this.floatParameter(b++):NaN;if(0==h||0==f){f=NaN;if(null==c)switch(this.tokAt(a)){case 1814695966:f=this.vwr.getCurrentUnitCell();null==f&&this.invArg();h=f.getUnitCellVerticesNoOffset();a=new JU.P3;for(var d=0;8>d;d++)a.add(h[d]);a.scale(0.125);
for(d=f=0;8>d;d++){var e=h[d].distanceSquared(a);e>f&&(f=e)}0==f&&this.invArg();f=Math.sqrt(f);break;case 1073742330:h=this.getObjectBoundingBox(this.objectNameParameter(a+1)),(null==h||0==(f=h[0].distance(h[1])/2))&&this.invArg()}else f=this.vwr.ms.calcRotationRadiusBs(c);Float.isNaN(f)&&this.invArg();f=100*(this.vwr.getFloat(570425388)/f);h=NaN}if(0>h)h+=f;else if(Float.isNaN(h))switch(a=this.tokAt(b),a){case 1073742079:case 1275068432:h=f*(1073742079==a?0.5:2);b++;break;case 268441088:case 268441089:case 268440577:c=
this.floatParameter(++b);b++;switch(a){case 268441088:h=f/c;break;case 268441089:h=f*c;break;case 268440577:h=f+c}break;default:h=null==c?-f:f}this.iToken=b-1;return h},"~N,~N,JU.BS,~N");e(d,"setElementColor",function(a,b){var c=-1,f="_"==a.charAt(0);a:for(;;){if(f){a=a.substring(1);for(f=JU.Elements.elementNumberMax;0<=--f;)if(a.equalsIgnoreCase(JU.Elements.elementSymbolFromNumber(f))){c=f;break a}for(f=JU.Elements.altElementMax;4<=--f;)if(a.equalsIgnoreCase(JU.Elements.altElementSymbolFromIndex(f))||
a.equalsIgnoreCase(JU.Elements.altIsotopeSymbolFromIndex(f))){c=JU.Elements.altElementNumberFromIndex(f);break a}}else{for(f=JU.Elements.elementNumberMax;0<=--f;)if(a.equalsIgnoreCase(JU.Elements.elementNameFromNumber(f))){c=f;break a}for(f=JU.Elements.altElementMax;0<=--f;)if(a.equalsIgnoreCase(JU.Elements.altElementNameFromIndex(f))){c=JU.Elements.altElementNumberFromIndex(f);break a}}break}if(this.chk||0>c)return!1;this.vwr.setElementArgb(c,b);return!0},"~S,~N");e(d,"setMeshDisplayProperty",function(a,
b,c){var f=null,d=null,e=25==a,j=0==b;j||(c=this.getToken(b).tok);switch(c){case 1765808134:if(e)this.iToken++;else break;case 1073742074:case 1111490588:return j||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(j)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:f="token",d=Integer.$valueOf(c)}if(null==f)return!1;if(j)return!0;this.setShapeProperty(a,f,
d);0!=this.tokAt(this.iToken+1)&&(this.setMeshDisplayProperty(a,++this.iToken,0)||--this.iToken);return!0},"~N,~N,~N");e(d,"setObjectArgb",function(a,b){this.chk||this.vwr.setObjectArgb(a,b)},"~S,~N");e(d,"setObjectMad10",function(a,b,c){this.chk||this.vwr.setObjectMad10(a,b,c)},"~N,~S,~N");e(d,"setObjectProp",function(a,b,c){for(var f=Q(-1,[a,null]),d="",e=JU.PT.isWild(a),j=17;;){if(this.getShapePropertyData(j,"checkID",f)){this.setShapeProperty(j,"thisID",a);switch(b){case 12291:this.setShapeProperty(j,
"delete",null);break;case 12294:case 1610625028:this.setShapeProperty(j,"hidden",1610625028==b?Boolean.FALSE:Boolean.TRUE);break;case 134222350:d+=this.getShapeProperty(j,"command")+"\n";break;case 1765808134:0<=c&&this.colorShape(j,c+1,!1)}if(!e)break}switch(j){case 17:j=20;continue;case 20:j=32}switch(--j){case 27:j--;break;case 28:j-=2}if(21>j)break}return d},"~S,~N,~N");e(d,"setObjectProperty",function(){var a=this.setShapeNameParameter(2);return this.chk?"":this.setObjectProp(a,this.tokAt(0),
this.iToken)});e(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");e(d,"setShapeProperty",function(a,b,c){this.chk||this.sm.setShapePropertyBs(a,
b,c,null)},"~N,~S,~O");e(d,"setShapePropertyBs",function(a,b,c,f){this.chk||this.sm.setShapePropertyBs(a,b,c,f)},"~N,~S,~O,JU.BS");e(d,"setShapeSize",function(a,b){this.chk||this.sm.setShapeSizeBs(a,0,b,null)},"~N,J.atomdata.RadiusData");e(d,"setShapeSizeBs",function(a,b,c){this.chk||this.sm.setShapeSizeBs(a,b,null,c)},"~N,~N,JU.BS");e(d,"setShapeTranslucency",function(a,b,c,f,d){3.4028235E38==f&&(f=this.vwr.getFloat(570425353));this.setShapeProperty(a,"translucentLevel",Float.$valueOf(f));null!=
b&&(null==d?this.setShapeProperty(a,b+"translucency",c):this.chk||this.setShapePropertyBs(a,b+"translucency",c,d))},"~N,~S,~S,~N,JU.BS");e(d,"setSize",function(a,b){var c=null,f=this.tokAt(1),d=!1;switch(f){case 1073742072:this.restrictSelected(!1,!1);case 1073742335:break;case 1073742334:b=0;break;case 3:case 2:d=0>this.floatParameter(1)&&(3==f||268441090==this.tokAt(2));default:c=this.encodeRadiusParameter(1,d,!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));d&&this.restrictSelected(!1,!1);this.setShapeSize(a,c)},"~N,~N");e(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");e(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");e(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],f=0;f<c.length;++f)a.appendO(c[f]),a.appendC("\n");a.appendC("\n")}a.append("END\n");return a.toString()});e(d,"getCurrentModelFileAsString",function(a){null==a&&(a=this.vwr.getParameter("_modelFile"));
return(""+a).equals("null")?this.vwr.ms.getInlineData(this.vwr.am.cmi):this.vwr.getFileAsString(a)},"~S");d.iProcess=0;d.commandHistoryLevelMax=0;d.contextDepthMax=100;d.scriptReportingLevel=0});I("JS");N(["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=P(function(){this.debugHigh=!1;this.ptTemp=
this.tempStatement=this.smilesExt=this.mathExt=this.isoExt=this.cmdExt=this.privateFuncs=null;L(this,arguments)},JS,"ScriptExpr",JS.ScriptParam);e(d,"getCmdExt",function(){return null==this.cmdExt?this.cmdExt=this.getExt("Cmd").init(this):this.cmdExt});e(d,"getIsoExt",function(){return null==this.isoExt?this.isoExt=this.getExt("Iso").init(this):this.isoExt});e(d,"getMathExt",function(){return null==this.mathExt?(this.mathExt=this.getExt("Math")).init(this):this.mathExt});e(d,"getSmilesExt",function(){return null==
this.smilesExt?(this.smilesExt=this.getExt("Smiles")).init(this):this.smilesExt});e(d,"getExt",function(a){return J.api.Interface.getInterface("JS."+a+"Ext",this.vwr,"script")},"~S");e(d,"parameterExpressionList",function(a,b,c){return this.parameterExpression(a,-1,null,!0,!0,b,c,null,null,!1)},"~N,~N,~B");e(d,"parameterExpressionString",function(a,b){return this.parameterExpression(a,b,"",!0,!1,-1,!1,null,null,!1)},"~N,~N");e(d,"parameterExpressionBoolean",function(a,b){return this.parameterExpression(a,
b,null,!0,!1,-1,!1,null,null,!1).booleanValue()},"~N,~N");e(d,"parameterExpressionToken",function(a){a=this.parameterExpressionList(a,-1,!1);return 0<a.size()?a.get(0):JS.SV.newS("")},"~N");e(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");e(d,"parameterExpression",function(a,b,c,f,d,e,j,g,k,u){var l=null!=k,m=null==k&&null!=g,n=0>a,w=!d&&null==c,q=!d&&null!=
c&&0==c.length;n&&(a=-a);var r=null==g||-2147483648!=b;b<a&&(b=this.slen);var v=u?0:1,C=-1;c=new JS.ScriptMathProcessor(this,u,j,d,!1,!1,c);var t,D;j=d=0;var y=!0,s=a;a:for(;s<b;s++){t=null;var B=this.getToken(s).tok;if(l&&1073742336!=this.tokAt(s+1)){var E=null!=g&&g.containsKey(this.theToken.value)?null:this.getBitsetPropertySelector(s,10);if(null!=E){c.addX(g.get(k));c.addOpAllowMath(E,268435968==this.tokAt(s+1),0)||this.invArg();if((134320141==E.intValue||102436==E.intValue)&&268435968!=this.tokAt(this.iToken+
1))c.addOp(JS.T.tokenLeftParen),c.addOp(JS.T.tokenRightParen);s=this.iToken;continue}}switch(B){case 268437505:case 1073742338:if(!f&&y)break a;1073742338==B&&this.invArg();u&&(1==d&&268440324==this.tokAt(s+1))&&(u=c.endAssignment())}switch(B){case 12290:if(1073742325==(B=this.tokAt(++s)))t=this.parameterExpressionToken(++s),s=this.iToken;else if(2==B){t=this.vwr.ms.getAtoms(1094715393,Integer.$valueOf(this.st[s].intValue));break}else if(12290==B&&2==this.tokAt(s+1)){t=this.vwr.ms.getAtomsFromAtomNumberInFrame(this.st[++s].intValue);
break}else t=this.getParameter(JS.SV.sValue(this.st[s]),1073742190,!0);t=this.getParameter(t.asString(),1073742190,!0);break;case 134320649:268435968!=this.getToken(++s).tok&&this.invArg();null==g&&(g=new java.util.Hashtable);D=this.parameterExpression(++s,-1,null,f,!1,-1,!1,g,k,!1);E=D.booleanValue();B=this.iToken;1073742339!=this.getToken(B++).tok&&this.invArg();this.parameterExpressionBoolean(B,-1);var F=this.iToken;1073742339!=this.tokAt(F++)&&this.invArg();this.parameterExpression(-F,-1,null,
f,!1,1,!1,g,k,!1);s=this.iToken;268435969!=this.tokAt(s)&&this.invArg();t=this.parameterExpression(E?B:F,E?F:s,"XXX",f,!1,1,!1,g,k,!1);s=this.iToken=s;break;case 134320648:case 1275082241:B=(E=0<a)&&134320648==B;E?((268435968!=this.getToken(++s).tok||!JS.T.tokAttr(this.getToken(++s).tok,1073741824))&&this.invArg(),F=this.paramAsStr(s),1073742339!=this.getToken(++s).tok&&this.invArg()):F="_x";t=this.parameterExpressionToken(-++s).value;x(t,"JU.BS")||this.invArg();s=this.iToken;E&&1073742339!=this.getToken(s++).tok&&
this.invArg();var H=new JU.BS,K=new JU.BS,I=B?Array(t.cardinality()):null;null==g&&(g=new java.util.Hashtable);K.set(0);var Q=JS.SV.newV(10,K);Q.index=0;g.put(F,Q.setName(F));var O=-1;if(E){O=s-1;D=0;for(var R;0<=D&&++O<b;)268435969==(R=this.tokAt(O))?D--:268435968==R&&D++}var A=0,S=0,M=t.nextSetBit(0);if(0>M||this.chk)this.iToken=O-1;else for(;0<=M;M=t.nextSetBit(M+1))0<=S&&K.clear(S),S=M,K.set(M),Q.index=M,D=this.parameterExpression(s,O,B?"XXX":null,f,B,M,!1,g,E?null:F,!1),B?((null==D||0==D.size())&&
this.invArg(),I[A++]=D.get(0).asString()):D.booleanValue()&&H.set(M);if(B)t=I;else if(E)t=H;else return this.listBS(H);s=this.iToken+1;break;case 1073742339:break a;case 2:if(1073742336==this.tokAt(this.iToken+1)&&(805307393==(B=this.tokAt(this.iToken+2))||268441089==B))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 N;try{N=this.centerParameter(s,null),c.addX(JS.SV.newV(8,N))}catch(L){if(G(L,Exception))c.addXStr("");else throw L;}this.ignoreError=!1;s=this.iToken}break;case 1073742332:if(4==this.tokAt(s+1)){if(1073742338==
this.tokAt(s+2)){t=this.chk?new JU.BS:this.getAtomBitSet(this.stringParameter(s+1));s+=2;break}t=this.getAssocArray(s)}else t=this.getPointOrPlane(s,55);s=this.iToken;break;case 1073742340:t=this.vwr.getVisibleFrameAtomsNoSplitData();s=this.iToken;break;case 1073742325:if(1073742326==this.tokAt(s+1)){t=new java.util.Hashtable;s++;break}else 1073742327==this.tokAt(s+1)&&1073742326==this.tokAt(s+2)&&(B=1073742327,this.iToken+=2);case 1073742327:t=1073742327==B?this.vwr.getAllAtoms():this.atomExpression(this.st,
s,0,!0,!0,null,!0);s=this.iToken;if(0==j&&n)return this.iToken++,this.listBS(t);break;case 1073742195:c.addOp(this.theToken);continue;case 1073742326:break a;case 268436992:if(!f&&y)break a;c.addOp(this.theToken)||this.invArg();break;case 1073742337:case 1073742336:u&&(y&&268440324==this.tokAt(s+2))&&(u=c.endAssignment());if(0==v&&y)switch(this.tokAt(s+1)){case 0:break;case 1275335685:case 1275334681:case 1140850694:case 1140850706:case 1140850696:case 1275068418:if(1073742336==B)break;default:c.addOp(JS.T.tokenArrayOpen);
c.addXStr(this.optParameterAsString(++s));c.addOp(JS.T.tokenArrayClose);continue}E=this.getBitsetPropertySelector(s+1,c.getXTok());F=E.intValue;s=134320141==F;B=!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:B=s||1275069443==F||480==R||224==R||1275068725==R,E.intValue|=R&480,this.getToken(this.iToken+
2),268435968==this.tokAt(this.iToken+1)&&1275069443!=F&&(this.iToken+=2)}F=this.tokAt(this.iToken+1);B=(new Boolean(B&(268435968==F||s))).valueOf();c.addOpAllowMath(E,B,s?F:0)||this.invArg();s=this.iToken;134320141==E.intValue&&268435968!=F&&(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==C&&268436992==this.tokAt(s+1)){c.addX(JS.SV.newT(this.theToken));break}default:if(268437504==this.theTok&&268436482==this.tokAt(s+2)){t=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<=e)break a;this.invArg()}switch(this.theTok){case 134217759:C=s+2;break;case 268440324:y&&(v=s);break;case 268435968:j++;y=!1;break;case 268435969:if(0>=--j&&0==d){if(n){this.iToken++;
break a}y=!0}break;case 268437504:d++;y=!1;break;case 268437505:if(0==--d&&0==j){if(n){this.iToken++;break a}y=!0}}}else{E=this.paramAsStr(s).toLowerCase();B=268435968==this.tokAt(s+1);if(!B)if(this.chk)t=E;else if(null==g||null==(t=JU.PT.getMapValueNoCase(g,E))&&r)if(E.startsWith("_")&&(t=E.equals("_")?this.vwr.getModelSetAuxiliaryInfo():E.equals("_m")?this.vwr.getCurrentModelAuxInfo():null),null==t){if(t=this.getContextVariableAsVariable(E,!1),null==t)switch(E){case "all":t=this.vwr.bsA();break;
case "this":t=this.vwr.getFrameAtoms()}}else 0==v&&this.invArg();if(null==t)if(JS.T.tokAttr(this.theTok,1073741824)&&this.isFunction(E))c.addOp(JS.SV.newV(134320141,this.theToken.value))||this.invArg(),B||(c.addOp(JS.T.tokenLeftParen),c.addOp(JS.T.tokenRightParen));else{E=this.vwr.g.getAndSetNewVariable(E,!1);switch(E.tok){case 2:case 3:if(this.noCopy(s,-1)||this.noCopy(s,1))break;c.addXCopy(E);continue}c.addX(E)}}}null!=t&&(x(t,"JU.BS")?c.addXBs(t):c.addXObj(t))}a=c.getResult();null==a&&(this.chk||
c.dumpStacks("null result"),this.error(13));if(135198==a.tok)return u&&0==v?(u=new JU.Lst,u.addLast(new JS.SV),u):a.value;if(this.chk){if(w)return Boolean.TRUE;if(q)return""}else{if(w)return Boolean.$valueOf(a.asBoolean());if(q)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");e(d,"atomExpressionAt",
function(a){this.checkToken(a)||(this.iToken=a,this.bad());return this.atomExpression(this.st,a,0,!0,!1,null,!0)},"~N");e(d,"atomExpression",function(a,b,c,f,d,e){this.isBondSet=!1;a!==this.st&&(this.tempStatement=this.st,this.st=a);var j=new JS.ScriptMathProcessor(this,!1,!1,!1,null==e,d,null),g,k=!1;this.iToken=1E3;var u=0>b,l=!1,m,n=0,q=this.vwr.ms.ac,z=-10;u&&(b=-b);u=(new Boolean(u|this.chk)).valueOf();0==c&&a.length>b&&(c=b+1);a:for(;b<c;++b){this.iToken=b;g=a[b];if(null==g)break;m=g.value;
switch(g.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)){j.addXPt(m);b=this.iToken;break}break;case 1073742338:0<b&&1073742332==a[b-1].tok&&j.addXBs(new JU.BS);break;case 268437504:l=!0;j.addOp(g);break;case 268437505:l=!1;j.addOp(g);break;case 12290:j.addXBs(this.getAtomBitSet(m));break;case 7:if(m=JS.SV.getBitSet(g,!1),null!=m){j.addXBs(m);break}case 6:j.addXBs(this.vwr.ms.getAtoms(1086324744,
g.asString()));break;case 134219777:j.addX(JS.SV.newT(g));j.addX(JS.SV.newV(9,this.hklParameter(b+2,null,!0)));b=this.iToken;break;case 134217750:j.addX(JS.SV.newT(g));j.addX(JS.SV.newV(9,this.planeParameter(b+2,!1)));b=this.iToken;break;case 1073742329:j.addX(JS.SV.newT(g));j.addXPt(this.getPoint3f(b+2,!0,!0));b=this.iToken;break;case 4:var r=m;if(0==r.indexOf("({")){if(m=JU.BS.unescape(r),null!=m){j.addXBs(m);break}}else if(0<=r.indexOf("|")&&z!=b-4){j.addXBs(this.vwr.ms.getAtoms(1086324744,r));
break}j.addX(JS.SV.newT(g));r.equals("hkl")&&(j.addX(JS.SV.newV(9,this.hklParameter(b+2,null,!0))),b=this.iToken);break;case 134217759:z=b;case 134218757:case 134218756:case 1237320707:case 134353926:case 134217736:case 268436992:case 1275203608:j.addOp(g);break;case 1073742327:j.addXBs(this.vwr.getAllAtoms());break;case 1073742333:j.addXBs(new JU.BS);break;case 1073742335:case 1073742334:j.addX(JS.SV.newT(g));break;case 1113589787:j.addXBs(JU.BSUtil.copy(this.vwr.bsA()));break;case 2097194:j.addXBs(JU.BSUtil.copy(this.vwr.slm.getHiddenSet()));
break;case 12293:j.addXBs(this.vwr.getMotionFixedAtoms(null,null));break;case 2097192:j.addXBs(JU.BSUtil.copyInvert(this.vwr.slm.getHiddenSet(),q));break;case 2097200:j.addXBs(this.vwr.getBaseModelBitSet());break;case 2097198:j.addXBs(this.chk?new JU.BS:JU.BSUtil.copy(this.vwr.ms.getVisibleSet(!k)));k=!0;break;case 2097190:!this.chk&&f&&this.refresh(!1);j.addXBs(this.chk?new JU.BS:this.vwr.ms.getClickableSet(!f));f=!1;break;case 1073742356:1!=this.vwr.ms.mc||this.vwr.ms.haveBioModels?(r=g.intValue,
0<r?(m=this.compareInt(1094713346,268440324,r),2==r&&m.or(this.compareInt(1086326789,268440324,20)),j.addXBs(m)):j.addXBs(this.getAtomBits(g.tok,m))):j.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:j.addXBs(this.getAtomBits(g.tok,m));break;case 1073742358:case 1073742359:g=
g.intValue;if(2147483647==g&&x(m,Integer)){g=m.intValue();if(!this.vwr.haveFileSet()){j.addXBs(this.getAtomBits(1073742358,Integer.$valueOf(g)));break}2147>=g&&(g*=1E6)}j.addXBs(this.bitSetForModelFileNumber(g));break;case 1073742361:case 1073742357:j.addXBs(this.getAtomBits(g.tok,Integer.$valueOf(g.intValue)));break;case 1073742362:l?j.addXNum(g):j.addXBs(this.getAtomBits(1073742362,Integer.$valueOf(JS.ScriptExpr.getSeqCode(g))));break;case 1073742363:if(l){j.addXNum(g);j.addOp(JS.T.tokenMinus);
j.addXNum(a[++b]);break}m=b+3<a.length&&268439552==a[b+2].tok&&1073742357==a[b+3].tok?a[b+3].intValue:-1;j.addXBs(this.getAtomBits(1073742363,O(-1,[JS.ScriptExpr.getSeqCode(g),JS.ScriptExpr.getSeqCode(a[++b]),m])));-1!=m&&(b+=2);break;case 1094713350:case 1094713349:j.addXBs(this.getAtomBits(g.tok,m));break;case 1073742340:case 2097182:j.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:j.addXBs(this.lookupIdentifierValue(m));
break;case 268440323:case 268440322:case 268440321:case 268440320:case 268440324:case 268440325:case 268440326:r=g.tok;g=g.intValue;1094717448==g&&268440324!=r&&this.invArg();var v=null;1715472409==g&&(b+2==a.length&&this.invArg(),this.chk||(v=this.vwr.getDataObj(a[++b].value,null,1)));++b==a.length&&this.invArg();j.addXBs(this.chk?new JU.BS:this.getComparison(a[b],g,r,m,v));break;case 3:case 2:j.addXNum(g);break;case 10:m=x(m,"JM.BondSet")?m:JU.BSUtil.copy(m);j.addXBs(m);break;case 8:j.addXPt(m);
break;default:if(JS.T.tokAttr(g.tok,268435456)){j.addOp(g)||this.invArg();break}if("string"!=typeof m){j.addXObj(m);break}g=this.getParameter(m,0,!0);if(l){j.addXObj(g);break}if("string"==typeof g||x(g,"JU.Lst"))g=this.getStringObjectAsVariable(g);"string"==typeof g&&(g=this.lookupIdentifierValue(m));j.addXObj(g)}}a=j.getResult();if(null==a){if(d)return null;this.chk||j.dumpStacks("after getResult");this.error(13)}d=a.value;if("string"==typeof d&&(null==e||d.startsWith("({")))d=this.chk?new JU.BS:
this.getAtomBitSet(d);if(null!=e&&!x(d,"JU.BS"))return e[0]=d,null;m=x(d,"JU.BS")?d:new JU.BS;this.isBondSet=x(d,"JM.BondSet");!this.isBondSet&&(m=this.vwr.slm.excludeAtoms(m,u)).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");e(d,"getComparison",function(a,b,c,f,d){var e=a.tok;if(7==e){e=new JU.BS;268440324!=c&&e.setBits(0,this.vwr.ms.ac);a=a.getList();for(var j=a.size();0<=--j;){var g=this.getComparison(a.get(j),
b,c,f,d);268440324==c?e.or(g):e.and(g)}return e}var k=a.intValue,j=NaN,g=1094717454==b,u=JS.T.tokAttr(b,1094713344),l=JS.T.tokAttr(b,1111490560)||1077936128==(b&1136656384),m=u&&l,n=!u&&JS.T.tokAttr(b,1086324736);1086326789==b&&(u=!(n=!1));var q=a.value;if(JS.T.tokAttr(e,1073741824))if("_modelNumber".equalsIgnoreCase(q))k=this.vwr.am.cmi,q=Integer.$valueOf(k=0>k?0:this.vwr.getModelFileNumber(k));else{var z=this.getParameter(q,1073742190,!1);if(null!=z){if(7==z.tok)return this.getComparison(z,b,c,
f,d);k=z.intValue;q=n||1094717448==b&&2!=z.tok?JS.SV.sValue(z):JS.SV.nValue(z);a=z}}x(q,"JU.P3")?1765808134==b&&(k=JU.CU.colorPtToFFRGB(q),e=2,u=!0):"string"==typeof q&&(1765808134==b?(k=JU.CU.getArgbFromString(q),0==k&&JS.T.tokAttr(e,1073741824)&&(q=this.getVarParameter(q,!0),q.startsWith("{")?(q=JU.Escape.uP(q),k=x(q,"JU.P3")?JU.CU.colorPtToFFRGB(q):0):k=JU.CU.getArgbFromString(q)),e=2,u=!0):n||(1094717448==b?q=Integer.$valueOf(2==a.tok?a.intValue:-1E3-(q+" ").codePointAt(0)):1639976963==b||1237320707==
b||1086326789==b?n=!(u=2147483647!=k):q=JS.SV.nValue(a),x(q,Integer)?j=k=q.intValue():x(q,Float)&&g&&(k=JM.ModelSet.modelFileNumberFromFloat(q.floatValue()))));n&&"string"!=typeof q&&(q=""+q);x(q,Integer)||2==e?g?1E6<=k&&(b=-1094717454):m||l&&(j=k):x(q,Float)?g?b=-1094717454:(j=q.floatValue(),m?u=!1:u&&(k=C(j))):n||(this.iToken++,this.invArg());g&&(1E6<=k&&0==k%1E6)&&(k/=1E6,b=1228935687);if(-1094717454==b&&268440324==c)return this.bitSetForModelFileNumber(k);null!=f&&0<=f.indexOf("-")&&(u?k=-k:Float.isNaN(j)||
(j=-j));return u?this.compareInt(b,c,k):n?this.compareString(b,c,q):this.compareFloatData(b,d,c,j)},"JS.T,~N,~N,~S,~A");e(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");e(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 f=null;x(this.st[a],"JS.SV")&&(f=this.st[a].myName);null==f&&(f=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(f,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");e(d,"listBS",function(a){var b=new JU.Lst;b.addLast(JS.SV.newV(10,a));return b},"JU.BS");e(d,"compareFloatData",function(a,b,c,f){var d=new JU.BS,e=this.vwr.ms.ac,j=this.vwr.ms.at,g=0;this.vwr.autoCalculate(a,null);var k=
1715472409==a;!k&&null==this.ptTemp&&(this.ptTemp=new JU.P3);for(;0<=--e;)if(g=!1,g=j[e],!JM.AtomCollection.isDeleted(g)){if(k){if(null==b||b.length<=e)continue;g=b[e]}else g=g.atomPropertyFloat(this.vwr,a,this.ptTemp);(g=this.compareFloat(c,g,f))&&d.set(e)}return d},"~N,~A,~N,~N");e(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");e(d,"compareString",function(a,b,c){var f=new JU.BS,d=this.vwr.ms.at,e=this.vwr.ms.ac,j=268440326==b||1086326788==a&&this.vwr.getBoolean(603979822);for(j||(c=c.toLowerCase());0<=--e;)if(null!=d[e]){var g=d[e].atomPropertyString(this.vwr,a);j||(g=g.toLowerCase());this.compareStringValues(b,g,c)&&f.set(e)}return f},"~N,~N,~S");e(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);default:this.invArg()}return!1},"~N,~S,~S");e(d,"compareInt",function(a,b,c){var f=2147483647,d=null,e=b,j=c,g=this.vwr.ms,k=g.at,u=g.ac,l=-1,m=0,n=-1,q=null,x=0,r;switch(a){case 1296041986:switch(e){case 268440321:case 268440320:l=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,u);case 268440320:return JU.BSUtil.newBitSet2(c+
1,u);case 268440324:return c<u?JU.BSUtil.newBitSet2(c,c+1):new JU.BS;default:return r=JU.BSUtil.setAll(u),0<=c&&r.clear(c),r}}catch(v){if(G(v,Exception))return new JU.BS;throw v;}}r=JU.BS.newN(u);for(var C=0;C<u;++C){var t=!1,D=k[C];if(!JM.AtomCollection.isDeleted(D)){switch(a){default:f=D.atomPropertyInt(this.vwr,a);break;case 1094713371:case 1094717448:return JU.BSUtil.copy(this.vwr.ms.getConformation(-1,c,!1,null));case 1296041986:d=D.atomSymmetry;if(null==d)continue;D.mi!=n&&(n=D.mi,q=g.getModelCellRange(n),
x=g.getModelSymmetryCount(n));if(200<=j){if(null==q)continue;c=j%1E3;var y=U(j/1E3)-1;if(0>y)t=!0;else if(0==x||0<=y&&!(t=d.get(y)))continue;e=1073742333;f=0>y?D.getCellTranslation(c,q,x):D.getSymmetryTranslation(y,q,x)}else if(0<x){if(c>x&&268440323!=e&&268440322!=e)continue;if(268440325==e){0<c&&(c<=x&&!d.get(c))&&r.set(C);continue}d=JU.BSUtil.copy(d);d.clearBits(x,d.length())}switch(e){case 268440323:l=c-1;break;case 268440322:l=c;break;case 268440321:m=c-1;break;case 268440320:m=c;break;case 268440324:l=
c;m=c-1;break;case 268440325:t=!d.get(c)}0>m&&(m=0);m<l&&(d=d.nextSetBit(m),0<=d&&d<l&&(t=!0));if(!t||2147483647==f)b=1073742333}switch(b){case 268440323:t=f<c;break;case 268440322:t=f<=c;break;case 268440321:t=f>=c;break;case 268440320:t=f>c;break;case 268440324:t=f==c;break;case 268440325:t=f!=c}t&&r.set(C)}}return r},"~N,~N,~N");e(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 f=this.paramAsStr(a);this.isFunction(f.toLowerCase())&&(c=134320141)}return JS.SV.newSV(268442113,c,this.paramAsStr(a))},"~N,~N");e(d,"getBitsetPropertyFloat",function(a,b,c,f,d){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:S(a.cardinality(),
0);if(!Float.isNaN(f))for(a=0;a<b.length;a++)b[a]<f&&(b[a]=NaN);if(!Float.isNaN(d))for(a=0;a<b.length;a++)b[a]>d&&(b[a]=NaN);return b},"JU.BS,~N,~S,~N,~N");e(d,"getBitsetProperty",function(a,b,c,f,d,e,j,g,k,q){var l=2147483647!=k,m=l||!x(e,"JM.BondSet")&&!x(a,"JM.BondSet"),n=c&480,w=224==n,z=288==n;z&&(n=480);var r=this.vwr.ms.ac,v=256==n?S(r,0):null,C=480==n||w;c&=-481;var t=null;0==c&&(c=m?1153433601:1677721602);var D=!1,y=!1,s=!1,B=!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:D=!0;break;case 1275203608:y=!0;t=Q(-1,[null,null]);break;case 134320141:case 1275069443:break;case 1145045003:B=!0;break;case 1086324754:s="color"===e;B=!s;break;default:s=JS.T.tokAttr(c,1094713344)&&!JS.T.tokAttr(c,1111490560),B=!s&&JS.T.tokAttr(c,1086324736)}var E=D||!m?new JU.P3:null;if(C||B&&!l&&256!=n&&32!=n)n=1073742327;var F=1073742327==n?new JU.Lst:null,H=null,G=
H=null,I=null,O=null,N=null,R=null,A=null;switch(c){case 1153433601:if(m)break;case 1677721602:if(this.chk)return a;H=1153433601==c?this.vwr.ms.getAtoms(1677721602,a):m?JM.BondSet.newBS(this.vwr.getBondsForSelectedAtoms(a)):a;switch(n){case 32:k=H.nextSetBit(0);break;case 64:k=H.length()-1;break;case 192:case 128:case 160:return Float.$valueOf(NaN);default:return H}H.clearAll();0<=k&&H.set(k);return H;case 1086324745:switch(n){case 0:case 32:case 1073742327:return this.getCmdExt().getBitsetIdent(a,
null,e,g,k,C)}return"";case 134320141:H=j[0];G=j[1];I=JU.BS.newN(r);O=JS.SV.newV(10,I);break;case 1111490587:for(j=v.length;0<=--j;)v[j]=NaN;case 1111490574:case 1111490575:this.vwr.autoCalculate(c,e);break;case 1275069443:if(null==f&&null==d)return new JU.P3;break;case 1765808134:N=new JU.P3;break;case 1715472409:R=this.vwr.getDataObj(j,null,1),null==R&&(A=this.vwr.getDataObj(j,null,2)),null!=A&&(n=1073742327,F=new JU.Lst)}var L=g=j=0,M=0,P=0;switch(n){case 32:g=2147483647;L=3.4028235E38;break;case 64:g=
-2147483648,L=-3.4028235E38}var T=this.vwr.ms;e=null!=A?5:y?4:D?3:B?2:s?1:0;if(m){N=null!=a;null!=b?(m=0,r=b.size()):l?(m=k,r=k+1):N?(m=a.nextSetBit(0),r=Math.min(r,a.length())):m=0;this.chk&&(r=0);for(k=m;0<=k&&k<r;k=N?a.nextSetBit(k+1):k+1){j++;var V;if(null==b){if(V=T.at[k],JM.AtomCollection.isDeleted(V))continue}else V=null;switch(e){case 0:m=3.4028235E38;switch(c){case 134320141:I.set(k);m=JS.SV.fValue(this.getUserFunctionResult(H,G,O));I.clear(k);break;case 1715472409:m=null==R||k>=R.length?
0:R[k];break;case 1275069443:m=null!=d?JU.Measure.distanceToPlane(d,V):null!=b?JS.SV.ptValue(b.get(k)).distance(f):V!==f||32!=n?V.distance(f):NaN;break;default:m=V.atomPropertyFloat(this.vwr,c,this.ptTemp)}if(3.4028235E38==m||Float.isNaN(m)&&1073742327!=n){j--;continue}switch(n){case 32:m<L&&(L=m);break;case 64:m>L&&(L=m);break;case 256:v[k]=m;break;case 1073742327:F.addLast(Float.$valueOf(m));break;case 160:case 192:P+=m*m;default:M+=m}break;case 1:m=0;switch(c){case 1094717448:case 1094713349:this.errorStr(45,
JS.T.nameOf(c));break;case 1086324754:m=V.getWyckoffPosition(!1).charAt(0).charCodeAt(0);switch(m){case 63:m=0;break;case 65:m=27;break;default:m&=31}break;default:m=V.atomPropertyInt(this.vwr,c)}switch(n){case 32:m<g&&(g=m);break;case 64:m>g&&(g=m);break;case 256:v[k]=m;break;case 1073742327:F.addLast(Integer.$valueOf(m));break;case 160:case 192:P+=m*m;default:M+=m}break;case 2:m=V.atomPropertyString(this.vwr,c);switch(n){case 256:v[k]=JU.PT.parseFloat(m);break;default:if(null==F)return m;F.addLast(m)}break;
case 3:m=V.atomPropertyTuple(this.vwr,c,this.ptTemp);switch(n){case 256:1145047055==c&&(null!=m&&null!=E)&&(null==this.ptTemp&&(this.ptTemp=new JU.P3),this.ptTemp.set(0.91,-0.41,1));v[k]=null==E?-1:null==m?0:1145047055==c?m.dot(this.ptTemp):m.length();break;case 1073742327:F.addLast(null==m?Integer.$valueOf(-1):JU.P3.newP(m));break;default:null==m?j--:E.add(m)}break;case 4:switch(c){case 1275203608:if(t[0]=Integer.$valueOf(k),t[1]="",this.vwr.shm.getShapePropertyData(21,"info",t),null!=t[1]){if(null==
F)return t[1];F.addLast(t[1])}}break;case 5:F.addLast(A[k])}if(l)break}}else{m=(b=null==a)?0:a.nextSetBit(0);r=this.vwr.ms.bondCount;for(k=m;0<=k&&k<r;k=b?k+1:a.nextSetBit(k+1))if(f=T.bo[k],null!=f)switch(j++,c){case 1275068435:m=f.atom1.distance(f.atom2);switch(n){case 32:m<L&&(L=m);break;case 64:m>L&&(L=m);break;case 1073742327:F.addLast(Float.$valueOf(m));break;case 160:case 192:P+=m*m;default:M+=m}break;case 1145047049:switch(n){case 1073742327:E.ave(f.atom1,f.atom2);F.addLast(JU.P3.newP(E));
break;default:E.add(f.atom1),E.add(f.atom2),j++}break;case 1765808134:JU.CU.colorPtFromInt(this.vwr.gdata.getColorArgbOrGray(f.colix),N);switch(n){case 1073742327:F.addLast(JU.P3.newP(N));break;default:E.add(N)}break;default:this.errorStr(46,JS.T.nameOf(c))}}if(256==n)return v;if(1073742327==n){if(q)return z?this.getMathExt().getMinMax(F,1275068725,!1):F;a=F.size();if((B||y)&&!C&&1==a)return F.get(0);if(w){v=S(a,0);for(k=a;0<=--k;)switch(c=F.get(k),e){case 0:v[k]=c.floatValue();break;case 1:v[k]=
c.floatValue();break;case 2:v[k]=JU.PT.parseFloat(c);break;case 3:v[k]=null==c?-1:c.length()}return v}if(1086324744==c){v=new JU.SB;for(k=0;k<a;k++)v.append(F.get(k));return v.toString()}v=Array(a);for(k=a;0<=--k;)c=F.get(k),v[k]=x(c,"JU.P3")?JU.Escape.eP(c):""+F.get(k);return v}if(D)return 0==j?Integer.$valueOf(-1):JU.P3.new3(E.x/j,E.y/j,E.z/j);if(y)return new java.util.Hashtable;if(0==j||1==j&&192==n)return Float.$valueOf(NaN);if(s)switch(n){case 32:case 64:return Integer.$valueOf(g);case 160:case 192:break;
case 128:return Integer.$valueOf(U(M));default:return M/j==U(M/j)?Integer.$valueOf(U(M/j)):Float.$valueOf(M/j)}switch(n){case 32:case 64:M=L;break;case 128:break;case 160:M=P;break;case 192:M=Math.sqrt((P-M*M/j)/(j-1));break;default:M/=j}return Float.$valueOf(M)},"JU.BS,JU.Lst,~N,JU.P3,JU.P4,~O,~O,~B,~N,~B");e(d,"bitSetForModelFileNumber",function(a){var b=JU.BS.newN(this.vwr.ms.ac);if(this.chk)return b;var c=this.vwr.ms.mc,f=this.vwr.haveFileSet();1E6>a&&f&&(a*=1E6);if(0==a%1E6){f=this.vwr.ms.getModelNumberIndex(a+
1,!1,!1);if(0>f)return b;a=0==a?c:this.vwr.ms.getModelNumberIndex(a+1000001,!1,!1);0>f&&(f=0);0>a&&(a=c);this.vwr.ms.isTrajectory(f)&&(a=f+1);for(c=f;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");e(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");e(d,"getAtomBits",function(a,b){return this.chk?new JU.BS:this.vwr.ms.getAtoms(a,b)},"~N,~O");d.getSeqCode=e(d,"getSeqCode",function(a){return 2147483647==a.intValue?a.value.intValue():JM.Group.getSeqcodeFor(a.intValue," ")},"JS.T");e(d,"setVariable",function(a,b,c,f){var d=null,e="",d=c.startsWith("property_"),
j=c.equals("thrown_value"),e=1073742325==this.tokAt(1)||268435968==this.tokAt(1),g=d?null:0==c.length?new JS.SV:this.getContextVariableAsVariable(c,!1);if(f&&!e)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}e=0;f=this.parameterExpression(a,b,c,!0,!0,-1,!1,null,null,f&&1==a);e=f.size();0==e&&this.invArg();if(this.chk||0==f.get(0).tok)return null;b=JS.SV.selectItemVar(JS.SV.copySafely(f.get(e-
1)));if(1<e){c=2<e?f.get(1):null;g=f.get(0);f=!1;switch(g.tok){case 6:case 14:3<e&&this.invArg();g.mapPut(c.asString(),b);break;case 7:e>2+(null==c?0:1)&&this.invArg();null==c?c=g:g=JS.SV.selectItemVar(g);f=!0;break;case 4:if(2!=c.tok){g.value=JU.PT.rep(g.asString(),c.asString(),b.asString());g.intValue=2147483647;break}case 11:case 12:2147483647==g.intValue?f=!0:g.setSelectedValue(g.intValue,c.asInt(),b);break;case 8:a=g.value=JU.P3.newP(g.value);d=b.asFloat();switch(JS.T.getTokFromName(c.asString())){case 1111492629:a.x=
d;break;case 1111492630:a.y=d;break;case 1111492631:a.z=d}break;case 10:var d=JS.SV.getBitSet(g,!0),j=this.vwr.ms.ac,k=d.cardinality(),e=c.asString(),q=JS.T.getTokFromName(e);switch(q){case 0:if(e.startsWith("property_")){7==b.tok?(a=b.getList().size()==k?k:j,a=1<JS.SV.getArrayDepth(b)?JS.SV.fflistValue(b,a):JS.SV.flistValue(b,a)):a=b.asString();this.vwr.setData(e,Q(-1,[e,a,JU.BSUtil.copy(d),Integer.$valueOf(-1)]),j,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(d,q,b.asInt(),b.asFloat(),b)}}f&&g.setSelectedValue(c.intValue,2147483647,b);return null}if(!d&&(null==g&&(j||!("string"==typeof b.value||2==b.tok||x(b.value,Integer)||x(b.value,Float)||x(b.value,Boolean))))&&null!=c)(c.startsWith("_")||null==(g=this.vwr.g.getAndSetNewVariable(c,!0)))&&this.errorStr(22,c);if(null!=g)return g.setv(b);g=JS.SV.oValue(b);if(d)return 7==b.tok&&(g=b.asString()),this.vwr.setData(c,Q(-1,[c,""+g,JU.BSUtil.copy(this.vwr.bsA()),Integer.$valueOf(0)]),
this.vwr.ms.ac,0,0,-2147483648,0),null;x(g,Boolean)?this.setBooleanProperty(c,g.booleanValue()):x(g,Integer)?this.setIntProperty(c,g.intValue()):x(g,Float)?this.setFloatProperty(c,g.floatValue()):"string"==typeof g&&this.setStringProperty(c,g);return b},"~N,~N,~S,~B");e(d,"setBitsetProperty",function(a,b,c,f,d){if(!this.chk&&!a.isEmpty()){var e=null,j=null,g=null,k,q=null;k=0;var l=JS.T.tokAttr(b,1086324736);if(7==d.tok&&(q=d.getList(),0==(k=q.size())))return;switch(b){case 1145047049:case 1145047050:case 1145047053:case 1145047055:switch(d.tok){case 8:this.vwr.setAtomCoords(a,
b,d.value);break;case 7:this.theToken=d,this.vwr.setAtomCoords(a,b,this.getPointArray(-1,k,!0,!0))}return;case 1765808134:var m=null;b="color";switch(d.tok){case 7:d=O(k,0);for(m=k;0<=--m;)b=q.get(m),k=JS.SV.ptValue(b),null!=k?d[m]=JU.CU.colorPtToFFRGB(k):2==b.tok?d[m]=b.intValue:(d[m]=JU.CU.getArgbFromString(b.asString()),0==d[m]&&(d[m]=b.asInt())),0==d[m]&&this.errorStr2(50,"ARRAY",b.asString());m=d;b="colorValues";break;case 8:m=Integer.$valueOf(JU.CU.colorPtToFFRGB(d.value));break;case 4:m=d.value;
break;default:m=Integer.$valueOf(JS.SV.iValue(d))}this.setAtomProp(b,m,a);return;case 1825200146:case 1287653388:7!=d.tok&&(j=JS.SV.sValue(d));break;case 1086326789:case 1094715402:this.clearDefinedVariableAtomSets(),l=!1}switch(d.tok){case 7:l?e=JS.SV.strListValue(d):g=JS.SV.flistValue(d,k);break;case 4:null==j&&(e=JU.PT.getTokens(JS.SV.sValue(d)))}if(null!=e){k=e.length;if(!l){g=S(k,0);for(m=k;0<=--m;)g[m]=1086326789==b?JU.Elements.elementNumberFromSymbol(e[m],!1):JU.PT.parseFloat(e[m])}7!=d.tok&&
1==k&&(l?j=e[0]:f=g[0],c=C(f),g=e=null)}JS.T.tokAttr(b,2048)||this.error(56);this.vwr.setAtomProperty(a,b,c,f,j,g,e)}},"JU.BS,~N,~N,~N,JS.T");e(d,"setStatement",function(a,b){this.st=a;this.slen=this.st.length;if(0==this.slen)return!0;var c,f,d;for(f=b;f<this.slen;f++){if(null==this.st[f])return this.slen=f,!0;if(12290==this.st[f].tok)break}if(f==this.slen||this.chk)return f==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 e=!1,j=b;for(f=b;f<this.slen;f++)if(null!=this.st[f]){switch(d=this.getToken(f).tok){default:c[j]=this.st[f];break;case 1073742325:case 1073742326:e=1073742325==d;c[j]=this.st[f];break;case 12290:++f==this.slen&&this.invArg();var g,k=4==this.theToken.intValue,q=this.paramAsStr(f),l=1073742325==this.tokAt(f),m=1==b&&1==j&&this.st[0]===JS.T.tokenSetCmd;if(l){f=this.parameterExpressionToken(++f);if(this.chk)g=null;else if(7!=f.tok)g=JS.SV.oValue(f);else if(e)if(d=JS.SV.getBitSet(f,
!0),null==d){var n=JS.SV.sValue(f);g=0>n.indexOf("|")?this.getAtomBitSet(n):n}else g=d;else g=f;f=this.iToken}else this.chk?g=new JU.BS:(g=2==this.tokAt(f)?this.vwr.ms.getAtoms(1094715393,Integer.$valueOf(this.st[f].intValue)):12290==this.tokAt(f)&&2==this.tokAt(f+1)?this.vwr.ms.getAtomsFromAtomNumberInFrame(this.st[++f].intValue):this.getParameter(q,0,!0),!e&&!m&&(l=!0));d=this.tokAt(0);k=(new Boolean(k|(JS.T.tokAttr(d,20480)||134222850==d))).valueOf();if(null==g)c[j]=JS.T.tokenAll;else if(x(g,"JS.SV"))c[j]=
g;else if(x(g,Boolean))c[j]=g.booleanValue()?JS.T.tokenOn:JS.T.tokenOff;else if(x(g,Integer))c[j]=JS.T.tv(2,g.intValue(),g);else if(x(g,Float))c[j]=JS.T.tv(3,JU.Edge.getFloatEncodedInt(""+g),g);else if("string"==typeof g){if(!k&&!e){if((36867!=d||1<j&&537022465!=this.st[1].tok&&!"labelfor".equalsIgnoreCase(this.st[1].value.toString()))&&JS.T.tokAttr(d,36864))g=this.getParameter(g,1073742190,!0);"string"==typeof g&&(g=this.getStringObjectAsVariable(g))}x(g,"JS.SV")?c[j]=g:(d=g,e&&!k?c[j]=0<=d.indexOf("|")||
JS.T.tokAttr(c[j-1].tok,268435712)?JS.T.o(4,d):JS.T.o(10,this.getAtomBitSet(d)):(d=m?JS.T.getTokFromName(d):l||k||0==d.length||0<=d.indexOf(".")||0<=d.indexOf(" ")||0<=d.indexOf("=")||0<=d.indexOf(";")||0<=d.indexOf("[")||0<=d.indexOf("{")?4:1073741824,c[j]=JS.T.o(d,g)))}else if(x(g,"JU.BArray"))c[j]=JS.SV.newV(15,g);else if(x(g,"JU.BS"))c[j]=JS.SV.newV(10,g);else if(x(g,"JU.P3"))c[j]=JS.SV.newV(8,g);else if(x(g,"JU.P4"))c[j]=JS.SV.newV(9,g);else if(x(g,"JU.M34"))c[j]=JS.SV.newV(x(g,"JU.M4")?12:11,
g);else if(x(g,"java.util.Map")||x(g,"JS.ScriptContext")&&null!=(g=g.getFullMap()))c[j]=JS.SV.newV(6,e?g:JS.SV.deepCopy(g,!0,!0));else if(x(g,"JU.Lst")){if(!e){c[j]=JS.SV.newV(7,JS.SV.deepCopy(g,!1,!0));break}n=g;d=null;for(k=0;k<n.size();k++){l=n.get(k);if(10!=l.tok){d=null;break}null==d&&(d=new JU.BS);d.or(l.value)}c[j]=null==d?JS.SV.getVariable(g):JS.T.o(10,d)}else g=this.getObjectCenter(q,-2147483648,-2147483648),null==g&&this.invArg(),c[j]=JS.T.o(8,g);m&&!JS.T.tokAttr(c[j].tok,536870912)&&this.invArg()}j++}this.st=
c;for(f=j;f<this.st.length;f++)this.st[f]=null;this.slen=j;return!0},"~A,~N");e(d,"isFunction",function(a){return null!=this.getFunction(a)},"~S");e(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");e(d,"getFunction",function(a){var b=null==this.privateFuncs?null:this.privateFuncs.get(a);return null==b?this.vwr.getFunction(a):b},"~S")});I("JS");
N(null,"JS.ScriptFlowContext",["JS.ScriptCompiler"],function(){var d=P(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;L(this,arguments)},JS,"ScriptFlowContext",null);T(d,function(a,b,c,f,d,e){this.compiler=a;this.token=b;this.tok0=b.tok;this.ident=b.value;this.pt0=c;this.line0=e;this.parent=
f;this.ichCommand=d;this.lineStart=this.ptLine=this.compiler.lineCurrent;this.commandStart=this.ptCommand=this.compiler.iCommand},"JS.ScriptCompiler,JS.ContextToken,~N,JS.ScriptFlowContext,~N,~N");e(d,"getBreakableContext",function(a){for(var b=this;null!=b&&(!JS.ScriptCompiler.isBreakableContext(b.token.tok)||0<a--);)b=b.parent;return b},"~N");e(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");e(d,"setPt0",function(a,b){this.pt0=a;b&&(this.ptDefault=a);this.setLine();return a},"~N,~B");e(d,"setLine",function(){this.ptLine=this.compiler.lineCurrent;this.ptCommand=this.compiler.iCommand+1});q(d,"toString",function(){return"ident "+this.ident+" line "+this.lineStart+" command "+this.commandStart});e(d,"path",function(){for(var a="",b=this;null!=b;)a=b.ident+"-"+a,b=b.parent;return"["+
a+"]"});e(d,"setFunction",function(a){this.$function=a},"JS.ScriptFunction")});I("JS");N(["J.api.JmolScriptFunction","java.util.Hashtable","JU.Lst"],"JS.ScriptFunction",["JU.AU","$.SB","JS.SV","$.T"],function(){var d=P(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;L(this,arguments)},JS,"ScriptFunction",null,J.api.JmolScriptFunction);
X(d,function(){this.names=new JU.Lst;this.variables=new java.util.Hashtable});T(d,function(){});T(d,function(a,b){this.set(a,b);this.typeName=JS.T.nameOf(b)},"~S,~N");e(d,"isVariable",function(a){return this.variables.containsKey(a)},"~S");e(d,"set",function(a,b){this.name=a;this.tok=b},"~S,~N");e(d,"setVariables",function(a,b){for(var c=null==b?0:b.size(),f=this.names.size();0<=--f;){var d=this.names.get(f).toLowerCase(),e=f<this.nParameters&&f<c?b.get(f):null;null!=e&&7!=e.tok&&(e=JS.SV.newT(e));
a.put(d,null==e?JS.SV.newS("").setName(d):e)}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");e(d,"unsetVariables",function(a,b){var c=null==b?0:b.size(),f=this.names.size();if(!(0==c||0==f))for(var d=0;d<f&&d<c;d++){var e=b.get(d);if(7==e.tok){var j=a.get(this.names.get(d).toLowerCase());7==j.tok&&(e.value=j.value)}}},
"java.util.Map,JU.Lst");e(d,"addVariable",function(a,b){this.variables.put(a,a);this.names.addLast(a);b&&this.nParameters++},"~S,~B");d.setFunction=e(d,"setFunction",function(a,b,c,f,d,e,j){var g=a.cmdpt0,k=a.chpt0,q=f-g;a.setScript(b.substring(k,c));b=a.aatoken=Array(q);a.lineIndices=JU.AU.newInt2(q);a.lineNumbers=aa(q,0);c=d[g]-1;for(var l=0;l<q;l++)if(a.lineNumbers[l]=d[g+l]-c,a.lineIndices[l]=O(-1,[e[g+l][0]-k,e[g+l][1]-k]),b[l]=j.get(g+l),0<b[l].length){var m=b[l][0];JS.T.tokAttr(m.tok,102400)&&
(m.intValue-=0>m.intValue?-g:g)}for(l=f;--l>=g;)j.removeItemAt(l),e[l][0]=e[l][1]=0},"JS.ScriptFunction,~S,~N,~N,~A,~A,JU.Lst");e(d,"setScript",function(a){this.script=a;null!=this.script&&(""!==this.script&&!this.script.endsWith("\n"))&&(this.script+="\n")},"~S");q(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()});q(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()});q(d,"geTokens",function(){return this.aatoken});q(d,"getName",function(){return this.name});q(d,"getTok",function(){return this.tok})});I("JS");N(["JS.ScriptException"],"JS.ScriptInterruption",null,function(){var d=$(JS,"ScriptInterruption",
JS.ScriptException);T(d,function(a,b,c){W(this,JS.ScriptInterruption,[a,b,"!",-2147483648==c||a.vwr.autoExit]);if(b.startsWith("delay")){var f=b.indexOf(":");b=0<f?b.substring(f+1):null;a.delayScriptAndRun(c,b)}},"JS.ScriptEval,~S,~N")});I("JS");N(["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=P(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;L(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});T(d,function(){});q(d,"getScriptQueue",function(){return this.scriptQueue});q(d,"isScriptQueued",function(){return this.$isScriptQueued});q(d,"setViewer",function(a){this.vwr=a;this.eval=this.newScriptEvaluator();
this.eval.setCompiler();return this.eval},"JV.Viewer");e(d,"newScriptEvaluator",function(){return J.api.Interface.getInterface("JS.ScriptEval",this.vwr,"setOptions").setViewer(this.vwr)});q(d,"clear",function(a){a?(this.startCommandWatcher(!1),this.interruptQueueThreads()):this.evalTemp=null},"~B");e(d,"addScript",function(a,b,c){return this.addScr("String",a,b,"",c)},"~S,~A,~B");e(d,"addScr",function(a,b,c,f,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 e=0;e<b.length;e++)this.addScr(a,b[e],c,f,d);return"split into "+b.length+" sections for processing"}var e=null!=this.commandWatcherThread&&(0>b.indexOf("javascript")||0<=b.indexOf("#javascript ")),j=new JU.Lst;j.addLast(b);j.addLast(f);j.addLast(a);j.addLast(d?Boolean.TRUE:Boolean.FALSE);j.addLast(Integer.$valueOf(e?
-1:1));j.addLast(c);this.scriptQueue.addLast(j);this.startScriptQueue(!1);return"pending"},"~S,~S,~A,~S,~B");q(d,"clearQueue",function(){this.scriptQueue.clear()});q(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;}});q(d,"isQueueProcessing",
function(){return null!=this.queueThreads[0]||null!=this.queueThreads[1]});e(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");e(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");q(d,"getScriptItem",function(a,b){if(this.vwr.isSingleThreaded&&this.vwr.queueOnHold)return null;var c=this.scriptQueue.get(0),f=c.get(4).intValue();return(a?0>f:b?0==f:1==f)?c:null},"~B,~B");q(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");e(d,"interruptQueueThreads",function(){for(var a=0;a<this.queueThreads.length;a++)null!=this.queueThreads[a]&&this.queueThreads[a].interrupt()});e(d,"clearCommandWatcherThread",function(){null!=this.commandWatcherThread&&(this.commandWatcherThread.interrupt(),this.commandWatcherThread=
null)});q(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");e(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))}});q(d,"evalFile",function(a){return this.evalFileArgs(a,null)},
"~S");q(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");q(d,"evalStringWaitStatusQueued",function(a,b,c,f,d){return this.evalStringWaitParamsStatusQueued(a,b,null,c,f,d)},"~S,~S,~S,~B,~B");e(d,"evalStringWaitParamsStatusQueued",function(a,b,c,f,d,e){if(null==b)return null;var j=this.checkScriptExecution(b,!1);
if(null!=j)return j;if(this.vwr.checkConsoleScript(b))return null;var g=null==f||f.equals("output")?new JU.SB:null,j=this.vwr.sm.statusList;this.vwr.getStatusChanged(f);this.vwr.isSyntaxCheck&&JU.Logger.info("--checking script:\n"+this.eval.getScript()+"\n----\n");var k=0==b.indexOf(")");k&&(b=b.substring(1));k=k||!e;this.vwr.setErrorMessage(null,null);var q=e&&null==c?this.eval:this.newScriptEvaluator(),l=q.compileScriptString(b,d),m=q.getErrorMessage(),n=q.getErrorMessageUntranslated();this.vwr.setErrorMessage(m,
n);this.vwr.refresh(7,"script complete");l?(this.$isScriptQueued=e,d||this.vwr.setScriptStatus(null,b,-2-++this.scriptIndex,null),q.evaluateCompiledScript(c,this.vwr.isSyntaxCheck,this.vwr.isSyntaxAndFileCheck,k,this.vwr.listCommands,g,e)):(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!=g)return null==n?g.toString():n;a=this.vwr.getProperty(a,"jmolStatus",f);this.vwr.getStatusChanged(j);return a},"~S,~S,~A,~S,~B,~B");e(d,"checkScriptExecution",function(a,b){var c=a,f=c.indexOf("; ## GUI ##");0<=f&&(c=c.substring(0,f));if(0<=(f=c.indexOf("\u0001##")))c=c.substring(0,f);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");e(d,"checkResume",function(a){return a.equalsIgnoreCase("resume")?(this.vwr.scriptStatusMsg("","execution resumed"),this.eval.resumePausedExecution(),!0):!1},"~S");e(d,"checkStepping",function(a){return a.equalsIgnoreCase("step")?(this.eval.stepPausedExecution(),!0):a.equalsIgnoreCase("?")?(this.vwr.scriptStatus(this.eval.getNextStatement()),
!0):!1},"~S");q(d,"evalStringQuietSync",function(a,b,c){return this.evalStringParamsQuietSync(a,null,b,c)},"~S,~B,~B");e(d,"evalStringParamsQuietSync",function(a,b,c,f){f&&(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 "));(f=null==b&&0<a.length&&"!"==a.charAt(0))&&(a=a.substring(1));var d=this.checkScriptExecution(a,f);if(null!=d)return d;if(this.vwr.isScriptExecuting()&&(f||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");q(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,f=null;a.startsWith("exit")?(this.vwr.haltScriptExecution(),this.vwr.clearScriptQueue(),this.vwr.clearTimeouts(),c=a.equals(f="exit")):a.startsWith("quit")&&(this.vwr.haltScriptExecution(),c=a.equals(f="quit"));if(null==f)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?f+" -- stops script checking":(b?"!":"")+f+" received");this.vwr.isSyntaxCheck=
!1;return c},"~S,~B");q(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");q(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=e(d,"setStateScriptVersion",
function(a,b){if(null!=b){JS.ScriptManager.prevCovalentVersion=JU.Elements.bondingVersion;var c=JU.PT.getTokens(b.$replace("."," ").$replace("_"," "));try{var f=JU.PT.parseInt(c[0]),d=JU.PT.parseInt(c[1]),e=JU.PT.parseInt(c[2]);-2147483648==e&&(e=0);if(-2147483648!=f&&-2147483648!=d){var j=a.stateScriptVersionInt=1E4*f+100*d+e;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(g){if(!G(g,Exception))throw g;}}a.setIntProperty("bondingVersion",JS.ScriptManager.prevCovalentVersion);a.setBooleanProperty("legacyautobonding",!1);a.setBooleanProperty("legacyHAddition",!1);a.stateScriptVersionInt=2147483647},"JV.Viewer,~S");q(d,"addHydrogensInline",function(a,b,c,f){a=null==a?-1:a.nextSetBit(0);null==f&&(f=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);f.put("appendToModelIndex",Integer.$valueOf(a));var d=f.containsKey("fixedSite"),e=this.vwr.getModelUndeletedAtomsBitSet(a),j=this.vwr.g.appendNew;this.vwr.g.appendNew=!1;for(var g=0,k=e.nextSetBit(0);0<=k;k=e.nextSetBit(k+1)){var q=this.vwr.ms.at[k].getAtomNumber();q>g&&(g=q)}for(var q=new JU.SB,k=0,l=this.vwr.ms.ac;k<b.size();k++,l++){var m=b.get(k);null!=m&&q.append(";  connect 0 100 ").append("({"+l+"}) ").append("({"+m.i+"}) group;")}b=new JU.SB;b.appendI(c.length).append("\n").append("Viewer.AddHydrogens").append("#noautobond").append("\n");
l=f.get("element");l=(null==l?"H":l)+" ";for(k=0;k<c.length;k++)b.append(l).appendF(c[k].x).append(" ").appendF(c[k].y).append(" ").appendF(c[k].z).append(" - - - - ").appendI(++g).appendC("\n");c=this.vwr.getBoolean(603979900);this.vwr.setBooleanProperty("refreshing",!1);this.vwr.openStringInlineParamsAppend(b.toString(),f,!0);0<q.length()&&this.vwr.runScript(q.toString());this.vwr.setBooleanProperty("refreshing",c);f=this.vwr.getModelUndeletedAtomsBitSet(a);f.andNot(e);this.vwr.g.appendNew=j;d||
(e=this.vwr.ms.am[a].bsAsymmetricUnit,null!=e&&e.or(f));return f},"JU.BS,JU.Lst,~A,java.util.Map");q(d,"evalCallback",function(a,b,c){c?this.evalStringWaitParamsStatusQueued("String",a,b,"",!0,!0):this.evalStringParamsQuietSync(a,b,!0,!0)},"~S,~A,~B");e(d,"runScriptFromThread",function(a){var b=a.get(0),c=a.get(1),f=a.get(2),d=a.get(3).booleanValue();a=a.get(5);this.evalStringWaitParamsStatusQueued(f,b,a,c,d,!0)},"JU.Lst");d.prevCovalentVersion=0});I("JS");N(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=P(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;L(this,arguments)},JS,"ScriptMathProcessor",null);X(d,function(){this.oStack=Array(8);this.xStack=Array(8);this.ifStack=da(8,"\x00")});T(d,function(a,b,c,f,d,e,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=f||c;this.asBitSet=d;this.allowUnderflow=e;this.wasX=c;this.debugHigh&&JU.Logger.debug("initialize RPN")},"JS.ScriptExpr,~B,~B,~B,~B,~B,~S");
e(d,"endAssignment",function(){return this.doSelections=this.assignLeft=!1});e(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});e(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");e(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");
e(d,"putIf",function(a){++this.ifPt>=this.ifStack.length&&(this.ifStack=JU.AU.doubleLength(this.ifStack));this.ifStack[this.ifPt]=a},"~S");e(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");e(d,"addX",function(a){this.putX(a);return this.wasX=!0},"JS.SV");e(d,"addXObj",function(a){a=JS.SV.getVariable(a);if(null==a)return!1;this.putX(a);return this.wasX=!0},"~O");e(d,"addXStr",function(a){this.putX(JS.SV.newS(a));
return this.wasX=!0},"~S");e(d,"addXBool",function(a){this.putX(JS.SV.getBoolean(a));return this.wasX=!0},"~B");e(d,"addXInt",function(a){this.putX(JS.SV.newI(a));return this.wasX=!0},"~N");e(d,"addXList",function(a){this.putX(JS.SV.getVariableList(a));return this.wasX=!0},"JU.Lst");e(d,"addXMap",function(a){this.putX(JS.SV.getVariableMap(a));return this.wasX=!0},"java.util.Map");e(d,"addXM3",function(a){this.putX(JS.SV.newV(11,a));return this.wasX=!0},"JU.M3");e(d,"addXM4",function(a){this.putX(JS.SV.newV(12,
a));return this.wasX=!0},"JU.M4");e(d,"addXFloat",function(a){this.putX(JS.SV.newF(a));return this.wasX=!0},"~N");e(d,"addXBs",function(a){this.putX(JS.SV.newV(10,a));return this.wasX=!0},"JU.BS");e(d,"addXPt",function(a){this.putX(JS.SV.newV(8,a));return this.wasX=!0},"JU.P3");e(d,"addXPt4",function(a){this.putX(JS.SV.newV(9,a));return this.wasX=!0},"JU.P4");e(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");e(d,"addXAV",function(a){this.putX(JS.SV.getVariableAV(a));return this.wasX=!0},"~A");e(d,"addXAD",function(a){this.putX(JS.SV.getVariableAD(a));return this.wasX=!0},"~A");e(d,"addXAS",function(a){this.putX(JS.SV.getVariableAS(a));return this.wasX=!0},"~A");e(d,"addXAI",function(a){this.putX(JS.SV.getVariableAI(a));
return this.wasX=!0},"~A");e(d,"addXAII",function(a){this.putX(JS.SV.getVariableAII(a));return this.wasX=!0},"~A");e(d,"addXAF",function(a){this.putX(JS.SV.getVariableAF(a));return this.wasX=!0},"~A");e(d,"addXAFF",function(a){this.putX(JS.SV.getVariableAFF(a));return this.wasX=!0},"~A");d.isOpFunc=e(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");e(d,"addOp",function(a){return this.addOpAllowMath(a,
!0,0)},"JS.T");e(d,"addOpAllowMath",function(a,b,c){this.debugHigh&&this.dumpStacks("adding "+a+" wasx="+this.wasX);var f=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,f);var d=268442113==a.tok;if(d&&!this.wasX)return!1;var e=b&&JS.ScriptMathProcessor.isOpFunc(a);1<=this.oPt&&(268435968!=a.tok&&134217750==f)&&(f=this.oStack[--this.oPt].tok);var j=null,g=!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==f&&!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:f=0>this.oPt?0:f;if(!this.wasX||!(268442113==f||1677721602==
f||1153433601==f))return!1;this.oStack[this.oPt].intValue|=a.tok;return!0;case 268437504:g=!0;if(!this.wasX||this.haveSpaceBeforeSquare)this.squareCount++,a=j=JS.T.tokenArraySquare,this.haveSpaceBeforeSquare=!1;break;case 268439040:case 268435968:g=!0;default:if(e){e=1<=this.oPt&&268435968==f;if(d){if(268435968==c&&6==this.xStack[this.xPt].tok)return!1}else if(this.wasX&&!e)return!1;j=a;g=!0;break}if(this.wasX==g&&268442113!=f){if(!this.wasX||!b)return!1;if(this.addOp(JS.T.tokenComma))return this.addOp(a)}}for(;0<=
this.oPt&&268436482!=f&&(268441601!=a.tok&&268441602!=a.tok||this.wasX)&&(!g||268442113==f&&(268442113==a.tok||268437504==a.tok))&&this.checkPrecedence(f,a.tok)&&(268441600!=f||268441600!=a.tok);){if(268435969==a.tok&&268435968==f){0<=this.xPt&&(this.xStack[this.xPt]=JS.SV.selectItemVar(this.xStack[this.xPt]));this.wasX=!0;break}if(268437505==a.tok&&1275068418==f)break;if(268437505==a.tok&&268437504==f){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;f=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==f?this.ifPt--:this.putOp(JS.T.tokenColon),this.putIf(a?"T":"F"),this.skipping=!a,this.wasX=!1,!0;case 268436482:if(268436482!=f||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==f&&(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:f=this.getX().asBoolean(),this.addX(JS.SV.getBoolean(f)),f==(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");e(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");e(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");e(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});e(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");e(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});e(d,"getXTok",
function(){return 0>this.xPt?0:this.xStack[this.xPt].tok});e(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),f=0,d=this.xPt;0<=d&&this.xStack[d--].value!==b;)f++;if(0<c&&f>c)return!1;for(c=Array(f);0<=--f;)c[f]=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");e(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)});e(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");e(d,"binaryOp",function(a,b,c){var f,d;switch(a.tok){case 268439552:case 268438528:switch(b.tok){case 10:var e=
b.value;switch(c.tok){case 2:return a=c.asInt(),this.addXBool(0>a?!1:e.get(a));case 10:return e=JU.BSUtil.copy(e),e.and(c.value),this.addXBs(x(b.value,"JM.BondSet")?JM.BondSet.newBS(e):e)}}return this.addXBool(b.asBoolean()&&c.asBoolean());case 268438016:switch(b.tok){case 10:e=null;switch(c.tok){case 10:e=JU.BSUtil.copy(b.value);e.or(c.value);break;case 2:e=JU.BSUtil.copy(b.value);a=c.asInt();0<=a&&e.set(a);break;case 7:e=JU.BSUtil.copy(b.value);d=c.value;for(a=d.size();0<=--a;)f=d.get(a).asInt(),
0<=f&&e.set(f)}if(null==e)break;return this.addXBs(x(b.value,"JM.BondSet")?JM.BondSet.newBS(e):e);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 e=JU.BSUtil.copy(b.value),e.xor(c.value),this.addXBs(x(b.value,"JM.BondSet")?JM.BondSet.newBS(e):e);b=b.asBoolean();f=c.asBoolean();return this.addXBool(b&&!f||f&&!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 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 f=c.value,a.add(JU.P3.new3(f.x,f.y,f.z)),this.addXPt(a);default:return f=c.asFloat(),this.addXPt(JU.P3.new3(a.x+f,a.y+f,a.z+f))}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 f=c.value,a.sub(JU.P3.new3(f.x,f.y,f.z)),this.addXPt(a)}f=c.asFloat();return this.addXPt(JU.P3.new3(a.x-f,a.y-f,a.z-f));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;f=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(),f=JU.P3.newP(a),c.rotate(f),7==b.tok?this.addX(JS.SV.getVariableAF(S(-1,[f.x,f.y,f.z]))):this.addXPt(f);if(null!=f)return this.addXPt4(JU.Quat.newP4(f).mulQ(JU.Quat.newM(c.value)).toPoint4f());break;case 12:if(null!=f)return a=JU.M4.newM4(c.value),a.transpose(),c=JU.P4.newPt(f),
a.transform(c),7==b.tok?this.addX(JS.SV.getVariableAF(S(-1,[c.x,c.y,c.z,c.w]))):this.addXPt4(c)}switch(b.tok){case 11:e=b.value;if(null!=a)return f=JU.P3.newP(a),e.rotate(f),7==c.tok?this.addX(JS.SV.getVariableAF(S(-1,[f.x,f.y,f.z]))):this.addXPt(f);switch(c.tok){case 11:return b=JU.M3.newM3(c.value),b.mul2(e,b),this.addXM3(b);case 9:return this.addXM3(JU.Quat.newM(e).mulQ(JU.Quat.newP4(c.value)).getMatrix());case 7:c=c.getList();d=new JU.Lst;for(a=c.size();0<=--a;){f=JS.SV.ptValue(c.get(a));if(null==
f)return!1;f=JU.P3.newP(f);e.rotate(f);d.addLast(f)}return this.addXList(d)}f=c.asFloat();c=new JU.A4;c.setM(e);c.angle*=f;return this.addXM3((new JU.M3).setAA(c));case 12:b=b.value;if(null!=a)return f=JU.P3.newP(a),b.rotTrans(f),7==c.tok?this.addX(JS.SV.getVariableAF(S(-1,[f.x,f.y,f.z]))):this.addXPt(f);if(null!=f)return b.transform(f),7==c.tok?this.addX(JS.SV.getVariableAF(S(-1,[f.x,f.y,f.z,f.w]))):this.addXPt4(f);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;)f=JU.P3.newP(JS.SV.ptValue(c.get(a))),b.rotTrans(f),d.addLast(f);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)}f=c.asFloat();return this.addXPt(JU.P3.new3(a.x*f,a.y*f,a.z*f));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(U(b.intValue/c.intValue));e=this.isDecimal(c)?0:c.asInt();if(0!=e)return this.addXInt(U(b.intValue/e));break;case 4:if(!this.isDecimal(b)&&!this.isDecimal(c)&&0!=(f=c.asInt()))return this.addXInt(U(b.asInt()/f));break;case 8:return a=JU.P3.newP(b.value),this.addXPt(0==(e=c.asFloat())?JU.P3.new3(NaN,NaN,NaN):JU.P3.new3(a.x/e,a.y/e,a.z/e));case 9:return this.addXPt4(9==c.tok?JU.Quat.newP4(b.value).div(JU.Quat.newP4(c.value)).toPoint4f():
0==(e=c.asFloat())?JU.P4.new4(NaN,NaN,NaN,NaN):JU.Quat.newP4(b.value).mul(1/e).toPoint4f())}return this.addXFloat(b.asFloat()/c.asFloat());case 268441091:return f=c.asFloat(),9==b.tok?0==f?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/f).toPoint4f()):this.addXInt(0==f?0:U(Math.floor(b.asFloat()/c.asFloat())));case 268441603:return f=Math.pow(b.asFloat(),c.asFloat()),2==b.tok&&
2==c.tok?this.addXInt(C(f)):this.addXFloat(f);case 268441090:d=null;e=c.asInt();switch(b.tok){case 3:f=b.asFloat();if(0==e)return this.addXInt(Math.round(f));d=JU.DF.formatDecimal(f,e);return this.addXStr(d);case 4:return d=b.value,this.addXStr(0==e?JU.PT.trim(d,"\n\t "):9999==e?d.toUpperCase():-9999==e?d.toLowerCase():0<e?JU.PT.formatS(d,e,e,!1,!1):JU.PT.formatS(d,e,e-1,!0,!1));case 7:c=JS.SV.strListValue(b);for(a=0;a<c.length;a++)c[a]=0==e?c[a].trim():0<e?JU.PT.formatS(c[a],e,e,!0,!1):JU.PT.formatS(d,
-e,e,!1,!1);return this.addXAS(c);case 8:return a=JU.P3.newP(b.value),this.vwr.toUnitCell(a,JU.P3.new3(e,e,e)),this.addXPt(a);case 9:f=b.value;if(8==c.tok)return this.addXPt(JU.Quat.newP4(f).transform2(c.value,new JU.P3));if(9==c.tok)return c=JU.P4.newPt(c.value),JU.Quat.newP4(f).getThetaDirected(c),this.addXPt4(c);0==e&&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),
e=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(e){case 0:return this.addXFloat(f.w);case 1:return this.addXFloat(f.x);case 2:return this.addXFloat(f.y);case 3:return this.addXFloat(f.z)}c=JU.Quat.newP4(f);switch(e){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,e){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,e){case 1:return e=new JU.M3,b.getRotationScale(e),this.addXM3(e);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,e))}return this.addXInt(0==e?b.asInt():b.asInt()%e)}return!0},"JS.T,JS.SV,JS.SV");e(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");e(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=e(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");e(d,"getAllProperties",function(a,b){var c=a.value,f,d=c.cardinality();if(0==d||!b.endsWith("?")||null==(f=JS.T.getAtomPropertiesLike(b.substring(0,b.length-1))))return this.addXStr("");for(var e=new java.util.Hashtable,d=1==d?c.nextSetBit(0):2147483647,
j=f.size();0<=--j;){var g=f.get(j),k=g.tok;switch(k){case 1094717448:case 1094713349:continue;default:2147483647==d&&(k|=480),e.put(g.value,JS.SV.getVariable(this.eval.getBitsetProperty(c,null,k,null,null,null,null,!1,d,!0)))}}return this.addXMap(e)},"JS.SV,~S");d.getMatrix4f=e(d,"getMatrix4f",function(a,b){return JU.M4.newMV(a,null==b?new JU.V3:JU.V3.newV(b))},"JU.M3,JU.T3");e(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");e(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()),
f=0;f<c.length;f++){var d=JS.SV.unescapePointOrBitsetAsVariable(b.getList().get(f));if(!x(d,"JS.SV")||!this.getPointOrBitsetOperation(a,d))return!1;c[f]=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)}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);f=b.value;c&&(1==f.cardinality()&&0==(a.intValue&480))&&(a.intValue|=32);f=this.eval.getBitsetProperty(f,
null,a.intValue,null,null,null,a.value,!1,b.index,!0);return c?this.addXObj(f):this.addXBs(JM.BondSet.newBS(f))}return!1},"JS.T,JS.SV")});I("JS");N(["JS.ScriptError"],"JS.ScriptParam","java.util.Hashtable JU.BS $.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=P(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;L(this,arguments)},JS,"ScriptParam",JS.ScriptError);e(d,"getToken",function(a){this.checkToken(a)||this.error(13);this.theToken=this.st[a];this.theTok=this.theToken.tok;return this.theToken},"~N");e(d,"tokAt",function(a){return a<this.slen&&null!=this.st[a]?this.st[a].tok:0},"~N");e(d,"checkToken",function(a){return(this.iToken=a)<this.slen},"~N");e(d,"getParameter",function(a,b,c){var f=this.getContextVariableAsVariable(a,
!1);if(null==f)if(c)f=this.vwr.getP(a);else if(null==(f=this.vwr.getPOrNull(a)))return null;switch(b){case 1073742190:return JS.SV.getVariable(f);case 4:if(!x(f,"JU.Lst"))break;a=f;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(f)},"~S,~N,~B");e(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");
e(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 f=this.thisContext,d=new java.util.Hashtable,e=null,j;null!=f&&(!f.isFunction||!(null==e?e=d:(j=new java.util.Hashtable,e.put("_caller",JS.SV.newV(6,j)),e=j),e.putAll(f.vars),e.put("_name",JS.SV.newS(f.functionName)),!c));)f=f.parentContext;return JS.SV.newV(6,d)}if(a.equalsIgnoreCase("_name")){for(f=
this.thisContext;null!=f;){if(f.isFunction)return JS.SV.newS(JS.SV.sValue(f.statement[0]));f=f.parentContext}return JS.SV.newS("")}}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");e(d,"paramAsStr",function(a){this.getToken(a);null==this.theToken&&this.error(13);return JS.SV.sValue(this.theToken)},"~N");e(d,"stringParameter",function(a){(!this.checkToken(a)||
4!=this.getToken(a).tok)&&this.error(41);return this.theToken.value},"~N");e(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"):Q(-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 f=0;f<a;f++)c[f]=b.get(f);return c},"~N");e(d,"objectNameParameter",function(a){this.checkToken(a)||this.error(37);return this.paramAsStr(a)},"~N");e(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");e(d,"isCenterParameter",function(a){a=this.tokAt(a);return 1073742330==a||1073742332==a||1073742325==a||8==a||10==a},"~N");e(d,"centerParameter",function(a,b){return this.centerParameterForModel(a,-2147483648,b)},"~N,~A");e(d,"centerParameterForModel",function(a,b,c){var f=null;if(this.checkToken(a))switch(this.getToken(a).tok){case 1814695966:return this.vwr.getUnitCellCenter();
case 1073742330:c=this.objectNameParameter(++a);f=-2147483648;268437504==this.tokAt(a+1)&&(f=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)))f=2147483647,this.iToken=a+2;null==(f=this.getObjectCenter(c,f,b))&&this.errorStr(12,c);break;case 10:case 1073742325:case 1073742332:case 8:null==c&&(c=Array(1)),f=this.atomCenterOrCoordinateParameter(a,
c)}null==f&&this.error(11);return f},"~N,~N,~A");e(d,"planeParameter",function(a,b){var c=new JU.V3,f=new JU.V3,d=null,e=null,j=null,g=null,k=!1;134217750==this.tokAt(a)&&a++;var q=null,l=268440576==this.tokAt(a);l&&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()),f=0,w=n.nextSetBit(0);0<=w;w=n.nextSetBit(w+1))q[f++]=this.vwr.ms.at[w];else if(e=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,e);c.scale(2*x);JU.Measure.getBisectingPlane(e,c,f,
c,d)}else g=this.atomCenterOrCoordinateParameter(this.iToken,null),k=!0;break;default:if(this.isArrayParameter(a))if(b)q=this.getPointArray(a,-1,!1,!0);else if(7==this.tokAt(a)){var r=this.getPointOrCenterVector(this.getToken(a));3!=r.size()&&this.invArg();e=r.get(0);j=r.get(1);g=r.get(2);k=!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(k){var d=new JU.P4,v=new JU.P3,C=JU.Measure.getNormalThroughPoints(e,j,g,v,c);d.set4(v.x,v.y,v.z,C)}!this.chk&&JU.Logger.debugging&&JU.Logger.debug(" defined plane: "+d)}}catch(t){if(G(t,Exception))d=null;else throw t;}null==d&&this.errorMore(38,"{a b c d}",'"xy" "xz" "yz" "x=..." "y=..." "z=..." "ab" "bc" "ac" "ab1" "bc1" "ac1"',"$xxxxx");l&&d.scale4(-1);return d},"~N,~B");e(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");e(d,"getPointOrCenterVector",function(a){var b=new JU.Lst,c,f;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!=(f=JS.SV.getBitSet(a.get(d),!0))?b.addLast(1==f.cardinality()?JU.P3.newP(this.vwr.ms.at[f.nextSetBit(0)]):this.vwr.ms.getAtomSetCenter(f)):this.invArg();return b},"JS.T");e(d,"hklParameter",function(a,b,c){!this.chk&&null==this.vwr.getCurrentUnitCell()&&this.error(33);a=this.getPointOrPlane(a,
71);var f=NaN;c&&(f=x(a,"JU.P4")?a.w:NaN,1073742066==this.tokAt(this.iToken+1)&&(this.iToken++,f=this.floatParameter(++this.iToken)));b=this.getHklPlane(a,f,b);null==b&&this.error(3);!this.chk&&JU.Logger.debugging&&JU.Logger.debug("defined plane: "+b);return b},"~N,JU.Lst,~B");e(d,"getHklPlane",function(a,b,c){var f=JU.P3.new3(0==a.x?1:1/a.x,0,0),d=JU.P3.new3(0,0==a.y?1:1/a.y,0),e=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?(f.set(1,0,e.z),d.set(0,1,e.z)):0==
a.y&&0==a.z?(d.set(f.x,0,1),e.set(f.x,1,0)):0==a.z&&0==a.x?(e.set(0,d.y,1),f.set(1,d.y,0)):0==a.x?f.set(1,d.y,0):0==a.y?d.set(0,1,e.z):0==a.z&&e.set(f.x,0,1);this.vwr.toCartesian(f,!1);this.vwr.toCartesian(d,!1);this.vwr.toCartesian(e,!1);a=new JU.V3;var j=JU.Measure.getPlaneThroughPoints(f,d,e,new JU.V3,a,new JU.P4);Float.isNaN(b)||(j.w=-b,null!=c&&(JU.Measure.getPlaneProjection(f,j,f,a),JU.Measure.getPlaneProjection(d,j,d,a),JU.Measure.getPlaneProjection(e,j,e,a)));null!=c&&(c.addLast(f),c.addLast(d),
c.addLast(e));return j},"JU.T3,~N,JU.Lst");e(d,"getPointOrPlane",function(a,b){var c=S(6,0),f=O(6,0),d=!1,e=0,j=4==(b&7)?4:3,g=3==(b&7)?3:4,k=0!=(b&64),q=0!=(b&8),l=!0,m=this.iToken;try{this.coordinatesAreFractional=k;if(8==this.tokAt(a)){if(3>=j&&3<=g)return this.getToken(a).value;l=!1;return null}if(9==this.tokAt(a)){if(4>=j&&4<=g)return this.getToken(a).value;l=!1;return null}var n=1,w=a;a:for(;w<this.slen;w++)switch(this.getToken(w).tok){case 1073742332:case 268436992:case 268438528:case 268439552:break;
case 1073742338:break a;case 268440576:n=-1;break;case 1073742363:if(6==e)return l=!1,null;c[e++]=this.theToken.intValue;n=-1;break;case 2:case 1073742362:(6==e||2147483647==this.theToken.intValue)&&this.invArg();k&&999999999<this.theToken.intValue&&(d=!0);f[e]=this.theToken.intValue;c[e++]=this.theToken.intValue*n;n=1;break;case 268441088:case 1073742358:if(!k&&0==(b&16))return l=!1,null;268441088==this.theTok&&this.getToken(++w);e--;if(0>e||q)return l=!1,null;x(this.theToken.value,Integer)||2==
this.theTok?c[e++]/=2147483647==this.theToken.intValue?this.theToken.value.intValue():this.theToken.intValue:x(this.theToken.value,Float)&&(c[e++]/=this.theToken.value.floatValue());this.coordinatesAreFractional=!0;break;case 1073742357:case 1073741824:c[e++]=NaN;break;case 3:case 1073742359:if(q||6==e)return l=!1,null;c[e++]=this.theToken.value.floatValue();break;default:this.iToken--;break a}if(e<j||e>g)return l=!1,null;if(3==e){if(d)return JU.P4.new4(c[0],c[1],c[2],1E3*(f[0]%1E3)+f[1]%1E3+1E6);
var z=JU.P3.new3(c[0],c[1],c[2]);this.coordinatesAreFractional&&0!=(b&32)&&(this.fractionalPoint=JU.P3.newP(z),this.chk||this.vwr.toCartesian(z,!1));return z}if(4==e&&(k||!this.coordinatesAreFractional))return JU.P4.new4(c[0],c[1],c[2],c[3]);l=!1;return null}finally{l||(this.iToken=m,0==(b&128)&&this.invArg())}},"~N,~N");e(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(f){if(G(f,Exception))c=!1;else throw f;}this.ignoreError=!1;this.iToken=b;return c},"~N");e(d,"getPoint3f",function(a,b,c){return this.getPointOrPlane(a,35|(b?16:0)|(c?0:128))},"~N,~B,~B");e(d,"getFractionalPoint",function(a){return this.getPointOrPlane(a,71)},"~N");e(d,"getPoint4f",function(a){return this.getPointOrPlane(a,4)},"~N");e(d,"getPoint4fNoError",function(a){return this.getPointOrPlane(a,
132)},"~N");e(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");e(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");e(d,"optParameterAsString",function(a){return a>=this.slen?"":this.paramAsStr(a)},
"~N");e(d,"intParameter",function(a){if(this.checkToken(a)&&2==this.getToken(a).tok)return this.theToken.intValue;this.error(20);return 0},"~N");e(d,"isFloatParameter",function(a){switch(this.tokAt(a)){case 2:case 3:return!0}return!1},"~N");e(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");e(d,"getPointArray",function(a,b,c,f){2147483647==b&&(b=-1);var d=0>b?null:Array(b),e=0>b?new JU.Lst:null,j=0>a?7:this.getToken(a++).tok;switch(j){case 7:e=this.theToken.getList();0<=b&&e.size()!=b&&this.invArg();b=e.size();null==d&&(d=Array(b));for(j=0;j<b;j++)null==(d[j]=JS.SV.ptValue(e.get(j)))&&!c&&this.invArg();return d;case 1073742195:j=this.tokAt(a++);break;case 268437504:break;default:if(this.iToken--,!f)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?e.addLast(a):d[c]=a;c++;a=this.iToken+1}268437505!=j&&this.invArg();null==d&&(d=e.toArray(Array(e.size())));0<b&&null==d[b-1]&&this.invArg();return d},"~N,~N,~B,~B");e(d,"listParameter",function(a,b,c){return this.listParameter4(a,b,c,!1)},"~N,~N,~N");e(d,"listParameter4",function(a,b,c,f){var d=new JU.Lst,e=this.tokAt(a);1073742195==e&&(e=this.tokAt(++a));
var j=1073742332==e,g=268437504==e;(j||g)&&a++;for(var k=0;k<c;){e=this.tokAt(a);if(j&&1073742338==e||g&&268437505==e)break;switch(e){case 268436992:case 268440576:case 1073742332:case 1073742338:break;case 4:f&&d.addLast(this.stringParameter(a));break;case 9:e=this.getPoint4f(a);d.addLast(Float.$valueOf(e.x));d.addLast(Float.$valueOf(e.y));d.addLast(Float.$valueOf(e.z));d.addLast(Float.$valueOf(e.w));k+=4;break;default:if(this.isCenterParameter(a)){e=this.centerParameter(a,null);a=this.iToken;d.addLast(Float.$valueOf(e.x));
d.addLast(Float.$valueOf(e.y));d.addLast(Float.$valueOf(e.z));k+=3;break}d.addLast(Float.$valueOf(this.floatParameter(a)));k++}a+=k==c&&g&&1073742338==this.tokAt(a+1)?2:1}(j&&1073742338!=this.tokAt(a++)||g&&268437505!=this.tokAt(a++)||k<b||k>c)&&this.invArg();this.iToken=a-1;return d},"~N,~N,~N,~B");e(d,"floatParameterSet",function(a,b,c){var f=null,d=null,e=0,e=null;this.iToken=a;switch(this.tokAt(a)){case 4:e=JS.SV.sValue(this.st[a]);e=JU.PT.replaceWithCharacter(e,"{},[]\"'"," ");d=JU.PT.parseFloatArray(e);
e=d.length;break;case 7:d=JS.SV.flistValue(this.st[a],0);e=d.length;break;default:f=this.listParameter(a,b,c),e=f.size()}(e<b||e>c)&&this.invArg();if(null==d){d=S(e,0);for(a=0;a<e;a++)d[a]=f.get(a).floatValue()}return d},"~N,~N,~N");e(d,"isArrayParameter",function(a){switch(this.tokAt(a)){case 7:case 11:case 12:case 1073742195:case 268437504:return!0}return!1},"~N");e(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");e(d,"checkLast",function(a){return this.checkLength(a+1)-1},"~N");e(d,"checkLength",function(a){if(0<=a)return this.checkLengthErrorPt(a,0);this.slen>-a&&(this.iToken=-a,this.bad());return this.slen},"~N");e(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");e(d,"checkLength23",function(){this.iToken=this.slen;2!=this.slen&&3!=this.slen&&this.bad();return this.slen});e(d,"checkLength34",function(){this.iToken=this.slen;3!=this.slen&&4!=this.slen&&this.bad();return this.slen});e(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");e(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:U(Math.floor(2E3*a));0>a&&(this.restrictSelected(!1,!1),a=-a);break;default:this.error(6)}return a});e(d,"intParameterRange",function(a,b,c){a=this.intParameter(a);return a<b||a>c?(this.integerOutOfRange(b,
c),2147483647):a},"~N,~N,~N");e(d,"floatParameterRange",function(a,b,c){a=this.floatParameter(a);return a<b||a>c?(this.numberOutOfRange(b,c),NaN):a},"~N,~N,~N");e(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,f,d=a.getList(),e=0;e<d.size();e++){f=d.get(e);if(null==(f=10==f.tok?this.vwr.ms.getAtomSetCenter(JS.SV.getBitSet(f,!1)):JS.SV.ptValue(f)))return null;c.addLast(f)}return c}return 0<b?this.vwr.ms.getAtomPointVector(this.atomExpressionAt(b)):
null},"JS.T,~N");e(d,"isColorParam",function(a){var b=this.tokAt(a);return 0!=b&&(570425378==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");e(d,"getArgbParam",function(a){return this.getArgbParamOrNone(a,!1)},"~N");e(d,"getArgbParamLast",function(a,b){var c=this.getArgbParamOrNone(a,b);this.checkLast(this.iToken);return c},"~N,~B");e(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 4:return JU.CU.getArgbFromString(this.paramAsStr(a));case 1073742195:return this.getColorTriad(a+2);case 268437504:return this.getColorTriad(++a);case 7:var f=JS.SV.flistValue(this.theToken,3);null!=f&&3!=f.length&&(c=JU.P3.new3(f[0],f[1],f[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");e(d,"getColorTriad",function(a){var b=
S(3,0),c=0,f="";this.getToken(a);var d=null,e=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);f="0"+this.paramAsStr(a);break a;case 3:2<c&&this.error(4);e=this.floatParameter(a);break;case 2:2<c&&this.error(4);e=this.theToken.intValue;break;case 1073742362:2<c&&this.error(4);e=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++]=e}this.error(4);break;case 8:d=this.theToken.value;break;case 1073741824:f=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("["+f+"]"))&&this.error(4);return c},"~N");e(d,"tickParamAsStr",function(a,b,c,f){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));f&&1073741942==this.tokAt(this.iToken+1)&&(b.first=this.floatParameter(this.iToken+2));return b},"~N,~B,~B,~B");e(d,"setBooleanProperty",function(a,b){this.chk||this.vwr.setBooleanProperty(a,b)},"~S,~B");e(d,"setIntProperty",function(a,b){this.chk||this.vwr.setIntProperty(a,b);return!0},"~S,~N");e(d,"setFloatProperty",
function(a,b){this.chk||this.vwr.setFloatProperty(a,b);return!0},"~S,~N");e(d,"setStringProperty",function(a,b){this.chk||this.vwr.setStringProperty(a,b)},"~S,~S");e(d,"checkHKL",function(a){(1>Math.abs(a.x)||1>Math.abs(a.y)||1>Math.abs(a.z)||a.x!=C(a.x)||a.y!=C(a.y)||a.z!=C(a.z))&&this.invArg();return a},"JU.T3");e(d,"planeValue",function(a){var b=null,c=NaN,f=null;switch(a.tok){case 9:return a.value;case 7:break;case 4:case 1073741824:var d=a.value,e=d.startsWith("-"),j=e?-1:1;e&&(d=d.substring(1));
var g=null,k=d.length,q=2>k?-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 l=0>d.indexOf("=");2<k&&(l?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:g=JU.P4.new4(1,0,0,-j*JU.PT.parseFloat(d.substring(2)));break;case 12:g=JU.P4.new4(0,1,0,-j*JU.PT.parseFloat(d.substring(2)));
break;case 15:g=JU.P4.new4(0,0,1,-j*JU.PT.parseFloat(d.substring(2)));break;case 18:Float.isNaN(c)&&(c=0);case 33:g=this.getHklPlane(f=JU.P3.new3(0,0,1),0,null);g.scale4(-j);break;case 21:Float.isNaN(c)&&(c=0);case 27:g=this.getHklPlane(f=JU.P3.new3(1,0,0),0,null);g.scale4(- -j);break;case 24:Float.isNaN(c)&&(c=0);case 30:g=this.getHklPlane(f=JU.P3.new3(0,1,0),0,null),g.scale4(-j)}if(null==g||Float.isNaN(g.w))break;if(null!=b&&!Float.isNaN(c)){b.toCartesian(f,!0);if(l||!e)c=-c;g.w=f.dot(g)*c;(!l||
0!=c)&&g.scale(-1)}return g;default:return null}a=JU.Escape.uP(JS.SV.sValue(a));return x(a,"JU.P4")?a:null},"JS.T");d.transformPoints=e(d,"transformPoints",function(a,b,c){for(var f=new JU.Lst,d=0;d<a.size();d++){var e=JU.P3.newP(a.get(d));e.sub(c);b.rotTrans(e);e.add(c);f.addLast(e)}return f},"JU.Lst,JU.M4,JU.P3");d.getTransformMatrix4=e(d,"getTransformMatrix4",function(a,b,c,f){a=JU.Measure.getCenterAndPoints(a);var d=JU.Measure.getCenterAndPoints(b);b=S(2,0);var e=JU.Measure.calculateQuaternionRotation(Q(-1,
[a,d]),b).getMatrix();null==f?e.rotate(a[0]):f.setT(a[0]);f=JU.V3.newVsub(d[0],a[0]);c.setMV(e,f);return b[1]},"JU.Lst,JU.Lst,JU.M4,JU.P3");e(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");e(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");e(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 f=new JU.M3;f.setRowV(0,a[0]);f.setRowV(1,a[1]);f.setRowV(2,a[2]);switch(b){case 3:return f;case 4:return b=new JU.M4,b.setRotationScale(f),b.setTranslation(a[3]),b}}c&&this.invArg();return null},"~N,~N,~B")});I("JS");Z=P(function(){this.context=this.processName=null;L(this,arguments)},JS,"ScriptProcess",null);T(Z,function(d,
a){this.processName=d;this.context=a},"~S,JS.ScriptContext");I("JS");N(null,"JS.ScriptProcessRunnable",["JU.Logger"],function(){var d=P(function(){this.shapeManager=this.processLock=this.process=this.parallelProcessor=null;L(this,arguments)},JS,"ScriptProcessRunnable",null,Runnable);T(d,function(a,b,c,f){this.parallelProcessor=a;this.process=b;this.processLock=c;this.shapeManager=f},"JS.ScriptParallelProcessor,JS.ScriptProcess,~O,JV.ShapeManager");q(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()}})});
I("JS");N(["J.thread.JmolThread"],"JS.ScriptQueueThread",["JU.Logger"],function(){var d=P(function(){this.scriptManager=null;this.startedByCommandThread=!1;this.pt=0;L(this,arguments)},JS,"ScriptQueueThread",J.thread.JmolThread);T(d,function(a,b,c,f){this.setViewer(b,"QueueThread"+f);this.scriptManager=a;this.vwr=b;this.startedByCommandThread=c;this.pt=f},"JS.ScriptManager,JV.Viewer,~B,~N");q(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");e(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})});I("JS");N(null,"JS.ScriptTokenParser","JU.Lst $.P3 $.PT J.i18n.GT JS.T JU.Edge $.Logger $.SimpleUnitCell".split(" "),function(){var d=P(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;L(this,arguments)},JS,"ScriptTokenParser",null);e(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)});e(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});e(d,"isUserFunction",function(a){a=a.toLowerCase();return!this.isStateScript&&(this.vwr.isFunction(a)||this.htUserFunctions.containsKey(a))},"~S");e(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=e(d,"tokenAttr",function(a,b){return null!=a&&JS.T.tokAttr(a.tok,b)},"JS.T,~N");e(d,"moreTokens",function(){return this.itokenInfix<this.atokenInfix.length});e(d,"tokAt",function(a){return a<this.atokenInfix.length?this.atokenInfix[a].tok:0},"~N");e(d,"tokPeek",function(){return this.itokenInfix>=this.atokenInfix.length?0:this.atokenInfix[this.itokenInfix].tok});
e(d,"tokPeekIs",function(a){return this.tokAt(this.itokenInfix)==a},"~N");e(d,"intPeek",function(){return this.itokenInfix>=this.atokenInfix.length?2147483647:this.atokenInfix[this.itokenInfix].intValue});e(d,"valuePeek",function(){return this.moreTokens()?this.atokenInfix[this.itokenInfix].value:""});e(d,"tokenNext",function(){return this.itokenInfix>=this.atokenInfix.length?null:this.atokenInfix[this.itokenInfix++]});e(d,"tokenNextTok",function(a){var b=this.tokenNext();return null!=b&&b.tok==a},
"~N");e(d,"returnToken",function(){this.itokenInfix--;return!1});e(d,"getToken",function(){this.theValue=null==(this.theToken=this.tokenNext())?null:this.theToken.value;return this.theToken});e(d,"getNumericalToken",function(){return null!=this.getToken()&&(2==this.theToken.tok||3==this.theToken.tok)});e(d,"floatValue",function(){switch(this.theToken.tok){case 2:return this.theToken.intValue;case 3:return this.theValue.floatValue()}return 0});e(d,"addTokenToPostfix",function(a,b){return this.addTokenToPostfixToken(JS.T.o(a,
b))},"~N,~O");e(d,"addTokenToPostfixInt",function(a,b,c){return this.addTokenToPostfixToken(JS.T.tv(a,b,c))},"~N,~N,~O");e(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,f,d=this.ltokenPostfix.size();0<=--d&&0<=c;)switch(f=
this.ltokenPostfix.get(d).tok){case 268435969:case 268437505:c++;break;case 268435968:case 268437504:c--;var e;if(1==c&&268435969!=(e=this.ltokenPostfix.get(d-1).tok)&&268437505!=e)b=268437504==f?d-1:d,c=-10;break;default:e=0==d?0:this.ltokenPostfix.get(d-1).tok;if(1073742336==e||1073742337==e){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");e(d,"addNextToken",function(){return this.addTokenToPostfixToken(this.tokenNext())});
e(d,"addNextTokenIf",function(a){return this.tokPeekIs(a)&&this.addNextToken()},"~N");e(d,"addSubstituteTokenIf",function(a,b){if(!this.tokPeekIs(a))return!1;this.itokenInfix++;return this.addTokenToPostfixToken(b)},"~N,JS.T");e(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");e(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});e(d,"clauseNot",function(){return this.tokPeekIs(268439040)?(this.addNextToken(),this.clauseNot()):this.clausePrimitive()});
e(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||this.itokenInfix!=b)return c;if(1237320707==a)return this.clauseSubstructure()}return this.addNextToken()}});e(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 f=this.tokPeekIs(4);if(f){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?
f||this.tokenNext():this.addNextToken();return this.checkForItemSelector(!f)},"~B");e(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");e(d,"clauseWithin",function(a){this.addNextToken();if(!this.addNextTokenIf(268435968)||null==this.getToken())return!1;var b=3.4028235E38,c=
null,f=a,d,e=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(),e=d=0}}switch(e){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="";f=!1}if(a&&3.4028235E38==
b)switch(e){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;f=!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:f=
!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==e||this.addNextTokenIf(268436992));){0==e&&(e=134353926);var g=!1;d=this.tokPeek();if(a){switch(e){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)f=!1}if(null==c){switch(d){case 134219777:case 1073742329:case 134217750:g=!0;this.addNextToken();break;case 1073742330:this.getToken();this.getToken();this.addTokenToPostfix(4,"$"+this.theValue);j=!0;break;case 1814695966: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(),g=!0,this.addTokenToPostfixToken(JS.T.getTokenFromName(3.4028235E38==b?"plane":"coord"))}j||this.addNextTokenIf(268436992)}}this.tokPeek();if(j)break;if(g)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(f)}return!this.addNextTokenIf(268435969)?this.errorStr(15,")"):!0},"~B");e(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");e(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});e(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});e(d,"clauseComparator",function(a){var b=this.tokenNext(),c=this.tokenNext();if(!JS.ScriptTokenParser.tokenAttr(c,
268435712)){if(!a)return this.errorStr(15,"== != < > <= >=");null!=c&&this.returnToken();this.returnToken();return!1}if(JS.ScriptTokenParser.tokenAttr(b,1086324736)&&268440324!=c.tok&&268440326!=c.tok&&268440325!=c.tok)return this.errorStr(15,"== !=");if(268437504==this.tokPeek()){this.getToken();for(this.addTokenToPostfixToken(JS.T.tokenLeftParen);;){if(!this.addCompare(b,c))return!1;if(268436992==this.tokPeek())this.getToken();else if(268437505==this.tokPeek())break;this.addTokenToPostfixToken(268440325==
c.tok?JS.T.tokenAnd:JS.T.tokenOr)}this.getToken();this.addTokenToPostfixToken(JS.T.tokenRightParen);return!0}return this.addCompare(b,c)},"~B");e(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");e(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");e(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");
e(d,"generateResidueSpecCode",function(a){this.residueSpecCodeGenerated&&this.addTokenToPostfixToken(JS.T.tokenAndSpec);this.addTokenToPostfixToken(a);return this.residueSpecCodeGenerated=!0},"JS.T");e(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});e(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))}});e(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)});e(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");e(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");e(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))});e(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");e(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)});e(d,"fixModelSpec",function(a){a=a.intValue;if(2147483647==a){var b=this.theValue.floatValue();
b==C(b)&&(a=1E6*C(b));0>a&&(a=2147483647)}return a},"JS.T");e(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=e(d,"errorString",function(a,b,c,f){var d=!1;!f&&!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));f||J.i18n.GT.setDoTranslate(d);return a},"~N,~S,~S,~B");e(d,"commandExpected",function(){this.ichToken=
this.ichCurrentCommand;return this.error(2)});e(d,"error",function(a){return this.errorIntStr2(a,null,null)},"~N");e(d,"errorStr",function(a,b){return this.errorIntStr2(a,b,null)},"~N,~S");e(d,"errorIntStr2",function(a,b,c){var f=JS.ScriptTokenParser.errorString(a,b,c,!0);a=J.i18n.GT.getDoTranslate()?JS.ScriptTokenParser.errorString(a,b,c,!1):null;return this.errorStr2(f,a)},"~N,~S,~S");e(d,"isError",function(){return null!=this.errorMessage});e(d,"errorStr2",function(a,b){this.errorMessage=a;this.errorMessageUntranslated=
b;return!1},"~S,~S")});I("JV");N(["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=P(function(){this.undoWorking=!1;this.temp4=this.temp3=this.temp2=this.temp=this.vwr=this.actionStatesRedo=this.actionStates=null;L(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});T(d,function(){W(this,JV.StateCreator,[]);this.actionStates=new JU.Lst;this.actionStatesRedo=new JU.Lst});q(d,"setViewer",function(a){this.vwr=a},"JV.Viewer");q(d,"getStateScript",function(a,b,c){var f=null==a||a.equalsIgnoreCase("all"),d=new JU.SB,e=f?(new JU.SB).append("function _setState() {\n"):null;f&&
(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;(f||a.equalsIgnoreCase("windowState"))&&d.append(this.getWindowState(e,b,c));(f||a.equalsIgnoreCase("fileState"))&&d.append(this.getFileState(e));(f||a.equalsIgnoreCase("definedState"))&&
d.append(this.getDefinedState(e,!0));(f||a.equalsIgnoreCase("variableState"))&&d.append(this.getParameterState(j,e));(f||a.equalsIgnoreCase("dataState"))&&d.append(this.getDataState(e));(f||a.equalsIgnoreCase("modelState"))&&d.append(this.getModelState(e,!0,this.vwr.getBooleanProperty("saveProteinStructureState")));(f||a.equalsIgnoreCase("colorState"))&&d.append(this.getColorState(this.vwr.cm,e));(f||a.equalsIgnoreCase("frameState"))&&d.append(this.getAnimState(this.vwr.am,e));(f||a.equalsIgnoreCase("perspectiveState"))&&
d.append(this.getViewState(this.vwr.tm,e));(f||a.equalsIgnoreCase("selectionState"))&&d.append(this.getSelectionState(this.vwr.slm,e));null!=e&&(this.app(e,"set refreshing true"),this.app(e,"set antialiasDisplay "+j.antialiasDisplay),this.app(e,"set antialiasTranslucent "+j.antialiasTranslucent),this.app(e,"set antialiasImages "+j.antialiasImages),this.vwr.tm.spinOn&&!this.vwr.tm.vectorSpinOnly&&this.app(e,"spin on"),e.append("}\n\n_setState;\n"));f&&d.appendSB(e);return d.toString()},"~S,~N,~N");
e(d,"getDataState",function(a){var b=new JU.SB,c=!1,f=this.getAtomicPropertyState(-1,null);0<f.length&&(c=!0,b.append(f));null!=this.vwr.userVdws&&(f=this.vwr.getDefaultVdwNameOrData(0,J.c.VDW.USER,this.vwr.bsUserVdws),0<f.length&&(c=!0,b.append(f)));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");e(d,"getDefinedState",function(a,b){var c=this.vwr.ms,f=c.stateScripts.size();if(0==f)return"";for(var d=!1,e=new JU.SB,j,g=0;g<f;g++){var k=c.stateScripts.get(g);if(k.inDefinedStateBlock&&0<(j=k.toString()).length)this.app(e,j),d=!0}if(!d)return"";j="";b&&null!=a&&(a.append("  _setDefinedState;\n"),j="function _setDefinedState() {\n\n");null!=a&&e.append("\n}\n\n");return j+e.toString()},"JU.SB,~B");q(d,"getModelState",function(a,b,c){var f=new JU.SB;
b&&null!=a&&(a.append("  _setModelState;\n"),f.append("function _setModelState() {\n"));var d,e=this.vwr.ms,j=e.bo,g=e.am,k=e.mc;if(b){for(var q=e.stateScripts.size(),l=0;l<q;l++){var m=e.stateScripts.get(l);!m.inDefinedStateBlock&&0<(d=m.toString()).length&&this.app(f,d)}d=new JU.SB;q=!1;if(null!=e.unitCells){m=!1;for(l=0;l<k;l++){var n=e.getUnitCell(l);null!=n&&(d.setLength(0),n.getState(e,l,d)&&(q=!0,f.append("  frame ").append(e.getModelNumberDotted(l)).appendSB(d).append(";\n")),m=(new Boolean(m|
0<=this.vwr.ms.getLastVibrationVector(l,1275072532))).valueOf())}q&&this.vwr.shm.loadShape(33);this.getShapeStatePriv(f,b,33);if(m){q=new java.util.Hashtable;for(l=k;0<=--l;)if(0<=(m=this.vwr.ms.getLastVibrationVector(l,1275072532)))for(n=g[l].firstAtomIndex;n<=m;n++){var w=e.getModulation(n);null!=w&&JU.BSUtil.setMapBitSet(q,n,n,w.getState())}f.append(this.getCommands(q,null,"select"))}}d.setLength(0);for(l=0;l<e.bondCount;l++)if(null!=j[l]&&!g[j[l].atom1.mi].isModelKit&&(j[l].isHydrogen()||0!=(j[l].order&
131072)))q=j[l],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()&&f.append('data "connect_atoms"\n').appendSB(d).append('end "connect_atoms";\n');f.append("\n")}if(e.haveHiddenBonds){d=new JM.BondSet;for(l=e.bondCount;0<=--l;)null!=j[l]&&(0!=j[l].mad&&0==(j[l].shapeVisibilityFlags&
JM.Bond.myVisibilityFlag))&&d.set(l);d.isEmpty()?e.haveHiddenBonds=!1:f.append("  hide ").append(JU.Escape.eBond(d)).append(";\n")}this.vwr.setModelVisibility();c&&f.append(e.getProteinStructureState(null,b?1073742327:1073742158));for(l=0;l<k;l++)null!=g[l].mat4&&f.append("  frame orientation "+e.getModelNumberDotted(l)+JU.Escape.matrixToScript(g[l].mat4)+";\n");this.getShapeStatePriv(f,b,2147483647);if(b){c=!1;for(l=0;l<k;l++)if(g[l].isJmolDataFrame){c=!0;break}d=new JU.SB;for(l=0;l<k;l++)j=g[l],
d.setLength(0),q=e.getInfo(l,"modelID"),null!=q&&!q.equals(e.getInfo(l,"modelID0"))&&d.append("  frame ID ").append(JU.PT.esc(q)).append(";\n"),q=e.frameTitles[l],null!=q&&0<q.length&&d.append("  frame title ").append(JU.PT.esc(q)).append(";\n"),c&&(null!=j.orientation&&!e.isTrajectorySubFrame(l))&&d.append("  ").append(j.orientation.getMoveToText(!1)).append(";\n"),0!=j.frameDelay&&!e.isTrajectorySubFrame(l)&&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()&&f.append("  frame "+e.getModelNumberDotted(l)+";\n").appendSB(d);f.append("  set fontScaling "+this.vwr.getBoolean(603979847)+";\n");this.vwr.is2D()&&f.append("  set mode2d TRUE;\n")}null!=a&&f.append("\n}\n\n");return f.toString()},"JU.SB,~B,~B");e(d,"getWindowState",function(a,b,c){var f=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(f.objColors[0]));for(b=1;7>b;b++)0!=f.objColors[b]&&this.app(d,JV.StateManager.getObjectNameFromId(b)+'Color = "'+JU.Escape.escapeColor(f.objColors[b])+
'"');null!=f.backgroundImageFileName&&this.app(d,"background IMAGE "+(f.backgroundImageFileName.startsWith(JV.JC.BASE64_TAG)?"":"/*file*/")+JU.PT.esc(f.backgroundImageFileName));d.append(this.getLightingState(!1));null!=a&&d.append("}\n\n");return d.toString()},"JU.SB,~N,~N");q(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 d=c.getSpecularExponent(),e=c.getPhongExponent();this.app(b,Math.pow(2,d)==e?"set specularExponent "+d:"set phongExponent "+e);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");e(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");e(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 d=this.vwr.ligandModels.get(c+"_data");null!=d&&a.append("  ").append(JU.Escape.encapsulateData("ligand_"+
c,d.trim()+"\n",0));d=this.vwr.ligandModels.get(c+"_file");null!=d&&a.append("  ").append(JU.Escape.encapsulateData("file_"+c,d.trim()+"\n",0))}var b=new JU.SB,d=this.vwr.ms,e=d.am,p=d.mc;for(c=0;c<p;c++)if(!d.isJmolDataFrame(c)&&!d.isTrajectorySubFrame(c)){var j=e[c],g=b.indexOf(j.loadState);(0>g||g!=b.lastIndexOf(j.loadState))&&b.append(e[c].loadState);if(e[c].isModelKit)g=d.getModelAtomBitSetIncludingDeleted(c,!1),null!=d.tainted&&(null!=d.tainted[2]&&d.tainted[2].andNot(g),null!=d.tainted[3]&&
d.tainted[3].andNot(g)),j.loadScript=new JU.SB,this.getInlineData(b,this.vwr.getModelExtract(g,!1,!0,"MOL"),0<c,null,null);else if(b.appendSB(j.loadScript),g=j.auxiliaryInfo.get("auxFiles"),null!=g)for(j=0;j<g.size();j++)b.append(";#FILE1="+JU.PT.esc(g.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");q(d,
"getInlineData",function(a,b,c,d,e){c=(c?"append"+(null!=d&&d.intValue()!=this.vwr.ms.mc-1?" modelindex="+d:""):"model")+" inline";a.append('load /*data*/ data "').append(c).append('"\n').append(b).append('end "').append(c).append(null==e||0==e.length?"":" filter"+JU.PT.esc(e)).append('";')},"JU.SB,~S,~B,Integer,~S");e(d,"getColorState",function(a,b){var c=new JU.SB,d=this.getCEState(a.ce,c);0<d&&null!=b&&b.append("\n  _setColorState\n");return 0<d&&null!=b?"function _setColorState() {\n"+c.append("}\n\n").toString():
c.toString()},"JV.ColorManager,JU.SB");e(d,"getCEState",function(a,b){for(var c=0,d,e=a.schemes.entrySet().iterator();e.hasNext()&&((d=e.next())||1);){var p=d.getKey();0<p.length&&(!p.startsWith("=")&&0<=c++)&&b.append('color "'+p+"="+JU.ColorEncoder.getColorSchemeList(d.getValue())+'";\n')}return c},"JU.ColorEncoder,JU.SB");e(d,"getAnimState",function(a,b){var c=this.vwr.ms.mc;if(2>c)return"";var d=new JU.SB;null!=b&&(b.append("  _setFrameState;\n"),d.append("function _setFrameState() {\n"));d.append("# frame state;\n");
d.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(d,"set backgroundModel "+this.vwr.getModelNumberDotted(a.backgroundModelIndex));if(null!=this.vwr.tm.bsFrameOffsets)this.app(d,"frame align "+JU.Escape.eBS(this.vwr.tm.bsFrameOffsets));else if(null!=this.vwr.ms.translations)for(;0<=--c;){var e=this.vwr.ms.getTranslation(c);null!=e&&this.app(d,
"frame "+this.vwr.ms.getModelNumberDotted(c)+" align "+e)}this.app(d,"frame RANGE "+a.getModelSpecial(-1)+" "+a.getModelSpecial(1));this.app(d,"animation DIRECTION "+(1==a.animationDirection?"+1":"-1"));this.app(d,"animation FPS "+a.animationFps);this.app(d,"animation MODE "+JS.T.nameOf(a.animationReplayMode)+" "+a.firstFrameDelay+" "+a.lastFrameDelay);0<a.morphCount&&this.app(d,"animation MORPH "+a.morphCount);c=!0;null!=a.animationFrames&&(this.app(d,"anim frames "+JU.Escape.eAI(a.animationFrames)),
c=a.caf,this.app(d,"frame "+(c+1)),c=a.cmi!=a.modelIndexForFrame(c));c&&(c=a.getModelSpecial(0),this.app(d,c.equals("0")?"frame *":"model "+c));this.app(d,"animation "+(!a.animationOn?"OFF":1==a.currentDirection?"PLAY":"PLAYREV"));a.animationOn&&a.animationPaused&&this.app(d,"animation PAUSE");a.splitFrame&&this.app(d,"frame "+this.vwr.getModelNumberDotted(a.getSplitFrameModelIndex(0))+" "+this.vwr.getModelNumberDotted(a.getSplitFrameModelIndex(1))+" split");null!=b&&d.append("}\n\n");return d.toString()},
"JV.AnimationManager,JU.SB");e(d,"getParameterState",function(a,b){var c=Array(a.htBooleanParameterFlags.size()+a.htNonbooleanParameterValues.size()),d=new JU.SB;null!=b&&(b.append("  _setParameterState;\n"),d.append("function _setParameterState() {\n\n"));for(var e=0,p,j=a.htBooleanParameterFlags.keySet().iterator();j.hasNext()&&((p=j.next())||1);)JV.GlobalSettings.doReportProperty(p)&&(c[e++]="set "+p+" "+a.htBooleanParameterFlags.get(p));for(j=a.htNonbooleanParameterValues.keySet().iterator();j.hasNext()&&
((p=j.next())||1);)if(JV.GlobalSettings.doReportProperty(p)){var g=a.htNonbooleanParameterValues.get(p);"="==p.charAt(0)?p=p.substring(1):(p=(0==p.indexOf("default")?" ":"")+"set "+p,g=JU.Escape.e(g));c[e++]=p+" "+g}switch(a.axesMode){case 603979808:c[e++]="set axes unitcell";break;case 603979804:c[e++]="set axes molecular";break;default:c[e++]="set axes window"}java.util.Arrays.sort(c,0,e);for(p=0;p<e;p++)null!=c[p]&&this.app(d,c[p]);c=JV.StateManager.getVariableList(a.htUserVariables,0,!1,!0);0<
c.length&&(d.append("\n#user-defined atom sets; \n"),d.append(c));null!=this.vwr.shm.getShape(5)&&d.append(this.getDefaultLabelState(this.vwr.shm.shapes[5]));a.haveSetStructureList&&(c=a.structureList,d.append("struture HELIX set "+JU.Escape.eAF(c.get(J.c.STR.HELIX))),d.append("struture SHEET set "+JU.Escape.eAF(c.get(J.c.STR.SHEET))),d.append("struture TURN set "+JU.Escape.eAF(c.get(J.c.STR.TURN))));null!=b&&d.append("\n}\n\n");return d.toString()},"JV.GlobalSettings,JU.SB");e(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");e(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 d=new java.util.Hashtable,e=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);d.put("-",this.vwr.slm.getSelectedAtomsNoSubset());e=this.getCommands(d,null,"select");null==e?this.app(c,"select none"):c.append(e);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");e(d,"getViewState",function(a,b){var c=new JU.SB,d=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 e=1==a.mode;e&&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,d);!e&&!a.zoomEnabled&&this.app(c,"zoom off");c.append("  slab ").appendI(a.slabPercentSetting).append(";depth ").appendI(a.depthPercentSetting).append(a.slabEnabled&&!e?";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");d=null!=a.depthPlane||null!=a.slabPlane;e&&c.append(a.getNavigationState());!a.slabEnabled&&d&&c.append("  slab off;\n");
null!=b&&c.append("}\n\n");return c.toString()},"JV.TransformManager,JU.SB");e(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(d){if(!G(d,Exception))throw d;}},"JU.SB,JV.TransformManager,~B");q(d,"getSpinState",function(){var a=this.vwr.tm,
b="  set spinX "+C(a.spinX)+"; set spinY "+C(a.spinY)+"; set spinZ "+C(a.spinZ)+"; set spinFps "+C(a.spinFps)+";";Float.isNaN(a.navFps)||(b+="  set navX "+C(a.navX)+"; set navY "+C(a.navY)+"; set navZ "+C(a.navZ)+"; set navFps "+C(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 d=JU.P3.newP(a.internalRotationCenter);d.sub(a.rotationAxis);b+=
c+" spin "+a.rotationRate+" "+JU.Escape.eP(a.internalRotationCenter)+" "+JU.Escape.eP(d)}else b=a.isSpinFixed?b+(c+" spin axisangle "+JU.Escape.eP(a.rotationAxis)+" "+a.rotationRate):b+" spin on";return b+";"},"~B");q(d,"getCommands",function(a,b,c){var d=new JU.SB;a=this.getCommands2(a,d,null,c);null!=b&&this.getCommands2(b,d,a,"select");return d.toString()},"java.util.Map,java.util.Map,~S");e(d,"getCommands2",function(a,b,c,d){if(null==a)return"";var e;for(a=a.entrySet().iterator();a.hasNext()&&
((e=a.next())||1);){var p=e.getKey(),j=JU.Escape.eBS(e.getValue());5>j.length||(j=d+" "+j,j.equals(c)||this.app(b,j),c=j,0!=p.indexOf("-")&&this.app(b,p))}return c},"java.util.Map,JU.SB,~S,~S");e(d,"app",function(a,b){0!=b.length&&a.append("  ").append(b).append(";\n")},"JU.SB,~S");e(d,"addBs",function(a,b,c){null==c||0==c.length()||this.app(a,b+JU.Escape.eBS(c))},"JU.SB,~S,JU.BS");e(d,"getFontState",function(a,b){var c=JV.StateManager.getObjectIdFromName(a.equalsIgnoreCase("axes")?"axis":a);if(0>
c)return"";var d=this.vwr.getObjectMad10(c),c=(new JU.SB).append("\n");this.app(c,a+(0==d?" off":1==d?" on":-1==d?" dotted":20>d?" "+d:" "+d/2E4));if(3>c.length())return"";d=J.shape.Shape.getFontCommand(a,b);0<d.length&&(d="  "+d+";\n");return c+d},"~S,JU.Font");e(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=e(d,"addTickInfo",function(a,b,c){a.append(" ticks ").appendC(b.type).append(" ").append(JU.Escape.eP(b.ticks));
var d=null!=b.scale&&Float.isNaN(b.scale.x);d&&a.append(" UNITCELL");null!=b.tickLabelFormats&&a.append(" format ").append(JU.Escape.eAS(b.tickLabelFormats,!1));!d&&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");e(d,"getMeasurementState",function(a){var b=a.measurements,c=a.measurementCount,d=a.font3d,e=a.defaultTickInfo,
p=new JU.SB;this.app(p,"measures delete");for(var j=0;j<c;j++){var g=b.get(j),k=null!=g.property;if(!k||!Float.isNaN(g.value)){var q=g.count,l=(new JU.SB).append("measure");null!=g.thisID&&l.append(" ID ").append(JU.PT.esc(g.thisID));0!=g.mad&&l.append(" radius ").appendF(null==g.thisID||0<g.mad?g.mad/2E3:0);0!=g.colix&&l.append(" color ").append(JU.Escape.escapeColor(JU.C.getArgb(g.colix)));null!=g.text&&(null!=g.text.font&&l.append(" font ").append(g.text.font.getInfo()),0!=g.text.align&&l.append(" align ").append(JV.JC.getHorizAlignmentName(g.text.align)),
null!=g.text.pymolOffset&&l.append(" offset ").append(JU.Escape.eAF(g.text.pymolOffset)));var m=g.tickInfo;null!=m&&JV.StateCreator.addTickInfo(l,m,!0);for(m=1;m<=q;m++)l.append(" ").append(g.getLabel(m,!0,!0));k?l.append(" "+g.property+" value "+(Float.isNaN(g.value)?0:g.value)).append(" "+JU.PT.esc(g.getString())):2==q&&(g=g.getDistanceFormatForState(),null!=g&&l.append(" ").append(JU.PT.esc(g)));k||l.append("; # "+a.getInfoAsString(j));this.app(p,l.toString())}}this.app(p,J.shape.Shape.getFontCommand("measures",
d));d=0;k=new java.util.Hashtable;l=JU.BS.newN(c);for(j=0;j<c;j++)g=b.get(j),g.isHidden&&(d++,l.set(j)),null!=a.bsColixSet&&a.bsColixSet.get(j)&&JU.BSUtil.setMapBitSet(k,j,j,J.shape.Shape.getColorCommandUnk("measure",g.colix,a.translucentAllowed));if(0<d)if(d==c)this.app(p,"measures off; # lines and numbers off");else for(j=0;j<c;j++)l.get(j)&&JU.BSUtil.setMapBitSet(k,j,j,"measure off");null!=e&&(p.append(" measure "),JV.StateCreator.addTickInfo(p,e,!0),p.append(";\n"));0<=a.mad&&p.append(" set measurements ").appendF(a.mad/
2E3).append(";\n");g=this.getCommands(k,null,"select measures");null!=g&&0!=g.length&&(p.append(g),this.app(p,"select measures ({null})"));return p.toString()},"J.shape.Measures");e(d,"getShapeStatePriv",function(a,b,c){var d=this.vwr.shm.shapes;if(null!=d){var e;2147483647==c?(c=0,e=37):e=c+1;for(;c<e;++c){var p=d[c];if(null!=p&&(b||9<=c&&16>c))p=this.getShapeState(p),null!=p&&1<p.length&&a.append(p)}a.append("  select *;\n")}},"JU.SB,~B,~N");e(d,"getBondState",function(a){var b=a.bsOrderSet,c=a.reportAll;
this.clearTemp();var d=this.vwr.ms,e=d.bo,p=d.bondCount,j;if(c||null!=a.bsSizeSet)for(d=c?p-1:a.bsSizeSet.nextSetBit(0);0<=d;d=c?d-1:a.bsSizeSet.nextSetBit(d+1))null!=e[d]&&JU.BSUtil.setMapBitSet(this.temp,d,d,"wireframe "+(1==(j=e[d].mad)?"on":""+JU.PT.escF(j/2E3)));if(c||null!=b)for(d=c?p-1:b.nextSetBit(0);0<=d;d=c?d-1:b.nextSetBit(d+1))j=e[d],null!=j&&(c||0==(j.order&131072))&&JU.BSUtil.setMapBitSet(this.temp,d,d,"bondOrder "+JU.Edge.getBondOrderNameFromOrder(j.order));if(null!=a.bsColixSet)for(d=
a.bsColixSet.nextSetBit(0);0<=d;d=a.bsColixSet.nextSetBit(d+1))null!=e[d]&&(b=e[d].colix,2==(b&-30721)?JU.BSUtil.setMapBitSet(this.temp,d,d,J.shape.Shape.getColorCommand("bonds",J.c.PAL.CPK.id,b,a.translucentAllowed)):JU.BSUtil.setMapBitSet(this.temp,d,d,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");e(d,"clearTemp",function(){this.temp.clear();this.temp2.clear()});e(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,d;for(a=a.objects.values().iterator();a.hasNext()&&((d=a.next())||1);)c=(new Boolean(c|this.getEchoState(b,d))).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 e=this.vwr.getAllAtoms(),c=!1;for(b=a.bsSizeSet.nextSetBit(0);0<=b;b=a.bsSizeSet.nextSetBit(b+1))if(e.get(b)){d=a.getLabel(b);var p="label ";null==d?p+=JU.PT.esc(a.formats[b]):(p+=JU.PT.esc(d.textUnformatted),null!=d.pymolOffset&&(p+=";set labelOffset "+JU.Escape.eAF(d.pymolOffset)));JU.BSUtil.setMapBitSet(this.temp,b,b,p);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]));d=a.getLabel(b);d=null!=d?d.scalePixelsPerMicron:0;0<d&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"set labelScaleReference "+1E4/d);if(null!=a.offsets&&a.offsets.length>b){d=a.offsets[b];JU.BSUtil.setMapBitSet(this.temp2,
b,b,"set "+(JV.JC.isOffsetAbsolute(d)?"labelOffsetAbsolute ":"labelOffset ")+JV.JC.getXOffset(d)+" "+JV.JC.getYOffset(d));var p=JV.JC.getHorizAlignmentName(d>>2),j=JV.JC.getPointerName(d);0<j.length&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"set labelPointer "+j);0!=(d&32)?JU.BSUtil.setMapBitSet(this.temp2,b,b,"set labelFront"):0!=(d&16)&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"set labelGroup");0<p.length&&JU.BSUtil.setMapBitSet(this.temp3,b,b,"set labelAlignment "+p)}null!=a.mads&&0>a.mads[b]&&JU.BSUtil.setMapBitSet(this.temp2,
b,b,"set toggleLabel");null!=a.bsFontSet&&a.bsFontSet.get(b)&&(d=JU.Font.getFont3D(a.fids[b]),0<d.fontSizeAngstroms&&(c=!0),JU.BSUtil.setMapBitSet(this.temp4,b,b,J.shape.Shape.getFontCommand("label",d)))}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;e=this.vwr.ms.at;d=a.colixes;
p=a.paletteIDs;for(b=j=0;b<c;b++)if(null!=e[b]&&(null!=a.bsSizeSet&&a.bsSizeSet.get(b)&&(0>(j=e[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 g=e[b].paletteID;(g!=J.c.PAL.CPK.id||JU.C.isColixTranslucent(e[b].colixAtom))&&JU.BSUtil.setMapBitSet(this.temp,b,b,J.shape.Shape.getColorCommand("atoms",g,e[b].colixAtom,a.translucentAllowed));null!=d&&b<d.length&&JU.BSUtil.setMapBitSet(this.temp2,
b,b,J.shape.Shape.getColorCommand("balls",p[b],d[b],a.translucentAllowed))}b=this.getCommands(this.temp,this.temp2,"select");this.clearTemp();break;default:b=a.getShapeState()}return b},"J.shape.Shape");e(d,"getFontLineShapeState",function(a){var b=this.getFontState(a.myType,a.font3d);if(null==a.tickInfos)return b;var c=0<=b.indexOf(" off"),d=new JU.SB;d.append(b);for(b=0;4>b;b++)null!=a.tickInfos[b]&&this.appendTickInfo(a.myType,d,a.tickInfos[b]);c&&d.append("  "+a.myType+" off;\n");return d.toString()},
"J.shape.FontLineShape");e(d,"getAxesState",function(a){var b=new JU.SB;b.append(this.getFontLineShapeState(a));return a.getAxesState(b)},"J.shape.Axes");q(d,"getAtomShapeState",function(a){if(!a.isActive)return"";this.clearTemp();var b=JV.JC.shapeClassBases[a.shapeID],c=18==a.shapeID,d,e=this.vwr.getAllAtoms();if(null!=a.bsSizeSet)for(var p=a.bsSizeSet.nextSetBit(0);0<=p;p=a.bsSizeSet.nextSetBit(p+1))e.get(p)&&JU.BSUtil.setMapBitSet(this.temp,p,p,b+" "+(0>(d=a.mads[p])?c&&-1>d?""+-d:"on":JU.PT.escF(d/
2E3)));if(null!=a.bsColixSet)for(p=a.bsColixSet.nextSetBit(0);0<=p;p=a.bsColixSet.nextSetBit(p+1))JU.BSUtil.setMapBitSet(this.temp2,p,p,J.shape.Shape.getColorCommand(b,a.paletteIDs[p],a.colixes[p],a.translucentAllowed));a=this.getCommands(this.temp,this.temp2,"select");this.clearTemp();return a},"J.shape.AtomShape");e(d,"getEchoState",function(a,b){var c=null!=b&&0<b.barPixels,d=null==b?null:c?b.textUnformatted:b.getStateText();if(null==d||!b.isEcho||b.target.equals("error"))return!1;var e=null!=
b.image,p=null,j="set echo ID "+JU.PT.esc(c?"%SCALE":b.target);switch(b.valign){case 3:p=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==p&&(p=JU.Escape.eP(b.xyz));a.append("  ").append(j).append(" ").append(p);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);e?a.append("; ").append(j).append(" IMAGE /*file*/"):a.append("; echo ");a.append(JU.PT.esc(d));a.append(";\n");e&&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.pymolOffset&&a.append("  ").append(j).append(" offset ").append(JU.Escape.escapeFloatA(b.pymolOffset,!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");q(d,"getAllSettings",function(a){for(var b=this.vwr.g,c=new JU.SB,
d=Array(b.htBooleanParameterFlags.size()+b.htNonbooleanParameterValues.size()+b.htUserVariables.size()),e=0,p="_"+a,j,g=b.htBooleanParameterFlags.keySet().iterator();g.hasNext()&&((j=g.next())||1);)if(null==a||0==j.indexOf(a)||0==j.indexOf(p))d[e++]=(0==j.indexOf("_")?j+" = ":"set "+j+" ")+b.htBooleanParameterFlags.get(j);for(g=b.htNonbooleanParameterValues.keySet().iterator();g.hasNext()&&((j=g.next())||1);)if("@"!=j.charAt(0)&&(null==a||0==j.indexOf(a)||0==j.indexOf(p))){var k=b.htNonbooleanParameterValues.get(j);
"string"==typeof k&&(k=JV.StateCreator.chop(JU.PT.esc(k)));d[e++]=(0==j.indexOf("_")?j+" = ":"set "+j+" ")+k}for(g=b.htUserVariables.keySet().iterator();g.hasNext()&&((j=g.next())||1);)if(null==a||0==j.indexOf(a))k=b.htUserVariables.get(j),p=k.escape(),d[e++]=j+" "+(j.startsWith("@")?"":"= ")+(4==k.tok?JV.StateCreator.chop(JU.PT.esc(p)):p);java.util.Arrays.sort(d,0,e);for(a=0;a<e;a++)null!=d[a]&&this.app(c,d[a]);c.append("\n");return c.toString()},"~S");d.chop=e(d,"chop",function(a){var b=a.length;
if(512>b)return a;for(var c=new JU.SB,d=0,e=72;e<b;d=e,e+=72){for(;"\\"==a.charAt(e-1);)e++;c.append(0==d?"":'"\\\n    + "').append(a.substring(d,e))}c.append('"\\\n    + "').append(a.substring(d,b));return c.toString()},"~S");q(d,"getFunctionCalls",function(a){null==a&&(a="");var b=new JU.SB,c=a.indexOf("*"),d=0<=c,e=JV.Viewer.isStaticFunction(a),p=a.equalsIgnoreCase("names")||a.equalsIgnoreCase("static_names");p&&(a="");d&&(a=a.substring(0,c));a=a.toLowerCase();(e||0==a.length)&&this.addFunctions(b,
JV.Viewer.staticFunctions,a,d,p);(!e||0==a.length)&&this.addFunctions(b,this.vwr.localFunctions,a,d,p);return b.toString()},"~S");e(d,"addFunctions",function(a,b,c,d,e){for(var p=Array(b.size()),j=0,g,k=b.keySet().iterator();k.hasNext()&&((g=k.next())||1);)if(0==c.length&&!g.startsWith("_")||g.equalsIgnoreCase(c)||d&&0==g.toLowerCase().indexOf(c))p[j++]=g;java.util.Arrays.sort(p,0,j);for(c=0;c<j;c++)d=b.get(p[c]),a.append(e?d.getSignature():d.toString()),a.appendC("\n")},"JU.SB,java.util.Map,~S,~B,~B");
d.isTainted=e(d,"isTainted",function(a,b,c){return null!=a&&null!=a[c]&&a[c].get(b)},"~A,~N,~N");q(d,"getAtomicPropertyState",function(a,b){for(var c,d=new JU.SB,e=0;18>e;e++)if(0>a||e==a)null!=(c=null!=b?b:this.vwr.ms.getTaintedAtoms(e))&&this.getAtomicPropertyStateBuffer(d,e,c,null,null);return d.toString()},"~N,JU.BS");q(d,"getAtomicPropertyStateBuffer",function(a,b,c,d,e){if(this.vwr.g.preserveState){var p=new JU.SB;d=(null==d?JM.AtomCollection.userSettableValues[b]:d)+" set";var j=0,g=2==b,k=
this.vwr.ms.at,q=this.vwr.ms.tainted;if(null!=c)for(var l=c.nextSetBit(0);0<=l;l=c.nextSetBit(l+1))if(!(l>=k.length||JM.AtomCollection.isDeleted(k[l]))){p.appendI(l+1).append(" ").append(k[l].getElementSymbol()).append(" ").append(k[l].getInfo().$replace(" ","_")).append(" ");switch(b){case 18:l<e.length&&p.appendF(e[l]);break;case 13:p.appendI(k[l].getAtomNumber());break;case 16:p.append(k[l].getChainIDStr());break;case 15:p.appendI(k[l].group.getResno());break;case 14:p.appendI(k[l].getSeqID());
break;case 0:p.append(k[l].getAtomName());break;case 1:p.append(k[l].getAtomType());break;case 2:JV.StateCreator.isTainted(q,l,2)&&(g=!1);p.appendF(k[l].x).append(" ").appendF(k[l].y).append(" ").appendF(k[l].z);break;case 12:var m=k[l].getVibrationVector();if(null==m)p.append("0 0 0");else if(Float.isNaN(m.modScale)){switch(m.modDim){case -3:continue}p.appendF(m.x).append(" ").appendF(m.y).append(" ").appendD(m.z).append(" ").appendD(m.modDim).append(" ").appendF(m.magMoment)}else p.appendF(1.4E-45).append(" ").appendD(1.4E-45).append(" ").appendD(m.modScale);
break;case 17:p.appendI(k[l].getAtomSite());break;case 3:p.appendI(k[l].getAtomicAndIsotopeNumber());break;case 4:p.appendI(k[l].getFormalCharge());break;case 6:p.appendF(k[l].getBondingRadius());break;case 7:p.appendI(k[l].getOccupancy100());break;case 8:p.appendF(k[l].getPartialCharge());break;case 9:p.appendF(k[l].getBfactor100()/100);break;case 10:p.appendI(k[l].getValence());break;case 11:p.appendF(k[l].getVanderwaalsRadiusFloat(this.vwr,J.c.VDW.AUTO))}p.append(" ;\n");++j}0!=j&&(g&&(d+="(default)"),
a.append('\n  DATA "'+d+'"\n').appendI(j).append(" ;\nJmol Property Data Format 1 -- Jmol ").append(JV.Viewer.getJmolVersion()).append(";\n"),a.appendSB(p),a.append('  end "'+d+'";\n'))}},"JU.SB,~N,JU.BS,~S,~A");q(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");q(d,"undoMoveActionClear",function(a,b,c){if(this.vwr.g.preserveState){var d=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 e="";switch(b){default:case 4165:e=this.actionStates;a=this.actionStatesRedo;break;case 4140:if(e=this.actionStatesRedo,
a=this.actionStates,1==this.actionStatesRedo.size())return}if(0==e.size()||this.undoWorking)return;this.undoWorking=!0;a.add(0,e.removeItemAt(0));e=this.actionStatesRedo.get(0);4165==b&&1==a.size()&&(a=O(-1,[1]),b=JU.PT.parseIntNext(e,a),a=JU.PT.parseIntNext(e,a),this.undoMoveActionClear(a,b,!1));this.vwr.ms.am[d].isModelKit||0>e.indexOf("zap ")?(JU.Logger.debugging&&this.vwr.log(e),this.vwr.evalStringQuiet(e)):this.actionStates.clear();break;default:if(this.undoWorking&&c)return;this.undoWorking=
!0;e=new JU.SB;e.append("#"+b+" "+a+" "+new java.util.Date+"\n");0<=a?(d=this.vwr.getModelUndeletedAtomsBitSet(d),this.vwr.ms.taintAtoms(d,b),e.append(this.getAtomicPropertyState(-1,null))):(d=this.vwr.getModelUndeletedAtomsBitSet(d),e.append("zap "),e.append(JU.Escape.eBS(d)).append(";"),this.getInlineData(e,this.vwr.getModelExtract(d,!1,!0,"MOL"),!0,null,null),e.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,e.toString()),this.actionStatesRedo.clear()):this.actionStatesRedo.add(1,e.toString());100==this.actionStates.size()&&this.actionStates.removeItemAt(99)}this.undoWorking=!c}},"~N,~N,~B")});I("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);
