text: (window.webpackJsonpdash_bio=window.webpackJsonpdash_bio||[]).push([[6],{43:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return d}));var n=r(1),i=r.n(n),o=r(438),a=r.n(o),s=r(17);function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var d=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=function(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?h(e):t}(this,f(t).call(this,e))).onChangeSelection=r.onChangeSelection.bind(h(r)),r.onRenderNewData=r.onRenderNewData.bind(h(r)),r}var r,n,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,e),r=t,(n=[{key:"onChangeSelection",value:function(e){this.props.setProps({selectedAtomIds:e})}},{key:"onRenderNewData",value:function(e){this.glviewer=e,e.zoomTo(this.props.zoomTo.sel,this.props.zoomTo.animationDuration,this.props.zoomTo.fixedPath),e.zoom(this.props.zoom.factor,this.props.zoom.animationDuration,this.props.zoom.fixedPath)}},{key:"shouldComponentUpdate",value:function(e){var t=this;return!!(this.props.modelData!==e.modelData||this.props.backgroundColor!==e.backgroundColor||this.props.backgroundOpacity!==e.backgroundOpacity||this.props.styles!==e.styles||this.props.selectionType!==e.selectionType||this.props.orbital!==e.orbital||this.props.shapes!==e.shapes||this.props.labels!==e.labels||this.props.zoom!==e.zoom||this.props.zoomTo!==e.zoomTo||!this.props.selectedAtomIds&&e.selectedAtomIds||this.props.selectedAtomIds&&!e.selectedAtomIds||this.props.selectedAtomIds&&e.selectedAtomIds&&this.props.selectedAtomIds.length!==e.selectedAtomIds.length||this.props.selectedAtomIds&&e.selectedAtomIds&&(this.props.selectedAtomIds.some((function(t){return!(t in e.selectedAtomIds)}))||e.selectedAtomIds.some((function(e){return!(e in t.props.selectedAtomIds)}))))}},{key:"componentDidUpdate",value:function(e){this.props.zoom===e.zoom&&this.props.zoomTo===e.zoomTo||!this.glviewer||(this.glviewer.zoomTo(this.props.zoomTo.sel,this.props.zoomTo.animationDuration,this.props.zoomTo.fixedPath),this.glviewer.zoom(this.props.zoom.factor,this.props.zoom.animationDuration,this.props.zoom.fixedPath))}},{key:"render",value:function(){var e=this.props,t=e.id,r=e.selectionType,n=null===r?null:r.charAt(0).toUpperCase()+r.slice(1);return i.a.createElement("div",{id:t},i.a.createElement(a.a,u({},this.props,{selectionType:n,onChangeSelection:this.onChangeSelection,onRenderNewData:this.onRenderNewData})))}}])&&c(r.prototype,n),o&&c(r,o),t}(n.Component);d.defaultProps=s.b,d.propTypes=s.c},438:function(e,t,r){e.exports=function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="/js/",t(0)}([function(e,t,r){e.exports=r(4)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={ATOM:"Atom",RESIDUE:"Residue",CHAIN:"Chain"}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(r(9)),s=n(r(11)),l=n(r(10)),u=n(r(5)),c=n(r(6)),f=n(r(1));window.$=a.default;var h=r(7),p=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.onClickAtom=function(e){var t=r.props.modelData.atoms,n=t[e.serial],i=r.props.selectionType,o=c.default.addSelection(t,r.state.selectedAtomIds,n,i);r.setState({selectedAtomIds:o}),r.props.onChangeSelection&&r.props.onChangeSelection(o)},r.state={selectedAtomIds:e.selectedAtomIds},r.lastOutline={width:0},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,null,[{key:"isModelDataEmpty",value:function(e){return 0===e.atoms.length&&0===e.bonds.length}},{key:"render3dMolModel",value:function(e,r){e.clear(),t.isModelDataEmpty(r)||(e.addModel(c.default.modelDataToCDJSON(r),"json",{keepH:!0}),e.getModel().selectedAtoms().forEach((function(e){var t=e,n=(r.atoms[e.serial].residue_name||"").replace(/[0-9]+/,"");t.atom=r.atoms[e.serial].name,t.chain=r.atoms[e.serial].chain,t.resi=r.atoms[e.serial].residue_index,t.resn=n})))}},{key:"render3dMolShapes",value:function(e,t){e.removeAllShapes(),t.forEach((function(t){t.type&&e["add"+t.type](u.default.getShapeSpec(t))}))}},{key:"render3dMolLabels",value:function(e,t){e.removeAllLabels(),t.forEach((function(t){e.addLabel(t.text,t)}))}},{key:"render3dMolOrbital",value:function(e,t){if(t.cube_file){var r=new h.VolumeData(t.cube_file,"cube");e.addIsosurface(r,{isoval:t.iso_val,color:t.positiveVolumetricColor||16711680,opacity:t.opacity||.8}),e.addIsosurface(r,{isoval:-t.iso_val,color:t.negativeVolumetricColor||255,opacity:t.opacity||.8})}}}]),o(t,[{key:"componentDidMount",value:function(){this.render3dMol()}},{key:"componentWillReceiveProps",value:function(e){this.setState({selectedAtomIds:e.selectedAtomIds})}},{key:"componentDidUpdate",value:function(){this.render3dMol()}},{key:"render3dMol",value:function(){var e=this;if(this.glviewer||!t.isModelDataEmpty(this.props.modelData)){var r=this.glviewer||h.createViewer((0,a.default)(this.container),{defaultcolors:h.elementColors.rasmol}),n=c.default.modelDataEquivalent(this.oldModelData,this.props.modelData);n||(this.lastStylesByAtom=null,t.render3dMolModel(r,this.props.modelData)),this.props.outlineWidth===this.lastOutline.width&&this.props.outlineColor===this.lastOutline.color||(this.props.outlineWidth?this.lastOutline={style:"outline",width:this.props.outlineWidth,color:this.props.outlineColor}:this.lastOutline={},r.setViewStyle(this.lastOutline));var o=Object.create(null),s=Object.create(null);this.props.modelData.atoms.forEach((function(t,n){var i=-1!==e.state.selectedAtomIds.indexOf(t.serial),a=u.default.getLibStyle(t,i,e.props.atomLabelsShown,e.props.styles[n]);e.props.atomLabelsShown&&r.addLabel(t.name,{fontSize:14,position:{x:t.positions[0],y:t.positions[1],z:t.positions[2]}});var l=JSON.stringify(a);s[t.serial]=l,e.lastStylesByAtom&&e.lastStylesByAtom[t.serial]===l||(o[l]||(o[l]=[]),o[l].push(t.serial))})),this.lastStylesByAtom=s,Object.entries(o).forEach((function(e){var t=i(e,2),n=t[0],o=t[1];r.setStyle({serial:o},JSON.parse(n))})),t.render3dMolShapes(r,this.props.shapes),t.render3dMolLabels(r,this.props.labels),t.render3dMolOrbital(r,this.props.orbital);var l=!1;if("number"==typeof this.props.nearClip&&"number"==typeof this.props.farClip&&(r.setSlab(this.props.nearClip,this.props.farClip),l=!0),r.setBackgroundColor(u.default.colorStringToNumber(this.props.backgroundColor),this.props.backgroundOpacity),r.setClickable({},!0,this.onClickAtom),r.render(),this.oldModelData||(r.zoom(),r.zoomTo(.8)),n||(l||r.fitSlab(),this.props.onRenderNewData(r)),!this.glviewer)var f=this,p=setInterval((function(){f.container.children.length>0&&f.container.children[0].offsetParent&&(r.resize(),clearInterval(p))}),50);this.oldModelData=this.props.modelData,this.glviewer=r}}},{key:"render",value:function(){var e=this;return s.default.createElement("div",{className:"molecule-3d",style:{width:this.props.width,height:this.props.height,position:"relative",margin:"0 auto"},ref:function(t){e.container=t}})}}]),t}(s.default.Component);p.defaultProps={atomLabelsShown:!1,backgroundOpacity:1,backgroundColor:"#73757c",height:"500px",onRenderNewData:function(){},orbital:{},selectedAtomIds:[],selectionType:f.default.ATOM,shapes:[],labels:[],styles:{},width:"500px",outlineWidth:0,outlineColor:"#000000",nearClip:null,farClip:null},p.propTypes={atomLabelsShown:l.default.bool,backgroundColor:l.default.string,backgroundOpacity:l.default.number,height:l.default.string,modelData:l.default.shape({atoms:l.default.array,bonds:l.default.array}).isRequired,onChangeSelection:l.default.func,onRenderNewData:l.default.func,orbital:l.default.shape({cube_file:l.default.string,iso_val:l.default.number,opacity:l.default.number,positiveVolumetricColor:l.default.string,negativeVolumetricColor:l.default.string}),selectedAtomIds:l.default.arrayOf(l.default.number),selectionType:l.default.oneOf([f.default.ATOM,f.default.RESIDUE,f.default.CHAIN]),shapes:l.default.arrayOf(l.default.object),labels:l.default.arrayOf(l.default.object),styles:l.default.objectOf(l.default.object),width:l.default.string,nearClip:l.default.number,farClip:l.default.number,outlineWidth:l.default.number,outlineColor:l.default.string},t.default=p},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={ARROW:"Arrow",SPHERE:"Sphere",CYLINDER:"Cylinder"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e&&e.__esModule?e:{default:e}}(r(2));t.default=n.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(e){return e&&e.__esModule?e:{default:e}}(r(3)),o="stick",a={colorStringToNumber:function(e){if(4!==e.length&&7!==e.length)return e;if("#"!==e[0])return e;var t=parseInt(e.substr(1,e.length-1),16);return isNaN(t)?e:t},getShapeSpec:function(e,t){var r=void 0;e.color&&(r=a.colorStringToNumber(e.color));var n=Object.assign({},{alpha:.8,callback:t,clickable:!1,color:65027,radius:e.radius},e,{color:r});if(e.type===i.default.ARROW)n.start=e.start,n.end=e.end;else if(e.type===i.default.SPHERE)n.center=e.center;else{if(e.type!==i.default.CYLINDER)throw new Error("Invalid shape type.");n.fromCap=!0,n.toCap=!0,n.start=e.start,n.end=e.end}return n},getLibStyle:function(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s={},l=i.visualization_type||o;return s[l]={},Object.entries(i).forEach((function(e){var t=n(e,2),r=t[0],i=t[1];"visualization_type"!==r&&(s[l][r]=i)})),t&&(s[l].color=2094078),"string"==typeof s[l].color&&(s[l].color=a.colorStringToNumber(s[l].color)),s}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8),i=function(e){return e&&e.__esModule?e:{default:e}}(r(1)),o={modelDataToCDJSON:function(e){return{m:[{a:e.atoms.map((function(e){return{l:e.elem,x:e.positions[0],y:e.positions[1],z:e.positions[2],mass:e.mass_magnitude}})),b:e.bonds.map((function(e){return{b:e.atom1_index,e:e.atom2_index,o:e.bond_order}}))}]}},addSelection:function(e,t,r,n){var a=t.slice(),s=t.indexOf(r.serial),l=-1===s;return n===i.default.ATOM?(l?a.push(r.serial):a.splice(s,1),a):(l?e.forEach((function(e){o.isSameGroup(r,e,n)&&a.push(e.serial)})):a=a.filter((function(t){var i=e[t];return!o.isSameGroup(r,i,n)})),a)},isSameGroup:function(e,t,r){if(r===i.default.RESIDUE)return e.residue_index===t.residue_index;if(r===i.default.CHAIN)return e.chain===t.chain;throw new Error("selectionType must be either residue or chain")},modelDataEquivalent:function(e,t){if(!e||!t)return!1;var r=new n.Set(e.atoms.map((function(e){return e.serial}))),i=new n.Set(t.atoms.map((function(e){return e.serial}))),o=new n.Set(e.bonds.map((function(e){return e.atom1_index+"=>"+e.atom2_index}))),a=new n.Set(t.bonds.map((function(e){return e.atom1_index+"=>"+e.atom2_index}))),s=r.equals(i),l=o.equals(a);if(!s||!l)return!1;var u=new Map,c=!0,f=!1,h=void 0;try{for(var p,d=e.atoms[Symbol.iterator]();!(c=(p=d.next()).done);c=!0){var m=p.value;u.set(m.serial,m.positions||[])}}catch(e){f=!0,h=e}finally{try{!c&&d.return&&d.return()}finally{if(f)throw h}}return t.atoms.every((function(e){return u.get(e.serial).every((function(t,r){return(e.positions||[])[r]===t}))}))}};t.default=o},function(e,t){e.exports=r(439)},function(e,t){e.exports=r(440)},function(e,t){e.exports=r(441)},function(e,t){e.exports=r(0)},function(e,t){e.exports=r(1)}])},439:function(module,exports,__webpack_require__){(function(module){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,__WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,require,require,__WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,t,e;function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t){"use strict";"object"==_typeof(module)&&"object"==_typeof(module.exports)?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){"use strict";var r=[],n=e.document,i=Object.getPrototypeOf,o=r.slice,a=r.concat,s=r.push,l=r.indexOf,u={},c=u.toString,f=u.hasOwnProperty,h=f.toString,p=h.call(Object),d={};function m(e,t){var r=(t=t||n).createElement("script");r.text=e,t.head.appendChild(r).parentNode.removeChild(r)}var v=function e(t,r){return new e.fn.init(t,r)},g=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,y=/^-ms-/,b=/-([a-z])/g,x=function(e,t){return t.toUpperCase()};function w(e){var t=!!e&&"length"in e&&e.length,r=v.type(e);return"function"!==r&&!v.isWindow(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}v.fn=v.prototype={jquery:"3.2.1",constructor:v,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=v.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return v.each(this,e)},map:function(e){return this.pushStack(v.map(this,(function(t,r){return e.call(t,r,t)})))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,r=+e+(e<0?t:0);return this.pushStack(r>=0&&r<t?[this[r]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:r.sort,splice:r.splice},v.extend=v.fn.extend=function(){var e,t,r,n,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==_typeof(a)||v.isFunction(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)r=a[t],a!==(n=e[t])&&(u&&n&&(v.isPlainObject(n)||(i=Array.isArray(n)))?(i?(i=!1,o=r&&Array.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},a[t]=v.extend(u,o,n)):void 0!==n&&(a[t]=n));return a},v.extend({expando:"jQuery"+("3.2.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===v.type(e)},isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=v.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},isPlainObject:function(e){var t,r;return!(!e||"[object Object]"!==c.call(e)||(t=i(e))&&("function"!=typeof(r=f.call(t,"constructor")&&t.constructor)||h.call(r)!==p))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==_typeof(e)||"function"==typeof e?u[c.call(e)]||"object":_typeof(e)},globalEval:function(e){m(e)},camelCase:function(e){return e.replace(y,"ms-").replace(b,x)},each:function(e,t){var r,n=0;if(w(e))for(r=e.length;n<r&&!1!==t.call(e[n],n,e[n]);n++);else for(n in e)if(!1===t.call(e[n],n,e[n]))break;return e},trim:function(e){return null==e?"":(e+"").replace(g,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(w(Object(e))?v.merge(r,"string"==typeof e?[e]:e):s.call(r,e)),r},inArray:function(e,t,r){return null==t?-1:l.call(t,e,r)},merge:function(e,t){for(var r=+t.length,n=0,i=e.length;n<r;n++)e[i++]=t[n];return e.length=i,e},grep:function(e,t,r){for(var n=[],i=0,o=e.length,a=!r;i<o;i++)!t(e[i],i)!==a&&n.push(e[i]);return n},map:function(e,t,r){var n,i,o=0,s=[];if(w(e))for(n=e.length;o<n;o++)null!=(i=t(e[o],o,r))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,r))&&s.push(i);return a.apply([],s)},guid:1,proxy:function(e,t){var r,n,i;if("string"==typeof t&&(r=e[t],t=e,e=r),v.isFunction(e))return n=o.call(arguments,2),(i=function(){return e.apply(t||this,n.concat(o.call(arguments)))}).guid=e.guid=e.guid||v.guid++,i},now:Date.now,support:d}),"function"==typeof Symbol&&(v.fn[Symbol.iterator]=r[Symbol.iterator]),v.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){u["[object "+t+"]"]=t.toLowerCase()}));var _=function(e){var t,r,n,i,o,a,s,l,u,c,f,h,p,d,m,v,g,y,b,x="sizzle"+1*new Date,w=e.document,_=0,D=0,A=ae(),C=ae(),S=ae(),E=function(e,t){return e===t&&(f=!0),0},T={}.hasOwnProperty,M=[],$=M.pop,z=M.push,L=M.push,k=M.slice,I=function(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",O="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",N="\\["+O+"*("+F+")(?:"+O+"*([*^$|!~]?=)"+O+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+O+"*\\]",P=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",j=new RegExp(O+"+","g"),B=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),U=new RegExp("^"+O+"*,"+O+"*"),V=new RegExp("^"+O+"*([>+~]|"+O+")"+O+"*"),q=new RegExp("="+O+"*([^\\]'\"]*?)"+O+"*\\]","g"),G=new RegExp(P),H=new RegExp("^"+F+"$"),W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+O+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/[+~]/,J=new RegExp("\\\\([\\da-f]{1,6}"+O+"?|("+O+")|.)","ig"),ee=function(e,t,r){var n="0x"+t-65536;return n!=n||r?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ne=function(){h()},ie=ye((function(e){return!0===e.disabled&&("form"in e||"label"in e)}),{dir:"parentNode",next:"legend"});try{L.apply(M=k.call(w.childNodes),w.childNodes),M[w.childNodes.length].nodeType}catch(e){L={apply:M.length?function(e,t){z.apply(e,k.call(t))}:function(e,t){for(var r=e.length,n=0;e[r++]=t[n++];);e.length=r-1}}}function oe(e,t,n,i){var o,s,u,c,f,d,g,y=t&&t.ownerDocument,_=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==_&&9!==_&&11!==_)return n;if(!i&&((t?t.ownerDocument||t:w)!==p&&h(t),t=t||p,m)){if(11!==_&&(f=Z.exec(e)))if(o=f[1]){if(9===_){if(!(u=t.getElementById(o)))return n;if(u.id===o)return n.push(u),n}else if(y&&(u=y.getElementById(o))&&b(t,u)&&u.id===o)return n.push(u),n}else{if(f[2])return L.apply(n,t.getElementsByTagName(e)),n;if((o=f[3])&&r.getElementsByClassName&&t.getElementsByClassName)return L.apply(n,t.getElementsByClassName(o)),n}if(r.qsa&&!S[e+" "]&&(!v||!v.test(e))){if(1!==_)y=t,g=e;else if("object"!==t.nodeName.toLowerCase()){for((c=t.getAttribute("id"))?c=c.replace(te,re):t.setAttribute("id",c=x),s=(d=a(e)).length;s--;)d[s]="#"+c+" "+ge(d[s]);g=d.join(","),y=Q.test(e)&&me(t.parentNode)||t}if(g)try{return L.apply(n,y.querySelectorAll(g)),n}catch(e){}finally{c===x&&t.removeAttribute("id")}}}return l(e.replace(B,"$1"),t,n,i)}function ae(){var e=[];return function t(r,i){return e.push(r+" ")>n.cacheLength&&delete t[e.shift()],t[r+" "]=i}}function se(e){return e[x]=!0,e}function le(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ue(e,t){for(var r=e.split("|"),i=r.length;i--;)n.attrHandle[r[i]]=t}function ce(e,t){var r=t&&e,n=r&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(n)return n;if(r)for(;r=r.nextSibling;)if(r===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function he(e){return function(t){var r=t.nodeName.toLowerCase();return("input"===r||"button"===r)&&t.type===e}}function pe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function de(e){return se((function(t){return t=+t,se((function(r,n){for(var i,o=e([],r.length,t),a=o.length;a--;)r[i=o[a]]&&(r[i]=!(n[i]=r[i]))}))}))}function me(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in r=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},h=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==p&&9===a.nodeType&&a.documentElement?(d=(p=a).documentElement,m=!o(p),w!==p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ne,!1):i.attachEvent&&i.attachEvent("onunload",ne)),r.attributes=le((function(e){return e.className="i",!e.getAttribute("className")})),r.getElementsByTagName=le((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),r.getElementsByClassName=K.test(p.getElementsByClassName),r.getById=le((function(e){return d.appendChild(e).id=x,!p.getElementsByName||!p.getElementsByName(x).length})),r.getById?(n.filter.ID=function(e){var t=e.replace(J,ee);return function(e){return e.getAttribute("id")===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var r=t.getElementById(e);return r?[r]:[]}}):(n.filter.ID=function(e){var t=e.replace(J,ee);return function(e){var r=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return r&&r.value===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var r,n,i,o=t.getElementById(e);if(o){if((r=o.getAttributeNode("id"))&&r.value===e)return[o];for(i=t.getElementsByName(e),n=0;o=i[n++];)if((r=o.getAttributeNode("id"))&&r.value===e)return[o]}return[]}}),n.find.TAG=r.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):r.qsa?t.querySelectorAll(e):void 0}:function(e,t){var r,n=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;r=o[i++];)1===r.nodeType&&n.push(r);return n}return o},n.find.CLASS=r.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},g=[],v=[],(r.qsa=K.test(p.querySelectorAll))&&(le((function(e){d.appendChild(e).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+O+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+O+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+x+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||v.push(".#.+[+~]")})),le((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+O+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),d.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")}))),(r.matchesSelector=K.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&le((function(e){r.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",P)})),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),t=K.test(d.compareDocumentPosition),b=t||K.test(d.contains)?function(e,t){var r=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(r.contains?r.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},E=t?function(e,t){if(e===t)return f=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!r.sortDetached&&t.compareDocumentPosition(e)===n?e===p||e.ownerDocument===w&&b(w,e)?-1:t===p||t.ownerDocument===w&&b(w,t)?1:c?I(c,e)-I(c,t):0:4&n?-1:1)}:function(e,t){if(e===t)return f=!0,0;var r,n=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===p?-1:t===p?1:i?-1:o?1:c?I(c,e)-I(c,t):0;if(i===o)return ce(e,t);for(r=e;r=r.parentNode;)a.unshift(r);for(r=t;r=r.parentNode;)s.unshift(r);for(;a[n]===s[n];)n++;return n?ce(a[n],s[n]):a[n]===w?-1:s[n]===w?1:0},p):p},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&h(e),t=t.replace(q,"='$1']"),r.matchesSelector&&m&&!S[t+" "]&&(!g||!g.test(t))&&(!v||!v.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return oe(t,p,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),b(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==p&&h(e);var i=n.attrHandle[t.toLowerCase()],o=i&&T.call(n.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:r.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,re)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,n=[],i=0,o=0;if(f=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(E),f){for(;t=e[o++];)t===e[o]&&(i=n.push(o));for(;i--;)e.splice(n[i],1)}return c=null,e},i=oe.getText=function(e){var t,r="",n=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)r+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[n++];)r+=i(t);return r},(n=oe.selectors={cacheLength:50,createPseudo:se,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(J,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(J,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,r=!e[6]&&e[2];return W.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":r&&G.test(r)&&(t=a(r,!0))&&(t=r.indexOf(")",r.length-t)-r.length)&&(e[0]=e[0].slice(0,t),e[2]=r.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(J,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=A[e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&A(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,r){return function(n){var i=oe.attr(n,e);return null==i?"!="===t:!t||(i+="","="===t?i===r:"!="===t?i!==r:"^="===t?r&&0===i.indexOf(r):"*="===t?r&&i.indexOf(r)>-1:"$="===t?r&&i.slice(-r.length)===r:"~="===t?(" "+i.replace(j," ")+" ").indexOf(r)>-1:"|="===t&&(i===r||i.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,r,n,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===n&&0===i?function(e){return!!e.parentNode}:function(t,r,l){var u,c,f,h,p,d,m=o!==a?"nextSibling":"previousSibling",v=t.parentNode,g=s&&t.nodeName.toLowerCase(),y=!l&&!s,b=!1;if(v){if(o){for(;m;){for(h=t;h=h[m];)if(s?h.nodeName.toLowerCase()===g:1===h.nodeType)return!1;d=m="only"===e&&!d&&"nextSibling"}return!0}if(d=[a?v.firstChild:v.lastChild],a&&y){for(b=(p=(u=(c=(f=(h=v)[x]||(h[x]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]||[])[0]===_&&u[1])&&u[2],h=p&&v.childNodes[p];h=++p&&h&&h[m]||(b=p=0)||d.pop();)if(1===h.nodeType&&++b&&h===t){c[e]=[_,p,b];break}}else if(y&&(b=p=(u=(c=(f=(h=t)[x]||(h[x]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]||[])[0]===_&&u[1]),!1===b)for(;(h=++p&&h&&h[m]||(b=p=0)||d.pop())&&((s?h.nodeName.toLowerCase()!==g:1!==h.nodeType)||!++b||(y&&((c=(f=h[x]||(h[x]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]=[_,b]),h!==t)););return(b-=i)===n||b%n==0&&b/n>=0}}},PSEUDO:function(e,t){var r,i=n.pseudos[e]||n.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(r=[e,e,"",t],n.setFilters.hasOwnProperty(e.toLowerCase())?se((function(e,r){for(var n,o=i(e,t),a=o.length;a--;)e[n=I(e,o[a])]=!(r[n]=o[a])})):function(e){return i(e,0,r)}):i}},pseudos:{not:se((function(e){var t=[],r=[],n=s(e.replace(B,"$1"));return n[x]?se((function(e,t,r,i){for(var o,a=n(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,n(t,null,o,r),t[0]=null,!r.pop()}})),has:se((function(e){return function(t){return oe(e,t).length>0}})),contains:se((function(e){return e=e.replace(J,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}})),lang:se((function(e){return H.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(J,ee).toLowerCase(),function(t){var r;do{if(r=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(r=r.toLowerCase())===e||0===r.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var r=e.location&&e.location.hash;return r&&r.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:pe(!1),disabled:pe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!n.pseudos.empty(e)},header:function(e){return X.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:de((function(){return[0]})),last:de((function(e,t){return[t-1]})),eq:de((function(e,t,r){return[r<0?r+t:r]})),even:de((function(e,t){for(var r=0;r<t;r+=2)e.push(r);return e})),odd:de((function(e,t){for(var r=1;r<t;r+=2)e.push(r);return e})),lt:de((function(e,t,r){for(var n=r<0?r+t:r;--n>=0;)e.push(n);return e})),gt:de((function(e,t,r){for(var n=r<0?r+t:r;++n<t;)e.push(n);return e}))}}).pseudos.nth=n.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})n.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})n.pseudos[t]=he(t);function ve(){}function ge(e){for(var t=0,r=e.length,n="";t<r;t++)n+=e[t].value;return n}function ye(e,t,r){var n=t.dir,i=t.next,o=i||n,a=r&&"parentNode"===o,s=D++;return t.first?function(t,r,i){for(;t=t[n];)if(1===t.nodeType||a)return e(t,r,i);return!1}:function(t,r,l){var u,c,f,h=[_,s];if(l){for(;t=t[n];)if((1===t.nodeType||a)&&e(t,r,l))return!0}else for(;t=t[n];)if(1===t.nodeType||a)if(c=(f=t[x]||(t[x]={}))[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[n]||t;else{if((u=c[o])&&u[0]===_&&u[1]===s)return h[2]=u[2];if(c[o]=h,h[2]=e(t,r,l))return!0}return!1}}function be(e){return e.length>1?function(t,r,n){for(var i=e.length;i--;)if(!e[i](t,r,n))return!1;return!0}:e[0]}function xe(e,t,r,n,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s<l;s++)(o=e[s])&&(r&&!r(o,n,i)||(a.push(o),u&&t.push(s)));return a}function we(e,t,r,n,i,o){return n&&!n[x]&&(n=we(n)),i&&!i[x]&&(i=we(i,o)),se((function(o,a,s,l){var u,c,f,h=[],p=[],d=a.length,m=o||function(e,t,r){for(var n=0,i=t.length;n<i;n++)oe(e,t[n],r);return r}(t||"*",s.nodeType?[s]:s,[]),v=!e||!o&&t?m:xe(m,h,e,s,l),g=r?i||(o?e:d||n)?[]:a:v;if(r&&r(v,g,s,l),n)for(u=xe(g,p),n(u,[],s,l),c=u.length;c--;)(f=u[c])&&(g[p[c]]=!(v[p[c]]=f));if(o){if(i||e){if(i){for(u=[],c=g.length;c--;)(f=g[c])&&u.push(v[c]=f);i(null,g=[],u,l)}for(c=g.length;c--;)(f=g[c])&&(u=i?I(o,f):h[c])>-1&&(o[u]=!(a[u]=f))}}else g=xe(g===a?g.splice(d,g.length):g),i?i(null,a,g,l):L.apply(a,g)}))}function _e(e){for(var t,r,i,o=e.length,a=n.relative[e[0].type],s=a||n.relative[" "],l=a?1:0,c=ye((function(e){return e===t}),s,!0),f=ye((function(e){return I(t,e)>-1}),s,!0),h=[function(e,r,n){var i=!a&&(n||r!==u)||((t=r).nodeType?c(e,r,n):f(e,r,n));return t=null,i}];l<o;l++)if(r=n.relative[e[l].type])h=[ye(be(h),r)];else{if((r=n.filter[e[l].type].apply(null,e[l].matches))[x]){for(i=++l;i<o&&!n.relative[e[i].type];i++);return we(l>1&&be(h),l>1&&ge(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(B,"$1"),r,l<i&&_e(e.slice(l,i)),i<o&&_e(e=e.slice(i)),i<o&&ge(e))}h.push(r)}return be(h)}return ve.prototype=n.filters=n.pseudos,n.setFilters=new ve,a=oe.tokenize=function(e,t){var r,i,o,a,s,l,u,c=C[e+" "];if(c)return t?0:c.slice(0);for(s=e,l=[],u=n.preFilter;s;){for(a in r&&!(i=U.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=V.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(B," ")}),s=s.slice(r.length)),n.filter)!(i=W[a].exec(s))||u[a]&&!(i=u[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return t?s.length:s?oe.error(e):C(e,l).slice(0)},s=oe.compile=function(e,t){var r,i=[],o=[],s=S[e+" "];if(!s){for(t||(t=a(e)),r=t.length;r--;)(s=_e(t[r]))[x]?i.push(s):o.push(s);(s=S(e,function(e,t){var r=t.length>0,i=e.length>0,o=function(o,a,s,l,c){var f,d,v,g=0,y="0",b=o&&[],x=[],w=u,D=o||i&&n.find.TAG("*",c),A=_+=null==w?1:Math.random()||.1,C=D.length;for(c&&(u=a===p||a||c);y!==C&&null!=(f=D[y]);y++){if(i&&f){for(d=0,a||f.ownerDocument===p||(h(f),s=!m);v=e[d++];)if(v(f,a||p,s)){l.push(f);break}c&&(_=A)}r&&((f=!v&&f)&&g--,o&&b.push(f))}if(g+=y,r&&y!==g){for(d=0;v=t[d++];)v(b,x,a,s);if(o){if(g>0)for(;y--;)b[y]||x[y]||(x[y]=$.call(l));x=xe(x)}L.apply(l,x),c&&!o&&x.length>0&&g+t.length>1&&oe.uniqueSort(l)}return c&&(_=A,u=w),b};return r?se(o):o}(o,i))).selector=e}return s},l=oe.select=function(e,t,r,i){var o,l,u,c,f,h="function"==typeof e&&e,p=!i&&a(e=h.selector||e);if(r=r||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===t.nodeType&&m&&n.relative[l[1].type]){if(!(t=(n.find.ID(u.matches[0].replace(J,ee),t)||[])[0]))return r;h&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(o=W.needsContext.test(e)?0:l.length;o--&&(u=l[o],!n.relative[c=u.type]);)if((f=n.find[c])&&(i=f(u.matches[0].replace(J,ee),Q.test(l[0].type)&&me(t.parentNode)||t))){if(l.splice(o,1),!(e=i.length&&ge(l)))return L.apply(r,i),r;break}}return(h||s(e,p))(i,t,!m,r,!t||Q.test(e)&&me(t.parentNode)||t),r},r.sortStable=x.split("").sort(E).join("")===x,r.detectDuplicates=!!f,h(),r.sortDetached=le((function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))})),le((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||ue("type|href|height|width",(function(e,t,r){if(!r)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),r.attributes&&le((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||ue("value",(function(e,t,r){if(!r&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),le((function(e){return null==e.getAttribute("disabled")}))||ue(R,(function(e,t,r){var n;if(!r)return!0===e[t]?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null})),oe}(e);v.find=_,(v.expr=_.selectors)[":"]=v.expr.pseudos,v.uniqueSort=v.unique=_.uniqueSort,v.text=_.getText,v.isXMLDoc=_.isXML,v.contains=_.contains,v.escapeSelector=_.escape;var D=function(e,t,r){for(var n=[],i=void 0!==r;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&v(e).is(r))break;n.push(e)}return n},A=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r},C=v.expr.match.needsContext;function S(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var E=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,T=/^.[^:#\[\.,]*$/;function M(e,t,r){return v.isFunction(t)?v.grep(e,(function(e,n){return!!t.call(e,n,e)!==r})):t.nodeType?v.grep(e,(function(e){return e===t!==r})):"string"!=typeof t?v.grep(e,(function(e){return l.call(t,e)>-1!==r})):T.test(t)?v.filter(t,e,r):(t=v.filter(t,e),v.grep(e,(function(e){return l.call(t,e)>-1!==r&&1===e.nodeType})))}v.filter=function(e,t,r){var n=t[0];return r&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?v.find.matchesSelector(n,e)?[n]:[]:v.find.matches(e,v.grep(t,(function(e){return 1===e.nodeType})))},v.fn.extend({find:function(e){var t,r,n=this.length,i=this;if("string"!=typeof e)return this.pushStack(v(e).filter((function(){for(t=0;t<n;t++)if(v.contains(i[t],this))return!0})));for(r=this.pushStack([]),t=0;t<n;t++)v.find(e,i[t],r);return n>1?v.uniqueSort(r):r},filter:function(e){return this.pushStack(M(this,e||[],!1))},not:function(e){return this.pushStack(M(this,e||[],!0))},is:function(e){return!!M(this,"string"==typeof e&&C.test(e)?v(e):e||[],!1).length}});var $,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(v.fn.init=function(e,t,r){var i,o;if(!e)return this;if(r=r||$,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:z.exec(e))||!i[1]&&t)return!t||t.jquery?(t||r).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof v?t[0]:t,v.merge(this,v.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:n,!0)),E.test(i[1])&&v.isPlainObject(t))for(i in t)v.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=n.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v.isFunction(e)?void 0!==r.ready?r.ready(e):e(v):v.makeArray(e,this)}).prototype=v.fn,$=v(n);var L=/^(?:parents|prev(?:Until|All))/,k={children:!0,contents:!0,next:!0,prev:!0};function I(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}v.fn.extend({has:function(e){var t=v(e,this),r=t.length;return this.filter((function(){for(var e=0;e<r;e++)if(v.contains(this,t[e]))return!0}))},closest:function(e,t){var r,n=0,i=this.length,o=[],a="string"!=typeof e&&v(e);if(!C.test(e))for(;n<i;n++)for(r=this[n];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(a?a.index(r)>-1:1===r.nodeType&&v.find.matchesSelector(r,e))){o.push(r);break}return this.pushStack(o.length>1?v.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?l.call(v(e),this[0]):l.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(v.uniqueSort(v.merge(this.get(),v(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),v.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return D(e,"parentNode")},parentsUntil:function(e,t,r){return D(e,"parentNode",r)},next:function(e){return I(e,"nextSibling")},prev:function(e){return I(e,"previousSibling")},nextAll:function(e){return D(e,"nextSibling")},prevAll:function(e){return D(e,"previousSibling")},nextUntil:function(e,t,r){return D(e,"nextSibling",r)},prevUntil:function(e,t,r){return D(e,"previousSibling",r)},siblings:function(e){return A((e.parentNode||{}).firstChild,e)},children:function(e){return A(e.firstChild)},contents:function(e){return S(e,"iframe")?e.contentDocument:(S(e,"template")&&(e=e.content||e),v.merge([],e.childNodes))}},(function(e,t){v.fn[e]=function(r,n){var i=v.map(this,t,r);return"Until"!==e.slice(-5)&&(n=r),n&&"string"==typeof n&&(i=v.filter(n,i)),this.length>1&&(k[e]||v.uniqueSort(i),L.test(e)&&i.reverse()),this.pushStack(i)}}));var R=/[^\x20\t\r\n\f]+/g;function O(e){return e}function F(e){throw e}function N(e,t,r,n){var i;try{e&&v.isFunction(i=e.promise)?i.call(e).done(t).fail(r):e&&v.isFunction(i=e.then)?i.call(e,t,r):t.apply(void 0,[e].slice(n))}catch(e){r.apply(void 0,[e])}}v.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return v.each(e.match(R)||[],(function(e,r){t[r]=!0})),t}(e):v.extend({},e);var t,r,n,i,o=[],a=[],s=-1,l=function(){for(i=i||e.once,n=t=!0;a.length;s=-1)for(r=a.shift();++s<o.length;)!1===o[s].apply(r[0],r[1])&&e.stopOnFalse&&(s=o.length,r=!1);e.memory||(r=!1),t=!1,i&&(o=r?[]:"")},u={add:function(){return o&&(r&&!t&&(s=o.length-1,a.push(r)),function t(r){v.each(r,(function(r,n){v.isFunction(n)?e.unique&&u.has(n)||o.push(n):n&&n.length&&"string"!==v.type(n)&&t(n)}))}(arguments),r&&!t&&l()),this},remove:function(){return v.each(arguments,(function(e,t){for(var r;(r=v.inArray(t,o,r))>-1;)o.splice(r,1),r<=s&&s--})),this},has:function(e){return e?v.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=r="",this},disabled:function(){return!o},lock:function(){return i=a=[],r||t||(o=r=""),this},locked:function(){return!!i},fireWith:function(e,r){return i||(r=[e,(r=r||[]).slice?r.slice():r],a.push(r),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},v.extend({Deferred:function(t){var r=[["notify","progress",v.Callbacks("memory"),v.Callbacks("memory"),2],["resolve","done",v.Callbacks("once memory"),v.Callbacks("once memory"),0,"resolved"],["reject","fail",v.Callbacks("once memory"),v.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return v.Deferred((function(t){v.each(r,(function(r,n){var i=v.isFunction(e[n[4]])&&e[n[4]];o[n[1]]((function(){var e=i&&i.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[n[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(t,n,i){var o=0;function a(t,r,n,i){return function(){var s=this,l=arguments,u=function(){var e,u;if(!(t<o)){if((e=n.apply(s,l))===r.promise())throw new TypeError("Thenable self-resolution");u=e&&("object"==_typeof(e)||"function"==typeof e)&&e.then,v.isFunction(u)?i?u.call(e,a(o,r,O,i),a(o,r,F,i)):(o++,u.call(e,a(o,r,O,i),a(o,r,F,i),a(o,r,O,r.notifyWith))):(n!==O&&(s=void 0,l=[e]),(i||r.resolveWith)(s,l))}},c=i?u:function(){try{u()}catch(e){v.Deferred.exceptionHook&&v.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(n!==F&&(s=void 0,l=[e]),r.rejectWith(s,l))}};t?c():(v.Deferred.getStackHook&&(c.stackTrace=v.Deferred.getStackHook()),e.setTimeout(c))}}return v.Deferred((function(e){r[0][3].add(a(0,e,v.isFunction(i)?i:O,e.notifyWith)),r[1][3].add(a(0,e,v.isFunction(t)?t:O)),r[2][3].add(a(0,e,v.isFunction(n)?n:F))})).promise()},promise:function(e){return null!=e?v.extend(e,i):i}},o={};return v.each(r,(function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add((function(){n=s}),r[3-e][2].disable,r[0][2].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,r=t,n=Array(r),i=o.call(arguments),a=v.Deferred(),s=function(e){return function(r){n[e]=this,i[e]=arguments.length>1?o.call(arguments):r,--t||a.resolveWith(n,i)}};if(t<=1&&(N(e,a.done(s(r)).resolve,a.reject,!t),"pending"===a.state()||v.isFunction(i[r]&&i[r].then)))return a.then();for(;r--;)N(i[r],s(r),a.reject);return a.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;v.Deferred.exceptionHook=function(t,r){e.console&&e.console.warn&&t&&P.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,r)},v.readyException=function(t){e.setTimeout((function(){throw t}))};var j=v.Deferred();function B(){n.removeEventListener("DOMContentLoaded",B),e.removeEventListener("load",B),v.ready()}v.fn.ready=function(e){return j.then(e).catch((function(e){v.readyException(e)})),this},v.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--v.readyWait:v.isReady)||(v.isReady=!0,!0!==e&&--v.readyWait>0||j.resolveWith(n,[v]))}}),v.ready.then=j.then,"complete"===n.readyState||"loading"!==n.readyState&&!n.documentElement.doScroll?e.setTimeout(v.ready):(n.addEventListener("DOMContentLoaded",B),e.addEventListener("load",B));var U=function e(t,r,n,i,o,a,s){var l=0,u=t.length,c=null==n;if("object"===v.type(n))for(l in o=!0,n)e(t,r,l,n[l],!0,a,s);else if(void 0!==i&&(o=!0,v.isFunction(i)||(s=!0),c&&(s?(r.call(t,i),r=null):(c=r,r=function(e,t,r){return c.call(v(e),r)})),r))for(;l<u;l++)r(t[l],n,s?i:i.call(t[l],l,r(t[l],n)));return o?t:c?r.call(t):u?r(t[0],n):a},V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function q(){this.expando=v.expando+q.uid++}q.uid=1,q.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,r){var n,i=this.cache(e);if("string"==typeof t)i[v.camelCase(t)]=r;else for(n in t)i[v.camelCase(n)]=t[n];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][v.camelCase(t)]},access:function(e,t,r){return void 0===t||t&&"string"==typeof t&&void 0===r?this.get(e,t):(this.set(e,t,r),void 0!==r?r:t)},remove:function(e,t){var r,n=e[this.expando];if(void 0!==n){if(void 0!==t){r=(t=Array.isArray(t)?t.map(v.camelCase):(t=v.camelCase(t))in n?[t]:t.match(R)||[]).length;for(;r--;)delete n[t[r]]}(void 0===t||v.isEmptyObject(n))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!v.isEmptyObject(t)}};var G=new q,H=new q,W=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Y=/[A-Z]/g;function X(e,t,r){var n;if(void 0===r&&1===e.nodeType)if(n="data-"+t.replace(Y,"-$&").toLowerCase(),"string"==typeof(r=e.getAttribute(n))){try{r=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:W.test(e)?JSON.parse(e):e)}(r)}catch(e){}H.set(e,t,r)}else r=void 0;return r}v.extend({hasData:function(e){return H.hasData(e)||G.hasData(e)},data:function(e,t,r){return H.access(e,t,r)},removeData:function(e,t){H.remove(e,t)},_data:function(e,t,r){return G.access(e,t,r)},_removeData:function(e,t){G.remove(e,t)}}),v.fn.extend({data:function(e,t){var r,n,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=H.get(o),1===o.nodeType&&!G.get(o,"hasDataAttrs"))){for(r=a.length;r--;)a[r]&&0===(n=a[r].name).indexOf("data-")&&(n=v.camelCase(n.slice(5)),X(o,n,i[n]));G.set(o,"hasDataAttrs",!0)}return i}return"object"==_typeof(e)?this.each((function(){H.set(this,e)})):U(this,(function(t){var r;if(o&&void 0===t)return void 0!==(r=H.get(o,e))?r:void 0!==(r=X(o,e))?r:void 0;this.each((function(){H.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){H.remove(this,e)}))}}),v.extend({queue:function(e,t,r){var n;if(e)return t=(t||"fx")+"queue",n=G.get(e,t),r&&(!n||Array.isArray(r)?n=G.access(e,t,v.makeArray(r)):n.push(r)),n||[]},dequeue:function(e,t){var r=v.queue(e,t=t||"fx"),n=r.length,i=r.shift(),o=v._queueHooks(e,t);"inprogress"===i&&(i=r.shift(),n--),i&&("fx"===t&&r.unshift("inprogress"),delete o.stop,i.call(e,(function(){v.dequeue(e,t)}),o)),!n&&o&&o.empty.fire()},_queueHooks:function(e,t){var r=t+"queueHooks";return G.get(e,r)||G.access(e,r,{empty:v.Callbacks("once memory").add((function(){G.remove(e,[t+"queue",r])}))})}}),v.fn.extend({queue:function(e,t){var r=2;return"string"!=typeof e&&(t=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):void 0===t?this:this.each((function(){var r=v.queue(this,e,t);v._queueHooks(this,e),"fx"===e&&"inprogress"!==r[0]&&v.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){v.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var r,n=1,i=v.Deferred(),o=this,a=this.length,s=function(){--n||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(r=G.get(o[a],e+"queueHooks"))&&r.empty&&(n++,r.empty.add(s));return s(),i.promise(t)}});var K=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Z=new RegExp("^(?:([+-])=|)("+K+")([a-z%]*)$","i"),Q=["Top","Right","Bottom","Left"],J=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&v.contains(e.ownerDocument,e)&&"none"===v.css(e,"display")},ee=function(e,t,r,n){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=r.apply(e,n||[]),t)e.style[o]=a[o];return i};function te(e,t,r,n){var i,o=1,a=20,s=n?function(){return n.cur()}:function(){return v.css(e,t,"")},l=s(),u=r&&r[3]||(v.cssNumber[t]?"":"px"),c=(v.cssNumber[t]||"px"!==u&&+l)&&Z.exec(v.css(e,t));if(c&&c[3]!==u){u=u||c[3],r=r||[],c=+l||1;do{c/=o=o||".5",v.style(e,t,c+u)}while(o!==(o=s()/l)&&1!==o&&--a)}return r&&(c=+c||+l||0,i=r[1]?c+(r[1]+1)*r[2]:+r[2],n&&(n.unit=u,n.start=c,n.end=i)),i}var re={};function ne(e){var t,r=e.ownerDocument,n=e.nodeName,i=re[n];return i||(t=r.body.appendChild(r.createElement(n)),i=v.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),re[n]=i,i)}function ie(e,t){for(var r,n,i=[],o=0,a=e.length;o<a;o++)(n=e[o]).style&&(r=n.style.display,t?("none"===r&&(i[o]=G.get(n,"display")||null,i[o]||(n.style.display="")),""===n.style.display&&J(n)&&(i[o]=ne(n))):"none"!==r&&(i[o]="none",G.set(n,"display",r)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}v.fn.extend({show:function(){return ie(this,!0)},hide:function(){return ie(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){J(this)?v(this).show():v(this).hide()}))}});var oe=/^(?:checkbox|radio)$/i,ae=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,se=/^$|\/(?:java|ecma)script/i,le={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ue(e,t){var r;return r=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&S(e,t)?v.merge([e],r):r}function ce(e,t){for(var r=0,n=e.length;r<n;r++)G.set(e[r],"globalEval",!t||G.get(t[r],"globalEval"))}le.optgroup=le.option,le.tbody=le.tfoot=le.colgroup=le.caption=le.thead,le.th=le.td;var fe,he,pe=/<|&#?\w+;/;function de(e,t,r,n,i){for(var o,a,s,l,u,c,f=t.createDocumentFragment(),h=[],p=0,d=e.length;p<d;p++)if((o=e[p])||0===o)if("object"===v.type(o))v.merge(h,o.nodeType?[o]:o);else if(pe.test(o)){for(a=a||f.appendChild(t.createElement("div")),s=(ae.exec(o)||["",""])[1].toLowerCase(),l=le[s]||le._default,a.innerHTML=l[1]+v.htmlPrefilter(o)+l[2],c=l[0];c--;)a=a.lastChild;v.merge(h,a.childNodes),(a=f.firstChild).textContent=""}else h.push(t.createTextNode(o));for(f.textContent="",p=0;o=h[p++];)if(n&&v.inArray(o,n)>-1)i&&i.push(o);else if(u=v.contains(o.ownerDocument,o),a=ue(f.appendChild(o),"script"),u&&ce(a),r)for(c=0;o=a[c++];)se.test(o.type||"")&&r.push(o);return f}fe=n.createDocumentFragment().appendChild(n.createElement("div")),(he=n.createElement("input")).setAttribute("type","radio"),he.setAttribute("checked","checked"),he.setAttribute("name","t"),fe.appendChild(he),d.checkClone=fe.cloneNode(!0).cloneNode(!0).lastChild.checked,fe.innerHTML="<textarea>x</textarea>",d.noCloneChecked=!!fe.cloneNode(!0).lastChild.defaultValue;var me=n.documentElement,ve=/^key/,ge=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ye=/^([^.]*)(?:\.(.+)|)/;function be(){return!0}function xe(){return!1}function we(){try{return n.activeElement}catch(e){}}function _e(e,t,r,n,i,o){var a,s;if("object"==_typeof(t)){for(s in"string"!=typeof r&&(n=n||r,r=void 0),t)_e(e,s,r,n,t[s],o);return e}if(null==n&&null==i?(i=r,n=r=void 0):null==i&&("string"==typeof r?(i=n,n=void 0):(i=n,n=r,r=void 0)),!1===i)i=xe;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return v().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=v.guid++)),e.each((function(){v.event.add(this,t,i,n,r)}))}v.event={global:{},add:function(e,t,r,n,i){var o,a,s,l,u,c,f,h,p,d,m,g=G.get(e);if(g)for(r.handler&&(r=(o=r).handler,i=o.selector),i&&v.find.matchesSelector(me,i),r.guid||(r.guid=v.guid++),(l=g.events)||(l=g.events={}),(a=g.handle)||(a=g.handle=function(t){return void 0!==v&&v.event.triggered!==t.type?v.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(R)||[""]).length;u--;)p=m=(s=ye.exec(t[u])||[])[1],d=(s[2]||"").split(".").sort(),p&&(f=v.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=v.event.special[p]||{},c=v.extend({type:p,origType:m,data:n,handler:r,guid:r.guid,selector:i,needsContext:i&&v.expr.match.needsContext.test(i),namespace:d.join(".")},o),(h=l[p])||((h=l[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,n,d,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=r.guid)),i?h.splice(h.delegateCount++,0,c):h.push(c),v.event.global[p]=!0)},remove:function(e,t,r,n,i){var o,a,s,l,u,c,f,h,p,d,m,g=G.hasData(e)&&G.get(e);if(g&&(l=g.events)){for(u=(t=(t||"").match(R)||[""]).length;u--;)if(p=m=(s=ye.exec(t[u])||[])[1],d=(s[2]||"").split(".").sort(),p){for(f=v.event.special[p]||{},h=l[p=(n?f.delegateType:f.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)c=h[o],!i&&m!==c.origType||r&&r.guid!==c.guid||s&&!s.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(h.splice(o,1),c.selector&&h.delegateCount--,f.remove&&f.remove.call(e,c));a&&!h.length&&(f.teardown&&!1!==f.teardown.call(e,d,g.handle)||v.removeEvent(e,p,g.handle),delete l[p])}else for(p in l)v.event.remove(e,p+t[u],r,n,!0);v.isEmptyObject(l)&&G.remove(e,"handle events")}},dispatch:function(e){var t,r,n,i,o,a,s=v.event.fix(e),l=new Array(arguments.length),u=(G.get(this,"events")||{})[s.type]||[],c=v.event.special[s.type]||{};for(l[0]=s,t=1;t<arguments.length;t++)l[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){for(a=v.event.handlers.call(this,s,u),t=0;(i=a[t++])&&!s.isPropagationStopped();)for(s.currentTarget=i.elem,r=0;(o=i.handlers[r++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(n=((v.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,l))&&!1===(s.result=n)&&(s.preventDefault(),s.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var r,n,i,o,a,s=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},r=0;r<l;r++)void 0===a[i=(n=t[r]).selector+" "]&&(a[i]=n.needsContext?v(i,this).index(u)>-1:v.find(i,this,null,[u]).length),a[i]&&o.push(n);o.length&&s.push({elem:u,handlers:o})}return u=this,l<t.length&&s.push({elem:u,handlers:t.slice(l)}),s},addProp:function(e,t){Object.defineProperty(v.Event.prototype,e,{enumerable:!0,configurable:!0,get:v.isFunction(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[v.expando]?e:new v.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==we()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===we()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&S(this,"input"))return this.click(),!1},_default:function(e){return S(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},v.removeEvent=function(e,t,r){e.removeEventListener&&e.removeEventListener(t,r)},(v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?be:xe,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0}).prototype={constructor:v.Event,isDefaultPrevented:xe,isPropagationStopped:xe,isImmediatePropagationStopped:xe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=be,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=be,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=be,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},v.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&ve.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&ge.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},v.event.addProp),v.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var r,n=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===n||v.contains(n,i))||(e.type=o.origType,r=o.handler.apply(this,arguments),e.type=t),r}}})),v.fn.extend({on:function(e,t,r,n){return _e(this,e,t,r,n)},one:function(e,t,r,n){return _e(this,e,t,r,n,1)},off:function(e,t,r){var n,i;if(e&&e.preventDefault&&e.handleObj)return n=e.handleObj,v(e.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==_typeof(e)){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(r=t,t=void 0),!1===r&&(r=xe),this.each((function(){v.event.remove(this,e,r,t)}))}});var De=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/<script|<style|<link/i,Ce=/checked\s*(?:[^=]|=\s*.checked.)/i,Se=/^true\/(.*)/,Ee=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Te(e,t){return S(e,"table")&&S(11!==t.nodeType?t:t.firstChild,"tr")&&v(">tbody",e)[0]||e}function Me(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function $e(e){var t=Se.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function ze(e,t){var r,n,i,o,a,s,l,u;if(1===t.nodeType){if(G.hasData(e)&&(o=G.access(e),a=G.set(t,o),u=o.events))for(i in delete a.handle,a.events={},u)for(r=0,n=u[i].length;r<n;r++)v.event.add(t,i,u[i][r]);H.hasData(e)&&(s=H.access(e),l=v.extend({},s),H.set(t,l))}}function Le(e,t){var r=t.nodeName.toLowerCase();"input"===r&&oe.test(e.type)?t.checked=e.checked:"input"!==r&&"textarea"!==r||(t.defaultValue=e.defaultValue)}function ke(e,t,r,n){t=a.apply([],t);var i,o,s,l,u,c,f=0,h=e.length,p=h-1,g=t[0],y=v.isFunction(g);if(y||h>1&&"string"==typeof g&&!d.checkClone&&Ce.test(g))return e.each((function(i){var o=e.eq(i);y&&(t[0]=g.call(this,i,o.html())),ke(o,t,r,n)}));if(h&&(o=(i=de(t,e[0].ownerDocument,!1,e,n)).firstChild,1===i.childNodes.length&&(i=o),o||n)){for(l=(s=v.map(ue(i,"script"),Me)).length;f<h;f++)u=i,f!==p&&(u=v.clone(u,!0,!0),l&&v.merge(s,ue(u,"script"))),r.call(e[f],u,f);if(l)for(c=s[s.length-1].ownerDocument,v.map(s,$e),f=0;f<l;f++)u=s[f],se.test(u.type||"")&&!G.access(u,"globalEval")&&v.contains(c,u)&&(u.src?v._evalUrl&&v._evalUrl(u.src):m(u.textContent.replace(Ee,""),c))}return e}function Ie(e,t,r){for(var n,i=t?v.filter(t,e):e,o=0;null!=(n=i[o]);o++)r||1!==n.nodeType||v.cleanData(ue(n)),n.parentNode&&(r&&v.contains(n.ownerDocument,n)&&ce(ue(n,"script")),n.parentNode.removeChild(n));return e}v.extend({htmlPrefilter:function(e){return e.replace(De,"<$1></$2>")},clone:function(e,t,r){var n,i,o,a,s=e.cloneNode(!0),l=v.contains(e.ownerDocument,e);if(!(d.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||v.isXMLDoc(e)))for(a=ue(s),n=0,i=(o=ue(e)).length;n<i;n++)Le(o[n],a[n]);if(t)if(r)for(o=o||ue(e),a=a||ue(s),n=0,i=o.length;n<i;n++)ze(o[n],a[n]);else ze(e,s);return(a=ue(s,"script")).length>0&&ce(a,!l&&ue(e,"script")),s},cleanData:function(e){for(var t,r,n,i=v.event.special,o=0;void 0!==(r=e[o]);o++)if(V(r)){if(t=r[G.expando]){if(t.events)for(n in t.events)i[n]?v.event.remove(r,n):v.removeEvent(r,n,t.handle);r[G.expando]=void 0}r[H.expando]&&(r[H.expando]=void 0)}}}),v.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return U(this,(function(e){return void 0===e?v.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return ke(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Te(this,e).appendChild(e)}))},prepend:function(){return ke(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Te(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return ke(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return ke(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(v.cleanData(ue(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return v.clone(this,e,t)}))},html:function(e){return U(this,(function(e){var t=this[0]||{},r=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!le[(ae.exec(e)||["",""])[1].toLowerCase()]){e=v.htmlPrefilter(e);try{for(;r<n;r++)1===(t=this[r]||{}).nodeType&&(v.cleanData(ue(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return ke(this,arguments,(function(t){var r=this.parentNode;v.inArray(this,e)<0&&(v.cleanData(ue(this)),r&&r.replaceChild(t,this))}),e)}}),v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){v.fn[e]=function(e){for(var r,n=[],i=v(e),o=i.length-1,a=0;a<=o;a++)r=a===o?this:this.clone(!0),v(i[a])[t](r),s.apply(n,r.get());return this.pushStack(n)}}));var Re=/^margin/,Oe=new RegExp("^("+K+")(?!px)[a-z%]+$","i"),Fe=function(t){var r=t.ownerDocument.defaultView;return r&&r.opener||(r=e),r.getComputedStyle(t)};function Ne(e,t,r){var n,i,o,a,s=e.style;return(r=r||Fe(e))&&(""!==(a=r.getPropertyValue(t)||r[t])||v.contains(e.ownerDocument,e)||(a=v.style(e,t)),!d.pixelMarginRight()&&Oe.test(a)&&Re.test(t)&&(n=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=r.width,s.width=n,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Pe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function t(){if(l){l.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",l.innerHTML="",me.appendChild(s);var t=e.getComputedStyle(l);r="1%"!==t.top,a="2px"===t.marginLeft,i="4px"===t.width,l.style.marginRight="50%",o="4px"===t.marginRight,me.removeChild(s),l=null}}var r,i,o,a,s=n.createElement("div"),l=n.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===l.style.backgroundClip,s.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",s.appendChild(l),v.extend(d,{pixelPosition:function(){return t(),r},boxSizingReliable:function(){return t(),i},pixelMarginRight:function(){return t(),o},reliableMarginLeft:function(){return t(),a}}))}();var je=/^(none|table(?!-c[ea]).+)/,Be=/^--/,Ue={position:"absolute",visibility:"hidden",display:"block"},Ve={letterSpacing:"0",fontWeight:"400"},qe=["Webkit","Moz","ms"],Ge=n.createElement("div").style;function He(e){var t=v.cssProps[e];return t||(t=v.cssProps[e]=function(e){if(e in Ge)return e;for(var t=e[0].toUpperCase()+e.slice(1),r=qe.length;r--;)if((e=qe[r]+t)in Ge)return e}(e)||e),t}function We(e,t,r){var n=Z.exec(t);return n?Math.max(0,n[2]-(r||0))+(n[3]||"px"):t}function Ye(e,t,r,n,i){var o,a=0;for(o=r===(n?"border":"content")?4:"width"===t?1:0;o<4;o+=2)"margin"===r&&(a+=v.css(e,r+Q[o],!0,i)),n?("content"===r&&(a-=v.css(e,"padding"+Q[o],!0,i)),"margin"!==r&&(a-=v.css(e,"border"+Q[o]+"Width",!0,i))):(a+=v.css(e,"padding"+Q[o],!0,i),"padding"!==r&&(a+=v.css(e,"border"+Q[o]+"Width",!0,i)));return a}function Xe(e,t,r){var n,i=Fe(e),o=Ne(e,t,i),a="border-box"===v.css(e,"boxSizing",!1,i);return Oe.test(o)?o:(n=a&&(d.boxSizingReliable()||o===e.style[t]),"auto"===o&&(o=e["offset"+t[0].toUpperCase()+t.slice(1)]),(o=parseFloat(o)||0)+Ye(e,t,r||(a?"border":"content"),n,i)+"px")}function Ke(e,t,r,n,i){return new Ke.prototype.init(e,t,r,n,i)}v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var r=Ne(e,"opacity");return""===r?"1":r}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,t,r,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=v.camelCase(t),l=Be.test(t),u=e.style;if(l||(t=He(s)),a=v.cssHooks[t]||v.cssHooks[s],void 0===r)return a&&"get"in a&&void 0!==(i=a.get(e,!1,n))?i:u[t];"string"===(o=_typeof(r))&&(i=Z.exec(r))&&i[1]&&(r=te(e,t,i),o="number"),null!=r&&r==r&&("number"===o&&(r+=i&&i[3]||(v.cssNumber[s]?"":"px")),d.clearCloneStyle||""!==r||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(r=a.set(e,r,n))||(l?u.setProperty(t,r):u[t]=r))}},css:function(e,t,r,n){var i,o,a,s=v.camelCase(t);return Be.test(t)||(t=He(s)),(a=v.cssHooks[t]||v.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,r)),void 0===i&&(i=Ne(e,t,n)),"normal"===i&&t in Ve&&(i=Ve[t]),""===r||r?(o=parseFloat(i),!0===r||isFinite(o)?o||0:i):i}}),v.each(["height","width"],(function(e,t){v.cssHooks[t]={get:function(e,r,n){if(r)return!je.test(v.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Xe(e,t,n):ee(e,Ue,(function(){return Xe(e,t,n)}))},set:function(e,r,n){var i,o=n&&Fe(e),a=n&&Ye(e,t,n,"border-box"===v.css(e,"boxSizing",!1,o),o);return a&&(i=Z.exec(r))&&"px"!==(i[3]||"px")&&(e.style[t]=r,r=v.css(e,t)),We(0,r,a)}}})),v.cssHooks.marginLeft=Pe(d.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ne(e,"marginLeft"))||e.getBoundingClientRect().left-ee(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),v.each({margin:"",padding:"",border:"Width"},(function(e,t){v.cssHooks[e+t]={expand:function(r){for(var n=0,i={},o="string"==typeof r?r.split(" "):[r];n<4;n++)i[e+Q[n]+t]=o[n]||o[n-2]||o[0];return i}},Re.test(e)||(v.cssHooks[e+t].set=We)})),v.fn.extend({css:function(e,t){return U(this,(function(e,t,r){var n,i,o={},a=0;if(Array.isArray(t)){for(n=Fe(e),i=t.length;a<i;a++)o[t[a]]=v.css(e,t[a],!1,n);return o}return void 0!==r?v.style(e,t,r):v.css(e,t)}),e,t,arguments.length>1)}}),v.Tween=Ke,Ke.prototype={constructor:Ke,init:function(e,t,r,n,i,o){this.elem=e,this.prop=r,this.easing=i||v.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=o||(v.cssNumber[r]?"":"px")},cur:function(){var e=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,r=Ke.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):Ke.propHooks._default.set(this),this}},Ke.prototype.init.prototype=Ke.prototype,Ke.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=v.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[v.cssProps[e.prop]]&&!v.cssHooks[e.prop]?e.elem[e.prop]=e.now:v.style(e.elem,e.prop,e.now+e.unit)}}},Ke.propHooks.scrollTop=Ke.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},(v.fx=Ke.prototype.init).step={};var Ze,Qe,Je=/^(?:toggle|show|hide)$/,et=/queueHooks$/;function tt(){Qe&&(!1===n.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(tt):e.setTimeout(tt,v.fx.interval),v.fx.tick())}function rt(){return e.setTimeout((function(){Ze=void 0})),Ze=v.now()}function nt(e,t){var r,n=0,i={height:e};for(t=t?1:0;n<4;n+=2-t)i["margin"+(r=Q[n])]=i["padding"+r]=e;return t&&(i.opacity=i.width=e),i}function it(e,t,r){for(var n,i=(ot.tweeners[t]||[]).concat(ot.tweeners["*"]),o=0,a=i.length;o<a;o++)if(n=i[o].call(r,t,e))return n}function ot(e,t,r){var n,i,o=0,a=ot.prefilters.length,s=v.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var t=Ze||rt(),r=Math.max(0,u.startTime+u.duration-t),n=1-(r/u.duration||0),o=0,a=u.tweens.length;o<a;o++)u.tweens[o].run(n);return s.notifyWith(e,[u,n,r]),n<1&&a?r:(a||s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{},easing:v.easing._default},r),originalProperties:t,originalOptions:r,startTime:Ze||rt(),duration:r.duration,tweens:[],createTween:function(t,r){var n=v.Tween(e,u.opts,t,r,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(n),n},stop:function(t){var r=0,n=t?u.tweens.length:0;if(i)return this;for(i=!0;r<n;r++)u.tweens[r].run(1);return t?(s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u,t])):s.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var r,n,i,o,a;for(r in e)if(i=t[n=v.camelCase(r)],o=e[r],Array.isArray(o)&&(i=o[1],o=e[r]=o[0]),r!==n&&(e[n]=o,delete e[r]),(a=v.cssHooks[n])&&"expand"in a)for(r in o=a.expand(o),delete e[n],o)r in e||(e[r]=o[r],t[r]=i);else t[n]=i}(c,u.opts.specialEasing);o<a;o++)if(n=ot.prefilters[o].call(u,e,c,u.opts))return v.isFunction(n.stop)&&(v._queueHooks(u.elem,u.opts.queue).stop=v.proxy(n.stop,n)),n;return v.map(c,it,u),v.isFunction(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),v.fx.timer(v.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}v.Animation=v.extend(ot,{tweeners:{"*":[function(e,t){var r=this.createTween(e,t);return te(r.elem,e,Z.exec(t),r),r}]},tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.match(R);for(var r,n=0,i=e.length;n<i;n++)r=e[n],ot.tweeners[r]=ot.tweeners[r]||[],ot.tweeners[r].unshift(t)},prefilters:[function(e,t,r){var n,i,o,a,s,l,u,c,f="width"in t||"height"in t,h=this,p={},d=e.style,m=e.nodeType&&J(e),g=G.get(e,"fxshow");for(n in r.queue||(null==(a=v._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,h.always((function(){h.always((function(){a.unqueued--,v.queue(e,"fx").length||a.empty.fire()}))}))),t)if(i=t[n],Je.test(i)){if(delete t[n],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!g||void 0===g[n])continue;m=!0}p[n]=g&&g[n]||v.style(e,n)}if((l=!v.isEmptyObject(t))||!v.isEmptyObject(p))for(n in f&&1===e.nodeType&&(r.overflow=[d.overflow,d.overflowX,d.overflowY],null==(u=g&&g.display)&&(u=G.get(e,"display")),"none"===(c=v.css(e,"display"))&&(u?c=u:(ie([e],!0),u=e.style.display||u,c=v.css(e,"display"),ie([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===v.css(e,"float")&&(l||(h.done((function(){d.display=u})),null==u&&(c=d.display,u="none"===c?"":c)),d.display="inline-block")),r.overflow&&(d.overflow="hidden",h.always((function(){d.overflow=r.overflow[0],d.overflowX=r.overflow[1],d.overflowY=r.overflow[2]}))),l=!1,p)l||(g?"hidden"in g&&(m=g.hidden):g=G.access(e,"fxshow",{display:u}),o&&(g.hidden=!m),m&&ie([e],!0),h.done((function(){for(n in m||ie([e]),G.remove(e,"fxshow"),p)v.style(e,n,p[n])}))),l=it(m?g[n]:0,n,h),n in g||(g[n]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?ot.prefilters.unshift(e):ot.prefilters.push(e)}}),v.speed=function(e,t,r){var n=e&&"object"==_typeof(e)?v.extend({},e):{complete:r||!r&&t||v.isFunction(e)&&e,duration:e,easing:r&&t||t&&!v.isFunction(t)&&t};return v.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in v.fx.speeds?n.duration=v.fx.speeds[n.duration]:n.duration=v.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){v.isFunction(n.old)&&n.old.call(this),n.queue&&v.dequeue(this,n.queue)},n},v.fn.extend({fadeTo:function(e,t,r,n){return this.filter(J).css("opacity",0).show().end().animate({opacity:t},e,r,n)},animate:function(e,t,r,n){var i=v.isEmptyObject(e),o=v.speed(t,r,n),a=function(){var t=ot(this,v.extend({},e),o);(i||G.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,r){var n=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",o=v.timers,a=G.get(this);if(i)a[i]&&a[i].stop&&n(a[i]);else for(i in a)a[i]&&a[i].stop&&et.test(i)&&n(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(r),t=!1,o.splice(i,1));!t&&r||v.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,r=G.get(this),n=r[e+"queue"],i=r[e+"queueHooks"],o=v.timers,a=n?n.length:0;for(r.finish=!0,v.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete r.finish}))}}),v.each(["toggle","show","hide"],(function(e,t){var r=v.fn[t];v.fn[t]=function(e,n,i){return null==e||"boolean"==typeof e?r.apply(this,arguments):this.animate(nt(t,!0),e,n,i)}})),v.each({slideDown:nt("show"),slideUp:nt("hide"),slideToggle:nt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){v.fn[e]=function(e,r,n){return this.animate(t,e,r,n)}})),v.timers=[],v.fx.tick=function(){var e,t=0,r=v.timers;for(Ze=v.now();t<r.length;t++)(e=r[t])()||r[t]!==e||r.splice(t--,1);r.length||v.fx.stop(),Ze=void 0},v.fx.timer=function(e){v.timers.push(e),v.fx.start()},v.fx.interval=13,v.fx.start=function(){Qe||(Qe=!0,tt())},v.fx.stop=function(){Qe=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fn.delay=function(t,r){return t=v.fx&&v.fx.speeds[t]||t,r=r||"fx",this.queue(r,(function(r,n){var i=e.setTimeout(r,t);n.stop=function(){e.clearTimeout(i)}}))},function(){var e=n.createElement("input"),t=n.createElement("select").appendChild(n.createElement("option"));e.type="checkbox",d.checkOn=""!==e.value,d.optSelected=t.selected,(e=n.createElement("input")).value="t",e.type="radio",d.radioValue="t"===e.value}();var at,st=v.expr.attrHandle;v.fn.extend({attr:function(e,t){return U(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){v.removeAttr(this,e)}))}}),v.extend({attr:function(e,t,r){var n,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?v.prop(e,t,r):(1===o&&v.isXMLDoc(e)||(i=v.attrHooks[t.toLowerCase()]||(v.expr.match.bool.test(t)?at:void 0)),void 0!==r?null===r?void v.removeAttr(e,t):i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:(e.setAttribute(t,r+""),r):i&&"get"in i&&null!==(n=i.get(e,t))?n:null==(n=v.find.attr(e,t))?void 0:n)},attrHooks:{type:{set:function(e,t){if(!d.radioValue&&"radio"===t&&S(e,"input")){var r=e.value;return e.setAttribute("type",t),r&&(e.value=r),t}}}},removeAttr:function(e,t){var r,n=0,i=t&&t.match(R);if(i&&1===e.nodeType)for(;r=i[n++];)e.removeAttribute(r)}}),at={set:function(e,t,r){return!1===t?v.removeAttr(e,r):e.setAttribute(r,r),r}},v.each(v.expr.match.bool.source.match(/\w+/g),(function(e,t){var r=st[t]||v.find.attr;st[t]=function(e,t,n){var i,o,a=t.toLowerCase();return n||(o=st[a],st[a]=i,i=null!=r(e,t,n)?a:null,st[a]=o),i}}));var lt=/^(?:input|select|textarea|button)$/i,ut=/^(?:a|area)$/i;function ct(e){return(e.match(R)||[]).join(" ")}function ft(e){return e.getAttribute&&e.getAttribute("class")||""}v.fn.extend({prop:function(e,t){return U(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[v.propFix[e]||e]}))}}),v.extend({prop:function(e,t,r){var n,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&v.isXMLDoc(e)||(t=v.propFix[t]||t,i=v.propHooks[t]),void 0!==r?i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:e[t]=r:i&&"get"in i&&null!==(n=i.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=v.find.attr(e,"tabindex");return t?parseInt(t,10):lt.test(e.nodeName)||ut.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),d.optSelected||(v.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),v.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){v.propFix[this.toLowerCase()]=this})),v.fn.extend({addClass:function(e){var t,r,n,i,o,a,s,l=0;if(v.isFunction(e))return this.each((function(t){v(this).addClass(e.call(this,t,ft(this)))}));if("string"==typeof e&&e)for(t=e.match(R)||[];r=this[l++];)if(i=ft(r),n=1===r.nodeType&&" "+ct(i)+" "){for(a=0;o=t[a++];)n.indexOf(" "+o+" ")<0&&(n+=o+" ");i!==(s=ct(n))&&r.setAttribute("class",s)}return this},removeClass:function(e){var t,r,n,i,o,a,s,l=0;if(v.isFunction(e))return this.each((function(t){v(this).removeClass(e.call(this,t,ft(this)))}));if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(R)||[];r=this[l++];)if(i=ft(r),n=1===r.nodeType&&" "+ct(i)+" "){for(a=0;o=t[a++];)for(;n.indexOf(" "+o+" ")>-1;)n=n.replace(" "+o+" "," ");i!==(s=ct(n))&&r.setAttribute("class",s)}return this},toggleClass:function(e,t){var r=_typeof(e);return"boolean"==typeof t&&"string"===r?t?this.addClass(e):this.removeClass(e):v.isFunction(e)?this.each((function(r){v(this).toggleClass(e.call(this,r,ft(this),t),t)})):this.each((function(){var t,n,i,o;if("string"===r)for(n=0,i=v(this),o=e.match(R)||[];t=o[n++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==r||((t=ft(this))&&G.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":G.get(this,"__className__")||""))}))},hasClass:function(e){var t,r,n=0;for(t=" "+e+" ";r=this[n++];)if(1===r.nodeType&&(" "+ct(ft(r))+" ").indexOf(t)>-1)return!0;return!1}});var ht=/\r/g;v.fn.extend({val:function(e){var t,r,n,i=this[0];return arguments.length?(n=v.isFunction(e),this.each((function(r){var i;1===this.nodeType&&(null==(i=n?e.call(this,r,v(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=v.map(i,(function(e){return null==e?"":e+""}))),(t=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=v.valHooks[i.type]||v.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(r=t.get(i,"value"))?r:"string"==typeof(r=i.value)?r.replace(ht,""):null==r?"":r:void 0}}),v.extend({valHooks:{option:{get:function(e){var t=v.find.attr(e,"value");return null!=t?t:ct(v.text(e))}},select:{get:function(e){var t,r,n,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(n=o<0?l:a?o:0;n<l;n++)if(((r=i[n]).selected||n===o)&&!r.disabled&&(!r.parentNode.disabled||!S(r.parentNode,"optgroup"))){if(t=v(r).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var r,n,i=e.options,o=v.makeArray(t),a=i.length;a--;)((n=i[a]).selected=v.inArray(v.valHooks.option.get(n),o)>-1)&&(r=!0);return r||(e.selectedIndex=-1),o}}}}),v.each(["radio","checkbox"],(function(){v.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=v.inArray(v(e).val(),t)>-1}},d.checkOn||(v.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var pt=/^(?:focusinfocus|focusoutblur)$/;v.extend(v.event,{trigger:function(t,r,i,o){var a,s,l,u,c,h,p,d=[i||n],m=f.call(t,"type")?t.type:t,g=f.call(t,"namespace")?t.namespace.split("."):[];if(s=l=i=i||n,3!==i.nodeType&&8!==i.nodeType&&!pt.test(m+v.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),c=m.indexOf(":")<0&&"on"+m,(t=t[v.expando]?t:new v.Event(m,"object"==_typeof(t)&&t)).isTrigger=o?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),r=null==r?[t]:v.makeArray(r,[t]),p=v.event.special[m]||{},o||!p.trigger||!1!==p.trigger.apply(i,r))){if(!o&&!p.noBubble&&!v.isWindow(i)){for(u=p.delegateType||m,pt.test(u+m)||(s=s.parentNode);s;s=s.parentNode)d.push(s),l=s;l===(i.ownerDocument||n)&&d.push(l.defaultView||l.parentWindow||e)}for(a=0;(s=d[a++])&&!t.isPropagationStopped();)t.type=a>1?u:p.bindType||m,(h=(G.get(s,"events")||{})[t.type]&&G.get(s,"handle"))&&h.apply(s,r),(h=c&&s[c])&&h.apply&&V(s)&&(t.result=h.apply(s,r),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(d.pop(),r)||!V(i)||c&&v.isFunction(i[m])&&!v.isWindow(i)&&((l=i[c])&&(i[c]=null),v.event.triggered=m,i[m](),v.event.triggered=void 0,l&&(i[c]=l)),t.result}},simulate:function(e,t,r){var n=v.extend(new v.Event,r,{type:e,isSimulated:!0});v.event.trigger(n,null,t)}}),v.fn.extend({trigger:function(e,t){return this.each((function(){v.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var r=this[0];if(r)return v.event.trigger(e,t,r,!0)}}),v.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){v.fn[t]=function(e,r){return arguments.length>0?this.on(t,null,e,r):this.trigger(t)}})),v.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),d.focusin="onfocusin"in e,d.focusin||v.each({focus:"focusin",blur:"focusout"},(function(e,t){var r=function(e){v.event.simulate(t,e.target,v.event.fix(e))};v.event.special[t]={setup:function(){var n=this.ownerDocument||this,i=G.access(n,t);i||n.addEventListener(e,r,!0),G.access(n,t,(i||0)+1)},teardown:function(){var n=this.ownerDocument||this,i=G.access(n,t)-1;i?G.access(n,t,i):(n.removeEventListener(e,r,!0),G.remove(n,t))}}}));var dt=e.location,mt=v.now(),vt=/\?/;v.parseXML=function(t){var r;if(!t||"string"!=typeof t)return null;try{r=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){r=void 0}return r&&!r.getElementsByTagName("parsererror").length||v.error("Invalid XML: "+t),r};var gt=/\[\]$/,yt=/\r?\n/g,bt=/^(?:submit|button|image|reset|file)$/i,xt=/^(?:input|select|textarea|keygen)/i;function wt(e,t,r,n){var i;if(Array.isArray(t))v.each(t,(function(t,i){r||gt.test(e)?n(e,i):wt(e+"["+("object"==_typeof(i)&&null!=i?t:"")+"]",i,r,n)}));else if(r||"object"!==v.type(t))n(e,t);else for(i in t)wt(e+"["+i+"]",t[i],r,n)}v.param=function(e,t){var r,n=[],i=function(e,t){var r=v.isFunction(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==r?"":r)};if(Array.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,(function(){i(this.name,this.value)}));else for(r in e)wt(r,e[r],t,i);return n.join("&")},v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=v.prop(this,"elements");return e?v.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!v(this).is(":disabled")&&xt.test(this.nodeName)&&!bt.test(e)&&(this.checked||!oe.test(e))})).map((function(e,t){var r=v(this).val();return null==r?null:Array.isArray(r)?v.map(r,(function(e){return{name:t.name,value:e.replace(yt,"\r\n")}})):{name:t.name,value:r.replace(yt,"\r\n")}})).get()}});var _t=/%20/g,Dt=/#.*$/,At=/([?&])_=[^&]*/,Ct=/^(.*?):[ \t]*([^\r\n]*)$/gm,St=/^(?:GET|HEAD)$/,Et=/^\/\//,Tt={},Mt={},$t="*/".concat("*"),zt=n.createElement("a");function Lt(e){return function(t,r){"string"!=typeof t&&(r=t,t="*");var n,i=0,o=t.toLowerCase().match(R)||[];if(v.isFunction(r))for(;n=o[i++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(r)):(e[n]=e[n]||[]).push(r)}}function kt(e,t,r,n){var i={},o=e===Mt;function a(s){var l;return i[s]=!0,v.each(e[s]||[],(function(e,s){var u=s(t,r,n);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)})),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function It(e,t){var r,n,i=v.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((i[r]?e:n||(n={}))[r]=t[r]);return n&&v.extend(!0,e,n),e}zt.href=dt.href,v.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:dt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(dt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":v.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?It(It(e,v.ajaxSettings),t):It(v.ajaxSettings,e)},ajaxPrefilter:Lt(Tt),ajaxTransport:Lt(Mt),ajax:function(t,r){"object"==_typeof(t)&&(r=t,t=void 0);var i,o,a,s,l,u,c,f,h,p,d=v.ajaxSetup({},r=r||{}),m=d.context||d,g=d.context&&(m.nodeType||m.jquery)?v(m):v.event,y=v.Deferred(),b=v.Callbacks("once memory"),x=d.statusCode||{},w={},_={},D="canceled",A={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=Ct.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=_[e.toLowerCase()]=_[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==c&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)A.always(e[A.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||D;return i&&i.abort(t),C(0,t),this}};if(y.promise(A),d.url=((t||d.url||dt.href)+"").replace(Et,dt.protocol+"//"),d.type=r.method||r.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(R)||[""],null==d.crossDomain){u=n.createElement("a");try{u.href=d.url,u.href=u.href,d.crossDomain=zt.protocol+"//"+zt.host!=u.protocol+"//"+u.host}catch(e){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=v.param(d.data,d.traditional)),kt(Tt,d,r,A),c)return A;for(h in(f=v.event&&d.global)&&0==v.active++&&v.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!St.test(d.type),o=d.url.replace(Dt,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(_t,"+")):(p=d.url.slice(o.length),d.data&&(o+=(vt.test(o)?"&":"?")+d.data,delete d.data),!1===d.cache&&(o=o.replace(At,"$1"),p=(vt.test(o)?"&":"?")+"_="+mt+++p),d.url=o+p),d.ifModified&&(v.lastModified[o]&&A.setRequestHeader("If-Modified-Since",v.lastModified[o]),v.etag[o]&&A.setRequestHeader("If-None-Match",v.etag[o])),(d.data&&d.hasContent&&!1!==d.contentType||r.contentType)&&A.setRequestHeader("Content-Type",d.contentType),A.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+$t+"; q=0.01":""):d.accepts["*"]),d.headers)A.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(m,A,d)||c))return A.abort();if(D="abort",b.add(d.complete),A.done(d.success),A.fail(d.error),i=kt(Mt,d,r,A)){if(A.readyState=1,f&&g.trigger("ajaxSend",[A,d]),c)return A;d.async&&d.timeout>0&&(l=e.setTimeout((function(){A.abort("timeout")}),d.timeout));try{c=!1,i.send(w,C)}catch(e){if(c)throw e;C(-1,e)}}else C(-1,"No Transport");function C(t,r,n,s){var u,h,p,w,_,D=r;c||(c=!0,l&&e.clearTimeout(l),i=void 0,a=s||"",A.readyState=t>0?4:0,u=t>=200&&t<300||304===t,n&&(w=function(e,t,r){for(var n,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(i in s)if(s[i]&&s[i].test(n)){l.unshift(i);break}if(l[0]in r)o=l[0];else{for(i in r){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),r[o]}(d,A,n)),w=function(e,t,r,n){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(r[e.responseFields[o]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(d,w,A,u),u?(d.ifModified&&((_=A.getResponseHeader("Last-Modified"))&&(v.lastModified[o]=_),(_=A.getResponseHeader("etag"))&&(v.etag[o]=_)),204===t||"HEAD"===d.type?D="nocontent":304===t?D="notmodified":(D=w.state,h=w.data,u=!(p=w.error))):(p=D,!t&&D||(D="error",t<0&&(t=0))),A.status=t,A.statusText=(r||D)+"",u?y.resolveWith(m,[h,D,A]):y.rejectWith(m,[A,D,p]),A.statusCode(x),x=void 0,f&&g.trigger(u?"ajaxSuccess":"ajaxError",[A,d,u?h:p]),b.fireWith(m,[A,D]),f&&(g.trigger("ajaxComplete",[A,d]),--v.active||v.event.trigger("ajaxStop")))}return A},getJSON:function(e,t,r){return v.get(e,t,r,"json")},getScript:function(e,t){return v.get(e,void 0,t,"script")}}),v.each(["get","post"],(function(e,t){v[t]=function(e,r,n,i){return v.isFunction(r)&&(i=i||n,n=r,r=void 0),v.ajax(v.extend({url:e,type:t,dataType:i,data:r,success:n},v.isPlainObject(e)&&e))}})),v._evalUrl=function(e){return v.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},v.fn.extend({wrapAll:function(e){var t;return this[0]&&(v.isFunction(e)&&(e=e.call(this[0])),t=v(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v.isFunction(e)?this.each((function(t){v(this).wrapInner(e.call(this,t))})):this.each((function(){var t=v(this),r=t.contents();r.length?r.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v.isFunction(e);return this.each((function(r){v(this).wrapAll(t?e.call(this,r):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){v(this).replaceWith(this.childNodes)})),this}}),v.expr.pseudos.hidden=function(e){return!v.expr.pseudos.visible(e)},v.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},v.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Rt={0:200,1223:204},Ot=v.ajaxSettings.xhr();d.cors=!!Ot&&"withCredentials"in Ot,d.ajax=Ot=!!Ot,v.ajaxTransport((function(t){var r,n;if(d.cors||Ot&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);r=function(e){return function(){r&&(r=n=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Rt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=r(),n=s.onerror=r("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout((function(){r&&n()}))},r=r("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(r)throw e}},abort:function(){r&&r()}}})),v.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),v.ajaxTransport("script",(function(e){var t,r;if(e.crossDomain)return{send:function(i,o){t=v("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",r=function(e){t.remove(),r=null,e&&o("error"===e.type?404:200,e.type)}),n.head.appendChild(t[0])},abort:function(){r&&r()}}}));var Ft,Nt=[],Pt=/(=)\?(?=&|$)|\?\?/;v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Nt.pop()||v.expando+"_"+mt++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",(function(t,r,n){var i,o,a,s=!1!==t.jsonp&&(Pt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Pt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=v.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Pt,"$1"+i):!1!==t.jsonp&&(t.url+=(vt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||v.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},n.always((function(){void 0===o?v(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=r.jsonpCallback,Nt.push(i)),a&&v.isFunction(o)&&o(a[0]),a=o=void 0})),"script"})),d.createHTMLDocument=((Ft=n.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ft.childNodes.length),v.parseHTML=function(e,t,r){return"string"!=typeof e?[]:("boolean"==typeof t&&(r=t,t=!1),t||(d.createHTMLDocument?((i=(t=n.implementation.createHTMLDocument("")).createElement("base")).href=n.location.href,t.head.appendChild(i)):t=n),a=!r&&[],(o=E.exec(e))?[t.createElement(o[1])]:(o=de([e],t,a),a&&a.length&&v(a).remove(),v.merge([],o.childNodes)));var i,o,a},v.fn.load=function(e,t,r){var n,i,o,a=this,s=e.indexOf(" ");return s>-1&&(n=ct(e.slice(s)),e=e.slice(0,s)),v.isFunction(t)?(r=t,t=void 0):t&&"object"==_typeof(t)&&(i="POST"),a.length>0&&v.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){o=arguments,a.html(n?v("<div>").append(v.parseHTML(e)).find(n):e)})).always(r&&function(e,t){a.each((function(){r.apply(this,o||[e.responseText,t,e])}))}),this},v.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){v.fn[t]=function(e){return this.on(t,e)}})),v.expr.pseudos.animated=function(e){return v.grep(v.timers,(function(t){return e===t.elem})).length},v.offset={setOffset:function(e,t,r){var n,i,o,a,s,l,u=v.css(e,"position"),c=v(e),f={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=v.css(e,"top"),l=v.css(e,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(a=(n=c.position()).top,i=n.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),v.isFunction(t)&&(t=t.call(e,r,v.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},v.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){v.offset.setOffset(this,e,t)}));var t,r,n,i,o=this[0];return o?o.getClientRects().length?(n=o.getBoundingClientRect(),r=(t=o.ownerDocument).documentElement,i=t.defaultView,{top:n.top+i.pageYOffset-r.clientTop,left:n.left+i.pageXOffset-r.clientLeft}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,r=this[0],n={top:0,left:0};return"fixed"===v.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),S(e[0],"html")||(n=e.offset()),n={top:n.top+v.css(e[0],"borderTopWidth",!0),left:n.left+v.css(e[0],"borderLeftWidth",!0)}),{top:t.top-n.top-v.css(r,"marginTop",!0),left:t.left-n.left-v.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===v.css(e,"position");)e=e.offsetParent;return e||me}))}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var r="pageYOffset"===t;v.fn[e]=function(n){return U(this,(function(e,n,i){var o;if(v.isWindow(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[n];o?o.scrollTo(r?o.pageXOffset:i,r?i:o.pageYOffset):e[n]=i}),e,n,arguments.length)}})),v.each(["top","left"],(function(e,t){v.cssHooks[t]=Pe(d.pixelPosition,(function(e,r){if(r)return r=Ne(e,t),Oe.test(r)?v(e).position()[t]+"px":r}))})),v.each({Height:"height",Width:"width"},(function(e,t){v.each({padding:"inner"+e,content:t,"":"outer"+e},(function(r,n){v.fn[n]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(!0===i||!0===o?"margin":"border");return U(this,(function(t,r,i){var o;return v.isWindow(t)?0===n.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?v.css(t,r,s):v.style(t,r,i,s)}),t,a?i:void 0,a)}}))})),v.fn.extend({bind:function(e,t,r){return this.on(e,null,t,r)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,r,n){return this.on(t,e,r,n)},undelegate:function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)}}),v.holdReady=function(e){e?v.readyWait++:v.ready(!0)},v.isArray=Array.isArray,v.parseJSON=JSON.parse,v.nodeName=S,void 0===(__WEBPACK_AMD_DEFINE_RESULT__=function(){return v}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__=[]))||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__);var jt=e.jQuery,Bt=e.$;return v.noConflict=function(t){return e.$===v&&(e.$=Bt),t&&e.jQuery===v&&(e.jQuery=jt),v},t||(e.jQuery=e.$=v),v})),e=this,function(e){"use strict";function t(e,t,r){e.byteLength;for(var n=0,i=r.length;n<i;n++){var o=r.charCodeAt(n);if(o<128)e.setUint8(t++,o>>>0&127|0);else if(o<2048)e.setUint8(t++,o>>>6&31|192),e.setUint8(t++,o>>>0&63|128);else if(o<65536)e.setUint8(t++,o>>>12&15|224),e.setUint8(t++,o>>>6&63|128),e.setUint8(t++,o>>>0&63|128);else{if(!(o<1114112))throw new Error("bad codepoint "+o);e.setUint8(t++,o>>>18&7|240),e.setUint8(t++,o>>>12&63|128),e.setUint8(t++,o>>>6&63|128),e.setUint8(t++,o>>>0&63|128)}}}function r(e){for(var t=0,r=0,n=e.length;r<n;r++){var i=e.charCodeAt(r);if(i<128)t+=1;else if(i<2048)t+=2;else if(i<65536)t+=3;else{if(!(i<1114112))throw new Error("bad codepoint "+i);t+=4}}return t}function n(e){var n=new ArrayBuffer(function e(t){var n=_typeof(t);if("string"===n){if((i=r(t))<32)return 1+i;if(i<256)return 2+i;if(i<65536)return 3+i;if(i<4294967296)return 5+i}if(t instanceof Uint8Array){var i;if((i=t.byteLength)<256)return 2+i;if(i<65536)return 3+i;if(i<4294967296)return 5+i}if("number"===n){if(Math.floor(t)!==t)return 9;if(t>=0){if(t<128)return 1;if(t<256)return 2;if(t<65536)return 3;if(t<4294967296)return 5;throw new Error("Number too big 0x"+t.toString(16))}if(t>=-32)return 1;if(t>=-128)return 2;if(t>=-32768)return 3;if(t>=-2147483648)return 5;throw new Error("Number too small -0x"+t.toString(16).substr(1))}if("boolean"===n||null===t)return 1;if("object"===n){var o=0;if(Array.isArray(t)){i=t.length;for(var a=0;a<i;a++)o+=e(t[a])}else{var s=Object.keys(t);for(i=s.length,a=0;a<i;a++){var l=s[a];o+=e(l)+e(t[l])}}if(i<16)return 1+o;if(i<65536)return 3+o;if(i<4294967296)return 5+o;throw new Error("Array or object too long 0x"+i.toString(16))}throw new Error("Unknown type "+n)}(e));return function e(n,i,o){var a=_typeof(n);if("string"===a){if((s=r(n))<32)return i.setUint8(o,160|s),t(i,o+1,n),1+s;if(s<256)return i.setUint8(o,217),i.setUint8(o+1,s),t(i,o+2,n),2+s;if(s<65536)return i.setUint8(o,218),i.setUint16(o+1,s),t(i,o+3,n),3+s;if(s<4294967296)return i.setUint8(o,219),i.setUint32(o+1,s),t(i,o+5,n),5+s}if(n instanceof Uint8Array){var s=n.byteLength,l=new Uint8Array(i.buffer);if(s<256)return i.setUint8(o,196),i.setUint8(o+1,s),l.set(n,o+2),2+s;if(s<65536)return i.setUint8(o,197),i.setUint16(o+1,s),l.set(n,o+3),3+s;if(s<4294967296)return i.setUint8(o,198),i.setUint32(o+1,s),l.set(n,o+5),5+s}if("number"===a){if(!isFinite(n))throw new Error("Number not finite: "+n);if(Math.floor(n)!==n)return i.setUint8(o,203),i.setFloat64(o+1,n),9;if(n>=0){if(n<128)return i.setUint8(o,n),1;if(n<256)return i.setUint8(o,204),i.setUint8(o+1,n),2;if(n<65536)return i.setUint8(o,205),i.setUint16(o+1,n),3;if(n<4294967296)return i.setUint8(o,206),i.setUint32(o+1,n),5;throw new Error("Number too big 0x"+n.toString(16))}if(n>=-32)return i.setInt8(o,n),1;if(n>=-128)return i.setUint8(o,208),i.setInt8(o+1,n),2;if(n>=-32768)return i.setUint8(o,209),i.setInt16(o+1,n),3;if(n>=-2147483648)return i.setUint8(o,210),i.setInt32(o+1,n),5;throw new Error("Number too small -0x"+(-n).toString(16).substr(1))}if(null===n)return i.setUint8(o,192),1;if("boolean"===a)return i.setUint8(o,n?195:194),1;if("object"===a){var u=0,c=Array.isArray(n);if(c)s=n.length;else{var f=Object.keys(n);s=f.length}if(s<16?(i.setUint8(o,s|(c?144:128)),u=1):s<65536?(i.setUint8(o,c?220:222),i.setUint16(o+1,s),u=3):s<4294967296&&(i.setUint8(o,c?221:223),i.setUint32(o+1,s),u=5),c)for(var h=0;h<s;h++)u+=e(n[h],i,o+u);else for(h=0;h<s;h++){var p=f[h];u+=e(p,i,o+u),u+=e(n[p],i,o+u)}return u}throw new Error("Unknown type "+a)}(e,new DataView(n),0),new Uint8Array(n)}var i=["mmtfVersion","mmtfProducer","unitCell","spaceGroup","structureId","title","depositionDate","releaseDate","experimentalMethods","resolution","rFree","rWork","bioAssemblyList","ncsOperatorList","entityList","groupList","numBonds","numAtoms","numGroups","numChains","numModels","groupsPerChain","chainsPerModel"],o=i.concat(["xCoordList","yCoordList","zCoordList","groupIdList","groupTypeList","chainIdList","bFactorList","atomIdList","altLocList","occupancyList","secStructList","insCodeList","sequenceIndexList","chainNameList","bondAtomList","bondOrderList"]);function a(e,t,r){return t?new e(t.buffer,t.byteOffset,t.byteLength/(r||1)):void 0}function s(e){return a(DataView,e)}function l(e){return a(Uint8Array,e)}function u(e){return a(Int8Array,e)}function c(e){return a(Int32Array,e,4)}function f(e,t){var r=e.length/2;t||(t=new Int16Array(r));for(var n=0,i=0;n<r;++n,i+=2)t[n]=e[i]<<8^e[i+1]<<0;return t}function h(e,t){var r=e.length/4;t||(t=new Int32Array(r));for(var n=0,i=0;n<r;++n,i+=4)t[n]=e[i]<<24^e[i+1]<<16^e[i+2]<<8^e[i+3]<<0;return t}function p(e,t){var r=e.length;t||(t=new Uint8Array(4*r));for(var n=s(t),i=0;i<r;++i)n.setInt32(4*i,e[i]);return l(t)}function d(e,t,r){var n=e.length,i=1/t;r||(r=new Float32Array(n));for(var o=0;o<n;++o)r[o]=e[o]*i;return r}function m(e,t,r){var n=e.length;r||(r=new Int32Array(n));for(var i=0;i<n;++i)r[i]=Math.round(e[i]*t);return r}function v(e,t){var r,n;if(!t){var i=0;for(r=0,n=e.length;r<n;r+=2)i+=e[r+1];t=new e.constructor(i)}var o=0;for(r=0,n=e.length;r<n;r+=2)for(var a=e[r],s=e[r+1],l=0;l<s;++l)t[o]=a,++o;return t}function g(e){if(0===e.length)return new Int32Array;var t,r,n=2;for(t=1,r=e.length;t<r;++t)e[t-1]!==e[t]&&(n+=2);var i=new Int32Array(n),o=0,a=1;for(t=1,r=e.length;t<r;++t)e[t-1]!==e[t]?(i[o]=e[t-1],i[o+1]=a,a=1,o+=2):++a;return i[o]=e[e.length-1],i[o+1]=a,i}function y(e,t){var r=e.length;t||(t=new e.constructor(r)),r&&(t[0]=e[0]);for(var n=1;n<r;++n)t[n]=e[n]+t[n-1];return t}function b(e,t){var r=e.length;t||(t=new e.constructor(r)),t[0]=e[0];for(var n=1;n<r;++n)t[n]=e[n]-e[n-1];return t}function x(e,t){var r,n,i=e instanceof Int8Array?127:32767,o=-i-1,a=e.length;if(!t){var s=0;for(r=0;r<a;++r)e[r]<i&&e[r]>o&&++s;t=new Int32Array(s)}for(r=0,n=0;r<a;){for(var l=0;e[r]===i||e[r]===o;)l+=e[r],++r;l+=e[r],++r,t[n]=l,++n}return t}function w(e,t,r){return d(x(e,c(r)),t,r)}function _(e,t,r,n){var i=new ArrayBuffer(12+n.byteLength),o=new Uint8Array(i),a=new DataView(i);return a.setInt32(0,e),a.setInt32(4,t),r&&o.set(r,8),o.set(n,12),o}function D(e){return _(2,e.length,void 0,l(e))}function A(e){return _(4,e.length,void 0,p(e))}function C(e,t){return _(5,e.length/t,p([t]),l(e))}function S(e){return _(6,e.length,void 0,p(g(e)))}function E(e){return _(8,e.length,void 0,p(g(b(e))))}function T(e,t){var r=e.length,n=p([t]),i=function(e,t){var r=e.length;t||(t=new Uint8Array(2*r));for(var n=s(t),i=0;i<r;++i)n.setInt16(2*i,e[i]);return l(t)}(function(e,t,r){return function(e,t){var r,n=t?127:32767,i=-n-1,o=e.length,a=0;for(r=0;r<o;++r)0===(u=e[r])?++a:a+=u===n||u===i?2:u>0?Math.ceil(u/n):Math.ceil(u/i);var s=t?new Int8Array(a):new Int16Array(a),l=0;for(r=0;r<o;++r){var u;if((u=e[r])>=0)for(;u>=n;)s[l]=n,++l,u-=n;else for(;u<=i;)s[l]=i,++l,u-=i;s[l]=u,++l}return s}(function(e,t,r){return b(m(e,t),void 0)}(e,t),r)}(e,t));return _(10,r,n,i)}function M(e){var t={};return i.forEach((function(r){void 0!==e[r]&&(t[r]=e[r])})),e.bondAtomList&&(t.bondAtomList=A(e.bondAtomList)),e.bondOrderList&&(t.bondOrderList=D(e.bondOrderList)),t.xCoordList=T(e.xCoordList,1e3),t.yCoordList=T(e.yCoordList,1e3),t.zCoordList=T(e.zCoordList,1e3),e.bFactorList&&(t.bFactorList=T(e.bFactorList,100)),e.atomIdList&&(t.atomIdList=E(e.atomIdList)),e.altLocList&&(t.altLocList=S(e.altLocList)),e.occupancyList&&(t.occupancyList=function(e,t){return _(9,e.length,p([t]),p(function(e,t){return g(m(e,t))}(e,t)))}(e.occupancyList,100)),t.groupIdList=E(e.groupIdList),t.groupTypeList=A(e.groupTypeList),e.secStructList&&(t.secStructList=D(e.secStructList)),e.insCodeList&&(t.insCodeList=S(e.insCodeList)),e.sequenceIndexList&&(t.sequenceIndexList=E(e.sequenceIndexList)),t.chainIdList=C(e.chainIdList,4),e.chainNameList&&(t.chainNameList=C(e.chainNameList,4)),t}function $(e){var t=0,r=new DataView(e.buffer);function n(e){for(var t={},r=0;r<e;r++)t[s()]=s();return t}function i(r){var n=e.subarray(t,t+r);return t+=r,n}function o(r){var n=e.subarray(t,t+r);if(t+=r,r>65535){for(var i=[],o=0;o<n.length;o+=65535)i.push(String.fromCharCode.apply(null,n.subarray(o,o+65535)));return i.join("")}return String.fromCharCode.apply(null,n)}function a(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=s();return t}function s(){var s,l,u=e[t];if(0==(128&u))return t++,u;if(128==(240&u))return t++,n(l=15&u);if(144==(240&u))return t++,a(l=15&u);if(160==(224&u))return t++,o(l=31&u);if(224==(224&u))return s=r.getInt8(t),t++,s;switch(u){case 192:return t++,null;case 194:return t++,!1;case 195:return t++,!0;case 196:return l=r.getUint8(t+1),t+=2,i(l);case 197:return l=r.getUint16(t+1),t+=3,i(l);case 198:return l=r.getUint32(t+1),t+=5,i(l);case 202:return s=r.getFloat32(t+1),t+=5,s;case 203:return s=r.getFloat64(t+1),t+=9,s;case 204:return s=e[t+1],t+=2,s;case 205:return s=r.getUint16(t+1),t+=3,s;case 206:return s=r.getUint32(t+1),t+=5,s;case 208:return s=r.getInt8(t+1),t+=2,s;case 209:return s=r.getInt16(t+1),t+=3,s;case 210:return s=r.getInt32(t+1),t+=5,s;case 217:return l=r.getUint8(t+1),t+=2,o(l);case 218:return l=r.getUint16(t+1),t+=3,o(l);case 219:return l=r.getUint32(t+1),t+=5,o(l);case 220:return l=r.getUint16(t+1),t+=3,a(l);case 221:return l=r.getUint32(t+1),t+=5,a(l);case 222:return l=r.getUint16(t+1),t+=3,n(l);case 223:return l=r.getUint32(t+1),t+=5,n(l)}throw new Error("Unknown type 0x"+u.toString(16))}return s()}function z(e,t,r,n){switch(e){case 1:return function(e,t){var r=e.length;t||(t=new Float32Array(r/4));for(var n=s(t),i=s(e),o=0,a=0,l=r/4;o<l;++o,a+=4)n.setFloat32(a,i.getFloat32(a),!0);return t}(t);case 2:return u(t);case 3:return f(t);case 4:return h(t);case 5:return l(t);case 6:return v(h(t),new Uint8Array(r));case 7:return v(h(t));case 8:return y(v(h(t)),void 0);case 9:return function(e,t,r){return d(v(e,c(r)),t,r)}(h(t),h(n)[0]);case 10:return function(e,t,r){var n=x(e,c(r));return function(e,t,r){return d(y(e,c(r)),t,r)}(n,t,a(Float32Array,n,4))}(f(t),h(n)[0]);case 11:return d(f(t),h(n)[0]);case 12:return w(f(t),h(n)[0]);case 13:return w(u(t),h(n)[0]);case 14:return x(f(t));case 15:return x(u(t))}}function L(e,t){var r=(t=t||{}).ignoreFields,n={};return o.forEach((function(t){var i,o,a,l,u,c=!!r&&-1!==r.indexOf(t),f=e[t];c||void 0===f||(f instanceof Uint8Array?n[t]=z.apply(null,(a=(o=s(i=f)).getInt32(0),l=o.getInt32(4),u=i.subarray(8,12),[a,i=i.subarray(12),l,u])):n[t]=f)})),n}function k(e){return String.fromCharCode.apply(null,e).replace(/\0/g,"")}var I="http://mmtf.rcsb.org/v1.0/",R=I+"full/",O=I+"reduced/";function F(e,t){return e instanceof ArrayBuffer&&(e=new Uint8Array(e)),L(e instanceof Uint8Array?$(e):e,t)}function N(e,t,r,n){var i=new XMLHttpRequest;i.addEventListener("load",(function(){try{var e=F(i.response);r(e)}catch(e){n(e)}}),!0),i.addEventListener("error",n,!0),i.responseType="arraybuffer",i.open("GET",t+e.toUpperCase()),i.send()}e.encode=function(e){return n(M(e))},e.decode=F,e.traverse=function(e,t,r){var n,i,o,a,s,l,u=(r=r||{}).firstModelOnly,c=t.onModel,f=t.onChain,h=t.onGroup,p=t.onAtom,d=t.onBond,m=0,v=0,g=0,y=0,b=0,x=-1,w=e.chainNameList,_=e.secStructList,D=e.insCodeList,A=e.sequenceIndexList,C=e.atomIdList,S=e.bFactorList,E=e.altLocList,T=e.occupancyList,M=e.bondAtomList,$=e.bondOrderList;for(n=0,i=e.chainsPerModel.length;n<i&&!(u&&m>0);++n){var z=e.chainsPerModel[m];for(c&&c({chainCount:z,modelIndex:m}),o=0;o<z;++o){var L=e.groupsPerChain[v];if(f){var I=k(e.chainIdList.subarray(4*v,4*v+4)),R=null;w&&(R=k(w.subarray(4*v,4*v+4))),f({groupCount:L,chainIndex:v,modelIndex:m,chainId:I,chainName:R})}for(a=0;a<L;++a){var O=e.groupList[e.groupTypeList[g]],F=O.atomNameList.length;if(h){var N=null;_&&(N=_[g]);var P=null;e.insCodeList&&(P=String.fromCharCode(D[g]));var j=null;A&&(j=A[g]),h({atomCount:F,groupIndex:g,chainIndex:v,modelIndex:m,groupId:e.groupIdList[g],groupType:e.groupTypeList[g],groupName:O.groupName,singleLetterCode:O.singleLetterCode,chemCompType:O.chemCompType,secStruct:N,insCode:P,sequenceIndex:j})}for(s=0;s<F;++s){if(p){var B=null;C&&(B=C[y]);var U=null;S&&(U=S[y]);var V=null;E&&(V=String.fromCharCode(E[y]));var q=null;T&&(q=T[y]),p({atomIndex:y,groupIndex:g,chainIndex:v,modelIndex:m,atomId:B,element:O.elementList[s],atomName:O.atomNameList[s],formalCharge:O.formalChargeList[s],xCoord:e.xCoordList[y],yCoord:e.yCoordList[y],zCoord:e.zCoordList[y],bFactor:U,altLoc:V,occupancy:q})}y+=1}if(d){var G=O.bondAtomList;for(s=0,l=O.bondOrderList.length;s<l;++s)d({atomIndex1:y-F+G[2*s],atomIndex2:y-F+G[2*s+1],bondOrder:O.bondOrderList[s]})}g+=1}v+=1}if(b=x+1,x=y-1,d&&M)for(s=0,l=M.length;s<l;s+=2){var H=M[s],W=M[s+1];(H>=b&&H<=x||W>=b&&W<=x)&&d({atomIndex1:H,atomIndex2:W,bondOrder:$?$[s/2]:null})}m+=1}},e.fetch=function(e,t,r){N(e,R,t,r)},e.fetchReduced=function(e,t,r){N(e,O,t,r)},e.version="v1.0.0",e.fetchUrl=R,e.fetchReducedUrl=O,e.encodeMsgpack=n,e.encodeMmtf=M,e.decodeMsgpack=$,e.decodeMmtf=L,Object.defineProperty(e,"__esModule",{value:!0})}(e.MMTF=e.MMTF||{}),function(e){"object"==_typeof(exports)&&void 0!==module?module.exports=e():(__WEBPACK_AMD_DEFINE_ARRAY__=[],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=e)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}((function(){return function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){if(!s&&("function"==typeof require&&require))return require(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=r[a]={exports:{}};t[a][0].call(u.exports,(function(e){return i(t[a][1][e]||e)}),u,u.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=_typeof(r))throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(n)},{}],2:[function(e,t,r){"use strict";var n=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",a=0;a<t;a++)r+=String.fromCharCode(e[a]);return r}a[254]=a[254]=1,r.string2buf=function(e){var t,r,i,o,a,s=e.length,l=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(l),a=0,o=0;a<l;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,i,o,s=t||e.length,u=new Array(2*s);for(n=0,r=0;r<s;)if((i=e[r++])<128)u[n++]=i;else if((o=a[i])>4)u[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<s;)i=i<<6|63&e[r++],o--;o>1?u[n++]=65533:i<65536?u[n++]=i:(i-=65536,u[n++]=55296|i>>10&1023,u[n++]=56320|1023&i)}return l(u,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+a[e[r]]>t?r:t}},{"./common":1}],3:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},{}],4:[function(e,t,r){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},{}],6:[function(e,t,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],7:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,i,o,a,s,l,u,c,f,h,p,d,m,v,g,y,b,x,w,_,D,A,C,S;r=e.state,n=e.next_in,C=e.input,i=n+(e.avail_in-5),o=e.next_out,S=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),l=r.dmax,u=r.wsize,c=r.whave,f=r.wnext,h=r.window,p=r.hold,d=r.bits,m=r.lencode,v=r.distcode,g=(1<<r.lenbits)-1,y=(1<<r.distbits)-1;e:do{d<15&&(p+=C[n++]<<d,d+=8,p+=C[n++]<<d,d+=8),b=m[p&g];t:for(;;){if(p>>>=x=b>>>24,d-=x,0==(x=b>>>16&255))S[o++]=65535&b;else{if(!(16&x)){if(0==(64&x)){b=m[(65535&b)+(p&(1<<x)-1)];continue t}if(32&x){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&b,(x&=15)&&(d<x&&(p+=C[n++]<<d,d+=8),w+=p&(1<<x)-1,p>>>=x,d-=x),d<15&&(p+=C[n++]<<d,d+=8,p+=C[n++]<<d,d+=8),b=v[p&y];r:for(;;){if(p>>>=x=b>>>24,d-=x,!(16&(x=b>>>16&255))){if(0==(64&x)){b=v[(65535&b)+(p&(1<<x)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(_=65535&b,d<(x&=15)&&(p+=C[n++]<<d,(d+=8)<x&&(p+=C[n++]<<d,d+=8)),(_+=p&(1<<x)-1)>l){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=x,d-=x,_>(x=o-a)){if((x=_-x)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(D=0,A=h,0===f){if(D+=u-x,x<w){w-=x;do{S[o++]=h[D++]}while(--x);D=o-_,A=S}}else if(f<x){if(D+=u+f-x,(x-=f)<w){w-=x;do{S[o++]=h[D++]}while(--x);if(D=0,f<w){w-=x=f;do{S[o++]=h[D++]}while(--x);D=o-_,A=S}}}else if(D+=f-x,x<w){w-=x;do{S[o++]=h[D++]}while(--x);D=o-_,A=S}for(;w>2;)S[o++]=A[D++],S[o++]=A[D++],S[o++]=A[D++],w-=3;w&&(S[o++]=A[D++],w>1&&(S[o++]=A[D++]))}else{D=o-_;do{S[o++]=S[D++],S[o++]=S[D++],S[o++]=S[D++],w-=3}while(w>2);w&&(S[o++]=S[D++],w>1&&(S[o++]=S[D++]))}break}}break}}while(n<i&&o<s);n-=w=d>>3,p&=(1<<(d-=w<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=p,r.bits=d}},{}],8:[function(e,t,r){"use strict";var n=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),a=e("./inffast"),s=e("./inftrees"),l=-2,u=12,c=30;function f(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):l}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,p(e)):l}function m(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?l:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,d(e))):l}function v(e,t){var r,n;return e?(n=new h,e.state=n,n.window=null,0!==(r=m(e,t))&&(e.state=null),r):l}var g,y,b=!0;function x(e){if(b){var t;for(g=new n.Buf32(512),y=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,g,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,y,0,e.work,{bits:5}),b=!1}e.lencode=g,e.lenbits=9,e.distcode=y,e.distbits=5}r.inflateReset=d,r.inflateReset2=m,r.inflateResetKeep=p,r.inflateInit=function(e){return v(e,15)},r.inflateInit2=v,r.inflate=function(e,t){var r,h,p,d,m,v,g,y,b,w,_,D,A,C,S,E,T,M,$,z,L,k,I,R,O=0,F=new n.Buf8(4),N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return l;(r=e.state).mode===u&&(r.mode=13),m=e.next_out,p=e.output,g=e.avail_out,d=e.next_in,h=e.input,v=e.avail_in,y=r.hold,b=r.bits,w=v,_=g,k=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;b<16;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}if(2&r.wrap&&35615===y){r.check=0,F[0]=255&y,F[1]=y>>>8&255,r.check=o(r.check,F,2,0),y=0,b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&y)<<8)+(y>>8))%31){e.msg="incorrect header check",r.mode=c;break}if(8!=(15&y)){e.msg="unknown compression method",r.mode=c;break}if(b-=4,L=8+(15&(y>>>=4)),0===r.wbits)r.wbits=L;else if(L>r.wbits){e.msg="invalid window size",r.mode=c;break}r.dmax=1<<L,e.adler=r.check=1,r.mode=512&y?10:u,y=0,b=0;break;case 2:for(;b<16;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}if(r.flags=y,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=c;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=c;break}r.head&&(r.head.text=y>>8&1),512&r.flags&&(F[0]=255&y,F[1]=y>>>8&255,r.check=o(r.check,F,2,0)),y=0,b=0,r.mode=3;case 3:for(;b<32;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}r.head&&(r.head.time=y),512&r.flags&&(F[0]=255&y,F[1]=y>>>8&255,F[2]=y>>>16&255,F[3]=y>>>24&255,r.check=o(r.check,F,4,0)),y=0,b=0,r.mode=4;case 4:for(;b<16;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}r.head&&(r.head.xflags=255&y,r.head.os=y>>8),512&r.flags&&(F[0]=255&y,F[1]=y>>>8&255,r.check=o(r.check,F,2,0)),y=0,b=0,r.mode=5;case 5:if(1024&r.flags){for(;b<16;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}r.length=y,r.head&&(r.head.extra_len=y),512&r.flags&&(F[0]=255&y,F[1]=y>>>8&255,r.check=o(r.check,F,2,0)),y=0,b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((D=r.length)>v&&(D=v),D&&(r.head&&(L=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,d,D,L)),512&r.flags&&(r.check=o(r.check,h,D,d)),v-=D,d+=D,r.length-=D),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===v)break e;D=0;do{L=h[d+D++],r.head&&L&&r.length<65536&&(r.head.name+=String.fromCharCode(L))}while(L&&D<v);if(512&r.flags&&(r.check=o(r.check,h,D,d)),v-=D,d+=D,L)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===v)break e;D=0;do{L=h[d+D++],r.head&&L&&r.length<65536&&(r.head.comment+=String.fromCharCode(L))}while(L&&D<v);if(512&r.flags&&(r.check=o(r.check,h,D,d)),v-=D,d+=D,L)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;b<16;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}if(y!==(65535&r.check)){e.msg="header crc mismatch",r.mode=c;break}y=0,b=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=u;break;case 10:for(;b<32;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}e.adler=r.check=f(y),y=0,b=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=m,e.avail_out=g,e.next_in=d,e.avail_in=v,r.hold=y,r.bits=b,2;e.adler=r.check=1,r.mode=u;case u:if(5===t||6===t)break e;case 13:if(r.last){y>>>=7&b,b-=7&b,r.mode=27;break}for(;b<3;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}switch(r.last=1&y,b-=1,3&(y>>>=1)){case 0:r.mode=14;break;case 1:if(x(r),r.mode=20,6===t){y>>>=2,b-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=c}y>>>=2,b-=2;break;case 14:for(y>>>=7&b,b-=7&b;b<32;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}if((65535&y)!=(y>>>16^65535)){e.msg="invalid stored block lengths",r.mode=c;break}if(r.length=65535&y,y=0,b=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(D=r.length){if(D>v&&(D=v),D>g&&(D=g),0===D)break e;n.arraySet(p,h,d,D,m),v-=D,d+=D,g-=D,m+=D,r.length-=D;break}r.mode=u;break;case 17:for(;b<14;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}if(r.nlen=257+(31&y),y>>>=5,b-=5,r.ndist=1+(31&y),y>>>=5,b-=5,r.ncode=4+(15&y),y>>>=4,b-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=c;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;b<3;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}r.lens[N[r.have++]]=7&y,y>>>=3,b-=3}for(;r.have<19;)r.lens[N[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,I={bits:r.lenbits},k=s(0,r.lens,0,19,r.lencode,0,r.work,I),r.lenbits=I.bits,k){e.msg="invalid code lengths set",r.mode=c;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;E=(O=r.lencode[y&(1<<r.lenbits)-1])>>>16&255,T=65535&O,!((S=O>>>24)<=b);){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}if(T<16)y>>>=S,b-=S,r.lens[r.have++]=T;else{if(16===T){for(R=S+2;b<R;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}if(y>>>=S,b-=S,0===r.have){e.msg="invalid bit length repeat",r.mode=c;break}L=r.lens[r.have-1],D=3+(3&y),y>>>=2,b-=2}else if(17===T){for(R=S+3;b<R;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}b-=S,L=0,D=3+(7&(y>>>=S)),y>>>=3,b-=3}else{for(R=S+7;b<R;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}b-=S,L=0,D=11+(127&(y>>>=S)),y>>>=7,b-=7}if(r.have+D>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=c;break}for(;D--;)r.lens[r.have++]=L}}if(r.mode===c)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=c;break}if(r.lenbits=9,I={bits:r.lenbits},k=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,I),r.lenbits=I.bits,k){e.msg="invalid literal/lengths set",r.mode=c;break}if(r.distbits=6,r.distcode=r.distdyn,I={bits:r.distbits},k=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,I),r.distbits=I.bits,k){e.msg="invalid distances set",r.mode=c;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(v>=6&&g>=258){e.next_out=m,e.avail_out=g,e.next_in=d,e.avail_in=v,r.hold=y,r.bits=b,a(e,_),m=e.next_out,p=e.output,g=e.avail_out,d=e.next_in,h=e.input,v=e.avail_in,y=r.hold,b=r.bits,r.mode===u&&(r.back=-1);break}for(r.back=0;E=(O=r.lencode[y&(1<<r.lenbits)-1])>>>16&255,T=65535&O,!((S=O>>>24)<=b);){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}if(E&&0==(240&E)){for(M=S,$=E,z=T;E=(O=r.lencode[z+((y&(1<<M+$)-1)>>M)])>>>16&255,T=65535&O,!(M+(S=O>>>24)<=b);){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}y>>>=M,b-=M,r.back+=M}if(y>>>=S,b-=S,r.back+=S,r.length=T,0===E){r.mode=26;break}if(32&E){r.back=-1,r.mode=u;break}if(64&E){e.msg="invalid literal/length code",r.mode=c;break}r.extra=15&E,r.mode=22;case 22:if(r.extra){for(R=r.extra;b<R;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}r.length+=y&(1<<r.extra)-1,y>>>=r.extra,b-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;E=(O=r.distcode[y&(1<<r.distbits)-1])>>>16&255,T=65535&O,!((S=O>>>24)<=b);){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}if(0==(240&E)){for(M=S,$=E,z=T;E=(O=r.distcode[z+((y&(1<<M+$)-1)>>M)])>>>16&255,T=65535&O,!(M+(S=O>>>24)<=b);){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}y>>>=M,b-=M,r.back+=M}if(y>>>=S,b-=S,r.back+=S,64&E){e.msg="invalid distance code",r.mode=c;break}r.offset=T,r.extra=15&E,r.mode=24;case 24:if(r.extra){for(R=r.extra;b<R;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}r.offset+=y&(1<<r.extra)-1,y>>>=r.extra,b-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=c;break}r.mode=25;case 25:if(0===g)break e;if(D=_-g,r.offset>D){if((D=r.offset-D)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=c;break}D>r.wnext?(D-=r.wnext,A=r.wsize-D):A=r.wnext-D,D>r.length&&(D=r.length),C=r.window}else C=p,A=m-r.offset,D=r.length;D>g&&(D=g),g-=D,r.length-=D;do{p[m++]=C[A++]}while(--D);0===r.length&&(r.mode=21);break;case 26:if(0===g)break e;p[m++]=r.length,g--,r.mode=21;break;case 27:if(r.wrap){for(;b<32;){if(0===v)break e;v--,y|=h[d++]<<b,b+=8}if(_-=g,e.total_out+=_,r.total+=_,_&&(e.adler=r.check=r.flags?o(r.check,p,_,m-_):i(r.check,p,_,m-_)),_=g,(r.flags?y:f(y))!==r.check){e.msg="incorrect data check",r.mode=c;break}y=0,b=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;b<32;){if(0===v)break e;v--,y+=h[d++]<<b,b+=8}if(y!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=c;break}y=0,b=0}r.mode=29;case 29:k=1;break e;case c:k=-3;break e;case 31:return-4;case 32:default:return l}return e.next_out=m,e.avail_out=g,e.next_in=d,e.avail_in=v,r.hold=y,r.bits=b,(r.wsize||_!==e.avail_out&&r.mode<c&&(r.mode<27||4!==t))&&function(e,t,r,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}(e,e.output,e.next_out,_-e.avail_out)?(r.mode=31,-4):(w-=e.avail_in,_-=e.avail_out,e.total_in+=w,e.total_out+=_,r.total+=_,r.wrap&&_&&(e.adler=r.check=r.flags?o(r.check,p,_,e.next_out-_):i(r.check,p,_,e.next_out-_)),e.data_type=r.bits+(r.last?64:0)+(r.mode===u?128:0)+(20===r.mode||15===r.mode?256:0),(0===w&&0===_||4===t)&&0===k&&(k=-5),k)},r.inflateEnd=function(e){if(!e||!e.state)return l;var t=e.state;return t.window&&(t.window=null),e.state=null,0},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?l:(r.head=t,t.done=!1,0):l},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,r){"use strict";var n=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,l,u,c,f,h){var p,d,m,v,g,y,b,x,w,_=h.bits,D=0,A=0,C=0,S=0,E=0,T=0,M=0,$=0,z=0,L=0,k=null,I=0,R=new n.Buf16(16),O=new n.Buf16(16),F=null,N=0;for(D=0;D<=15;D++)R[D]=0;for(A=0;A<l;A++)R[t[r+A]]++;for(E=_,S=15;S>=1&&0===R[S];S--);if(E>S&&(E=S),0===S)return u[c++]=20971520,u[c++]=20971520,h.bits=1,0;for(C=1;C<S&&0===R[C];C++);for(E<C&&(E=C),$=1,D=1;D<=15;D++)if($<<=1,($-=R[D])<0)return-1;if($>0&&(0===e||1!==S))return-1;for(O[1]=0,D=1;D<15;D++)O[D+1]=O[D]+R[D];for(A=0;A<l;A++)0!==t[r+A]&&(f[O[t[r+A]]++]=A);if(0===e?(k=F=f,y=19):1===e?(k=i,I-=257,F=o,N-=257,y=256):(k=a,F=s,y=-1),L=0,A=0,D=C,g=c,T=E,M=0,m=-1,v=(z=1<<E)-1,1===e&&z>852||2===e&&z>592)return 1;for(;;){b=D-M,f[A]<y?(x=0,w=f[A]):f[A]>y?(x=F[N+f[A]],w=k[I+f[A]]):(x=96,w=0),p=1<<D-M,C=d=1<<T;do{u[g+(L>>M)+(d-=p)]=b<<24|x<<16|w|0}while(0!==d);for(p=1<<D-1;L&p;)p>>=1;if(0!==p?(L&=p-1,L+=p):L=0,A++,0==--R[D]){if(D===S)break;D=t[r+f[A]]}if(D>E&&(L&v)!==m){for(0===M&&(M=E),g+=C,$=1<<(T=D-M);T+M<S&&!(($-=R[T+M])<=0);)T++,$<<=1;if(z+=1<<T,1===e&&z>852||2===e&&z>592)return 1;u[m=L&v]=E<<24|T<<16|g-c|0}}return 0!==L&&(u[g+L]=D-M<<24|64<<16|0),h.bits=E,0}},{"../utils/common":1}],10:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],"/lib/inflate.js":[function(e,t,r){"use strict";var n=e("./zlib/inflate.js"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),l=e("./zlib/zstream"),u=e("./zlib/gzheader"),c=Object.prototype.toString,f=function(e){this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);this.header=new u,n.inflateGetHeader(this.strm,this.header)};function h(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg;return r.result}f.prototype.push=function(e,t){var r,s,l,u,f,h=this.strm,p=this.options.chunkSize;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?h.input=o.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(p),h.next_out=0,h.avail_out=p),(r=n.inflate(h,a.Z_NO_FLUSH))!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==a.Z_STREAM_END&&(0!==h.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(h.output,h.next_out),u=h.next_out-l,f=o.buf2string(h.output,l),h.next_out=u,h.avail_out=p-u,u&&i.arraySet(h.output,h.output,l,u,0),this.onData(f)):this.onData(i.shrinkBuf(h.output,h.next_out))))}while(h.avail_in>0&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),h.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=f,r.inflate=h,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},r.ungzip=h},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate.js":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")})),t=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}([function(e,t,r){"use strict";function n(e){e.offset%4!=0&&e.skip(4-e.offset%4)}e.exports.notNetcdf=function(e,t){if(e)throw new TypeError("Not a valid NetCDF v3.x file: "+t)},e.exports.padding=n,e.exports.readName=function(e){var t=e.readUint32(),r=e.readChars(t);return n(e),r}},function(e,t,r){"use strict";var n=r(0).notNetcdf,i={BYTE:1,CHAR:2,SHORT:3,INT:4,FLOAT:5,DOUBLE:6};function o(e,t){if(1!==e){for(var r=new Array(e),n=0;n<e;n++)r[n]=t();return r}return t()}e.exports=i,e.exports.num2str=function(e){switch(Number(e)){case i.BYTE:return"byte";case i.CHAR:return"char";case i.SHORT:return"short";case i.INT:return"int";case i.FLOAT:return"float";case i.DOUBLE:return"double";default:return"undefined"}},e.exports.num2bytes=function(e){switch(Number(e)){case i.BYTE:case i.CHAR:return 1;case i.SHORT:return 2;case i.INT:case i.FLOAT:return 4;case i.DOUBLE:return 8;default:return-1}},e.exports.str2num=function(e){switch(String(e)){case"byte":return i.BYTE;case"char":return i.CHAR;case"short":return i.SHORT;case"int":return i.INT;case"float":return i.FLOAT;case"double":return i.DOUBLE;default:return-1}},e.exports.readType=function(e,t,r){switch(t){case i.BYTE:return e.readBytes(r);case i.CHAR:return 0===(a=e.readChars(r)).charCodeAt(a.length-1)?a.substring(0,a.length-1):a;case i.SHORT:return o(r,e.readInt16.bind(e));case i.INT:return o(r,e.readInt32.bind(e));case i.FLOAT:return o(r,e.readFloat32.bind(e));case i.DOUBLE:return o(r,e.readFloat64.bind(e));default:return void n(!0,"non valid type "+t)}var a}},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==("undefined"==typeof window?"undefined":_typeof(window))&&(r=window)}e.exports=r},function(e,t,r){"use strict";var n=r(1);e.exports.nonRecord=function(e,t){for(var r=n.str2num(t.type),i=t.size/n.num2bytes(r),o=new Array(i),a=0;a<i;a++)o[a]=n.readType(e,r,1);return o},e.exports.record=function(e,t,r){for(var i=n.str2num(t.type),o=t.size?t.size/n.num2bytes(i):1,a=r.length,s=new Array(a),l=r.recordStep,u=0;u<a;u++){var c=e.offset;s[u]=n.readType(e,i,o),e.seek(c+l)}return s}},function(e,t,r){"use strict";var n=r(0),i=r(1);function o(e){var t=e.readUint32();if(0===t)return n.notNetcdf(0!==e.readUint32(),"wrong empty tag for list of attributes"),[];n.notNetcdf(12!==t,"wrong tag for list of attributes");for(var r=e.readUint32(),o=new Array(r),a=0;a<r;a++){var s=n.readName(e),l=e.readUint32();n.notNetcdf(l<1||l>6,"non valid type "+l);var u=e.readUint32(),c=i.readType(e,l,u);n.padding(e),o[a]={name:s,type:i.num2str(l),value:c}}return o}e.exports=function(e,t){var r={recordDimension:{length:e.readUint32()}};r.version=t;var a=function(e){var t,r,i=e.readUint32();if(0===i)return n.notNetcdf(0!==e.readUint32(),"wrong empty tag for list of dimensions"),[];n.notNetcdf(10!==i,"wrong tag for list of dimensions");for(var o=e.readUint32(),a=new Array(o),s=0;s<o;s++){var l=n.readName(e),u=e.readUint32();0===u&&(t=s,r=l),a[s]={name:l,size:u}}return{dimensions:a,recordId:t,recordName:r}}(e);r.recordDimension.id=a.recordId,r.recordDimension.name=a.recordName,r.dimensions=a.dimensions,r.globalAttributes=o(e);var s=function(e,t,r){var a=e.readUint32(),s=0;if(0===a)return n.notNetcdf(0!==e.readUint32(),"wrong empty tag for list of variables"),[];n.notNetcdf(11!==a,"wrong tag for list of variables");for(var l=e.readUint32(),u=new Array(l),c=0;c<l;c++){for(var f=n.readName(e),h=e.readUint32(),p=new Array(h),d=0;d<h;d++)p[d]=e.readUint32();var m=o(e),v=e.readUint32();n.notNetcdf(v<1&&v>6,"non valid type "+v);var g=e.readUint32(),y=e.readUint32();2===r&&(n.notNetcdf(y>0,"offsets larger than 4GB not supported"),y=e.readUint32()),p[0]===t&&(s+=g),u[c]={name:f,dimensions:p,attributes:m,type:i.num2str(v),size:g,offset:y,record:p[0]===t}}return{variables:u,recordStep:s}}(e,a.recordId,t);return r.variables=s.variables,r.recordDimension.recordStep=s.recordStep,r}},function(e,t,r){"use strict";(function(t){var n=r(11),i=[];e.exports=function(){function e(t,r){_classCallCheck(this,e),r=r||{};var n=!1;void 0===t&&(t=8192),"number"==typeof t?t=new ArrayBuffer(t):(n=!0,this._lastWrittenByte=t.byteLength);var i=r.offset?r.offset>>>0:0,o=t.byteLength-i,a=i;t.buffer&&(t.byteLength!==t.buffer.byteLength&&(a=t.byteOffset+i),t=t.buffer),this._lastWrittenByte=n?o:0,this.buffer=t,this.length=o,this.byteLength=o,this.byteOffset=a,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,a,o),this._mark=0,this._marks=[]}return _createClass(e,[{key:"available",value:function(e){return void 0===e&&(e=1),this.offset+e<=this.length}},{key:"isLittleEndian",value:function(){return this.littleEndian}},{key:"setLittleEndian",value:function(){return this.littleEndian=!0,this}},{key:"isBigEndian",value:function(){return!this.littleEndian}},{key:"setBigEndian",value:function(){return this.littleEndian=!1,this}},{key:"skip",value:function(e){return void 0===e&&(e=1),this.offset+=e,this}},{key:"seek",value:function(e){return this.offset=e,this}},{key:"mark",value:function(){return this._mark=this.offset,this}},{key:"reset",value:function(){return this.offset=this._mark,this}},{key:"pushMark",value:function(){return this._marks.push(this.offset),this}},{key:"popMark",value:function(){var e=this._marks.pop();if(void 0===e)throw new Error("Mark stack empty");return this.seek(e),this}},{key:"rewind",value:function(){return this.offset=0,this}},{key:"ensureAvailable",value:function(e){if(void 0===e&&(e=1),!this.available(e)){var t=2*(this.offset+e),r=new Uint8Array(t);r.set(new Uint8Array(this.buffer)),this.buffer=r.buffer,this.length=this.byteLength=t,this._data=new DataView(this.buffer)}return this}},{key:"readBoolean",value:function(){return 0!==this.readUint8()}},{key:"readInt8",value:function(){return this._data.getInt8(this.offset++)}},{key:"readUint8",value:function(){return this._data.getUint8(this.offset++)}},{key:"readByte",value:function(){return this.readUint8()}},{key:"readBytes",value:function(e){void 0===e&&(e=1);for(var t=new Uint8Array(e),r=0;r<e;r++)t[r]=this.readByte();return t}},{key:"readInt16",value:function(){var e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}},{key:"readUint16",value:function(){var e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}},{key:"readInt32",value:function(){var e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}},{key:"readUint32",value:function(){var e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}},{key:"readFloat32",value:function(){var e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}},{key:"readFloat64",value:function(){var e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}},{key:"readChar",value:function(){return String.fromCharCode(this.readInt8())}},{key:"readChars",value:function(e){void 0===e&&(e=1),i.length=e;for(var t=0;t<e;t++)i[t]=this.readChar();return i.join("")}},{key:"readUtf8",value:function(e){void 0===e&&(e=1);var t=this.readChars(e);return n.decode(t)}},{key:"writeBoolean",value:function(e){return this.writeUint8(e?255:0),this}},{key:"writeInt8",value:function(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}},{key:"writeUint8",value:function(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}},{key:"writeByte",value:function(e){return this.writeUint8(e)}},{key:"writeBytes",value:function(e){this.ensureAvailable(e.length);for(var t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}},{key:"writeInt16",value:function(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}},{key:"writeUint16",value:function(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}},{key:"writeInt32",value:function(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}},{key:"writeUint32",value:function(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}},{key:"writeFloat32",value:function(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}},{key:"writeFloat64",value:function(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}},{key:"writeChar",value:function(e){return this.writeUint8(e.charCodeAt(0))}},{key:"writeChars",value:function(e){for(var t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t));return this}},{key:"writeUtf8",value:function(e){var t=n.encode(e);return this.writeChars(t)}},{key:"toArray",value:function(){return new Uint8Array(this.buffer,this.byteOffset,this._lastWrittenByte)}},{key:"getBuffer",value:function(){return void 0!==t?t.from(this.toArray()):this.toArray()}},{key:"_updateLastWrittenByte",value:function(){this.offset>this._lastWrittenByte&&(this._lastWrittenByte=this.offset)}}]),e}()}).call(t,r(8).Buffer)},function(e,t,r){"use strict";var n=r(5),i=r(0),o=r(3),a=r(4);e.exports=function(){function e(t){_classCallCheck(this,e);var r=new n(t);r.setBigEndian(),i.notNetcdf("CDF"!==r.readChars(3),"should start with CDF");var o=r.readByte();i.notNetcdf(o>2,"unknown version"),this.header=a(r,o),this.buffer=r}return _createClass(e,[{key:"getDataVariable",value:function(e){var t;return t="string"==typeof e?this.header.variables.find((function(t){return t.name===e})):e,i.notNetcdf(void 0===t,"variable not found"),this.buffer.seek(t.offset),t.record?o.record(this.buffer,t,this.header.recordDimension):o.nonRecord(this.buffer,t)}},{key:"version",get:function(){return 1===this.header.version?"classic format":"64-bit offset format"}},{key:"recordDimension",get:function(){return this.header.recordDimension}},{key:"dimensions",get:function(){return this.header.dimensions}},{key:"globalAttributes",get:function(){return this.header.globalAttributes}},{key:"variables",get:function(){return this.header.variables}}]),e}()},function(e,t,r){"use strict";t.byteLength=function(e){return 3*e.length/4-u(e)},t.toByteArray=function(e){var t,r,n,a,s,l,c=e.length;s=u(e),l=new o(3*c/4-s),n=s>0?c-4:c;var f=0;for(t=0,r=0;t<n;t+=4,r+=3)a=i[e.charCodeAt(t)]<<18|i[e.charCodeAt(t+1)]<<12|i[e.charCodeAt(t+2)]<<6|i[e.charCodeAt(t+3)],l[f++]=a>>16&255,l[f++]=a>>8&255,l[f++]=255&a;return 2===s?(a=i[e.charCodeAt(t)]<<2|i[e.charCodeAt(t+1)]>>4,l[f++]=255&a):1===s&&(a=i[e.charCodeAt(t)]<<10|i[e.charCodeAt(t+1)]<<4|i[e.charCodeAt(t+2)]>>2,l[f++]=a>>8&255,l[f++]=255&a),l},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o="",a=[],s=0,l=r-i;s<l;s+=16383)a.push(c(e,s,s+16383>l?l:s+16383));return 1===i?(t=e[r-1],o+=n[t>>2],o+=n[t<<4&63],o+="=="):2===i&&(t=(e[r-2]<<8)+e[r-1],o+=n[t>>10],o+=n[t>>4&63],o+=n[t<<2&63],o+="="),a.push(o),a.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s<l;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function c(e,t,r){for(var i,o,a=[],s=t;s<r;s+=3)i=(e[s]<<16)+(e[s+1]<<8)+e[s+2],a.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t,r){"use strict";(function(e){var n=r(7),i=r(9),o=r(10);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,r){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return u(this,e,t,r)}function u(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=h(e,t),e}(e,t,r,n):"string"==typeof t?function(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!l.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(t,r),i=(e=s(e,n)).write(t,r);return i!==n&&(e=e.slice(0,i)),e}(e,t,r):function(e,t){if(l.isBuffer(t)){var r=0|p(t.length);return 0===(e=s(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(c(t),e=s(e,t<0?0:0|p(t)),!l.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t){var r=t.length<0?0:0|p(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(n)return B(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return $(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return M(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){var o,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;o<s;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+l>s&&(r=s-l),o=r;o>=0;o--){for(var f=!0,h=0;h<l;h++)if(u(e,o+h)!==u(t,h)){f=!1;break}if(f)return o}return-1}function b(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function x(e,t,r,n){return V(B(t,e.length-r),e,r,n)}function w(e,t,r,n){return V(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return w(e,t,r,n)}function D(e,t,r,n){return V(U(t),e,r,n)}function A(e,t,r,n){return V(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function C(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,l,u=e[i],c=null,f=u>239?4:u>223?3:u>191?2:1;if(i+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=E));return r}(n)}t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,r){return u(null,e,t,r)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,r){return function(e,t,r,n){return c(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},l.allocUnsafe=function(e){return f(null,e)},l.allocUnsafeSlow=function(e){return f(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=l.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},l.byteLength=d,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)v(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?S(this,0,e):m.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,r,n,i){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),c=e.slice(t,r),f=0;f<s;++f)if(u[f]!==c[f]){o=u[f],a=c[f];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return D(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function T(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function M(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function $(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=j(e[o]);return i}function z(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function L(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function R(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function O(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,o){return o||O(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function N(e,t,r,n,o){return o||O(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=l.prototype;else{var i=t-e;r=new l(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},l.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},l.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||L(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t|=0,r|=0,n||k(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);k(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);k(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return N(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return N(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=l.isBuffer(e)?e:B(new l(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var P=/[^+\/0-9A-Za-z-_]/g;function j(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(P,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(t,r(2))},function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,u=l>>1,c=-7,f=r?i-1:0,h=r?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+f],f+=h,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=u}return(p?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,l,u=8*o-i-1,c=(1<<u)-1,f=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*l-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[r+p]=255&a,p+=d,a/=256,u-=8);e[r+p-d]|=128*m}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(e,n){var i;!function(o){_typeof(t);var a=("object"==_typeof(e)&&e&&e.exports,"object"==_typeof(n)&&n);a.global!==a&&a.window;var s,l,u,c=String.fromCharCode;function f(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function h(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function p(e,t){return c(e>>t&63|128)}function d(e){if(0==(4294967168&e))return c(e);var t="";return 0==(4294965248&e)?t=c(e>>6&31|192):0==(4294901760&e)?(h(e),t=c(e>>12&15|224),t+=p(e,6)):0==(4292870144&e)&&(t=c(e>>18&7|240),t+=p(e,12),t+=p(e,6)),t+c(63&e|128)}function m(){if(u>=l)throw Error("Invalid byte index");var e=255&s[u];if(u++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function v(){var e,t;if(u>l)throw Error("Invalid byte index");if(u==l)return!1;if(e=255&s[u],u++,0==(128&e))return e;if(192==(224&e)){if((t=(31&e)<<6|m())>=128)return t;throw Error("Invalid continuation byte")}if(224==(240&e)){if((t=(15&e)<<12|m()<<6|m())>=2048)return h(t),t;throw Error("Invalid continuation byte")}if(240==(248&e)&&(t=(7&e)<<18|m()<<12|m()<<6|m())>=65536&&t<=1114111)return t;throw Error("Invalid UTF-8 detected")}var g={version:"2.1.2",encode:function(e){for(var t=f(e),r=t.length,n=-1,i="";++n<r;)i+=d(t[n]);return i},decode:function(e){s=f(e),l=s.length,u=0;for(var t,r=[];!1!==(t=v());)r.push(t);return function(e){for(var t,r=e.length,n=-1,i="";++n<r;)(t=e[n])>65535&&(i+=c((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=c(t);return i}(r)}};void 0===(i=function(){return g}.call(t,r,t,e))||(e.exports=i)}()}).call(t,r(12)(e),r(2))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}])},"object"==_typeof(exports)&&"object"==_typeof(module)?module.exports=t():(__WEBPACK_AMD_DEFINE_ARRAY__=[],void 0===(__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof(__WEBPACK_AMD_DEFINE_FACTORY__=t)?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__)||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)),$3Dmol=window.$3Dmol||{},"object"==_typeof(module)&&"object"==_typeof(module.exports)&&(module.exports=$3Dmol),$3Dmol.notrack||$.get("https://3dmol.csb.pitt.edu/track/report.cgi"),String.prototype.startsWith||(String.prototype.startsWith=function(e){return 0===this.lastIndexOf(e,0)}),String.prototype.endsWith||(String.prototype.endsWith=function(e){return-1!==this.indexOf(e,this.length-e.length)}),$.ajaxTransport("+binary",(function(e,t,r){if(window.FormData&&(e.dataType&&"binary"==e.dataType||e.data&&(window.ArrayBuffer&&e.data instanceof ArrayBuffer||window.Blob&&e.data instanceof Blob)))return{send:function(t,r){var n=new XMLHttpRequest,i=e.url,o=e.type,a=e.async||!0,s=e.responseType||"blob",l=e.data||null,u=e.username||null,c=e.password||null,f=function(){var t={};t[e.dataType]=n.response,r(n.status,n.statusText,t,n.getAllResponseHeaders())};for(var h in n.addEventListener("load",f),n.addEventListener("error",f),n.addEventListener("abort",f),n.open(o,i,a,u,c),t)n.setRequestHeader(h,t[h]);n.responseType=s,n.send(l)},abort:function(){r.abort()}}})),$3Dmol.createViewer=function(e,t,r){if("string"===$.type(e)&&(e=$("#"+e)),e){t=t||{},r=r||{};try{return new $3Dmol.GLViewer(e,t,r)}catch(e){throw"error creating viewer: "+e}return null}},$3Dmol.createViewerGrid=function(e,t,r){if("string"===$.type(e)&&(e=$("#"+e)),e){t=t||{},r=r||{};var n=[],i=document.createElement("canvas");r.rows=t.rows,r.cols=t.cols,r.control_all=null!=t.control_all&&t.control_all,$(e).append($(i));try{for(var o=0;o<t.rows;o++){for(var a=[],s=0;s<t.cols;s++){r.row=o,r.col=s,r.canvas=i,r.viewers=n,r.control_all=t.control_all;var l=$3Dmol.createViewer(e,r);a.push(l)}n.unshift(a)}}catch(e){throw"error creating viewer grid: "+e}return n}},$3Dmol.viewers={},$3Dmol.getbin=function(e,t,r,n){var i=new Promise((function(t,i){r=null==r?"GET":r,$.ajax({url:e,dataType:"binary",method:r,data:n,responseType:"arraybuffer",processData:!1}).done((function(e){t(e)})).fail((function(e,t){console.log(t),i()}))}));return t?i.then(t):i},$3Dmol.base64ToArray=function(e){for(var t=window.atob(e),r=t.length,n=new Uint8Array(r),i=0;i<r;i++)n[i]=t.charCodeAt(i);return n},$3Dmol.download=function(e,t,r,n){var i="",o="",a="",s="",l=null,u=t.addModel();if("mmtf:"===e.substr(0,5))o=r&&r.pdbUri?r.pdbUri:"https://mmtf.rcsb.org/v1.0/full/",e=e.substr(5).toUpperCase(),s=o+e,r&&void 0===r.noComputeSecondaryStructure&&(r.noComputeSecondaryStructure=!0),l=new Promise((function(e){$3Dmol.getbin(s).then((function(n){u.addMolData(n,"mmtf",r),t.zoomTo(),t.render(),e(u)}))}));else{if("pdb:"===e.substr(0,4)){if(i="mmtf",r&&r.format&&(i=r.format),r&&void 0===r.noComputeSecondaryStructure&&(r.noComputeSecondaryStructure=!0),!(e=e.substr(4).toUpperCase()).match(/^[1-9][A-Za-z0-9]{3}$/))return void alert("Wrong PDB ID");"mmtf"==i?(a=r&&r.mmtfUri?r.mmtfUri:"https://mmtf.rcsb.org/v1.0/full/",s=a+e.toUpperCase()):(o=r&&r.pdbUri?r.pdbUri:"https://files.rcsb.org/view/",s=o+e+"."+i)}else if("cid:"==e.substr(0,4)){if(i="sdf",!(e=e.substr(4)).match(/^[0-9]+$/))return void alert("Wrong Compound ID");s="https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/"+e+"/SDF?record_type=3d"}else"url:"==e.substr(0,4)&&(s=e.substr(4),i=s);var c=function(e){u.addMolData(e,i,r),t.zoomTo(),t.render()};l=new Promise((function(e){"mmtf"==i?$3Dmol.getbin(s).then((function(t){c(t),e(u)})):$.get(s,(function(t){c(t),e(u)})).fail((function(e){console.log("fetch of "+s+" failed: "+e.statusText)}))}))}return n?(l.then((function(e){n(e)})),u):l},$3Dmol.SurfaceType={VDW:1,MS:2,SAS:3,SES:4},$3Dmol.mergeGeos=function(e,t){var r=t.geometry;void 0!==r&&e.geometryGroups.push(r.geometryGroups[0])},$3Dmol.multiLineString=function(e){return e.toString().replace(/^[^\/]+\/\*!?/,"").replace(/\*\/[^\/]+$/,"")},$3Dmol.syncSurface=!1,(window.navigator.userAgent.indexOf("MSIE ")>=0||window.navigator.userAgent.indexOf("Trident/")>=0)&&($3Dmol.syncSurface=!0),$3Dmol.specStringToObject=function(e){if("object"==_typeof(e))return e;if(void 0===e||null==e)return e;var t=function(e){return $.isNumeric(e)?Math.floor(parseFloat(e))==parseInt(e)?parseFloat(e):e.indexOf(".")>=0?parseFloat(e):parseInt(e):"true"===e||"false"!==e&&e},r={};if("all"===(e=e.replace(/%7E/,"~")))return r;for(var n=e.split(";"),i=0;i<n.length;i++){var o=n[i].split(":"),a=o[0],s={},l=o[1];if(l)if(-1!==(l=l.replace(/~/g,"=")).indexOf("="))for(var u=l.split(","),c=0;c<u.length;c++){var f=u[c].split("=",2);s[f[0]]=t(f[1])}else s=-1!==l.indexOf(",")?l.split(","):t(l);r[a]=s}return r},$3Dmol.getExtent=function(e,t){var r,n,i,o,a,s,l,u,c,f,h=!t;if(r=n=i=9999,o=a=s=-9999,l=u=c=f=0,0===e.length)return[[0,0,0],[0,0,0],[0,0,0]];for(var p=0;p<e.length;p++){var d=e[p];if(void 0!==d&&isFinite(d.x)&&isFinite(d.y)&&isFinite(d.z)&&(f++,l+=d.x,u+=d.y,c+=d.z,r=r<d.x?r:d.x,n=n<d.y?n:d.y,i=i<d.z?i:d.z,o=o>d.x?o:d.x,a=a>d.y?a:d.y,s=s>d.z?s:d.z,d.symmetries&&h))for(var m=0;m<d.symmetries.length;m++)f++,l+=d.symmetries[m].x,u+=d.symmetries[m].y,c+=d.symmetries[m].z,r=r<d.symmetries[m].x?r:d.symmetries[m].x,n=n<d.symmetries[m].y?n:d.symmetries[m].y,i=i<d.symmetries[m].z?i:d.symmetries[m].z,o=o>d.symmetries[m].x?o:d.symmetries[m].x,a=a>d.symmetries[m].y?a:d.symmetries[m].y,s=s>d.symmetries[m].z?s:d.symmetries[m].z}return[[r,n,i],[o,a,s],[l/f,u/f,c/f]]},$3Dmol.getAtomProperty=function(e,t){var r=null;return e.properties&&void 0!==e.properties[t]?r=e.properties[t]:void 0!==e[t]&&(r=e[t]),r},$3Dmol.getPropertyRange=function(e,t){for(var r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,i=0,o=e.length;i<o;i++){var a=e[i],s=$3Dmol.getAtomProperty(a,t);null!=s&&(s<r&&(r=s),s>n&&(n=s))}return isFinite(r)||isFinite(n)?isFinite(r)?isFinite(n)||(n=r):r=n:r=n=0,[r,n]},__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return $3Dmol}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),void 0!==__WEBPACK_AMD_DEFINE_RESULT__&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),$3Dmol.createStereoViewer=function(e){var t=this;if("string"===$.type(e)&&(e=$("#"+e)),e){var r=$3Dmol.createViewerGrid(e,{rows:1,cols:2,control_all:!0});this.glviewer1=r[0][0],this.glviewer2=r[0][1],this.glviewer1.setAutoEyeSeparation(!1),this.glviewer2.setAutoEyeSeparation(!0),this.glviewer1.linkViewer(this.glviewer2),this.glviewer2.linkViewer(this.glviewer1);for(var n=Object.getOwnPropertyNames(this.glviewer1).filter((function(e){return"function"==typeof t.glviewer1[e]})),i=0;i<n.length;i++)this[n[i]]=function(e){return function(){var t=this.glviewer1[e].apply(this.glviewer1,arguments),r=this.glviewer2[e].apply(this.glviewer2,arguments);return[t,r]}}(n[i]);this.setCoordinates=function(e,t,r){for(var n=0;n<e.length;n++)e[n].setCoordinates(t,r)},this.surfacesFinished=function(){return this.glviewer1.surfacesFinished()&&this.glviewer2.surfacesFinished()},this.isAnimated=function(){return this.glviewer1.isAnimated()||this.glviewer2.isAnimated()},this.render=function(e){this.glviewer1.render(),this.glviewer2.render(),e&&e(this)},this.getCanvas=function(){return this.glviewer1.getCanvas()}}};var $3Dmol=$3Dmol||{};$3Dmol.Math={clamp:function(e,t,r){return Math.min(Math.max(e,t),r)},degToRad:function(){var e=Math.PI/180;return function(t){return t*e}}()},$3Dmol.Quaternion=function(e,t,r,n){this.x=e||0,this.y=t||0,this.z=r||0,this.w=void 0!==n?n:1},$3Dmol.Quaternion.prototype={constructor:$3Dmol.Quaternion,set:function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},conjugate:function(){return this.x*=-1,this.y*=-1,this.z*=-1,this},inverse:function(){return this.conjugate().normalize()},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthxyz:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){var e=this.length();return 0===e?(this.x=0,this.y=0,this.z=0,this.w=1):(e=1/e,this.x*=e,this.y*=e,this.z*=e,this.w*=e),this},multiply:function(e){return this.multiplyQuaternions(this,e)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},multiplyQuaternions:function(e,t){var r=e.x,n=e.y,i=e.z,o=e.w,a=t.x,s=t.y,l=t.z,u=t.w;return this.x=r*u+o*a+n*l-i*s,this.y=n*u+o*s+i*a-r*l,this.z=i*u+o*l+r*s-n*a,this.w=o*u-r*a-n*s-i*l,this},sub:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this},clone:function(){return new $3Dmol.Quaternion(this.x,this.y,this.z,this.w)},setFromEuler:function(e){var t=Math.cos(e.x/2),r=Math.cos(e.y/2),n=Math.cos(e.z/2),i=Math.sin(e.x/2),o=Math.sin(e.y/2),a=Math.sin(e.z/2);return this.x=i*r*n+t*o*a,this.y=t*o*n-i*r*a,this.z=t*r*a+i*o*n,this.w=t*r*n-i*o*a,this}},$3Dmol.Vector2=function(e,t){this.x=e||0,this.y=t||0},$3Dmol.Vector2.prototype={constructor:$3Dmol.Vector2,set:function(e,t){return this.x=e,this.y=t,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},copy:function(e){return this.x=e.x,this.y=e.y,this},clone:function(){return new $3Dmol.Vector2(this.x,this.y)}},$3Dmol.Vector3=function(e,t,r){this.x=e||0,this.y=t||0,this.z=r||0},$3Dmol.Vector3.prototype={constructor:$3Dmol.Vector3,set:function(e,t,r){return this.x=e,this.y=t,this.z=r,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},sub:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},divideScalar:function(e){return 0!==e?(this.x/=e,this.y/=e,this.z/=e):(this.x=0,this.y=0,this.z=0),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n+i[12],this.y=i[1]*t+i[5]*r+i[9]*n+i[13],this.z=i[2]*t+i[6]*r+i[10]*n+i[14],this},applyProjection:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements,o=i[3]*t+i[7]*r+i[11]*n+i[15];return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])/o,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])/o,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])/o,this},applyQuaternion:function(e){var t=this.x,r=this.y,n=this.z,i=e.x,o=e.y,a=e.z,s=e.w,l={};l.x=2*(r*a-n*o),l.y=2*(n*i-t*a),l.z=2*(t*o-r*i);var u={};return u.x=l.y*a-l.z*o,u.y=l.z*i-l.x*a,u.z=l.x*o-l.y*i,this.x=t+s*l.x+u.x,this.y=r+s*l.y+u.y,this.z=n+s*l.z+u.z,this},negate:function(){return this.multiplyScalar(-1)},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},normalize:function(){return this.divideScalar(this.length())},cross:function(e){var t=this.x,r=this.y,n=this.z;return this.x=r*e.z-n*e.y,this.y=n*e.x-t*e.z,this.z=t*e.y-r*e.x,this},crossVectors:function(e,t){return this.x=e.y*t.z-e.z*t.y,this.y=e.z*t.x-e.x*t.z,this.z=e.x*t.y-e.y*t.x,this},getPositionFromMatrix:function(e){return this.x=e.elements[12],this.y=e.elements[13],this.z=e.elements[14],this},setEulerFromRotationMatrix:function(e,t){var r=e.elements,n=r[0],i=r[4],o=r[8],a=r[5],s=r[9],l=r[6],u=r[10];return void 0===t||"XYZ"===t?(this.y=Math.asin($3Dmol.Math.clamp(o,-1,1)),Math.abs(o)<.99999?(this.x=Math.atan2(-s,u),this.z=Math.atan2(-i,n)):(this.x=Math.atan2(l,a),this.z=0)):console.error("Error with vector's setEulerFromRotationMatrix: Unknown order: "+t),this},rotateAboutVector:function(e,t){e.normalize();var r=Math.cos(t),n=Math.sin(t),i=this.clone().multiplyScalar(r),o=e.clone().cross(this).multiplyScalar(n),a=e.clone().multiplyScalar(e.clone().dot(this)).multiplyScalar(1-r),s=i.add(o).add(a);return this.x=s.x,this.y=s.y,this.z=s.z,this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},transformDirection:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize()},clone:function(){return new $3Dmol.Vector3(this.x,this.y,this.z)}},$3Dmol.Matrix3=function(e,t,r,n,i,o,a,s,l){this.elements=new Float32Array(9),this.set(void 0!==e?e:1,t||0,r||0,n||0,void 0!==i?i:1,o||0,a||0,s||0,void 0!==l?l:1)},$3Dmol.Matrix3.prototype={constructor:$3Dmol.Matrix3,set:function(e,t,r,n,i,o,a,s,l){var u=this.elements;return u[0]=e,u[3]=t,u[6]=r,u[1]=n,u[4]=i,u[7]=o,u[2]=a,u[5]=s,u[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},copy:function(e){var t=e.elements;this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},getInverse:function(e,t){var r=e.elements,n=this.elements;n[0]=r[10]*r[5]-r[6]*r[9],n[1]=-r[10]*r[1]+r[2]*r[9],n[2]=r[6]*r[1]-r[2]*r[5],n[3]=-r[10]*r[4]+r[6]*r[8],n[4]=r[10]*r[0]-r[2]*r[8],n[5]=-r[6]*r[0]+r[2]*r[4],n[6]=r[9]*r[4]-r[5]*r[8],n[7]=-r[9]*r[0]+r[1]*r[8],n[8]=r[5]*r[0]-r[1]*r[4];var i=r[0]*n[0]+r[1]*n[3]+r[2]*n[6];if(0===i){var o="Matrix3.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(o);return console.warn(o),this.identity(),this}return this.multiplyScalar(1/i),this},getDeterminant:function(){var e=this.elements;return e[0]*e[4]*e[8]+e[1]*e[5]*e[6]+e[2]*e[3]*e[7]-e[2]*e[4]*e[6]-e[1]*e[3]*e[8]-e[0]*e[5]*e[7]},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},clone:function(){var e=this.elements;return new $3Dmol.Matrix3(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])}},$3Dmol.Matrix4=function(e,t,r,n,i,o,a,s,l,u,c,f,h,p,d,m){if(void 0===t&&void 0!==e)this.elements=new Float32Array(e);else{var v=this.elements=new Float32Array(16);v[0]=void 0!==e?e:1,v[4]=t||0,v[8]=r||0,v[12]=n||0,v[1]=i||0,v[5]=void 0!==o?o:1,v[9]=a||0,v[13]=s||0,v[2]=l||0,v[6]=u||0,v[10]=void 0!==c?c:1,v[14]=f||0,v[3]=h||0,v[7]=p||0,v[11]=d||0,v[15]=void 0!==m?m:1}},$3Dmol.Matrix4.prototype={constructor:$3Dmol.Matrix4,set:function(e,t,r,n,i,o,a,s,l,u,c,f,h,p,d,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=r,v[12]=n,v[1]=i,v[5]=o,v[9]=a,v[13]=s,v[2]=l,v[6]=u,v[10]=c,v[14]=f,v[3]=h,v[7]=p,v[11]=d,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},copy:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15]),this},matrix3FromTopLeft:function(){var e=this.elements;return new $3Dmol.Matrix3(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10])},setRotationFromEuler:function(e,t){var r=this.elements,n=e.x,i=e.y,o=e.z,a=Math.cos(n),s=Math.sin(n),l=Math.cos(i),u=Math.sin(i),c=Math.cos(o),f=Math.sin(o);if(void 0===t||"XYZ"===t){var h=a*c,p=a*f,d=s*c,m=s*f;r[0]=l*c,r[4]=-l*f,r[8]=u,r[1]=p+d*u,r[5]=h-m*u,r[9]=-s*l,r[2]=m-h*u,r[6]=d+p*u,r[10]=a*l}else console.error("Error with matrix4 setRotationFromEuler. Order: "+t);return this},setRotationFromQuaternion:function(e){var t=this.elements,r=e.x,n=e.y,i=e.z,o=e.w,a=r+r,s=n+n,l=i+i,u=r*a,c=r*s,f=r*l,h=n*s,p=n*l,d=i*l,m=o*a,v=o*s,g=o*l;return t[0]=1-(h+d),t[4]=c-g,t[8]=f+v,t[1]=c+g,t[5]=1-(u+d),t[9]=p-m,t[2]=f-v,t[6]=p+m,t[10]=1-(u+h),this},lookAt:function(){var e=new $3Dmol.Vector3,t=new $3Dmol.Vector3,r=new $3Dmol.Vector3;return function(n,i,o){var a=this.elements;return r.subVectors(n,i).normalize(),0===r.length()&&(r.z=1),e.crossVectors(o,r).normalize(),0===e.length()&&(r.x+=1e-4,e.crossVectors(o,r).normalize()),t.crossVectors(r,e),a[0]=e.x,a[4]=t.x,a[8]=r.x,a[1]=e.y,a[5]=t.y,a[9]=r.y,a[2]=e.z,a[6]=t.z,a[10]=r.z,this}}(),multiplyMatrices:function(e,t){var r=e.elements,n=t.elements,i=this.elements,o=r[0],a=r[4],s=r[8],l=r[12],u=r[1],c=r[5],f=r[9],h=r[13],p=r[2],d=r[6],m=r[10],v=r[14],g=r[3],y=r[7],b=r[11],x=r[15],w=n[0],_=n[4],D=n[8],A=n[12],C=n[1],S=n[5],E=n[9],T=n[13],M=n[2],$=n[6],z=n[10],L=n[14],k=n[3],I=n[7],R=n[11],O=n[15];return i[0]=o*w+a*C+s*M+l*k,i[4]=o*_+a*S+s*$+l*I,i[8]=o*D+a*E+s*z+l*R,i[12]=o*A+a*T+s*L+l*O,i[1]=u*w+c*C+f*M+h*k,i[5]=u*_+c*S+f*$+h*I,i[9]=u*D+c*E+f*z+h*R,i[13]=u*A+c*T+f*L+h*O,i[2]=p*w+d*C+m*M+v*k,i[6]=p*_+d*S+m*$+v*I,i[10]=p*D+d*E+m*z+v*R,i[14]=p*A+d*T+m*L+v*O,i[3]=g*w+y*C+b*M+x*k,i[7]=g*_+y*S+b*$+x*I,i[11]=g*D+y*E+b*z+x*R,i[15]=g*A+y*T+b*L+x*O,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},makeTranslation:function(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},getPosition:function(){var e=new $3Dmol.Vector3;return function(){console.warn("DEPRECATED: Matrix4's .getPosition() has been removed. Use Vector3.getPositionFromMatrix( matrix ) instead.");var t=this.elements;return e.set(t[12],t[13],t[14])}}(),setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var r=this.elements,n=e.elements,i=n[0],o=n[4],a=n[8],s=n[12],l=n[1],u=n[5],c=n[9],f=n[13],h=n[2],p=n[6],d=n[10],m=n[14],v=n[3],g=n[7],y=n[11],b=n[15];r[0]=c*m*g-f*d*g+f*p*y-u*m*y-c*p*b+u*d*b,r[4]=s*d*g-a*m*g-s*p*y+o*m*y+a*p*b-o*d*b,r[8]=a*f*g-s*c*g+s*u*y-o*f*y-a*u*b+o*c*b,r[12]=s*c*p-a*f*p-s*u*d+o*f*d+a*u*m-o*c*m,r[1]=f*d*v-c*m*v-f*h*y+l*m*y+c*h*b-l*d*b,r[5]=a*m*v-s*d*v+s*h*y-i*m*y-a*h*b+i*d*b,r[9]=s*c*v-a*f*v-s*l*y+i*f*y+a*l*b-i*c*b,r[13]=a*f*h-s*c*h+s*l*d-i*f*d-a*l*m+i*c*m,r[2]=u*m*v-f*p*v+f*h*g-l*m*g-u*h*b+l*p*b,r[6]=s*p*v-o*m*v-s*h*g+i*m*g+o*h*b-i*p*b,r[10]=o*f*v-s*u*v+s*l*g-i*f*g-o*l*b+i*u*b,r[14]=s*u*h-o*f*h-s*l*p+i*f*p+o*l*m-i*u*m,r[3]=c*p*v-u*d*v-c*h*g+l*d*g+u*h*y-l*p*y,r[7]=o*d*v-a*p*v+a*h*g-i*d*g-o*h*y+i*p*y,r[11]=a*u*v-o*c*v-a*l*g+i*c*g+o*l*y-i*u*y,r[15]=o*c*h-a*u*h+a*l*p-i*c*p-o*l*d+i*u*d;var x=n[0]*r[0]+n[1]*r[4]+n[2]*r[8]+n[3]*r[12];if(0===x){var w="Matrix4.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(w);return console.warn(w),this.identity(),this}return this.multiplyScalar(1/x),this},isReflected:function(){return this.matrix3FromTopLeft().getDeterminant()<0},compose:function(){var e=new $3Dmol.Matrix4,t=new $3Dmol.Matrix4;return function(r,n,i){var o=this.elements;return e.identity(),e.setRotationFromQuaternion(n),t.makeScale(i.x,i.y,i.z),this.multiplyMatrices(e,t),o[12]=r.x,o[13]=r.y,o[14]=r.z,this}}(),getScale:function(){var e=new $3Dmol.Vector3,t=new $3Dmol.Vector3,r=new $3Dmol.Vector3;return function(n){var i=this.elements;return n=n instanceof $3Dmol.Vector3?n:new $3Dmol.Vector3,e.set(i[0],i[1],i[2]),t.set(i[4],i[5],i[6]),r.set(i[8],i[9],i[10]),n.x=e.length(),n.y=t.length(),n.z=r.length(),n}}(),decompose:function(){var e=new $3Dmol.Vector3,t=new $3Dmol.Vector3,r=new $3Dmol.Vector3,n=new $3Dmol.Matrix4;return function(i,o,a){var s=this.elements;return e.set(s[0],s[1],s[2]),t.set(s[4],s[5],s[6]),r.set(s[8],s[9],s[10]),i=i instanceof $3Dmol.Vector3?i:new $3Dmol.Vector3,o=o instanceof $3Dmol.Quaternion?o:new $3Dmol.Quaternion,(a=a instanceof $3Dmol.Vector3?a:new $3Dmol.Vector3).x=e.length(),a.y=t.length(),a.z=r.length(),i.x=s[12],i.y=s[13],i.z=s[14],n.copy(this),n.elements[0]/=a.x,n.elements[1]/=a.x,n.elements[2]/=a.x,n.elements[4]/=a.y,n.elements[5]/=a.y,n.elements[6]/=a.y,n.elements[8]/=a.z,n.elements[9]/=a.z,n.elements[10]/=a.z,o.setFromRotationMatrix(n),[i,o,a]}}(),scale:function(e){var t=this.elements,r=e.x,n=e.y,i=e.z;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,Math.max(r,n)))},makeFrustum:function(e,t,r,n,i,o){var a=this.elements,s=2*i/(t-e),l=2*i/(n-r),u=(t+e)/(t-e),c=(n+r)/(n-r),f=-(o+i)/(o-i),h=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=l,a[9]=c,a[13]=0,a[2]=0,a[6]=0,a[10]=f,a[14]=h,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makePerspective:function(e,t,r,n){var i=r*Math.tan($3Dmol.Math.degToRad(.5*e)),o=-i,a=o*t,s=i*t;return this.makeFrustum(a,s,o,i,r,n)},makeOrthographic:function(e,t,r,n,i,o){var a=this.elements,s=1/(t-e),l=1/(r-n),u=1/(o-i),c=(t+e)*s,f=(r+n)*l,h=(o+i)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-c,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-f,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-h,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},isEqual:function(e){var t=e.elements,r=this.elements;return r[0]==t[0]&&r[4]==t[4]&&r[8]==t[8]&&r[12]==t[12]&&r[1]==t[1]&&r[5]==t[5]&&r[9]==t[9]&&r[13]==t[13]&&r[2]==t[2]&&r[6]==t[6]&&r[10]==t[10]&&r[14]==t[14]&&r[3]==t[3]&&r[7]==t[7]&&r[11]==t[11]&&r[15]==t[15]},clone:function(){var e=this.elements;return new $3Dmol.Matrix4(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},isIdentity:function(){var e=this.elements;return 1==e[0]&&0==e[4]&&0==e[8]&&0==e[12]&&0==e[1]&&1==e[5]&&0==e[9]&&0==e[13]&&0==e[2]&&0==e[6]&&1==e[10]&&0==e[14]&&0==e[3]&&0==e[7]&&0==e[11]&&1==e[15]}},$3Dmol.Vector3.prototype.unproject=function(){var e=new $3Dmol.Matrix4;return function(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),$3Dmol.Ray=function(e,t){this.origin=void 0!==e?e:new $3Dmol.Vector3,this.direction=void 0!==t?t:new $3Dmol.Vector3},$3Dmol.Ray.prototype={constructor:$3Dmol.Ray,set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return(t||new $3Dmol.Vector3).copy(this.direction).multiplyScalar(e).add(this.origin)},recast:function(){var e=new $3Dmol.Vector3;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var r=t||new $3Dmol.Vector3;r.subVectors(e,this.origin);var n=r.dot(this.direction);return r.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(){var e=new $3Dmol.Vector3;return function(t){var r=e.subVectors(t,this.origin).dot(this.direction);return e.copy(this.direction).multiplyScalar(r).add(this.origin),e.distanceTo(t)}}(),isIntersectionCylinder:function(){},isIntersectionSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},isIntersectionPlane:function(e){return 0!==e.normal.dot(this.direction)||0===e.distanceToPoint(this.origin)},distanceToPlane:function(e){var t=e.normal.dot(this.direction);return 0===t?0===e.distanceToPoint(this.origin)?0:void 0:-(this.origin.dot(e.normal)+e.constant)/t},intersectPlane:function(e,t){var r=this.distanceToPlane(e);if(void 0!==r)return this.at(r,t)},applyMatrix4:function(e){return this.direction.add(this.origin).applyMatrix4(e),this.origin.applyMatrix4(e),this.direction.sub(this.origin),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)},clone:function(){return(new $3Dmol.Ray).copy(this)}},$3Dmol.Sphere=function(e,t){this.center=void 0!==e?e:new $3Dmol.Vector3,this.radius=void 0!==t?t:0},$3Dmol.Sphere.prototype={constructor:$3Dmol.Sphere,set:function(e,t){return this.center.copy(e),this.radius=t,this},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius},clone:function(){return(new $3Dmol.Sphere).copy(this)}},$3Dmol.Cylinder=function(e,t,r){this.c1=void 0!==e?e:new $3Dmol.Vector3,this.c2=void 0!==t?t:new $3Dmol.Vector3,this.direction=(new $3Dmol.Vector3).subVectors(this.c2,this.c1).normalize(),this.radius=void 0!==r?r:0},$3Dmol.Cylinder.prototype={constructor:$3Dmol.Cylinder,copy:function(e){return this.c1.copy(e.c1),this.c2.copy(e.c2),this.direction.copy(e.direction),this.radius=e.radius,this},lengthSq:function(){var e=new $3Dmol.Vector3;return function(){return e.subVectors(this.c2,this.c1).lengthSq()}}(),applyMatrix4:function(e){return this.direction.add(this.c1).applyMatrix4(e),this.c1.applyMatrix4(e),this.c2.applyMatrix4(e),this.direction.sub(this.c1).normalize(),this.radius=this.radius*e.getMaxScaleOnAxis(),this}},$3Dmol.Triangle=function(e,t,r){this.a=void 0!==e?e:new $3Dmol.Vector3,this.b=void 0!==t?t:new $3Dmol.Vector3,this.c=void 0!==r?r:new $3Dmol.Vector3},$3Dmol.Triangle.prototype={constructor:$3Dmol.Triangle,copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},applyMatrix4:function(e){return this.a.applyMatrix4(e),this.b.applyMatrix4(e),this.c.applyMatrix4(e),this},getNormal:function(){var e=new $3Dmol.Vector3;return function(){var t=this.a.clone();return t.sub(this.b),e.subVectors(this.c,this.b),t.cross(e),t.normalize(),t}}()},$3Dmol.EventDispatcher=function(){var e={};this.addEventListener=function(t,r){void 0===e[t]&&(e[t]=[]),-1===e[t].indexOf(r)&&e[t].push(r)},this.removeEventListener=function(t,r){var n=e[t].indexOf(r);-1!==n&&e[t].splice(n,1)},this.dispatchEvent=function(t){var r=e[t.type];if(void 0!==r){t.target=this;for(var n=0,i=r.length;n<i;n++)r[n].call(this,t)}}},$3Dmol.Color=function(e){return arguments.length>1?(this.r=arguments[0]||0,this.g=arguments[1]||0,this.b=arguments[2]||0,this):this.set(e)},$3Dmol.Color.prototype={constructor:$3Dmol.Color,r:0,g:0,b:0,set:function(e){if(e instanceof $3Dmol.Color)return e.clone();"number"==typeof e?this.setHex(e):"object"==_typeof(e)&&"r"in e&&"g"in e&&"b"in e&&(this.r=e.r,this.g=e.g,this.b=e.b)},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},getHex:function(){return Math.round(255*this.r)<<16|Math.round(255*this.g)<<8|Math.round(255*this.b)},clone:function(){return new $3Dmol.Color(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},scaled:function(){var e={};return e.r=Math.round(255*this.r),e.g=Math.round(255*this.g),e.b=Math.round(255*this.b),e.a=1,e}},$3Dmol.Object3D=function(){this.id=$3Dmol.Object3DIDCount++,this.name="",this.parent=void 0,this.children=[],this.position=new $3Dmol.Vector3,this.rotation=new $3Dmol.Vector3,this.matrix=new $3Dmol.Matrix4,this.matrixWorld=new $3Dmol.Matrix4,this.quaternion=new $3Dmol.Quaternion,this.eulerOrder="XYZ",this.up=new $3Dmol.Vector3(0,1,0),this.scale=new $3Dmol.Vector3(1,1,1),this.matrixAutoUpdate=!0,this.matrixWorldNeedsUpdate=!0,this.rotationAutoUpdate=!0,this.useQuaternion=!1,this.visible=!0},$3Dmol.Object3D.prototype={constructor:$3Dmol.Object3D,lookAt:function(e){this.matrix.lookAt(e,this.position,this.up),this.rotationAutoUpdate&&(!0===this.useQuaternion?this.quaternion.copy(this.matrix.decompose()[1]):this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder))},add:function(e){if(e!==this){e.parent=this,this.children.push(e);for(var t=this;void 0!==t.parent;)t=t.parent;void 0!==t&&t instanceof $3Dmol.Scene&&t.__addObject(e)}else console.error("Can't add $3Dmol.Object3D to itself")},remove:function(e){var t=this.children.indexOf(e);if(-1!==t){e.parent=void 0,this.children.splice(t,1);for(var r=this;void 0!==r.parent;)r=r.parent;void 0!==r&&r instanceof $3Dmol.Scene&&r.__removeObject(e)}},vrml:function(e){e||(e=" ");var t=2*Math.atan2(this.quaternion.lengthxyz(),this.quaternion.w),r=0,n=0,i=0;if(0!=t){var o=Math.sin(t/2);r=this.quaternion.x/o,n=this.quaternion.y/o,i=this.quaternion.z/o}var a=e+"Transform {\n"+e+" center "+this.position.x+" "+this.position.y+" "+this.position.z+"\n"+e+" rotation "+r+" "+n+" "+i+" "+t+"\n"+e+" children [\n";this.geometry&&(a+=this.geometry.vrml(e,this.material));for(var s=0;s<this.children.length;s++)a+=this.children[s].vrml(e+" ")+",\n";return(a+=" ]\n")+"}"},updateMatrix:function(){this.matrix.setPosition(this.position),!1===this.useQuaternion?this.matrix.setRotationFromEuler(this.rotation,this.eulerOrder):this.matrix.setRotationFromQuaternion(this.quaternion),1===this.scale.x&&1===this.scale.y&&1===this.scale.z||this.matrix.scale(this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){!0===this.matrixAutoUpdate&&this.updateMatrix(),!0!==this.matrixWorldNeedsUpdate&&!0!==e||(void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1;for(var t=0;t<this.children.length;t++)this.children[t].updateMatrixWorld(!0)},clone:function(e){void 0===e&&(e=new $3Dmol.Object3D),e.name=this.name,e.up.copy(this.up),e.position.copy(this.position),e.rotation.copy(this.rotation),e.eulerOrder=this.eulerOrder,e.scale.copy(this.scale),e.rotationAutoUpdate=this.rotationAutoUpdate,e.matrix.copy(this.matrix),e.matrixWorld.copy(this.matrixWorld),e.quaternion.copy(this.quaternion),e.matrixAutoUpdate=this.matrixAutoUpdate,e.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate,e.useQuaternion=this.useQuaternion,e.visible=this.visible;for(var t=0;t<this.children.length;t++){var r=this.children[t];e.add(r.clone())}return e},setVisible:function(e){this.visible=e;for(var t=0;t<this.children.length;t++)this.children[t].setVisible(e)}},$3Dmol.Object3DIDCount=0,$3Dmol.Geometry=function(){var e=function(e){this.id=e||0,this.vertexArray=null,this.colorArray=null,this.normalArray=null,this.faceArray=null,this.radiusArray=null,this.lineArray=null,this.vertices=0,this.faceidx=0,this.lineidx=0};e.prototype.setColors=function(e){var t=this.vertexArray,r=this.colorArray;if(t.length==r.length)for(var n=0;n<t.length;n+=3){var i=e(t[n],t[n+1],t[n+2]);i instanceof $3Dmol.Color||(i=$3Dmol.CC.color(i)),r[n]=i.r,r[n+1]=i.g,r[n+2]=i.b}else console.log("Cannot re-color geometry group due to mismatched lengths.")},e.prototype.getNumVertices=function(){return this.vertices},e.prototype.getVertices=function(){return this.vertexArray},e.prototype.getCentroid=function(){for(var e,t,r,n,i=new $3Dmol.Vector3,o=0;o<this.vertices;++o)e=3*o,t=this.vertexArray[e],r=this.vertexArray[e+1],n=this.vertexArray[e+2],i.x+=t,i.y+=r,i.z+=n;return i.divideScalar(this.vertices),i},e.prototype.setNormals=function(){var e=this.faceArray,t=this.vertexArray,r=this.normalArray;if(this.vertices&&this.faceidx)for(var n,i,o,a,s,l,u,c=0;c<e.length/3;++c)n=3*e[3*c],i=3*e[3*c+1],o=3*e[3*c+2],a=new $3Dmol.Vector3(t[n],t[n+1],t[n+2]),s=new $3Dmol.Vector3(t[i],t[i+1],t[i+2]),l=new $3Dmol.Vector3(t[o],t[o+1],t[o+2]),a.subVectors(a,s),l.subVectors(l,s),l.cross(a),(u=l).normalize(),r[n]+=u.x,r[i]+=u.x,r[o]+=u.x,r[n+1]+=u.y,r[i+1]+=u.y,r[o+1]+=u.y,r[n+2]+=u.z,r[i+2]+=u.z,r[o+2]+=u.z},e.prototype.setLineIndices=function(){if(this.faceidx&&(!this.lineArray||this.lineArray.length!=2*this.faceidx||this.lineidx!=2*this.faceidx)){var e=this.faceArray,t=this.lineArray=new Uint16Array(2*this.faceidx);this.lineidx=2*this.faceidx;for(var r=0;r<this.faceidx/3;++r){var n=3*r,i=2*n,o=e[n],a=e[n+1],s=e[n+2];t[i]=o,t[i+1]=a,t[i+2]=o,t[i+3]=s,t[i+4]=a,t[i+5]=s}}},e.prototype.vrml=function(e,t){var r="";r+=e+"Shape {\n"+e+" appearance Appearance {\n"+e+"  material Material {\n"+e+"   diffuseColor "+t.color.r+" "+t.color.g+" "+t.color.b+"\n",t.transparent&&(r+=e+"   transparency "+(1-t.opacity)+"\n"),r+=e+"  }\n",r+=e+" }\n";var n=e;if(e+=" ",t instanceof $3Dmol.LineBasicMaterial){r+=e+"geometry IndexedLineSet {\n"+e+" colorPerVertex TRUE\n"+e+" coord Coordinate {\n"+e+"  point [\n";for(var i=0;i<this.vertices;++i){var o=3*i;r+=e+"   "+this.vertexArray[o]+" "+this.vertexArray[o+1]+" "+this.vertexArray[o+2]+",\n"}if(r+=e+"  ]\n",r+=e+" }\n",this.colorArray){r+=e+" color Color {\n"+e+"  color [\n";for(var a=0;a<this.vertices;++a){var s=3*a;r+=e+"   "+this.colorArray[s]+" "+this.colorArray[s+1]+" "+this.colorArray[s+2]+",\n"}r+=e+"  ]\n",r+=e+" }\n"}r+=e+" coordIndex [\n";for(var l=0;l<this.vertices;l+=2)r+=e+"  "+l+", "+(l+1)+", -1,\n";r+=e+" ]\n",r+=e+"}\n"}else{r+=e+"geometry IndexedFaceSet {\n"+e+" colorPerVertex TRUE\n"+e+" normalPerVertex TRUE\n"+e+" solid FALSE\n",r+=e+" coord Coordinate {\n"+e+"  point [\n";for(var u=0;u<this.vertices;++u){var c=3*u;r+=e+"   "+this.vertexArray[c]+" "+this.vertexArray[c+1]+" "+this.vertexArray[c+2]+",\n"}r+=e+"  ]\n",r+=e+" }\n",r+=e+" normal Normal {\n"+e+"  vector [\n";for(var f=0;f<this.vertices;++f){var h=3*f;r+=e+"   "+this.normalArray[h]+" "+this.normalArray[h+1]+" "+this.normalArray[h+2]+",\n"}if(r+=e+"  ]\n",r+=e+" }\n",this.colorArray){r+=e+" color Color {\n"+e+"  color [\n";for(var p=0;p<this.vertices;++p){var d=3*p;r+=e+"   "+this.colorArray[d]+" "+this.colorArray[d+1]+" "+this.colorArray[d+2]+",\n"}r+=e+"  ]\n",r+=e+" }\n"}r+=e+" coordIndex [\n";for(var m=0;m<this.faceidx;m+=3)r+=e+"  "+this.faceArray[m]+", "+this.faceArray[m+1]+", "+this.faceArray[m+2]+", -1,\n";r+=e+" ]\n",r+=e+"}\n"}return r+(n+"}")},e.prototype.truncateArrayBuffers=function(e,t){e=!0===e;var r=this.vertexArray,n=this.colorArray,i=this.normalArray,o=this.faceArray,a=this.lineArray,s=this.radiusArray;this.vertexArray=r.subarray(0,3*this.vertices),this.colorArray=n.subarray(0,3*this.vertices),e?(this.normalArray=i.subarray(0,3*this.vertices),this.faceArray=o.subarray(0,this.faceidx),this.lineidx>0?this.lineArray=a.subarray(0,this.lineidx):this.lineArray=new Uint16Array(0)):(this.normalArray=new Float32Array(0),this.faceArray=new Uint16Array(0),this.lineArray=new Uint16Array(0)),s&&(this.radiusArray=s.subarray(0,this.vertices)),t&&(this.normalArray&&(this.normalArray=new Float32Array(this.normalArray)),this.faceArray&&(this.faceArray=new Uint16Array(this.faceArray)),this.lineArray&&(this.lineArray=new Uint16Array(this.lineArray)),this.vertexArray&&(this.vertexArray=new Float32Array(this.vertexArray)),this.colorArray&&(this.colorArray=new Float32Array(this.colorArray)),this.radiusArray&&(this.radiusArray=new Float32Array(this.radiusArray))),this.__inittedArrays=!0};var t=function(t){var r=new e(t.geometryGroups.length);return t.geometryGroups.push(r),t.groups=t.geometryGroups.length,r.vertexArray=new Float32Array(196605),r.colorArray=new Float32Array(196605),t.mesh&&(r.normalArray=new Float32Array(196605),r.faceArray=new Uint16Array(393210),r.lineArray=new Uint16Array(393210)),t.radii&&(r.radiusArray=new Float32Array(65535)),r.useOffset=t.offset,r},r=function(e,t,r){$3Dmol.EventDispatcher.call(this),this.id=$3Dmol.GeometryIDCount++,this.name="",this.hasTangents=!1,this.dynamic=!0,this.mesh=!0===e,this.radii=t||!1,this.offset=r||!1,this.verticesNeedUpdate=!1,this.elementsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.buffersNeedUpdate=!1,this.geometryGroups=[],this.groups=0};return r.prototype={constructor:r,updateGeoGroup:function(e){e=e||0;var r=this.groups>0?this.geometryGroups[this.groups-1]:null;return(!r||r.vertices+e>r.vertexArray.length/3)&&(r=t(this)),r},vrml:function(e,t){for(var r="",n=this.geometryGroups.length,i=0;i<n;i++)r+=this.geometryGroups[i].vrml(e,t)+",\n";return r},addGeoGroup:function(){return t(this)},setUpNormals:function(e){e=e||!1;for(var t=0;t<this.groups;t++)this.geometryGroups[t].setNormals(e)},setColors:function(e){for(var t=this.geometryGroups.length,r=0;r<t;r++)this.geometryGroups[r].setColors(e)},setUpWireframe:function(){for(var e=0;e<this.groups;e++)this.geometryGroups[e].setLineIndices()},initTypedArrays:function(){for(var e=0;e<this.groups;e++){var t=this.geometryGroups[e];!0!==t.__inittedArrays&&t.truncateArrayBuffers(this.mesh,!1)}},dispose:function(){this.dispatchEvent({type:"dispose"})}},r}(),Object.defineProperty($3Dmol.Geometry.prototype,"vertices",{get:function(){for(var e=0,t=0;t<this.groups;t++)e+=this.geometryGroups[t].vertices;return e}}),$3Dmol.GeometryIDCount=0,$3Dmol.Raycaster=function(){var e,t=function(e,t,r,n){this.ray=new $3Dmol.Ray(e,t),this.ray.direction.lengthSq()>0&&this.ray.direction.normalize(),this.near=n||0,this.far=r||1/0},r=new $3Dmol.Sphere,n=new $3Dmol.Cylinder,i=new $3Dmol.Triangle,o=new $3Dmol.Vector3,a=new $3Dmol.Vector3,s=new $3Dmol.Vector3,l=new $3Dmol.Vector3,u=new $3Dmol.Vector3,c=function(e,t){return e.distance-t.distance},f=function(e){return Math.min(Math.max(e,-1),1)},h=function(e,t,c,h){if(u.getPositionFromMatrix(e.matrixWorld),void 0===t.intersectionShape)return h;var p,d,m,v,g,y,b,x,w,_,D,A,C,S,E=t.intersectionShape,T=c.linePrecision,M=(T*=e.matrixWorld.getMaxScaleOnAxis())*T;if(void 0!==t.boundingSphere&&t.boundingSphere instanceof $3Dmol.Sphere&&(r.copy(t.boundingSphere),r.applyMatrix4(e.matrixWorld),!c.ray.isIntersectionSphere(r)))return h;for(p=0,d=E.triangle.length;p<d;p++)if(E.triangle[p]instanceof $3Dmol.Triangle){if(i.copy(E.triangle[p]),i.applyMatrix4(e.matrixWorld),m=i.getNormal(),(v=c.ray.direction.dot(m))>=0)continue;if(o.subVectors(i.a,c.ray.origin),(b=m.dot(o)/v)<0)continue;a.copy(c.ray.direction).multiplyScalar(b).add(c.ray.origin),a.sub(i.a),s.copy(i.b).sub(i.a),l.copy(i.c).sub(i.a);var $=s.dot(l),z=s.lengthSq(),L=l.lengthSq();if((A=(z*a.dot(l)-$*a.dot(s))/(z*L-$*$))<0||A>1)continue;if((D=(a.dot(s)-A*$)/z)<0||D>1||D+A>1)continue;h.push({clickable:t,distance:b})}for(p=0,d=E.cylinder.length;p<d;p++)if(E.cylinder[p]instanceof $3Dmol.Cylinder){if(n.copy(E.cylinder[p]),n.applyMatrix4(e.matrixWorld),o.subVectors(n.c1,c.ray.origin),g=o.dot(n.direction),y=o.dot(c.ray.direction),0==(w=1-(v=f(c.ray.direction.dot(n.direction)))*v))continue;C=(v*y-g)/w,S=(y-v*g)/w,a.copy(n.direction).multiplyScalar(C).add(n.c1),s.copy(c.ray.direction).multiplyScalar(S).add(c.ray.origin),x=l.subVectors(a,s).lengthSq();var k=n.radius*n.radius;if(x<=k){if((D=v*(A=b=(_=(v*g-y)*(v*g-y)-w*(o.lengthSq()-g*g-k))<=0?Math.sqrt(x):(y-v*g-Math.sqrt(_))/w)-g)<0||D*D>n.lengthSq()||A<0)continue;h.push({clickable:t,distance:b})}}for(p=0,d=E.line.length;p<d;p+=2){a.copy(E.line[p]),a.applyMatrix4(e.matrixWorld),s.copy(E.line[p+1]),s.applyMatrix4(e.matrixWorld),l.subVectors(s,a);var I=l.lengthSq();l.normalize(),o.subVectors(a,c.ray.origin);var R=o.dot(l);y=o.dot(c.ray.direction),0!=(w=1-(v=f(c.ray.direction.dot(l)))*v)&&(C=(v*y-R)/w,S=(y-v*R)/w,a.add(l.multiplyScalar(C)),s.copy(c.ray.direction).multiplyScalar(S).add(c.ray.origin),(x=l.subVectors(s,a).lengthSq())<M&&C*C<I&&h.push({clickable:t,distance:S}))}for(p=0,d=E.sphere.length;p<d;p++)if(E.sphere[p]instanceof $3Dmol.Sphere&&(r.copy(E.sphere[p]),r.applyMatrix4(e.matrixWorld),c.ray.isIntersectionSphere(r))){a.subVectors(r.center,c.ray.origin);var O=a.dot(c.ray.direction);return _=O*O-(a.lengthSq()-r.radius*r.radius),O<0?h:(b=_<=0?O:O-Math.sqrt(_),h.push({clickable:t,distance:b}),h)}};return t.prototype.precision=1e-4,t.prototype.linePrecision=.2,t.prototype.set=function(e,t){this.ray.set(e,t)},t.prototype.setFromCamera=(e=new $3Dmol.Matrix4,function(t,r){r.ortho?(this.ray.origin.set(t.x,t.y,(r.near+r.far)/(r.near-r.far)).unproject(r),this.ray.direction.set(0,0,-1).transformDirection(r.matrixWorld)):(this.ray.origin.setFromMatrixPosition(r.matrixWorld),this.ray.direction.set(t.x,t.y,t.z),r.projectionMatrixInverse.getInverse(r.projectionMatrix),e.multiplyMatrices(r.matrixWorld,r.projectionMatrixInverse),this.ray.direction.applyProjection(e),this.ray.direction.sub(this.ray.origin).normalize())}),t.prototype.intersectObjects=function(e,t){for(var r=[],n=0,i=t.length;n<i;n++)h(e,t[n],this,r);return r.sort(c),r},t}(),$3Dmol.Projector=function(){var e=new $3Dmol.Matrix4;this.projectVector=function(t,r){return r.matrixWorldInverse.getInverse(r.matrixWorld),e.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),t.applyProjection(e)},this.unprojectVector=function(t,r){return r.projectionMatrixInverse.getInverse(r.projectionMatrix),e.multiplyMatrices(r.matrixWorld,r.projectionMatrixInverse),t.applyProjection(e)}},$3Dmol.Camera=function(e,t,r,n,i){$3Dmol.Object3D.call(this),this.fov=void 0!==e?e:50,this.aspect=void 0!==t?t:1,this.near=void 0!==r?r:.1,this.far=void 0!==n?n:2e3,this.projectionMatrix=new $3Dmol.Matrix4,this.projectionMatrixInverse=new $3Dmol.Matrix4,this.matrixWorldInverse=new $3Dmol.Matrix4;var o=this.position.z;this.right=o*Math.tan(Math.PI/180*e),this.left=-this.right,this.top=this.right/this.aspect,this.bottom=-this.top,this.ortho=!!i,this.updateProjectionMatrix()},$3Dmol.Camera.prototype=Object.create($3Dmol.Object3D.prototype),$3Dmol.Camera.prototype.lookAt=function(e){this.matrix.lookAt(this.position,e,this.up),this.rotationAutoUpdate&&(!1===this.useQuaternion?this.rotation.setEulerFromRotationMatrix(this.matrix,this.eulerOrder):this.quaternion.copy(this.matrix.decompose()[1]))},$3Dmol.Camera.prototype.updateProjectionMatrix=function(){this.ortho?this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far):this.projectionMatrix.makePerspective(this.fov,this.aspect,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},$3Dmol.SpritePlugin=function(){var e,t,r,n={};function i(e,t){return e.z!==t.z?t.z-e.z:t.id-e.id}this.init=function(i){e=i.context,t=i,r=i.getPrecision(),n.vertices=new Float32Array(16),n.faces=new Uint16Array(6);var o=0;n.vertices[o++]=-1,n.vertices[o++]=-1,n.vertices[o++]=0,n.vertices[o++]=0,n.vertices[o++]=1,n.vertices[o++]=-1,n.vertices[o++]=1,n.vertices[o++]=0,n.vertices[o++]=1,n.vertices[o++]=1,n.vertices[o++]=1,n.vertices[o++]=1,n.vertices[o++]=-1,n.vertices[o++]=1,n.vertices[o++]=0,n.vertices[o++]=1,o=0,n.faces[o++]=0,n.faces[o++]=1,n.faces[o++]=2,n.faces[o++]=0,n.faces[o++]=2,n.faces[o++]=3,n.vertexBuffer=e.createBuffer(),n.elementBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,n.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,n.vertices,e.STATIC_DRAW),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n.elementBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,n.faces,e.STATIC_DRAW),n.program=function(t,r){var n=e.createProgram(),i=e.createShader(e.FRAGMENT_SHADER),o=e.createShader(e.VERTEX_SHADER),a="precision "+r+" float;\n";return e.shaderSource(i,a+t.fragmentShader),e.shaderSource(o,a+t.vertexShader),e.compileShader(i),e.compileShader(o),e.getShaderParameter(i,e.COMPILE_STATUS)&&e.getShaderParameter(o,e.COMPILE_STATUS)?(e.attachShader(n,i),e.attachShader(n,o),e.linkProgram(n),e.getProgramParameter(n,e.LINK_STATUS)||console.error("Could not initialize shader"),n):(console.error(e.getShaderInfoLog(i)),console.error("could not initialize shader"),null)}($3Dmol.ShaderLib.sprite,r),n.attributes={},n.uniforms={},n.attributes.position=e.getAttribLocation(n.program,"position"),n.attributes.uv=e.getAttribLocation(n.program,"uv"),n.uniforms.uvOffset=e.getUniformLocation(n.program,"uvOffset"),n.uniforms.uvScale=e.getUniformLocation(n.program,"uvScale"),n.uniforms.rotation=e.getUniformLocation(n.program,"rotation"),n.uniforms.scale=e.getUniformLocation(n.program,"scale"),n.uniforms.alignment=e.getUniformLocation(n.program,"alignment"),n.uniforms.color=e.getUniformLocation(n.program,"color"),n.uniforms.map=e.getUniformLocation(n.program,"map"),n.uniforms.opacity=e.getUniformLocation(n.program,"opacity"),n.uniforms.useScreenCoordinates=e.getUniformLocation(n.program,"useScreenCoordinates"),n.uniforms.screenPosition=e.getUniformLocation(n.program,"screenPosition"),n.uniforms.modelViewMatrix=e.getUniformLocation(n.program,"modelViewMatrix"),n.uniforms.projectionMatrix=e.getUniformLocation(n.program,"projectionMatrix"),n.uniforms.fogType=e.getUniformLocation(n.program,"fogType"),n.uniforms.fogDensity=e.getUniformLocation(n.program,"fogDensity"),n.uniforms.fogNear=e.getUniformLocation(n.program,"fogNear"),n.uniforms.fogFar=e.getUniformLocation(n.program,"fogFar"),n.uniforms.fogColor=e.getUniformLocation(n.program,"fogColor"),n.uniforms.alphaTest=e.getUniformLocation(n.program,"alphaTest")},this.render=function(r,o,a,s){var l=r.__webglSprites,u=l.length;if(u){var c=n.attributes,f=n.uniforms,h=.5*a,p=.5*s;e.useProgram(n.program),e.enableVertexAttribArray(c.position),e.enableVertexAttribArray(c.uv),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.bindBuffer(e.ARRAY_BUFFER,n.vertexBuffer),e.vertexAttribPointer(c.position,2,e.FLOAT,!1,16,0),e.vertexAttribPointer(c.uv,2,e.FLOAT,!1,16,8),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n.elementBuffer),e.uniformMatrix4fv(f.projectionMatrix,!1,o.projectionMatrix.elements),e.activeTexture(e.TEXTURE0),e.uniform1i(f.map,0);var d=0,m=0,v=r.fog;v?(e.uniform3f(f.fogColor,v.color.r,v.color.g,v.color.b),e.uniform1f(f.fogNear,v.near),e.uniform1f(f.fogFar,v.far),e.uniform1i(f.fogType,1),d=1,m=1):(e.uniform1i(f.fogType,0),d=0,m=0);var g,y,b,x,w,_=[];for(g=0;g<u;g++)b=(y=l[g]).material,y.visible&&0!==b.opacity&&(b.useScreenCoordinates?y.z=-y.position.z:(y._modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,y.matrixWorld),y.z=-y._modelViewMatrix.elements[14]));for(l.sort(i),g=0;g<u;g++)if(b=(y=l[g]).material,y.visible&&0!==b.opacity&&b.map&&b.map.image&&b.map.image.width){e.uniform1f(f.alphaTest,b.alphaTest);var D=b.map.image.width,A=b.map.image.height;_[0]=D*t.devicePixelRatio/a,_[1]=A*t.devicePixelRatio/s,!0===b.useScreenCoordinates?(e.uniform1i(f.useScreenCoordinates,1),e.uniform3f(f.screenPosition,(y.position.x*t.devicePixelRatio-h)/h,(p-y.position.y*t.devicePixelRatio)/p,Math.max(0,Math.min(1,y.position.z)))):(e.uniform1i(f.useScreenCoordinates,0),e.uniformMatrix4fv(f.modelViewMatrix,!1,y._modelViewMatrix.elements)),d!==(w=r.fog&&b.fog?m:0)&&(e.uniform1i(f.fogType,w),d=w),x=1/(b.scaleByViewport?s:1),_[0]*=x*y.scale.x,_[1]*=x*y.scale.y,e.uniform2f(f.uvScale,b.uvScale.x,b.uvScale.y),e.uniform2f(f.uvOffset,b.uvOffset.x,b.uvOffset.y),e.uniform2f(f.alignment,b.alignment.x,b.alignment.y),e.uniform1f(f.opacity,b.opacity),e.uniform3f(f.color,b.color.r,b.color.g,b.color.b),e.uniform1f(f.rotation,y.rotation),e.uniform2fv(f.scale,_),t.setDepthTest(b.depthTest),t.setDepthWrite(b.depthWrite),t.setTexture(b.map,0),e.drawElements(e.TRIANGLES,6,e.UNSIGNED_SHORT,0)}e.enable(e.CULL_FACE)}}},$3Dmol.Light=function(e,t){$3Dmol.Object3D.call(this),this.color=new $3Dmol.Color(e),this.position=new $3Dmol.Vector3(0,1,0),this.target=new $3Dmol.Object3D,this.intensity=void 0!==t?t:1,this.castShadow=!1,this.onlyShadow=!1},$3Dmol.Light.prototype=Object.create($3Dmol.Object3D.prototype),$3Dmol.Material=function(){$3Dmol.EventDispatcher.call(this),this.id=$3Dmol.MaterialIdCount++,this.name="",this.side=$3Dmol.FrontSide,this.opacity=1,this.transparent=!1,this.depthTest=!0,this.depthWrite=!0,this.stencilTest=!0,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.visible=!0,this.needsUpdate=!0},$3Dmol.Material.prototype.setValues=function(e){if(void 0!==e)for(var t in e){var r=e[t];if(void 0!==r){if(t in this){var n=this[t];n instanceof $3Dmol.Color&&r instanceof $3Dmol.Color?n.copy(r):n instanceof $3Dmol.Color?n.set(r):n instanceof $3Dmol.Vector3&&r instanceof $3Dmol.Vector3?n.copy(r):this[t]=r}}else console.warn("$3Dmol.Material: '"+t+"' parameter is undefined.")}},$3Dmol.Material.prototype.clone=function(e){return void 0===e&&(e=new $3Dmol.Material),e.name=this.name,e.side=this.side,e.opacity=this.opacity,e.transparent=this.transparent,e.depthTest=this.depthTest,e.depthWrite=this.depthWrite,e.stencilTest=this.stencilTest,e.polygonOffset=this.polygonOffset,e.polygonOffsetFactor=this.polygonOffsetFactor,e.polygonOffsetUnits=this.polygonOffsetUnits,e.alphaTest=this.alphaTest,e.overdraw=this.overdraw,e.visible=this.visible,e},$3Dmol.Material.prototype.dispose=function(){this.dispatchEvent({type:"dispose"})},$3Dmol.MaterialIdCount=0,$3Dmol.LineBasicMaterial=function(e){$3Dmol.Material.call(this),this.color=new $3Dmol.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.vertexColors=!1,this.fog=!0,this.shaderID="basic",this.setValues(e)},$3Dmol.LineBasicMaterial.prototype=Object.create($3Dmol.Material.prototype),$3Dmol.LineBasicMaterial.prototype.clone=function(){var e=new $3Dmol.LineBasicMaterial;return $3Dmol.Material.prototype.clone.call(this,e),e.color.copy(this.color),e},$3Dmol.MeshLambertMaterial=function(e){$3Dmol.Material.call(this),this.color=new $3Dmol.Color(16777215),this.ambient=new $3Dmol.Color(1048575),this.emissive=new $3Dmol.Color(0),this.wrapAround=!1,this.wrapRGB=new $3Dmol.Vector3(1,1,1),this.map=null,this.lightMap=null,this.specularMap=null,this.envMap=null,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.shading=$3Dmol.SmoothShading,this.shaderID="lambert",this.vertexColors=$3Dmol.NoColors,this.skinning=!1,this.setValues(e)},$3Dmol.MeshLambertMaterial.prototype=Object.create($3Dmol.Material.prototype),$3Dmol.MeshLambertMaterial.prototype.clone=function(e){return void 0===e&&(e=new $3Dmol.MeshLambertMaterial),$3Dmol.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.ambient.copy(this.ambient),e.emissive.copy(this.emissive),e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.shaderID=this.shaderID,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},$3Dmol.MeshDoubleLambertMaterial=function(e){$3Dmol.MeshLambertMaterial.call(this,e),this.shaderID="lambertdouble",this.side=$3Dmol.DoubleSide},$3Dmol.MeshDoubleLambertMaterial.prototype=Object.create($3Dmol.MeshLambertMaterial.prototype),$3Dmol.MeshDoubleLambertMaterial.prototype.clone=function(){var e=new $3Dmol.MeshDoubleLambertMaterial;return $3Dmol.MeshLambertMaterial.prototype.clone.call(this,e),e},$3Dmol.MeshOutlineMaterial=function(e){$3Dmol.Material.call(this),e=e||{},this.fog=!0,this.shaderID="outline",this.wireframe=!1,this.outlineColor=e.color||new $3Dmol.Color(0,0,0),this.outlineWidth=e.width||.1,this.outlinePushback=e.pushback||1},$3Dmol.MeshOutlineMaterial.prototype=Object.create($3Dmol.Material.prototype),$3Dmol.MeshOutlineMaterial.prototype.clone=function(e){return void 0===e&&(e=new $3Dmol.MeshOutlineMaterial),$3Dmol.Material.prototype.clone.call(this,e),e.fog=this.fog,e.shaderID=this.shaderID,e.wireframe=this.wireframe,e},$3Dmol.ImposterMaterial=function(e){$3Dmol.Material.call(this),this.color=new $3Dmol.Color(16777215),this.ambient=new $3Dmol.Color(1048575),this.emissive=new $3Dmol.Color(0),this.imposter=!0,this.wrapAround=!1,this.wrapRGB=new $3Dmol.Vector3(1,1,1),this.map=null,this.lightMap=null,this.specularMap=null,this.envMap=null,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.shading=$3Dmol.SmoothShading,this.shaderID=null,this.vertexColors=$3Dmol.NoColors,this.skinning=!1,this.setValues(e)},$3Dmol.ImposterMaterial.prototype=Object.create($3Dmol.Material.prototype),$3Dmol.ImposterMaterial.prototype.clone=function(){var e=new $3Dmol.ImposterMaterial;return $3Dmol.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.ambient.copy(this.ambient),e.emissive.copy(this.emissive),e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.shaderID=this.shaderID,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},$3Dmol.SphereImposterMaterial=function(e){$3Dmol.ImposterMaterial.call(this),this.shaderID="sphereimposter",this.setValues(e)},$3Dmol.SphereImposterMaterial.prototype=Object.create($3Dmol.ImposterMaterial.prototype),$3Dmol.SphereImposterMaterial.prototype.clone=function(){var e=new $3Dmol.SphereImposterMaterial;return $3Dmol.ImposterMaterial.prototype.clone.call(this,e),e},$3Dmol.SphereImposterOutlineMaterial=function(e){$3Dmol.ImposterMaterial.call(this),e=e||{},this.shaderID="sphereimposteroutline",this.outlineColor=e.color||new $3Dmol.Color(0,0,0),this.outlineWidth=e.width||.1,this.outlinePushback=e.pushback||1,this.setValues(e)},$3Dmol.SphereImposterOutlineMaterial.prototype=Object.create($3Dmol.ImposterMaterial.prototype),$3Dmol.SphereImposterOutlineMaterial.prototype.clone=function(){var e=new $3Dmol.SphereImposterOutlineMaterial;return $3Dmol.ImposterMaterial.prototype.clone.call(this,e),e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.outlinePushback=this.outlinePushback,e},$3Dmol.StickImposterMaterial=function(e){$3Dmol.ImposterMaterial.call(this),this.shaderID="stickimposter",this.setValues(e)},$3Dmol.StickImposterMaterial.prototype=Object.create($3Dmol.ImposterMaterial.prototype),$3Dmol.StickImposterMaterial.prototype.clone=function(){var e=new $3Dmol.StickImposterMaterial;return $3Dmol.ImposterMaterial.prototype.clone.call(this,e),e},$3Dmol.StickImposterOutlineMaterial=function(e){$3Dmol.ImposterMaterial.call(this),e=e||{},this.shaderID="stickimposteroutline",this.outlineColor=e.color||new $3Dmol.Color(0,0,0),this.outlineWidth=e.width||.1,this.outlinePushback=e.pushback||1,this.setValues(e)},$3Dmol.StickImposterOutlineMaterial.prototype=Object.create($3Dmol.ImposterMaterial.prototype),$3Dmol.StickImposterOutlineMaterial.prototype.clone=function(){var e=new $3Dmol.StickImposterOutlineMaterial;return $3Dmol.ImposterMaterial.prototype.clone.call(this,e),e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.outlinePushback=this.outlinePushback,e},$3Dmol.InstancedMaterial=function(e){$3Dmol.Material.call(this),this.color=new $3Dmol.Color(16777215),this.ambient=new $3Dmol.Color(1048575),this.emissive=new $3Dmol.Color(0),this.wrapAround=!1,this.wrapRGB=new $3Dmol.Vector3(1,1,1),this.map=null,this.lightMap=null,this.specularMap=null,this.envMap=null,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.shading=$3Dmol.SmoothShading,this.shaderID="instanced",this.vertexColors=$3Dmol.NoColors,this.skinning=!1,this.sphere=null,this.setValues(e)},$3Dmol.InstancedMaterial.prototype=Object.create($3Dmol.Material.prototype),$3Dmol.InstancedMaterial.prototype.clone=function(){var e=new $3Dmol.InstancedMaterial;return $3Dmol.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.ambient.copy(this.ambient),e.emissive.copy(this.emissive),e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.shaderID=this.shaderID,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e.sphere=this.sphere,e},$3Dmol.VolumetricMaterial=function(e){$3Dmol.Material.call(this),this.transparent=!1,this.volumetric=!0,this.color=new $3Dmol.Color(16777215),this.transferfn=null,this.map=null,this.volumetric=!0,this.extent=[],this.maxdepth=100,this.unit=0,this.texmatrix=null,this.transfermin=-1,this.transfermax=1,this.subsamples=5,this.shaderID="volumetric",this.side=$3Dmol.FrontSide,this.setValues(e)},$3Dmol.VolumetricMaterial.prototype=Object.create($3Dmol.Material.prototype),$3Dmol.VolumetricMaterial.prototype.clone=function(){var e=Object.assign(new $3Dmol.VolumetricMaterial,this);return $3Dmol.Material.prototype.clone.call(this,e),e},$3Dmol.SpriteMaterial=function(e){$3Dmol.Material.call(this),this.color=new $3Dmol.Color(16777215),this.map=new $3Dmol.Texture,this.useScreenCoordinates=!0,this.depthTest=!this.useScreenCoordinates,this.sizeAttenuation=!this.useScreenCoordinates,this.scaleByViewPort=!this.sizeAttenuation,this.alignment=$3Dmol.SpriteAlignment.center.clone(),this.fog=!1,this.uvOffset=new $3Dmol.Vector2(0,0),this.uvScale=new $3Dmol.Vector2(1,1),this.setValues(e),void 0===(e=e||{}).depthTest&&(this.depthTest=!this.useScreenCoordinates),void 0===e.sizeAttenuation&&(this.sizeAttenuation=!this.useScreenCoordinates),void 0===e.scaleByViewPort&&(this.scaleByViewPort=!this.sizeAttenuation)},$3Dmol.SpriteMaterial.prototype=Object.create($3Dmol.Material.prototype),$3Dmol.SpriteMaterial.prototype.clone=function(){var e=new $3Dmol.SpriteMaterial;return $3Dmol.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.useScreenCoordinates=this.useScreenCoordinates,e.sizeAttenuation=this.sizeAttenuation,e.scaleByViewport=this.scaleByViewPort,e.alignment.copy(this.alignment),e.uvOffset.copy(this.uvOffset),e},$3Dmol.SpriteAlignment={},$3Dmol.SpriteAlignment.topLeft=new $3Dmol.Vector2(1,-1),$3Dmol.SpriteAlignment.topCenter=new $3Dmol.Vector2(0,-1),$3Dmol.SpriteAlignment.topRight=new $3Dmol.Vector2(-1,-1),$3Dmol.SpriteAlignment.centerLeft=new $3Dmol.Vector2(1,0),$3Dmol.SpriteAlignment.center=new $3Dmol.Vector2(0,0),$3Dmol.SpriteAlignment.centerRight=new $3Dmol.Vector2(-1,0),$3Dmol.SpriteAlignment.bottomLeft=new $3Dmol.Vector2(1,1),$3Dmol.SpriteAlignment.bottomCenter=new $3Dmol.Vector2(0,1),$3Dmol.SpriteAlignment.bottomRight=new $3Dmol.Vector2(-1,1),$3Dmol.Texture=function(e,t){$3Dmol.EventDispatcher.call(this),this.id=$3Dmol.TextureIdCount++,this.name="",this.image=e,this.mapping=new $3Dmol.UVMapping,this.wrapS=$3Dmol.ClampToEdgeWrapping,this.wrapT=$3Dmol.ClampToEdgeWrapping,this.anisotropy=1,t?(this.format=$3Dmol.RFormat,this.type=$3Dmol.FloatType,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.magFilter=$3Dmol.NearestFilter,this.minFilter=$3Dmol.NearestFilter):(this.format=$3Dmol.RGBAFormat,this.type=$3Dmol.UnsignedByteType,this.offset=new $3Dmol.Vector2(0,0),this.repeat=new $3Dmol.Vector2(1,1),this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.magFilter=$3Dmol.LinearFilter,this.minFilter=$3Dmol.LinearMipMapLinearFilter),this.needsUpdate=!1,this.onUpdate=null},$3Dmol.Texture.prototype={constructor:$3Dmol.Texture,clone:function(e){return void 0===e&&(e=new $3Dmol.Texture),e.image=this.image,e.mapping=this.mapping,e.wrapS=this.wrapS,e.wrapT=this.wrapT,e.magFilter=this.magFilter,e.minFilter=this.minFilter,e.anisotropy=this.anisotropy,e.format=this.format,e.type=this.type,e.offset.copy(this.offset),e.repeat.copy(this.repeat),e.premultiplyAlpha=this.premultiplyAlpha,e.flipY=this.flipY,e.unpackAlignment=this.unpackAlignment,e},dispose:function(){this.dispatchEvent({type:"dispose"})}},$3Dmol.TextureIdCount=0,$3Dmol.FrontSide=0,$3Dmol.BackSide=1,$3Dmol.DoubleSide=2,$3Dmol.NoShading=0,$3Dmol.FlatShading=1,$3Dmol.SmoothShading=2,$3Dmol.NoColors=0,$3Dmol.FaceColors=1,$3Dmol.VertexColors=2,$3Dmol.MultiplyOperation=0,$3Dmol.MixOperation=1,$3Dmol.AddOperation=2,$3Dmol.UVMapping=function(){},$3Dmol.ClampToEdgeWrapping=1001,$3Dmol.LinearFilter=1006,$3Dmol.NearestFilter=1007,$3Dmol.LinearMipMapLinearFilter=1008,$3Dmol.UnsignedByteType=1009,$3Dmol.FloatType=1010,$3Dmol.RGBAFormat=1021,$3Dmol.RFormat=1022,$3Dmol.R32Format=1023,$3Dmol.Line=function(e,t,r){$3Dmol.Object3D.call(this),this.geometry=e,this.material=void 0!==t?t:new $3Dmol.LineBasicMaterial({color:16777215*Math.random()}),this.type=void 0!==r?r:$3Dmol.LineStrip},$3Dmol.LineStrip=0,$3Dmol.LinePieces=1,$3Dmol.Line.prototype=Object.create($3Dmol.Object3D.prototype),$3Dmol.Line.prototype.clone=function(e){return void 0===e&&(e=new $3Dmol.Line(this.geometry,this.material,this.type)),$3Dmol.Object3D.prototype.clone.call(this,e),e},$3Dmol.Mesh=function(e,t){$3Dmol.Object3D.call(this),this.geometry=e,this.material=void 0!==t?t:new $3Dmol.MeshBasicMaterial({color:16777215*Math.random(),wireframe:!0})},$3Dmol.Mesh.prototype=Object.create($3Dmol.Object3D.prototype),$3Dmol.Mesh.prototype.clone=function(e){return void 0===e&&(e=new $3Dmol.Mesh(this.geometry,this.material)),$3Dmol.Object3D.prototype.clone.call(this,e),e},$3Dmol.Sprite=function(e){$3Dmol.Object3D.call(this),this.material=void 0!==e?e:new $3Dmol.SpriteMaterial,this.rotation3d=this.rotation,this.rotation=0},$3Dmol.Sprite.prototype=Object.create($3Dmol.Object3D.prototype),$3Dmol.Sprite.prototype.updateMatrix=function(){this.matrix.setPosition(this.position),this.rotation3d.set(0,0,this.rotation),this.matrix.setRotationFromEuler(this.rotation3d),1===this.scale.x&&1===this.scale.y||this.matrix.scale(this.scale),this.matrixWorldNeedsUpdate=!0},$3Dmol.Sprite.prototype.clone=function(e){return void 0===e&&(e=new $3Dmol.Sprite(this.material)),$3Dmol.Object3D.prototype.clone.call(this,e),e},$3Dmol.Renderer=function(e){e=e||{},this.row=e.row,this.col=e.col,this.rows=e.rows,this.cols=e.cols;var t=void 0!==e.canvas?e.canvas:document.createElement("canvas"),r=void 0!==e.precision?e.precision:"highp",n=void 0===e.alpha||e.alpha,i=void 0===e.premultipliedAlpha||e.premultipliedAlpha,o=void 0!==e.antialias&&e.antialias,a=void 0===e.stencil||e.stencil,s=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,l=void 0!==e.clearColor?new $3Dmol.Color(e.clearColor):new $3Dmol.Color(0),u=void 0!==e.clearAlpha?e.clearAlpha:0,c=new $3Dmol.MeshOutlineMaterial(e.outline),f=new $3Dmol.SphereImposterOutlineMaterial(e.outline),h=new $3Dmol.StickImposterOutlineMaterial(e.outline),p=!!e.outline;this.domElement=t,this.context=null,this.devicePixelRatio=1,t.id=e.id,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.autoUpdateObjects=!0,this.autoUpdateScene=!0,this.renderPluginsPost=[],this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var d,m=this,v=[],g=0,y=null,b=-1,x=null,w=null,_=0,D=-1,A=-1,C=-1,S=-1,E=null,T=0,M=0,$=0,z=0,L={},k=new $3Dmol.Matrix4,I=new $3Dmol.Vector3,R=new $3Dmol.Matrix4,O=new $3Dmol.Matrix4,F=new $3Dmol.Matrix4,N=new $3Dmol.Vector3,P=!0,j={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},B=null,U=null,V=null,q=null,G=null,H=null;!function(){try{if(!(d=t.getContext("webgl2",{alpha:n,premultipliedAlpha:i,antialias:o,stencil:a,preserveDrawingBuffer:s}))&&!(d=t.getContext("experimental-webgl",{alpha:n,premultipliedAlpha:i,antialias:o,stencil:a,preserveDrawingBuffer:s}))&&!(d=t.getContext("webgl",{alpha:n,premultipliedAlpha:i,antialias:o,stencil:a,preserveDrawingBuffer:s})))throw"Error creating WebGL context."}catch(e){console.error(e)}}(),d.clearColor(0,0,0,1),d.clearDepth(1),d.clearStencil(0),d.enable(d.DEPTH_TEST),d.depthFunc(d.LEQUAL),d.frontFace(d.CCW),d.cullFace(d.BACK),d.enable(d.CULL_FACE),d.enable(d.BLEND),d.blendEquation(d.FUNC_ADD),d.blendFunc(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA),d.clearColor(l.r,l.g,l.b,u),this.context=d;var W=d.getExtension("ANGLE_instanced_arrays"),Y=d.getExtension("EXT_frag_depth"),X=d.getExtension("OES_texture_float_linear"),K=d.getExtension("EXT_color_buffer_float");function Z(e){L[e]||(d.enableVertexAttribArray(e),L[e]=!0)}function Q(e){e!==E&&(d.lineWidth(e),E=e)}this.supportedExtensions=function(){return{supportsAIA:Boolean(W),supportsImposters:Boolean(Y)||!ye()}},this.getContext=function(){return d},this.getPrecision=function(){return r},this.setClearColorHex=function(e,t){l.setHex(e),u=t,d.clearColor(l.r,l.g,l.b,u)},this.enableOutline=function(e){c=new $3Dmol.MeshOutlineMaterial(e),f=new $3Dmol.SphereImposterOutlineMaterial(e),h=new $3Dmol.StickImposterOutlineMaterial(e),p=!0},this.disableOutline=function(){p=!1},this.setViewport=function(){if(null!=this.rows&&null!=this.cols&&null!=this.row&&null!=this.col){var e=t.width/this.cols,r=t.height/this.rows;T=e,M=r,d.enable(d.SCISSOR_TEST),d.scissor(e*this.col,r*this.row,e,r),d.viewport(e*this.col,r*this.row,e,r)}},this.setSize=function(e,r){if(this.devicePixelRatio=void 0!==window.devicePixelRatio?window.devicePixelRatio:1,o&&this.devicePixelRatio<2&&(this.devicePixelRatio*=2),null!=this.rows&&null!=this.cols&&null!=this.row&&null!=this.col){var n=e/this.cols,i=r/this.rows;t.width=e*this.devicePixelRatio,t.height=r*this.devicePixelRatio,T=n*this.devicePixelRatio,M=i*this.devicePixelRatio,t.style.width=e+"px",t.style.height=r+"px",this.setViewport()}else T=t.width=e*this.devicePixelRatio,M=t.height=r*this.devicePixelRatio,t.style.width=e+"px",t.style.height=r+"px",d.viewport(0,0,d.drawingBufferWidth,d.drawingBufferHeight)},this.clear=function(e,t,r){var n=0;(void 0===e||e)&&(n|=d.COLOR_BUFFER_BIT),(void 0===t||t)&&(n|=d.DEPTH_BUFFER_BIT),(void 0===r||r)&&(n|=d.STENCIL_BUFFER_BIT),d.clear(n)},this.clearTarget=function(e,t,r){this.clear(e,t,r)},this.setMaterialFaces=function(e,t){var r=e.side===$3Dmol.DoubleSide,n=e.side===$3Dmol.BackSide;n=t?!n:n,D!==r&&(r?d.disable(d.CULL_FACE):d.enable(d.CULL_FACE),D=r),A!==n&&(n?d.frontFace(d.CW):d.frontFace(d.CCW),A=n),d.cullFace(d.BACK)},this.setDepthTest=function(e){C!==e&&(e?d.enable(d.DEPTH_TEST):d.disable(d.DEPTH_TEST),C=e)},this.setDepthWrite=function(e){S!==e&&(d.depthMask(e),S=e)},this.setBlending=function(e){e?(d.enable(d.BLEND),d.blendEquationSeparate(d.FUNC_ADD,d.FUNC_ADD),d.blendFuncSeparate(d.SRC_ALPHA,d.ONE_MINUS_SRC_ALPHA,d.ONE,d.ONE_MINUS_SRC_ALPHA)):d.disable(d.BLEND)},this.addPostPlugin=function(e){e.init(this),this.renderPluginsPost.push(e)};var J=function(e){var t=e.program;if(void 0!==t){var r,n,i;e.program=void 0;var o=!1;for(r=0,n=v.length;r<n;r++)if((i=v[r]).program===t){i.usedTimes--,0===i.usedTimes&&(o=!0);break}if(!0===o){var a=[];for(r=0,n=v.length;r<n;r++)(i=v[r]).program!==t&&a.push(i);v=a,d.deleteProgram(t),m.info.memory.programs--}}},ee=function e(t){var r=t.target;r.removeEventListener("dispose",e),function(e){if(e.__webglInit=void 0,void 0!==e.__webglVertexBuffer&&d.deleteBuffer(e.__webglVertexBuffer),void 0!==e.__webglColorBuffer&&d.deleteBuffer(e.__webglColorBuffer),void 0!==e.geometryGroups)for(var t=0,r=e.groups;t<r;t++){var n=e.geometryGroups[t];void 0!==n.__webglVertexBuffer&&d.deleteBuffer(n.__webglVertexBuffer),void 0!==n.__webglColorBuffer&&d.deleteBuffer(n.__webglColorBuffer),void 0!==n.__webglNormalBuffer&&d.deleteBuffer(n.__webglNormalBuffer),void 0!==n.__webglFaceBuffer&&d.deleteBuffer(n.__webglFaceBuffer),void 0!==n.__webglLineBuffer&&d.deleteBuffer(n.__webglLineBuffer)}}(r),m.info.memory.geometries--},te=function e(t){var r=t.target;r.removeEventListener("dispose",e),function(e){if(e.image&&e.image.__webglTextureCube)d.deleteTexture(e.image.__webglTextureCube);else{if(!e.__webglInit)return;e.__webglInit=!1,d.deleteTexture(e.__webglTexture)}}(r),m.info.memory.textures--},re=function e(t){var r=t.target;r.removeEventListener("dispose",e),J(r)};function ne(e,t){var r;return ye()||t.startsWith("#version")||(t=t.replace(/gl_FragDepthEXT/g,"gl_FragDepth"),t="#version 300 es\n"+(t=(t=(t=(t=(t="fragment"==e?t.replace(/varying/g,"in"):t.replace(/varying/g,"out")).replace(/attribute/g,"in")).replace(/texture2D/g,"texture")).replace(/\/\/DEFINEFRAGCOLOR/g,"out vec4 glFragColor;")).replace(/gl_FragColor/g,"glFragColor"))),"fragment"===e?r=d.createShader(d.FRAGMENT_SHADER):"vertex"===e&&(r=d.createShader(d.VERTEX_SHADER)),d.shaderSource(r,t),d.compileShader(r),d.getShaderParameter(r,d.COMPILE_STATUS)?r:(console.error(d.getShaderInfoLog(r)),console.error("could not initialize shader"),null)}function ie(e,t,n,i){var o,a,s,l,u=[];for(o in u.push(e),u.push(t),i)u.push(o),u.push(i[o]);for(l=u.join(),o=0,a=v.length;o<a;o++){var c=v[o];if(c.code===l)return c.usedTimes++,c.program}if(ye()&&i.volumetric)throw new Error("Volumetric rendering requires webgl2 which is not supported by your hardware.");s=d.createProgram();var f,h,p,y="precision "+r+" float;",b=[i.volumetric?"#version 300 es":"",y].join("\n"),x=ne("fragment",[i.volumetric?"#version 300 es":"",i.fragdepth&&ye()?"#extension GL_EXT_frag_depth: enable":"",i.wireframe?"#define WIREFRAME 1":"",y].join("\n")+e),w=ne("vertex",b+t);for(h in d.attachShader(s,w),d.attachShader(s,x),d.linkProgram(s),d.getProgramParameter(s,d.LINK_STATUS)||console.error("Could not initialize shader"),s.uniforms={},s.attributes={},f=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix"],n)f.push(h);for(p=0;p<f.length;p++){var _=f[p];s.uniforms[_]=d.getUniformLocation(s,_)}for(f=["position","normal","color","lineDistance","offset","radius"],p=0;p<f.length;p++){var D=f[p];s.attributes[D]=d.getAttribLocation(s,D)}return s.id=g++,v.push({program:s,code:l,usedTimes:1}),m.info.memory.programs=v.length,s}function oe(e,t,r,n,i,o,a){var s,l,u,v,g,y,b,x;t?(g=e.length-1,y=-1,b=-1):(g=0,y=e.length,b=1);for(var w=g;w!==y;w+=b)if((s=e[w]).render){if(l=s.object,u=s.buffer,!(v=s[r]))continue;a&&m.setBlending(!0),m.setDepthTest(v.depthTest),m.setDepthWrite(v.depthWrite),x=v.polygonOffset,v.polygonOffsetFactor,v.polygonOffsetUnits,null!==x&&(x?d.enable(d.POLYGON_OFFSET_FILL):d.disable(d.POLYGON_OFFSET_FILL));var _=l._modelViewMatrix.isReflected();m.setMaterialFaces(v,_),m.renderBuffer(n,i,o,v,u,l),(p||v.outline)&&("sphereimposter"==v.shaderID?m.renderBuffer(n,i,o,f,u,l):"stickimposter"==v.shaderID?m.renderBuffer(n,i,o,h,u,l):v.wireframe||"basic"===v.shaderID||0===v.opacity||m.renderBuffer(n,i,o,c,u,l))}}function ae(e,t){var r,n,i,o;if(!e.__webglInit&&(e.__webglInit=!0,e._modelViewMatrix=new $3Dmol.Matrix4,e._normalMatrix=new $3Dmol.Matrix3,void 0!==e.geometry&&void 0===e.geometry.__webglInit&&(e.geometry.__webglInit=!0,e.geometry.addEventListener("dispose",ee)),e instanceof $3Dmol.Mesh||e instanceof $3Dmol.Line))for(i=e.geometry,e.material,r=0,n=i.geometryGroups.length;r<n;r++)(o=i.geometryGroups[r]).id=_++,o.__webglVertexBuffer||(e instanceof $3Dmol.Mesh?(fe(o),i.elementsNeedUpdate=!0,i.normalsNeedUpdate=!0):e instanceof $3Dmol.Line&&he(o),i.verticesNeedUpdate=!0,i.colorsNeedUpdate=!0);if(!e.__webglActive){if(e instanceof $3Dmol.Mesh||e instanceof $3Dmol.Line)for(r=0,n=(i=e.geometry).geometryGroups.length;r<n;r++)o=i.geometryGroups[r],pe(t.__webglObjects,o,e);else e instanceof $3Dmol.Sprite&&t.__webglSprites.push(e);e.__webglActive=!0}}function se(e){var t,r=e.geometry;if(e instanceof $3Dmol.Mesh||e instanceof $3Dmol.Line){for(var n=0,i=r.geometryGroups.length;n<i;n++)t=r.geometryGroups[n],(r.verticesNeedUpdate||r.elementsNeedUpdate||r.colorsNeedUpdate||r.normalsNeedUpdate)&&ce(t,d.STATIC_DRAW);r.verticesNeedUpdate=!1,r.elementsNeedUpdate=!1,r.normalsNeedUpdate=!1,r.colorsNeedUpdate=!1,r.buffersNeedUpdate=!1}}function le(e,t){e instanceof $3Dmol.Mesh||e instanceof $3Dmol.Line?function(e,t){for(var r=e.length-1;r>=0;--r)e[r].object===t&&e.splice(r,1)}(t.__webglObjects,e):e instanceof $3Dmol.Sprite&&function(e,t){for(var r=e.length-1;r>=0;--r)e[r]===t&&e.splice(r,1)}(t.__webglSprites,e),e.__webglActive=!1}function ue(e){var t=e.object.material;if(t.volumetric)e.opaque=null,e.transparent=null,e.volumetric=t;else if(t.transparent){if(e.opaque=null,e.volumetric=null,e.transparent=t,!t.wireframe){var r=t.clone();r.opacity=0,e.blank=r}}else e.opaque=t,e.transparent=null,e.volumetric=null}function ce(e,t){var r=e.vertexArray,n=e.colorArray;if(void 0!==e.__webglOffsetBuffer?(d.bindBuffer(d.ARRAY_BUFFER,e.__webglOffsetBuffer),d.bufferData(d.ARRAY_BUFFER,r,t)):(d.bindBuffer(d.ARRAY_BUFFER,e.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,r,t)),d.bindBuffer(d.ARRAY_BUFFER,e.__webglColorBuffer),d.bufferData(d.ARRAY_BUFFER,n,t),e.normalArray&&void 0!==e.__webglNormalBuffer){var i=e.normalArray;d.bindBuffer(d.ARRAY_BUFFER,e.__webglNormalBuffer),d.bufferData(d.ARRAY_BUFFER,i,t)}if(e.radiusArray&&void 0!==e.__webglRadiusBuffer&&(d.bindBuffer(d.ARRAY_BUFFER,e.__webglRadiusBuffer),d.bufferData(d.ARRAY_BUFFER,e.radiusArray,t)),e.faceArray&&void 0!==e.__webglFaceBuffer){var o=e.faceArray;d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,o,t)}if(e.lineArray&&void 0!==e.__webglLineBuffer){var a=e.lineArray;d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,a,t)}}function fe(e){e.radiusArray&&(e.__webglRadiusBuffer=d.createBuffer()),e.useOffset&&(e.__webglOffsetBuffer=d.createBuffer()),e.__webglVertexBuffer=d.createBuffer(),e.__webglNormalBuffer=d.createBuffer(),e.__webglColorBuffer=d.createBuffer(),e.__webglFaceBuffer=d.createBuffer(),e.__webglLineBuffer=d.createBuffer(),m.info.memory.geometries++}function he(e){e.__webglVertexBuffer=d.createBuffer(),e.__webglColorBuffer=d.createBuffer(),m.info.memory.geometries++}function pe(e,t,r){e.push({buffer:t,object:r,opaque:null,transparent:null})}function de(e,t){e._modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld),e._normalMatrix.getInverse(e._modelViewMatrix),e._normalMatrix.transpose()}function me(){return d.LINEAR}function ve(e,t){e==d.TEXTURE_2D?(d.texParameteri(e,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(e,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(e,d.TEXTURE_MAG_FILTER,me(t.magFilter)),d.texParameteri(e,d.TEXTURE_MIN_FILTER,me(t.minFilter))):(d.texParameteri(e,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(e,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),d.texParameteri(e,d.TEXTURE_WRAP_R,d.CLAMP_TO_EDGE),K&&X?(d.texParameteri(e,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(e,d.TEXTURE_MIN_FILTER,d.LINEAR)):(d.texParameteri(e,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texParameteri(e,d.TEXTURE_MIN_FILTER,d.NEAREST)))}function ge(e){return e===$3Dmol.UnsignedByteType?d.UNSIGNED_BYTE:e===$3Dmol.RGBAFormat?d.RGBA:e===$3Dmol.NearestFilter?d.NEAREST:0}function ye(){var e=d.getParameter(d.VERSION);return null==e||"1"==e[6]}this.initMaterial=function(e){var t,r;if(e.addEventListener("dispose",re),r=e.shaderID){var n=$3Dmol.ShaderLib[r];e.vertexShader=n.vertexShader,e.fragmentShader=n.fragmentShader,e.uniforms=$3Dmol.ShaderUtils.clone(n.uniforms)}t={wireframe:e.wireframe,fragdepth:e.imposter,volumetric:e.volumetric},e.program=ie(e.fragmentShader,e.vertexShader,e.uniforms,t)},this.renderBuffer=function(e,t,r,n,i,o){if(n.visible){var a,s;s=(a=function(e,t,r,n,i,o){n.needsUpdate&&(n.program&&J(n),m.initMaterial(n,t,r,i),n.needsUpdate=!1);var a=!1,s=n.program,l=s.uniforms,u=n.uniforms;if(s!=y&&(d.useProgram(s),y=s,a=!0),n.id!=b&&(b=n.id,a=!0),e!=w&&(w=e,a=!0),d.uniformMatrix4fv(l.projectionMatrix,!1,e.projectionMatrix.elements),d.uniformMatrix4fv(l.modelViewMatrix,!1,i._modelViewMatrix.elements),d.uniformMatrix3fv(l.normalMatrix,!1,i._normalMatrix.elements),a){if(u.fogColor.value=r.color,u.fogNear.value=r.near,u.fogFar.value=r.far,n.shaderID.startsWith("lambert")||"instanced"===n.shaderID||n.shaderID.endsWith("imposter"))d.uniformMatrix4fv(l.viewMatrix,!1,e.matrixWorldInverse.elements),P&&(function(e,t){var r,n,i,o,a,s=j,l=s.directional.colors,u=s.directional.positions,c=0,f=0;for(r=0,n=t.length;r<n;r++)if(o=(i=t[r]).color,a=i.intensity,i.distance,i instanceof $3Dmol.Light){if(N.getPositionFromMatrix(i.matrixWorld),I.getPositionFromMatrix(i.target.matrixWorld),N.sub(I),N.normalize(),0===N.x&&0===N.y&&0===N.z)continue;u[f]=N.x,u[f+1]=N.y,u[f+2]=N.z,l[f]=o.r*a,l[f+1]=o.g*a,l[f+2]=o.b*a,f+=3,c++}s.ambient[0]=0,s.ambient[1]=0,s.ambient[2]=0,s.directional.length=c}(0,t),P=!1),u.directionalLightColor.value=j.directional.colors,u.directionalLightDirection.value=j.directional.positions;else if(n.shaderID.endsWith("outline"))u.outlineColor.value=n.outlineColor,u.outlineWidth.value=n.outlineWidth,u.outlinePushback.value=n.outlinePushback;else if("sphereimposter"===n.shaderID)d.uniformMatrix4fv(l.viewMatrix,!1,e.matrixWorldInverse.elements),u.directionalLightColor.value=j.directional.colors,u.directionalLightDirection.value=j.directional.positions;else if("volumetric"===n.shaderID){i._modelViewMatrix.getScale(N),R.getInverse(i._modelViewMatrix),O.getInverse(e.projectionMatrix),F.multiplyMatrices(i.material.texmatrix,R),d.uniformMatrix4fv(l.textmat,!1,F.elements),d.uniformMatrix4fv(l.projinv,!1,O.elements);var c=Math.min(Math.min(N.x,N.y),N.z);u.step.value=i.material.unit*c,u.maxdepth.value=i.material.maxdepth*c,u.transfermax.value=i.material.transfermax,u.transfermin.value=i.material.transfermin,u.subsamples.value=i.material.subsamples,o.setTexture(i.material.transferfn,4,!1),o.setTexture(i.material.map,3,!0),d.activeTexture(d.TEXTURE5),d.bindTexture(d.TEXTURE_2D,H)}u.opacity.value=n.opacity,function(e,t){var r,n,i,o;for(r in t)e[r]&&(n=t[r].type,i=t[r].value,o=e[r],"f"===n?d.uniform1f(o,i):"i"===n?d.uniform1i(o,i):"fv"===n?d.uniform3fv(o,i):"c"===n?d.uniform3f(o,i.r,i.g,i.b):"f4"===n&&d.uniform4f(o,i[0],i[1],i[2],i[3]))}(l,u)}return s}(e,t,r,n,o,this)).attributes;var l,u,c=!1,f=n.wireframe?1:0,h=16777215*i.id+2*a.id+f;if(h!==x&&(x=h,c=!0),c&&(function(){for(var e in L)L[e]&&(d.disableVertexAttribArray(e),L[e]=!1)}(),s.position>=0&&(d.bindBuffer(d.ARRAY_BUFFER,i.__webglVertexBuffer),Z(s.position),d.vertexAttribPointer(s.position,3,d.FLOAT,!1,0,0)),s.color>=0&&(d.bindBuffer(d.ARRAY_BUFFER,i.__webglColorBuffer),Z(s.color),d.vertexAttribPointer(s.color,3,d.FLOAT,!1,0,0)),s.normal>=0&&(d.bindBuffer(d.ARRAY_BUFFER,i.__webglNormalBuffer),Z(s.normal),d.vertexAttribPointer(s.normal,3,d.FLOAT,!1,0,0)),s.offset>=0&&(d.bindBuffer(d.ARRAY_BUFFER,i.__webglOffsetBuffer),Z(s.offset),d.vertexAttribPointer(s.offset,3,d.FLOAT,!1,0,0)),s.radius>=0&&(d.bindBuffer(d.ARRAY_BUFFER,i.__webglRadiusBuffer),Z(s.radius),d.vertexAttribPointer(s.radius,1,d.FLOAT,!1,0,0))),o instanceof $3Dmol.Mesh){if("instanced"===n.shaderID){var p=n.sphere.geometryGroups[0];c&&(d.bindBuffer(d.ARRAY_BUFFER,i.__webglVertexBuffer),d.bufferData(d.ARRAY_BUFFER,p.vertexArray,d.STATIC_DRAW),d.bindBuffer(d.ARRAY_BUFFER,i.__webglNormalBuffer),d.bufferData(d.ARRAY_BUFFER,p.normalArray,d.STATIC_DRAW),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,i.__webglFaceBuffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,p.faceArray,d.STATIC_DRAW)),l=p.faceidx,W.vertexAttribDivisorANGLE(s.offset,1),W.vertexAttribDivisorANGLE(s.radius,1),W.vertexAttribDivisorANGLE(s.color,1),W.drawElementsInstancedANGLE(d.TRIANGLES,l,d.UNSIGNED_SHORT,0,i.radiusArray.length),W.vertexAttribDivisorANGLE(s.offset,0),W.vertexAttribDivisorANGLE(s.radius,0),W.vertexAttribDivisorANGLE(s.color,0)}else n.wireframe?(u=i.lineidx,Q(n.wireframeLinewidth),c&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,i.__webglLineBuffer),d.drawElements(d.LINES,u,d.UNSIGNED_SHORT,0)):(l=i.faceidx,c&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,i.__webglFaceBuffer),d.drawElements(d.TRIANGLES,l,d.UNSIGNED_SHORT,0));m.info.render.calls++,m.info.render.vertices+=l,m.info.render.faces+=l/3}else o instanceof $3Dmol.Line&&(u=i.vertices,Q(n.linewidth),d.drawArrays(d.LINES,0,u),m.info.render.calls++)}},this.render=function(e,t,r){if(t instanceof $3Dmol.Camera!=0){var n,i,o,a,s,c=e.__lights,f=e.fog;b=-1,P=!0,this.autoUpdateScene&&e.updateMatrixWorld(),void 0===t.parent&&t.updateMatrixWorld(),t.matrixWorldInverse.getInverse(t.matrixWorld),k.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this.autoUpdateObjects&&this.initWebGLObjects(e),m.info.render.calls=0,m.info.render.vertices=0,m.info.render.faces=0,m.info.render.points=0,$=T,z=M,this.setViewport(),this.initFrameBuffer(),(this.autoClear||r)&&(d.clearColor(l.r,l.g,l.b,u),this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil));var h=!1;for(n=0,i=(s=e.__webglObjects).length;n<i;n++)a=(o=s[n]).object,o.render=!1,a.visible&&(de(a,t),ue(o),o.render=!0,o.volumetric&&(h=!0));this.setBlending(!1),oe(e.__webglObjects,!0,"opaque",t,c,f,!1),oe(e.__webglObjects,!0,"blank",t,c,f,!0),oe(e.__webglObjects,!1,"transparent",t,c,f,!0),h&&q&&(this.reinitFrameBuffer(),oe(e.__webglObjects,!1,"volumetric",t,c,f,!0)),function(e,t,r){if(x=-1,y=null,w=null,S=-1,C=-1,D=-1,b=-1,A=-1,e.length)for(var n=0,i=e.length;n<i;n++)P=!0,e[n].render(t,r,$,z),x=-1,y=null,w=null,S=-1,C=-1,D=-1,b=-1,A=-1}(this.renderPluginsPost,e,t),this.renderFrameBuffertoScreen(),this.setDepthTest(!0),this.setDepthWrite(!0)}else console.error("$3Dmol.Renderer.render: camera is not an instance of $3Dmol.Camera.")},this.reinitFrameBuffer=function(){ye()||(q=d.createFramebuffer(),d.bindFramebuffer(d.FRAMEBUFFER,q),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,G,0))},this.initFrameBuffer=function(){if(!ye()){var e=T,t=M;d.enable(d.SCISSOR_TEST),d.scissor(0,0,e,t),d.viewport(0,0,e,t),G=d.createTexture(),d.bindTexture(d.TEXTURE_2D,G),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,e,t,0,d.RGBA,d.UNSIGNED_BYTE,null),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.LINEAR),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),H=d.createTexture(),d.bindTexture(d.TEXTURE_2D,H),d.texImage2D(d.TEXTURE_2D,0,d.DEPTH_COMPONENT32F,e,t,0,d.DEPTH_COMPONENT,d.FLOAT,null),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,d.NEAREST),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,d.CLAMP_TO_EDGE),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,d.CLAMP_TO_EDGE),q=d.createFramebuffer(),d.bindFramebuffer(d.FRAMEBUFFER,q),d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_2D,G,0),d.framebufferTexture2D(d.FRAMEBUFFER,d.DEPTH_ATTACHMENT,d.TEXTURE_2D,H,0);var r=$3Dmol.ShaderLib.screen;B=ie(r.fragmentShader,r.vertexShader,r.uniforms,{}),U=d.getAttribLocation(B,"vertexPosition"),V=d.createBuffer(),d.bindBuffer(d.ARRAY_BUFFER,V),d.bufferData(d.ARRAY_BUFFER,new Float32Array([1,1,-1,1,-1,-1,-1,-1,1,-1,1,1]),d.STATIC_DRAW)}},this.renderFrameBuffertoScreen=function(){ye()||null===q||(this.setViewport(),d.bindFramebuffer(d.FRAMEBUFFER,null),d.clear(d.COLOR_BUFFER_BIT|d.DEPTH_BUFFER_BIT),d.frontFace(d.CCW),d.cullFace(d.BACK),d.useProgram(B),y=B,this.setDepthTest(-1),this.setDepthWrite(-1),d.bindBuffer(d.ARRAY_BUFFER,V),d.enableVertexAttribArray(U),d.vertexAttribPointer(U,2,d.FLOAT,!1,0,0),d.activeTexture(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,G),d.drawArrays(d.TRIANGLES,0,6))},this.initWebGLObjects=function(e){if(e.__webglObjects||(e.__webglObjects=[],e.__webglObjectsImmediate=[],e.__webglSprites=[],e.__webglFlares=[]),e.__objectsAdded.length){for(;e.__objectsAdded.length;)ae(e.__objectsAdded[0],e),e.__objectsAdded.splice(0,1);x=-1}for(;e.__objectsRemoved.length;)le(e.__objectsRemoved[0],e),e.__objectsRemoved.splice(0,1);for(var t=0,r=e.__webglObjects.length;t<r;t++)se(e.__webglObjects[t].object)},this.getXYRatio=function(){return null!=this.rows&&null!=this.cols&&null!=this.row&&null!=this.col?[this.cols,this.rows]:[1,1]},this.getAspect=function(e,r){null!=e&&null!=r||(e=t.width,r=t.height);var n=e/r;return null!=this.rows&&null!=this.cols&&null!=this.row&&null!=this.col&&(n=e/this.cols/(r/this.rows)),n},this.setTexture=function(e,t,r){if(e.needsUpdate){e.__webglInit||(e.__webglInit=!0,e.addEventListener("dispose",te),e.__webglTexture=d.createTexture(),m.info.memory.textures++),d.activeTexture(d.TEXTURE0+t);var n=r?d.TEXTURE_3D:d.TEXTURE_2D;d.bindTexture(n,e.__webglTexture),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,e.flipY),d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),d.pixelStorei(d.UNPACK_ALIGNMENT,e.unpackAlignment),d.pixelStorei(d.PACK_ALIGNMENT,e.unpackAlignment);var i=ge(e.format),o=ge(e.type);if(r)ve(d.TEXTURE_3D,e),d.texImage3D(d.TEXTURE_3D,0,d.R32F,e.image.size.z,e.image.size.y,e.image.size.x,0,d.RED,d.FLOAT,e.image.data);else{var a=e.image,s=a.width,l=a.height;void 0===s&&(s=a.length,i==d.RGBA&&(s/=4),l=1),ve(d.TEXTURE_2D,e),ye()?d.texImage2D(d.TEXTURE_2D,0,i,i,o,e.image):d.texImage2D(d.TEXTURE_2D,0,i,s,l,0,i,o,e.image)}e.needsUpdate=!1,e.onUpdate&&e.onUpdate()}else d.activeTexture(d.TEXTURE0+t),r?d.bindTexture(d.TEXTURE_3D,e.__webglTexture):d.bindTexture(d.TEXTURE_2D,e.__webglTexture)},this.supportsVolumetric=function(){return!ye()},this.addPostPlugin(new $3Dmol.SpritePlugin)},$3Dmol.Scene=function(){$3Dmol.Object3D.call(this),this.fog=null,this.overrideMaterial=null,this.matrixAutoUpdate=!1,this.__objects=[],this.__lights=[],this.__objectsAdded=[],this.__objectsRemoved=[]},$3Dmol.Scene.prototype=Object.create($3Dmol.Object3D.prototype),$3Dmol.Scene.prototype.__addObject=function(e){if(e instanceof $3Dmol.Light)-1===this.__lights.indexOf(e)&&this.__lights.push(e),e.target&&void 0===e.target.parent&&this.add(e.target);else if(-1===this.__objects.indexOf(e)){this.__objects.push(e),this.__objectsAdded.push(e);var t=this.__objectsRemoved.indexOf(e);-1!==t&&this.__objectsRemoved.splice(t,1)}for(var r=0;r<e.children.length;r++)this.__addObject(e.children[r])},$3Dmol.Scene.prototype.__removeObject=function(e){var t;e instanceof $3Dmol.Light?-1!==(t=this.__lights.indexOf(e))&&this.__lights.splice(t,1):-1!==(t=this.__objects.indexOf(e))&&(this.__objects.splice(t,1),this.__objectsRemoved.push(e),-1!==this.__objectsAdded.indexOf(e)&&this.__objectsAdded.splice(t,1));for(var r=0;r<e.children.length;r++)this.__removeObject(e.children[r])},$3Dmol.Fog=function(e,t,r){this.name="",this.color=new $3Dmol.Color(e),this.near=void 0!==t?t:1,this.far=void 0!==r?r:1e3},$3Dmol.Fog.prototype.clone=function(){return new $3Dmol.Fog(this.color.getHex(),this.near,this.far)},$3Dmol.ShaderUtils={clone:function(e){var t,r={};for(t in e){r[t]={},r[t].type=e[t].type;var n=e[t].value;n instanceof $3Dmol.Color?r[t].value=n.clone():"number"==typeof n?r[t].value=n:n instanceof Array?r[t].value=[]:console.error("Error copying shader uniforms from ShaderLib: unknown type for uniform")}return r},stickimposterFragmentShader:["uniform float opacity;","uniform mat4 projectionMatrix;","uniform vec3 fogColor;","uniform float fogNear;","uniform float fogFar;","varying vec3 vLight;","varying vec3 vColor;","varying vec3 cposition;","varying vec3 p1;","varying vec3 p2;","varying float r;","//DEFINEFRAGCOLOR","void main() {","    vec3 color = abs(vColor);","    vec3 pos = cposition;","    vec3 p = pos;","    vec3 v = normalize(pos);","    vec3 pa = p1;","    vec3 va = normalize(p2-p1);","    vec3 tmp1 = v-(dot(v,va)*va);","    vec3 deltap = p-pa;","    float A = dot(tmp1,tmp1);","    if(A == 0.0) discard;","    vec3 tmp2 = deltap-(dot(deltap,va)*va);","    float B = 2.0*dot(tmp1, tmp2);","    float C = dot(tmp2,tmp2)-r*r;","    float det = (B*B) - (4.0*A*C);","    if(det < 0.0) discard;","    float sqrtDet = sqrt(det);","    float posT = (-B+sqrtDet)/(2.0*A);","    float negT = (-B-sqrtDet)/(2.0*A);","    float intersectionT = min(posT,negT);","    vec3 qi = p+v*intersectionT;","    float dotp1 = dot(va,qi-p1);","    float dotp2 = dot(va,qi-p2);","    vec3 norm;","    if( dotp1 < 0.0 || dotp2 > 0.0) {","       vec3 cp;","       if( dotp1 < 0.0) {        cp = p1;","       } else {","          cp = p2;","       }","       vec3 diff = p-cp;","       A = dot(v,v);","       B = dot(diff,v)*2.0;","       C = dot(diff,diff)-r*r;","       det = (B*B) - (4.0*C);","       if(det < 0.0) discard;","       sqrtDet = sqrt(det);","       posT = (-B+sqrtDet)/(2.0);","       negT = (-B-sqrtDet)/(2.0);","       float t = min(posT,negT);","       qi = p+v*t;","       norm = normalize(qi-cp);","    } else {","       norm = normalize(qi-(dotp1*va + p1));","    }","    vec4 clipPos = projectionMatrix * vec4(qi, 1.0);","    float ndcDepth = clipPos.z / clipPos.w;","    float depth = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;","    gl_FragDepthEXT = depth;"].join("\n")},$3Dmol.ShaderLib={basic:{fragmentShader:["uniform mat4 viewMatrix;","uniform float opacity;","uniform vec3 fogColor;","uniform float fogNear;","uniform float fogFar;","varying vec3 vColor;","//DEFINEFRAGCOLOR","void main() {","    gl_FragColor = vec4( vColor, opacity );","    float depth = gl_FragCoord.z / gl_FragCoord.w;","    float fogFactor = smoothstep( fogNear, fogFar, depth );","    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}"].join("\n"),vertexShader:["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","attribute vec3 position;","attribute vec3 color;","varying vec3 vColor;","void main() {","    vColor = color;","    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","    gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3}}},sphereimposter:{fragmentShader:["uniform mat4 viewMatrix;","uniform float opacity;","uniform mat4 projectionMatrix;","uniform vec3 fogColor;","uniform float fogNear;","uniform float fogFar;","uniform float uDepth;","uniform vec3 directionalLightColor[ 1 ];","varying vec3 vColor;","varying vec2 mapping;","varying float rval;","varying vec3 vLight;","varying vec3 center;","//DEFINEFRAGCOLOR","void main() {","    float lensqr = dot(mapping,mapping);","    float rsqr = rval*rval;","    if(lensqr > rsqr)","       discard;","    float z = sqrt(rsqr-lensqr);","    vec3 cameraPos = center+ vec3(mapping.x,mapping.y,z);","    vec4 clipPos = projectionMatrix * vec4(cameraPos, 1.0);","    float ndcDepth = clipPos.z / clipPos.w;","    gl_FragDepthEXT = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;","    vec3 norm = normalize(vec3(mapping.x,mapping.y,z));","    float dotProduct = dot( norm, vLight );","    vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );","    vec3 vLight = directionalLightColor[ 0 ] * directionalLightWeighting;","    gl_FragColor = vec4(vLight*vColor, opacity*opacity );","    float fogFactor = smoothstep( fogNear, fogFar, gl_FragDepthEXT/gl_FragCoord.w );","    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}"].join("\n"),vertexShader:["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 directionalLightColor[ 1 ];","uniform vec3 directionalLightDirection[ 1 ];","attribute vec3 position;","attribute vec3 normal;","attribute vec3 color;","varying vec2 mapping;","varying vec3 vColor;","varying float rval;","varying vec3 vLight;","varying vec3 center;","void main() {","    vColor = color;","    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","    center = mvPosition.xyz;","    vec4 projPosition = projectionMatrix * mvPosition;","    vec4 adjust = projectionMatrix* vec4(normal,0.0); adjust.z = 0.0; adjust.w = 0.0;","    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );","    vLight = normalize( lDirection.xyz );","    mapping = normal.xy;","    rval = abs(normal.x);","    gl_Position = projPosition+adjust;","}"].join("\n"),uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},lambert:{fragmentShader:["uniform mat4 viewMatrix;","uniform float opacity;","uniform vec3 fogColor;","uniform float fogNear;","uniform float fogFar;","varying vec3 vLightFront;","varying vec3 vColor;","//DEFINEFRAGCOLOR","void main() {","    gl_FragColor = vec4( vec3 ( 1.0 ), opacity );","    #ifndef WIREFRAME","    gl_FragColor.xyz *= vLightFront;","    #endif","    gl_FragColor = gl_FragColor * vec4( vColor, opacity );","    float depth = gl_FragCoord.z / gl_FragCoord.w;","    float fogFactor = smoothstep( fogNear, fogFar, depth );","    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}"].join("\n"),vertexShader:["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 directionalLightColor[ 1 ];","uniform vec3 directionalLightDirection[ 1 ];","attribute vec3 position;","attribute vec3 normal;","attribute vec3 color;","varying vec3 vColor;","varying vec3 vLightFront;","void main() {","    vColor = color;","    vec3 objectNormal = normal;","    vec3 transformedNormal = normalMatrix * objectNormal;","    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","    vLightFront = vec3( 0.0 );","    transformedNormal = normalize( transformedNormal );","    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );","    vec3 dirVector = normalize( lDirection.xyz );","    float dotProduct = dot( transformedNormal, dirVector );","    vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );","    vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;","    gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},instanced:{fragmentShader:["uniform mat4 viewMatrix;","uniform float opacity;","uniform vec3 fogColor;","uniform float fogNear;","uniform float fogFar;","varying vec3 vLightFront;","varying vec3 vColor;","//DEFINEFRAGCOLOR","void main() {","    gl_FragColor = vec4( vec3 ( 1.0 ), opacity );","    #ifndef WIREFRAME","    gl_FragColor.xyz *= vLightFront;","    #endif","    gl_FragColor = gl_FragColor * vec4( vColor, opacity );","    float depth = gl_FragCoord.z / gl_FragCoord.w;","    float fogFactor = smoothstep( fogNear, fogFar, depth );","    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}"].join("\n"),vertexShader:["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 directionalLightColor[ 1 ];","uniform vec3 directionalLightDirection[ 1 ];","attribute vec3 offset;","attribute vec3 position;","attribute vec3 normal;","attribute vec3 color;","attribute float radius;","varying vec3 vColor;","varying vec3 vLightFront;","void main() {","    vColor = color;","    vec3 objectNormal = normal;","    vec3 transformedNormal = normalMatrix * objectNormal;","    vec4 mvPosition = modelViewMatrix * vec4( position * radius + offset, 1.0 );","    vLightFront = vec3( 0.0 );","    transformedNormal = normalize( transformedNormal );","    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );","    vec3 dirVector = normalize( lDirection.xyz );","    float dotProduct = dot( transformedNormal, dirVector );","    vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );","    vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;","    gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},outline:{fragmentShader:["uniform float opacity;","uniform vec3 outlineColor;","uniform vec3 fogColor;","uniform float fogNear;","uniform float fogFar;","//DEFINEFRAGCOLOR","void main() {","    gl_FragColor = vec4( outlineColor, 1 );","}"].join("\n"),vertexShader:["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float outlineWidth;","uniform float outlinePushback;","attribute vec3 position;","attribute vec3 normal;","attribute vec3 color;","void main() {","    vec4 norm = modelViewMatrix*vec4(normalize(normal),0.0);","    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","    mvPosition.xy += norm.xy*outlineWidth;","    gl_Position = projectionMatrix * mvPosition;","    mvPosition.z -= outlinePushback;","    vec4 pushpos = projectionMatrix*mvPosition;","    gl_Position.z = gl_Position.w*pushpos.z/pushpos.w;","}"].join("\n"),uniforms:{opacity:{type:"f",value:1},outlineColor:{type:"c",value:new $3Dmol.Color(0,0,0)},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},outlineWidth:{type:"f",value:.1},outlinePushback:{type:"f",value:1}}},sphereimposteroutline:{fragmentShader:["uniform float opacity;","uniform vec3 outlineColor;","uniform vec3 fogColor;","uniform float fogNear;","uniform float fogFar;","uniform mat4 projectionMatrix;","varying vec2 mapping;","varying float rval;","varying vec3 center;","uniform float outlinePushback;","//DEFINEFRAGCOLOR","void main() {","    float lensqr = dot(mapping,mapping);","    float rsqr = rval*rval;","    if(lensqr > rsqr)","       discard;","    float z = sqrt(rsqr-lensqr);","    vec3 cameraPos = center+ vec3(mapping.x,mapping.y,z-outlinePushback);","    vec4 clipPos = projectionMatrix * vec4(cameraPos, 1.0);","    float ndcDepth = clipPos.z / clipPos.w;","    gl_FragDepthEXT = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;","    gl_FragColor = vec4(outlineColor, 1 );","}"].join("\n"),vertexShader:["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float outlineWidth;","uniform float outlinePushback;","attribute vec3 position;","attribute vec3 normal;","attribute vec3 color;","varying vec2 mapping;","varying float rval;","varying vec3 center;","void main() {","    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","    center = mvPosition.xyz;","    vec4 projPosition = projectionMatrix * mvPosition;","    vec2 norm = normal.xy + vec2(sign(normal.x)*outlineWidth,sign(normal.y)*outlineWidth);","    vec4 adjust = projectionMatrix* vec4(norm,normal.z,0.0); adjust.z = 0.0; adjust.w = 0.0;","    mapping = norm.xy;","    rval = abs(norm.x);","    gl_Position = projPosition+adjust;","}"].join("\n"),uniforms:{opacity:{type:"f",value:1},outlineColor:{type:"c",value:new $3Dmol.Color(0,0,0)},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},outlineWidth:{type:"f",value:.1},outlinePushback:{type:"f",value:1}}},stickimposter:{fragmentShader:[$3Dmol.ShaderUtils.stickimposterFragmentShader,"    float dotProduct = dot( norm, vLight );","    vec3 light = vec3( max( dotProduct, 0.0 ) );","    gl_FragColor = vec4(light*color, opacity*opacity );","    float fogFactor = smoothstep( fogNear, fogFar, depth );","    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}"].join("\n"),vertexShader:["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 directionalLightColor[ 1 ];","uniform vec3 directionalLightDirection[ 1 ];","attribute vec3 position;","attribute vec3 normal;","attribute vec3 color;","attribute float radius;","varying vec3 vColor;","varying vec3 vLight;","varying vec3 cposition;","varying vec3 p1;","varying vec3 p2;","varying float r;","void main() {","    vColor = color; vColor.z = abs(vColor.z);","    r = abs(radius);","    vec4 to = modelViewMatrix*vec4(normal, 1.0);","    vec4 pt = modelViewMatrix*vec4(position, 1.0);","    vec4 mvPosition = pt;","    p1 = pt.xyz; p2 = to.xyz;","    vec3 norm = to.xyz-pt.xyz;","    float mult = 1.1;","    if(length(p1) > length(p2)) {","       mvPosition = to;","    }","    vec3 n = normalize(mvPosition.xyz);","    if(color.z >= 0.0) {","       vec3 pnorm = normalize(p1);","       float t = dot(mvPosition.xyz-p1,n)/dot(pnorm,n);","       mvPosition.xyz = p1+t*pnorm;","    } else {","       vec3 pnorm = normalize(p2);","       float t = dot(mvPosition.xyz-p2,n)/dot(pnorm,n);","       mvPosition.xyz = p2+t*pnorm;","       mult *= -1.0;","    }","    vec3 cr = normalize(cross(mvPosition.xyz,norm))*radius;","    vec3 doublecr = normalize(cross(mvPosition.xyz,cr))*radius;","    mvPosition.xy +=  mult*(cr + doublecr).xy;","    cposition = mvPosition.xyz;","    gl_Position = projectionMatrix * mvPosition;","    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );","    vLight = normalize( lDirection.xyz )*directionalLightColor[0];","}"].join("\n"),uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},stickimposteroutline:{fragmentShader:$3Dmol.ShaderUtils.stickimposterFragmentShader+"gl_FragColor = vec4(color,1.0);}",vertexShader:["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 directionalLightColor[ 1 ];","uniform vec3 directionalLightDirection[ 1 ];","uniform vec3 outlineColor;","uniform float outlineWidth;","uniform float outlinePushback;","attribute vec3 position;","attribute vec3 normal;","attribute vec3 color;","attribute float radius;","varying vec3 vColor;","varying vec3 vLight;","varying vec3 cposition;","varying vec3 p1;","varying vec3 p2;","varying float r;","void main() {","    vColor = outlineColor;","    float rad = radius+sign(radius)*outlineWidth;","    r = abs(rad);","    vec4 to = modelViewMatrix*vec4(normal, 1.0);","    vec4 pt = modelViewMatrix*vec4(position, 1.0);","    to.xyz += normalize(to.xyz)*outlinePushback;","    pt.xyz += normalize(pt.xyz)*outlinePushback;","    vec4 mvPosition = pt;","    p1 = pt.xyz; p2 = to.xyz;","    vec3 norm = to.xyz-pt.xyz;","    float mult = 1.1;","    if(length(p1) > length(p2)) {","       mvPosition = to;","    }","    vec3 n = normalize(mvPosition.xyz);","    if(color.z >= 0.0) {","       vec3 pnorm = normalize(p1);","       float t = dot(mvPosition.xyz-p1,n)/dot(pnorm,n);","       mvPosition.xyz = p1+t*pnorm;","    } else {","       vec3 pnorm = normalize(p2);","       float t = dot(mvPosition.xyz-p2,n)/dot(pnorm,n);","       mvPosition.xyz = p2+t*pnorm;","       mult *= -1.0;","    }","    vec3 cr = normalize(cross(mvPosition.xyz,norm))*rad;","    vec3 doublecr = normalize(cross(mvPosition.xyz,cr))*rad;","    mvPosition.xy +=  mult*(cr + doublecr).xy;","    cposition = mvPosition.xyz;","    gl_Position = projectionMatrix * mvPosition;","    vLight = vec3(1.0,1.0,1.0);","}"].join("\n"),uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},outlineColor:{type:"c",value:new $3Dmol.Color(0,0,0)},outlineWidth:{type:"f",value:.1},outlinePushback:{type:"f",value:1}}},lambertdouble:{fragmentShader:["uniform mat4 viewMatrix;","uniform float opacity;","uniform vec3 fogColor;","uniform float fogNear;","uniform float fogFar;","varying vec3 vLightFront;","varying vec3 vLightBack;","varying vec3 vColor;","//DEFINEFRAGCOLOR","void main() {","    gl_FragColor = vec4( vec3 ( 1.0 ), opacity );","    #ifndef WIREFRAME","    if ( gl_FrontFacing )","       gl_FragColor.xyz *= vLightFront;","    else","       gl_FragColor.xyz *= vLightBack;","    #endif","    gl_FragColor = gl_FragColor * vec4( vColor, opacity );","    float depth = gl_FragCoord.z / gl_FragCoord.w;","    float fogFactor = smoothstep( fogNear, fogFar, depth );","    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}"].join("\n"),vertexShader:["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 directionalLightColor[ 1 ];","uniform vec3 directionalLightDirection[ 1 ];","attribute vec3 position;","attribute vec3 normal;","attribute vec3 color;","varying vec3 vColor;","varying vec3 vLightFront;","varying vec3 vLightBack;","void main() {","    vColor = color;","    vec3 objectNormal = normal;","    vec3 transformedNormal = normalMatrix * objectNormal;","    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","    vLightFront = vec3( 0.0 );","    vLightBack = vec3( 0.0 );","    transformedNormal = normalize( transformedNormal );","    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );","    vec3 dirVector = normalize( lDirection.xyz );","    float dotProduct = dot( transformedNormal, dirVector );","    vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );","    vec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );","    vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;","    vLightBack += directionalLightColor[ 0 ] * directionalLightWeightingBack;","    gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},directionalLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]}}},sprite:{fragmentShader:["uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","//DEFINEFRAGCOLOR","void main() {","    vec4 texture = texture2D(map, vUV);","    if (texture.a < alphaTest) discard;","    gl_FragColor = vec4(color * texture.xyz, texture.a * opacity);","    if (fogType > 0) {","        float depth = gl_FragCoord.z / gl_FragCoord.w;","        float fogFactor = 0.0;","        if (fogType == 1) {","            fogFactor = smoothstep(fogNear, fogFar, depth);","        }","        else {","            const float LOG2 = 1.442695;","            float fogFactor = exp2(- fogDensity * fogDensity * depth * depth * LOG2);","            fogFactor = 1.0 - clamp(fogFactor, 0.0, 1.0);","        }","        gl_FragColor = mix(gl_FragColor, vec4(fogColor, gl_FragColor.w), fogFactor);","    }","}"].join("\n"),vertexShader:["uniform int useScreenCoordinates;","uniform vec3 screenPosition;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 alignment;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","    vUV = uvOffset + uv * uvScale;","    vec2 alignedPosition = position + alignment;","    vec2 rotatedPosition;","    rotatedPosition.x = ( cos(rotation) * alignedPosition.x - sin(rotation) * alignedPosition.y ) * scale.x;","    rotatedPosition.y = ( sin(rotation) * alignedPosition.x + cos(rotation) * alignedPosition.y ) * scale.y;","    vec4 finalPosition;","    if(useScreenCoordinates != 0) {","        finalPosition = vec4(screenPosition.xy + rotatedPosition, screenPosition.z, 1.0);","    }","    else {","        finalPosition = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0); finalPosition /= finalPosition.w;","        finalPosition.xy += rotatedPosition; ","    }","    gl_Position = finalPosition;","}"].join("\n"),uniforms:{}},volumetric:{fragmentShader:["uniform highp sampler3D data;","uniform highp sampler2D colormap;","uniform highp sampler2D depthmap;","uniform mat4 textmat;","uniform mat4 projinv;","uniform mat4 projectionMatrix;","uniform float step;","uniform float subsamples;","uniform float maxdepth;","uniform float transfermin;","uniform float transfermax;","in  vec4 mvPosition;","out vec4 color;","void main(void) {","   vec4 pos = mvPosition;","   bool seengood = false;","   float i = 0.0;","   color = vec4(1,1,1,0);","   float increment = 1.0/subsamples;","   float maxsteps = (maxdepth*subsamples/step);","   vec4 maxpos = vec4(pos.x,pos.y,pos.z-maxdepth,1.0);","   maxpos = projectionMatrix*maxpos;","   vec4 startp = projectionMatrix*pos;","   maxpos /= maxpos.w;","   startp /= startp.w;","   maxpos = vec4(startp.x,startp.y,maxpos.z,1.0);","   maxpos = projinv*maxpos;","   maxpos /= maxpos.w;","   float incr = step/subsamples;","   vec2 tpos = startp.xy/2.0+0.5;","   float depth = texture(depthmap, tpos).r;","   vec4 direction = maxpos-pos;","   for( i = 0.0; i <= maxsteps; i++) {","      vec4 pt = (pos+(i/maxsteps)*direction);","      vec4 ppt = projectionMatrix*pt;","      float ptdepth = ppt.z/ppt.w;","      ptdepth = ((gl_DepthRange.diff * ptdepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;","      if(ptdepth > depth) break;","      pt = textmat*pt;","      if(pt.x >= -0.01 && pt.y >= -0.01 && pt.z >= -0.01 && pt.x <= 1.01 && pt.y <= 1.01 && pt.z <= 1.01) {","         seengood = true;","      } else if(seengood) {","         break;","      }","      float val = texture(data, pt.zyx).r;","      if(isinf(val)) continue;","      float cval = (val-transfermin)/(transfermax-transfermin);","      vec4 val_color = texture(colormap, vec2(cval,0.5));","      color.rgb = color.rgb*color.a + (1.0-color.a)*val_color.a*val_color.rgb;","      color.a += (1.0 - color.a) * val_color.a; ","      if(color.a > 0.0) color.rgb /= color.a;","    }","}"].join("\n"),vertexShader:["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","in vec3 position;","out vec4 mvPosition;","void main() {","    mvPosition = modelViewMatrix * vec4( position, 1.0 );","    gl_Position = projectionMatrix*mvPosition;","}"].join("\n"),uniforms:{opacity:{type:"f",value:1},fogColor:{type:"c",value:new $3Dmol.Color(1,1,1)},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},data:{type:"i",value:3},colormap:{type:"i",value:4},depthmap:{type:"i",value:5},step:{type:"f",value:1},maxdepth:{type:"f",value:100},subsamples:{type:"f",value:5},textmat:{type:"mat4",value:[]},projinv:{type:"mat4",value:[]},transfermin:{type:"f",value:-.2},transfermax:{type:"f",value:.2}}},screen:{fragmentShader:["uniform sampler2D colormap;","varying highp vec2 vTexCoords;","uniform vec2 dimensions;","//DEFINEFRAGCOLOR","void main (void) {","   gl_FragColor = texture2D(colormap, vTexCoords);","}"].join("\n"),vertexShader:["attribute vec2 vertexPosition;","varying highp vec2 vTexCoords;","const vec2 scale = vec2(0.5, 0.5);","void main() {","   vTexCoords  = vertexPosition * scale + scale; // scale vertex attribute to [0,1] range","   gl_Position = vec4(vertexPosition, 0.0, 1.0);","}"].join("\n"),uniforms:{}},screenaa:{fragmentShader:["uniform sampler2D colormap;","varying highp vec2 vTexCoords;","uniform vec2 dimensions;","// Basic FXAA implementation based on the code on geeks3d.com ","#define FXAA_REDUCE_MIN   (1.0/ 128.0)","#define FXAA_REDUCE_MUL   (1.0 / 8.0)","#define FXAA_SPAN_MAX     8.0","vec4 applyFXAA(vec2 fragCoord, sampler2D tex)","{","    vec4 color;","    vec2 inverseVP = vec2(1.0 / dimensions.x, 1.0 / dimensions.y);","    vec3 rgbNW = texture2D(tex, fragCoord + vec2(-1.0, -1.0) * inverseVP).xyz;","    vec3 rgbNE = texture2D(tex, fragCoord + vec2(1.0, -1.0) * inverseVP).xyz;","    vec3 rgbSW = texture2D(tex, fragCoord + vec2(-1.0, 1.0) * inverseVP).xyz;","    vec3 rgbSE = texture2D(tex, fragCoord + vec2(1.0, 1.0) * inverseVP).xyz;","    vec3 rgbM  = texture2D(tex, fragCoord  * inverseVP).xyz;","    vec3 luma = vec3(0.299, 0.587, 0.114);","    float lumaNW = dot(rgbNW, luma);","    float lumaNE = dot(rgbNE, luma);","    float lumaSW = dot(rgbSW, luma);","    float lumaSE = dot(rgbSE, luma);","    float lumaM  = dot(rgbM,  luma);","    float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));","    float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));","    vec2 dir;","    dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));","    dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));","    float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *","                        (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);","    float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);","    dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),","            max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),","            dir * rcpDirMin)) * inverseVP;","    vec3 rgbA = 0.5 * (","        texture2D(tex, fragCoord + dir * (1.0 / 3.0 - 0.5)).xyz +","        texture2D(tex, fragCoord  + dir * (2.0 / 3.0 - 0.5)).xyz);","    vec3 rgbB = rgbA * 0.5 + 0.25 * (","        texture2D(tex, fragCoord  + dir * -0.5).xyz +","        texture2D(tex, fragCoord  + dir * 0.5).xyz);","    float lumaB = dot(rgbB, luma);","    if ((lumaB < lumaMin) || (lumaB > lumaMax))","        color = vec4(rgbA, 1.0);","    else","        color = vec4(rgbB, 1.0);","    return color;","}","//DEFINEFRAGCOLOR","void main (void) {","   gl_FragColor = applyFXAA(vTexCoords, colormap);","}"].join("\n"),vertexShader:["attribute vec2 vertexPosition;","varying highp vec2 vTexCoords;","const vec2 scale = vec2(0.5, 0.5);","void main() {","   vTexCoords  = vertexPosition * scale + scale; // scale vertex attribute to [0,1] range","   gl_Position = vec4(vertexPosition, 0.0, 1.0);","}"].join("\n"),uniforms:{}}},"undefined"==typeof console&&(console={log:function(){}}),$3Dmol.ProteinSurface=function(){var e,t,r=0,n=0,i=0,o=2,a=0,s=0,l=0,u=0,c=null,f=null,h=null,p=0,d=0,m=0,v=0,g=0,y=0,b={H:1.2,Li:1.82,Na:2.27,K:2.75,C:1.7,N:1.55,O:1.52,F:1.47,P:1.8,S:1.8,CL:1.75,BR:1.85,SE:1.9,ZN:1.39,CU:1.4,NI:1.63,X:2},x=function(e){return e.elem&&void 0!==b[e.elem]?e.elem:"X"},w={},_={},D=[new Int32Array([1,0,0]),new Int32Array([-1,0,0]),new Int32Array([0,1,0]),new Int32Array([0,-1,0]),new Int32Array([0,0,1]),new Int32Array([0,0,-1]),new Int32Array([1,1,0]),new Int32Array([1,-1,0]),new Int32Array([-1,1,0]),new Int32Array([-1,-1,0]),new Int32Array([1,0,1]),new Int32Array([1,0,-1]),new Int32Array([-1,0,1]),new Int32Array([-1,0,-1]),new Int32Array([0,1,1]),new Int32Array([0,1,-1]),new Int32Array([0,-1,1]),new Int32Array([0,-1,-1]),new Int32Array([1,1,1]),new Int32Array([1,1,-1]),new Int32Array([1,-1,1]),new Int32Array([-1,1,1]),new Int32Array([1,-1,-1]),new Int32Array([-1,-1,1]),new Int32Array([-1,1,-1]),new Int32Array([-1,-1,-1])];this.getFacesAndVertices=function(a){for(var s={},l=0,u=a.length;l<u;l++)s[a[l]]=!0;for(var p=t,d=0,m=p.length;d<m;d++)p[d].x=p[d].x/o-r,p[d].y=p[d].y/o-n,p[d].z=p[d].z/o-i;for(var v=[],g=0,y=e.length;g<y;g+=3){var b=e[g],x=e[g+1],w=e[g+2],_=p[b].atomid,D=p[x].atomid,A=p[w].atomid,C=_;D<C&&(C=D),A<C&&(C=A),s[C]&&b!==x&&x!==w&&b!==w&&(v.push(b),v.push(x),v.push(w))}return c=null,f=null,h=null,{vertices:p,faces:v}},this.initparm=function(e,t,b){b>1e6&&(o=1);var x=1/o*5.5;p=e[0][0],v=e[1][0],d=e[0][1],g=e[1][1],m=e[0][2],y=e[1][2],t?(p-=1.4+x,d-=1.4+x,m-=1.4+x,v+=1.4+x,g+=1.4+x,y+=1.4+x):(p-=x,d-=x,m-=x,v+=x,g+=x,y+=x),p=Math.floor(p*o)/o,d=Math.floor(d*o)/o,m=Math.floor(m*o)/o,v=Math.ceil(v*o)/o,g=Math.ceil(g*o)/o,y=Math.ceil(y*o)/o,r=-p,n=-d,i=-m,l=Math.ceil(o*(v-p))+1,s=Math.ceil(o*(g-d))+1,a=Math.ceil(o*(y-m))+1,this.boundingatom(t),u=1.4*o,c=new Uint8Array(l*s*a),f=new Float64Array(l*s*a),h=new Int32Array(l*s*a)},this.boundingatom=function(e){var t,r,n,i=[];for(var a in b)if(b.hasOwnProperty(a)){var s=b[a];i[a]=e?(s+1.4)*o+.5:s*o+.5,n=i[a]*i[a],_[a]=Math.floor(i[a])+1,w[a]=new Int32Array(_[a]*_[a]);for(var l=0,u=0;u<_[a];u++)for(var c=0;c<_[a];c++)(t=u*u+c*c)>n?w[a][l]=-1:(r=Math.sqrt(n-t),w[a][l]=Math.floor(r)),l++}},this.fillvoxels=function(e,t){for(var r=0,n=c.length;r<n;r++)c[r]=0,f[r]=-1,h[r]=-1;for(var i in t){var o=e[t[i]];void 0!==o&&this.fillAtom(o,e)}for(var a=0,s=c.length;a<s;a++)1&c[a]&&(c[a]|=2)},this.fillAtom=function(e,t){var u,f,p,d,m,v,g,y,b,D,A,C,S,E,T,M,$,z,L;u=Math.floor(.5+o*(e.x+r)),f=Math.floor(.5+o*(e.y+n)),p=Math.floor(.5+o*(e.z+i));var k=x(e),I=0,R=s*a;for(D=0,L=_[k];D<L;D++)for(A=0;A<L;A++){if(-1!=w[k][I])for(M=-1;M<2;M++)for($=-1;$<2;$++)for(z=-1;z<2;z++)if(0!==M&&0!==$&&0!==z)for(g=M*D,b=z*A,C=0;C<=w[k][I];C++)if(E=f+(y=C*$),T=p+b,!((S=u+g)<0||E<0||T<0||S>=l||E>=s||T>=a)){var O=S*R+E*a+T;if(1&c[O]){var F=t[h[O]];F.serial!=e.serial&&g*g+y*y+b*b<(d=u+g-Math.floor(.5+o*(F.x+r)))*d+(m=f+y-Math.floor(.5+o*(F.y+n)))*m+(v=p+b-Math.floor(.5+o*(F.z+i)))*v&&(h[O]=e.serial)}else c[O]|=1,h[O]=e.serial}I++}},this.fillvoxelswaals=function(e,t){for(var r=0,n=c.length;r<n;r++)c[r]&=-3;for(var i in t){var o=e[t[i]];void 0!==o&&this.fillAtomWaals(o,e)}},this.fillAtomWaals=function(e,t){var u,f,p,d,m,v,g,y,b,D,A,C,S,E,T,M,$,z,L,k=0;u=Math.floor(.5+o*(e.x+r)),f=Math.floor(.5+o*(e.y+n)),p=Math.floor(.5+o*(e.z+i));var I=x(e),R=s*a;for(S=0,L=_[I];S<L;S++)for(E=0;E<L;E++){if(-1!=w[I][k])for(M=-1;M<2;M++)for($=-1;$<2;$++)for(z=-1;z<2;z++)if(0!==M&&0!==$&&0!==z)for(g=M*S,b=z*E,T=0;T<=w[I][k];T++)if(A=f+(y=T*$),C=p+b,!((D=u+g)<0||A<0||C<0||D>=l||A>=s||C>=a)){var O=D*R+A*a+C;if(2&c[O]){var F=t[h[O]];F.serial!=e.serial&&g*g+y*y+b*b<(d=u+g-Math.floor(.5+o*(F.x+r)))*d+(m=f+y-Math.floor(.5+o*(F.y+n)))*m+(v=p+b-Math.floor(.5+o*(F.z+i)))*v&&(h[O]=e.serial)}else c[O]|=2,h[O]=e.serial}k++}},this.buildboundary=function(){for(var e=s*a,t=0;t<l;t++)for(var r=0;r<a;r++)for(var n=0;n<s;n++){var i=t*e+n*a+r;if(1&c[i])for(var o=0;o<26;){var u=t+D[o][0],f=r+D[o][2],h=n+D[o][1];if(u>-1&&u<l&&h>-1&&h<s&&f>-1&&f<a&&!(1&c[u*e+h*a+f])){c[i]|=4;break}o++}}};var A=function(e,t,r){var n=new Int32Array(e*t*r*3);this.set=function(e,i,o,a){var s=3*((e*t+i)*r+o);n[s]=a.ix,n[s+1]=a.iy,n[s+2]=a.iz},this.get=function(e,i,o){var a=3*((e*t+i)*r+o);return{ix:n[a],iy:n[a+1],iz:n[a+2]}}};this.fastdistancemap=function(){var e,t,r,n,i,h=new A(l,s,a),p=s*a,d=u*u,m=[],v=[];for(e=0;e<l;e++)for(t=0;t<s;t++)for(r=0;r<a;r++)if(c[i=e*p+t*a+r]&=-3,1&c[i]&&4&c[i]){var g={ix:e,iy:t,iz:r};h.set(e,t,r,g),m.push(g),f[i]=0,c[i]|=2,c[i]&=-5}do{for(v=this.fastoneshell(m,h),m=[],e=0,n=v.length;e<n;e++)i=p*v[e].ix+a*v[e].iy+v[e].iz,c[i]&=-5,f[i]<=1.0404*d&&m.push({ix:v[e].ix,iy:v[e].iy,iz:v[e].iz})}while(0!==m.length);m=[],v=[],h=null;var y=o-.5;y<0&&(y=0);var b=d-.5/(.1+y);for(e=0;e<l;e++)for(t=0;t<s;t++)for(r=0;r<a;r++)c[i=e*p+t*a+r]&=-5,1&c[i]&&(2&c[i]&&!(2&c[i]&&f[i]>=b)||(c[i]|=4))},this.fastoneshell=function(e,t){var r,n,i,o,u,h,p,d,m,v,g,y,b=[];if(0===e.length)return b;var x={ix:-1,iy:-1,iz:-1},w=s*a;for(p=0,m=e.length;p<m;p++)for(r=e[p].ix,n=e[p].iy,i=e[p].iz,g=t.get(r,n,i),d=0;d<6;d++)x.ix=r+D[d][0],x.iy=n+D[d][1],x.iz=i+D[d][2],x.ix<l&&x.ix>-1&&x.iy<s&&x.iy>-1&&x.iz<a&&x.iz>-1&&(y=x.ix*w+a*x.iy+x.iz,1&c[y]&&!(2&c[y])?(t.set(x.ix,x.iy,i+D[d][2],g),v=(o=x.ix-g.ix)*o+(u=x.iy-g.iy)*u+(h=x.iz-g.iz)*h,f[y]=v,c[y]|=2,c[y]|=4,b.push({ix:x.ix,iy:x.iy,iz:x.iz})):1&c[y]&&2&c[y]&&(v=(o=x.ix-g.ix)*o+(u=x.iy-g.iy)*u+(h=x.iz-g.iz)*h)<f[y]&&(t.set(x.ix,x.iy,x.iz,g),f[y]=v,4&c[y]||(c[y]|=4,b.push({ix:x.ix,iy:x.iy,iz:x.iz}))));for(p=0,m=e.length;p<m;p++)for(r=e[p].ix,n=e[p].iy,i=e[p].iz,g=t.get(r,n,i),d=6;d<18;d++)x.ix=r+D[d][0],x.iy=n+D[d][1],x.iz=i+D[d][2],x.ix<l&&x.ix>-1&&x.iy<s&&x.iy>-1&&x.iz<a&&x.iz>-1&&(y=x.ix*w+a*x.iy+x.iz,1&c[y]&&!(2&c[y])?(t.set(x.ix,x.iy,i+D[d][2],g),v=(o=x.ix-g.ix)*o+(u=x.iy-g.iy)*u+(h=x.iz-g.iz)*h,f[y]=v,c[y]|=2,c[y]|=4,b.push({ix:x.ix,iy:x.iy,iz:x.iz})):1&c[y]&&2&c[y]&&(v=(o=x.ix-g.ix)*o+(u=x.iy-g.iy)*u+(h=x.iz-g.iz)*h)<f[y]&&(t.set(x.ix,x.iy,x.iz,g),f[y]=v,4&c[y]||(c[y]|=4,b.push({ix:x.ix,iy:x.iy,iz:x.iz}))));for(p=0,m=e.length;p<m;p++)for(r=e[p].ix,n=e[p].iy,i=e[p].iz,g=t.get(r,n,i),d=18;d<26;d++)x.ix=r+D[d][0],x.iy=n+D[d][1],x.iz=i+D[d][2],x.ix<l&&x.ix>-1&&x.iy<s&&x.iy>-1&&x.iz<a&&x.iz>-1&&(y=x.ix*w+a*x.iy+x.iz,1&c[y]&&!(2&c[y])?(t.set(x.ix,x.iy,i+D[d][2],g),v=(o=x.ix-g.ix)*o+(u=x.iy-g.iy)*u+(h=x.iz-g.iz)*h,f[y]=v,c[y]|=2,c[y]|=4,b.push({ix:x.ix,iy:x.iy,iz:x.iz})):1&c[y]&&2&c[y]&&(v=(o=x.ix-g.ix)*o+(u=x.iy-g.iy)*u+(h=x.iz-g.iz)*h)<f[y]&&(t.set(x.ix,x.iy,x.iz,g),f[y]=v,4&c[y]||(c[y]|=4,b.push({ix:x.ix,iy:x.iy,iz:x.iz}))));return b},this.marchingcubeinit=function(e){for(var t=0,r=c.length;t<r;t++)1==e?c[t]&=-5:4==e?(c[t]&=-3,4&c[t]&&(c[t]|=2),c[t]&=-5):2==e?4&c[t]&&2&c[t]?c[t]&=-5:4&c[t]&&!(2&c[t])&&(c[t]|=2):3==e&&(c[t]&=-5)},this.marchingcube=function(r){this.marchingcubeinit(r),t=[],e=[],$3Dmol.MarchingCube.march(c,t,e,{smooth:1,nX:l,nY:s,nZ:a});for(var n=s*a,i=0,o=t.length;i<o;i++)t[i].atomid=h[t[i].x*n+a*t[i].y+t[i].z];$3Dmol.MarchingCube.laplacianSmooth(1,t,e)}},$3Dmol.autoload=function(viewer,callback){var i,dataname,type;if(void 0!==$(".viewer_3Dmoljs")[0]&&($3Dmol.autoinit=!0),$3Dmol.autoinit){viewer=null!=viewer?viewer:null,$3Dmol.viewers={};var nviewers=0;$(".viewer_3Dmoljs").each((function(){var viewerdiv=$(this),datauri=[],datatypes=[],uri="";"static"==viewerdiv.css("position")&&viewerdiv.css("position","relative"),type=null,viewerdiv.data("pdb")?(datauri.push("https://files.rcsb.org/view/"+viewerdiv.data("pdb")+".pdb"),datatypes.push("pdb")):viewerdiv.data("cid")?(datatypes.push("sdf"),datauri.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/"+viewerdiv.data("cid")+"/SDF?record_type=3d")):(viewerdiv.data("href")||viewerdiv.data("url"))&&(uri=viewerdiv.data("href"),datauri.push(uri),type=uri.substr(uri.lastIndexOf(".")+1),datatypes.push(type));var divdata=viewerdiv.data();for(i in divdata)"pdb"===i.substring(0,3)&&"pdb"!==i?(datauri.push("https://files.rcsb.org/view/"+divdata[i]+".pdb"),datatypes.push("pdb")):"href"===i.substring(0,4)&&"href"!==i?(uri=divdata[i],datauri.push(uri),datatypes.push(uri.substr(uri.lastIndexOf(".")+1))):"cid"===i.substring(0,3)&&"cid"!==i&&(datauri.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/"+divdata[i]+"/SDF?record_type=3d"),datatypes.push("sdf"));var options={};viewerdiv.data("options")&&(options=$3Dmol.specStringToObject(viewerdiv.data("options")));var bgcolor=$3Dmol.CC.color(viewerdiv.data("backgroundcolor")),style={line:{}};viewerdiv.data("style")&&(style=$3Dmol.specStringToObject(viewerdiv.data("style")));var select={};viewerdiv.data("select")&&(select=$3Dmol.specStringToObject(viewerdiv.data("select")));var selectstylelist=[],surfaces=[],labels=[],zoomto={},d=viewerdiv.data(),stylere=/style(.+)/,surfre=/surface(.*)/,reslabre=/labelres(.*)/,keys=[];for(dataname in d)d.hasOwnProperty(dataname)&&keys.push(dataname);for(keys.sort(),i=0;i<keys.length;i++){dataname=keys[i];var m=stylere.exec(dataname),selname,newsel,styleobj;m&&(selname="select"+m[1],newsel=$3Dmol.specStringToObject(d[selname]),styleobj=$3Dmol.specStringToObject(d[dataname]),selectstylelist.push([newsel,styleobj])),m=surfre.exec(dataname),m&&(selname="select"+m[1],newsel=$3Dmol.specStringToObject(d[selname]),styleobj=$3Dmol.specStringToObject(d[dataname]),surfaces.push([newsel,styleobj])),m=reslabre.exec(dataname),m&&(selname="select"+m[1],newsel=$3Dmol.specStringToObject(d[selname]),styleobj=$3Dmol.specStringToObject(d[dataname]),labels.push([newsel,styleobj])),"zoomto"==dataname&&(zoomto=$3Dmol.specStringToObject(d[dataname]))}var applyStyles=function(e){var t,r;for(e.setStyle(select,style),i=0;i<selectstylelist.length;i++)t=selectstylelist[i][0]||{},r=selectstylelist[i][1]||{line:{}},e.setStyle(t,r);for(i=0;i<surfaces.length;i++)t=surfaces[i][0]||{},r=surfaces[i][1]||{},e.addSurface($3Dmol.SurfaceType.VDW,r,t,t);for(i=0;i<labels.length;i++)t=labels[i][0]||{},r=labels[i][1]||{},e.addResLabels(t,r);e.zoomTo(zoomto),e.render()},glviewer=viewer;try{null==glviewer&&(glviewer=$3Dmol.viewers[this.id||nviewers++]=$3Dmol.createViewer(viewerdiv,{defaultcolors:$3Dmol.rasmolElementColors})),glviewer.setBackgroundColor(bgcolor)}catch(e){console.log(e),window.location="http://get.webgl.org"}if(0!=datauri.length){i=0;var process=function process(moldata){uri=datauri[i];var type=viewerdiv.data("type")||viewerdiv.data("datatype")||datatypes[i];if(glviewer.addModel(moldata,type,options),i+=1,i<datauri.length)$.get(datauri[i],process,"text");else{if(applyStyles(glviewer),viewerdiv.data("callback")){var runres=eval(viewerdiv.data("callback"));"function"==typeof runres&&runres(glviewer)}callback&&callback(glviewer)}};$.get(datauri[0],process,"text")}else{if(viewerdiv.data("element")){var moldata=$("#"+viewerdiv.data("element")).val()||"";type=viewerdiv.data("type")||viewerdiv.data("datatype"),type||(console.log("Warning: No type specified for embedded viewer with moldata from "+viewerdiv.data("element")+"\n assuming type 'pdb'"),type="pdb"),glviewer.addModel(moldata,type,options)}if(applyStyles(glviewer),viewerdiv.data("callback")){var runres=eval(viewerdiv.data("callback"));"function"==typeof runres&&runres(glviewer)}callback&&callback(glviewer)}}))}},$(document).ready((function(){$3Dmol.autoload()}));var htmlColors=$3Dmol.htmlColors={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgrey:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,grey:8421504,green:32768,greenyellow:11403055,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgrey:13882323,lightgreen:9498256,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};$3Dmol.CC={cache:{0:new $3Dmol.Color(0)},color:function e(t){if(!t)return this.cache[0];if(void 0!==this.cache[t])return this.cache[t];if(t&&t.constructor===Array)return t.map(e,this);if("number"==typeof(t=this.getHex(t))){var r=new $3Dmol.Color(t);return this.cache[t]=r,r}return t},getHex:function(e){return isNaN(parseInt(e))?"string"==typeof e?(4==(e=e.trim()).length&&"#"==e[0]&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),7==e.length&&"#"==e[0]?parseInt(e.substring(1),16):htmlColors[e.toLowerCase()]||0):e:parseInt(e)}},$3Dmol.CC=$3Dmol.CC,$3Dmol.CC.color=$3Dmol.CC.color,$3Dmol.ssColors=$3Dmol.ssColors||{},$3Dmol.ssColors.pyMol={h:16711680,s:16776960,c:65280},$3Dmol.ssColors.Jmol={h:16711808,s:16762880,c:16777215},$3Dmol.elementColors=$3Dmol.elementColors||{},$3Dmol.elementColors.defaultColor=16716947,$3Dmol.elementColors.Jmol={H:16777215,He:14286847,HE:14286847,Li:13402367,LI:13402367,Be:12779264,BE:12779264,B:16758197,C:9474192,N:3166456,O:16715021,F:9494608,Ne:11789301,NE:11789301,Na:11230450,NA:11230450,Mg:9109248,MG:9109248,Al:12560038,AL:12560038,Si:1578e4,SI:1578e4,P:16744448,S:16777008,Cl:2093087,CL:2093087,Ar:8442339,AR:8442339,K:9388244,Ca:4062976,CA:4062976,Sc:15132390,SC:15132390,Ti:12567239,TI:12567239,V:10921643,Cr:9083335,CR:9083335,Mn:10255047,MN:10255047,Fe:14706227,FE:14706227,Co:15765664,CO:15765664,Ni:5296208,NI:5296208,Cu:13140019,CU:13140019,Zn:8224944,ZN:8224944,Ga:12750735,GA:12750735,Ge:6721423,GE:6721423,As:12419299,AS:12419299,Se:16752896,SE:16752896,Br:10889513,BR:10889513,Kr:6076625,KR:6076625,Rb:7351984,RB:7351984,Sr:65280,SR:65280,Y:9764863,Zr:9756896,ZR:9756896,Nb:7586505,NB:7586505,Mo:5551541,MO:5551541,Tc:3907230,TC:3907230,Ru:2396047,RU:2396047,Rh:687500,RH:687500,Pd:27013,PD:27013,Ag:12632256,AG:12632256,Cd:16767375,CD:16767375,In:10909043,IN:10909043,Sn:6717568,SN:6717568,Sb:10380213,SB:10380213,Te:13924864,TE:13924864,I:9699476,Xe:4366e3,XE:4366e3,Cs:5707663,CS:5707663,Ba:51456,BA:51456,La:7394559,LA:7394559,Ce:16777159,CE:16777159,Pr:14286791,PR:14286791,Nd:13107143,ND:13107143,Pm:10747847,PM:10747847,Sm:9437127,SM:9437127,Eu:6422471,EU:6422471,Gd:4587463,GD:4587463,Tb:3211207,TB:3211207,Dy:2097095,DY:2097095,Ho:65436,HO:65436,Er:58997,ER:58997,Tm:54354,TM:54354,Yb:48952,YB:48952,Lu:43812,LU:43812,Hf:5096191,HF:5096191,Ta:5089023,TA:5089023,W:2200790,Re:2522539,RE:2522539,Os:2516630,OS:2516630,Ir:1528967,IR:1528967,Pt:13684960,PT:13684960,Au:16765219,AU:16765219,Hg:12105936,HG:12105936,Tl:10900557,TL:10900557,Pb:5724513,PB:5724513,Bi:10375093,BI:10375093,Po:11230208,PO:11230208,At:7688005,AT:7688005,Rn:4358806,RN:4358806,Fr:4325478,FR:4325478,Ra:32e3,RA:32e3,Ac:7384058,AC:7384058,Th:47871,TH:47871,Pa:41471,PA:41471,U:36863,Np:33023,NP:33023,Pu:27647,PU:27647,Am:5528818,AM:5528818,Cm:7888099,CM:7888099,Bk:9064419,BK:9064419,Cf:10565332,CF:10565332,Es:11739092,ES:11739092,Fm:11739066,FM:11739066,Md:11734438,MD:11734438,No:12389767,NO:12389767,Lr:13041766,LR:13041766,Rf:13369433,RF:13369433,Db:13697103,DB:13697103,Sg:14221381,SG:14221381,Bh:14680120,BH:14680120,Hs:15073326,HS:15073326,Mt:15400998,MT:15400998},$3Dmol.elementColors.rasmol={H:16777215,He:16761035,HE:16761035,Li:11674146,LI:11674146,B:65280,C:13158600,N:9408511,O:15728640,F:14329120,Na:255,NA:255,Mg:2263842,MG:2263842,Al:8421520,AL:8421520,Si:14329120,SI:14329120,P:16753920,S:16762930,Cl:65280,CL:65280,Ca:8421520,CA:8421520,Ti:8421520,TI:8421520,Cr:8421520,CR:8421520,Mn:8421520,MN:8421520,Fe:16753920,FE:16753920,Ni:10824234,NI:10824234,Cu:10824234,CU:10824234,Zn:10824234,ZN:10824234,Br:10824234,BR:10824234,Ag:8421520,AG:8421520,I:10494192,Ba:16753920,BA:16753920,Au:14329120,AU:14329120},$3Dmol.elementColors.defaultColors=$3Dmol.elementColors.rasmol,$3Dmol.elementColors.greenCarbon=$.extend({},$3Dmol.elementColors.defaultColors),$3Dmol.elementColors.greenCarbon.C=65280,$3Dmol.elementColors.cyanCarbon=$.extend({},$3Dmol.elementColors.defaultColors),$3Dmol.elementColors.cyanCarbon.C=65535,$3Dmol.elementColors.magentaCarbon=$.extend({},$3Dmol.elementColors.defaultColors),$3Dmol.elementColors.magentaCarbon.C=16711935,$3Dmol.elementColors.yellowCarbon=$.extend({},$3Dmol.elementColors.defaultColors),$3Dmol.elementColors.yellowCarbon.C=16776960,$3Dmol.elementColors.whiteCarbon=$.extend({},$3Dmol.elementColors.defaultColors),$3Dmol.elementColors.whiteCarbon.C=16777215,$3Dmol.elementColors.orangeCarbon=$.extend({},$3Dmol.elementColors.defaultColors),$3Dmol.elementColors.orangeCarbon.C=16753920,$3Dmol.elementColors.purpleCarbon=$.extend({},$3Dmol.elementColors.defaultColors),$3Dmol.elementColors.purpleCarbon.C=8388736,$3Dmol.elementColors.blueCarbon=$.extend({},$3Dmol.elementColors.defaultColors),$3Dmol.elementColors.blueCarbon.C=255,$3Dmol.residues={},$3Dmol.residues.amino={ALA:13158600,ARG:1334015,ASN:56540,ASP:15075850,CYS:15132160,GLN:56540,GLU:15075850,GLY:15461355,HIS:8553170,ILE:1016335,LEU:1016335,LYS:1334015,MET:15132160,PHE:3289770,PRO:14456450,SER:16422400,THR:16422400,TRP:11819700,TYR:3289770,VAL:1016335,ASX:16738740,GLX:16738740},$3Dmol.residues.shapely={ALA:9240460,ARG:124,ASN:16743536,ASP:10485826,CYS:16777072,GLN:16731212,GLU:6684672,GLY:16777215,HIS:7368959,ILE:19456,LEU:4546117,LYS:4671416,MET:12099650,PHE:5459026,PRO:5395026,SER:16740418,THR:12078080,TRP:5195264,TYR:9203788,VAL:16747775,ASX:16711935,GLX:16711935},$3Dmol.residues.nucleic={A:10526975,G:16740464,I:8454143,C:16747595,T:10551200,U:16744576},$3Dmol.chains={},$3Dmol.chains.atom={A:12636415,B:11599792,C:16761032,D:16777088,E:16761087,F:11596016,G:16765040,H:15761536,I:16113331,J:49151,K:13458524,L:6737322,M:10145074,N:15631086,O:52945,P:65407,Q:3978097,R:139,S:12433259,T:25600,U:8388608,V:8421376,W:8388736,X:32896,Y:12092939,Z:11674146},$3Dmol.chains.hetatm={A:9478351,B:8441752,C:13602992,D:13619056,E:13603023,F:8437952,G:13607008,H:12603504,I:12955267,J:42959,K:11881548,L:5682578,M:9090346,N:12481214,O:46753,P:53103,Q:3447649,R:187,S:10854235,T:37888,U:11534336,V:11579392,W:11534512,X:45232,Y:15250963,Z:12726834},$3Dmol.builtinColorSchemes={ssPyMol:{prop:"ss",map:$3Dmol.ssColors.pyMol},ssJmol:{prop:"ss",map:$3Dmol.ssColors.Jmol},Jmol:{prop:"elem",map:$3Dmol.elementColors.Jmol},greenCarbon:{prop:"elem",map:$3Dmol.elementColors.greenCarbon},default:{prop:"elem",map:$3Dmol.elementColors.defaultColors},amino:{prop:"resn",map:$3Dmol.residues.amino},shapely:{prop:"resn",map:$3Dmol.residues.shapely},nucleic:{prop:"resn",map:$3Dmol.residues.nucleic},chain:{prop:"chain",map:$3Dmol.chains.atom},chainHetatm:{prop:"chain",map:$3Dmol.chains.hetatm}},$3Dmol.getColorFromStyle=function(e,t){var r=t.colorscheme;if(void 0!==$3Dmol.builtinColorSchemes[r])r=$3Dmol.builtinColorSchemes[r];else if("string"==typeof r&&r.endsWith("Carbon")){var n=r.substring(0,r.lastIndexOf("Carbon")).toLowerCase();if(void 0!==htmlColors[n]){var i=$.extend({},$3Dmol.elementColors.defaultColors);i.C=htmlColors[n],$3Dmol.builtinColorSchemes[r]={prop:"elem",map:i},r=$3Dmol.builtinColorSchemes[r]}}var o,a,s=e.color;if(void 0!==t.color&&"spectrum"!=t.color&&(s=t.color),void 0!==r)if(void 0!==$3Dmol.elementColors[r])void 0!==(r=$3Dmol.elementColors[r])[e[r.prop]]&&(s=r.map[e[r.prop]]);else if(void 0!==r[e[r.prop]])s=r.map[e[r.prop]];else if(void 0!==r.prop&&void 0!==r.gradient){o=r.prop;var l=r.gradient;void 0!==$3Dmol.Gradient.builtinGradients[l]&&(l=new $3Dmol.Gradient.builtinGradients[l](r.min,r.max,r.mid));var u=l.range()||[-1,1];null!=(a=$3Dmol.getAtomProperty(e,o))&&(s=l.valueToHex(a,u))}else void 0!==r.prop&&void 0!==r.map?(o=r.prop,a=$3Dmol.getAtomProperty(e,o),void 0!==r.map[a]&&(s=r.map[a])):void 0!==t.colorscheme[e.elem]?s=t.colorscheme[e.elem]:console.log("Could not interpret colorscheme "+r);else void 0!==t.colorfunc&&(s=t.colorfunc(e));return $3Dmol.CC.color(s)};var $3Dmol=$3Dmol||{};$3Dmol.subdivide_spline=function(e,t){var r,n,i,o,a,s,l,u,c,f=[],h=e;for((h=[]).push(e[0]),r=1,n=e.length-1;r<n;r++)if(a=e[r],s=e[r+1],a.smoothen){var p=new $3Dmol.Vector3((a.x+s.x)/2,(a.y+s.y)/2,(a.z+s.z)/2);p.atom=a.atom,h.push(p)}else h.push(a);for(h.push(e[e.length-1]),r=-1,i=h.length;r<=i-3;r++)if(o=h[-1===r?0:r],a=h[r+1],s=h[r+2],l=h[r===i-3?i-1:r+3],u=(new $3Dmol.Vector3).subVectors(s,o).multiplyScalar(.5),c=(new $3Dmol.Vector3).subVectors(l,a).multiplyScalar(.5),!s.skip)for(var d=0;d<t;d++){var m=1/t*d,v=a.x+m*u.x+m*m*(-3*a.x+3*s.x-2*u.x-c.x)+m*m*m*(2*a.x-2*s.x+u.x+c.x),g=a.y+m*u.y+m*m*(-3*a.y+3*s.y-2*u.y-c.y)+m*m*m*(2*a.y-2*s.y+u.y+c.y),y=a.z+m*u.z+m*m*(-3*a.z+3*s.z-2*u.z-c.z)+m*m*m*(2*a.z-2*s.z+u.z+c.z),b=new $3Dmol.Vector3(v,g,y);b.atom=d<t/2?a.atom:s.atom,f.push(b)}return f.push(h[h.length-1]),f},$3Dmol.drawCartoon=function(){var e=function(e,t,r,n){for(var i,o,a,s,l=0,u=t.length;l<u;l++){s=Math.round(l*(n.length-1)/u),a=$3Dmol.CC.color(n[s]);var c=e.updateGeoGroup(2),f=c.vertexArray,h=c.colorArray,p=c.faceArray;f[o=3*(i=c.vertices)]=t[l].x,f[o+1]=t[l].y,f[o+2]=t[l].z,f[o+3]=r[l].x,f[o+4]=r[l].y,f[o+5]=r[l].z;for(var d=0;d<6;++d)h[o+3*d]=a.r,h[o+1+3*d]=a.g,h[o+2+3*d]=a.b;if(l>0){var m=[i,i+1,i-1,i-2],v=c.faceidx;p[v]=m[0],p[v+1]=m[1],p[v+2]=m[3],p[v+3]=m[1],p[v+4]=m[2],p[v+5]=m[3],c.faceidx+=6}c.vertices+=2}},t=function(e,t,r,n,i){if(0!==t.length){i=void 0===i?5:i;var o=new $3Dmol.Geometry,a=new $3Dmol.LineBasicMaterial({linewidth:r});a.vertexColors=!0;var s=new $3Dmol.Line(o,a);s.type=$3Dmol.LineStrip,e.add(s)}},r=function(t,r,n,i,o,a,s){s&&"default"!==s||(s="rectangle"),"edged"===s?function(t,r,n,i,o,a){if(!(r.length<2)){var s,l;if(s=r[0],l=r[r.length-1],s=$3Dmol.subdivide_spline(s,i),l=$3Dmol.subdivide_spline(l,i),!o)return e(t,s,l,n);var u,c,f,h,p,d,m,v,g,y,b,x,w,_,D,A,C,S,E,T,M,$,z=[],L=[[0,2,-6,-8],[-4,-2,6,4],[7,-1,-5,3],[-3,5,1,-7]];for(w=0,_=s.length;w<_;w++){if(y=Math.round(w*(n.length-1)/_),g=$3Dmol.CC.color(n[y]),z.push(c=s[w]),z.push(c),z.push(f=l[w]),z.push(f),w<_-1){var k=s[w+1].clone().sub(s[w]);u=l[w].clone().sub(s[w]).cross(k).normalize().multiplyScalar(o)}for(z.push(h=s[w].clone().add(u)),z.push(h),z.push(p=l[w].clone().add(u)),z.push(p),void 0!==c.atom&&(b=c.atom),T=(E=t.updateGeoGroup(8)).vertexArray,M=E.colorArray,$=E.faceArray,T[m=3*(d=E.vertices)]=c.x,T[m+1]=c.y,T[m+2]=c.z,T[m+3]=c.x,T[m+4]=c.y,T[m+5]=c.z,T[m+6]=f.x,T[m+7]=f.y,T[m+8]=f.z,T[m+9]=f.x,T[m+10]=f.y,T[m+11]=f.z,T[m+12]=h.x,T[m+13]=h.y,T[m+14]=h.z,T[m+15]=h.x,T[m+16]=h.y,T[m+17]=h.z,T[m+18]=p.x,T[m+19]=p.y,T[m+20]=p.z,T[m+21]=p.x,T[m+22]=p.y,T[m+23]=p.z,D=0;D<8;++D)M[m+3*D]=g.r,M[m+1+3*D]=g.g,M[m+2+3*D]=g.b;if(w>0){var I=void 0!==x&&void 0!==b&&x.serial!==b.serial;for(D=0;D<4;D++){var R=[d+L[D][0],d+L[D][1],d+L[D][2],d+L[D][3]];if($[v=E.faceidx]=R[0],$[v+1]=R[1],$[v+2]=R[3],$[v+3]=R[1],$[v+4]=R[2],$[v+5]=R[3],E.faceidx+=6,b.clickable||x.clickable||b.hoverable||x.hoverable){var O=z[R[3]].clone(),F=z[R[0]].clone(),N=z[R[2]].clone(),P=z[R[1]].clone();if(O.atom=z[R[3]].atom||null,N.atom=z[R[2]].atom||null,F.atom=z[R[0]].atom||null,P.atom=z[R[1]].atom||null,I){var j=O.clone().add(F).multiplyScalar(.5),B=N.clone().add(P).multiplyScalar(.5),U=O.clone().add(P).multiplyScalar(.5);D%2==0?((x.clickable||x.hoverable)&&(A=new $3Dmol.Triangle(j,U,O),C=new $3Dmol.Triangle(B,N,U),S=new $3Dmol.Triangle(U,N,O),x.intersectionShape.triangle.push(A),x.intersectionShape.triangle.push(C),x.intersectionShape.triangle.push(S)),(b.clickable||b.hoverable)&&(A=new $3Dmol.Triangle(F,P,U),C=new $3Dmol.Triangle(P,B,U),S=new $3Dmol.Triangle(F,U,j),b.intersectionShape.triangle.push(A),b.intersectionShape.triangle.push(C),b.intersectionShape.triangle.push(S))):((b.clickable||b.hoverable)&&(A=new $3Dmol.Triangle(j,U,O),C=new $3Dmol.Triangle(B,N,U),S=new $3Dmol.Triangle(U,N,O),b.intersectionShape.triangle.push(A),b.intersectionShape.triangle.push(C),b.intersectionShape.triangle.push(S)),(x.clickable||x.hoverable)&&(A=new $3Dmol.Triangle(F,P,U),C=new $3Dmol.Triangle(P,B,U),S=new $3Dmol.Triangle(F,U,j),x.intersectionShape.triangle.push(A),x.intersectionShape.triangle.push(C),x.intersectionShape.triangle.push(S)))}else(b.clickable||b.hoverable)&&(A=new $3Dmol.Triangle(F,P,O),C=new $3Dmol.Triangle(P,N,O),b.intersectionShape.triangle.push(A),b.intersectionShape.triangle.push(C))}}}E.vertices+=8,x=b}var V=z.length-8;for(T=(E=t.updateGeoGroup(8)).vertexArray,M=E.colorArray,$=E.faceArray,m=3*(d=E.vertices),v=E.faceidx,w=0;w<4;w++){z.push(z[2*w]),z.push(z[V+2*w]);var q=z[2*w],G=z[V+2*w];T[m+6*w]=q.x,T[m+1+6*w]=q.y,T[m+2+6*w]=q.z,T[m+3+6*w]=G.x,T[m+4+6*w]=G.y,T[m+5+6*w]=G.z,M[m+6*w]=g.r,M[m+1+6*w]=g.g,M[m+2+6*w]=g.b,M[m+3+6*w]=g.r,M[m+4+6*w]=g.g,M[m+5+6*w]=g.b}V+=8,A=[d,d+2,d+6,d+4],C=[d+1,d+5,d+7,d+3],$[v]=A[0],$[v+1]=A[1],$[v+2]=A[3],$[v+3]=A[1],$[v+4]=A[2],$[v+5]=A[3],$[v+6]=C[0],$[v+7]=C[1],$[v+8]=C[3],$[v+9]=C[1],$[v+10]=C[2],$[v+11]=C[3],E.faceidx+=12,E.vertices+=8}}(t,r,n,i,o):"rectangle"!==s&&"oval"!==s&&"parabola"!==s||function(t,r,n,i,o,a,s){var l,u,c,f;if(!((c=r.length)<2||r[0].length<2)){for(l=0;l<c;l++)r[l]=$3Dmol.subdivide_spline(r[l],i);if(f=r[0].length,!o)return e(t,r[0],r[c-1],n);var h,p,d,m,v,g,y=[],b=[],x=[];for(u=0;u<c;u++)y.push(.25+1.5*Math.sqrt((c-1)*u-Math.pow(u,2))/(c-1)),b.push(.5),x.push(2*(Math.pow(u/c,2)-u/c)+.6);var w,_,D,A,C,S,E=[];for(u=0;u<2*c-1;u++)E[u]=[u,u+1,u+1-2*c,u-2*c];E[2*c-1]=[u,u+1-2*c,u+1-4*c,u-2*c];var T,M,$,z,L=t.updateGeoGroup(2*c*f);for(l=0;l<f;l++){var k,I;for(S=Math.round(l*(n.length-1)/f),C=$3Dmol.CC.color(n[S]),v=d,g=m,d=[],m=[],h=[],void 0!==r[0][l].atom&&(A=r[0][l].atom,"oval"===s?p=y:"rectangle"===s?p=b:"parabola"===s&&(p=x)),p||(p=b),u=0;u<c;u++)k=l<f-1?r[u][l+1].clone().sub(r[u][l]):r[u][l-1].clone().sub(r[u][l]).negate(),I=u<c-1?r[u+1][l].clone().sub(r[u][l]):r[u-1][l].clone().sub(r[u][l]).negate(),h[u]=I.cross(k).normalize().multiplyScalar(o*p[u]);for(u=0;u<c;u++)d[u]=r[u][l].clone().add(h[u].clone().negate());for(u=0;u<c;u++)m[u]=r[u][l].clone().add(h[u]);for(T=L.vertexArray,M=L.colorArray,$=L.faceArray,_=3*(w=L.vertices),u=0;u<c;u++)T[_+3*u+0]=d[u].x,T[_+3*u+1]=d[u].y,T[_+3*u+2]=d[u].z;for(u=0;u<c;u++)T[_+3*u+0+3*c]=m[c-1-u].x,T[_+3*u+1+3*c]=m[c-1-u].y,T[_+3*u+2+3*c]=m[c-1-u].z;for(u=0;u<2*c;++u)M[_+3*u+0]=C.r,M[_+3*u+1]=C.g,M[_+3*u+2]=C.b;if(l>0){for(u=0;u<2*c;u++)z=[w+E[u][0],w+E[u][1],w+E[u][2],w+E[u][3]],$[D=L.faceidx]=z[0],$[D+1]=z[1],$[D+2]=z[3],$[D+3]=z[1],$[D+4]=z[2],$[D+5]=z[3],L.faceidx+=6;if(A.clickable||A.hoverable){var R=[];for(u in R.push(new $3Dmol.Triangle(v[0],d[0],d[c-1])),R.push(new $3Dmol.Triangle(v[0],d[c-1],v[c-1])),R.push(new $3Dmol.Triangle(v[c-1],d[c-1],m[c-1])),R.push(new $3Dmol.Triangle(v[c-1],m[c-1],g[c-1])),R.push(new $3Dmol.Triangle(m[0],g[0],g[c-1])),R.push(new $3Dmol.Triangle(m[c-1],m[0],g[c-1])),R.push(new $3Dmol.Triangle(d[0],v[0],g[0])),R.push(new $3Dmol.Triangle(m[0],d[0],g[0])),R)A.intersectionShape.triangle.push(R[u])}}L.vertices+=2*c}for(T=L.vertexArray,M=L.colorArray,$=L.faceArray,_=3*(w=L.vertices),D=L.faceidx,l=0;l<c-1;l++)z=[l,l+1,2*c-2-l,2*c-1-l],$[D=L.faceidx]=z[0],$[D+1]=z[1],$[D+2]=z[3],$[D+3]=z[1],$[D+4]=z[2],$[D+5]=z[3],L.faceidx+=6;for(l=0;l<c-1;l++)z=[w-1-l,w-2-l,w-2*c+l+1,w-2*c+l],$[D=L.faceidx]=z[0],$[D+1]=z[1],$[D+2]=z[3],$[D+3]=z[1],$[D+4]=z[2],$[D+5]=z[3],L.faceidx+=6}}(t,r,n,i,o,0,s)},n=function(e){return e&&"C"===e.elem&&"CA"===e.atom},i=function(e,t){if(e&&t&&e.chain===t.chain){if(e.reschain===t.reschain&&(e.resi===t.resi||e.resi===t.resi-1))return!0;if(e.resi<t.resi){var r=e.x-t.x,n=e.y-t.y,i=e.z-t.z;if(r*r+n*n+i*i<16)return!0}}return!1},o=function(e,t,r,n,i){if(null!=t&&0!=t.vertices){i&&(t.initTypedArrays(),t.setUpNormals());var o=new $3Dmol.MeshDoubleLambertMaterial;o.vertexColors=$3Dmol.FaceColors,"number"==typeof r&&r>=0&&r<1&&(o.transparent=!0,o.opacity=r),o.outline=n;var a=new $3Dmol.Mesh(t,o);e.add(a)}},a=function(e,t,r,n,i,o,a,s,l){var u,c,f,h,p,d;if(n&&i&&a){var m=i.sub(n);m.normalize();var v=s[l];for(c=l+1;c<s.length&&(v=s[c]).atom!=a.atom;c++);if((v=v?new $3Dmol.Vector3(v.x,v.y,v.z):new $3Dmol.Vector3(0,0,0)).sub(n),"arrow start"===a.ss){var g=v.clone().multiplyScalar(.3).cross(i);n.add(g);var y=v.clone().cross(m).normalize();m.rotateAboutVector(y,.43)}for(a.style.cartoon.ribbon?u=a.style.cartoon.thickness||.4:a.style.cartoon.width?u=a.style.cartoon.width:"c"===a.ss?u="P"===a.atom?.8:.5:"arrow start"===a.ss?(u=1.3,p=!0):u="arrow end"===a.ss?.5:"h"===a.ss&&a.style.cartoon.tubes||"tube start"===a.ss?.5:1.3,null!=o&&m.dot(o)<0&&m.negate(),m.multiplyScalar(u),c=0;c<t;c++)f=2*c/(t-1)-1,(h=new $3Dmol.Vector3(n.x+f*m.x,n.y+f*m.y,n.z+f*m.z)).atom=a,r&&"s"===a.ss&&(h.smoothen=!0),e[c].push(h);if(p)for(m.multiplyScalar(2),c=0;c<t;c++)f=2*c/(t-1)-1,(h=new $3Dmol.Vector3(n.x+f*m.x,n.y+f*m.y,n.z+f*m.z)).atom=a,h.smoothen=!1,h.skip=!0,e[c].push(h);return d=a.style.cartoon.style||"default",e.style?e.style!=d&&(console.log("Warning: a cartoon chain's strand-style is ambiguous"),e.style="default"):e.style=d,"arrow start"!==a.ss&&"arrow end"!==a.ss||(a.ss="s"),p}},s={C:!0,CA:!0,O:!0,P:!0,OP2:!0,O2P:!0,"O5'":!0,"O3'":!0,"C5'":!0,"C2'":!0,"O5*":!0,"O3*":!0,"C5*":!0,"C2*":!0,N1:!0,N3:!0},l={DA:!0,DG:!0,A:!0,G:!0},u={DT:!0,DC:!0,U:!0,C:!0,T:!0},c={DA:!0,DG:!0,A:!0,G:!0,DT:!0,DC:!0,U:!0,C:!0,T:!0};return function(e,f,h,p){!function(e,f,h,p,d,m,v){var g,y,b,x,w,_,D,A,C,S,E,T,M,z,L,k,I,R;m=m||5,v=v||5;var O=new $3Dmol.Geometry(!0),F=new $3Dmol.Geometry(!0),N=[],P=[],j=1,B=!1,U={};for(var V in $3Dmol.Gradient.builtinGradients)$3Dmol.Gradient.builtinGradients.hasOwnProperty(V)&&(U[V]=new $3Dmol.Gradient.builtinGradients[V](h[1],h[0]));var q=function(e,t){return h&&"spectrum"===t.color?t.colorscheme in U?U[t.colorscheme].valueToHex(e.resi):U.sinebow.valueToHex(e.resi):$3Dmol.getColorFromStyle(e,t).getHex()};for(A=0;A<m;A++)P[A]=[];var G=!1,H=!1,W=[];for(A in f){if("C"===(x=f[A]).elem&&"CA"===x.atom){var Y=i(b,x);Y&&"s"===x.ss?G=!0:G&&(b&&y&&b.style.cartoon.arrows&&y.style.cartoon.arrows&&(b.ss="arrow end",y.ss="arrow start"),G=!1),Y&&("h"===b.ss||"tube start"==b.ss)&&b.style.cartoon.tubes?!H&&"tube start"!=b.ss&&x.style.cartoon.tubes&&(x.ss="tube start",H=!0):H&&("tube start"===b.ss?b.ss="tube end":y&&y.style.cartoon.tubes&&(y.ss="tube end"),H=!1),y=b,b=x}x&&x.atom in s&&W.push(x)}H&&b.style.cartoon.tubes&&(b.ss="tube end",H=!1);var X=function(n){for(var i=0;!D&&i<m;i++)t(e,P[i],1,0,v);P[0].length>0&&r(F,P,N,v,D,0,P.style);var a=[],s=null;if(n){for(i=0;i<m;i++)a[i]=P[i][P[i].length-1];s=N[N.length-1]}for(P=[],i=0;i<m;i++)P[i]=[];if(N=[],n){for(i=0;i<m;i++)P[i].push(a[i]);N.push(s)}o(e,F,j,B,!0),o(e,O,j,B,!1),F=new $3Dmol.Geometry(!0),O=new $3Dmol.Geometry(!0)};b=void 0;for(var K=0;K<W.length;K++){var Z=(x=W[K]).resn.trim(),Q=Z in c;if(j=1,g=x.style.cartoon,b&&b.style.cartoon&&(j=b.style.cartoon.opacity),b&&b.style.cartoon&&b.style.cartoon.outline&&(B=b.style.cartoon.outline),!b||!b.style.cartoon||x.style.cartoon&&b.style.cartoon.opacity==x.style.cartoon.opacity||X(b.chain==x.chain),P.length&&P[0].length>3e4/m/v/2&&X(!0),"trace"===g.style){if(x.hetflag);else if("C"===x.elem&&"CA"===x.atom||Q&&"P"===x.atom){if(_=q(x,g),D=$.isNumeric(g.thickness)?g.thickness:.4,i(b,x))if(_==w){var J=$3Dmol.CC.color(_);$3Dmol.GLDraw.drawCylinder(O,b,x,D,J,2,2)}else{var ee=(new $3Dmol.Vector3).addVectors(b,x).multiplyScalar(.5),te=$3Dmol.CC.color(w),re=$3Dmol.CC.color(_);$3Dmol.GLDraw.drawCylinder(O,b,ee,D,te,2,0),$3Dmol.GLDraw.drawCylinder(O,ee,x,D,re,0,2)}if((!0===x.clickable||x.hoverable)&&void 0!==x.intersectionShape){var ne=new $3Dmol.Vector3(x.x,x.y,x.z);x.intersectionShape.sphere.push(new $3Dmol.Sphere(ne,D))}b=x,w=_}}else{if(n(x)||Q&&("P"===x.atom||0==x.atom.indexOf("O5"))){if(R)if("tube end"===x.ss)R=!1,I=new $3Dmol.Vector3(x.x,x.y,x.z),$3Dmol.GLDraw.drawCylinder(O,k,I,2,$3Dmol.CC.color(w),1,1),x.ss="h";else{if(b.chain==x.chain&&"tube end"!==b.ss)continue;R=!1,b.ss="h",I=new $3Dmol.Vector3(b.x,b.y,b.z),$3Dmol.GLDraw.drawCylinder(O,k,I,2,$3Dmol.CC.color(w),1,1)}if(b&&(!i(b,x)||"tube start"===b.ss)){for("tube start"===b.ss&&(R=!0,k=new $3Dmol.Vector3(b.x,b.y,b.z),b.ss="h"),L&&(z=T?(new $3Dmol.Vector3).addVectors(b,T).multiplyScalar(.5):new $3Dmol.Vector3(b.x,b.y,b.z),$3Dmol.GLDraw.drawCylinder(O,z,L,.4,$3Dmol.CC.color(L.color),0,2),a(P,m,!0,T,M,E,b,W,K),N.push(_),z=null,L=null),A=0;!D&&A<m;A++)t(e,P[A],1,0,v);for(P[0].length>0&&r(F,P,N,v,D,0,P.style),P=[],A=0;A<m;A++)P[A]=[];N=[]}if(void 0===b||b.rescode!=x.rescode||b.resi!=x.resi){if(L){var ie=(z=(new $3Dmol.Vector3).addVectors(b,x).multiplyScalar(.5)).clone().sub(L).multiplyScalar(.02);z.add(ie),$3Dmol.GLDraw.drawCylinder(O,z,L,.4,$3Dmol.CC.color(L.color),0,2),z=null,L=null}_=q(x,g),N.push(_),D=$.isNumeric(g.thickness)?g.thickness:.4,b=x,(C=new $3Dmol.Vector3(b.x,b.y,b.z)).resi=b.resi,w=_}!0!==x.clickable&&!0!==x.hoverable||void 0!==x.intersectionShape&&void 0!==x.intersectionShape.triangle||(x.intersectionShape={sphere:null,cylinder:[],line:[],triangle:[]})}else n(b)&&"O"===x.atom||Q&&"P"===b.atom&&("OP2"===x.atom||"O2P"===x.atom)||Q&&0==b.atom.indexOf("O5")&&0==x.atom.indexOf("C5")?((S=new $3Dmol.Vector3(x.x,x.y,x.z)).resi=x.resi,"OP2"!==x.atom&&"O2P"!==x.atom||(M=new $3Dmol.Vector3(x.x,x.y,x.z))):Q&&0==x.atom.indexOf("O3")?T=new $3Dmol.Vector3(x.x,x.y,x.z):("N1"===x.atom&&Z in l||"N3"===x.atom&&Z in u)&&((L=new $3Dmol.Vector3(x.x,x.y,x.z)).color=$3Dmol.getColorFromStyle(x,g).getHex());S&&C&&S.resi===C.resi&&(a(P,m,!0,C,S,E,b,W,K),E=S,C=null,S=null,N.push(_))}}L&&(z=T?(new $3Dmol.Vector3).addVectors(b,T).multiplyScalar(.5):new $3Dmol.Vector3(b.x,b.y,b.z),$3Dmol.GLDraw.drawCylinder(O,z,L,.4,$3Dmol.CC.color(L.color),0,2),a(P,m,!0,T,M,E,b,W,K),N.push(_)),X()}(e,f,h,0,0,p=p||5,p)}}();var $3Dmol=$3Dmol||{};$3Dmol.CAP={NONE:0,FLAT:1,ROUND:2},$3Dmol.GLDraw=function(){var e,t={},r=(e=new $3Dmol.Vector3,function(t){e.set(t[0],t[1],t[2]);var r,n,i,o,a,s=e.x,l=e.y,u=e.z,c=Math.sqrt(s*s+l*l);c<1e-4?(n=0,i=1):(n=-s/c,i=l/c),l=-n*s+i*l,(r=Math.sqrt(l*l+u*u))<1e-4?(o=0,a=1):(o=u/r,a=l/r);var f=new Float32Array(9);return f[0]=i,f[1]=n,f[2]=0,f[3]=-n*a,f[4]=i*a,f[5]=o,f[6]=n*o,f[7]=-i*o,f[8]=a,f}),n=function(){var e,t=[],r=Math.pow(2,4),n=2,i=Math.pow(2,n),o=r/i;for(t[0]=new $3Dmol.Vector3(-1,0,0),t[o]=new $3Dmol.Vector3(0,0,1),t[2*o]=new $3Dmol.Vector3(1,0,0),t[3*o]=new $3Dmol.Vector3(0,0,-1),n=3;n<=4;n++){for(o=r/(i=Math.pow(2,n-1)),e=0;e<i-1;e++)t[o/2+e*o]=t[e*o].clone().add(t[(e+1)*o]).normalize();t[o/2+(e=i-1)*o]=t[e*o].clone().add(t[0]).normalize()}return t}(),i={cache:{},getVerticesForRadius:function(e,t,r){if(void 0!==_typeof(this.chache)&&void 0!==this.cache[e]&&void 0!==this.cache[e][t+r])return this.cache[e][t+r];for(var i,o=n.length,a=[],s=[],l=0;l<o;l++)a.push(n[l].clone().multiplyScalar(e)),a.push(n[l].clone().multiplyScalar(e)),i=n[l].clone().normalize(),s.push(i),s.push(i);var u,c,f=[],h=o,p=2*Math.PI,d=Math.PI,m=!1,v=!1;for(c=0;c<=10;c++){m=0===c||10===c,v=5===c;var g=[],y=[];for(u=0;u<=h;u++)if(v){var b=u<h?2*u:0;y.push(b+1),g.push(b)}else{var x=u/h,w=c/10;if(m&&0!==u)m&&g.push(a.length-1);else if(u<h){var _=new $3Dmol.Vector3;_.x=-e*Math.cos(0+x*p)*Math.sin(0+w*d),_.y=1==t?0:e*Math.cos(0+w*d),_.z=e*Math.sin(0+x*p)*Math.sin(0+w*d),Math.abs(_.x)<1e-5&&(_.x=0),Math.abs(_.y)<1e-5&&(_.y=0),Math.abs(_.z)<1e-5&&(_.z=0),t==$3Dmol.CAP.FLAT?(i=new $3Dmol.Vector3(0,Math.cos(0+w*d),0)).normalize():(i=new $3Dmol.Vector3(_.x,_.y,_.z)).normalize(),a.push(_),s.push(i),g.push(a.length-1)}else g.push(a.length-h)}v&&f.push(y),f.push(g)}var D={vertices:a,normals:s,verticesRows:f,w:h,h:10};return e in this.cache||(this.cache[e]={}),this.cache[e][t+r]=D,D}};t.drawCylinder=function(e,t,n,o,a,s,l){if(t&&n){var u=l||s;a=a||{r:0,g:0,b:0};var c=[n.x,n.y,n.z];c[0]-=t.x,c[1]-=t.y,c[2]-=t.z;var f,h,p,d,m,v,g=r(c),y=i.getVerticesForRadius(o,l,"to"),b=y.w,x=y.h,w=u?x*b+2:2*b,_=e.updateGeoGroup(w),D=y.vertices,A=y.normals,C=y.verticesRows,S=C[x/2],E=C[x/2+1],T=_.vertices,M=_.vertexArray,$=_.normalArray,z=_.colorArray,L=_.faceArray;for(p=0;p<b;++p){var k=2*p;d=g[0]*D[k].x+g[3]*D[k].y+g[6]*D[k].z,m=g[1]*D[k].x+g[4]*D[k].y+g[7]*D[k].z,v=g[5]*D[k].y+g[8]*D[k].z,f=3*(T+k),h=_.faceidx,M[f]=d+t.x,M[f+1]=m+t.y,M[f+2]=v+t.z,M[f+3]=d+n.x,M[f+4]=m+n.y,M[f+5]=v+n.z,$[f]=d,$[f+3]=d,$[f+1]=m,$[f+4]=m,$[f+2]=v,$[f+5]=v,z[f]=a.r,z[f+3]=a.r,z[f+1]=a.g,z[f+4]=a.g,z[f+2]=a.b,z[f+5]=a.b,L[h]=E[p]+T,L[h+1]=E[p+1]+T,L[h+2]=S[p]+T,L[h+3]=S[p]+T,L[h+4]=E[p+1]+T,L[h+5]=S[p+1]+T,_.faceidx+=6}if(u){var I,R,O,F,N,P,j,B,U,V,q,G,H,W,Y,X,K,Z,Q,J,ee,te,re,ne,ie,oe,ae,se,le,ue,ce,fe,he=s?x+1:x/2+1;for(m=l?0:x/2;m<he;m++)if(m!==x/2){var pe=m<=x/2?n:t,de=i.getVerticesForRadius(o,l,"to"),me=i.getVerticesForRadius(o,s,"from");for(pe===n?(D=de.vertices,A=de.normals,C=de.verticesRows):pe==t&&(D=me.vertices,A=me.normals,C=me.verticesRows),d=0;d<b;d++)h=_.faceidx,le=3*((I=C[m][d+1])+T),ue=3*((R=C[m][d])+T),ce=3*((O=C[m+1][d])+T),fe=3*((F=C[m+1][d+1])+T),N=g[0]*D[I].x+g[3]*D[I].y+g[6]*D[I].z,P=g[0]*D[R].x+g[3]*D[R].y+g[6]*D[R].z,j=g[0]*D[O].x+g[3]*D[O].y+g[6]*D[O].z,B=g[0]*D[F].x+g[3]*D[F].y+g[6]*D[F].z,U=g[1]*D[I].x+g[4]*D[I].y+g[7]*D[I].z,V=g[1]*D[R].x+g[4]*D[R].y+g[7]*D[R].z,q=g[1]*D[O].x+g[4]*D[O].y+g[7]*D[O].z,G=g[1]*D[F].x+g[4]*D[F].y+g[7]*D[F].z,H=g[5]*D[I].y+g[8]*D[I].z,W=g[5]*D[R].y+g[8]*D[R].z,Y=g[5]*D[O].y+g[8]*D[O].z,X=g[5]*D[F].y+g[8]*D[F].z,M[le]=N+pe.x,M[ue]=P+pe.x,M[ce]=j+pe.x,M[fe]=B+pe.x,M[le+1]=U+pe.y,M[ue+1]=V+pe.y,M[ce+1]=q+pe.y,M[fe+1]=G+pe.y,M[le+2]=H+pe.z,M[ue+2]=W+pe.z,M[ce+2]=Y+pe.z,M[fe+2]=X+pe.z,z[le]=a.r,z[ue]=a.r,z[ce]=a.r,z[fe]=a.r,z[le+1]=a.g,z[ue+1]=a.g,z[ce+1]=a.g,z[fe+1]=a.g,z[le+2]=a.b,z[ue+2]=a.b,z[ce+2]=a.b,z[fe+2]=a.b,K=g[0]*A[I].x+g[3]*A[I].y+g[6]*A[I].z,Z=g[0]*A[R].x+g[3]*A[R].y+g[6]*A[R].z,Q=g[0]*A[O].x+g[3]*A[O].y+g[6]*A[O].z,J=g[0]*A[F].x+g[3]*A[F].y+g[6]*A[F].z,ee=g[1]*A[I].x+g[4]*A[I].y+g[7]*A[I].z,te=g[1]*A[R].x+g[4]*A[R].y+g[7]*A[R].z,re=g[1]*A[O].x+g[4]*A[O].y+g[7]*A[O].z,ne=g[1]*A[F].x+g[4]*A[F].y+g[7]*A[F].z,ie=g[5]*A[I].y+g[8]*A[I].z,oe=g[5]*A[R].y+g[8]*A[R].z,ae=g[5]*A[O].y+g[8]*A[O].z,se=g[5]*A[F].y+g[8]*A[F].z,0===m?($[le]=K,$[ce]=Q,$[fe]=J,$[le+1]=ee,$[ce+1]=re,$[fe+1]=ne,$[le+2]=ie,$[ce+2]=ae,$[fe+2]=se,L[h]=I+T,L[h+1]=O+T,L[h+2]=F+T,_.faceidx+=3):m===he-1?($[le]=K,$[ue]=Z,$[ce]=Q,$[le+1]=ee,$[ue+1]=te,$[ce+1]=re,$[le+2]=ie,$[ue+2]=oe,$[ce+2]=ae,L[h]=I+T,L[h+1]=R+T,L[h+2]=O+T,_.faceidx+=3):($[le]=K,$[ue]=Z,$[fe]=J,$[le+1]=ee,$[ue+1]=te,$[fe+1]=ne,$[le+2]=ie,$[ue+2]=oe,$[fe+2]=se,$[ue]=Z,$[ce]=Q,$[fe]=J,$[ue+1]=te,$[ce+1]=re,$[fe+1]=ne,$[ue+2]=oe,$[ce+2]=ae,$[fe+2]=se,L[h]=I+T,L[h+1]=R+T,L[h+2]=F+T,L[h+3]=R+T,L[h+4]=O+T,L[h+5]=F+T,_.faceidx+=6)}}_.vertices+=w}},t.drawCone=function(e,t,i,o,a){if(t&&i){a=a||{r:0,g:0,b:0};var s=[i.x,i.y,i.z];s.x-=t.x,s.y-=t.y,s.z-=t.z;var l,u,c,f,h,p,d=r(s),m=n.length,v=n,g=m+2,y=e.updateGeoGroup(g),b=y.vertices,x=y.vertexArray,w=y.normalArray,_=y.colorArray,D=y.faceArray;l=3*b;var A=new $3Dmol.Vector3(s[0],s[1],s[2]).normalize();for(x[l]=t.x,x[l+1]=t.y,x[l+2]=t.z,w[l]=-A.x,w[l+1]=-A.y,w[l+2]=-A.z,_[l]=a.r,_[l+1]=a.g,_[l+2]=a.b,x[l+3]=i.x,x[l+4]=i.y,x[l+5]=i.z,w[l+3]=A.x,w[l+4]=A.y,w[l+5]=A.z,_[l+3]=a.r,_[l+4]=a.g,_[l+5]=a.b,l+=6,c=0;c<m;++c){var C=v[c].clone();C.multiplyScalar(o),f=d[0]*C.x+d[3]*C.y+d[6]*C.z,h=d[1]*C.x+d[4]*C.y+d[7]*C.z,p=d[5]*C.y+d[8]*C.z,x[l]=f+t.x,x[l+1]=h+t.y,x[l+2]=p+t.z,w[l]=f,w[l+1]=h,w[l+2]=p,_[l]=a.r,_[l+1]=a.g,_[l+2]=a.b,l+=3}for(y.vertices+=m+2,u=y.faceidx,c=0;c<m;c++){var S=b+2+c,E=b+2+(c+1)%m;D[u]=S,D[u+1]=E,D[u+2]=b,D[u+=3]=S,D[u+1]=E,D[u+2]=b+1,u+=3}y.faceidx+=6*m}};var o={cache:{},getVerticesForRadius:function(e){if(void 0!==this.cache[e])return this.cache[e];var t={vertices:[],verticesRows:[],normals:[]},r=16,n=10;e<1&&(r=10,n=8);var i,o,a=2*Math.PI,s=Math.PI;for(o=0;o<=n;o++){var l=[];for(i=0;i<=r;i++){var u=i/r,c=o/n,f={};f.x=-e*Math.cos(0+u*a)*Math.sin(0+c*s),f.y=e*Math.cos(0+c*s),f.z=e*Math.sin(0+u*a)*Math.sin(0+c*s);var h=new $3Dmol.Vector3(f.x,f.y,f.z);h.normalize(),t.vertices.push(f),t.normals.push(h),l.push(t.vertices.length-1)}t.verticesRows.push(l)}return this.cache[e]=t,t}};return t.drawSphere=function(e,t,r,n){for(var i,a,s=o.getVerticesForRadius(r),l=s.vertices,u=s.normals,c=e.updateGeoGroup(l.length),f=c.vertices,h=c.vertexArray,p=c.colorArray,d=c.faceArray,m=c.lineArray,v=c.normalArray,g=0,y=l.length;g<y;++g){var b=3*(f+g),x=l[g];h[b]=x.x+t.x,h[b+1]=x.y+t.y,h[b+2]=x.z+t.z,p[b]=n.r,p[b+1]=n.g,p[b+2]=n.b}c.vertices+=l.length;var w=s.verticesRows,_=w.length-1;for(a=0;a<_;a++){var D=w[a].length-1;for(i=0;i<D;i++){var A=c.faceidx,C=c.lineidx,S=w[a][i+1]+f,E=3*S,T=w[a][i]+f,M=3*T,$=w[a+1][i]+f,z=3*$,L=w[a+1][i+1]+f,k=3*L,I=u[S-f],R=u[T-f],O=u[$-f],F=u[L-f];Math.abs(l[S-f].y)===r?(v[E]=I.x,v[z]=O.x,v[k]=F.x,v[E+1]=I.y,v[z+1]=O.y,v[k+1]=F.y,v[E+2]=I.z,v[z+2]=O.z,v[k+2]=F.z,d[A]=S,d[A+1]=$,d[A+2]=L,m[C]=S,m[C+1]=$,m[C+2]=S,m[C+3]=L,m[C+4]=$,m[C+5]=L,c.faceidx+=3,c.lineidx+=6):Math.abs(l[$-f].y)===r?(v[E]=I.x,v[M]=R.x,v[z]=O.x,v[E+1]=I.y,v[M+1]=R.y,v[z+1]=O.y,v[E+2]=I.z,v[M+2]=R.z,v[z+2]=O.z,d[A]=S,d[A+1]=T,d[A+2]=$,m[C]=S,m[C+1]=T,m[C+2]=S,m[C+3]=$,m[C+4]=T,m[C+5]=$,c.faceidx+=3,c.lineidx+=6):(v[E]=I.x,v[M]=R.x,v[k]=F.x,v[E+1]=I.y,v[M+1]=R.y,v[k+1]=F.y,v[E+2]=I.z,v[M+2]=R.z,v[k+2]=F.z,v[M]=R.x,v[z]=O.x,v[k]=F.x,v[M+1]=R.y,v[z+1]=O.y,v[k+1]=F.y,v[M+2]=R.z,v[z+2]=O.z,v[k+2]=F.z,d[A]=S,d[A+1]=T,d[A+2]=L,d[A+3]=T,d[A+4]=$,d[A+5]=L,m[C]=S,m[C+1]=T,m[C+2]=S,m[C+3]=L,m[C+4]=T,m[C+5]=$,m[C+6]=$,m[C+7]=L,c.faceidx+=6,c.lineidx+=8)}}},t}();var $3Dmol=$3Dmol||{};$3Dmol.GLModel=function(){var e={line:{}},t={H:1.2,Li:1.82,LI:1.82,Na:2.27,NA:2.27,K:2.75,C:1.7,N:1.55,O:1.52,F:1.47,P:1.8,S:1.8,CL:1.75,Cl:1.75,BR:1.85,Br:1.85,SE:1.9,Se:1.9,ZN:1.39,Zn:1.39,CU:1.4,Cu:1.4,NI:1.63,Ni:1.63};o.validElements=["H","Li","LI","Na","NA","K","C","N","O","F","P","S","CL","Cl","BR","Br","SE","Se","ZN","Zn","CU","Cu","NI","Ni"],o.validAtomSpecs={resn:{type:"string",valid:!0},x:{type:"number",valid:!1,step:.1},y:{type:"number",valid:!1,step:.1},z:{type:"number",valid:!1,step:.1},color:{type:"color",gui:!0},surfaceColor:{type:"color",gui:!0},elem:{type:"element",gui:!0},hetflag:{type:"boolean",valid:!1},chain:{type:"string",gui:!0},resi:{type:"number",gui:!0},icode:{type:"number",valid:!1,step:.1},rescode:{type:"number",valid:!1,step:.1},serial:{type:"number",valid:!1,step:.1},atom:{type:"string",valid:!1},bonds:{type:"array",valid:!1},ss:{type:"string",valid:!1},singleBonds:{type:"boolean",valid:!1},bondOrder:{type:"array",valid:!1},properties:{type:"properties",valid:!1},b:{type:"number",valid:!1,step:.1},pdbline:{type:"string",valid:!1},clickable:{type:"boolean",valid:!1},callback:{type:"function",valid:!1},invert:{type:"boolean",valid:!1},reflectivity:{type:"number",gui:!0,step:.1},altLoc:{type:"invalid",valid:!1}},o.validAtomSelectionSpecs=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}(o.validAtomSpecs,{model:{type:"string",valid:!1},bonds:{type:"string",valid:!1},predicate:{type:"string",valid:!1},invert:{type:"string",valid:!1},byres:{type:"string",valid:!1},expand:{type:"string",valid:!1},within:{type:"string",valid:!1},and:{type:"string",valid:!1},or:{type:"string",valid:!1},not:{type:"string",valid:!1}});var r={hidden:{type:"boolean",gui:!0},linewidth:{type:"number",gui:!0,step:.1,default:1},colorscheme:{type:"colorscheme",gui:!0},color:{type:"color",gui:!0}},n={hidden:{type:"boolean",gui:!0},linewidth:{type:"number",gui:!1,step:.1,default:1,min:0},colorscheme:{type:"colorscheme",gui:!0},color:{type:"color",gui:!0},radius:{type:"number",gui:!0,step:.1,default:1,min:.1},scale:{type:"number",gui:!0,step:.1,default:1,min:0}},i={hidden:{type:"boolean",gui:!0},singleBonds:{type:"boolean",gui:!0},colorscheme:{type:"colorscheme",gui:!0},color:{type:"color",gui:!0},radius:{type:"number",gui:!0,step:.1,default:1.5,min:0}};o.validAtomStyleSpecs={line:{validItems:r,gui:!0},cross:{validItems:n,gui:!0},stick:{validItems:{hidden:{type:"boolean",gui:!0},colorscheme:{type:"colorscheme",gui:!0},color:{type:"color",gui:!0},radius:{type:"number",gui:!0,step:.1,default:.25,min:.1},singleBonds:{type:"boolean",gui:!0}},gui:!0},sphere:{validItems:i,gui:!0},cartoon:{validItems:{style:{validItems:["trace","oval","rectangle","parabola","edged"],gui:!0},color:{type:"color",gui:!0},arrows:{type:"boolean",gui:!0},ribbon:{type:"boolean",gui:!0},hidden:{type:"boolean",gui:!0},tubes:{type:"boolean",gui:!0},thickness:{type:"number",gui:!0,step:.1,default:1,min:0},width:{type:"number",gui:!0,step:.1,default:1,min:0},opacity:{type:"number",gui:!0,step:.1,default:1,min:0,max:1}},gui:!0},colorfunc:{validItems:null,valid:!1},clicksphere:{validItems:i}},o.validSurfaceSpecs={opacity:{type:"number",gui:!0,step:.1,default:1,min:0,max:1},colorscheme:{type:"colorscheme",gui:!0},color:{type:"color",gui:!0},voldata:{type:"number",gui:!1},volscheme:{type:"number",gui:!1},map:{type:"number",gui:!1}},o.validLabelResSpecs={font:{type:"string",gui:!0},fontSize:{type:"number",gui:!0,step:1,default:12,min:1},fontColor:{type:"color",gui:!0},fontOpacity:{type:"number",gui:!0,step:.1,default:1,min:0,max:1},borderThickness:{type:"number",gui:!0,step:.1,default:1,min:0},borderColor:{type:"color",gui:!0},borderOpacity:{type:"number",gui:!0,step:.1,default:1,min:0,max:1},backgroundColor:{type:"color",gui:!0},backgroundOpacity:{type:"number",gui:!0,step:.1,default:1,min:0,max:1},position:{type:"array",valid:!1},inFront:{type:"boolean",gui:!0},showBackground:{type:"boolean",gui:!0},fixed:{type:"boolean",gui:!0},alignment:{validItems:["topLeft","topCenter","topRight","centerLeft","center","centerRight","bottomLeft","bottomCenter","bottomRight"],gui:!0},scale:{type:"boolean",gui:!1}};function o(r,n){var i=[],a=[],s=null,l=null,u=r,c=!1,f=null,h=null,p=null,d={},m=new $3Dmol.Matrix4,v=!0,g=$3Dmol.elementColors.defaultColor,y=(n=n||{}).defaultcolors?n.defaultcolors:$3Dmol.elementColors.defaultColors,b=n.defaultSphereRadius?n.defaultSphereRadius:1.5,x=n.cartoonQuality?n.cartoonQuality:5,w=function(e,r){var n=b;return void 0!==r.radius?n=r.radius:t[e.elem]&&(n=t[e.elem]),void 0!==r.scale&&(n*=r.scale),n},_=function(e,t){if(e.style.cross){var r=e.style.cross;if(!r.hidden){var n=r.linewidth||1;t[n]||(t[n]=new $3Dmol.Geometry);var i=t[n].updateGeoGroup(6),o=w(e,r),a=[[o,0,0],[-o,0,0],[0,o,0],[0,-o,0],[0,0,o],[0,0,-o]],s=e.clickable||e.hoverable;s&&void 0===e.intersectionShape&&(e.intersectionShape={sphere:[],cylinder:[],line:[]});for(var l=$3Dmol.getColorFromStyle(e,r),u=i.vertexArray,c=i.colorArray,f=0;f<6;f++){var h=3*i.vertices;if(i.vertices++,u[h]=e.x+a[f][0],u[h+1]=e.y+a[f][1],u[h+2]=e.z+a[f][2],c[h]=l.r,c[h+1]=l.g,c[h+2]=l.b,s){var p=new $3Dmol.Vector3(a[f][0],a[f][1],a[f][2]);p.multiplyScalar(.1),p.set(p.x+e.x,p.y+e.y,p.z+e.z),e.intersectionShape.line.push(p)}}}}},D=function(e,t,r){var n,o,a,s,l,u=new $3Dmol.Vector3(e.x,e.y,e.z),c=new $3Dmol.Vector3(t.x,t.y,t.z).clone(),f=null;c.sub(u);var h=function(e,t){for(var r=null,n=-1,h=0,p=e.bonds.length;h<p;h++)if(e.bonds[h]!=t.index){o=e.bonds[h],a=i[o],s=new $3Dmol.Vector3(a.x,a.y,a.z),(l=s.clone()).sub(u),(f=l.clone()).cross(c);var d=f.lengthSq();if(d>n&&(r=f,(n=d)>.1))return r}return r};if(1===e.bonds.length)1===t.bonds.length?(f=c.clone(),Math.abs(f.x)>1e-4?f.y+=1:f.x+=1):(n=(r+1)%t.bonds.length,o=t.bonds[n],a=i[o],s=new $3Dmol.Vector3(a.x,a.y,a.z),(l=s.clone()).sub(u),(f=l.clone()).cross(c));else if((f=h(e,t)).lengthSq()<.01){var p=h(t,e);null!=p&&(f=p)}return f.lengthSq()<.01&&(f=c.clone(),Math.abs(f.x)>1e-4?f.y+=1:f.x+=1),f.cross(c),f.normalize(),f},A=function(e,t,r,n,i,o){e[r]=n.x,e[r+1]=n.y,e[r+2]=n.z,t[r]=o.r,t[r+1]=o.g,t[r+2]=o.b,e[r+3]=i.x,e[r+4]=i.y,e[r+5]=i.z,t[r+3]=o.r,t[r+4]=o.g,t[r+5]=o.b},C=function(e,t,r){if(e.style.line){var n=e.style.line;if(!n.hidden){var i,o,a,s,l=n.linewidth||1;r[l]||(r[l]=new $3Dmol.Geometry);for(var u=r[l].updateGeoGroup(6*e.bonds.length),c=u.vertexArray,f=u.colorArray,h=0;h<e.bonds.length;h++){var p=t[e.bonds[h]];if(p.style.line&&!(e.serial>=p.serial)){var d=new $3Dmol.Vector3(e.x,e.y,e.z),m=new $3Dmol.Vector3(p.x,p.y,p.z),v=d.clone().add(m).multiplyScalar(.5),g=!1,y=e.clickable||e.hoverable,b=p.clickable||p.hoverable;(y||b)&&(y&&(void 0===e.intersectionShape&&(e.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}),e.intersectionShape.line.push(d),e.intersectionShape.line.push(v)),b&&(void 0===p.intersectionShape&&(p.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}),p.intersectionShape.line.push(v),p.intersectionShape.line.push(m)));var x=$3Dmol.getColorFromStyle(e,e.style.line),w=$3Dmol.getColorFromStyle(p,p.style.line);if(e.bondStyles&&e.bondStyles[h]){var _=e.bondStyles[h];if(!_.iswire)continue;_.singleBond&&(g=!0),void 0!==_.color1&&(x=$3Dmol.CC.color(_.color1)),void 0!==_.color2&&(w=$3Dmol.CC.color(_.color2))}var C,S,E=3*u.vertices;if(e.bondOrder[h]>1&&e.bondOrder[h]<4&&!g){var T=D(e,p,h),M=m.clone();M.sub(d),2==e.bondOrder[h]?(T.multiplyScalar(.1),(i=d.clone()).add(T),(o=d.clone()).sub(T),(a=i.clone()).add(M),(s=o.clone()).add(M),x==w?(u.vertices+=4,A(c,f,E,i,a,x),A(c,f,E+6,o,s,x)):(u.vertices+=8,M.multiplyScalar(.5),(C=i.clone()).add(M),(S=o.clone()).add(M),A(c,f,E,i,C,x),A(c,f,E+6,C,a,w),A(c,f,E+12,o,S,x),A(c,f,E+18,S,s,w))):3==e.bondOrder[h]&&(T.multiplyScalar(.1),(i=d.clone()).add(T),(o=d.clone()).sub(T),(a=i.clone()).add(M),(s=o.clone()).add(M),x==w?(u.vertices+=6,A(c,f,E,d,m,x),A(c,f,E+6,i,a,x),A(c,f,E+12,o,s,x)):(u.vertices+=12,M.multiplyScalar(.5),(C=i.clone()).add(M),(S=o.clone()).add(M),A(c,f,E,d,v,x),A(c,f,E+6,v,m,w),A(c,f,E+12,i,C,x),A(c,f,E+18,C,a,w),A(c,f,E+24,o,S,x),A(c,f,E+30,S,s,w)))}else x==w?(u.vertices+=2,A(c,f,E,d,m,x)):(u.vertices+=4,A(c,f,E,d,v,x),A(c,f,E+6,v,m,w))}}}}},S=function(e,t){if(e.style.sphere){var r=e.style.sphere;if(!r.hidden){var n=$3Dmol.getColorFromStyle(e,r),i=w(e,r);if((!0===e.clickable||e.hoverable)&&void 0!==e.intersectionShape){var o=new $3Dmol.Vector3(e.x,e.y,e.z);e.intersectionShape.sphere.push(new $3Dmol.Sphere(o,i))}$3Dmol.GLDraw.drawSphere(t,e,i,n)}}},E=function(e){if(e.style.clicksphere){var t=e.style.clicksphere;if(!t.hidden){var r=w(e,t);if((!0===e.clickable||e.hoverable)&&void 0!==e.intersectionShape){var n=new $3Dmol.Vector3(e.x,e.y,e.z);e.intersectionShape.sphere.push(new $3Dmol.Sphere(n,r))}}}},T=function(e,t){if(e.style.sphere){var r=e.style.sphere;if(!r.hidden){var n=w(e,r),i=$3Dmol.getColorFromStyle(e,r),o=t.updateGeoGroup(1),a=o.vertices,s=3*a,l=o.vertexArray,u=o.colorArray,c=o.radiusArray;if(l[s]=e.x,l[s+1]=e.y,l[s+2]=e.z,u[s]=i.r,u[s+1]=i.g,u[s+2]=i.b,c[a]=n,(!0===e.clickable||e.hoverable)&&void 0!==e.intersectionShape){var f=new $3Dmol.Vector3(e.x,e.y,e.z);e.intersectionShape.sphere.push(new $3Dmol.Sphere(f,n))}o.vertices+=1}}},M=function(e,t,r,n){var i,o=e.updateGeoGroup(4),a=o.vertices,s=3*a,l=o.vertexArray,u=o.colorArray;for(i=0;i<4;i++)l[s+3*i]=t.x,l[s+3*i+1]=t.y,l[s+3*i+2]=t.z;var c=o.normalArray;for(i=0;i<4;i++)u[s+3*i]=n.r,u[s+3*i+1]=n.g,u[s+3*i+2]=n.b;c[s+0]=-r,c[s+1]=r,c[s+2]=0,c[s+3]=-r,c[s+4]=-r,c[s+5]=0,c[s+6]=r,c[s+7]=-r,c[s+8]=0,c[s+9]=r,c[s+10]=r,c[s+11]=0,o.vertices+=4;var f=o.faceArray,h=o.faceidx;f[h+0]=a,f[h+1]=a+1,f[h+2]=a+2,f[h+3]=a+2,f[h+4]=a+3,f[h+5]=a,o.faceidx+=6},z=function(e,t){if(e.style.sphere){var r=e.style.sphere;if(!r.hidden){var n=w(e,r),i=$3Dmol.getColorFromStyle(e,r);if((!0===e.clickable||e.hoverable)&&void 0!==e.intersectionShape){var o=new $3Dmol.Vector3(e.x,e.y,e.z);e.intersectionShape.sphere.push(new $3Dmol.Sphere(o,n))}M(t,e,n,i)}}},L=function(e,t,r,n,i){for(var o,a=e.updateGeoGroup(4),s=a.vertices,l=3*s,u=a.vertexArray,c=a.colorArray,f=a.radiusArray,h=a.normalArray,p=i.r,d=i.g,m=i.b,v=l,g=0;g<4;g++)u[v]=t.x,h[v]=r.x,c[v]=p,u[++v]=t.y,h[v]=r.y,c[v]=d,u[++v]=t.z,h[v]=r.z,c[v]=g<2?m:(o=void 0,0==(o=-m)&&(o=-1e-4),o),v++;a.vertices+=4,f[s]=-n,f[s+1]=n,f[s+2]=-n,f[s+3]=n;var y=a.faceArray,b=a.faceidx;y[b+0]=s,y[b+1]=s+1,y[b+2]=s+2,y[b+3]=s+2,y[b+4]=s+3,y[b+5]=s,a.faceidx+=6},k=function(e,t,r){if(e.style.stick){var n=e.style.stick;if(!n.hidden){var i,o,a,s,l,u,c,f,h,p,d,m,v,g,y=n.radius||.25,b=y,x=n.singleBonds||!1,w=0,_=0,A=$3Dmol.getColorFromStyle(e,n);!e.capDrawn&&e.bonds.length<4&&(w=2);var C=$3Dmol.GLDraw.drawCylinder;for(r.imposter&&(C=L),a=0;a<e.bonds.length;a++){var S=t[e.bonds[a]];if(e.serial<S.serial){var E=S.style;if(!E.stick||E.stick.hidden)continue;var T=$3Dmol.getColorFromStyle(S,E.stick);if(b=y,s=x,e.bondStyles&&e.bondStyles[a]){if((l=e.bondStyles[a]).iswire)continue;l.radius&&(b=l.radius),l.singleBond&&(s=!0),void 0!==l.color1&&(A=$3Dmol.CC.color(l.color1)),void 0!==l.color2&&(T=$3Dmol.CC.color(l.color2))}var $=new $3Dmol.Vector3(e.x,e.y,e.z),z=new $3Dmol.Vector3(S.x,S.y,S.z);if(1===e.bondOrder[a]||s){if(!S.capDrawn&&S.bonds.length<4&&(_=2),A!=T?(C(r,$,m=(new $3Dmol.Vector3).addVectors($,z).multiplyScalar(.5),b,A,w,0),C(r,m,z,b,T,0,_)):C(r,$,z,b,A,w,_),i=e.clickable||e.hoverable,o=S.clickable||S.hoverable,i||o){if(m||(m=(new $3Dmol.Vector3).addVectors($,z).multiplyScalar(.5)),i){var k=new $3Dmol.Cylinder($,m,b),I=new $3Dmol.Sphere($,b);e.intersectionShape.cylinder.push(k),e.intersectionShape.sphere.push(I)}if(o){var R=new $3Dmol.Cylinder(z,m,b),O=new $3Dmol.Sphere(z,b);S.intersectionShape.cylinder.push(R),S.intersectionShape.sphere.push(O)}}}else if(e.bondOrder[a]>1){var F=0,N=0;b!=y&&(F=2,N=2);var P,j,B,U,V,q=z.clone(),G=null;q.sub($),G=D(e,S,a),2==e.bondOrder[a]?(P=b/2.5,(G=D(e,S,a)).multiplyScalar(1.5*P),(j=$.clone()).add(G),(B=$.clone()).sub(G),(U=j.clone()).add(q),(V=B.clone()).add(q),A!=T?(m=(new $3Dmol.Vector3).addVectors(j,U).multiplyScalar(.5),v=(new $3Dmol.Vector3).addVectors(B,V).multiplyScalar(.5),C(r,j,m,P,A,F,0),C(r,m,U,P,T,0,N),C(r,B,v,P,A,F,0),C(r,v,V,P,T,0,N)):(C(r,j,U,P,A,F,N),C(r,B,V,P,A,F,N)),i=e.clickable||e.hoverable,o=S.clickable||S.hoverable,(i||o)&&(m||(m=(new $3Dmol.Vector3).addVectors(j,U).multiplyScalar(.5)),v||(v=(new $3Dmol.Vector3).addVectors(B,V).multiplyScalar(.5)),i&&(u=new $3Dmol.Cylinder(j,m,P),c=new $3Dmol.Cylinder(B,v,P),e.intersectionShape.cylinder.push(u),e.intersectionShape.cylinder.push(c)),o&&(h=new $3Dmol.Cylinder(U,m,P),p=new $3Dmol.Cylinder(V,v,P),S.intersectionShape.cylinder.push(h),S.intersectionShape.cylinder.push(p)))):3==e.bondOrder[a]&&(P=b/4,G.cross(q),G.normalize(),G.multiplyScalar(3*P),(j=$.clone()).add(G),(B=$.clone()).sub(G),(U=j.clone()).add(q),(V=B.clone()).add(q),A!=T?(m=(new $3Dmol.Vector3).addVectors(j,U).multiplyScalar(.5),v=(new $3Dmol.Vector3).addVectors(B,V).multiplyScalar(.5),g=(new $3Dmol.Vector3).addVectors($,z).multiplyScalar(.5),C(r,j,m,P,A,F,0),C(r,m,U,P,T,0,N),C(r,$,g,P,A,w,0),C(r,g,z,P,T,0,_),C(r,B,v,P,A,F,0),C(r,v,V,P,T,0,N)):(C(r,j,U,P,A,F,N),C(r,$,z,P,A,w,_),C(r,B,V,P,A,F,N)),i=e.clickable||e.hoverable,o=S.clickable||S.hoverable,(i||o)&&(m||(m=(new $3Dmol.Vector3).addVectors(j,U).multiplyScalar(.5)),v||(v=(new $3Dmol.Vector3).addVectors(B,V).multiplyScalar(.5)),g||(g=(new $3Dmol.Vector3).addVectors($,z).multiplyScalar(.5)),i&&(u=new $3Dmol.Cylinder(j.clone(),m.clone(),P),c=new $3Dmol.Cylinder(B.clone(),v.clone(),P),f=new $3Dmol.Cylinder($.clone(),g.clone(),P),e.intersectionShape.cylinder.push(u),e.intersectionShape.cylinder.push(c),e.intersectionShape.cylinder.push(f)),o&&(h=new $3Dmol.Cylinder(U.clone(),m.clone(),P),p=new $3Dmol.Cylinder(V.clone(),v.clone(),P),d=new $3Dmol.Cylinder(z.clone(),g.clone(),P),S.intersectionShape.cylinder.push(h),S.intersectionShape.cylinder.push(p),S.intersectionShape.cylinder.push(d))))}}}var H=!1,W=0,Y=!1;for(a=0;a<e.bonds.length;a++)s=x,e.bondStyles&&e.bondStyles[a]&&((l=e.bondStyles[a]).singleBond&&(s=!0),l.radius&&l.radius!=y&&(Y=!0)),(s||1==e.bondOrder[a])&&W++;Y?W>0&&(H=!0):0==W&&e.bonds.length>0&&(H=!0),H&&(b=y,r.imposter?M(r.sphereGeometry,e,b,A):$3Dmol.GLDraw.drawSphere(r,e,b,A))}}},I=function(e,t){t=t||{};var r,n,i,o,a=new $3Dmol.Object3D,s=[],l={},u={},c=S,f=null,h=null;t.supportsImposters?(c=z,(f=new $3Dmol.Geometry(!0)).imposter=!0,(h=new $3Dmol.Geometry(!0,!0)).imposter=!0,h.sphereGeometry=new $3Dmol.Geometry(!0),h.sphereGeometry.imposter=!0,h.drawnCaps={}):t.supportsAIA?(c=T,(f=new $3Dmol.Geometry(!1,!0,!0)).instanced=!0,h=new $3Dmol.Geometry(!0)):(f=new $3Dmol.Geometry(!0),h=new $3Dmol.Geometry(!0));var p,m={},g=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];for(r=0,i=e.length;r<i;r++){var y=e[r];if(y&&y.style){for(n in(y.clickable||y.hoverable)&&void 0===y.intersectionShape&&(y.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}),o={line:void 0,cross:void 0,stick:void 0,sphere:void 0})y.style[n]?y.style[n].opacity?o[n]=parseFloat(y.style[n].opacity):o[n]=1:o[n]=void 0,m[n]?null!=o[n]&&m[n]!=o[n]&&(console.log("Warning: "+n+" opacity is ambiguous"),m[n]=1):m[n]=o[n];c(y,f),E(y),_(y,u),C(y,e,l),k(y,e,h),void 0===y.style.cartoon||y.style.cartoon.hidden||("spectrum"!==y.style.cartoon.color||"number"!=typeof y.resi||y.hetflag||(y.resi<g[0]&&(g[0]=y.resi),y.resi>g[1]&&(g[1]=y.resi)),s.push(y))}}if(s.length>0&&$3Dmol.drawCartoon(a,s,g,x),f&&f.vertices>0){f.initTypedArrays();var b=null,w=null;f.imposter?b=new $3Dmol.SphereImposterMaterial({ambient:0,vertexColors:!0,reflectivity:0}):f.instanced?(w=new $3Dmol.Geometry(!0),$3Dmol.GLDraw.drawSphere(w,{x:0,y:0,z:0},1,new $3Dmol.Color(.5,.5,.5)),w.initTypedArrays(),b=new $3Dmol.InstancedMaterial({sphereMaterial:new $3Dmol.MeshLambertMaterial({ambient:0,vertexColors:!0,reflectivity:0}),sphere:w})):b=new $3Dmol.MeshLambertMaterial({ambient:0,vertexColors:!0,reflectivity:0}),m.sphere<1&&m.sphere>=0&&(b.transparent=!0,b.opacity=m.sphere),w=new $3Dmol.Mesh(f,b),a.add(w)}if(h.vertices>0){var D=null,A=null,M=h.sphereGeometry;M&&void 0!==M.vertices&&0!=M.vertices||(M=null),h.initTypedArrays(),M&&M.initTypedArrays();var $={ambient:0,vertexColors:!0,reflectivity:0};h.imposter?(D=new $3Dmol.StickImposterMaterial($),A=new $3Dmol.SphereImposterMaterial($)):(D=new $3Dmol.MeshLambertMaterial($),A=new $3Dmol.MeshLambertMaterial($),D.wireframe&&(h.setUpWireframe(),M&&M.setUpWireframe())),m.stick<1&&m.stick>=0&&(D.transparent=!0,D.opacity=m.stick,A.transparent=!0,A.opacity=m.stick);var L=new $3Dmol.Mesh(h,D);if(a.add(L),M){var I=new $3Dmol.Mesh(M,A);a.add(I)}}for(r in l)if(l.hasOwnProperty(r)){p=r;var R=new $3Dmol.LineBasicMaterial({linewidth:p,vertexColors:!0});m.line<1&&m.line>=0&&(R.transparent=!0,R.opacity=m.line),l[r].initTypedArrays();var O=new $3Dmol.Line(l[r],R,$3Dmol.LinePieces);a.add(O)}for(r in u)if(u.hasOwnProperty(r)){p=r;var F=new $3Dmol.LineBasicMaterial({linewidth:p,vertexColors:!0});m.cross<1&&m.cross>=0&&(F.transparent=!0,F.opacity=m.cross),u[r].initTypedArrays();var N=new $3Dmol.Line(u[r],F,$3Dmol.LinePieces);a.add(N)}if(v&&d.symmetries&&d.symmetries.length>0){var P,j=new $3Dmol.Object3D;for(P=0;P<d.symmetries.length;P++){var B=new $3Dmol.Object3D;(B=a.clone()).matrix.copy(d.symmetries[P]),B.matrixAutoUpdate=!1,j.add(B)}return j}return a};this.getInternalState=function(){return{atoms:i,frames:a}},this.setInternalState=function(e){i=e.atoms,a=e.frames,f=null},this.getCrystData=function(){return d.cryst?d.cryst:null},this.getSymmetries=function(){return void 0===d.symmetries&&(d.symmetries=[m]),d.symmetries},this.setSymmetries=function(e){d.symmetries=void 0===e?[m]:e},this.getID=function(){return u},this.getNumFrames=function(){return null!=a.numFrames?a.numFrames:a.length};var R=function(e,t,r,n){var i=t-e;return i<-r?t+n:i>r?t-n:t};this.setFrame=function(e){var t=this.getNumFrames();return new Promise((function(r,n){if(0==t&&r(),(e<0||e>=t)&&(e=t-1),null!=a.url){var o=a.url;$3Dmol.getbin(o+"/traj/frame/"+e+"/"+a.path,null,"POST").then((function(e){for(var t=new Float32Array(e,44),n=0,o=0;o<i.length;o++)i[o].x=t[n++],i[o].y=t[n++],i[o].z=t[n++];s&&l&&function(){if(s&&l)for(var e=s[0],t=s[1],r=s[2],n=.9*e,o=.9*t,a=.9*r,u=0;u<l.length;u++)for(var c=l[u],f=1;f<c.length;f++){var h=i[c[f][0]],p=i[c[f][1]];h.x=R(p.x,h.x,n,e),h.y=R(p.y,h.y,o,t),h.z=R(p.z,h.z,a,r)}}(),r()})).catch(n)}else i=a[e],r();f=null}))},this.addFrame=function(e){a.push(e)},this.vibrate=function(e,t,r,n,o){t=t||1;var s=0,l=e=e||10;r&&(s=-e,l=e),s<l&&(a=[]);for(var u=s;u<l;u++){var c=[],f=a.length;if(0!=u||o){for(var h=0;h<i.length;h++){var p=$3Dmol.getAtomProperty(i[h],"dx"),d=$3Dmol.getAtomProperty(i[h],"dy"),m=$3Dmol.getAtomProperty(i[h],"dz"),v=new $3Dmol.Vector3(p,d,m),g=new $3Dmol.Vector3(i[h].x,i[h].y,i[h].z),y=u*t/e;v.multiplyScalar(y),g.add(v);var b={};for(var x in i[h])b[x]=i[h][x];if(b.x=g.x,b.y=g.y,b.z=g.z,c.push(b),n&&o){var w=$.extend({},o),_=new $3Dmol.Vector3(p,d,m);if(_.multiplyScalar(t),_.add(g),w.start=g,w.end=_,w.frame=f,!w.color){var D=b.style.sphere;D||(D=b.style.stick),D||(D=b.style.line),w.color=$3Dmol.getColorFromStyle(b,D)}n.addArrow(w)}}a.push(c)}else a.push(i)}},this.setAtomDefaults=function(t){for(var r=0;r<t.length;r++){var n=t[r];n&&(n.style=n.style||$.extend(!0,{},e),n.color=n.color||y[n.elem]||g,n.model=u,(n.clickable||n.hoverable)&&(n.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}))}},this.addMolData=function(e,t,r){r=r||{};var n=$3Dmol.GLModel.parseMolData(e,t,r);v=!r.duplicateAssemblyAtoms;var o=n.modelData;if(o&&(d=Array.isArray(o)?o[0]:o),s=n.box?n.box:null,0==a.length){for(var l=0;l<n.length;l++)0!=n[l].length&&a.push(n[l]);a[0]&&(i=a[0])}else if(r.frames)for(var c=0;c<n.length;c++)a.push(n[c]);else for(var f=0;f<n.length;f++)this.addAtoms(n[f]);for(var h=0;h<a.length;h++)this.setAtomDefaults(a[h],u);r.vibrate&&r.vibrate.frames&&r.vibrate.amplitude&&this.vibrate(r.vibrate.frames,r.vibrate.amplitude),r.style&&this.setStyle({},r.style)},this.setDontDuplicateAtoms=function(e){v=e},this.setModelData=function(e){d=e};var O=function(e,t){if(e==t)return!0;if("string"==typeof t&&"number"==typeof e){var r=t.match(/(-?\d+)\s*-\s*(-?\d+)/);if(r){var n=parseInt(r[1]),i=parseInt(r[2]);if(r&&e>=n&&e<=i)return!0}}return!1};this.atomIsSelected=function(e,t){if(void 0===t)return!0;var r=!!t.invert,n=!0;for(var i in t)if("and"==i||"or"==i||"not"==i){if("not"==i){if(this.atomIsSelected(e,t[i])){n=!1;break}}else if("and"==i){for(var o=t[i],a=0;a<o.length;a++)if(!this.atomIsSelected(e,o[a])){n=!1;break}}else if("or"==i){for(var s=t[i],l=!0,u=0;u<s.length;u++){if(this.atomIsSelected(e,s[u])){l=!0;break}l=!1}n=l}}else if("predicate"===i){if(!t.predicate(e)){n=!1;break}}else if("properties"==i&&e[i])for(var c in t.properties){if(void 0===e.properties[c]){n=!1;break}if(e.properties[c]!=t.properties[c]){n=!1;break}}else if(t.hasOwnProperty(i)&&"props"!=i&&"invert"!=i&&"model"!=i&&"byres"!=i&&"expand"!=i&&"within"!=i&&"and"!=i&&"or"!=i&&"not"!=i){if(void 0===e[i]){n=!1;break}var f=!1;if("bonds"===i){if(t[i]!=e.bonds.length){n=!1;break}}else if($.isArray(t[i])){for(var h=t[i],p=e[i],d=0;d<h.length;d++)if(O(p,h[d])){f=!0;break}if(!f){n=!1;break}}else{var m=t[i];if(!O(e[i],m)){n=!1;break}}}return r?!n:n};var F=function(e,t){var r=t.x-e.x,n=t.y-e.y,i=t.z-e.z;return Math.pow(r,2)+Math.pow(n,2)+Math.pow(i,2)};this.selectedAtoms=function(e,t){var r=[];e=e||{},t||(t=i);for(var n=t.length,o=0;o<n;o++){var a=t[o];a&&this.atomIsSelected(a,e)&&r.push(a)}if(e.hasOwnProperty("expand"))for(var s=function(e,t){if(t<=0)return e;for(var r=$3Dmol.getExtent(e),n=[[],[],[]],o=0;o<3;o++)n[0][o]=r[0][o]-t,n[1][o]=r[1][o]+t,n[2][o]=r[2][o];for(var a=[],s=0;s<i.length;s++){var l=i[s].x,u=i[s].y,c=i[s].z;l>=n[0][0]&&l<=n[1][0]&&u>=n[0][1]&&u<=n[1][1]&&c>=n[0][2]&&c<=n[1][2]&&(l>=r[0][0]&&l<=r[1][0]&&u>=r[0][1]&&u<=r[1][1]&&c>=r[0][2]&&c<=r[1][2]||a.push(i[s]))}return a}(r,parseFloat(e.expand)),l=r.length,u=0;u<s.length;u++)for(var c=0;c<l;c++){var f=F(s[u],r[c]);f<Math.pow(e.expand,2)&&f>0&&r.push(s[u])}if(e.hasOwnProperty("within")&&e.within.hasOwnProperty("sel")&&e.within.hasOwnProperty("distance")){for(var h=this.selectedAtoms(e.within.sel,i),p={},d=0;d<h.length;d++)for(var m=0;m<r.length;m++){var v=F(h[d],r[m]);v<Math.pow(parseFloat(e.within.distance),2)&&v>0&&(p[m]=1)}var g=[];if(e.within.invert)for(var y=0;y<r.length;y++)p[y]||g.push(r[y]);else for(var b in p)g.push(r[b]);r=g}if(e.hasOwnProperty("byres"))for(var x={},w=[],_=[],D=0;D<r.length;D++){var A=r[D],C=A.chain,S=A.resi;if(void 0===x[C]&&(x[C]={}),A.hasOwnProperty("resi")&&void 0===x[C][S])for(x[C][S]=!0,_.push(A);_.length>0;)if(C=(A=_.pop()).chain,S=A.resi,void 0===w[A.index]){w[A.index]=!0;for(var E=0;E<A.bonds.length;E++){var T=i[A.bonds[E]];void 0===w[T.index]&&T.hasOwnProperty("resi")&&T.chain==C&&T.resi==S&&(_.push(T),r.push(T))}}}return r},this.addAtoms=function(t){f=null;var r,n=i.length,o=[];for(r=0;r<t.length;r++)void 0===t[r].index&&(t[r].index=r),void 0===t[r].serial&&(t[r].serial=r),o[t[r].index]=n+r;for(r=0;r<t.length;r++){var a=t[r],s=o[a.index],l=$.extend(!1,{},a);l.index=s,l.bonds=[],l.bondOrder=[],l.model=u,l.style=l.style||$.extend(!0,{},e),void 0===l.color&&(l.color=y[l.elem]||g);for(var c=a.bonds?a.bonds.length:0,h=0;h<c;h++){var p=o[a.bonds[h]];void 0!==p&&(l.bonds.push(p),l.bondOrder.push(a.bondOrder?a.bondOrder[h]:1))}i.push(l)}},this.removeAtoms=function(e){f=null;var t,r=[];for(t=0;t<e.length;t++)r[e[t].index]=!0;var n=[];for(t=0;t<i.length;t++){var o=i[t];r[o.index]||n.push(o)}i=[],this.addAtoms(n)},this.setStyle=function(e,t,r){var n;for(n in void 0===t&&void 0===r&&(t=e,e={}),e)o.validAtomSelectionSpecs.hasOwnProperty(n)||console.log("Unknown selector "+n);for(n in t)o.validAtomStyleSpecs.hasOwnProperty(n)||console.log("Unknown style "+n);var s=!1,l=this,u=function(n){for(var i=l.selectedAtoms(e,n),o=0;o<n.length;o++)n[o]&&(n[o].capDrawn=!1);for(var a=0;a<i.length;a++)for(var u in s=!0,(i[a].clickable||i[a].hoverable)&&(i[a].intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]}),r||(i[a].style={}),t)t.hasOwnProperty(u)&&(i[a].style[u]=i[a].style[u]||{},Object.assign(i[a].style[u],t[u]))};u(i);for(var c=0;c<a.length;c++)a[c]!==i&&u(a[c]);s&&(f=null)},this.setClickable=function(e,t,r){var n;for(n in e)o.validAtomSelectionSpecs.hasOwnProperty(n)||console.log("Unknown selector "+n);if(t=!!t,r&&"function"!=typeof r)console.log("Callback is not a function");else{var a,s=this.selectedAtoms(e,i),l=s.length;for(a=0;a<l;a++)s[a].intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]},s[a].clickable=t,r&&(s[a].callback=r);l>0&&(f=null)}},this.setHoverable=function(e,t,r,n){var a;for(a in e)o.validAtomSelectionSpecs.hasOwnProperty(a)||console.log("Unknown selector "+a);if(t=!!t,r&&"function"!=typeof r)console.log("Hover_callback is not a function");else if(n&&"function"!=typeof n)console.log("Unhover_callback is not a function");else{var s,l=this.selectedAtoms(e,i),u=l.length;for(s=0;s<u;s++)l[s].intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]},l[s].hoverable=t,r&&(l[s].hover_callback=r),n&&(l[s].unhover_callback=n);u>0&&(f=null)}},this.setColorByElement=function(e,t){if(null===f||!function(e,t){return e&&t?JSON.stringify(e)==JSON.stringify(t):e==t}(t,p)){p=t;var r=this.selectedAtoms(e,r);r.length>0&&(f=null);for(var n=0;n<r.length;n++){var i=r[n];void 0!==t[i.elem]&&(i.color=t[i.elem])}}},this.setColorByProperty=function(e,t,r,n){var i,o,a=this.selectedAtoms(e,a);for(p=null,a.length>0&&(f=null),void 0!==$3Dmol.Gradient.builtinGradients[r]&&(r=new $3Dmol.Gradient.builtinGradients[r]),n||(n=r.range()),n||(n=$3Dmol.getPropertyRange(a,t)),i=0;i<a.length;i++)o=a[i],null!=$3Dmol.getAtomProperty(o,t)&&(o.color=r.valueToHex(parseFloat(o.properties[t]),n))},this.setColorByFunction=function(e,t){var r=this.selectedAtoms(e,r);if("function"==typeof t){p=null,r.length>0&&(f=null);for(var n=0;n<r.length;n++){var i=r[n];i.color=t(i)}}},this.toCDObject=function(e){var t={a:[],b:[]};e&&(t.s=[]);for(var r=0;r<i.length;r++){var n={},o=i[r];if(n.x=o.x,n.y=o.y,n.z=o.z,"C"!=o.elem&&(n.l=o.elem),e){for(var a=0;a<t.s.length&&JSON.stringify(o.style)!==JSON.stringify(t.s[a]);)a++;a===t.s.length&&t.s.push(o.style),0!==a&&(n.s=a)}t.a.push(n);for(var s=0;s<o.bonds.length;s++){var l=r,u=o.bonds[s];if(!(l>=u)){var c={b:l,e:u},f=o.bondOrder[s];1!=f&&(c.o=f),t.b.push(c)}}}return t},this.globj=function(e,t){(null===f||t.regen)&&(f=I(i,t),h&&(e.remove(h),h=null),h=f.clone(),c&&(h.setVisible(!1),f.setVisible(!1)),e.add(h))},this.exportVRML=function(){return I(i,{supportsImposters:!1,supportsAIA:!1}).vrml()},this.removegl=function(e){h&&(void 0!==h.geometry&&h.geometry.dispose(),void 0!==h.material&&h.material.dispose(),e.remove(h),h=null),f=null},this.hide=function(){c=!0,h&&h.setVisible(!1),f&&f.setVisible(!1)},this.show=function(){c=!1,h&&h.setVisible(!0),f&&f.setVisible(!0)},this.addPropertyLabels=function(e,t,r,n){for(var i=this.selectedAtoms(t,i),o=$.extend(!0,{},n),a=0;a<i.length;a++){var s=i[a],l=null;void 0!==s[e]?l=String(s[e]):(s.properties[e],l=String(s.properties[e])),null!=l&&(o.position=s,r.addLabel(l,o))}},this.addResLabels=function(e,t,r,n){var o=[],s=function(n,i){for(var a=n.selectedAtoms(e,a),s={},l=0;l<a.length;l++){var u=a[l],c=u.chain,f=u.resn+""+u.resi;s[c]||(s[c]={}),s[c][f]||(s[c][f]=[]),s[c][f].push(u)}var h=$.extend(!0,{},r);for(var p in s)if(s.hasOwnProperty(p)){var d=s[p];for(var m in d)if(d.hasOwnProperty(m)){for(var v=d[m],g=new $3Dmol.Vector3(0,0,0),y=0;y<v.length;y++){var b=v[y];g.x+=b.x,g.y+=b.y,g.z+=b.z}g.divideScalar(v.length),h.position=g,h.frame=i;var x=t.addLabel(m,h,void 0,!0);o.push(x)}}};if(n){for(var l=this.getNumFrames(),u=i,c=0;c<l;c++)a[c]&&(i=a[c],s(this,c));i=u}else s(this);return o},this.setCoordinatesFromURL=function(e,t){a=[];var r=this;return s&&function(){l=[];var e=new Int8Array(i.length);e.fill(0);for(var t=function t(r,n,o){o.push([r,n]);var a=i[r];e[r]=1;for(var s=0;s<a.bonds.length;s++){var l=a.bonds[s];i[l]&&!e[l]&&t(l,r,o)}},r=0;r<i.length;r++)if(i[r]&&!e[r]){var n=[];t(r,-1,n),l.push(n)}}(),new Promise((function(n,o){e.startsWith("http://")||(e="http://"+e),$.get(e+"/traj/numframes/"+t,(function(s){isNaN(parseInt(s))||(a.push(i),a.numFrames=s,a.url=e,a.path=t,r.setFrame(0).then((function(){n()})).catch(o))}))}))},this.setCoordinates=function(e,t){if(!e)return[];if(/\.gz$/.test(t=t||"")){t=t.replace(/\.gz$/,"");try{e=pako.inflate(e,{to:"string"})}catch(e){console.log(e)}}if({mdcrd:"",inpcrd:"",pdb:"",netcdf:""}.hasOwnProperty(t)){a=[];for(var r=i.length,n=o.parseCrd(e,t),s=0;s<n.length;){for(var l=[],u=0;u<r;u++){var c={};for(var f in i[u])c[f]=i[u][f];l[u]=c,l[u].x=n[s++],l[u].y=n[s++],l[u].z=n[s++]}a.push(l)}return i=a[0],a}return[]},this.addAtomSpecs=function(e){for(var t=0;t<e.length;t++)o.validAtomSelectionSpecs.hasOwnProperty(e[t])&&o.validAtomSelectionSpecs.push(e[t])}}return o.parseCrd=function(e,t){var r=[],n=0;if("pdb"==t)for(var i=e.indexOf("\nATOM");-1!=i;){for(;"\nATOM"==e.slice(i,i+5)||"\nHETATM"==e.slice(i,i+7);)r[n++]=parseFloat(e.slice(i+31,i+39)),r[n++]=parseFloat(e.slice(i+39,i+47)),r[n++]=parseFloat(e.slice(i+47,i+55)),i=e.indexOf("\n",i+54),"\nTER"==e.slice(i,i+4)&&(i=e.indexOf("\n",i+5));i=e.indexOf("\nATOM",i)}else if("netcdf"==t){var o=new netcdfjs(e);r=[].concat.apply([],o.getDataVariable("coordinates"))}else{var a=e.indexOf("\n");"inpcrd"==t&&(a=e.indexOf("\n",a+1)),r=(e=e.slice(a+1)).match(/\S+/g).map(parseFloat)}return r},o.parseMolData=function(e,t,r){if(!e)return[];if(/\.gz$/.test(t=t||"")){t=t.replace(/\.gz$/,"");try{e=pako.inflate(e,{to:"string"})}catch(e){console.log(e)}}return void 0===$3Dmol.Parsers[t]&&(t=t.split(".").pop(),void 0===$3Dmol.Parsers[t]&&(console.log("Unknown format: "+t),t=e instanceof Uint8Array?"mmtf":e.match(/^@<TRIPOS>MOLECULE/gm)?"mol2":e.match(/^HETATM/gm)||e.match(/^ATOM/gm)?"pdb":e.match(/ITEM: TIMESTEP/gm)?"lammpstrj":e.match(/^.*\n.*\n.\s*(\d+)\s+(\d+)/gm)?"sdf":e.match(/^%VERSION\s+\VERSION_STAMP/gm)?"prmtop":"xyz",console.log("Best guess: "+t))),(0,$3Dmol.Parsers[t])(e,r)},o}(),$3Dmol.GLShape=function(){var e=function(e){var t=e.updateGeoGroup(0);t.vertices>0&&t.truncateArrayBuffers(!0,!0)},t=function(e,t,r,n){var i,o;if(e.center.set(0,0,0),t.length>0){for(i=0,o=t.length;i<o;++i){var a=t[i].centroid;e.center.add(a)}e.center.divideScalar(t.length)}var s=e.radius*e.radius;for(r.length/3<n&&(n=r.length/3),i=0,o=n;i<o;i++){var l=r[3*i],u=r[3*i+1],c=r[3*i+2],f=e.center.distanceToSquared({x:l,y:u,z:c});s=Math.max(s,f)}e.radius=Math.sqrt(s)},r=function(e,r,n,i,o){var a,s,l,u,c,f,h,p,d,m=r.addGeoGroup(),v=n.vertexArr,g=n.normalArr,y=n.faceArr;m.vertices=v.length,m.faceidx=y.length;var b=m.vertexArray,x=m.colorArray;for(i.constructor!==Array&&(p=i.r,d=i.g,u=i.b),f=0,h=m.vertices;f<h;++f)a=3*f,s=v[f],b[a]=s.x,b[a+1]=s.y,b[a+2]=s.z,i.constructor===Array&&(p=(c=i[f]).r,d=c.g,u=c.b),x[a]=p,x[a+1]=d,x[a+2]=u;if(o)for(f=0,h=m.faceidx/3;f<h;++f){l=y[a=3*f],u=y[a+1],c=y[a+2];var w=new $3Dmol.Vector3,_=new $3Dmol.Vector3,D=new $3Dmol.Vector3;e.intersectionShape.triangle.push(new $3Dmol.Triangle(w.copy(v[l]),_.copy(v[u]),D.copy(v[c])))}if(o){for(var A=new $3Dmol.Vector3(0,0,0),C=0,S=0;S<r.geometryGroups.length;S++)A.add(r.geometryGroups[S].getCentroid()),C++;A.divideScalar(C),t(e.boundingSphere,{centroid:A},b,m.vertices)}if(m.faceArray=new Uint16Array(y),m.truncateArrayBuffers(!0,!0),g.length<m.vertices)m.setNormals();else{var E,T=m.normalArray=new Float32Array(3*m.vertices);for(f=0,h=m.vertices;f<h;++f)a=3*f,E=g[f],T[a]=E.x,T[a+1]=E.y,T[a+2]=E.z}m.setLineIndices(),m.lineidx=m.lineArray.length},n=function(e,t,n){var i=n,o=i.vertexArr,a=i.faceArr;0!==o.length&&0!==a.length||console.warn("Error adding custom shape component: No vertices and/or face indices supplied!");var s=n.color;void 0===s&&(s=e.color),s=$3Dmol.CC.color(s);for(var l=$3Dmol.splitMesh(i),u=0,c=l.length;u<c;u++)r(e,t,l[u],l[u].colorArr?l[u].colorArr:s,n.clickable)},i=function(e,t){void 0!==t.color?(e.color=t.color||new $3Dmol.Color,t.color instanceof $3Dmol.Color||(e.color=$3Dmol.CC.color(t.color))):e.color=$3Dmol.CC.color(0),e.wireframe=!!t.wireframe,e.opacity=t.alpha?$3Dmol.Math.clamp(t.alpha,0,1):1,void 0!==t.opacity&&(e.opacity=$3Dmol.Math.clamp(t.opacity,0,1)),e.side=void 0!==t.side?t.side:$3Dmol.DoubleSide,e.linewidth=void 0===t.linewidth?1:t.linewidth,e.clickable=!!t.clickable,e.callback="function"==typeof t.callback?t.callback:null,e.hoverable=!!t.hoverable,e.hover_callback="function"==typeof t.hover_callback?t.hover_callback:null,e.unhover_callback="function"==typeof t.unhover_callback?t.unhover_callback:null,e.hidden=t.hidden,e.frame=t.frame};function o(r){r=r||{},$3Dmol.ShapeIDCount++,this.boundingSphere=new $3Dmol.Sphere,this.intersectionShape={sphere:[],cylinder:[],line:[],triangle:[]},i(this,r);var o=[],a=null,s=null,l=new $3Dmol.Geometry(!0),u=new $3Dmol.Geometry(!0);this.updateStyle=function(e){for(var t in e)r[t]=e[t];i(this,r)},this.addCustom=function(e){e.vertexArr=e.vertexArr||[],e.faceArr=e.faceArr||[],e.normalArr=e.normalArr||[],n(this,l,e)},this.addSphere=function(e){e.center=e.center||{x:0,y:0,z:0},e.radius=e.radius?$3Dmol.Math.clamp(e.radius,0,1/0):1.5,e.color=$3Dmol.CC.color(e.color),this.intersectionShape.sphere.push(new $3Dmol.Sphere(e.center,e.radius)),$3Dmol.GLDraw.drawSphere(l,e.center,e.radius,e.color),o.push({centroid:new $3Dmol.Vector3(e.center.x,e.center.y,e.center.z)});var r=l.updateGeoGroup(0);t(this.boundingSphere,o,r.vertexArray,r.vertices)},this.addBox=function(e){var r=e.dimensions||{w:1,h:1,d:1},i=r.w;"number"==typeof r.w&&(i={x:r.w,y:0,z:0});var a=r.h;"number"==typeof r.h&&(a={x:0,y:r.h,z:0});var s=r.d;"number"==typeof r.d&&(s={x:0,y:0,z:r.d});var u=e.corner;null==u&&(u=void 0!==e.center?{x:e.center.x-.5*(i.x+a.x+s.x),y:e.center.y-.5*(i.y+a.y+s.y),z:e.center.z-.5*(i.z+a.z+s.z)}:{x:0,y:0,z:0});var c=[{x:u.x,y:u.y,z:u.z},{x:u.x+i.x,y:u.y+i.y,z:u.z+i.z},{x:u.x+a.x,y:u.y+a.y,z:u.z+a.z},{x:u.x+i.x+a.x,y:u.y+i.y+a.y,z:u.z+i.z+a.z},{x:u.x+s.x,y:u.y+s.y,z:u.z+s.z},{x:u.x+i.x+s.x,y:u.y+i.y+s.y,z:u.z+i.z+s.z},{x:u.x+a.x+s.x,y:u.y+a.y+s.y,z:u.z+a.z+s.z},{x:u.x+i.x+a.x+s.x,y:u.y+i.y+a.y+s.y,z:u.z+i.z+a.z+s.z}],f=[],h=[];f.splice(f.length,0,c[0],c[1],c[2],c[3]),h.splice(h.length,0,0,2,1,1,2,3);var p=4;f.splice(f.length,0,c[2],c[3],c[6],c[7]),h.splice(h.length,0,p+0,p+2,p+1,p+1,p+2,p+3),p+=4,f.splice(f.length,0,c[4],c[5],c[0],c[1]),h.splice(h.length,0,p+0,p+2,p+1,p+1,p+2,p+3),p+=4,f.splice(f.length,0,c[6],c[7],c[4],c[5]),h.splice(h.length,0,p+0,p+2,p+1,p+1,p+2,p+3),p+=4,f.splice(f.length,0,c[3],c[1],c[7],c[5]),h.splice(h.length,0,p+0,p+2,p+1,p+1,p+2,p+3),p+=4,f.splice(f.length,0,c[2],c[6],c[0],c[4]),h.splice(h.length,0,p+0,p+2,p+1,p+1,p+2,p+3),p+=4;var d=$.extend({},e);d.vertexArr=f,d.faceArr=h,d.normalArr=[],n(this,l,d);var m=new $3Dmol.Vector3;o.push({centroid:m.addVectors(c[0],c[7]).multiplyScalar(.5)});var v=l.updateGeoGroup(0);t(this.boundingSphere,o,v.vertexArray,v.vertices)},this.addCylinder=function(e){e.start=e.start||{},e.end=e.end||{};var r=new $3Dmol.Vector3(e.start.x||0,e.start.y||0,e.start.z||0),n=new $3Dmol.Vector3(e.end.x,e.end.y||0,e.end.z||0);void 0===n.x&&(n.x=3);var i=e.radius||.1,a=$3Dmol.CC.color(e.color);this.intersectionShape.cylinder.push(new $3Dmol.Cylinder(r,n,i)),$3Dmol.GLDraw.drawCylinder(l,r,n,i,a,e.fromCap,e.toCap);var s=new $3Dmol.Vector3;o.push({centroid:s.addVectors(r,n).multiplyScalar(.5)});var u=l.updateGeoGroup(0);t(this.boundingSphere,o,u.vertexArray,u.vertices)},this.addDashedCylinder=function(e){e.start=e.start||{},e.end=e.end||{},e.dashLength=e.dashLength||.25,e.gapLength=e.gapLength||.25;var r=new $3Dmol.Vector3(e.start.x||0,e.start.y||0,e.start.z||0),n=new $3Dmol.Vector3(e.end.x,e.end.y||0,e.end.z||0);void 0===n.x&&(n.x=3);for(var i=e.radius||.1,a=$3Dmol.CC.color(e.color),s=Math.sqrt(Math.pow(r.x-n.x,2)+Math.pow(r.y-n.y,2)+Math.pow(r.z-n.z,2)),u=s/(e.gapLength+e.dashLength),c=new $3Dmol.Vector3(e.start.x||0,e.start.y||0,e.start.z||0),f=new $3Dmol.Vector3(e.end.x,e.end.y||0,e.end.z||0),h=new $3Dmol.Vector3((n.x-r.x)/(s/e.gapLength),(n.y-r.y)/(s/e.gapLength),(n.z-r.z)/(s/e.gapLength)),p=new $3Dmol.Vector3((n.x-r.x)/(s/e.dashLength),(n.y-r.y)/(s/e.dashLength),(n.z-r.z)/(s/e.dashLength)),d=0;d<u;d++)f=new $3Dmol.Vector3(c.x+p.x,c.y+p.y,c.z+p.z),this.intersectionShape.cylinder.push(new $3Dmol.Cylinder(c,f,i)),$3Dmol.GLDraw.drawCylinder(l,c,f,i,a,e.fromCap,e.toCap),c=new $3Dmol.Vector3(f.x+h.x,f.y+h.y,f.z+h.z);var m=new $3Dmol.Vector3;o.push({centroid:m.addVectors(r,n).multiplyScalar(.5)});var v=l.updateGeoGroup(0);t(this.boundingSphere,o,v.vertexArray,v.vertices)},this.addCurve=function(e){e.points=e.points||[],e.smooth=e.smooth||10,void 0===e.fromCap&&(e.fromCap=2),void 0===e.toCap&&(e.toCap=2);var t=$3Dmol.subdivide_spline(e.points,e.smooth);if(t.length<3)console.log("Too few points in addCurve");else{var r=e.radius||.1,n=$3Dmol.CC.color(e.color),i=0,o=t.length-1,a=t[0].distanceTo(t[1]),s=Math.ceil(2*r/a);if(e.toArrow){var l={start:t[o-=s],end:t[t.length-1],radius:r,color:n,mid:1e-4};this.addArrow(l)}if(e.fromArrow){var u={start:t[i+=s],end:t[0],radius:r,color:n,mid:1e-4};this.addArrow(u)}for(var c=Math.ceil(t.length/2),f={radius:r,color:n,fromCap:2,toCap:2},h=i;h<o;h++)f.start=t[h],f.end=t[h+1],f.fromCap=2,f.toCap=2,h<c?(f.fromCap=2,f.toCap=0):h>c?(f.fromCap=0,f.toCap=2):(f.fromCap=2,f.toCap=2),this.addCylinder(f)}},this.addLine=function(e){e.start=e.start||{},e.end=e.end||{};var r=new $3Dmol.Vector3(e.start.x||0,e.start.y||0,e.start.z||0),n=new $3Dmol.Vector3(e.end.x,e.end.y||0,e.end.z||0);void 0===n.x&&(n.x=3);var i=l.updateGeoGroup(2),a=i.vertices,s=3*a,u=i.vertexArray;u[s]=r.x,u[s+1]=r.y,u[s+2]=r.z,u[s+3]=n.x,u[s+4]=n.y,u[s+5]=n.z,i.vertices+=2;var c=i.lineArray,f=i.lineidx;c[f]=a,c[f+1]=a+1,i.lineidx+=2;var h=new $3Dmol.Vector3;o.push({centroid:h.addVectors(r,n).multiplyScalar(.5)}),i=l.updateGeoGroup(0),t(this.boundingSphere,o,i.vertexArray,i.vertices)},this.addArrow=function(e){if(e.start=e.start||{},e.end=e.end||{},e.start=new $3Dmol.Vector3(e.start.x||0,e.start.y||0,e.start.z||0),e.dir instanceof $3Dmol.Vector3&&"number"==typeof e.length){var r=e.dir.clone().multiplyScalar(e.length).add(e.start);e.end=r}else e.end=new $3Dmol.Vector3(e.end.x,e.end.y||0,e.end.z||0),void 0===e.end.x&&(e.end.x=3);e.radius=e.radius||.1,e.radiusRatio=e.radiusRatio||1.618034,e.mid=0<e.mid&&e.mid<1?e.mid:.618034,function(e,t,r){var n=r.start,i=r.end,o=r.radius,a=r.radiusRatio,s=r.mid;if(n&&i){var l=t.updateGeoGroup(51),u=i.clone();u.sub(n).multiplyScalar(s);var c=n.clone().add(u),f=u.clone().negate();e.intersectionShape.cylinder.push(new $3Dmol.Cylinder(n.clone(),c.clone(),o)),e.intersectionShape.sphere.push(new $3Dmol.Sphere(n.clone(),o));var h=[];h[0]=u.clone(),Math.abs(h[0].x)>1e-4?h[0].y+=1:h[0].x+=1,h[0].cross(u),h[0].normalize(),h[0]=h[0],h[4]=h[0].clone(),h[4].crossVectors(h[0],u),h[4].normalize(),h[8]=h[0].clone().negate(),h[12]=h[4].clone().negate(),h[2]=h[0].clone().add(h[4]).normalize(),h[6]=h[4].clone().add(h[8]).normalize(),h[10]=h[8].clone().add(h[12]).normalize(),h[14]=h[12].clone().add(h[0]).normalize(),h[1]=h[0].clone().add(h[2]).normalize(),h[3]=h[2].clone().add(h[4]).normalize(),h[5]=h[4].clone().add(h[6]).normalize(),h[7]=h[6].clone().add(h[8]).normalize(),h[9]=h[8].clone().add(h[10]).normalize(),h[11]=h[10].clone().add(h[12]).normalize(),h[13]=h[12].clone().add(h[14]).normalize(),h[15]=h[14].clone().add(h[0]).normalize();var p,d,m,v,g,y,b,x,w,_,D,A,C,S,E,T,M,$,z,L,k,I,R=l.vertices,O=l.vertexArray,F=l.faceArray,N=l.normalArray,P=l.lineArray;for(d=0,m=h.length;d<m;++d){p=3*(R+3*d);var j=h[d].clone().multiplyScalar(o).add(n),B=h[d].clone().multiplyScalar(o).add(c),U=h[d].clone().multiplyScalar(o*a).add(c);if(O[p]=j.x,O[p+1]=j.y,O[p+2]=j.z,O[p+3]=B.x,O[p+4]=B.y,O[p+5]=B.z,O[p+6]=U.x,O[p+7]=U.y,O[p+8]=U.z,d>0){var V=O[p-3],q=O[p-2],G=O[p-1],H=new $3Dmol.Vector3(V,q,G),W=i.clone(),Y=c.clone(),X=new $3Dmol.Vector3(U.x,U.y,U.z);e.intersectionShape.triangle.push(new $3Dmol.Triangle(X,W,H)),e.intersectionShape.triangle.push(new $3Dmol.Triangle(H.clone(),Y,X.clone()))}}l.vertices+=48,O[p=3*l.vertices]=n.x,O[p+1]=n.y,O[p+2]=n.z,O[p+3]=c.x,O[p+4]=c.y,O[p+5]=c.z,O[p+6]=i.x,O[p+7]=i.y,O[p+8]=i.z,l.vertices+=3;var K=l.vertices-3,Z=l.vertices-2,Q=l.vertices-1,J=3*K,ee=3*Z,te=3*Q;for(d=0,m=h.length-1;d<m;++d){var re=R+3*d;p=3*re,g=l.faceidx,y=l.lineidx,C=3*(b=re),S=3*(x=re+1),E=3*(w=re+2),T=3*(_=re+4),M=3*(D=re+5),$=3*(A=re+3),h[d],h[d],h[d+1],h[d+1],z=L=h[d],k=I=h[d+1],N[C]=z.x,N[S]=L.x,N[$]=I.x,N[C+1]=z.y,N[S+1]=L.y,N[$+1]=I.y,N[C+2]=z.z,N[S+2]=L.z,N[$+2]=I.z,N[S]=L.x,N[T]=k.x,N[$]=I.x,N[S+1]=L.y,N[T+1]=k.y,N[$+1]=I.y,N[S+2]=L.z,N[T+2]=k.z,N[$+2]=I.z,N[E]=L.x,N[M]=k.x,N[E+1]=L.y,N[M+1]=k.y,N[E+2]=L.z,N[M+2]=k.z,F[g]=b,F[g+1]=x,F[g+2]=A,F[g+3]=x,F[g+4]=_,F[g+5]=A,F[g+6]=b,F[g+7]=A,F[g+8]=K,F[g+9]=w,F[g+10]=Z,F[g+11]=D,F[g+12]=w,F[g+13]=Q,F[g+14]=D,P[y]=b,P[y+1]=x,P[y+2]=b,P[y+3]=A,P[y+4]=_,P[y+5]=A,P[y+6]=b,P[y+7]=A,P[y+8]=w,P[y+9]=x,P[y+10]=w,P[y+11]=D,P[y+12]=_,P[y+13]=D,P[y+14]=w,P[y+15]=Q,P[y+16]=w,P[y+17]=D,P[y+18]=Q,P[y+19]=D,l.faceidx+=15,l.lineidx+=20}v=[R+45,R+46,R+1,R,R+47,R+2],h[15],h[15],h[0],h[0],g=l.faceidx,y=l.lineidx,C=3*(b=v[0]),S=3*(x=v[1]),E=3*(w=v[4]),T=3*(_=v[2]),M=3*(D=v[5]),$=3*(A=v[3]),z=L=h[15],k=I=h[0],N[C]=z.x,N[S]=L.x,N[$]=I.x,N[C+1]=z.y,N[S+1]=L.y,N[$+1]=I.y,N[C+2]=z.z,N[S+2]=L.z,N[$+2]=I.z,N[S]=L.x,N[T]=k.x,N[$]=I.x,N[S+1]=L.y,N[T+1]=k.y,N[$+1]=I.y,N[S+2]=L.z,N[T+2]=k.z,N[$+2]=I.z,N[E]=L.x,N[M]=k.x,N[E+1]=L.y,N[M+1]=k.y,N[E+2]=L.z,N[M+2]=k.z,u.normalize(),f.normalize(),N[J]=f.x,N[ee]=N[te]=u.x,N[J+1]=f.y,N[ee+1]=N[te+1]=u.y,N[J+2]=f.z,N[ee+2]=N[te+2]=u.z,F[g]=b,F[g+1]=x,F[g+2]=A,F[g+3]=x,F[g+4]=_,F[g+5]=A,F[g+6]=b,F[g+7]=A,F[g+8]=K,F[g+9]=w,F[g+10]=Z,F[g+11]=D,F[g+12]=w,F[g+13]=Q,F[g+14]=D,P[y]=b,P[y+1]=x,P[y+2]=b,P[y+3]=A,P[y+4]=_,P[y+5]=A,P[y+6]=b,P[y+7]=A,P[y+8]=w,P[y+9]=x,P[y+10]=w,P[y+11]=D,P[y+12]=_,P[y+13]=D,P[y+14]=w,P[y+15]=Q,P[y+16]=w,P[y+17]=D,P[y+18]=Q,P[y+19]=D,l.faceidx+=15,l.lineidx+=20}}(this,l,e);var n=new $3Dmol.Vector3;o.push({centroid:n.addVectors(e.start,e.end).multiplyScalar(.5)});var i=l.updateGeoGroup(0);t(this.boundingSphere,o,i.vertexArray,i.vertices)};var c=function(e,t,r){for(var n=0;n<t.length;n++)if(i=t[n],o=e,Math.sqrt(Math.pow(i.x-o.x,2)+Math.pow(i.y-o.y,2)+Math.pow(i.z-o.z,2))<=r)return!0;var i,o;return!1};this.addIsosurface=function(e,t,r){var i,o,a=void 0!==t.isoval&&"number"==typeof t.isoval?t.isoval:0,s=!!t.voxel,u=void 0===t.smoothness?1:t.smoothness,f=e.size.x,h=e.size.y,p=e.size.z,d=new Int16Array(f*h*p),m=e.data;for(i=0,o=d.length;i<o;++i)d[i]=-1;var v=new Uint8Array(f*h*p);for(i=0,o=m.length;i<o;++i)(a>=0?m[i]-a:a-m[i])>0&&(v[i]|=2);var g=[],y=[];$3Dmol.MarchingCube.march(v,g,y,{fulltable:!0,voxel:s,unitCube:e.unit,origin:e.origin,matrix:e.matrix,nX:f,nY:h,nZ:p}),!s&&u>0&&$3Dmol.MarchingCube.laplacianSmooth(u,g,y);var b=[],x=[],w=[];if(t.selectedRegion&&void 0===t.coords&&(t.coords=t.selectedRegion),void 0!==t.coords){for(var _=t.coords[0].x,D=t.coords[0].y,A=t.coords[0].z,C=t.coords[0].x,S=t.coords[0].y,E=t.coords[0].z,T=0;T<t.coords.length;T++)t.coords[T].x>_?_=t.coords[T].x:t.coords[T].x<C&&(C=t.coords[T].x),t.coords[T].y>D?D=t.coords[T].y:t.coords[T].y<S&&(S=t.coords[T].y),t.coords[T].z>A?A=t.coords[T].z:t.coords[T].z<E&&(E=t.coords[T].z);var M=2;void 0!==t.radius&&(M=t.radius),void 0!==t.selectedOffset&&(M=t.selectedOffset),void 0!==t.seldist&&(M=t.seldist),C-=M,_+=M,S-=M,D+=M,E-=M,A+=M;for(var $=0;$<g.length;$++)g[$].x>C&&g[$].x<_&&g[$].y>S&&g[$].y<D&&g[$].z>E&&g[$].z<A&&c(g[$],t.coords,M)?(b.push(x.length),x.push(g[$])):b.push(-1);for(var z=0;z+2<y.length;z+=3)-1!==b[y[z]]&&-1!==b[y[z+1]]&&-1!==b[y[z+2]]&&(w.push(y[z]-(y[z]-b[y[z]])),w.push(y[z+1]-(y[z+1]-b[y[z+1]])),w.push(y[z+2]-(y[z+2]-b[y[z+2]])));g=x,y=w}n(this,l,{vertexArr:g,faceArr:y,normalArr:[],clickable:t.clickable,hoverable:t.hoverable}),this.updateStyle(t);for(var L=new $3Dmol.Vector3(e.origin.x,e.origin.y,e.origin.z),k=new $3Dmol.Vector3(e.size.x*e.unit.x,e.size.y*e.unit.y,e.size.z*e.unit.z),I=new $3Dmol.Vector3(0,0,0),R=L.clone(),O=L.clone().add(k),F=0;F<g.length;F++)I.add(g[F]),R.max(g[F]),O.min(g[F]);I.divideScalar(g.length);var N=I.distanceTo(O),P=I.distanceTo(R);this.boundingSphere.center=I,this.boundingSphere.radius=Math.max(N,P),"function"==typeof r&&r()},this.addVolumetricData=function(e,t,r){e=new $3Dmol.VolumeData(e,t),this.addIsosurface(e,r)},this.finalize=function(){return e(l),l.initTypedArrays(),l},this.globj=function(t){if(s&&(t.remove(s),s=null),!this.hidden){e(l),l.initTypedArrays(),this.wireframe&&l.setUpWireframe(),void 0!==this.color&&function(e,t){var r,n,i;for(var o in t=t||$3Dmol.CC.color(t),e.colorsNeedUpdate=!0,t.constructor!==Array&&(r=t.r,n=t.g,i=t.b),e.geometryGroups)for(var a=e.geometryGroups[o],s=a.colorArray,l=0,u=a.vertices;l<u;++l){if(t.constructor===Array){var c=t[l];r=c.r,n=c.g,i=c.b}s[3*l]=r,s[3*l+1]=n,s[3*l+2]=i}}(l,this.color),a=new $3Dmol.Object3D;var r;r=this.side==$3Dmol.DoubleSide?new $3Dmol.MeshDoubleLambertMaterial({wireframe:this.wireframe,side:this.side,transparent:this.opacity<1,opacity:this.opacity,wireframeLinewidth:this.linewidth}):new $3Dmol.MeshLambertMaterial({wireframe:this.wireframe,side:this.side,transparent:this.opacity<1,opacity:this.opacity,wireframeLinewidth:this.linewidth});var n=new $3Dmol.Mesh(l,r);a.add(n);var i=new $3Dmol.LineBasicMaterial({linewidth:this.linewidth,color:this.color}),o=new $3Dmol.Line(u,i,$3Dmol.LinePieces);a.add(o),s=a.clone(),t.add(s)}},this.removegl=function(e){s&&(void 0!==s.geometry&&s.geometry.dispose(),void 0!==s.material&&s.material.dispose(),e.remove(s),s=null),a=null}}return Object.defineProperty(o.prototype,"position",{get:function(){return this.boundingSphere.center}}),Object.defineProperty(o.prototype,"x",{get:function(){return this.boundingSphere.center.x}}),Object.defineProperty(o.prototype,"y",{get:function(){return this.boundingSphere.center.y}}),Object.defineProperty(o.prototype,"z",{get:function(){return this.boundingSphere.center.z}}),o}(),$3Dmol.ShapeIDCount=0,$3Dmol.splitMesh=function(e){if(e.vertexArr.length<64e3)return[e];var t=[{vertexArr:[],normalArr:[],faceArr:[]}];e.colorArr&&(t.colorArr=[]);for(var r=[],n=[],i=0,o=e.faceArr,a=0,s=o.length;a<s;a+=3){for(var l=t[i],u=0;u<3;u++){var c=o[a+u];r[c]!==i&&(r[c]=i,n[c]=l.vertexArr.length,l.vertexArr.push(e.vertexArr[c]),e.normalArr&&e.normalArr[c]&&l.normalArr.push(e.normalArr[c]),e.colorArr&&e.colorArr[c]&&l.colorArr.push(e.colorArr[c])),l.faceArr.push(n[c])}l.vertexArr.length>=64e3&&(t.push({vertexArr:[],normalArr:[],faceArr:[]}),e.colorArr&&(t.colorArr=[]),i++)}return t},$3Dmol.GLViewer=function(e,t){var r=(t=t||{}).callback,n=t.defaultcolors;n||(n=$3Dmol.elementColors.defaultColors);var i=t.nomouse,o=0;t.backgroundColor=t.backgroundColor||"#ffffff",null!=typeof t.backgroundColor&&(o=$3Dmol.CC.color(t.backgroundColor).getHex());var a=0;null!=typeof t.camerax&&(a=parseFloat(t.camerax));var s=this,l=e,u=null,c=[],f={},h=[],p=[],d=[],m=[],v=[],g=null,y=500,b=0;null!=t.hoverDuration&&(y=t.hoverDuration),void 0===t.antialias&&(t.antialias=!0);var x=l.width(),w=l.height(),_=null,D=null,A=[],C=new $3Dmol.Renderer({antialias:t.antialias,preserveDrawingBuffer:!0,premultipliedAlpha:!1,id:t.id,row:t.row,col:t.col,rows:t.rows,cols:t.cols,canvas:t.canvas,containerWidth:x,containerHeight:w});C.domElement.style.width="100%",C.domElement.style.height="100%",C.domElement.style.padding="0",C.domElement.style.position="absolute",C.domElement.style.top="0px",C.domElement.style.left="0px",C.domElement.style.zIndex="0";var S=t.row,E=t.col,T=t.cols,M=t.rows,z=t.viewers,L=t.control_all,k=C.getAspect(x,w),I=new $3Dmol.Camera(20,k,1,800,t.orthographic);I.position=new $3Dmol.Vector3(a,0,150);var R=new $3Dmol.Vector3;I.lookAt(R);var O=new $3Dmol.Raycaster(new $3Dmol.Vector3(0,0,0),new $3Dmol.Vector3(0,0,0)),F=new $3Dmol.Projector,N=null,P=null,j=null,B=-50,U=50,V=new $3Dmol.Quaternion(0,0,0,1),q=new $3Dmol.Quaternion(0,0,0,1),G=0,H=!1,W=0,Y=0,X=0,K=0,Z=0,Q=0,J=0,ee=function(){--G<0&&(G=0)},te=function(){G++},re=function(){var e=0;for(var t in f)if(f.hasOwnProperty(t)){var r=parseInt(t);isNaN(r)||(t=r),t>e&&(e=t)}return e+1},ne=function(){var e=I.position.z-P.position.z;e<1&&(e=1),I.near=e+B,I.near<1&&(I.near=1),I.far=e+U,I.near+1>I.far&&(I.far=I.near+1),I.fov=20,I.right=e*Math.tan(Math.PI/180*20),I.left=-I.right,I.top=I.right/k,I.bottom=-I.top,I.updateProjectionMatrix(),N.fog.near=I.near+.4*(I.far-I.near),N.fog.far=I.far,t.disableFog&&(N.fog.near=N.fog.far)},ie=function(e){if(C.setViewport(),N&&(ne(),C.render(N,I),_&&_(s.getView()),!e&&A.length>0))for(var t=s.getView(),r=0;r<A.length;r++)A[r].setView(t,!0)};!function(){(N=new $3Dmol.Scene).fog=new $3Dmol.Fog(o,100,200),j=new $3Dmol.Object3D,(P=new $3Dmol.Object3D).useQuaternion=!0,P.quaternion=new $3Dmol.Quaternion(0,0,0,1),P.add(j),N.add(P);var e=new $3Dmol.Light(16777215);e.position=new $3Dmol.Vector3(.2,.2,1).normalize(),e.intensity=1,N.add(e)}(),C.setClearColorHex(o,1),N.fog.color=$3Dmol.CC.color(o);var oe=function(e,t){g!=e&&(g&&g.unhover_callback(g,s,t,l),g=e,e&&void 0!==e.hover_callback&&"function"==typeof e.hover_callback&&e.hover_callback(e,s,t,l))},ae=function(e){var t=e.originalEvent.targetTouches[0].pageX-e.originalEvent.targetTouches[1].pageX,r=e.originalEvent.targetTouches[0].pageY-e.originalEvent.targetTouches[1].pageY;return Math.sqrt(t*t+r*r)},se=function(e){var t=e.pageX,r=e.pageY;return null==t&&(t=e.originalEvent.pageX),null==r&&(r=e.originalEvent.pageY),e.originalEvent.targetTouches&&e.originalEvent.targetTouches[0]?(t=e.originalEvent.targetTouches[0].pageX,r=e.originalEvent.targetTouches[0].pageY):e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(t=e.originalEvent.changedTouches[0].pageX,r=e.originalEvent.changedTouches[0].pageY),[t,r]},le=function(e,t){var r=l.width(),n=l.height();if(null!=z&&!L){var i=r/T,o=n/M,a=$("canvas",l).offset(),s=e-a.left,u=t-a.top,c=M-Math.floor(u/o)-1,f=Math.floor(s/i);if(c!=S||f!=E)return!1}return!0};$("body").bind("mouseup touchend",(function(e){if(H&&N){var t=se(e),r=t[0],n=t[1];if(r==W&&n==Y){var i=$("canvas",l).offset();!function(e,t,r){if(0!=m.length){var n,i={x:e,y:t,z:-1};if(O.setFromCamera(i,I),(n=O.intersectObjects(j,m)).length){var o=n[0].clickable;void 0!==o.callback&&"function"==typeof o.callback&&o.callback(o,s,r,l)}}}((r-i.left)/x*2-1,-(n-i.top)/w*2+1,e)}}H=!1}));var ue,ce=function(e){if(t.lowerZoomLimit&&t.lowerZoomLimit>0){var r=150-t.lowerZoomLimit;e>r&&(e=r)}if(t.upperZoomLimit&&t.upperZoomLimit>0){var n=150-t.upperZoomLimit;e<n&&(e=n)}return e>150&&(e=149.85),e};this.setViewChangeCallback=function(e){"function"!=typeof e&&null!=e||(_=e)},this.setStateChangeCallback=function(e){"function"!=typeof e&&null!=e||(D=e)},this.getInternalState=function(){for(var e={models:[],surfaces:[],shapes:[],labels:[]},t=0;t<c.length;t++)c[t]&&(e.models[t]=c[t].getInternalState());return e},this.setInternalState=function(e){this.clear();for(var t=e.models,r=0;r<t.length;r++)t[r]&&(c[r]=new $3Dmol.GLModel(r),c[r].setInternalState(t[r]));this.render()},this.setZoomLimits=function(e,r){void 0!==e&&(t.lowerZoomLimit=e),r&&(t.upperZoomLimit=r),P.position.z=ce(P.position.z),ie()};var fe,he=this._handleMouseDown=function(e){if(e.preventDefault(),N){var t=se(e),r=t[0],n=t[1];void 0!==r&&(H=!0,ue=e.which,W=r,Y=n,X=0,e.originalEvent.targetTouches&&2==e.originalEvent.targetTouches.length&&(X=ae(e)),V=P.quaternion,Z=P.position.z,K=j.position.clone(),Q=B,J=U)}},pe=this._handleMouseScroll=function(e){if(e.preventDefault(),N){var t=se(e),r=t[0],n=t[1];if(void 0!==r&&le(r,n)){var i=.85*(150-P.position.z),o=1;e.originalEvent.ctrlKey&&(o=-1),e.originalEvent.detail?P.position.z+=o*i*e.originalEvent.detail/10:e.originalEvent.wheelDelta&&(P.position.z-=o*i*e.originalEvent.wheelDelta/400),P.position.z=ce(P.position.z),ie()}}};this.pngURI=function(){return this.getCanvas().toDataURL("image/png")},this.getCanvas=function(){return u.get(0)},this.setHoverDuration=function(e){y=e};var de=this._handleMouseMove=function(e){x=l.width(),w=l.height(),clearTimeout(fe);var t=$("canvas",l).offset(),r=(se(e)[0]-t.left)/x*2-1,n=-(se(e)[1]-t.top)/w*2+1;if(null!==g&&function(e,t){var r,n={x:e,y:t,z:-1};O.setFromCamera(n,I),0!=(r=O.intersectObjects(j,v)).length&&void 0!==r[0]||oe(null),void 0!==r[0]&&r[0].clickable!==g&&oe(null)}(r,n),fe=setTimeout((function(){!function(e,t){if(0!=v.length){var r,n={x:e,y:t,z:-1};if(O.setFromCamera(n,I),(r=O.intersectObjects(j,v)).length){var i=r[0].clickable;oe(i),g=i}else oe(null)}}(r,n)}),y),e.preventDefault(),N&&H){var i=0,o=se(e),a=o[0],s=o[1];if(void 0!==a&&le(a,s)){var u=(a-W)/x,c=(s-Y)/w;0!=X&&e.originalEvent.targetTouches&&2==e.originalEvent.targetTouches.length?(i=2,c=2*(ae(e)-X)/(x+w)):e.originalEvent.targetTouches&&3==e.originalEvent.targetTouches.length&&(i=1);var f=C.getXYRatio(),h=f[0],p=f[1];u*=h,c*=p;var d,m=Math.sqrt(u*u+c*c);if(3==i||3==ue&&e.ctrlKey)B=Q+100*u,U=J-100*c;else if(2==i||3==ue||e.shiftKey)(d=.85*(150-P.position.z))<80&&(d=80),P.position.z=Z+c*d,P.position.z=ce(P.position.z);else if(1==i||2==ue||e.ctrlKey){var b=function(e,t){var r=e/x,n=t/w,i=P.position.z,o=P.quaternion,a=new $3Dmol.Vector3(0,0,i);return F.projectVector(a,I),a.x+=2*r,a.y-=2*n,F.unprojectVector(a,I),a.z=0,a.applyQuaternion(o),a}(h*(a-W),p*(s-Y));j.position.addVectors(K,b)}else if((0===i||1==ue)&&0!==m){var _=Math.sin(m*Math.PI)/m;q.x=Math.cos(m*Math.PI),q.y=0,q.z=_*u,q.w=-_*c,P.quaternion=new $3Dmol.Quaternion(1,0,0,0),P.quaternion.multiply(q),P.quaternion.multiply(V)}ie()}}},me=function(e){x=(l=e).width(),w=l.height(),k=C.getAspect(x,w),C.setSize(x,w),l.append(C.domElement),u=$(C.domElement),i||(u.bind("mousedown touchstart",he),u.bind("DOMMouseScroll mousewheel",pe),u.bind("mousemove touchmove",de),u.bind("contextmenu",(function(e){e.preventDefault()})))};me(l),this.setContainer=function(e){return"string"===$.type(e)&&(e=$("#"+e)),e||(e=l),me(e),this},this.setBackgroundColor=function(e,t){void 0===t?t=1:(t<0||t>1)&&(t=1);var r=$3Dmol.CC.color(e);return N.fog.color=r,o=r.getHex(),C.setClearColorHex(r.getHex(),t),ie(),this},this.setProjection=function(e){I.ortho="orthographic"===e,ne()},this.setViewStyle=function(e){if("outline"===e.style){var t={};e.color&&(t.color=$3Dmol.CC.color(e.color)),e.width&&(t.width=e.width),C.enableOutline(t)}else C.disableOutline();return this},t.style&&this.setViewStyle(t),this.setWidth=function(e){return x=e||x,C.setSize(x,w),this},this.setHeight=function(e){return w=e||w,C.setSize(x,w),this},this.resize=function(){return x=l.width(),w=l.height(),k=C.getAspect(x,w),C.setSize(x,w),I.aspect=k,I.updateProjectionMatrix(),ie(),this},$(window).resize(this.resize),this.getModel=function(e){return e in c?c[e]:0==c.length?null:c[c.length-1]};var ve,ge=function(e,t,r){if(1==r)return t;if(0==r)return e;var n=e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w;if(n>.9995){var i=new $3Dmol.Quaternion(e.x+r*(t.x-e.x),e.y+r*(t.y-e.y),e.z+r*(t.z-e.z),e.w+r*(t.w-e.w));return i.normalize(),i}n<0&&(t=t.clone().multiplyScalar(-1),n=-n),n>1?n=1:n<-1&&(n=-1);var o=Math.acos(n)*r,a=t.clone();a.sub(e.clone().multiplyScalar(n)),a.normalize();var s=Math.cos(o),l=Math.sin(o),u=new $3Dmol.Quaternion(e.x*s+a.x*l,e.y*s+a.y*l,e.z*s+a.z*l,e.w*s+a.w*l);return u.normalize(),u};this.spin=function(e){if(clearInterval(ve),void 0===e&&(e="y"),"boolean"==typeof e){if(!e)return;e="y"}Array.isArray(e)&&(e={x:e[0],y:e[1],z:e[2]});var t=this;ve=setInterval((function(){t.rotate(1,e)}),25)};var ye=function(e,t,r,n,i,o){var a=Math.ceil(e/20);a<1&&(a=1),te();var s={mpos:j.position.clone(),rz:P.position.z,rot:P.quaternion.clone(),cam:R.clone()};if(t){for(var l=(a=new Array(a)).length,u=0;u<l;u++){var c=(u+1)/l,f={mpos:s.mpos,rz:s.rz,rot:s.rot};r&&(f.mpos=r.clone().sub(s.mpos).multiplyScalar(c).add(s.mpos)),void 0!==n&&null!=n&&(f.rz=s.rz+c*(n-s.rz)),i&&(f.rot=ge(s.rot,i,c)),o&&(f.cam=o.clone().sub(s.cam).multiplyScalar(c).add(s.cam)),a[u]=f}var h=0;setTimeout((function e(){var t=a[h];h+=1,t.mpos&&(j.position=t.mpos),t.rz&&(P.position.z=t.rz),t.rot&&(P.quaternion=t.rot),t.cam&&I.lookAt(t.cam),h<a.length?setTimeout(e,20):ee(),ie()}),20)}else{var p={},d=1/a;if(r&&(p.mpos=r.clone().sub(s.mpos).multiplyScalar(d)),void 0!==n&&null!=n&&(p.rz=d*(n-s.rz)),i){var m=ge(s.rot,i,d);p.rot=s.rot.clone().inverse().multiply(m)}o&&(p.cam=o.clone().sub(s.cam).multiplyScalar(d));var v=0;setTimeout((function e(){v+=1,p.mpos&&j.position.add(p.mpos),p.rz&&(P.position.z+=p.rz),p.rot&&P.quaternion.multiply(p.rot),p.cam&&(R.add(p.cam),I.lookAt(R)),v<a?setTimeout(e,20):ee(),ie()}),20)}};function be(e){var t=[];if(void 0===e||void 0===e.model)for(var r=0;r<c.length;r++)c[r]&&t.push(c[r]);else{t=e.model,$.isArray(t)||(t=[t]);for(var n=0;n<t.length;n++)if("number"==typeof t[n]){var i=t[n];i<0&&(i+=c.length),t[n]=c[i]}}return t}function xe(e){var t=[];void 0===e&&(e={});for(var r=be(e),n=0;n<r.length;n++)t=t.concat(r[n].selectedAtoms(e));return t}function we(e,t){void 0===t&&(t={});for(var r=be(t),n=0;n<r.length;n++)if(r[n].atomIsSelected(e,t))return!0;return!1}this.rotate=function(e,t,r,n){r=void 0!==r?r:0,void 0===t&&(t="y"),"x"==t?t={x:1,y:0,z:0}:"y"==t?t={x:0,y:1,z:0}:"z"==t&&(t={x:0,y:0,z:1});var i=function(e){var r,n,i,o=Math.sin(e/2),a=Math.cos(e/2);return r=t.x*o,n=t.y*o,i=t.z*o,new $3Dmol.Quaternion(r,n,i,a).normalize()}(Math.PI*e/180);if(r){var o=(new $3Dmol.Quaternion).copy(P.quaternion).multiply(i);ye(r,n,j.position,P.position.z,o,R)}else P.quaternion.multiply(i),ie();return this},this.surfacesFinished=function(){for(var e in f)if(!f[e][0].done)return!1;return!0},this.getView=function(){if(!j)return[0,0,0,0,0,0,0,1];var e=j.position,t=P.quaternion;return[e.x,e.y,e.z,P.position.z,t.x,t.y,t.z,t.w]},this.setView=function(e,t){return void 0!==e&&(e instanceof Array||8!==e.length)&&j&&P?(j.position.x=e[0],j.position.y=e[1],j.position.z=e[2],P.position.z=e[3],P.quaternion.x=e[4],P.quaternion.y=e[5],P.quaternion.z=e[6],P.quaternion.w=e[7],void 0!==e[8]&&(P.position.x=e[8],P.position.y=e[9]),ie(t),this):this},this.render=function(e,t){C.setViewport(),function(){m.splice(0,m.length),v.splice(0,v.length);for(var e=0,t=c.length;e<t;e++){var r=c[e];if(r){var n=r.selectedAtoms({clickable:!0}),i=r.selectedAtoms({hoverable:!0});Array.prototype.push.apply(v,i),Array.prototype.push.apply(m,n)}}for(var o=0,a=h.length;o<a;o++){var s=h[o];s&&s.clickable&&m.push(s),s&&s.hoverable&&v.push(s)}}();var r,n,i=this.getView();for(D&&D(this.getInternalState()),t||(t=C.supportedExtensions()),r=0;r<c.length;r++)c[r]&&c[r].globj(j,t);for(r=0;r<h.length;r++)h[r]&&(void 0===h[r].frame||b<0||h[r].frame<0||h[r].frame==b?h[r].globj(j,t):h[r].removegl(j));for(r=0;r<p.length;r++)p[r]&&void 0!==p[r].frame&&p[r].frame>=0&&(j.remove(p[r].sprite),(b<0||p[r].frame==b)&&j.add(p[r].sprite));for(r in f)if(f.hasOwnProperty(r)){var o=f[r];for(n=0;n<o.length;n++)if(o.hasOwnProperty(n)){var a=o[n].geo;if(!o[n].finished||t.regen){a.verticesNeedUpdate=!0,a.elementsNeedUpdate=!0,a.normalsNeedUpdate=!0,a.colorsNeedUpdate=!0,a.buffersNeedUpdate=!0,a.boundingSphere=null,o[n].done&&(o[n].finished=!0),o[n].lastGL&&j.remove(o[n].lastGL);var s=null;if(s=o[n].mat instanceof $3Dmol.LineBasicMaterial?new $3Dmol.Line(a,o[n].mat):new $3Dmol.Mesh(a,o[n].mat),o[n].mat.transparent&&0==o[n].mat.opacity?s.visible=!1:s.visible=!0,o[n].symmetries.length>1||1==o[n].symmetries.length&&!o[n].symmetries[n].isIdentity()){var l,u=new $3Dmol.Object3D;for(l=0;l<o[n].symmetries.length;l++){var d=s.clone();d.matrix=o[n].symmetries[l],d.matrixAutoUpdate=!1,u.add(d)}o[n].lastGL=u,j.add(u)}else o[n].lastGL=s,j.add(s)}}}return this.setView(i),"function"==typeof e&&e(this),this},this.selectedAtoms=function(e){return xe(e)},this.getUniqueValues=function(e,t){void 0===t&&(t={});var r=xe(t),n={};for(var i in r)r[i].hasOwnProperty(e)&&(n[r[i][e]]=!0);return Object.keys(n)},this.pdbData=function(e){for(var t=xe(e),r="",n=0,i=t.length;n<i;++n)r+=t[n].pdbline+"\n";return r},this.zoom=function(e,t,r){e=e||2,t=void 0!==t?t:0;var n=150-(150-P.position.z)/e;return t>0?ye(t,r,j.position,ce(n),P.quaternion,R):(P.position.z=ce(n),ie()),this},this.translate=function(e,t,r,n){r=void 0!==r?r:0;var i=e/x,o=t/w,a=new $3Dmol.Vector3(0,0,-150);F.projectVector(a,I),a.x-=i,a.y-=o,F.unprojectVector(a,I),a.z=0;var s=R.clone().add(a);return r>0?ye(r,n,j.position,P.position.z,P.quaternion,s):(R=s,I.lookAt(R),ie()),this},this.fitSlab=function(e){var t=xe(e=e||{}),r=$3Dmol.getExtent(t),n=r[1][0]-r[0][0],i=r[1][1]-r[0][1],o=r[1][2]-r[0][2],a=Math.sqrt(n*n+i*i+o*o);return a<5&&(a=5),B=-a/1.9,U=a/2,this},this.center=function(e,t,r){var n,i;t=void 0!==t?t:0;var o=xe(e=e||{}),a=$3Dmol.getExtent(o);$.isEmptyObject(e)?($.each(h,(function(e,t){if(t&&t.boundingSphere&&t.boundingSphere.center){var r=t.boundingSphere.center,n=t.boundingSphere.radius;n>0?(o.push(new $3Dmol.Vector3(r.x+n,r.y,r.z)),o.push(new $3Dmol.Vector3(r.x-n,r.y,r.z)),o.push(new $3Dmol.Vector3(r.x,r.y+n,r.z)),o.push(new $3Dmol.Vector3(r.x,r.y-n,r.z)),o.push(new $3Dmol.Vector3(r.x,r.y,r.z+n)),o.push(new $3Dmol.Vector3(r.x,r.y,r.z-n))):o.push(r)}})),a=$3Dmol.getExtent(o),n=o,i=a):(n=xe({}),i=$3Dmol.getExtent(n));var s=new $3Dmol.Vector3(a[2][0],a[2][1],a[2][2]),l=i[1][0]-i[0][0],u=i[1][1]-i[0][1],c=i[1][2]-i[0][2],f=Math.sqrt(l*l+u*u+c*c);f<5&&(f=5),B=-f/1.9,U=f/2,l=a[1][0]-a[0][0],u=a[1][1]-a[0][1],c=a[1][2]-a[0][2],(f=Math.sqrt(l*l+u*u+c*c))<5&&(f=5);for(var p=25,d=0;d<o.length;d++)if(o[d]){var m=s.distanceToSquared(o[d]);m>p&&(p=m)}f=2*Math.sqrt(p);var v=s.clone().multiplyScalar(-1);return t>0?ye(t,r,v,P.position.z,P.quaternion,R):(j.position=v,ie()),this},this.zoomTo=function(e,t,r){var n,i;t=void 0!==t?t:0;var o=xe(e=e||{}),a=$3Dmol.getExtent(o);$.isEmptyObject(e)?($.each(h,(function(e,t){if(t&&t.boundingSphere&&t.boundingSphere.center){var r=t.boundingSphere.center,n=t.boundingSphere.radius;n>0?(o.push(new $3Dmol.Vector3(r.x+n,r.y,r.z)),o.push(new $3Dmol.Vector3(r.x-n,r.y,r.z)),o.push(new $3Dmol.Vector3(r.x,r.y+n,r.z)),o.push(new $3Dmol.Vector3(r.x,r.y-n,r.z)),o.push(new $3Dmol.Vector3(r.x,r.y,r.z+n)),o.push(new $3Dmol.Vector3(r.x,r.y,r.z-n))):o.push(r)}})),a=$3Dmol.getExtent(o),n=o,i=a):(n=xe({}),i=$3Dmol.getExtent(n));var s=new $3Dmol.Vector3(a[2][0],a[2][1],a[2][2]),l=i[1][0]-i[0][0],u=i[1][1]-i[0][1],c=i[1][2]-i[0][2],f=Math.sqrt(l*l+u*u+c*c);f<5&&(f=5),B=-f/1.9,U=f/2,0===Object.keys(e).length&&(B=-999999,U=999999),l=a[1][0]-a[0][0],u=a[1][1]-a[0][1],c=a[1][2]-a[0][2],(f=Math.sqrt(l*l+u*u+c*c))<5&&(f=5);for(var p=25,d=0;d<o.length;d++)if(o[d]){var m=s.distanceToSquared(o[d]);m>p&&(p=m)}f=2*Math.sqrt(p);var v=s.clone().multiplyScalar(-1),g=-(.5*f/Math.tan(Math.PI/180*I.fov/2)-150);return g=ce(g),t>0?ye(t,r,v,g,P.quaternion,R):(j.position=v,P.position.z=g,ie()),this},this.setSlab=function(e,t){B=e,U=t},this.getSlab=function(){return{near:B,far:U}},this.addLabel=function(e,t,r,n){if(t=t||{},r){var i=$3Dmol.getExtent(xe(r));t.position={x:i[2][0],y:i[2][1],z:i[2][2]}}var o=new $3Dmol.Label(e,t);return o.setContext(),j.add(o.sprite),t.fixed&&d.push(p.length),p.push(o),n||ie(),o},this.addResLabels=function(e,t,r){var n=p.length;return De("addResLabels",e,this,t,r),ie(),p.slice(n)},this.addPropertyLabels=function(e,t,r){return De("addPropertyLabels",e,t,this,r),ie(),this},this.removeLabel=function(e){for(var t=0;t<p.length;t++)if(p[t]==e){p.splice(t,1),e.dispose(),j.remove(e.sprite);break}return ie(),this},this.removeAllLabels=function(){for(var e=0;e<p.length;e++)p[e]&&p[e].sprite&&j.remove(p[e].sprite);return p.splice(0,p.length),ie(),this},this.setLabelStyle=function(e,t){return j.remove(e.sprite),e.dispose(),e.stylespec=t,e.setContext(),j.add(e.sprite),ie(),e},this.setLabelText=function(e,t){return j.remove(e.sprite),e.dispose(),e.text=t,e.setContext(),j.add(e.sprite),ie(),e},this.addShape=function(e){e=e||{};var t=new $3Dmol.GLShape(e);return t.shapePosition=h.length,h.push(t),t},this.removeShape=function(e){if(!e)return this;for(e.removegl(j),delete h[e.shapePosition];h.length>0&&void 0===h[h.length-1];)h.pop();return this},this.removeAllShapes=function(){for(var e=0;e<h.length;e++){var t=h[e];t&&t.removegl(j)}return h.splice(0,h.length),this};var _e=function(e){if(e.hasOwnProperty("x")&&e.hasOwnProperty("y")&&e.hasOwnProperty("z"))return e;var t=xe(e);if(0==t.length)return{x:0,y:0,z:0};var r=$3Dmol.getExtent(t);return{x:r[0][0]+(r[1][0]-r[0][0])/2,y:r[0][1]+(r[1][1]-r[0][1])/2,z:r[0][2]+(r[1][2]-r[0][2])/2}};function De(e,t,r,n,i,o,a){for(var s=be(t),l=0;l<s.length;l++)s[l][e](t,r,n,i,o,a)}this.addSphere=function(e){(e=e||{}).center=_e(e.center);var t=new $3Dmol.GLShape(e);return t.shapePosition=h.length,t.addSphere(e),h.push(t),t.finalize(),t},this.addBox=function(e){null!=(e=e||{}).corner&&(e.corner=_e(e.corner)),null!=e.center&&(e.center=_e(e.center));var t=new $3Dmol.GLShape(e);return t.shapePosition=h.length,t.addBox(e),h.push(t),t.finalize(),t},this.addArrow=function(e){(e=e||{}).start=_e(e.start),e.end=_e(e.end);var t=new $3Dmol.GLShape(e);return t.shapePosition=h.length,t.addArrow(e),h.push(t),t.finalize(),t},this.addCylinder=function(e){(e=e||{}).start=_e(e.start),e.end=_e(e.end);var t=new $3Dmol.GLShape(e);return t.shapePosition=h.length,e.dashed?t.addDashedCylinder(e):t.addCylinder(e),h.push(t),t.finalize(),t},this.addCurve=function(e){e=e||{};var t=new $3Dmol.GLShape(e);return t.shapePosition=h.length,t.addCurve(e),h.push(t),t.finalize(),t},this.addLine=function(e){(e=e||{}).start=_e(e.start),e.end=_e(e.end),e.wireframe=!0;var t=new $3Dmol.GLShape(e);return t.shapePosition=h.length,e.dashed?t=function(e,t){e.dashLength=e.dashLength||.5,e.gapLength=e.gapLength||.5,e.start=e.start||{},e.end=e.end||{};var r,n,i,o=new $3Dmol.Vector3(e.start.x||0,e.start.y||0,e.start.z||0),a=new $3Dmol.Vector3(e.end.x,e.end.y||0,e.end.z||0),s=new $3Dmol.Vector3,l=new $3Dmol.Vector3,u=new $3Dmol.Vector3,c=o.clone(),f=0;for(s.subVectors(a,o),r=s.length(),s.normalize(),l=s.clone(),u=s.clone(),l.multiplyScalar(e.dashLength),u.multiplyScalar(e.gapLength),n=l.length(),i=u.length();f<r;){if(f+n>r){e.start=o,e.end=a,t.addLine(e);break}c.addVectors(o,l),e.start=o,e.end=c,t.addLine(e),o=c.clone(),f+=n,c.addVectors(o,u),o=c.clone(),f+=i}return t.finalize(),t}(e,t):t.addLine(e),h.push(t),t.finalize(),t},this.addUnitCell=function(e){e||(e=this.getModel());var t=new $3Dmol.GLShape({wireframe:!0});t.shapePosition=h.length;var r=e.getCrystData(),n=null;if(r){if(r.matrix)n=r.matrix;else{var i,o,a,s=r.a,l=r.b,u=r.c,c=r.alpha,f=r.beta,p=r.gamma;c=c*Math.PI/180,f=f*Math.PI/180,p=p*Math.PI/180,i=Math.cos(f),o=(Math.cos(c)-Math.cos(f)*Math.cos(p))/Math.sin(p),a=Math.sqrt(Math.max(0,1-i*i-o*o)),n=new $3Dmol.Matrix4(s,l*Math.cos(p),u*i,0,0,l*Math.sin(p),u*o,0,0,0,u*a,0,0,0,0,1)}for(var d=[new $3Dmol.Vector3(0,0,0),new $3Dmol.Vector3(1,0,0),new $3Dmol.Vector3(0,1,0),new $3Dmol.Vector3(0,0,1),new $3Dmol.Vector3(1,1,0),new $3Dmol.Vector3(0,1,1),new $3Dmol.Vector3(1,0,1),new $3Dmol.Vector3(1,1,1)],m=0;m<d.length;m++)d[m]=d[m].applyMatrix4(n);t.addLine({start:d[0],end:d[1]}),t.addLine({start:d[0],end:d[2]}),t.addLine({start:d[1],end:d[4]}),t.addLine({start:d[2],end:d[4]}),t.addLine({start:d[0],end:d[3]}),t.addLine({start:d[3],end:d[5]}),t.addLine({start:d[2],end:d[5]}),t.addLine({start:d[1],end:d[6]}),t.addLine({start:d[4],end:d[7]}),t.addLine({start:d[6],end:d[7]}),t.addLine({start:d[3],end:d[6]}),t.addLine({start:d[5],end:d[7]})}return h.push(t),t.finalize(),t},this.addCustom=function(e){e=e||{};var t=new $3Dmol.GLShape(e);return t.shapePosition=h.length,t.addCustom(e),h.push(t),t.finalize(),t},this.addVolumetricData=function(e,t,r){r=r||{};var n=new $3Dmol.GLShape(r);return n.shapePosition=h.length,n.addVolumetricData(e,t,r),h.push(n),n},this.addIsosurface=function(e,t,r){t=t||{};var n=new $3Dmol.GLShape(t);return n.shapePosition=h.length,n.addIsosurface(e,t,r),h.push(n),n},this.addVolumetricRender=function(e,t){t=t||{};var r=new $3Dmol.GLVolumetricRender(e,t);return r.shapePosition=h.length,h.push(r),r},this.hasVolumetricRender=function(){return C.supportsVolumetric()},this.enableFog=function(e){e?N.fog=new $3Dmol.Fog(o,100,200):(t.disableFog=!0,ie())},this.setFrame=function(e){return b=e,new Promise((function(t){var r=c.map((function(t){return t.setFrame(e)}));Promise.all(r).then((function(){t()}))}))},this.getFrame=function(){return b},this.getNumFrames=function(){for(var e=0,t=0;t<c.length;t++)c[t].getNumFrames()>e&&(e=c[t].getNumFrames());for(var r=0;r<h.length;r++)h[r].frame&&h[r].frame>=e&&(e=h[r].frame+1);for(var n=0;n<p.length;n++)p[n].frame&&p[n].frame>=e&&(e=p[n].frame+1);return e},this.animate=function(e){te();var t=100,r="forward",n=0;(e=e||{}).interval&&(t=e.interval),e.loop&&(r=e.loop),e.reps&&(n=e.reps);var i=this.getNumFrames(),o=this,a=0,s=1;e.step&&(n/=s=e.step);var l,u,c=0,f=i*n,h=new Date,p=function(e){h=new Date,"forward"==e?o.setFrame(a).then((function(){a=(a+s)%i,l()})):"backward"==e?o.setFrame(i-1-a).then((function(){a=(a+s)%i,l()})):o.setFrame(a).then((function(){s*=(a+=s)%(i-1)==0?-1:1,l()}))};return l=function(){if(o.render(),++c!=f&&o.isAnimated()){var e=t-(new Date-h);e=e>0?e:0,setTimeout(p,e,r)}else clearTimeout(u),ee()},u=setTimeout(p,0,r),this},this.stopAnimate=function(){return G=0,this},this.isAnimated=function(){return G>0},this.addModel=function(e,t,r){r&&!r.defaultcolors?r.defaultcolors=n:void 0===r&&(r={defaultcolors:n});var i=new $3Dmol.GLModel(c.length,r);return i.addMolData(e,t,r),c.push(i),i},this.addModels=function(e,t,r){(r=r||{}).multimodel=!0,r.frames=!0;for(var i=$3Dmol.GLModel.parseMolData(e,t,r),o=0;o<i.length;o++){var a=new $3Dmol.GLModel(c.length,n);a.setAtomDefaults(i[o]),a.addFrame(i[o]),a.setFrame(0),i.modelData&&a.setModelData(i.modelData[o]),a.setDontDuplicateAtoms(!r.duplicateAssemblyAtoms),c.push(a)}return c},this.addModelsAsFrames=function(e,t,r){(r=r||{}).multimodel=!0,r.frames=!0;var i=new $3Dmol.GLModel(c.length,n);return i.addMolData(e,t,r),c.push(i),i},this.addAsOneMolecule=function(e,t,r){(r=r||{}).multimodel=!0,r.onemol=!0;var i=new $3Dmol.GLModel(c.length,n);return i.addMolData(e,t,r),c.push(i),i},this.removeModel=function(e){if(e){for(e.removegl(j),delete c[e.getID()];c.length>0&&void 0===c[c.length-1];)c.pop();return this}},this.removeAllModels=function(){for(var e=0;e<c.length;e++){var t=c[e];t&&t.removegl(j)}return c.splice(0,c.length),this},this.exportJSON=function(e,t){var r={};return r.m=void 0===t?c.map((function(t){return t.toCDObject(e)})):[c[t].toCDObject()],JSON.stringify(r)},this.exportVRML=function(){var e=j;De("removegl",j),j=new $3Dmol.Object3D,this.render(null,{supportsImposters:!1,supportsAIA:!1,regen:!0});var t="#VRML V2.0 utf8\n"+j.vrml()+"\n";return De("removegl",j),j=e,t},this.createModelFrom=function(e,t){for(var r=new $3Dmol.GLModel(c.length,n),i=0;i<c.length;i++)if(c[i]){var o=c[i].selectedAtoms(e);r.addAtoms(o),t&&c[i].removeAtoms(o)}return c.push(r),r},this.setStyle=function(e,t){return void 0===t&&(t=e,e={}),De("setStyle",e,t,!1),this},this.addStyle=function(e,t){return void 0===t&&(t=e,e={}),De("setStyle",e,t,!0),this},this.setClickable=function(e,t,r){return De("setClickable",e,t,r),this},this.setHoverable=function(e,t,r,n){return De("setHoverable",e,t,r,n),this},this.vibrate=function(e,t,r,n){return De("vibrate",e,t,r,this,n),this},this.setColorByProperty=function(e,t,r,n){return De("setColorByProperty",e,t,r,n),this},this.setColorByElement=function(e,t){return De("setColorByElement",e,t),this};var Ae=function(e,t){for(var r=[],n=0;n<e.length;n++){var i=e[n];void 0!==i&&(i.x<t[0][0]||i.x>t[1][0]||i.y<t[0][1]||i.y>t[1][1]||i.z<t[0][2]||i.z>t[1][2]||r.push(i))}return r},Ce=function(e){return(e[1][0]-e[0][0])*(e[1][1]-e[0][1])*(e[1][2]-e[0][2])},Se=function(e,t,r){for(var n=new $3Dmol.Geometry(!0),i=n.updateGeoGroup(0),o=[],a=0,s=e.length;a<s;a++){var l=e[a];l&&(void 0!==l.surfaceColor?o[a]=l.surfaceColor:l.color&&(o[a]=$3Dmol.CC.color(l.color)))}for(var u=i.vertexArray,c=t.vertices,f=0,h=c.length;f<h;f++){var p=3*i.vertices;u[p]=c[f].x,u[p+1]=c[f].y,u[p+2]=c[f].z,i.vertices++}var d=i.colorArray;if(r.voldata&&r.volscheme)for(var m=r.volscheme,v=r.voldata,g=m.range()||[-1,1],y=0,b=c.length;y<b;y++){var x=v.getVal(c[y].x,c[y].y,c[y].z),w=$3Dmol.CC.color(m.valueToHex(x,g)),_=3*y;d[_]=w.r,d[_+1]=w.g,d[_+2]=w.b}else if(o.length>0)for(var D=0,A=c.length;D<A;D++){var C=c[D].atomid,S=3*D;d[S]=o[C].r,d[S+1]=o[C].g,d[S+2]=o[C].b}var E=t.faces;i.faceidx=E.length,n.initTypedArrays();for(var T,M,$,z,L=i.vertexArray,k=i.normalArray,I=0,R=E.length;I<R;I+=3){var O=3*E[I],F=3*E[I+1],N=3*E[I+2];T=new $3Dmol.Vector3(L[O],L[O+1],L[O+2]),M=new $3Dmol.Vector3(L[F],L[F+1],L[F+2]),($=new $3Dmol.Vector3(L[N],L[N+1],L[N+2])).subVectors($,M),T.subVectors(T,M),$.cross(T),(z=$).normalize(),k[O]+=z.x,k[F]+=z.x,k[N]+=z.x,k[O+1]+=z.y,k[F+1]+=z.y,k[N+1]+=z.y,k[O+2]+=z.z,k[F+2]+=z.z,k[N+2]+=z.z}i.faceArray=new Uint16Array(E);var P=new $3Dmol.Mesh(n,r);return P.doubleSided=!0,P};function Ee(e){var t=new $3Dmol.MeshLambertMaterial;for(var r in t.vertexColors=$3Dmol.VertexColors,e)"color"===r||"map"===r||e.hasOwnProperty(r)&&(t[r]=e[r]);return void 0!==e.opacity&&(1===e.opacity?t.transparent=!1:t.transparent=!0),t}this.addMesh=function(e){var t={geo:e.geometry,mat:e.material,done:!0,finished:!1},r=re();return f[r]=t,r};var Te=function(e){var t=[];return $.each(e,(function(e,r){t[e]=$.extend({},r)})),t},Me={VDW:$3Dmol.SurfaceType.VDW,MS:$3Dmol.SurfaceType.MS,SAS:$3Dmol.SurfaceType.SAS,SES:$3Dmol.SurfaceType.SES};this.addSurface=function(e,t,r,n,i,o){var a=re(),l=null;"string"==typeof e?void 0!==Me[e]?e=Me[e]:console.log("Surface type : "+e+" is not recognized"):void 0===e&&(e=$3Dmol.SurfaceType.VDW);var u,h=null,p=Te(xe(r));u=n?Te(xe(n)):p;var d,m=!1;for(d=0;d<c.length;d++)if(c[d]){var v=c[d].getSymmetries();if(v.length>1||1==v.length&&!v[0].isIdentity()){m=!0;break}}var g=function(r,n,o){var u;h=i?Te(xe(i)):o;var c=$3Dmol.getExtent(o,!0);if(t.map&&t.map.prop){var f=t.map.prop,p=t.map.scheme||t.map.gradient||new $3Dmol.Gradient.RWB,d=p.range();d||(d=$3Dmol.getPropertyRange(o,f)),t.colorscheme={prop:f,gradient:p}}for(var m=0,v=n.length;m<v;m++)(u=n[m]).surfaceColor=$3Dmol.getColorFromStyle(u,t);var g=Ce(c),y=function(e,t,r){for(var n=[],i={},o=0,a=t.length;o<a;o++)i[t[o].index]=o;for(var s=function(e){for(var t=[],r=0,n=e.length;r<n;r++)e[r].index in i&&t.push(i[e[r].index]);return t},l=function(e){var t=[];return t[0]=[e[0][0],e[0][1],e[0][2]],t[1]=[e[1][0],e[1][1],e[1][2]],t},u=function e(t){if(Ce(t)<64e3)return[t];var r,n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],o=t[1][2]-t[0][2];r=n>i&&n>o?0:i>n&&i>o?1:2;var a=l(t),s=l(t),u=(t[1][r]-t[0][r])/2+t[0][r];a[1][r]=u,s[0][r]=u;var c=e(a),f=e(s);return c.concat(f)}(e),c=0,f=u.length;c<f;c++){var h=l(u[c]);h[0][0]-=6,h[0][1]-=6,h[0][2]-=6,h[1][0]+=6,h[1][1]+=6,h[1][2]+=6;var p=Ae(t,h),d=Ae(r,u[c]);n.push({extent:u[c],atoms:s(p),toshow:s(d)})}return n}(c,n,o);if(h&&h.length&&h.length>0){var b=$3Dmol.getExtent(h,!0);y.sort((function(e,t){var r=function(e,t){var r=e.extent,n=r[1][0]-r[0][0],i=r[1][1]-r[0][1],o=r[1][2]-r[0][2],a=n-t[2][0];a*=a;var s=i-t[2][1];s*=s;var l=o-t[2][2];return a+s+l*l};return r(e,b)-r(t,b)}))}for(var x=[],w=0,_=n.length;w<_;w++)u=n[w],x[w]={x:u.x,y:u.y,z:u.z,serial:w,elem:u.elem};if($3Dmol.syncSurface){for(var D=function(t){return new Promise((function(i){for(var o=function(e,t,r,n,i,o){var a=new $3Dmol.ProteinSurface;return a.initparm(t,1!==e,o),a.fillvoxels(i,r),a.buildboundary(),e!=$3Dmol.SurfaceType.SES&&e!=$3Dmol.SurfaceType.MS||(a.fastdistancemap(),a.boundingatom(!1),a.fillvoxelswaals(i,r)),a.marchingcube(e),a.getFacesAndVertices(n)}(e,y[t].extent,y[t].atoms,y[t].toshow,x,g),a=$3Dmol.splitMesh({vertexArr:o.vertices,faceArr:o.faces}),u=0,c=a.length;u<c;u++){o={vertices:a[u].vertexArr,faces:a[u].faceArr};var f=Se(n,o,l);$3Dmol.mergeGeos(r.geo,f)}s.render(),i()}))},A=[],C=0;C<y.length;C++)A.push(D(C));return Promise.all(A).then((function(){return r.done=!0,Promise.resolve(a)}))}var S=[];e<0&&(e=0);for(var E=0;E<4;E++){var T=new Worker($3Dmol.SurfaceWorker);S.push(T),T.postMessage({type:-1,atoms:x,volume:g})}return new Promise((function(t,i){for(var o=0,u=function(e){for(var i=$3Dmol.splitMesh({vertexArr:e.data.vertices,faceArr:e.data.faces}),u=0,c=i.length;u<c;u++){var f={vertices:i[u].vertexArr,faces:i[u].faceArr},h=Se(n,f,l);$3Dmol.mergeGeos(r.geo,h)}s.render(),++o==y.length&&(r.done=!0,t(a))},c=function(e){console.log(e.message+" ("+e.filename+":"+e.lineno+")"),i(e)},f=0;f<y.length;f++){var h=S[f%S.length];h.onmessage=u,h.onerror=c,h.postMessage({type:e,expandedExtent:y[f].extent,extendedAtoms:y[f].atoms,atomsToShow:y[f].toshow})}}))};l=Ee(t=t||{});var y=[],b=null;if(m){var x={},w={};for(d=0;d<c.length;d++)x[d]=[],w[d]=[];for(d=0;d<u.length;d++)x[u[d].model].push(u[d]);for(d=0;d<p.length;d++)w[p[d].model].push(p[d]);var _=[];for(d=0;d<c.length;d++)w[d].length>0&&(y.push({geo:new $3Dmol.Geometry(!0),mat:l,done:!1,finished:!1,symmetries:c[d].getSymmetries()}),_.append(g(y[d],x[d],w[d])));b=Promise.all(_)}else y.push({geo:new $3Dmol.Geometry(!0),mat:l,done:!1,finished:!1,symmetries:[new $3Dmol.Matrix4]}),b=g(y[y.length-1],u,p);return f[a]=y,b.surfid=a,o&&"function"==typeof o?(b.then((function(e){o(e)})),a):b},this.setSurfaceMaterialStyle=function(e,t){if(f[e])for(var r=f[e],n=0;n<r.length;n++){var i=r[n].mat=Ee(t);r[n].mat.side=$3Dmol.FrontSide,t.color?function(){r[n].mat.color=t.color,r[n].geo.colorsNeedUpdate=!0;var e=$3Dmol.CC.color(t.color);r[n].geo.setColors((function(){return e}))}():i.voldata&&i.volscheme&&function(){var e=i.volscheme,t=i.voldata,o=$3Dmol.CC,a=e.range()||[-1,1];r[n].geo.setColors((function(r,n,i){var s=t.getVal(r,n,i);return o.color(e.valueToHex(s,a))}))}(),r[n].finished=!1}return this},this.removeSurface=function(e){for(var t=f[e],r=0;r<t.length;r++)t[r]&&t[r].lastGL&&(void 0!==t[r].geo&&t[r].geo.dispose(),void 0!==t[r].mat&&t[r].mat.dispose(),j.remove(t[r].lastGL));return delete f[e],ie(),this},this.removeAllSurfaces=function(){for(var e in f)if(f.hasOwnProperty(e)){for(var t=f[e],r=0;r<t.length;r++)t[r]&&t[r].lastGL&&(void 0!==t[r].geo&&t[r].geo.dispose(),void 0!==t[r].mat&&t[r].mat.dispose(),j.remove(t[r].lastGL));delete f[e]}return ie(),this},this.jmolMoveTo=function(){var e=j.position,t="center { "+-e.x+" "+-e.y+" "+-e.z+" }; ",r=P.quaternion;return t+"moveto .5 quaternion { "+r.x+" "+r.y+" "+r.z+" "+r.w+" };"},this.clear=function(){return this.removeAllSurfaces(),this.removeAllModels(),this.removeAllLabels(),this.removeAllShapes(),ie(),this},this.mapAtomProperties=function(e,t){var r=xe(t=t||{});if("function"==typeof e)for(var n=0,i=r.length;n<i;n++)e(r[n]);else for(var o=0,a=r.length;o<a;o++)for(var s=r[o],l=0,u=e.length;l<u;l++){var c=e[l];if(c.props)for(var f in c.props)c.props.hasOwnProperty(f)&&we(s,c)&&(s.properties||(s.properties={}),s.properties[f]=c.props[f])}return this},this.linkViewer=function(e){return A.push(e),this};try{"function"==typeof r&&r(this)}catch(e){console.log("error with glviewer callback: "+e)}this.getPerceivedDistance=function(){return 150-P.position.z},this.setPerceivedDistance=function(e){P.position.z=150-e},this.setAutoEyeSeparation=function(e){var t=this.getPerceivedDistance();return e||I.position.x>0?I.position.x=t*Math.tan(Math.PI/180*5):I.position.x=-t*Math.tan(Math.PI/180*5),I.lookAt(new $3Dmol.Vector3(0,0,P.position.z)),I.position.x}},$3Dmol.glmolViewer=$3Dmol.GLViewer;var $3Dmol=$3Dmol||{};$3Dmol.Gradient=function(){},$3Dmol.Gradient.valueToHex=function(){},$3Dmol.Gradient.range=function(){},$3Dmol.Gradient.normalizeValue=function(e,t,r){return t>=e?(r<e&&(r=e),r>t&&(r=t),{lo:e,hi:t,val:r}):(r>e&&(r=e),r<t&&(r=t),{lo:t,hi:e,val:r=e-r+t})},$3Dmol.Gradient.RWB=function(e,t,r){void 0===t&&$.isArray(e)&&e.length>=2&&(t=e[1],e=e[0]),this.valueToHex=function(n,i){var o,a;if(n*=1,i?(o=i[0],a=i[1]):(o=e,a=t),void 0===n)return 16777215;var s=$3Dmol.Gradient.normalizeValue(o,a,n);o=s.lo;var l,u=a=s.hi;return(n=s.val)<=(u=i&&void 0!==i[2]?i[2]:void 0!==r?r:(o+a)/2)?16711680+256*(l=Math.floor(255*Math.sqrt((n-o)/(u-o))))+l:65536*(l=Math.floor(255*Math.sqrt(1-(n-u)/(a-u))))+256*l+255},this.range=function(){return void 0!==e&&void 0!==t?[e,t]:null}},$3Dmol.Gradient.ROYGB=function(e,t){void 0===t&&$.isArray(e)&&e.length>=2&&(t=e[1],e=e[0]),this.valueToHex=function(r,n){var i,o;if(r*=1,n?(i=n[0],o=n[1]):(i=e,o=t),void 0===r)return 16777215;var a=$3Dmol.Gradient.normalizeValue(i,o,r),s=((i=a.lo)+(o=a.hi))/2,l=(i+s)/2,u=(s+o)/2;return(r=a.val)<l?16711680+256*Math.floor(255*Math.sqrt((r-i)/(l-i)))+0:r<s?65536*Math.floor(255*Math.sqrt(1-(r-l)/(s-l)))+65280+0:r<u?65280+1*Math.floor(255*Math.sqrt((r-s)/(u-s))):0+256*Math.floor(255*Math.sqrt(1-(r-u)/(o-u)))+255},this.range=function(){return void 0!==e&&void 0!==t?[e,t]:null}},$3Dmol.Gradient.Sinebow=function(e,t){var r=1;void 0===t&&$.isArray(e)&&e.length>=2&&(t=e[1],e=e[0]),t<e&&(r=-1,e*=-1,t*=-1),this.valueToHex=function(n,i){var o,a;if(n*=r,i?(o=i[0],a=i[1]):(o=e,a=t),void 0===n)return 16777215;var s=$3Dmol.Gradient.normalizeValue(o,a,n);o=s.lo,a=s.hi;var l=((n=s.val)-o)/(a-o)*5/6+.5,u=Math.sin(Math.PI*l);u*=255*u;var c=Math.sin(Math.PI*(l+1/3));c*=255*c;var f=Math.sin(Math.PI*(l+2/3));return f*=255*f,65536*Math.floor(u)+256*Math.floor(f)+1*Math.floor(c)},this.range=function(){return void 0!==e&&void 0!==t?[e,t]:null}},$3Dmol.Gradient.builtinGradients={rwb:$3Dmol.Gradient.RWB,roygb:$3Dmol.Gradient.ROYGB,sinebow:$3Dmol.Gradient.Sinebow},$3Dmol.LabelCount=0,$3Dmol.Label=function(e,t){this.id=$3Dmol.LabelCount++,this.stylespec=t||{},this.canvas=document.createElement("canvas"),this.canvas.width=134,this.canvas.height=35,this.context=this.canvas.getContext("2d"),this.sprite=new $3Dmol.Sprite,this.text=e,this.frame=this.stylespec.frame},$3Dmol.Label.prototype={constructor:$3Dmol.Label,getStyle:function(){return this.stylespec},setContext:function(){var e=function(e,t,r){var n=r;return void 0!==e&&(e instanceof $3Dmol.Color?n=e.scaled():void 0!==(n=$3Dmol.CC.color(e)).scaled&&(n=n.scaled())),void 0!==t&&(n.a=parseFloat(t)),n};return function(){var t=this.stylespec,r=void 0!==t.useScreen&&t.useScreen,n=t.showBackground;"0"!==n&&"false"!==n||(n=!1),void 0===n&&(n=!0);var i=t.font?t.font:"sans-serif",o=parseInt(t.fontSize)?parseInt(t.fontSize):18,a=e(t.fontColor,t.fontOpacity,{r:255,g:255,b:255,a:1}),s=t.padding?t.padding:4,l=t.borderThickness?t.borderThickness:0,u=e(t.backgroundColor,t.backgroundOpacity,{r:0,g:0,b:0,a:1}),c=e(t.borderColor,t.borderOpacity,u),f=t.position?t.position:{x:-10,y:1,z:1},h=void 0===t.inFront||t.inFront;"false"!==h&&"0"!==h||(h=!1);var p=t.alignment||$3Dmol.SpriteAlignment.topLeft;"string"==typeof p&&p in $3Dmol.SpriteAlignment&&(p=$3Dmol.SpriteAlignment[p]);var d="";t.bold&&(d="bold "),this.context.font=d+o+"px  "+i;var m=this.context.measureText(this.text).width;n||(l=0);var v=m+2.5*l+2*s,g=1.25*o+2*l+2*s;if(t.backgroundImage){var y=t.backgroundImage,b=t.backgroundWidth?t.backgroundWidth:y.width,x=t.backgroundHeight?t.backgroundHeight:y.height;b>v&&(v=b),x>g&&(g=x)}if(this.canvas.width=v,this.canvas.height=g,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),d="",t.bold&&(d="bold "),this.context.font=d+o+"px  "+i,this.context.fillStyle="rgba("+u.r+","+u.g+","+u.b+","+u.a+")",this.context.strokeStyle="rgba("+c.r+","+c.g+","+c.b+","+c.a+")",this.context.lineWidth=l,n&&function(e,t,r,n,i,o,a){e.beginPath(),e.moveTo(t+6,r),e.lineTo(t+n-6,r),e.quadraticCurveTo(t+n,r,t+n,r+6),e.lineTo(t+n,r+i-6),e.quadraticCurveTo(t+n,r+i,t+n-6,r+i),e.lineTo(t+6,r+i),e.quadraticCurveTo(t,r+i,t,r+i-6),e.lineTo(t,r+6),e.quadraticCurveTo(t,r,t+6,r),e.closePath(),e.fill(),a&&e.stroke()}(this.context,l,l,v-2*l,g-2*l,0,l>0),t.backgroundImage){var w=t.backgroundImage,_=t.backgroundWidth?t.backgroundWidth:w.width,D=t.backgroundHeight?t.backgroundHeight:w.height;this.context.drawImage(w,0,0,_,D)}this.context.fillStyle="rgba("+a.r+","+a.g+","+a.b+","+a.a+")",this.context.fillText(this.text,l+s,o+l+s,m);var A=new $3Dmol.Texture(this.canvas);A.needsUpdate=!0,this.sprite.material=new $3Dmol.SpriteMaterial({map:A,useScreenCoordinates:r,alignment:p,depthTest:!h}),this.sprite.scale.set(1,1,1),this.sprite.position.set(f.x,f.y,f.z)}}(),dispose:function(){void 0!==this.sprite.material.map&&this.sprite.material.map.dispose(),void 0!==this.sprite.material&&this.sprite.material.dispose()}},$3Dmol=$3Dmol||{},$3Dmol.MarchingCubeInitializer=function(){var e,t,r,n,i={march:function(i,o,a,s){var l,u=!!s.fulltable,c=s.hasOwnProperty("origin")&&s.origin.hasOwnProperty("x")?s.origin:{x:0,y:0,z:0},f=!!s.voxel,h=s.matrix,p=s.nX||0,d=s.nY||0,m=s.nZ||0,v=s.scale||1;l=s.unitCube?s.unitCube:{x:v,y:v,z:v};var g,y,b=new Int32Array(p*d*m);for(g=0,y=b.length;g<y;++g)b[g]=-1;var x=function(e,t,r,n,i,a){var s={x:0,y:0,z:0},u=i;!(n&1<<i)&&!!(n&1<<a)&&(u=a),1&u&&r++,2&u&&t++,4&u&&e++,h?s={x:(s=(s=new $3Dmol.Vector3(e,t,r)).applyMatrix4(h)).x,y:s.y,z:s.z}:(s.x=c.x+l.x*e,s.y=c.y+l.y*t,s.z=c.z+l.z*r);var p=(d*e+t)*m+r;return f?(o.push(s),o.length-1):(b[p]<0&&(b[p]=o.length,o.push(s)),b[p])},w=new Int32Array(12),_=u?t:e,D=u?n:r;for(g=0;g<p-1;++g)for(var A=0;A<d-1;++A)for(var C=0;C<m-1;++C){for(var S=0,E=0;E<8;++E)S|=!!(2&i[(d*(g+((4&E)>>2))+A+((2&E)>>1))*m+C+(1&E)])<<E;if(0!==S&&255!==S){var T=_[S];if(0!==T){var M=D[S];1&T&&(w[0]=x(g,A,C,S,0,1)),2&T&&(w[1]=x(g,A,C,S,1,3)),4&T&&(w[2]=x(g,A,C,S,3,2)),8&T&&(w[3]=x(g,A,C,S,2,0)),16&T&&(w[4]=x(g,A,C,S,4,5)),32&T&&(w[5]=x(g,A,C,S,5,7)),64&T&&(w[6]=x(g,A,C,S,7,6)),128&T&&(w[7]=x(g,A,C,S,6,4)),256&T&&(w[8]=x(g,A,C,S,0,4)),512&T&&(w[9]=x(g,A,C,S,1,5)),1024&T&&(w[10]=x(g,A,C,S,3,7)),2048&T&&(w[11]=x(g,A,C,S,2,6));for(var $=0;$<M.length;$+=3){var z=w[M[$]],L=w[M[$+1]],k=w[M[$+2]];f&&$>=3&&(o.push(o[z]),z=o.length-1,o.push(o[L]),L=o.length-1,o.push(o[k]),k=o.length-1),a.push(z),a.push(L),a.push(k)}}}}},laplacianSmooth:function(e,t,r){var n,i,o,a,s,l=new Array(t.length);for(n=0,i=t.length;n<i;n++)l[n]={x:0,y:0,z:0};var u,c=new Array(20);for(n=0;n<20;n++)c[n]=new Array(t.length);for(n=0,i=t.length;n<i;n++)c[0][n]=0;for(n=0,i=r.length/3;n<i;n++){var f=3*n,h=3*n+1,p=3*n+2;for(u=!0,o=0,a=c[0][r[f]];o<a;o++)if(r[h]==c[o+1][r[f]]){u=!1;break}for(u&&(c[0][r[f]]++,c[c[0][r[f]]][r[f]]=r[h]),u=!0,o=0,a=c[0][r[f]];o<a;o++)if(r[p]==c[o+1][r[f]]){u=!1;break}for(u&&(c[0][r[f]]++,c[c[0][r[f]]][r[f]]=r[p]),u=!0,o=0,a=c[0][r[h]];o<a;o++)if(r[f]==c[o+1][r[h]]){u=!1;break}for(u&&(c[0][r[h]]++,c[c[0][r[h]]][r[h]]=r[f]),u=!0,o=0,a=c[0][r[h]];o<a;o++)if(r[p]==c[o+1][r[h]]){u=!1;break}for(u&&(c[0][r[h]]++,c[c[0][r[h]]][r[h]]=r[p]),u=!0,o=0;o<c[0][r[p]];o++)if(r[f]==c[o+1][r[p]]){u=!1;break}for(u&&(c[0][r[p]]++,c[c[0][r[p]]][r[p]]=r[f]),u=!0,o=0,a=c[0][r[p]];o<a;o++)if(r[h]==c[o+1][r[p]]){u=!1;break}u&&(c[0][r[p]]++,c[c[0][r[p]]][r[p]]=r[h])}for(s=0;s<e;s++){for(n=0,i=t.length;n<i;n++)if(c[0][n]<3)l[n].x=t[n].x,l[n].y=t[n].y,l[n].z=t[n].z;else if(3==c[0][n]||4==c[0][n]){for(l[n].x=0,l[n].y=0,l[n].z=0,o=0,a=c[0][n];o<a;o++)l[n].x+=t[c[o+1][n]].x,l[n].y+=t[c[o+1][n]].y,l[n].z+=t[c[o+1][n]].z;l[n].x+=.5*t[n].x,l[n].y+=.5*t[n].y,l[n].z+=.5*t[n].z,l[n].x/=.5+c[0][n],l[n].y/=.5+c[0][n],l[n].z/=.5+c[0][n]}else{for(l[n].x=0,l[n].y=0,l[n].z=0,o=0,a=c[0][n];o<a;o++)l[n].x+=t[c[o+1][n]].x,l[n].y+=t[c[o+1][n]].y,l[n].z+=t[c[o+1][n]].z;l[n].x+=1*t[n].x,l[n].y+=1*t[n].y,l[n].z+=1*t[n].z,l[n].x/=1+c[0][n],l[n].y/=1+c[0][n],l[n].z/=1+c[0][n]}for(n=0,i=t.length;n<i;n++)t[n].x=l[n].x,t[n].y=l[n].y,t[n].z=l[n].z}},edgeTable:[0,0,0,0,0,0,0,2816,0,0,0,1792,0,3328,3584,3840,0,0,0,138,0,21,0,134,0,0,0,652,0,2067,3865,3600,0,0,0,42,0,0,0,294,0,0,21,28,0,3875,1049,3360,0,168,162,170,0,645,2475,2210,0,687,293,172,4010,3747,3497,3232,0,0,0,0,0,69,0,900,0,0,0,1792,138,131,1608,1920,0,81,0,2074,84,85,84,86,0,81,0,3676,330,1105,1881,1616,0,0,0,42,0,69,0,502,0,0,21,3580,138,2035,1273,1520,2816,104,2337,106,840,581,367,102,2816,3695,3429,3180,1898,1635,1385,1120,0,0,0,0,0,0,0,3910,0,0,69,588,42,2083,41,2880,0,0,0,1722,0,2293,4095,3830,0,255,757,764,2538,2291,3065,2800,0,0,81,338,0,3925,1119,3414,84,855,85,340,2130,2899,89,2384,1792,712,194,1162,4036,3781,3535,3270,708,719,197,204,3018,2755,2505,2240,0,0,0,0,168,420,168,1958,162,162,676,2988,170,163,680,928,3328,3096,3328,3642,52,53,1855,1590,2340,2111,2869,2620,298,51,825,560,3584,3584,3090,3482,1668,1941,1183,1430,146,2975,2069,2460,154,915,153,400,3840,3592,3329,3082,1796,1541,1295,1030,2818,2575,2309,2060,778,515,265,0]};return e=new Uint32Array(i.edgeTable),r=i.triTable=[[],[],[],[],[],[],[],[11,9,8],[],[],[],[8,10,9],[],[10,8,11],[9,11,10],[8,10,9,8,11,10],[],[],[],[1,7,3],[],[4,2,0],[],[2,1,7],[],[],[],[2,7,3,2,9,7],[],[1,4,11,1,0,4],[3,8,0,11,9,4,11,10,9],[4,11,9,11,10,9],[],[],[],[5,3,1],[],[],[],[2,5,8,2,1,5],[],[],[2,4,0],[3,2,4],[],[0,9,1,8,10,5,8,11,10],[3,4,0,3,10,4],[5,8,10,8,11,10],[],[3,5,7],[7,1,5],[1,7,3,1,5,7],[],[9,2,0,9,7,2],[0,3,8,1,7,11,1,5,7],[11,1,7,1,5,7],[],[9,1,0,5,3,2,5,7,3],[8,2,5,8,0,2],[2,5,3,5,7,3],[3,9,1,3,8,9,7,11,10,7,10,5],[9,1,0,10,7,11,10,5,7],[3,8,0,7,10,5,7,11,10],[11,5,7,11,10,5],[],[],[],[],[],[0,6,2],[],[7,2,9,7,9,8],[],[],[],[8,10,9],[7,1,3],[7,1,0],[6,9,3,6,10,9],[7,10,8,10,9,8],[],[6,0,4],[],[11,1,4,11,3,1],[2,4,6],[2,0,4,2,4,6],[2,4,6],[1,4,2,4,6,2],[],[6,0,4],[],[2,11,3,6,9,4,6,10,9],[8,6,1,8,1,3],[10,0,6,0,4,6],[8,0,3,9,6,10,9,4,6],[10,4,6,10,9,4],[],[],[],[5,3,1],[],[0,6,2],[],[7,4,8,5,2,1,5,6,2],[],[],[2,4,0],[7,4,8,2,11,3,10,5,6],[7,1,3],[5,6,10,0,9,1,8,7,4],[5,6,10,7,0,3,7,4,0],[10,5,6,4,8,7],[9,11,8],[3,5,6],[0,5,11,0,11,8],[6,3,5,3,1,5],[3,9,6,3,8,9],[9,6,0,6,2,0],[0,3,8,2,5,6,2,1,5],[1,6,2,1,5,6],[9,11,8],[1,0,9,6,10,5,11,3,2],[6,10,5,2,8,0,2,11,8],[3,2,11,10,5,6],[10,5,6,9,3,8,9,1,3],[0,9,1,5,6,10],[8,0,3,10,5,6],[10,5,6],[],[],[],[],[],[],[],[1,10,2,9,11,6,9,8,11],[],[],[6,0,2],[3,6,9,3,2,6],[3,5,1],[0,5,1,0,11,5],[0,3,5],[6,9,11,9,8,11],[],[],[],[4,5,9,7,1,10,7,3,1],[],[11,6,7,2,4,5,2,0,4],[11,6,7,8,0,3,1,10,2,9,4,5],[6,7,11,1,10,2,9,4,5],[],[4,1,0,4,5,1,6,7,3,6,3,2],[9,4,5,0,6,7,0,2,6],[4,5,9,6,3,2,6,7,3],[6,7,11,5,3,8,5,1,3],[6,7,11,4,1,0,4,5,1],[4,5,9,3,8,0,11,6,7],[9,4,5,7,11,6],[],[],[0,6,4],[8,6,4,8,1,6],[],[0,10,2,0,9,10,4,8,11,4,11,6],[10,2,1,6,0,3,6,4,0],[10,2,1,11,4,8,11,6,4],[4,2,6],[1,0,9,2,4,8,2,6,4],[2,4,0,2,6,4],[8,2,4,2,6,4],[11,4,1,11,6,4],[0,9,1,4,11,6,4,8,11],[3,6,0,6,4,0],[8,6,4,8,11,6],[10,8,9],[6,3,9,6,7,3],[6,7,1],[10,7,1,7,3,1],[7,11,6,8,10,2,8,9,10],[11,6,7,10,0,9,10,2,0],[2,1,10,7,11,6,8,0,3],[1,10,2,6,7,11],[7,2,6,7,9,2],[1,0,9,3,6,7,3,2,6],[7,0,6,0,2,6],[2,7,3,2,6,7],[7,11,6,3,9,1,3,8,9],[9,1,0,11,6,7],[0,3,8,11,6,7],[11,6,7],[],[],[],[],[5,3,7],[8,5,2,8,7,5],[5,3,7],[1,10,2,5,8,7,5,9,8],[1,7,5],[1,7,5],[9,2,7,9,7,5],[11,3,2,8,5,9,8,7,5],[1,3,7,1,7,5],[0,7,1,7,5,1],[9,3,5,3,7,5],[9,7,5,9,8,7],[8,10,11],[3,4,10,3,10,11],[8,10,11],[5,9,4,1,11,3,1,10,11],[2,4,5],[5,2,4,2,0,4],[0,3,8,5,9,4,10,2,1],[2,1,10,9,4,5],[2,8,5,2,11,8],[3,2,11,1,4,5,1,0,4],[9,4,5,8,2,11,8,0,2],[11,3,2,9,4,5],[8,5,3,5,1,3],[5,0,4,5,1,0],[3,8,0,4,5,9],[9,4,5],[11,9,10],[11,9,10],[1,11,4,1,10,11],[8,7,4,11,1,10,11,3,1],[2,7,9,2,9,10],[4,8,7,0,10,2,0,9,10],[2,1,10,0,7,4,0,3,7],[10,2,1,8,7,4],[1,7,4],[3,2,11,4,8,7,9,1,0],[11,4,2,4,0,2],[2,11,3,7,4,8],[4,1,7,1,3,7],[1,0,9,8,7,4],[3,4,0,3,7,4],[8,7,4],[8,9,10,8,10,11],[3,9,11,9,10,11],[0,10,8,10,11,8],[10,3,1,10,11,3],[2,8,10,8,9,10],[9,2,0,9,10,2],[8,0,3,1,10,2],[10,2,1],[1,11,9,11,8,9],[11,3,2,0,9,1],[11,0,2,11,8,0],[11,3,2],[8,1,3,8,9,1],[9,1,0],[8,0,3],[]],t=[0,265,515,778,2060,2309,2575,2822,1030,1295,1541,1804,3082,3331,3593,3840,400,153,915,666,2460,2197,2975,2710,1430,1183,1941,1692,3482,3219,3993,3728,560,825,51,314,2620,2869,2111,2358,1590,1855,1077,1340,3642,3891,3129,3376,928,681,419,170,2988,2725,2479,2214,1958,1711,1445,1196,4010,3747,3497,3232,2240,2505,2755,3018,204,453,719,966,3270,3535,3781,4044,1226,1475,1737,1984,2384,2137,2899,2650,348,85,863,598,3414,3167,3925,3676,1370,1107,1881,1616,2800,3065,2291,2554,764,1013,255,502,3830,4095,3317,3580,1786,2035,1273,1520,2912,2665,2403,2154,876,613,367,102,3942,3695,3429,3180,1898,1635,1385,1120,1120,1385,1635,1898,3180,3429,3695,3942,102,367,613,876,2154,2403,2665,2912,1520,1273,2035,1786,3580,3317,4095,3830,502,255,1013,764,2554,2291,3065,2800,1616,1881,1107,1370,3676,3925,3167,3414,598,863,85,348,2650,2899,2137,2384,1984,1737,1475,1226,4044,3781,3535,3270,966,719,453,204,3018,2755,2505,2240,3232,3497,3747,4010,1196,1445,1711,1958,2214,2479,2725,2988,170,419,681,928,3376,3129,3891,3642,1340,1077,1855,1590,2358,2111,2869,2620,314,51,825,560,3728,3993,3219,3482,1692,1941,1183,1430,2710,2975,2197,2460,666,915,153,400,3840,3593,3331,3082,1804,1541,1295,1030,2822,2575,2309,2060,778,515,265,0],n=[[],[8,3,0],[9,0,1],[8,3,1,8,1,9],[11,2,3],[11,2,0,11,0,8],[11,2,3,0,1,9],[2,1,11,1,9,11,11,9,8],[10,1,2],[8,3,0,1,2,10],[9,0,2,9,2,10],[3,2,8,2,10,8,8,10,9],[10,1,3,10,3,11],[1,0,10,0,8,10,10,8,11],[0,3,9,3,11,9,9,11,10],[8,10,9,8,11,10],[8,4,7],[3,0,4,3,4,7],[1,9,0,8,4,7],[9,4,1,4,7,1,1,7,3],[2,3,11,7,8,4],[7,11,4,11,2,4,4,2,0],[3,11,2,4,7,8,9,0,1],[2,7,11,2,1,7,1,4,7,1,9,4],[10,1,2,8,4,7],[2,10,1,0,4,7,0,7,3],[4,7,8,0,2,10,0,10,9],[2,7,3,2,9,7,7,9,4,2,10,9],[8,4,7,11,10,1,11,1,3],[11,4,7,1,4,11,1,11,10,1,0,4],[3,8,0,7,11,4,11,9,4,11,10,9],[7,11,4,4,11,9,11,10,9],[9,5,4],[3,0,8,4,9,5],[5,4,0,5,0,1],[4,8,5,8,3,5,5,3,1],[11,2,3,9,5,4],[9,5,4,8,11,2,8,2,0],[3,11,2,1,5,4,1,4,0],[8,5,4,2,5,8,2,8,11,2,1,5],[2,10,1,9,5,4],[0,8,3,5,4,9,10,1,2],[10,5,2,5,4,2,2,4,0],[3,4,8,3,2,4,2,5,4,2,10,5],[5,4,9,1,3,11,1,11,10],[0,9,1,4,8,5,8,10,5,8,11,10],[3,4,0,3,10,4,4,10,5,3,11,10],[4,8,5,5,8,10,8,11,10],[9,5,7,9,7,8],[0,9,3,9,5,3,3,5,7],[8,0,7,0,1,7,7,1,5],[1,7,3,1,5,7],[11,2,3,8,9,5,8,5,7],[9,2,0,9,7,2,2,7,11,9,5,7],[0,3,8,2,1,11,1,7,11,1,5,7],[2,1,11,11,1,7,1,5,7],[1,2,10,5,7,8,5,8,9],[9,1,0,10,5,2,5,3,2,5,7,3],[5,2,10,8,2,5,8,5,7,8,0,2],[10,5,2,2,5,3,5,7,3],[3,9,1,3,8,9,7,11,10,7,10,5],[9,1,0,10,7,11,10,5,7],[3,8,0,7,10,5,7,11,10],[11,5,7,11,10,5],[11,7,6],[0,8,3,11,7,6],[9,0,1,11,7,6],[7,6,11,3,1,9,3,9,8],[2,3,7,2,7,6],[8,7,0,7,6,0,0,6,2],[1,9,0,3,7,6,3,6,2],[7,6,2,7,2,9,2,1,9,7,9,8],[1,2,10,6,11,7],[2,10,1,7,6,11,8,3,0],[11,7,6,10,9,0,10,0,2],[7,6,11,3,2,8,8,2,10,8,10,9],[6,10,7,10,1,7,7,1,3],[6,10,1,6,1,7,7,1,0,7,0,8],[9,0,3,6,9,3,6,10,9,6,3,7],[6,10,7,7,10,8,10,9,8],[8,4,6,8,6,11],[11,3,6,3,0,6,6,0,4],[0,1,9,4,6,11,4,11,8],[1,9,4,11,1,4,11,3,1,11,4,6],[3,8,2,8,4,2,2,4,6],[2,0,4,2,4,6],[1,9,0,3,8,2,2,8,4,2,4,6],[9,4,1,1,4,2,4,6,2],[10,1,2,11,8,4,11,4,6],[10,1,2,11,3,6,6,3,0,6,0,4],[0,2,10,0,10,9,4,11,8,4,6,11],[2,11,3,6,9,4,6,10,9],[8,4,6,8,6,1,6,10,1,8,1,3],[1,0,10,10,0,6,0,4,6],[8,0,3,9,6,10,9,4,6],[10,4,6,10,9,4],[9,5,4,7,6,11],[4,9,5,3,0,8,11,7,6],[6,11,7,4,0,1,4,1,5],[6,11,7,4,8,5,5,8,3,5,3,1],[4,9,5,6,2,3,6,3,7],[9,5,4,8,7,0,0,7,6,0,6,2],[4,0,1,4,1,5,6,3,7,6,2,3],[7,4,8,5,2,1,5,6,2],[6,11,7,1,2,10,9,5,4],[11,7,6,8,3,0,1,2,10,9,5,4],[11,7,6,10,5,2,2,5,4,2,4,0],[7,4,8,2,11,3,10,5,6],[4,9,5,6,10,7,7,10,1,7,1,3],[5,6,10,0,9,1,8,7,4],[5,6,10,7,0,3,7,4,0],[10,5,6,4,8,7],[5,6,9,6,11,9,9,11,8],[0,9,5,0,5,3,3,5,6,3,6,11],[0,1,5,0,5,11,5,6,11,0,11,8],[11,3,6,6,3,5,3,1,5],[9,5,6,3,9,6,3,8,9,3,6,2],[5,6,9,9,6,0,6,2,0],[0,3,8,2,5,6,2,1,5],[1,6,2,1,5,6],[1,2,10,5,6,9,9,6,11,9,11,8],[1,0,9,6,10,5,11,3,2],[6,10,5,2,8,0,2,11,8],[3,2,11,10,5,6],[10,5,6,9,3,8,9,1,3],[0,9,1,5,6,10],[8,0,3,10,5,6],[10,5,6],[10,6,5],[8,3,0,10,6,5],[0,1,9,5,10,6],[10,6,5,9,8,3,9,3,1],[3,11,2,10,6,5],[6,5,10,2,0,8,2,8,11],[1,9,0,6,5,10,11,2,3],[1,10,2,5,9,6,9,11,6,9,8,11],[1,2,6,1,6,5],[0,8,3,2,6,5,2,5,1],[5,9,6,9,0,6,6,0,2],[9,6,5,3,6,9,3,9,8,3,2,6],[11,6,3,6,5,3,3,5,1],[0,5,1,0,11,5,5,11,6,0,8,11],[0,5,9,0,3,5,3,6,5,3,11,6],[5,9,6,6,9,11,9,8,11],[10,6,5,4,7,8],[5,10,6,7,3,0,7,0,4],[5,10,6,0,1,9,8,4,7],[4,5,9,6,7,10,7,1,10,7,3,1],[7,8,4,2,3,11,10,6,5],[11,6,7,10,2,5,2,4,5,2,0,4],[11,6,7,8,0,3,1,10,2,9,4,5],[6,7,11,1,10,2,9,4,5],[7,8,4,5,1,2,5,2,6],[4,1,0,4,5,1,6,7,3,6,3,2],[9,4,5,8,0,7,0,6,7,0,2,6],[4,5,9,6,3,2,6,7,3],[6,7,11,4,5,8,5,3,8,5,1,3],[6,7,11,4,1,0,4,5,1],[4,5,9,3,8,0,11,6,7],[9,4,5,7,11,6],[10,6,4,10,4,9],[8,3,0,9,10,6,9,6,4],[1,10,0,10,6,0,0,6,4],[8,6,4,8,1,6,6,1,10,8,3,1],[2,3,11,6,4,9,6,9,10],[0,10,2,0,9,10,4,8,11,4,11,6],[10,2,1,11,6,3,6,0,3,6,4,0],[10,2,1,11,4,8,11,6,4],[9,1,4,1,2,4,4,2,6],[1,0,9,3,2,8,2,4,8,2,6,4],[2,4,0,2,6,4],[3,2,8,8,2,4,2,6,4],[1,4,9,11,4,1,11,1,3,11,6,4],[0,9,1,4,11,6,4,8,11],[11,6,3,3,6,0,6,4,0],[8,6,4,8,11,6],[6,7,10,7,8,10,10,8,9],[9,3,0,6,3,9,6,9,10,6,7,3],[6,1,10,6,7,1,7,0,1,7,8,0],[6,7,10,10,7,1,7,3,1],[7,11,6,3,8,2,8,10,2,8,9,10],[11,6,7,10,0,9,10,2,0],[2,1,10,7,11,6,8,0,3],[1,10,2,6,7,11],[7,2,6,7,9,2,2,9,1,7,8,9],[1,0,9,3,6,7,3,2,6],[8,0,7,7,0,6,0,2,6],[2,7,3,2,6,7],[7,11,6,3,9,1,3,8,9],[9,1,0,11,6,7],[0,3,8,11,6,7],[11,6,7],[11,7,5,11,5,10],[3,0,8,7,5,10,7,10,11],[9,0,1,10,11,7,10,7,5],[3,1,9,3,9,8,7,10,11,7,5,10],[10,2,5,2,3,5,5,3,7],[5,10,2,8,5,2,8,7,5,8,2,0],[9,0,1,10,2,5,5,2,3,5,3,7],[1,10,2,5,8,7,5,9,8],[2,11,1,11,7,1,1,7,5],[0,8,3,2,11,1,1,11,7,1,7,5],[9,0,2,9,2,7,2,11,7,9,7,5],[11,3,2,8,5,9,8,7,5],[1,3,7,1,7,5],[8,7,0,0,7,1,7,5,1],[0,3,9,9,3,5,3,7,5],[9,7,5,9,8,7],[4,5,8,5,10,8,8,10,11],[3,0,4,3,4,10,4,5,10,3,10,11],[0,1,9,4,5,8,8,5,10,8,10,11],[5,9,4,1,11,3,1,10,11],[3,8,4,3,4,2,2,4,5,2,5,10],[10,2,5,5,2,4,2,0,4],[0,3,8,5,9,4,10,2,1],[2,1,10,9,4,5],[8,4,5,2,8,5,2,11,8,2,5,1],[3,2,11,1,4,5,1,0,4],[9,4,5,8,2,11,8,0,2],[11,3,2,9,4,5],[4,5,8,8,5,3,5,1,3],[5,0,4,5,1,0],[3,8,0,4,5,9],[9,4,5],[7,4,11,4,9,11,11,9,10],[3,0,8,7,4,11,11,4,9,11,9,10],[11,7,4,1,11,4,1,10,11,1,4,0],[8,7,4,11,1,10,11,3,1],[2,3,7,2,7,9,7,4,9,2,9,10],[4,8,7,0,10,2,0,9,10],[2,1,10,0,7,4,0,3,7],[10,2,1,8,7,4],[2,11,7,2,7,1,1,7,4,1,4,9],[3,2,11,4,8,7,9,1,0],[7,4,11,11,4,2,4,0,2],[2,11,3,7,4,8],[9,1,4,4,1,7,1,3,7],[1,0,9,8,7,4],[3,4,0,3,7,4],[8,7,4],[8,9,10,8,10,11],[0,9,3,3,9,11,9,10,11],[1,10,0,0,10,8,10,11,8],[10,3,1,10,11,3],[3,8,2,2,8,10,8,9,10],[9,2,0,9,10,2],[8,0,3,1,10,2],[10,2,1],[2,11,1,1,11,9,11,8,9],[11,3,2,0,9,1],[11,0,2,11,8,0],[11,3,2],[8,1,3,8,9,1],[9,1,0],[8,0,3],[]],i},$3Dmol.MarchingCube=$3Dmol.MarchingCubeInitializer(),$3Dmol.Parsers=function(){var e={},t={H:.37,He:.32,Li:1.34,Be:.9,B:.82,C:.77,N:.75,O:.73,F:.71,Ne:.69,Na:1.54,Mg:1.3,Al:1.18,Si:1.11,P:1.06,S:1.02,Cl:.99,Ar:.97,K:1.96,Ca:1.74,Sc:1.44,Ti:1.56,V:1.25,Mn:1.39,Fe:1.25,Co:1.26,Ni:1.21,Cu:1.38,Zn:1.31,Ga:1.26,Ge:1.22,Se:1.16,Br:1.14,Kr:1.1,Rb:2.11,Sr:1.92,Y:1.62,Zr:1.48,Nb:1.37,Mo:1.45,Tc:1.56,Ru:1.26,Rh:1.35,Pd:1.31,Ag:1.53,Cd:1.48,In:1.44,Sn:1.41,Sb:1.38,Te:1.35,I:1.33,Xe:1.3,Cs:2.25,Ba:1.98,Lu:1.6,Hf:1.5,Ta:1.38,W:1.46,Re:1.59,Os:1.44,Ir:1.37,Pt:1.28,Au:1.44,Hg:1.49,Tl:1.48,Pb:1.47,Bi:1.46,Rn:1.45},r=function(e){return t[e]||1.6},n=function(e,t){var n=r(e.elem)+r(t.elem);n+=.25,n*=n;var i=e.x-t.x;if((i*=i)>n)return!1;var o=e.y-t.y;if((o*=o)>n)return!1;var a=e.z-t.z;if((a*=a)>n)return!1;var s=i+o+a;return!(isNaN(s)||s<.5||s>n||e.altLoc!=t.altLoc&&" "!=e.altLoc&&" "!=t.altLoc)},i=function(e){for(var t=0,r=e.length;t<r;t++)e[t].index||(e[t].index=t);for(var i={},o=0;o<e.length;o++){var a=e[o],s=Math.floor(a.x/4.95),l=Math.floor(a.y/4.95),u=Math.floor(a.z/4.95);i[s]||(i[s]={}),i[s][l]||(i[s][l]={}),i[s][l][u]||(i[s][l][u]=[]),i[s][l][u].push(a)}var c=function(e,t){for(var r=0;r<e.length;r++)for(var i=e[r],o=0;o<t.length;o++){var a=t[o];if(n(i,a)){var s=i.bonds.indexOf(a.index),l=a.bonds.indexOf(i.index);-1==s&&-1==l?(i.bonds.push(a.index),i.bondOrder.push(1),a.bonds.push(i.index),a.bondOrder.push(1)):-1==s?(i.bonds.push(a.index),i.bondOrder.push(a.bondOrder[l])):-1==l&&(a.bonds.push(i.index),a.bondOrder.push(i.bondOrder[s]))}}},f=[{x:0,y:0,z:1},{x:0,y:1,z:-1},{x:0,y:1,z:0},{x:0,y:1,z:1},{x:1,y:-1,z:-1},{x:1,y:-1,z:0},{x:1,y:-1,z:1},{x:1,y:0,z:-1},{x:1,y:0,z:0},{x:1,y:0,z:1},{x:1,y:1,z:-1},{x:1,y:1,z:0},{x:1,y:1,z:1}];for(var h in i)for(var p in i[h=parseInt(h)])for(var d in p=parseInt(p),i[h][p]){d=parseInt(d);for(var m=i[h][p][d],v=0;v<m.length;v++)for(var g=m[v],y=v+1;y<m.length;y++){var b=m[y];n(g,b)&&-1==g.bonds.indexOf(b.index)&&(g.bonds.push(b.index),g.bondOrder.push(1),b.bonds.push(g.index),b.bondOrder.push(1))}for(var x=0;x<f.length;x++){var w=f[x];i[h+w.x]&&i[h+w.x][p+w.y]&&i[h+w.x][p+w.y][d+w.z]&&c(m,i[h+w.x][p+w.y][d+w.z])}}},o=function(e){var t,r,o=[],a=[];for(t=0,r=e.length;t<r;t++){var s=e[t];s.index=t,s.hetflag?a.push(s):o.push(s)}i(a),o.sort((function(e,t){return e.chain!=t.chain?e.chain<t.chain?-1:1:e.resi-t.resi}));var l,u=-1,c=-1;for(t=0,r=o.length;t<r;t++){var f=o[t];f.resi!==u&&(u=f.resi,l||c++,l=!1),f.reschain=c;for(var h=t+1;h<o.length;h++){var p=o[h];if(p.chain!=f.chain)break;if(p.resi-f.resi>1)break;n(f,p)&&(-1===f.bonds.indexOf(p.index)&&(f.bonds.push(p.index),f.bondOrder.push(1),p.bonds.push(f.index),p.bondOrder.push(1)),f.resi!==p.resi&&(l=!0))}}},a=function(e){!function(e){var t,r,n,i=[];for(t=0,n=e.length;t<n;t++){e[t].index=t;var o=e[t];o.hetflag||"N"!==o.atom&&"O"!==o.atom||(i.push(o),o.hbondOther=null,o.hbondDistanceSq=Number.POSITIVE_INFINITY)}for(i.sort((function(e,t){return e.z-t.z})),t=0,n=i.length;t<n;t++){var a=i[t];for(r=t+1;r<n;r++){var s=i[r],l=s.z-a.z;if(l>3.2)break;if(s.atom!=a.atom){var u=Math.abs(s.y-a.y);if(!(u>3.2)){var c=Math.abs(s.x-a.x);if(!(c>3.2)){var f=c*c+u*u+l*l;f>10.24||s.chain==a.chain&&Math.abs(s.resi-a.resi)<4||(f<a.hbondDistanceSq&&(a.hbondOther=s,a.hbondDistanceSq=f),f<s.hbondDistanceSq&&(s.hbondOther=a,s.hbondDistanceSq=f))}}}}}}(e);var t,r,n,i,o,a,s={};for(t=0,r=e.length;t<r;t++)if(void 0===s[(o=e[t]).chain]&&(s[o.chain]=[]),isFinite(o.hbondDistanceSq)){var l=o.hbondOther;void 0===s[l.chain]&&(s[l.chain]=[]),4===Math.abs(l.resi-o.resi)&&(s[o.chain][o.resi]="h")}for(n in s)for(i=1;i<s[n].length-1;i++){var u=s[n][i-1],c=s[n][i+1];a=s[n][i],"h"==u&&u==c&&a!=u&&(s[n][i]=u)}for(t=0,r=e.length;t<r;t++)o=e[t],isFinite(o.hbondDistanceSq)&&"h"!=s[o.chain][o.resi]&&"h"!=o.ss&&(s[o.chain][o.resi]="maybesheet");for(var f=0,h=e.length;f<h;f++)if(o=e[f],isFinite(o.hbondDistanceSq)&&"maybesheet"==s[o.chain][o.resi]){var p=o.hbondOther,d=s[p.chain][p.resi];"maybesheet"!=d&&"s"!=d||(s[o.chain][o.resi]="s",s[p.chain][p.resi]="s")}for(var m in s){for(var v=1;v<s[m].length-1;v++){var g=s[m][v-1],y=s[m][v+1];a=s[m][v],"s"==g&&g==y&&a!=g&&(s[m][v]=g)}for(var b=0;b<s[m].length;b++){var x=s[m][b];"h"!=x&&"s"!=x||s[m][b-1]!=x&&s[m][b+1]!=x&&delete s[m][b]}}for(t=0,r=e.length;t<r;t++)a=s[(o=e[t]).chain][o.resi],delete o.hbondOther,delete o.hbondDistanceSq,void 0!==a&&"maybesheet"!=a&&(o.ss=a,s[o.chain][o.resi-1]!=a&&(o.ssbegin=!0),s[o.chain][o.resi+1]!=a&&(o.ssend=!0))},s=function(e,t,r){var n,i,o,a=r.length,s=a;if(t){if(e.length>1)for(n=0;n<r.length;n++){var l=[];for(i=0;i<e.length;i++)if(!e[i].isIdentity()){var u=new $3Dmol.Vector3;u.set(r[n].x,r[n].y,r[n].z),u.applyMatrix4(e[i]),l.push(u)}r[n].symmetries=l}}else for(n=0;n<e.length;n++)if(!e[n].isIdentity()){var c=new $3Dmol.Vector3;for(o=0;o<a;o++){var f=[];for(i=0;i<r[o].bonds.length;i++)f.push(r[o].bonds[i]+s);c.set(r[o].x,r[o].y,r[o].z),c.applyMatrix4(e[n]);var h={};for(var p in r[o])h[p]=r[o][p];h.x=c.x,h.y=c.y,h.z=c.z,h.bonds=f,r.push(h)}s=r.length}};e.vasp=e.VASP=function(e){var t=[[]],r={},n=e.replace(/^\s+/,"").split(/[\n\r]/);if(n.length<3)return t;if(!n[1].match(/\d+/))return console.log("Warning: second line of the vasp structure file must be a number"),t;if(r.length=parseFloat(n[1]),r.length<0)return console.log("Warning: Vasp implementation for negative lattice lengths is not yet available"),t;r.xVec=new Float32Array(n[2].replace(/^\s+/,"").split(/\s+/)),r.yVec=new Float32Array(n[3].replace(/^\s+/,"").split(/\s+/)),r.zVec=new Float32Array(n[4].replace(/^\s+/,"").split(/\s+/));var i=new $3Dmol.Matrix4(r.xVec[0],r.xVec[1],r.xVec[2],0,r.yVec[0],r.yVec[1],r.yVec[2],0,r.zVec[0],r.zVec[1],r.zVec[2],0,0,0,0,1);i.multiplyScalar(r.length),t.modelData=[{symmetries:[],cryst:{matrix:i}}];var o=n[5].replace(/\s+/,"").replace(/\s+$/,"").split(/\s+/),a=new Int16Array(n[6].replace(/^\s+/,"").split(/\s+/)),s=n[7].replace(/\s+/,"");if(s.match(/C/))s="cartesian";else{if(!s.match(/D/))return console.log("Warning: Unknown vasp mode in POSCAR file: mode must be either C(artesian) or D(irect)"),t;s="direct"}if(o.length!=a.length)return console.log("Warning: declaration of atomary species wrong:"),console.log(o),console.log(a),t;n.splice(0,8);for(var l=0,u=0,c=o.length;u<c;u++){for(var f=o[u],h=0,p=a[u];h<p;h++){var d=new Float32Array(n[l+h].replace(/^\s+/,"").split(/\s+/)),m={};m.elem=f,"cartesian"==s?(m.x=r.length*d[0],m.y=r.length*d[1],m.z=r.length*d[2]):(m.x=r.length*(d[0]*r.xVec[0]+d[1]*r.yVec[0]+d[2]*r.zVec[0]),m.y=r.length*(d[0]*r.xVec[1]+d[1]*r.yVec[1]+d[2]*r.zVec[1]),m.z=r.length*(d[0]*r.xVec[2]+d[1]*r.yVec[2]+d[2]*r.zVec[2])),m.bonds=[],t[0].push(m)}l+=a[u]}return t},e.cube=e.CUBE=function(e){var t=[[]],r=e.replace(/^\s+/,"").split(/\n\r|\r+/);if(r.length<6)return t;var n=r[2].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),o=Math.abs(parseFloat(n[0]));n=r[3].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");var a=parseFloat(n[0])>0?.529177:1;r=r.splice(6,o);for(var s=t[t.length-1].length,l=s+r.length,u=s;u<l;++u){var c={};c.serial=u;var f=r[u-s].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");6==f[0]?c.elem="C":1==f[0]?c.elem="H":8==f[0]?c.elem="O":17==f[0]&&(c.elem="Cl"),c.x=parseFloat(f[2])*a,c.y=parseFloat(f[3])*a,c.z=parseFloat(f[4])*a,c.hetflag=!0,c.bonds=[],c.bondOrder=[],c.properties={},t[t.length-1].push(c)}for(var h=0;h<t.length;h++)i(t[h]);return t},e.xyz=e.XYZ=function(e,t){for(var r=[[]],n=e.split(/\r?\n|\r/);n.length>0&&!(n.length<3);){var o=parseInt(n[0]);if(isNaN(o)||o<=0)break;if(n.length<o+2)break;for(var a=2,s=r[r.length-1].length,l=s+o,u=s;u<l;u++){var c=n[a++].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),f={};f.serial=u;var h=c[0];f.atom=f.elem=h[0].toUpperCase()+h.substr(1).toLowerCase(),f.x=parseFloat(c[1]),f.y=parseFloat(c[2]),f.z=parseFloat(c[3]),f.hetflag=!0,f.bonds=[],f.bondOrder=[],f.properties={},r[r.length-1][u]=f,c.length>=7&&(f.dx=parseFloat(c[4]),f.dy=parseFloat(c[5]),f.dz=parseFloat(c[6]))}if(!t.multimodel)break;r.push([]),n.splice(0,a)}for(var p=0;p<r.length;p++)i(r[p]);if(t.onemol){var d=r;(r=[]).push(d[0]);for(var m=1;m<d.length;m++)for(var v=r[0].length,g=0;g<d[m].length;g++){for(var y=d[m][g],b=0;b<y.bonds.length;b++)y.bonds[b]=y.bonds[b]+v;y.index=r[0].length,y.serial=r[0].length,r[0].push(y)}}return r},e.sdf=e.SDF=function(e,t){var r="V2000",n=e.split(/\r?\n|\r/);return n.length>3&&n[3].length>38&&(r=n[3].substr(34,5)),"V2000"===r?function(e,t){var r=[[]],n=!1;for(void 0!==t.keepH&&(n=!t.keepH);e.length>0&&!(e.length<4);){var i=parseInt(e[3].substr(0,3));if(isNaN(i)||i<=0)break;var o=parseInt(e[3].substr(3,3)),a=4;if(e.length<4+i+o)break;var s,l,u=[],c=r[r.length-1].length,f=c+i;for(s=c;s<f;s++,a++){var h={},p=(l=e[a]).substr(31,3).replace(/ /g,"");h.atom=h.elem=p[0].toUpperCase()+p.substr(1).toLowerCase(),"H"===h.elem&&n||(h.serial=s,u[s]=r[r.length-1].length,h.x=parseFloat(l.substr(0,10)),h.y=parseFloat(l.substr(10,10)),h.z=parseFloat(l.substr(20,10)),h.hetflag=!0,h.bonds=[],h.bondOrder=[],h.properties={},h.index=r[r.length-1].length,r[r.length-1].push(h))}for(s=0;s<o;s++,a++){l=e[a];var d=u[parseInt(l.substr(0,3))-1+c],m=u[parseInt(l.substr(3,3))-1+c],v=parseInt(l.substr(6,3));void 0!==d&&void 0!==m&&(r[r.length-1][d].bonds.push(m),r[r.length-1][d].bondOrder.push(v),r[r.length-1][m].bonds.push(d),r[r.length-1][m].bondOrder.push(v))}if(!t.multimodel)break;for(t.onemol||r.push([]);"$$$$"!==e[a];)a++;e.splice(0,++a)}return r}(n,t):"V3000"===r?function(e,t){var r=[[]],n=!1;for(void 0!==t.keepH&&(n=!t.keepH);e.length>0&&!(e.length<8)&&e[4].startsWith("M  V30 BEGIN CTAB")&&e[5].startsWith("M  V30 COUNTS")&&!(e[5].length<14);){var i=e[5].substr(13).match(/\S+/g);if(i.length<2)break;var o=parseInt(i[0]);if(isNaN(o)||o<=0)break;var a=parseInt(i[1]),s=7;if(e.length<8+o+a)break;var l,u=[],c=r[r.length-1].length,f=c+o;for(l=c;l<f;l++,s++){var h=e[s].substr(6).match(/\S+/g);if(h.length>4){var p={},d=h[1].replace(/ /g,"");p.atom=p.elem=d[0].toUpperCase()+d.substr(1).toLowerCase(),"H"===p.elem&&n||(p.serial=l,u[l]=r[r.length-1].length,p.x=parseFloat(h[2]),p.y=parseFloat(h[3]),p.z=parseFloat(h[4]),p.hetflag=!0,p.bonds=[],p.bondOrder=[],p.properties={},p.index=r[r.length-1].length,r[r.length-1].push(p))}}if("M  V30 END ATOM"!==e[s])break;if(s++,0===a||"M  V30 BEGIN BOND"!==e[s])break;for(s++,l=0;l<a;l++,s++){var m=e[s].substr(6).match(/\S+/g);if(m.length>3){var v=u[parseInt(m[2])-1+c],g=u[parseInt(m[3])-1+c],y=parseInt(m[1]);void 0!==v&&void 0!==g&&(r[r.length-1][v].bonds.push(g),r[r.length-1][v].bondOrder.push(y),r[r.length-1][g].bonds.push(v),r[r.length-1][g].bondOrder.push(y))}}if(!t.multimodel)break;for(t.onemol||r.push([]);"$$$$"!==e[s];)s++;e.splice(0,++s)}return r}(n,t):[[]]},e.cdjson=e.json=function(e,t){var r=[[]];"string"==typeof e&&(e=JSON.parse(e));for(var n=e.m,i=n[0].a,o=n[0].b,a=n[0].s,s=void 0!==t&&void 0!==t.parseStyle?t.parseStyle:void 0!==a,l=r[r.length-1].length,u=0;u<i.length;u++){var c=i[u],f={};f.id=c.i,f.x=c.x,f.y=c.y,f.z=c.z||0,f.bonds=[],f.bondOrder=[];var h=c.l||"C";f.elem=h[0].toUpperCase()+h.substr(1).toLowerCase(),f.serial=r[r.length-1].length,s&&(f.style=a[c.s||0]),r[r.length-1].push(f)}for(var p=0;p<o.length;p++){var d=o[p],m=d.b+l,v=d.e+l,g=d.o||1,y=r[r.length-1][m],b=r[r.length-1][v];y.bonds.push(v),y.bondOrder.push(g),b.bonds.push(m),b.bondOrder.push(g)}return r},e.mcif=e.cif=function(e,t){var r=[],n=!t.doAssembly,o=!t.duplicateAssemblyAtoms,l=r.modelData=[];function u(e,t){for(var r=[],n=0,i=0;i<e.length;){for(;e.substr(i,t.length)!==t&&i<e.length;){if("'"===e[i])for(i++;i<e.length&&"'"!==e[i];)i++;else if('"'===e[i])for(i++;i<e.length&&'"'!==e[i];)i++;i++}r.push(e.substr(n,i-n)),n=i+=t.length}return r}for(var c=e.split(/\r?\n|\r/),f=[],h=!1,p=0;p<c.length;p++){var d=c[p].split("#")[0];if(h?";"===d[0]&&(h=!1):";"===d[0]&&(h=!0),h||""!==d){if(!h&&"_"===(d=d.trim())[0]){var m=d.split(/\s/)[0].indexOf(".");m>-1&&(d[m]="_",d=d.substr(0,m)+"_"+d.substr(m+1))}f.push(d)}}for(var v=0;v<f.length;){for(;!f[v].startsWith("data_")||"data_global"===f[v];)v++;v++;for(var g={};v<f.length&&!f[v].startsWith("data_");)if(void 0===f[v][0])v++;else if("_"===f[v][0]){var y=f[v].split(/\s/)[0].toLowerCase(),b=g[y]=g[y]||[],x=f[v].substr(f[v].indexOf(y)+y.length);if(""===x)if(";"===f[++v][0]){var w=f[v].substr(1);for(v++;";"!==f[v];)w=w+"\n"+f[v],v++;b.push(w)}else b.push(f[v]);else b.push(x.trim());v++}else if("loop_"===f[v].substr(0,5)){v++;for(var _=[];""===f[v]||"_"===f[v][0];){if(""!==f[v]){var D=f[v].split(/\s/)[0].toLowerCase(),A=g[D]=g[D]||[];_.push(A)}v++}for(var C=0;v<f.length&&"_"!==f[v][0]&&!f[v].startsWith("loop_")&&!f[v].startsWith("data_");){for(var S=u(f[v]," "),E=0;E<S.length;E++)""!==S[E]&&(_[C].push(S[E]),C=(C+1)%_.length);v++}}else v++;l.push({symmetries:[]}),r.push([]);var T,M=void 0!==g._atom_site_id?g._atom_site_id.length:g._atom_site_label.length,$=function(e){return e*e};if(void 0!==g._cell_length_a){var z=parseFloat(g._cell_length_a),L=parseFloat(g._cell_length_b),k=parseFloat(g._cell_length_c),I=parseFloat(g._cell_angle_alpha)||90,R=parseFloat(g._cell_angle_beta)||90,O=parseFloat(g._cell_angle_gamma)||90,F=I*Math.PI/180,N=R*Math.PI/180,P=O*Math.PI/180,j=Math.cos(F),B=Math.cos(N),U=Math.cos(P),V=Math.sin(P);T=[[z,L*U,k*B],[0,L*V,k*(j-B*U)/V],[0,0,k*Math.sqrt(1-$(j)-$(B)-$(U)+2*j*B*U)/V]],l[l.length-1].cryst={a:z,b:L,c:k,alpha:I,beta:R,gamma:O}}for(var q=function(e,t,r,n){return{x:e[0][0]*t+e[0][1]*r+e[0][2]*n,y:e[1][0]*t+e[1][1]*r+e[1][2]*n,z:e[2][0]*t+e[2][1]*r+e[2][2]*n}},G=0;G<M;G++)if(void 0===g._atom_site_group_pdb||"TER"!==g._atom_site_group_pdb[G]){var H={};if(void 0!==g._atom_site_cartn_x)H.x=parseFloat(g._atom_site_cartn_x[G]),H.y=parseFloat(g._atom_site_cartn_y[G]),H.z=parseFloat(g._atom_site_cartn_z[G]);else{var W=q(T,parseFloat(g._atom_site_fract_x[G]),parseFloat(g._atom_site_fract_y[G]),parseFloat(g._atom_site_fract_z[G]));H.x=W.x,H.y=W.y,H.z=W.z}H.chain=g._atom_site_auth_asym_id?g._atom_site_auth_asym_id[G]:void 0,H.resi=g._atom_site_auth_seq_id?parseInt(g._atom_site_auth_seq_id[G]):void 0,H.resn=g._atom_site_auth_comp_id?g._atom_site_auth_comp_id[G].trim():void 0,H.atom=g._atom_site_auth_atom_id?g._atom_site_auth_atom_id[G].replace(/"/gm,""):void 0,H.hetflag=!g._atom_site_group_pdb||"HETA"===g._atom_site_group_pdb[G]||"HETATM"===g._atom_site_group_pdb[G];var Y=g._atom_site_type_symbol[G];H.elem=Y[0].toUpperCase()+Y.substr(1).toLowerCase(),H.bonds=[],H.ss="c",H.serial=G,H.bondOrder=[],H.properties={},r[r.length-1].push(H)}if(void 0!==g._pdbx_struct_oper_list_id&&!n){for(var X=0;X<g._pdbx_struct_oper_list_id.length;X++){var K=parseFloat(g["_pdbx_struct_oper_list_matrix[1][1]"][X]),Z=parseFloat(g["_pdbx_struct_oper_list_matrix[1][2]"][X]),Q=parseFloat(g["_pdbx_struct_oper_list_matrix[1][3]"][X]),J=parseFloat(g["_pdbx_struct_oper_list_vector[1]"][X]),ee=parseFloat(g["_pdbx_struct_oper_list_matrix[2][1]"][X]),te=parseFloat(g["_pdbx_struct_oper_list_matrix[2][2]"][X]),re=parseFloat(g["_pdbx_struct_oper_list_matrix[2][3]"][X]),ne=parseFloat(g["_pdbx_struct_oper_list_vector[2]"][X]),ie=parseFloat(g["_pdbx_struct_oper_list_matrix[3][1]"][X]),oe=parseFloat(g["_pdbx_struct_oper_list_matrix[3][2]"][X]),ae=parseFloat(g["_pdbx_struct_oper_list_matrix[3][3]"][X]),se=parseFloat(g["_pdbx_struct_oper_list_vector[3]"][X]),le=new $3Dmol.Matrix4(K,Z,Q,J,ee,te,re,ne,ie,oe,ae,se);l[l.length-1].symmetries.push(le)}for(var ue=0;ue<r.length;ue++)s(l[l.length-1].symmetries,o,r[ue])}var ce=function(e){var t,r=e.match("-"),n=(e=e.replace(/[-xyz]/g,"")).split("/");return t=void 0===n[1]?1:parseInt(n[1]),(""===n[0]?1:parseInt(n[0]))/t*(r?-1:1)};if(void 0!==g._symmetry_equiv_pos_as_xyz)for(var fe=0;fe<g._symmetry_equiv_pos_as_xyz.length;fe++){for(var he=g._symmetry_equiv_pos_as_xyz[fe].replace(/["' ]/g,"").split(",").map((function(e){return e.replace(/-/g,"+-")})),pe=new $3Dmol.Matrix4(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1),de=0;de<3;de++)for(var me=he[de].split("+"),ve=0;ve<me.length;ve++){var ge=me[ve];if(""!==ge){var ye=ce(ge);ge.match("x")?pe.elements[de+0]=ye:ge.match("y")?pe.elements[de+4]=ye:ge.match("z")?pe.elements[de+8]=ye:pe.elements[de+12]=ye}}var be=new $3Dmol.Matrix4(T[0][0],T[0][1],T[0][2],0,T[1][0],T[1][1],T[1][2],0,T[2][0],T[2][1],T[2][2],0),xe=(new $3Dmol.Matrix4).getInverse(be,!0);pe=(new $3Dmol.Matrix4).multiplyMatrices(pe,xe),pe=(new $3Dmol.Matrix4).multiplyMatrices(be,pe),l[l.length-1].symmetries.push(pe)}}for(var we=0;we<r.length;we++)i(r[we]),a(r[we]),s(l[we].symmetries,o,r[we]);return r},e.mol2=e.MOL2=function(e,t){var r=[[]],n=!1;void 0!==t.keepH&&(n=!t.keepH);var i=e.search(/@<TRIPOS>MOLECULE/),o=e.search(/@<TRIPOS>ATOM/);if(-1==i||-1==o)return r;for(var a=e.substr(i,e.length).split(/\r?\n|\r/);a.length>0;){var s=[],l=a[2].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),u=parseInt(l[0]),c=0;l.length>1&&(c=parseInt(l[1]));var f,h=4;for(f=3;f<a.length;f++)if("@<TRIPOS>ATOM"==a[f]){h=f+1;break}var p=r[r.length-1].length,d=p+u;for(f=p;f<d;f++){var m={},v=(l=a[h++].replace(/^\s+/,"").replace(/\s+/g," ").split(" "))[5].split(".")[0];if(m.atom=m.elem=v[0].toUpperCase()+v.substr(1).toLowerCase(),"H"==m.elem&&n);else{var g=r[r.length-1].length,y=parseInt(l[0]);m.serial=y,m.x=parseFloat(l[2]),m.y=parseFloat(l[3]),m.z=parseFloat(l[4]),m.atom=l[5];var b=parseFloat(l[8]);m.index=g,m.bonds=[],m.bondOrder=[],m.properties={charge:b,partialCharge:b},s[y]=g,r[r.length-1].push(m)}}for(var x=!1;h<a.length;)if("@<TRIPOS>BOND"==a[h++]){x=!0;break}if(x&&c)for(f=0;f<c;f++){l=a[h++].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");var w=parseInt(l[1]),_=r[r.length-1][s[w]],D=parseInt(l[2]),A=r[r.length-1][s[D]],C=parseInt(l[3]);isNaN(C)&&(C=1),void 0!==_&&void 0!==A&&(_.bonds.push(s[D]),_.bondOrder.push(C),A.bonds.push(s[w]),A.bondOrder.push(C))}if(!t.multimodel)break;t.onemol||r.push([]),a.splice(0,h),e=a.join("\n")}return r};var l=function(e,r){var n=e.replace(/ /g,"");return n.length>0&&"H"==n[0]&&"Hg"!=n&&(n="H"),n.length>1&&(n=n[0].toUpperCase()+n.substr(1).toLowerCase(),void 0===t[n]?n=n[0]:r&&("Ca"==n?n="C":"Cd"==n&&(n="C"))),n},u=function(e,r,n){for(var i,u,c=[],f=!r.keepH,h=!!r.noSecondaryStructure,p=!r.noComputeSecondaryStructure,d=!r.doAssembly,m=!r.duplicateAssemblyAtoms,v=r.altLoc?r.altLoc:"A",g={symmetries:[]},y=[],b=[],x={},w=0;w<e.length;w++){var _,D,A,C=(u=e[w].replace(/^\s*/,"")).substr(0,6);if(0==C.indexOf("END")){if(y=e.slice(w+1),"END"==C)for(var S in n)n.hasOwnProperty(S)&&delete n[S];break}if("ATOM  "==C||"HETATM"==C){var E,T,M,$,z,L,k,I,R,O,F,N;if(" "!=(F=u.substr(16,1))&&F!=v&&"*"!=v)continue;if(O=parseInt(u.substr(6,5)),i=u.substr(12,4).replace(/ /g,""),E=u.substr(17,3).replace(/ /g,""),T=u.substr(21,1),M=parseInt(u.substr(22,4)),$=u.substr(26,1),z=parseFloat(u.substr(30,8)),L=parseFloat(u.substr(38,8)),k=parseFloat(u.substr(46,8)),N=parseFloat(u.substr(60,8)),"H"==(R=""===(R=u.substr(76,2).replace(/ /g,""))||void 0===t[R]?l(u.substr(12,2),"A"==u[0]):R[0].toUpperCase()+R.substr(1).toLowerCase())&&f)continue;I="H"==C[0],b[O]=c.length,c.push({resn:E,x:z,y:L,z:k,elem:R,hetflag:I,altLoc:F,chain:T,resi:M,icode:$,rescode:M+(" "!=$?"^"+$:""),serial:O,atom:i,bonds:[],ss:"c",bondOrder:[],properties:{},b:N,pdbline:u})}else if("SHEET "==C){_=u.substr(21,1),D=parseInt(u.substr(22,4)),u.substr(32,1),A=parseInt(u.substr(33,4)),_ in n||(n[_]={}),n[_][D]="s1";for(var P=D+1;P<A;P++)n[_][P]="s";n[_][A]="s2"}else if("CONECT"==C)for(var j=b[parseInt(u.substr(6,5))],B=c[j],U=[11,16,21,26],V=0;V<4;V++){var q=b[parseInt(u.substr(U[V],5))],G=c[q];if(void 0!==B&&void 0!==G)if(x[[j,q]]){x[[j,q]]+=1;for(var H=0;H<B.bonds.length;H++)if(B.bonds[H]==q){var W=x[[j,q]];B.bondOrder[H]=W>=4?1:W}}else x[[j,q]]=1,0!=B.bonds.length&&B.bonds[B.bonds.length-1]==q||(B.bonds.push(q),B.bondOrder.push(1))}else if("HELIX "==C){_=u.substr(19,1),D=parseInt(u.substr(21,4)),u.substr(31,1),A=parseInt(u.substr(33,4)),_ in n||(n[_]={}),n[_][D]="h1";for(var Y=D+1;Y<A;Y++)n[_][Y]="h";n[_][A]="h2"}else if(d||"REMARK"!=C||"BIOMT"!=u.substr(13,5)){if("CRYST1"==C){var X,K,Z,Q,J,ee;X=parseFloat(u.substr(7,8)),K=parseFloat(u.substr(16,8)),Z=parseFloat(u.substr(25,8)),Q=parseFloat(u.substr(34,6)),J=parseFloat(u.substr(41,6)),ee=parseFloat(u.substr(48,6)),g.cryst={a:X,b:K,c:Z,alpha:Q,beta:J,gamma:ee}}else if("ANISOU"==C){var te=c[b[parseInt(u.substr(6,5))]];if(te){var re=u.substr(30).trim().split(/\s+/),ne={u11:parseInt(re[0]),u22:parseInt(re[1]),u33:parseInt(re[2]),u12:parseInt(re[3]),u13:parseInt(re[4]),u23:parseInt(re[5])};te.uMat=ne}}}else{var ie,oe=new $3Dmol.Matrix4;for(ie=1;ie<=3;ie++)if(u=e[w].replace(/^\s*/,""),parseInt(u.substr(18,1))==ie)oe.elements[ie-1]=parseFloat(u.substr(23,10)),oe.elements[ie-1+4]=parseFloat(u.substr(33,10)),oe.elements[ie-1+8]=parseFloat(u.substr(43,10)),oe.elements[ie-1+12]=parseFloat(u.substr(53)),w++;else for(;"BIOMT"==u.substr(13,5);)u=e[++w].replace(/^\s*/,"");oe.elements[3]=0,oe.elements[7]=0,oe.elements[11]=0,oe.elements[15]=1,g.symmetries.push(oe),w--}}if((new Date).getTime(),function(e,t){for(var r=0,n=e.length;r<n;r++)for(var i=e[r],o=0;o<i.bonds.length;o++){var a=e[i.bonds[o]],s=t[i.serial];a&&s&&a.bonds.indexOf(s)<0&&(a.bonds.push(s),a.bondOrder.push(i.bondOrder[o]))}}(c,b),o(c),d||s(g.symmetries,m,c),p&&!h&&((new Date).getTime(),a(c)),(new Date).getTime(),!function(e){var t;for(t in e)return!1;return!0}(n))for(var ae=0;ae<c.length;ae++)if(void 0!==(i=c[ae])&&i.chain in n&&i.resi in n[i.chain]){var se=n[i.chain][i.resi];i.ss=se[0],se.length>1&&("1"==se[1]?i.ssbegin=!0:"2"==se[1]&&(i.ssend=!0))}return[c,g,y]};e.pdb=e.PDB=e.pdbqt=e.PDBQT=function(e,t){var r=[],n={};r.modelData=[];for(var i=e.split(/\r?\n|\r/);i.length>0;){var o=u(i,t,n),a=o[0],s=o[1];if(i=o[2],0!=a.length){if(t.multimodel&&t.onemol&&r.length>0)for(var l=r[0].length,c=0;c<a.length;c++){var f=a[c];f.index=c;for(var h=0;h<f.bonds.length;h++)f.bonds[h]+=l;r[0].push(f)}else r.modelData.push(s),r.push(a);if(!t.multimodel)break}}return r},e.pqr=e.PQR=function(e,t){var r=[[]],n=!t.noSecondaryStructure;r.modelData=[{symmetries:[]}];for(var i,s=[],l=e.split(/\r?\n|\r/),u=0;u<l.length;u++){var c=(i=l[u].replace(/^\s*/,"")).substr(0,6);if(0==c.indexOf("END")){if(t.multimodel){t.onemol||r.push([]);continue}break}if("ATOM  "==c||"HETATM"==c){var f,h=parseInt(i.substr(6,5)),p=i.substr(12,4).replace(/ /g,""),d=i.substr(17,3),m=i.substr(21,1),v=parseInt(i.substr(22,4)),g=i.substr(30).trim().split(/\s+/),y=parseFloat(g[0]),b=parseFloat(g[1]),x=parseFloat(g[2]),w=parseFloat(g[3]),_=parseFloat(g[4]),D=p[0];p.length>1&&p[1].toUpperCase()!=p[1]&&(D=p.substr(0,2)),f="H"==i[0],s[h]=r[r.length-1].length,r[r.length-1].push({resn:d,x:y,y:b,z:x,elem:D,hetflag:f,chain:m,resi:v,serial:h,atom:p,bonds:[],ss:"c",bondOrder:[],properties:{charge:w,partialCharge:w,radius:_},pdbline:i})}else if("CONECT"==c)for(var A=parseInt(i.substr(6,5)),C=r[r.length-1][s[A]],S=0;S<4;S++){var E=parseInt(i.substr([11,16,21,26][S],5)),T=r[r.length-1][s[E]];void 0!==C&&void 0!==T&&(C.bonds.push(s[E]),C.bondOrder.push(1))}}for(var M=0;M<r.length;M++)o(r[M]),n&&a(r[M]);return r};var c=function(e){return String.fromCharCode.apply(null,e).replace(/\0/g,"")},f=function(e){return 0==e||2==e||4==e?"h":3==e?"s":"c"};return e.mmtf=e.MMTF=function(e,t){var r=!t.keepH,n=t.altLoc?t.altLoc:"A",i=!!t.noSecondaryStructure,o=!t.noComputeSecondaryStructure,l=!t.doAssembly,u=!t.duplicateAssemblyAtoms,h=t.assemblyIndex?t.assemblyIndex:0;"string"==typeof e&&(e=$3Dmol.base64ToArray(e));var p,d,m,v,g,y,b=MMTF.decode(e),x=[[]],w=x.modelData=[],_=0,D=0,A=0,C=0,S=b.secStructList,E=b.insCodeList,T=b.sequenceIndexList,M=b.bFactorList,$=b.altLocList,z=b.occupancyList,L=b.bondAtomList,k=b.bondOrderList,I=b.numModels;if(0==I)return x;t.multimodel||(I=1);var R=[];if(!l&&b.bioAssemblyList&&b.bioAssemblyList.length>0){var O=b.bioAssemblyList[h].transformList;for(p=0,y=O.length;p<y;p++){var F=new $3Dmol.Matrix4(O[p].matrix);F.transpose(),R.push(F)}}var N=null;if(b.unitCell){var P=b.unitCell;N={a:P[0],b:P[1],c:P[2],alpha:P[3],beta:P[4],gamma:P[5]}}var j=0;for(g=0;g<I;g++){var B=b.chainsPerModel[g],U=x[x.length-1],V=[];for(w.push({symmetries:R,cryst:N}),p=0;p<B;++p){var q=b.groupsPerChain[D],G=c(b.chainIdList.subarray(4*D,4*D+4));b.chainNameList&&(G=c(b.chainNameList.subarray(4*D,4*D+4)));var H=A,W="";for(d=0;d<q;++d){var Y=b.groupList[b.groupTypeList[A]],X=Y.atomNameList.length,K=0,Z=!1,Q=!1;if(S){K=S[A];var J=f(K);0!=A&&J==W||(Z=!0),W=J;var ee=A+1;(ee>=S.length||f(S[ee]!=J))&&(Q=!0)}b.insCodeList&&String.fromCharCode(E[A]),T&&T[A];var te=b.groupIdList[A],re=Y.groupName,ne=C;for(m=0;m<X;++m){var ie=Y.elementList[m];if(r&&"H"==ie)C+=1;else{var oe="";M&&(oe=M[C]);var ae="";$&&$[C]&&(ae=String.fromCharCode($[C]));var se="";if(z&&(se=z[C]),""==ae||ae==n||"*"==n){var le=b.atomIdList[C],ue=Y.atomNameList[m],ce=0;Y.atomChargeList&&(ce=Y.atomChargeList[m]);var fe=b.xCoordList[C],he=b.yCoordList[C],pe=b.zCoordList[C];V[C]=U.length,U.push({resn:re,x:fe,y:he,z:pe,elem:ie,hetflag:K<0,chain:G,resi:te,icode:ae,rescode:te+(" "!=ae?"^"+ae:""),serial:le,altLoc:ae,index:C,atom:ue,bonds:[],ss:f(K),ssbegin:Z,ssend:Q,bondOrder:[],properties:{charge:ce,occupancy:se},b:oe}),C+=1}else C+=1}}var de=Y.bondAtomList;for(m=0,v=Y.bondOrderList.length;m<v;++m){var me=ne+de[2*m],ve=ne+de[2*m+1],ge=Y.bondOrderList[m],ye=V[me],be=V[ve],xe=U[ye],we=U[be];xe&&we&&(xe.bonds.push(be),xe.bondOrder.push(ge),we.bonds.push(ye),we.bondOrder.push(ge))}A+=1}for(A=H,d=0;d<q;++d)A+=1;D+=1}if(L)for(var _e=j,De=L.length;_e<De;_e+=2){var Ae=L[_e],Ce=L[_e+1],Se=k?k[_e/2]:1;if(Ae>=C){j=_e;break}var Ee=V[Ae],Te=V[Ce],Me=U[Ee],$e=U[Te];Me&&$e&&(Me.bonds.push(Te),Me.bondOrder.push(Se),$e.bonds.push(Ee),$e.bondOrder.push(Se))}if(t.multimodel&&(t.onemol||x.push([])),!l)for(var ze=0;ze<x.length;ze++)s(w[_].symmetries,u,x[ze]);_+=1}return o&&!i&&a(x),x},e.prmtop=e.PRMTOP=function(e){var t,r=[],n=0,i=e.split(/\r?\n|\r/);if(!(i.length>0&&i[0].includes("VERSION")))return[];var o=i.filter((function(e){return e.includes("POINTERS")||e.includes("ATOM_NAME")||e.includes("CHARGE")||e.includes("RADII")||e.includes("BONDS_INC_HYDROGEN")||e.includes("BONDS_WITHOUT_HYDROGEN")})),a=b("POINTERS");if(-1==a)return[];var s=x(a),l=parseInt(i[a+1].slice(0,s[1]));if(isNaN(l)||l<=0)return[];if(-1==(a=b("ATOM_NAME")))return[];for(var u=(s=x(a))[0],c=0;c<l/s[0];c++){c==parseInt(l/s[0])&&(u=l%s[0]);for(var f=0;f<u;f++){var h={};h.serial=n,h.x=0,h.y=0,h.z=0,h.atom=i[a+1].slice(s[1]*f,s[1]*(f+1)),h.elem=i[a+1].slice(s[1]*f,s[1]*f+1),h.properties={charge:"",radii:""},h.bonds=[],h.bondOrder=[],r.push(h),n++}a++}if(-1!=(a=b("CHARGE"))){n=0,u=(s=x(a))[0];for(var p=0;p<l/s[0];p++){p==parseInt(l/s[0])&&(u=l%s[0]);for(var d=0;d<u;d++)r[n].properties.charge=parseFloat(i[a+1].slice(s[1]*d,s[1]*(d+1))),n++;a++}}if(-1!=(a=b("RADII"))){n=0,u=(s=x(a))[0];for(var m=0;m<l/s[0];m++){m==parseInt(l/s[0])&&(u=l%s[0]);for(var v=0;v<u;v++)r[n].properties.radii=parseFloat(i[a+1].slice(s[1]*v,s[1]*(v+1))),n++;a++}}if(-1!=(a=b("BONDS_WITHOUT_HYDROGEN")))for(n=0,u=(s=x(a))[0],a+=1;!i[a].match(/^%FLAG/);){i[a+1].match(/^%FLAG/)&&(u=l%s[0]);for(var g=0;g<u;g++)n%3==0?t=parseInt(i[a].slice(s[1]*g,s[1]*(g+1))/3):n%3==1&&r[t].bonds.push(parseInt(i[a].slice(s[1]*g,s[1]*(g+1))/3)),n++;a++}if(-1!=(a=b("BONDS_INC_HYDROGEN")))for(n=0,u=(s=x(a))[0],a+=1;!i[a].match(/^%FLAG/);){i[a+1].match(/^%FLAG/)&&(u=l%s[0]);for(var y=0;y<u;y++)n%3==0?t=parseInt(i[a].slice(s[1]*y,s[1]*(y+1))/3):n%3==1&&r[t].bonds.push(parseInt(i[a].slice(s[1]*y,s[1]*(y+1))/3)),n++;a++}function b(e){var t=i.indexOf(o.filter((function(t){return t.includes(e)}))[0]);if(Number.isInteger(t)&&t>0){for(;!i[t].includes("FORMAT");)t++;return t}return-1}function x(e){var t=i[e].match(/\((\d*)\S*/),r=i[e].match(/[a-zA-Z](\d*)\)\s*/);return null==r&&(r=i[e].match(/[a-zA-Z](\d*)\.\d*\)\s*/)),[t[1],r[1]]}return[r]},e.gro=e.GRO=function(e){for(var t=[],r=e.split(/\r?\n|\r/);r.length>0&&!(r.length<3);){var n=parseInt(r[1]);if(isNaN(n)||n<=0)break;if(r.length<n+3)break;var i=[];t.push(i);for(var a=2,s=i.length,u=s+n,c=s;c<u;c++){var f=r[a++],h={};h.serial=c,h.atom=f.slice(10,15).trim(),h.elem=l(h.atom,!0),h.x=10*parseFloat(f.slice(20,28)),h.y=10*parseFloat(f.slice(28,36)),h.z=10*parseFloat(f.slice(36,44)),h.resi=parseInt(f.slice(0,5)),h.resn=f.slice(5,10).trim(),h.bonds=[],h.bondOrder=[],h.properties={},f.length>44&&(h.dx=10*parseFloat(f.slice(44,52)),h.dy=10*parseFloat(f.slice(52,60)),h.dz=10*parseFloat(f.slice(60,68))),i[c]=h}if(r.length<=a+3){var p=r[a++].trim().split(/\s+/);if(3==p.length){for(var d=0;d<3;d++)p[d]=10*parseFloat(p[d]);t.box=p}}r.splice(0,++a)}for(var m=0;m<t.length;m++)o(t[m]);return t},e.lammpstrj=e.LAMMPSTRJ=function(e,t){for(var r=[],n={id:"serial",type:"atom",element:"elem",q:"charge",radius:"radius",x:"x",xu:"x",xs:"x",xsu:"x",y:"y",yu:"y",ys:"y",ysu:"y",z:"z",zu:"z",zs:"z",zsu:"z"},o=e.split(/\r?\n|\r/),a=0,s=0,l=0;l<o.length-9;){for(var u=l;u<o.length;u++)if(o[u].match(/ITEM: NUMBER OF ATOMS/)&&(s=parseInt(o[u+1])),o[u].match(/ITEM: ATOMS/)){a=u+1;break}var c=o[a-1].replace("ITEM: ATOMS ","").split(" ");r.push([]);for(var f=a;f<a+s;f++){for(var h={},p={},d=o[f].split(" "),m=0;m<d.length;m++){var v=n[c[m]];null!=v&&("serial"==v?h[v]=parseInt(d[m]):"x"==v||"y"==v||"z"===v?h[v]=parseFloat(d[m]):"charge"==v||"radius"==v?p[v]=parseFloat(d[m]):h[v]=d[m]),h.properties=p,h.bonds=[],h.bondOrder=[]}r[r.length-1][f-a]=h}l=a+s-1}if(t.assignbonds)for(var g=0;g<r.length;g++)i(r[g]);return r},e}();var $3Dmol=$3Dmol||{};$3Dmol.partialCharges={"ALA:N":-.15,"ALA:CA":.1,"ALA:CB":0,"ALA:C":.6,"ALA:O":-.55,"ARG:N":-.15,"ARG:CA":.1,"ARG:CB":0,"ARG:CG":0,"ARG:CD":.1,"ARG:NE":-.1,"ARG:CZ":.5,"ARG:NH1":.25,"ARG:NH2":.25,"ARG:C":.6,"ARG:O":-.55,"ASN:N":-.15,"ASN:CA":.1,"ASN:CB":0,"ASN:CG":.55,"ASN:OD1":-.55,"ASN:ND2":0,"ASN:C":.6,"ASN:O":-.55,"ASP:N":-.15,"ASP:CA":.1,"ASP:CB":0,"ASP:CG":.14,"ASP:OD1":-.57,"ASP:OD2":-.57,"ASP:C":.6,"ASP:O":-.55,"CYS:N":-.15,"CYS:CA":.1,"CYS:CB":.19,"CYS:SG":-.19,"CYS:C":.6,"CYS:O":-.55,"GLN:N":-.15,"GLN:CA":.1,"GLN:CB":0,"GLN:CG":0,"GLN:CD":.55,"GLN:OE1":-.55,"GLN:NE2":0,"GLN:C":.6,"GLN:O":-.55,"GLU:N":-.15,"GLU:CA":.1,"GLU:CB":0,"GLU:CG":0,"GLU:CD":.14,"GLU:OE1":-.57,"GLU:OE2":-.57,"GLU:C":.6,"GLU:O":-.55,"GLY:N":-.15,"GLY:CA":.1,"GLY:C":.6,"GLY:O":-.55,"HIS:N":-.15,"HIS:CA":.1,"HIS:CB":0,"HIS:CG":.1,"HIS:ND1":-.1,"HIS:CD2":.1,"HIS:NE2":-.4,"HIS:CE1":.3,"HIS:C":.6,"HIS:O":-.55,"ILE:N":-.15,"ILE:CA":.1,"ILE:CB":0,"ILE:CG2":0,"ILE:CG1":0,"ILE:CD":0,"ILE:C":.6,"ILE:O":-.55,"LEU:N":-.15,"LEU:CA":.1,"LEU:CB":0,"LEU:CG":0,"LEU:CD1":0,"LEU:CD2":0,"LEU:C":.6,"LEU:O":-.55,"LYS:N":-.15,"LYS:CA":.1,"LYS:CB":0,"LYS:CG":0,"LYS:CD":0,"LYS:CE":.25,"LYS:NZ":.75,"LYS:C":.6,"LYS:O":-.55,"MET:N":-.15,"MET:CA":.1,"MET:CB":0,"MET:CG":.06,"MET:SD":-.12,"MET:CE":.06,"MET:C":.6,"MET:O":-.55,"PHE:N":-.15,"PHE:CA":.1,"PHE:CB":0,"PHE:CG":0,"PHE:CD1":0,"PHE:CD2":0,"PHE:CE1":0,"PHE:CE2":0,"PHE:CZ":0,"PHE:C":.6,"PHE:O":-.55,"PRO:N":-.25,"PRO:CD":.1,"PRO:CA":.1,"PRO:CB":0,"PRO:CG":0,"PRO:C":.6,"PRO:O":-.55,"SER:N":-.15,"SER:CA":.1,"SER:CB":.25,"SER:OG":-.25,"SER:C":.6,"SER:O":-.55,"THR:N":-.15,"THR:CA":.1,"THR:CB":.25,"THR:OG1":-.25,"THR:CG2":0,"THR:C":.6,"THR:O":-.55,"TRP:N":-.15,"TRP:CA":.1,"TRP:CB":0,"TRP:CG":-.03,"TRP:CD2":.1,"TRP:CE2":-.04,"TRP:CE3":-.03,"TRP:CD1":.06,"TRP:NE1":-.06,"TRP:CZ2":0,"TRP:CZ3":0,"TRP:CH2":0,"TRP:C":.6,"TRP:O":-.55,"TYR:N":-.15,"TYR:CA":.1,"TYR:CB":0,"TYR:CG":0,"TYR:CD1":0,"TYR:CE1":0,"TYR:CD2":0,"TYR:CE2":0,"TYR:CZ":.25,"TYR:OH":-.25,"TYR:C":.6,"TYR:O":-.55,"VAL:N":-.15,"VAL:CA":.1,"VAL:CB":0,"VAL:CG1":0,"VAL:CG2":0,"VAL:C":.6,"VAL:O":-.55},$3Dmol.applyPartialCharges=function(e,t){if((!t||void 0===e.partialCharge)&&e.resn&&e.atom){var r=e.resn+":"+e.atom;e.properties.partialCharge=$3Dmol.partialCharges[r]}},$3Dmol.VolumeData=function(e,t,r){if(this.unit={x:1,y:1,z:1},this.origin={x:0,y:0,z:0},this.size={x:0,y:0,z:0},this.data=new Float32Array([]),this.matrix=null,t=t.toLowerCase(),/\.gz$/.test(t)){t=t.replace(/\.gz$/,"");try{e=this[t]&&this[t].isbinary?pako.inflate(e):new TextDecoder("utf-8").decode(pako.inflate(e))}catch(e){console.log(e)}}if(this[t]&&this[t](e),r){if(r.negate)for(var n=0,i=this.data.length;n<i;n++)this.data[n]=-this.data[n];if(r.normalize){for(var o=0,a=0,s=this.data.length;a<s;a++)o+=this.data[a];var l=o/this.data.length;console.log("computed mean: "+l),o=0;for(var u=0,c=this.data.length;u<c;u++){var f=this.data[u]-l;o+=f*f}for(var h=o/this.data.length,p=0,d=this.data.length;p<d;p++)this.data[p]=(this.data[p]-l)/h}}},$3Dmol.VolumeData.prototype.getIndex=function(e,t,r){if(this.matrix){this.inversematrix||(this.inversematrix=(new $3Dmol.Matrix4).getInverse(this.matrix));var n=new $3Dmol.Vector3(e,t,r);e=(n=n.applyMatrix4(this.inversematrix)).x,t=n.y,r=n.z}else e-=this.origin.x,t-=this.origin.y,r-=this.origin.z,e/=this.unit.x,t/=this.unit.y,r/=this.unit.z;return e=Math.round(e),t=Math.round(t),r=Math.round(r),e<0||e>=this.size.x?-1:t<0||t>=this.size.y?-1:r<0||r>=this.size.z?-1:e*this.size.y*this.size.z+t*this.size.z+r},$3Dmol.VolumeData.prototype.getVal=function(e,t,r){var n=this.getIndex(e,t,r);return n<0?0:this.data[n]},$3Dmol.VolumeData.prototype.getCoordinates=function(e){var t=e/(this.size.y*this.size.z),r=e%(this.size.y*this.size.z),n=e%this.size.z;return t*=this.unit.x,r*=this.unit.y,n*=this.unit.z,{x:t+=this.origin.x,y:r+=this.origin.y,z:n+=this.origin.z}},$3Dmol.VolumeData.prototype.vasp=function(e){var t=e.replace(/^\s+/,"").split(/[\n\r]/),r=$3Dmol.Parsers.vasp(e)[0].length;if(0==r)return console.log("No good formating of CHG or CHGCAR file, not atomic information provided in the file."),void(this.data=[]);var n,i=1.889725992,o=parseFloat(t[1]);n=t[2].replace(/^\s+/,"").split(/\s+/);var a=new $3Dmol.Vector3(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2])).multiplyScalar(o*i);n=t[3].replace(/^\s+/,"").split(/\s+/);var s=new $3Dmol.Vector3(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2])).multiplyScalar(o*i);n=t[4].replace(/^\s+/,"").split(/\s+/);var l=new $3Dmol.Vector3(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2])).multiplyScalar(o*i),u=a.x*(s.y*l.z-l.y*s.z)-s.x*(a.y*l.z-l.y*a.z)+l.x*(a.y*s.z-s.y*a.z),c=1/(u=Math.abs(u)/Math.pow(i,3));t.splice(0,8+r+1);var f=t[0].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),h=Math.abs(f[0]),p=Math.abs(f[1]),d=Math.abs(f[2]),m=this.origin=new $3Dmol.Vector3(0,0,0);this.size={x:h,y:p,z:d},this.unit=new $3Dmol.Vector3(a.x,s.y,l.z),a=a.multiplyScalar(1/(i*h)),s=s.multiplyScalar(1/(i*p)),l=l.multiplyScalar(1/(i*d)),0==a.y&&0==a.z&&0==s.x&&0==s.z&&0==l.x&&0==l.y||(this.matrix=new $3Dmol.Matrix4(a.x,s.x,l.x,0,a.y,s.y,l.y,0,a.z,s.z,l.z,0,0,0,0,1),this.matrix=this.matrix.multiplyMatrices(this.matrix,(new $3Dmol.Matrix4).makeTranslation(m.x,m.y,m.z)),this.origin=new $3Dmol.Vector3(0,0,0),this.unit=new $3Dmol.Vector3(1,1,1)),t.splice(0,1);var v=t.join(" ");(v=(v=v.replace(/^\s+/,"")).split(/[\s\r]+/)).splice(h*p*d+1);for(var g=new Float32Array(v),y=0;y<g.length;y++)g[y]=g[y]*c*.036749309;this.data=g},$3Dmol.VolumeData.prototype.dx=function(e){var t,r,n=e.split(/[\n\r]+/),i=/gridpositions\s+counts\s+(\d+)\s+(\d+)\s+(\d+)/,o=/^origin\s+(\S+)\s+(\S+)\s+(\S+)/,a=/^delta\s+(\S+)\s+(\S+)\s+(\S+)/,s=/data follows/;for(t=0;t<n.length;t++){var l=n[t];if(r=i.exec(l)){var u=parseInt(r[1]),c=parseInt(r[2]),f=parseInt(r[3]);this.size={x:u,y:c,z:f}}else if(r=a.exec(l)){var h=parseFloat(r[1]);if(0==parseFloat(r[2])&&0==parseFloat(r[3])||console.log("Non-orthogonal delta matrix not currently supported in dx format"),l=n[t+=1],null==(r=a.exec(l)))return void console.log("Parse error in dx delta matrix");var p=parseFloat(r[2]);if(0==parseFloat(r[1])&&0==parseFloat(r[3])||console.log("Non-orthogonal delta matrix not currently supported in dx format"),l=n[t+=1],null==(r=a.exec(l)))return void console.log("Parse error in dx delta matrix");var d=parseFloat(r[3]);0==parseFloat(r[1])&&0==parseFloat(r[2])||console.log("Non-orthogonal delta matrix not currently supported in dx format"),this.unit=new $3Dmol.Vector3(h,p,d)}else if(r=o.exec(l)){var m=parseFloat(r[1]),v=parseFloat(r[2]),g=parseFloat(r[3]);this.origin=new $3Dmol.Vector3(m,v,g)}else if(r=s.exec(l))break}if(t+=1,this.size&&this.origin&&this.unit&&this.size){var y=n.splice(t).join(" ");y=y.split(/[\s\r]+/),this.data=new Float32Array(y)}else console.log("Error parsing dx format")},$3Dmol.VolumeData.prototype.cube=function(e){var t=e.replace(/^\s+/,"").split(/[\n\r]+/);if(!(t.length<6)){var r=t[2].replace(/^\s+/,"").replace(/\s+/g," ").split(" "),n=parseFloat(r[0]),i=Math.abs(n),o=this.origin=new $3Dmol.Vector3(parseFloat(r[1]),parseFloat(r[2]),parseFloat(r[3])),a=(r=t[3].replace(/^\s+/,"").replace(/\s+/g," ").split(" "))[0]>0?.529177:1;o.multiplyScalar(a);var s=Math.abs(r[0]),l=new $3Dmol.Vector3(parseFloat(r[1]),parseFloat(r[2]),parseFloat(r[3])).multiplyScalar(a);r=t[4].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");var u=Math.abs(r[0]),c=new $3Dmol.Vector3(parseFloat(r[1]),parseFloat(r[2]),parseFloat(r[3])).multiplyScalar(a);r=t[5].replace(/^\s+/,"").replace(/\s+/g," ").split(" ");var f=Math.abs(r[0]),h=new $3Dmol.Vector3(parseFloat(r[1]),parseFloat(r[2]),parseFloat(r[3])).multiplyScalar(a);this.size={x:s,y:u,z:f},this.unit=new $3Dmol.Vector3(l.x,c.y,h.z),0==l.y&&0==l.z&&0==c.x&&0==c.z&&0==h.x&&0==h.y||(this.matrix=new $3Dmol.Matrix4(l.x,c.x,h.x,0,l.y,c.y,h.y,0,l.z,c.z,h.z,0,0,0,0,1),this.matrix=this.matrix.multiplyMatrices(this.matrix,(new $3Dmol.Matrix4).makeTranslation(o.x,o.y,o.z)),this.origin=new $3Dmol.Vector3(0,0,0),this.unit=new $3Dmol.Vector3(1,1,1));var p=6;n<0&&p++;var d=t.splice(i+p).join(" ");d=(d=d.replace(/^\s+/,"")).split(/[\s\r]+/),this.data=new Float32Array(d)}},$3Dmol.VolumeData.prototype.ccp4=function(e){var t={};e=new Int8Array(e);var r=new Int32Array(e.buffer,0,56),n=new Float32Array(e.buffer,0,56),i=new DataView(e.buffer);if(t.MAP=String.fromCharCode(i.getUint8(208),i.getUint8(209),i.getUint8(210),i.getUint8(211)),t.MACHST=[i.getUint8(212),i.getUint8(213)],17===t.MACHST[0]&&17===t.MACHST[1])for(var o=e.byteLength,a=0;a<o;a+=4)i.setFloat32(a,i.getFloat32(a),!0);t.NX=r[0],t.NY=r[1],t.NZ=r[2],t.MODE=r[3],t.NXSTART=r[4],t.NYSTART=r[5],t.NZSTART=r[6],t.MX=r[7],t.MY=r[8],t.MZ=r[9],t.xlen=n[10],t.ylen=n[11],t.zlen=n[12],t.alpha=n[13],t.beta=n[14],t.gamma=n[15],t.MAPC=r[16],t.MAPR=r[17],t.MAPS=r[18],t.DMIN=n[19],t.DMAX=n[20],t.DMEAN=n[21],t.ISPG=r[22],t.NSYMBT=r[23],t.LSKFLG=r[24],t.originX=n[49],t.originY=n[50],t.originZ=n[51],t.ARMS=n[54];var s=t,l=[s.xlen,0,0],u=[s.ylen*Math.cos(Math.PI/180*s.gamma),s.ylen*Math.sin(Math.PI/180*s.gamma),0],c=[s.zlen*Math.cos(Math.PI/180*s.beta),s.zlen*(Math.cos(Math.PI/180*s.alpha)-Math.cos(Math.PI/180*s.gamma)*Math.cos(Math.PI/180*s.beta))/Math.sin(Math.PI/180*s.gamma),0];c[2]=Math.sqrt(s.zlen*s.zlen*Math.sin(Math.PI/180*s.beta)*Math.sin(Math.PI/180*s.beta)-c[1]*c[1]);var f=[0,l,u,c],h=[0,s.MX,s.MY,s.MZ],p=[0,s.MAPC,s.MAPR,s.MAPS];this.matrix=new $3Dmol.Matrix4,this.matrix.set(f[p[1]][0]/h[p[1]],f[p[2]][0]/h[p[2]],f[p[3]][0]/h[p[3]],0,f[p[1]][1]/h[p[1]],f[p[2]][1]/h[p[2]],f[p[3]][1]/h[p[3]],0,f[p[1]][2]/h[p[1]],f[p[2]][2]/h[p[2]],f[p[3]][2]/h[p[3]],0,0,0,0,1),this.matrix=this.matrix.multiplyMatrices(this.matrix,(new $3Dmol.Matrix4).makeTranslation(s.NXSTART+s.originX,s.NYSTART+s.originY,s.NZSTART+s.originZ)),this.origin=new $3Dmol.Vector3(0,0,0),this.unit=new $3Dmol.Vector3(1,1,1),this.size={x:t.NX,y:t.NY,z:t.NZ},this.dimensionorder=[t.MAPC,t.MAPR,t.MAPS];var d=new Float32Array(e.buffer,1024+t.NSYMBT),m=t.NX,v=t.NY,g=t.NZ;this.data=new Float32Array(m*v*g);for(var y=0;y<m;y++)for(var b=0;b<v;b++)for(var x=0;x<g;x++)this.data[(y*v+b)*g+x]=d[(x*v+b)*m+y]},$3Dmol.VolumeData.prototype.ccp4.isbinary=!0,$3Dmol.GLVolumetricRender=function(){function e(e,t){function r(e,t,r){return e+(t-e)*r}var n=[],i=(e.length-1)/(t-1);n[0]=e[0];for(var o=1;o<t-1;o++){var a=o*i,s=Math.floor(a).toFixed(),l=Math.ceil(a).toFixed(),u=a-s;n[o]=r(e[s],e[l],u)}return n[t-1]=e[e.length-1],n}function t(t,r){r=r||{};var n=Object.assign([],r.transferfn),i=null,o=null,a=r.subsamples||5,s=[];n.forEach((function(e){e.value=parseFloat(e.value)})),n.sort((function(e,t){return e.value-t.value}));var l=n[0].value;0==n.length&&n.push(n[0]);for(var u,c,f,h,p,d,m,v,g,y,b=n[n.length-1].value,x=0;x<n.length-1;x++)if(f=$3Dmol.CC.color(n[x].color),h=$3Dmol.CC.color(n[x+1].color),g=n[x].opacity,y=n[x+1].opacity,(u=Math.floor(256*(n[x].value-l)/(b-l)))!=(c=Math.floor(256*(n[x+1].value-l)/(b-l)))){p=e([255*f.r,255*h.r],c-u),d=e([255*f.g,255*h.g],c-u),m=e([255*f.b,255*h.b],c-u),v=e([255*g,255*y],c-u);for(var w=0;w<p.length;w++)s.push(p[w]),s.push(d[w]),s.push(m[w]),s.push(v[w])}s=new Uint8ClampedArray(s);var _=(new $3Dmol.Matrix4).identity(),D=t.unit.x*t.size.x,A=t.unit.y*t.size.y,C=t.unit.z*t.size.z;_.makeTranslation(-t.origin.x/D,-t.origin.y/A,-t.origin.z/C),_.scale({x:1/D,y:1/A,z:1/C});var S=Math.min(Math.min(t.unit.x,t.unit.y),t.unit.z),E=[[t.origin.x,t.origin.y,t.origin.z],[t.origin.x+D,t.origin.y+A,t.origin.z+C]],T=Math.sqrt(D*D+A*A+C*C),M=new $3Dmol.GLShape;t.matrix?console.log("ERROR: Non-orthonombic boxes (or file formats that specify transformation matrices) are not supported with volumetric rendering yet."):M.addBox({corner:t.origin,dimensions:{w:D,h:A,d:C}});var $=M.finalize();void 0!==r.coords&&r.seldist,this.globj=function(e){if(o&&(e.remove(o),o=null),!this.hidden){i=new $3Dmol.Object3D;var r,n=new $3Dmol.Texture(t,!0),u=new $3Dmol.Texture(s,!1);n.needsUpdate=!0,u.needsUpdate=!0,u.flipY=!1,r=new $3Dmol.VolumetricMaterial({transferfn:u,transfermin:l,transfermax:b,map:n,extent:E,maxdepth:T,texmatrix:_,unit:S,subsamples:a});var c=new $3Dmol.Mesh($,r);i.add(c),o=i.clone(),e.add(o)}},this.removegl=function(e){o&&(void 0!==o.geometry&&o.geometry.dispose(),void 0!==o.material&&o.material.dispose(),e.remove(o),o=null),i=null}}return Object.defineProperty(t.prototype,"position",{get:function(){return this.boundingSphere.center}}),Object.defineProperty(t.prototype,"x",{get:function(){return this.boundingSphere.center.x}}),Object.defineProperty(t.prototype,"y",{get:function(){return this.boundingSphere.center.y}}),Object.defineProperty(t.prototype,"z",{get:function(){return this.boundingSphere.center.z}}),t}(),$3Dmol.workerString=function(){self.onmessage=function(e){var t=e.data,r=t.type;if(r<0)self.atomData=t.atoms,self.volume=t.volume,self.ps=new ProteinSurface;else{var n=self.ps;n.initparm(t.expandedExtent,1!=r,self.volume),n.fillvoxels(self.atomData,t.extendedAtoms),n.buildboundary(),4!==r&&2!==r||(n.fastdistancemap(),n.boundingatom(!1),n.fillvoxelswaals(self.atomData,t.extendedAtoms)),n.marchingcube(r);var i=n.getFacesAndVertices(t.atomsToShow);self.postMessage(i)}}}.toString().replace(/(^.*?\{|\}$)/g,""),$3Dmol.workerString+="; var ProteinSurface="+$3Dmol.ProteinSurface.toString().replace(/[a-zA-Z_$]{1}[0-9a-zA-Z_$]*.MarchingCube./g,"MarchingCube."),$3Dmol.workerString+=",MarchingCube=("+$3Dmol.MarchingCubeInitializer.toString()+")();",$3Dmol.SurfaceWorker=window.URL?window.URL.createObjectURL(new Blob([$3Dmol.workerString],{type:"text/javascript"})):{postMessage:function(){}},$3Dmol.workerString=$3Dmol.workerString,$3Dmol.SurfaceWorker=$3Dmol.SurfaceWorker}).call(this,__webpack_require__(74)(module))},440:function(e,t,r){e.exports=function(){"use strict";var e=Array.prototype.slice;function t(e,t){t&&(e.prototype=Object.create(t.prototype)),e.prototype.constructor=e}function r(e){return a(e)?e:U(e)}function n(e){return s(e)?e:V(e)}function i(e){return l(e)?e:q(e)}function o(e){return a(e)&&!u(e)?e:G(e)}function a(e){return!(!e||!e[f])}function s(e){return!(!e||!e[h])}function l(e){return!(!e||!e[p])}function u(e){return s(e)||l(e)}function c(e){return!(!e||!e[d])}t(n,r),t(i,r),t(o,r),r.isIterable=a,r.isKeyed=s,r.isIndexed=l,r.isAssociative=u,r.isOrdered=c,r.Keyed=n,r.Indexed=i,r.Set=o;var f="@@__IMMUTABLE_ITERABLE__@@",h="@@__IMMUTABLE_KEYED__@@",p="@@__IMMUTABLE_INDEXED__@@",d="@@__IMMUTABLE_ORDERED__@@",m={},v={value:!1},g={value:!1};function y(e){return e.value=!1,e}function b(e){e&&(e.value=!0)}function x(){}function w(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),i=0;i<r;i++)n[i]=e[i+t];return n}function _(e){return void 0===e.size&&(e.size=e.__iterate(A)),e.size}function D(e,t){if("number"!=typeof t){var r=t>>>0;if(""+r!==t||4294967295===r)return NaN;t=r}return t<0?_(e)+t:t}function A(){return!0}function C(e,t,r){return(0===e||void 0!==r&&e<=-r)&&(void 0===t||void 0!==r&&t>=r)}function S(e,t){return T(e,t,0)}function E(e,t){return T(e,t,t)}function T(e,t,r){return void 0===e?r:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}var M,$,z,L="function"==typeof Symbol&&Symbol.iterator,k=L||"@@iterator";function I(e){this.next=e}function R(e,t,r,n){var i=0===e?t:1===e?r:[t,r];return n?n.value=i:n={value:i,done:!1},n}function O(){return{value:void 0,done:!0}}function F(e){return!!j(e)}function N(e){return e&&"function"==typeof e.next}function P(e){var t=j(e);return t&&t.call(e)}function j(e){var t=e&&(L&&e[L]||e["@@iterator"]);if("function"==typeof t)return t}function B(e){return e&&"number"==typeof e.length}function U(e){return null==e?Z():a(e)?e.toSeq():function(e){var t=ee(e)||"object"==typeof e&&new W(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}(e)}function V(e){return null==e?Z().toKeyedSeq():a(e)?s(e)?e.toSeq():e.fromEntrySeq():Q(e)}function q(e){return null==e?Z():a(e)?s(e)?e.entrySeq():e.toIndexedSeq():J(e)}function G(e){return(null==e?Z():a(e)?s(e)?e.entrySeq():e:J(e)).toSetSeq()}function H(e){this._array=e,this.size=e.length}function W(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function Y(e){this._iterable=e,this.size=e.length||e.size}function X(e){this._iterator=e,this._iteratorCache=[]}function K(e){return!(!e||!e["@@__IMMUTABLE_SEQ__@@"])}function Z(){return M||(M=new H([]))}function Q(e){var t=Array.isArray(e)?new H(e).fromEntrySeq():N(e)?new X(e).fromEntrySeq():F(e)?new Y(e).fromEntrySeq():"object"==typeof e?new W(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function J(e){var t=ee(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function ee(e){return B(e)?new H(e):N(e)?new X(e):F(e)?new Y(e):void 0}function te(e,t,r,n){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[r?o-a:a];if(!1===t(s[1],n?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,r)}function re(e,t,r,n){var i=e._cache;if(i){var o=i.length-1,a=0;return new I((function(){var e=i[r?o-a:a];return a++>o?{value:void 0,done:!0}:R(t,n?e[0]:a-1,e[1])}))}return e.__iteratorUncached(t,r)}function ne(e,t){return t?function e(t,r,n,i){return Array.isArray(r)?t.call(i,n,q(r).map((function(n,i){return e(t,n,i,r)}))):oe(r)?t.call(i,n,V(r).map((function(n,i){return e(t,n,i,r)}))):r}(t,e,"",{"":e}):ie(e)}function ie(e){return Array.isArray(e)?q(e).map(ie).toList():oe(e)?V(e).map(ie).toMap():e}function oe(e){return e&&(e.constructor===Object||void 0===e.constructor)}function ae(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function se(e,t){if(e===t)return!0;if(!a(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||s(e)!==s(t)||l(e)!==l(t)||c(e)!==c(t))return!1;if(0===e.size&&0===t.size)return!0;var r=!u(e);if(c(e)){var n=e.entries();return t.every((function(e,t){var i=n.next().value;return i&&ae(i[1],e)&&(r||ae(i[0],t))}))&&n.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var f=!0,h=t.__iterate((function(t,n){if(r?!e.has(t):i?!ae(t,e.get(n,m)):!ae(e.get(n,m),t))return f=!1,!1}));return f&&e.size===h}function le(e,t){if(!(this instanceof le))return new le(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if($)return $;$=this}}function ue(e,t){if(!e)throw new Error(t)}function ce(e,t,r){if(!(this instanceof ce))return new ce(e,t,r);if(ue(0!==r,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),r=void 0===r?1:Math.abs(r),t<e&&(r=-r),this._start=e,this._end=t,this._step=r,this.size=Math.max(0,Math.ceil((t-e)/r-1)+1),0===this.size){if(z)return z;z=this}}function fe(){throw TypeError("Abstract")}function he(){}function pe(){}function de(){}I.prototype.toString=function(){return"[Iterator]"},I.KEYS=0,I.VALUES=1,I.ENTRIES=2,I.prototype.inspect=I.prototype.toSource=function(){return this.toString()},I.prototype[k]=function(){return this},t(U,r),U.of=function(){return U(arguments)},U.prototype.toSeq=function(){return this},U.prototype.toString=function(){return this.__toString("Seq {","}")},U.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},U.prototype.__iterate=function(e,t){return te(this,e,t,!0)},U.prototype.__iterator=function(e,t){return re(this,e,t,!0)},t(V,U),V.prototype.toKeyedSeq=function(){return this},t(q,U),q.of=function(){return q(arguments)},q.prototype.toIndexedSeq=function(){return this},q.prototype.toString=function(){return this.__toString("Seq [","]")},q.prototype.__iterate=function(e,t){return te(this,e,t,!1)},q.prototype.__iterator=function(e,t){return re(this,e,t,!1)},t(G,U),G.of=function(){return G(arguments)},G.prototype.toSetSeq=function(){return this},U.isSeq=K,U.Keyed=V,U.Set=G,U.Indexed=q,U.prototype["@@__IMMUTABLE_SEQ__@@"]=!0,t(H,q),H.prototype.get=function(e,t){return this.has(e)?this._array[D(this,e)]:t},H.prototype.__iterate=function(e,t){for(var r=this._array,n=r.length-1,i=0;i<=n;i++)if(!1===e(r[t?n-i:i],i,this))return i+1;return i},H.prototype.__iterator=function(e,t){var r=this._array,n=r.length-1,i=0;return new I((function(){return i>n?{value:void 0,done:!0}:R(e,i,r[t?n-i++:i++])}))},t(W,V),W.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},W.prototype.has=function(e){return this._object.hasOwnProperty(e)},W.prototype.__iterate=function(e,t){for(var r=this._object,n=this._keys,i=n.length-1,o=0;o<=i;o++){var a=n[t?i-o:o];if(!1===e(r[a],a,this))return o+1}return o},W.prototype.__iterator=function(e,t){var r=this._object,n=this._keys,i=n.length-1,o=0;return new I((function(){var a=n[t?i-o:o];return o++>i?{value:void 0,done:!0}:R(e,a,r[a])}))},W.prototype[d]=!0,t(Y,q),Y.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var r=P(this._iterable),n=0;if(N(r))for(var i;!(i=r.next()).done&&!1!==e(i.value,n++,this););return n},Y.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=P(this._iterable);if(!N(r))return new I(O);var n=0;return new I((function(){var t=r.next();return t.done?t:R(e,n++,t.value)}))},t(X,q),X.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var r,n=this._iterator,i=this._iteratorCache,o=0;o<i.length;)if(!1===e(i[o],o++,this))return o;for(;!(r=n.next()).done;){var a=r.value;if(i[o]=a,!1===e(a,o++,this))break}return o},X.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var r=this._iterator,n=this._iteratorCache,i=0;return new I((function(){if(i>=n.length){var t=r.next();if(t.done)return t;n[i]=t.value}return R(e,i,n[i++])}))},t(le,q),le.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},le.prototype.get=function(e,t){return this.has(e)?this._value:t},le.prototype.includes=function(e){return ae(this._value,e)},le.prototype.slice=function(e,t){var r=this.size;return C(e,t,r)?this:new le(this._value,E(t,r)-S(e,r))},le.prototype.reverse=function(){return this},le.prototype.indexOf=function(e){return ae(this._value,e)?0:-1},le.prototype.lastIndexOf=function(e){return ae(this._value,e)?this.size:-1},le.prototype.__iterate=function(e,t){for(var r=0;r<this.size;r++)if(!1===e(this._value,r,this))return r+1;return r},le.prototype.__iterator=function(e,t){var r=this,n=0;return new I((function(){return n<r.size?R(e,n++,r._value):{value:void 0,done:!0}}))},le.prototype.equals=function(e){return e instanceof le?ae(this._value,e._value):se(e)},t(ce,q),ce.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},ce.prototype.get=function(e,t){return this.has(e)?this._start+D(this,e)*this._step:t},ce.prototype.includes=function(e){var t=(e-this._start)/this._step;return t>=0&&t<this.size&&t===Math.floor(t)},ce.prototype.slice=function(e,t){return C(e,t,this.size)?this:(e=S(e,this.size),(t=E(t,this.size))<=e?new ce(0,0):new ce(this.get(e,this._end),this.get(t,this._end),this._step))},ce.prototype.indexOf=function(e){var t=e-this._start;if(t%this._step==0){var r=t/this._step;if(r>=0&&r<this.size)return r}return-1},ce.prototype.lastIndexOf=function(e){return this.indexOf(e)},ce.prototype.__iterate=function(e,t){for(var r=this.size-1,n=this._step,i=t?this._start+r*n:this._start,o=0;o<=r;o++){if(!1===e(i,o,this))return o+1;i+=t?-n:n}return o},ce.prototype.__iterator=function(e,t){var r=this.size-1,n=this._step,i=t?this._start+r*n:this._start,o=0;return new I((function(){var a=i;return i+=t?-n:n,o>r?{value:void 0,done:!0}:R(e,o++,a)}))},ce.prototype.equals=function(e){return e instanceof ce?this._start===e._start&&this._end===e._end&&this._step===e._step:se(this,e)},t(fe,r),t(he,fe),t(pe,fe),t(de,fe),fe.Keyed=he,fe.Indexed=pe,fe.Set=de;var me="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var r=65535&(e|=0),n=65535&(t|=0);return r*n+((e>>>16)*n+r*(t>>>16)<<16>>>0)|0};function ve(e){return e>>>1&1073741824|3221225471&e}function ge(e){if(!1===e||null==e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null==e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!=e||e===1/0)return 0;var r=0|e;for(r!==e&&(r^=4294967295*e);e>4294967295;)r^=e/=4294967295;return ve(r)}if("string"===t)return e.length>Ce?function(e){var t=Te[e];return void 0===t&&(t=ye(e),Ee===Se&&(Ee=0,Te={}),Ee++,Te[e]=t),t}(e):ye(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return function(e){var t;if(_e&&void 0!==(t=be.get(e)))return t;if(void 0!==(t=e[Ae]))return t;if(!we){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Ae]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}if(t=++De,1073741824&De&&(De=0),_e)be.set(e,t);else{if(void 0!==xe&&!1===xe(e))throw new Error("Non-extensible objects are not allowed as keys.");if(we)Object.defineProperty(e,Ae,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Ae]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[Ae]=t}}return t}(e);if("function"==typeof e.toString)return ye(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ye(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return ve(t)}var be,xe=Object.isExtensible,we=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),_e="function"==typeof WeakMap;_e&&(be=new WeakMap);var De=0,Ae="__immutablehash__";"function"==typeof Symbol&&(Ae=Symbol(Ae));var Ce=16,Se=255,Ee=0,Te={};function Me(e){ue(e!==1/0,"Cannot perform this action with an infinite size.")}function $e(e){return null==e?qe():ze(e)&&!c(e)?e:qe().withMutations((function(t){var r=n(e);Me(r.size),r.forEach((function(e,r){return t.set(r,e)}))}))}function ze(e){return!(!e||!e[ke])}t($e,he),$e.of=function(){var t=e.call(arguments,0);return qe().withMutations((function(e){for(var r=0;r<t.length;r+=2){if(r+1>=t.length)throw new Error("Missing value for key: "+t[r]);e.set(t[r],t[r+1])}}))},$e.prototype.toString=function(){return this.__toString("Map {","}")},$e.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},$e.prototype.set=function(e,t){return Ge(this,e,t)},$e.prototype.setIn=function(e,t){return this.updateIn(e,m,(function(){return t}))},$e.prototype.remove=function(e){return Ge(this,e,m)},$e.prototype.deleteIn=function(e){return this.updateIn(e,(function(){return m}))},$e.prototype.update=function(e,t,r){return 1===arguments.length?e(this):this.updateIn([e],t,r)},$e.prototype.updateIn=function(e,t,r){r||(r=t,t=void 0);var n=function e(t,r,n,i){var o=t===m,a=r.next();if(a.done){var s=o?n:t,l=i(s);return l===s?t:l}ue(o||t&&t.set,"invalid keyPath");var u=a.value,c=o?m:t.get(u,m),f=e(c,r,n,i);return f===c?t:f===m?t.remove(u):(o?qe():t).set(u,f)}(this,Xt(e),t,r);return n===m?void 0:n},$e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):qe()},$e.prototype.merge=function(){return Xe(this,void 0,arguments)},$e.prototype.mergeWith=function(t){var r=e.call(arguments,1);return Xe(this,t,r)},$e.prototype.mergeIn=function(t){var r=e.call(arguments,1);return this.updateIn(t,qe(),(function(e){return"function"==typeof e.merge?e.merge.apply(e,r):r[r.length-1]}))},$e.prototype.mergeDeep=function(){return Xe(this,Ke,arguments)},$e.prototype.mergeDeepWith=function(t){var r=e.call(arguments,1);return Xe(this,Ze(t),r)},$e.prototype.mergeDeepIn=function(t){var r=e.call(arguments,1);return this.updateIn(t,qe(),(function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,r):r[r.length-1]}))},$e.prototype.sort=function(e){return wt(Nt(this,e))},$e.prototype.sortBy=function(e,t){return wt(Nt(this,t,e))},$e.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},$e.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new x)},$e.prototype.asImmutable=function(){return this.__ensureOwner()},$e.prototype.wasAltered=function(){return this.__altered},$e.prototype.__iterator=function(e,t){return new je(this,e,t)},$e.prototype.__iterate=function(e,t){var r=this,n=0;return this._root&&this._root.iterate((function(t){return n++,e(t[1],t[0],r)}),t),n},$e.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Ve(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},$e.isMap=ze;var Le,ke="@@__IMMUTABLE_MAP__@@",Ie=$e.prototype;function Re(e,t){this.ownerID=e,this.entries=t}function Oe(e,t,r){this.ownerID=e,this.bitmap=t,this.nodes=r}function Fe(e,t,r){this.ownerID=e,this.count=t,this.nodes=r}function Ne(e,t,r){this.ownerID=e,this.keyHash=t,this.entries=r}function Pe(e,t,r){this.ownerID=e,this.keyHash=t,this.entry=r}function je(e,t,r){this._type=t,this._reverse=r,this._stack=e._root&&Ue(e._root)}function Be(e,t){return R(e,t[0],t[1])}function Ue(e,t){return{node:e,index:0,__prev:t}}function Ve(e,t,r,n){var i=Object.create(Ie);return i.size=e,i._root=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function qe(){return Le||(Le=Ve(0))}function Ge(e,t,r){var n,i;if(e._root){var o=y(v),a=y(g);if(n=He(e._root,e.__ownerID,0,void 0,t,r,o,a),!a.value)return e;i=e.size+(o.value?r===m?-1:1:0)}else{if(r===m)return e;i=1,n=new Re(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=i,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?Ve(i,n):qe()}function He(e,t,r,n,i,o,a,s){return e?e.update(t,r,n,i,o,a,s):o===m?e:(b(s),b(a),new Pe(t,n,[i,o]))}function We(e){return e.constructor===Pe||e.constructor===Ne}function Ye(e,t,r,n,i){if(e.keyHash===n)return new Ne(t,n,[e.entry,i]);var o,a=31&(0===r?e.keyHash:e.keyHash>>>r),s=31&(0===r?n:n>>>r);return new Oe(t,1<<a|1<<s,a===s?[Ye(e,t,r+5,n,i)]:(o=new Pe(t,n,i),a<s?[e,o]:[o,e]))}function Xe(e,t,r){for(var i=[],o=0;o<r.length;o++){var s=r[o],l=n(s);a(s)||(l=l.map((function(e){return ne(e)}))),i.push(l)}return Qe(e,t,i)}function Ke(e,t,r){return e&&e.mergeDeep&&a(t)?e.mergeDeep(t):ae(e,t)?e:t}function Ze(e){return function(t,r,n){if(t&&t.mergeDeepWith&&a(r))return t.mergeDeepWith(e,r);var i=e(t,r,n);return ae(t,i)?t:i}}function Qe(e,t,r){return 0===(r=r.filter((function(e){return 0!==e.size}))).length?e:0!==e.size||e.__ownerID||1!==r.length?e.withMutations((function(e){for(var n=t?function(r,n){e.update(n,m,(function(e){return e===m?r:t(e,r,n)}))}:function(t,r){e.set(r,t)},i=0;i<r.length;i++)r[i].forEach(n)})):e.constructor(r[0])}function Je(e){return e=(e=(858993459&(e-=e>>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function et(e,t,r,n){var i=n?e:w(e);return i[t]=r,i}Ie[ke]=!0,Ie.delete=Ie.remove,Ie.removeIn=Ie.deleteIn,Re.prototype.get=function(e,t,r,n){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(ae(r,i[o][0]))return i[o][1];return n},Re.prototype.update=function(e,t,r,n,i,o,a){for(var s=i===m,l=this.entries,u=0,c=l.length;u<c&&!ae(n,l[u][0]);u++);var f=u<c;if(f?l[u][1]===i:s)return this;if(b(a),(s||!f)&&b(o),!s||1!==l.length){if(!f&&!s&&l.length>=tt)return function(e,t,r,n){e||(e=new x);for(var i=new Pe(e,ge(r),[r,n]),o=0;o<t.length;o++){var a=t[o];i=i.update(e,0,void 0,a[0],a[1])}return i}(e,l,n,i);var h=e&&e===this.ownerID,p=h?l:w(l);return f?s?u===c-1?p.pop():p[u]=p.pop():p[u]=[n,i]:p.push([n,i]),h?(this.entries=p,this):new Re(e,p)}},Oe.prototype.get=function(e,t,r,n){void 0===t&&(t=ge(r));var i=1<<(31&(0===e?t:t>>>e)),o=this.bitmap;return 0==(o&i)?n:this.nodes[Je(o&i-1)].get(e+5,t,r,n)},Oe.prototype.update=function(e,t,r,n,i,o,a){void 0===r&&(r=ge(n));var s=31&(0===t?r:r>>>t),l=1<<s,u=this.bitmap,c=0!=(u&l);if(!c&&i===m)return this;var f=Je(u&l-1),h=this.nodes,p=c?h[f]:void 0,d=He(p,e,t+5,r,n,i,o,a);if(d===p)return this;if(!c&&d&&h.length>=rt)return function(e,t,r,n,i){for(var o=0,a=new Array(32),s=0;0!==r;s++,r>>>=1)a[s]=1&r?t[o++]:void 0;return a[n]=i,new Fe(e,o+1,a)}(e,h,u,s,d);if(c&&!d&&2===h.length&&We(h[1^f]))return h[1^f];if(c&&d&&1===h.length&&We(d))return d;var v=e&&e===this.ownerID,g=c?d?u:u^l:u|l,y=c?d?et(h,f,d,v):function(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var i=new Array(n),o=0,a=0;a<n;a++)a===t&&(o=1),i[a]=e[a+o];return i}(h,f,v):function(e,t,r,n){var i=e.length+1;if(n&&t+1===i)return e[t]=r,e;for(var o=new Array(i),a=0,s=0;s<i;s++)s===t?(o[s]=r,a=-1):o[s]=e[s+a];return o}(h,f,d,v);return v?(this.bitmap=g,this.nodes=y,this):new Oe(e,g,y)},Fe.prototype.get=function(e,t,r,n){void 0===t&&(t=ge(r));var i=31&(0===e?t:t>>>e),o=this.nodes[i];return o?o.get(e+5,t,r,n):n},Fe.prototype.update=function(e,t,r,n,i,o,a){void 0===r&&(r=ge(n));var s=31&(0===t?r:r>>>t),l=i===m,u=this.nodes,c=u[s];if(l&&!c)return this;var f=He(c,e,t+5,r,n,i,o,a);if(f===c)return this;var h=this.count;if(c){if(!f&&--h<nt)return function(e,t,r,n){for(var i=0,o=0,a=new Array(r),s=0,l=1,u=t.length;s<u;s++,l<<=1){var c=t[s];void 0!==c&&s!==n&&(i|=l,a[o++]=c)}return new Oe(e,i,a)}(e,u,h,s)}else h++;var p=e&&e===this.ownerID,d=et(u,s,f,p);return p?(this.count=h,this.nodes=d,this):new Fe(e,h,d)},Ne.prototype.get=function(e,t,r,n){for(var i=this.entries,o=0,a=i.length;o<a;o++)if(ae(r,i[o][0]))return i[o][1];return n},Ne.prototype.update=function(e,t,r,n,i,o,a){void 0===r&&(r=ge(n));var s=i===m;if(r!==this.keyHash)return s?this:(b(a),b(o),Ye(this,e,t,r,[n,i]));for(var l=this.entries,u=0,c=l.length;u<c&&!ae(n,l[u][0]);u++);var f=u<c;if(f?l[u][1]===i:s)return this;if(b(a),(s||!f)&&b(o),s&&2===c)return new Pe(e,this.keyHash,l[1^u]);var h=e&&e===this.ownerID,p=h?l:w(l);return f?s?u===c-1?p.pop():p[u]=p.pop():p[u]=[n,i]:p.push([n,i]),h?(this.entries=p,this):new Ne(e,this.keyHash,p)},Pe.prototype.get=function(e,t,r,n){return ae(r,this.entry[0])?this.entry[1]:n},Pe.prototype.update=function(e,t,r,n,i,o,a){var s=i===m,l=ae(n,this.entry[0]);return(l?i===this.entry[1]:s)?this:(b(a),s?void b(o):l?e&&e===this.ownerID?(this.entry[1]=i,this):new Pe(e,this.keyHash,[n,i]):(b(o),Ye(this,e,t,ge(n),[n,i])))},Re.prototype.iterate=Ne.prototype.iterate=function(e,t){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(!1===e(r[t?i-n:n]))return!1},Oe.prototype.iterate=Fe.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[t?i-n:n];if(o&&!1===o.iterate(e,t))return!1}},Pe.prototype.iterate=function(e,t){return e(this.entry)},t(je,I),je.prototype.next=function(){for(var e=this._type,t=this._stack;t;){var r,n=t.node,i=t.index++;if(n.entry){if(0===i)return Be(e,n.entry)}else if(n.entries){if(i<=(r=n.entries.length-1))return Be(e,n.entries[this._reverse?r-i:i])}else if(i<=(r=n.nodes.length-1)){var o=n.nodes[this._reverse?r-i:i];if(o){if(o.entry)return Be(e,o.entry);t=this._stack=Ue(o,t)}continue}t=this._stack=this._stack.__prev}return{value:void 0,done:!0}};var tt=8,rt=16,nt=8;function it(e){var t=dt();if(null==e)return t;if(ot(e))return e;var r=i(e),n=r.size;return 0===n?t:(Me(n),n>0&&n<32?pt(0,n,5,null,new lt(r.toArray())):t.withMutations((function(e){e.setSize(n),r.forEach((function(t,r){return e.set(r,t)}))})))}function ot(e){return!(!e||!e[at])}t(it,pe),it.of=function(){return this(arguments)},it.prototype.toString=function(){return this.__toString("List [","]")},it.prototype.get=function(e,t){if((e=D(this,e))>=0&&e<this.size){var r=gt(this,e+=this._origin);return r&&r.array[31&e]}return t},it.prototype.set=function(e,t){return function(e,t,r){if((t=D(e,t))!=t)return e;if(t>=e.size||t<0)return e.withMutations((function(e){t<0?yt(e,t).set(0,r):yt(e,0,t+1).set(t,r)}));t+=e._origin;var n=e._tail,i=e._root,o=y(g);return t>=xt(e._capacity)?n=mt(n,e.__ownerID,0,t,r,o):i=mt(i,e.__ownerID,e._level,t,r,o),o.value?e.__ownerID?(e._root=i,e._tail=n,e.__hash=void 0,e.__altered=!0,e):pt(e._origin,e._capacity,e._level,i,n):e}(this,e,t)},it.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},it.prototype.insert=function(e,t){return this.splice(e,0,t)},it.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):dt()},it.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(r){yt(r,0,t+e.length);for(var n=0;n<e.length;n++)r.set(t+n,e[n])}))},it.prototype.pop=function(){return yt(this,0,-1)},it.prototype.unshift=function(){var e=arguments;return this.withMutations((function(t){yt(t,-e.length);for(var r=0;r<e.length;r++)t.set(r,e[r])}))},it.prototype.shift=function(){return yt(this,1)},it.prototype.merge=function(){return bt(this,void 0,arguments)},it.prototype.mergeWith=function(t){var r=e.call(arguments,1);return bt(this,t,r)},it.prototype.mergeDeep=function(){return bt(this,Ke,arguments)},it.prototype.mergeDeepWith=function(t){var r=e.call(arguments,1);return bt(this,Ze(t),r)},it.prototype.setSize=function(e){return yt(this,0,e)},it.prototype.slice=function(e,t){var r=this.size;return C(e,t,r)?this:yt(this,S(e,r),E(t,r))},it.prototype.__iterator=function(e,t){var r=0,n=ht(this,t);return new I((function(){var t=n();return t===ft?{value:void 0,done:!0}:R(e,r++,t)}))},it.prototype.__iterate=function(e,t){for(var r,n=0,i=ht(this,t);(r=i())!==ft&&!1!==e(r,n++,this););return n},it.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?pt(this._origin,this._capacity,this._level,this._root,this._tail,e,this.__hash):(this.__ownerID=e,this)},it.isList=ot;var at="@@__IMMUTABLE_LIST__@@",st=it.prototype;function lt(e,t){this.array=e,this.ownerID=t}st[at]=!0,st.delete=st.remove,st.setIn=Ie.setIn,st.deleteIn=st.removeIn=Ie.removeIn,st.update=Ie.update,st.updateIn=Ie.updateIn,st.mergeIn=Ie.mergeIn,st.mergeDeepIn=Ie.mergeDeepIn,st.withMutations=Ie.withMutations,st.asMutable=Ie.asMutable,st.asImmutable=Ie.asImmutable,st.wasAltered=Ie.wasAltered,lt.prototype.removeBefore=function(e,t,r){if(r===t?1<<t:0===this.array.length)return this;var n=r>>>t&31;if(n>=this.array.length)return new lt([],e);var i,o=0===n;if(t>0){var a=this.array[n];if((i=a&&a.removeBefore(e,t-5,r))===a&&o)return this}if(o&&!i)return this;var s=vt(this,e);if(!o)for(var l=0;l<n;l++)s.array[l]=void 0;return i&&(s.array[n]=i),s},lt.prototype.removeAfter=function(e,t,r){if(r===(t?1<<t:0)||0===this.array.length)return this;var n,i=r-1>>>t&31;if(i>=this.array.length)return this;if(t>0){var o=this.array[i];if((n=o&&o.removeAfter(e,t-5,r))===o&&i===this.array.length-1)return this}var a=vt(this,e);return a.array.splice(i+1),n&&(a.array[i]=n),a};var ut,ct,ft={};function ht(e,t){var r=e._origin,n=e._capacity,i=xt(n),o=e._tail;return a(e._root,e._level,0);function a(e,s,l){return 0===s?function(e,a){var s=a===i?o&&o.array:e&&e.array,l=a>r?0:r-a,u=n-a;return u>32&&(u=32),function(){if(l===u)return ft;var e=t?--u:l++;return s&&s[e]}}(e,l):function(e,i,o){var s,l=e&&e.array,u=o>r?0:r-o>>i,c=1+(n-o>>i);return c>32&&(c=32),function(){for(;;){if(s){var e=s();if(e!==ft)return e;s=null}if(u===c)return ft;var r=t?--c:u++;s=a(l&&l[r],i-5,o+(r<<i))}}}(e,s,l)}}function pt(e,t,r,n,i,o,a){var s=Object.create(st);return s.size=t-e,s._origin=e,s._capacity=t,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}function dt(){return ut||(ut=pt(0,0,5))}function mt(e,t,r,n,i,o){var a,s=n>>>r&31,l=e&&s<e.array.length;if(!l&&void 0===i)return e;if(r>0){var u=e&&e.array[s],c=mt(u,t,r-5,n,i,o);return c===u?e:((a=vt(e,t)).array[s]=c,a)}return l&&e.array[s]===i?e:(b(o),a=vt(e,t),void 0===i&&s===a.array.length-1?a.array.pop():a.array[s]=i,a)}function vt(e,t){return t&&e&&t===e.ownerID?e:new lt(e?e.array.slice():[],t)}function gt(e,t){if(t>=xt(e._capacity))return e._tail;if(t<1<<e._level+5){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&31],n-=5;return r}}function yt(e,t,r){void 0!==t&&(t|=0),void 0!==r&&(r|=0);var n=e.__ownerID||new x,i=e._origin,o=e._capacity,a=i+t,s=void 0===r?o:r<0?o+r:i+r;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var l=e._level,u=e._root,c=0;a+c<0;)u=new lt(u&&u.array.length?[void 0,u]:[],n),c+=1<<(l+=5);c&&(a+=c,i+=c,s+=c,o+=c);for(var f=xt(o),h=xt(s);h>=1<<l+5;)u=new lt(u&&u.array.length?[u]:[],n),l+=5;var p=e._tail,d=h<f?gt(e,s-1):h>f?new lt([],n):p;if(p&&h>f&&a<o&&p.array.length){for(var m=u=vt(u,n),v=l;v>5;v-=5){var g=f>>>v&31;m=m.array[g]=vt(m.array[g],n)}m.array[f>>>5&31]=p}if(s<o&&(d=d&&d.removeAfter(n,0,s)),a>=h)a-=h,s-=h,l=5,u=null,d=d&&d.removeBefore(n,0,a);else if(a>i||h<f){for(c=0;u;){var y=a>>>l&31;if(y!==h>>>l&31)break;y&&(c+=(1<<l)*y),l-=5,u=u.array[y]}u&&a>i&&(u=u.removeBefore(n,l,a-c)),u&&h<f&&(u=u.removeAfter(n,l,h-c)),c&&(a-=c,s-=c)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=l,e._root=u,e._tail=d,e.__hash=void 0,e.__altered=!0,e):pt(a,s,l,u,d)}function bt(e,t,r){for(var n=[],o=0,s=0;s<r.length;s++){var l=r[s],u=i(l);u.size>o&&(o=u.size),a(l)||(u=u.map((function(e){return ne(e)}))),n.push(u)}return o>e.size&&(e=e.setSize(o)),Qe(e,t,n)}function xt(e){return e<32?0:e-1>>>5<<5}function wt(e){return null==e?At():_t(e)?e:At().withMutations((function(t){var r=n(e);Me(r.size),r.forEach((function(e,r){return t.set(r,e)}))}))}function _t(e){return ze(e)&&c(e)}function Dt(e,t,r,n){var i=Object.create(wt.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=r,i.__hash=n,i}function At(){return ct||(ct=Dt(qe(),dt()))}function Ct(e,t,r){var n,i,o=e._map,a=e._list,s=o.get(t),l=void 0!==s;if(r===m){if(!l)return e;a.size>=32&&a.size>=2*o.size?(n=(i=a.filter((function(e,t){return void 0!==e&&s!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(n.__ownerID=i.__ownerID=e.__ownerID)):(n=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(l){if(r===a.get(s)[1])return e;n=o,i=a.set(s,[t,r])}else n=o.set(t,a.size),i=a.set(a.size,[t,r]);return e.__ownerID?(e.size=n.size,e._map=n,e._list=i,e.__hash=void 0,e):Dt(n,i)}function St(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function Et(e){this._iter=e,this.size=e.size}function Tt(e){this._iter=e,this.size=e.size}function Mt(e){this._iter=e,this.size=e.size}function $t(e){var t=Ht(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Wt,t.__iterateUncached=function(t,r){var n=this;return e.__iterate((function(e,r){return!1!==t(r,e,n)}),r)},t.__iteratorUncached=function(t,r){if(2===t){var n=e.__iterator(t,r);return new I((function(){var e=n.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e}))}return e.__iterator(1===t?0:1,r)},t}function zt(e,t,r){var n=Ht(e);return n.size=e.size,n.has=function(t){return e.has(t)},n.get=function(n,i){var o=e.get(n,m);return o===m?i:t.call(r,o,n,e)},n.__iterateUncached=function(n,i){var o=this;return e.__iterate((function(e,i,a){return!1!==n(t.call(r,e,i,a),i,o)}),i)},n.__iteratorUncached=function(n,i){var o=e.__iterator(2,i);return new I((function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return R(n,s,t.call(r,a[1],s,e),i)}))},n}function Lt(e,t){var r=Ht(e);return r._iter=e,r.size=e.size,r.reverse=function(){return e},e.flip&&(r.flip=function(){var t=$t(e);return t.reverse=function(){return e.flip()},t}),r.get=function(r,n){return e.get(t?r:-1-r,n)},r.has=function(r){return e.has(t?r:-1-r)},r.includes=function(t){return e.includes(t)},r.cacheResult=Wt,r.__iterate=function(t,r){var n=this;return e.__iterate((function(e,r){return t(e,r,n)}),!r)},r.__iterator=function(t,r){return e.__iterator(t,!r)},r}function kt(e,t,r,n){var i=Ht(e);return n&&(i.has=function(n){var i=e.get(n,m);return i!==m&&!!t.call(r,i,n,e)},i.get=function(n,i){var o=e.get(n,m);return o!==m&&t.call(r,o,n,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate((function(e,o,l){if(t.call(r,e,o,l))return s++,i(e,n?o:s-1,a)}),o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(2,o),s=0;return new I((function(){for(;;){var o=a.next();if(o.done)return o;var l=o.value,u=l[0],c=l[1];if(t.call(r,c,u,e))return R(i,n?u:s++,c,o)}}))},i}function It(e,t,r,n){var i=e.size;if(void 0!==t&&(t|=0),void 0!==r&&(r===1/0?r=i:r|=0),C(t,r,i))return e;var o=S(t,i),a=E(r,i);if(o!=o||a!=a)return It(e.toSeq().cacheResult(),t,r,n);var s,l=a-o;l==l&&(s=l<0?0:l);var u=Ht(e);return u.size=0===s?s:e.size&&s||void 0,!n&&K(e)&&s>=0&&(u.get=function(t,r){return(t=D(this,t))>=0&&t<s?e.get(t+o,r):r}),u.__iterateUncached=function(t,r){var i=this;if(0===s)return 0;if(r)return this.cacheResult().__iterate(t,r);var a=0,l=!0,u=0;return e.__iterate((function(e,r){if(!l||!(l=a++<o))return u++,!1!==t(e,n?r:u-1,i)&&u!==s})),u},u.__iteratorUncached=function(t,r){if(0!==s&&r)return this.cacheResult().__iterator(t,r);var i=0!==s&&e.__iterator(t,r),a=0,l=0;return new I((function(){for(;a++<o;)i.next();if(++l>s)return{value:void 0,done:!0};var e=i.next();return n||1===t?e:R(t,l-1,0===t?void 0:e.value[1],e)}))},u}function Rt(e,t,r,n){var i=Ht(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,l=0;return e.__iterate((function(e,o,u){if(!s||!(s=t.call(r,e,o,u)))return l++,i(e,n?o:l-1,a)})),l},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(2,o),l=!0,u=0;return new I((function(){var e,o,c;do{if((e=s.next()).done)return n||1===i?e:R(i,u++,0===i?void 0:e.value[1],e);var f=e.value;o=f[0],c=f[1],l&&(l=t.call(r,c,o,a))}while(l);return 2===i?e:R(i,o,c,e)}))},i}function Ot(e,t){var r=s(e),i=[e].concat(t).map((function(e){return a(e)?r&&(e=n(e)):e=r?Q(e):J(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===i.length)return e;if(1===i.length){var o=i[0];if(o===e||r&&s(o)||l(e)&&l(o))return o}var u=new H(i);return r?u=u.toKeyedSeq():l(e)||(u=u.toSetSeq()),(u=u.flatten(!0)).size=i.reduce((function(e,t){if(void 0!==e){var r=t.size;if(void 0!==r)return e+r}}),0),u}function Ft(e,t,r){var n=Ht(e);return n.__iterateUncached=function(n,i){var o=0,s=!1;return function e(l,u){var c=this;l.__iterate((function(i,l){return(!t||u<t)&&a(i)?e(i,u+1):!1===n(i,r?l:o++,c)&&(s=!0),!s}),i)}(e,0),o},n.__iteratorUncached=function(n,i){var o=e.__iterator(n,i),s=[],l=0;return new I((function(){for(;o;){var e=o.next();if(!1===e.done){var u=e.value;if(2===n&&(u=u[1]),t&&!(s.length<t)||!a(u))return r?e:R(n,l++,u,e);s.push(o),o=u.__iterator(n,i)}else o=s.pop()}return{value:void 0,done:!0}}))},n}function Nt(e,t,r){t||(t=Yt);var n=s(e),i=0,o=e.toSeq().map((function(t,n){return[n,t,i++,r?r(t,n,e):t]})).toArray();return o.sort((function(e,r){return t(e[3],r[3])||e[2]-r[2]})).forEach(n?function(e,t){o[t].length=2}:function(e,t){o[t]=e[1]}),n?V(o):l(e)?q(o):G(o)}function Pt(e,t,r){if(t||(t=Yt),r){var n=e.toSeq().map((function(t,n){return[t,r(t,n,e)]})).reduce((function(e,r){return jt(t,e[1],r[1])?r:e}));return n&&n[0]}return e.reduce((function(e,r){return jt(t,e,r)?r:e}))}function jt(e,t,r){var n=e(r,t);return 0===n&&r!==t&&(null==r||r!=r)||n>0}function Bt(e,t,n){var i=Ht(e);return i.size=new H(n).map((function(e){return e.size})).min(),i.__iterate=function(e,t){for(var r,n=this.__iterator(1,t),i=0;!(r=n.next()).done&&!1!==e(r.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=n.map((function(e){return e=r(e),P(i?e.reverse():e)})),a=0,s=!1;return new I((function(){var r;return s||(r=o.map((function(e){return e.next()})),s=r.some((function(e){return e.done}))),s?{value:void 0,done:!0}:R(e,a++,t.apply(null,r.map((function(e){return e.value}))))}))},i}function Ut(e,t){return K(e)?t:e.constructor(t)}function Vt(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function qt(e){return Me(e.size),_(e)}function Gt(e){return s(e)?n:l(e)?i:o}function Ht(e){return Object.create((s(e)?V:l(e)?q:G).prototype)}function Wt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):U.prototype.cacheResult.call(this)}function Yt(e,t){return e>t?1:e<t?-1:0}function Xt(e){var t=P(e);if(!t){if(!B(e))throw new TypeError("Expected iterable or array-like: "+e);t=P(r(e))}return t}function Kt(e,t){var r,n=function(o){if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var a=Object.keys(e);!function(e,t){try{t.forEach(er.bind(void 0,e))}catch(e){}}(i,a),i.size=a.length,i._name=t,i._keys=a,i._defaultValues=e}this._map=$e(o)},i=n.prototype=Object.create(Zt);return i.constructor=n,n}t(wt,$e),wt.of=function(){return this(arguments)},wt.prototype.toString=function(){return this.__toString("OrderedMap {","}")},wt.prototype.get=function(e,t){var r=this._map.get(e);return void 0!==r?this._list.get(r)[1]:t},wt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):At()},wt.prototype.set=function(e,t){return Ct(this,e,t)},wt.prototype.remove=function(e){return Ct(this,e,m)},wt.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},wt.prototype.__iterate=function(e,t){var r=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],r)}),t)},wt.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},wt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),r=this._list.__ensureOwner(e);return e?Dt(t,r,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=r,this)},wt.isOrderedMap=_t,wt.prototype[d]=!0,wt.prototype.delete=wt.prototype.remove,t(St,V),St.prototype.get=function(e,t){return this._iter.get(e,t)},St.prototype.has=function(e){return this._iter.has(e)},St.prototype.valueSeq=function(){return this._iter.valueSeq()},St.prototype.reverse=function(){var e=this,t=Lt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},St.prototype.map=function(e,t){var r=this,n=zt(this,e,t);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(e,t)}),n},St.prototype.__iterate=function(e,t){var r,n=this;return this._iter.__iterate(this._useKeys?function(t,r){return e(t,r,n)}:(r=t?qt(this):0,function(i){return e(i,t?--r:r++,n)}),t)},St.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var r=this._iter.__iterator(1,t),n=t?qt(this):0;return new I((function(){var i=r.next();return i.done?i:R(e,t?--n:n++,i.value,i)}))},St.prototype[d]=!0,t(Et,q),Et.prototype.includes=function(e){return this._iter.includes(e)},Et.prototype.__iterate=function(e,t){var r=this,n=0;return this._iter.__iterate((function(t){return e(t,n++,r)}),t)},Et.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t),n=0;return new I((function(){var t=r.next();return t.done?t:R(e,n++,t.value,t)}))},t(Tt,G),Tt.prototype.has=function(e){return this._iter.includes(e)},Tt.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){return e(t,t,r)}),t)},Tt.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new I((function(){var t=r.next();return t.done?t:R(e,t.value,t.value,t)}))},t(Mt,V),Mt.prototype.entrySeq=function(){return this._iter.toSeq()},Mt.prototype.__iterate=function(e,t){var r=this;return this._iter.__iterate((function(t){if(t){Vt(t);var n=a(t);return e(n?t.get(1):t[1],n?t.get(0):t[0],r)}}),t)},Mt.prototype.__iterator=function(e,t){var r=this._iter.__iterator(1,t);return new I((function(){for(;;){var t=r.next();if(t.done)return t;var n=t.value;if(n){Vt(n);var i=a(n);return R(e,i?n.get(0):n[0],i?n.get(1):n[1],t)}}}))},Et.prototype.cacheResult=St.prototype.cacheResult=Tt.prototype.cacheResult=Mt.prototype.cacheResult=Wt,t(Kt,he),Kt.prototype.toString=function(){return this.__toString(Jt(this)+" {","}")},Kt.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},Kt.prototype.get=function(e,t){if(!this.has(e))return t;var r=this._defaultValues[e];return this._map?this._map.get(e,r):r},Kt.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=Qt(this,qe()))},Kt.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+Jt(this));if(this._map&&!this._map.has(e)&&t===this._defaultValues[e])return this;var r=this._map&&this._map.set(e,t);return this.__ownerID||r===this._map?this:Qt(this,r)},Kt.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:Qt(this,t)},Kt.prototype.wasAltered=function(){return this._map.wasAltered()},Kt.prototype.__iterator=function(e,t){var r=this;return n(this._defaultValues).map((function(e,t){return r.get(t)})).__iterator(e,t)},Kt.prototype.__iterate=function(e,t){var r=this;return n(this._defaultValues).map((function(e,t){return r.get(t)})).__iterate(e,t)},Kt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?Qt(this,t,e):(this.__ownerID=e,this._map=t,this)};var Zt=Kt.prototype;function Qt(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._map=t,n.__ownerID=r,n}function Jt(e){return e._name||e.constructor.name||"Record"}function er(e,t){Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(e){ue(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})}function tr(e){return null==e?lr():rr(e)&&!c(e)?e:lr().withMutations((function(t){var r=o(e);Me(r.size),r.forEach((function(e){return t.add(e)}))}))}function rr(e){return!(!e||!e[ir])}Zt.delete=Zt.remove,Zt.deleteIn=Zt.removeIn=Ie.removeIn,Zt.merge=Ie.merge,Zt.mergeWith=Ie.mergeWith,Zt.mergeIn=Ie.mergeIn,Zt.mergeDeep=Ie.mergeDeep,Zt.mergeDeepWith=Ie.mergeDeepWith,Zt.mergeDeepIn=Ie.mergeDeepIn,Zt.setIn=Ie.setIn,Zt.update=Ie.update,Zt.updateIn=Ie.updateIn,Zt.withMutations=Ie.withMutations,Zt.asMutable=Ie.asMutable,Zt.asImmutable=Ie.asImmutable,t(tr,de),tr.of=function(){return this(arguments)},tr.fromKeys=function(e){return this(n(e).keySeq())},tr.prototype.toString=function(){return this.__toString("Set {","}")},tr.prototype.has=function(e){return this._map.has(e)},tr.prototype.add=function(e){return ar(this,this._map.set(e,!0))},tr.prototype.remove=function(e){return ar(this,this._map.remove(e))},tr.prototype.clear=function(){return ar(this,this._map.clear())},tr.prototype.union=function(){var t=e.call(arguments,0);return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(e){for(var r=0;r<t.length;r++)o(t[r]).forEach((function(t){return e.add(t)}))})):this.constructor(t[0])},tr.prototype.intersect=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return o(e)}));var r=this;return this.withMutations((function(e){r.forEach((function(r){t.every((function(e){return e.includes(r)}))||e.remove(r)}))}))},tr.prototype.subtract=function(){var t=e.call(arguments,0);if(0===t.length)return this;t=t.map((function(e){return o(e)}));var r=this;return this.withMutations((function(e){r.forEach((function(r){t.some((function(e){return e.includes(r)}))&&e.remove(r)}))}))},tr.prototype.merge=function(){return this.union.apply(this,arguments)},tr.prototype.mergeWith=function(t){var r=e.call(arguments,1);return this.union.apply(this,r)},tr.prototype.sort=function(e){return ur(Nt(this,e))},tr.prototype.sortBy=function(e,t){return ur(Nt(this,t,e))},tr.prototype.wasAltered=function(){return this._map.wasAltered()},tr.prototype.__iterate=function(e,t){var r=this;return this._map.__iterate((function(t,n){return e(n,n,r)}),t)},tr.prototype.__iterator=function(e,t){return this._map.map((function(e,t){return t})).__iterator(e,t)},tr.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e);return e?this.__make(t,e):(this.__ownerID=e,this._map=t,this)},tr.isSet=rr;var nr,ir="@@__IMMUTABLE_SET__@@",or=tr.prototype;function ar(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:0===t.size?e.__empty():e.__make(t)}function sr(e,t){var r=Object.create(or);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function lr(){return nr||(nr=sr(qe()))}function ur(e){return null==e?dr():cr(e)?e:dr().withMutations((function(t){var r=o(e);Me(r.size),r.forEach((function(e){return t.add(e)}))}))}function cr(e){return rr(e)&&c(e)}or[ir]=!0,or.delete=or.remove,or.mergeDeep=or.merge,or.mergeDeepWith=or.mergeWith,or.withMutations=Ie.withMutations,or.asMutable=Ie.asMutable,or.asImmutable=Ie.asImmutable,or.__empty=lr,or.__make=sr,t(ur,tr),ur.of=function(){return this(arguments)},ur.fromKeys=function(e){return this(n(e).keySeq())},ur.prototype.toString=function(){return this.__toString("OrderedSet {","}")},ur.isOrderedSet=cr;var fr,hr=ur.prototype;function pr(e,t){var r=Object.create(hr);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function dr(){return fr||(fr=pr(At()))}function mr(e){return null==e?wr():vr(e)?e:wr().unshiftAll(e)}function vr(e){return!(!e||!e[yr])}hr[d]=!0,hr.__empty=dr,hr.__make=pr,t(mr,pe),mr.of=function(){return this(arguments)},mr.prototype.toString=function(){return this.__toString("Stack [","]")},mr.prototype.get=function(e,t){var r=this._head;for(e=D(this,e);r&&e--;)r=r.next;return r?r.value:t},mr.prototype.peek=function(){return this._head&&this._head.value},mr.prototype.push=function(){if(0===arguments.length)return this;for(var e=this.size+arguments.length,t=this._head,r=arguments.length-1;r>=0;r--)t={value:arguments[r],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):xr(e,t)},mr.prototype.pushAll=function(e){if(0===(e=i(e)).size)return this;Me(e.size);var t=this.size,r=this._head;return e.reverse().forEach((function(e){t++,r={value:e,next:r}})),this.__ownerID?(this.size=t,this._head=r,this.__hash=void 0,this.__altered=!0,this):xr(t,r)},mr.prototype.pop=function(){return this.slice(1)},mr.prototype.unshift=function(){return this.push.apply(this,arguments)},mr.prototype.unshiftAll=function(e){return this.pushAll(e)},mr.prototype.shift=function(){return this.pop.apply(this,arguments)},mr.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):wr()},mr.prototype.slice=function(e,t){if(C(e,t,this.size))return this;var r=S(e,this.size);if(E(t,this.size)!==this.size)return pe.prototype.slice.call(this,e,t);for(var n=this.size-r,i=this._head;r--;)i=i.next;return this.__ownerID?(this.size=n,this._head=i,this.__hash=void 0,this.__altered=!0,this):xr(n,i)},mr.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?xr(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},mr.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var r=0,n=this._head;n&&!1!==e(n.value,r++,this);)n=n.next;return r},mr.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var r=0,n=this._head;return new I((function(){if(n){var t=n.value;return n=n.next,R(e,r++,t)}return{value:void 0,done:!0}}))},mr.isStack=vr;var gr,yr="@@__IMMUTABLE_STACK__@@",br=mr.prototype;function xr(e,t,r,n){var i=Object.create(br);return i.size=e,i._head=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function wr(){return gr||(gr=xr(0))}function _r(e,t){var r=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}br[yr]=!0,br.withMutations=Ie.withMutations,br.asMutable=Ie.asMutable,br.asImmutable=Ie.asImmutable,br.wasAltered=Ie.wasAltered,r.Iterator=I,_r(r,{toArray:function(){Me(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate((function(t,r){e[r]=t})),e},toIndexedSeq:function(){return new Et(this)},toJS:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJS?e.toJS():e})).__toJS()},toJSON:function(){return this.toSeq().map((function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e})).__toJS()},toKeyedSeq:function(){return new St(this,!0)},toMap:function(){return $e(this.toKeyedSeq())},toObject:function(){Me(this.size);var e={};return this.__iterate((function(t,r){e[r]=t})),e},toOrderedMap:function(){return wt(this.toKeyedSeq())},toOrderedSet:function(){return ur(s(this)?this.valueSeq():this)},toSet:function(){return tr(s(this)?this.valueSeq():this)},toSetSeq:function(){return new Tt(this)},toSeq:function(){return l(this)?this.toIndexedSeq():s(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return mr(s(this)?this.valueSeq():this)},toList:function(){return it(s(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){var t=e.call(arguments,0);return Ut(this,Ot(this,t))},includes:function(e){return this.some((function(t){return ae(t,e)}))},entries:function(){return this.__iterator(2)},every:function(e,t){Me(this.size);var r=!0;return this.__iterate((function(n,i,o){if(!e.call(t,n,i,o))return r=!1,!1})),r},filter:function(e,t){return Ut(this,kt(this,e,t,!0))},find:function(e,t,r){var n=this.findEntry(e,t);return n?n[1]:r},forEach:function(e,t){return Me(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){Me(this.size),e=void 0!==e?""+e:",";var t="",r=!0;return this.__iterate((function(n){r?r=!1:t+=e,t+=null!=n?n.toString():""})),t},keys:function(){return this.__iterator(0)},map:function(e,t){return Ut(this,zt(this,e,t))},reduce:function(e,t,r){var n,i;return Me(this.size),arguments.length<2?i=!0:n=t,this.__iterate((function(t,o,a){i?(i=!1,n=t):n=e.call(r,n,t,o,a)})),n},reduceRight:function(e,t,r){var n=this.toKeyedSeq().reverse();return n.reduce.apply(n,arguments)},reverse:function(){return Ut(this,Lt(this,!0))},slice:function(e,t){return Ut(this,It(this,e,t,!0))},some:function(e,t){return!this.every(Er(e),t)},sort:function(e){return Ut(this,Nt(this,e))},values:function(){return this.__iterator(1)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(e,t){return _(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return function(e,t,r){var n=$e().asMutable();return e.__iterate((function(i,o){n.update(t.call(r,i,o,e),0,(function(e){return e+1}))})),n.asImmutable()}(this,e,t)},equals:function(e){return se(this,e)},entrySeq:function(){var e=this;if(e._cache)return new H(e._cache);var t=e.toSeq().map(Sr).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Er(e),t)},findEntry:function(e,t,r){var n=r;return this.__iterate((function(r,i,o){if(e.call(t,r,i,o))return n=[i,r],!1})),n},findKey:function(e,t){var r=this.findEntry(e,t);return r&&r[0]},findLast:function(e,t,r){return this.toKeyedSeq().reverse().find(e,t,r)},findLastEntry:function(e,t,r){return this.toKeyedSeq().reverse().findEntry(e,t,r)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(A)},flatMap:function(e,t){return Ut(this,function(e,t,r){var n=Gt(e);return e.toSeq().map((function(i,o){return n(t.call(r,i,o,e))})).flatten(!0)}(this,e,t))},flatten:function(e){return Ut(this,Ft(this,e,!0))},fromEntrySeq:function(){return new Mt(this)},get:function(e,t){return this.find((function(t,r){return ae(r,e)}),void 0,t)},getIn:function(e,t){for(var r,n=this,i=Xt(e);!(r=i.next()).done;){var o=r.value;if((n=n&&n.get?n.get(o,m):m)===m)return t}return n},groupBy:function(e,t){return function(e,t,r){var n=s(e),i=(c(e)?wt():$e()).asMutable();e.__iterate((function(o,a){i.update(t.call(r,o,a,e),(function(e){return(e=e||[]).push(n?[a,o]:o),e}))}));var o=Gt(e);return i.map((function(t){return Ut(e,o(t))}))}(this,e,t)},has:function(e){return this.get(e,m)!==m},hasIn:function(e){return this.getIn(e,m)!==m},isSubset:function(e){return e="function"==typeof e.includes?e:r(e),this.every((function(t){return e.includes(t)}))},isSuperset:function(e){return(e="function"==typeof e.isSubset?e:r(e)).isSubset(this)},keyOf:function(e){return this.findKey((function(t){return ae(t,e)}))},keySeq:function(){return this.toSeq().map(Cr).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return Pt(this,e)},maxBy:function(e,t){return Pt(this,t,e)},min:function(e){return Pt(this,e?Tr(e):zr)},minBy:function(e,t){return Pt(this,t?Tr(t):zr,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Ut(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Ut(this,Rt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Er(e),t)},sortBy:function(e,t){return Ut(this,Nt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Ut(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Ut(this,function(e,t,r){var n=Ht(e);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var a=0;return e.__iterate((function(e,i,s){return t.call(r,e,i,s)&&++a&&n(e,i,o)})),a},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var a=e.__iterator(2,i),s=!0;return new I((function(){if(!s)return{value:void 0,done:!0};var e=a.next();if(e.done)return e;var i=e.value,l=i[0],u=i[1];return t.call(r,u,l,o)?2===n?e:R(n,l,u,e):(s=!1,{value:void 0,done:!0})}))},n}(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Er(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(e){if(e.size===1/0)return 0;var t=c(e),r=s(e),n=t?1:0;return function(e,t){return t=me(t,3432918353),t=me(t<<15|t>>>-15,461845907),t=me(t<<13|t>>>-13,5),t=me((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=ve((t=me(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(r?t?function(e,t){n=31*n+Lr(ge(e),ge(t))|0}:function(e,t){n=n+Lr(ge(e),ge(t))|0}:t?function(e){n=31*n+ge(e)|0}:function(e){n=n+ge(e)|0}),n)}(this))}});var Dr=r.prototype;Dr[f]=!0,Dr[k]=Dr.values,Dr.__toJS=Dr.toArray,Dr.__toStringMapper=Mr,Dr.inspect=Dr.toSource=function(){return this.toString()},Dr.chain=Dr.flatMap,Dr.contains=Dr.includes,_r(n,{flip:function(){return Ut(this,$t(this))},mapEntries:function(e,t){var r=this,n=0;return Ut(this,this.toSeq().map((function(i,o){return e.call(t,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(e,t){var r=this;return Ut(this,this.toSeq().flip().map((function(n,i){return e.call(t,n,i,r)})).flip())}});var Ar=n.prototype;function Cr(e,t){return t}function Sr(e,t){return[t,e]}function Er(e){return function(){return!e.apply(this,arguments)}}function Tr(e){return function(){return-e.apply(this,arguments)}}function Mr(e){return"string"==typeof e?JSON.stringify(e):String(e)}function $r(){return w(arguments)}function zr(e,t){return e<t?1:e>t?-1:0}function Lr(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}return Ar[h]=!0,Ar[k]=Dr.entries,Ar.__toJS=Dr.toObject,Ar.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+Mr(e)},_r(i,{toKeyedSeq:function(){return new St(this,!1)},filter:function(e,t){return Ut(this,kt(this,e,t,!1))},findIndex:function(e,t){var r=this.findEntry(e,t);return r?r[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Ut(this,Lt(this,!1))},slice:function(e,t){return Ut(this,It(this,e,t,!1))},splice:function(e,t){var r=arguments.length;if(t=Math.max(0|t,0),0===r||2===r&&!t)return this;e=S(e,e<0?this.count():this.size);var n=this.slice(0,e);return Ut(this,1===r?n:n.concat(w(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var r=this.findLastEntry(e,t);return r?r[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Ut(this,Ft(this,e,!1))},get:function(e,t){return(e=D(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,r){return r===e}),void 0,t)},has:function(e){return(e=D(this,e))>=0&&(void 0!==this.size?this.size===1/0||e<this.size:-1!==this.indexOf(e))},interpose:function(e){return Ut(this,function(e,t){var r=Ht(e);return r.size=e.size&&2*e.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return e.__iterate((function(e,n){return(!o||!1!==r(t,o++,i))&&!1!==r(e,o++,i)}),n),o},r.__iteratorUncached=function(r,n){var i,o=e.__iterator(1,n),a=0;return new I((function(){return(!i||a%2)&&(i=o.next()).done?i:a%2?R(r,a++,t):R(r,a++,i.value,i)}))},r}(this,e))},interleave:function(){var e=[this].concat(w(arguments)),t=Bt(this.toSeq(),q.of,e),r=t.flatten(!0);return t.size&&(r.size=t.size*e.length),Ut(this,r)},keySeq:function(){return ce(0,this.size)},last:function(){return this.get(-1)},skipWhile:function(e,t){return Ut(this,Rt(this,e,t,!1))},zip:function(){var e=[this].concat(w(arguments));return Ut(this,Bt(this,$r,e))},zipWith:function(e){var t=w(arguments);return t[0]=this,Ut(this,Bt(this,e,t))}}),i.prototype[p]=!0,i.prototype[d]=!0,_r(o,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),o.prototype.has=Dr.includes,o.prototype.contains=o.prototype.includes,_r(V,n.prototype),_r(q,i.prototype),_r(G,o.prototype),_r(he,n.prototype),_r(pe,i.prototype),_r(de,o.prototype),{Iterable:r,Seq:U,Collection:fe,Map:$e,OrderedMap:wt,List:it,Stack:mr,Set:tr,OrderedSet:ur,Record:Kt,Range:ce,Repeat:le,is:ae,fromJS:ne}}()},441:function(e,t,r){var n;
  /*!
   * jQuery JavaScript Library v3.4.1
   * https://jquery.com/
   *
   * Includes Sizzle.js
   * https://sizzlejs.com/
   *
   * Copyright JS Foundation and other contributors
   * Released under the MIT license
   * https://jquery.org/license
   *
   * Date: 2019-05-01T21:04Z
   */!function(t,r){"use strict";"object"==typeof e.exports?e.exports=t.document?r(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return r(e)}:r(t)}("undefined"!=typeof window?window:this,(function(r,i){"use strict";var o=[],a=r.document,s=Object.getPrototypeOf,l=o.slice,u=o.concat,c=o.push,f=o.indexOf,h={},p=h.toString,d=h.hasOwnProperty,m=d.toString,v=m.call(Object),g={},y=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},b=function(e){return null!=e&&e===e.window},x={type:!0,src:!0,nonce:!0,noModule:!0};function w(e,t,r){var n,i,o=(r=r||a).createElement("script");if(o.text=e,t)for(n in x)(i=t[n]||t.getAttribute&&t.getAttribute(n))&&o.setAttribute(n,i);r.head.appendChild(o).parentNode.removeChild(o)}function _(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?h[p.call(e)]||"object":typeof e}var D=function(e,t){return new D.fn.init(e,t)},A=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function C(e){var t=!!e&&"length"in e&&e.length,r=_(e);return!y(e)&&!b(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}D.fn=D.prototype={jquery:"3.4.1",constructor:D,length:0,toArray:function(){return l.call(this)},get:function(e){return null==e?l.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=D.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return D.each(this,e)},map:function(e){return this.pushStack(D.map(this,(function(t,r){return e.call(t,r,t)})))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,r=+e+(e<0?t:0);return this.pushStack(r>=0&&r<t?[this[r]]:[])},end:function(){return this.prevObject||this.constructor()},push:c,sort:o.sort,splice:o.splice},D.extend=D.fn.extend=function(){var e,t,r,n,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||y(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)n=e[t],"__proto__"!==t&&a!==n&&(u&&n&&(D.isPlainObject(n)||(i=Array.isArray(n)))?(r=a[t],o=i&&!Array.isArray(r)?[]:i||D.isPlainObject(r)?r:{},i=!1,a[t]=D.extend(u,o,n)):void 0!==n&&(a[t]=n));return a},D.extend({expando:"jQuery"+("3.4.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,r;return!(!e||"[object Object]"!==p.call(e))&&(!(t=s(e))||"function"==typeof(r=d.call(t,"constructor")&&t.constructor)&&m.call(r)===v)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t){w(e,{nonce:t&&t.nonce})},each:function(e,t){var r,n=0;if(C(e))for(r=e.length;n<r&&!1!==t.call(e[n],n,e[n]);n++);else for(n in e)if(!1===t.call(e[n],n,e[n]))break;return e},trim:function(e){return null==e?"":(e+"").replace(A,"")},makeArray:function(e,t){var r=t||[];return null!=e&&(C(Object(e))?D.merge(r,"string"==typeof e?[e]:e):c.call(r,e)),r},inArray:function(e,t,r){return null==t?-1:f.call(t,e,r)},merge:function(e,t){for(var r=+t.length,n=0,i=e.length;n<r;n++)e[i++]=t[n];return e.length=i,e},grep:function(e,t,r){for(var n=[],i=0,o=e.length,a=!r;i<o;i++)!t(e[i],i)!==a&&n.push(e[i]);return n},map:function(e,t,r){var n,i,o=0,a=[];if(C(e))for(n=e.length;o<n;o++)null!=(i=t(e[o],o,r))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,r))&&a.push(i);return u.apply([],a)},guid:1,support:g}),"function"==typeof Symbol&&(D.fn[Symbol.iterator]=o[Symbol.iterator]),D.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){h["[object "+t+"]"]=t.toLowerCase()}));var S=
  /*!
   * Sizzle CSS Selector Engine v2.3.4
   * https://sizzlejs.com/
   *
   * Copyright JS Foundation and other contributors
   * Released under the MIT license
   * https://js.foundation/
   *
   * Date: 2019-04-08
   */
  function(e){var t,r,n,i,o,a,s,l,u,c,f,h,p,d,m,v,g,y,b,x="sizzle"+1*new Date,w=e.document,_=0,D=0,A=le(),C=le(),S=le(),E=le(),T=function(e,t){return e===t&&(f=!0),0},M={}.hasOwnProperty,$=[],z=$.pop,L=$.push,k=$.push,I=$.slice,R=function(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},O="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",P="\\["+F+"*("+N+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+F+"*\\]",j=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",B=new RegExp(F+"+","g"),U=new RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),V=new RegExp("^"+F+"*,"+F+"*"),q=new RegExp("^"+F+"*([>+~]|"+F+")"+F+"*"),G=new RegExp(F+"|>"),H=new RegExp(j),W=new RegExp("^"+N+"$"),Y={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N+"|[*])"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+j),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},X=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),re=function(e,t,r){var n="0x"+t-65536;return n!=n||r?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},ne=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){h()},ae=xe((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{k.apply($=I.call(w.childNodes),w.childNodes),$[w.childNodes.length].nodeType}catch(e){k={apply:$.length?function(e,t){L.apply(e,I.call(t))}:function(e,t){for(var r=e.length,n=0;e[r++]=t[n++];);e.length=r-1}}}function se(e,t,n,i){var o,s,u,c,f,d,g,y=t&&t.ownerDocument,_=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==_&&9!==_&&11!==_)return n;if(!i&&((t?t.ownerDocument||t:w)!==p&&h(t),t=t||p,m)){if(11!==_&&(f=J.exec(e)))if(o=f[1]){if(9===_){if(!(u=t.getElementById(o)))return n;if(u.id===o)return n.push(u),n}else if(y&&(u=y.getElementById(o))&&b(t,u)&&u.id===o)return n.push(u),n}else{if(f[2])return k.apply(n,t.getElementsByTagName(e)),n;if((o=f[3])&&r.getElementsByClassName&&t.getElementsByClassName)return k.apply(n,t.getElementsByClassName(o)),n}if(r.qsa&&!E[e+" "]&&(!v||!v.test(e))&&(1!==_||"object"!==t.nodeName.toLowerCase())){if(g=e,y=t,1===_&&G.test(e)){for((c=t.getAttribute("id"))?c=c.replace(ne,ie):t.setAttribute("id",c=x),s=(d=a(e)).length;s--;)d[s]="#"+c+" "+be(d[s]);g=d.join(","),y=ee.test(e)&&ge(t.parentNode)||t}try{return k.apply(n,y.querySelectorAll(g)),n}catch(t){E(e,!0)}finally{c===x&&t.removeAttribute("id")}}}return l(e.replace(U,"$1"),t,n,i)}function le(){var e=[];return function t(r,i){return e.push(r+" ")>n.cacheLength&&delete t[e.shift()],t[r+" "]=i}}function ue(e){return e[x]=!0,e}function ce(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){for(var r=e.split("|"),i=r.length;i--;)n.attrHandle[r[i]]=t}function he(e,t){var r=t&&e,n=r&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(n)return n;if(r)for(;r=r.nextSibling;)if(r===t)return-1;return e?1:-1}function pe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function de(e){return function(t){var r=t.nodeName.toLowerCase();return("input"===r||"button"===r)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ve(e){return ue((function(t){return t=+t,ue((function(r,n){for(var i,o=e([],r.length,t),a=o.length;a--;)r[i=o[a]]&&(r[i]=!(n[i]=r[i]))}))}))}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in r=se.support={},o=se.isXML=function(e){var t=e.namespaceURI,r=(e.ownerDocument||e).documentElement;return!X.test(t||r&&r.nodeName||"HTML")},h=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==p&&9===a.nodeType&&a.documentElement?(d=(p=a).documentElement,m=!o(p),w!==p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),r.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),r.getElementsByTagName=ce((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),r.getElementsByClassName=Q.test(p.getElementsByClassName),r.getById=ce((function(e){return d.appendChild(e).id=x,!p.getElementsByName||!p.getElementsByName(x).length})),r.getById?(n.filter.ID=function(e){var t=e.replace(te,re);return function(e){return e.getAttribute("id")===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var r=t.getElementById(e);return r?[r]:[]}}):(n.filter.ID=function(e){var t=e.replace(te,re);return function(e){var r=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return r&&r.value===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var r,n,i,o=t.getElementById(e);if(o){if((r=o.getAttributeNode("id"))&&r.value===e)return[o];for(i=t.getElementsByName(e),n=0;o=i[n++];)if((r=o.getAttributeNode("id"))&&r.value===e)return[o]}return[]}}),n.find.TAG=r.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):r.qsa?t.querySelectorAll(e):void 0}:function(e,t){var r,n=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;r=o[i++];)1===r.nodeType&&n.push(r);return n}return o},n.find.CLASS=r.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},g=[],v=[],(r.qsa=Q.test(p.querySelectorAll))&&(ce((function(e){d.appendChild(e).innerHTML="<a id='"+x+"'></a><select id='"+x+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+F+"*(?:value|"+O+")"),e.querySelectorAll("[id~="+x+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||v.push(".#.+[+~]")})),ce((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+F+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),d.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")}))),(r.matchesSelector=Q.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ce((function(e){r.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",j)})),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),t=Q.test(d.compareDocumentPosition),b=t||Q.test(d.contains)?function(e,t){var r=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(r.contains?r.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},T=t?function(e,t){if(e===t)return f=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!r.sortDetached&&t.compareDocumentPosition(e)===n?e===p||e.ownerDocument===w&&b(w,e)?-1:t===p||t.ownerDocument===w&&b(w,t)?1:c?R(c,e)-R(c,t):0:4&n?-1:1)}:function(e,t){if(e===t)return f=!0,0;var r,n=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===p?-1:t===p?1:i?-1:o?1:c?R(c,e)-R(c,t):0;if(i===o)return he(e,t);for(r=e;r=r.parentNode;)a.unshift(r);for(r=t;r=r.parentNode;)s.unshift(r);for(;a[n]===s[n];)n++;return n?he(a[n],s[n]):a[n]===w?-1:s[n]===w?1:0},p):p},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&h(e),r.matchesSelector&&m&&!E[t+" "]&&(!g||!g.test(t))&&(!v||!v.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){E(t,!0)}return se(t,p,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),b(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!==p&&h(e);var i=n.attrHandle[t.toLowerCase()],o=i&&M.call(n.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:r.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},se.escape=function(e){return(e+"").replace(ne,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],i=0,o=0;if(f=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(T),f){for(;t=e[o++];)t===e[o]&&(i=n.push(o));for(;i--;)e.splice(n[i],1)}return c=null,e},i=se.getText=function(e){var t,r="",n=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)r+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[n++];)r+=i(t);return r},(n=se.selectors={cacheLength:50,createPseudo:ue,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,re),e[3]=(e[3]||e[4]||e[5]||"").replace(te,re),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,r=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":r&&H.test(r)&&(t=a(r,!0))&&(t=r.indexOf(")",r.length-t)-r.length)&&(e[0]=e[0].slice(0,t),e[2]=r.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,re).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=A[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&A(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,r){return function(n){var i=se.attr(n,e);return null==i?"!="===t:!t||(i+="","="===t?i===r:"!="===t?i!==r:"^="===t?r&&0===i.indexOf(r):"*="===t?r&&i.indexOf(r)>-1:"$="===t?r&&i.slice(-r.length)===r:"~="===t?(" "+i.replace(B," ")+" ").indexOf(r)>-1:"|="===t&&(i===r||i.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,r,n,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===n&&0===i?function(e){return!!e.parentNode}:function(t,r,l){var u,c,f,h,p,d,m=o!==a?"nextSibling":"previousSibling",v=t.parentNode,g=s&&t.nodeName.toLowerCase(),y=!l&&!s,b=!1;if(v){if(o){for(;m;){for(h=t;h=h[m];)if(s?h.nodeName.toLowerCase()===g:1===h.nodeType)return!1;d=m="only"===e&&!d&&"nextSibling"}return!0}if(d=[a?v.firstChild:v.lastChild],a&&y){for(b=(p=(u=(c=(f=(h=v)[x]||(h[x]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]||[])[0]===_&&u[1])&&u[2],h=p&&v.childNodes[p];h=++p&&h&&h[m]||(b=p=0)||d.pop();)if(1===h.nodeType&&++b&&h===t){c[e]=[_,p,b];break}}else if(y&&(b=p=(u=(c=(f=(h=t)[x]||(h[x]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]||[])[0]===_&&u[1]),!1===b)for(;(h=++p&&h&&h[m]||(b=p=0)||d.pop())&&((s?h.nodeName.toLowerCase()!==g:1!==h.nodeType)||!++b||(y&&((c=(f=h[x]||(h[x]={}))[h.uniqueID]||(f[h.uniqueID]={}))[e]=[_,b]),h!==t)););return(b-=i)===n||b%n==0&&b/n>=0}}},PSEUDO:function(e,t){var r,i=n.pseudos[e]||n.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return i[x]?i(t):i.length>1?(r=[e,e,"",t],n.setFilters.hasOwnProperty(e.toLowerCase())?ue((function(e,r){for(var n,o=i(e,t),a=o.length;a--;)e[n=R(e,o[a])]=!(r[n]=o[a])})):function(e){return i(e,0,r)}):i}},pseudos:{not:ue((function(e){var t=[],r=[],n=s(e.replace(U,"$1"));return n[x]?ue((function(e,t,r,i){for(var o,a=n(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,n(t,null,o,r),t[0]=null,!r.pop()}})),has:ue((function(e){return function(t){return se(e,t).length>0}})),contains:ue((function(e){return e=e.replace(te,re),function(t){return(t.textContent||i(t)).indexOf(e)>-1}})),lang:ue((function(e){return W.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,re).toLowerCase(),function(t){var r;do{if(r=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(r=r.toLowerCase())===e||0===r.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var r=e.location&&e.location.hash;return r&&r.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!n.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return K.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve((function(){return[0]})),last:ve((function(e,t){return[t-1]})),eq:ve((function(e,t,r){return[r<0?r+t:r]})),even:ve((function(e,t){for(var r=0;r<t;r+=2)e.push(r);return e})),odd:ve((function(e,t){for(var r=1;r<t;r+=2)e.push(r);return e})),lt:ve((function(e,t,r){for(var n=r<0?r+t:r>t?t:r;--n>=0;)e.push(n);return e})),gt:ve((function(e,t,r){for(var n=r<0?r+t:r;++n<t;)e.push(n);return e}))}}).pseudos.nth=n.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})n.pseudos[t]=pe(t);for(t in{submit:!0,reset:!0})n.pseudos[t]=de(t);function ye(){}function be(e){for(var t=0,r=e.length,n="";t<r;t++)n+=e[t].value;return n}function xe(e,t,r){var n=t.dir,i=t.next,o=i||n,a=r&&"parentNode"===o,s=D++;return t.first?function(t,r,i){for(;t=t[n];)if(1===t.nodeType||a)return e(t,r,i);return!1}:function(t,r,l){var u,c,f,h=[_,s];if(l){for(;t=t[n];)if((1===t.nodeType||a)&&e(t,r,l))return!0}else for(;t=t[n];)if(1===t.nodeType||a)if(c=(f=t[x]||(t[x]={}))[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[n]||t;else{if((u=c[o])&&u[0]===_&&u[1]===s)return h[2]=u[2];if(c[o]=h,h[2]=e(t,r,l))return!0}return!1}}function we(e){return e.length>1?function(t,r,n){for(var i=e.length;i--;)if(!e[i](t,r,n))return!1;return!0}:e[0]}function _e(e,t,r,n,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s<l;s++)(o=e[s])&&(r&&!r(o,n,i)||(a.push(o),u&&t.push(s)));return a}function De(e,t,r,n,i,o){return n&&!n[x]&&(n=De(n)),i&&!i[x]&&(i=De(i,o)),ue((function(o,a,s,l){var u,c,f,h=[],p=[],d=a.length,m=o||function(e,t,r){for(var n=0,i=t.length;n<i;n++)se(e,t[n],r);return r}(t||"*",s.nodeType?[s]:s,[]),v=!e||!o&&t?m:_e(m,h,e,s,l),g=r?i||(o?e:d||n)?[]:a:v;if(r&&r(v,g,s,l),n)for(u=_e(g,p),n(u,[],s,l),c=u.length;c--;)(f=u[c])&&(g[p[c]]=!(v[p[c]]=f));if(o){if(i||e){if(i){for(u=[],c=g.length;c--;)(f=g[c])&&u.push(v[c]=f);i(null,g=[],u,l)}for(c=g.length;c--;)(f=g[c])&&(u=i?R(o,f):h[c])>-1&&(o[u]=!(a[u]=f))}}else g=_e(g===a?g.splice(d,g.length):g),i?i(null,a,g,l):k.apply(a,g)}))}function Ae(e){for(var t,r,i,o=e.length,a=n.relative[e[0].type],s=a||n.relative[" "],l=a?1:0,c=xe((function(e){return e===t}),s,!0),f=xe((function(e){return R(t,e)>-1}),s,!0),h=[function(e,r,n){var i=!a&&(n||r!==u)||((t=r).nodeType?c(e,r,n):f(e,r,n));return t=null,i}];l<o;l++)if(r=n.relative[e[l].type])h=[xe(we(h),r)];else{if((r=n.filter[e[l].type].apply(null,e[l].matches))[x]){for(i=++l;i<o&&!n.relative[e[i].type];i++);return De(l>1&&we(h),l>1&&be(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(U,"$1"),r,l<i&&Ae(e.slice(l,i)),i<o&&Ae(e=e.slice(i)),i<o&&be(e))}h.push(r)}return we(h)}return ye.prototype=n.filters=n.pseudos,n.setFilters=new ye,a=se.tokenize=function(e,t){var r,i,o,a,s,l,u,c=C[e+" "];if(c)return t?0:c.slice(0);for(s=e,l=[],u=n.preFilter;s;){for(a in r&&!(i=V.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=q.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(U," ")}),s=s.slice(r.length)),n.filter)!(i=Y[a].exec(s))||u[a]&&!(i=u[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return t?s.length:s?se.error(e):C(e,l).slice(0)},s=se.compile=function(e,t){var r,i=[],o=[],s=S[e+" "];if(!s){for(t||(t=a(e)),r=t.length;r--;)(s=Ae(t[r]))[x]?i.push(s):o.push(s);(s=S(e,function(e,t){var r=t.length>0,i=e.length>0,o=function(o,a,s,l,c){var f,d,v,g=0,y="0",b=o&&[],x=[],w=u,D=o||i&&n.find.TAG("*",c),A=_+=null==w?1:Math.random()||.1,C=D.length;for(c&&(u=a===p||a||c);y!==C&&null!=(f=D[y]);y++){if(i&&f){for(d=0,a||f.ownerDocument===p||(h(f),s=!m);v=e[d++];)if(v(f,a||p,s)){l.push(f);break}c&&(_=A)}r&&((f=!v&&f)&&g--,o&&b.push(f))}if(g+=y,r&&y!==g){for(d=0;v=t[d++];)v(b,x,a,s);if(o){if(g>0)for(;y--;)b[y]||x[y]||(x[y]=z.call(l));x=_e(x)}k.apply(l,x),c&&!o&&x.length>0&&g+t.length>1&&se.uniqueSort(l)}return c&&(_=A,u=w),b};return r?ue(o):o}(o,i))).selector=e}return s},l=se.select=function(e,t,r,i){var o,l,u,c,f,h="function"==typeof e&&e,p=!i&&a(e=h.selector||e);if(r=r||[],1===p.length){if((l=p[0]=p[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&9===t.nodeType&&m&&n.relative[l[1].type]){if(!(t=(n.find.ID(u.matches[0].replace(te,re),t)||[])[0]))return r;h&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(o=Y.needsContext.test(e)?0:l.length;o--&&(u=l[o],!n.relative[c=u.type]);)if((f=n.find[c])&&(i=f(u.matches[0].replace(te,re),ee.test(l[0].type)&&ge(t.parentNode)||t))){if(l.splice(o,1),!(e=i.length&&be(l)))return k.apply(r,i),r;break}}return(h||s(e,p))(i,t,!m,r,!t||ee.test(e)&&ge(t.parentNode)||t),r},r.sortStable=x.split("").sort(T).join("")===x,r.detectDuplicates=!!f,h(),r.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))})),ce((function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")}))||fe("type|href|height|width",(function(e,t,r){if(!r)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),r.attributes&&ce((function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||fe("value",(function(e,t,r){if(!r&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||fe(O,(function(e,t,r){var n;if(!r)return!0===e[t]?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null})),se}(r);D.find=S,D.expr=S.selectors,D.expr[":"]=D.expr.pseudos,D.uniqueSort=D.unique=S.uniqueSort,D.text=S.getText,D.isXMLDoc=S.isXML,D.contains=S.contains,D.escapeSelector=S.escape;var E=function(e,t,r){for(var n=[],i=void 0!==r;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&D(e).is(r))break;n.push(e)}return n},T=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r},M=D.expr.match.needsContext;function $(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var z=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function L(e,t,r){return y(t)?D.grep(e,(function(e,n){return!!t.call(e,n,e)!==r})):t.nodeType?D.grep(e,(function(e){return e===t!==r})):"string"!=typeof t?D.grep(e,(function(e){return f.call(t,e)>-1!==r})):D.filter(t,e,r)}D.filter=function(e,t,r){var n=t[0];return r&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?D.find.matchesSelector(n,e)?[n]:[]:D.find.matches(e,D.grep(t,(function(e){return 1===e.nodeType})))},D.fn.extend({find:function(e){var t,r,n=this.length,i=this;if("string"!=typeof e)return this.pushStack(D(e).filter((function(){for(t=0;t<n;t++)if(D.contains(i[t],this))return!0})));for(r=this.pushStack([]),t=0;t<n;t++)D.find(e,i[t],r);return n>1?D.uniqueSort(r):r},filter:function(e){return this.pushStack(L(this,e||[],!1))},not:function(e){return this.pushStack(L(this,e||[],!0))},is:function(e){return!!L(this,"string"==typeof e&&M.test(e)?D(e):e||[],!1).length}});var k,I=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(D.fn.init=function(e,t,r){var n,i;if(!e)return this;if(r=r||k,"string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:I.exec(e))||!n[1]&&t)return!t||t.jquery?(t||r).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof D?t[0]:t,D.merge(this,D.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:a,!0)),z.test(n[1])&&D.isPlainObject(t))for(n in t)y(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return(i=a.getElementById(n[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):y(e)?void 0!==r.ready?r.ready(e):e(D):D.makeArray(e,this)}).prototype=D.fn,k=D(a);var R=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function F(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}D.fn.extend({has:function(e){var t=D(e,this),r=t.length;return this.filter((function(){for(var e=0;e<r;e++)if(D.contains(this,t[e]))return!0}))},closest:function(e,t){var r,n=0,i=this.length,o=[],a="string"!=typeof e&&D(e);if(!M.test(e))for(;n<i;n++)for(r=this[n];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(a?a.index(r)>-1:1===r.nodeType&&D.find.matchesSelector(r,e))){o.push(r);break}return this.pushStack(o.length>1?D.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?f.call(D(e),this[0]):f.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(D.uniqueSort(D.merge(this.get(),D(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),D.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return E(e,"parentNode")},parentsUntil:function(e,t,r){return E(e,"parentNode",r)},next:function(e){return F(e,"nextSibling")},prev:function(e){return F(e,"previousSibling")},nextAll:function(e){return E(e,"nextSibling")},prevAll:function(e){return E(e,"previousSibling")},nextUntil:function(e,t,r){return E(e,"nextSibling",r)},prevUntil:function(e,t,r){return E(e,"previousSibling",r)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return void 0!==e.contentDocument?e.contentDocument:($(e,"template")&&(e=e.content||e),D.merge([],e.childNodes))}},(function(e,t){D.fn[e]=function(r,n){var i=D.map(this,t,r);return"Until"!==e.slice(-5)&&(n=r),n&&"string"==typeof n&&(i=D.filter(n,i)),this.length>1&&(O[e]||D.uniqueSort(i),R.test(e)&&i.reverse()),this.pushStack(i)}}));var N=/[^\x20\t\r\n\f]+/g;function P(e){return e}function j(e){throw e}function B(e,t,r,n){var i;try{e&&y(i=e.promise)?i.call(e).done(t).fail(r):e&&y(i=e.then)?i.call(e,t,r):t.apply(void 0,[e].slice(n))}catch(e){r.apply(void 0,[e])}}D.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return D.each(e.match(N)||[],(function(e,r){t[r]=!0})),t}(e):D.extend({},e);var t,r,n,i,o=[],a=[],s=-1,l=function(){for(i=i||e.once,n=t=!0;a.length;s=-1)for(r=a.shift();++s<o.length;)!1===o[s].apply(r[0],r[1])&&e.stopOnFalse&&(s=o.length,r=!1);e.memory||(r=!1),t=!1,i&&(o=r?[]:"")},u={add:function(){return o&&(r&&!t&&(s=o.length-1,a.push(r)),function t(r){D.each(r,(function(r,n){y(n)?e.unique&&u.has(n)||o.push(n):n&&n.length&&"string"!==_(n)&&t(n)}))}(arguments),r&&!t&&l()),this},remove:function(){return D.each(arguments,(function(e,t){for(var r;(r=D.inArray(t,o,r))>-1;)o.splice(r,1),r<=s&&s--})),this},has:function(e){return e?D.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=r="",this},disabled:function(){return!o},lock:function(){return i=a=[],r||t||(o=r=""),this},locked:function(){return!!i},fireWith:function(e,r){return i||(r=[e,(r=r||[]).slice?r.slice():r],a.push(r),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},D.extend({Deferred:function(e){var t=[["notify","progress",D.Callbacks("memory"),D.Callbacks("memory"),2],["resolve","done",D.Callbacks("once memory"),D.Callbacks("once memory"),0,"resolved"],["reject","fail",D.Callbacks("once memory"),D.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return D.Deferred((function(r){D.each(t,(function(t,n){var i=y(e[n[4]])&&e[n[4]];o[n[1]]((function(){var e=i&&i.apply(this,arguments);e&&y(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[n[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(e,n,i){var o=0;function a(e,t,n,i){return function(){var s=this,l=arguments,u=function(){var r,u;if(!(e<o)){if((r=n.apply(s,l))===t.promise())throw new TypeError("Thenable self-resolution");u=r&&("object"==typeof r||"function"==typeof r)&&r.then,y(u)?i?u.call(r,a(o,t,P,i),a(o,t,j,i)):(o++,u.call(r,a(o,t,P,i),a(o,t,j,i),a(o,t,P,t.notifyWith))):(n!==P&&(s=void 0,l=[r]),(i||t.resolveWith)(s,l))}},c=i?u:function(){try{u()}catch(r){D.Deferred.exceptionHook&&D.Deferred.exceptionHook(r,c.stackTrace),e+1>=o&&(n!==j&&(s=void 0,l=[r]),t.rejectWith(s,l))}};e?c():(D.Deferred.getStackHook&&(c.stackTrace=D.Deferred.getStackHook()),r.setTimeout(c))}}return D.Deferred((function(r){t[0][3].add(a(0,r,y(i)?i:P,r.notifyWith)),t[1][3].add(a(0,r,y(e)?e:P)),t[2][3].add(a(0,r,y(n)?n:j))})).promise()},promise:function(e){return null!=e?D.extend(e,i):i}},o={};return D.each(t,(function(e,r){var a=r[2],s=r[5];i[r[1]]=a.add,s&&a.add((function(){n=s}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(r[3].fire),o[r[0]]=function(){return o[r[0]+"With"](this===o?void 0:this,arguments),this},o[r[0]+"With"]=a.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,r=t,n=Array(r),i=l.call(arguments),o=D.Deferred(),a=function(e){return function(r){n[e]=this,i[e]=arguments.length>1?l.call(arguments):r,--t||o.resolveWith(n,i)}};if(t<=1&&(B(e,o.done(a(r)).resolve,o.reject,!t),"pending"===o.state()||y(i[r]&&i[r].then)))return o.then();for(;r--;)B(i[r],a(r),o.reject);return o.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;D.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&U.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},D.readyException=function(e){r.setTimeout((function(){throw e}))};var V=D.Deferred();function q(){a.removeEventListener("DOMContentLoaded",q),r.removeEventListener("load",q),D.ready()}D.fn.ready=function(e){return V.then(e).catch((function(e){D.readyException(e)})),this},D.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--D.readyWait:D.isReady)||(D.isReady=!0,!0!==e&&--D.readyWait>0||V.resolveWith(a,[D]))}}),D.ready.then=V.then,"complete"===a.readyState||"loading"!==a.readyState&&!a.documentElement.doScroll?r.setTimeout(D.ready):(a.addEventListener("DOMContentLoaded",q),r.addEventListener("load",q));var G=function(e,t,r,n,i,o,a){var s=0,l=e.length,u=null==r;if("object"===_(r))for(s in i=!0,r)G(e,t,s,r[s],!0,o,a);else if(void 0!==n&&(i=!0,y(n)||(a=!0),u&&(a?(t.call(e,n),t=null):(u=t,t=function(e,t,r){return u.call(D(e),r)})),t))for(;s<l;s++)t(e[s],r,a?n:n.call(e[s],s,t(e[s],r)));return i?e:u?t.call(e):l?t(e[0],r):o},H=/^-ms-/,W=/-([a-z])/g;function Y(e,t){return t.toUpperCase()}function X(e){return e.replace(H,"ms-").replace(W,Y)}var K=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Z(){this.expando=D.expando+Z.uid++}Z.uid=1,Z.prototype={cache:function(e){var t=e[this.expando];return t||(t={},K(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,r){var n,i=this.cache(e);if("string"==typeof t)i[X(t)]=r;else for(n in t)i[X(n)]=t[n];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,r){return void 0===t||t&&"string"==typeof t&&void 0===r?this.get(e,t):(this.set(e,t,r),void 0!==r?r:t)},remove:function(e,t){var r,n=e[this.expando];if(void 0!==n){if(void 0!==t){r=(t=Array.isArray(t)?t.map(X):(t=X(t))in n?[t]:t.match(N)||[]).length;for(;r--;)delete n[t[r]]}(void 0===t||D.isEmptyObject(n))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!D.isEmptyObject(t)}};var Q=new Z,J=new Z,ee=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,te=/[A-Z]/g;function re(e,t,r){var n;if(void 0===r&&1===e.nodeType)if(n="data-"+t.replace(te,"-$&").toLowerCase(),"string"==typeof(r=e.getAttribute(n))){try{r=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ee.test(e)?JSON.parse(e):e)}(r)}catch(e){}J.set(e,t,r)}else r=void 0;return r}D.extend({hasData:function(e){return J.hasData(e)||Q.hasData(e)},data:function(e,t,r){return J.access(e,t,r)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,r){return Q.access(e,t,r)},_removeData:function(e,t){Q.remove(e,t)}}),D.fn.extend({data:function(e,t){var r,n,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=J.get(o),1===o.nodeType&&!Q.get(o,"hasDataAttrs"))){for(r=a.length;r--;)a[r]&&0===(n=a[r].name).indexOf("data-")&&(n=X(n.slice(5)),re(o,n,i[n]));Q.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each((function(){J.set(this,e)})):G(this,(function(t){var r;if(o&&void 0===t)return void 0!==(r=J.get(o,e))?r:void 0!==(r=re(o,e))?r:void 0;this.each((function(){J.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){J.remove(this,e)}))}}),D.extend({queue:function(e,t,r){var n;if(e)return t=(t||"fx")+"queue",n=Q.get(e,t),r&&(!n||Array.isArray(r)?n=Q.access(e,t,D.makeArray(r)):n.push(r)),n||[]},dequeue:function(e,t){t=t||"fx";var r=D.queue(e,t),n=r.length,i=r.shift(),o=D._queueHooks(e,t);"inprogress"===i&&(i=r.shift(),n--),i&&("fx"===t&&r.unshift("inprogress"),delete o.stop,i.call(e,(function(){D.dequeue(e,t)}),o)),!n&&o&&o.empty.fire()},_queueHooks:function(e,t){var r=t+"queueHooks";return Q.get(e,r)||Q.access(e,r,{empty:D.Callbacks("once memory").add((function(){Q.remove(e,[t+"queue",r])}))})}}),D.fn.extend({queue:function(e,t){var r=2;return"string"!=typeof e&&(t=e,e="fx",r--),arguments.length<r?D.queue(this[0],e):void 0===t?this:this.each((function(){var r=D.queue(this,e,t);D._queueHooks(this,e),"fx"===e&&"inprogress"!==r[0]&&D.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){D.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var r,n=1,i=D.Deferred(),o=this,a=this.length,s=function(){--n||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(r=Q.get(o[a],e+"queueHooks"))&&r.empty&&(n++,r.empty.add(s));return s(),i.promise(t)}});var ne=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ie=new RegExp("^(?:([+-])=|)("+ne+")([a-z%]*)$","i"),oe=["Top","Right","Bottom","Left"],ae=a.documentElement,se=function(e){return D.contains(e.ownerDocument,e)},le={composed:!0};ae.getRootNode&&(se=function(e){return D.contains(e.ownerDocument,e)||e.getRootNode(le)===e.ownerDocument});var ue=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&se(e)&&"none"===D.css(e,"display")},ce=function(e,t,r,n){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=r.apply(e,n||[]),t)e.style[o]=a[o];return i};function fe(e,t,r,n){var i,o,a=20,s=n?function(){return n.cur()}:function(){return D.css(e,t,"")},l=s(),u=r&&r[3]||(D.cssNumber[t]?"":"px"),c=e.nodeType&&(D.cssNumber[t]||"px"!==u&&+l)&&ie.exec(D.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;a--;)D.style(e,t,c+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),c/=o;c*=2,D.style(e,t,c+u),r=r||[]}return r&&(c=+c||+l||0,i=r[1]?c+(r[1]+1)*r[2]:+r[2],n&&(n.unit=u,n.start=c,n.end=i)),i}var he={};function pe(e){var t,r=e.ownerDocument,n=e.nodeName,i=he[n];return i||(t=r.body.appendChild(r.createElement(n)),i=D.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),he[n]=i,i)}function de(e,t){for(var r,n,i=[],o=0,a=e.length;o<a;o++)(n=e[o]).style&&(r=n.style.display,t?("none"===r&&(i[o]=Q.get(n,"display")||null,i[o]||(n.style.display="")),""===n.style.display&&ue(n)&&(i[o]=pe(n))):"none"!==r&&(i[o]="none",Q.set(n,"display",r)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}D.fn.extend({show:function(){return de(this,!0)},hide:function(){return de(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){ue(this)?D(this).show():D(this).hide()}))}});var me=/^(?:checkbox|radio)$/i,ve=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,ge=/^$|^module$|\/(?:java|ecma)script/i,ye={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function be(e,t){var r;return r=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&$(e,t)?D.merge([e],r):r}function xe(e,t){for(var r=0,n=e.length;r<n;r++)Q.set(e[r],"globalEval",!t||Q.get(t[r],"globalEval"))}ye.optgroup=ye.option,ye.tbody=ye.tfoot=ye.colgroup=ye.caption=ye.thead,ye.th=ye.td;var we,_e,De=/<|&#?\w+;/;function Ae(e,t,r,n,i){for(var o,a,s,l,u,c,f=t.createDocumentFragment(),h=[],p=0,d=e.length;p<d;p++)if((o=e[p])||0===o)if("object"===_(o))D.merge(h,o.nodeType?[o]:o);else if(De.test(o)){for(a=a||f.appendChild(t.createElement("div")),s=(ve.exec(o)||["",""])[1].toLowerCase(),l=ye[s]||ye._default,a.innerHTML=l[1]+D.htmlPrefilter(o)+l[2],c=l[0];c--;)a=a.lastChild;D.merge(h,a.childNodes),(a=f.firstChild).textContent=""}else h.push(t.createTextNode(o));for(f.textContent="",p=0;o=h[p++];)if(n&&D.inArray(o,n)>-1)i&&i.push(o);else if(u=se(o),a=be(f.appendChild(o),"script"),u&&xe(a),r)for(c=0;o=a[c++];)ge.test(o.type||"")&&r.push(o);return f}we=a.createDocumentFragment().appendChild(a.createElement("div")),(_e=a.createElement("input")).setAttribute("type","radio"),_e.setAttribute("checked","checked"),_e.setAttribute("name","t"),we.appendChild(_e),g.checkClone=we.cloneNode(!0).cloneNode(!0).lastChild.checked,we.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!we.cloneNode(!0).lastChild.defaultValue;var Ce=/^key/,Se=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function Te(){return!0}function Me(){return!1}function $e(e,t){return e===function(){try{return a.activeElement}catch(e){}}()==("focus"===t)}function ze(e,t,r,n,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof r&&(n=n||r,r=void 0),t)ze(e,s,r,n,t[s],o);return e}if(null==n&&null==i?(i=r,n=r=void 0):null==i&&("string"==typeof r?(i=n,n=void 0):(i=n,n=r,r=void 0)),!1===i)i=Me;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return D().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=D.guid++)),e.each((function(){D.event.add(this,t,i,n,r)}))}function Le(e,t,r){r?(Q.set(e,t,!1),D.event.add(e,t,{namespace:!1,handler:function(e){var n,i,o=Q.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(D.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=l.call(arguments),Q.set(this,t,o),n=r(this,t),this[t](),o!==(i=Q.get(this,t))||n?Q.set(this,t,!1):i={},o!==i)return e.stopImmediatePropagation(),e.preventDefault(),i.value}else o.length&&(Q.set(this,t,{value:D.event.trigger(D.extend(o[0],D.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,t)&&D.event.add(e,t,Te)}D.event={global:{},add:function(e,t,r,n,i){var o,a,s,l,u,c,f,h,p,d,m,v=Q.get(e);if(v)for(r.handler&&(r=(o=r).handler,i=o.selector),i&&D.find.matchesSelector(ae,i),r.guid||(r.guid=D.guid++),(l=v.events)||(l=v.events={}),(a=v.handle)||(a=v.handle=function(t){return void 0!==D&&D.event.triggered!==t.type?D.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(N)||[""]).length;u--;)p=m=(s=Ee.exec(t[u])||[])[1],d=(s[2]||"").split(".").sort(),p&&(f=D.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=D.event.special[p]||{},c=D.extend({type:p,origType:m,data:n,handler:r,guid:r.guid,selector:i,needsContext:i&&D.expr.match.needsContext.test(i),namespace:d.join(".")},o),(h=l[p])||((h=l[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,n,d,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=r.guid)),i?h.splice(h.delegateCount++,0,c):h.push(c),D.event.global[p]=!0)},remove:function(e,t,r,n,i){var o,a,s,l,u,c,f,h,p,d,m,v=Q.hasData(e)&&Q.get(e);if(v&&(l=v.events)){for(u=(t=(t||"").match(N)||[""]).length;u--;)if(p=m=(s=Ee.exec(t[u])||[])[1],d=(s[2]||"").split(".").sort(),p){for(f=D.event.special[p]||{},h=l[p=(n?f.delegateType:f.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)c=h[o],!i&&m!==c.origType||r&&r.guid!==c.guid||s&&!s.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(h.splice(o,1),c.selector&&h.delegateCount--,f.remove&&f.remove.call(e,c));a&&!h.length&&(f.teardown&&!1!==f.teardown.call(e,d,v.handle)||D.removeEvent(e,p,v.handle),delete l[p])}else for(p in l)D.event.remove(e,p+t[u],r,n,!0);D.isEmptyObject(l)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,r,n,i,o,a,s=D.event.fix(e),l=new Array(arguments.length),u=(Q.get(this,"events")||{})[s.type]||[],c=D.event.special[s.type]||{};for(l[0]=s,t=1;t<arguments.length;t++)l[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){for(a=D.event.handlers.call(this,s,u),t=0;(i=a[t++])&&!s.isPropagationStopped();)for(s.currentTarget=i.elem,r=0;(o=i.handlers[r++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!1!==o.namespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(n=((D.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,l))&&!1===(s.result=n)&&(s.preventDefault(),s.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var r,n,i,o,a,s=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},r=0;r<l;r++)void 0===a[i=(n=t[r]).selector+" "]&&(a[i]=n.needsContext?D(i,this).index(u)>-1:D.find(i,this,null,[u]).length),a[i]&&o.push(n);o.length&&s.push({elem:u,handlers:o})}return u=this,l<t.length&&s.push({elem:u,handlers:t.slice(l)}),s},addProp:function(e,t){Object.defineProperty(D.Event.prototype,e,{enumerable:!0,configurable:!0,get:y(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[D.expando]?e:new D.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return me.test(t.type)&&t.click&&$(t,"input")&&Le(t,"click",Te),!1},trigger:function(e){var t=this||e;return me.test(t.type)&&t.click&&$(t,"input")&&Le(t,"click"),!0},_default:function(e){var t=e.target;return me.test(t.type)&&t.click&&$(t,"input")&&Q.get(t,"click")||$(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},D.removeEvent=function(e,t,r){e.removeEventListener&&e.removeEventListener(t,r)},D.Event=function(e,t){if(!(this instanceof D.Event))return new D.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Te:Me,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&D.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[D.expando]=!0},D.Event.prototype={constructor:D.Event,isDefaultPrevented:Me,isPropagationStopped:Me,isImmediatePropagationStopped:Me,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Te,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Te,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Te,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},D.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Ce.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Se.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},D.event.addProp),D.each({focus:"focusin",blur:"focusout"},(function(e,t){D.event.special[e]={setup:function(){return Le(this,e,$e),!1},trigger:function(){return Le(this,e),!0},delegateType:t}})),D.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){D.event.special[e]={delegateType:t,bindType:t,handle:function(e){var r,n=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===n||D.contains(n,i))||(e.type=o.origType,r=o.handler.apply(this,arguments),e.type=t),r}}})),D.fn.extend({on:function(e,t,r,n){return ze(this,e,t,r,n)},one:function(e,t,r,n){return ze(this,e,t,r,n,1)},off:function(e,t,r){var n,i;if(e&&e.preventDefault&&e.handleObj)return n=e.handleObj,D(e.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(r=t,t=void 0),!1===r&&(r=Me),this.each((function(){D.event.remove(this,e,r,t)}))}});var ke=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ie=/<script|<style|<link/i,Re=/checked\s*(?:[^=]|=\s*.checked.)/i,Oe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Fe(e,t){return $(e,"table")&&$(11!==t.nodeType?t:t.firstChild,"tr")&&D(e).children("tbody")[0]||e}function Ne(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Pe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function je(e,t){var r,n,i,o,a,s,l,u;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),u=o.events))for(i in delete a.handle,a.events={},u)for(r=0,n=u[i].length;r<n;r++)D.event.add(t,i,u[i][r]);J.hasData(e)&&(s=J.access(e),l=D.extend({},s),J.set(t,l))}}function Be(e,t){var r=t.nodeName.toLowerCase();"input"===r&&me.test(e.type)?t.checked=e.checked:"input"!==r&&"textarea"!==r||(t.defaultValue=e.defaultValue)}function Ue(e,t,r,n){t=u.apply([],t);var i,o,a,s,l,c,f=0,h=e.length,p=h-1,d=t[0],m=y(d);if(m||h>1&&"string"==typeof d&&!g.checkClone&&Re.test(d))return e.each((function(i){var o=e.eq(i);m&&(t[0]=d.call(this,i,o.html())),Ue(o,t,r,n)}));if(h&&(o=(i=Ae(t,e[0].ownerDocument,!1,e,n)).firstChild,1===i.childNodes.length&&(i=o),o||n)){for(s=(a=D.map(be(i,"script"),Ne)).length;f<h;f++)l=i,f!==p&&(l=D.clone(l,!0,!0),s&&D.merge(a,be(l,"script"))),r.call(e[f],l,f);if(s)for(c=a[a.length-1].ownerDocument,D.map(a,Pe),f=0;f<s;f++)l=a[f],ge.test(l.type||"")&&!Q.access(l,"globalEval")&&D.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?D._evalUrl&&!l.noModule&&D._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")}):w(l.textContent.replace(Oe,""),l,c))}return e}function Ve(e,t,r){for(var n,i=t?D.filter(t,e):e,o=0;null!=(n=i[o]);o++)r||1!==n.nodeType||D.cleanData(be(n)),n.parentNode&&(r&&se(n)&&xe(be(n,"script")),n.parentNode.removeChild(n));return e}D.extend({htmlPrefilter:function(e){return e.replace(ke,"<$1></$2>")},clone:function(e,t,r){var n,i,o,a,s=e.cloneNode(!0),l=se(e);if(!(g.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||D.isXMLDoc(e)))for(a=be(s),n=0,i=(o=be(e)).length;n<i;n++)Be(o[n],a[n]);if(t)if(r)for(o=o||be(e),a=a||be(s),n=0,i=o.length;n<i;n++)je(o[n],a[n]);else je(e,s);return(a=be(s,"script")).length>0&&xe(a,!l&&be(e,"script")),s},cleanData:function(e){for(var t,r,n,i=D.event.special,o=0;void 0!==(r=e[o]);o++)if(K(r)){if(t=r[Q.expando]){if(t.events)for(n in t.events)i[n]?D.event.remove(r,n):D.removeEvent(r,n,t.handle);r[Q.expando]=void 0}r[J.expando]&&(r[J.expando]=void 0)}}}),D.fn.extend({detach:function(e){return Ve(this,e,!0)},remove:function(e){return Ve(this,e)},text:function(e){return G(this,(function(e){return void 0===e?D.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Ue(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Fe(this,e).appendChild(e)}))},prepend:function(){return Ue(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Fe(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Ue(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Ue(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(D.cleanData(be(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return D.clone(this,e,t)}))},html:function(e){return G(this,(function(e){var t=this[0]||{},r=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ie.test(e)&&!ye[(ve.exec(e)||["",""])[1].toLowerCase()]){e=D.htmlPrefilter(e);try{for(;r<n;r++)1===(t=this[r]||{}).nodeType&&(D.cleanData(be(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return Ue(this,arguments,(function(t){var r=this.parentNode;D.inArray(this,e)<0&&(D.cleanData(be(this)),r&&r.replaceChild(t,this))}),e)}}),D.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){D.fn[e]=function(e){for(var r,n=[],i=D(e),o=i.length-1,a=0;a<=o;a++)r=a===o?this:this.clone(!0),D(i[a])[t](r),c.apply(n,r.get());return this.pushStack(n)}}));var qe=new RegExp("^("+ne+")(?!px)[a-z%]+$","i"),Ge=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=r),t.getComputedStyle(e)},He=new RegExp(oe.join("|"),"i");function We(e,t,r){var n,i,o,a,s=e.style;return(r=r||Ge(e))&&(""!==(a=r.getPropertyValue(t)||r[t])||se(e)||(a=D.style(e,t)),!g.pixelBoxStyles()&&qe.test(a)&&He.test(t)&&(n=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=r.width,s.width=n,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Ye(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ae.appendChild(u).appendChild(c);var e=r.getComputedStyle(c);n="1%"!==e.top,l=12===t(e.marginLeft),c.style.right="60%",s=36===t(e.right),i=36===t(e.width),c.style.position="absolute",o=12===t(c.offsetWidth/3),ae.removeChild(u),c=null}}function t(e){return Math.round(parseFloat(e))}var n,i,o,s,l,u=a.createElement("div"),c=a.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===c.style.backgroundClip,D.extend(g,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),s},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),o}}))}();var Xe=["Webkit","Moz","ms"],Ke=a.createElement("div").style,Ze={};function Qe(e){var t=D.cssProps[e]||Ze[e];return t||(e in Ke?e:Ze[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),r=Xe.length;r--;)if((e=Xe[r]+t)in Ke)return e}(e)||e)}var Je=/^(none|table(?!-c[ea]).+)/,et=/^--/,tt={position:"absolute",visibility:"hidden",display:"block"},rt={letterSpacing:"0",fontWeight:"400"};function nt(e,t,r){var n=ie.exec(t);return n?Math.max(0,n[2]-(r||0))+(n[3]||"px"):t}function it(e,t,r,n,i,o){var a="width"===t?1:0,s=0,l=0;if(r===(n?"border":"content"))return 0;for(;a<4;a+=2)"margin"===r&&(l+=D.css(e,r+oe[a],!0,i)),n?("content"===r&&(l-=D.css(e,"padding"+oe[a],!0,i)),"margin"!==r&&(l-=D.css(e,"border"+oe[a]+"Width",!0,i))):(l+=D.css(e,"padding"+oe[a],!0,i),"padding"!==r?l+=D.css(e,"border"+oe[a]+"Width",!0,i):s+=D.css(e,"border"+oe[a]+"Width",!0,i));return!n&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l}function ot(e,t,r){var n=Ge(e),i=(!g.boxSizingReliable()||r)&&"border-box"===D.css(e,"boxSizing",!1,n),o=i,a=We(e,t,n),s="offset"+t[0].toUpperCase()+t.slice(1);if(qe.test(a)){if(!r)return a;a="auto"}return(!g.boxSizingReliable()&&i||"auto"===a||!parseFloat(a)&&"inline"===D.css(e,"display",!1,n))&&e.getClientRects().length&&(i="border-box"===D.css(e,"boxSizing",!1,n),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+it(e,t,r||(i?"border":"content"),o,n,a)+"px"}function at(e,t,r,n,i){return new at.prototype.init(e,t,r,n,i)}D.extend({cssHooks:{opacity:{get:function(e,t){if(t){var r=We(e,"opacity");return""===r?"1":r}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,r,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),l=et.test(t),u=e.style;if(l||(t=Qe(s)),a=D.cssHooks[t]||D.cssHooks[s],void 0===r)return a&&"get"in a&&void 0!==(i=a.get(e,!1,n))?i:u[t];"string"===(o=typeof r)&&(i=ie.exec(r))&&i[1]&&(r=fe(e,t,i),o="number"),null!=r&&r==r&&("number"!==o||l||(r+=i&&i[3]||(D.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==r||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(r=a.set(e,r,n))||(l?u.setProperty(t,r):u[t]=r))}},css:function(e,t,r,n){var i,o,a,s=X(t);return et.test(t)||(t=Qe(s)),(a=D.cssHooks[t]||D.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,r)),void 0===i&&(i=We(e,t,n)),"normal"===i&&t in rt&&(i=rt[t]),""===r||r?(o=parseFloat(i),!0===r||isFinite(o)?o||0:i):i}}),D.each(["height","width"],(function(e,t){D.cssHooks[t]={get:function(e,r,n){if(r)return!Je.test(D.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,t,n):ce(e,tt,(function(){return ot(e,t,n)}))},set:function(e,r,n){var i,o=Ge(e),a=!g.scrollboxSize()&&"absolute"===o.position,s=(a||n)&&"border-box"===D.css(e,"boxSizing",!1,o),l=n?it(e,t,n,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-it(e,t,"border",!1,o)-.5)),l&&(i=ie.exec(r))&&"px"!==(i[3]||"px")&&(e.style[t]=r,r=D.css(e,t)),nt(0,r,l)}}})),D.cssHooks.marginLeft=Ye(g.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-ce(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),D.each({margin:"",padding:"",border:"Width"},(function(e,t){D.cssHooks[e+t]={expand:function(r){for(var n=0,i={},o="string"==typeof r?r.split(" "):[r];n<4;n++)i[e+oe[n]+t]=o[n]||o[n-2]||o[0];return i}},"margin"!==e&&(D.cssHooks[e+t].set=nt)})),D.fn.extend({css:function(e,t){return G(this,(function(e,t,r){var n,i,o={},a=0;if(Array.isArray(t)){for(n=Ge(e),i=t.length;a<i;a++)o[t[a]]=D.css(e,t[a],!1,n);return o}return void 0!==r?D.style(e,t,r):D.css(e,t)}),e,t,arguments.length>1)}}),D.Tween=at,at.prototype={constructor:at,init:function(e,t,r,n,i,o){this.elem=e,this.prop=r,this.easing=i||D.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=o||(D.cssNumber[r]?"":"px")},cur:function(){var e=at.propHooks[this.prop];return e&&e.get?e.get(this):at.propHooks._default.get(this)},run:function(e){var t,r=at.propHooks[this.prop];return this.options.duration?this.pos=t=D.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):at.propHooks._default.set(this),this}},at.prototype.init.prototype=at.prototype,at.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=D.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){D.fx.step[e.prop]?D.fx.step[e.prop](e):1!==e.elem.nodeType||!D.cssHooks[e.prop]&&null==e.elem.style[Qe(e.prop)]?e.elem[e.prop]=e.now:D.style(e.elem,e.prop,e.now+e.unit)}}},at.propHooks.scrollTop=at.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},D.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},D.fx=at.prototype.init,D.fx.step={};var st,lt,ut=/^(?:toggle|show|hide)$/,ct=/queueHooks$/;function ft(){lt&&(!1===a.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ft):r.setTimeout(ft,D.fx.interval),D.fx.tick())}function ht(){return r.setTimeout((function(){st=void 0})),st=Date.now()}function pt(e,t){var r,n=0,i={height:e};for(t=t?1:0;n<4;n+=2-t)i["margin"+(r=oe[n])]=i["padding"+r]=e;return t&&(i.opacity=i.width=e),i}function dt(e,t,r){for(var n,i=(mt.tweeners[t]||[]).concat(mt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(n=i[o].call(r,t,e))return n}function mt(e,t,r){var n,i,o=0,a=mt.prefilters.length,s=D.Deferred().always((function(){delete l.elem})),l=function(){if(i)return!1;for(var t=st||ht(),r=Math.max(0,u.startTime+u.duration-t),n=1-(r/u.duration||0),o=0,a=u.tweens.length;o<a;o++)u.tweens[o].run(n);return s.notifyWith(e,[u,n,r]),n<1&&a?r:(a||s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:D.extend({},t),opts:D.extend(!0,{specialEasing:{},easing:D.easing._default},r),originalProperties:t,originalOptions:r,startTime:st||ht(),duration:r.duration,tweens:[],createTween:function(t,r){var n=D.Tween(e,u.opts,t,r,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(n),n},stop:function(t){var r=0,n=t?u.tweens.length:0;if(i)return this;for(i=!0;r<n;r++)u.tweens[r].run(1);return t?(s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u,t])):s.rejectWith(e,[u,t]),this}}),c=u.props;for(!function(e,t){var r,n,i,o,a;for(r in e)if(i=t[n=X(r)],o=e[r],Array.isArray(o)&&(i=o[1],o=e[r]=o[0]),r!==n&&(e[n]=o,delete e[r]),(a=D.cssHooks[n])&&"expand"in a)for(r in o=a.expand(o),delete e[n],o)r in e||(e[r]=o[r],t[r]=i);else t[n]=i}(c,u.opts.specialEasing);o<a;o++)if(n=mt.prefilters[o].call(u,e,c,u.opts))return y(n.stop)&&(D._queueHooks(u.elem,u.opts.queue).stop=n.stop.bind(n)),n;return D.map(c,dt,u),y(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),D.fx.timer(D.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}D.Animation=D.extend(mt,{tweeners:{"*":[function(e,t){var r=this.createTween(e,t);return fe(r.elem,e,ie.exec(t),r),r}]},tweener:function(e,t){y(e)?(t=e,e=["*"]):e=e.match(N);for(var r,n=0,i=e.length;n<i;n++)r=e[n],mt.tweeners[r]=mt.tweeners[r]||[],mt.tweeners[r].unshift(t)},prefilters:[function(e,t,r){var n,i,o,a,s,l,u,c,f="width"in t||"height"in t,h=this,p={},d=e.style,m=e.nodeType&&ue(e),v=Q.get(e,"fxshow");for(n in r.queue||(null==(a=D._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,h.always((function(){h.always((function(){a.unqueued--,D.queue(e,"fx").length||a.empty.fire()}))}))),t)if(i=t[n],ut.test(i)){if(delete t[n],o=o||"toggle"===i,i===(m?"hide":"show")){if("show"!==i||!v||void 0===v[n])continue;m=!0}p[n]=v&&v[n]||D.style(e,n)}if((l=!D.isEmptyObject(t))||!D.isEmptyObject(p))for(n in f&&1===e.nodeType&&(r.overflow=[d.overflow,d.overflowX,d.overflowY],null==(u=v&&v.display)&&(u=Q.get(e,"display")),"none"===(c=D.css(e,"display"))&&(u?c=u:(de([e],!0),u=e.style.display||u,c=D.css(e,"display"),de([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===D.css(e,"float")&&(l||(h.done((function(){d.display=u})),null==u&&(c=d.display,u="none"===c?"":c)),d.display="inline-block")),r.overflow&&(d.overflow="hidden",h.always((function(){d.overflow=r.overflow[0],d.overflowX=r.overflow[1],d.overflowY=r.overflow[2]}))),l=!1,p)l||(v?"hidden"in v&&(m=v.hidden):v=Q.access(e,"fxshow",{display:u}),o&&(v.hidden=!m),m&&de([e],!0),h.done((function(){for(n in m||de([e]),Q.remove(e,"fxshow"),p)D.style(e,n,p[n])}))),l=dt(m?v[n]:0,n,h),n in v||(v[n]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?mt.prefilters.unshift(e):mt.prefilters.push(e)}}),D.speed=function(e,t,r){var n=e&&"object"==typeof e?D.extend({},e):{complete:r||!r&&t||y(e)&&e,duration:e,easing:r&&t||t&&!y(t)&&t};return D.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in D.fx.speeds?n.duration=D.fx.speeds[n.duration]:n.duration=D.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){y(n.old)&&n.old.call(this),n.queue&&D.dequeue(this,n.queue)},n},D.fn.extend({fadeTo:function(e,t,r,n){return this.filter(ue).css("opacity",0).show().end().animate({opacity:t},e,r,n)},animate:function(e,t,r,n){var i=D.isEmptyObject(e),o=D.speed(t,r,n),a=function(){var t=mt(this,D.extend({},e),o);(i||Q.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,r){var n=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each((function(){var t=!0,i=null!=e&&e+"queueHooks",o=D.timers,a=Q.get(this);if(i)a[i]&&a[i].stop&&n(a[i]);else for(i in a)a[i]&&a[i].stop&&ct.test(i)&&n(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(r),t=!1,o.splice(i,1));!t&&r||D.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,r=Q.get(this),n=r[e+"queue"],i=r[e+"queueHooks"],o=D.timers,a=n?n.length:0;for(r.finish=!0,D.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete r.finish}))}}),D.each(["toggle","show","hide"],(function(e,t){var r=D.fn[t];D.fn[t]=function(e,n,i){return null==e||"boolean"==typeof e?r.apply(this,arguments):this.animate(pt(t,!0),e,n,i)}})),D.each({slideDown:pt("show"),slideUp:pt("hide"),slideToggle:pt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){D.fn[e]=function(e,r,n){return this.animate(t,e,r,n)}})),D.timers=[],D.fx.tick=function(){var e,t=0,r=D.timers;for(st=Date.now();t<r.length;t++)(e=r[t])()||r[t]!==e||r.splice(t--,1);r.length||D.fx.stop(),st=void 0},D.fx.timer=function(e){D.timers.push(e),D.fx.start()},D.fx.interval=13,D.fx.start=function(){lt||(lt=!0,ft())},D.fx.stop=function(){lt=null},D.fx.speeds={slow:600,fast:200,_default:400},D.fn.delay=function(e,t){return e=D.fx&&D.fx.speeds[e]||e,t=t||"fx",this.queue(t,(function(t,n){var i=r.setTimeout(t,e);n.stop=function(){r.clearTimeout(i)}}))},function(){var e=a.createElement("input"),t=a.createElement("select").appendChild(a.createElement("option"));e.type="checkbox",g.checkOn=""!==e.value,g.optSelected=t.selected,(e=a.createElement("input")).value="t",e.type="radio",g.radioValue="t"===e.value}();var vt,gt=D.expr.attrHandle;D.fn.extend({attr:function(e,t){return G(this,D.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){D.removeAttr(this,e)}))}}),D.extend({attr:function(e,t,r){var n,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?D.prop(e,t,r):(1===o&&D.isXMLDoc(e)||(i=D.attrHooks[t.toLowerCase()]||(D.expr.match.bool.test(t)?vt:void 0)),void 0!==r?null===r?void D.removeAttr(e,t):i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:(e.setAttribute(t,r+""),r):i&&"get"in i&&null!==(n=i.get(e,t))?n:null==(n=D.find.attr(e,t))?void 0:n)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&$(e,"input")){var r=e.value;return e.setAttribute("type",t),r&&(e.value=r),t}}}},removeAttr:function(e,t){var r,n=0,i=t&&t.match(N);if(i&&1===e.nodeType)for(;r=i[n++];)e.removeAttribute(r)}}),vt={set:function(e,t,r){return!1===t?D.removeAttr(e,r):e.setAttribute(r,r),r}},D.each(D.expr.match.bool.source.match(/\w+/g),(function(e,t){var r=gt[t]||D.find.attr;gt[t]=function(e,t,n){var i,o,a=t.toLowerCase();return n||(o=gt[a],gt[a]=i,i=null!=r(e,t,n)?a:null,gt[a]=o),i}}));var yt=/^(?:input|select|textarea|button)$/i,bt=/^(?:a|area)$/i;function xt(e){return(e.match(N)||[]).join(" ")}function wt(e){return e.getAttribute&&e.getAttribute("class")||""}function _t(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(N)||[]}D.fn.extend({prop:function(e,t){return G(this,D.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[D.propFix[e]||e]}))}}),D.extend({prop:function(e,t,r){var n,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&D.isXMLDoc(e)||(t=D.propFix[t]||t,i=D.propHooks[t]),void 0!==r?i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:e[t]=r:i&&"get"in i&&null!==(n=i.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=D.find.attr(e,"tabindex");return t?parseInt(t,10):yt.test(e.nodeName)||bt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(D.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),D.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){D.propFix[this.toLowerCase()]=this})),D.fn.extend({addClass:function(e){var t,r,n,i,o,a,s,l=0;if(y(e))return this.each((function(t){D(this).addClass(e.call(this,t,wt(this)))}));if((t=_t(e)).length)for(;r=this[l++];)if(i=wt(r),n=1===r.nodeType&&" "+xt(i)+" "){for(a=0;o=t[a++];)n.indexOf(" "+o+" ")<0&&(n+=o+" ");i!==(s=xt(n))&&r.setAttribute("class",s)}return this},removeClass:function(e){var t,r,n,i,o,a,s,l=0;if(y(e))return this.each((function(t){D(this).removeClass(e.call(this,t,wt(this)))}));if(!arguments.length)return this.attr("class","");if((t=_t(e)).length)for(;r=this[l++];)if(i=wt(r),n=1===r.nodeType&&" "+xt(i)+" "){for(a=0;o=t[a++];)for(;n.indexOf(" "+o+" ")>-1;)n=n.replace(" "+o+" "," ");i!==(s=xt(n))&&r.setAttribute("class",s)}return this},toggleClass:function(e,t){var r=typeof e,n="string"===r||Array.isArray(e);return"boolean"==typeof t&&n?t?this.addClass(e):this.removeClass(e):y(e)?this.each((function(r){D(this).toggleClass(e.call(this,r,wt(this),t),t)})):this.each((function(){var t,i,o,a;if(n)for(i=0,o=D(this),a=_t(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==r||((t=wt(this))&&Q.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Q.get(this,"__className__")||""))}))},hasClass:function(e){var t,r,n=0;for(t=" "+e+" ";r=this[n++];)if(1===r.nodeType&&(" "+xt(wt(r))+" ").indexOf(t)>-1)return!0;return!1}});var Dt=/\r/g;D.fn.extend({val:function(e){var t,r,n,i=this[0];return arguments.length?(n=y(e),this.each((function(r){var i;1===this.nodeType&&(null==(i=n?e.call(this,r,D(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=D.map(i,(function(e){return null==e?"":e+""}))),(t=D.valHooks[this.type]||D.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=D.valHooks[i.type]||D.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(r=t.get(i,"value"))?r:"string"==typeof(r=i.value)?r.replace(Dt,""):null==r?"":r:void 0}}),D.extend({valHooks:{option:{get:function(e){var t=D.find.attr(e,"value");return null!=t?t:xt(D.text(e))}},select:{get:function(e){var t,r,n,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(n=o<0?l:a?o:0;n<l;n++)if(((r=i[n]).selected||n===o)&&!r.disabled&&(!r.parentNode.disabled||!$(r.parentNode,"optgroup"))){if(t=D(r).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var r,n,i=e.options,o=D.makeArray(t),a=i.length;a--;)((n=i[a]).selected=D.inArray(D.valHooks.option.get(n),o)>-1)&&(r=!0);return r||(e.selectedIndex=-1),o}}}}),D.each(["radio","checkbox"],(function(){D.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=D.inArray(D(e).val(),t)>-1}},g.checkOn||(D.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),g.focusin="onfocusin"in r;var At=/^(?:focusinfocus|focusoutblur)$/,Ct=function(e){e.stopPropagation()};D.extend(D.event,{trigger:function(e,t,n,i){var o,s,l,u,c,f,h,p,m=[n||a],v=d.call(e,"type")?e.type:e,g=d.call(e,"namespace")?e.namespace.split("."):[];if(s=p=l=n=n||a,3!==n.nodeType&&8!==n.nodeType&&!At.test(v+D.event.triggered)&&(v.indexOf(".")>-1&&(g=v.split("."),v=g.shift(),g.sort()),c=v.indexOf(":")<0&&"on"+v,(e=e[D.expando]?e:new D.Event(v,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:D.makeArray(t,[e]),h=D.event.special[v]||{},i||!h.trigger||!1!==h.trigger.apply(n,t))){if(!i&&!h.noBubble&&!b(n)){for(u=h.delegateType||v,At.test(u+v)||(s=s.parentNode);s;s=s.parentNode)m.push(s),l=s;l===(n.ownerDocument||a)&&m.push(l.defaultView||l.parentWindow||r)}for(o=0;(s=m[o++])&&!e.isPropagationStopped();)p=s,e.type=o>1?u:h.bindType||v,(f=(Q.get(s,"events")||{})[e.type]&&Q.get(s,"handle"))&&f.apply(s,t),(f=c&&s[c])&&f.apply&&K(s)&&(e.result=f.apply(s,t),!1===e.result&&e.preventDefault());return e.type=v,i||e.isDefaultPrevented()||h._default&&!1!==h._default.apply(m.pop(),t)||!K(n)||c&&y(n[v])&&!b(n)&&((l=n[c])&&(n[c]=null),D.event.triggered=v,e.isPropagationStopped()&&p.addEventListener(v,Ct),n[v](),e.isPropagationStopped()&&p.removeEventListener(v,Ct),D.event.triggered=void 0,l&&(n[c]=l)),e.result}},simulate:function(e,t,r){var n=D.extend(new D.Event,r,{type:e,isSimulated:!0});D.event.trigger(n,null,t)}}),D.fn.extend({trigger:function(e,t){return this.each((function(){D.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var r=this[0];if(r)return D.event.trigger(e,t,r,!0)}}),g.focusin||D.each({focus:"focusin",blur:"focusout"},(function(e,t){var r=function(e){D.event.simulate(t,e.target,D.event.fix(e))};D.event.special[t]={setup:function(){var n=this.ownerDocument||this,i=Q.access(n,t);i||n.addEventListener(e,r,!0),Q.access(n,t,(i||0)+1)},teardown:function(){var n=this.ownerDocument||this,i=Q.access(n,t)-1;i?Q.access(n,t,i):(n.removeEventListener(e,r,!0),Q.remove(n,t))}}}));var St=r.location,Et=Date.now(),Tt=/\?/;D.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||D.error("Invalid XML: "+e),t};var Mt=/\[\]$/,$t=/\r?\n/g,zt=/^(?:submit|button|image|reset|file)$/i,Lt=/^(?:input|select|textarea|keygen)/i;function kt(e,t,r,n){var i;if(Array.isArray(t))D.each(t,(function(t,i){r||Mt.test(e)?n(e,i):kt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,r,n)}));else if(r||"object"!==_(t))n(e,t);else for(i in t)kt(e+"["+i+"]",t[i],r,n)}D.param=function(e,t){var r,n=[],i=function(e,t){var r=y(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==r?"":r)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!D.isPlainObject(e))D.each(e,(function(){i(this.name,this.value)}));else for(r in e)kt(r,e[r],t,i);return n.join("&")},D.fn.extend({serialize:function(){return D.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=D.prop(this,"elements");return e?D.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!D(this).is(":disabled")&&Lt.test(this.nodeName)&&!zt.test(e)&&(this.checked||!me.test(e))})).map((function(e,t){var r=D(this).val();return null==r?null:Array.isArray(r)?D.map(r,(function(e){return{name:t.name,value:e.replace($t,"\r\n")}})):{name:t.name,value:r.replace($t,"\r\n")}})).get()}});var It=/%20/g,Rt=/#.*$/,Ot=/([?&])_=[^&]*/,Ft=/^(.*?):[ \t]*([^\r\n]*)$/gm,Nt=/^(?:GET|HEAD)$/,Pt=/^\/\//,jt={},Bt={},Ut="*/".concat("*"),Vt=a.createElement("a");function qt(e){return function(t,r){"string"!=typeof t&&(r=t,t="*");var n,i=0,o=t.toLowerCase().match(N)||[];if(y(r))for(;n=o[i++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(r)):(e[n]=e[n]||[]).push(r)}}function Gt(e,t,r,n){var i={},o=e===Bt;function a(s){var l;return i[s]=!0,D.each(e[s]||[],(function(e,s){var u=s(t,r,n);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)})),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Ht(e,t){var r,n,i=D.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((i[r]?e:n||(n={}))[r]=t[r]);return n&&D.extend(!0,e,n),e}Vt.href=St.href,D.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:St.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(St.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ut,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":D.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ht(Ht(e,D.ajaxSettings),t):Ht(D.ajaxSettings,e)},ajaxPrefilter:qt(jt),ajaxTransport:qt(Bt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,o,s,l,u,c,f,h,p,d=D.ajaxSetup({},t),m=d.context||d,v=d.context&&(m.nodeType||m.jquery)?D(m):D.event,g=D.Deferred(),y=D.Callbacks("once memory"),b=d.statusCode||{},x={},w={},_="canceled",A={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s)for(s={};t=Ft.exec(o);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==c&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)A.always(e[A.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||_;return n&&n.abort(t),C(0,t),this}};if(g.promise(A),d.url=((e||d.url||St.href)+"").replace(Pt,St.protocol+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(N)||[""],null==d.crossDomain){u=a.createElement("a");try{u.href=d.url,u.href=u.href,d.crossDomain=Vt.protocol+"//"+Vt.host!=u.protocol+"//"+u.host}catch(e){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=D.param(d.data,d.traditional)),Gt(jt,d,t,A),c)return A;for(h in(f=D.event&&d.global)&&0==D.active++&&D.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Nt.test(d.type),i=d.url.replace(Rt,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(It,"+")):(p=d.url.slice(i.length),d.data&&(d.processData||"string"==typeof d.data)&&(i+=(Tt.test(i)?"&":"?")+d.data,delete d.data),!1===d.cache&&(i=i.replace(Ot,"$1"),p=(Tt.test(i)?"&":"?")+"_="+Et+++p),d.url=i+p),d.ifModified&&(D.lastModified[i]&&A.setRequestHeader("If-Modified-Since",D.lastModified[i]),D.etag[i]&&A.setRequestHeader("If-None-Match",D.etag[i])),(d.data&&d.hasContent&&!1!==d.contentType||t.contentType)&&A.setRequestHeader("Content-Type",d.contentType),A.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Ut+"; q=0.01":""):d.accepts["*"]),d.headers)A.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(m,A,d)||c))return A.abort();if(_="abort",y.add(d.complete),A.done(d.success),A.fail(d.error),n=Gt(Bt,d,t,A)){if(A.readyState=1,f&&v.trigger("ajaxSend",[A,d]),c)return A;d.async&&d.timeout>0&&(l=r.setTimeout((function(){A.abort("timeout")}),d.timeout));try{c=!1,n.send(x,C)}catch(e){if(c)throw e;C(-1,e)}}else C(-1,"No Transport");function C(e,t,a,s){var u,h,p,x,w,_=t;c||(c=!0,l&&r.clearTimeout(l),n=void 0,o=s||"",A.readyState=e>0?4:0,u=e>=200&&e<300||304===e,a&&(x=function(e,t,r){for(var n,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(i in s)if(s[i]&&s[i].test(n)){l.unshift(i);break}if(l[0]in r)o=l[0];else{for(i in r){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),r[o]}(d,A,a)),x=function(e,t,r,n){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(r[e.responseFields[o]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(d,x,A,u),u?(d.ifModified&&((w=A.getResponseHeader("Last-Modified"))&&(D.lastModified[i]=w),(w=A.getResponseHeader("etag"))&&(D.etag[i]=w)),204===e||"HEAD"===d.type?_="nocontent":304===e?_="notmodified":(_=x.state,h=x.data,u=!(p=x.error))):(p=_,!e&&_||(_="error",e<0&&(e=0))),A.status=e,A.statusText=(t||_)+"",u?g.resolveWith(m,[h,_,A]):g.rejectWith(m,[A,_,p]),A.statusCode(b),b=void 0,f&&v.trigger(u?"ajaxSuccess":"ajaxError",[A,d,u?h:p]),y.fireWith(m,[A,_]),f&&(v.trigger("ajaxComplete",[A,d]),--D.active||D.event.trigger("ajaxStop")))}return A},getJSON:function(e,t,r){return D.get(e,t,r,"json")},getScript:function(e,t){return D.get(e,void 0,t,"script")}}),D.each(["get","post"],(function(e,t){D[t]=function(e,r,n,i){return y(r)&&(i=i||n,n=r,r=void 0),D.ajax(D.extend({url:e,type:t,dataType:i,data:r,success:n},D.isPlainObject(e)&&e))}})),D._evalUrl=function(e,t){return D.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){D.globalEval(e,t)}})},D.fn.extend({wrapAll:function(e){var t;return this[0]&&(y(e)&&(e=e.call(this[0])),t=D(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return y(e)?this.each((function(t){D(this).wrapInner(e.call(this,t))})):this.each((function(){var t=D(this),r=t.contents();r.length?r.wrapAll(e):t.append(e)}))},wrap:function(e){var t=y(e);return this.each((function(r){D(this).wrapAll(t?e.call(this,r):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){D(this).replaceWith(this.childNodes)})),this}}),D.expr.pseudos.hidden=function(e){return!D.expr.pseudos.visible(e)},D.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},D.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Wt={0:200,1223:204},Yt=D.ajaxSettings.xhr();g.cors=!!Yt&&"withCredentials"in Yt,g.ajax=Yt=!!Yt,D.ajaxTransport((function(e){var t,n;if(g.cors||Yt&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Wt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),n=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&r.setTimeout((function(){t&&n()}))},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),D.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),D.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return D.globalEval(e),e}}}),D.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),D.ajaxTransport("script",(function(e){var t,r;if(e.crossDomain||e.scriptAttrs)return{send:function(n,i){t=D("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",r=function(e){t.remove(),r=null,e&&i("error"===e.type?404:200,e.type)}),a.head.appendChild(t[0])},abort:function(){r&&r()}}}));var Xt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;D.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||D.expando+"_"+Et++;return this[e]=!0,e}}),D.ajaxPrefilter("json jsonp",(function(e,t,n){var i,o,a,s=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=y(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Zt,"$1"+i):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||D.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=r[i],r[i]=function(){a=arguments},n.always((function(){void 0===o?D(r).removeProp(i):r[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(i)),a&&y(o)&&o(a[0]),a=o=void 0})),"script"})),g.createHTMLDocument=((Xt=a.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Xt.childNodes.length),D.parseHTML=function(e,t,r){return"string"!=typeof e?[]:("boolean"==typeof t&&(r=t,t=!1),t||(g.createHTMLDocument?((n=(t=a.implementation.createHTMLDocument("")).createElement("base")).href=a.location.href,t.head.appendChild(n)):t=a),o=!r&&[],(i=z.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&D(o).remove(),D.merge([],i.childNodes)));var n,i,o},D.fn.load=function(e,t,r){var n,i,o,a=this,s=e.indexOf(" ");return s>-1&&(n=xt(e.slice(s)),e=e.slice(0,s)),y(t)?(r=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&D.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done((function(e){o=arguments,a.html(n?D("<div>").append(D.parseHTML(e)).find(n):e)})).always(r&&function(e,t){a.each((function(){r.apply(this,o||[e.responseText,t,e])}))}),this},D.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){D.fn[t]=function(e){return this.on(t,e)}})),D.expr.pseudos.animated=function(e){return D.grep(D.timers,(function(t){return e===t.elem})).length},D.offset={setOffset:function(e,t,r){var n,i,o,a,s,l,u=D.css(e,"position"),c=D(e),f={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=D.css(e,"top"),l=D.css(e,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(a=(n=c.position()).top,i=n.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),y(t)&&(t=t.call(e,r,D.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},D.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){D.offset.setOffset(this,e,t)}));var t,r,n=this[0];return n?n.getClientRects().length?(t=n.getBoundingClientRect(),r=n.ownerDocument.defaultView,{top:t.top+r.pageYOffset,left:t.left+r.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,r,n=this[0],i={top:0,left:0};if("fixed"===D.css(n,"position"))t=n.getBoundingClientRect();else{for(t=this.offset(),r=n.ownerDocument,e=n.offsetParent||r.documentElement;e&&(e===r.body||e===r.documentElement)&&"static"===D.css(e,"position");)e=e.parentNode;e&&e!==n&&1===e.nodeType&&((i=D(e).offset()).top+=D.css(e,"borderTopWidth",!0),i.left+=D.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-D.css(n,"marginTop",!0),left:t.left-i.left-D.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===D.css(e,"position");)e=e.offsetParent;return e||ae}))}}),D.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var r="pageYOffset"===t;D.fn[e]=function(n){return G(this,(function(e,n,i){var o;if(b(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[n];o?o.scrollTo(r?o.pageXOffset:i,r?i:o.pageYOffset):e[n]=i}),e,n,arguments.length)}})),D.each(["top","left"],(function(e,t){D.cssHooks[t]=Ye(g.pixelPosition,(function(e,r){if(r)return r=We(e,t),qe.test(r)?D(e).position()[t]+"px":r}))})),D.each({Height:"height",Width:"width"},(function(e,t){D.each({padding:"inner"+e,content:t,"":"outer"+e},(function(r,n){D.fn[n]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(!0===i||!0===o?"margin":"border");return G(this,(function(t,r,i){var o;return b(t)?0===n.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?D.css(t,r,s):D.style(t,r,i,s)}),t,a?i:void 0,a)}}))})),D.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(e,t){D.fn[t]=function(e,r){return arguments.length>0?this.on(t,null,e,r):this.trigger(t)}})),D.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),D.fn.extend({bind:function(e,t,r){return this.on(e,null,t,r)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,r,n){return this.on(t,e,r,n)},undelegate:function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)}}),D.proxy=function(e,t){var r,n,i;if("string"==typeof t&&(r=e[t],t=e,e=r),y(e))return n=l.call(arguments,2),(i=function(){return e.apply(t||this,n.concat(l.call(arguments)))}).guid=e.guid=e.guid||D.guid++,i},D.holdReady=function(e){e?D.readyWait++:D.ready(!0)},D.isArray=Array.isArray,D.parseJSON=JSON.parse,D.nodeName=$,D.isFunction=y,D.isWindow=b,D.camelCase=X,D.type=_,D.now=Date.now,D.isNumeric=function(e){var t=D.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},void 0===(n=function(){return D}.apply(t,[]))||(e.exports=n);var Qt=r.jQuery,Jt=r.$;return D.noConflict=function(e){return r.$===D&&(r.$=Jt),e&&r.jQuery===D&&(r.jQuery=Qt),D},i||(r.jQuery=r.$=D),D}))}}]);
  //# sourceMappingURL=async-moleculeviewer3.js.map