(function(Q,R,S,T,I,U,G,t,K,L,M,V,W,N,X,Y,C,H,A,Z,O,$,aa,P,ba,ca,da,ea,fa,ga,y,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,h,v){G("J.api");P(J.api,"JmolPropertyManager");G("JV");K(["J.api.JmolPropertyManager","java.util.Hashtable"],"JV.PropertyManager","java.lang.Boolean $.Double $.Float java.util.Arrays $.Date $.Map JU.AU $.BArray $.BS $.Base64 $.Lst $.M3 $.M4 $.Measure $.P3 $.PT $.SB $.V3 J.api.Interface JM.BondSet $.LabelToken JS.SV $.T JU.BSUtil $.C $.Edge $.Elements $.Escape $.JmolMolecule $.Logger JV.ActionManager $.FileManager $.JC $.Viewer JV.binding.Binding".split(" "),
function(){c$=M(function(){this.ptTemp=this.connections=this.vTemp=this.vNorm=this.map=this.vwr=null;L(this,arguments)},JV,"PropertyManager",null,J.api.JmolPropertyManager);O(c$,function(){this.map=new java.util.Hashtable});N(c$,function(){});v(c$,"setViewer",function(b){this.vwr=b;for(var a=b=0;b<JV.PropertyManager.propertyTypes.length;b+=3,a++)0<JV.PropertyManager.propertyTypes[b].length&&this.map.put(JV.PropertyManager.propertyTypes[b].toLowerCase(),Integer.$valueOf(a))},"JV.Viewer");v(c$,"getPropertyNumber",
function(b){b=this.map.get(null==b?"":b.toLowerCase());return null==b?-1:b.intValue()},"~S");v(c$,"getDefaultPropertyParam",function(b){return 0>b?"":JV.PropertyManager.propertyTypes[3*b+2]},"~N");v(c$,"checkPropertyParameter",function(b){b=this.getPropertyNumber(b);b=JV.PropertyManager.getParamType(b);return 0<b.length&&"<atom selection>"!==b},"~S");v(c$,"getProperty",function(b,a,e){138!=JV.PropertyManager.propertyTypes.length&&JU.Logger.warn("propertyTypes is not the right length: "+JV.PropertyManager.propertyTypes.length+
" != 138");if(0<=a.indexOf(".")||0<=a.indexOf("[")){var c=this.getArguments(a);e=this.extractProperty(this.getPropertyAsObject(c[0].asString(),e,null),c,1,null,!1)}else e=this.getPropertyAsObject(a,e,b);if(null==b)return e;(c=b.equalsIgnoreCase("readable"))&&(b=JV.PropertyManager.isReadableAsString(a)?"String":"JSON");return b.equalsIgnoreCase("String")?null==e?"":e.toString():c?JU.Escape.toReadable(a,e):b.equalsIgnoreCase("JSON")?JS.SV.safeJSON(a,e):e},"~S,~S,~O");h(c$,"getArguments",function(b){var a=
b.toLowerCase(),e=-1;if(0<=b.indexOf('"')||0<=b.indexOf("'"))b=this.fixSelectQuotes(b);for(;0<=(e=a.indexOf("[select ",++e));){var c=a.indexOf(" where ",e),d=a.indexOf(" wherein ",e);0<d&&d<c&&(c=d);d=a.lastIndexOf("]");0>c||c>d||(b=b.substring(0,e+1)+b.substring(e+1,d).$replace(".","\u0001").$replace("[","\u0002").$replace("]","\u0003")+b.substring(d))}b=JU.PT.rep(JU.PT.rep(b.$replace("]","\x00").$replace("[","\x00"),"..","\u0004").$replace(".","\x00").$replace("\u0001",".").$replace("\u0002","[").$replace("\u0003",
"]"),"\u0004","..");b=JU.PT.rep(b,"\x00\x00","\x00");b=JU.PT.split(JU.PT.trim(b,"\x00"),"\x00");for(var a=Array(b.length),e=0,f;e<b.length;e++)a[e]=b[e].startsWith("'")||b[e].startsWith('"')?JS.SV.newS(JU.PT.trim(b[e],"'\"")):-2147483648==(f=JU.PT.parseInt(b[e]))?JS.SV.newS(b[e]):JS.SV.newI(f);return a},"~S");h(c$,"fixSelectQuotes",function(b){b=b.toCharArray();for(var a=!1,e=!1,c=!1,d=b.length;0<=--d;)switch(b[d]){case "'":c||(a=e=!a);break;case '"':e||(a=c=!a);break;case ".":a&&(b[d]="\u0001");
break;case "[":a&&(b[d]="\u0002");break;case "]":a&&(b[d]="\u0003")}return b=String.instantialize(b)},"~S");v(c$,"extractProperty",function(b,a,e,c,d){0>e&&(a=this.getArguments(a),e=0);if(e>=a.length)return b;d||(a=this.compileSelect(a));var f,g=a[e++];d=JS.SV.oValue(b);switch(g.tok){case 2:f=g.intValue-1;if(t(d,JU.Lst))return 0>f&&(f+=d.size()),0<=f&&f<d.size()?this.extractProperty(d.get(f),a,e,null,!0):"";if(t(d,JU.M3))return c=d,c=y(-1,[A(-1,[c.m00,c.m01,c.m02]),A(-1,[c.m10,c.m11,c.m12]),A(-1,
[c.m20,c.m21,c.m22])]),0>f&&(f+=3),0<=f&&3>f?this.extractProperty(c,a,--e,null,!0):"";if(t(d,JU.M4))return c=d,c=y(-1,[A(-1,[c.m00,c.m01,c.m02,c.m03]),A(-1,[c.m10,c.m11,c.m12,c.m13]),A(-1,[c.m20,c.m21,c.m22,c.m23]),A(-1,[c.m30,c.m31,c.m32,c.m33])]),0>f&&(f+=4),0<=f&&4>f?this.extractProperty(c,a,--e,null,!0):"";if(JU.AU.isAI(d))return 0>f&&(f+=d.length),0<=f&&f<d.length?Integer.$valueOf(d[f]):"";if(JU.AU.isAD(d))return 0>f&&(f+=d.length),0<=f&&f<d.length?Double.$valueOf(d[f]):"";if(JU.AU.isAF(d))return 0>
f&&(f+=d.length),0<=f&&f<d.length?Float.$valueOf(d[f]):"";if(JU.AU.isAII(d)||JU.AU.isAFF(d))return 0>f&&(f+=d.length),0<=f&&f<d.length?this.extractProperty(d[f],a,e,null,!0):"";if(JU.AU.isAS(d)||t(d,Array))return 0>f&&(f+=d.length),0<=f&&f<d.length?d[f]:"";break;case 1275082245:case 4:if(t(d,java.util.Map)){var j=!1,w=b=!1;f=1275082245==g.tok?g.value[0]:null;var k=null;if(1275082245==g.tok)if(w=!0,k=g.value[1],g=g.myName,b=0<=g.indexOf(";"),g.contains("**")){for(var l=0==f.size(),m="",u,r=d.entrySet().iterator();r.hasNext()&&
((u=r.next())||1);)for(var h=u.getKey(),g=l?1:f.size();0<=--g;)if(l||JU.PT.isLike(h,f.get(g))){var j=u.getValue(),s=!1;switch(t(j,JS.SV)?j.tok:0){case 7:s=!0;j=j.getList();break;case 6:case 14:j=j.getMap();break;default:if(!t(j,java.util.Map)&&!(s=t(j,JU.Lst)))j=null}if(null!=j){if(s){null==c&&(c=new JU.Lst);a=j;e=a.size();for(d=0;d<e;d++)if(j=a.get(d),t(j,JS.SV)&&null!=(j=j.getMap()))(null==k||this.vwr.checkSelect(j,k))&&c.addLast(j);return c}if(null==k||this.vwr.checkSelect(j,k))m+=","+h}}if(0==
m.length)return new JU.Lst;g=m.substring(1);j=!b;f=null}else{if(null!=k&&!this.vwr.checkSelect(d,k))return""}else if(g=g.asString(),g.equalsIgnoreCase("keys")){c=new JU.Lst;for(d=d.keySet().iterator();d.hasNext()&&((h=d.next())||1);)c.addLast(h);return this.extractProperty(c,a,e,null,!0)}k=b||0<=g.indexOf(",")||0<=g.indexOf(";");w&&!k&&(k=!0,g+=",");u=b||g.startsWith("*")||g.endsWith("*")||k;h=null!=c;if(u&&(h||(c=new JU.Lst),!b&&(null==f?1==g.length:0==f.size()))){if(e==a.length){if(!h)return d;
c.addLast(d);return c}return this.extractProperty(d,a,e,c,!0)}g.contains("**")&&(g=JU.PT.rep(g,"**","*"));u&&!k&&(g+=",");if(j||b||g.contains(",")){w=new java.util.Hashtable;null!=f&&0==f.size()&&(f=null,g="*");if(null==f){f=JU.PT.split(g,",");for(g=f.length;0<=--g;)JV.PropertyManager.getMapSubset(d,f[g],w,b?c:null)}else for(g=f.size();0<=--g;)JV.PropertyManager.getMapSubset(d,f.get(g),w,b?c:null);if(j&&!h)return w;if(e==a.length){if(!b){if(!h)return w;c.addLast(w)}return c}return this.extractProperty(w,
a,e,h?c:null,!0)}g=this.checkMap(d,g,u,c,a,e,w);return null!=g&&!u?this.extractProperty(d.get(g),a,e,null,!0):!u?"":c}if(t(d,JU.Lst)){null==c&&(c=new JU.Lst);e--;for(f=0;f<d.size();f++)j=d.get(f),(t(j,java.util.Map)||t(j,JU.Lst)||t(j,JS.SV)&&(null!=j.getMap()||null!=j.getList()))&&this.extractProperty(j,a,e,c,!0);return c}}return b},"~O,~O,~N,JU.Lst,~B");c$.getMapSubset=h(c$,"getMapSubset",function(b,a,e,c){if(a.startsWith('"')||a.startsWith("'"))a=JU.PT.trim(a,"\"'");var d=b.get(a);if(null!=d)null==
c?e.put(a,d):c.addLast(d);else{var f;for(b=b.entrySet().iterator();b.hasNext()&&((f=b.next())||1);)d=f.getKey(),JU.PT.isLike(d,a)&&(null==c?e.put(d,f.getValue()):c.addLast(f.getValue()))}},"java.util.Map,~S,java.util.Map,JU.Lst");h(c$,"compileSelect",function(b){for(var a=null,e=b.length;0<=--e;)if(4==b[e].tok){var c=b[e].value,d=c.toUpperCase();d.startsWith("WHERE")&&(d=(c="SELECT * "+c).toUpperCase());if(d.startsWith("SELECT ")){null==a&&(a=JU.AU.arrayCopyObject(b,b.length));d=(c=c.substring(6).trim()).toUpperCase();
if(d.startsWith("WHERE ")||d.startsWith("WHEREIN "))d=(c="* "+c).toUpperCase();var f=d.indexOf(" WHEREIN "),g=0>f?"":0<=c.indexOf(";")?";**":",**";0>f&&(f=d.indexOf(" WHERE "));d=c.substring(0,0>f?c.length:f).trim();d.startsWith("(")&&d.endsWith(")")&&(d=d.substring(1,d.length-1)+";");0>f?a[e]=JS.SV.newV(1275082245,y(-1,[this.getKeys(d),null])):(d+=g,a[e]=JS.SV.newV(1275082245,y(-1,[this.getKeys(d),this.vwr.compileExpr(c.substring(f+6+g.length).trim())])));a[e].myName=d}}return null==a?b:a},"~A");
h(c$,"getKeys",function(b){var a=new JU.Lst;b=JU.PT.rep(JU.PT.rep(b,"**","*"),";",",")+",";for(var e=0,c=-1;0<=(c=b.indexOf(",",c+1));)if(c>e){var d=b.substring(e,c);if(d.equals("*")){if(0==a.size())break}else a.addLast(d),e=c+1}return a},"~S");h(c$,"checkMap",function(b,a,e,c,d,f,g){var j=null==c&&b.containsKey(a);if(!j)for(var w=a.contains(";"),k=w?JU.PT.split(a,";"):null,l=e&&!g?a.toLowerCase():null,m,u=b.keySet().iterator();u.hasNext()&&((m=u.next())||1);){if(w){for(var h=k.length;0<=--h;a=null)if(a=
k[h],0!=a.length){if(g){if(!JU.PT.isLike(m,a))continue;break}l=0<=a.indexOf("*")?a.toLowerCase():null;if(this.checkKey(m,a,l))break}if(null==a)continue}else if(g?!JU.PT.isLike(m,a):!this.checkKey(m,a,l))continue;if(null==c)return m;c.addLast(this.extractProperty(b.get(m),d,f,null,!0));if(!e&&!w)return null}return j?a:null},"java.util.Map,~S,~B,JU.Lst,~O,~N,~B");h(c$,"checkKey",function(b,a,e){return b.equalsIgnoreCase(a)||null!=e&&JU.PT.isLike(b.toLowerCase(),e)},"~S,~S,~S");c$.getPropertyName=h(c$,
"getPropertyName",function(b){return 0>b?"":JV.PropertyManager.propertyTypes[3*b]},"~N");c$.getParamType=h(c$,"getParamType",function(b){return 0>b?"":JV.PropertyManager.propertyTypes[3*b+1]},"~N");c$.isReadableAsString=h(c$,"isReadableAsString",function(b){for(var a=JV.PropertyManager.readableTypes.length;0<=--a;)if(b.equalsIgnoreCase(JV.PropertyManager.readableTypes[a]))return!0;return!1},"~S");h(c$,"getPropertyAsObject",function(b,a,e){if(b.equals("tokenList"))return JS.T.getTokensLike(a);var c=
this.getPropertyNumber(b),d=null!=a&&0<a.toString().length;a=d?a:this.getDefaultPropertyParam(c);switch(c){case 0:return this.getAppletInfo();case 5:return this.getAnimationInfo();case 14:return this.getAllAtomInfo(this.vwr.getAtomBitSet(a));case 24:return this.vwr.getAuxiliaryInfoForAtoms(a);case 15:return this.getAllBondInfo(a);case 25:return this.getBoundBoxInfo();case 10:return this.vwr.tm.fixedRotationCenter;case 16:return this.getAllChainInfo(this.vwr.getAtomBitSet(a));case 37:return this.vwr.getProperty("DATA_API",
"consoleText",null);case 26:return this.vwr.getDataObj(a.toString(),null,-1);case 33:return this.vwr.getErrorMessageUn();case 28:return this.vwr.evaluateExpression(a.toString());case 20:return this.vwr.getModelExtract(a,!0,!1,"MOL");case 32:return JV.PropertyManager.getFileInfo(this.vwr.getFileData(),a.toString());case 45:return this.vwr.readCifData(a.toString(),null);case 1:return this.vwr.fm.getFullPathName(!1);case 2:return this.vwr.getFileHeader();case 4:case 3:return d?this.vwr.getFileAsString3(a.toString(),
!0,null):this.vwr.getCurrentFileAsString("prop");case 27:return b=a.toString().toLowerCase(),this.getImage(b,0>b.indexOf("g64")&&0>b.indexOf("base64")&&(null==e||e.equalsIgnoreCase("java")));case 35:return this.vwr.getShapeProperty(24,"info");case 36:return this.vwr.getShapeProperty(24,"data");case 40:return this.vwr.getNMRCalculation().getInfo(a.toString());case 41:return this.getVariables(a.toString());case 21:return this.vwr.getStatusChanged(a.toString());case 22:return this.vwr;case 38:return this.vwr.getJspecViewProperties(a);
case 7:return this.getLigandInfo(this.vwr.getAtomBitSet(a));case 9:return this.getMeasurementInfo();case 29:return this.vwr.getMenu(a.toString());case 23:return this.vwr.sm.messageQueue;case 30:return this.vwr.getMinimizationInfo();case 6:return this.getModelInfo(this.vwr.getAtomBitSet(a));case 18:return this.getMoleculeInfo(this.vwr.getAtomBitSet(a));case 34:return this.getMouseInfo();case 11:return this.vwr.tm.getOrientationInfo();case 31:return this.vwr.ms.getPointGroupInfo(this.vwr.getAtomBitSet(a));
case 17:return this.getAllPolymerInfo(this.vwr.getAtomBitSet(a));case 39:return this.vwr.getScriptQueueInfo();case 8:return this.getShapeInfo();case 19:return this.vwr.getStateInfo3(a.toString(),0,0);case 12:return JU.M3.newM3(this.vwr.tm.matrixRotate);case 42:return this.getAnnotationInfo(a,1073741925);case 43:return this.getAnnotationInfo(a,1073742189);case 44:return a=JS.SV.oValue(a),d=t(a,java.util.Map)?a:null,null==d?null:this.vwr.sm.processService(d)}e=Array(46);for(c=0;46>c;c++){d=JV.PropertyManager.getParamType(c);
a=this.getDefaultPropertyParam(c);var f=JV.PropertyManager.getPropertyName(c);e[c]=0==f.length||"X"==f.charAt(0)?"":f+(""!==d?" "+JV.PropertyManager.getParamType(c)+(""!==a?" #default: "+this.getDefaultPropertyParam(c):""):"")}java.util.Arrays.sort(e);d=new JU.SB;d.append("getProperty ERROR\n").append(b).append("?\nOptions include:\n");for(c=0;46>c;c++)0<e[c].length&&d.append("\n getProperty ").append(e[c]);return d.toString()},"~S,~O,~S");h(c$,"getImage",function(b,a){var e=-1,c=-1,d;if(0<=(d=b.indexOf("height=")))e=
JU.PT.parseInt(b.substring(d+7));if(0<=(d=b.indexOf("width=")))c=JU.PT.parseInt(b.substring(d+6));0>c&&0>e?e=c=-1:0>c?c=e:e=c;var f="JPG";0<=b.indexOf("type=")&&(f=JU.PT.getTokens(JU.PT.replaceWithCharacter(b.substring(b.indexOf("type=")+5),";,"," "))[0]);d=Array(1);e=this.vwr.getImageAsBytes(f.toUpperCase(),c,e,-1,d);return null!=d[0]?d[0]:a?new JU.BArray(e):JU.Base64.getBase64(e).toString()},"~S,~B");h(c$,"getVariables",function(b){return b.toLowerCase().equals("all")?this.vwr.g.getAllVariables():
this.vwr.evaluateExpressionAsVariable(b)},"~S");c$.getFileInfo=h(c$,"getFileInfo",function(b,a){var e=new java.util.Hashtable;if(null==b)return e;var c=null!=a&&0<a.length;if(t(b,java.util.Map))return c?b.get(a):b;var d=JU.PT.split(b,"\n");if(0==d.length||6>d[0].length||" "!=d[0].charAt(6)||!d[0].substring(0,6).equals(d[0].substring(0,6).toUpperCase()))return e.put("fileHeader",b),e;var f="",g=new JU.SB;c&&(a=a.toUpperCase());for(var j="",w=0;w<d.length;w++){var k=d[w];if(!(12>k.length)){var j=k.substring(0,
6).trim(),l=k.substring(7,10).trim();j.equals("REMARK")&&(j+=l);if(!j.equals(f)){if(c&&f.equals(a))return g.toString();c||(e.put(f,g.toString()),g=new JU.SB);f=j}(!c||j.equals(a))&&g.append(k).appendC("\n")}}c||e.put(f,g.toString());return c?j.equals(a)?g.toString():"":e},"~O,~S");h(c$,"getMoleculeInfo",function(b){b=this.vwr.getAtomBitSet(b);for(var a=this.vwr.ms.getMolecules(),e=new JU.Lst,c=new JU.BS,d=0;d<a.length;d++){var c=JU.BSUtil.copy(b),f=a[d];c.and(f.atomList);0<c.length()&&(c=new java.util.Hashtable,
c.put("mf",f.getMolecularFormula(!0,null,!1)),c.put("number",Integer.$valueOf(f.moleculeIndex+1)),c.put("modelNumber",this.vwr.ms.getModelNumberDotted(f.modelIndex)),c.put("numberInModel",Integer.$valueOf(f.indexInModel+1)),c.put("nAtoms",Integer.$valueOf(f.ac)),c.put("nElements",Integer.$valueOf(f.nElements)),e.addLast(c))}return e},"~O");v(c$,"getModelInfo",function(b){b=this.vwr.ms.getModelBS(this.vwr.getAtomBitSet(b),!1);var a=this.vwr.ms,e=new java.util.Hashtable;e.put("modelSetName",a.modelSetName);
e.put("modelIndex",Integer.$valueOf(this.vwr.am.cmi));e.put("modelCount",Integer.$valueOf(a.mc));e.put("isTainted",Boolean.$valueOf(null!=a.tainted));e.put("canSkipLoad",Boolean.$valueOf(a.canSkipLoad));e.put("modelSetHasVibrationVectors",Boolean.$valueOf(a.modelSetHasVibrationVectors()));null!=a.modelSetProperties&&e.put("modelSetProperties",a.modelSetProperties);e.put("modelCountSelected",Integer.$valueOf(b.cardinality()));e.put("modelsSelected",b);var c=new JU.Lst;a.getMolecules();for(var d=b.nextSetBit(0);0<=
d;d=b.nextSetBit(d+1)){var f=new java.util.Hashtable;f.put("_ipt",Integer.$valueOf(d));f.put("num",Integer.$valueOf(a.getModelNumber(d)));f.put("file_model",a.getModelNumberDotted(d));f.put("name",a.getModelName(d));var g=a.getModelTitle(d);null!=g&&f.put("title",g);g=a.getModelFileName(d);null!=g&&f.put("file",g);g=a.getInfo(d,"modelID");null!=g&&f.put("id",g);f.put("vibrationVectors",Boolean.$valueOf(this.vwr.modelHasVibrationVectors(d)));g=a.am[d];f.put("atomCount",Integer.$valueOf(g.act));f.put("bondCount",
Integer.$valueOf(g.getBondCount()));f.put("groupCount",Integer.$valueOf(g.getGroupCount()));f.put("moleculeCount",Integer.$valueOf(g.moleculeCount));g.isBioModel&&f.put("polymerCount",Integer.$valueOf(g.getBioPolymerCount()));f.put("chainCount",Integer.$valueOf(a.getChainCountInModelWater(d,!0)));null!=g.properties&&f.put("modelProperties",g.properties);var j=a.getInfo(d,"Energy");null!=j&&f.put("energy",j);f.put("atomCount",Integer.$valueOf(g.act));c.addLast(f)}e.put("models",c);return e},"~O");
v(c$,"getLigandInfo",function(b){var a=this.vwr.getAtomBitSet(b),e=this.vwr.getAtomBitSet("solvent");b=new java.util.Hashtable;var c=new JU.Lst;b.put("ligands",c);var d=this.vwr.ms,f=JU.BSUtil.copyInvert(a,d.ac);f.or(e);for(var e=d.at,g=a.nextSetBit(0);0<=g;g=a.nextSetBit(g+1))(e[g].group.isProtein()||e[g].group.isDna()||e[g].group.isRna())&&e[g].group.setAtomBitsAndClear(f,a);a=Array(d.mc);for(g=d.mc;0<=--g;)a[g]=this.vwr.getModelUndeletedAtomsBitSet(g),a[g].andNot(f);f=JU.JmolMolecule.getMolecules(e,
a,null,f);for(g=0;g<f.length;g++){var a=f[g].atomList,j=new java.util.Hashtable;c.addLast(j);j.put("atoms",JU.Escape.eBS(a));for(var w="",k="",l=null,m=0,h=null,r="",x="",s=2147483647,q=2147483647,p=a.nextSetBit(0);0<=p;p=a.nextSetBit(p+1)){var n=e[p];if(l!==n.group){var l=n.group,t=n.getResno(),z=n.getChainID();s!=t-1&&(0!=r.length&&s!=q&&(r+="-"+s),z=-1,q=t);x="/"+d.getModelNumberDotted(n.mi);0!=m&&z!=m&&(r+=":"+h+x);-1==z&&(r+=" "+t);s=t;m=n.getChainID();h=n.getChainIDStr();w+=k+n.getGroup3(!1);
k="-"}}r+=(q==s?"":"-"+s)+(0==m?"":":"+h)+x;j.put("groupNames",w);j.put("residueList",r.substring(1))}return b},"~O");v(c$,"getAtomData",function(b,a,e){b.startsWith("{")||(b="{"+b+"}");var c=a.toLowerCase().startsWith("user:"),d=a.toLowerCase().startsWith("property_");e&&(!c&&!d)&&(a=a.toUpperCase());c=d?"%{"+a+"}":c?a.substring(5):a.equals("xyzrn")?"%-2e %8.3x %8.3y %8.3z %4.2[vdw] 1 [%n]%r.%a#%i":a.equals("xyzvib")?"%-2e %10.5x %10.5y %10.5z %10.5vx %10.5vy %10.5vz":a.equals("pdb")?'{selected and not hetero}.label("ATOM  %5i %-4a%1A%3.3n %1c%4R%1E   %8.3x%8.3y%8.3z%6.2Q%6.2b          %2e  ").lines+{selected and hetero}.label("HETATM%5i %-4a%1A%3.3n %1c%4R%1E   %8.3x%8.3y%8.3z%6.2Q%6.2b          %2e  ").lines':
a.equals("xyz")?"%-2e %10.5x %10.5y %10.5z":a.equals("cfi")?"print '$CFI from Jmol"+JV.Viewer.getJmolVersion()+"\n'+{selected}.count + ' ' + {selected}.bonds.count + '\n'   + {selected}.format('%10.0[atomno] %10.0[elemno] %10.4[xyz]')  + {selected}.bonds.format('%i1 %i2') + '\n' + {selected}.bonds.format('%ORDER')":null;if(null==c)return this.getModelExtract(this.vwr.getAtomBitSet(b),!1,!1,a.toUpperCase(),e);if(c.startsWith("print"))return b.equals("selected")||(c=JU.PT.rep(c,"selected",b.substring(1,
b.length-1))),this.vwr.runScriptCautiously(c);0>c.indexOf("label")?c=b+'.label("'+c+'").lines':b.equals("selected")||(c=JU.PT.rep(c,"selected",b.substring(1,b.length-1)));return this.vwr.evaluateExpression(c)},"~S,~S,~B");v(c$,"getModelExtract",function(b,a,e,c,d){if(c.equalsIgnoreCase("CIF"))return this.getModelCif(b);if(c.equalsIgnoreCase("CML"))return this.getModelCml(b,2147483647,!0,a,d);if(c.equals("PDB")||c.equals("PQR"))return this.getPdbAtomData(b,null,c.equals("PQR"),a,d);var f=c.equalsIgnoreCase("V3000"),
g=c.equalsIgnoreCase("SDF"),j=c.equalsIgnoreCase("MOL"),w=!a&&c.equalsIgnoreCase("XYZVIB"),k=c.equalsIgnoreCase("XYZRN"),l=c.toUpperCase().startsWith("XYZ"),m=c.equalsIgnoreCase("JSON")||c.equalsIgnoreCase("CD");c=new JU.SB;var h=this.vwr.ms,r=JU.BSUtil.copy(b),x=this.vwr.ms.getModelBS(r,!0);if(!l&&!m){var s=this.vwr.ms.getFrameTitle(x.nextSetBit(0)),s=null!=s?s.$replace("\n"," "):e?"Jmol Model Kit":JV.FileManager.fixDOSName(this.vwr.fm.getFullPathName(!1));80<s.length&&(s=s.substring(0,77)+"...");
c.append(s);e=JV.Viewer.getJmolVersion();c.append("\n__Jmol-").append(e.substring(0,2));var q,p,n;n=new Date;e=n.getMonth();s=n.getDate();q=n.getFullYear();p=n.getHours();n=n.getMinutes();JU.PT.rightJustify(c,"_00",""+(1+e));JU.PT.rightJustify(c,"00",""+s);c.append((""+q).substring(2,4));JU.PT.rightJustify(c,"00",""+p);JU.PT.rightJustify(c,"00",""+n);c.append("3D 1   1.00000     0.00000     0");c.append("\nJmol version ").append(JV.Viewer.getJmolVersion()).append(" EXTRACT: ").append(JU.Escape.eBS(b)).append("\n")}s=
h.at;for(e=b.nextSetBit(0);0<=e;e=b.nextSetBit(e+1))a&&s[e].isDeleted()&&r.clear(e);q=JV.PropertyManager.getCovalentBondsForAtoms(h.bo,h.bondCount,r);if(!w&&r.isEmpty())return"";b=!0;null!=h.trajectory&&!d&&h.trajectory.selectDisplayed(x);a=a?this.vwr.tm.getRotationQ():null;if(g){w=c.toString();c=new JU.SB;for(e=x.nextSetBit(0);0<=e&&!(c.append(w),f=JU.BSUtil.copy(r),f.and(h.getModelAtomBitSetIncludingDeleted(e,!1)),q=JV.PropertyManager.getCovalentBondsForAtoms(h.bo,h.bondCount,f),!(b=this.addMolFile(e,
c,f,q,!1,!1,j,a)));e=x.nextSetBit(e+1));}else if(l){j=JM.LabelToken.compile(this.vwr,k?"%-2e _XYZ_ %4.2[vdw] 1 [%n]%r.%a#%i\n":"%-2e _XYZ_\n","\x00",null);g=w?JM.LabelToken.compile(this.vwr,"%-2e _XYZ_ %12.5vx %12.5vy %12.5vz\n","\x00",null):null;k=new JU.P3;for(e=x.nextSetBit(0);0<=e;e=x.nextSetBit(e+1))if(f=JU.BSUtil.copy(r),f.and(h.getModelAtomBitSetIncludingDeleted(e,!1)),!f.isEmpty()){c.appendI(f.cardinality()).appendC("\n");l=h.am[e].properties;c.append("Model["+(e+1)+"]: ");if(null!=h.frameTitles[e]&&
0<h.frameTitles[e].length)c.append(h.frameTitles[e].$replace("\n"," "));else if(null==l)c.append("Jmol "+JV.Viewer.getJmolVersion());else{d=new JU.SB;m=l.propertyNames();for(q=null;m.hasMoreElements();)p=m.nextElement(),p.equals(".PATH")?q=l.getProperty(p):d.append(";").append(p).append("=").append(l.getProperty(p));null!=q&&d.append(";PATH=").append(q);q=d.substring(0<d.length()?1:0);c.append(q.$replace("\n"," "))}c.appendC("\n");l=y(-1,[k]);for(d=f.nextSetBit(0);0<=d;d=f.nextSetBit(d+1))m=JM.LabelToken.formatLabelAtomArray(this.vwr,
s[d],w&&null!=h.getVibration(d,!1)?g:j,"\x00",null,k),this.getPointTransf(e,h,s[d],a,k),m=JU.PT.rep(m,"_XYZ_",JU.PT.sprintf("%12.5p %12.5p %12.5p","p",l)),c.append(m)}}else b=this.addMolFile(-1,c,r,q,f,m,j,a);return b?c.toString():"ERROR: Too many atoms or bonds -- use V3000 format."},"JU.BS,~B,~B,~S,~B");h(c$,"getModelCif",function(b){var a=new JU.SB;a.append("# primitive CIF file created by Jmol "+JV.Viewer.getJmolVersion()+"\ndata_primitive");var e=this.vwr.ms.getUnitCellForAtom(b.nextSetBit(0)),
c=null==e?A(-1,[1,1,1,90,90,90]):e.getUnitCellAsArray(!1);a.append("\n_cell_length_a ").appendF(c[0]);a.append("\n_cell_length_b ").appendF(c[1]);a.append("\n_cell_length_c ").appendF(c[2]);a.append("\n_cell_angle_alpha ").appendF(c[3]);a.append("\n_cell_angle_beta ").appendF(c[4]);a.append("\n_cell_angle_gamma ").appendF(c[5]);a.append("\n\n_symmetry_space_group_name_H-M 'P 1'\nloop_\n_space_group_symop_operation_xyz\n'x,y,z'");a.append("\n\nloop_\n_atom_site_label\n_atom_site_fract_x\n_atom_site_fract_y\n_atom_site_fract_z\n");
for(var c=this.vwr.ms.at,d=new JU.P3,f=b.nextSetBit(0);0<=f;f=b.nextSetBit(f+1)){var g=c[f];d.setT(g);null!=e&&e.toFractional(d,!1);a.append(g.getElementSymbol()).append("\t").append(JU.PT.formatF(d.x,10,5,!0,!1)).append("\t").append(JU.PT.formatF(d.y,10,5,!0,!1)).append("\t").append(JU.PT.formatF(d.z,10,5,!0,!1)).append("\n")}return a.toString()},"JU.BS");h(c$,"addMolFile",function(b,a,e,c,d,f,g,j){var h=e.cardinality(),k=c.cardinality();if(!d&&!f&&(999<h||999<k))return!1;var l=0<=b,m=l?this.vwr.ms.getInfo(b,
"molData"):null,u=this.vwr.ms,r=C(u.ac,0),x=new JU.P3;d?a.append("  0  0  0  0  0  0            999 V3000"):f?a.append('{"mol":{"createdBy":"Jmol '+JV.Viewer.getJmolVersion()+'","a":['):(JU.PT.rightJustify(a,"   ",""+h),JU.PT.rightJustify(a,"   ",""+k),a.append("  0  0  0  0            999 V2000"));f||a.append("\n");d&&a.append("M  V30 BEGIN CTAB\nM  V30 COUNTS ").appendI(h).append(" ").appendI(k).append(" 0 0 0\n").append("M  V30 BEGIN ATOM\n");k=null==m?null:m.get("atom_value_name");t(k,JS.SV)&&
(k=k.asString());for(var s=null==k?0:JS.T.getTokFromName(""+k),q=0==s&&!l?null:new JU.SB,p=e.nextSetBit(0),n=0;0<=p;p=e.nextSetBit(p+1))this.getAtomRecordMOL(b,u,a,r[p]=++n,u.at[p],j,x,d,f,q,s,l);d?a.append("M  V30 END ATOM\nM  V30 BEGIN BOND\n"):f&&a.append('],"b":[');p=c.nextSetBit(0);for(n=0;0<=p;p=c.nextSetBit(p+1))this.getBondRecordMOL(a,++n,u.bo[p],r,d,f,g);d&&a.append("M  V30 END BOND\nM  V30 END CTAB\n");f?a.append("]}}"):(null!=q&&0<q.length()&&a.append(q.toString()),a.append("M  END\n"));
if(l){try{var y=u.getPartialCharges();null==m&&(m=new java.util.Hashtable);var z=new JU.SB;if(null!=y){z.appendI(h).appendC("\n");p=e.nextSetBit(0);for(n=0;0<=p;p=e.nextSetBit(p+1))z.appendI(++n).append(" ").appendF(y[p]).appendC("\n");m.put("jmol_partial_charges",z.toString())}z.setLength(0);z.appendI(h).appendC("\n");p=e.nextSetBit(0);for(n=0;0<=p;p=e.nextSetBit(p+1)){var v=u.at[p].getAtomName().trim();0==v.length&&(v=".");z.appendI(++n).append(" ").append(v.$replace(" ","_")).appendC("\n")}m.put("jmol_atom_names",
z.toString());for(var A,F=m.keySet().iterator();F.hasNext()&&((A=F.next())||1);)k=m.get(A),t(k,JS.SV)&&(k=k.asString()),a.append("> <"+A.toUpperCase()+">\n"),this.output80CharWrap(a,k.toString(),80),a.append("\n\n")}catch(Ia){}a.append("$$$$\n")}return!0},"~N,JU.SB,JU.BS,JU.BS,~B,~B,~B,JU.Quat");h(c$,"output80CharWrap",function(b,a,e){80>e&&(a=JU.PT.rep(a,"\n","|"));a=JU.PT.split(JU.PT.trim(JU.PT.rep(a,"\n\n","\n"),"\n"),"\n");for(var c=0;c<a.length;c++)this.outputLines(b,a[c],e)},"JU.SB,~S,~N");
h(c$,"outputLines",function(b,a,e){for(var c=!1,d=0,f=a.length;d<f&&!c;d+=80)b.append(a.substring(d,Math.min(d+e,f))),!(c=80!=e)&&d+80<f&&b.append("+"),b.append("\n")},"JU.SB,~S,~N");c$.getCovalentBondsForAtoms=h(c$,"getCovalentBondsForAtoms",function(b,a,e){for(var c=new JU.BS,d=0;d<a;d++){var f=b[d];e.get(f.atom1.i)&&(e.get(f.atom2.i)&&f.isCovalent())&&c.set(d)}return c},"~A,~N,JU.BS");h(c$,"getAtomRecordMOL",function(b,a,e,c,d,f,g,j,h,k,l,m){this.getPointTransf(b,a,d,f,g);b=d.getElementNumber();
b=d.isDeleted()?"Xx":JU.Elements.elementSymbolFromNumber(b);a=d.getIsotopeNumber();f=d.getFormalCharge();g=y(-1,[g]);if(j)e.append("M  V30 ").appendI(c).append(" ").append(b).append(JU.PT.sprintf(" %12.5p %12.5p %12.5p 0","p",g)),0!=f&&e.append(" CHG=").appendI(f),0!=a&&e.append(" MASS=").appendI(a),e.append("\n");else if(h)1!=c&&e.append(","),e.append("{"),6!=d.getElementNumber()&&e.append('"l":"').append(d.getElementSymbol()).append('",'),0!=f&&e.append('"c":').appendI(f).append(","),0!=a&&e.append('"m":').appendI(a).append(","),
e.append('"x":').appendF(d.x).append(',"y":').appendF(d.y).append(',"z":').appendF(d.z).append("}");else if(e.append(JU.PT.sprintf("%10.4p%10.4p%10.4p","p",g)),e.append(" ").append(b),1==b.length&&e.append(" "),JU.PT.rightJustify(e,"   ",""+(0<a?a-JU.Elements.getNaturalIsotope(d.getElementNumber()):0)),m&&0<a&&(k.append("M  ISO  1"),JU.PT.rightJustify(k,"    ",""+c),JU.PT.rightJustify(k,"    ",""+a),k.append("\n")),JU.PT.rightJustify(e,"   ",""+(0==f?0:4-f)),e.append("  ").append(this.getAtomParity(d)),
e.append("  0  0  0\n"),e=0==l||j?null:this.getAtomPropertyAsString(d,l),null!=e&&0<(e=e.trim()).length)c="   "+c+" ",k.append("V  ").append(c.substring(c.length-4)),this.output80CharWrap(k,e,73)},"~N,JM.ModelSet,JU.SB,~N,JM.Atom,JU.Quat,JU.P3,~B,~B,JU.SB,~N,~B");h(c$,"getAtomParity",function(b){if(4==b.getCovalentBondCount()){null==this.connections&&(this.connections=C(4,0),this.vTemp=new JU.V3,this.vNorm=new JU.V3);for(var a=b.bonds,e=0,c=0,d=a.length;0<=--d;)if(a[d].isCovalent()){var f=a[d].getOtherAtom(b);
1==f.getAtomicAndIsotopeNumber()&&e++;this.connections[c++]=f.i}if(3>e)return java.util.Arrays.sort(this.connections),b=this.vwr.ms.at,JU.Measure.getNormalThroughPoints(b[this.connections[0]],b[this.connections[1]],b[this.connections[2]],this.vNorm,this.vTemp),this.vTemp.sub2(b[this.connections[3]],b[this.connections[0]]),0<this.vTemp.dot(this.vNorm)?"1":"2"}return"0"},"JM.Atom");h(c$,"getAtomPropertyAsString",function(b,a){switch(a&1136656384){case 1094713344:var e=b.atomPropertyInt(a);return 1765808134==
a?JU.PT.trim(JU.Escape.escapeColor(e),"[x]").toUpperCase():""+e;case 1086324736:return b.atomPropertyString(this.vwr,a);case 1111490560:return e=b.atomPropertyFloat(this.vwr,a,null),Float.isNaN(e)?null:""+e;default:return null==this.ptTemp&&(this.ptTemp=new JU.P3),b.atomPropertyTuple(this.vwr,a,this.ptTemp),null==this.ptTemp?null:this.ptTemp.toString()}},"JM.Atom,~N");h(c$,"getPointTransf",function(b,a,e,c,d){a.isTrajectory(0<=b?b:e.mi)?a.trajectory.getFractional(e,d):d.setT(e);null!=c&&c.transform2(d,
d)},"~N,JM.ModelSet,JM.Atom,JU.Quat,JU.P3");h(c$,"getBondRecordMOL",function(b,a,e,c,d,f,g){var j=c[e.atom1.i];c=c[e.atom2.i];var h=e.getValence();3<h&&(h=1);switch(e.order&-131073){case 515:h=f?-3:4;break;case 66:h=f?-3:5;break;case 513:h=f||g?1:6;break;case 514:h=f||g?2:7;break;case 33:h=f?-1:8}d?b.append("M  V30 ").appendI(a).append(" ").appendI(h).append(" ").appendI(j).append(" ").appendI(c).appendC("\n"):f?(1!=a&&b.append(","),b.append('{"b":').appendI(j-1).append(',"e":').appendI(c-1),1!=h&&
(b.append(',"o":'),0>h?b.appendF(-h/2):b.appendI(h)),b.append("}")):(JU.PT.rightJustify(b,"   ",""+j),JU.PT.rightJustify(b,"   ",""+c),b.append("  ").appendI(h).append("  0  0  0\n"))},"JU.SB,~N,JM.Bond,~A,~B,~B,~B");v(c$,"getChimeInfo",function(b,a){switch(b){case 1073741982:break;case 1073741863:return this.getBasePairInfo(a);default:return this.getChimeInfoA(this.vwr.ms.at,b,a)}var e=new JU.SB;this.vwr.getChimeMessenger().getAllChimeInfo(e);return e.appendC("\n").toString().substring(1)},"~N,JU.BS");
h(c$,"getChimeInfoA",function(b,a,e){var c=new JU.SB;c.append("\n");var d="",f=null,g=null,j=-1,h=0;if(null!=e)for(var k=e.nextSetBit(0);0<=k;k=e.nextSetBit(k+1)){var l=b[k];switch(a){default:return"";case 1113589787:d=l.getInfo();break;case 1140850689:d=""+l.getAtomNumber();break;case 1086324742:d=l.getGroup3(!1);break;case 1086326788:case 1073742120:case 1086324744:case 1086324743:var m=l.getChainID(),d=0==m?" ":l.getChainIDStr();300<=m&&(d=JU.PT.esc(d));switch(a){case 1073742120:d="["+l.getGroup3(!1)+
"]"+l.group.getSeqcodeString()+":"+d;break;case 1086324744:case 1086324743:l.mi!=j&&(c.appendC("\n"),h=0,j=l.mi,c.append("Model "+l.getModelNumber()),f=g=null);l.group.chain!==f&&(c.appendC("\n"),h=0,f=l.group.chain,c.append("Chain "+d+":\n"),g=null);d=l.group;d!==g&&(g=d,1086324743==a?c.append(l.getGroup1("?")):(0==h++%5&&1<h&&c.appendC("\n"),JU.PT.leftJustify(c,"          ","["+l.getGroup3(!1)+"]"+l.getResno()+" ")));continue}}0>c.indexOf("\n"+d+"\n")&&c.append(d).appendC("\n")}1086324744==a&&c.appendC("\n");
return c.toString().substring(1)},"~A,~N,JU.BS");v(c$,"getModelFileInfo",function(b){for(var a=this.vwr.ms,e=new JU.SB,c=0;c<a.mc;++c)if(null==b||b.get(c)){var d='["'+a.getModelNumberDotted(c)+'"] = ';e.append("\n\nfile").append(d).append(JU.PT.esc(a.getModelFileName(c)));var f=a.getInfo(c,"modelID");null!=f&&e.append("\nid").append(d).append(JU.PT.esc(f));e.append("\ntitle").append(d).append(JU.PT.esc(a.getModelTitle(c)));e.append("\nname").append(d).append(JU.PT.esc(a.getModelName(c)));e.append("\ntype").append(d).append(JU.PT.esc(a.getModelFileType(c)))}return e.toString()},
"JU.BS");h(c$,"getAllAtomInfo",function(b){for(var a=new JU.Lst,e=new JU.P3,c=b.nextSetBit(0);0<=c;c=b.nextSetBit(c+1))a.addLast(this.getAtomInfoLong(c,e));return a},"JU.BS");h(c$,"getAtomInfoLong",function(b,a){var e=this.vwr.ms,c=e.at[b],d=new java.util.Hashtable;e.getAtomIdentityInfo(b,d,a);d.put("element",e.getElementName(b));d.put("elemno",Integer.$valueOf(e.at[b].getElementNumber()));d.put("x",Float.$valueOf(c.x));d.put("y",Float.$valueOf(c.y));d.put("z",Float.$valueOf(c.z));d.put("coord",JU.P3.newP(c));
null!=e.vibrations&&null!=e.vibrations[b]&&e.vibrations[b].getInfo(d);d.put("bondCount",Integer.$valueOf(c.getCovalentBondCount()));d.put("radius",Float.$valueOf(c.getRasMolRadius()/120));d.put("model",c.getModelNumberForLabel());var f=c.atomPropertyString(this.vwr,1086324748);null!=f&&d.put("shape",f);d.put("visible",Boolean.$valueOf(c.checkVisible()));d.put("clickabilityFlags",Integer.$valueOf(c.clickabilityFlags));d.put("visibilityFlags",Integer.$valueOf(c.shapeVisibilityFlags));d.put("spacefill",
Float.$valueOf(c.getRadius()));f=JU.Escape.escapeColor(this.vwr.gdata.getColorArgbOrGray(c.colixAtom));null!=f&&d.put("color",f);d.put("colix",Integer.$valueOf(c.colixAtom));(f=JU.C.isColixTranslucent(c.colixAtom))&&d.put("translucent",Boolean.$valueOf(f));d.put("formalCharge",Integer.$valueOf(c.getFormalCharge()));d.put("partialCharge",Float.$valueOf(c.getPartialCharge()));f=c.getSurfaceDistance100()/100;0<=f&&d.put("surfaceDistance",Float.$valueOf(f));if(e.am[c.mi].isBioModel){d.put("resname",c.getGroup3(!1));
var f=c.group.getInsertionCode(),g=c.getResno();0<g&&d.put("resno",Integer.$valueOf(g));0!=f.charCodeAt(0)&&d.put("insertionCode",""+f);d.put("name",e.at[b].getAtomName());d.put("chain",c.getChainIDStr());d.put("atomID",Integer.$valueOf(c.atomID));d.put("groupID",Integer.$valueOf(c.group.groupID));"\x00"!=c.altloc&&d.put("altLocation",""+c.altloc);d.put("structure",Integer.$valueOf(c.group.getProteinStructureType().getId()));d.put("polymerLength",Integer.$valueOf(c.group.getBioPolymerLength()));d.put("occupancy",
Integer.$valueOf(c.getOccupancy100()));e=c.getBfactor100();d.put("temp",Integer.$valueOf(I(e/100)))}return d},"~N,JU.P3");h(c$,"getAllBondInfo",function(b){var a=new JU.Lst,e=this.vwr.ms,c=e.bondCount,e=e.bo,d;t(b,String)&&(b=this.vwr.getAtomBitSet(b));var f=new JU.P3;if(t(b,Array)){d=b[0];var g=b[1];for(b=0;b<c;b++){var j=e[b].atom1.i,h=e[b].atom2.i;(d.get(j)&&g.get(h)||g.get(j)&&d.get(h))&&a.addLast(this.getBondInfo(b,f))}}else if(t(b,JM.BondSet)){d=b;for(b=d.nextSetBit(0);0<=b&&b<c;b=d.nextSetBit(b+
1))a.addLast(this.getBondInfo(b,f))}else if(t(b,JU.BS)){d=b;g=1==d.cardinality()?d.nextSetBit(0):-1;for(b=0;b<c;b++)(0<=g?e[b].atom1.i==g||e[b].atom2.i==g:d.get(e[b].atom1.i)&&d.get(e[b].atom2.i))&&a.addLast(this.getBondInfo(b,f))}return a},"~O");h(c$,"getBondInfo",function(b,a){var e=this.vwr.ms.bo[b],c=e.atom1,d=e.atom2,f=new java.util.Hashtable;f.put("_bpt",Integer.$valueOf(b));var g=new java.util.Hashtable;this.vwr.ms.getAtomIdentityInfo(c.i,g,a);var j=new java.util.Hashtable;this.vwr.ms.getAtomIdentityInfo(d.i,
j,a);f.put("atom1",g);f.put("atom2",j);f.put("jmol_order","0x"+Integer.toHexString(e.order));f.put("order",Float.$valueOf(JU.PT.fVal(JU.Edge.getBondOrderNumberFromOrder(e.order))));f.put("type",JU.Edge.getBondOrderNameFromOrder(e.order));f.put("radius",Float.$valueOf(e.mad/2E3));f.put("length_Ang",Float.$valueOf(c.distance(d)));f.put("visible",Boolean.$valueOf(0!=e.shapeVisibilityFlags));c=JU.Escape.escapeColor(this.vwr.gdata.getColorArgbOrGray(e.colix));null!=c&&f.put("color",c);f.put("colix",Integer.$valueOf(e.colix));
JU.C.isColixTranslucent(e.colix)&&f.put("translucent",Boolean.TRUE);return f},"~N,JU.P3");h(c$,"getAllChainInfo",function(b){for(var a=new java.util.Hashtable,e=new JU.Lst,c=this.vwr.ms.mc,d=0;d<c;++d){var f=new java.util.Hashtable,g=this.getChainInfo(d,b);0<g.size()&&(f.put("modelIndex",Integer.$valueOf(d)),f.put("chains",g),e.addLast(f))}a.put("models",e);return a},"JU.BS");h(c$,"getChainInfo",function(b,a){for(var e=this.vwr.ms.am[b],c=e.getChainCount(!0),d=new JU.Lst,f=new JU.P3,g=0;g<c;g++){for(var j=
e.getChainAt(g),h=new JU.Lst,k=j.groupCount,l=new java.util.Hashtable,m=0;m<k;m++){var u=j.groups[m];a.get(u.firstAtomIndex)&&h.addLast(u.getGroupInfo(m,f))}h.isEmpty()||(l.put("residues",h),d.addLast(l))}return d},"~N,JU.BS");h(c$,"getAllPolymerInfo",function(b){var a=new java.util.Hashtable;null!=this.vwr.ms.bioModelset&&this.vwr.ms.bioModelset.getAllPolymerInfo(b,a);return a},"JU.BS");h(c$,"getBasePairInfo",function(b){var a=new JU.SB,e=new JU.Lst;this.vwr.ms.calcRasmolHydrogenBonds(b,b,e,!0,1,
!1,null);for(b=e.size();0<=--b;){var c=e.get(b);JV.PropertyManager.getAtomResidueInfo(a,c.atom1);a.append(" - ");JV.PropertyManager.getAtomResidueInfo(a,c.atom2);a.append("\n")}return a.toString()},"JU.BS");c$.getAtomResidueInfo=h(c$,"getAtomResidueInfo",function(b,a){b.append("[").append(a.getGroup3(!1)).append("]").append(a.group.getSeqcodeString()).append(":");var e=a.getChainID();b.append(0==e?" ":a.getChainIDStr())},"JU.SB,JM.Atom");h(c$,"getAppletInfo",function(){var b=new java.util.Hashtable;
b.put("htmlName",this.vwr.htmlName);b.put("syncId",this.vwr.syncId);b.put("fullName",this.vwr.fullName);b.put("codeBase",""+JV.Viewer.appletCodeBase);this.vwr.isApplet&&(b.put("documentBase",JV.Viewer.appletDocumentBase),b.put("registry",this.vwr.sm.getRegistryInfo()));b.put("version",JV.JC.version);b.put("date",JV.JC.date);b.put("javaVendor",JV.Viewer.strJavaVendor);b.put("javaVersion",JV.Viewer.strJavaVersion+(!this.vwr.isJS?"":this.vwr.isWebGL?"(WebGL)":"(HTML5)"));b.put("operatingSystem",JV.Viewer.strOSName);
return b});h(c$,"getAnimationInfo",function(){var b=this.vwr.am,a=new java.util.Hashtable;a.put("firstModelIndex",Integer.$valueOf(b.firstFrameIndex));a.put("lastModelIndex",Integer.$valueOf(b.lastFrameIndex));a.put("animationDirection",Integer.$valueOf(b.animationDirection));a.put("currentDirection",Integer.$valueOf(b.currentDirection));a.put("displayModelIndex",Integer.$valueOf(b.cmi));null!=b.animationFrames&&(a.put("isMovie",Boolean.TRUE),a.put("frames",JU.Escape.eAI(b.animationFrames)),a.put("currentAnimationFrame",
Integer.$valueOf(b.caf)));a.put("displayModelNumber",this.vwr.getModelNumberDotted(b.cmi));a.put("displayModelName",0<=b.cmi?this.vwr.getModelName(b.cmi):"");a.put("animationFps",Integer.$valueOf(b.animationFps));a.put("animationReplayMode",JS.T.nameOf(b.animationReplayMode));a.put("firstFrameDelay",Float.$valueOf(b.firstFrameDelay));a.put("lastFrameDelay",Float.$valueOf(b.lastFrameDelay));a.put("animationOn",Boolean.$valueOf(b.animationOn));a.put("animationPaused",Boolean.$valueOf(b.animationPaused));
return a});h(c$,"getBoundBoxInfo",function(){var b=this.vwr.ms.getBoxInfo(null,1).getBoundBoxPoints(!0),a=new java.util.Hashtable;a.put("center",JU.P3.newP(b[0]));a.put("vector",JU.V3.newV(b[1]));a.put("corner0",JU.P3.newP(b[2]));a.put("corner1",JU.P3.newP(b[3]));return a});h(c$,"getShapeInfo",function(){var b=new java.util.Hashtable,a=new JU.SB,e=this.vwr.shm.shapes;if(null!=e)for(var c=0;37>c;++c){var d=e[c];if(null!=d){var f=JV.JC.shapeClassBases[c],d=d.getShapeDetail();null!=d&&b.put(f,d)}}0<
a.length()&&b.put("shapeCommands",a.toString());return b});h(c$,"getAnnotationInfo",function(b,a){var e=this.vwr.getAtomBitSet(b),e=this.vwr.ms.getModelBS(e,!1).nextSetBit(0);if(0>e)return null;var c=this.vwr.ms.getModelAuxiliaryInfo(e).get(1073741925==a?"domains":"validation");if(null==c||6!=c.tok)return null;this.vwr.getAnnotationParser(!1).initializeAnnotation(c,a,e);return c.mapGet("_list")},"~O,~N");h(c$,"getMeasurementInfo",function(){return this.vwr.getShapeProperty(6,"info")});h(c$,"getMouseInfo",
function(){if(!this.vwr.haveDisplay)return null;for(var b=new java.util.Hashtable,a=new JU.Lst,e=this.vwr.acm,c,d=e.b.getBindings().values().iterator();d.hasNext()&&((c=d.next())||1);)t(c,Boolean)||(JU.AU.isAI(c)&&(c=y(-1,[JV.binding.Binding.getMouseActionName(c[0],!1),JV.ActionManager.getActionName(c[1])])),a.addLast(c));b.put("bindings",a);b.put("bindingName",e.b.name);b.put("actionNames",JV.ActionManager.actionNames);b.put("actionInfo",JV.ActionManager.actionInfo);b.put("bindingInfo",JU.PT.split(e.getBindingInfo(null),
"\n"));return b});v(c$,"getPdbAtomData",function(b,a,e,c){if(0==this.vwr.ms.ac||0>b.nextSetBit(0))return"";null==a?a=this.vwr.getOutputChannel(null,null):(e=(new Boolean(e|0<=a.getType().indexOf("PQR"))).valueOf(),c=(new Boolean(c|0<=a.getType().indexOf("-coord true"))).valueOf());var d=this.vwr.ms.at,f=this.vwr.ms.am,g="%6.2Q%6.2b          ";if(e){g="%8.4P%7.4V       ";e=0;for(var j=b.nextSetBit(0);0<=j;j=b.nextSetBit(j+1))e+=d[j].getPartialCharge();a.append("REMARK   1 PQR file generated by Jmol "+
JV.Viewer.getJmolVersion()).append("\nREMARK   1 created "+new java.util.Date).append("\nREMARK   1 Forcefield Used: unknown\nREMARK   1").append("\nREMARK   5").append("\nREMARK   6 Total charge on this protein: "+e+" e\nREMARK   6\n")}j=d[b.nextSetBit(0)].mi;e=-1;var h=b.length()-1,h=j!=d[h].mi,k=this.vwr.ms.getModelBS(b,!0),l=k.cardinality(),m=new JU.Lst,u=f[j].isPdbWithMultipleBonds,r=!1;if(1<l)for(var x=null,s=0,j=k.nextSetBit(0);0<=j;j=k.nextSetBit(j+1)){var q=this.vwr.ms.getModelAuxiliaryInfo(j).get("PDB_CONECT_bonds");
if(q!==x||!this.vwr.ms.am[j].isBioModel)if(x=q,0<s++){r=!0;break}}var x=new JU.P3,s=y(-1,[x]),p=c?this.vwr.tm.getRotationQ():null;c=new java.util.Hashtable;for(var k=!1,n=r?C(l,0):null,l=0,j=b.nextSetBit(0);0<=j;j=b.nextSetBit(j+1)){q=d[j];k=f[q.mi].isBioModel;h&&q.mi!=e&&(-1!=e&&(l=this.fixPDBFormat(m,c,a,n,l),a.append("ENDMDL\n")),m=new JU.Lst,e=q.mi,a.append("MODEL     "+(e+1)+"\n"));var r=q.getAtomName(),t=2==q.getElementSymbol().length||4<=r.length||JU.PT.isDigit(r.charAt(0)),r=q.isHetero(),
r=k?r?t?JM.LabelToken.compile(this.vwr,"HETATM%5.-5i %-4.4a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+g,"\x00",null):JM.LabelToken.compile(this.vwr,"HETATM%5.-5i  %-3.3a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+g,"\x00",null):t?JM.LabelToken.compile(this.vwr,"ATOM  %5.-5i %-4.4a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+g,"\x00",null):JM.LabelToken.compile(this.vwr,"ATOM  %5.-5i  %-3.3a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+g,"\x00",null):t?JM.LabelToken.compile(this.vwr,"HETATM%5.-5i %-4.4a%1AUNK %1c   1%1E   _XYZ_"+g,"\x00",null):JM.LabelToken.compile(this.vwr,
"HETATM%5.-5i  %-3.3a%1AUNK %1c   1%1E   _XYZ_"+g,"\x00",null),k=q.getElementSymbolIso(!1).toUpperCase(),k=this.pdbKey(q.group.getBioPolymerIndexInModel())+this.pdbKey(q.group.groupIndex)+JM.LabelToken.formatLabelAtomArray(this.vwr,q,r,"\x00",null,x)+(1==k.length?" "+k:k.substring(0,2))+"  ";this.getPointTransf(-1,this.vwr.ms,q,p,x);q=JU.PT.sprintf("%8.3p%8.3p%8.3p","p",s);24<q.length&&(q=JU.PT.sprintf("%8.2p%8.2p%8.2p","p",s));k=JU.PT.rep(k,"_XYZ_",q);m.addLast(k)}this.fixPDBFormat(m,c,a,n,l);h&&
a.append("ENDMDL\n");e=l=-1;k=!1;for(j=b.nextSetBit(0);0<=j;j=b.nextSetBit(j+1))if(q=d[j],h&&q.mi!=e&&(e=q.mi,k=f[e].isBioModel,l++),r=!k||q.isHetero(),g=!r&&16==q.getElementNumber(),r||u||g)if(m=q.bonds,null!=m)for(x=0;x<m.length;x++)if(p=q.getAtomNumber(),n=m[x].getOtherAtom(q),b.get(n.i)&&(s=m[x].getCovalentOrder(),!(1==s&&(u&&!r&&!g||g&&16!=n.getElementNumber()))))switch(n=n.getAtomNumber(),s){case 2:case 3:if(n<p)continue;case 1:p=c.get(""+l+"."+Integer.$valueOf(p));n=c.get(""+l+"."+Integer.$valueOf(n));
if(null==p||null==n)break;a.append("CONECT").append(JU.PT.formatStringS("%5s","s",""+p));p=JU.PT.formatStringS("%5s","s",""+n);for(n=0;n<s;n++)a.append(p);a.append("\n")}return a.toString()},"JU.BS,JU.OC,~B,~B,~B");h(c$,"pdbKey",function(b){b=0>b?"~999":"   "+b;return b.substring(b.length-4)},"~N");h(c$,"fixPDBFormat",function(b,a,e,c,d){b.addLast("~999~999XXXXXX99999999999999999999~99~");var f=Array(b.size());b.toArray(f);java.util.Arrays.sort(f);b.clear();for(var g=0,j=f.length;g<j;g++)b.addLast(f[g]);
for(var h=f=null,j=b.size(),k=0,l=null==c?0:c[d],g=0;g<j;g++){var m=b.get(g),u=m.substring(0,4),m=m.substring(8),r=!1,t=0<=m.indexOf("~99~");if(!u.equals(f)||t)null!=f&&!f.equals("~999")&&(r=!0,m="TER   "+h.substring(6,11)+"      "+h.substring(17,27),b.add(g,u+"~~~~"+m),j++),f=u;if(t&&!r)break;h=m;k=g+1+l;null!=a&&!r&&a.put(""+d+"."+Integer.$valueOf(JU.PT.parseInt(m.substring(6,11))),Integer.$valueOf(k));u="     "+k;e.append(m.substring(0,6)).append(u.substring(u.length-5)).append(m.substring(11)).append("\n")}null!=
c&&++d<c.length&&(c[d]=k);return d},"JU.Lst,java.util.Map,JU.OC,~A,~N");v(c$,"getPdbData",function(b,a,e,c,d,f){this.vwr.ms.isJmolDataFrameForModel(b)&&(b=this.vwr.ms.getJmolDataSourceFrame(b));if(0>b)return"";var g=this.vwr.ms.am[b],j=g.isBioModel;if(null==c&&!j)return null;null==d&&(d=this.vwr.getOutputChannel(null,null));var h=new JU.SB,k=0<=a.indexOf("draw"),l=null,m=new JU.BS,u="\x00",r=this.vwr.ms.getLabeler().compile(this.vwr,"ATOM  %-6i%4a%1A%3.-3n %1c%4R%1E   ","\x00",null);if(null==c)u=
11<a.length&&0<=a.indexOf("quaternion ")?a.charAt(11):"R",g.getPdbData(a,u,k,e,d,r,h,m),l=this.vwr.getModelUndeletedAtomsBitSet(b);else{l=c[0];b=c[1];var g=c[2],t=c[3],s=null!=g,q=null!=t,p=c[4],n=c[5],v=c[6],z=c[7],D=c[8],E=c[9];c=null!=v&&null==D;var F=this.vwr.ms.at;if(c){d.append("REMARK   6 Jmol PDB-encoded data: ").append(a).append("; ").append(JV.Viewer.getJmolVersion()).append("; ").append(this.vwr.apiPlatform.getDateFormat(null)).append("\n");d.append("REMARK   6 Jmol data").append(" min = ").append(JU.Escape.eP(p)).append(" max = ").append(JU.Escape.eP(n)).append(" unScaledXyz = xyz * ").append(JU.Escape.eP(v)).append(" + ").append(JU.Escape.eP(z)).append(";\n");
n=null;for(a=l.nextSetBit(0);0<=a;a=l.nextSetBit(a+1))if(p=""+F[a].getAtomName(),null!=n||4<p.length)null==n?(n="",a=-1):n+=" "+p;null!=n&&d.append("REMARK   6 Jmol atom names").append(n).append("\n");n=null;for(a=l.nextSetBit(0);0<=a;a=l.nextSetBit(a+1))if(p=""+F[a].getGroup3(!0),null!=n||3<p.length)null==n?(n="",a=-1):n+=" "+p;null!=n&&d.append("REMARK   6 Jmol residue names").append(n).append("\n");for(a=0;a<E.length;a++)null!=E[a]&&d.append("REMARK   6 Jmol property ").append(E[a]).append(";\n")}E=
null;p=new JU.P3;c||(null==D&&(D="%-5i %-10s %-13.5f "+(q?"%-13.5f %-13.5f":s?"%-13.5f":"")),D+="\n");a=l.nextSetBit(0);for(n=0;0<=a;a=l.nextSetBit(a+1),n++){var v=b[n],z=s?g[n]:0,C=q?t[n]:0;if(!Float.isNaN(v)&&!Float.isNaN(z)&&!Float.isNaN(C)){var B=F[a];c?(d.append(JM.LabelToken.formatLabelAtomArray(this.vwr,B,r,"\x00",null,p)),j&&m.set(a),d.append(JU.PT.sprintf("%-8.2f%-8.2f%-10.2f    %6.3f          %2s    %s\n","ssF",y(-1,[B.getElementSymbolIso(!1).toUpperCase(),"",A(-1,[v,z,C,0])]))),null!=E&&
E.group.getBioPolymerIndexInModel()==B.group.getBioPolymerIndexInModel()&&h.append("CONECT").append(JU.PT.formatStringI("%5i","i",E.getAtomNumber())).append(JU.PT.formatStringI("%5i","i",B.getAtomNumber())).appendC("\n")):q?d.append(JU.PT.sprintf(D,"isF",y(-1,[Integer.$valueOf(B.getAtomNumber()),B.getAtomName(),A(-1,[v,z,C])]))):s?d.append(JU.PT.sprintf(D,"isF",y(-1,[Integer.$valueOf(B.getAtomNumber()),B.getAtomName(),A(-1,[v,z])]))):d.append(JU.PT.sprintf(D,"isF",y(-1,[Integer.$valueOf(B.getAtomNumber()),
B.getAtomName(),A(-1,[v])])));E=B}}}d.append(h.toString());if(k)return d.toString();e.and(l);j&&f&&d.append("\n\n"+this.vwr.ms.getProteinStructureState(m,"R"==u?4138:1073742086));return d.toString()},"~N,~S,JU.BS,~A,JU.OC,~B");v(c$,"getModelCml",function(b,a,e){var c=new JU.SB;if(0==b.cardinality())return"";this.vwr.isJS&&J.api.Interface.getInterface("JU.XmlUtil",this.vwr,"file");JU.XmlUtil.openTag(c,"molecule");JU.XmlUtil.openTag(c,"atomArray");for(var d=new JU.BS,f=this.vwr.ms.at,g=b.nextSetBit(0);0<=
g&&!(0>--a);g=b.nextSetBit(g+1)){var h=f[g],t=h.getAtomName();JU.PT.rep(t,'"',"''");d.set(h.i);JU.XmlUtil.appendTag(c,"atom/",y(-1,["id","a"+(h.i+1),"title",h.getAtomName(),"elementType",h.getElementSymbol(),"x3",""+h.x,"y3",""+h.y,"z3",""+h.z]))}JU.XmlUtil.closeTag(c,"atomArray");if(e){JU.XmlUtil.openTag(c,"bondArray");b=this.vwr.ms.bondCount;a=this.vwr.ms.bo;for(g=0;g<b;g++)e=a[g],f=e.atom2,d.get(e.atom1.i)&&d.get(f.i)&&(f=JU.Edge.getCmlBondOrder(e.order),null!=f&&JU.XmlUtil.appendTag(c,"bond/",
y(-1,["atomRefs2","a"+(e.atom1.i+1)+" a"+(e.atom2.i+1),"order",f])));JU.XmlUtil.closeTag(c,"bondArray")}JU.XmlUtil.closeTag(c,"molecule");return c.toString()},"JU.BS,~N,~B,~B,~B");v(c$,"fixJMEFormalCharges",function(b,a){var e=!1;if(null==b)return a;for(var c=b.nextSetBit(0);0<=c;c=b.nextSetBit(c+1)){var d=this.vwr.ms.at[c];if(0!=d.getFormalCharge()){e=!0;break}}if(!e)return a;e=this.vwr.getSmilesMatcher().getMapForJME(a,this.vwr.ms.at,b);if(null==e)return a;for(var d=e[0],f=e[1],e=JU.PT.getTokens(a),
g=JU.PT.parseInt(e[0]),g=C(g,0),c=d.length;0<=--c;)g[d[c]]=f[c]+1;c=0;for(f=2;f<e.length;f+=3){var h=e[f];if(-2147483648!=JU.PT.parseInt(h))break;h=JU.PT.replaceAllCharacters(h,"+-","");d=this.vwr.ms.at[g[c++]-1];if(!d.getElementSymbol().equals(h))return a;d=d.getFormalCharge();0!=d&&(e[f]=h+(0<d?"+":"-")+(1<Math.abs(d)?""+Math.abs(d):""))}return JU.PT.join(e," ",0)},"JU.BS,~S");H(c$,"atomExpression","<atom selection>");c$.propertyTypes=c$.prototype.propertyTypes=y(-1,"appletInfo;;;fileName;;;fileHeader;;;fileContents;<pathname>;;fileContents;;;animationInfo;;;modelInfo;<atom selection>;{*};ligandInfo;<atom selection>;{*};shapeInfo;;;measurementInfo;;;centerInfo;;;orientationInfo;;;transformInfo;;;;;;atomInfo;<atom selection>;(visible);bondInfo;<atom selection>;(visible);chainInfo;<atom selection>;(visible);polymerInfo;<atom selection>;(visible);moleculeInfo;<atom selection>;(visible);stateInfo;<state type>;all;extractModel;<atom selection>;(visible);jmolStatus;statusNameList;;jmolViewer;;;messageQueue;;;auxiliaryInfo;<atom selection>;{*};boundBoxInfo;;;dataInfo;<data type>;types;image;<width=www,height=hhh>;;evaluate;<expression>;;menu;<type>;current;minimizationInfo;;;pointGroupInfo;<atom selection>;(visible);fileInfo;<type>;;errorMessage;;;mouseInfo;;;isosurfaceInfo;;;isosurfaceData;;;consoleText;;;JSpecView;<key>;;scriptQueueInfo;;;nmrInfo;<elementSymbol> or 'all' or 'shifts';all;variableInfo;<name>;all;domainInfo;<atom selection>;{visible};validationInfo;<atom selection>;{visible};service;<hashTable>;;CIFInfo;<filename>;".split(";"));
H(c$,"PROP_APPLET_INFO",0,"PROP_FILENAME",1,"PROP_FILEHEADER",2,"PROP_FILECONTENTS_PATH",3,"PROP_FILECONTENTS",4,"PROP_ANIMATION_INFO",5,"PROP_MODEL_INFO",6,"PROP_LIGAND_INFO",7,"PROP_SHAPE_INFO",8,"PROP_MEASUREMENT_INFO",9,"PROP_CENTER_INFO",10,"PROP_ORIENTATION_INFO",11,"PROP_TRANSFORM_INFO",12,"PROP_ATOM_INFO",14,"PROP_BOND_INFO",15,"PROP_CHAIN_INFO",16,"PROP_POLYMER_INFO",17,"PROP_MOLECULE_INFO",18,"PROP_STATE_INFO",19,"PROP_EXTRACT_MODEL",20,"PROP_JMOL_STATUS",21,"PROP_JMOL_VIEWER",22,"PROP_MESSAGE_QUEUE",
23,"PROP_AUXILIARY_INFO",24,"PROP_BOUNDBOX_INFO",25,"PROP_DATA_INFO",26,"PROP_IMAGE",27,"PROP_EVALUATE",28,"PROP_MENU",29,"PROP_MINIMIZATION_INFO",30,"PROP_POINTGROUP_INFO",31,"PROP_FILE_INFO",32,"PROP_ERROR_MESSAGE",33,"PROP_MOUSE_INFO",34,"PROP_ISOSURFACE_INFO",35,"PROP_ISOSURFACE_DATA",36,"PROP_CONSOLE_TEXT",37,"PROP_JSPECVIEW",38,"PROP_SCRIPT_QUEUE_INFO",39,"PROP_NMR_INFO",40,"PROP_VAR_INFO",41,"PROP_DOM_INFO",42,"PROP_VAL_INFO",43,"PROP_SERVICE",44,"PROP_CIF_INFO",45,"PROP_COUNT",46,"readableTypes",
y(-1," stateinfo extractmodel filecontents fileheader image menu minimizationInfo".split(" ")))})})(Clazz,Clazz.getClassName,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.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.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAB,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,
Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
