(function(W,X,Y,Z,$,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,d,ra,sa,ta,ua,va,wa,xa,ya,za,n,Aa,Ba,Ca,Da,G,D,r,E,L,I,z,M,Ea,B,N,P,O,Fa,R,Q,Ga,S,Ha,Ia,T,Ja,Ka,La,Ma,Na,Oa,Pa,Qa,U,V){D("J.api");S(J.api,"JmolScriptManager");D("J.api");S(J.api,"JmolScriptEvaluator");D("J.api");S(J.api,"JmolScriptFunction");D("J.api");S(J.api,"JmolParallelProcessor");D("J.script");E(["J.thread.JmolThread"],"J.script.FileLoadThread",null,function(){c$=I(function(){this.key=this.cacheName=this.fileName=null;L(this,
arguments)},J.script,"FileLoadThread",J.thread.JmolThread);M(c$,function(a,b,c,e,f){Q(this,J.script.FileLoadThread,[]);this.setViewer(b,"FileLoadThread");this.fileName=c;this.key=e;this.cacheName=f;this.setEval(a);this.sc.pc--},"J.api.JmolScriptEvaluator,J.viewer.Viewer,~S,~S,~S");n(c$,"run1",function(a){for(;;)switch(a){case -1:a=0;break;case 0:if(this.stopped||this.eval.isStopped()){a=-2;break}return Jmol._loadFileAsynchronously(this,this.viewer.applet,this.fileName);case -2:this.resumeEval();return}},
"~N");d(c$,"setData",function(a,b){null!=a&&this.sc.parentContext.htFileCache.put(this.key,this.cacheName=this.cacheName.substring(0,this.cacheName.lastIndexOf("_")+1)+a);this.viewer.cachePut(this.cacheName,b);this.run1(-2)},"~S,~O")});D("J.script");E(["J.thread.JmolThread"],"J.script.ScriptQueueThread",["J.util.Logger"],function(){c$=I(function(){this.scriptManager=null;this.startedByCommandThread=!1;this.pt=0;L(this,arguments)},J.script,"ScriptQueueThread",J.thread.JmolThread);M(c$,function(a,b,
c,e){Q(this,J.script.ScriptQueueThread);this.setViewer(b,"QueueThread"+e);this.scriptManager=a;this.viewer=b;this.startedByCommandThread=c;this.pt=e},"J.api.JmolScriptManager,J.viewer.Viewer,~B,~N");n(c$,"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");d(c$,"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;var c=b.get(0),e=b.get(1),f=b.get(2),l=b.get(3).booleanValue(),b=b.get(4).booleanValue();J.util.Logger.debugging&&J.util.Logger.debug("Queue["+this.pt+"]["+a.size()+"] scripts; running: "+c);a.remove(0);this.viewer.evalStringWaitStatusQueued(f,c,e,l,b,!0);return 0==a.size()?!1:!0})});D("J.script");E(["J.thread.JmolThread"],"J.script.ScriptDelayThread",
null,function(){c$=I(function(){this.seconds=this.millis=0;this.isPauseDelay=this.doPopPush=!1;L(this,arguments)},J.script,"ScriptDelayThread",J.thread.JmolThread);M(c$,function(a,b,c){Q(this,J.script.ScriptDelayThread,[]);this.setViewer(b,"ScriptDelayThread");this.millis=c;this.setEval(a)},"J.api.JmolScriptEvaluator,J.viewer.Viewer,~N");n(c$,"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.viewer.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=G(this.millis/1E3),this.millis-=1E3*this.seconds,0>=this.millis&&(this.millis=1));this.doPopPush&&this.viewer.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.viewer.pushHoldRepaintWhy("delay FINISH");this.isPauseDelay&&this.eval.notifyResumeStatus();this.resumeEval();return}},"~N");P(c$,"PAUSE_DELAY",-100)});D("J.script");E(["J.thread.JmolThread"],"J.script.CommandWatcherThread",["java.lang.Thread","J.util.Logger"],function(){c$=I(function(){this.scriptManager=null;L(this,arguments)},J.script,"CommandWatcherThread",J.thread.JmolThread);M(c$,function(){Q(this,J.script.CommandWatcherThread,[])});n(c$,"setManager",function(a,
b){this.scriptManager=a;this.setViewer(b,"CommmandWatcherThread");return 0},"~O,J.viewer.Viewer,~O");n(c$,"run",function(){for(Thread.currentThread().setPriority(1);!this.stopped;)try{Thread.sleep(50),this.stopped||this.scriptManager.runScriptNow()}catch(a){if(B(a,InterruptedException)){var b=a;J.util.Logger.warn("CommandWatcher InterruptedException! "+this);break}else if(B(a,Exception)){for(var b=a,c="script processing ERROR:\n\n"+b.toString(),e=0;e<b.getStackTrace().length;e++)c+="\n"+b.getStackTrace()[e].toString();
J.util.Logger.warn("CommandWatcher Exception! "+c);break}else throw a;}});n(c$,"run1",function(){},"~N");P(c$,"commandDelay",50)});D("J.script");E(["J.api.JmolScriptManager","JU.List"],"J.script.ScriptManager","java.io.BufferedReader java.lang.Boolean $.Thread javajs.api.ZInputStream JU.PT $.SB J.api.Interface J.io.JmolBinary J.script.ScriptQueueThread J.util.Escape $.Logger".split(" "),function(){c$=I(function(){this.scriptQueue=this.commandWatcherThread=this.scriptQueueRunning=this.queueThreads=
this.evalTemp=this.eval=this.viewer=null;this.useCommandWatcherThread=!1;this.scriptIndex=0;this.$isScriptQueued=!0;L(this,arguments)},J.script,"ScriptManager",null,J.api.JmolScriptManager);R(c$,function(){this.queueThreads=Array(2);this.scriptQueueRunning=U(2,!1);this.scriptQueue=new JU.List});n(c$,"getEval",function(){return this.eval});n(c$,"getScriptQueue",function(){return this.scriptQueue});n(c$,"isScriptQueued",function(){return this.$isScriptQueued});M(c$,function(){});n(c$,"setViewer",function(a){this.viewer=
a;this.eval=this.newScriptEvaluator();this.eval.setCompiler()},"J.viewer.Viewer");d(c$,"newScriptEvaluator",function(){return J.api.Interface.getOptionInterface("script.ScriptEvaluator").setViewer(this.viewer)});n(c$,"clear",function(a){a?(this.startCommandWatcher(!1),this.interruptQueueThreads()):this.evalTemp=null},"~B");n(c$,"addScript",function(a,b,c){return this.addScr("String",a,"",b,c)},"~S,~B,~B");d(c$,"addScr",function(a,b,c,e,f){this.useCommandWatcherThread=!1;this.viewer.global.useScriptQueue||
(this.clearQueue(),this.viewer.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 l=0;l<b.length;l++)this.addScr(a,b[l],c,e,f);return"split into "+b.length+" sections for processing"}var l=null!=this.commandWatcherThread&&(0>b.indexOf("javascript")||0<=b.indexOf("#javascript ")),g=new JU.List;g.addLast(b);g.addLast(c);g.addLast(a);g.addLast(e?
Boolean.TRUE:Boolean.FALSE);g.addLast(f?Boolean.TRUE:Boolean.FALSE);g.addLast(Integer.$valueOf(l?-1:1));this.scriptQueue.addLast(g);this.startScriptQueue(!1);return"pending"},"~S,~S,~S,~B,~B");n(c$,"clearQueue",function(){this.scriptQueue.clear()});n(c$,"waitForQueue",function(){if(!this.viewer.isSingleThreaded)for(var a=0;this.isQueueProcessing();)try{Thread.sleep(100),0==a++%10&&J.util.Logger.debugging&&J.util.Logger.debug("...scriptManager waiting for queue: "+this.scriptQueue.size()+" thread="+
Thread.currentThread().getName())}catch(b){if(!B(b,InterruptedException))throw b;}});n(c$,"isQueueProcessing",function(){return null!=this.queueThreads[0]||null!=this.queueThreads[1]});d(c$,"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.remove(b),J.util.Logger.debugging&&J.util.Logger.debug(this.scriptQueue.size()+" scripts; removed: "+c))}},"~S");d(c$,"startScriptQueue",function(a){var b=a?1:0;this.scriptQueueRunning[b]||
(this.scriptQueueRunning[b]=!0,this.queueThreads[b]=new J.script.ScriptQueueThread(this,this.viewer,a,b),this.queueThreads[b].start())},"~B");n(c$,"getScriptItem",function(a,b){if(this.viewer.isSingleThreaded&&this.viewer.queueOnHold)return null;var c=this.scriptQueue.get(0),e=c.get(5).intValue();return(a?0>e:b?0==e:1==e)?c:null},"~B,~B");n(c$,"startCommandWatcher",function(a){if(this.useCommandWatcherThread=a){if(null!=this.commandWatcherThread)return;this.commandWatcherThread=J.api.Interface.getOptionInterface("script.CommandWatcherThread");
this.commandWatcherThread.setManager(this,this.viewer,null);this.commandWatcherThread.start()}else{if(null==this.commandWatcherThread)return;this.clearCommandWatcherThread()}J.util.Logger.debugging&&J.util.Logger.debug("command watcher "+(a?"started":"stopped")+this.commandWatcherThread)},"~B");d(c$,"interruptQueueThreads",function(){for(var a=0;a<this.queueThreads.length;a++)null!=this.queueThreads[a]&&this.queueThreads[a].interrupt()});d(c$,"clearCommandWatcherThread",function(){null!=this.commandWatcherThread&&
(this.commandWatcherThread.interrupt(),this.commandWatcherThread=null)});n(c$,"queueThreadFinished",function(a){this.queueThreads[a].interrupt();this.scriptQueueRunning[a]=!1;this.queueThreads[a]=null;this.viewer.setSyncDriver(4);this.viewer.queueOnHold=!1},"~N");d(c$,"runScriptNow",function(){if(0<this.scriptQueue.size()){var a=this.getScriptItem(!0,!0);null!=a&&(a.set(5,Integer.$valueOf(0)),this.startScriptQueue(!0))}});n(c$,"evalStringWaitStatusQueued",function(a,b,c,e,f,l){if(null==b)return null;
var g=this.checkScriptExecution(b,!1);if(null!=g)return g;var d=null==c||c.equals("output")?new JU.SB:null,g=this.viewer.statusManager.getStatusList();this.viewer.getStatusChanged(c);this.viewer.isSyntaxCheck&&J.util.Logger.info("--checking script:\n"+this.eval.getScript()+"\n----\n");var k=0==b.indexOf(")");k&&(b=b.substring(1));k=k||!l;this.viewer.setErrorMessage(null,null);e=e?this.eval.compileScriptFile(b,f):this.eval.compileScriptString(b,f);var m=this.eval.getErrorMessage(),j=this.eval.getErrorMessageUntranslated();
this.viewer.setErrorMessage(m,j);this.viewer.refresh(7,"script complete");e?(this.$isScriptQueued=l,f||this.viewer.setScriptStatus(null,b,-2-++this.scriptIndex,null),this.eval.evaluateCompiledScript(this.viewer.isSyntaxCheck,this.viewer.isSyntaxAndFileCheck,k,this.viewer.listCommands,d,l||!this.viewer.isSingleThreaded)):(this.viewer.scriptStatus(m),this.viewer.setScriptStatus("Jmol script terminated",m,1,j),this.viewer.setStateScriptVersion(null));null!=m&&this.viewer.autoExit&&this.viewer.exitJmol();
this.viewer.isSyntaxCheck&&(null==m?J.util.Logger.info("--script check ok"):J.util.Logger.error("--script check error\n"+j),J.util.Logger.info("(use 'exit' to stop checking)"));this.$isScriptQueued=!0;if(a.equalsIgnoreCase("String"))return j;if(null!=d)return null==j?d.toString():j;a=this.viewer.getProperty(a,"jmolStatus",c);this.viewer.getStatusChanged(g);return a},"~S,~S,~S,~B,~B,~B");d(c$,"checkScriptExecution",function(a,b){var c=a;0<=c.indexOf("\u0001##")&&(c=c.substring(0,c.indexOf("\u0001##")));
return this.checkResume(c)?"script processing resumed":this.checkStepping(c)?"script processing stepped":this.checkHalt(c,b)?"script execution halted":null},"~S,~B");d(c$,"checkResume",function(a){return a.equalsIgnoreCase("resume")?(this.viewer.setScriptStatus("","execution resumed",0,null),this.eval.resumePausedExecution(),!0):!1},"~S");d(c$,"checkStepping",function(a){return a.equalsIgnoreCase("step")?(this.eval.stepPausedExecution(),!0):a.equalsIgnoreCase("?")?(this.viewer.scriptStatus(this.eval.getNextStatement()),
!0):!1},"~S");n(c$,"evalStringQuietSync",function(a,b,c){c&&(this.viewer.statusManager.syncingScripts&&0>a.indexOf("#NOSYNC;"))&&this.viewer.syncScript(a+" #NOSYNC;",null,0);this.eval.isPaused()&&"!"!=a.charAt(0)&&(a="!"+JU.PT.trim(a,"\n\r\t "));(c=0<a.length&&"!"==a.charAt(0))&&(a=a.substring(1));var e=this.checkScriptExecution(a,c);if(null!=e)return e;if(this.viewer.isScriptExecuting()&&(c||this.eval.isPaused()))return this.viewer.setInsertedCommand(a),0==a.indexOf("moveto ")&&this.flushQueue("moveto "),
"!"+a;this.viewer.setInsertedCommand("");b&&(a+="\u0001## EDITOR_IGNORE ##");return this.addScript(a,!1,b&&!this.viewer.getBoolean(603979880))},"~S,~B,~B");n(c$,"checkHalt",function(a,b){if(a.equalsIgnoreCase("pause"))return this.viewer.pauseScriptExecution(),this.viewer.scriptEditorVisible&&this.viewer.setScriptStatus("","paused -- type RESUME to continue",0,null),!0;if(a.equalsIgnoreCase("menu"))return this.viewer.getProperty("DATA_API","getPopupMenu","\x00"),!0;a=a.toLowerCase();var c=!1,e=null;
a.startsWith("exit")?(this.viewer.haltScriptExecution(),this.viewer.clearScriptQueue(),this.viewer.clearTimeouts(),c=a.equals(e="exit")):a.startsWith("quit")&&(this.viewer.haltScriptExecution(),c=a.equals(e="quit"));if(null==e)return!1;b&&(this.viewer.clearThreads(),this.viewer.queueOnHold=!1);(b||this.viewer.global.waitForMoveTo)&&this.viewer.stopMotion();J.util.Logger.info(this.viewer.isSyntaxCheck?e+" -- stops script checking":(b?"!":"")+e+" received");this.viewer.isSyntaxCheck=!1;return c},"~S,~B");
n(c$,"getAtomBitSetEval",function(a,b){null==a&&(a=this.evalTemp,null==a&&(a=this.evalTemp=this.newScriptEvaluator()));return a.getAtomBitSet(b)},"J.api.JmolScriptEvaluator,~O");n(c$,"scriptCheckRet",function(a,b){if(0==a.indexOf(")")||0==a.indexOf("!"))a=a.substring(1);var c=this.newScriptEvaluator().checkScriptSilent(a);return b||null==c.errorMessage?c:c.errorMessage},"~S,~B");n(c$,"openFileAsync",function(a,b){var c=1==b,e=null;a=a.trim();var f=!a.startsWith("\t");f||(a=a.substring(1));a=a.$replace("\\",
"/");var l=a.startsWith("cache://");this.viewer.isApplet()&&0>a.indexOf("://")&&(a="file://"+(a.startsWith("/")?"":"/")+a);try{if(a.endsWith(".pse"))e=(l?"":"zap;")+"load SYNC "+J.util.Escape.eS(a)+" filter 'DORESIZE'";else if(a.endsWith("jvxl"))e="isosurface ";else{if(!a.toLowerCase().endsWith(".spt")){var g=this.getFileTypeName(a);if(null==g){g=J.io.JmolBinary.determineSurfaceTypeIs(this.viewer.getBufferedInputStream(a));null!=g&&(e="if (_filetype == 'Pdb') { isosurface sigma 1.0 within 2.0 {*} "+
J.util.Escape.eS(a)+" mesh nofill }; else; { isosurface "+J.util.Escape.eS(a)+"}");return}if(g.equals("Jmol"))e="script ";else if(g.equals("Cube"))e="isosurface sign red blue ";else if(!g.equals("spt")){e=this.viewer.global.defaultDropScript;e=JU.PT.simpleReplace(e,"%FILE",a);e=JU.PT.simpleReplace(e,"%ALLOWCARTOONS",""+c);e.toLowerCase().startsWith("zap")&&l&&(e=e.substring(3));return}}f&&this.viewer.scriptEditorVisible&&null==e?this.viewer.showEditor([a,this.viewer.getFileAsString(a)]):e=(null==
e?"script ":e)+J.util.Escape.eS(a)}}finally{null!=e&&this.viewer.evalString(e)}},"~S,~N");d(c$,"getFileTypeName",function(a){var b=a.indexOf("::");if(0<=b)return a.substring(0,b);if(a.startsWith("="))return"pdb";b=this.viewer.fileManager.getUnzippedReaderOrStreamFromName(a,null,!0,!1,!0,!0,null);return r(b,java.io.BufferedReader)?this.viewer.getModelAdapter().getFileTypeName(b):r(b,javajs.api.ZInputStream)?(a=this.getZipDirectoryAsString(a),0<=a.indexOf("JmolManifest")?"Jmol":this.viewer.getModelAdapter().getFileTypeName(J.io.JmolBinary.getBR(a))):
JU.PT.isAS(b)?b[0]:null},"~S");d(c$,"getZipDirectoryAsString",function(a){a=this.viewer.fileManager.getBufferedInputStreamOrErrorMessageFromName(a,a,!1,!1,null,!1);return J.io.JmolBinary.getZipDirectoryAsStringAndClose(a)},"~S")});D("J.script");E(["J.api.JmolScriptEvaluator"],"J.script.ScriptEvaluator","java.lang.Boolean $.Float $.NullPointerException $.Thread java.util.Hashtable $.Map JU.BS $.CU $.List $.M3 $.M4 $.P3 $.P4 $.PT $.SB $.V3 J.api.Interface $.JmolParallelProcessor J.atomdata.RadiusData J.constant.EnumAnimationMode $.EnumPalette $.EnumStereoMode $.EnumStructure $.EnumVdw J.i18n.GT J.io.JmolBinary J.modelset.Atom $.BondSet $.Group $.ModelCollection $.TickInfo J.script.FileLoadThread $.SV $.ScriptCompiler $.ScriptContext $.ScriptDelayThread $.ScriptException $.ScriptInterruption $.ScriptMathProcessor $.T J.util.BSUtil $.ColorEncoder $.Elements $.Escape $.GData $.JmolEdge $.Logger $.Measure $.Parser $.Quaternion $.SimpleUnitCell $.Txt J.viewer.ActionManager $.FileManager $.JC $.StateManager $.Viewer".split(" "),
function(){c$=I(function(){this.allowJSThreads=!0;this.executing=this.executionStepping=this.executionPaused=this.executionStopped=this.debugScript=this.logMessages=this.historyDisabled=this.isCmdLine_c_or_C_Option=this.isCmdLine_C_Option=this.chk=this.tQuiet=this.isJS=this.listCommands=!1;this.timeEndExecution=this.timeBeginExecution=0;this.mustResumeEval=!1;this.outputBuffer=this.definedAtomSets=this.compiler=this.viewer=this.currentThread=this.sm=null;this.contextPath="";this.functionName=this.scriptFileName=
null;this.isStateScript=!1;this.commandHistoryLevelMax=this.scriptReportingLevel=this.scriptLevel=0;this.$script=this.contextVariables=this.lineIndices=this.lineNumbers=this.aatoken=null;this.pc=0;this.st=this.fullCommand=this.thisCommand=null;this.pcEnd=this.lineEnd=this.iToken=this.slen=0;this.scriptExtensions=null;this.forceNoAddHydrogens=!1;this.thisContext=this.parallelProcessor=null;this.$error=!1;this.errorType=this.errorMessageUntranslated=this.errorMessage=null;this.iCommandError=0;this.ignoreError=
!1;this.tempStatement=null;this.isBondSet=!1;this.expressionResult=null;this.theTok=0;this.theToken=null;this.coordinatesAreFractional=!1;this.fileLoadThread=this.scriptDelayThread=this.colorArgb=this.scriptExt=this.fractionalPoint=null;L(this,arguments)},J.script,"ScriptEvaluator",null,J.api.JmolScriptEvaluator);R(c$,function(){this.colorArgb=[-2147483648]});n(c$,"getAllowJSThreads",function(){return this.allowJSThreads});n(c$,"setViewer",function(a){this.viewer=a;this.compiler=null==this.compiler?
a.compiler:this.compiler;this.isJS=a.isSingleThreaded;this.definedAtomSets=a.definedAtomSets;return this},"J.viewer.Viewer");M(c$,function(){this.currentThread=Thread.currentThread()});n(c$,"setCompiler",function(){this.viewer.compiler=this.compiler=new J.script.ScriptCompiler(this.viewer)});n(c$,"compileScriptString",function(a,b){this.clearState(b);this.contextPath="[script]";return this.compileScript(null,a,this.debugScript)},"~S,~B");n(c$,"compileScriptFile",function(a,b){this.clearState(b);this.contextPath=
a;return this.compileScriptFileInternal(a,null,null,null)},"~S,~B");n(c$,"evaluateCompiledScript",function(a,b,c,e,f,l){var g=this.isCmdLine_C_Option;this.isCmdLine_C_Option=b;this.chk=this.isCmdLine_c_or_C_Option=a;this.historyDisabled=c;this.outputBuffer=f;this.currentThread=Thread.currentThread();this.allowJSThreads=l;this.listCommands=e;this.startEval();this.isCmdLine_C_Option=g;this.viewer.setStateScriptVersion(null)},"~B,~B,~B,~B,JU.SB,~B");d(c$,"useThreads",function(){return!this.viewer.autoExit&&
this.viewer.haveDisplay&&null==this.outputBuffer&&this.allowJSThreads});d(c$,"startEval",function(){this.timeBeginExecution=System.currentTimeMillis();this.executionStepping=this.executionStopped=this.executionPaused=!1;this.executing=!0;this.viewer.pushHoldRepaintWhy("runEval");this.setScriptExtensions();this.executeCommands(!1)});d(c$,"executeCommands",function(a){var b=!1;try{if(!this.dispatchCommands(!1,!1))return}catch(c){if(B(c,Error))this.viewer.handleError(c,!1),this.setErrorMessage(""+c+
" "+this.viewer.getShapeErrorState()),this.errorMessageUntranslated=""+c,this.scriptStatusOrBuffer(this.errorMessage),b=!0;else if(B(c,J.script.ScriptException)){if(r(c,J.script.ScriptInterruption))return;if(a){this.viewer.setStringProperty("_errormessage",""+c);return}this.setErrorMessage(c.toString());this.errorMessageUntranslated=c.getErrorMessageUntranslated();this.scriptStatusOrBuffer(this.errorMessage);this.viewer.notifyError(null!=this.errorMessage&&0<=this.errorMessage.indexOf("java.lang.OutOfMemoryError")?
"Error":"ScriptException",this.errorMessage,this.errorMessageUntranslated);b=!0}else throw c;}if(b||!this.isJS||!this.allowJSThreads)this.viewer.setTainted(!0),this.viewer.popHoldRepaint("executeCommands "+(0<this.scriptLevel?"\u0001## REPAINT_IGNORE ##":""));this.timeEndExecution=System.currentTimeMillis();null==this.errorMessage&&this.executionStopped?this.setErrorMessage("execution interrupted"):!this.tQuiet&&!this.chk&&this.viewer.scriptStatus("Script completed");this.executing=this.chk=this.isCmdLine_c_or_C_Option=
this.historyDisabled=!1;a=this.getErrorMessageUntranslated();this.viewer.setErrorMessage(this.errorMessage,a);this.tQuiet||this.viewer.setScriptStatus("Jmol script terminated",this.errorMessage,1+this.getExecutionWalltime(),a)},"~B");n(c$,"resumeEval",function(a){this.setErrorMessage(null);this.executionStopped||null==a||!a.mustResumeEval?(this.viewer.setTainted(!0),this.viewer.popHoldRepaint("resumeEval"),this.viewer.queueOnHold=!1):(this.executionPaused||a.pc++,this.thisContext=a,0<a.scriptLevel&&
(this.scriptLevel=a.scriptLevel-1),this.restoreScriptContext(a,!0,!1,!1),this.executeCommands(a.isTryCatch))},"J.script.ScriptContext");n(c$,"runScript",function(a){this.viewer.isPreviewOnly()||this.runScriptBuffer(a,this.outputBuffer)},"~S");n(c$,"runScriptBuffer",function(a,b){this.pushContext(null,"runScriptBuffer");this.contextPath+=" >> script() ";this.outputBuffer=b;this.allowJSThreads=!1;this.compileScript(null,a+"\u0001## EDITOR_IGNORE ##\u0001## REPAINT_IGNORE ##",!1)&&this.dispatchCommands(!1,
!1);this.popContext(!1,!1)},"~S,JU.SB");n(c$,"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)}catch(b){if(B(b,J.script.ScriptException))this.setErrorMessage(b.toString()),a=this.getScriptContext("checkScriptSilent");else throw b;}this.chk=!1;return a},"~S");c$.getContextTrace=d(c$,"getContextTrace",
function(a,b,c,e){null==c&&(c=new JU.SB);c.append(J.script.ScriptEvaluator.getErrorLineMessage(b.functionName,b.scriptFileName,b.lineNumbers[b.pc],b.pc,J.script.ScriptEvaluator.statementAsString(a,b.statement,e?b.iToken:9999,!1)));null!=b.parentContext&&J.script.ScriptEvaluator.getContextTrace(a,b.parentContext,c,!1);return c},"J.viewer.Viewer,J.script.ScriptContext,JU.SB,~B");n(c$,"setDebugging",function(){this.logMessages=(this.debugScript=this.viewer.getBoolean(603979824))&&J.util.Logger.debugging});
d(c$,"getExecutionWalltime",function(){return this.timeEndExecution-this.timeBeginExecution});n(c$,"haltExecution",function(){this.resumePausedExecution();this.executionStopped=!0});n(c$,"pauseExecution",function(a){!this.chk&&!this.viewer.isHeadless()&&(a&&!this.isJS&&this.delayScript(-100),this.viewer.popHoldRepaint("pauseExecution "+a),this.executionStepping=!1,this.executionPaused=!0)},"~B");n(c$,"stepPausedExecution",function(){this.executionStepping=!0;this.executionPaused=!1});n(c$,"resumePausedExecution",
function(){this.executionStepping=this.executionPaused=!1});n(c$,"isExecuting",function(){return this.executing&&!this.executionStopped});n(c$,"isPaused",function(){return this.executionPaused});n(c$,"isStepping",function(){return this.executionStepping});n(c$,"isStopped",function(){return this.executionStopped||!this.isJS&&this.currentThread!==Thread.currentThread()});n(c$,"getNextStatement",function(){return this.pc<this.aatoken.length?J.script.ScriptEvaluator.getErrorLineMessage(this.functionName,
this.scriptFileName,this.getLinenumber(null),this.pc,J.script.ScriptEvaluator.statementAsString(this.viewer,this.aatoken[this.pc],-9999,this.logMessages)):""});d(c$,"getCommand",function(a,b){if(a>=this.lineIndices.length)return"";if(b){for(var c=-1,e=this.$script.length,f=0;f<this.lineNumbers.length;f++)if(this.lineNumbers[f]==this.lineNumbers[a])0>c&&(c=this.lineIndices[f][0]),e=this.lineIndices[f][1];else if(0==this.lineNumbers[f]||this.lineNumbers[f]>this.lineNumbers[a])break;f=this.$script;0<=
f.indexOf("\u0001")&&(f=f.substring(0,f.indexOf("\u0001")));e==f.length-1&&f.endsWith("}")&&e++;return c==f.length||e<c?"":f.substring(Math.max(c,0),Math.min(f.length,e))}c=this.lineIndices[a][0];e=this.lineIndices[a][1];f="";if(0>c||e<=c||e>this.$script.length)return"";try{f=this.$script.substring(c,e),0<=f.indexOf("\\\n")&&(f=JU.PT.simpleReplace(f,"\\\n","  ")),0<=f.indexOf("\\\r")&&(f=JU.PT.simpleReplace(f,"\\\r","  ")),0<f.length&&!f.endsWith(";")&&(f+=";")}catch(l){if(B(l,Exception))J.util.Logger.error("darn problem in Eval getCommand: ichBegin="+
c+" ichEnd="+e+" len = "+this.$script.length+"\n"+l);else throw l;}return f},"~N,~B,~B");d(c$,"logDebugScript",function(a){if(this.logMessages){0<this.st.length&&J.util.Logger.debug(this.st[0].toString());for(var b=1;b<this.slen;++b)J.util.Logger.debug(this.st[b].toString())}this.iToken=-9999;this.logMessages?(b=new JU.SB,a=0<a?"                          ".substring(0,2*a):"",b.append(a).append(J.script.ScriptEvaluator.statementAsString(this.viewer,this.st,this.iToken,this.logMessages)),this.viewer.scriptStatus(b.toString())):
(a=this.getCommand(this.pc,!1,!1),""!==a&&this.viewer.scriptStatus(a))},"~N");n(c$,"evaluateExpression",function(a,b){var c=(new J.script.ScriptEvaluator).setViewer(this.viewer);try{c.pushContext(null,"evalExp"),c.allowJSThreads=!1}catch(e){if(!B(e,J.script.ScriptException))throw e;}return c.evaluate(a,b)},"~O,~B");d(c$,"evaluate",function(a,b){try{if(r(a,String)){if(this.compileScript(null,"e_x_p_r_e_s_s_i_o_n = "+a,!1))return this.contextVariables=this.viewer.getContextVariables(),this.setStatement(0),
b?this.parameterExpressionList(2,-1,!1).get(0):this.parameterExpressionString(2,0)}else if(r(a,Array)){this.contextVariables=this.viewer.getContextVariables();var c=this.atomExpression(a,0,0,!0,!1,!0,!1);return b?J.script.SV.newV(10,c):c}}catch(e){if(B(e,Exception))J.util.Logger.error("Error evaluating: "+a+"\n"+e);else throw e;}return b?J.script.SV.getVariable("ERROR"):"ERROR"},"~O,~B");n(c$,"getAtomBitSet",function(a){if(r(a,JU.BS))return a;var b=new JU.BS;try{this.pushContext(null,"getAtomBitSet");
var c="select ("+a+")",c=JU.PT.replaceAllCharacters(c,"\n\r","),("),c=JU.PT.simpleReplace(c,"()","(none)");this.compileScript(null,c,!1)&&(this.st=this.aatoken[0],b=this.atomExpression(this.st,1,0,!1,!1,!0,!0));this.popContext(!1,!1)}catch(e){if(B(e,Exception))J.util.Logger.error("getAtomBitSet "+a+"\n"+e);else throw e;}return b},"~O");n(c$,"getAtomBitSetVector",function(a,b){for(var c=new JU.List,e=this.getAtomBitSet(b),f=e.nextSetBit(0);0<=f;f=e.nextSetBit(f+1))c.addLast(Integer.$valueOf(f));return c},
"~N,~O");d(c$,"parameterExpressionList",function(a,b,c){return this.parameterExpression(a,-1,null,!0,!0,b,c,null,null)},"~N,~N,~B");d(c$,"parameterExpressionString",function(a,b){return this.parameterExpression(a,b,"",!0,!1,-1,!1,null,null)},"~N,~N");d(c$,"parameterExpressionBoolean",function(a,b){return this.parameterExpression(a,b,null,!0,!1,-1,!1,null,null).booleanValue()},"~N,~N");d(c$,"parameterExpressionToken",function(a){a=this.parameterExpressionList(a,-1,!1);return 0<a.size()?a.get(0):J.script.SV.newS("")},
"~N");d(c$,"parameterExpression",function(a,b,c,e,f,l,g,d,k){var m,j,p=null!=k,K=0>a,n=!f&&null==c;c=!f&&null!=c&&0==c.length;var q=0;K&&(a=-a);var x=0;f=new J.script.ScriptMathProcessor(this,g,f,!1);0==a&&0==b&&(a=2);b<a&&(b=this.slen);g=a;a:for(;g<b;g++){m=null;var u=this.getToken(g).tok;if(p&&1048584!=this.tokAt(g+1)){var v=null!=d&&d.containsKey(this.theToken.value)?null:this.getBitsetPropertySelector(g,!1);if(null!=v){f.addXVar(d.get(k));f.addOpAllowMath(v,269484048==this.tokAt(g+1))||this.invArg();
if((135368713==v.intValue||102436==v.intValue)&&269484048!=this.tokAt(this.iToken+1))f.addOp(J.script.T.tokenLeftParen),f.addOp(J.script.T.tokenRightParen);g=this.iToken;continue}}switch(u){case 1060866:if(1048577==this.tokAt(++g))m=this.parameterExpressionToken(++g),g=this.iToken;else if(2==this.tokAt(g)){m=this.viewer.getAtomBits(1095763969,Integer.$valueOf(this.st[g].intValue));break}else m=this.getParameter(J.script.SV.sValue(this.st[g]),1073742190);m=this.getParameter(m.asString(),1073742190);
break;case 135369225:269484048!=this.getToken(++g).tok&&this.invArg();null==d&&(d=new java.util.Hashtable);j=this.parameterExpression(++g,-1,null,e,!1,-1,!1,d,k);v=j.booleanValue();u=this.iToken;1048591!=this.getToken(u++).tok&&this.invArg();this.parameterExpressionBoolean(u,-1);var t=this.iToken;1048591!=this.tokAt(t++)&&this.invArg();this.parameterExpression(-t,-1,null,e,!1,1,!1,d,k);g=this.iToken;269484049!=this.tokAt(g)&&this.invArg();m=this.parameterExpression(v?u:t,v?t:g,"XXX",e,!1,1,!1,d,k);
break;case 135369224:case 135280132:u=(v=0<a)&&135369224==u;v?((269484048!=this.getToken(++g).tok||!J.script.T.tokAttr(this.getToken(++g).tok,1073741824))&&this.invArg(),t=this.parameterAsString(g),1048591!=this.getToken(++g).tok&&this.invArg()):t="_x";m=this.parameterExpressionToken(-++g).value;r(m,JU.BS)||this.invArg();g=this.iToken;v&&1048591!=this.getToken(g++).tok&&this.invArg();var w=new JU.BS,s=new JU.BS,y=u?Array(J.util.BSUtil.cardinalityOf(m)):null;null==d&&(d=new java.util.Hashtable);s.set(0);
var A=J.script.SV.newV(10,s);A.index=0;d.put(t,A.setName(t));var z=-1;if(v){z=g-1;j=0;for(var C;0<=j&&++z<b;)269484049==(C=this.tokAt(z))?j--:269484048==C&&j++}var G=0,D=0,H=m.nextSetBit(0);if(0>H)this.iToken=z-1;else if(!this.chk)for(;0<=H;H=m.nextSetBit(H+1))0<=D&&s.clear(D),D=H,s.set(H),A.index=H,j=this.parameterExpression(g,z,u?"XXX":null,e,u,H,!1,d,v?null:t),u?((null==j||0==j.size())&&this.invArg(),y[G++]=j.get(0).asString()):j.booleanValue()&&w.set(H);if(u)m=y;else if(v)m=w;else return this.bitsetVariableVector(w);
g=this.iToken+1;break;case 1048591:break a;case 3:f.addXNum(J.script.SV.newV(3,this.theToken.value));break;case 1048614:case 2:f.addXNum(J.script.SV.newI(this.theToken.intValue));break;case 135266319:if(269484048==this.tokAt(this.iToken+1)){f.addOpAllowMath(this.theToken,!0)||this.invArg();break}f.addXVar(J.script.SV.newT(this.theToken));break;case 1087375362:case 1087375361:case 1048580:case 1679429641:case 1087373316:case 1048582:case 1087375365:case 1087373318:case 1095766030:case 1095761936:case 1087373320:case 1095761940:case 135267335:case 135267336:case 1238369286:case 1641025539:case 1048589:case 1048588:case 4:case 8:case 9:case 11:case 12:case 10:case 6:f.addXVar(J.script.SV.newT(this.theToken));
break;case 1048583:this.ignoreError=!0;var F;try{F=this.centerParameter(g),f.addXVar(J.script.SV.newV(8,F))}catch(E){if(B(E,Exception))f.addXStr("");else throw E;}this.ignoreError=!1;g=this.iToken;break;case 1048586:m=4==this.tokAt(g+1)?this.getHash(g):this.getPointOrPlane(g,!1,!0,!0,!1,3,4);g=this.iToken;break;case 1048577:if(1048578==this.tokAt(g+1)){m=new java.util.Hashtable;g++;break}else 1048579==this.tokAt(g+1)&&1048578==this.tokAt(g+2)&&(u=1048579,this.iToken+=2);case 1048579:m=1048579==u?
this.viewer.getAllAtoms():this.atomExpression(this.st,g,0,!0,!0,!0,!0);g=this.iToken;if(0==x&&K)return this.iToken++,this.bitsetVariableVector(m);break;case 1073742195:f.addOp(this.theToken);continue;case 1048578:break a;case 1048590:if(!e&&0==x&&0==q)break a;this.invArg();break;case 269484080:if(!e&&0==x&&0==q)break a;f.addOp(this.theToken)||this.invArg();break;case 1048584:v=this.getBitsetPropertySelector(g+1,!1);null==v&&this.invArg();g=135368713==v.intValue;u=!0;C=this.tokAt(this.iToken+2);if(1048584==
this.tokAt(this.iToken+1))switch(C){case 1048579:C=480,1048584==this.tokAt(this.iToken+3)&&1276118529==this.tokAt(this.iToken+4)&&(C=224);case 32:case 64:case 192:case 128:case 160:case 96:u=g||1276118018==v.intValue||480==C||224==C,v.intValue|=C,this.getToken(this.iToken+2)}u=(new Boolean(u&(269484048==this.tokAt(this.iToken+1)||g))).valueOf();f.addOpAllowMath(v,u)||this.invArg();g=this.iToken;135368713==v.intValue&&269484048!=this.tokAt(g+1)&&(f.addOp(J.script.T.tokenLeftParen),f.addOp(J.script.T.tokenRightParen));
break;default:if(J.script.T.tokAttr(this.theTok,269484032)||J.script.T.tokAttr(this.theTok,135266304)&&269484048==this.tokAt(this.iToken+1)){if(!f.addOp(this.theToken)){if(0<=l)break a;this.invArg()}switch(this.theTok){case 269484048:x++;break;case 269484049:if(0>=--x&&0==q&&K){this.iToken++;break a}break;case 269484096:q++;break;case 269484097:if(0==--q&&0==x&&K){this.iToken++;break a}}}else{v=this.parameterAsString(g).toLowerCase();u=269484048==this.tokAt(g+1);if(this.chk)m=v;else if(!u&&(null==
d||null==(m=d.get(v))))m=this.getContextVariableAsVariable(v);null==m&&(J.script.T.tokAttr(this.theTok,1073741824)&&this.viewer.isFunction(v)?(f.addOp(J.script.SV.newV(135368713,this.theToken.value))||this.invArg(),u||(f.addOp(J.script.T.tokenLeftParen),f.addOp(J.script.T.tokenRightParen))):f.addXVar(this.viewer.getOrSetNewVariable(v,!1)))}}null!=m&&(r(m,JU.BS)?f.addXBs(m):f.addXObj(m))}a=f.getResult(!1);null==a&&(this.chk||f.dumpStacks("null result"),this.error(13));if(135198==a.tok)return a.value;
if(n)return Boolean.$valueOf(a.asBoolean());if(c)return 4==a.tok&&(a.intValue=2147483647),a.asString();switch(a.tok){case 1048589:case 1048588: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");d(c$,"getHash",function(a){var b=new java.util.Hashtable;for(a+=1;a<this.slen&&1048590!=this.tokAt(a);a++){var c=this.stringParameter(a++);269484066!=this.tokAt(a++)&&this.invArg();a=this.parameterExpression(a,
0,null,!1,!0,-1,!1,null,null);b.put(c,a.get(0));a=this.iToken;if(269484080!=this.tokAt(a))break}this.iToken=a;1048590!=this.tokAt(a)&&this.invArg();return b},"~N");d(c$,"bitsetVariableVector",function(a){var b=new JU.List;r(a,JU.BS)&&b.addLast(J.script.SV.newV(10,a));return b},"~O");d(c$,"getBitsetPropertySelector",function(a,b){var c=this.getToken(a).tok;switch(c){case 32:case 64:case 96:case 192:case 128:case 160:case 1716520985:break;default:if(J.script.T.tokAttrOr(c,1078984704,1141899264))break;
if(806354977!=c&&!J.script.T.tokAttr(c,1073741824))return null;c=this.parameterAsString(a);if(!b&&this.viewer.isFunction(c)){c=135368713;break}if(!c.endsWith("?"))return null;c=1073741824}return b&&!J.script.T.tokAttr(c,2048)?null:J.script.SV.newSV(269484241,c,this.parameterAsString(a).toLowerCase())},"~N,~B");d(c$,"getBitsetPropertyFloat",function(a,b,c,e){a=this.getBitsetProperty(a,b,null,null,null,null,!1,2147483647,!1);if(!Float.isNaN(c))for(b=0;b<a.length;b++)a[b]<c&&(a[b]=NaN);if(!Float.isNaN(e))for(b=
0;b<a.length;b++)a[b]>e&&(a[b]=NaN);return a},"JU.BS,~N,~N,~N");d(c$,"getBitsetProperty",function(a,b,c,e,f,l,g,d,k){var m=2147483647!=d,j=m||!r(f,J.modelset.BondSet),p=b&480,K=224==p,n=this.viewer.getAtomCount(),q=256==p?O(n,0):null,x=480==p||K;b&=-481;0==b&&(b=j?1141899265:1678770178);var u=!1,v=!1,t=!1;switch(b){case 1146095626:case 1146095631:case 1146095627:case 1146095629:case 1146093582:case 1766856708:case 1146095628:u=!0;break;case 135368713:case 1276118018:break;default:v=J.script.T.tokAttr(b,
1095761920)&&!J.script.T.tokAttr(b,1112539136),t=!v&&J.script.T.tokAttr(b,1087373312)}var w=u||!j?new JU.P3:null;if(x||t&&!m&&256!=p&&32!=p)p=1048579;var s=1048579==p?new JU.List:null,y=null,A=y=null,z=null,C=null,B=null,D=null;switch(b){case 1141899265:case 1678770178:if(this.chk)return a;y=1141899265==b?j?a:this.viewer.getAtomBits(1678770178,a):j?new J.modelset.BondSet(this.viewer.getBondsForSelectedAtoms(a)):a;switch(p){case 32:d=y.nextSetBit(0);break;case 64:d=y.length()-1;break;case 192:case 128:case 160:return Float.$valueOf(NaN);
default:return y}y.clearAll();0<=d&&y.set(d);return y;case 1087373321:switch(p){case 0:case 1048579:return this.getExtension().getBitsetIdent(a,null,f,g,d,x)}return"";case 135368713:y=l[0];A=l[1];z=J.util.BSUtil.newBitSet(n);C=J.script.SV.newV(10,z);break;case 1112539150:case 1112539151:this.viewer.autoCalculate(b);break;case 1276118018:if(null==c&&null==e)return new JU.P3;break;case 1766856708:B=new JU.P3;break;case 1716520985:D=this.viewer.getDataFloat(l)}var H=g=l=0,F=0,E=0;switch(p){case 32:g=
2147483647;H=3.4028235E38;break;case 64:g=-2147483648,H=-3.4028235E38}var L=this.viewer.modelSet;f=u?3:t?2:v?1:0;if(j){B=null!=a;m?(j=d,n=d+1):B?(j=a.nextSetBit(0),n=Math.min(n,a.length())):j=0;this.chk&&(n=0);for(d=j;0<=d&&d<n;d=B?a.nextSetBit(d+1):d+1){l++;var I=L.atoms[d];switch(f){case 0:j=3.4028235E38;switch(b){case 135368713:z.set(d);j=J.script.SV.fValue(this.runFunctionRet(null,y,A,C,!0,!0,!1));z.clear(d);break;case 1716520985:j=null==D?0:D[d];break;case 1276118018:j=null!=e?J.util.Measure.distanceToPlane(e,
I):I.distance(c);break;default:j=J.modelset.Atom.atomPropertyFloat(this.viewer,I,b)}if(3.4028235E38==j||Float.isNaN(j)&&1048579!=p){l--;continue}switch(p){case 32:j<H&&(H=j);break;case 64:j>H&&(H=j);break;case 256:q[d]=j;break;case 1048579:s.addLast(Float.$valueOf(j));break;case 160:case 192:E+=j*j;default:F+=j}break;case 1:j=0;switch(b){case 1095766024:case 1095761925:this.errorStr(45,J.script.T.nameOf(b));break;default:j=J.modelset.Atom.atomPropertyInt(I,b)}switch(p){case 32:j<g&&(g=j);break;case 64:j>
g&&(g=j);break;case 256:q[d]=j;break;case 1048579:s.addLast(Integer.$valueOf(j));break;case 160:case 192:E+=j*j;default:F+=j}break;case 2:j=J.modelset.Atom.atomPropertyString(this.viewer,I,b);switch(p){case 256:q[d]=JU.PT.parseFloat(j);break;default:if(null==s)return j;s.addLast(j)}break;case 3:switch(j=J.modelset.Atom.atomPropertyTuple(I,b),null==j&&this.errorStr(45,J.script.T.nameOf(b)),p){case 256:q[d]=Math.sqrt(j.x*j.x+j.y*j.y+j.z*j.z);break;case 1048579:s.addLast(JU.P3.newP(j));break;default:w.add(j)}}if(m)break}}else{j=
(c=null==a)?0:a.nextSetBit(0);n=this.viewer.getBondCount();for(d=j;0<=d&&d<n;d=c?d+1:a.nextSetBit(d+1))switch(l++,e=L.getBondAt(d),b){case 1141899267:j=e.getAtom1().distance(e.getAtom2());switch(p){case 32:j<H&&(H=j);break;case 64:j>H&&(H=j);break;case 1048579:s.addLast(Float.$valueOf(j));break;case 160:case 192:E+=j*j;default:F+=j}break;case 1146095626:switch(p){case 1048579:w.ave(e.getAtom1(),e.getAtom2());s.addLast(JU.P3.newP(w));break;default:w.add(e.getAtom1()),w.add(e.getAtom2()),l++}break;
case 1766856708:JU.CU.toRGBpt(this.viewer.getColorArgbOrGray(e.colix),B);switch(p){case 1048579:s.addLast(JU.P3.newP(B));break;default:w.add(B)}break;default:this.errorStr(46,J.script.T.nameOf(b))}}if(256==p)return q;if(1048579==p){if(k)return s;a=s.size();if(t&&!x&&1==a)return s.get(0);if(K){q=O(a,0);for(d=a;0<=--d;)switch(b=s.get(d),f){case 0:q[d]=b.floatValue();break;case 1:q[d]=b.floatValue();break;case 2:q[d]=JU.PT.parseFloat(b);break;case 3:q[d]=b.length()}return q}if(1087373320==b){q=new JU.SB;
for(d=0;d<a;d++)q.append(s.get(d));return q.toString()}q=Array(a);for(d=a;0<=--d;)b=s.get(d),q[d]=r(b,JU.P3)?J.util.Escape.eP(b):""+s.get(d);return q}if(u)return 0==l?w:JU.P3.new3(w.x/l,w.y/l,w.z/l);if(0==l||1==l&&192==p)return Float.$valueOf(NaN);if(v)switch(p){case 32:case 64:return Integer.$valueOf(g);case 160:case 192:break;case 128:return Integer.$valueOf(G(F));default:return F/l==G(F/l)?Integer.$valueOf(G(F/l)):Float.$valueOf(F/l)}switch(p){case 32:case 64:F=H;break;case 128:break;case 160:F=
E;break;case 192:F=Math.sqrt((E-F*F/l)/(l-1));break;default:F/=l}return Float.$valueOf(F)},"JU.BS,~N,JU.P3,JU.P4,~O,~O,~B,~N,~B");d(c$,"setBitsetProperty",function(a,b,c,e,f){if(!(this.chk||0==J.util.BSUtil.cardinalityOf(a))){var l=null,d=null,h=null,k,m=null;k=0;var j=J.script.T.tokAttr(b,1087373312);if(7==f.tok&&(m=f.getList(),0==(k=m.size())))return;switch(b){case 1146095626:case 1146095627:case 1146095629:case 1146095631:switch(f.tok){case 8:this.viewer.setAtomCoords(a,b,f.value);break;case 7:this.theToken=
f,this.viewer.setAtomCoords(a,b,this.getPointArray(-1,k))}return;case 1766856708:var p=null;b="color";switch(f.tok){case 7:f=N(k,0);for(p=k;0<=--p;)b=m.get(p),k=J.script.SV.ptValue(b),null!=k?f[p]=JU.CU.colorPtToFFRGB(k):2==b.tok?f[p]=b.intValue:(f[p]=JU.CU.getArgbFromString(b.asString()),0==f[p]&&(f[p]=b.asInt())),0==f[p]&&this.errorStr2(50,"ARRAY",b.asString());p=f;b="colorValues";break;case 8:p=Integer.$valueOf(JU.CU.colorPtToFFRGB(f.value));break;case 4:p=f.value;break;default:p=Integer.$valueOf(J.script.SV.iValue(f))}this.setShapePropertyBs(0,
b,p,a);return;case 1826248715:case 1288701960:7!=f.tok&&(d=J.script.SV.sValue(f));break;case 1087375365:case 1095763978:this.clearDefinedVariableAtomSets(),j=!1}switch(f.tok){case 7:j?l=J.script.SV.listValue(f):h=J.script.SV.flistValue(f,k);break;case 4:null==d&&(l=JU.PT.getTokens(J.script.SV.sValue(f)))}if(null!=l){k=l.length;if(!j){h=O(k,0);for(p=k;0<=--p;)h[p]=1087375365==b?J.util.Elements.elementNumberFromSymbol(l[p],!1):JU.PT.parseFloat(l[p])}7!=f.tok&&1==k&&(j?d=l[0]:e=h[0],c=z(e),h=l=null)}this.viewer.setAtomProperty(a,
b,c,e,d,h,l)}},"JU.BS,~N,~N,~N,J.script.T");n(c$,"getDefinedAtomSets",function(){return this.definedAtomSets});n(c$,"getContextVariables",function(){return this.contextVariables});n(c$,"getScript",function(){return this.$script});d(c$,"compileScript",function(a,b,c){this.scriptFileName=a;b=this.fixScriptPath(b,a);this.restoreScriptContext(this.compiler.compile(a,b,!1,!1,c,!1),!1,!1,!1);this.forceNoAddHydrogens=(this.isStateScript=0<=this.$script.indexOf("# Jmol state version "))&&0>this.$script.indexOf("pdbAddHydrogens");
a=this.$script;this.pc=this.setScriptExtensions();!this.chk&&(this.viewer.scriptEditorVisible&&0>b.indexOf("\u0001## EDITOR_IGNORE ##"))&&this.viewer.scriptStatus("");this.$script=a;return!this.$error},"~S,~S,~B");d(c$,"fixScriptPath",function(a,b){if(null!=b&&0<=a.indexOf("$SCRIPT_PATH$")){var c=b,e=Math.max(b.lastIndexOf("|"),b.lastIndexOf("/")),c=c.substring(0,e+1);a=JU.PT.simpleReplace(a,"$SCRIPT_PATH$/",c);a=JU.PT.simpleReplace(a,"$SCRIPT_PATH$",c)}return a},"~S,~S");d(c$,"setScriptExtensions",
function(){var a=this.scriptExtensions;if(null==a)return 0;var b=a.indexOf("##SCRIPT_STEP");0<=b&&(this.executionStepping=!0);b=a.indexOf("##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});d(c$,"compileScriptFileInternal",function(a,
b,c,e){if(0==a.toLowerCase().indexOf("javascript:"))return this.compileScript(a,this.viewer.jsEval(a.substring(11)),this.debugScript);var f=Array(2);f[0]=a;if(!this.viewer.getFileAsStringBin(f))return this.setErrorMessage("io error reading "+f[0]+": "+f[1]),!1;if(0<=("\n"+f[1]).indexOf("\nJmolManifest.txt\n")){var d;if(a.endsWith(".all.pngj")||a.endsWith(".all.png"))d="|state.spt",a+="|";else{f[0]=a+="|JmolManifest.txt";if(!this.viewer.getFileAsStringBin(f))return this.setErrorMessage("io error reading "+
f[0]+": "+f[1]),!1;d=J.io.JmolBinary.getManifestScriptPath(f[1])}if(null!=d&&0<d.length&&(f[0]=a=a.substring(0,a.lastIndexOf("|"))+d,!this.viewer.getFileAsStringBin(f)))return this.setErrorMessage("io error reading "+f[0]+": "+f[1]),!1}this.scriptFileName=a;f[1]=J.io.JmolBinary.getEmbeddedScript(f[1]);f=this.fixScriptPath(f[1],f[0]);null==e&&(e=this.viewer.getFilePath(a,!1),e=e.substring(0,Math.max(e.lastIndexOf("|"),e.lastIndexOf("/"))));f=J.viewer.FileManager.setScriptFileReferences(f,b,c,e);return this.compileScript(a,
f,this.debugScript)},"~S,~S,~S,~S");d(c$,"getParameter",function(a,b){var c=this.getContextVariableAsVariable(a);null==c&&(c=this.viewer.getParameter(a));switch(b){case 1073742190:return J.script.SV.getVariable(c);case 4:if(!r(c,JU.List))break;for(var e=new JU.SB,f=0;f<c.size();f++)e.append(c.get(f).asString()).appendC("\n");return e.toString()}return r(c,J.script.SV)?J.script.SV.oValue(c):c},"~S,~N");d(c$,"getStringParameter",function(a,b){var c=this.getContextVariableAsVariable(a);if(null!=c)return c.asString();
c=""+this.viewer.getParameter(a);return 0==c.length&&b?a:c},"~S,~B");d(c$,"getNumericParameter",function(a){if(a.equalsIgnoreCase("_modelNumber"))return a=this.viewer.getCurrentModelIndex(),Integer.$valueOf(0>a?0:this.viewer.getModelFileNumber(a));var b=this.getContextVariableAsVariable(a);if(null==b){a=this.viewer.getParameter(a);if(!r(a,String))return a;b=J.script.SV.newS(a)}return J.script.SV.nValue(b)},"~S");d(c$,"getContextVariableAsVariable",function(a){if(a.equals("expressionBegin"))return null;
a=a.toLowerCase();if(null!=this.contextVariables&&this.contextVariables.containsKey(a))return this.contextVariables.get(a);for(var b=this.thisContext;null!=b&&!0!=b.isFunction;){if(null!=b.contextVariables&&b.contextVariables.containsKey(a))return b.contextVariables.get(a);b=b.parentContext}return null},"~S");d(c$,"getStringObjectAsVariable",function(a,b){if(null==a||0==a.length)return a;var c=J.script.SV.unescapePointOrBitsetAsVariable(a);r(c,String)&&null!=b&&(c=this.viewer.setUserVariable(b,J.script.SV.newS(c)));
return c},"~S,~S");n(c$,"evalFunctionFloat",function(a,b,c){try{for(var e=0;e<c.length;e++)b.get(e).value=Float.$valueOf(c[e]);return J.script.SV.fValue(this.runFunctionRet(a,a.name,b,null,!0,!1,!1))}catch(f){if(B(f,Exception))return NaN;throw f;}},"~O,~O,~A");d(c$,"runFunctionRet",function(a,b,c,e,f,d,g){if(null==a){a=this.viewer.getFunction(b);if(null==a)return null;d&&(this.contextPath+=" >> function "+b)}else d&&(this.contextPath+=" >> "+b);this.pushContext(null,"funcRet");this.allowJSThreads&&
(this.allowJSThreads=g);d=364558==a.getTok();this.thisContext.isTryCatch=d;this.thisContext.isFunction=!d;this.functionName=b;if(d){this.viewer.resetError();this.thisContext.displayLoadErrorsSave=this.viewer.displayLoadErrors;this.thisContext.tryPt=++J.script.ScriptEvaluator.tryPt;this.viewer.displayLoadErrors=!1;this.restoreFunction(a,c,e);this.contextVariables.put("_breakval",J.script.SV.newI(2147483647));this.contextVariables.put("_errorval",J.script.SV.newS(""));a=this.contextVariables;for(this.executeCommands(!0);this.thisContext.tryPt>
J.script.ScriptEvaluator.tryPt;)this.popContext(!1,!1);this.processTry(a);return null}r(a,J.api.JmolParallelProcessor)?(this.parallelProcessor=a,this.restoreFunction(a,c,e),this.dispatchCommands(!1,!0),a.runAllProcesses(this.viewer)):(this.restoreFunction(a,c,e),this.dispatchCommands(!1,!0));a=f?this.getContextVariableAsVariable("_retval"):null;this.popContext(!1,!1);return a},"J.api.JmolScriptFunction,~S,JU.List,J.script.SV,~B,~B,~B");d(c$,"processTry",function(a){this.viewer.displayLoadErrors=this.thisContext.displayLoadErrorsSave;
this.popContext(!1,!1);var b=this.viewer.getParameter("_errormessage");0<b.length&&(a.put("_errorval",J.script.SV.newS(b)),this.viewer.resetError());a.put("_tryret",a.get("_retval"));b=a.get("_tryret");if(null!=b.value||2147483647!=b.intValue)this.returnCmd(b);else{b=a.get("_errorval").value;if(0==b.length&&(a=a.get("_breakval").intValue,2147483647!=a)){this.breakCmd(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,J.script.SV.newS(b)),a.intValue=(0<b.length?1:-1)*Math.abs(a.intValue))}},"java.util.Map");d(c$,"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.List,J.script.SV");d(c$,"clearDefinedVariableAtomSets",
function(){this.definedAtomSets.remove("# variable")});d(c$,"defineSets",function(){if(!this.definedAtomSets.containsKey("# static")){for(var a=0;a<J.viewer.JC.predefinedStatic.length;a++)this.defineAtomSet(J.viewer.JC.predefinedStatic[a]);this.defineAtomSet("# static")}if(!this.definedAtomSets.containsKey("# variable")){for(a=0;a<J.viewer.JC.predefinedVariable.length;a++)this.defineAtomSet(J.viewer.JC.predefinedVariable[a]);for(a=J.util.Elements.elementNumberMax;0<=--a;){var b=" elemno="+a;this.defineAtomSet("@"+
J.util.Elements.elementNameFromNumber(a)+b);this.defineAtomSet("@_"+J.util.Elements.elementSymbolFromNumber(a)+b)}for(a=4;0<=--a;)b="@"+J.util.Elements.altElementNameFromIndex(a)+" _e="+J.util.Elements.altElementNumberFromIndex(a),this.defineAtomSet(b);for(a=J.util.Elements.altElementMax;4<=--a;){var c=J.util.Elements.altElementNumberFromIndex(a),e=" _e="+c,b="@_"+J.util.Elements.altElementSymbolFromIndex(a);this.defineAtomSet(b+e);b="@_"+J.util.Elements.altIsotopeSymbolFromIndex(a);this.defineAtomSet(b+
e);b="@_"+J.util.Elements.altIsotopeSymbolFromIndex2(a);this.defineAtomSet(b+e);b="@"+J.util.Elements.altElementNameFromIndex(a);1<b.length&&this.defineAtomSet(b+e);b=J.util.Elements.getElementNumber(c);c=J.util.Elements.getNaturalIsotope(b);0<c&&(e=J.util.Elements.elementSymbolFromNumber(b),this.defineAtomSet("@_"+e+c+" _e="+b),this.defineAtomSet("@_"+c+e+" _e="+b))}this.defineAtomSet("# variable")}});d(c$,"defineAtomSet",function(a){if(0==a.indexOf("#"))this.definedAtomSets.put(a,Boolean.TRUE);
else{var b=this.compiler.compile("#predefine",a,!0,!1,!1,!1);if(null!=b.errorType)this.viewer.scriptStatus("JmolConstants.java ERROR: predefined set compile error:"+a+"\ncompile error:"+b.errorMessageUntranslated);else if(1!=b.aatoken.length)this.viewer.scriptStatus("JmolConstants.java ERROR: predefinition does not have exactly 1 command:"+a);else if(b=b.aatoken[0],2>=b.length)this.viewer.scriptStatus("JmolConstants.java ERROR: bad predefinition length:"+a);else{var c=b[1].tok;!J.script.T.tokAttr(c,
1073741824)&&!J.script.T.tokAttr(c,3145728)?this.viewer.scriptStatus("JmolConstants.java ERROR: invalid variable name:"+a):(a=b[1].value.toLowerCase(),a.startsWith("dynamic_")&&(a="!"+a.substring(8)),this.definedAtomSets.put(a,b))}}},"~S");d(c$,"lookupIdentifierValue",function(a){var b=this.lookupValue(a,!1);if(null!=b)return J.util.BSUtil.copy(b);b=this.getAtomBits(1073741824,a);return null==b?new JU.BS:b},"~S");d(c$,"lookupValue",function(a,b){if(this.chk)return new JU.BS;this.defineSets();a=a.toLowerCase();
var c=this.definedAtomSets.get(a),e=!1;null==c&&(c=this.definedAtomSets.get("!"+a),e=null!=c);if(r(c,JU.BS))return c;if(r(c,Array))return this.pushContext(null,"lookupValue"),c=this.atomExpression(c,-2,0,!0,!1,!0,!0),this.popContext(!1,!1),e||this.definedAtomSets.put(a,c),c;if(b)return null;e=a.length;if(5>e||"s"!=a.charAt(e-1))return null;a=a.endsWith("ies")?a.substring(0,e-3)+"y":a.substring(0,e-1);return this.lookupValue(a,!0)},"~S,~B");n(c$,"deleteAtomsInVariables",function(a){for(var b,c=this.definedAtomSets.entrySet().iterator();c.hasNext()&&
((b=c.next())||1);){var e=b.getValue();r(e,JU.BS)&&(J.util.BSUtil.deleteBits(e,a),b.getKey().startsWith("!")||this.viewer.setUserVariable("@"+b.getKey(),J.script.SV.newV(10,e)))}},"JU.BS");d(c$,"setStatement",function(a){this.st=this.aatoken[a];this.slen=this.st.length;if(0==this.slen)return!0;var b,c;for(b=1;b<this.slen;b++){if(null==this.st[b])return this.slen=b,!0;if(1060866==this.st[b].tok)break}if(b==this.slen)return b==this.slen;switch(this.st[0].tok){case 102436:case 135368713:case 1073741824:if(269484048==
this.tokAt(1))return!0}a=Array(this.slen);a[0]=this.st[0];var e=!1,f=1;for(b=1;b<this.slen;b++)if(null!=this.st[b]){switch(c=this.getToken(b).tok){default:a[f]=this.st[b];break;case 1048577:case 1048578:e=1048577==c;a[f]=this.st[b];break;case 1060866:++b==this.slen&&this.invArg();var d,g=4==this.theToken.intValue,h;h=this.parameterAsString(b);var k=1048577==this.tokAt(b),m=1==f&&this.st[0]===J.script.T.tokenSetCmd;k?(d=this.parameterExpressionToken(++b),b=this.iToken,d=7==d.tok?d:J.script.SV.oValue(d)):
(d=2==this.tokAt(b)?this.viewer.getAtomBits(1095763969,Integer.$valueOf(this.st[b].intValue)):this.getParameter(h,0),!e&&!m&&(k=!0));c=this.tokAt(0);g=(new Boolean(g|(J.script.T.tokAttr(c,20480)||135271429==c))).valueOf();if(r(d,J.script.SV))a[f]=d,e&&7==a[f].tok&&(g=J.script.SV.getBitSet(d,!0),a[f]=J.script.SV.newV(10,null==g?this.getAtomBitSet(J.script.SV.sValue(a[f])):g));else if(r(d,Boolean))a[f]=d.booleanValue()?J.script.T.tokenOn:J.script.T.tokenOff;else if(r(d,Integer))a[f]=J.script.T.tv(2,
d.intValue(),d);else if(r(d,Float))a[f]=J.script.T.tv(3,J.script.ScriptEvaluator.getFloatEncodedInt(""+d),d);else if(r(d,String)){if(!g){if((1085443!=c||1<f&&537022465!=this.st[1].tok)&&J.script.T.tokAttr(c,36864))d=this.getParameter(d,1073742190);r(d,String)&&(d=this.getStringObjectAsVariable(d,null))}r(d,J.script.SV)?a[f]=d:(h=d,e&&!g?a[f]=J.script.T.o(10,this.getAtomBitSet(h)):(c=m?J.script.T.getTokFromName(h):k||g||0==h.length||0<=h.indexOf(".")||0<=h.indexOf(" ")||0<=h.indexOf("=")||0<=h.indexOf(";")||
0<=h.indexOf("[")||0<=h.indexOf("{")?4:1073741824,a[f]=J.script.T.o(c,d)))}else if(r(d,JU.BS))a[f]=J.script.SV.newV(10,d);else if(r(d,JU.P3))a[f]=J.script.SV.newV(8,d);else if(r(d,JU.P4))a[f]=J.script.SV.newV(9,d);else if(r(d,JU.M3))a[f]=J.script.SV.newV(11,d);else if(r(d,JU.M4))a[f]=J.script.SV.newV(12,d);else if(r(d,java.util.Map))a[f]=J.script.SV.newV(6,d);else if(r(d,JU.List)){k=d;g=null;for(h=0;h<k.size();h++){c=k.get(h);if(10!=c.tok){g=null;break}null==g&&(g=new JU.BS);g.or(c.value)}a[f]=null==
g?J.script.SV.getVariable(d):J.script.T.o(10,g)}else d=this.getObjectCenter(h,-2147483648,-2147483648),null==d&&this.invArg(),a[f]=J.script.T.o(8,d);m&&!J.script.T.tokAttr(a[f].tok,536870912)&&this.invArg()}f++}this.st=a;for(b=f;b<this.st.length;b++)this.st[b]=null;this.slen=f;return!0},"~N");d(c$,"clearState",function(a){this.thisContext=null;this.scriptLevel=0;this.setErrorMessage(null);this.contextPath="";this.tQuiet=a},"~B");n(c$,"getThisContext",function(){return this.thisContext});n(c$,"pushContextDown",
function(a){this.scriptLevel--;this.pushContext2(null,a)},"~S");d(c$,"pushContext",function(a,b){100==this.scriptLevel&&this.error(44);this.pushContext2(a,b)},"J.script.ContextToken,~S");d(c$,"pushContext2",function(a,b){this.thisContext=this.getScriptContext(b);this.thisContext.token=a;if(null==a)this.scriptLevel=++this.thisContext.scriptLevel;else if(this.thisContext.scriptLevel=-1,this.contextVariables=new java.util.Hashtable,null!=a.contextVariables)for(var c,e=a.contextVariables.keySet().iterator();e.hasNext()&&
((c=e.next())||1);)J.script.ScriptCompiler.addContextVariable(this.contextVariables,c);(this.debugScript||this.isCmdLine_c_or_C_Option)&&J.util.Logger.info("--\x3e>-------------".substring(0,Math.max(17,this.scriptLevel+5))+this.scriptLevel+" "+this.scriptFileName+" "+a+" "+this.thisContext.id)},"J.script.ContextToken,~S");n(c$,"getScriptContext",function(a){var b=new J.script.ScriptContext;this.debugScript&&J.util.Logger.info("creating context "+b.id+" for "+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.aatoken=this.aatoken;b.statement=this.st;b.statementLength=this.slen;b.pc=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.contextVariables=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.mustResumeEval=this.mustResumeEval;b.allowJSThreads=this.allowJSThreads;return b},"~S");d(c$,"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.debugScript||this.isCmdLine_c_or_C_Option)J.util.Logger.info("--<<-------------".substring(0,Math.max(17,this.scriptLevel+5))+this.scriptLevel+" "+this.scriptFileName+" "+(null==this.thisContext?"":""+this.thisContext.id))}},"~B,~B");d(c$,"restoreScriptContext",function(a,b,c,e){this.executing=!this.chk;if(null!=a){(this.debugScript||this.isCmdLine_c_or_C_Option)&&
J.util.Logger.info("--<<-------------".substring(0,Math.max(17,this.scriptLevel+5))+this.scriptLevel+" "+this.scriptFileName+" isPop "+b+" "+a.id);if(!c&&(this.st=a.statement,this.slen=a.statementLength,this.pc=a.pc,this.lineEnd=a.lineEnd,this.pcEnd=a.pcEnd,e))return;this.mustResumeEval=a.mustResumeEval;this.$script=a.script;this.lineNumbers=a.lineNumbers;this.lineIndices=a.lineIndices;this.aatoken=a.aatoken;this.contextVariables=a.contextVariables;this.scriptExtensions=a.scriptExtensions;b?(this.contextPath=
a.contextPath,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.$error=null!=a.errorType,this.errorMessage=a.errorMessage,this.errorMessageUntranslated=a.errorMessageUntranslated,this.iCommandError=a.iCommandError,this.errorType=
a.errorType)}},"J.script.ScriptContext,~B,~B,~B");d(c$,"getLinenumber",function(a){return null==a?this.lineNumbers[this.pc]:a.lineNumbers[a.pc]},"J.script.ScriptContext");n(c$,"setException",function(a,b,c){a.untranslated=null==c?b:c;this.errorType=b;this.iCommandError=this.pc;if(null==a.message)a.message="";else{for(c=J.script.ScriptEvaluator.getContextTrace(this.viewer,this.getScriptContext("setException"),null,!0).toString();null!=this.thisContext&&!this.thisContext.isTryCatch;)this.popContext(!1,
!1);a.message+=c;a.untranslated+=c;null!=this.thisContext||(this.chk||0<=b.indexOf("NOTE: file recognized as a script file: "))||(J.util.Logger.error("eval ERROR: "+this.toString()),this.viewer.autoExit&&this.viewer.exitJmol())}},"J.script.ScriptException,~S,~S");n(c$,"getErrorMessage",function(){return this.errorMessage});n(c$,"getErrorMessageUntranslated",function(){return null==this.errorMessageUntranslated?this.errorMessage:this.errorMessageUntranslated});d(c$,"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");d(c$,"planeExpected",function(){this.errorMore(38,"{a b c d}",'"xy" "xz" "yz" "x=..." "y=..." "z=..."',"$xxxxx")});d(c$,"integerOutOfRange",function(a,b){this.errorStr2(21,""+a,""+b)},"~N,~N");d(c$,"numberOutOfRange",function(a,b){this.errorStr2(36,""+a,""+b)},"~N,~N");d(c$,"errorAt",function(a,
b){this.iToken=b;this.errorOrWarn(a,null,null,null,!1)},"~N,~N");d(c$,"invArg",function(){this.error(22)});d(c$,"error",function(a){this.errorOrWarn(a,null,null,null,!1)},"~N");d(c$,"errorStr",function(a,b){this.errorOrWarn(a,b,null,null,!1)},"~N,~S");d(c$,"errorStr2",function(a,b,c){this.errorOrWarn(a,b,c,null,!1)},"~N,~S,~S");d(c$,"errorMore",function(a,b,c,e){this.errorOrWarn(a,b,c,e,!1)},"~N,~S,~S,~S");d(c$,"warning",function(a,b,c){this.errorOrWarn(a,b,c,null,!0)},"~N,~S,~S");d(c$,"errorOrWarn",
function(a,b,c,e,f){var d=this.ignoreError?null:J.script.ScriptEvaluator.errorString(a,b,c,e,!0);a=!this.ignoreError&&J.i18n.GT.getDoTranslate()?J.script.ScriptEvaluator.errorString(a,b,c,e,!1):null;f||this.evalError(d,a);this.showString(d)},"~N,~S,~S,~S,~B");d(c$,"evalError",function(a,b){if(this.ignoreError)throw new NullPointerException;this.chk||(this.setCursorWait(!1),this.viewer.setBooleanProperty("refreshing",!0),this.viewer.setStringProperty("_errormessage",b));throw new J.script.ScriptException(this,
a,b,!0);},"~S,~S");c$.errorString=d(c$,"errorString",function(a,b,c,e,f){e=!1;!f&&!0==(e=J.i18n.GT.getDoTranslate())&&J.i18n.GT.setDoTranslate(!1);switch(a){default:a="Unknown error message number: "+a;break;case 0:a=J.i18n.GT._("x y z axis expected");break;case 1:a=J.i18n.GT._("{0} not allowed with background model displayed");break;case 2:a=J.i18n.GT._("bad argument count");break;case 3:a=J.i18n.GT._("Miller indices cannot all be zero.");break;case 4:a=J.i18n.GT._("bad [R,G,B] color");break;case 5:a=
J.i18n.GT._("boolean expected");break;case 6:a=J.i18n.GT._("boolean or number expected");break;case 7:a=J.i18n.GT._("boolean, number, or {0} expected");break;case 56:a=J.i18n.GT._("cannot set value");break;case 8:a=J.i18n.GT._("color expected");break;case 9:a=J.i18n.GT._("a color or palette name (Jmol, Rasmol) is required");break;case 10:a=J.i18n.GT._("command expected");break;case 11:a=J.i18n.GT._("{x y z} or $name or (atom expression) required");break;case 12:a=J.i18n.GT._("draw object not defined");
break;case 13:a=J.i18n.GT._("unexpected end of script command");break;case 14:a=J.i18n.GT._("valid (atom expression) expected");break;case 15:a=J.i18n.GT._("(atom expression) or integer expected");break;case 16:a=J.i18n.GT._("filename expected");break;case 17:a=J.i18n.GT._("file not found");break;case 18:a=J.i18n.GT._("incompatible arguments");break;case 19:a=J.i18n.GT._("insufficient arguments");break;case 20:a=J.i18n.GT._("integer expected");break;case 21:a=J.i18n.GT._("integer out of range ({0} - {1})");
break;case 22:a=J.i18n.GT._("invalid argument");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} require 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 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.simpleReplace(a,"{0}",b),0<=a.indexOf("{1}")?a=JU.PT.simpleReplace(a,"{1}",c):null!=c&&(a+=": "+c),0<=a.indexOf("{2}")&&(a=JU.PT.simpleReplace(a,"{2}",c)));e&&J.i18n.GT.setDoTranslate(!0);return a},"~N,~S,~S,~S,~B");c$.getErrorLineMessage=d(c$,"getErrorLineMessage",function(a,b,c,e,f){var d="\n----";if(null!=b||null!=a)d+="line "+c+" command "+(e+1)+" of "+(null==
a?b:a.equals("try")?"try":"function "+a)+":";return d+("\n         "+f)},"~S,~S,~N,~N,~S");d(c$,"toString",function(){var a=new JU.SB;a.append("Eval\n pc:");a.appendI(this.pc);a.append("\n");a.appendI(this.aatoken.length);a.append(" statements\n");for(var b=0;b<this.aatoken.length;++b){a.append("----\n");for(var c=this.aatoken[b],e=0;e<c.length;++e)a.appendO(c[e]),a.appendC("\n");a.appendC("\n")}a.append("END\n");return a.toString()});c$.statementAsString=d(c$,"statementAsString",function(a,b,c,e){if(0==
b.length)return"";var f=new JU.SB,d=b[0].tok;switch(d){case 0:return b[0].value;case 1150985:if(2==b.length&&(135368713==b[1].tok||102436==b[1].tok))return b[1].value.toString()}for(var g=!0,h=!1,k=!1,d=1<b.length&&1085443==d&&b[0].value.equals("")&&(61==b[0].intValue||35==b[0].intValue)&&1048577!=b[1].tok,m=b.length,j=0;j<m;++j){var p=b[j];if(null==p){m=j;break}c==j-1&&f.append(" <<");0!=j&&f.appendC(" ");if(2==j&&d&&((d=269484436!=p.tok)||35==b[0].intValue))if(f.append(d?"= ":"== "),!d)continue;
c==j&&1048578!=p.tok&&f.append(">> ");switch(p.tok){case 1048577:g&&f.append("{");continue;case 1048578:k&&j==b.length-1&&(g=!1);g&&f.append("}");continue;case 269484096:case 269484097:break;case 1048586:case 1048590:h=1048586==p.tok;break;case 1060866:if(0<j&&p.value.equals("define")){f.append("@");j+1<b.length&&1048577==b[j+1].tok&&(g||(k=!0),g=!0);continue}break;case 1048589:f.append("true");continue;case 1048588:f.append("false");continue;case 135280132:break;case 2:f.appendI(p.intValue);continue;
case 8:case 9:case 10:f.append(J.script.SV.sValue(p));continue;case 7:case 6:f.append(p.escape());continue;case 5:f.appendC("^");continue;case 1048615:2147483647!=p.intValue?f.appendI(p.intValue):f.append(J.modelset.Group.getSeqcodeStringFor(J.script.ScriptEvaluator.getSeqCode(p))),p=b[++j],f.appendC(" "),f.append(h?"-":"- ");case 1048614:2147483647!=p.intValue?f.appendI(p.intValue):f.append(J.modelset.Group.getSeqcodeStringFor(J.script.ScriptEvaluator.getSeqCode(p)));continue;case 1048609:f.append("*:");
f.append(a.getChainIDStr(p.intValue));continue;case 1048607:f.append("*%");null!=p.value&&f.append(p.value.toString());continue;case 1048610:f.append("*/");case 1048611:case 3:2147483647>p.intValue?f.append(J.util.Escape.escapeModelFileNumber(p.intValue)):f.append(""+p.value);continue;case 1048613:f.appendC("[");f.append(J.modelset.Group.getGroup3For(p.intValue));f.appendC("]");continue;case 1048612:f.appendC("[");f.appendO(p.value);f.appendC("]");continue;case 1048608:f.append("*.");break;case 1095761925:if(r(p.value,
JU.P3)){p=p.value;f.append("cell=").append(J.util.Escape.eP(p));continue}break;case 4:f.append('"').appendO(p.value).append('"');continue;case 269484436:case 269484434:case 269484433:case 269484432:case 269484435:case 269484438:1716520985==p.intValue?f.append(b[++j].value).append(" "):2147483647!=p.intValue&&f.append(J.script.T.nameOf(p.intValue)).append(" ");break;case 364558:continue;case 1150985:f.append("end");continue;default:if(J.script.T.tokAttr(p.tok,1073741824)||!e)break;f.appendC("\n").append(p.toString()).appendC("\n");
continue}null!=p.value&&f.append(p.value.toString())}c>=m-1&&9999!=c&&f.append(" <<");return f.toString()},"J.viewer.Viewer,~A,~N,~B");d(c$,"getShapeProperty",function(a,b){return this.sm.getShapePropertyIndex(a,b,-2147483648)},"~N,~S");d(c$,"getShapePropertyData",function(a,b,c){return this.sm.getShapePropertyData(a,b,c)},"~N,~S,~A");d(c$,"setObjectMad",function(a,b,c){this.chk||this.viewer.setObjectMad(a,b,c)},"~N,~S,~N");d(c$,"setObjectArgb",function(a,b){this.chk||this.viewer.setObjectArgb(a,
b)},"~S,~N");d(c$,"setShapeProperty",function(a,b,c){this.chk||this.sm.setShapePropertyBs(a,b,c,null)},"~N,~S,~O");d(c$,"setShapePropertyBs",function(a,b,c,e){this.chk||this.sm.setShapePropertyBs(a,b,c,e)},"~N,~S,~O,JU.BS");d(c$,"setShapeSizeBs",function(a,b,c){this.chk||this.sm.setShapeSizeBs(a,b,null,c)},"~N,~N,JU.BS");d(c$,"setShapeSize",function(a,b){this.chk||this.sm.setShapeSizeBs(a,0,b,null)},"~N,J.atomdata.RadiusData");d(c$,"setBooleanProperty",function(a,b){this.chk||this.viewer.setBooleanProperty(a,
b)},"~S,~B");d(c$,"setIntProperty",function(a,b){this.chk||this.viewer.setIntProperty(a,b);return!0},"~S,~N");d(c$,"setFloatProperty",function(a,b){this.chk||this.viewer.setFloatProperty(a,b);return!0},"~S,~N");d(c$,"setStringProperty",function(a,b){this.chk||this.viewer.setStringProperty(a,b)},"~S,~S");d(c$,"showString",function(a){this.showStringPrint(a,!1)},"~S");d(c$,"showStringPrint",function(a,b){this.chk||null==a||(null!=this.outputBuffer?this.outputBuffer.append(a).appendC("\n"):this.viewer.showString(a,
b))},"~S,~B");d(c$,"scriptStatusOrBuffer",function(a){this.chk||(null!=this.outputBuffer?this.outputBuffer.append(a).appendC("\n"):this.viewer.scriptStatus(a))},"~S");d(c$,"atomExpressionAt",function(a){this.checkToken(a)||this.errorAt(2,a);return this.atomExpression(this.st,a,0,!0,!1,!0,!0)},"~N");d(c$,"atomExpression",function(a,b,c,e,f,d){this.isBondSet=!1;a!==this.st&&(this.tempStatement=this.st,this.st=a);var g=new J.script.ScriptMathProcessor(this,!1,!1,d),h,k=2147483647,m=!1;this.iToken=1E3;
var j=0>b,p=!1,K=0,n=this.viewer.getAtomCount();j&&(b=-b);j=(new Boolean(j|this.chk)).valueOf();0==c&&a.length>b&&(c=b+1);a:for(;b<c;++b){this.iToken=b;k=a[b];if(null==k)break;var q=k.value;switch(k.tok){case 1048577:c=a.length;K++;break;case 1048578:K--;if(0<K)continue;break a;case 1048586:if(this.isPoint3f(b)&&(q=this.getPoint3f(b,!0),null!=q)){g.addXPt(q);b=this.iToken;break}break;case 1048590:0<b&&1048586==a[b-1].tok&&g.addXBs(new JU.BS);break;case 269484096:p=!0;g.addOp(k);break;case 269484097:p=
!1;g.addOp(k);break;case 1060866:g.addXBs(this.getAtomBitSet(q));break;case 135267841:g.addXVar(J.script.SV.newT(k));g.addXVar(J.script.SV.newV(9,this.hklParameter(b+2)));b=this.iToken;break;case 135266319:g.addXVar(J.script.SV.newT(k));g.addXVar(J.script.SV.newV(9,this.planeParameter(b+2)));b=this.iToken;break;case 1048582:g.addXVar(J.script.SV.newT(k));g.addXPt(this.getPoint3f(b+2,!0));b=this.iToken;break;case 4:if(0==q.indexOf("({")&&(h=J.util.Escape.uB(q),null!=h)){g.addXBs(h);break}g.addXVar(J.script.SV.newT(k));
q.equals("hkl")&&(g.addXVar(J.script.SV.newV(9,this.hklParameter(b+2))),b=this.iToken);break;case 135267336:case 135267335:case 1238369286:case 135266325:case 135402505:case 135266310:case 269484080:g.addOp(k);break;case 1048579:g.addXBs(this.viewer.getAllAtoms());break;case 1048587:g.addXBs(new JU.BS);break;case 1048589:case 1048588:g.addXVar(J.script.SV.newT(k));break;case 1114638363:g.addXBs(J.util.BSUtil.copy(this.viewer.getSelectionSet(!1)));break;case 3145770:g.addXBs(J.util.BSUtil.copy(this.viewer.getHiddenSet()));
break;case 1060869:g.addXBs(J.util.BSUtil.copy(this.viewer.getMotionFixedAtoms()));break;case 3145768:g.addXBs(J.util.BSUtil.copyInvert(this.viewer.getHiddenSet(),n));break;case 3145776:g.addXBs(this.viewer.getBaseModelBitSet());break;case 3145774:!this.chk&&!m&&this.viewer.setModelVisibility();m=!0;g.addXBs(this.viewer.getVisibleSet());break;case 3145766:!this.chk&&e&&this.refresh();g.addXBs(this.viewer.getClickableSet());break;case 1048608:this.viewer.allowSpecAtom()?(h=k.intValue,0<h?g.addXBs(this.compareInt(1095761922,
269484436,h)):g.addXBs(this.getAtomBits(k.tok,q))):g.addXBs(this.lookupIdentifierValue("_"+q));break;case 3145764:case 3145732:case 1613758470:case 1048585:case 3145742:case 3145744:case 3145746:case 3145748:case 3145750:case 1048612:case 1048607:case 3145772:case 1089470478:case 3145778:case 1614417948:g.addXBs(this.getAtomBits(k.tok,q));break;case 1048610:case 1048611:h=k.intValue;if(2147483647==h&&r(q,Integer)){h=q.intValue();if(!this.viewer.haveFileSet()){g.addXBs(this.getAtomBits(1048610,Integer.$valueOf(h)));
break}2147>=h&&(h*=1E6)}g.addXBs(this.bitSetForModelFileNumber(h));break;case 1048613:case 1048609:g.addXBs(this.getAtomBits(k.tok,Integer.$valueOf(k.intValue)));break;case 1048614:p?g.addXNum(J.script.SV.newI(k.intValue)):g.addXBs(this.getAtomBits(1048614,Integer.$valueOf(J.script.ScriptEvaluator.getSeqCode(k))));break;case 1048615:if(p){g.addXNum(J.script.SV.newI(k.intValue));g.addOp(J.script.T.tokenMinus);g.addXNum(J.script.SV.newI(a[++b].intValue));break}q=b+3<a.length&&269484160==a[b+2].tok&&
1048609==a[b+3].tok?a[b+3].intValue:-1;g.addXBs(this.getAtomBits(1048615,[J.script.ScriptEvaluator.getSeqCode(k),J.script.ScriptEvaluator.getSeqCode(a[++b]),q]));-1!=q&&(b+=2);break;case 1095761926:case 1095761925:g.addXBs(this.getAtomBits(k.tok,[G(Math.floor(1E3*q.x)),G(Math.floor(1E3*q.y)),G(Math.floor(1E3*q.z))]));break;case 3145758:g.addXBs(this.viewer.getModelUndeletedAtomsBitSet(this.viewer.getCurrentModelIndex()));break;case 1613758476:case 3145730:case 1115297793:case 1613758488:case 137363468:case 3145735:case 3145736:case 3145738:case 3145754:case 3145756:g.addXBs(this.lookupIdentifierValue(q));
break;case 269484435:case 269484434:case 269484433:case 269484432:case 269484436:case 269484438:b+1==a.length&&this.invArg();h=a[++b].value;var x=k.tok,u=k.intValue,v=1716520985==u?h:null;null!=v&&(b+1==a.length&&this.invArg(),h=a[++b].value);1095766024==u&&269484436!=x&&this.invArg();if(this.chk){g.addXBs(new JU.BS);break}var t=1095766030==u,w=J.script.T.tokAttr(u,1095761920),s=J.script.T.tokAttr(u,1112539136),y=w&&s,A=!w&&J.script.T.tokAttr(u,1087373312);1087375365==u&&(w=!(A=!1));var B=a[b].tok,
k=a[b].intValue,C=NaN;r(h,JU.P3)?1766856708==u&&(k=JU.CU.colorPtToFFRGB(h),B=2,w=!0):r(h,String)&&(1766856708==u?(k=JU.CU.getArgbFromString(h),0==k&&J.script.T.tokAttr(B,1073741824)&&(h=this.getStringParameter(h,!0),h.startsWith("{")?(h=J.util.Escape.uP(h),k=r(h,JU.P3)?JU.CU.colorPtToFFRGB(h):0):k=JU.CU.getArgbFromString(h)),B=2,w=!0):A?J.script.T.tokAttr(B,1073741824)&&(h=this.getStringParameter(h,!0)):(J.script.T.tokAttr(B,1073741824)&&(h=this.getNumericParameter(h)),r(h,String)&&(1641025539==u||
1238369286==u||1087375365==u?A=!(w=2147483647!=k):h=J.script.SV.nValue(a[b])),r(h,Integer)?C=k=h.intValue():r(h,Float)&&t&&(k=J.modelset.ModelCollection.modelFileNumberFromFloat(h.floatValue()))));A&&!r(h,String)&&(h=""+h);r(h,Integer)||2==B?t?1E6<=k&&(u=-1095766030):y||s&&(C=k):r(h,Float)?t?u=-1095766030:(C=h.floatValue(),y?w=!1:w&&(k=z(C))):A||(this.iToken++,this.invArg());t&&(1E6<=k&&0==k%1E6)&&(k/=1E6,u=1229984263);if(-1095766030==u&&269484436==x){g.addXBs(this.bitSetForModelFileNumber(k));break}null!=
q&&0<=q.indexOf("-")&&(w?k=-k:Float.isNaN(C)||(C=-C));q=1716520985==u?this.viewer.getDataFloat(v):null;g.addXBs(w?this.compareInt(u,x,k):A?this.compareString(u,x,h):this.compareFloatData(u,q,x,C));break;case 3:case 2:g.addXNum(J.script.SV.newT(k));break;case 10:q=J.util.BSUtil.copy(q);g.addXBs(q);break;case 8:g.addXPt(q);break;default:if(J.script.T.tokAttr(k.tok,269484032)){g.addOp(k)||this.invArg();break}if(!r(q,String)){g.addXObj(q);break}h=this.getParameter(q,0);if(p){g.addXObj(h);break}r(h,String)&&
(h=this.getStringObjectAsVariable(h,null));r(h,JU.List)&&(h=J.script.SV.unEscapeBitSetArray(h,!0),h=null==h?q:h);r(h,String)&&(h=this.lookupIdentifierValue(q));g.addXObj(h)}}this.expressionResult=g.getResult(f);if(null==this.expressionResult){if(f)return null;this.chk||g.dumpStacks("after getResult");this.error(13)}this.expressionResult=this.expressionResult.value;if(r(this.expressionResult,String)&&(d||this.expressionResult.startsWith("({")))this.expressionResult=this.chk?new JU.BS:this.getAtomBitSet(this.expressionResult);
if(!d&&!r(this.expressionResult,JU.BS))return null;h=r(this.expressionResult,JU.BS)?this.expressionResult:new JU.BS;this.isBondSet=r(this.expressionResult,J.modelset.BondSet);this.isBondSet||(this.viewer.excludeAtoms(h,j),h.length()>this.viewer.getAtomCount()&&h.clearAll());null!=this.tempStatement&&(this.st=this.tempStatement,this.tempStatement=null);return h},"~A,~N,~N,~B,~B,~B,~B");d(c$,"compareFloatData",function(a,b,c,e){var f=new JU.BS,d=this.viewer.getAtomCount(),g=this.viewer.modelSet.atoms,
h=0;for(this.viewer.autoCalculate(a);0<=--d;){h=!1;switch(a){default:h=J.modelset.Atom.atomPropertyFloat(this.viewer,g[d],a);break;case 1716520985:if(null==b||b.length<=d)continue;h=b[d]}(h=J.script.ScriptEvaluator.compareFloat(c,h,e))&&f.set(d)}return f},"~N,~A,~N,~N");d(c$,"compareString",function(a,b,c){var e=new JU.BS,f=this.viewer.modelSet.atoms,d=this.viewer.getAtomCount(),g=1087373316==a&&this.viewer.getBoolean(603979822);for(g||(c=c.toLowerCase());0<=--d;){var h=J.modelset.Atom.atomPropertyString(this.viewer,
f[d],a);g||(h=h.toLowerCase());this.compareStringValues(b,h,c)&&e.set(d)}return e},"~N,~N,~S");d(c$,"compareInt",function(a,b,c){var e=2147483647,f=null,d=b,g=c,h=this.viewer.getAtomCount(),k=this.viewer.modelSet,m=k.atoms,j=-1,p=0,K=-1,r=null,q=0,n;switch(a){case 1297090050:switch(d){case 269484433:case 269484432:j=2147483647}break;case 1095761923:try{switch(b){case 269484435:return J.util.BSUtil.newBitSet2(0,c);case 269484434:return J.util.BSUtil.newBitSet2(0,c+1);case 269484433:return J.util.BSUtil.newBitSet2(c,
h);case 269484432:return J.util.BSUtil.newBitSet2(c+1,h);case 269484436:return c<h?J.util.BSUtil.newBitSet2(c,c+1):new JU.BS;default:return n=J.util.BSUtil.setAll(h),0<=c&&n.clear(c),n}}catch(u){if(B(u,Exception))return new JU.BS;throw u;}}n=J.util.BSUtil.newBitSet(h);for(var v=0;v<h;++v){var t=!1,w=m[v];switch(a){default:e=J.modelset.Atom.atomPropertyInt(w,a);break;case 1095766024:return J.util.BSUtil.copy(this.viewer.getConformation(-1,c-1,!1));case 1297090050:f=w.getAtomSymmetry();if(null==f)continue;
w.getModelIndex()!=K&&(K=w.getModelIndex(),r=k.getModelCellRange(K),q=k.getModelSymmetryCount(K));if(200<=g){if(null==r)continue;c=g%1E3;var s=G(g/1E3)-1;if(0>s)t=!0;else if(0==q||0<=s&&!(t=f.get(s)))continue;d=1048587;e=0>s?w.getCellTranslation(c,r,q):w.getSymmetryTranslation(s,r,q)}else if(0<q){if(c>q&&269484435!=d&&269484434!=d)continue;if(269484438==d){0<c&&(c<=q&&!f.get(c))&&n.set(v);continue}}switch(d){case 269484435:j=c-1;break;case 269484434:j=c;break;case 269484433:p=c-1;break;case 269484432:p=
c;break;case 269484436:j=c;p=c-1;break;case 269484438:t=!f.get(c)}0>p&&(p=0);p<j&&(f=f.nextSetBit(p),0<=f&&f<j&&(t=!0));if(!t||2147483647==e)b=1048587}switch(b){case 269484435:t=e<c;break;case 269484434:t=e<=c;break;case 269484433:t=e>=c;break;case 269484432:t=e>c;break;case 269484436:t=e==c;break;case 269484438:t=e!=c}t&&n.set(v)}return n},"~N,~N,~N");d(c$,"compareStringValues",function(a,b,c){switch(a){case 269484436:case 269484438:return J.util.Txt.isMatch(b,c,!0,!0)==(269484436==a);default:this.invArg()}return!1},
"~N,~S,~S");c$.compareFloat=d(c$,"compareFloat",function(a,b,c){switch(a){case 269484435:return b<c;case 269484434:return b<=c;case 269484433:return b>=c;case 269484432:return b>c;case 269484436:return b==c;case 269484438:return b!=c}return!1},"~N,~N,~N");d(c$,"getAtomBits",function(a,b){return this.chk?new JU.BS:this.viewer.getAtomBits(a,b)},"~N,~O");c$.getSeqCode=d(c$,"getSeqCode",function(a){return 2147483647==a.intValue?a.value.intValue():J.modelset.Group.getSeqcodeFor(a.intValue," ")},"J.script.T");
d(c$,"checkLast",function(a){return this.checkLength(a+1)-1},"~N");d(c$,"checkLength",function(a){if(0<=a)return this.checkLengthErrorPt(a,0);this.slen>-a&&(this.iToken=-a,this.error(2));return this.slen},"~N");d(c$,"checkLengthErrorPt",function(a,b){this.slen!=a&&(this.iToken=0<b?b:this.slen,this.error(0<b?22:2));return this.slen},"~N,~N");d(c$,"checkLength23",function(){this.iToken=this.slen;2!=this.slen&&3!=this.slen&&this.error(2);return this.slen});d(c$,"checkLength34",function(){this.iToken=
this.slen;3!=this.slen&&4!=this.slen&&this.error(2);return this.slen});d(c$,"getToken",function(a){this.checkToken(a)||this.error(13);this.theToken=this.st[a];this.theTok=this.theToken.tok;return this.theToken},"~N");d(c$,"tokAt",function(a){return a<this.slen&&null!=this.st[a]?this.st[a].tok:0},"~N");d(c$,"checkToken",function(a){return(this.iToken=a)<this.slen},"~N");d(c$,"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=
J.script.ScriptEvaluator.getFloatEncodedInt(this.stringParameter(a));break;default:this.invArg()}return this.viewer.getModelNumberIndex(b,c,!0)},"~N");d(c$,"optParameterAsString",function(a){return a>=this.slen?"":this.parameterAsString(a)},"~N");d(c$,"parameterAsString",function(a){this.getToken(a);null==this.theToken&&this.error(13);return J.script.SV.sValue(this.theToken)},"~N");d(c$,"intParameter",function(a){if(this.checkToken(a)&&2==this.getToken(a).tok)return this.theToken.intValue;this.error(20);
return 0},"~N");d(c$,"intParameterRange",function(a,b,c){a=this.intParameter(a);(a<b||a>c)&&this.integerOutOfRange(b,c);return a},"~N,~N,~N");d(c$,"isFloatParameter",function(a){switch(this.tokAt(a)){case 2:case 3:return!0}return!1},"~N");d(c$,"floatParameterRange",function(a,b,c){a=this.floatParameter(a);(a<b||a>c)&&this.numberOutOfRange(b,c);return a},"~N,~N,~N");d(c$,"floatParameter",function(a){if(this.checkToken(a))switch(this.getToken(a),this.theTok){case 1048615:return-this.theToken.intValue;
case 1048614:case 2:return this.theToken.intValue;case 1048611:case 3:return this.theToken.value.floatValue()}this.error(34);return 0},"~N");d(c$,"listParameter",function(a,b,c){var e=new JU.List,f;f=this.tokAt(a);1073742195==f&&(f=this.tokAt(++a));var d=1048586==f,g=269484096==f;(d||g)&&a++;for(var h=0;h<c;){f=this.tokAt(a);if(d&&1048590==f||g&&269484097==f)break;switch(f){case 269484080:case 1048586:case 1048590:break;case 4:break;case 8:f=this.getPoint3f(a,!1);e.addLast(Float.$valueOf(f.x));e.addLast(Float.$valueOf(f.y));
e.addLast(Float.$valueOf(f.z));h+=3;break;case 9:f=this.getPoint4f(a);e.addLast(Float.$valueOf(f.x));e.addLast(Float.$valueOf(f.y));e.addLast(Float.$valueOf(f.z));e.addLast(Float.$valueOf(f.w));h+=4;break;default:e.addLast(Float.$valueOf(this.floatParameter(a))),h++,h==c&&(g&&1048590==this.tokAt(a+1))&&a++}a++}(d&&1048590!=this.tokAt(a++)||g&&269484097!=this.tokAt(a++)||h<b||h>c)&&this.invArg();this.iToken=a-1;return e},"~N,~N,~N");d(c$,"floatParameterSet",function(a,b,c){var e=null,f=null,d=0,d=
null;this.iToken=a;switch(this.tokAt(a)){case 4:d=J.script.SV.sValue(this.st[a]);d=JU.PT.replaceAllCharacter(d,"{},[]\"'"," ");f=JU.PT.parseFloatArray(d);d=f.length;break;case 7:f=J.script.SV.flistValue(this.st[a],0);d=f.length;break;default:e=this.listParameter(a,b,c),d=e.size()}(d<b||d>c)&&this.invArg();if(null==f){f=O(d,0);for(a=0;a<d;a++)f[a]=e.get(a).floatValue()}return f},"~N,~N,~N");d(c$,"isArrayParameter",function(a){switch(this.tokAt(a)){case 7:case 11:case 12:case 1073742195:case 269484096:return!0}return!1},
"~N");d(c$,"getPointArray",function(a,b){var c=0>b?null:Array(b),e=0>b?new JU.List:null,f=0>a?7:this.getToken(a++).tok;switch(f){case 7:e=this.theToken.getList();0<=b&&e.size()!=b&&this.invArg();b=e.size();null==c&&(c=Array(b));for(f=0;f<b;f++)null==(c[f]=J.script.SV.ptValue(e.get(f)))&&this.invArg();return c;case 1073742195:f=this.tokAt(a++)}269484096!=f&&this.invArg();for(var d=0;269484097!=f&&0!=f;)switch(f=this.getToken(a).tok,f){case 0:case 269484097:break;case 269484080:a++;break;default:if(0<=
b&&d==b){f=0;break}var g=this.getPoint3f(a,!0);null==c?e.addLast(g):c[d]=g;d++;a=this.iToken+1}269484097!=f&&this.invArg();null==c&&(c=e.toArray(Array(e.size())));return c},"~N,~N");d(c$,"stringParameter",function(a){(!this.checkToken(a)||4!=this.getToken(a).tok)&&this.error(41);return this.theToken.value},"~N");d(c$,"stringParameterSet",function(a){switch(this.tokAt(a)){case 4:var b=this.stringParameter(a);return b.startsWith('["')&&(a=this.viewer.evaluateExpression(b),r(a,String))?JU.PT.split(a,
"\n"):[b];case 1073742195:a+=2;break;case 269484096:++a;break;case 7:return J.script.SV.listValue(this.getToken(a));default:this.invArg()}for(var c,b=new JU.List;269484097!=(c=this.tokAt(a));){switch(c){case 269484080:break;case 4:b.addLast(this.stringParameter(a));break;default:case 0:this.invArg()}a++}this.iToken=a;a=b.size();c=Array(a);for(var e=0;e<a;e++)c[e]=b.get(e);return c},"~N");d(c$,"objectNameParameter",function(a){this.checkToken(a)||this.error(37);return this.parameterAsString(a)},"~N");
d(c$,"booleanParameter",function(a){if(this.slen==a)return!0;switch(this.getToken(this.checkLast(a)).tok){case 1048589:return!0;case 1048588:break;default:this.error(5)}return!1},"~N");d(c$,"atomCenterOrCoordinateParameter",function(a){switch(this.getToken(a).tok){case 10:case 1048577:a=this.atomExpression(this.st,a,0,!0,!1,!1,!0);if(null!=a&&1==a.cardinality())return this.viewer.getAtomPoint3f(a.nextSetBit(0));if(null!=a)return this.viewer.getAtomSetCenter(a);if(r(this.expressionResult,JU.P3))return this.expressionResult;
this.invArg();break;case 1048586:case 8:return this.getPoint3f(a,!0)}this.invArg();return null},"~N");d(c$,"isCenterParameter",function(a){a=this.tokAt(a);return 1048583==a||1048586==a||1048577==a||8==a||10==a},"~N");d(c$,"centerParameter",function(a){return this.centerParameterForModel(a,-2147483648)},"~N");d(c$,"centerParameterForModel",function(a,b){var c=null;this.expressionResult=null;if(this.checkToken(a))switch(this.getToken(a).tok){case 1048583:var e=this.objectNameParameter(++a),c=-2147483648;
269484096==this.tokAt(a+1)&&(c=this.parameterExpressionList(-a-1,-1,!0).get(0).asInt(),269484097!=this.getToken(--this.iToken).tok&&this.invArg());if(this.chk)return new JU.P3;if(1048584==this.tokAt(a+1)&&(1141899267==this.tokAt(a+2)||1141899270==this.tokAt(a+2)))c=2147483647,this.iToken=a+2;null==(c=this.getObjectCenter(e,c,b))&&this.errorStr(12,e);break;case 10:case 1048577:case 1048586:case 8:c=this.atomCenterOrCoordinateParameter(a)}null==c&&this.error(11);return c},"~N,~N");d(c$,"planeParameter",
function(a){var b=new JU.V3,c=new JU.V3,e=null,f=269484192==this.tokAt(a);f&&a++;if(a<this.slen)switch(this.getToken(a).tok){case 9:e=JU.P4.newPt(this.theToken.value);break;case 1048583:a=this.objectNameParameter(++a);if(this.chk)return new JU.P4;switch(this.sm.getShapeIdFromObjectName(a)){case 22:this.setShapeProperty(22,"thisID",a);a=this.getShapeProperty(22,"vertices");if(null==a||3>a.length||null==a[0]||null==a[1]||null==a[2])break;J.util.Measure.getPlaneThroughPoints(a[0],a[1],a[2],new JU.V3,
b,c,e=new JU.P4);break;case 24:this.setShapeProperty(24,"thisID",a),e=this.getShapeProperty(24,"plane")}break;case 1112541205:(!this.checkToken(++a)||269484436!=this.getToken(a++).tok)&&this.evalError("x=?",null);e=JU.P4.new4(1,0,0,-this.floatParameter(a));break;case 1112541206:(!this.checkToken(++a)||269484436!=this.getToken(a++).tok)&&this.evalError("y=?",null);e=JU.P4.new4(0,1,0,-this.floatParameter(a));break;case 1112541207:(!this.checkToken(++a)||269484436!=this.getToken(a++).tok)&&this.evalError("z=?",
null);e=JU.P4.new4(0,0,1,-this.floatParameter(a));break;case 1073741824:case 4:b=this.parameterAsString(a);if(b.equalsIgnoreCase("xy"))return JU.P4.new4(0,0,1,0);if(b.equalsIgnoreCase("xz"))return JU.P4.new4(0,1,0,0);if(b.equalsIgnoreCase("yz"))return JU.P4.new4(1,0,0,0);this.iToken+=2;break;case 1048586:if(!this.isPoint3f(a)){e=this.getPoint4f(a);break}case 10:case 1048577:a=this.atomCenterOrCoordinateParameter(a);269484080==this.getToken(++this.iToken).tok&&++this.iToken;var d=this.atomCenterOrCoordinateParameter(this.iToken);
269484080==this.getToken(++this.iToken).tok&&++this.iToken;var g=this.atomCenterOrCoordinateParameter(this.iToken),h=new JU.V3,b=J.util.Measure.getNormalThroughPoints(a,d,g,h,b,c),e=new JU.P4;e.set(h.x,h.y,h.z,b);!this.chk&&J.util.Logger.debugging&&J.util.Logger.debug("points: "+a+d+g+" defined plane: "+e)}null==e&&this.planeExpected();f&&e.scale(-1);return e},"~N");d(c$,"hklParameter",function(a){!this.chk&&null==this.viewer.getCurrentUnitCell()&&this.error(33);a=this.getPointOrPlane(a,!1,!0,!1,
!0,3,3);a=this.getHklPlane(a);null==a&&this.error(3);!this.chk&&J.util.Logger.debugging&&J.util.Logger.debug("defined plane: "+a);return a},"~N");d(c$,"getHklPlane",function(a){var b=new JU.V3,c=new JU.V3,e=JU.P3.new3(0==a.x?1:1/a.x,0,0),f=JU.P3.new3(0,0==a.y?1:1/a.y,0),d=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?(e.set(1,0,d.z),f.set(0,1,d.z)):0==a.y&&0==a.z?(f.set(e.x,0,1),d.set(e.x,1,0)):0==a.z&&0==a.x?(d.set(0,f.y,1),e.set(1,f.y,0)):0==a.x?e.set(1,f.y,
0):0==a.y?f.set(0,1,d.z):0==a.z&&d.set(e.x,0,1);this.viewer.toCartesian(e,!1);this.viewer.toCartesian(f,!1);this.viewer.toCartesian(d,!1);a=new JU.V3;b=J.util.Measure.getNormalThroughPoints(e,f,d,a,b,c);c=new JU.P4;c.set(a.x,a.y,a.z,b);return c},"JU.P3");d(c$,"getMadParameter",function(){var a=1;switch(this.getToken(1).tok){case 1073742072:this.restrictSelected(!1,!1);break;case 1048589:break;case 1048588:a=0;break;case 2:a=8*this.intParameterRange(1,0,750);break;case 3:a=G(Math.floor(2E3*this.floatParameterRange(1,
-3,3)));0>a&&(this.restrictSelected(!1,!1),a=-a);break;default:this.error(6)}return a});d(c$,"getSetAxesTypeMad",function(a){if(a==this.slen)return 1;switch(this.getToken(this.checkLast(a)).tok){case 1048589:return 1;case 1048588:return 0;case 1073741926:return-1;case 2:return this.intParameterRange(a,-1,19);case 3:return a=this.floatParameterRange(a,0,2),G(Math.floor(2E3*a))}this.errorStr(7,'"DOTTED"');return 0},"~N");d(c$,"isColorParam",function(a){var b=this.tokAt(a);return 570425378==b||1073742195==
b||269484096==b||7==b||8==b||this.isPoint3f(a)||(4==b||J.script.T.tokAttr(b,1073741824))&&0!=JU.CU.getArgbFromString(this.st[a].value)},"~N");d(c$,"getArgbParam",function(a){return this.getArgbParamOrNone(a,!1)},"~N");d(c$,"getArgbParamLast",function(a,b){var c=this.getArgbParamOrNone(a,b);this.checkLast(this.iToken);return c},"~N,~B");d(c$,"getArgbParamOrNone",function(a,b){var c=null;if(this.checkToken(a))switch(this.getToken(a).tok){default:if(!J.script.T.tokAttr(this.theTok,1073741824))break;
case 570425378:case 4:return JU.CU.getArgbFromString(this.parameterAsString(a));case 1073742195:return this.getColorTriad(a+2);case 269484096:return this.getColorTriad(++a);case 7:var e=J.script.SV.flistValue(this.theToken,3);null!=e&&3!=e.length&&(c=JU.P3.new3(e[0],e[1],e[2]));break;case 8:c=this.theToken.value;break;case 1048586:c=this.getPoint3f(a,!1);break;case 1048587:if(b)return 0}null==c&&this.error(8);return JU.CU.colorPtToFFRGB(c)},"~N,~B");d(c$,"getColorTriad",function(a){var b=O(3,0),c=
0,e="";this.getToken(a);var f=null,d=0;a:switch(this.theTok){case 2:case 1048614:case 3:for(;a<this.slen;a++){switch(this.getToken(a).tok){case 269484080:continue;case 1073741824:(1!=c||0!=b[0])&&this.error(4);e="0"+this.parameterAsString(a);break a;case 3:2<c&&this.error(4);d=this.floatParameter(a);break;case 2:2<c&&this.error(4);d=this.theToken.intValue;break;case 1048614:2<c&&this.error(4);d=this.theToken.value.intValue()%256;break;case 269484097:3!=c&&this.error(4);--a;f=JU.P3.new3(b[0],b[1],
b[2]);break a;default:this.error(4)}b[c++]=d}this.error(4);break;case 8:f=this.theToken.value;break;case 1073741824:e=this.parameterAsString(a);break;default:this.error(4)}269484097!=this.getToken(++a).tok&&this.error(4);if(null!=f)return JU.CU.colorPtToFFRGB(f);0==(c=JU.CU.getArgbFromString("["+e+"]"))&&this.error(4);return c},"~N");d(c$,"isPoint3f",function(a){var b;if((b=8==this.tokAt(a))||9==this.tokAt(a)||this.isFloatParameter(a+1)&&this.isFloatParameter(a+2)&&this.isFloatParameter(a+3)&&this.isFloatParameter(a+
4))return b;this.ignoreError=!0;var c=this.iToken;b=!0;try{this.getPoint3f(a,!0)}catch(e){if(B(e,Exception))b=!1;else throw e;}this.ignoreError=!1;this.iToken=c;return b},"~N");d(c$,"getPoint3f",function(a,b){return this.getPointOrPlane(a,!1,b,!0,!1,3,3)},"~N,~B");d(c$,"getPoint4f",function(a){return this.getPointOrPlane(a,!1,!1,!1,!1,4,4)},"~N");d(c$,"getPointOrPlane",function(a,b,c,e,f,d,g){var h=O(6,0),k=0;this.coordinatesAreFractional=f;if(8==this.tokAt(a)){if(3>=d&&3<=g)return this.getToken(a).value;
this.invArg()}if(9==this.tokAt(a)){if(4>=d&&4<=g)return this.getToken(a).value;this.invArg()}f=1;a:for(;a<this.st.length;a++)switch(this.getToken(a).tok){case 1048586:case 269484080:case 269484128:case 269484160:break;case 1048590:break a;case 269484192:f=-1;break;case 1048615:6==k&&this.invArg();h[k++]=this.theToken.intValue;f=-1;break;case 2:case 1048614:6==k&&this.invArg();h[k++]=this.theToken.intValue*f;f=1;break;case 269484208:case 1048610:c||this.invArg();269484208==this.theTok&&this.getToken(++a);
k--;(0>k||b)&&this.invArg();r(this.theToken.value,Integer)||2==this.theTok?h[k++]/=2147483647==this.theToken.intValue?this.theToken.value.intValue():this.theToken.intValue:r(this.theToken.value,Float)&&(h[k++]/=this.theToken.value.floatValue());this.coordinatesAreFractional=!0;break;case 1048609:case 1073741824:h[k++]=NaN;break;case 3:case 1048611:b&&this.invArg();6==k&&this.invArg();h[k++]=this.theToken.value.floatValue();break;default:this.invArg()}(k<d||k>g)&&this.invArg();return 3==k?(b=JU.P3.new3(h[0],
h[1],h[2]),this.coordinatesAreFractional&&e&&(this.fractionalPoint=JU.P3.newP(b),this.chk||this.viewer.toCartesian(b,!this.viewer.getBoolean(603979848))),b):4==k?(this.coordinatesAreFractional&&this.invArg(),JU.P4.new4(h[0],h[1],h[2],h[3])):h},"~N,~B,~B,~B,~B,~N,~N");d(c$,"xypParameter",function(a){var b=this.tokAt(a);1073742195==b&&(b=this.tokAt(++a));if(269484096!=b||!this.isFloatParameter(++a))return null;b=new JU.P3;b.x=this.floatParameter(a);269484080==this.tokAt(++a)&&a++;if(!this.isFloatParameter(a))return null;
b.y=this.floatParameter(a);var c=269484210==this.tokAt(++a);c&&++a;if(269484097!=this.tokAt(a))return null;this.iToken=a;b.z=3.4028235E38*(c?-1:1);return b},"~N");d(c$,"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");d(c$,"checkContinue",function(){if(this.executionStopped)return!1;if(this.executionStepping&&this.isCommandDisplayable(this.pc))this.viewer.setScriptStatus("Next: "+this.getNextStatement(),
"stepping -- type RESUME to continue",0,null),this.executionPaused=!0;else if(!this.executionPaused)return!0;J.util.Logger.debugging&&J.util.Logger.debug("script execution paused at command "+(this.pc+1)+" level "+this.scriptLevel+": "+this.thisCommand);for(this.refresh();this.executionPaused;){this.viewer.popHoldRepaint("pause \u0001## REPAINT_IGNORE ##");var a=this.viewer.getInsertedCommand();if(0<a.length){this.resumePausedExecution();this.setErrorMessage(null);var b=this.getScriptContext("script insertion");
this.pc--;try{this.runScript(a)}catch(c){if(B(c,Exception))this.setErrorMessage(""+c);else if(B(c,Error))this.setErrorMessage(""+c);else throw c;}this.$error&&(this.scriptStatusOrBuffer(this.errorMessage),this.setErrorMessage(null));this.restoreScriptContext(b,!0,!1,!1);this.pauseExecution(!1)}this.doDelay(-100);this.viewer.pushHoldRepaintWhy("pause")}this.notifyResumeStatus();return!this.$error&&!this.executionStopped});n(c$,"notifyResumeStatus",function(){!this.chk&&(!this.executionStopped&&!this.executionStepping)&&
this.viewer.scriptStatus("script execution "+(this.$error||this.executionStopped?"interrupted":"resumed"));J.util.Logger.debugging&&J.util.Logger.debug("script execution resumed")});d(c$,"doDelay",function(a){if(this.useThreads()){if(this.isJS&&this.allowJSThreads)throw new J.script.ScriptInterruption(this,"delay",a);this.delayScript(a)}},"~N");d(c$,"dispatchCommands",function(a,b){null==this.sm&&(this.sm=this.viewer.getShapeManager());this.debugScript=this.logMessages=!1;this.chk||this.setDebugging();
0==this.pcEnd&&(this.pcEnd=2147483647);0==this.lineEnd&&(this.lineEnd=2147483647);if(null==this.aatoken)return!0;this.commandLoop(b);if(this.chk)return!0;var c=this.viewer.getInsertedCommand();"".equals(c)?a&&(this.debugScript&&this.viewer.getBoolean(603979880))&&this.viewer.scriptStatus("script <exiting>"):this.runScriptBuffer(c,null);return!this.isJS||!this.allowJSThreads||b?!0:this.mustResumeEval||null==this.thisContext?(c=null==this.thisContext,this.resumeEval(this.thisContext),this.mustResumeEval=
!1,c):!0},"~B,~B");d(c$,"commandLoop",function(a){for(var b="",c=!1,e=null,f=System.currentTimeMillis();this.pc<this.aatoken.length&&this.pc<this.pcEnd;this.pc++){!this.chk&&(this.isJS&&this.useThreads()&&!a)&&(!this.executionPaused&&1E3<System.currentTimeMillis()-f&&(this.pc--,this.doDelay(-1)),f=System.currentTimeMillis());if(!this.chk&&!this.checkContinue())break;if(this.lineNumbers[this.pc]>this.lineEnd)break;if(this.logMessages){var d=0,d=System.currentTimeMillis();this.viewer.scriptStatus("Eval.dispatchCommands():"+
d);this.viewer.scriptStatus(this.$script)}this.debugScript&&!this.chk&&J.util.Logger.info("Command "+this.pc);this.theToken=0==this.aatoken[this.pc].length?null:this.aatoken[this.pc][0];if(!this.historyDisabled&&(!this.chk&&this.scriptLevel<=this.commandHistoryLevelMax&&!this.tQuiet)&&(d=this.getCommand(this.pc,!0,!0),null!=this.theToken&&0<d.length&&!d.equals(b)&&(135368713==this.theToken.tok||102436==this.theToken.tok||!J.script.T.tokAttr(this.theToken.tok,102400))))this.viewer.addCommand(b=d);
this.chk||(d=this.viewer.getInsertedCommand(),"".equals(d)||this.runScript(d));if(this.setStatement(this.pc)){this.thisCommand=this.getCommand(this.pc,!1,!0);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.viewer.getInt(536870922),this.listCommands||0<d)0<d&&this.delayScript(-d),this.viewer.scriptEcho("$["+this.scriptLevel+"."+this.lineNumbers[this.pc]+
"."+(this.pc+1)+"] "+this.thisCommand);if(null!=e&&(1150985!=this.theTok||2>this.slen||102439!=this.st[1].tok))e.addLast(this.st);else{if(this.chk){if(this.isCmdLine_c_or_C_Option&&J.util.Logger.info(this.thisCommand),1==this.slen&&135368713!=this.st[0].tok&&102436!=this.st[0].tok)continue}else this.debugScript&&this.logDebugScript(0),0==this.scriptLevel&&this.viewer.global.logCommands&&this.viewer.log(this.thisCommand),this.logMessages&&null!=this.theToken&&J.util.Logger.debug(this.theToken.toString());
if(null!=this.theToken){if(J.script.T.tokAttr(this.theToken.tok,135168))this.processShapeCommand(this.theToken.tok);else switch(this.theToken.tok){case 0:if(this.chk||!this.viewer.getBoolean(603979880))break;d=this.theToken.value;if(null==d)break;null==this.outputBuffer&&this.viewer.showMessage(d);this.scriptStatusOrBuffer(d);break;case 1276383749:this.pushContext(this.theToken,"PUSH");break;case 1276383249:this.popContext(!0,!1);break;case 269484066:break;case 20500:case 528410:if(this.viewer.isHeadless())break;
case 102412:case 102407:case 102408:case 364547:case 102402:case 1150985:case 364548:case 135369224:case 135369225:case 102410:case 102411:case 102413:case 102406:c=this.flowControl(this.theToken.tok,c,e);102439==this.theTok&&(e=null);break;case 4097:this.animation();break;case 4098:this.assign();break;case 1610616835:this.background(1);break;case 4100:this.bind();break;case 4101:this.bondorder();break;case 135270423:this.cache();break;case 1069064:this.cd();break;case 12289:this.center(1);break;
case 4105:this.centerAt();break;case 1766856708:this.color();break;case 4106:this.connect(1);break;case 528395:this.console();break;case 1060866:this.define();break;case 528397:this.delay();break;case 12291:this.$delete();break;case 554176526:this.slab(!0);break;case 1610625028:this.display(!0);break;case 266255:case 266281:if(this.chk)break;0<this.pc&&266255==this.theToken.tok&&this.viewer.clearScriptQueue();this.executionStopped=0<this.pc||!this.viewer.global.useScriptQueue;break;case 266256:if(this.chk)return;
this.viewer.exitJmol();break;case 1229984263:this.file();break;case 1060869:this.fixed();break;case 4114:this.font(-1,0);break;case 4115:case 1095766030:this.model(1);break;case 102436:case 135368713:case 1073741824:this.$function();break;case 1276121098:this.getProperty();break;case 20482:this.help();break;case 12294:this.display(!1);break;case 1612189718:this.hbond();break;case 1610616855:this.history(1);break;case 544771:this.hover();break;case 266264:this.chk||this.viewer.initialize(!this.isStateScript);
break;case 4121:this.invertSelected();break;case 135287308:this.script(135287308,null,null);break;case 135271426:this.load();break;case 36869:this.log();break;case 20485:this.message();break;case 4128:this.move();break;case 4130:this.moveto();break;case 20487:this.pause();break;case 36865:this.print();break;case 102439:this.pushContext(this.theToken,"PROCESS");null!=this.parallelProcessor&&(e=new JU.List);break;case 135304707:this.prompt();break;case 4139:case 4165:this.undoRedoMove();break;case 266284:this.refresh();
break;case 4141:this.reset();break;case 4142:this.restore();break;case 12295:this.restrict();break;case 266287:this.chk||this.resumePausedExecution();break;case 36866:this.returnCmd(null);break;case 528432:this.rotate(!1,!1);break;case 4145:this.rotate(!1,!0);break;case 4146:this.save();break;case 1085443:this.set();break;case 135271429:this.script(135271429,null,null);break;case 135280132:this.select(1);break;case 1611141171:this.selectionHalo(1);break;case 554176565:this.slab(!1);break;case 1611141175:this.rotate(!0,
!1);break;case 1611141176:this.ssbond();break;case 266298:this.pause()&&this.stepPausedExecution();break;case 528443:this.stereo();break;case 1641025539:this.structure();break;case 3158024:this.subset();break;case 4156:this.sync();break;case 536875070:this.timeout(1);break;case 4160:this.translate(!1);break;case 4162:this.translate(!0);break;case 4164:this.unbind();break;case 4166:this.vibration();break;case 1060873:this.zap(!0);break;case 4168:this.zoom(!1);break;case 4170:this.zoom(!0);break;case 4102:case 4103:case 135270405:case 1095766024:case 1052700:case 4126:case 1276121113:case 4133:case 135270418:case 1052714:case 135270407:case 4131:case 4148:case 135270422:this.getExtension().dispatch(this.theToken.tok,
!1,this.st);break;default:this.error(47)}this.setCursorWait(!1);this.executionStepping&&(this.executionPaused=this.isCommandDisplayable(this.pc+1))}}}else J.util.Logger.info(this.getCommand(this.pc,!0,!1)+" -- STATEMENT CONTAINING @{} SKIPPED")}},"~B");d(c$,"cache",function(){var a=this.tokAt(1),b=null,c=2;switch(a){case 1276118017:case 1073742119:b=this.optParameterAsString(c++);case 1073741882:this.checkLength(c);this.chk||("all".equals(b)&&(b=null),b=this.viewer.cacheFileByName(b,1276118017==a),
this.showString(0>b?"cache cleared":b+" bytes "+(1276118017==a?" cached":" removed")));break;default:this.invArg()}});d(c$,"setCursorWait",function(a){this.chk||this.viewer.setCursor(a?3:0)},"~B");d(c$,"processShapeCommand",function(a){var b=0;switch(a){case 1611272194:b=31;break;case 1115297793:b=9;break;case 1679429641:b=32;break;case 1113200642:b=11;break;case 135174:b=23;break;case 135402505:b=25;break;case 135175:b=17;break;case 1113198595:b=16;break;case 135176:b=22;break;case 537022465:b=30;
break;case 1113198596:b=20;break;case 1611272202:b=35;break;case 1113198597:b=19;break;case 1113200646:b=8;break;case 135180:b=24;break;case 1826248715:b=5;break;case 135182:b=26;break;case 537006096:case 1746538509:b=6;break;case 1113200647:b=13;break;case 1183762:b=27;break;case 135190:b=29;break;case 135188:b=28;break;case 135192:b=21;break;case 1113200649:b=14;break;case 1113200650:b=15;break;case 1113200651:b=0;break;case 1113200652:b=7;break;case 1650071565:b=12;break;case 1708058:b=4;break;
case 1113200654:b=10;break;case 1614417948: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 1048588:case 12291:case 1048587:return}switch(a){case 1115297793:case 1113200642:case 1113200647:case 1113200649:case 1113200650:case 1650071565:case 1113200654:this.proteinShape(b);return;case 1113198595:case 1113198597:this.dots(b);return;case 1113198596:this.ellipsoid();return;case 1113200646:case 1113200651:case 1113200652:this.setAtomShapeSize(b,
1113200646==a?-1:1);return;case 1826248715:this.label(1);return;case 135198:this.vector();return;case 659488:this.wireframe();return}switch(a){case 1611272194:this.axes(1);break;case 1679429641:this.boundbox(1);break;case 537022465:this.echo(1,null,!1);break;case 1611272202:this.frank(1);break;case 1614417948:this.unitcell(1);break;case 135174:case 135402505:case 135175:case 135176:case 135180:case 135182:case 537006096:case 1746538509:case 1183762:case 135190:case 135188:case 135192:case 1708058:this.getExtension().dispatch(b,
!1,this.st)}},"~N");d(c$,"getExtension",function(){return null==this.scriptExt?(this.scriptExt=J.api.Interface.getOptionInterface("scriptext.ScriptExt")).init(this):this.scriptExt});d(c$,"flowControl",function(a,b,c){var e;switch(a){case 20500:return this.gotoCmd(this.parameterAsString(this.checkLast(1))),b;case 528410:return this.chk||(this.pc=-1),this.delay(),b}var f=this.st[0].intValue,d=0>f&&!this.chk;e=!0;var g=0;switch(a){case 102412:e=this.theToken;this.pushContext(e,"CATCH");!d&&null!=e.name0&&
this.contextVariables.put(e.name0,e.contextVariables.get(e.name0));e=!d;break;case 102410:case 102413:case 102411:g=Math.abs(this.aatoken[Math.abs(f)][0].intValue);switch(d?0:this.switchCmd(this.theToken,a)){case 0:g=-g;e=!1;break;case -1:e=!1}this.aatoken[this.pc][0].intValue=Math.abs(f);this.theToken=this.aatoken[Math.abs(f)][0];1150985!=this.theToken.tok&&(this.theToken.intValue=g);break;case 135369225:case 102402:e=!d&&this.ifCmd();if(this.chk)break;g=Math.abs(this.aatoken[Math.abs(f)][0].intValue);
this.aatoken[Math.abs(f)][0].intValue=d||e?-g:g;102412==a&&(this.aatoken[this.pc][0].intValue=-f);break;case 364547:this.checkLength(1);0>f&&!this.chk&&(this.pc=-f-1);break;case 364548:this.checkLength(1);break;case 102406:b||this.pushContext(this.theToken,"WHILE");b=!1;!this.ifCmd()&&!this.chk&&(this.pc=f,this.popContext(!0,!1));break;case 102407:if(!this.chk){this.breakCmd(f);break}if(1==this.slen)break;d=this.intParameter(this.checkLast(1));if(this.chk)break;for(var h=0;h<d;h++)this.popContext(!0,
!1);break;case 102408:b=!0;this.chk||(this.pc=f-1);1<this.slen&&this.intParameter(this.checkLast(1));break;case 135369224:g=this.theToken;d=N(2,0);c=0;a=null;for(var h=1,k=0;h<this.slen&&2>c;h++)switch(this.tokAt(h)){case 1048591:0<k?k--:d[c++]=h;break;case 1073741980:k-=2;if(1048577==this.tokAt(++h)||10==this.tokAt(h))a=this.atomExpressionAt(h),this.isBondSet&&(a=new J.modelset.BondSet(a));else switch(h=this.parameterExpressionList(-h,1,!1),(null==h||1>h.size())&&this.invArg(),h=h.get(0),h.tok){case 10:a=
J.script.SV.getBitSet(h,!1);break;case 7:a=h.getList();break;default:this.invArg()}h=this.iToken;break;case 135280132:k+=2}b?c=null==a?d[1]+1:2:(this.pushContext(g,"FOR"),c=2);36868==this.tokAt(c)&&c++;g=this.parameterAsString(c);(h=g.equals("--")||g.equals("++"))&&(g=this.parameterAsString(++c));k=null;if(J.script.T.tokAttr(this.tokAt(c),1073741824)||null!=(k=this.getContextVariableAsVariable(g)))if(null==a&&(!h&&269484436!=this.getToken(++c).tok)&&this.invArg(),null==a)h&&(c-=2),this.setVariable(++c,
this.slen-1,g,0);else if(e=!0,c=g+"_incr",null==k&&(k=this.getContextVariableAsVariable(c)),null==k&&(g.startsWith("_")&&this.invArg(),k=this.viewer.getOrSetNewVariable(c,!0)),!b||10!=k.tok&&7!=k.tok||2147483647==k.intValue?b?e=!1:(k.setv(J.script.SV.getVariable(a),!1),k.intValue=1):k.intValue++,e=e&&(r(a,JU.BS)?1==J.script.SV.bsSelectVar(k).cardinality():k.intValue<=k.getList().size()))k=J.script.SV.selectItemVar(k),b=this.getContextVariableAsVariable(g),null==b&&(b=this.viewer.getOrSetNewVariable(g,
!0)),b.setv(k,!1);null==a&&(e=this.parameterExpressionBoolean(d[0]+1,d[1]));f++;e||this.popContext(!0,!1);b=!1;break;case 1150985:switch(this.getToken(this.checkLast(1)).tok){case 364558:f=this.getToken(1).value;if(this.chk)return!1;this.runFunctionRet(f,"try",null,null,!0,!0,!0);return!1;case 102412:this.popContext(!0,!1);break;case 135368713:case 102436:return this.viewer.addFunction(this.theToken.value),b;case 102439:this.addProcess(c,f,this.pc);this.popContext(!0,!1);break;case 102410:if(0<f&&
-1==this.switchCmd(this.aatoken[f][0],0)){for(;f<this.pc&&!(102413!=(a=this.aatoken[f][0].tok)&&102411!=a);f++);e=this.pc==f}}e&&(e=102412==this.theTok||102439==this.theTok||135369225==this.theTok||102410==this.theTok);b=135369224==this.theTok||102406==this.theTok}!e&&!this.chk&&(this.pc=Math.abs(f)-1);return b},"~N,~B,JU.List");d(c$,"gotoCmd",function(a){for(var b=null==a?this.aatoken.length-1:-1,c=null,e=b+1;e<this.aatoken.length;e++){var c=this.aatoken[e],f=c[0].tok;switch(f){case 20485:case 0:c=
c[c.length-1].value;0==f&&(c=c.substring(c.startsWith("#")?1:2));break;default:continue}if(c.equalsIgnoreCase(a)){b=e;break}}0>b&&this.invArg();null==a&&(b=0);f=b<this.pc?1:-1;c=0;for(e=b;e!=this.pc;e+=f)switch(this.aatoken[e][0].tok){case 1276383749:case 102439:case 135369224:case 102412:case 102406:c++;break;case 1276383249:c--;break;case 1150985:switch(this.aatoken[e][1].tok){case 102439:case 135369224: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)},"~S");d(c$,"breakCmd",function(a){if(0>a)this.getContextVariableAsVariable("_breakval").intValue=-a,this.pcEnd=this.pc;else if(this.pc=Math.abs(this.aatoken[a][0].intValue),a=this.aatoken[a][0].tok,102411==a||102413==a)this.theToken=this.aatoken[this.pc--][0],a=Math.abs(this.theToken.intValue),1150985!=this.theToken.tok&&(this.theToken.intValue=-a);else{for(;null!=this.thisContext&&!J.script.ScriptCompiler.isBreakableContext(this.thisContext.token.tok);)this.popContext(!0,
!1);this.popContext(!0,!1)}},"~N");d(c$,"addProcess",function(a,b,c){if(null!=this.parallelProcessor){for(var e=Array(c),f=0;f<a.size();f++)e[f+1-b]=a.get(f);a=this.getScriptContext("addProcess");a.aatoken=e;a.pc=1-b;a.pcEnd=c;this.parallelProcessor.addProcess("p"+ ++J.script.ScriptEvaluator.iProcess,a)}},"JU.List,~N,~N");d(c$,"switchCmd",function(a,b){102410==b&&a.addName("_var");var c=a.contextVariables.get("_var");if(null==c)return 1;if(0==b)return a.contextVariables.remove("_var"),-1;if(102413==
b)return-1;var e=this.parameterExpressionToken(1);if(102411==b)return(c=J.script.SV.areEqual(c,e))&&a.contextVariables.remove("_var"),c?1:-1;a.contextVariables.put("_var",e);return 1},"J.script.ContextToken,~N");d(c$,"ifCmd",function(){return this.parameterExpressionBoolean(1,0)});d(c$,"returnCmd",function(a){var b=this.getContextVariableAsVariable("_retval");if(null==b)this.chk||this.gotoCmd(null);else{var c=null!=a||1==this.slen?null:this.parameterExpressionToken(1);this.chk||(null==a&&(a=null==
c?J.script.SV.newI(0):c),b.value=a.value,b.intValue=a.intValue,b.tok=a.tok,this.gotoCmd(null))}},"J.script.SV");d(c$,"help",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.viewer.getBindingInfo(a.substring(b+1))):(J.script.T.tokAttr(J.script.T.getTokFromName(a),4096)&&(a="?command="+a),this.viewer.getHelp(a))}});d(c$,"move",function(){this.checkLength(-11);var a=JU.V3.new3(this.floatParameter(1),
this.floatParameter(2),this.floatParameter(3)),b=this.floatParameter(4),c=JU.V3.new3(this.intParameter(5),this.intParameter(6),this.intParameter(7)),e=this.floatParameter(8),f=this.floatParameter(9),d=11==this.slen?this.intParameter(10):30;if(!this.chk&&(this.refresh(),this.useThreads()||(f=0),this.viewer.move(this,a,b,c,e,f,d),0<f&&this.isJS))throw new J.script.ScriptInterruption(this,"move",1);});d(c$,"moveto",function(){if(2==this.slen&&1073742162==this.tokAt(1))this.chk||this.viewer.stopMotion();
else{var a;if(2==this.slen&&this.isFloatParameter(1)){if(a=this.floatParameter(1),!this.chk&&(this.useThreads()||(a=0),0<a&&this.refresh(),this.viewer.moveTo(this,a,null,J.viewer.JC.axisZ,0,null,100,0,0,0,null,NaN,NaN,NaN,NaN,NaN,NaN),this.isJS&&0<a&&this.viewer.global.waitForMoveTo))throw new J.script.ScriptInterruption(this,"moveTo",1);}else{var b=JU.V3.new3(NaN,0,0),c=null,e=1;a=this.isFloatParameter(e)?this.floatParameter(e++):2;var f=90,d=null,g=!0,h=0,k=0,m=NaN,j=NaN,p=this.viewer.getZoomSetting(),
K=null,n=NaN,q=NaN,x=NaN,u=NaN,v=NaN,t=NaN,w=null;switch(this.getToken(e).tok){case 1073742110:w=this.floatParameterSet(++e,18,21);e=this.iToken+1;if(this.chk&&0<this.checkLength(e))return;break;case 135270418:f=!1;1073742029==this.tokAt(++e)&&(f=!0,e++);10==this.tokAt(e)||1048577==this.tokAt(e)?(f=!0,c=this.centerParameter(e),r(this.expressionResult,JU.BS)||this.invArg(),d=this.expressionResult,g=this.chk?new J.util.Quaternion:this.viewer.getAtomQuaternion(d.nextSetBit(0))):g=this.getQuaternionParameter(e);
e=this.iToken+1;null==g&&this.invArg();g=g.toAxisAngle4f();b.set(g.x,g.y,g.z);f=(f?-1:1)*(180*g.angle/3.141592653589793);break;case 9:case 8:case 1048586:this.isPoint3f(e)?(b.setT(this.getPoint3f(e,!0)),e=this.iToken+1,f=this.floatParameter(e++)):(f=this.getPoint4f(e),e=this.iToken+1,b.set(f.x,f.y,f.z),f=0==f.x&&0==f.y&&0==f.z?NaN:f.w);break;case 1073741954:b.set(1,0,0);f=0;this.checkLength(++e);break;case 1073741859:b.set(0,1,0);f=180;this.checkLength(++e);break;case 1073741996:b.set(0,1,0);this.checkLength(++e);
break;case 1073742128:b.set(0,-1,0);this.checkLength(++e);break;case 1074790748:b.set(1,0,0);this.checkLength(++e);break;case 1073741871:b.set(-1,0,0);this.checkLength(++e);break;default:b=JU.V3.new3(this.floatParameter(e++),this.floatParameter(e++),this.floatParameter(e++)),f=this.floatParameter(e++)}Float.isNaN(b.x)||Float.isNaN(b.y)||Float.isNaN(b.z)?b.set(0,0,0):0==b.length()&&0==f&&(f=NaN);g=!this.viewer.isInPosition(b,f);this.isFloatParameter(e)&&(m=this.floatParameter(e++));this.isFloatParameter(e)&&
!this.isCenterParameter(e)&&(h=this.floatParameter(e++),k=this.floatParameter(e++),!g&&1<=Math.abs(h-this.viewer.getTranslationXPercent())&&(g=!0),!g&&1<=Math.abs(k-this.viewer.getTranslationYPercent())&&(g=!0));null==d&&e!=this.slen&&(c=this.centerParameter(e),r(this.expressionResult,JU.BS)&&(d=this.expressionResult),e=this.iToken+1);if(null!=c){!g&&0.1<=c.distance(this.viewer.getRotationCenter())&&(g=!0);this.isFloatParameter(e)&&(j=this.floatParameter(e++));this.isCenterParameter(e)||((0==j||Float.isNaN(j))&&
(0==m||Float.isNaN(m))?(d=Math.abs(this.getZoom(0,e,d,0==m?0:p)),e=this.iToken+1,m=d):!g&&0.1<=Math.abs(j-this.viewer.getFloat(570425388))&&(g=!0));if(0==m||Float.isNaN(m))m=100;Float.isNaN(j)&&(j=0);!g&&1<=Math.abs(m-p)&&(g=!0);e!=this.slen&&(K=this.centerParameter(e),e=this.iToken+1,e!=this.slen&&(n=this.floatParameter(e++),q=this.floatParameter(e++)),e!=this.slen&&(x=this.floatParameter(e++)),e!=this.slen&&(u=this.floatParameter(e++),!g&&0.01<=Math.abs(u-this.viewer.getCameraDepth())&&(g=!0)),
e+1<this.slen&&(v=this.floatParameter(e++),t=this.floatParameter(e++),!g&&0.01<=Math.abs(v-this.viewer.getCamera().x)&&(g=!0),!g&&0.01<=Math.abs(t-this.viewer.getCamera().y)&&(g=!0)))}this.checkLength(e);if(!this.chk&&(g||(a=0),0<a&&this.refresh(),this.useThreads()||(a=0),0==u&&(u=v=t=NaN),null!=w?this.viewer.movePyMOL(this,a,w):this.viewer.moveTo(this,a,c,b,f,null,m,h,k,j,K,n,q,x,u,v,t),this.isJS&&0<a&&this.viewer.global.waitForMoveTo))throw new J.script.ScriptInterruption(this,"moveTo",1);}}});
d(c$,"bondorder",function(){this.checkLength(-3);var a=0;switch(this.getToken(1).tok){case 2:case 3:131071==(a=J.util.JmolEdge.getBondOrderFromFloat(this.floatParameter(1)))&&this.invArg();break;default:131071==(a=J.script.ScriptEvaluator.getBondOrderFromString(this.parameterAsString(1)))&&this.invArg(),33==a&&3==this.tokAt(2)&&(a=J.script.ScriptEvaluator.getPartialBondOrderFromFloatEncodedInt(this.st[2].intValue))}this.setShapeProperty(1,"bondOrder",Integer.$valueOf(a))});d(c$,"console",function(){switch(this.getToken(1).tok){case 1048588:this.chk||
this.viewer.showConsole(!1);break;case 1048589:this.chk||this.viewer.showConsole(!0);break;case 1073741882:this.chk||this.viewer.clearConsole();break;case 135270422:this.showString(this.stringParameter(2));break;default:this.invArg()}});d(c$,"centerAt",function(){var a=null;switch(this.getToken(1).tok){case 1073741826:a="absolute";break;case 96:a="average";break;case 1679429641:a="boundbox";break;default:this.invArg()}var b=JU.P3.new3(0,0,0);5==this.slen?(b.x=this.floatParameter(2),b.y=this.floatParameter(3),
b.z=this.floatParameter(4)):this.isCenterParameter(2)?(b=this.centerParameter(2),this.checkLast(this.iToken)):this.checkLength(2);this.chk||this.viewer.setCenterAt(a,b)});d(c$,"stereo",function(){for(var a=J.constant.EnumStereoMode.DOUBLE,b=-5,c=!1,e=null,f=0,d=1;d<this.slen;++d)if(this.isColorParam(d))1<f&&this.error(2),0==f&&(e=N(2,0)),c||(b=3),e[f]=this.getArgbParam(d),0==f++&&(e[1]=~e[0]),d=this.iToken;else switch(this.getToken(d).tok){case 1048589:this.checkLast(this.iToken=1);this.iToken=1;
break;case 1048588:this.checkLast(this.iToken=1);a=J.constant.EnumStereoMode.NONE;break;case 2:case 3:b=this.floatParameter(d);c=!0;break;case 1073741824:if(c||(b=3),a=J.constant.EnumStereoMode.getStereoMode(this.parameterAsString(d)),null!=a)break;default:this.invArg()}this.chk||this.viewer.setStereoMode(e,a,b)});d(c$,"connect",function(a){var b=O(2,0),c=Array(2);c[0]=c[1]=this.viewer.getSelectionSet(!1);var e=NaN;this.colorArgb[0]=-2147483648;var f=0,d=131071,g=1073742026,h=!1,k=!1,m=!1,j=3.4028235E38,
p=!1,r=0,n=0,q=new JU.BS,x=!1,u=0,v=0,t=0,w=!1;if(1==this.slen)this.chk||this.viewer.rebondState(this.isStateScript);else{for(;a<this.slen;++a){switch(this.getToken(a).tok){case 1048589:case 1048588:this.checkLength(2);this.chk||this.viewer.rebondState(this.isStateScript);return;case 2:case 3:if(0<r){(k||p)&&this.error(23);d=J.util.JmolEdge.getBondOrderFromFloat(this.floatParameter(a));131071==d&&this.invArg();k=!0;break}2<++n&&this.error(2);var s=this.floatParameter(a);269484210==this.tokAt(a+1)&&
(s=-s/100,a++);b[f++]=s;break;case 10:case 1048577:(2<r||x&&0<r)&&this.error(2);(k||p)&&this.error(23);c[r++]=this.atomExpressionAt(a);x=this.isBondSet;if(2==r){for(var s=this.iToken,y=a;y<s;y++)if(1073741824==this.tokAt(y)&&this.parameterAsString(y).equals("_1")){u=a;break}this.iToken=s}a=this.iToken;break;case 1087373318:w=!0;break;case 1766856708:case 603979967:case 1073742074:p=!0;j=this.getColorTrans(a,!1);a=this.iToken;break;case 1074790662:b=1073741852==this.tokAt(2);this.checkLength(b?3:2);
this.chk||this.viewer.setPdbConectBonding(b,this.isStateScript);return;case 1073741830:case 1073741852:case 1073741904:case 1073742025:case 1073742026:m=!0;++a!=this.slen&&this.error(23);g=this.theTok;1073741852==this.theTok&&!(131071==d||2048==d||515==d)&&this.invArg();break;case 1708058:p||(this.colorArgb[0]=16777215,j=0.5,e=this.viewer.getFloat(570425406),p=!0),m||(g=1073742026),m=!0;case 1073741824:if(this.isColorParam(a)){v=-a;break}case 1076887572:case 1612189718:d=this.parameterAsString(a);
131071==(d=J.script.ScriptEvaluator.getBondOrderFromString(d))&&this.invArg();k&&this.error(18);k=!0;switch(d){case 33:switch(this.tokAt(a+1)){case 3:d=J.script.ScriptEvaluator.getPartialBondOrderFromFloatEncodedInt(this.st[++a].intValue);break;case 2:d=this.intParameter(++a)}break;case 2048:2==this.tokAt(a+1)&&(d=this.intParameter(++a)<<11,t=this.floatParameter(++a))}break;case 1666189314:e=this.floatParameter(++a);p=!0;break;case 1048587:case 12291:++a!=this.slen&&this.error(23);g=12291;h=!0;p=
!1;break;default:v=a}0<a&&(v==-a||v==a&&this.isColorParam(a)?(p=!0,this.colorArgb[0]=this.getArgbParam(a),a=this.iToken):v==a&&this.invArg())}if(!this.chk){2>f&&(0==f&&(b[0]=1E8),b[1]=b[0],b[0]=0.1);p&&(k||(d=65535),m||(g=1073742025));k=f=0;if(0<u){t=new JU.BS;this.definedAtomSets.put("_1",t);w=c[0];for(m=w.nextSetBit(0);0<=m;m=w.nextSetBit(m+1))t.set(m),c=this.viewer.makeConnections(b[0],b[1],d,g,t,this.atomExpressionAt(u),q,x,!1,0),f+=Math.abs(c[0]),k+=c[1],t.clear(m)}else c=this.viewer.makeConnections(b[0],
b[1],d,g,c[0],c[1],q,x,w,t),f+=Math.abs(c[0]),k+=c[1];h?this.tQuiet||this.scriptLevel>this.scriptReportingLevel||this.scriptStatusOrBuffer(J.i18n.GT.i(J.i18n.GT._("{0} connections deleted"),k)):(p&&(this.viewer.selectBonds(q),Float.isNaN(e)||this.setShapeSizeBs(1,Math.round(2E3*e),null),this.finalizeObject(1,this.colorArgb[0],j,0,!1,null,0,q),this.viewer.selectBonds(null)),this.tQuiet||this.scriptLevel>this.scriptReportingLevel||this.scriptStatusOrBuffer(J.i18n.GT.o(J.i18n.GT._("{0} new bonds; {1} modified"),
[Integer.$valueOf(f),Integer.$valueOf(k)])))}}},"~N");d(c$,"getTranslucentLevel",function(a){a=this.floatParameter(a);return 2==this.theTok&&0<a&&9>a?a+1:a},"~N");d(c$,"getProperty",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.viewer.getPropertyNumber(b),c="";switch(this.tokAt(2)){default:c=this.optParameterAsString(2);break;case 1048577:case 10:if(c=this.atomExpressionAt(2),
a.equalsIgnoreCase("bondInfo"))switch(this.tokAt(++this.iToken)){case 1048577:case 10:c=[c,this.atomExpressionAt(this.iToken)]}}if(0<a.length&&0>b)c=a="";else if(0<=b&&3>this.slen)c=this.viewer.getDefaultPropertyParam(b),c.equals("(visible)")&&(this.viewer.setModelVisibility(),c=this.viewer.getVisibleSet());else if(b==this.viewer.getPropertyNumber("fileContents")){b=c.toString();for(c=3;c<this.slen;c++)b+=this.parameterAsString(c);c=b}a=this.viewer.getProperty("readable",a,c);this.showString(a)}});
d(c$,"background",function(a){this.getToken(a);if(1073741979==this.theTok)a=this.parameterAsString(this.checkLast(++a)),!this.chk&&(!a.equalsIgnoreCase("none")&&0<a.length)&&this.viewer.loadImage(a,null);else if(this.isColorParam(a)||1048587==this.theTok)a=this.getArgbParamLast(a,!0),this.chk||(this.setObjectArgb("background",a),this.viewer.setBackgroundImage(null,null));else{var b=this.getShapeType(this.theTok);this.colorShape(b,a+1,!0)}},"~N");d(c$,"center",function(a){1==this.slen?this.viewer.setNewRotationCenter(null):
(a=this.centerParameter(a),null==a&&this.invArg(),this.chk||this.viewer.setNewRotationCenter(a))},"~N");d(c$,"setObjectProperty",function(){var a=this.getShapeNameParameter(2);if(this.chk)return"";var b=this.iToken,c=this.tokAt(0);return this.setObjectProp(a,c,b)});n(c$,"setObjectPropSafe",function(a,b,c){try{return this.setObjectProp(a,b,c)}catch(e){if(B(e,J.script.ScriptException))return null;throw e;}},"~S,~N,~N");d(c$,"setObjectProp",function(a,b,c){for(var e=[a,null],f="",d=J.util.Txt.isWild(a),
g=17;;){if(27!=g&&this.getShapePropertyData(g,"checkID",e)){this.setShapeProperty(g,"thisID",a);switch(b){case 12291:this.setShapeProperty(g,"delete",null);break;case 12294:case 1610625028:this.setShapeProperty(g,"hidden",1610625028==b?Boolean.FALSE:Boolean.TRUE);break;case 4148:f+=this.getShapeProperty(g,"command")+"\n";break;case 1766856708:0<=c&&this.colorShape(g,c+1,!1)}if(!d)break}17==g&&(g=31);if(22>--g)break}return f},"~S,~N,~N");d(c$,"color",function(){var a=1;if(this.isColorParam(1))this.theTok=
1141899265;else{var b=0,a=2,c=this.getToken(1).tok;switch(c){case 1048583:this.setObjectProperty();return;case 1087373315:case 3145730:case 1087373316:case 1073741946:case 1632634891:case 1087373318:case 1114638362:case 1087373322:case 1073741992:case 1095761936:case 1073742030:case 1048587:case 1073742074:case 1112541196:case 1095761937:case 1716520985:case 1073742116:case 1113200651:case 1073742144:case 1112539150:case 1641025539:case 1112539151:case 1112541199:case 603979967:case 1073742186:case 1649412120:this.theTok=
1141899265;a=1;break;case 4:a=1;b=this.stringParameter(a++);this.isArrayParameter(a)&&(b=b+="="+J.script.SV.sValue(J.script.SV.getVariableAS(this.stringParameterSet(a))).$replace("\n"," "),a=this.iToken+1);c=603979967==this.tokAt(a);this.chk||this.viewer.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.viewer.setCurrentColorRange(b,a);return;case 1073742114:case 1073741826:b=this.floatParameter(2);
a=this.floatParameter(this.checkLast(3));this.chk||this.viewer.setCurrentColorRange(b,a);return;case 1610616835:b=this.getArgbParamLast(2,!0);this.chk||this.setObjectArgb("background",b);return;case 10:case 1048577:a=-1;this.theTok=1141899265;break;case 1073742134:b=this.getArgbParamLast(2,!1);this.chk||this.viewer.setRubberbandArgb(b);return;case 536870920:case 1611141171:a=2;1073742074==this.tokAt(2)&&a++;b=this.getArgbParamLast(a,!0);if(this.chk)return;this.sm.loadShape(8);this.setShapeProperty(8,
1611141171==c?"argbSelection":"argbHighlight",Integer.$valueOf(b));return;case 1611272194:case 1679429641:case 1614417948:case 1073741824:case 1613758476:c=this.parameterAsString(1);if(this.checkToken(2))switch(this.getToken(2).tok){case 1073742116:b=1073742116;break;case 1048587:case 1073741992:b=1073741992;break;default:b=this.getArgbParam(2)}0==b&&this.error(9);this.checkLast(this.iToken);if(c.equalsIgnoreCase("axes")||0<=J.viewer.StateManager.getObjectIdFromName(c)){this.setObjectArgb(c,b);return}if(this.changeElementColor(c,
b))return;this.invArg();break;case 135180:case 135402505:this.setShapeProperty(J.viewer.JC.shapeTokenIndex(c),"thisID","+PREVIOUS_MESH+")}}this.colorShape(this.getShapeType(this.theTok),a,!1)});d(c$,"changeElementColor",function(a,b){for(var c=J.util.Elements.elementNumberMax;0<=--c;)if(a.equalsIgnoreCase(J.util.Elements.elementNameFromNumber(c)))return this.chk||this.viewer.setElementArgb(c,b),!0;for(c=J.util.Elements.altElementMax;0<=--c;)if(a.equalsIgnoreCase(J.util.Elements.altElementNameFromIndex(c)))return this.chk||
this.viewer.setElementArgb(J.util.Elements.altElementNumberFromIndex(c),b),!0;if("_"!=a.charAt(0))return!1;for(c=J.util.Elements.elementNumberMax;0<=--c;)if(a.equalsIgnoreCase("_"+J.util.Elements.elementSymbolFromNumber(c)))return this.chk||this.viewer.setElementArgb(c,b),!0;for(c=J.util.Elements.altElementMax;4<=--c;)if(a.equalsIgnoreCase("_"+J.util.Elements.altElementSymbolFromIndex(c))||a.equalsIgnoreCase("_"+J.util.Elements.altIsotopeSymbolFromIndex(c)))return this.chk||this.viewer.setElementArgb(J.util.Elements.altElementNumberFromIndex(c),
b),!0;return!1},"~S,~N");d(c$,"colorShape",function(a,b,c){var e=null,f=null,d=null,g=null,h=2==b&&1073741860==this.tokAt(1)?"ball":"",k=!1,m=24==a||25==a,j=0,p=!1,n=3.4028235E38;0>b&&(g=this.atomExpressionAt(-b),b=this.iToken+1,this.isBondSet&&(p=!0,a=1));var z=this.getToken(b).tok;c?this.getToken(b):!0==(c=1610616835==z)&&this.getToken(++b);if(c)h="bg";else if(m)switch(this.theTok){case 1073742018:this.getToken(++b);h="mesh";break;case 1073742094:c=this.getArgbParamOrNone(++b,!1);d=0==c?null:Integer.$valueOf(c);
this.getToken(b=this.iToken+1);break;case 10:case 1048577:r(this.theToken.value,J.modelset.BondSet)?(g=this.theToken.value,h="vertex"):(g=this.atomExpressionAt(b),h="atom"),this.getToken(b=this.iToken+1)}if(this.chk||27!=a||this.getExtension().dispatch(27,!0,this.st)){if((c=603979967==this.theTok)||1073742074==this.theTok)1.4E-45==n&&this.invArg(),e=this.parameterAsString(b++),c&&this.isFloatParameter(b)&&(n=this.getTranslucentLevel(b++));z=0;if(b<this.slen&&1048589!=this.tokAt(b)&&1048588!=this.tokAt(b))if(k=
!0,z=this.getToken(b).tok,(!m||1074790746!=this.tokAt(b+1))&&this.isColorParam(b)){if(c=this.getArgbParamOrNone(b,!1),f=0==c?null:Integer.$valueOf(c),null==e&&0!=this.tokAt(b=this.iToken+1))this.getToken(b),(c=603979967==this.theTok)||1073742074==this.theTok?(e=this.parameterAsString(b),c&&this.isFloatParameter(b+1)&&(n=this.getTranslucentLevel(++b))):this.isColorParam(b)&&(c=this.getArgbParamOrNone(b,!1),d=0==c?null:Integer.$valueOf(c))}else if(26==a)this.iToken--;else{var j=this.parameterAsString(b).toLowerCase(),
q=0==j.indexOf("byelement"),x=q||0==j.indexOf("byresidue"),f=x||m?J.constant.EnumPalette.PROPERTY:1113200651==z?J.constant.EnumPalette.CPK:J.constant.EnumPalette.getPalette(j);(f===J.constant.EnumPalette.UNKNOWN||(f===J.constant.EnumPalette.TYPE||f===J.constant.EnumPalette.ENERGY)&&2!=a)&&this.invArg();var u=null,v=f!==J.constant.EnumPalette.PROPERTY&&f!==J.constant.EnumPalette.VARIABLE||!this.viewer.global.rangeSelected?null:this.viewer.getSelectionSet(!1);if(f===J.constant.EnumPalette.PROPERTY)if(x)this.chk||
(u=this.getBitsetPropertyFloat(v,(q?1095763978:1095761932)|256,NaN,NaN));else{if(!x&&!m&&b++,j.equals("property")&&J.script.T.tokAttr(z=this.getToken(b).tok,1078984704)&&!J.script.T.tokAttr(z,1087373312))this.chk||(u=this.getBitsetPropertyFloat(v,this.getToken(b++).tok|256,NaN,NaN))}else f===J.constant.EnumPalette.VARIABLE&&(b++,j=this.parameterAsString(b++),u=O(this.viewer.getAtomCount(),0),J.util.Parser.parseStringInfestedFloatArray(""+this.getParameter(j,4),null,u),f=J.constant.EnumPalette.PROPERTY);
if(f===J.constant.EnumPalette.PROPERTY){var t=null;4==this.tokAt(b)?(t=this.parameterAsString(b++).toLowerCase(),this.isArrayParameter(b)&&(t+="="+J.script.SV.sValue(J.script.SV.getVariableAS(this.stringParameterSet(b))).$replace("\n"," "),b=this.iToken+1)):m&&this.isColorParam(b)&&(t=this.getColorRange(b),b=this.iToken+1);null!=t&&!m&&(this.setStringProperty("propertyColorScheme",(c&&3.4028235E38==n?"translucent ":"")+t),x=0==t.indexOf("byelement")||0==t.indexOf("byresidue"));var q=0,w=3.4028235E38;
if(!x&&(1073741826==this.tokAt(b)||1073742114==this.tokAt(b)))q=this.floatParameter(b+1),w=this.floatParameter(b+2),b+=3,q==w&&m?(x=this.getShapeProperty(a,"dataRange"),null!=x&&(q=x[0],w=x[1])):q==w&&(w=3.4028235E38);if(!this.chk)if(m||(null==u?this.viewer.setCurrentColorRange(j):this.viewer.setCurrentColorRangeData(u,v)),m){this.checkLength(b);k=!1;j=this.viewer.getColorEncoder(t);if(null==j)return;j.isTranslucent=c&&3.4028235E38==n;j.setRange(q,w,q>w);3.4028235E38==w&&(j.hi=w);this.setShapeProperty(a,
"remapColor",j);this.showString(this.getIsosurfaceDataRange(a,""));if(3.4028235E38==n)return}else 3.4028235E38!=w&&this.viewer.setCurrentColorRange(q,w)}else b++;this.checkLength(b)}if(!(this.chk||0>a)){switch(a){case 4:j=32768;break;case 2:j=30720;break;case 3:j=256;break;case 1:j=1023;break;default:j=0}0==j?(this.sm.loadShape(a),5==a&&this.setShapeProperty(5,"setDefaults",this.viewer.getNoneSelected())):(null!=g&&(this.viewer.selectBonds(g),g=null),a=1,this.setShapeProperty(a,"type",Integer.$valueOf(j)));
if(k){switch(z){case 1112539151:case 1112539150:this.viewer.autoCalculate(z);break;case 1112541199:this.viewer.global.rangeSelected&&this.viewer.clearBfactorRange();break;case 1087373318:this.viewer.calcSelectedGroupsCount();break;case 1095761937:case 1073742030:this.viewer.calcSelectedMonomersCount();break;case 1095761936:this.viewer.calcSelectedMoleculesCount()}null!=d&&(m||11==a||14==a)?this.setShapeProperty(a,"colorPhase",[d,f]):null==g?this.setShapeProperty(a,h+"color",f):this.setShapePropertyBs(a,
h+"color",f,g)}null!=e&&this.setShapeTranslucency(a,h,e,n,g);0!=j&&this.setShapeProperty(1,"type",Integer.$valueOf(1023));p&&this.viewer.selectBonds(null);0==a&&this.viewer.checkInheritedShapes()}}},"~N,~N,~B");d(c$,"setShapeTranslucency",function(a,b,c,e,f){3.4028235E38==e&&(e=this.viewer.getFloat(570425354));this.setShapeProperty(a,"translucentLevel",Float.$valueOf(e));null!=b&&(null==f?this.setShapeProperty(a,b+"translucency",c):this.chk||this.setShapePropertyBs(a,b+"translucency",c,f))},"~N,~S,~S,~N,JU.BS");
d(c$,"cd",function(){if(!this.chk){var a=1==this.slen?null:this.parameterAsString(1);this.showString(this.viewer.cd(a))}});d(c$,"define",function(){(3>this.slen||!r(this.getToken(1).value,String))&&this.invArg();var a=this.getToken(1).value.toLowerCase();-2147483648!=JU.PT.parseInt(a)&&this.invArg();if(!this.chk){var b=a.startsWith("site_");if(0==a.indexOf("dynamic_")||b){for(var c=Array(this.slen),e=this.slen;0<=--e;)c[e]=this.st[e];this.definedAtomSets.put("!"+(b?a:a.substring(8)),c)}else b=this.atomExpressionAt(2),
this.definedAtomSets.put(a,b),this.chk||this.viewer.setUserVariable("@"+a,J.script.SV.newV(10,b))}});d(c$,"echo",function(a,b,c){if(!this.chk){a=this.optParameterAsString(a);if(this.viewer.getEchoStateActive()){if(c){this.viewer.loadImage(a,b);return}a.startsWith("\u0001")&&(a=a.substring(1),c=!0);null!=a&&this.setShapeProperty(30,"text",a)}!c&&this.viewer.getRefreshing()&&this.showString(this.viewer.formatText(a))}},"~N,~S,~B");d(c$,"message",function(){var a=this.parameterAsString(this.checkLast(1));
this.chk||(a=this.viewer.formatText(a),null==this.outputBuffer&&this.viewer.showMessage(a),a.startsWith("_")||this.scriptStatusOrBuffer(a))});d(c$,"log",function(){1==this.slen&&this.error(2);if(!this.chk){var a=this.parameterExpressionString(1,0);1048588==this.tokAt(1)?this.setStringProperty("logFile",""):this.viewer.log(a)}});d(c$,"label",function(a){if(!this.chk){this.sm.loadShape(5);var b=null;switch(this.getToken(a).tok){case 1048589:b=this.viewer.getStandardLabelFormat(0);break;case 1048588:break;
case 12294:case 1610625028:this.setShapeProperty(5,"display",1610625028==this.theTok?Boolean.TRUE:Boolean.FALSE);return;default:b=this.parameterAsString(a)}this.sm.setLabel(b,this.viewer.getSelectionSet(!1))}},"~N");d(c$,"hover",function(){if(!this.chk){var a=this.parameterAsString(1);a.equalsIgnoreCase("on")?a="%U":a.equalsIgnoreCase("off")&&(a=null);this.viewer.setHoverLabel(a)}});d(c$,"load",function(){var a=!this.chk||this.isCmdLine_C_Option,b=!1,c=!1,e=!1,f=!1,d,g=135270407==this.tokAt(0)?0:
1,h=this.viewer.getBoolean(603979792),k=null,m=null,j=this.viewer.getModelCount()-(this.viewer.getFileName().equals("zapped")?1:0),p=this.viewer.getAtomCount(),n=(new JU.SB).append("load"),r=1,q=new java.util.Hashtable;this.isStateScript&&(q.put("isStateScript",Boolean.TRUE),this.forceNoAddHydrogens&&q.put("doNotAddHydrogens",Boolean.TRUE));var x=null,u=null,v=null,t=null,t="",w=0,s;if(1==this.slen)g=0;else{x=this.parameterAsString(g);if(2==this.slen&&!this.chk&&(x.endsWith(".spt")||x.endsWith(".png")||
x.endsWith(".pngj"))){this.script(0,x,null);return}switch(s=this.tokAt(g)){case 1073742015:b=this.parameterAsString(this.checkLast(2));this.chk||this.viewer.setMenu(b,!0);return;case 135270407:f=!0;n.append(" /*data*/ data");d=this.stringParameter(++g).toLowerCase();n.append(" ").append(J.util.Escape.eS(d));var b=d.startsWith("append"),y=0<=d.indexOf("@")?""+this.getParameter(d.substring(d.indexOf("@")+1),4):this.parameterAsString(++g),y=J.viewer.Viewer.fixInlineString(y,this.viewer.getInlineChar());
q.put("fileData",y);q.put("isData",Boolean.TRUE);n.appendC("\n");n.append(y);0>d.indexOf("@")&&(n.append(" end ").append(J.util.Escape.eS(d)),g+=2);break;case 1073741839:b=!0;n.append(" append");x=this.optParameterAsString(++g);s=J.script.T.getTokFromName(x);break;case 1073741824:g++,n.append(" "+x),w=1073741824==s&&JU.PT.isOneOf(x.toLowerCase(),";xyz;vxyz;vibration;temperature;occupancy;partialcharge;")?J.script.T.getTokFromName(x):0,0!=w&&(q.put("atomDataOnly",Boolean.TRUE),q.put("modelNumber",
Integer.$valueOf(1)),4166==w&&(w=1146095631),v=this.viewer.getFileInfo(),b=!0)}switch(s){case 1229984263:g++;n.append(" "+x);7==this.tokAt(g)&&(u=this.stringParameterSet(g),g=this.iToken,g+1!=this.slen&&this.invArg(),null!=u&&(r=u.length));break;case 1073741983:c=!0;g++;n.append(" "+x);break;case 135267336:e=!0;g++;break;case 4156:q.put("async",Boolean.TRUE);g++;break;case 536870926:case 1095766030:g++;n.append(" "+x);536870926==s&&q.put("isTrajectory",Boolean.TRUE);this.isPoint3f(g)?(s=this.getPoint3f(g,
!1),g=this.iToken+1,q.put("firstLastStep",[z(s.x),z(s.y),z(s.z)]),n.append(" "+J.util.Escape.eP(s))):10==this.tokAt(g)?(d=this.getToken(g++).value,q.put("bsModels",d),n.append(" "+J.util.Escape.eBS(d))):q.put("firstLastStep",[0,-1,1]);break;case 1073741824:break;default:x="fileset"}null==u&&4!=this.getToken(g).tok&&this.error(16)}s=g;d=null;1073741848==this.tokAt(s+1)&&(d=this.stringParameter(g+=2),""!==this.viewer.getPathForAllFiles()&&(d=null,s=g));var A=y=null,B=null;if(this.slen==g+1){if(0==g||
null==u&&0==(y=this.parameterAsString(s)).length)y=this.getFullPathName();if(null==y&&null==u){this.zap(!1);return}if(null==u&&!c)if(e)y="$"+y;else{if(0<=y.indexOf("[]"))return;0==y.indexOf("[")&&(u=J.util.Escape.unescapeStringArray(y),null!=u&&(1==g&&n.append(" files"),r=u.length))}if(null!=u)for(var C=0;C<r;C++)n.append(" /*file*/").append(J.util.Escape.eS(u[C]))}else if(1073742010==this.getToken(g+1).tok||2==this.theTok||7==this.theTok||269484096==this.theTok||1073742195==this.theTok||1048586==
this.theTok||8==this.theTok||1073742080==this.theTok||1095761926==this.theTok||1073742163==this.theTok||1073742114==this.theTok||1073742152==this.theTok||1614417948==this.theTok||1073742066==this.theTok||1073741940==this.theTok&&1048582!=this.tokAt(g+3)||1073741839==this.theTok||1073741824==this.theTok&&1048582!=this.tokAt(g+3)){if(0==(y=this.parameterAsString(s)).length&&null==(y=this.getFullPathName())){this.zap(!1);return}s==g&&g++;if(0<=y.indexOf("[]"))return;if(1073742010==(s=this.tokAt(g)))m=
this.stringParameter(++g),q.put("manifest",m),t+=" MANIFEST "+J.util.Escape.eS(m),s=this.tokAt(++g);switch(s){case 2:m=this.intParameter(g);t+=" "+m;0>m?q.put("vibrationNumber",Integer.$valueOf(-m)):q.put("modelNumber",Integer.$valueOf(m));s=this.tokAt(++g);break;case 7:case 269484096:case 1073742195:m=this.floatParameterSet(g,1,2147483647);g=this.iToken;e=new JU.BS;for(C=0;C<m.length;C++)1<=m[C]&&m[C]==z(m[C])&&e.set(z(m[C])-1);q.put("bsModels",e);m=N(e.cardinality(),0);s=0;for(C=e.nextSetBit(0);0<=
C;C=e.nextSetBit(C+1))m[s++]=C+1;t+=" "+J.util.Escape.eAI(m);s=this.tokAt(g)}e=null;if(1048586==s||8==s)e=this.getPoint3f(g,!1),g=this.iToken+1,s=this.tokAt(g);switch(s){case 1073742080:case 1095761926:case 1073742163:case 1073742114:case 1073742152:case 1614417948:null==e&&(e=JU.P3.new3(555,555,-1)),this.iToken=g-1}m=null;if(null!=e){q.put("lattice",e);g=this.iToken+1;t+=" {"+z(e.x)+" "+z(e.y)+" "+z(e.z)+"}";1073742080==this.tokAt(g)&&(q.put("packed",Boolean.TRUE),t+=" PACKED",g++);1095761926==this.tokAt(g)&&
(q.put("centroid",Boolean.TRUE),t+=" CENTROID",g++,1073742080==this.tokAt(g)&&!q.containsKey("packed")&&(q.put("packed",Boolean.TRUE),t+=" PACKED",g++));if(1073742163==this.tokAt(g)){if(this.isPoint3f(++g)){s=this.getPoint3f(g,!1);if(s.x!=z(s.x)||s.y!=z(s.y)||s.z!=z(s.z)||1>s.x||1>s.y||1>s.z)this.iToken=g,this.invArg();g=this.iToken+1}else s=this.stringParameter(g++);q.put("supercell",s)}s=0;1073742114==this.tokAt(g)&&(g++,s=this.floatParameter(g++),t+=" range "+s);q.put("symmetryRange",Float.$valueOf(s));
s=null;s=-2147483648;1073742152==this.tokAt(g)&&(++g,s=JU.PT.simpleReplace(this.parameterAsString(g++),"''",'"'),t+=" spacegroup "+J.util.Escape.eS(s),s.equalsIgnoreCase("ignoreOperators")?s=-999:(0==s.length?(e=this.viewer.getCurrentUnitCell(),null!=e&&(s=e.getSpaceGroupName())):0<=s.indexOf(",")&&9>e.x&&(9>e.y&&0==e.z)&&(s+="#doNormalize=0"),q.put("spaceGroupName",s),s=-2));var D=null;if(1614417948==this.tokAt(g)){++g;0==this.optParameterAsString(g).length?(e=this.viewer.getCurrentUnitCell(),null!=
e&&(D=e.getUnitCellAsArray(!0),m=e.getCartesianOffset())):D=this.floatParameterSet(g,6,9);(null==D||6!=D.length&&9!=D.length)&&this.invArg();t+=" unitcell {";for(C=0;C<D.length;C++)t+=(0==C?"":" ")+D[C];t+="}";q.put("unitcell",D);-2147483648==s&&(s=-1);g=this.iToken+1}-2147483648!=s&&q.put("spaceGroupIndex",Integer.$valueOf(s))}null!=m?this.coordinatesAreFractional=!1:1073742066==this.tokAt(g)&&(m=this.getPoint3f(++g,!0));null!=m&&(this.coordinatesAreFractional?(m.setT(this.fractionalPoint),q.put("unitCellOffsetFractional",
this.coordinatesAreFractional?Boolean.TRUE:Boolean.FALSE),t+=" offset {"+m.x+" "+m.y+" "+m.z+"/1}"):t+=" offset "+J.util.Escape.eP(m),q.put("unitCellOffset",m),g=this.iToken+1);1073741839==this.tokAt(g)&&(135270407==this.tokAt(++g)?(g+=2,A=this.getToken(g++).value,B=this.stringParameter(++g),++g):(B=this.stringParameter(g++),A=this.stringParameter(g++)),q.put(B,A));1073741940==this.tokAt(g)&&(k=this.stringParameter(++g))}else{1==g&&(g++,n.append(" "+x));e=s=null;for(u=new JU.List;g<this.slen;){switch(this.tokAt(g)){case 1073741940:k=
this.stringParameter(++g);++g;continue;case 1048582:q.remove("isTrajectory");null==m&&(m=new JU.List,s=JU.P3.new3(0,-1,1));this.isPoint3f(++g)?(s=this.getPoint3f(g,!1),g=this.iToken+1):10==this.tokAt(g)&&(e=this.getToken(g).value,s=null,g=this.iToken+1);break;case 1073741824:this.invArg()}u.addLast(y=this.parameterAsString(g++));null!=s?(m.addLast([z(s.x),z(s.y),z(s.z)]),n.append(" COORD "+J.util.Escape.eP(s))):null!=e&&(m.addLast(e),n.append(" COORD "+J.util.Escape.eBS(e)));n.append(" /*file*/$FILENAME"+
u.size()+"$")}null!=m&&q.put("firstLastSteps",m);r=u.size();u=u.toArray(Array(r))}if(a)if(null!=u&&(y="fileSet"),null!=A&&(t+=' APPEND data "'+B+'"\n'+A+(A.endsWith("\n")?"":"\n")+'end "'+B+'"'),null==k&&(k=this.viewer.getDefaultLoadFilter()),0<k.length&&(0<=k.toUpperCase().indexOf("DOCACHE")&&!this.isStateScript&&!b&&this.viewer.cacheClear(),q.put("filter",k),k.equalsIgnoreCase("2d")&&(k="2D-noMin"),t+=" FILTER "+J.util.Escape.eS(k)),a=!1,null==u&&(c?q.put("fileData",y):y.startsWith("@")&&1<y.length?
(a=!0,g=this.getStringParameter(y.substring(1),!1),q.put("fileData",g),n=(new JU.SB).append("{\n    var ").append(y.substring(1)).append(" = ").append(J.util.Escape.eS(g)).append(";\n    ").appendSB(n)):y.startsWith("?")&&this.viewer.isJS&&(d=null,y=this.loadFileAsync("LOAD"+(b?"_APPEND_":"_"),y,g,!b))),g=null,null!=d&&(d.equals(".")&&(d=this.viewer.getFilePath(y,!0)),(0==d.length||this.viewer.getFilePath(d,!1).equalsIgnoreCase(this.viewer.getFilePath(y,!1)))&&this.invArg(),k=[d],g=this.viewer.getOutputChannel(d,
k),null==g?J.util.Logger.error("Could not create output stream for "+k[0]):q.put("outputChannel",g)),null==u&&0==w&&(n.append(" "),a||c?n.append(J.util.Escape.eS(y)):f||(!y.equals("string")&&!y.equals("string[]")&&n.append("/*file*/"),null!=d&&(d=this.viewer.getFilePath(d,!1)),n.append(null!=d?J.util.Escape.eS(d):"$FILENAME$")),0<t.length&&n.append(" /*options*/ ").append(t),a&&n.append("\n  }"),q.put("loadScript",n)),this.setCursorWait(!0),(c=this.viewer.getBoolean(603979934))&&J.util.Logger.startTimer("load"),
t=this.viewer.loadModelFromFile(null,y,u,null,b,q,n,w),null!=g&&(this.viewer.setFileInfo([d]),J.util.Logger.info(J.i18n.GT.o(J.i18n.GT._("file {0} created"),d)),this.showString(this.viewer.getFilePath(d,!1)+" created"),g.closeChannel()),0<w)this.viewer.setFileInfo(v),null!=t&&!this.isCmdLine_c_or_C_Option&&this.evalError(t,null);else{if(null!=t&&!this.isCmdLine_c_or_C_Option){if(0==t.indexOf("NOTE: file recognized as a script file: ")){y=t.substring(40).trim();this.script(0,y,null);return}this.evalError(t,
null)}if(b&&(h||1<r))this.viewer.setAnimationRange(-1,-1),this.viewer.setCurrentModelIndex(j);0==this.scriptLevel&&(!b&&2>r)&&this.showString(this.viewer.getModelSetAuxiliaryInfoValue("modelLoadNote"));this.logMessages&&this.scriptStatusOrBuffer("Successfully loaded:"+(null==u?q.get("fullPathName"):x));h=this.viewer.getModelSetAuxiliaryInfo();null!=h&&(h.containsKey("centroidMinMax")&&0<this.viewer.getAtomCount())&&(e=J.util.BSUtil.newBitSet2(b?p:0,this.viewer.getAtomCount()),this.viewer.setCentroid(e,
h.get("centroidMinMax")));b=this.viewer.getDefaultLoadScript();p="";0<b.length&&(p+="\nUsing defaultLoadScript: "+b);null!=h&&this.viewer.allowEmbeddedScripts()?(j=h.remove("jmolscript"),null!=j&&0<j.length&&(p+="\nAdding embedded #jmolscript: "+j,b+=";"+j,this.setStringProperty("_loadScript",b),b="allowEmbeddedScripts = false;try{"+b+"} allowEmbeddedScripts = true;")):this.setStringProperty("_loadScript","");this.logLoadInfo(p);p=null==h?null:h.remove("sitescript");null!=p&&(b=p+";"+b);0<b.length&&
!this.isCmdLine_c_or_C_Option&&this.runScript(b);c&&this.showString(J.util.Logger.getTimerMsg("load",0))}});d(c$,"loadFileAsync",function(a,b,c,e){a="cache://local"+a;c=this.pc+"_"+c;var f;if(null==this.thisContext||null==this.thisContext.htFileCache)this.pushContext(null,"loadFileAsync"),this.thisContext.htFileCache=new java.util.Hashtable;f=this.thisContext.htFileCache.get(c);if(null!=f&&0<f.length)return this.fileLoadThread=null,this.popContext(!1,!1),this.viewer.queueOnHold=!1,"#CANCELED#".equals(this.viewer.cacheGet(f))&&
this.evalError("#CANCELED#",null),f;this.thisContext.htFileCache.put(c,f=a+System.currentTimeMillis());null!=this.fileLoadThread&&this.evalError("#CANCELED#",null);e&&this.viewer.cacheFileByName(a+"*",!1);this.fileLoadThread=new J.script.FileLoadThread(this,this.viewer,b,c,f);this.fileLoadThread.run();throw new J.script.ScriptInterruption(this,"load",1);},"~S,~S,~N,~B");d(c$,"logLoadInfo",function(a){0<a.length&&J.util.Logger.info(a);a=new JU.SB;var b=this.viewer.getModelCount();1<b&&a.append((this.viewer.isMovie()?
this.viewer.getFrameCount()+" frames":b+" models")+"\n");for(var c=0;c<b;c++){var e=this.viewer.getModelAuxiliaryInfoValue(c,"moData");null!=e&&a.appendI(e.get("mos").size()).append(" molecular orbitals in model ").append(this.viewer.getModelNumberDotted(c)).append("\n")}0<a.length()&&this.showString(a.toString())},"~S");d(c$,"getFullPathName",function(){var a=!this.chk||this.isCmdLine_C_Option?this.viewer.getFullPathName(!0):"test.xyz";null==a&&this.invArg();return a});d(c$,"pause",function(){if(this.chk||
this.isJS&&!this.allowJSThreads)return!1;var a=this.optParameterAsString(1);this.viewer.getBooleanProperty("_useCommandThread");if(this.viewer.autoExit||!this.viewer.haveDisplay&&!this.viewer.isWebGL)return!1;if(0==this.scriptLevel&&this.pc==this.aatoken.length-1)return this.viewer.scriptStatus("nothing to pause: "+a),!1;a=0==a.length?": RESUME to continue.":": "+this.viewer.formatText(a);this.pauseExecution(!0);this.viewer.scriptStatusMsg("script execution paused"+a,"script paused for RESUME");return!0});
d(c$,"print",function(){1==this.slen&&this.error(2);this.showStringPrint(this.parameterExpressionString(1,0),!0)});d(c$,"prompt",function(){var a=null;1==this.slen?this.chk||(a=J.script.ScriptEvaluator.getContextTrace(this.viewer,this.getScriptContext("prompt"),null,!0).toString()):a=this.parameterExpressionString(1,0);this.chk||this.viewer.prompt(a,"OK",null,!0)});d(c$,"refresh",function(){this.chk||(this.viewer.setTainted(!0),this.viewer.requestRepaintAndWait("refresh cmd"))});d(c$,"reset",function(){if(3==
this.slen&&135368713==this.tokAt(1))this.chk||this.viewer.removeFunction(this.stringParameter(2));else if(this.checkLength(-2),!this.chk)if(1==this.slen)this.viewer.reset(!1);else{switch(this.tokAt(1)){case 135270423:this.viewer.cacheClear();return;case 1073741935:this.viewer.resetError();return;case 1087373323:this.viewer.resetShapes(!0);return;case 135368713:this.viewer.clearFunctions();return;case 1641025539:var a=new JU.BS;this.runScript(this.viewer.getDefaultStructure(null,a));this.viewer.resetBioshapes(a);
return;case 1649412120:this.viewer.setData("element_vdw",[null,""],0,0,0,0,0);return;case 1076887572:this.viewer.resetAromatic();return;case 1611141175:this.viewer.reset(!0);return}a=this.parameterAsString(1);"_"==a.charAt(0)&&this.invArg();this.viewer.unsetProperty(a)}});d(c$,"restrict",function(){var a=1678770178==this.tokAt(1);this.select(a?2:1);this.restrictSelected(a,!0)});d(c$,"restrictSelected",function(a,b){this.chk||this.sm.restrictSelected(a,b)},"~B,~B");d(c$,"rotate",function(a,b){if(2==
this.slen)switch(this.getToken(1).tok){case 1048589:this.chk||this.viewer.setSpinOn(!0);return;case 1048588:this.chk||this.viewer.setSpinOn(!1);return}for(var c=null,e=1.4E-45,f=0,d=3.4028235E38,g=!1,h=!1,k=null,m=null,j=Array(2),p=JU.V3.new3(0,1,0),n=null,r=null,m=null,q=1,x,m=null,u=!1,v=null,t=null,w=null,s=null,y=this.viewer.getBoolean(603979806),A=1;A<this.slen;++A){switch(x=this.getToken(A).tok){case 10:case 1048577:case 1048586:case 8:case 1048583:if(10==x||1048577==x)if(null!=n||null!=m||
2==f){c=this.atomExpressionAt(A);v=null;b=!0;break}h=!0;2==f&&(f=0);var z=this.centerParameterForModel(A,this.viewer.getCurrentModelIndex());!this.chk&&(1048583==x&&269484096!=this.tokAt(A+2))&&(g=!0,p=this.getDrawObjectAxis(this.objectNameParameter(++A),this.viewer.getCurrentModelIndex()));j[f++]=z;break;case 1611141175:a=!0;continue;case 1073741988:case 1073742029:g=!0;continue;case 1114638363:b=!0;break;case 269484080:continue;case 2:case 3:if(a)if(1.4E-45==e){e=this.floatParameter(A);continue}else{if(3.4028235E38==
d){d=e;e=this.floatParameter(A);continue}}else if(3.4028235E38==d){d=this.floatParameter(A);continue}else if(1.4E-45==e){e=this.floatParameter(A);a=!0;continue}this.invArg();break;case 269484192:q=-1;continue;case 1112541205:h=!0;p.set(q,0,0);continue;case 1112541206:h=!0;p.set(0,q,0);continue;case 1112541207:h=!0;p.set(0,0,y&&!g?-q:q);continue;case 9:case 135270418:case 1073741863:135270418==x&&A++;h=!0;m=this.getQuaternionParameter(A);if(null!=m){if(1073741863==x&&!(g=b))m=m.mulQ(this.viewer.getRotationQuaternion().mul(-1));
p.setT(m.getNormal());d=m.getTheta()}break;case 135266307:h=!0;if(this.isPoint3f(++A)){p.setT(this.centerParameter(A));break}d=this.getPoint4f(A);p.set(d.x,d.y,d.z);d=d.w;m=J.util.Quaternion.newVA(p,d);break;case 1048580:h=g=b=!0;if(this.isArrayParameter(++A))k=this.floatParameterSet(A,6,2147483647);else{f=this.atomExpressionAt(A).nextSetBit(0);A=this.atomExpressionAt(++this.iToken).nextSetBit(0);if(0>f||0>A)return;c=this.viewer.getBranchBitSet(A,f,!0);j[0]=this.viewer.getAtomPoint3f(f);j[1]=this.viewer.getAtomPoint3f(A);
f=2}break;case 4160:n=JU.V3.newV(this.centerParameter(++A));g=b=!0;break;case 137363468:u=!0;continue;case 1297090050:x=this.intParameter(++A);if(this.chk)continue;n=this.viewer.getSpaceGroupInfo(null);g=null==n?null:n.get("operations");(0==x||null==g||g.length<Math.abs(x))&&this.invArg();g=g[Math.abs(x)-1];n=g[5];w=g[6];j[0]=g[7];null!=g[8]&&(p=g[8]);d=g[9].intValue();0>x&&(d=-d,null!=n&&n.scale(-1));0==d&&null!=j[0]&&(p.normalize(),J.util.Measure.getPlaneThroughPoint(j[0],p,s=new JU.P4));m=J.util.Quaternion.newVA(p,
d);f=null==j[0]?0:1;b=h=g=!0;continue;case 135270405:case 12:case 11:h=!0;if(135270405==x){if(t=this.atomExpressionAt(++A),m=this.viewer.getAtomPointVector(t),null==m&&this.errorAt(22,A),A=this.iToken,v=this.getPointVector(this.getToken(++A),A),(null==v||m.size()!=v.size())&&this.errorAt(22,A),r=new JU.M4,j[0]=new JU.P3,f=1,0.001<(this.chk?0:J.util.Measure.getTransformMatrix4(m,v,r,j[0])))v=null}else 12==x&&(r=this.theToken.value);m=new JU.M3;null!=r?(n=new JU.V3,r.get(n),r.getRotationScale(m)):m=
this.theToken.value;m=this.chk?new J.util.Quaternion:J.util.Quaternion.newM(m);p.setT(m.getNormal());d=m.getTheta();g=!0;break;default:this.invArg()}A=this.iToken}if(!this.chk){null!=k&&3.4028235E38!=d&&(a=!0,e=d);b&&null==c&&(c=this.viewer.getSelectionSet(!1));null!=t&&(b=!0,null==c&&(c=t));q=1.4E-45==e?10:3.4028235E38==d?e:0>e==0<d?-d/e:e;if(null!=k){if(!a){this.viewer.setDihedrals(k,null,1);return}n=null}null!=m&&(0==f&&null!=n&&(j[0]=this.viewer.getAtomSetCenter(null!=c?c:b?this.viewer.getSelectionSet(!1):
this.viewer.getAllAtoms())),u&&null!=n&&(j[1]=JU.P3.newP(j[0]),j[1].add(n),r=J.util.Measure.computeHelicalAxis(null,135266306,j[0],j[1],m),j[0]=r[0],u=r[3].x,0!=u&&(n=r[1],p=JU.V3.newV(n),0>u&&p.scale(-1)),r=null),a&&null==r&&(r=J.script.ScriptMathProcessor.getMatrix4f(m.getMatrix(),n)),null!=j[0]&&(f=1));if(null!=w&&(this.viewer.invertAtomCoordPt(w,c),null==p)||null!=s&&(this.viewer.invertAtomCoordPlane(s,c),null==p))return;if(2>f&&null==k){if(!g){if(a&&null==c&&!this.useThreads())return;if(this.viewer.rotateAxisAngleAtCenter(this,
j[0],p,q,d,a,c)&&this.isJS&&a&&null==c)throw new J.script.ScriptInterruption(this,"rotate",1);return}0==f&&(j[0]=new JU.P3);j[1]=JU.P3.newP(j[0]);j[1].add(p);f=2}0==f&&(j[0]=new JU.P3);if(2>f||0==j[0].distance(j[1]))j[1]=JU.P3.newP(j[0]),j[1].y+=1;3.4028235E38==d&&(d=0);0!=d&&(null!=n&&!h)&&n.scale(d/n.length());if(a&&null!=n&&(0==d||0==e))d=0.01,q=1.4E-45==e?0.01:0>e?-d/e:0.01*e/n.length();null!=c&&(a&&null==v&&null!=r)&&(m=this.viewer.getAtomPointVector(c),v=J.util.Measure.transformPoints(m,r,j[0]));
if(null!=c&&!a&&null!=v)this.viewer.setAtomCoords(c,1146095626,v);else if(this.useThreads()&&this.viewer.rotateAboutPointsInternal(this,j[0],j[1],q,d,a,c,n,v,k)&&this.isJS&&a)throw new J.script.ScriptInterruption(this,"rotate",1);}},"~B,~B");d(c$,"getQuaternionParameter",function(a){switch(this.tokAt(a)){case 7:a=this.getToken(a).getList();var b=null;(0==a.size()||null==(b=J.script.SV.pt4Value(a.get(0))))&&this.invArg();return J.util.Quaternion.newP4(b);case 1073741863:return this.chk?null:J.util.Quaternion.newP4(J.util.Escape.uP(this.viewer.getOrientationText(1073741863,
null)));default:return J.util.Quaternion.newP4(this.getPoint4f(a))}},"~N");d(c$,"getPointVector",function(a,b){switch(a.tok){case 10:return this.viewer.getAtomPointVector(a.value);case 7:for(var c=new JU.List,e,d=a.getList(),l=0;l<d.size();l++)if(null!=(e=J.script.SV.ptValue(d.get(l))))c.addLast(e);else return null;return c}return 0<b?this.viewer.getAtomPointVector(this.atomExpressionAt(b)):null},"J.script.T,~N");d(c$,"getObjectCenter",function(a,b,c){a=[a,Integer.$valueOf(b),Integer.$valueOf(c)];
return this.getShapePropertyData(22,"getCenter",a)||this.getShapePropertyData(24,"getCenter",a)||this.getShapePropertyData(28,"getCenter",a)||this.getShapePropertyData(25,"getCenter",a)||this.getShapePropertyData(27,"getCenter",a)?a[2]:null},"~S,~N,~N");d(c$,"getObjectBoundingBox",function(a){a=[a,null,null];return this.getShapePropertyData(24,"getBoundingBox",a)||this.getShapePropertyData(28,"getBoundingBox",a)||this.getShapePropertyData(25,"getBoundingBox",a)||this.getShapePropertyData(27,"getBoundingBox",
a)?a[2]:null},"~S");d(c$,"getDrawObjectAxis",function(a,b){var c=[a,Integer.$valueOf(b),null];return this.getShapePropertyData(22,"getSpinAxis",c)?c[2]:null},"~S,~N");d(c$,"script",function(a,b,c){var e=!0,d=!1,l=!1,g=0,h=0,k=0,m=0,j=2,p=null,n=null,r=null,q=null;if(135287308==a)this.checkLength(2),this.chk||this.viewer.jsEval(this.parameterAsString(1));else{if(null==b&&null==c)if(a=this.tokAt(1),4!=a&&this.error(16),b=this.parameterAsString(1),b.equalsIgnoreCase("applet")){a=this.parameterAsString(2);
c=this.parameterExpressionString(3,0);this.checkLast(this.iToken);if(this.chk)return;if(0==a.length||a.equals("all"))a="*";if(!a.equals(".")&&(this.viewer.jsEval(a+"\u0001"+c),!a.equals("*")))return}else{a=this.tokAt(this.slen-1);l=266298==a;b.equalsIgnoreCase("inline")&&(c=this.parameterExpressionString(2,l?this.slen-1:0),j=this.iToken+1);for(;b.equalsIgnoreCase("localPath")||b.equalsIgnoreCase("remotePath")||b.equalsIgnoreCase("scriptPath");)b.equalsIgnoreCase("localPath")?p=this.parameterAsString(j++):
b.equalsIgnoreCase("scriptPath")?r=this.parameterAsString(j++):n=this.parameterAsString(j++),b=this.parameterAsString(j++);b.startsWith("?")&&this.viewer.isJS&&(b=this.loadFileAsync("SCRIPT_",b,j,!0));if(1073741878==(a=this.tokAt(j)))d=!0,a=this.tokAt(++j);1073742050==a&&(e=!1,a=this.tokAt(++j));if(1073741998==a||1141899268==a)j++,k=g=Math.max(this.intParameter(j++),0),this.checkToken(j)&&(k=269484192==this.getToken(j).tok?this.checkToken(++j)?this.intParameter(j++):0:-this.intParameter(j++),0>=k&&
this.invArg());else if(1073741890==a||1073741892==a)j++,h=Math.max(this.intParameter(j++)-1,0),m=h+1,this.checkToken(j)&&(m=269484192==this.getToken(j).tok?this.checkToken(++j)?this.intParameter(j++):0:-this.intParameter(j++),0>=m&&this.invArg());269484048==this.tokAt(j)&&(q=this.parameterExpressionList(j,-1,!1),j=this.iToken+1);this.checkLength(l?j+1:j)}if(!this.chk||this.isCmdLine_c_or_C_Option){this.isCmdLine_c_or_C_Option&&(d=!0);a=this.chk;j=this.isCmdLine_c_or_C_Option;d&&(this.chk=this.isCmdLine_c_or_C_Option=
!0);this.pushContext(null,"SCRIPT");this.contextPath+=" >> "+b;if(null==c?this.compileScriptFileInternal(b,p,n,r):this.compileScript(null,c,!1)){this.pcEnd=m;for(this.lineEnd=k;h<this.lineNumbers.length&&this.lineNumbers[h]<g;)h++;this.pc=h;b=this.isCmdLine_C_Option;this.isCmdLine_C_Option=(new Boolean(this.isCmdLine_C_Option&e)).valueOf();this.executionStepping=(new Boolean(this.executionStepping|l)).valueOf();this.contextVariables=new java.util.Hashtable;this.contextVariables.put("_arguments",null==
q?J.script.SV.getVariableAI([]):J.script.SV.getVariableList(q));d&&(this.listCommands=!0);(e=this.viewer.getBoolean(603979934))&&J.util.Logger.startTimer("script");this.dispatchCommands(!1,!1);e&&this.showString(J.util.Logger.getTimerMsg("script",0));this.isCmdLine_C_Option=b;this.popContext(!1,!1)}else J.util.Logger.error(J.i18n.GT._("script ERROR: ")+this.errorMessage),this.popContext(!1,!1),j?this.setErrorMessage(null):this.evalError(null,null);this.chk=a;this.isCmdLine_c_or_C_Option=j}}},"~N,~S,~S");
d(c$,"$function",function(){if(!this.chk||this.isCmdLine_c_or_C_Option){var a=this.getToken(0).value;this.viewer.isFunction(a)||this.error(10);var b=1==this.slen||3==this.slen&&269484048==this.tokAt(1)&&269484049==this.tokAt(2)?null:this.parameterExpressionList(1,-1,!1);this.chk||this.runFunctionRet(null,a,b,null,!1,!0,!0)}});d(c$,"sync",function(){this.checkLength(-3);var a="",b="",c=JU.PT.parseInt(this.optParameterAsString(1));if(-2147483648==c)switch(c=0,this.slen){case 1:b="*";a="ON";break;case 2:b=
this.parameterAsString(1);if(0==b.indexOf("jmolApplet")||JU.PT.isOneOf(b,";*;.;^;")){a="ON";this.chk||this.viewer.syncScript(a,b,0);b=".";break}a=b;b="*";break;case 3:b=this.parameterAsString(1),a=528443==this.tokAt(2)?"GET_GRAPHICS":this.parameterAsString(2)}else a=2==this.slen?null:this.parameterAsString(2),b=null;this.chk||this.viewer.syncScript(a,b,c)});d(c$,"history",function(a){if(1==this.slen)this.showString(this.viewer.getSetHistory(2147483647));else if(2==a)a=this.intParameter(this.checkLast(2)),
0>a&&this.invArg(),this.chk||this.viewer.getSetHistory(0==a?0:-2-a);else switch(this.getToken(this.checkLast(1)).tok){case 1048589:case 1073741882:this.chk||this.viewer.getSetHistory(-2147483648);break;case 1048588:this.chk||this.viewer.getSetHistory(0);break;default:this.errorStr(24,"ON, OFF, CLEAR")}},"~N");d(c$,"display",function(a){var b=null,c=0,e=1,d;switch(d=this.tokAt(1)){case 1276118017:case 1073742119:c=d,d=this.tokAt(++e)}var l=1087373318==d;l&&(d=this.tokAt(++e));switch(d){case 1048583:this.setObjectProperty();
return;case 0:break;default:b=4==this.slen&&1678770178==this.tokAt(2)?new J.modelset.BondSet(J.util.BSUtil.newBitSet2(0,this.viewer.modelSet.bondCount)):this.atomExpressionAt(e)}this.chk||(r(b,J.modelset.BondSet)?this.viewer.displayBonds(b,a):this.viewer.displayAtoms(b,a,l,c,this.tQuiet))},"~B");d(c$,"$delete",function(){if(1048583==this.tokAt(1))this.setObjectProperty();else{var a=1==this.slen?null:this.atomExpression(this.st,1,0,!0,!1,!0,!1);this.chk||(null==a&&(a=this.viewer.getAllAtoms()),a=this.viewer.deleteAtoms(a,
!1),this.tQuiet||this.scriptLevel>this.scriptReportingLevel||this.scriptStatusOrBuffer(J.i18n.GT.i(J.i18n.GT._("{0} atoms deleted"),a)))}});d(c$,"select",function(a){if(1==this.slen)this.viewer.select(null,!1,0,this.tQuiet||this.scriptLevel>this.scriptReportingLevel);else if(!(2==this.slen&&1073742072==this.tokAt(1)))if(this.viewer.setNoneSelected(4==this.slen&&1048587==this.tokAt(2)),10==this.tokAt(2)&&r(this.getToken(2).value,J.modelset.BondSet)||1678770178==this.tokAt(2)&&10==this.getToken(3).tok)this.slen!=
this.iToken+2&&this.invArg(),this.chk||this.viewer.selectBonds(this.theToken.value);else if(1746538509==this.tokAt(2))(5!=this.slen||10!=this.getToken(3).tok)&&this.invArg(),this.chk||this.setShapeProperty(6,"select",this.theToken.value);else{var b=0,c=!1;if(0==this.getToken(1).intValue&&1048588!=this.theTok)a=this.parameterExpressionToken(0).value,r(a,JU.BS)||this.invArg(),this.checkLast(this.iToken);else{c=this.tokAt(a);switch(c){case 1048589:case 1048588:if(this.chk||this.viewer.setSelectionHalos(1048589==
c),c=this.tokAt(++a),0==c)return}switch(c){case 1276118017:case 1073742119:b=c,c=this.tokAt(++a)}(c=1087373318==c)&&this.tokAt(++a);a=this.atomExpressionAt(a)}if(!this.chk)if(this.isBondSet)this.viewer.selectBonds(a);else{if(a.length()>this.viewer.getAtomCount()){var e=this.viewer.getAllAtoms();e.and(a);a=e}this.viewer.select(a,c,b,this.tQuiet||this.scriptLevel>this.scriptReportingLevel)}}},"~N");d(c$,"subset",function(){var a=null;this.chk||this.viewer.setSelectionSubset(null);if(1!=this.slen&&(4!=
this.slen||!this.getToken(2).value.equals("off")))a=this.atomExpressionAt(1);this.chk||this.viewer.setSelectionSubset(a)});d(c$,"invertSelected",function(){var a=null,b=null,c=null,e=-2147483648;switch(this.tokAt(1)){case 0:if(this.chk)return;c=this.viewer.getSelectionSet(!1);a=this.viewer.getAtomSetCenter(c);this.viewer.invertAtomCoordPt(a,c);return;case 528443:e=this.atomExpressionAt(2).nextSetBit(0);c=this.atomExpressionAt(this.iToken+1);break;case 135266320:a=this.centerParameter(2);break;case 135266319:b=
this.planeParameter(2);break;case 135267841:b=this.hklParameter(2)}this.checkLengthErrorPt(this.iToken+1,1);null==b&&(null==a&&-2147483648==e)&&this.invArg();this.chk||-1!=e&&this.viewer.invertSelected(a,b,e,c)});d(c$,"translate",function(a){var b=null,c=1,b=0;1114638363==this.tokAt(1)&&(a=!0,b=1,c=2);if(this.isPoint3f(c)){var e=this.getPoint3f(c,!0),b=!a&&this.iToken+1<this.slen?this.atomExpressionAt(++this.iToken):null;this.checkLast(this.iToken);this.chk||this.viewer.setAtomCoordsRelative(e,b)}else{e=
(this.parameterAsString(c).toLowerCase()+" ").charAt(0);0>"xyz".indexOf(e)&&this.error(0);var d=this.floatParameter(++c);switch(this.tokAt(++c)){case 0:case 10:case 1048577:c="\x00";break;default:c=(this.optParameterAsString(c).toLowerCase()+"\x00").charAt(0)}0==d&&"\x00"!=c||(this.iToken=b+("\x00"==c?2:3),b=a?this.viewer.getSelectionSet(!1):this.iToken+1<this.slen?this.atomExpressionAt(++this.iToken):null,this.checkLast(this.iToken),this.chk||this.viewer.translate(e,d,c,b))}},"~B");d(c$,"zap",function(a){if(1==
this.slen||!a)(a=a&&!this.isStateScript)&&this.viewer.cacheFileByName(null,!1),this.viewer.zap(!0,a,!0),this.refresh();else if(a=this.atomExpressionAt(1),!this.chk){a=this.viewer.deleteAtoms(a,!0);var b=this.tQuiet||this.scriptLevel>this.scriptReportingLevel;b||this.scriptStatusOrBuffer(J.i18n.GT.i(J.i18n.GT._("{0} atoms deleted"),a));this.viewer.select(null,!1,0,b)}},"~B");d(c$,"zoom",function(a){if(!a){var b=1<this.slen?this.getToken(1).tok:1048589;switch(b){case 1048589:case 1048588:2<this.slen&&
this.error(2);this.chk||this.setBooleanProperty("zoomEnabled",1048589==b);return}}var c=null,e=1,b=a?this.isFloatParameter(e)?this.floatParameter(e++):2:0;0>b&&(e--,b=0);var d=0,l=null;this.isCenterParameter(e)?(d=e,c=this.centerParameter(e),r(this.expressionResult,JU.BS)&&(l=this.expressionResult),e=this.iToken+1):2==this.tokAt(e)&&0==this.getToken(e).intValue&&(l=this.viewer.getAtomBitSet("visible"),c=this.viewer.getAtomSetCenter(l));var g=this.viewer.getZoomSetting(),l=this.getZoom(d,e,l,g),e=
this.iToken+1,h=g=NaN;e!=this.slen&&(g=this.floatParameter(e++),h=this.floatParameter(e++));e!=this.slen&&this.invArg();0>l&&(l=-l,a&&(1==this.slen?l*=2:null==c&&(l/=2)));a=this.viewer.getMaxZoomPercent();(5>l||l>a)&&this.numberOutOfRange(5,a);this.viewer.isWindowCentered()||(null!=c&&(a=this.atomExpressionAt(d),this.chk||this.viewer.setCenterBitSet(a,!1)),c=this.viewer.getRotationCenter(),Float.isNaN(g)&&(g=this.viewer.getTranslationXPercent()),Float.isNaN(h)&&(h=this.viewer.getTranslationYPercent()));
if(!this.chk&&(this.viewer.moveTo(this,b,c,J.viewer.JC.center,NaN,null,l,g,h,NaN,null,NaN,NaN,NaN,NaN,NaN,NaN),this.isJS&&0<b&&this.viewer.global.waitForMoveTo))throw new J.script.ScriptInterruption(this,"zoomTo",1);},"~B");d(c$,"getZoom",function(a,b,c,e){var d=this.isFloatParameter(b)?this.floatParameter(b++):NaN;if(0==d||0==e)e=NaN,null==c?1048583==this.tokAt(a)&&(d=this.getObjectBoundingBox(this.objectNameParameter(a+1)),(null==d||0==(e=d[0].distance(d[1])/2))&&this.invArg()):e=this.viewer.calcRotationRadiusBs(c),
Float.isNaN(e)&&this.invArg(),e=100*(this.viewer.getFloat(570425388)/e),d=NaN;if(0>d)d+=e;else if(Float.isNaN(d))switch(a=this.tokAt(b),a){case 1073742079:case 1073741980:d=e*(1073742079==a?0.5:2);b++;break;case 269484208:case 269484209:case 269484193:c=this.floatParameter(++b);b++;switch(a){case 269484208:d=e/c;break;case 269484209:d=e*c;break;case 269484193:d=e+c}break;default:d=null==c?-e:e}this.iToken=b-1;return d},"~N,~N,JU.BS,~N");d(c$,"delay",function(){var a=0;switch(this.getToken(1).tok){case 1048589:a=
1;break;case 2:a=1E3*this.intParameter(1);break;case 3:a=z(1E3*this.floatParameter(1));break;default:this.error(34)}!this.chk&&(!this.viewer.isHeadless()&&!this.viewer.autoExit)&&(this.refresh(),this.doDelay(Math.abs(a)))});d(c$,"slab",function(a){var b=!1,c=null;if(this.isCenterParameter(1)||9==this.tokAt(1))c=this.planeParameter(1);else switch(this.getToken(1).tok){case 2:c=this.intParameter(this.checkLast(1));this.chk||(a?this.viewer.depthToPercent(c):this.viewer.slabToPercent(c));return;case 1048589:this.checkLength(2),
b=!0;case 1048588:this.checkLength(2);this.setBooleanProperty("slabEnabled",b);return;case 4141:this.checkLength(2);if(this.chk)return;this.viewer.slabReset();this.setBooleanProperty("slabEnabled",!0);return;case 1085443:this.checkLength(2);if(this.chk)return;this.viewer.setSlabDepthInternal(a);this.setBooleanProperty("slabEnabled",!0);return;case 269484192:b=this.parameterAsString(2);b.equalsIgnoreCase("hkl")?c=this.hklParameter(3):b.equalsIgnoreCase("plane")&&(c=this.planeParameter(3));null==c&&
this.invArg();c.scale(-1);break;case 135266319:switch(this.getToken(2).tok){case 1048587:break;default:c=this.planeParameter(2)}break;case 135267841:c=1048587==this.getToken(2).tok?null:this.hklParameter(2);break;case 1073742118:return;default:this.invArg()}this.chk||this.viewer.slabInternal(c,a)},"~B");d(c$,"ellipsoid",function(){var a=0,b=1,c=3.4028235E38,e=!1,d=!1;this.setShapeProperty(20,"thisID",null);switch(this.getToken(1).tok){case 1048589:a=2147483647;break;case 1048588:break;case 2:a=this.intParameter(1);
break;case 1085443:this.sm.loadShape(20);this.setShapeProperty(20,"select",this.parameterAsString(2));b=this.iToken;d=e=!0;break;case 1074790550:case 269484209:case 1073741824:this.sm.loadShape(20);1074790550==this.theTok&&b++;this.setShapeId(20,b,!1);b=this.iToken;e=!0;break;default:this.invArg()}if(e){for(;++b<this.slen;){a=this.parameterAsString(b);e=null;this.getToken(b);if(!d)switch(this.theTok){case 1048583:a="points";e=Array(3);e[0]=this.objectNameParameter(++b);if(this.chk)continue;this.getShapePropertyData(24,
"getVertices",e);break;case 1611272194:for(var e=Array(3),l=0;3>l;l++)e[l]=new JU.V3,e[l].setT(this.centerParameter(++b)),b=this.iToken;break;case 12289:e=this.centerParameter(++b);b=this.iToken;break;case 1095761935:e=Integer.$valueOf(this.intParameter(++b));break;case 12291:e=Boolean.TRUE,this.checkLength(b+1)}if(null==e)switch(this.theTok){case 1048589:a="on";e=Boolean.TRUE;break;case 1048588:a="on";e=Boolean.FALSE;break;case 1073742138:e=Float.$valueOf(this.floatParameter(++b));break;case 10:case 1048577:a=
"atoms";e=this.atomExpressionAt(b);b=this.iToken;break;case 1766856708:case 603979967:case 1073742074:c=this.getColorTrans(b,!0);b=this.iToken;continue;case 1073742075:e=this.parameterAsString(++b)}null==e&&this.invArg();this.setShapeProperty(20,a.toLowerCase(),e)}this.finalizeObject(20,this.colorArgb[0],c,0,!1,null,0,null);this.setShapeProperty(20,"thisID",null)}else this.setShapeSizeBs(20,a,null)});d(c$,"getShapeNameParameter",function(a){var b=this.parameterAsString(a),c=b.equals("*");0==b.length&&
this.invArg();if(c)switch(this.tokAt(a+1)){case 0:case 1048589:case 1048588:case 3145768:case 3145770:case 1766856708:case 12291:break;default:if(this.setMeshDisplayProperty(-1,0,this.tokAt(a+1)))break;b+=this.optParameterAsString(++a)}269484209==this.tokAt(a+1)&&(b+=this.parameterAsString(++a));this.iToken=a;return b},"~N");d(c$,"setShapeId",function(a,b,c){c&&this.invArg();b=this.getShapeNameParameter(b).toLowerCase();this.setShapeProperty(a,"thisID",b);return b},"~N,~N,~B");d(c$,"setAtomShapeSize",
function(a,b){var c=null,e=!1;switch(this.tokAt(1)){case 1073742072:this.restrictSelected(!1,!1);break;case 1048589:break;case 1048588:b=0;break;case 3:e=0>this.floatParameter(1);default:c=this.encodeRadiusParameter(1,e,!0),Float.isNaN(c.value)&&this.invArg()}null==c&&(c=new J.atomdata.RadiusData(null,b,J.atomdata.RadiusData.EnumType.FACTOR,J.constant.EnumVdw.AUTO));e&&this.restrictSelected(!1,!1);this.setShapeSize(a,c)},"~N,~N");d(c$,"encodeRadiusParameter",function(a,b,c){var e=NaN,d=J.atomdata.RadiusData.EnumType.ABSOLUTE,
l=null,g=-1==a?1649412120:this.getToken(a).tok;switch(g){case 1112539137:case 1112539138:case 1112541195:case 1114638362:case 1112541199:case 1649412120:e=1,d=J.atomdata.RadiusData.EnumType.FACTOR,l=1649412120==g?null:J.constant.EnumVdw.getVdwType2(J.script.T.nameOf(g)),g=this.tokAt(++a)}switch(g){case 4141:return this.viewer.getDefaultRadiusData();case 1073741852:case 1073742116:case 1073741856:case 1073741858:case 1073741992:e=1;d=J.atomdata.RadiusData.EnumType.FACTOR;this.iToken=a-1;break;case 269484193:case 2:case 3:if(269484193==
g)a++;else if(269484210==this.tokAt(a+1)){e=Math.round(this.floatParameter(a));this.iToken=++a;d=J.atomdata.RadiusData.EnumType.FACTOR;(0>e||200<e)&&this.integerOutOfRange(0,200);e/=100;break}else if(2==g){e=this.intParameter(a);(749<e||-200>e)&&this.integerOutOfRange(-200,749);0<e?(e/=250,d=J.atomdata.RadiusData.EnumType.ABSOLUTE):(e/=-100,d=J.atomdata.RadiusData.EnumType.FACTOR);break}269484193==g||!c?(d=J.atomdata.RadiusData.EnumType.OFFSET,e=16):(d=J.atomdata.RadiusData.EnumType.ABSOLUTE,l=J.constant.EnumVdw.NADA,
e=100);e=this.floatParameterRange(a,b||!c?-e:0,e);b&&(e=-e);16<e&&(e=16.1);break;default:1==e&&a--}null==l&&(l=J.constant.EnumVdw.getVdwType(this.optParameterAsString(++this.iToken)),null==l&&(this.iToken=a,l=J.constant.EnumVdw.AUTO));return new J.atomdata.RadiusData(null,e,d,l)},"~N,~B,~B");d(c$,"structure",function(){var a=J.constant.EnumStructure.getProteinStructureType(this.parameterAsString(1));a===J.constant.EnumStructure.NOT&&this.invArg();var b=null;switch(this.tokAt(2)){case 10:case 1048577:b=
this.atomExpressionAt(2);this.checkLast(this.iToken);break;default:this.checkLength(2)}this.chk||(this.clearDefinedVariableAtomSets(),this.viewer.setProteinType(a,b))});d(c$,"wireframe",function(){var a=-2147483648;4141==this.tokAt(1)?this.checkLast(1):a=this.getMadParameter();this.chk||(this.setShapeProperty(1,"type",Integer.$valueOf(1023)),this.setShapeSizeBs(1,-2147483648==a?300:a,null))});d(c$,"ssbond",function(){var a=this.getMadParameter();this.setShapeProperty(1,"type",Integer.$valueOf(256));
this.setShapeSizeBs(1,a,null);this.setShapeProperty(1,"type",Integer.$valueOf(1023))});d(c$,"hbond",function(){if(2==this.slen&&4102==this.getToken(1).tok){if(!this.chk){var a=this.viewer.autoHbond(null,null,!1);this.scriptStatusOrBuffer(J.i18n.GT.i(J.i18n.GT._("{0} hydrogen bonds"),Math.abs(a)))}}else 2==this.slen&&12291==this.getToken(1).tok?this.chk||this.connect(0):(a=this.getMadParameter(),this.setShapeProperty(1,"type",Integer.$valueOf(30720)),this.setShapeSizeBs(1,a,null),this.setShapeProperty(1,
"type",Integer.$valueOf(1023)))});d(c$,"vector",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 1048589:break;case 1048588:b=0;break;case 2:b=this.intParameterRange(1,0,19);break;case 3:a=J.atomdata.RadiusData.EnumType.ABSOLUTE;b=this.floatParameterRange(1,0,3);break;default:this.error(6)}break;case 3:if(1073742138==this.tokAt(1)){this.setFloatProperty("vectorScale",this.floatParameterRange(2,-100,
100));return}}this.setShapeSize(18,new J.atomdata.RadiusData(null,b,a,null))});d(c$,"vibration",function(){this.checkLength(-3);var a=0;switch(this.getToken(1).tok){case 1048589:this.checkLength(2);a=this.viewer.getFloat(570425412);break;case 1048588:this.checkLength(2);a=0;break;case 2:case 3:this.checkLength(2);a=this.floatParameter(1);break;case 1073742138:this.setFloatProperty("vibrationScale",this.floatParameterRange(2,-100,100));return;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.viewer.setVibrationOff():this.viewer.setVibrationPeriod(-a))});d(c$,"dots",function(a){this.chk||this.sm.loadShape(a);this.setShapeProperty(a,"init",null);for(var b=NaN,c=J.atomdata.RadiusData.EnumType.ABSOLUTE,e=1;;){switch(this.getToken(e).tok){case 1073742072:this.restrictSelected(!1,!1);b=1;c=J.atomdata.RadiusData.EnumType.FACTOR;break;case 1048589:b=1;c=J.atomdata.RadiusData.EnumType.FACTOR;
break;case 1048588:b=0;break;case 1073741976:this.setShapeProperty(a,"ignore",this.atomExpressionAt(e+1));e=this.iToken+1;continue;case 2:var d=this.intParameter(e);if(1666189314==this.tokAt(e+1)){e++;this.setShapeProperty(a,"atom",Integer.$valueOf(d));this.setShapeProperty(a,"radius",Float.$valueOf(this.floatParameter(++e)));1766856708==this.tokAt(++e)&&(this.setShapeProperty(a,"colorRGB",Integer.$valueOf(this.getArgbParam(++e))),e++);10!=this.getToken(e).tok&&this.invArg();this.setShapeProperty(a,
"dots",this.st[e].value);return}}break}b=Float.isNaN(b)?this.encodeRadiusParameter(e,!1,!0):new J.atomdata.RadiusData(null,b,c,J.constant.EnumVdw.AUTO);Float.isNaN(b.value)&&this.invArg();this.setShapeSize(a,b)},"~N");d(c$,"proteinShape",function(a){var b=0;switch(this.getToken(1).tok){case 1073742072:if(this.chk)return;this.restrictSelected(!1,!1);b=-1;break;case 1048589:b=-1;break;case 1048588:break;case 1641025539:b=-2;break;case 1112541199:case 1073741922:b=-4;break;case 2:b=8*this.intParameterRange(1,
0,1E3);break;case 3:b=Math.round(2E3*this.floatParameterRange(1,-4,4));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");d(c$,"animation",function(){var a=!1;switch(this.getToken(1).tok){case 1048589:a=!0;case 1048588:this.chk||this.viewer.setAnimationOn(a);break;case 1073742031:a=z(this.floatParameter(2));this.chk||this.viewer.setAnimMorphCount(Math.abs(a));
break;case 1610625028:this.iToken=2;a=1048579==this.tokAt(2)?null:this.atomExpressionAt(2);this.checkLength(this.iToken+1);this.chk||this.viewer.setAnimDisplay(a);break;case 4115:if(this.isArrayParameter(2)){var b=this.floatParameterSet(2,0,2147483647);this.checkLength(this.iToken+1);if(this.chk)break;for(var a=N(b.length,0),c=b.length;0<=--c;)a[c]=z(b[c]);c=new java.util.Hashtable;c.put("frames",a);c.put("currentFrame",Integer.$valueOf(0));this.viewer.setMovie(c)}else this.model(2);break;case 1073742024:c=
a=1;5<this.slen&&this.error(2);b=null;switch(J.script.T.getTokFromName(this.parameterAsString(2))){case 1073742070:b=J.constant.EnumAnimationMode.ONCE;a=c=0;break;case 528410:b=J.constant.EnumAnimationMode.LOOP;break;case 1073742082:b=J.constant.EnumAnimationMode.PALINDROME;break;default:this.invArg()}4<=this.slen&&(a=c=this.floatParameter(3),5==this.slen&&(c=this.floatParameter(4)));this.chk||this.viewer.setAnimationReplayMode(b,a,c);break;case 1073741918:c=2;a=0;switch(this.tokAt(c)){case 269484192:a=
-this.intParameter(++c);break;case 269484193:a=this.intParameter(++c);break;case 2:a=this.intParameter(c);break;default:this.invArg()}this.checkLength(++c);1!=a&&-1!=a&&this.errorStr2(35,"-1","1");this.chk||this.viewer.setAnimationDirection(a);break;case 1074790526:this.setIntProperty("animationFps",this.intParameter(this.checkLast(2)));break;default:this.frameControl(1)}});d(c$,"assign",function(){var a=this.tokAt(1),b=this.atomExpressionAt(2).nextSetBit(0),c=-1,e=null;if(!(0>b)){4106==a?c=this.atomExpressionAt(++this.iToken).nextSetBit(0):
e=this.parameterAsString(++this.iToken);var d=++this.iToken<this.slen?this.centerParameter(this.iToken):null;if(!this.chk)switch(a){case 1141899265:this.clearDefinedVariableAtomSets();this.viewer.assignAtom(b,d,e);break;case 1678770178:this.viewer.assignBond(b,(e+"p").charAt(0));break;case 4106:this.viewer.assignConnect(b,c)}}});d(c$,"file",function(){var a=this.intParameter(this.checkLast(1));if(!this.chk){var b=this.viewer.getModelNumberIndex(1E6*a+1,!1,!1),c=-1;0<=b&&(c=this.viewer.getModelNumberIndex(1E6*
(a+1)+1,!1,!1),0>c&&(c=this.viewer.getModelCount()),c--);this.viewer.setAnimationOn(!1);this.viewer.setAnimationDirection(1);this.viewer.setAnimationRange(b,c);this.viewer.setCurrentModelIndex(-1)}});d(c$,"fixed",function(){var a=1==this.slen?null:this.atomExpressionAt(1);this.chk||this.viewer.setMotionFixedAtoms(a)});d(c$,"model",function(a){var b=4115==this.theTok,c=!0;if(1==this.slen&&1==a){var e=this.viewer.getCurrentModelIndex(),d;if(!this.chk&&0<=e&&0<=(d=this.viewer.getJmolDataSourceFrame(e)))this.viewer.setCurrentModelIndex(d==
e?-2147483648:d)}else{switch(this.tokAt(1)){case 2:if(b&&2==this.slen){this.chk||this.viewer.setFrame(this.intParameter(1));return}break;case 1048577:case 10:d=this.atomExpressionAt(1).nextSetBit(0);this.checkLength(this.iToken+1);if(this.chk||0>d)return;c=new JU.BS;c.set(d);this.viewer.setCurrentModelIndex(this.viewer.getModelBitSet(c,!1).nextSetBit(0));return;case 1073741904:this.iToken=1;c=2==this.tokAt(2)?this.intParameter(++this.iToken):1;this.checkLength(this.iToken+1);!this.chk&&0<c&&this.viewer.createModels(c);
return;case 1074790550:this.checkLength(3);e=this.stringParameter(2);this.chk||this.viewer.setCurrentModelID(e);return;case 528397:c=0;this.checkLength(3);switch(this.getToken(2).tok){case 2:case 3:c=Clazz_floatToLong(1E3*this.floatParameter(2));break;default:this.error(20)}this.chk||this.viewer.setFrameDelayMs(c);return;case 1073742166:0<this.checkLength23()&&(this.chk||this.viewer.setFrameTitleObj(2==this.slen?"@{_modelName}":7==this.tokAt(2)?J.script.SV.listValue(this.st[2]):this.parameterAsString(2)));
return;case 1073741832:c=2==this.slen||1048587==this.tokAt(2)?null:this.atomExpressionAt(2);this.chk||this.viewer.setFrameOffsets(c);return}if(269484192==this.getToken(a).tok)++a,(2!=this.getToken(this.checkLast(a)).tok||1!=this.intParameter(a))&&this.invArg(),this.chk||this.viewer.setAnimation(1073742108);else{var l=b=!1,g=!1,h=!1,k=[-1,-1],m=0,j=0,n=this.viewer.haveFileSet();for(d=a;d<this.slen;d++)switch(this.getToken(d).tok){case 1048579:case 269484209:this.checkLength(a+(l?2:1));g=!0;break;case 269484192:1!=
m&&this.invArg();h=!0;break;case 1048587:this.checkLength(a+1);break;case 3:if(c=!1,0>(j=this.floatParameter(d))){this.checkLength(d+1);this.chk||this.viewer.morph(-j);return}case 2:case 4:2==m&&this.invArg();e=4==this.theTok?J.script.ScriptEvaluator.getFloatEncodedInt(this.theToken.value):this.theToken.intValue;0>e&&1==m&&(h=!0,e=-e,n&&1E6>e&&(e*=1E6));3==this.theTok&&(n&&j==z(j))&&(e=1E6*z(j));if(2147483647==e){if(1==d&&(e=this.theToken.value.toString(),e=this.chk?-1:this.viewer.getModelIndexFromId(e),
0<=e)){this.checkLength(2);this.viewer.setCurrentModelIndex(e);return}e=0}if(-1==e){this.checkLength(a+1);this.chk||this.viewer.setAnimation(1073742108);return}1E3<=e&&(1E6>e&&n)&&(e=1E6*G(e/1E3)+e%1E3);!c&&(0==e&&0==m)&&(g=!0);1E6<=e&&(c=!1);k[m++]=e;break;case 1073742096:b=!0;break;case 1073742114:l=!0;break;default:this.frameControl(a);return}l&&0==m&&(g=!0);if(!this.chk)if(g)this.viewer.setAnimationOn(!1),this.viewer.setAnimationRange(-1,-1),l||this.viewer.setCurrentModelIndex(-1);else{2==m&&
!l&&(h=!0);if(n)c=!1;else if(c)for(d=0;d<m;d++)0<=k[d]&&(k[d]%=1E6);e=this.viewer.getModelNumberIndex(k[0],c,!1);a=-1;if(n&&0>e&&0!=k[0])if(1E6>k[0]&&(k[0]*=1E6),2==m&&1E6>k[1]&&(k[1]*=1E6),0==k[0]%1E6)k[0]++,e=this.viewer.getModelNumberIndex(k[0],!1,!1),0<=e&&(a=this.viewer.getModelNumberIndex(1==m?k[0]+1E6:0==k[1]?-1:0==k[1]%1E6?k[1]+1000001:k[1]+1,!1,!1),0>a&&(a=this.viewer.getModelCount()),a--,l?m=2:!h&&a!=e&&(h=!0),l=l||e==a);else return;(!b&&!l||0<=e)&&this.viewer.setCurrentModelIndexClear(e,
!1);if(b&&2==m||l||h)0>a&&(a=this.viewer.getModelNumberIndex(k[1],c,!1)),this.viewer.setAnimationOn(!1),this.viewer.setAnimationDirection(1),this.viewer.setAnimationRange(e,a),this.viewer.setCurrentModelIndexClear(h&&!l?-1:0<=e?e:0,!1);b&&this.viewer.setAnimation(266287)}}}},"~N");d(c$,"bitSetForModelFileNumber",function(a){var b=J.util.BSUtil.newBitSet(this.viewer.getAtomCount());if(this.chk)return b;var c=this.viewer.getModelCount(),e=this.viewer.haveFileSet();1E6>a&&e&&(a*=1E6);if(0==a%1E6){e=
this.viewer.getModelNumberIndex(a+1,!1,!1);if(0>e)return b;a=0==a?c:this.viewer.getModelNumberIndex(a+1000001,!1,!1);0>e&&(e=0);0>a&&(a=c);this.viewer.isTrajectory(e)&&(a=e+1);for(c=e;c<a;c++)b.or(this.viewer.getModelUndeletedAtomsBitSet(c))}else c=this.viewer.getModelNumberIndex(a,!1,!0),0<=c&&b.or(this.viewer.getModelUndeletedAtomsBitSet(c));return b},"~N");d(c$,"frameControl",function(a){switch(this.getToken(this.checkLast(a)).tok){case 1073742098:case 1073742096:case 266287:case 20487:case 1073742037:case 1073742108:case 1073742126:case 1073741942:case 1073741993:this.chk||
this.viewer.setAnimation(this.theTok);return}this.invArg()},"~N");d(c$,"getShapeType",function(a){a=J.viewer.JC.shapeTokenIndex(a);0>a&&this.error(49);return a},"~N");d(c$,"font",function(a,b){var c="SansSerif",e="Plain",d=0,l=-1;switch(this.iToken=this.slen){case 6:l=this.floatParameter(5),5<=l&&(l=this.viewer.getZoomSetting()/l/this.viewer.getScalePixelsPerAngstrom(!1));case 5:1073741824!=this.getToken(4).tok&&this.invArg(),e=this.parameterAsString(4);case 4:1073741824!=this.getToken(3).tok&&this.invArg();
c=this.parameterAsString(3);this.isFloatParameter(2)||this.error(34);b=this.floatParameter(2);a=this.getShapeType(this.getToken(1).tok);break;case 3:this.isFloatParameter(2)||this.error(34);-1==a?(a=this.getShapeType(this.getToken(1).tok),b=this.floatParameter(2)):1<=b&&(b+=d=5);break;default:if(5==a){b=13;break}this.error(2)}5==a&&((0>b||1<=b&&(6>b||63<b))&&this.integerOutOfRange(6-d,63-d),this.setShapeProperty(5,"setDefaults",this.viewer.getNoneSelected()));this.chk||(0<=J.util.GData.getFontStyleID(c)&&
(e=c,c="SansSerif"),c=this.viewer.getFont3D(c,e,b),this.sm.loadShape(a),this.setShapeProperty(a,"font",c),0<=l&&this.setShapeProperty(a,"scalereference",Float.$valueOf(l)))},"~N,~N");d(c$,"set",function(){if(1==this.slen)this.showString(this.viewer.getAllSettings(null));else{var a=this.parameterAsString(0).equals("set"),b=this.optParameterAsString(1);if(a&&2==this.slen&&0<=b.indexOf("?"))this.showString(this.viewer.getAllSettings(b.substring(0,b.indexOf("?"))));else{var c=this.getToken(1).tok,e=0,
d,l=2147483647,g=!this.chk&&!this.tQuiet&&this.scriptLevel<=this.scriptReportingLevel&&!this.st[0].value.equals("var");switch(c){case 1611272194:this.axes(2);return;case 1610616835:this.background(2);return;case 1679429641:this.boundbox(2);return;case 1611272202:this.frank(2);return;case 1610616855:this.history(2);return;case 1826248715:this.label(2);return;case 1614417948:this.unitcell(2);return;case 536870920:this.sm.loadShape(8);this.setShapeProperty(8,"highlight",1048588==this.tokAt(2)?null:this.atomExpressionAt(2));
return;case 1610625028:case 1611141171:this.selectionHalo(2);return;case 536875070:this.timeout(2);return}switch(c){case 1641025539:g=J.constant.EnumStructure.getProteinStructureType(this.parameterAsString(2));g===J.constant.EnumStructure.NOT&&this.invArg();a=this.floatParameterSet(3,0,2147483647);0!=a.length%4&&this.invArg();this.viewer.setStructureList(a,g);this.checkLast(this.iToken);return;case 545259526:l=this.getArgbParam(2);this.chk||this.setObjectArgb("axes",l);return;case 1610612737:this.setBondmode();
return;case 536870916:if(this.chk)return;a=1048588==this.tokAt(2)||2==this.tokAt(2)&&0==this.intParameter(2)?4:5;J.util.Logger.setLogLevel(a);this.setIntProperty("logLevel",a);4==a&&(this.viewer.setDebugScript(!1),g&&this.viewer.showParameter("debugScript",!0,80));this.setDebugging();g&&this.viewer.showParameter("logLevel",!0,80);return;case 537022465:this.setEcho();return;case 1610612738:this.font(5,2==this.checkLength23()?0:this.floatParameter(2));return;case 1612189718:this.setHbond();return;case 1746538509:case 537006096:this.setMonitor();
return;case 1611141176:this.setSsbond();return;case 1610612741:this.setLabel("toggle");return;case 536870930:this.setUserColors();return;case 553648188:this.setZslab();return}var h=!0;switch(c){case 536870914:if(2<this.slen){a=this.stringSetting(2,!1);g=!1;0>a.indexOf(".")?(a=JU.PT.parseInt(a),g=!0):a=J.script.ScriptEvaluator.getFloatEncodedInt(a);if(this.chk)return;g=this.viewer.getModelNumberIndex(a,g,!0);this.viewer.setBackgroundModelIndex(g);return}break;case 1649412120:if(this.chk)return;this.viewer.setAtomProperty(this.viewer.getAllAtoms(),
1649412120,-1,NaN,null,null,null);switch(this.tokAt(2)){case 1073742109:this.runScript("#VDW radii for PROBE;{_H}.vdw = 1.0;{_H and connected(_C) and not connected(within(smiles,'[a]'))}.vdw = 1.17;{_C}.vdw = 1.75;{_C and connected(3) and connected(_O)}.vdw = 1.65;{_N}.vdw = 1.55;{_O}.vdw = 1.4;{_P}.vdw = 1.8;{_S}.vdw = 1.8;message VDW radii for H, C, N, O, P, and S set according to Word, et al., J. Mol. Biol. (1999) 285, 1711-1733");return}e=545259555;case 545259555:2<this.slen&&(d=3==this.slen&&
null==J.constant.EnumVdw.getVdwType(this.parameterAsString(2))?this.stringSetting(2,!1):this.parameterAsString(2),null==J.constant.EnumVdw.getVdwType(d)&&this.invArg(),this.setStringProperty(b,d));break;case 536870918:if(2<this.slen){d=this.parameterExpressionToken(2);if(8==d.tok)d=d.value;else{var k=d.asInt();d=new JU.P3;555<=k&&J.util.SimpleUnitCell.ijkToPoint3f(k+111,d,0)}this.chk||this.viewer.setDefaultLattice(d)}break;case 545259552:case 545259545:2<this.slen&&(d=1073741992==(this.theTok=this.tokAt(2))||
1073742116==this.theTok?this.parameterAsString(this.checkLast(2)):this.stringSetting(2,!1),this.setStringProperty(b,d));break;case 1632634891:l=this.intSetting(2);-2147483648==l&&this.invArg();this.chk||this.viewer.setFormalCharges(l);return;case 553648148:l=this.intSetting(2);this.chk||(-2147483648!=l&&(this.commandHistoryLevelMax=l),this.setIntProperty(b,l));break;case 545259564:2<this.slen&&this.setStringProperty(b,this.stringSetting(2,a));break;case 545259568:case 545259558:2<this.slen&&this.setUnits(this.stringSetting(2,
a),c);break;case 545259572:this.chk||this.viewer.setPicked(-1);if(2<this.slen){this.setPicking();return}break;case 545259574:if(2<this.slen){this.setPickingStyle();return}break;case 1716520985:break;case 553648168:l=this.intSetting(2);!this.chk&&-2147483648!=l&&this.setIntProperty(b,this.scriptReportingLevel=l);break;case 536870924:l=this.intSetting(2);if(-2147483648==l||0==l||1==l){h=!1;break}c=553648174;b="specularPercent";this.setIntProperty(b,l);break;case 1650071565:c=553648178;b="strandCount";
this.setIntProperty(b,this.intSetting(2));break;default:h=!1}if(!h||g){k=!h&&!a&&null!=this.getContextVariableAsVariable(b);if(!h&&!k)switch(c){case 1678770178:e=603979928;break;case 1613758470:e=603979908;break;case 1613758476:e=603979910;break;case 1610612739:e=603979879;break;case 1666189314:e=570425394;this.setFloatProperty("solventProbeRadius",this.floatSetting(2));h=!0;break;case 1610612740:e=570425390;break;case 1613758488:e=603979948;break;case 1766856708:e=545259545;break;case 1611141175:d=
this.parameterAsString(2).toLowerCase();switch("x;y;z;fps".indexOf(d+";")){case 0:e=570425398;break;case 2:e=570425400;break;case 4:e=570425402;break;case 6:e=570425396;break;default:this.errorStr2(50,"set SPIN ",d)}this.chk||this.viewer.setSpin(d,z(this.floatParameter(this.checkLast(3))));h=!0}if(0!=e)b=J.script.T.nameOf(c=e);else if(!h&&!k){(0==b.length||"_"==b.charAt(0))&&this.error(56);e=b.toLowerCase();if(0==e.indexOf("label")&&JU.PT.isOneOf(b.substring(5).toLowerCase(),";front;group;atom;offset;offsetexact;pointer;alignment;toggle;scalereference;")&&
this.setLabel(b.substring(5)))return;if(a&&0==e.indexOf("shift_")){g=this.floatParameter(2);this.checkLength(3);this.chk||this.viewer.getNMRCalculation().setChemicalShiftReference(e.substring(6),g);return}e.endsWith("callback")&&(c=536870912)}a&&!J.script.T.tokAttr(c,536870912)&&(this.iToken=1,this.isStateScript||this.errorStr2(50,"SET",b),this.warning(51,"SET",b));if(!h&&a)switch(this.slen){case 2:this.setBooleanProperty(b,!0);h=!0;break;case 3:2147483647!=l&&(this.setIntProperty(b,l),h=!0)}!h&&
(!a&&1048587==this.tokAt(2))&&(this.chk||this.viewer.removeUserVariable(b.toLowerCase()),h=!0);if(!h&&(l=1048577==this.tokAt(1)?0:this.tokAt(2),c=this.st[0].intValue,d=269484436==l?3:61==c&&!b.equals("return")&&269484436!=l?0:2,this.setVariable(d,0,b,c),!a))return;g&&this.viewer.showParameter(b,!0,80)}}}});d(c$,"setZslab",function(){var a=null;this.isFloatParameter(2)?(this.checkLength(3),this.setIntProperty("zSlab",z(this.floatParameter(2)))):(this.isCenterParameter(2)||this.invArg(),a=this.centerParameter(2),
this.checkLength(this.iToken+1));this.chk||this.viewer.setZslabPoint(a)});d(c$,"setBondmode",function(){var a=!1;switch(this.getToken(this.checkLast(2)).tok){case 269484128:break;case 269484112:a=!0;break;default:this.invArg()}this.setBooleanProperty("bondModeOr",a)});d(c$,"setEcho",function(){var a=null,b=null,c=null,e=!0,d=2;switch(this.getToken(2).tok){case 1048588:c=a="allOff";this.checkLength(++d);break;case 1048587:e=!1;case 1048579:c=this.parameterAsString(2);this.checkLength(++d);break;case 1073741996:case 12289:case 1073742128:case 1074790748:case 1073742019:case 1073741871:case 1073741824:case 4:case 1074790550:1074790550==
this.theTok&&d++,c=this.parameterAsString(d++)}this.chk||(this.viewer.setEchoStateActive(e),this.sm.loadShape(30),null!=c&&this.setShapeProperty(30,null==a?"target":a,c));if(d<this.slen)switch(this.getToken(d++).tok){case 1073741832:a="align";switch(this.getToken(d).tok){case 1073741996:case 1073742128:case 12289:b=this.parameterAsString(d++);break;default:this.invArg()}break;case 12289:case 1073741996:case 1073742128:a="align";b=this.parameterAsString(d-1);break;case 554176526:a="%zpos";b=Integer.$valueOf(z(this.floatParameter(d++)));
break;case 1610625028:case 3145768:case 1048589:a="hidden";b=Boolean.FALSE;break;case 12294:case 3145770:a="hidden";b=Boolean.TRUE;break;case 1095766030:b=this.chk?0:this.modelNumberParameter(d++);b>=this.viewer.getModelCount()&&this.invArg();a="model";b=Integer.$valueOf(b);break;case 269484096:case 1073742195:a="xypos";b=this.xypParameter(--d);null==b?d--:d=this.iToken+1;break;case 2:d--;c=this.intParameter(d++);e="xpos";269484210==this.tokAt(d)&&(e="%xpos",d++);a="ypos";b=Integer.$valueOf(this.intParameter(d++));
269484210==this.tokAt(d)&&(a="%ypos",d++);this.checkLength(d);this.setShapeProperty(30,e,Integer.$valueOf(c));break;case 1048588:a="off";break;case 1073742138:a="scale";b=Float.$valueOf(this.floatParameter(d++));break;case 135271429:a="script";b=this.parameterAsString(d++);break;case 4:case 1073741979:(a=1073741979==this.theTok)&&d++;this.checkLength(d);null==c&&a&&(b=Array(1),this.getShapePropertyData(30,"currentTarget",b),c=b[0]);this.echo(d-1,c,a);return;case 135266320:a="point";b=this.isCenterParameter(d)?
this.centerParameter(d):null;d=this.iToken+1;break;default:if(this.isCenterParameter(d-1)){a="xyz";b=this.centerParameter(d-1);d=this.iToken+1;break}this.invArg()}this.checkLength(d);!this.chk&&null!=a&&this.setShapeProperty(30,a,b)});d(c$,"intSetting",function(a){return a==this.slen?-2147483648:this.parameterExpressionToken(a).asInt()},"~N");d(c$,"floatSetting",function(a){return a==this.slen?NaN:J.script.SV.fValue(this.parameterExpressionToken(a))},"~N");d(c$,"stringSetting",function(a,b){return b&&
this.slen==a+1?this.parameterAsString(a):this.parameterExpressionToken(a).asString()},"~N,~B");d(c$,"setLabel",function(a){this.sm.loadShape(5);var b=null;for(this.setShapeProperty(5,"setDefaults",this.viewer.getNoneSelected());;){if(a.equals("scalereference")){b=this.floatParameter(2);5<=b&&(b=this.viewer.getZoomSetting()/b/this.viewer.getScalePixelsPerAngstrom(!1));b=Float.$valueOf(b);break}if(a.equals("offset")||a.equals("offsetexact")){if(this.isPoint3f(2))b=this.getPoint3f(2,!1),b=[1,b.x,b.y,
b.z,0,0,0];else if(this.isArrayParameter(2))b=this.floatParameterSet(2,7,7);else var b=this.intParameterRange(2,-127,127),c=this.intParameterRange(3,-127,127),b=Integer.$valueOf(J.viewer.JC.getOffset(b,c));break}if(a.equals("alignment")){switch(this.getToken(2).tok){case 1073741996:case 1073742128:case 12289:a="align";b=this.theToken.value;break;default:this.invArg()}break}if(a.equals("pointer")){b=0;switch(this.getToken(2).tok){case 1048588:case 1048587:break;case 1610616835:b|=2;case 1048589:b|=
1;break;default:this.invArg()}b=Integer.$valueOf(b);break}if(a.equals("toggle"))return this.iToken=1,c=2==this.slen?null:this.atomExpressionAt(2),this.checkLast(this.iToken),this.chk||this.viewer.togglePickingLabel(c),!0;this.iToken=1;b=2==this.slen||1048589==this.getToken(2).tok;if(a.equals("front")||a.equals("group")){!b&&1048588!=this.tokAt(2)&&this.invArg();b||(a="front");b=b?Boolean.TRUE:Boolean.FALSE;break}if(a.equals("atom")){!b&&1048588!=this.tokAt(2)&&this.invArg();a="front";b=b?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");d(c$,"setMonitor",function(){var a=this.tokAt(this.checkLast(2));switch(a){case 1048589:case 1048588:this.setBooleanProperty("measurementlabels",1048589==a);return;case 1073741926:case 2:case 3:this.viewer.loadShape(6);this.setShapeSizeBs(6,this.getSetAxesTypeMad(2),null);
return}this.setUnits(this.parameterAsString(2),545259568)});d(c$,"setUnits",function(a,b){545259568==b&&(a.endsWith("hz")||JU.PT.isOneOf(a.toLowerCase(),";angstroms;au;bohr;nanometers;nm;picometers;pm;vanderwaals;vdw;"))?this.chk||this.viewer.setUnits(a,!0):545259558==b&&JU.PT.isOneOf(a.toLowerCase(),";kcal;kj;")?this.chk||this.viewer.setUnits(a,!1):this.errorStr2(50,"set "+J.script.T.nameOf(b),a);return!0},"~S,~N");d(c$,"setSsbond",function(){var a=!1;switch(this.tokAt(this.checkLast(2))){case 1115297793:a=
!0;break;case 3145754:break;default:this.invArg()}this.setBooleanProperty("ssbondsBackbone",a)});d(c$,"setHbond",function(){var a=!1;switch(this.tokAt(this.checkLast(2))){case 1115297793:a=!0;case 3145754:this.setBooleanProperty("hbondsBackbone",a);break;case 1073742150:a=!0;case 1073741926:this.setBooleanProperty("hbondsSolid",a);break;default:this.invArg()}});d(c$,"setPicking",function(){if(2==this.slen)this.setStringProperty("picking","identify");else if(4<this.slen||4==this.tokAt(2))this.setStringProperty("picking",
this.stringSetting(2,!1));else{var a=2,b="SELECT";switch(this.getToken(2).tok){case 135280132:case 1746538509:case 1611141175:4==this.checkLength34()&&(b=this.parameterAsString(2).toUpperCase(),b.equals("SPIN")?this.setIntProperty("pickingSpinRate",this.intParameter(3)):a=3);break;case 12291:break;default:this.checkLength(3)}var c=this.parameterAsString(a);switch(this.getToken(a).tok){case 1048589:case 1073742056:c="identify";break;case 1048588:case 1048587:c="off";break;case 135280132:c="atom";break;
case 1826248715:c="label";break;case 1678770178:c="bond";break;case 12291:this.checkLength(4),1678770178!=this.tokAt(3)&&this.invArg(),c="deleteBond"}var e=0<=(e=c.indexOf("_"))?e:c.length,e=J.viewer.ActionManager.getPickingMode(c.substring(0,e));0>e&&this.errorStr2(50,"SET PICKING "+b,c);this.setStringProperty("picking",c)}});d(c$,"setPickingStyle",function(){if(4<this.slen||4==this.tokAt(2))this.setStringProperty("pickingStyle",this.stringSetting(2,!1));else{var a=2,b=!1,c="SELECT";switch(this.getToken(2).tok){case 1746538509:b=
!0,c="MEASURE";case 135280132:4==this.checkLength34()&&(a=3);break;default:this.checkLength(3)}var e=this.parameterAsString(a);switch(this.getToken(a).tok){case 1048587:case 1048588:e=b?"measureoff":"toggle";break;case 1048589:b&&(e="measure")}0>J.viewer.ActionManager.getPickingStyleIndex(e)&&this.errorStr2(50,"SET PICKINGSTYLE "+c,e);this.setStringProperty("pickingStyle",e)}});d(c$,"timeout",function(a){var b=null,c=null,e=0;if(this.slen==a)this.showString(this.viewer.showTimeout(null));else{for(;a<
this.slen;a++)switch(this.getToken(a).tok){case 1074790550:b=this.parameterAsString(++a);if(3==this.slen){this.chk||this.viewer.triggerTimeout(b);return}break;case 1048588:break;case 2:e=this.intParameter(a);break;case 3:e=Math.round(1E3*this.floatParameter(a));break;default:null==b?b=this.parameterAsString(a):null==c?c=this.parameterAsString(a):this.invArg()}this.chk||this.viewer.setTimeout(b,e,c)}},"~N");d(c$,"setUserColors",function(){for(var a=new JU.List,b=2;b<this.slen;b++){var c=this.getArgbParam(b);
a.addLast(Integer.$valueOf(c));b=this.iToken}if(!this.chk){b=a.size();for(c=N(b,0);0<=--b;)c[b]=a.get(b).intValue();this.viewer.setUserScale(c)}});d(c$,"setVariable",function(a,b,c,e){var d=null,l="",g=0,h=91==e,k=!1,m=!1,j=c.startsWith("property_"),n=c.equals("all");e=j||n?null:this.getContextVariableAsVariable(c);var z=null!=e;0<a&&1048577==this.tokAt(a-1)&&(d=this.atomExpressionAt(a-1),a=this.iToken+1,m=!0);1048584==this.tokAt(a)&&(k=!0,l=this.getBitsetPropertySelector(++a,!0),null==l&&this.invArg(),
269484436!=this.tokAt(++a)&&this.invArg(),a++,g=l.intValue,l=l.value);m&&!k&&this.invArg();a=this.parameterExpression(a,b,c,!0,!0,-1,h,null,null);if(!n&&(b=a.size(),(0==b||!h&&1<b||h&&(3>b||1!=b%2))&&this.invArg(),!this.chk)){b=a.get(h?a.size()-1:0);if(!z&&!m&&!j&&(h||k||!r(b.value,String)&&!(2==b.tok||r(b.value,Integer)||r(b.value,Float)||r(b.value,Boolean))))c.startsWith("_")&&this.errorStr(22,c),e=this.viewer.getOrSetNewVariable(c,!0),z=!0;if(h){c=J.script.SV.newS("").setv(b,!1);d=G(a.size()/2);
for(g=0;g<d;g++)if(l=g+1==d,h=a.get(2*g),10==e.tok&&(e.tok=6,e.value=new java.util.Hashtable),6==e.tok){h=h.asString();e=e.value;if(l){e.put(h,c);break}e=e.get(h)}else{h=h.asInt();7==e.tok&&(e=J.script.SV.selectItemVar(e));switch(e.tok){case 7:k=e.getList();if(h>k.size()||l)break;0>=h&&(h=k.size()+h);0>--h&&(h=0);e=k.get(h);continue;case 11:case 12:l=11==e.tok?3:4;if(1==d&&1<=Math.abs(h)&&Math.abs(h)<=l&&7==c.tok&&c.getList().size()==l)break;if(2==d&&(k=a.get(2).asInt(),1<=k&&k<=l&&(2==c.tok||3==
c.tok))){h=10*h+k;break}e.toArray();--g;continue}e.setSelectedValue(h,c);break}}else k?(m||(d=J.script.SV.getBitSet(e,!0),null==d&&this.invArg()),l.startsWith("property_")?this.viewer.setData(l,[l,7==b.tok?J.script.SV.flistValue(b,b.value.size()==d.cardinality()?d.cardinality():this.viewer.getAtomCount()):b.asString(),J.util.BSUtil.copy(d),Integer.$valueOf(7==b.tok?1:0)],this.viewer.getAtomCount(),0,0,7==b.tok?2147483647:-2147483648,0):this.setBitsetProperty(d,g,b.asInt(),b.asFloat(),b)):z?e.setv(b,
!1):(h=J.script.SV.oValue(b),c.startsWith("property_")?(7==b.tok&&(h=b.asString()),this.viewer.setData(c,[c,""+h,J.util.BSUtil.copy(this.viewer.getSelectionSet(!1)),Integer.$valueOf(0)],this.viewer.getAtomCount(),0,0,-2147483648,0)):r(h,Boolean)?this.setBooleanProperty(c,h.booleanValue()):r(h,Integer)?this.setIntProperty(c,h.intValue()):r(h,Float)?this.setFloatProperty(c,h.floatValue()):r(h,String)?this.setStringProperty(c,h):r(h,J.modelset.BondSet)?this.setStringProperty(c,J.util.Escape.eBond(h)):
r(h,JU.BS)||r(h,JU.P3)||r(h,JU.P4)?this.setStringProperty(c,J.util.Escape.e(h)):J.util.Logger.error("ERROR -- return from propertyExpression was "+h))}},"~N,~N,~S,~N");d(c$,"axes",function(a){var b=this.checkTicks(a,!0,!0,!1);a=this.iToken+1;var c=this.tokAt(a),e=this.optParameterAsString(a).toLowerCase();if(this.slen==a+1&&JU.PT.isOneOf(e,";window;unitcell;molecular;"))this.setBooleanProperty("axes"+e,!0);else{switch(c){case 12289:a=this.centerParameter(a+1);this.setShapeProperty(31,"origin",a);
this.checkLast(this.iToken);return;case 1073742138:this.setFloatProperty("axesScale",this.floatParameter(this.checkLast(++a)));return;case 1826248715:switch(c=this.tokAt(a+1)){case 1048588:case 1048589:this.checkLength(a+2);this.setShapeProperty(31,"labels"+(1048589==c?"On":"Off"),null);return}b=null;switch(this.slen-a){case 7:this.setShapeProperty(31,"labels",[this.parameterAsString(++a),this.parameterAsString(++a),this.parameterAsString(++a),this.parameterAsString(++a),this.parameterAsString(++a),
this.parameterAsString(++a)]);break;case 5:b=this.parameterAsString(a+4);case 4:this.setShapeProperty(31,"labels",[this.parameterAsString(++a),this.parameterAsString(++a),this.parameterAsString(++a),b]);break;default:this.error(2)}return}e.equals("position")?(1048588==this.tokAt(++a)?a=new JU.P3:(a=this.xypParameter(a),null==a&&this.invArg()),this.setShapeProperty(31,"position",a)):(a=this.getSetAxesTypeMad(a),this.chk||(this.setObjectMad(31,"axes",a),null!=b&&this.setShapeProperty(31,"tickInfo",
b)))}},"~N");d(c$,"boundbox",function(a){var b=this.checkTicks(a,!1,!0,!1);a=this.iToken+1;var c=1;if(1073742138==this.tokAt(a)&&(c=this.floatParameter(++a),!this.chk&&0==c&&this.invArg(),a++,a==this.slen)){this.chk||this.viewer.setBoundBox(null,null,!0,c);return}var e=1073741902==this.tokAt(a);e&&a++;if(this.isCenterParameter(a)){this.expressionResult=null;var d=a,l=this.centerParameter(a);a=this.iToken+1;if(e||this.isCenterParameter(a))d=e?this.centerParameter(a):this.getPoint3f(a,!0),a=this.iToken+
1,this.chk||this.viewer.setBoundBox(l,d,e,c);else if(null!=this.expressionResult&&r(this.expressionResult,JU.BS))this.chk||this.viewer.calcBoundBoxDimensions(this.expressionResult,c);else if(null==this.expressionResult&&1048583==this.tokAt(d)){if(this.chk)return;a=this.getObjectBoundingBox(this.objectNameParameter(++d));null==a&&this.invArg();this.viewer.setBoundBox(a[0],a[1],!0,c);a=this.iToken+1}else this.invArg();if(a==this.slen)return}c=this.getSetAxesTypeMad(a);this.chk||(null!=b&&this.setShapeProperty(32,
"tickInfo",b),this.setObjectMad(32,"boundbox",c))},"~N");d(c$,"checkTicks",function(a,b,c,e){this.iToken=a-1;if(1073742164!=this.tokAt(a))return null;var d=" ";switch(this.tokAt(a+1)){case 1112541205:case 1112541206:case 1112541207:d=this.parameterAsString(++a).toLowerCase();break;case 1073741824:this.invArg()}if(1048587==this.tokAt(++a))return b=new J.modelset.TickInfo(null),b.type=d,this.iToken=a,b;b=new J.modelset.TickInfo(this.getPointOrPlane(a,!1,!0,!1,!1,3,3));if(this.coordinatesAreFractional||
1614417948==this.tokAt(this.iToken+1))b.scale=JU.P3.new3(NaN,NaN,NaN),c=!1;1614417948==this.tokAt(this.iToken+1)&&this.iToken++;b.type=d;1288701960==this.tokAt(this.iToken+1)&&(b.tickLabelFormats=this.stringParameterSet(this.iToken+2));if(!c)return b;1073742138==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));e&&1073741942==this.tokAt(this.iToken+1)&&(b.first=this.floatParameter(this.iToken+
2));return b},"~N,~B,~B,~B");d(c$,"unitcell",function(a){var b=2147483647,c=2147483647,d=null,f=this.checkTicks(a,!0,!1,!1);a=this.iToken;var l=null,g=null;switch(this.tokAt(a+1)){case 4:l=this.objectNameParameter(++a);break;case 1048583:a++;l=this.objectNameParameter(++a);break;case 10:case 1048577:a=this.atomExpressionAt(1).nextSetBit(0);this.chk||this.viewer.setCurrentAtom(a);if(0>a)return;a=this.iToken;break;case 12289:++a;switch(this.tokAt(++a)){case 10:case 1048577:d=JU.P3.newP(this.viewer.getAtomSetCenter(this.atomExpressionAt(a)));
this.viewer.toFractional(d,!0);a=this.iToken;break;default:if(this.isCenterParameter(a)){d=this.centerParameter(a);a=this.iToken;break}this.invArg()}d.x-=0.5;d.y-=0.5;d.z-=0.5;break;default:this.isArrayParameter(a+1)?(g=this.getPointArray(++a,4),a=this.iToken):this.slen==a+2?2==this.getToken(a+1).tok&&111<=this.intParameter(a+1)&&(b=this.intParameter(++a)):this.slen>a+1&&(d=this.getPointOrPlane(++a,!1,!0,!1,!0,3,3),a=this.iToken)}c=this.getSetAxesTypeMad(++a);this.checkLast(this.iToken);this.chk||
(2147483647==c&&this.viewer.setCurrentAtom(-1),2147483647!=b?this.viewer.setCurrentUnitCellOffset(null,b):null!=l?this.viewer.setCurrentCage(l):null!=g&&this.viewer.setCurrentCagePts(g),this.setObjectMad(33,"unitCell",c),null!=d&&this.viewer.setCurrentUnitCellOffset(d,0),null!=f&&this.setShapeProperty(33,"tickInfo",f))},"~N");d(c$,"frank",function(a){this.setBooleanProperty("frank",this.booleanParameter(a))},"~N");d(c$,"selectionHalo",function(a){var b=!1;switch(a==this.slen?1048589:this.getToken(a).tok){case 1048589:case 1114638363:b=
!0;case 1048588:case 1048587:case 1073742056:this.setBooleanProperty("selectionHalos",b);break;default:this.invArg()}},"~N");d(c$,"save",function(){if(1<this.slen){var a=this.optParameterAsString(2);switch(this.tokAt(1)){case 1073742077:case 1073742132:this.chk||this.viewer.saveOrientation(a,null);return;case 1678770178:this.chk||this.viewer.saveBonds(a);return;case 1073742158:this.chk||this.viewer.saveState(a);return;case 1641025539:this.chk||this.viewer.saveStructure(a);return;case 1048582:this.chk||
this.viewer.saveCoordinates(a,this.viewer.getSelectionSet(!1));return;case 1073742140:this.chk||this.viewer.saveSelection(a);return}}this.errorStr2(53,"SAVE","bonds? coordinates? orientation? selection? state? structure?")});d(c$,"restore",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 d="";switch(b){case 1073742077:d="Orientation";
this.viewer.restoreOrientation(a,c);break;case 1073742132:d="Rotation";this.viewer.restoreRotation(a,c);break;case 1073742139:d="Scene",this.viewer.restoreScene(a,c)}if(this.isJS&&0<c&&this.viewer.global.waitForMoveTo)throw new J.script.ScriptInterruption(this,"restore"+d,1);return}this.checkLength23();switch(b){case 1678770178:this.chk||this.viewer.restoreBonds(a);return;case 1048582:if(this.chk)return;a=this.viewer.getSavedCoordinates(a);null==a&&this.invArg();this.runScript(a);this.viewer.checkCoordinatesChanged();
return;case 1073742140:this.chk||this.viewer.restoreSelection(a);return;case 1073742158:if(this.chk)return;a=this.viewer.getSavedState(a);null==a&&this.invArg();this.runScript(a);return;case 1641025539:if(this.chk)return;a=this.viewer.getSavedStructure(a);null==a&&this.invArg();this.runScript(a);return}}this.errorStr2(53,"RESTORE","bonds? coords? orientation? rotation? scene? selection? state? structure?")});d(c$,"getColorTrans",function(a){var b=3.4028235E38;1766856708!=this.theTok&&--a;switch(this.tokAt(a+
1)){case 603979967:a++;b=this.isFloatParameter(a+1)?this.getTranslucentLevel(++a):this.viewer.getFloat(570425354);break;case 1073742074:a++,b=0}this.isColorParam(a+1)?this.colorArgb[0]=this.getArgbParam(++a):1048587==this.tokAt(a+1)?(this.colorArgb[0]=0,this.iToken=a+1):3.4028235E38==b?this.invArg():this.colorArgb[0]=-2147483648;return b},"~N,~B");d(c$,"finalizeObject",function(a,b,c,d,f,l,g,h){f&&this.setShapeProperty(a,"set",l);-2147483648!=b&&this.setShapePropertyBs(a,"color",Integer.$valueOf(b),
h);3.4028235E38!=c&&this.setShapeTranslucency(a,"","translucent",c,h);0!=d&&this.setShapeProperty(a,"scale",Integer.$valueOf(d));0<g&&(this.setMeshDisplayProperty(a,g,0)||this.invArg())},"~N,~N,~N,~N,~B,~O,~N,JU.BS");d(c$,"getColorRange",function(a){a=this.getArgbParam(a);1074790746!=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 J.util.ColorEncoder.getColorSchemeList(J.util.ColorEncoder.getPaletteAtoB(a,
b,c))},"~N");d(c$,"getIsosurfaceDataRange",function(a,b){var c=this.getShapeProperty(a,"dataRange");return null!=c&&3.4028235E38!=c[0]&&c[0]!=c[1]?b+"isosurface full data range "+c[0]+" to "+c[1]+" with color scheme spanning "+c[2]+" to "+c[3]:""},"~N,~S");d(c$,"setMeshDisplayProperty",function(a,b,c){var d=null,f=null,l=25==a,g=0==b;g||(c=this.getToken(b).tok);switch(c){case 1766856708:if(l)this.iToken++;else break;case 1073742074:case 603979967:return g||this.colorShape(a,this.iToken,!1),!0;case 0:case 12291:case 1048589:case 1048588:case 12294:case 3145770:case 1610625028:case 3145768:1==
this.iToken&&(0<=a&&0==this.tokAt(2))&&this.setShapeProperty(a,"thisID",null);if(0==c)return 1==this.iToken;if(g)return!0;switch(c){case 12291:return this.setShapeProperty(a,"delete",null),!0;case 3145770:case 12294:c=1048588;break;case 3145768:c=1048589;break;case 1610625028:b+1==this.slen&&(c=1048589);break}case 1073741958:case 1073741862:case 1073741964:case 1073741898:case 1073742039:case 1113198595:case 1073742042:case 1073742018:case 1073742052:case 1073741938:case 1073742046:case 1073742182:case 1073742060:case 1073741960:case 1073742058:d=
"token",f=Integer.$valueOf(c)}if(null==d)return!1;if(g)return!0;this.setShapeProperty(a,d,f);0!=this.tokAt(this.iToken+1)&&(this.setMeshDisplayProperty(a,++this.iToken,0)||--this.iToken);return!0},"~N,~N,~N");d(c$,"bind",function(){var a=this.stringParameter(1),b=this.parameterAsString(2);this.checkLength(3);this.chk||this.viewer.bindAction(a,b)});d(c$,"unbind",function(){1!=this.slen&&this.checkLength23();var a=this.optParameterAsString(1),b=this.optParameterAsString(2);if(0==a.length||1048579==
this.tokAt(1))a=null;if(0==b.length||1048579==this.tokAt(2))b=null;null==b&&(null!=a&&0<=J.viewer.ActionManager.getActionFromName(a))&&(b=a,a=null);this.chk||this.viewer.unBindAction(a,b)});d(c$,"undoRedoMove",function(){var a=1,b=2;switch(this.tokAt(1)){case 0:b=1;break;case 1048579:a=0;break;case 2:a=this.intParameter(1);break;default:this.invArg()}this.checkLength(b);this.chk||this.viewer.undoMoveAction(this.tokAt(0),a)});c$.getFloatEncodedInt=d(c$,"getFloatEncodedInt",function(a){var b=a.indexOf(".");
if(1>b||"-"==a.charAt(0)||a.endsWith(".")||a.contains(".0"))return 2147483647;var c=0,d=0;if(0<b)try{c=Integer.parseInt(a.substring(0,b)),0>c&&(c=-c)}catch(f){if(B(f,NumberFormatException))c=-1;else throw f;}if(b<a.length-1)try{d=Integer.parseInt(a.substring(b+1))}catch(l){if(!B(l,NumberFormatException))throw l;}c=1E6*c+d;return 0>c?2147483647:c},"~S");c$.getPartialBondOrderFromFloatEncodedInt=d(c$,"getPartialBondOrderFromFloatEncodedInt",function(a){return(G(a/1E6)%6<<5)+(a%1E6&31)},"~N");c$.getBondOrderFromString=
d(c$,"getBondOrderFromString",function(a){return 0>a.indexOf(" ")?J.util.JmolEdge.getBondOrderFromString(a):0==a.toLowerCase().indexOf("partial ")?J.script.ScriptEvaluator.getPartialBondOrderFromString(a.substring(8).trim()):131071},"~S");c$.getPartialBondOrderFromString=d(c$,"getPartialBondOrderFromString",function(a){return J.script.ScriptEvaluator.getPartialBondOrderFromFloatEncodedInt(J.script.ScriptEvaluator.getFloatEncodedInt(a))},"~S");n(c$,"addHydrogensInline",function(a,b,c){var d=this.viewer.getAtomModelIndex(a.nextSetBit(0));
if(d!=this.viewer.modelSet.modelCount-1)return new JU.BS;a=this.viewer.getModelUndeletedAtomsBitSet(d);this.viewer.setAppendNew(!1);for(var f=this.viewer.modelSet.getAtomCount(),l=this.viewer.modelSet.getAtomCountInModel(d),g=new JU.SB,h=0;h<b.size();h++){var k=b.get(h);g.append(";  connect 0 100 ").append("({"+f++ +"}) ").append("({"+k.index+"}) group;")}b=new JU.SB;b.appendI(c.length).append("\n").append("Viewer.AddHydrogens").append("#noautobond").append("\n");for(h=0;h<c.length;h++)b.append("H ").appendF(c[h].x).append(" ").appendF(c[h].y).append(" ").appendF(c[h].z).append(" - - - - ").appendI(++l).appendC("\n");
this.viewer.openStringInlineParamsAppend(b.toString(),null,!0);this.runScriptBuffer(g.toString(),null);c=this.viewer.getModelUndeletedAtomsBitSet(d);c.andNot(a);return c},"JU.BS,JU.List,~A");n(c$,"stopScriptThreads",function(){null!=this.scriptDelayThread&&(this.scriptDelayThread.interrupt(),this.scriptDelayThread=null);null!=this.fileLoadThread&&(this.fileLoadThread.interrupt(),this.fileLoadThread.resumeEval(),null!=this.thisContext&&this.popContext(!1,!1),this.fileLoadThread=null)});d(c$,"delayScript",
function(a){this.viewer.autoExit||(this.stopScriptThreads(),this.scriptDelayThread=new J.script.ScriptDelayThread(this,this.viewer,a),this.scriptDelayThread.run())},"~N");d(c$,"getErrorLineMessage2",function(){return J.script.ScriptEvaluator.getErrorLineMessage(this.functionName,this.scriptFileName,this.getLinenumber(null),this.pc,J.script.ScriptEvaluator.statementAsString(this.viewer,this.st,-9999,this.logMessages))});n(c$,"evaluateParallel",function(a,b){return this.getExtension().evaluateParallel(a,
b)},"J.script.ScriptContext,J.viewer.ShapeManager");P(c$,"EXPRESSION_KEY","e_x_p_r_e_s_s_i_o_n","scriptLevelMax",100,"tryPt",0,"ERROR_axisExpected",0,"ERROR_backgroundModelError",1,"ERROR_badArgumentCount",2,"ERROR_badMillerIndices",3,"ERROR_badRGBColor",4,"ERROR_booleanExpected",5,"ERROR_booleanOrNumberExpected",6,"ERROR_booleanOrWhateverExpected",7,"ERROR_colorExpected",8,"ERROR_colorOrPaletteRequired",9,"ERROR_commandExpected",10,"ERROR_coordinateOrNameOrExpressionRequired",11,"ERROR_drawObjectNotDefined",
12,"ERROR_endOfStatementUnexpected",13,"ERROR_expressionExpected",14,"ERROR_expressionOrIntegerExpected",15,"ERROR_filenameExpected",16,"ERROR_fileNotFoundException",17,"ERROR_incompatibleArguments",18,"ERROR_insufficientArguments",19,"ERROR_integerExpected",20,"ERROR_integerOutOfRange",21,"ERROR_invalidArgument",22,"ERROR_invalidParameterOrder",23,"ERROR_keywordExpected",24,"ERROR_moCoefficients",25,"ERROR_moIndex",26,"ERROR_moModelError",27,"ERROR_moOccupancy",28,"ERROR_moOnlyOne",29,"ERROR_multipleModelsDisplayedNotOK",
30,"ERROR_noData",31,"ERROR_noPartialCharges",32,"ERROR_noUnitCell",33,"ERROR_numberExpected",34,"ERROR_numberMustBe",35,"ERROR_numberOutOfRange",36,"ERROR_objectNameExpected",37,"ERROR_planeExpected",38,"ERROR_propertyNameExpected",39,"ERROR_spaceGroupNotFound",40,"ERROR_stringExpected",41,"ERROR_stringOrIdentifierExpected",42,"ERROR_tooManyPoints",43,"ERROR_tooManyScriptLevels",44,"ERROR_unrecognizedAtomProperty",45,"ERROR_unrecognizedBondProperty",46,"ERROR_unrecognizedCommand",47,"ERROR_unrecognizedExpression",
48,"ERROR_unrecognizedObject",49,"ERROR_unrecognizedParameter",50,"ERROR_unrecognizedParameterWarning",51,"ERROR_unrecognizedShowParameter",52,"ERROR_what",53,"ERROR_writeWhat",54,"ERROR_multipleModelsNotOK",55,"ERROR_cannotSet",56,"iProcess",0)});D("J.script");E(["J.script.ScriptCompilationTokenParser","JU.List"],"J.script.ScriptCompiler","java.lang.Boolean $.Character $.Float java.util.Hashtable JU.AU $.BS $.M3 $.M4 $.PT $.SB J.api.Interface J.i18n.GT J.io.JmolBinary J.modelset.BondSet $.Group J.script.ContextToken $.SV $.ScriptContext $.ScriptEvaluator $.ScriptFlowContext $.ScriptFunction $.T J.util.Escape $.Logger $.Txt J.viewer.Viewer".split(" "),
function(){c$=I(function(){this.filename=null;this.isSilent=!1;this.lineIndices=this.lineNumbers=this.aatokenCompiled=this.contextVariables=null;this.lnLength=8;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.tokInitialPlusPlus=0;this.vPush=null;this.pushCount=0;this.chFirst="\x00";L(this,arguments)},J.script,"ScriptCompiler",J.script.ScriptCompilationTokenParser);R(c$,function(){this.vPush=new JU.List});M(c$,function(a){Q(this,
J.script.ScriptCompiler,[]);this.viewer=a},"J.viewer.Viewer");d(c$,"compile",function(a,b,c,d,f,l){this.isCheckOnly=l;this.filename=a;this.isSilent=d;this.script=b;this.logMessages=!d&&!c&&f;this.preDefining="#predefine"===a;(a=this.compile0(!0))||this.handleError();c=new J.script.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.errorType=this.errorType;null!=this.errorType&&(c.iCommandError=
this.iCommand,this.setAaTokenCompiled());c.aatoken=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.contextVariables=this.contextVariables;return c},"~S,~S,~B,~B,~B,~B");d(c$,"addContextVariable",
function(a){this.theToken=J.script.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),J.script.ScriptCompiler.addContextVariable(this.contextVariables,a)):this.thisFunction.addVariable(a,!1)},"~S");c$.addContextVariable=d(c$,"addContextVariable",function(a,b){a.put(b,J.script.SV.newS("").setName(b))},"java.util.Map,~S");d(c$,"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");d(c$,"cleanScriptComments",function(a){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.scriptExtensions=a.substring(b+1),a=a.substring(0,b),this.allowMissingEnd=0<=this.scriptExtensions.indexOf("##noendcheck"));this.haveComments=0<=a.indexOf("#");return J.io.JmolBinary.getEmbeddedScript(a)},"~S");d(c$,"addTokenToPrefix",function(a){this.logMessages&&J.util.Logger.debug("addTokenToPrefix"+a);this.ltoken.addLast(a);0!=a.tok&&(this.lastToken=a)},"J.script.T");d(c$,"compile0",function(a){this.vFunctionStack=new JU.List;this.htUserFunctions=new java.util.Hashtable;this.script=
this.cleanScriptComments(this.script);this.ichToken=this.script.indexOf("# Jmol state version ");if(this.isStateScript=0<=this.ichToken)this.ptSemi=this.script.indexOf(";",this.ichToken),this.ptSemi>=this.ichToken&&this.viewer.setStateScriptVersion(this.script.substring(this.ichToken+21,this.ptSemi).trim());this.cchScript=this.script.length;this.errorLine=this.errorMessageUntranslated=this.errorMessage=this.errorType=this.flowContext=this.thisFunction=this.aatokenCompiled=this.lineIndices=this.lineNumbers=
this.contextVariables=null;this.ichBrace=this.ichComment=this.ichCurrentCommand=this.ichToken=this.nSemiSkip=0;this.lineCurrent=1;this.tokLastMath=this.iCommand=0;this.lastToken=J.script.T.tokenOff;this.vBraces=new JU.List;this.vPush=new JU.List;this.parenCount=this.braceCount=this.iBrace=this.pushCount=0;this.ptSemi=-10;this.cchToken=0;this.lnLength=8;this.lineNumbers=T(this.lnLength,0);this.lineIndices=N(this.lnLength,2,0);this.isNewSet=this.isSetBrace=!1;this.ptNewSetModifier=1;this.checkImpliedScriptCmd=
this.iHaveQuotedString=this.isShowScriptOutput=!1;this.lltoken=new JU.List;this.ltoken=new JU.List;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.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;this.setAaTokenCompiled();return null==this.flowContext||this.errorStr(11,J.script.T.nameOf(this.flowContext.token.tok))}if(0<this.nTokens)switch(this.checkSpecialParameterSyntax()){case 2:continue;case 4:return!1}if(this.lookingAtLookupToken(this.ichToken)){var c=this.getPrefixToken();switch(this.parseKnownToken(c)){case 2:continue;case 4:return!1}switch(this.parseCommandParameter(c)){case 2:continue;
case 4:return!1}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(J.script.T.tokenScript));this.cchToken=0;continue}this.lookingAtImpliedString(!0,!0,!0)&&(this.ichEnd=this.ichToken+this.cchToken)}return this.commandExpected()}return this.errorStr(19,this.script.substring(this.ichToken,this.ichToken+1))}}}},"~B");d(c$,"setAaTokenCompiled",
function(){this.aatokenCompiled=this.lltoken.toArray(Array(this.lltoken.size()))});d(c$,"lookingAtLeadingWhitespace",function(){for(var a=this.ichToken;J.script.ScriptCompiler.isSpaceOrTab(this.charAt(a));)++a;this.isLineContinuation(a,!0)&&(a+=1+this.nCharNewLine(a+1));this.cchToken=a-this.ichToken;return 0<this.cchToken});d(c$,"isLineContinuation",function(a,b){var c=a+2<this.cchScript&&"\\"==this.script.charAt(a)&&0<this.nCharNewLine(a+1)||b&&this.lookingAtMathContinuation(a);c&&this.lineCurrent++;
return c},"~N,~B");d(c$,"lookingAtMathContinuation",function(a){var b;if(0==(b=this.nCharNewLine(a))||1048586==this.lastToken.tok)return!1;if(0<this.parenCount||0<this.bracketCount)return!0;if((1085443!=this.tokCommand||!this.isNewSet)&&36865!=this.tokCommand&&36869!=this.tokCommand)return!1;if(this.lastToken.tok==this.tokLastMath)return!0;for(a+=b;J.script.ScriptCompiler.isSpaceOrTab(this.charAt(a));)++a;return this.lookingAtLookupToken(a)&&1==this.tokLastMath},"~N");d(c$,"lookingAtEndOfLine",function(){return this.ichToken>=
this.cchScript?(this.ichEnd=this.cchScript,!0):0<(this.cchToken=this.nCharNewLine(this.ichEnd=this.ichToken))});d(c$,"nCharNewLine",function(a){var b;return"\r"!=(b=this.charAt(a))?"\n"==b?1:0:"\n"==this.charAt(++a)?2:1},"~N");d(c$,"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});d(c$,"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)){case "/":c=this.ichToken;this.ichEnd=b-1;break;case "*":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 d=0>c;if(d&&!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(!d&&";"==a)continue;break}0<=c||"#"==a&&(c=b)}if(0>c)return 0;this.ichComment=
c;if(d&&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(d&&this.cchScript>this.ichToken+3&&"j"==this.script.charAt(this.ichToken+1)&&"x"==this.script.charAt(this.ichToken+2)&&J.script.ScriptCompiler.isSpaceOrTab(this.script.charAt(this.ichToken+3)))return this.cchToken=4,2;if(b==this.ichToken)return 0;this.cchToken=b-this.ichToken;return 0==this.nTokens?1:2});d(c$,"charAt",function(a){return a<
this.cchScript?this.script.charAt(a):"\x00"},"~N");d(c$,"processTokenList",function(a,b){if(0<this.nTokens||null!=this.comment){if(0==this.nTokens)this.ichCurrentCommand=this.ichToken,null!=this.comment&&(this.isComment=!0,this.addTokenToPrefix(J.script.T.o(0,this.comment)));else if(0<this.setBraceCount&&this.endOfLine&&this.ichToken<this.cchScript)return 2;if(135271429==this.tokCommand&&this.checkImpliedScriptCmd){var c=2==this.nTokens?this.lastToken.value.toString().toUpperCase():null;if(2<this.nTokens&&
!(269484048==this.tokAt(2)&&this.ltoken.get(1).value.toString().endsWith(".spt"))||null!=c&&(c.endsWith(".SORT")||c.endsWith(".REVERSE")||0<=c.indexOf(".SORT(")||0<=c.indexOf(".REVERSE(")||0<=c.indexOf(".POP(")||0<=c.indexOf(".PUSH(")))return this.ichToken=this.ichCurrentCommand,this.nTokens=0,this.ltoken.clear(),this.tokCommand=this.cchToken=0,2}this.isNewSet&&2<this.nTokens&&1048584==this.tokAt(2)&&(1276117011==this.tokAt(3)||1141899269==this.tokAt(3)||1276383749==this.tokAt(3)||1276383249==this.tokAt(3))?
(this.ltoken.set(0,J.script.T.tokenSet),this.ltoken.add(1,1276383249==this.tokAt(3)?J.script.T.tokenAll:this.ltoken.get(1))):0!=this.tokInitialPlusPlus&&(this.isNewSet||this.checkNewSetCommand(),this.tokenizePlusPlus(this.tokInitialPlusPlus,!0));this.iCommand=this.lltoken.size();null!=this.thisFunction&&0>this.thisFunction.cmdpt0&&(this.thisFunction.cmdpt0=this.iCommand);1==this.nTokens&&1==this.braceCount&&(null==this.lastFlowCommand?(this.parenCount=this.setBraceCount=this.braceCount=0,this.ltoken.remove(0),
this.iBrace++,c=J.script.ContextToken.newContext(!0),this.addTokenToPrefix(this.setCommand(c)),this.pushCount++,this.vPush.addLast(c),this.vBraces.addLast(this.tokenCommand)):(this.parenCount=this.setBraceCount=0,this.setCommand(this.lastFlowCommand),102439!=this.lastFlowCommand.tok&&1048586==this.tokAt(0)&&this.ltoken.remove(0),this.lastFlowCommand=null));if(0<this.bracketCount||0<this.setBraceCount||0<this.parenCount||1==this.braceCount&&!this.checkFlowStartBrace(!0))return this.error(1==this.nTokens?
2:4),4;this.needRightParen&&(this.addTokenToPrefix(J.script.T.tokenRightParen),this.needRightParen=!1);if(0<this.ltoken.size()){if(b&&!this.compileCommand())return 4;this.logMessages&&J.util.Logger.debug("-------------------------------------");c=!0;switch(this.tokCommand){case 364558:case 102436:case 135368713:case 1150985:c=0<this.atokenInfix.length&&2147483647!=this.atokenInfix[0].intValue}c&&(this.iCommand==this.lnLength&&(this.lineNumbers=JU.AU.doubleLengthShort(this.lineNumbers),c=N(2*this.lnLength,
2,0),System.arraycopy(this.lineIndices,0,c,0,this.lnLength),this.lineIndices=c,this.lnLength*=2),this.lineNumbers[this.iCommand]=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());1085443==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}if(this.endOfLine){if(null!=this.flowContext&&this.flowContext.checkForceEndIf())return this.isComment||this.forceFlowEnd(this.flowContext.token),this.isEndOfCommand=!0,this.cchToken=0,this.ichCurrentCommand=this.ichToken,this.lineCurrent--,
2;this.isShowCommand=this.isComment=!1;++this.lineCurrent}if(this.ichToken>=this.cchScript){this.setCommand(J.script.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");d(c$,"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(J.script.T.tokenScript);this.addTokenToPrefix(J.script.T.o(4,a));this.isNewSet=!1}}this.setCommand(this.tokenAt(0));a=this.ltoken.size();1==a&&J.script.T.tokAttr(this.tokCommand,524288)&&this.addTokenToPrefix(J.script.T.tokenOn);if(null!=this.tokenAndEquals){for(var b,c=0,c=1;c<a&&269484242!=this.tokAt(c);c++);a=c;c++;if(this.ltoken.size()<c)J.util.Logger.error("COMPILER ERROR! - andEquals ");else{for(b=1;b<a;b++,c++)this.ltoken.add(c,
this.tokenAt(b));this.ltoken.set(a,J.script.T.tokenEquals);this.ltoken.add(c,this.tokenAndEquals);this.ltoken.add(++c,J.script.T.tokenLeftParen);this.addTokenToPrefix(J.script.T.tokenRightParen)}}this.atokenInfix=this.ltoken.toArray(Array(this.ltoken.size()));if(this.logMessages){J.util.Logger.debug("token list:");for(c=0;c<this.atokenInfix.length;c++)J.util.Logger.debug(c+": "+this.atokenInfix[c]);J.util.Logger.debug("vBraces list:");for(c=0;c<this.vBraces.size();c++)J.util.Logger.debug(c+": "+this.vBraces.get(c));
J.util.Logger.debug("-------------------------------------")}return this.compileExpressions()});d(c$,"tokenAt",function(a){return this.ltoken.get(a)},"~N");n(c$,"tokAt",function(a){return a<this.ltoken.size()?this.tokenAt(a).tok:0},"~N");d(c$,"setCommand",function(a){this.tokenCommand=a;null==a?this.tokCommand=0:(this.tokCommand=this.tokenCommand.tok,this.isMathExpressionCommand=1073741824==this.tokCommand||J.script.T.tokAttr(this.tokCommand,36864),this.isSetOrDefine=1085443==this.tokCommand||1060866==
this.tokCommand,this.isCommaAsOrAllowed=J.script.T.tokAttr(this.tokCommand,12288),this.implicitString=J.script.T.tokAttr(this.tokCommand,20480));return a},"J.script.T");d(c$,"replaceCommand",function(a){this.ltoken.remove(0);this.ltoken.add(0,this.setCommand(a))},"J.script.T");d(c$,"getPrefixToken",function(){var a=this.script.substring(this.ichToken,this.ichToken+this.cchToken),b=a.toLowerCase(),c=this.isContextVariable(b);0==this.nTokens&&(this.isUserToken=c);if(1==this.nTokens&&(135368713==this.tokCommand||
102436==this.tokCommand||36868==this.tokCommand)||0!=this.nTokens&&c||this.isUserFunction(b)&&(null==this.thisFunction||!this.thisFunction.name.equals(b)))a=b,this.theToken=null;else if(1==a.length||269484066==this.lastToken.tok){if(null==(this.theToken=J.script.T.getTokenFromName(a))&&null!=(this.theToken=J.script.T.getTokenFromName(b)))this.theToken=J.script.T.tv(this.theToken.tok,this.theToken.intValue,a)}else a=b,this.theToken=J.script.T.getTokenFromName(a);null==this.theToken&&(this.theToken=
0==a.indexOf("property_")?J.script.T.o(1716520985,a):J.script.T.o(1073741824,a));this.theTok=this.theToken.tok;return a});d(c$,"checkSpecialParameterSyntax",function(){if(this.lookingAtString(!this.implicitString)){if(0>this.cchToken)return this.ERROR(4);var a=this.getUnescapedStringLiteral(null!=this.lastToken&&!this.iHaveQuotedString&&1073741983!=this.lastToken.tok&&(1085443==this.tokCommand&&2==this.nTokens&&545259546==this.lastToken.tok||135271426==this.tokCommand||1610616835==this.tokCommand||
135271429==this.tokCommand));this.iHaveQuotedString=!0;if(135271426==this.tokCommand&&135270407==this.lastToken.tok||135270407==this.tokCommand&&0>a.indexOf("@")){if(!this.getData(a))return this.ERROR(11,"data")}else this.addTokenToPrefix(J.script.T.o(4,a)),this.implicitString&&(this.ichEnd=this.ichToken+this.cchToken,this.isEndOfCommand=!0);return 2}if(1074790550==this.lastToken.tok&&this.lookingAtImpliedString(!1,!1,!1))return this.addTokenToPrefix(J.script.T.o(4,this.script.substring(this.ichToken,
this.ichToken+this.cchToken))),2;if(this.nTokens==this.ptNewSetModifier){var a=this.script.charAt(this.ichToken),b=0<="+-\\*/&|=".indexOf(a),c=b||"."==a||"["==a,d=this.charAt(this.ichToken+1);if(!this.isNewSet&&this.isUserToken&&c&&("="==a||d==a||"="==d))this.isNewSet=!0;if(this.isNewSet||1085443==this.tokCommand||J.script.T.tokAttr(this.tokCommand,536870912))if("="==a&&(this.setEqualPt=this.ichToken),J.script.T.tokAttr(this.tokCommand,536870912)&&"="==a||(this.isNewSet||this.isSetBrace)&&c)switch(this.setCommand(b?
J.script.T.tokenSet:"["==a&&!this.isSetBrace?J.script.T.tokenSetArray:J.script.T.tokenSetProperty),this.ltoken.add(0,this.tokenCommand),this.cchToken=1,a){case "[":return this.addTokenToPrefix(J.script.T.o(269484096,"[")),this.bracketCount++,2;case ".":return this.addTokenToPrefix(J.script.T.o(1048584,".")),2;case "-":case "+":case "*":case "/":case "\\":case "&":case "|":if(0==d.charCodeAt(0))return this.ERROR(4);if(d!=a&&"="!=d)return this.ERROR(1,'"'+a+'"');break;default:return this.lastToken=
J.script.T.tokenMinus,2}}switch(this.tokCommand){case 135271426:case 135271429:case 1276121098:if("@"==this.script.charAt(this.ichToken))return this.iHaveQuotedString=!0,0;if(135271426==this.tokCommand){if((1==this.nTokens||2==this.nTokens&&1073741839==this.tokAt(1))&&this.lookingAtLoadFormat()){var f=this.script.substring(this.ichToken,this.ichToken+this.cchToken),l=J.script.T.getTokenFromName(f.toLowerCase());switch(null==l?0:l.tok){case 1073742015:case 1073741839:if(1!=this.nTokens)return 4;case 135270407:case 1229984263:case 1073741983:case 1095766030:case 135267336:case 536870926:case 4156:this.addTokenToPrefix(l);
break;default:l=0==f.indexOf("=")||0==f.indexOf("$")?4:JU.PT.isOneOf(f=f.toLowerCase(),";xyz;vxyz;vibration;temperature;occupancy;partialcharge;")?1073741824:0,0!=l&&(this.addTokenToPrefix(J.script.T.o(l,f)),this.iHaveQuotedString=4==l)}return 2}if("{"==this.script.charAt(this.ichToken)||0<this.parenCount)break;if(null!=(a=this.lookingAtBitset()))return this.addTokenToPrefix(J.script.T.o(10,a)),2}if(!this.iHaveQuotedString&&this.lookingAtImpliedString(!1,135271426==this.tokCommand,1<this.nTokens||
135271429!=this.tokCommand)){a=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(135271429==this.tokCommand)if(a.startsWith("javascript:"))this.lookingAtImpliedString(!0,!0,!0),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(J.script.T.o(4,a));return 2}break;case 4156:if(1==this.nTokens&&this.lookForSyncID())return f=this.script.substring(this.ichToken,
this.ichToken+this.cchToken),l=JU.PT.parseInt(f),-2147483648==l||1E3>Math.abs(l)?this.addTokenToPrefix(J.script.T.o(1073741824,f)):this.addTokenToPrefix(J.script.T.i(l)),2;break;case 135270422: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)){b=this.cchToken;a=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(0>a.indexOf(" "))return this.addTokenToPrefix(J.script.T.o(4,
a)),this.iHaveQuotedString=!0,2;this.cchToken=b}}}if(this.implicitString&&!(135271429==this.tokCommand&&this.iHaveQuotedString)&&this.lookingAtImpliedString(!0,!0,!0))return a=this.script.substring(this.ichToken,this.ichToken+this.cchToken),1826248715==this.tokCommand&&JU.PT.isOneOf(a.toLowerCase(),"on;off;hide;display")?this.addTokenToPrefix(J.script.T.getTokenFromName(a.toLowerCase())):this.addTokenToPrefix(J.script.T.o(4,a)),2;if(this.lookingAtObjectID())return this.addTokenToPrefix(J.script.T.getTokenFromName("$")),
this.addTokenToPrefix(J.script.T.o(1073741824,this.script.substring(this.ichToken,this.ichToken+this.cchToken))),2;if(!Float.isNaN(a=this.lookingAtExponential()))return this.addTokenToPrefix(J.script.T.o(3,Float.$valueOf(a))),2;if(this.lookingAtDecimal())return a=JU.PT.fVal(this.script.substring(this.ichToken,this.ichToken+this.cchToken)),f=J.script.ScriptEvaluator.getFloatEncodedInt(this.script.substring(this.ichToken,this.ichToken+this.cchToken)),this.addTokenToPrefix(J.script.T.tv(3,f,Float.$valueOf(a))),
2;if(this.lookingAtSeqcode()){a=this.script.charAt(this.ichToken);try{f="*"==a||"^"==a?2147483647:Integer.parseInt(this.script.substring(this.ichToken,this.ichToken+this.cchToken-2));l=this.script.charAt(this.ichToken+this.cchToken-1);"^"==l&&(l=" ");0>f&&(f=-f,this.addTokenToPrefix(J.script.T.tokenMinus));var g=J.modelset.Group.getSeqcodeFor(f,l);this.addTokenToPrefix(J.script.T.tv(5,g,"seqcode"))}catch(h){if(B(h,NumberFormatException))return this.ERROR(9,""+a);throw h;}return 2}f=this.lookingAtInteger();
if(2147483647!=f){l=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(102407==this.tokCommand||102408==this.tokCommand){if(1!=this.nTokens)return this.ERROR(0);g=null==this.flowContext?null:this.flowContext.getBreakableContext(f=Math.abs(f));if(null==g)return this.ERROR(1,this.tokenCommand.value);this.tokenAt(0).intValue=g.pt0}0==f&&l.equals("-0")&&this.addTokenToPrefix(J.script.T.tokenMinus);this.addTokenToPrefix(J.script.T.tv(2,f,l));return 2}if(!this.isMathExpressionCommand&&
0==this.parenCount||1073741824!=this.lastToken.tok&&!J.script.ScriptCompilationTokenParser.tokenAttr(this.lastToken,135266304)){f="["==this.script.charAt(this.ichToken);a=this.lookingAtBitset();if(null!=a)return this.addTokenToPrefix(J.script.T.o(10,f?new J.modelset.BondSet(a):a)),2;if(f&&(f=this.lookingAtMatrix(),r(f,JU.M3)||r(f,JU.M4)))return this.addTokenToPrefix(J.script.T.o(r(f,JU.M3)?11:12,f)),2}return 0});d(c$,"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=J.util.Escape.unescapeMatrix(this.script.substring(this.ichToken,a+2))))return null;this.cchToken=a+2-this.ichToken;return b});d(c$,"parseKnownToken",function(a){var b;0!=this.tokLastMath&&(this.tokLastMath=this.theTok);if(null!=this.flowContext&&102410==this.flowContext.token.tok&&null!=this.flowContext.$var&&102411!=this.theTok&&102413!=this.theTok&&102410!=this.lastToken.tok)return this.ERROR(1,a);
if(1060866==this.lastToken.tok&&1048586!=this.theTok&&1!=this.nTokens)return this.addTokenToPrefix(J.script.T.o(4,a)),2;switch(this.theTok){case 1073741824:if(0==this.nTokens&&!this.checkImpliedScriptCmd){if("'"==a.charAt(0))return this.addTokenToPrefix(this.setCommand(J.script.T.tokenScript)),this.cchToken=0,2;if("."==this.charAt(this.ichToken+this.cchToken))return this.addTokenToPrefix(this.setCommand(J.script.T.tokenScript)),this.nTokens=1,this.cchToken=0,this.checkImpliedScriptCmd=!0,2}break;
case 269484242:if(this.nSemiSkip==this.forPoint3&&this.nTokens==this.ptSemi+2)return b=this.lastToken,this.addTokenToPrefix(J.script.T.tokenEquals),this.addTokenToPrefix(b),b=J.script.T.getTokenFromName(a.substring(0,1)),this.addTokenToPrefix(b),this.addTokenToPrefix(J.script.T.tokenLeftParen),this.needRightParen=!0,2;this.checkNewSetCommand();if(1085443==this.tokCommand){this.tokenAndEquals=J.script.T.getTokenFromName(a.substring(0,1));this.setEqualPt=this.ichToken;break}if(554176565==this.tokCommand||
554176526==this.tokCommand){this.addTokenToPrefix(this.tokenCommand);this.replaceCommand(J.script.T.tokenSet);this.tokenAndEquals=J.script.T.getTokenFromName(a.substring(0,1));this.setEqualPt=this.ichToken;break}return 2;case 1150985: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 135369224:if(0<this.bracketCount)break;case 102411:case 102413:case 102402:case 135369225:case 102410:case 102406:case 102412:if(1<
this.nTokens&&1085443!=this.tokCommand)return this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!0),this.cchToken=0,2;break;case 269484225:case 269484226:!this.isNewSet&&1==this.nTokens&&this.checkNewSetCommand();if(this.isNewSet&&0==this.parenCount&&0==this.bracketCount&&this.ichToken<=this.setEqualPt)return this.tokenizePlusPlus(this.theTok,!1),2;if(this.nSemiSkip==this.forPoint3&&this.nTokens==this.ptSemi+2)return b=this.lastToken,this.addTokenToPrefix(J.script.T.tokenEquals),
this.addTokenToPrefix(b),this.addTokenToPrefix(269484225==this.theTok?J.script.T.tokenMinus:J.script.T.tokenPlus),this.addTokenToPrefix(J.script.T.i(1)),2;break;case 269484436:0==this.parenCount&&0==this.bracketCount&&(this.setEqualPt=this.ichToken);break;case 1048584:1085443==this.tokCommand&&(0==this.parenCount&&0==this.bracketCount&&this.ichToken<this.setEqualPt)&&(this.ltoken.add(1,J.script.T.tokenExpressionBegin),this.addTokenToPrefix(J.script.T.tokenExpressionEnd),this.ltoken.set(0,J.script.T.tokenSetProperty),
this.setEqualPt=0);break;case 1048586:if(this.braceCount++,1==this.braceCount&&0==this.parenCount&&this.checkFlowStartBrace(!1))return this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!1),2;case 269484048:this.parenCount++;if(1<this.nTokens&&(135280132==this.lastToken.tok||135369224==this.lastToken.tok||135369225==this.lastToken.tok))this.nSemiSkip+=2;break;case 1048590: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.braceCount=this.parenCount=this.nSemiSkip=0,102411!=this.theToken.tok&&102413!=this.theToken.tok&&this.vBraces.addLast(this.theToken),this.iBrace++,this.isEndOfCommand=!0,this.ichEnd=this.ichToken,2;this.braceCount--;case 269484049:this.parenCount--;if(0>this.parenCount)return this.ERROR(16,a);0==this.parenCount&&(this.nSemiSkip=0);this.needRightParen&&(this.addTokenToPrefix(J.script.T.tokenRightParen),this.needRightParen=!1);break;case 269484096:0<this.ichToken&&
Character.isWhitespace(this.script.charAt(this.ichToken-1))&&this.addTokenToPrefix(J.script.T.tokenSpaceBeforeSquare);this.bracketCount++;break;case 269484097:if(this.bracketCount--,0>this.bracketCount)return this.ERROR(16,"]")}return 0},"~S");d(c$,"tokenizePlusPlus",function(a,b){b&&(this.setCommand(J.script.T.tokenSet),this.ltoken.add(0,this.tokenCommand));this.nTokens=this.ltoken.size();this.addTokenToPrefix(J.script.T.tokenEquals);this.setEqualPt=0;for(var c=1;c<this.nTokens;c++)this.addTokenToPrefix(this.ltoken.get(c));
this.addTokenToPrefix(269484225==a?J.script.T.tokenMinus:J.script.T.tokenPlus);this.addTokenToPrefix(J.script.T.i(1))},"~N,~B");d(c$,"checkNewSetCommand",function(){var a=this.ltoken.get(0).value.toString();if(!this.isContextVariable(a.toLowerCase()))return!1;a=this.setNewSetCommand(!1,a);this.setCommand(J.script.T.tokenSet);this.ltoken.add(0,this.tokenCommand);this.ltoken.set(1,a);return!0});d(c$,"parseCommandParameter",function(a){this.nTokens=this.ltoken.size();switch(this.tokCommand){case 0:this.lastToken=
J.script.T.tokenOff;this.ichCurrentCommand=this.ichEnd=this.ichToken;this.setCommand(this.theToken);J.script.T.tokAttr(this.tokCommand,102400)&&(this.lastFlowCommand=this.tokenCommand);var b=this.checkFlowEndBrace();if(4==b)return 4;if(2==b)return this.isEndOfCommand=!0,this.cchToken=0,2;if(J.script.T.tokAttr(this.tokCommand,102400)){if(!this.checkFlowCommand(this.tokenCommand.value))return 4;this.theToken=this.tokenCommand;102411==this.theTok&&(this.addTokenToPrefix(this.tokenCommand),this.theToken=
J.script.T.tokenLeftParen);break}if(269484066==this.theTok){this.braceCount++;this.isEndOfCommand=!0;break}if(1048590==this.theTok)return this.vBraces.addLast(this.tokenCommand),this.iBrace++,this.tokCommand=0,2;1048586!=this.theTok&&(this.lastFlowCommand=null);if(J.script.T.tokAttr(this.tokCommand,4096))break;if(this.isSetBrace=1048586==this.theTok)this.lookingAtSetBraceSyntax()||(this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!1));else switch(this.theTok){case 269484226:case 269484225:return this.tokInitialPlusPlus=
this.theTok,this.tokCommand=0,2;case 1073741824:case 36868:case 1060866:case 269484048:break;default:if(!J.script.T.tokAttr(this.theTok,1073741824)&&!J.script.T.tokAttr(this.theTok,536870912)&&!this.isContextVariable(a))return this.commandExpected(),4}this.theToken=this.setNewSetCommand(this.isSetBrace,a);break;case 102412:switch(this.nTokens){case 1:if(269484048!=this.theTok)return this.ERROR(15,"(");break;case 2:269484049!=this.theTok&&(this.tokenCommand.name0=a);this.addContextVariable(a);break;
case 3:if(269484049!=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 135368713:if(0==this.tokenCommand.intValue){if(1!=this.nTokens)break;this.tokenCommand.value=a;return 2}if(1==this.nTokens){null!=this.thisFunction&&this.vFunctionStack.add(0,this.thisFunction);this.thisFunction=102436==this.tokCommand?J.script.ScriptCompiler.newScriptParallelProcessor(a,this.tokCommand):
new J.script.ScriptFunction(a,this.tokCommand);this.htUserFunctions.put(a,Boolean.TRUE);this.flowContext.setFunction(this.thisFunction);break}if(2==this.nTokens){if(269484048!=this.theTok)return this.ERROR(15,"(");break}if(3==this.nTokens&&269484049==this.theTok)break;if(0==this.nTokens%2){if(269484080!=this.theTok&&269484049!=this.theTok)return this.ERROR(15,")");break}this.thisFunction.addVariable(a,!0);break;case 102411:if(1<this.nTokens&&0==this.parenCount&&0==this.braceCount&&269484066==this.theTok)return this.addTokenToPrefix(J.script.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&&135369225!=this.theTok)return this.isEndOfCommand=!0,this.cchToken=0,2;if(1!=this.nTokens||135369225!=this.theTok&&1048586!=this.theTok)return this.ERROR(0);this.replaceCommand(this.flowContext.token=J.script.ContextToken.newCmd(102402,"elseif"));this.tokCommand=102402;return 2;case 36868:if(1!=this.nTokens)break;
this.addContextVariable(a);this.replaceCommand(J.script.T.tokenSetVar);this.tokCommand=1085443;break;case 1150985:if(1!=this.nTokens)return this.ERROR(0);if(!this.checkFlowEnd(this.theTok,a,this.ichCurrentCommand))return 4;if(135368713==this.theTok||102436==this.theTok)return 2;break;case 102410:case 102406:2<this.nTokens&&(0==this.braceCount&&0==this.parenCount)&&(this.isEndOfCommand=!0,this.ichEnd=this.ichToken+1,this.flowContext.setLine());break;case 102402:case 135369225:2<this.nTokens&&(0==this.braceCount&&
0==this.parenCount)&&(this.isEndOfCommand=!0,this.ichEnd=this.ichToken+1,this.flowContext.setLine());break;case 102439:this.isEndOfCommand=!0;this.ichEnd=this.ichToken+1;this.flowContext.setLine();break;case 135369224:if(1==this.nTokens){if(269484048!=this.theTok)return this.ERROR(19,a);this.forPoint3=this.nSemiSkip=0;this.nSemiSkip+=2}else 3==this.nTokens&&36868==this.tokAt(2)?this.addContextVariable(a):(3==this.nTokens||4==this.nTokens)&&1073741980==this.theTok?(this.nSemiSkip-=2,this.forPoint3=
2,this.addTokenToPrefix(this.theToken),this.theToken=J.script.T.tokenLeftParen):0==this.braceCount&&0==this.parenCount&&(this.isEndOfCommand=!0,this.ichEnd=this.ichToken+1,this.flowContext.setLine());break;case 1085443:1048586==this.theTok?this.setBraceCount++:1048590==this.theTok&&(this.setBraceCount--,this.isSetBrace&&(0==this.setBraceCount&&2147483647==this.ptNewSetModifier)&&(this.ptNewSetModifier=this.nTokens+1));if(this.nTokens==this.ptNewSetModifier){b=this.tokenAt(0);if(269484048==this.theTok||
this.isUserFunction(b.value.toString())){this.ltoken.set(0,this.setCommand(J.script.T.tv(1073741824,0,b.value)));this.setBraceCount=0;break}if(1073741824!=this.theTok&&269484242!=this.theTok&&1060866!=this.theTok&&!J.script.T.tokAttr(this.theTok,536870912))return this.isNewSet?this.commandExpected():this.errorIntStr2(18,"SET",": "+a),4;if(1==this.nTokens&&(269484226==this.lastToken.tok||269484225==this.lastToken.tok)){this.replaceCommand(J.script.T.tokenSet);this.addTokenToPrefix(this.lastToken);
break}}break;case 135271426:if(1060866==this.theTok&&(1==this.nTokens||1073741940==this.lastToken.tok||1073742152==this.lastToken.tok))return this.addTokenToPrefix(J.script.T.tokenDefineString),2;1073741848==this.theTok&&(this.iHaveQuotedString=!1);break;case 1610625028:case 12294:case 12295:case 135280132:case 12291:case 1060866:if(1060866==this.tokCommand){if(1==this.nTokens){if(1073741824!=this.theTok)if(this.preDefining){if(!J.script.T.tokAttr(this.theTok,3145728))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: "+
a,null),4}else J.script.T.tokAttr(this.theTok,3145728)?J.util.Logger.warn("WARNING: predefined term '"+a+"' has been redefined by the user until the next file load."):!this.isCheckOnly&&1<a.length&&(J.util.Logger.warn("WARNING: redefining "+a+"; was "+this.theToken+"not all commands may continue to be functional for the life of the applet!"),this.theTok=this.theToken.tok=1073741824,J.script.T.addToken(a,this.theToken));this.addTokenToPrefix(this.theToken);this.lastToken=J.script.T.tokenComma;return 2}if(2==
this.nTokens&&269484436==this.theTok)return this.ltoken.add(0,J.script.T.tokenSet),2}if(0==this.bracketCount&&1073741824!=this.theTok&&!J.script.T.tokAttr(this.theTok,1048576)&&!J.script.T.tokAttr(this.theTok,1073741824)&&(this.theTok&480)!=this.theTok)return this.ERROR(9,a);break;case 12289:if(1073741824!=this.theTok&&1048583!=this.theTok&&!J.script.T.tokAttr(this.theTok,1048576))return this.ERROR(9,a);break;case 135190:case 135188:case 135180:b=this.charAt(this.ichToken+this.cchToken);0==this.parenCount&&
(0==this.bracketCount&&0<=".:/\\+-!?".indexOf(b)&&!("-"==b&&a.equals("=")))&&this.checkUnquotedFileName();break;case 4148:2==this.nTokens&&(1073742158==this.tokAt(1)&&269484208==this.theTok)&&(this.implicitString=!0)}return 0},"~S");c$.newScriptParallelProcessor=d(c$,"newScriptParallelProcessor",function(a,b){var c=J.api.Interface.getOptionInterface("parallel.ScriptParallelProcessor");c.set(a,b);return c},"~S,~N");d(c$,"setNewSetCommand",function(a,b){this.tokCommand=1085443;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||269484226==this.theToken.tok||269484225==this.theToken.tok?this.theToken:J.script.T.o(1073741824,b)},"~B,~S");d(c$,"checkUnquotedFileName",function(){for(var a=this.ichToken,b;++a<this.cchScript&&!Character.isWhitespace(b=this.script.charAt(a))&&"#"!=b&&";"!=b&&"}"!=b;);b=this.script.substring(this.ichToken,a).$replace("\\","/");this.cchToken=a-this.ichToken;
this.theToken=J.script.T.o(4,b)});d(c$,"checkFlowStartBrace",function(a){if(!J.script.T.tokAttr(this.tokCommand,102400)||102407==this.tokCommand||102408==this.tokCommand)return!1;a&&(102411!=this.tokenCommand.tok&&102413!=this.tokenCommand.tok&&(this.iBrace++,this.vBraces.addLast(this.tokenCommand),this.lastFlowCommand=null),this.parenCount=this.braceCount=0);return!0},"~B");d(c$,"checkFlowEndBrace",function(){if(0>=this.iBrace||1048590!=this.vBraces.get(this.iBrace-1).tok)return 0;this.vBraces.remove(--this.iBrace);
var a=this.vBraces.remove(--this.iBrace);1048586==this.theTok&&(this.braceCount--,this.parenCount--);if(1276383749==a.tok)return this.vPush.remove(--this.pushCount),this.addTokenToPrefix(this.setCommand(J.script.ContextToken.newContext(!0))),this.isEndOfCommand=!0,2;switch(null==this.flowContext?0:this.flowContext.token.tok){case 135369225: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)});d(c$,"forceFlowEnd",function(a){var b=this.tokenCommand;this.setCommand(J.script.T.o(1150985,"end"));if(!this.checkFlowCommand("end"))return 0;this.addTokenToPrefix(this.tokenCommand);switch(a.tok){case 135369225:case 364547:case 102402:a=J.script.T.tokenIf;break;case 102413:case 102411:a=J.script.T.tokenSwitch;break;default:a=J.script.T.getTokenFromName(a.value)}if(!this.checkFlowEnd(a.tok,a.value,this.ichBrace))return 4;135368713!=a.tok&&(102436!=
a.tok&&364558!=a.tok)&&this.addTokenToPrefix(a);this.setCommand(b);return 2},"J.script.T");c$.isBreakableContext=d(c$,"isBreakableContext",function(a){return 135369224==a||102439==a||102406==a||102411==a||102413==a},"~N");d(c$,"checkFlowCommand",function(a){var b=this.lltoken.size(),c=!1,d=!0;switch(this.tokCommand){case 135368713:case 102436:if(null!=this.flowContext)return this.errorStr(1,J.script.T.nameOf(this.tokCommand));break;case 1150985:if(null==this.flowContext)return this.errorStr(1,a);
c=!0;135368713!=this.flowContext.token.tok&&(102436!=this.flowContext.token.tok&&364558!=this.flowContext.token.tok)&&this.setCommand(J.script.T.tv(this.tokCommand,0<this.flowContext.ptDefault?this.flowContext.ptDefault:-this.flowContext.pt0,a));break;case 364548:c=!0;if(null==this.flowContext||135369225!=this.flowContext.token.tok&&102439!=this.flowContext.token.tok&&364547!=this.flowContext.token.tok&&102402!=this.flowContext.token.tok)return this.errorStr(1,a);break;case 364547:if(null==this.flowContext||
135369225!=this.flowContext.token.tok&&102402!=this.flowContext.token.tok)return this.errorStr(1,a);this.flowContext.token.intValue=this.flowContext.setPt0(b,!1);break;case 102407:case 102408:var d=!1,f=null==this.flowContext?null:this.flowContext.getBreakableContext(0);if(102408==this.tokCommand)for(;null!=f&&135369224!=f.token.tok&&102406!=f.token.tok;)f=f.getParent();if(null==f)return this.errorStr(1,a);this.setCommand(J.script.T.tv(this.tokCommand,f.pt0,a));break;case 102413:if(null==this.flowContext||
102410!=this.flowContext.token.tok&&102411!=this.flowContext.token.tok&&0<this.flowContext.ptDefault)return this.errorStr(1,a);this.flowContext.token.intValue=this.flowContext.setPt0(b,!0);break;case 102411:if(null==this.flowContext||102410!=this.flowContext.token.tok&&102411!=this.flowContext.token.tok&&102413!=this.flowContext.token.tok)return this.errorStr(1,a);this.flowContext.token.intValue=this.flowContext.setPt0(b,!1);break;case 102402:if(null==this.flowContext||135369225!=this.flowContext.token.tok&&
102402!=this.flowContext.token.tok&&364547!=this.flowContext.token.tok)return this.errorStr(1,"elseif");this.flowContext.token.intValue=this.flowContext.setPt0(b,!1)}if(c)this.flowContext.token.intValue=102412==this.tokCommand?-b:b,364548==this.tokCommand&&(this.flowContext=this.flowContext.getParent());else if(d)switch(a=J.script.ContextToken.newCmd(this.tokCommand,this.tokenCommand.value),102410==this.tokCommand&&a.addName("_var"),this.setCommand(a),this.tokCommand){case 364558:this.flowContext=
new J.script.ScriptFlowContext(this,a,b,this.flowContext);null!=this.thisFunction&&this.vFunctionStack.add(0,this.thisFunction);this.thisFunction=J.script.ScriptCompiler.newScriptParallelProcessor("",this.tokCommand);this.flowContext.setFunction(this.thisFunction);this.pushCount++;this.vPush.addLast(a);break;case 364547:case 102402:this.flowContext.token=a;break;case 102411:case 102413:a.contextVariables=this.flowContext.token.contextVariables;this.flowContext.token=a;break;case 102439:case 135369224:case 102406:case 102412:this.pushCount++,
this.vPush.addLast(a);default:this.flowContext=new J.script.ScriptFlowContext(this,a,b,this.flowContext)}return!0},"~S");d(c$,"checkFlowEnd",function(a,b,c){if(null==this.flowContext||this.flowContext.token.tok!=a){var d=!0;switch(a){case 135369225:d=364547==this.flowContext.token.tok||102402==this.flowContext.token.tok;break;case 102410:d=102411==this.flowContext.token.tok||102413==this.flowContext.token.tok;break;default:d=!1}if(!d)return this.errorStr(1,"end "+b)}switch(a){case 135369225:case 102410:break;
case 102412:case 135369224:case 102439:case 102406:this.vPush.remove(--this.pushCount);break;case 102436:case 135368713:case 364558:this.isCheckOnly||(this.addTokenToPrefix(J.script.T.o(a,this.thisFunction)),J.script.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.remove(0);this.tokenCommand.intValue=0;364558==a&&this.vPush.remove(--this.pushCount);
break;default:return this.errorStr(19,"end "+b)}this.flowContext=this.flowContext.getParent();return!0},"~N,~S,~N");d(c$,"getData",function(a){this.addTokenToPrefix(J.script.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(J.script.T.o(135270407,c));this.addTokenToPrefix(J.script.T.o(1073741824,"end"));this.addTokenToPrefix(J.script.T.o(4,a));this.cchToken=b-this.ichToken+a.length+6;return!0},"~S");d(c$,"incrementLineCount",function(a){var b,c=a.indexOf("\r"),d=a.indexOf("\n");if(0>c&&0>d)return 0;var f=this.lineCurrent;if(0>c||d<c)c=d;for(d=a.length;--d>=c;)("\n"==(b=a.charAt(d))||"\r"==b)&&this.lineCurrent++;return this.lineCurrent-
f},"~S");c$.isSpaceOrTab=d(c$,"isSpaceOrTab",function(a){return" "==a||"\t"==a},"~S");d(c$,"eol",function(a){return"\x00"==a||"\r"==a||"\n"==a||";"==a&&0>=this.nSemiSkip},"~S");d(c$,"lookingAtSetBraceSyntax",function(){for(var a=this.ichToken,b=1;++a<this.cchScript&&0<b;)switch(this.script.charAt(a)){case "{":b++;break;case "}":b--}if("["==this.charAt(a)&&1==++b)for(;++a<this.cchScript&&0<b;)switch(this.script.charAt(a)){case "[":b++;break;case "]":b--}return"."==this.charAt(a)&&0==b?!0:!1});d(c$,
"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");d(c$,"getUnescapedStringLiteral",function(a){if(a)return a=this.script.substring(this.ichToken+
1,this.ichToken+this.cchToken-1),0<=a.indexOf("\\u")&&(a=J.util.Escape.unescapeUnicode(a)),a;a=JU.SB.newN(this.cchToken-2);for(var b=this.ichToken+this.cchToken-1,c=this.ichToken+1;c<b;){var d=this.script.charAt(c++);if("\\"==d&&c<b)switch(d=this.script.charAt(c++),d){case "n":d="\n";break;case "t":d="\t";break;case "r":d="\r";case '"':case "\\":case "'":break;case "x":case "u":var f="x"==d?2:4;if(c<b){for(d=0;0<=--f&&c<b;){var l=this.script.charAt(c),l=J.util.Escape.getHexitValue(l);if(0>l)break;
d<<=4;d+=l;++c}d=String.fromCharCode(d)}}a.appendC(d)}return a.toString()},"~B");d(c$,"lookingAtLoadFormat",function(){for(var a=this.ichToken,b=J.viewer.Viewer.isDatabaseCode(this.charAt(a)),c;Character.isLetterOrDigit(c=this.charAt(a))&&(b||Character.isLetter(c))||b&&!this.eol(c)&&!Character.isWhitespace(c);)++a;if(!b&&a==this.ichToken||!J.script.ScriptCompiler.isSpaceOrTab(c))return!1;this.cchToken=a-this.ichToken;return!0});d(c$,"lookingAtImpliedString",function(a,b,c){var d=this.ichToken,f=this.script.charAt(d),
l=1074790550==this.lastToken.tok,g=l||!J.script.T.tokAttr(this.tokCommand,20480)&&1==(this.tokCommand&1),h="@"==f;if(h&&(d+3<this.cchScript&&"{"==this.script.charAt(d+1))&&g)return d=J.util.Txt.ichMathTerminator(this.script,this.ichToken+1,this.cchScript),!l&&d!=this.cchScript&&0<(this.cchToken=d+1-this.ichToken);for(var g=l=-1,k=!0,m=0;k&&!this.eol(f=this.charAt(d));){switch(f){case "(":if(!c&&5<=d&&(this.script.substring(d-4,d).equals(".spt")||this.script.substring(d-4,d).equals(".png")||this.script.substring(d-
5,d).equals(".pngj"))){k=!1;continue}break;case "=":if(!b){k=!1;continue}break;case "{":m++;break;case "}":m--;if(0>m&&(0<this.braceCount||0<this.iBrace)){k=!1;continue}break;default:Character.isWhitespace(f)?0>l&&(l=d):g=d}++d}a?d=g+1:0<l&&(d=l);return h&&(!a||0>l&&0>=m&&1<d-this.ichToken)?!1:0<(this.cchToken=d-this.ichToken)},"~B,~B,~B");d(c$,"lookingAtExponential",function(){if(this.ichToken==this.cchScript)return NaN;var a=this.ichToken,b=a;"-"==this.script.charAt(a)&&++a;for(var c=!1,d="X";Character.isDigit(d=
this.charAt(a));)++a,c=!0;for(a<this.cchScript&&"."==d&&++a;Character.isDigit(d=this.charAt(a));)++a,c=!0;if(a==this.cchScript||!c||(c="E"!=d&&"e"!=d)||++a==this.cchScript)return NaN;d=this.script.charAt(a);for(("-"==d||"+"==d)&&a++;Character.isDigit(this.charAt(a));)a++,c=!0;if(!c)return NaN;this.cchToken=a-this.ichToken;return JU.PT.dVal(this.script.substring(b,a))});d(c$,"lookingAtDecimal",function(){if(this.ichToken==this.cchScript)return!1;var a=this.ichToken;"-"==this.script.charAt(a)&&++a;
for(var b=!1,c;Character.isDigit(c=this.charAt(a++));)b=!0;if("."!=c)return!1;if(!this.eol(c=this.charAt(a)))if(Character.isLetter(c)||"?"==c||"*"==c||Character.isLetter(c=this.charAt(a+1))||"?"==c)return!1;for(;Character.isDigit(this.charAt(a));)++a,b=!0;this.cchToken=a-this.ichToken;return b});d(c$,"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;Character.isDigit(b=this.charAt(a));)++a;if("^"!=
b)return!1;a++;b=a==this.cchScript?" ":this.script.charAt(a++);if(" "!=b&&"*"!=b&&"?"!=b&&!Character.isLetter(b))return!1;this.cchToken=a-this.ichToken;return!0});d(c$,"lookingAtInteger",function(){if(this.ichToken==this.cchScript)return 2147483647;var a=this.ichToken;"-"==this.script.charAt(this.ichToken)&&++a;for(var b=a;Character.isDigit(this.charAt(a));)++a;if(b==a)return 2147483647;this.cchToken=a-this.ichToken;try{return Integer.parseInt(this.script.substring(this.ichToken,a))}catch(c){if(!B(c,
NumberFormatException))throw c;}return 2147483647});d(c$,"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=J.util.Escape.uB(this.script.substring(this.ichToken,a+2));null!=b&&(this.cchToken=a+2-this.ichToken);return b});d(c$,"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(Character.isWhitespace(c=this.script.charAt(b))){if(b==this.ichToken+1)return!1;break}if(!Character.isLetterOrDigit(c))switch(c){default:return!1;case "*":if(!a)return!1;case "~":case "_":}b++}this.cchToken=b-++this.ichToken;return!0});d(c$,"lookingAtLookupToken",function(a){if(a==this.cchScript)return!1;var b=a;this.tokLastMath=0;var c;switch(c=this.script.charAt(a++)){case "-":case "+":case "&":case "|":case "*":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 "/":if("/"==this.charAt(a))break;case "\\":case "!":"="==this.charAt(a)&&++a;this.tokLastMath=1;break;case ")":case "]":case "}":case ".":break;case "@":case "{":this.tokLastMath=2;break;case ":":this.tokLastMath=1;break;case "(":case ",":case "$":case ";":case "[":case "%":this.tokLastMath=1;break;case "<":case "=":case ">":("<"==
(c=this.charAt(a))||"="==c||">"==c)&&++a;this.tokLastMath=1;break;default:if(!Character.isLetter(c))return!1;case "~":case "_":case "'":case "?":"?"==c&&(this.tokLastMath=1);for(;Character.isLetterOrDigit(c=this.charAt(a))||"_"==c||"?"==c||"~"==c||"'"==c||"\\"==c&&"?"==this.charAt(a+1)||"^"==c&&a>b&&Character.isDigit(this.charAt(a-1));)++a}this.cchToken=a-b;return!0},"~N");d(c$,"lookForSyncID",function(){var a;if('"'==(a=this.charAt(this.ichToken))||"@"==a||"\x00"==a)return!1;for(var b=this.ichToken;!J.script.ScriptCompiler.isSpaceOrTab(a=
this.charAt(b))&&"#"!=a&&"}"!=a&&!this.eol(a);)++b;this.cchToken=b-this.ichToken;return!0});d(c$,"ERROR",function(a){this.errorIntStr2(a,null,null);return 4},"~N");d(c$,"ERROR",function(a,b){this.errorStr(a,b);return 4},"~N,~S");d(c$,"handleError",function(){this.errorType=this.errorMessage;this.errorLine=this.script.substring(this.ichCurrentCommand,this.ichEnd<=this.ichCurrentCommand?this.ichToken:this.ichEnd);var 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+J.script.ScriptEvaluator.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.viewer.addCommand(this.errorLine+
"#??");J.util.Logger.error(this.errorMessage)}return!1});P(c$,"OK",0,"OK2",1,"CONTINUE",2,"EOL",3,"$ERROR",4)});D("J.script");E(null,"J.script.ScriptCompilationTokenParser","java.lang.Float JU.List $.P3 $.PT J.i18n.GT J.script.ScriptEvaluator $.T J.util.Logger J.viewer.JC".split(" "),function(){c$=I(function(){this.script=this.viewer=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.logMessages=this.isNewSet=!1;this.atokenInfix=null;this.itokenInfix=0;this.isSetOrDefine=this.isMathExpressionCommand=this.isSetBrace=!1;this.ltokenPostfix=null;this.isCommaAsOrAllowed=this.isEmbeddedExpression=!1;this.htUserFunctions=this.theValue=null;this.residueSpecCodeGenerated=this.haveString=!1;this.errorType=this.errorLine=this.errorMessageUntranslated=this.errorMessage=null;L(this,
arguments)},J.script,"ScriptCompilationTokenParser");d(c$,"compileExpressions",function(){var a=135271429==this.tokCommand&&269484048==this.tokAt(2);this.isEmbeddedExpression=a||0!=this.tokCommand&&(135368713!=this.tokCommand&&102436!=this.tokCommand&&364558!=this.tokCommand&&102412!=this.tokCommand||2147483647!=this.tokenCommand.intValue)&&1150985!=this.tokCommand&&!J.script.T.tokAttrOr(this.tokCommand,12288,20480);this.isMathExpressionCommand=1073741824==this.tokCommand||a||J.script.T.tokAttr(this.tokCommand,
36864);a=this.isEmbeddedExpression||J.script.T.tokAttr(this.tokCommand,12288);1048583==this.tokAt(1)&&J.script.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++)1060866==this.tokAt(c)&&b++;a-=b;this.isNewSet&&1==a&&(this.atokenInfix[0]=J.script.T.tv(135368713,0,this.atokenInfix[0].value),this.isNewSet=!1);return(this.isNewSet||this.isSetBrace)&&a<this.ptNewSetModifier+2?this.commandExpected():1==a||!J.script.T.tokAttr(this.tokCommand,
262144)?!0:this.error(0)});d(c$,"compileExpression",function(){var a=this.isSetOrDefine&&!this.isSetBrace?2:1;this.ltokenPostfix=new JU.List;this.itokenInfix=0;var b=null,c=this.tokAt(1);switch(this.tokCommand){case 1060866:2==this.tokAt(1)&&(1048584==this.tokAt(2)&&269484436==this.tokAt(4))&&(this.tokCommand=1085443,this.isSetBrace=!0,this.ptNewSetModifier=4,this.isEmbeddedExpression=this.isMathExpressionCommand=!0,this.addTokenToPostfixToken(J.script.T.tokenSetProperty),this.addTokenToPostfixToken(J.script.T.tokenExpressionBegin),
this.addNextToken(),this.addNextToken(),this.addTokenToPostfixToken(J.script.T.tokenExpressionEnd),a=0);break;case 12295:1678770178==c&&(a=2);break;case 135280132:switch(c){case 1048589:case 1048588:c=this.tokAt(++a);break}case 12294:case 1610625028:switch(c){case 1276118017:case 1073742119:c=this.tokAt(++a)}1087373318==c&&a++}for(c=0;c<a&&this.addNextToken();c++);for(;this.moreTokens();){if(this.isEmbeddedExpression){for(;!this.isExpressionNext();){if(this.tokPeekIs(1073741824)&&!(135271426==this.tokCommand&&
1==this.itokenInfix)&&(a=this.atokenInfix[this.itokenInfix].value,c=J.script.T.getTokenFromName(a),null!=c&&(!this.isMathExpressionCommand&&1060866!=this.lastToken.tok||(1048584==this.lastToken.tok||269484048==this.tokAt(this.itokenInfix+1))&&!this.isUserFunction(a))))this.atokenInfix[this.itokenInfix]=c;if(!this.addNextToken())break}if(!this.moreTokens())break}if(1060866==this.lastToken.tok){if(!this.clauseDefine(!0,!1))return!1}else{this.isMathExpressionCommand||this.addTokenToPostfixToken(b=J.script.T.o(1048577,
"implicitExpressionBegin"));if(!this.clauseOr(this.isCommaAsOrAllowed||!this.isMathExpressionCommand&&this.tokPeekIs(269484048)))return!1;!this.isMathExpressionCommand&&!(this.isEmbeddedExpression&&this.lastToken===J.script.T.tokenCoordinateEnd)&&this.addTokenToPostfixToken(J.script.T.tokenExpressionEnd);if(this.moreTokens()){if(135280132!=this.tokCommand&&!this.isEmbeddedExpression)return this.error(5);135280132==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});d(c$,"isUserFunction",function(a){return!this.isStateScript&&(this.viewer.isFunction(a)||this.htUserFunctions.containsKey(a))},"~S");d(c$,"isExpressionNext",function(){return this.tokPeekIs(1048586)&&!(4==this.tokAt(this.itokenInfix+1)&&269484066==this.tokAt(this.itokenInfix+2))||!this.isMathExpressionCommand&&this.tokPeekIs(269484048)});c$.tokenAttr=d(c$,"tokenAttr",function(a,
b){return null!=a&&J.script.T.tokAttr(a.tok,b)},"J.script.T,~N");d(c$,"moreTokens",function(){return this.itokenInfix<this.atokenInfix.length});d(c$,"tokAt",function(a){return a<this.atokenInfix.length?this.atokenInfix[a].tok:0},"~N");d(c$,"tokPeek",function(){return this.itokenInfix>=this.atokenInfix.length?0:this.atokenInfix[this.itokenInfix].tok});d(c$,"tokPeekIs",function(a){return this.tokAt(this.itokenInfix)==a},"~N");d(c$,"intPeek",function(){return this.itokenInfix>=this.atokenInfix.length?
2147483647:this.atokenInfix[this.itokenInfix].intValue});d(c$,"valuePeek",function(){return this.moreTokens()?this.atokenInfix[this.itokenInfix].value:""});d(c$,"tokenNext",function(){return this.itokenInfix>=this.atokenInfix.length?null:this.atokenInfix[this.itokenInfix++]});d(c$,"tokenNextTok",function(a){var b=this.tokenNext();return null!=b&&b.tok==a},"~N");d(c$,"returnToken",function(){this.itokenInfix--;return!1});d(c$,"getToken",function(){this.theValue=null==(this.theToken=this.tokenNext())?
null:this.theToken.value;return this.theToken});d(c$,"isToken",function(a){return null!=this.theToken&&this.theToken.tok==a},"~N");d(c$,"getNumericalToken",function(){return null!=this.getToken()&&(this.isToken(2)||this.isToken(3))});d(c$,"floatValue",function(){switch(this.theToken.tok){case 2:return this.theToken.intValue;case 3:return this.theValue.floatValue()}return 0});d(c$,"addTokenToPostfix",function(a,b){return this.addTokenToPostfixToken(J.script.T.o(a,b))},"~N,~O");d(c$,"addTokenToPostfixInt",
function(a,b,c){return this.addTokenToPostfixToken(J.script.T.tv(a,b,c))},"~N,~N,~O");d(c$,"addTokenToPostfixToken",function(a){if(null==a)return!1;this.logMessages&&J.util.Logger.debug("addTokenToPostfix"+a);this.ltokenPostfix.addLast(a);this.lastToken=a;return!0},"J.script.T");d(c$,"addNextToken",function(){return this.addTokenToPostfixToken(this.tokenNext())});d(c$,"addNextTokenIf",function(a){return this.tokPeekIs(a)&&this.addNextToken()},"~N");d(c$,"addSubstituteTokenIf",function(a,b){if(!this.tokPeekIs(a))return!1;
this.itokenInfix++;return this.addTokenToPostfixToken(b)},"~N,J.script.T");d(c$,"clauseOr",function(a){this.haveString=!1;if(!this.clauseAnd())return!1;if(this.isEmbeddedExpression&&1048578==this.lastToken.tok)return!0;for(var b;269484112==(b=this.tokPeek())||269484113==b||269484114==b||a&&269484080==b;){269484080==b&&!this.haveString?this.addSubstituteTokenIf(269484080,J.script.T.tokenOr):this.addNextToken();if(!this.clauseAnd())return!1;if(a&&(1048590==this.lastToken.tok||10==this.lastToken.tok))this.haveString=
!0}return!0},"~B");d(c$,"clauseAnd",function(){if(!this.clauseNot())return!1;if(this.isEmbeddedExpression&&1048578==this.lastToken.tok)return!0;for(;this.tokPeekIs(269484128);)if(this.addNextToken(),!this.clauseNot())return!1;return!0});d(c$,"clauseNot",function(){return this.tokPeekIs(269484144)?(this.addNextToken(),this.clauseNot()):this.clausePrimitive()});d(c$,"clausePrimitive",function(){var a=this.tokPeek();switch(a){case 1073742195:return this.itokenInfix++,this.clausePrimitive();case 0:return this.error(4);
case 1048579:case 10:case 269484208:case 137363468:case 3145736:case 3145735:case 3145738:case 1048585:case 1048587:case 3145760:return this.addNextToken();case 4:return this.haveString=!0,this.addNextToken();case 3:return this.addTokenToPostfixInt(1048611,this.fixModelSpec(this.getToken()),this.theValue);case 1095761925:case 1095761926:return this.clauseCell(a);case 135266310:return this.clauseConnected();case 135267335:case 135267336:return this.clauseSubstructure();case 135266325:case 135402505:return this.clauseWithin(135266325==
a);case 1060866:return this.clauseDefine(!1,!1);case 1678770178:case 1746538509:this.addNextToken();if(this.tokPeekIs(10))this.addNextToken();else if(this.tokPeekIs(1060866))return this.clauseDefine(!1,!1);return!0;case 269484048:return this.addNextToken(),!this.clauseOr(!0)?!1:!this.addNextTokenIf(269484049)?this.errorStr(15,")"):this.checkForItemSelector(!0);case 1048586:return this.checkForCoordinate(this.isMathExpressionCommand);default:if(this.clauseResidueSpec())return!0;if(this.isError())return!1;
if(J.script.T.tokAttr(a,1078984704)){var b=this.itokenInfix,c=this.clauseComparator(!0);if(c||this.itokenInfix!=b)return c;if(1238369286==a)return this.clauseSubstructure()}return this.addNextToken()}});d(c$,"checkForCoordinate",function(a){var b=!1,c=this.ltokenPostfix.size();a?(this.addTokenToPostfixToken(J.script.T.tokenExpressionBegin),this.tokenNext()):this.isEmbeddedExpression?(this.tokenNext(),c--):this.addNextToken();var d=this.tokPeekIs(4);if(d){a=!1;this.returnToken();this.ltokenPostfix.remove(this.ltokenPostfix.size()-
1);this.addNextToken();for(var f=1;0!=f;){if(this.tokPeekIs(1048586))if(this.isExpressionNext()){this.addTokenToPostfixToken(J.script.T.o(1048577,"implicitExpressionBegin"));if(!this.clauseOr(!0))return!1;this.lastToken!==J.script.T.tokenCoordinateEnd&&this.addTokenToPostfixToken(J.script.T.tokenExpressionEnd)}else f++;this.tokPeekIs(1048590)&&f--;this.addNextToken()}}else{if(!this.tokPeekIs(1048590)&&!this.clauseOr(!1))return!1;for(b=1;!this.tokPeekIs(1048590);){f=this.addNextTokenIf(269484080);
if(!this.clauseOr(!1))return f||3>b?!1:this.errorStr(15,"}");b++}b=2<=b}b&&(a||this.isEmbeddedExpression)?(this.ltokenPostfix.set(c,J.script.T.tokenCoordinateBegin),this.addTokenToPostfixToken(J.script.T.tokenCoordinateEnd),this.tokenNext()):a?(this.addTokenToPostfixToken(J.script.T.tokenExpressionEnd),this.tokenNext()):this.isEmbeddedExpression&&!d?this.tokenNext():this.addNextToken();return this.checkForItemSelector(!d)},"~B");d(c$,"checkForItemSelector",function(a){var b;if(269484096==(b=this.tokAt(this.itokenInfix+
1))||a&&1048586==b)return!0;for(;this.addNextTokenIf(269484096);){if(!this.clauseItemSelector())return!1;if(!this.addNextTokenIf(269484097))return this.errorStr(15,"]")}return!0},"~B");d(c$,"clauseWithin",function(a){this.addNextToken();if(!this.addNextTokenIf(269484048)||null==this.getToken())return!1;var b=3.4028235E38,c=null,d=a,f,l=this.theToken.tok;if(!a){f=-1;for(var g=this.itokenInfix;0!=f;g++)switch(f=this.tokAt(g)){case 269484080:f=0;break;case 1048586:case 269484048:case 269484049:b=100,
this.returnToken(),l=f=0}}switch(l){case 269484192: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 1060866:this.addTokenToPostfixToken(this.theToken);if(!this.clauseDefine(!0,!1))return!1;c="";d=!1}if(a&&3.4028235E38==b)switch(l){case 1060866:break;case 135267335:case 135267336:case 1238369286:this.addTokenToPostfix(4,this.theValue);if(!this.addNextTokenIf(269484080))return!1;d=!1;f=this.tokPeek();
switch(f){case 0:return!1;case 4:this.addNextToken();c="";break;case 1060866:if(!this.clauseDefine(!1,!0))return!1;c="";break;default:return!1}break;case 1048580:d=!1;case 1087375361:case 1087375362:case 1073741864:case 1679429641:case 1087373316:case 1048582:case 1087375365:case 1087373318:case 137363468:case 1095766030:case 1095761936:case 135266319:case 135267841:case 1095761937:case 1087373320:case 3145760:case 1095761940:case 1641025539:case 4:case 1649412120:c=this.theValue;break;case 1073741824:c=
this.theValue.toLowerCase();break;default:return this.errorIntStr2(18,"WITHIN",": "+this.theToken.value)}null==c?this.addTokenToPostfix(3,Float.$valueOf(b)):0<c.length&&this.addTokenToPostfix(4,c);for(g=!1;!g&&(0==l||this.addNextTokenIf(269484080));){0==l&&(l=135402505);var h=!1;f=this.tokPeek();if(a){switch(l){case 2:case 3:if(1048589==f||1048588==f){this.addTokenToPostfixToken(this.getToken());if(!this.addNextTokenIf(269484080))break;f=this.tokPeek()}}if(null==c){switch(f){case 135267841:case 1048582:case 135266319:h=
!0;this.addNextToken();break;case 1048583:this.getToken();this.getToken();this.addTokenToPostfix(4,"$"+this.theValue);g=!0;break;case 1087373318:case 1649412120:this.getToken();this.addTokenToPostfix(4,J.script.T.nameOf(f));break;case 1048586:this.returnToken(),h=!0,this.addTokenToPostfixToken(J.script.T.getTokenFromName(3.4028235E38==b?"plane":"coord"))}g||this.addNextTokenIf(269484080)}}this.tokPeek();if(g)break;if(h)for(;!this.tokPeekIs(269484049);)switch(this.tokPeek()){case 0:return this.error(4);
case 269484048:this.addTokenToPostfixToken(J.script.T.tokenExpressionBegin);this.addNextToken();if(!this.clauseOr(!1))return this.errorIntStr2(18,"WITHIN",": ?");if(!this.addNextTokenIf(269484049))return this.errorStr(15,", / )");this.addTokenToPostfixToken(J.script.T.tokenExpressionEnd);break;case 1060866:if(!this.clauseDefine(!1,!1))return!1;break;default:this.addTokenToPostfixToken(this.getToken())}else this.clauseOr(d)}return!this.addNextTokenIf(269484049)?this.errorStr(15,")"):!0},"~B");d(c$,
"clauseConnected",function(){this.addNextToken();if(!this.addNextTokenIf(269484048))return this.addTokenToPostfixToken(J.script.T.tokenLeftParen),this.addTokenToPostfixToken(J.script.T.tokenRightParen),!0;for(;(!this.addNextTokenIf(2)||this.addNextTokenIf(269484080))&&(!this.addNextTokenIf(2)||this.addNextTokenIf(269484080))&&(!this.addNextTokenIf(3)||this.addNextTokenIf(269484080))&&(!this.addNextTokenIf(3)||this.addNextTokenIf(269484080));){var a=this.getToken().value,a=r(a,String)?a:" ";if(131071==
J.script.ScriptEvaluator.getBondOrderFromString(a))this.returnToken();else if(this.addTokenToPostfix(4,a),!this.addNextTokenIf(269484080))break;if(this.addNextTokenIf(269484049))return!0;if(!this.clauseOr(this.tokPeekIs(269484048)))return!1;if(this.addNextTokenIf(269484049))return!0;if(!this.addNextTokenIf(269484080)||!this.clauseOr(this.tokPeekIs(269484048)))return!1;break}return!this.addNextTokenIf(269484049)?this.errorStr(15,")"):!0});d(c$,"clauseSubstructure",function(){this.addNextToken();if(!this.addNextTokenIf(269484048))return!1;
if(this.tokPeekIs(1060866)){if(!this.clauseDefine(!1,!0))return!1}else if(!this.addNextTokenIf(4))return this.errorStr(15,'"..."');return this.addNextTokenIf(269484080)&&!this.clauseOr(this.tokPeekIs(269484048))?!1:!this.addNextTokenIf(269484049)?this.errorStr(15,")"):!0});d(c$,"clauseItemSelector",function(){for(var a,b=0;0!=(a=this.tokPeek())&&269484097!=a;)this.addNextToken(),269484096==a&&b++,269484097==this.tokPeek()&&0<b--&&this.addNextToken();return!0});d(c$,"clauseComparator",function(a){var b=
this.tokenNext(),c=this.tokenNext();if(!J.script.ScriptCompilationTokenParser.tokenAttr(c,269484288)){if(!a)return this.errorStr(15,"== != < > <= >=");null!=c&&this.returnToken();this.returnToken();return!1}if(J.script.ScriptCompilationTokenParser.tokenAttr(b,1087373312)&&269484436!=c.tok&&269484438!=c.tok)return this.errorStr(15,"== !=");if(null==this.getToken())return this.errorStr(17,""+this.valuePeek());if((a=this.isToken(269484192))&&null==this.getToken())return this.error(12);switch(this.theToken.tok){case 2:case 3:case 1073741824:case 4:case 1048586:case 1060866:break;
default:if(!J.script.T.tokAttr(this.theToken.tok,1073741824))return this.error(13)}this.addTokenToPostfixInt(c.tok,b.tok,c.value+(a?" -":""));1716520985==b.tok&&this.addTokenToPostfixToken(b);if(this.isToken(1048586))return this.returnToken(),this.clausePrimitive();this.addTokenToPostfixToken(this.theToken);return 1060866==this.theToken.tok?this.clauseDefine(!0,!1):!0},"~B");d(c$,"clauseCell",function(a){var b=new JU.P3;this.tokenNext();if(!this.tokenNextTok(269484436))return this.errorStr(15,"=");
if(null==this.getToken())return this.error(3);if(this.isToken(2)){var c=this.theToken.intValue;b.x=G(c/100)-4;b.y=G(c%100/10)-4;b.z=c%10-4;return this.addTokenToPostfix(a,b)}if(!this.isToken(1048586)||!this.getNumericalToken())return this.error(3);b.x=this.floatValue();this.tokPeekIs(269484080)&&this.tokenNext();if(!this.getNumericalToken())return this.error(3);b.y=this.floatValue();this.tokPeekIs(269484080)&&this.tokenNext();if(!this.getNumericalToken()||!this.tokenNextTok(1048590))return this.error(3);
b.z=this.floatValue();return this.addTokenToPostfix(a,b)},"~N");d(c$,"clauseDefine",function(a,b){if(!a){var c=this.tokenNext();b&&(c=J.script.T.tokenDefineString);this.addTokenToPostfixToken(c)}if(0==this.tokPeek())return this.error(4);if(!this.addSubstituteTokenIf(1048586,J.script.T.tokenExpressionBegin))return this.addNextToken()&&this.checkForItemSelector(!0);for(;this.moreTokens()&&!this.tokPeekIs(1048590);)if(this.tokPeekIs(1048586)){if(!this.checkForCoordinate(!0))return!1}else this.addNextToken();
return this.addSubstituteTokenIf(1048590,J.script.T.tokenExpressionEnd)&&this.checkForItemSelector(!0)},"~B,~B");d(c$,"generateResidueSpecCode",function(a){this.residueSpecCodeGenerated&&this.addTokenToPostfixToken(J.script.T.tokenAND);this.addTokenToPostfixToken(a);return this.residueSpecCodeGenerated=!0},"J.script.T");d(c$,"clauseResidueSpec",function(){var a=this.tokPeek(),b=this.residueSpecCodeGenerated=!1;switch(a){case 0:case 3145732:case 3145750:return!1;case 269484066:case 2:case 269484210:case 5:break;
case 269484209:case 269484096:case 1073741824:b=!0;break;default:if(J.script.T.tokAttr(a,269484288))return!1;var c=""+this.valuePeek(),b=2==c.length||3==c.length;if(!b)return!1}c=!1;if(b){if(!this.clauseResNameSpec())return!1;c=!0;a=this.tokPeek();if(J.script.T.tokAttr(a,269484288))return this.returnToken(),this.ltokenPostfix.remove(this.ltokenPostfix.size()-1),!1}b=!1;if(269484209==a||2==a||5==a){b=2==a;if(this.tokPeekIs(269484209))this.getToken();else if(!this.clauseSequenceSpec())return!1;c=!0;
a=this.tokPeek()}if(269484066==a||269484209==a||1073741824==a||1112541205==a||1112541206==a||1112541207==a||1141899280==a||2==a&&!b){if(!this.clauseChainSpec(a))return!1;c=!0;a=this.tokPeek()}if(1048584==a){if(!this.clauseAtomSpec())return!1;c=!0;a=this.tokPeek()}if(269484210==a){if(!this.clauseAlternateSpec())return!1;c=!0;a=this.tokPeek()}if(269484066==a||269484208==a){if(!this.clauseModelSpec())return!1;c=!0;this.tokPeek()}if(!c)return this.error(14);this.residueSpecCodeGenerated||this.addTokenToPostfixToken(J.script.T.tokenAll);
return!0});d(c$,"clauseResNameSpec",function(){this.getToken();switch(this.theToken.tok){case 269484209:return!0;case 269484096:for(var a="";null!=this.getToken()&&!this.isToken(269484097);)a+=this.theValue;if(!this.isToken(269484097))return!1;if(""===a)return!0;var b;if(0<a.length&&0<=(b=a.indexOf("*"))&&b!=a.length-1)return this.error(14);a=a.toUpperCase();return this.generateResidueSpecCode(J.script.T.o(1048612,a));default:return a=this.theValue,this.tokPeekIs(269484209)&&(a=this.theValue+"*",
this.getToken()),this.generateResidueSpecCode(J.script.T.o(1073741824,a))}});d(c$,"clauseSequenceSpec",function(){var a=this.getSequenceCode(!1);if(null==a)return!1;var b=this.tokPeek();return 269484192==b||2==b&&0>this.intPeek()?(269484192==b?this.tokenNext():(b=-this.intPeek(),this.tokenNext().intValue=b,this.returnToken()),a.tok=1048615,this.generateResidueSpecCode(a),this.addTokenToPostfixToken(this.getSequenceCode(!0))):this.generateResidueSpecCode(a)});d(c$,"getSequenceCode",function(a){var b=
2147483647,c=2147483647,d=this.tokPeek();if(5==d)b=this.tokenNext().intValue;else if(2==d)c=this.tokenNext().intValue;else if(!a)return null;return J.script.T.tv(1048614,c,Integer.$valueOf(b))},"~B");d(c$,"clauseChainSpec",function(a){if(269484066==a&&(this.tokenNext(),a=this.tokPeek(),this.isSpecTerminator(a)))return this.generateResidueSpecCode(J.script.T.tv(1048609,0,"spec_chain"));switch(a){case 269484209:return null!=this.getToken();case 2:this.getToken();a=this.theToken.intValue;if(0>a||9999<
a)return this.error(8);a=this.viewer.getChainID(""+a);break;default:a=""+this.getToken().value;if(a.equals("?"))return!0;a=this.viewer.getChainID(a)}return this.generateResidueSpecCode(J.script.T.tv(1048609,a,"spec_chain"))},"~N");d(c$,"isSpecTerminator",function(a){switch(a){case 0:case 269484208:case 269484128:case 269484112:case 269484144:case 269484080:case 269484210:case 269484049:case 1048590:return!0}return!1},"~N");d(c$,"clauseAlternateSpec",function(){this.tokenNext();var a=this.tokPeek();
if(this.isSpecTerminator(a))return this.generateResidueSpecCode(J.script.T.o(1048607,null));a=this.getToken().value;switch(this.theToken.tok){case 269484209:case 4:case 2:case 1073741824:break;default:return this.error(10)}return this.generateResidueSpecCode(J.script.T.o(1048607,a))});d(c$,"clauseModelSpec",function(){this.getToken();if(this.tokPeekIs(269484209))return this.getToken(),!0;switch(this.tokPeek()){case 2:return this.generateResidueSpecCode(J.script.T.o(1048610,Integer.$valueOf(this.getToken().intValue)));
case 3:return this.generateResidueSpecCode(J.script.T.tv(1048610,this.fixModelSpec(this.getToken()),this.theValue));case 269484080:case 1048590:case 0:return this.generateResidueSpecCode(J.script.T.o(1048610,Integer.$valueOf(1)))}return this.error(10)});d(c$,"fixModelSpec",function(a){a=a.intValue;if(2147483647==a){var b=this.theValue.floatValue();b==z(b)&&(a=1E6*z(b));0>a&&(a=2147483647)}return a},"J.script.T");d(c$,"clauseAtomSpec",function(){if(!this.tokenNextTok(1048584))return this.error(7);
if(null==this.getToken())return!0;var a="";if(this.isToken(2)&&(a+=""+this.theToken.intValue,null==this.getToken()))return this.error(7);switch(this.theToken.tok){case 269484209:return!0}a+=""+this.theToken.value;this.tokPeekIs(269484209)&&(this.tokenNext(),a+="'");var b=J.viewer.JC.lookupSpecialAtomID(a.toUpperCase());return this.generateResidueSpecCode(J.script.T.tv(1048608,b,a))});c$.errorString=d(c$,"errorString",function(a,b,c,d){var f=!1;!d&&!0==(f=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.simpleReplace(a,"{0}",b),0<=a.indexOf("{1}")?a=JU.PT.simpleReplace(a,"{1}",c):null!=c&&(a+=": "+c));d||J.i18n.GT.setDoTranslate(f);return a},"~N,~S,~S,~B");d(c$,"commandExpected",function(){this.ichToken=this.ichCurrentCommand;return this.error(2)});d(c$,"error",function(a){return this.errorIntStr2(a,
null,null)},"~N");d(c$,"errorStr",function(a,b){return this.errorIntStr2(a,b,null)},"~N,~S");d(c$,"errorIntStr2",function(a,b,c){var d=J.script.ScriptCompilationTokenParser.errorString(a,b,c,!0);a=J.i18n.GT.getDoTranslate()?J.script.ScriptCompilationTokenParser.errorString(a,b,c,!1):null;return this.errorStr2(d,a)},"~N,~S,~S");d(c$,"isError",function(){return null!=this.errorMessage});d(c$,"errorStr2",function(a,b){this.errorMessage=a;this.errorMessageUntranslated=b;return!1},"~S,~S");P(c$,"ERROR_badArgumentCount",
0,"ERROR_badContext",1,"ERROR_commandExpected",2,"ERROR_endOfCommandUnexpected",4,"ERROR_invalidExpressionToken",9,"ERROR_missingEnd",11,"ERROR_tokenExpected",15,"ERROR_tokenUnexpected",16,"ERROR_unrecognizedParameter",18,"ERROR_unrecognizedToken",19,"ERROR_coordinateExpected",3,"ERROR_endOfExpressionExpected",5,"ERROR_identifierOrResidueSpecificationExpected",6,"ERROR_invalidAtomSpecification",7,"ERROR_invalidChainSpecification",8,"ERROR_invalidModelSpecification",10,"ERROR_numberExpected",12,"ERROR_numberOrVariableNameExpected",
13,"ERROR_residueSpecificationExpected",14,"ERROR_unrecognizedExpressionToken",17)});D("J.script");E(null,"J.script.ScriptFlowContext",["J.script.ScriptCompiler"],function(){c$=I(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;L(this,arguments)},J.script,"ScriptFlowContext");M(c$,function(a,b,c,d){this.compiler=a;this.token=b;this.ident=b.value;
this.pt0=c;this.parent=d;this.lineStart=this.ptLine=this.compiler.lineCurrent;this.commandStart=this.ptCommand=this.compiler.iCommand},"J.script.ScriptCompiler,J.script.ContextToken,~N,J.script.ScriptFlowContext");d(c$,"getBreakableContext",function(a){for(var b=this;null!=b&&(!J.script.ScriptCompiler.isBreakableContext(b.token.tok)||0<a--);)b=b.getParent();return b},"~N");d(c$,"checkForceEndIf",function(){var a=this.forceEndIf&&this.ptCommand<this.compiler.iCommand&&this.ptLine==this.compiler.lineCurrent;
a&&(this.forceEndIf=!1);return a});d(c$,"setPt0",function(a,b){this.pt0=a;b&&(this.ptDefault=a);this.setLine();return a},"~N,~B");d(c$,"setLine",function(){this.ptLine=this.compiler.lineCurrent;this.ptCommand=this.compiler.iCommand+1});n(c$,"toString",function(){return"ident "+this.ident+" line "+this.lineStart+" command "+this.commandStart});d(c$,"getParent",function(){return this.parent});d(c$,"path",function(){for(var a="",b=this;null!=b;)a=b.ident+"-"+a,b=b.parent;return"["+a+"]"});d(c$,"setFunction",
function(a){this.$function=a},"J.script.ScriptFunction")});D("J.script");E(["J.api.JmolScriptFunction","java.util.Hashtable","JU.List"],"J.script.ScriptFunction",["JU.AU","$.SB","J.script.SV","$.T"],function(){c$=I(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;L(this,arguments)},J.script,"ScriptFunction",null,J.api.JmolScriptFunction);
R(c$,function(){this.names=new JU.List;this.variables=new java.util.Hashtable});d(c$,"isVariable",function(a){return this.variables.containsKey(a)},"~S");M(c$,function(){});M(c$,function(a,b){this.set(a,b);this.typeName=J.script.T.nameOf(b)},"~S,~N");d(c$,"set",function(a,b){this.name=a;this.tok=b},"~S,~N");d(c$,"setVariables",function(a,b){for(var c=null==b?0:b.size(),d=this.names.size();0<=--d;){var f=this.names.get(d).toLowerCase(),l=d<this.nParameters&&d<c?b.get(d):null;null!=l&&7!=l.tok&&(l=
J.script.SV.newT(l));a.put(f,null==l?J.script.SV.newS("").setName(f):l)}a.put("_retval",J.script.SV.newI(364558==this.tok?2147483647:0))},"java.util.Map,JU.List");d(c$,"unsetVariables",function(a,b){var c=null==b?0:b.size(),d=this.names.size();if(!(0==c||0==d))for(var f=0;f<d&&f<c;f++){var l=b.get(f);if(7==l.tok){var g=a.get(this.names.get(f).toLowerCase());7==g.tok&&(l.value=g.value)}}},"java.util.Map,JU.List");d(c$,"addVariable",function(a,b){this.variables.put(a,a);this.names.addLast(a);b&&this.nParameters++},
"~S,~B");c$.setFunction=d(c$,"setFunction",function(a,b,c,d,f,l,g){var h=a.cmdpt0,k=a.chpt0,m=d-h;a.setScript(b.substring(k,c));b=a.aatoken=Array(m);a.lineIndices=JU.AU.newInt2(m);a.lineNumbers=T(m,0);c=f[h]-1;for(var j=0;j<m;j++)if(a.lineNumbers[j]=f[h+j]-c,a.lineIndices[j]=[l[h+j][0]-k,l[h+j][1]-k],b[j]=g.get(h+j),0<b[j].length){var n=b[j][0];J.script.T.tokAttr(n.tok,102400)&&(n.intValue-=0>n.intValue?-h:h)}for(j=d;--j>=h;)g.remove(j),l[j][0]=l[j][1]=0},"J.script.ScriptFunction,~S,~N,~N,~A,~A,JU.List");
d(c$,"setScript",function(a){this.script=a;null!=this.script&&(""!==this.script&&!this.script.endsWith("\n"))&&(this.script+="\n")},"~S");n(c$,"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()});n(c$,"getSignature",function(){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()});n(c$,"geTokens",function(){return this.aatoken});n(c$,"getName",function(){return this.name});n(c$,"getTok",function(){return this.tok})});D("J.script");E(["J.script.ScriptException"],"J.script.ScriptInterruption",null,function(){c$=I(function(){this.willResume=!1;L(this,arguments)},J.script,"ScriptInterruption",J.script.ScriptException);M(c$,function(a,b,c){Q(this,J.script.ScriptInterruption,[a,b,"!",a.viewer.autoExit]);
this.willResume=2147483647!=c;b.equals("delay")&&a.delayScript(c)},"J.script.ScriptEvaluator,~S,~N")});D("J.script");E(null,"J.script.ScriptMathProcessor","java.lang.Float java.util.Arrays $.Hashtable JU.A4 $.AU $.CU $.DF $.List $.M3 $.M4 $.P3 $.P4 $.PT $.V3 J.modelset.BondSet J.script.SV $.T J.util.BSUtil $.Escape $.Logger $.Quaternion".split(" "),function(){c$=I(function(){this.logMessages=this.wasSyntaxCheck=this.chk=!1;this.ifStack=this.xStack=this.oStack=this.viewer=this.eval=null;this.xPt=this.oPt=
this.ifPt=-1;this.braceCount=this.squareCount=this.parenCount=0;this.wasX=!1;this.incrementX=0;this.asBitSet=this.asVector=this.isArrayItem=!1;this.ptid=0;this.ptx=2147483647;this.haveSpaceBeforeSquare=this.skipping=!1;this.equalCount=0;L(this,arguments)},J.script,"ScriptMathProcessor");R(c$,function(){this.oStack=Array(8);this.xStack=Array(8);this.ifStack=V(8,"\x00")});M(c$,function(a,b,c,d){this.eval=a;this.viewer=a.viewer;this.logMessages=a.logMessages;this.chk=this.wasSyntaxCheck=a.chk;this.isArrayItem=
b;this.asVector=c||b;this.asBitSet=d;this.wasX=b;this.logMessages&&J.util.Logger.debug("initialize RPN")},"J.script.ScriptEvaluator,~B,~B,~B");d(c$,"getResult",function(a){for(var b=!0;b&&0<=this.oPt;)b=this.operate();if(b){if(this.asVector){a=new JU.List;for(b=0;b<=this.xPt;b++)a.addLast(J.script.SV.selectItemVar(this.xStack[b]));return J.script.SV.newV(135198,a)}if(0==this.xPt){a=this.xStack[0];if(10==a.tok||7==a.tok||4==a.tok||11==a.tok||12==a.tok)a=J.script.SV.selectItemVar(a);this.asBitSet&&
7==a.tok&&(a=J.script.SV.newV(10,J.script.SV.unEscapeBitSetArray(a.value,!1)));return a}}!a&&(0<=this.xPt||0<=this.oPt)&&this.eval.error(22);return null},"~B");d(c$,"putX",function(a){this.skipping||(++this.xPt==this.xStack.length&&(this.xStack=JU.AU.doubleLength(this.xStack)),this.logMessages&&J.util.Logger.debug("\nputX: "+a),this.xStack[this.xPt]=a,this.ptx=++this.ptid)},"J.script.SV");d(c$,"putOp",function(a){++this.oPt>=this.oStack.length&&(this.oStack=JU.AU.doubleLength(this.oStack));this.oStack[this.oPt]=
a;this.ptid++},"J.script.T");d(c$,"putIf",function(a){++this.ifPt>=this.ifStack.length&&(this.ifStack=JU.AU.doubleLength(this.ifStack));this.ifStack[this.ifPt]=a},"~S");d(c$,"addXVar",function(a){this.putX(a);return this.wasX=!0},"J.script.SV");d(c$,"addXObj",function(a){a=J.script.SV.getVariable(a);if(null==a)return!1;this.putX(a);return this.wasX=!0},"~O");d(c$,"addXStr",function(a){this.putX(J.script.SV.newS(a));return this.wasX=!0},"~S");d(c$,"addXBool",function(a){this.putX(J.script.SV.getBoolean(a));
return this.wasX=!0},"~B");d(c$,"addXInt",function(a){this.putX(J.script.SV.newI(a));return this.wasX=!0},"~N");d(c$,"addXList",function(a){this.putX(J.script.SV.getVariableList(a));return this.wasX=!0},"JU.List");d(c$,"addXMap",function(a){this.putX(J.script.SV.getVariableMap(a));return this.wasX=!0},"java.util.Map");d(c$,"addXM3",function(a){this.putX(J.script.SV.newV(11,a));return this.wasX=!0},"JU.M3");d(c$,"addXM4",function(a){this.putX(J.script.SV.newV(12,a));return this.wasX=!0},"JU.M4");d(c$,
"addXFloat",function(a){if(Float.isNaN(a))return this.addXStr("NaN");this.putX(J.script.SV.newV(3,Float.$valueOf(a)));return this.wasX=!0},"~N");d(c$,"addXBs",function(a){this.putX(J.script.SV.newV(10,a));return this.wasX=!0},"JU.BS");d(c$,"addXPt",function(a){this.putX(J.script.SV.newV(8,a));return this.wasX=!0},"JU.P3");d(c$,"addXPt4",function(a){this.putX(J.script.SV.newV(9,a));return this.wasX=!0},"JU.P4");d(c$,"addXNum",function(a){if(this.wasX)switch(a.tok){case 2:0>a.intValue&&(this.addOp(J.script.T.tokenMinus),
a=J.script.SV.newI(-a.intValue));break;case 3:var b=a.value.floatValue();if(0>b||0==b&&-Infinity==1/b)this.addOp(J.script.T.tokenMinus),a=J.script.SV.newV(3,Float.$valueOf(-b))}this.putX(a);return this.wasX=!0},"J.script.SV");d(c$,"addXAV",function(a){this.putX(J.script.SV.getVariableAV(a));return this.wasX=!0},"~A");d(c$,"addXAD",function(a){this.putX(J.script.SV.getVariableAD(a));return this.wasX=!0},"~A");d(c$,"addXAS",function(a){this.putX(J.script.SV.getVariableAS(a));return this.wasX=!0},"~A");
d(c$,"addXAI",function(a){this.putX(J.script.SV.getVariableAI(a));return this.wasX=!0},"~A");d(c$,"addXAII",function(a){this.putX(J.script.SV.getVariableAII(a));return this.wasX=!0},"~A");d(c$,"addXAF",function(a){this.putX(J.script.SV.getVariableAF(a));return this.wasX=!0},"~A");d(c$,"addXAFF",function(a){this.putX(J.script.SV.getVariableAFF(a));return this.wasX=!0},"~A");c$.isOpFunc=d(c$,"isOpFunc",function(a){return J.script.T.tokAttr(a.tok,135266304)&&a!==J.script.T.tokenArraySquare||269484241==
a.tok&&J.script.T.tokAttr(a.intValue,135266304)},"J.script.T");d(c$,"addOp",function(a){return this.addOpAllowMath(a,!0)},"J.script.T");d(c$,"addOpAllowMath",function(a,b){this.logMessages&&J.util.Logger.debug("addOp entry\naddOp: "+a);var c=0<=this.oPt?this.oStack[this.oPt].tok:0;if(this.skipping=0<=this.ifPt&&("F"==this.ifStack[this.ifPt]||"X"==this.ifStack[this.ifPt]))switch(a.tok){case 269484048:return this.putOp(a),!0;case 269484066:if(269484066!=c||"X"==this.ifStack[this.ifPt])return!0;this.ifStack[this.ifPt]=
"T";this.skipping=this.wasX=!1;return!0;case 269484049:if(269484048==c)return this.oPt--,!0;if(269484066!=c)return this.putOp(a),!0;this.wasX=!0;this.ifPt--;this.oPt-=2;this.skipping=!1;return!0;default:return!0}var d=null,f=!1,l=269484241==a.tok;if(l&&!this.wasX)return!1;var g=b&&J.script.ScriptMathProcessor.isOpFunc(a);1<=this.oPt&&(269484048!=a.tok&&135266319==c)&&(c=this.oStack[--this.oPt].tok);var h=1<=this.oPt&&269484048==c;switch(a.tok){case 1073742195:return this.haveSpaceBeforeSquare=!0;
case 269484080:if(!this.wasX)return!1;break;case 32:case 64:case 96:case 128:case 160:case 192:case 480:c=0>this.oPt?0:c;if(!this.wasX||!(269484241==c||1678770178==c||1141899265==c))return!1;this.oStack[this.oPt].intValue|=a.tok;return!0;case 269484096:f=!0;if(!this.wasX||this.haveSpaceBeforeSquare)this.squareCount++,a=d=J.script.T.tokenArraySquare,this.haveSpaceBeforeSquare=!1;break;case 269484097:break;case 269484225:case 269484226:this.incrementX=269484226==a.tok?1:-1;if(this.ptid==this.ptx){if(this.chk)return!0;
c=this.xStack[this.xPt];this.xStack[this.xPt]=J.script.SV.newS("").setv(c,!1);return c.increment(this.incrementX)}break;case 269484192:if(this.wasX)break;this.addXInt(0);a=J.script.SV.newV(269484224,"-");break;case 269484049:if(!this.wasX&&1<=this.oPt&&269484048==c&&!J.script.ScriptMathProcessor.isOpFunc(this.oStack[this.oPt-1]))return!1;break;case 269484144:case 269484048:f=!0;default:if(g){if(!l&&this.wasX&&!h)return!1;d=a;f=!0;break}if(this.wasX==f&&269484241!=c)return!1}for(;0<=this.oPt&&269484066!=
c&&(!f||269484241==c&&(269484241==a.tok||269484096==a.tok))&&J.script.T.getPrecedence(c)>=J.script.T.getPrecedence(a.tok);){this.logMessages&&(J.util.Logger.debug("\noperating, oPt="+this.oPt+" isLeftOp="+f+" oStack[oPt]="+J.script.T.nameOf(c)+"        prec="+J.script.T.getPrecedence(c)+' pending op="'+J.script.T.nameOf(a.tok)+'" prec='+J.script.T.getPrecedence(a.tok)),this.dumpStacks("operating"));if(269484049==a.tok&&269484048==c){0<=this.xPt&&(this.xStack[this.xPt]=J.script.SV.selectItemVar(this.xStack[this.xPt]));
break}if(269484097==a.tok&&135266306==c)break;if(269484097==a.tok&&269484096==c){if(this.isArrayItem&&1==this.squareCount&&0==this.equalCount){this.addXVar(J.script.SV.newT(J.script.T.tokenArraySelector));break}if(!this.doBitsetSelect())return!1;break}if(!this.operate())return!1;c=0<=this.oPt?this.oStack[this.oPt].tok:0}null!=d&&this.addXVar(J.script.SV.newV(269484436,d));switch(a.tok){case 269484048:this.parenCount++;this.wasX=!1;break;case 806354977:return d=this.getX().asBoolean(),269484066==c?
this.ifPt--:this.putOp(J.script.T.tokenColon),this.putIf(d?"T":"F"),this.skipping=!d,this.wasX=!1,!0;case 269484066:if(269484066!=c||0>this.ifPt)return!1;this.ifStack[this.ifPt]="X";this.wasX=!1;return this.skipping=!0;case 269484049:this.wasX=!0;if(0>=this.parenCount--)return!1;269484066==c&&(this.ifPt--,this.oPt--);this.oPt--;if(0>this.oPt)return!0;if(J.script.ScriptMathProcessor.isOpFunc(this.oStack[this.oPt])&&!this.evaluateFunction(0))return!1;this.skipping=0<=this.ifPt&&"X"==this.ifStack[this.ifPt];
return!0;case 269484080:return this.wasX=!1,!0;case 269484096:this.squareCount++;this.wasX=!1;break;case 269484097:this.wasX=!0;if(0>=this.squareCount--||0>this.oPt)return!1;if(135266306==this.oStack[this.oPt].tok)return this.evaluateFunction(269484096);this.oPt--;return!0;case 269484241:this.wasX=!b||!J.script.T.tokAttr(a.intValue,135266304);break;case 1048586:this.braceCount++;this.wasX=!1;break;case 1048590:if(0>=this.braceCount--)return!1;this.wasX=!1;break;case 269484128:case 269484112:if(!this.wasSyntaxCheck&&
0>this.xPt)return!1;!this.wasSyntaxCheck&&(10!=this.xStack[this.xPt].tok&&7!=this.xStack[this.xPt].tok)&&(c=this.getX().asBoolean(),this.addXVar(J.script.SV.getBoolean(c)),c==(269484112==a.tok)&&(this.chk=!0,a=269484112==a.tok?J.script.T.tokenOrTRUE:J.script.T.tokenAndFALSE));this.wasX=!1;break;case 269484436:0==this.squareCount&&this.equalCount++;this.wasX=!1;break;default:this.wasX=!1}this.putOp(a);return 269484241==a.tok&&135368713==(a.intValue&-481)&&135368713!=a.intValue?this.evaluateFunction(0):
!0},"J.script.T,~B");d(c$,"doBitsetSelect",function(){if(0>this.xPt||0==this.xPt&&!this.isArrayItem)return!1;var a=this.xStack[this.xPt--],b=this.xStack[this.xPt];7==b.tok&&(4==a.tok&&2147483647!=b.intValue)&&(b=J.script.SV.selectItemTok(b,-2147483648));if(6==b.tok)return b=b.mapValue(J.script.SV.sValue(a)),this.xStack[this.xPt]=null==b?J.script.SV.newS(""):b,!0;a=a.asInt();switch(b.tok){default:b=J.script.SV.newS(J.script.SV.sValue(b));case 10:case 7:case 4:case 11:case 12:this.xStack[this.xPt]=
J.script.SV.selectItemTok(b,a)}return!0});d(c$,"dumpStacks",function(a){J.util.Logger.debug("\n\n------------------\nRPN stacks: "+a+"\n");for(a=0;a<=this.xPt;a++)J.util.Logger.debug("x["+a+"]: "+this.xStack[a]);J.util.Logger.debug("\n");for(a=0;a<=this.oPt;a++)J.util.Logger.debug("o["+a+"]: "+this.oStack[a]+" prec="+J.script.T.getPrecedence(this.oStack[a].tok));J.util.Logger.debug(" ifStack = "+String.instantialize(this.ifStack).substring(0,this.ifPt+1))},"~S");d(c$,"getX",function(){0>this.xPt&&
this.eval.error(13);var a=J.script.SV.selectItemVar(this.xStack[this.xPt]);this.xStack[this.xPt--]=null;return a});d(c$,"evaluateFunction",function(a){var b=this.oStack[this.oPt--];0==a&&(a=269484241==b.tok?b.intValue&-481:b.tok);for(var c=J.script.T.getMaxMathParams(a),d=0,f=this.xPt;0<=f&&this.xStack[f--].value!==b;)d++;if(0<c&&d>c)return!1;for(c=Array(d);0<=--d;)c[d]=this.getX();this.xPt--;return!this.chk?this.eval.getExtension().evaluate(this,b,c,a):269484241==b.tok?!0:this.addXBool(!0)},"~N");
d(c$,"operate",function(){var a=this.oStack[this.oPt--],b;this.logMessages&&this.dumpStacks("operate: "+a);if(this.isArrayItem&&0==this.squareCount&&1==this.equalCount&&0>this.oPt&&269484436==a.tok)return!0;b=this.getX();if(b===J.script.T.tokenArraySelector)return!1;if(269484225==a.tok||269484226==a.tok){if(!this.chk&&!b.increment(this.incrementX))return!1;this.wasX=!0;this.putX(b);return!0}if(269484144==a.tok){if(this.chk)return this.addXBool(!0);switch(b.tok){case 9:return this.addXPt4(J.util.Quaternion.newP4(b.value).inv().toPoint4f());
case 11:return a=JU.M3.newM(b.value),a.invert(),this.addXM3(a);case 12:return a=JU.M4.newM(b.value),a.invert(),this.addXM4(a);case 10:return this.addXBs(J.util.BSUtil.copyInvert(J.script.SV.bsSelectVar(b),r(b.value,J.modelset.BondSet)?this.viewer.getBondCount():this.viewer.getAtomCount()));default:return this.addXBool(!b.asBoolean())}}var c=a.intValue&-481;if(269484241==a.tok){switch(c){case 1073741824:return this.getAllProperties(b,a.value);case 1141899267:case 1276117012:case 1141899270:if(1141899267==
c&&r(b.value,J.modelset.BondSet))break;return this.addXInt(J.script.SV.sizeOf(b));case 1141899272:return this.addXStr(J.script.ScriptMathProcessor.typeOf(b));case 1141899281:if(6!=b.tok)return this.addXStr("");a=b.value.keySet();a=a.toArray(Array(a.size()));java.util.Arrays.sort(a);return this.addXAS(a);case 1141899268:switch(b.tok){case 11:case 12:b=J.script.SV.sValue(b);b=JU.PT.simpleReplace(b.substring(1,b.length-1),"],[","]\n[");break;case 4:b=b.value;break;default:b=J.script.SV.sValue(b)}b=JU.PT.simpleReplace(b,
"\n\r","\n").$replace("\r","\n");return this.addXAS(JU.PT.split(b,"\n"));case 1766856708:switch(b.tok){case 4:case 7:return b=J.script.SV.sValue(b),a=new JU.P3,this.addXPt(JU.CU.colorPtFromString(b,a));case 2:case 3:return this.addXPt(this.viewer.getColorPointForPropertyValue(J.script.SV.fValue(b)));case 8:return this.addXStr(J.util.Escape.escapeColor(JU.CU.colorPtToFFRGB(b.value)))}break;case 1679429641:return this.chk?this.addXStr("x"):this.getBoundBox(b)}if(this.chk)return this.addXStr(J.script.SV.sValue(b));
if(4==b.tok&&(b=J.script.SV.unescapePointOrBitsetAsVariable(J.script.SV.sValue(b)),!r(b,J.script.SV)))return!1;a.tok==b.tok&&(b=this.getX());return this.getPointOrBitsetOperation(a,b)}c=this.getX();if(this.chk){if(a===J.script.T.tokenAndFALSE||a===J.script.T.tokenOrTRUE)this.chk=!1;return this.addXVar(J.script.SV.newT(c))}return this.binaryOp(a,c,b)});d(c$,"binaryOp",function(a,b,c){var d;switch(a.tok){case 269484160:case 269484128:switch(b.tok){case 10:switch(a=J.script.SV.bsSelectVar(b),c.tok){case 2:var f=
c.asInt();return this.addXBool(0>f?!1:a.get(f));case 10:return a=J.util.BSUtil.copy(a),a.and(J.script.SV.bsSelectVar(c)),this.addXBs(a)}}return this.addXBool(b.asBoolean()&&c.asBoolean());case 269484112:switch(b.tok){case 10:a=J.util.BSUtil.copy(J.script.SV.bsSelectVar(b));switch(c.tok){case 10:return a.or(J.script.SV.bsSelectVar(c)),this.addXBs(a);case 2:f=c.asInt();if(0>f)break;a.set(f);return this.addXBs(a);case 7:f=c.value;for(c=f.size();0<=--c;)b=f.get(c).asInt(),0<=b&&a.set(b);return this.addXBs(a)}break;
case 7:return this.addXVar(J.script.SV.concatList(b,c,!1))}return this.addXBool(b.asBoolean()||c.asBoolean());case 269484113:if(10==b.tok&&10==c.tok)return a=J.util.BSUtil.copy(J.script.SV.bsSelectVar(b)),a.xor(J.script.SV.bsSelectVar(c)),this.addXBs(a);a=b.asBoolean();b=c.asBoolean();return this.addXBool(a&&!b||b&&!a);case 269484114:return 10!=b.tok||10!=c.tok?!1:this.addXBs(J.util.BSUtil.toggleInPlace(J.util.BSUtil.copy(J.script.SV.bsSelectVar(b)),J.script.SV.bsSelectVar(c)));case 269484434:return this.addXBool(b.asFloat()<=
c.asFloat());case 269484433:return this.addXBool(b.asFloat()>=c.asFloat());case 269484432:return this.addXBool(b.asFloat()>c.asFloat());case 269484435:return this.addXBool(b.asFloat()<c.asFloat());case 269484436:return this.addXBool(J.script.SV.areEqual(b,c));case 269484438:return this.addXBool(!J.script.SV.areEqual(b,c));case 269484193:switch(b.tok){case 2:if(!this.isDecimal(c))return this.addXInt(b.intValue+c.asInt());break;case 4:return this.addXVar(J.script.SV.newS(J.script.SV.sValue(b)+J.script.SV.sValue(c)));
case 9:switch(b=J.util.Quaternion.newP4(b.value),c.tok){default:return this.addXPt4(b.add(c.asFloat()).toPoint4f());case 9:return this.addXPt4(b.mulQ(J.util.Quaternion.newP4(c.value)).toPoint4f())}case 8:switch(a=JU.P3.newP(b.value),c.tok){case 8:return a.add(c.value),this.addXPt(a);case 9:return d=c.value,a.add(JU.P3.new3(d.x,d.y,d.z)),this.addXPt(a);default:return d=c.asFloat(),this.addXPt(JU.P3.new3(a.x+d,a.y+d,a.z+d))}case 11:switch(c.tok){default:return this.addXFloat(b.asFloat()+c.asFloat());
case 11:return b=JU.M3.newM(b.value),b.add(c.value),this.addXM3(b);case 8:return this.addXM4(J.script.ScriptMathProcessor.getMatrix4f(b.value,c.value))}case 7:return this.addXVar(J.script.SV.concatList(b,c,!0))}return this.addXFloat(b.asFloat()+c.asFloat());case 269484192: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(J.script.SV.sValue(c)),this.addXVar(J.script.SV.getVariableMap(b));case 11:if(11!=c.tok)break;b=JU.M3.newM(b.value);b.sub(c.value);return this.addXM3(b);case 12:if(12!=c.tok)break;b=JU.M4.newM(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 d=c.value,a.sub(JU.P3.new3(d.x,d.y,d.z)),this.addXPt(a)}d=c.asFloat();return this.addXPt(JU.P3.new3(a.x-d,a.y-d,a.z-d));case 9:return b=J.util.Quaternion.newP4(b.value),
9==c.tok?(c=J.util.Quaternion.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 269484224:switch(c.tok){case 2:return this.addXInt(-c.asInt());case 8:return a=JU.P3.newP(c.value),a.scale(-1),this.addXPt(a);case 9:return d=JU.P4.newPt(c.value),d.scale(-1),this.addXPt4(d);case 11:return b=JU.M3.newM(c.value),b.transpose(),this.addXM3(b);case 12:return b=JU.M4.newM(c.value),b.transpose(),this.addXM4(b);
case 10:return this.addXBs(J.util.BSUtil.copyInvert(J.script.SV.bsSelectVar(c),r(c.value,J.modelset.BondSet)?this.viewer.getBondCount():this.viewer.getAtomCount()))}return this.addXFloat(-c.asFloat());case 1276117508: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 269484209: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?this.ptValue(c,!1):11==c.tok?this.ptValue(b,!1):null;d=12==b.tok?this.planeValue(c):12==c.tok?this.planeValue(b):null;switch(c.tok){case 11:if(null!=a)return c=JU.M3.newM(c.value),c.transpose(),c.transform(a),7==b.tok?this.addXVar(J.script.SV.getVariableAF([a.x,a.y,a.z])):this.addXPt(a);if(null!=d)return this.addXPt4(J.util.Quaternion.newP4(d).mulQ(J.util.Quaternion.newM(c.value)).toPoint4f());break;case 12:if(null!=
d)return c=JU.M4.newM(c.value),c.transpose(),c.transform4(d),7==b.tok?this.addXVar(J.script.SV.getVariableAF([d.x,d.y,d.z,d.w])):this.addXPt4(d)}switch(b.tok){case 11:f=b.value;if(null!=a)return f.transform(a),7==c.tok?this.addXVar(J.script.SV.getVariableAF([a.x,a.y,a.z])):this.addXPt(a);switch(c.tok){case 11:return b=JU.M3.newM(c.value),b.mul2(f,b),this.addXM3(b);case 9:return this.addXM3(J.util.Quaternion.newM(f).mulQ(J.util.Quaternion.newP4(c.value)).getMatrix())}d=c.asFloat();c=new JU.A4;c.setM(f);
c.angle*=d;b=new JU.M3;b.setAA(c);return this.addXM3(b);case 12:return b=b.value,null!=a?(b.transform(a),7==c.tok?this.addXVar(J.script.SV.getVariableAF([a.x,a.y,a.z])):this.addXPt(a)):null!=d?(b.transform4(d),7==c.tok?this.addXVar(J.script.SV.getVariableAF([d.x,d.y,d.z,d.w])):this.addXPt4(d)):12==c.tok?(c=JU.M4.newM(c.value),c.mul2(b,c),this.addXM4(c)):this.addXStr("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)}d=c.asFloat();return this.addXPt(JU.P3.new3(a.x*
d,a.y*d,a.z*d));case 9:return 9==c.tok?this.addXPt4(J.util.Quaternion.newP4(b.value).mulQ(J.util.Quaternion.newP4(c.value)).toPoint4f()):this.addXPt4(J.util.Quaternion.newP4(b.value).mul(c.asFloat()).toPoint4f())}return this.addXFloat(b.asFloat()*c.asFloat());case 269484208:switch(b.tok){case 2:if(2==c.tok&&0!=c.intValue)return this.addXInt(G(b.intValue/c.intValue));if(!this.isDecimal(c))return this.addXInt(G(b.intValue/c.asInt()));break;case 4:if(!this.isDecimal(b)&&!this.isDecimal(c)&&0!=(d=c.asInt()))return this.addXInt(G(b.asInt()/
d));break;case 8:return a=JU.P3.newP(b.value),this.addXPt(0==(f=c.asFloat())?JU.P3.new3(NaN,NaN,NaN):JU.P3.new3(a.x/f,a.y/f,a.z/f));case 9:return this.addXPt4(9==c.tok?J.util.Quaternion.newP4(b.value).div(J.util.Quaternion.newP4(c.value)).toPoint4f():0==(f=c.asFloat())?JU.P4.new4(NaN,NaN,NaN,NaN):J.util.Quaternion.newP4(b.value).mul(1/f).toPoint4f())}return this.addXFloat(b.asFloat()/c.asFloat());case 269484211:return d=c.asFloat(),9==b.tok?0==d?this.addXPt4(JU.P4.new4(NaN,NaN,NaN,NaN)):9==c.tok?
this.addXPt4(J.util.Quaternion.newP4(b.value).divLeft(J.util.Quaternion.newP4(c.value)).toPoint4f()):this.addXPt4(J.util.Quaternion.newP4(b.value).mul(1/d).toPoint4f()):this.addXInt(0==d?0:G(Math.floor(b.asFloat()/c.asFloat())));case 269484227:return d=Math.pow(b.asFloat(),c.asFloat()),2==b.tok&&2==c.tok?this.addXInt(z(d)):this.addXFloat(d);case 269484210:a=null;f=c.asInt();switch(b.tok){case 3:d=b.asFloat();if(0==f)return this.addXInt(Math.round(d));a=JU.DF.formatDecimal(d,f);return this.addXStr(a);
case 4:return a=b.value,0==f?this.addXStr(JU.PT.trim(a,"\n\t ")):9999==f?this.addXStr(a.toUpperCase()):-9999==f?this.addXStr(a.toLowerCase()):0<f?this.addXStr(JU.PT.formatS(a,f,f,!1,!1)):this.addXStr(JU.PT.formatS(a,f,f-1,!0,!1));case 7:b=J.script.SV.listValue(b);for(c=0;c<b.length;c++)b[c]=0==f?b[c].trim():0<f?JU.PT.formatS(b[c],f,f,!0,!1):JU.PT.formatS(a,-f,f,!1,!1);return this.addXAS(b);case 8:return a=JU.P3.newP(b.value),this.viewer.toUnitCell(a,JU.P3.new3(f,f,f)),this.addXPt(a);case 9:d=b.value;
if(8==c.tok)return this.addXPt(J.util.Quaternion.newP4(d).transformPt(c.value));if(9==c.tok)return c=JU.P4.newPt(c.value),J.util.Quaternion.newP4(d).getThetaDirected(c),this.addXPt4(c);0==f&&4==c.tok&&(a=" "+c.value.toString().trim().toLowerCase()+":",c=" 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(a),f=0<=c?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(c+
a.length)):-99);switch(f){case 0:return this.addXFloat(d.w);case 1:return this.addXFloat(d.x);case 2:return this.addXFloat(d.y);case 3:return this.addXFloat(d.z)}c=J.util.Quaternion.newP4(d);switch(f){case 4:return this.addXPt(JU.P3.newP(c.getNormal()));case 5:return this.addXAF(c.getEulerZXZ());case 6:return this.addXAF(c.getEulerZYZ());case -1:return this.addXPt(JU.P3.newP(c.getVector(-1)));case -2:return this.addXFloat(c.getTheta());case -3:return this.addXPt(JU.P3.newP(c.getVector(0)));case -4:return this.addXPt(JU.P3.newP(c.getVector(1)));
case -5:return this.addXPt(JU.P3.newP(c.getVector(2)));case -6:return c=c.toAxisAngle4f(),this.addXPt4(JU.P4.new4(c.x,c.y,c.z,180*c.angle/3.141592653589793));case -9:return this.addXM3(c.getMatrix());default:return this.addXStr("NaN")}case 12:switch(b=b.value,f){case 1:return f=new JU.M3,b.getRotationScale(f),this.addXM3(f);case 2:return c=new JU.V3,b.get(c),this.addXPt(JU.P3.newP(c));default:return!1}case 10:return this.addXBs(J.script.SV.bsSelectRange(b,f))}return this.addXInt(0==f?0:b.asInt()%
f)}return!0},"J.script.T,J.script.SV,J.script.SV");d(c$,"isDecimal",function(a){var b;return 3==a.tok||4==a.tok&&(0<=(b=J.script.SV.sValue(a).trim()).indexOf(".")||0<b.indexOf("+")||0<b.lastIndexOf("-"))},"J.script.SV");d(c$,"ptValue",function(a,b){var c;if(this.chk)return new JU.P3;switch(a.tok){case 8:return a.value;case 10:return this.eval.getBitsetProperty(J.script.SV.bsSelectVar(a),1146095626,null,null,a.value,null,!1,2147483647,!1);case 4:c=J.util.Escape.uP(J.script.SV.sValue(a));if(r(c,JU.P3))return c;
break;case 7:if(c=J.util.Escape.uP("{"+J.script.SV.sValue(a)+"}"),r(c,JU.P3))return c}if(!b)return null;c=J.script.SV.fValue(a);return JU.P3.new3(c,c,c)},"J.script.SV,~B");d(c$,"planeValue",function(a){if(this.chk)return new JU.P4;switch(a.tok){case 9:return a.value;case 7:case 4:return a=J.util.Escape.uP(J.script.SV.sValue(a)),r(a,JU.P4)?a:null}return null},"J.script.T");c$.typeOf=d(c$,"typeOf",function(a){var b=null==a?0:a.tok;switch(b){case 1048589:case 1048588:return"boolean";case 10:return r(a.value,
J.modelset.BondSet)?"bondset":"bitset";case 2:case 3:case 8:case 9:case 4:case 7:case 6:case 11:case 12:return J.script.T.astrType[b]}return"?"},"J.script.SV");d(c$,"getAllProperties",function(a,b){if(10!=a.tok)return!1;if(this.chk)return this.addXStr("");var c=J.script.SV.bsSelectVar(a),d,f=c.cardinality();if(0==f||null==(d=J.script.T.getAtomPropertiesLike(b.substring(0,b.length-1))))return this.addXStr("");for(var l=new java.util.Hashtable,f=1==f?c.nextSetBit(0):2147483647,g=d.size();0<=--g;){var h=
d.get(g),k=h.tok;switch(k){case 1095766024:case 1095761925:continue;default:2147483647==f&&(k|=480),l.put(h.value,J.script.SV.getVariable(this.eval.getBitsetProperty(c,k,null,null,null,null,!1,f,!0)))}}return this.addXMap(l)},"J.script.SV,~S");c$.getMatrix4f=d(c$,"getMatrix4f",function(a,b){return JU.M4.newMV(a,null==b?new JU.V3:JU.V3.newV(b))},"JU.M3,JU.T3");d(c$,"getBoundBox",function(a){if(10!=a.tok)return!1;if(this.chk)return this.addXStr("");a=this.viewer.getBoxInfo(J.script.SV.bsSelectVar(a),
1).getBoundBoxPoints(!0);for(var b=new JU.List,c=0;4>c;c++)b.addLast(a[c]);return this.addXList(b)},"J.script.SV");d(c$,"getPointOrBitsetOperation",function(a,b){switch(b.tok){case 7:switch(a.intValue){case 32:case 64:case 96:case 192:case 128:case 160:return this.addXObj(this.eval.getExtension().getMinMax(b.getList(),a.intValue));case 1276117011:case 1141899269:return this.addXVar(b.sortOrReverse(1141899269==a.intValue?-2147483648:1))}for(var c=Array(b.getList().size()),d=0;d<c.length;d++){var f=
J.script.SV.unescapePointOrBitsetAsVariable(b.getList().get(d));if(!r(f,J.script.SV)||!this.getPointOrBitsetOperation(a,f))return!1;c[d]=this.xStack[this.xPt--]}return this.addXAV(c);case 8:switch(a.intValue){case 1112541185:case 1112541205:return this.addXFloat(b.value.x);case 1112541186:case 1112541206:return this.addXFloat(b.value.y);case 1112541187:case 1112541207:return this.addXFloat(b.value.z);case 1146095626:return c=JU.P3.newP(b.value),this.viewer.toCartesian(c,!0),this.addXPt(c);case 1112541188:case 1112541189:case 1112541190:case 1146095627:return c=
JU.P3.newP(b.value),this.viewer.toFractional(c,!0),1146095627==a.intValue?this.addXPt(c):this.addXFloat(1112541188==a.intValue?c.x:1112541189==a.intValue?c.y:c.z);case 1112541191:case 1112541192:case 1112541193:case 1146095629:return c=JU.P3.newP(b.value),this.viewer.toFractional(c,!1),1146095627==a.intValue?this.addXPt(c):this.addXFloat(1112541191==a.intValue?c.x:1112541192==a.intValue?c.y:c.z);case 1112539153:case 1112539154:case 1112539155:case 1146093582:return c=JU.P3.newP(b.value),this.viewer.toUnitCell(c,
null),this.viewer.toFractional(c,!1),1146093582==a.intValue?this.addXPt(c):this.addXFloat(1112539153==a.intValue?c.x:1112539154==a.intValue?c.y:c.z)}break;case 9:switch(a.intValue){case 1112541185:case 1112541205:return this.addXFloat(b.value.x);case 1112541186:case 1112541206:return this.addXFloat(b.value.y);case 1112541187:case 1112541207:return this.addXFloat(b.value.z);case 1141899280:return this.addXFloat(b.value.w)}break;case 10:if(1678770178==a.intValue&&r(b.value,J.modelset.BondSet))return this.addXVar(b);
c=J.script.SV.bsSelectVar(b);1==c.cardinality()&&0==(a.intValue&480)&&(a.intValue|=32);d=this.eval.getBitsetProperty(c,a.intValue,null,null,b.value,a.value,!1,b.index,!0);return 1678770178!=a.intValue?this.addXObj(d):this.addXVar(J.script.SV.newV(10,new J.modelset.BondSet(d,this.viewer.getAtomIndices(c))))}return!1},"J.script.T,J.script.SV");d(c$,"evalOp",function(a){return!this.addOp(a)||!this.operate()?null:this.xStack[this.xPt--]},"J.script.T");P(c$,"qMods"," 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")})})(Clazz,
Clazz.newArray,Clazz.newBooleanArray,Clazz.newByteArray,Clazz.newCharArray,Clazz.newDoubleArray,Clazz.newFloatArray,Clazz.newIntArray,Clazz.newLongArray,Clazz.newShortArray,Clazz.prepareCallback,Clazz.decorateAsClass,Clazz.isClassDefined,Clazz.defineEnumConstant,Clazz.cloneFinals,Clazz.inheritArgs,Clazz.pu$h,Clazz.declareInterface,Clazz.declarePackage,Clazz.makeConstructor,Clazz.overrideConstructor,Clazz.load,Clazz.defineMethod,Clazz.innerTypeInstance,Clazz.instanceOf,Clazz.p0p,Clazz.makeFunction,
Clazz.superConstructor,Clazz.defineStatics,Clazz.registerSerializableFields,Clazz.declareType,Clazz.superCall,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.checkPrivateMethod,Clazz.prepareFields,Clazz.instantialize,Clazz.doubleToInt,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,
Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.supportsNativeObject,Clazz.extendedObjectMethods,Clazz.callingStackTraces,Clazz.clone,Clazz.doubleToShort,Clazz.innerFunctions,Clazz.getInheritedLevel,
Clazz.getParamsType,Clazz.isAF,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs);
