(function(Q,R,S,H,T,F,q,I,K,L,U,V,M,W,X,N,G,x,Y,O,Z,$,P,aa,ba,ca,da,ea,fa,v,ga,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,j,t){F("J.api");P(J.api,"JmolPropertyManager");F("JV");I(["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 $.P3 $.PT $.SB $.V3 J.api.Interface JM.BondSet $.LabelToken JS.SV $.T JU.BSUtil $.C $.Edge $.Elements $.Escape $.JmolMolecule $.Logger JV.ActionManager $.JC $.Viewer JV.binding.Binding".split(" "),
function(){c$=L(function(){this.map=this.vwr=null;K(this,arguments)},JV,"PropertyManager",null,J.api.JmolPropertyManager);O(c$,function(){this.map=new java.util.Hashtable});M(c$,function(){});t(c$,"setViewer",function(b){this.vwr=b;for(var c=b=0;b<JV.PropertyManager.propertyTypes.length;b+=3,c++)0<JV.PropertyManager.propertyTypes[b].length&&this.map.put(JV.PropertyManager.propertyTypes[b].toLowerCase(),Integer.$valueOf(c))},"JV.Viewer");t(c$,"getPropertyNumber",function(b){b=this.map.get(null==b?
"":b.toLowerCase());return null==b?-1:b.intValue()},"~S");t(c$,"getDefaultPropertyParam",function(b){return 0>b?"":JV.PropertyManager.propertyTypes[3*b+2]},"~N");t(c$,"checkPropertyParameter",function(b){b=this.getPropertyNumber(b);b=JV.PropertyManager.getParamType(b);return 0<b.length&&"<atom selection>"!==b},"~S");t(c$,"getProperty",function(b,c,e){135!=JV.PropertyManager.propertyTypes.length&&JU.Logger.warn("propertyTypes is not the right length: "+JV.PropertyManager.propertyTypes.length+" != 135");
if(0<=c.indexOf(".")||0<=c.indexOf("[")){var a=this.getArguments(c);e=this.extractProperty(this.getPropertyAsObject(a[0].asString(),e,null),a,1,null,!1)}else e=this.getPropertyAsObject(c,e,b);if(null==b)return e;(a=b.equalsIgnoreCase("readable"))&&(b=JV.PropertyManager.isReadableAsString(c)?"String":"JSON");return b.equalsIgnoreCase("String")?null==e?"":e.toString():a?JU.Escape.toReadable(c,e):b.equalsIgnoreCase("JSON")?"{"+JU.PT.toJSON(c,e)+"}":e},"~S,~S,~O");j(c$,"getArguments",function(b){var c=
b.toLowerCase(),e=-1;if(0<=b.indexOf('"')||0<=b.indexOf("'"))b=this.fixSelectQuotes(b);for(;0<=(e=c.indexOf("[select ",++e));){var a=c.indexOf(" where ",e),d=c.indexOf(" wherein ",e);0<d&&d<a&&(a=d);d=c.lastIndexOf("]");0>a||a>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 c=Array(b.length),e=0,f;e<b.length;e++)c[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 c},"~S");j(c$,"fixSelectQuotes",function(b){b=b.toCharArray();for(var c=!1,e=!1,a=!1,d=b.length;0<=--d;)switch(b[d]){case "'":a||(c=e=!c);break;case '"':e||(c=a=!c);break;case ".":c&&(b[d]="\u0001");
break;case "[":c&&(b[d]="\u0002");break;case "]":c&&(b[d]="\u0003")}return b=String.instantialize(b)},"~S");t(c$,"extractProperty",function(b,c,e,a,d){0>e&&(c=this.getArguments(c),e=0);if(e>=c.length)return b;d||(c=this.compileSelect(c));var f,g=c[e++];d=JS.SV.oValue(b);switch(g.tok){case 2:f=g.intValue-1;if(q(d,JU.Lst))return 0>f&&(f+=d.size()),0<=f&&f<d.size()?this.extractProperty(d.get(f),c,e,null,!0):"";if(q(d,JU.M3))return a=d,a=v(-1,[x(-1,[a.m00,a.m01,a.m02]),x(-1,[a.m10,a.m11,a.m12]),x(-1,
[a.m20,a.m21,a.m22])]),0>f&&(f+=3),0<=f&&3>f?this.extractProperty(a,c,--e,null,!0):"";if(q(d,JU.M4))return a=d,a=v(-1,[x(-1,[a.m00,a.m01,a.m02,a.m03]),x(-1,[a.m10,a.m11,a.m12,a.m13]),x(-1,[a.m20,a.m21,a.m22,a.m23]),x(-1,[a.m30,a.m31,a.m32,a.m33])]),0>f&&(f+=4),0<=f&&4>f?this.extractProperty(a,c,--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],c,e,null,!0):"";if(JU.AU.isAS(d)||q(d,Array))return 0>f&&(f+=d.length),0<=f&&f<d.length?d[f]:"";break;case 1275082245:case 4:if(q(d,java.util.Map)){var h=!1,p=b=!1;f=1275082245==g.tok?g.value[0]:null;var l=null;if(1275082245==g.tok)if(p=!0,l=g.value[1],g=g.myName,b=0<=g.indexOf(";"),g.contains("**")){for(var k=0==f.size(),r="",m,j=d.entrySet().iterator();j.hasNext()&&
((m=j.next())||1);)for(var s=m.getKey(),g=k?1:f.size();0<=--g;)if(k||JU.PT.isLike(s,f.get(g))){var h=m.getValue(),n=!1;switch(q(h,JS.SV)?h.tok:0){case 7:n=!0;h=h.getList();break;case 6:case 14:h=h.getMap();break;default:if(!q(h,java.util.Map)&&!(n=q(h,JU.Lst)))h=null}if(null!=h){if(n){null==a&&(a=new JU.Lst);c=h;e=c.size();for(d=0;d<e;d++)if(h=c.get(d),q(h,JS.SV)&&null!=(h=h.getMap()))(null==l||this.vwr.checkSelect(h,l))&&a.addLast(h);return a}if(null==l||this.vwr.checkSelect(h,l))r+=","+s}}if(0==
r.length)return new JU.Lst;g=r.substring(1);h=!b;f=null}else{if(null!=l&&!this.vwr.checkSelect(d,l))return""}else if(g=g.asString(),g.equalsIgnoreCase("keys")){a=new JU.Lst;for(d=d.keySet().iterator();d.hasNext()&&((s=d.next())||1);)a.addLast(s);return this.extractProperty(a,c,e,null,!0)}l=b||0<=g.indexOf(",")||0<=g.indexOf(";");p&&!l&&(l=!0,g+=",");m=b||g.startsWith("*")||g.endsWith("*")||l;s=null!=a;if(m&&(s||(a=new JU.Lst),!b&&(null==f?1==g.length:0==f.size()))){if(e==c.length){if(!s)return d;
a.addLast(d);return a}return this.extractProperty(d,c,e,a,!0)}g.contains("**")&&(g=JU.PT.rep(g,"**","*"));m&&!l&&(g+=",");if(h||b||g.contains(",")){p=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],p,b?a:null)}else for(g=f.size();0<=--g;)JV.PropertyManager.getMapSubset(d,f.get(g),p,b?a:null);if(h&&!s)return p;if(e==c.length){if(!b){if(!s)return p;a.addLast(p)}return a}return this.extractProperty(p,
c,e,s?a:null,!0)}g=this.checkMap(d,g,m,a,c,e,p);return null!=g&&!m?this.extractProperty(d.get(g),c,e,null,!0):!m?"":a}if(q(d,JU.Lst)){null==a&&(a=new JU.Lst);e--;for(f=0;f<d.size();f++)h=d.get(f),(q(h,java.util.Map)||q(h,JU.Lst)||q(h,JS.SV)&&(null!=h.getMap()||null!=h.getList()))&&this.extractProperty(h,c,e,a,!0);return a}}return b},"~O,~O,~N,JU.Lst,~B");c$.getMapSubset=j(c$,"getMapSubset",function(b,c,e,a){if(c.startsWith('"')||c.startsWith("'"))c=JU.PT.trim(c,"\"'");var d=b.get(c);if(null!=d)null==
a?e.put(c,d):a.addLast(d);else{var f;for(b=b.entrySet().iterator();b.hasNext()&&((f=b.next())||1);)d=f.getKey(),JU.PT.isLike(d,c)&&(null==a?e.put(d,f.getValue()):a.addLast(f.getValue()))}},"java.util.Map,~S,java.util.Map,JU.Lst");j(c$,"compileSelect",function(b){for(var c=null,e=b.length;0<=--e;)if(4==b[e].tok){var a=b[e].value,d=a.toUpperCase();if(d.startsWith("SELECT ")){null==c&&(c=JU.AU.arrayCopyObject(b,b.length));d=(a=a.substring(6).trim()).toUpperCase();if(d.startsWith("WHERE ")||d.startsWith("WHEREIN "))d=
(a="* "+a).toUpperCase();var f=d.indexOf(" WHEREIN "),g=0>f?"":0<=a.indexOf(";")?";**":",**";0>f&&(f=d.indexOf(" WHERE "));d=a.substring(0,0>f?a.length:f).trim();d.startsWith("(")&&d.endsWith(")")&&(d=d.substring(1,d.length-1)+";");0>f?c[e]=JS.SV.newV(1275082245,v(-1,[this.getKeys(d),null])):(d+=g,c[e]=JS.SV.newV(1275082245,v(-1,[this.getKeys(d),this.vwr.compileExpr(a.substring(f+6+g.length).trim())])));c[e].myName=d}}return null==c?b:c},"~A");j(c$,"getKeys",function(b){var c=new JU.Lst;b=JU.PT.rep(JU.PT.rep(b,
"**","*"),";",",")+",";for(var e=0,a=-1;0<=(a=b.indexOf(",",a+1));)if(a>e){var d=b.substring(e,a);if(d.equals("*")){if(0==c.size())break}else c.addLast(d),e=a+1}return c},"~S");j(c$,"checkMap",function(b,c,e,a,d,f,g){var h=null==a&&b.containsKey(c);if(!h)for(var p=c.contains(";"),l=p?JU.PT.split(c,";"):null,k=e&&!g?c.toLowerCase():null,r,m=b.keySet().iterator();m.hasNext()&&((r=m.next())||1);){if(p){for(var j=l.length;0<=--j;c=null)if(c=l[j],0!=c.length){if(g){if(!JU.PT.isLike(r,c))continue;break}k=
0<=c.indexOf("*")?c.toLowerCase():null;if(this.checkKey(r,c,k))break}if(null==c)continue}else if(g?!JU.PT.isLike(r,c):!this.checkKey(r,c,k))continue;if(null==a)return r;a.addLast(this.extractProperty(b.get(r),d,f,null,!0));if(!e&&!p)return null}return h?c:null},"java.util.Map,~S,~B,JU.Lst,~O,~N,~B");j(c$,"checkKey",function(b,c,e){return b.equalsIgnoreCase(c)||null!=e&&JU.PT.isLike(b.toLowerCase(),e)},"~S,~S,~S");c$.getPropertyName=j(c$,"getPropertyName",function(b){return 0>b?"":JV.PropertyManager.propertyTypes[3*
b]},"~N");c$.getParamType=j(c$,"getParamType",function(b){return 0>b?"":JV.PropertyManager.propertyTypes[3*b+1]},"~N");c$.isReadableAsString=j(c$,"isReadableAsString",function(b){for(var c=JV.PropertyManager.readableTypes.length;0<=--c;)if(b.equalsIgnoreCase(JV.PropertyManager.readableTypes[c]))return!0;return!1},"~S");j(c$,"getPropertyAsObject",function(b,c,e){if(b.equals("tokenList"))return JS.T.getTokensLike(c);var a=this.getPropertyNumber(b),d=null!=c&&0<c.toString().length;c=d?c:this.getDefaultPropertyParam(a);
switch(a){case 0:return this.getAppletInfo();case 5:return this.getAnimationInfo();case 14:return this.getAllAtomInfo(this.vwr.getAtomBitSet(c));case 24:return this.vwr.getAuxiliaryInfoForAtoms(c);case 15:return this.getAllBondInfo(c);case 25:return this.getBoundBoxInfo();case 10:return this.vwr.tm.fixedRotationCenter;case 16:return this.getAllChainInfo(this.vwr.getAtomBitSet(c));case 37:return this.vwr.getProperty("DATA_API","consoleText",null);case 26:return this.vwr.getDataObj(c.toString(),null,
-1);case 33:return this.vwr.getErrorMessageUn();case 28:return this.vwr.evaluateExpression(c.toString());case 20:return this.vwr.getModelExtract(c,!0,!1,"MOL");case 32:return JV.PropertyManager.getFileInfo(this.vwr.getFileData(),c.toString());case 1:return this.vwr.fm.getFullPathName(!1);case 2:return this.vwr.getFileHeader();case 4:case 3:return d?this.vwr.getFileAsString3(c.toString(),!0,null):this.vwr.getCurrentFileAsString("prop");case 27:return b=c.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,"getInfo");case 36:return this.vwr.getShapeProperty(24,"getData");case 40:return this.vwr.getNMRCalculation().getInfo(c.toString());case 41:return this.getVariables(c.toString());case 21:return this.vwr.getStatusChanged(c.toString());case 22:return this.vwr;case 38:return this.vwr.getJspecViewProperties(c);case 7:return this.getLigandInfo(this.vwr.getAtomBitSet(c));case 9:return this.getMeasurementInfo();
case 29:return this.vwr.getMenu(c.toString());case 23:return this.vwr.sm.messageQueue;case 30:return this.vwr.getMinimizationInfo();case 6:return this.getModelInfo(this.vwr.getAtomBitSet(c));case 18:return this.getMoleculeInfo(this.vwr.getAtomBitSet(c));case 34:return this.getMouseInfo();case 11:return this.vwr.tm.getOrientationInfo();case 31:return this.vwr.ms.getPointGroupInfo(this.vwr.getAtomBitSet(c));case 17:return this.getAllPolymerInfo(this.vwr.getAtomBitSet(c));case 39:return this.vwr.getScriptQueueInfo();
case 8:return this.getShapeInfo();case 19:return this.vwr.getStateInfo3(c.toString(),0,0);case 12:return JU.M3.newM3(this.vwr.tm.matrixRotate);case 42:return this.getAnnotationInfo(c,1073741925);case 43:return this.getAnnotationInfo(c,1073742189);case 44:return c=JS.SV.oValue(c),d=q(c,java.util.Map)?c:null,null==d?null:this.vwr.sm.processService(d)}e=Array(45);for(a=0;45>a;a++){d=JV.PropertyManager.getParamType(a);c=this.getDefaultPropertyParam(a);var f=JV.PropertyManager.getPropertyName(a);e[a]=
0==f.length||"X"==f.charAt(0)?"":f+(""!==d?" "+JV.PropertyManager.getParamType(a)+(""!==c?" #default: "+this.getDefaultPropertyParam(a):""):"")}java.util.Arrays.sort(e);d=new JU.SB;d.append("getProperty ERROR\n").append(b).append("?\nOptions include:\n");for(a=0;45>a;a++)0<e[a].length&&d.append("\n getProperty ").append(e[a]);return d.toString()},"~S,~O,~S");j(c$,"getImage",function(b,c){var e=-1,a=-1,d;if(0<=(d=b.indexOf("height=")))e=JU.PT.parseInt(b.substring(d+7));if(0<=(d=b.indexOf("width=")))a=
JU.PT.parseInt(b.substring(d+6));0>a&&0>e?e=a=-1:0>a?a=e:e=a;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(),a,e,-1,d);return null!=d[0]?d[0]:c?new JU.BArray(e):JU.Base64.getBase64(e).toString()},"~S,~B");j(c$,"getVariables",function(b){return b.toLowerCase().equals("all")?this.vwr.g.getAllVariables():this.vwr.evaluateExpressionAsVariable(b)},"~S");c$.getFileInfo=
j(c$,"getFileInfo",function(b,c){var e=new java.util.Hashtable;if(null==b)return e;var a=null!=c&&0<c.length;if(q(b,java.util.Map))return a?b.get(c):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;a&&(c=c.toUpperCase());for(var h="",p=0;p<d.length;p++){var l=d[p];if(!(12>l.length)){var h=l.substring(0,6).trim(),k=l.substring(7,10).trim();h.equals("REMARK")&&
(h+=k);if(!h.equals(f)){if(a&&f.equals(c))return g.toString();a||(e.put(f,g.toString()),g=new JU.SB);f=h}(!a||h.equals(c))&&g.append(l).appendC("\n")}}a||e.put(f,g.toString());return a?h.equals(c)?g.toString():"":e},"~O,~S");j(c$,"getMoleculeInfo",function(b){b=this.vwr.getAtomBitSet(b);for(var c=this.vwr.ms.getMolecules(),e=new JU.Lst,a=new JU.BS,d=0;d<c.length;d++){var a=JU.BSUtil.copy(b),f=c[d];a.and(f.atomList);0<a.length()&&(a=new java.util.Hashtable,a.put("mf",f.getMolecularFormula(!1,null,
!1)),a.put("number",Integer.$valueOf(f.moleculeIndex+1)),a.put("modelNumber",this.vwr.ms.getModelNumberDotted(f.modelIndex)),a.put("numberInModel",Integer.$valueOf(f.indexInModel+1)),a.put("nAtoms",Integer.$valueOf(f.ac)),a.put("nElements",Integer.$valueOf(f.nElements)),e.addLast(a))}return e},"~O");t(c$,"getModelInfo",function(b){b=this.vwr.ms.getModelBS(this.vwr.getAtomBitSet(b),!1);var c=this.vwr.ms,e=new java.util.Hashtable;e.put("modelSetName",c.modelSetName);e.put("modelIndex",Integer.$valueOf(this.vwr.am.cmi));
e.put("modelCount",Integer.$valueOf(c.mc));e.put("isTainted",Boolean.$valueOf(null!=c.tainted));e.put("canSkipLoad",Boolean.$valueOf(c.canSkipLoad));e.put("modelSetHasVibrationVectors",Boolean.$valueOf(c.modelSetHasVibrationVectors()));null!=c.modelSetProperties&&e.put("modelSetProperties",c.modelSetProperties);e.put("modelCountSelected",Integer.$valueOf(JU.BSUtil.cardinalityOf(b)));e.put("modelsSelected",b);var a=new JU.Lst;c.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(c.getModelNumber(d)));f.put("file_model",c.getModelNumberDotted(d));f.put("name",c.getModelName(d));var g=c.getModelTitle(d);null!=g&&f.put("title",g);g=c.getModelFileName(d);null!=g&&f.put("file",g);g=c.getInfo(d,"modelID");null!=g&&f.put("id",g);f.put("vibrationVectors",Boolean.$valueOf(this.vwr.modelHasVibrationVectors(d)));g=c.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(c.getChainCountInModelWater(d,!0)));null!=g.properties&&f.put("modelProperties",g.properties);var h=c.getInfo(d,"Energy");null!=h&&f.put("energy",h);f.put("atomCount",Integer.$valueOf(g.act));a.addLast(f)}e.put("models",a);return e},"~O");t(c$,"getLigandInfo",function(b){var c=
this.vwr.getAtomBitSet(b),e=this.vwr.getAtomBitSet("solvent");b=new java.util.Hashtable;var a=new JU.Lst;b.put("ligands",a);var d=this.vwr.ms,f=JU.BSUtil.copyInvert(c,d.ac);f.or(e);for(var e=d.at,g=c.nextSetBit(0);0<=g;g=c.nextSetBit(g+1))(e[g].group.isProtein()||e[g].group.isDna()||e[g].group.isRna())&&e[g].group.setAtomBitsAndClear(f,c);c=Array(d.mc);for(g=d.mc;0<=--g;)c[g]=this.vwr.getModelUndeletedAtomsBitSet(g),c[g].andNot(f);f=JU.JmolMolecule.getMolecules(e,c,null,f);for(g=0;g<f.length;g++){var c=
f[g].atomList,h=new java.util.Hashtable;a.addLast(h);h.put("atoms",JU.Escape.eBS(c));for(var p="",l="",k=null,r=0,m=null,j="",s="",n=2147483647,q=2147483647,w=c.nextSetBit(0);0<=w;w=c.nextSetBit(w+1)){var u=e[w];if(k!==u.group){var k=u.group,v=u.getResno(),t=u.getChainID();n!=v-1&&(0!=j.length&&n!=q&&(j+="-"+n),t=-1,q=v);s="/"+d.getModelNumberDotted(u.mi);0!=r&&t!=r&&(j+=":"+m+s);-1==t&&(j+=" "+v);n=v;r=u.getChainID();m=u.getChainIDStr();p+=l+u.getGroup3(!1);l="-"}}j+=(q==n?"":"-"+n)+(0==r?"":":"+
m)+s;h.put("groupNames",p);h.put("residueList",j.substring(1))}return b},"~O");t(c$,"getAtomData",function(b,c,e){b.startsWith("{")||(b="{"+b+"}");var a=c.toLowerCase().startsWith("user:"),d=c.toLowerCase().startsWith("property_");e&&(!a&&!d)&&(c=c.toUpperCase());a=d?"%{"+c+"}":a?c.substring(5):c.equals("xyzrn")?"%-2e %8.3x %8.3y %8.3z %4.2[vdw] 1 [%n]%r.%a#%i":c.equals("xyzvib")?"%-2e %10.5x %10.5y %10.5z %10.5vx %10.5vy %10.5vz":c.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':
c.equals("xyz")?"%-2e %10.5x %10.5y %10.5z":c.equals("cfi")?"print '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==a)return this.getModelExtract(this.vwr.getAtomBitSet(b),!1,!1,c.toUpperCase(),e);if(a.startsWith("print"))return this.vwr.runScript(a);0>a.indexOf("label")?a=b+'.label("'+a+'").lines':
b.equals("selected")||(a=JU.PT.rep(a,"selected",b.substring(1,b.length-1)));return this.vwr.evaluateExpression(a)},"~S,~S,~B");t(c$,"getModelExtract",function(b,c,e,a,d){if(a.equalsIgnoreCase("CML"))return this.getModelCml(b,2147483647,!0,c,d);if(a.equals("PDB")||a.equals("PQR"))return this.getPdbAtomData(b,null,a.equals("PQR"),c,d);var f=a.equalsIgnoreCase("V3000"),g=a.equalsIgnoreCase("SDF"),h=!c&&a.equalsIgnoreCase("XYZVIB"),p=a.equalsIgnoreCase("XYZRN"),l=a.toUpperCase().startsWith("XYZ"),k=a.equalsIgnoreCase("JSON")||
a.equalsIgnoreCase("CD");a=new JU.SB;var j=this.vwr.ms;if(!l&&!k){a.append(e?"Jmol Model Kit":this.vwr.fm.getFullPathName(!1).$replace("\\","/"));e=JV.Viewer.getJmolVersion();a.append("\n__Jmol-").append(e.substring(0,2));var m,q,s,n;n=new Date;e=n.getMonth();m=n.getDate();q=n.getFullYear();s=n.getHours();n=n.getMinutes();JU.PT.rightJustify(a,"_00",""+(1+e));JU.PT.rightJustify(a,"00",""+m);a.append((""+q).substring(2,4));JU.PT.rightJustify(a,"00",""+s);JU.PT.rightJustify(a,"00",""+n);a.append("3D 1   1.00000     0.00000     0");
a.append("\nJmol version ").append(JV.Viewer.getJmolVersion()).append(" EXTRACT: ").append(JU.Escape.eBS(b)).append("\n")}e=JU.BSUtil.copy(b);q=j.at;for(m=b.nextSetBit(0);0<=m;m=b.nextSetBit(m+1))c&&q[m].isDeleted()&&e.clear(m);n=JV.PropertyManager.getCovalentBondsForAtoms(j.bo,j.bondCount,e);if(!h&&0==e.cardinality())return"";b=!0;s=this.vwr.ms.getModelBS(e,!0);null!=j.trajectory&&!d&&j.trajectory.selectDisplayed(s);c=c?this.vwr.tm.getRotationQ():null;if(g){h=a.toString();a=new JU.SB;for(m=s.nextSetBit(0);0<=
m;m=s.nextSetBit(m+1)){a.append(h);f=JU.BSUtil.copy(e);f.and(j.getModelAtomBitSetIncludingDeleted(m,!1));n=JV.PropertyManager.getCovalentBondsForAtoms(j.bo,j.bondCount,f);if(!(b=this.addMolFile(m,a,f,n,!1,!1,c)))break;a.append("$$$$\n")}}else if(l){g=JM.LabelToken.compile(this.vwr,p?"%-2e _XYZ_ %4.2[vdw] 1 [%n]%r.%a#%i\n":"%-2e _XYZ_\n","\x00",null);p=h?JM.LabelToken.compile(this.vwr,"%-2e _XYZ_ %12.5vx %12.5vy %12.5vz\n","\x00",null):null;l=new JU.P3;for(m=s.nextSetBit(0);0<=m;m=s.nextSetBit(m+1))if(f=
JU.BSUtil.copy(e),f.and(j.getModelAtomBitSetIncludingDeleted(m,!1)),0!=f.cardinality()){a.appendI(f.cardinality()).appendC("\n");d=j.am[m].properties;a.append("Model["+(m+1)+"]: ");if(null!=j.frameTitles[m]&&0<j.frameTitles[m].length)a.append(j.frameTitles[m].$replace("\n"," "));else if(null==d)a.append("Jmol "+JV.Viewer.getJmolVersion());else{k=new JU.SB;n=d.propertyNames();for(var t=null;n.hasMoreElements();){var w=n.nextElement();w.equals(".PATH")?t=d.getProperty(w):k.append(";").append(w).append("=").append(d.getProperty(w))}null!=
t&&k.append(";PATH=").append(t);t=k.substring(0<k.length()?1:0);a.append(t.$replace("\n"," "))}a.appendC("\n");d=v(-1,[l]);for(k=f.nextSetBit(0);0<=k;k=f.nextSetBit(k+1))n=JM.LabelToken.formatLabelAtomArray(this.vwr,q[k],h&&null!=j.getVibration(k,!1)?p:g,"\x00",null,l),this.getPointTransf(m,j,q[k],c,l),n=JU.PT.rep(n,"_XYZ_",JU.PT.sprintf("%12.5p %12.5p %12.5p","p",d)),a.append(n)}}else b=this.addMolFile(-1,a,e,n,f,k,c);return b?a.toString():"ERROR: Too many atoms or bonds -- use V3000 format."},"JU.BS,~B,~B,~S,~B");
j(c$,"addMolFile",function(b,c,e,a,d,f,g){var h=e.cardinality(),p=a.cardinality();if(!d&&!f&&(999<h||999<p))return!1;var j=this.vwr.ms,k=N(j.ac,0),r=new JU.P3;d?c.append("  0  0  0  0  0  0            999 V3000"):f?c.append('{"mol":{"createdBy":"Jmol '+JV.Viewer.getJmolVersion()+'","a":['):(JU.PT.rightJustify(c,"   ",""+h),JU.PT.rightJustify(c,"   ",""+p),c.append("  0  0  0  0              1 V2000"));f||c.append("\n");d&&c.append("M  V30 BEGIN CTAB\nM  V30 COUNTS ").appendI(h).append(" ").appendI(p).append(" 0 0 0\n").append("M  V30 BEGIN ATOM\n");
for(var p=e.nextSetBit(0),m=0;0<=p;p=e.nextSetBit(p+1))this.getAtomRecordMOL(b,j,c,k[p]=++m,j.at[p],g,r,d,f);d?c.append("M  V30 END ATOM\nM  V30 BEGIN BOND\n"):f&&c.append('],"b":[');p=a.nextSetBit(0);for(m=0;0<=p;p=a.nextSetBit(p+1))this.getBondRecordMOL(c,++m,j.bo[p],k,d,f);d&&c.append("M  V30 END BOND\nM  V30 END CTAB\n");f?c.append("]}}"):c.append("M  END\n");if(!f&&!d&&(b=j.getPartialCharges(),null!=b)){c.append("> <JMOL_PARTIAL_CHARGES>\n").appendI(h).appendC("\n");p=e.nextSetBit(0);for(m=0;0<=
p;p=e.nextSetBit(p+1))c.appendI(++m).append(" ").appendF(b[p]).appendC("\n")}return!0},"~N,JU.SB,JU.BS,JU.BS,~B,~B,JU.Quat");c$.getCovalentBondsForAtoms=j(c$,"getCovalentBondsForAtoms",function(b,c,e){for(var a=new JU.BS,d=0;d<c;d++){var f=b[d];e.get(f.atom1.i)&&(e.get(f.atom2.i)&&f.isCovalent())&&a.set(d)}return a},"~A,~N,JU.BS");j(c$,"getAtomRecordMOL",function(b,c,e,a,d,f,g,h,j){this.getPointTransf(b,c,d,f,g);b=d.getElementNumber();c=d.isDeleted()?"Xx":JU.Elements.elementSymbolFromNumber(b);f=
d.getIsotopeNumber();var l=d.getFormalCharge();g=v(-1,[g]);h?(e.append("M  V30 ").appendI(a).append(" ").append(c).append(JU.PT.sprintf(" %12.5p %12.5p %12.5p 0","p",g)),0!=l&&e.append(" CHG=").appendI(l),0!=f&&e.append(" MASS=").appendI(f),e.append("\n")):j?(1!=a&&e.append(","),e.append("{"),6!=d.getElementNumber()&&e.append('"l":"').append(d.getElementSymbol()).append('",'),0!=l&&e.append('"c":').appendI(l).append(","),0!=f&&f!=JU.Elements.getNaturalIsotope(b)&&e.append('"m":').appendI(f).append(","),
e.append('"x":').appendF(d.x).append(',"y":').appendF(d.y).append(',"z":').appendF(d.z).append("}")):(e.append(JU.PT.sprintf("%10.5p%10.5p%10.5p","p",g)),e.append(" ").append(c),1==c.length&&e.append(" "),0<f&&(f-=JU.Elements.getNaturalIsotope(d.getElementNumber())),e.append(" "),JU.PT.rightJustify(e,"  ",""+f),JU.PT.rightJustify(e,"   ",""+(0==l?0:4-l)),e.append("  0  0  0  0\n"))},"~N,JM.ModelSet,JU.SB,~N,JM.Atom,JU.Quat,JU.P3,~B,~B");j(c$,"getPointTransf",function(b,c,e,a,d){c.isTrajectory(0<=
b?b:e.mi)?c.trajectory.getFractional(e,d):d.setT(e);null!=a&&a.transform2(d,d)},"~N,JM.ModelSet,JM.Atom,JU.Quat,JU.P3");j(c$,"getBondRecordMOL",function(b,c,e,a,d,f){var g=a[e.atom1.i];a=a[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?1:6;break;case 514:h=f?2:7;break;case 33:h=f?-1:8}d?b.append("M  V30 ").appendI(c).append(" ").appendI(h).append(" ").appendI(g).append(" ").appendI(a).appendC("\n"):f?(1!=c&&b.append(","),
b.append('{"b":').appendI(g-1).append(',"e":').appendI(a-1),1!=h&&(b.append(',"o":'),0>h?b.appendF(-h/2):b.appendI(h)),b.append("}")):(JU.PT.rightJustify(b,"   ",""+g),JU.PT.rightJustify(b,"   ",""+a),b.append("  ").appendI(h).append("  0  0  0\n"))},"JU.SB,~N,JM.Bond,~A,~B,~B");t(c$,"getChimeInfo",function(b,c){switch(b){case 1073741982:break;case 1073741864:return this.getBasePairInfo(c);default:return this.getChimeInfoA(this.vwr.ms.at,b,c)}var e=new JU.SB;this.vwr.getChimeMessenger().getAllChimeInfo(e);
return e.appendC("\n").toString().substring(1)},"~N,JU.BS");j(c$,"getChimeInfoA",function(b,c,e){var a=new JU.SB;a.append("\n");var d="",f=null,g=null,h=-1,j=0;if(null!=e)for(var l=e.nextSetBit(0);0<=l;l=e.nextSetBit(l+1)){var k=b[l];switch(c){default:return"";case 1113589787:d=k.getInfo();break;case 1140850689:d=""+k.getAtomNumber();break;case 1086324742:d=k.getGroup3(!1);break;case 1086324740:case 1073742120:case 1086324744:case 1086324743:var r=k.getChainID(),d=0==r?" ":k.getChainIDStr();300<=
r&&(d=JU.PT.esc(d));switch(c){case 1073742120:d="["+k.getGroup3(!1)+"]"+k.group.getSeqcodeString()+":"+d;break;case 1086324744:case 1086324743:k.mi!=h&&(a.appendC("\n"),j=0,h=k.mi,a.append("Model "+k.getModelNumber()),f=g=null);k.group.chain!==f&&(a.appendC("\n"),j=0,f=k.group.chain,a.append("Chain "+d+":\n"),g=null);d=k.group;d!==g&&(g=d,1086324743==c?a.append(k.getGroup1("?")):(0==j++%5&&1<j&&a.appendC("\n"),JU.PT.leftJustify(a,"          ","["+k.getGroup3(!1)+"]"+k.getResno()+" ")));continue}}0>
a.indexOf("\n"+d+"\n")&&a.append(d).appendC("\n")}1086324744==c&&a.appendC("\n");return a.toString().substring(1)},"~A,~N,JU.BS");t(c$,"getModelFileInfo",function(b){for(var c=this.vwr.ms,e=new JU.SB,a=0;a<c.mc;++a)if(null==b||b.get(a)){var d='["'+c.getModelNumberDotted(a)+'"] = ';e.append("\n\nfile").append(d).append(JU.PT.esc(c.getModelFileName(a)));var f=c.getInfo(a,"modelID");null!=f&&e.append("\nid").append(d).append(JU.PT.esc(f));e.append("\ntitle").append(d).append(JU.PT.esc(c.getModelTitle(a)));
e.append("\nname").append(d).append(JU.PT.esc(c.getModelName(a)));e.append("\ntype").append(d).append(JU.PT.esc(c.getModelFileType(a)))}return e.toString()},"JU.BS");j(c$,"getAllAtomInfo",function(b){for(var c=new JU.Lst,e=new JU.P3,a=b.nextSetBit(0);0<=a;a=b.nextSetBit(a+1))c.addLast(this.getAtomInfoLong(a,e));return c},"JU.BS");j(c$,"getAtomInfoLong",function(b,c){var e=this.vwr.ms,a=e.at[b],d=new java.util.Hashtable;e.getAtomIdentityInfo(b,d,c);d.put("element",e.getElementName(b));d.put("elemno",
Integer.$valueOf(e.at[b].getElementNumber()));d.put("x",Float.$valueOf(a.x));d.put("y",Float.$valueOf(a.y));d.put("z",Float.$valueOf(a.z));d.put("coord",JU.P3.newP(a));null!=e.vibrations&&null!=e.vibrations[b]&&e.vibrations[b].getInfo(d);d.put("bondCount",Integer.$valueOf(a.getCovalentBondCount()));d.put("radius",Float.$valueOf(a.getRasMolRadius()/120));d.put("model",a.getModelNumberForLabel());var f=a.atomPropertyString(this.vwr,1086324748);null!=f&&d.put("shape",f);d.put("visible",Boolean.$valueOf(a.checkVisible()));
d.put("clickabilityFlags",Integer.$valueOf(a.clickabilityFlags));d.put("visibilityFlags",Integer.$valueOf(a.shapeVisibilityFlags));d.put("spacefill",Float.$valueOf(a.getRadius()));f=JU.Escape.escapeColor(this.vwr.gdata.getColorArgbOrGray(a.colixAtom));null!=f&&d.put("color",f);d.put("colix",Integer.$valueOf(a.colixAtom));(f=JU.C.isColixTranslucent(a.colixAtom))&&d.put("translucent",Boolean.$valueOf(f));d.put("formalCharge",Integer.$valueOf(a.getFormalCharge()));d.put("partialCharge",Float.$valueOf(a.getPartialCharge()));
f=a.getSurfaceDistance100()/100;0<=f&&d.put("surfaceDistance",Float.$valueOf(f));if(e.am[a.mi].isBioModel){d.put("resname",a.getGroup3(!1));var f=a.group.getInsertionCode(),g=a.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",a.getChainIDStr());d.put("atomID",Integer.$valueOf(a.atomID));d.put("groupID",Integer.$valueOf(a.group.groupID));"\x00"!=a.altloc&&d.put("altLocation",""+a.altloc);d.put("structure",
Integer.$valueOf(a.group.getProteinStructureType().getId()));d.put("polymerLength",Integer.$valueOf(a.group.getBioPolymerLength()));d.put("occupancy",Integer.$valueOf(a.getOccupancy100()));e=a.getBfactor100();d.put("temp",Integer.$valueOf(H(e/100)))}return d},"~N,JU.P3");j(c$,"getAllBondInfo",function(b){var c=new JU.Lst,e=this.vwr.ms,a=e.bondCount,e=e.bo,d;q(b,String)&&(b=this.vwr.getAtomBitSet(b));var f=new JU.P3;if(q(b,Array)){d=b[0];var g=b[1];for(b=0;b<a;b++){var h=e[b].atom1.i,j=e[b].atom2.i;
(d.get(h)&&g.get(j)||g.get(h)&&d.get(j))&&c.addLast(this.getBondInfo(b,f))}}else if(q(b,JM.BondSet)){d=b;for(b=d.nextSetBit(0);0<=b&&b<a;b=d.nextSetBit(b+1))c.addLast(this.getBondInfo(b,f))}else if(q(b,JU.BS)){d=b;g=1==d.cardinality()?d.nextSetBit(0):-1;for(b=0;b<a;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))&&c.addLast(this.getBondInfo(b,f))}return c},"~O");j(c$,"getBondInfo",function(b,c){var e=this.vwr.ms.bo[b],a=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(a.i,g,c);var h=new java.util.Hashtable;this.vwr.ms.getAtomIdentityInfo(d.i,h,c);f.put("atom1",g);f.put("atom2",h);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(a.distance(d)));f.put("visible",Boolean.$valueOf(0!=e.shapeVisibilityFlags));
a=JU.Escape.escapeColor(this.vwr.gdata.getColorArgbOrGray(e.colix));null!=a&&f.put("color",a);f.put("colix",Integer.$valueOf(e.colix));JU.C.isColixTranslucent(e.colix)&&f.put("translucent",Boolean.TRUE);return f},"~N,JU.P3");j(c$,"getAllChainInfo",function(b){for(var c=new java.util.Hashtable,e=new JU.Lst,a=this.vwr.ms.mc,d=0;d<a;++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))}c.put("models",e);return c},
"JU.BS");j(c$,"getChainInfo",function(b,c){for(var e=this.vwr.ms.am[b],a=e.getChainCount(!0),d=new JU.Lst,f=new JU.P3,g=0;g<a;g++){for(var h=e.getChainAt(g),j=new JU.Lst,l=h.groupCount,k=new java.util.Hashtable,r=0;r<l;r++){var m=h.groups[r];c.get(m.firstAtomIndex)&&j.addLast(m.getGroupInfo(r,f))}j.isEmpty()||(k.put("residues",j),d.addLast(k))}return d},"~N,JU.BS");j(c$,"getAllPolymerInfo",function(b){var c=new java.util.Hashtable;null!=this.vwr.ms.bioModelset&&this.vwr.ms.bioModelset.getAllPolymerInfo(b,
c);return c},"JU.BS");j(c$,"getBasePairInfo",function(b){var c=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 a=e.get(b);JV.PropertyManager.getAtomResidueInfo(c,a.atom1);c.append(" - ");JV.PropertyManager.getAtomResidueInfo(c,a.atom2);c.append("\n")}return c.toString()},"JU.BS");c$.getAtomResidueInfo=j(c$,"getAtomResidueInfo",function(b,c){b.append("[").append(c.getGroup3(!1)).append("]").append(c.group.getSeqcodeString()).append(":");var e=
c.getChainID();b.append(0==e?" ":c.getChainIDStr())},"JU.SB,JM.Atom");j(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});j(c$,"getAnimationInfo",function(){var b=this.vwr.am,c=new java.util.Hashtable;c.put("firstModelIndex",Integer.$valueOf(b.firstFrameIndex));c.put("lastModelIndex",Integer.$valueOf(b.lastFrameIndex));c.put("animationDirection",Integer.$valueOf(b.animationDirection));c.put("currentDirection",Integer.$valueOf(b.currentDirection));c.put("displayModelIndex",
Integer.$valueOf(b.cmi));null!=b.animationFrames&&(c.put("isMovie",Boolean.TRUE),c.put("frames",JU.Escape.eAI(b.animationFrames)),c.put("currentAnimationFrame",Integer.$valueOf(b.caf)));c.put("displayModelNumber",this.vwr.getModelNumberDotted(b.cmi));c.put("displayModelName",0<=b.cmi?this.vwr.getModelName(b.cmi):"");c.put("animationFps",Integer.$valueOf(b.animationFps));c.put("animationReplayMode",JS.T.nameOf(b.animationReplayMode));c.put("firstFrameDelay",Float.$valueOf(b.firstFrameDelay));c.put("lastFrameDelay",
Float.$valueOf(b.lastFrameDelay));c.put("animationOn",Boolean.$valueOf(b.animationOn));c.put("animationPaused",Boolean.$valueOf(b.animationPaused));return c});j(c$,"getBoundBoxInfo",function(){var b=this.vwr.ms.getBoxInfo(null,1).getBoundBoxPoints(!0),c=new java.util.Hashtable;c.put("center",JU.P3.newP(b[0]));c.put("vector",JU.V3.newV(b[1]));c.put("corner0",JU.P3.newP(b[2]));c.put("corner1",JU.P3.newP(b[3]));return c});j(c$,"getShapeInfo",function(){var b=new java.util.Hashtable,c=new JU.SB,e=this.vwr.shm.shapes;
if(null!=e)for(var a=0;37>a;++a){var d=e[a];if(null!=d){var f=JV.JC.shapeClassBases[a],d=d.getShapeDetail();null!=d&&b.put(f,d)}}0<c.length()&&b.put("shapeCommands",c.toString());return b});j(c$,"getAnnotationInfo",function(b,c){var e=this.vwr.getAtomBitSet(b),e=this.vwr.ms.getModelBS(e,!1).nextSetBit(0);if(0>e)return null;var a=this.vwr.ms.getModelAuxiliaryInfo(e).get(1073741925==c?"domains":"validation");if(null==a||6!=a.tok)return null;this.vwr.getAnnotationParser(!1).initializeAnnotation(a,c,
e);return a.mapGet("_list")},"~O,~N");j(c$,"getMeasurementInfo",function(){return this.vwr.getShapeProperty(6,"info")});j(c$,"getMouseInfo",function(){if(!this.vwr.haveDisplay)return null;for(var b=new java.util.Hashtable,c=new JU.Lst,e=this.vwr.acm,a,d=e.b.getBindings().values().iterator();d.hasNext()&&((a=d.next())||1);)q(a,Boolean)||(JU.AU.isAI(a)&&(a=v(-1,[JV.binding.Binding.getMouseActionName(a[0],!1),JV.ActionManager.getActionName(a[1])])),c.addLast(a));b.put("bindings",c);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});t(c$,"getPdbAtomData",function(b,c,e,a){if(0==this.vwr.ms.ac||0>b.nextSetBit(0))return"";null==c?c=this.vwr.getOutputChannel(null,null):(e=(new Boolean(e|0<=c.getType().indexOf("PQR"))).valueOf(),a=(new Boolean(a|0<=c.getType().indexOf("-coord true"))).valueOf());var d=this.vwr.ms.at,f=this.vwr.ms.am,g=d[b.nextSetBit(0)].mi,
h=-1,j=!1,l="%6.2Q%6.2b          ";if(e){var l="%8.4P%7.4V       ",k=0;for(e=b.nextSetBit(0);0<=e;e=b.nextSetBit(e+1))k+=d[e].getPartialCharge();c.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: "+k+" e\nREMARK   6\n")}e=b.length()-1;var r=g!=d[e].mi,m=new JU.Lst,g=f[g].isPdbWithMultipleBonds,
q,s=new JU.P3,n=v(-1,[s]),t=a?this.vwr.tm.getRotationQ():null;for(e=b.nextSetBit(0);0<=e;e=b.nextSetBit(e+1))a=d[e],j=f[a.mi].isBioModel,r&&a.mi!=h&&(-1!=h&&c.append("ENDMDL\n"),h=a.mi,c.append("MODEL     "+(h+1)+"\n"),m=new JU.Lst),k=a.getAtomName(),q=2==a.getElementSymbol().length||4<=k.length||JU.PT.isDigit(k.charAt(0)),k=a.isHetero(),q=j?k?q?JM.LabelToken.compile(this.vwr,"HETATM%5.-5i %-4.4a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+l,"\x00",null):JM.LabelToken.compile(this.vwr,"HETATM%5.-5i  %-3.3a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+
l,"\x00",null):q?JM.LabelToken.compile(this.vwr,"ATOM  %5.-5i %-4.4a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+l,"\x00",null):JM.LabelToken.compile(this.vwr,"ATOM  %5.-5i  %-3.3a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+l,"\x00",null):q?JM.LabelToken.compile(this.vwr,"HETATM%5.-5i %-4.4a%1AUNK %1c   1%1E   _XYZ_"+l,"\x00",null):JM.LabelToken.compile(this.vwr,"HETATM%5.-5i  %-3.3a%1AUNK %1c   1%1E   _XYZ_"+l,"\x00",null),k=a.getElementSymbolIso(!1).toUpperCase(),k=this.pdbKey(a.group.getBioPolymerIndexInModel())+this.pdbKey(a.group.groupIndex)+
JM.LabelToken.formatLabelAtomArray(this.vwr,a,q,"\x00",null,s)+(1==k.length?" "+k:k.substring(0,2))+"  ",this.getPointTransf(-1,this.vwr.ms,a,t,s),a=JU.PT.sprintf("%8.3p%8.3p%8.3p","p",n),24<a.length&&(a=JU.PT.sprintf("%8.2p%8.2p%8.2p","p",n)),k=JU.PT.rep(k,"_XYZ_",a),m.addLast(k);f=new java.util.Hashtable;this.fixPDBFormat(m,f,c);if(r)c.append("ENDMDL\n");else for(e=b.nextSetBit(0);0<=e;e=b.nextSetBit(e+1))if(a=d[e],k=!j||a.isHetero(),h=!k&&16==a.getElementNumber(),k||g||h)if(l=a.bonds,null!=l)for(r=
0;r<l.length;r++)if(s=a.getAtomNumber(),n=l[r].getOtherAtom(a),b.get(n.i)&&(m=l[r].getCovalentOrder(),!(1==m&&(g&&!k&&!h||h&&16!=n.getElementNumber()))))switch(n=n.getAtomNumber(),m){case 2:case 3:if(n<s)continue;case 1:c.append("CONECT").append(JU.PT.formatStringS("%5s","s",""+f.get(Integer.$valueOf(s))));s=JU.PT.formatStringS("%5s","s",""+f.get(Integer.$valueOf(n)));for(n=0;n<m;n++)c.append(s);c.append("\n")}return c.toString()},"JU.BS,JU.OC,~B,~B,~B");j(c$,"pdbKey",function(b){b=0>b?"!999":"   "+
b;return b.substring(b.length-4)},"~N");j(c$,"fixPDBFormat",function(b,c,e){b.addLast("!999!999XXXXXX99999999999999999999!99!");var a=Array(b.size());b.toArray(a);java.util.Arrays.sort(a);b.clear();for(var d=0,f=a.length;d<f;d++)b.addLast(a[d]);for(var g=a=null,f=b.size(),d=0;d<f;d++){var h=b.get(d),j=h.substring(0,4),h=h.substring(8),l=!1,k=0<=h.indexOf("!99!");if(!j.equals(a)||k)null!=a&&!a.equals("!999")&&(l=!0,h="TER   "+g.substring(6,11)+"      "+g.substring(17,27),b.add(d,j+"!!!!"+h),f++),a=
j;if(k&&!l)break;g=h;null!=c&&!l&&c.put(Integer.$valueOf(JU.PT.parseInt(h.substring(6,11))),Integer.$valueOf(d+1));j="     "+(d+1);e.append(h.substring(0,6)).append(j.substring(j.length-5)).append(h.substring(11)).append("\n")}},"JU.Lst,java.util.Map,JU.OC");t(c$,"getPdbData",function(b,c,e,a,d,f){this.vwr.ms.isJmolDataFrameForModel(b)&&(b=this.vwr.ms.getJmolDataSourceFrame(b));if(0>b)return"";var g=this.vwr.ms.am[b],h=g.isBioModel;if(null==a&&!h)return null;null==d&&(d=this.vwr.getOutputChannel(null,
null));var j=new JU.SB,l=0<=c.indexOf("draw"),k=null,r=new JU.BS,m="\x00",q=this.vwr.ms.getLabeler().compile(this.vwr,"ATOM  %-6i%4a%1A%3.-3n %1c%4R%1E   ","\x00",null);if(null==a)m=11<c.length&&0<=c.indexOf("quaternion ")?c.charAt(11):"R",g.getPdbData(c,m,l,e,d,q,j,r),k=this.vwr.getModelUndeletedAtomsBitSet(b);else{k=a[0];b=a[1];var g=a[2],s=a[3],n=null!=g,t=null!=s,w=a[4],u=a[5],z=a[6],C=a[7],A=a[8],B=a[9];a=null!=z&&null==A;var D=this.vwr.ms.at;if(a){d.append("REMARK   6 Jmol PDB-encoded data: ").append(c).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(w)).append(" max = ").append(JU.Escape.eP(u)).append(" unScaledXyz = xyz * ").append(JU.Escape.eP(z)).append(" + ").append(JU.Escape.eP(C)).append(";\n");u=null;for(c=k.nextSetBit(0);0<=c;c=k.nextSetBit(c+1))if(w=""+D[c].getAtomName(),null!=u||4<w.length)null==u?(u="",c=-1):u+=" "+w;null!=u&&d.append("REMARK   6 Jmol atom names").append(u).append("\n");u=null;for(c=k.nextSetBit(0);0<=c;c=k.nextSetBit(c+1))if(w=""+D[c].getGroup3(!0),
null!=u||3<w.length)null==u?(u="",c=-1):u+=" "+w;null!=u&&d.append("REMARK   6 Jmol residue names").append(u).append("\n");for(c=0;c<B.length;c++)null!=B[c]&&d.append("REMARK   6 Jmol property ").append(B[c]).append(";\n")}B=null;w=new JU.P3;a||(null==A&&(A="%-5i %-10s %-13.5f "+(t?"%-13.5f %-13.5f":n?"%-13.5f":"")),A+="\n");c=k.nextSetBit(0);for(u=0;0<=c;c=k.nextSetBit(c+1),u++){var z=b[u],C=n?g[u]:0,E=t?s[u]:0;if(!Float.isNaN(z)&&!Float.isNaN(C)&&!Float.isNaN(E)){var y=D[c];a?(d.append(JM.LabelToken.formatLabelAtomArray(this.vwr,
y,q,"\x00",null,w)),h&&r.set(c),d.append(JU.PT.sprintf("%-8.2f%-8.2f%-10.2f    %6.3f          %2s    %s\n","ssF",v(-1,[y.getElementSymbolIso(!1).toUpperCase(),"",x(-1,[z,C,E,0])]))),null!=B&&B.group.getBioPolymerIndexInModel()==y.group.getBioPolymerIndexInModel()&&j.append("CONECT").append(JU.PT.formatStringI("%5i","i",B.getAtomNumber())).append(JU.PT.formatStringI("%5i","i",y.getAtomNumber())).appendC("\n")):t?d.append(JU.PT.sprintf(A,"isF",v(-1,[Integer.$valueOf(y.getAtomNumber()),y.getAtomName(),
x(-1,[z,C,E])]))):n?d.append(JU.PT.sprintf(A,"isF",v(-1,[Integer.$valueOf(y.getAtomNumber()),y.getAtomName(),x(-1,[z,C])]))):d.append(JU.PT.sprintf(A,"isF",v(-1,[Integer.$valueOf(y.getAtomNumber()),y.getAtomName(),x(-1,[z])])));B=y}}}d.append(j.toString());if(l)return d.toString();e.and(k);h&&f&&d.append("\n\n"+this.vwr.ms.getProteinStructureState(r,"R"==m?4138:1073742086));return d.toString()},"~N,~S,JU.BS,~A,JU.OC,~B");t(c$,"getModelCml",function(b,c,e){var a=new JU.SB;if(0==JU.BSUtil.cardinalityOf(b))return"";
J.api.Interface.getInterface("JU.XmlUtil",this.vwr,"file");JU.XmlUtil.openTag(a,"molecule");JU.XmlUtil.openTag(a,"atomArray");for(var d=new JU.BS,f=this.vwr.ms.at,g=b.nextSetBit(0);0<=g&&!(0>--c);g=b.nextSetBit(g+1)){var h=f[g],j=h.getAtomName();JU.PT.rep(j,'"',"''");d.set(h.i);JU.XmlUtil.appendTag(a,"atom/",v(-1,["id","a"+(h.i+1),"title",h.getAtomName(),"elementType",h.getElementSymbol(),"x3",""+h.x,"y3",""+h.y,"z3",""+h.z]))}JU.XmlUtil.closeTag(a,"atomArray");if(e){JU.XmlUtil.openTag(a,"bondArray");
b=this.vwr.ms.bondCount;c=this.vwr.ms.bo;for(g=0;g<b;g++)e=c[g],f=e.atom2,d.get(e.atom1.i)&&d.get(f.i)&&(f=JU.Edge.getCmlBondOrder(e.order),null!=f&&JU.XmlUtil.appendTag(a,"bond/",v(-1,["atomRefs2","a"+(e.atom1.i+1)+" a"+(e.atom2.i+1),"order",f])));JU.XmlUtil.closeTag(a,"bondArray")}JU.XmlUtil.closeTag(a,"molecule");return a.toString()},"JU.BS,~N,~B,~B,~B");G(c$,"atomExpression","<atom selection>");c$.propertyTypes=c$.prototype.propertyTypes=v(-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>;".split(";"));
G(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_COUNT",45,"readableTypes",v(-1," stateinfo extractmodel filecontents fileheader image menu minimizationInfo".split(" ")))})})(Clazz,
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.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);
