UNPKG

@chemistry/mol3dview

Version:
24 lines 294 kB
!function(e,y){"object"==typeof exports&&"object"==typeof module?module.exports=y():"function"==typeof define&&define.amd?define("mol3dview",[],y):"object"==typeof exports?exports.mol3dview=y():e.mol3dview=y()}(this,function(){return function(e){function y(x){if(t[x])return t[x].exports;var z=t[x]={i:x,l:!1,exports:{}};return e[x].call(z.exports,z,z.exports,y),z.l=!0,z.exports}var t={};return y.m=e,y.c=t,y.d=function(e,t,x){y.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:x})},y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,"a",t),t},y.o=function(e,y){return Object.prototype.hasOwnProperty.call(e,y)},y.p="",y(y.s=2)}([function(e,y,t){!function(y,t){e.exports=t()}(0,function(){return function(e){function y(x){if(t[x])return t[x].exports;var z=t[x]={i:x,l:!1,exports:{}};return e[x].call(z.exports,z,z.exports,y),z.l=!0,z.exports}var t={};return y.m=e,y.c=t,y.d=function(e,t,x){y.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:x})},y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,"a",t),t},y.o=function(e,y){return Object.prototype.hasOwnProperty.call(e,y)},y.p="",y(y.s=2)}([function(e,y,t){"use strict";Object.defineProperty(y,"__esModule",{value:!0}),y.EPSILON=1e-8},function(e,y,t){"use strict";Object.defineProperty(y,"__esModule",{value:!0});var x=t(0),z=function(){function e(e,y,t){this.x=e,this.y=y,this.z=t}return e.add=function(y,t){return new e(y.x+t.x,y.y+t.y,y.z+t.z)},e.sub=function(y,t){return new e(y.x-t.x,y.y-t.y,y.z-t.z)},e.dot=function(e,y){return e.x*y.x+e.y*y.y+e.z*y.z},e.cross=function(y,t){return new e(y.y*t.z-y.z*t.y,y.z*t.x-y.x*t.z,y.x*t.y-y.y*t.x)},e.equal=function(e,y){return Math.abs(e.x-y.x)<x.EPSILON&&Math.abs(e.y-y.y)<x.EPSILON&&Math.abs(e.z-y.z)<x.EPSILON},e.getDecimal=function(y){return new e(y.x-Math.floor(y.x),y.y-Math.floor(y.y),y.z-Math.floor(y.z))},Object.defineProperty(e.prototype,"length",{get:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lengthPow2",{get:function(){return this.x*this.x+this.y*this.y+this.z*this.z},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"avg",{get:function(){return(this.x+this.y+this.z)/3},enumerable:!0,configurable:!0}),e.prototype.scale=function(y){return new e(this.x*y,this.y*y,this.z*y)},e.prototype.normalize=function(){var y=this.length;if(0===y)throw new Error("Can not normalize zero vector");return new e(this.x/y,this.y/y,this.z/y)},e.prototype.dot=function(y){return e.dot(this,y)},e.prototype.sub=function(y){return e.sub(this,y)},e.prototype.add=function(y){return e.add(this,y)},e.prototype.equal=function(y){return e.equal(this,y)},e.prototype.clone=function(){return new e(this.x,this.y,this.z)},e.prototype.toString=function(){return"("+this.x.toFixed(3)+","+this.y.toFixed(3)+","+this.z.toFixed(3)+")"},e}();y.default=z},function(e,y,t){"use strict";Object.defineProperty(y,"__esModule",{value:!0});var x=t(3);y.Matrix3x3=x.default;var z=t(4);y.Matrix3x4=z.default;var n=t(5);y.Transform3D=n.default;var i=t(1);y.Vec3=i.default},function(e,y,t){"use strict";Object.defineProperty(y,"__esModule",{value:!0});var x=t(0),z=t(1),n=function(){function e(e){this.elements=e&&9===e.length?e.slice(0):[1,0,0,0,1,0,0,0,1]}return e.equal=function(e,y){return Math.abs(e.elements[0]-y.elements[0])<x.EPSILON&&Math.abs(e.elements[1]-y.elements[1])<x.EPSILON&&Math.abs(e.elements[2]-y.elements[2])<x.EPSILON&&Math.abs(e.elements[3]-y.elements[3])<x.EPSILON&&Math.abs(e.elements[4]-y.elements[4])<x.EPSILON&&Math.abs(e.elements[5]-y.elements[5])<x.EPSILON&&Math.abs(e.elements[6]-y.elements[6])<x.EPSILON&&Math.abs(e.elements[7]-y.elements[7])<x.EPSILON&&Math.abs(e.elements[8]-y.elements[8])<x.EPSILON},e.inverse=function(y){var t=y.determinant();if(0===t)throw new Error("Matrix not invertable");return new e([(y.get(1,1)*y.get(2,2)-y.get(1,2)*y.get(2,1))/t,(-y.get(0,1)*y.get(2,2)+y.get(0,2)*y.get(2,1))/t,(y.get(0,1)*y.get(1,2)-y.get(0,2)*y.get(1,1))/t,(-y.get(1,0)*y.get(2,2)+y.get(1,2)*y.get(2,0))/t,(y.get(0,0)*y.get(2,2)-y.get(0,2)*y.get(2,0))/t,(-y.get(0,0)*y.get(1,2)+y.get(0,2)*y.get(1,0))/t,(y.get(1,0)*y.get(2,1)-y.get(1,1)*y.get(2,0))/t,(-y.get(0,0)*y.get(2,1)+y.get(0,1)*y.get(2,0))/t,(y.get(0,0)*y.get(1,1)-y.get(0,1)*y.get(1,0))/t])},e.prototype.set=function(e,y,t){if(e>3||e<0||y>3||y<0)throw new Error("Wrong coefficients");this.elements[3*e+y]=t},e.prototype.get=function(e,y){if(e>3||e<0||y>3||y<0)throw new Error("Wrong coefficients");return this.elements[3*e+y]},e.prototype.scale=function(y){return new e([this.elements[0]*y,this.elements[1]*y,this.elements[2]*y,this.elements[3]*y,this.elements[4]*y,this.elements[5]*y,this.elements[6]*y,this.elements[7]*y,this.elements[8]*y])},e.prototype.project=function(e){return new z.default(this.elements[0]*e.x+this.elements[1]*e.y+this.elements[2]*e.z,this.elements[3]*e.x+this.elements[4]*e.y+this.elements[5]*e.z,this.elements[6]*e.x+this.elements[7]*e.y+this.elements[8]*e.z)},e.prototype.multiply=function(y){return new e([this.elements[0]*y.elements[0]+this.elements[3]*y.elements[1]+this.elements[6]*y.elements[2],this.elements[1]*y.elements[0]+this.elements[4]*y.elements[1]+this.elements[7]*y.elements[2],this.elements[2]*y.elements[0]+this.elements[5]*y.elements[1]+this.elements[8]*y.elements[2],this.elements[0]*y.elements[3]+this.elements[3]*y.elements[4]+this.elements[6]*y.elements[5],this.elements[1]*y.elements[3]+this.elements[4]*y.elements[4]+this.elements[7]*y.elements[5],this.elements[2]*y.elements[3]+this.elements[5]*y.elements[4]+this.elements[8]*y.elements[5],this.elements[0]*y.elements[6]+this.elements[3]*y.elements[7]+this.elements[6]*y.elements[8],this.elements[1]*y.elements[6]+this.elements[4]*y.elements[7]+this.elements[7]*y.elements[8],this.elements[2]*y.elements[6]+this.elements[5]*y.elements[7]+this.elements[8]*y.elements[8]])},e.prototype.determinant=function(){var e=this.get(0,0)*(this.get(1,1)*this.get(2,2)-this.get(2,1)*this.get(1,2));return e-=this.get(1,0)*(this.get(0,1)*this.get(2,2)-this.get(2,1)*this.get(0,2)),e+=this.get(2,0)*(this.get(0,1)*this.get(1,2)-this.get(1,1)*this.get(0,2))},e.prototype.clone=function(){return new e(this.elements.slice(0))},e.prototype.equal=function(y){return e.equal(this,y)},e.prototype.toString=function(){return"("+[this.elements[0].toFixed(3),this.elements[1].toFixed(3),this.elements[2].toFixed(3),this.elements[3].toFixed(3),this.elements[4].toFixed(3),this.elements[5].toFixed(3),this.elements[6].toFixed(3),this.elements[7].toFixed(3),this.elements[8].toFixed(3)].join(",")+")"},e}();y.default=n},function(e,y,t){"use strict";Object.defineProperty(y,"__esModule",{value:!0});var x=t(0),z=t(1),n=function(){function e(e){this.elements=e&&12===e.length?e.slice(0):[1,0,0,0,0,1,0,0,0,0,1,0]}return e.add=function(y,t){var x=y.elements,z=t.elements;return new e([x[0]+z[0],x[1]+z[1],x[2]+z[2],x[3]+z[3],x[4]+z[4],x[5]+z[5],x[6]+z[6],x[7]+z[7],x[8]+z[8],x[9]+z[9],x[10]+z[10],x[11]+z[11]])},e.sub=function(y,t){var x=y.elements,z=t.elements;return new e([x[0]-z[0],x[1]-z[1],x[2]-z[2],x[3]-z[3],x[4]-z[4],x[5]-z[5],x[6]-z[6],x[7]-z[7],x[8]-z[8],x[9]-z[9],x[10]-z[10],x[11]-z[11]])},e.inverse=function(y){var t,x,z=[],n=y.elements.slice(0,12);for(n[12]=0,n[13]=0,n[14]=0,n[15]=1,z[0]=n[5]*n[10]*n[15]-n[5]*n[14]*n[11]-n[6]*n[9]*n[15]+n[6]*n[13]*n[11]+n[7]*n[9]*n[14]-n[7]*n[13]*n[10],z[1]=-n[1]*n[10]*n[15]+n[1]*n[14]*n[11]+n[2]*n[9]*n[15]-n[2]*n[13]*n[11]-n[3]*n[9]*n[14]+n[3]*n[13]*n[10],z[2]=n[1]*n[6]*n[15]-n[1]*n[14]*n[7]-n[2]*n[5]*n[15]+n[2]*n[13]*n[7]+n[3]*n[5]*n[14]-n[3]*n[13]*n[6],z[3]=-n[1]*n[6]*n[11]+n[1]*n[10]*n[7]+n[2]*n[5]*n[11]-n[2]*n[9]*n[7]-n[3]*n[5]*n[10]+n[3]*n[9]*n[6],z[4]=-n[4]*n[10]*n[15]+n[4]*n[14]*n[11]+n[6]*n[8]*n[15]-n[6]*n[12]*n[11]-n[7]*n[8]*n[14]+n[7]*n[12]*n[10],z[5]=n[0]*n[10]*n[15]-n[0]*n[14]*n[11]-n[2]*n[8]*n[15]+n[2]*n[12]*n[11]+n[3]*n[8]*n[14]-n[3]*n[12]*n[10],z[6]=-n[0]*n[6]*n[15]+n[0]*n[14]*n[7]+n[2]*n[4]*n[15]-n[2]*n[12]*n[7]-n[3]*n[4]*n[14]+n[3]*n[12]*n[6],z[7]=n[0]*n[6]*n[11]-n[0]*n[10]*n[7]-n[2]*n[4]*n[11]+n[2]*n[8]*n[7]+n[3]*n[4]*n[10]-n[3]*n[8]*n[6],z[8]=n[4]*n[9]*n[15]-n[4]*n[13]*n[11]-n[5]*n[8]*n[15]+n[5]*n[12]*n[11]+n[7]*n[8]*n[13]-n[7]*n[12]*n[9],z[9]=-n[0]*n[9]*n[15]+n[0]*n[13]*n[11]+n[1]*n[8]*n[15]-n[1]*n[12]*n[11]-n[3]*n[8]*n[13]+n[3]*n[12]*n[9],z[10]=n[0]*n[5]*n[15]-n[0]*n[13]*n[7]-n[1]*n[4]*n[15]+n[1]*n[12]*n[7]+n[3]*n[4]*n[13]-n[3]*n[12]*n[5],z[11]=-n[0]*n[5]*n[11]+n[0]*n[9]*n[7]+n[1]*n[4]*n[11]-n[1]*n[8]*n[7]-n[3]*n[4]*n[9]+n[3]*n[8]*n[5],z[12]=-n[4]*n[9]*n[14]+n[4]*n[13]*n[10]+n[5]*n[8]*n[14]-n[5]*n[12]*n[10]-n[6]*n[8]*n[13]+n[6]*n[12]*n[9],z[13]=n[0]*n[9]*n[14]-n[0]*n[13]*n[10]-n[1]*n[8]*n[14]+n[1]*n[12]*n[10]+n[2]*n[8]*n[13]-n[2]*n[12]*n[9],z[14]=-n[0]*n[5]*n[14]+n[0]*n[13]*n[6]+n[1]*n[4]*n[14]-n[1]*n[12]*n[6]-n[2]*n[4]*n[13]+n[2]*n[12]*n[5],z[15]=n[0]*n[5]*n[10]-n[0]*n[9]*n[6]-n[1]*n[4]*n[10]+n[1]*n[8]*n[6]+n[2]*n[4]*n[9]-n[2]*n[8]*n[5],x=n[0]*z[0]+n[1]*z[4]+n[2]*z[8]+n[3]*z[12],t=0;t<16;t++)z[t]/=x;return new e(z.slice(0,12))},e.isE=function(e){return Math.abs(e.elements[0]-1)<x.EPSILON&&Math.abs(e.elements[1]-0)<x.EPSILON&&Math.abs(e.elements[2]-0)<x.EPSILON&&Math.abs(e.elements[3]-0)<x.EPSILON&&Math.abs(e.elements[4]-0)<x.EPSILON&&Math.abs(e.elements[5]-1)<x.EPSILON&&Math.abs(e.elements[6]-0)<x.EPSILON&&Math.abs(e.elements[7]-0)<x.EPSILON&&Math.abs(e.elements[8]-0)<x.EPSILON&&Math.abs(e.elements[9]-0)<x.EPSILON&&Math.abs(e.elements[10]-1)<x.EPSILON&&Math.abs(e.elements[11]-0)<x.EPSILON},e.equal=function(e,y){return Math.abs(e.elements[0]-y.elements[0])<x.EPSILON&&Math.abs(e.elements[1]-y.elements[1])<x.EPSILON&&Math.abs(e.elements[2]-y.elements[2])<x.EPSILON&&Math.abs(e.elements[3]-y.elements[3])<x.EPSILON&&Math.abs(e.elements[4]-y.elements[4])<x.EPSILON&&Math.abs(e.elements[5]-y.elements[5])<x.EPSILON&&Math.abs(e.elements[6]-y.elements[6])<x.EPSILON&&Math.abs(e.elements[7]-y.elements[7])<x.EPSILON&&Math.abs(e.elements[8]-y.elements[8])<x.EPSILON&&Math.abs(e.elements[9]-y.elements[9])<x.EPSILON&&Math.abs(e.elements[10]-y.elements[10])<x.EPSILON&&Math.abs(e.elements[11]-y.elements[11])<x.EPSILON},e.prototype.set=function(e,y,t){if(e>3||e<0||y>4||y<0)throw new Error("Wrong coefficients");this.elements[4*e+y]=t},e.prototype.get=function(e,y){if(e>3||e<0||y>4||y<0)throw new Error("Incorrect coeficients");return this.elements[4*e+y]},e.prototype.add=function(y){return e.add(this,y)},e.prototype.sub=function(y){return e.sub(this,y)},e.prototype.translate=function(y){var t=this.elements.slice(0);return t[3]=t[3]+y.x,t[7]=t[7]+y.y,t[11]=t[11]+y.z,new e(t)},e.prototype.scale=function(y){return new e([this.elements[0]*y,this.elements[1]*y,this.elements[2]*y,this.elements[3]*y,this.elements[4]*y,this.elements[5]*y,this.elements[6]*y,this.elements[7]*y,this.elements[8]*y,this.elements[9]*y,this.elements[10]*y,this.elements[11]*y])},e.prototype.project=function(e){return new z.default(this.elements[0]*e.x+this.elements[1]*e.y+this.elements[2]*e.z+this.elements[3],this.elements[4]*e.x+this.elements[5]*e.y+this.elements[6]*e.z+this.elements[7],this.elements[8]*e.x+this.elements[9]*e.y+this.elements[10]*e.z+this.elements[11])},e.prototype.multiply=function(y){var t=[0,0,0,0,0,0,0,0,0,0,0,0];return t[0]=y.elements[0]*this.elements[0]+y.elements[4]*this.elements[1]+y.elements[8]*this.elements[2],t[1]=y.elements[1]*this.elements[0]+y.elements[5]*this.elements[1]+y.elements[9]*this.elements[2],t[2]=y.elements[2]*this.elements[0]+y.elements[6]*this.elements[1]+y.elements[10]*this.elements[2],t[3]=y.elements[3]*this.elements[0]+y.elements[7]*this.elements[1]+y.elements[11]*this.elements[2]+this.elements[3],t[4]=y.elements[0]*this.elements[4]+y.elements[4]*this.elements[5]+y.elements[8]*this.elements[6],t[5]=y.elements[1]*this.elements[4]+y.elements[5]*this.elements[5]+y.elements[9]*this.elements[6],t[6]=y.elements[2]*this.elements[4]+y.elements[6]*this.elements[5]+y.elements[10]*this.elements[6],t[7]=y.elements[3]*this.elements[4]+y.elements[7]*this.elements[5]+y.elements[11]*this.elements[6]+this.elements[7],t[8]=y.elements[0]*this.elements[8]+y.elements[4]*this.elements[9]+y.elements[8]*this.elements[10],t[9]=y.elements[1]*this.elements[8]+y.elements[5]*this.elements[9]+y.elements[9]*this.elements[10],t[10]=y.elements[2]*this.elements[8]+y.elements[6]*this.elements[9]+y.elements[10]*this.elements[10],t[11]=y.elements[3]*this.elements[8]+y.elements[7]*this.elements[9]+y.elements[11]*this.elements[10]+this.elements[11],new e(t)},e.prototype.inverse=function(){return e.inverse(this)},e.prototype.isE=function(){return e.isE(this)},e.prototype.equal=function(y){return e.equal(this,y)},e.prototype.clone=function(){return new e(this.elements)},e.prototype.toString=function(){return"("+this.elements.slice(0,12).map(function(e){return e.toFixed(3)})+")"},e.prototype.toSymetryCode=function(){function e(e,y,t,x){var z=[];return 0!==e&&z.push(e.toFixed(3)+"*x"),0!==y&&z.push(y.toFixed(3)+"*y"),0!==t&&z.push(t.toFixed(3)+"*z"),0!==x&&z.push(x.toFixed(3)),z.join("+")}return e(this.elements[0],this.elements[1],this.elements[2],this.elements[3])+", "+e(this.elements[4],this.elements[5],this.elements[6],this.elements[7])+", "+e(this.elements[8],this.elements[9],this.elements[10],this.elements[11])},e}();y.default=n},function(e,y,t){"use strict";Object.defineProperty(y,"__esModule",{value:!0});var x=t(0),z=t(6),n=t(1),i=function(){function e(e){if(e&&e.length){if(16!==e.length)throw new Error("Wrong array length. expected 16");return void(this.elements=e.slice(0))}this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}return e.equal=function(e,y){return Math.abs(e.elements[0]-y.elements[0])<x.EPSILON&&Math.abs(e.elements[1]-y.elements[1])<x.EPSILON&&Math.abs(e.elements[2]-y.elements[2])<x.EPSILON&&Math.abs(e.elements[3]-y.elements[3])<x.EPSILON&&Math.abs(e.elements[4]-y.elements[4])<x.EPSILON&&Math.abs(e.elements[5]-y.elements[5])<x.EPSILON&&Math.abs(e.elements[6]-y.elements[6])<x.EPSILON&&Math.abs(e.elements[7]-y.elements[7])<x.EPSILON&&Math.abs(e.elements[8]-y.elements[8])<x.EPSILON&&Math.abs(e.elements[9]-y.elements[9])<x.EPSILON&&Math.abs(e.elements[10]-y.elements[10])<x.EPSILON&&Math.abs(e.elements[11]-y.elements[11])<x.EPSILON&&Math.abs(e.elements[12]-y.elements[12])<x.EPSILON&&Math.abs(e.elements[13]-y.elements[13])<x.EPSILON&&Math.abs(e.elements[14]-y.elements[14])<x.EPSILON&&Math.abs(e.elements[15]-y.elements[15])<x.EPSILON},e.fromScale=function(y){return new e([y,0,0,0,0,y,0,0,0,0,y,0,0,0,0,1])},e.fromQuaternion=function(y){var t=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],x=y.X()+y.X(),z=y.Y()+y.Y(),n=y.Z()+y.Z(),i=y.X()*x,o=y.X()*z,s=y.X()*n,r=y.Y()*z,a=y.Y()*n,h=y.Z()*n,c=y.W()*x,u=y.W()*z,l=y.W()*n;return t[3]=t[7]=t[11]=t[12]=t[13]=t[14]=0,t[15]=1,t[0]=1-(r+h),t[4]=o+l,t[8]=s-u,t[1]=o-l,t[5]=1-(i+h),t[9]=a+c,t[2]=s+u,t[6]=a-c,t[10]=1-(i+r),new e(t)},e.fromMultiplication=function(y,t){var x=y.elements,z=t.elements;return new e([x[0]*z[0]+x[1]*z[4]+x[2]*z[8]+x[3]*z[12],x[0]*z[1]+x[1]*z[5]+x[2]*z[9]+x[3]*z[13],x[0]*z[2]+x[1]*z[6]+x[2]*z[10]+x[3]*z[14],x[0]*z[3]+x[1]*z[7]+x[2]*z[11]+x[3]*z[15],x[4]*z[0]+x[5]*z[4]+x[6]*z[8]+x[7]*z[12],x[4]*z[1]+x[5]*z[5]+x[6]*z[9]+x[7]*z[13],x[4]*z[2]+x[5]*z[6]+x[6]*z[10]+x[7]*z[14],x[4]*z[3]+x[5]*z[7]+x[6]*z[11]+x[7]*z[15],x[8]*z[0]+x[9]*z[4]+x[10]*z[8]+x[11]*z[12],x[8]*z[1]+x[9]*z[5]+x[10]*z[9]+x[11]*z[13],x[8]*z[2]+x[9]*z[6]+x[10]*z[10]+x[11]*z[14],x[8]*z[3]+x[9]*z[7]+x[10]*z[11]+x[11]*z[15],x[12]*z[0]+x[13]*z[4]+x[14]*z[8]+x[15]*z[12],x[12]*z[1]+x[13]*z[5]+x[14]*z[9]+x[15]*z[13],x[12]*z[2]+x[13]*z[6]+x[14]*z[10]+x[15]*z[14],x[12]*z[3]+x[13]*z[7]+x[14]*z[11]+x[15]*z[15]])},e.fromTranslation=function(y){return new e([1,0,0,0,0,1,0,0,0,0,1,0,y.x,y.y,y.z,1])},e.fromRotation=function(y,t){var x=z.default.fromAxisAngle(y,t);return e.fromQuaternion(x)},e.prototype.toString=function(){return"("+this.elements.slice(0,16).map(function(e){return e.toFixed(3)})+")"},e.prototype.set=function(e,y,t){if(e>4||e<0||y>4||y<0)throw new Error("Incorrect coeficients");this.elements[e+4*y]=t},e.prototype.get=function(e,y){if(e>4||e<0||y>4||y<0)throw new Error("Incorrect coeficients");return this.elements[e+4*y]},e.prototype.project=function(e){var y=this.elements[0]*e.x+this.elements[4]*e.y+this.elements[8]*e.z+this.elements[12],t=this.elements[1]*e.x+this.elements[5]*e.y+this.elements[9]*e.z+this.elements[13],x=this.elements[2]*e.x+this.elements[6]*e.y+this.elements[10]*e.z+this.elements[14];return new n.default(y,t,x)},e.prototype.rotate=function(y,t){var x=z.default.fromAxisAngle(y,t),n=e.fromQuaternion(x);return e.fromMultiplication(this,n)},e.prototype.translate=function(y){var t=this.elements;return new e([t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12]+y.x,t[13]+y.y,t[14]+y.z,t[15]])},e.prototype.extractTranslation=function(){return new n.default(this.elements[12],this.elements[13],this.elements[14])},e.prototype.extractScale=function(){var y=this.elements;return new e([y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],0,0,0,1]).project(new n.default(1,1,1)).length/Math.sqrt(3)},e.prototype.inverse=function(){var y,t,x=new Array(16),z=this.elements;for(x[0]=z[5]*z[10]*z[15]-z[5]*z[14]*z[11]-z[6]*z[9]*z[15]+z[6]*z[13]*z[11]+z[7]*z[9]*z[14]-z[7]*z[13]*z[10],x[1]=-z[1]*z[10]*z[15]+z[1]*z[14]*z[11]+z[2]*z[9]*z[15]-z[2]*z[13]*z[11]-z[3]*z[9]*z[14]+z[3]*z[13]*z[10],x[2]=z[1]*z[6]*z[15]-z[1]*z[14]*z[7]-z[2]*z[5]*z[15]+z[2]*z[13]*z[7]+z[3]*z[5]*z[14]-z[3]*z[13]*z[6],x[3]=-z[1]*z[6]*z[11]+z[1]*z[10]*z[7]+z[2]*z[5]*z[11]-z[2]*z[9]*z[7]-z[3]*z[5]*z[10]+z[3]*z[9]*z[6],x[4]=-z[4]*z[10]*z[15]+z[4]*z[14]*z[11]+z[6]*z[8]*z[15]-z[6]*z[12]*z[11]-z[7]*z[8]*z[14]+z[7]*z[12]*z[10],x[5]=z[0]*z[10]*z[15]-z[0]*z[14]*z[11]-z[2]*z[8]*z[15]+z[2]*z[12]*z[11]+z[3]*z[8]*z[14]-z[3]*z[12]*z[10],x[6]=-z[0]*z[6]*z[15]+z[0]*z[14]*z[7]+z[2]*z[4]*z[15]-z[2]*z[12]*z[7]-z[3]*z[4]*z[14]+z[3]*z[12]*z[6],x[7]=z[0]*z[6]*z[11]-z[0]*z[10]*z[7]-z[2]*z[4]*z[11]+z[2]*z[8]*z[7]+z[3]*z[4]*z[10]-z[3]*z[8]*z[6],x[8]=z[4]*z[9]*z[15]-z[4]*z[13]*z[11]-z[5]*z[8]*z[15]+z[5]*z[12]*z[11]+z[7]*z[8]*z[13]-z[7]*z[12]*z[9],x[9]=-z[0]*z[9]*z[15]+z[0]*z[13]*z[11]+z[1]*z[8]*z[15]-z[1]*z[12]*z[11]-z[3]*z[8]*z[13]+z[3]*z[12]*z[9],x[10]=z[0]*z[5]*z[15]-z[0]*z[13]*z[7]-z[1]*z[4]*z[15]+z[1]*z[12]*z[7]+z[3]*z[4]*z[13]-z[3]*z[12]*z[5],x[11]=-z[0]*z[5]*z[11]+z[0]*z[9]*z[7]+z[1]*z[4]*z[11]-z[1]*z[8]*z[7]-z[3]*z[4]*z[9]+z[3]*z[8]*z[5],x[12]=-z[4]*z[9]*z[14]+z[4]*z[13]*z[10]+z[5]*z[8]*z[14]-z[5]*z[12]*z[10]-z[6]*z[8]*z[13]+z[6]*z[12]*z[9],x[13]=z[0]*z[9]*z[14]-z[0]*z[13]*z[10]-z[1]*z[8]*z[14]+z[1]*z[12]*z[10]+z[2]*z[8]*z[13]-z[2]*z[12]*z[9],x[14]=-z[0]*z[5]*z[14]+z[0]*z[13]*z[6]+z[1]*z[4]*z[14]-z[1]*z[12]*z[6]-z[2]*z[4]*z[13]+z[2]*z[12]*z[5],x[15]=z[0]*z[5]*z[10]-z[0]*z[9]*z[6]-z[1]*z[4]*z[10]+z[1]*z[8]*z[6]+z[2]*z[4]*z[9]-z[2]*z[8]*z[5],t=z[0]*x[0]+z[1]*x[4]+z[2]*x[8]+z[3]*x[12],y=0;y<16;y++)x[y]/=t;return new e(x)},e.prototype.determinant=function(){return this.get(0,3)*this.get(1,2)*this.get(2,1)*this.get(3,0)-this.get(0,1)*this.get(1,3)*this.get(2,1)*this.get(3,0)-this.get(0,3)*this.get(1,1)*this.get(2,2)*this.get(3,0)+this.get(0,1)*this.get(1,3)*this.get(2,2)*this.get(3,0)+this.get(0,1)*this.get(1,1)*this.get(2,3)*this.get(3,0)-this.get(0,1)*this.get(1,2)*this.get(2,3)*this.get(3,0)-this.get(0,3)*this.get(1,2)*this.get(2,0)*this.get(3,1)+this.get(0,1)*this.get(1,3)*this.get(2,0)*this.get(3,1)+this.get(0,3)*this.get(1,0)*this.get(2,2)*this.get(3,1)-this.get(0,0)*this.get(1,3)*this.get(2,2)*this.get(3,1)-this.get(0,1)*this.get(1,0)*this.get(2,3)*this.get(3,1)+this.get(0,0)*this.get(1,2)*this.get(2,3)*this.get(3,1)+this.get(0,3)*this.get(1,1)*this.get(2,0)*this.get(3,2)-this.get(0,1)*this.get(1,3)*this.get(2,0)*this.get(3,2)-this.get(0,3)*this.get(1,0)*this.get(2,1)*this.get(3,2)+this.get(0,0)*this.get(1,3)*this.get(2,1)*this.get(3,2)+this.get(0,1)*this.get(1,0)*this.get(2,3)*this.get(3,2)-this.get(0,0)*this.get(1,1)*this.get(2,3)*this.get(3,2)-this.get(0,1)*this.get(1,1)*this.get(2,0)*this.get(3,3)+this.get(0,1)*this.get(1,2)*this.get(2,0)*this.get(3,3)+this.get(0,1)*this.get(1,0)*this.get(2,1)*this.get(3,3)-this.get(0,0)*this.get(1,2)*this.get(2,1)*this.get(3,3)-this.get(0,1)*this.get(1,0)*this.get(2,2)*this.get(3,3)+this.get(0,0)*this.get(1,1)*this.get(2,2)*this.get(3,3)},e.prototype.clone=function(){return new e(this.elements)},e.prototype.equal=function(y){return e.equal(this,y)},e}();y.default=i},function(e,y,t){"use strict";Object.defineProperty(y,"__esModule",{value:!0});var x=function(){function e(e,y,t,x){this.data=[e,y,t,x]}return e.fromAxisAngle=function(y,t){var x=.5*t,z=y.scale(Math.sin(x));return new e(z.x,z.y,z.z,Math.cos(x))},e.prototype.X=function(){return this.data[0]},e.prototype.Y=function(){return this.data[1]},e.prototype.Z=function(){return this.data[2]},e.prototype.W=function(){return this.data[3]},e}();y.default=x}])})},function(e,y,t){"use strict";Object.defineProperty(y,"__esModule",{value:!0});var x=t(0),z=function(){function e(e,y,t,x,z,n,i){this.a=e,this.b=y,this.c=t,this.alpha=x,this.beta=z,this.gamma=n,this.spaceGroup=i,this.init()}return e.getMatrixFromSymetry=function(e){function y(e){for(var y=[0,0,0,0],x=e.split("+"),z=0,n=x;z<n.length;z++){var i=n[z],o=t(i);y[0]=y[0]+o[0],y[1]=y[1]+o[1],y[2]=y[2]+o[2],y[3]=y[3]+o[3]}return y}function t(e){for(var y=[0,0,0,0],t=e.split("-"),x=[0,0,0,0],n=0;n<t.length;n++)if(0!==n||""!==t[n]){var i=-1;0===n&&(i=1),x=z(t[n]),y[0]=y[0]+x[0]*i,y[1]=y[1]+x[1]*i,y[2]=y[2]+x[2]*i,y[3]=y[3]+x[3]*i}return y}function z(e){var y=[0,0,0,0];return e.indexOf("x")>=0?y[0]=i(e,"x"):e.indexOf("y")>=0?y[1]=i(e,"y"):e.indexOf("z")>=0?y[2]=i(e,"z"):y[3]=n(e),y}function n(e){var y;if(e.indexOf("/")>=0){var t=e.split("/");y=parseFloat(t[0])/parseFloat(t[1])}else{var x=e.replace(".",",");y=parseFloat(x)}return y}function i(e,y){var t=0;if(e.indexOf(y)>=0)if(e.indexOf("*")>=0){var x=e.split("*");if(t=n(x[0]),x[1]!==y)throw new Error("Incorect formula")}else{if(y===e)return 1;t=n(e.replace(y,""))}return t}var o=function(e,y,t){return e.replace(new RegExp(y.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),t)}(e.toLowerCase()," ",""),s=o.split(",");if(3!==s.length)throw new Error("can not parse symetry code : "+e);for(var r=y(s[0]),a=y(s[1]),h=y(s[2]),c=0;c<4;c++){var u="number"!=typeof r[c]||!isFinite(r[c]);if(u=u||"number"!=typeof a[c]||!isFinite(a[c]),u=u||"number"!=typeof h[c]||!isFinite(h[c]))throw new Error("can not parse symetry code : "+e)}return new x.Matrix3x4([r[0],r[1],r[2],r[3],a[0],a[1],a[2],a[3],h[0],h[1],h[2],h[3]])},e.prototype.fractToOrth=function(e){return this.mOrthMatrix.project(e)},e.prototype.orthToFract=function(e){return this.mOrthMatrixInvert.project(e)},e.prototype.transactionsFromOrthBox=function(e,y){for(var t=new x.Vec3(Math.min(e.x,y.x),Math.min(e.y,y.y),Math.min(e.z,y.z)),z=new x.Vec3(Math.max(e.x,y.x),Math.max(e.y,y.y),Math.max(e.z,y.z)),n=new x.Vec3(t.x,t.y,t.z),i=new x.Vec3(z.x,t.y,t.z),o=new x.Vec3(t.x,z.y,t.z),s=new x.Vec3(t.x,t.y,z.z),r=new x.Vec3(z.x,z.y,t.z),a=new x.Vec3(z.x,t.y,z.z),h=new x.Vec3(t.x,z.y,z.z),c=new x.Vec3(z.x,z.y,z.z),u=this.orthToFract(n),l=this.orthToFract(i),d=this.orthToFract(o),f=this.orthToFract(s),m=this.orthToFract(r),p=this.orthToFract(a),g=this.orthToFract(h),v=this.orthToFract(c),b=Math.floor(Math.min(u.x,l.x,d.x,f.x,m.x,p.x,g.x,v.x)),P=Math.floor(Math.min(u.y,l.y,d.y,f.y,m.y,p.y,g.y,v.y)),w=Math.floor(Math.min(u.z,l.z,d.z,f.z,m.z,p.z,g.z,v.z)),C=Math.ceil(Math.max(u.x,l.x,d.x,f.x,m.x,p.x,g.x,v.x)),M=Math.ceil(Math.max(u.y,l.y,d.y,f.y,m.y,p.y,g.y,v.y)),A=Math.ceil(Math.max(u.z,l.z,d.z,f.z,m.z,p.z,g.z,v.z)),I=[],T=b;T<C;T++)for(var F=P;F<M;F++)for(var E=w;E<A;E++)I.push(new x.Vec3(T,F,E));return I},e.prototype.init=function(){var y=.017453292519943295*this.alpha,t=.017453292519943295*this.beta,z=.017453292519943295*this.gamma,n=Math.sqrt(1-Math.cos(y)*Math.cos(y)-Math.cos(t)*Math.cos(t)-Math.cos(z)*Math.cos(z)+2*Math.cos(y)*Math.cos(t)*Math.cos(z)),i=(Math.sin(y),this.a,Math.sin(t),this.b,Math.sin(z)/this.c/n),o=Math.acos((Math.cos(t)*Math.cos(z)-Math.cos(y))/Math.sin(t)/Math.sin(z));Math.acos((Math.cos(y)*Math.cos(z)-Math.cos(t))/Math.sin(y)/Math.sin(z)),Math.acos((Math.cos(y)*Math.cos(t)-Math.cos(z))/Math.sin(y)/Math.sin(t));this.mOrthMatrix=new x.Matrix3x3,this.mOrthMatrix.set(0,0,this.a),this.mOrthMatrix.set(0,1,this.b*Math.cos(z)),this.mOrthMatrix.set(0,2,this.c*Math.cos(t)),this.mOrthMatrix.set(1,0,0),this.mOrthMatrix.set(1,1,this.b*Math.sin(z)),this.mOrthMatrix.set(1,2,-this.c*Math.sin(t)*Math.cos(o)),this.mOrthMatrix.set(2,0,0),this.mOrthMatrix.set(2,1,0),this.mOrthMatrix.set(2,2,1/i),this.mOrthMatrixInvert=x.Matrix3x3.inverse(this.mOrthMatrix),this.volume=n,this.symetryList=[];for(var s=0,r=this.spaceGroup.symetryList;s<r.length;s++){var a=r[s],h=e.getMatrixFromSymetry(a);this.symetryList.push(h)}},e}();y.UnitCell=z},function(e,y,t){"use strict";Object.defineProperty(y,"__esModule",{value:!0});var x=t(3),z=t(5),n=t(17),i=t(19),o=t(25),s=function(){function e(e){this.options={bgcolor:e.bgcolor||"#2b303b",showLabels:!1,showMarkers:!0,showUnitCell:!1},this.initDone=!1,this.subscriptions=[],this.molecule=new z.Molecule3D}return e.prototype.append=function(e){var y=this;if(this.View||this.initDone)throw new Error("append or init were alredy done");this.View=$('<div class="jcmolview"><canvas></canvas></div>'),this.View.css({"background-color":this.options.bgcolor,dispaly:"block",height:"100%",position:"absolute",width:"100%"}),this.View.find("canvas").css({dispaly:"block"}),this.View.appendTo(e),this.canvasElement=this.View.find("canvas").get(0),this.context=this.canvasElement.getContext("2d"),this.painer=new n.Painter(this.context,this.options),this.camera=new x.Camera({element:this.canvasElement,onClick:function(e,t){if(y.options.showMarkers){var x=y.painer.uprojectToMarker({camera:y.camera,molecule:y.molecule,x:e,y:t});x&&(y.molecule.extendByMarker(x),y.redraw())}},onRedraw:function(){y.redraw()}}),this.contextMenu=new i.ContextMenu([new o.ContextMenuItem({command:function(){y.center()},title:"Center Molecule",type:"item"}),new o.ContextMenuItem({title:"----",type:"delimer"}),new o.ContextMenuItem({command:function(){y.options.showMarkers=!y.options.showMarkers,y.redraw()},isChecked:function(){return y.options.showMarkers},title:"Show Markers",type:"checkbox"}),new o.ContextMenuItem({command:function(){y.options.showUnitCell=!y.options.showUnitCell,y.redraw()},isChecked:function(){return y.options.showUnitCell},title:"Show Unit Cell",type:"checkbox"}),new o.ContextMenuItem({command:function(){y.options.showLabels=!y.options.showLabels,y.redraw()},isChecked:function(){return y.options.showLabels},title:"Show Labels",type:"checkbox"})])},e.prototype.load=function(e){this.molecule.clear(),this.molecule.load(e),this.center()},e.prototype.center=function(){if(this.molecule&&this.molecule.atoms&&this.molecule.atoms.length>2){var e=this.molecule.getCenter(),y=Math.min($(this.View).width()-10,$(this.View).height()-10)/this.molecule.getRadius();this.camera.setCameraView(y/2,e),this.redraw()}this.redraw()},e.prototype.onInit=function(){var e=this;if(!this.View)throw new Error("append has to be called first");if(this.initDone)throw new Error("Init has to be called once");this.camera.onInit();var y=function(){e.resizeCanvas()};$(window).on("resize",y),this.subscriptions.push(function(){$(window).off("resize",y)}),setTimeout(function(){e.resizeCanvas()},0),this.contextMenu.onInit(this.View),this.initDone=!0},e.prototype.onDestroy=function(){this.camera.onDestroy(),this.subscriptions.forEach(function(e){e()})},e.prototype.redraw=function(){this.height&&this.width&&this.painer.draw(this.molecule,this.camera)},e.prototype.resizeCanvas=function(){var e=this.View.width(),y=this.View.height();e===this.width&&y===this.height||(this.width=e,this.height=y,this.canvasElement.width=this.width,this.canvasElement.height=this.height,this.redraw())},e}();y.Mol3DView=s},function(e,y,t){"use strict";Object.defineProperty(y,"__esModule",{value:!0});var x=t(0),z=t(4),n=function(){function e(e){this.element=e.element;var y=new x.Vec3(0,0,0);this.mouseCapture=!1,this.mouseClick=!1,this.rootation=x.Transform3D.fromScale(20),this.translation=x.Transform3D.fromTranslation(y),this.width=this.element.clientWidth,this.height=this.element.clientHeight,this.onRedrawCallBack=e.onRedraw,this.onClickCallBack=e.onClick,this.attachLiseners(),this.initMatrixes()}return e.prototype.onInit=function(){this.attachLiseners(),this.initMatrixes()},e.prototype.onDestroy=function(){this.detachLiseners()},e.prototype.project=function(e){return this.projectionMatrix.project(e)},e.prototype.unproject=function(e){return this.unprojectionMatrix.project(e)},e.prototype.extractScale=function(){return this.rootation.extractScale()},e.prototype.setCameraView=function(e,y){this.rootation=x.Transform3D.fromScale(e),this.translation=x.Transform3D.fromTranslation(y.scale(-1)),this.initMatrixes()},e.prototype.attachLiseners=function(){var e=this;z(this.element).on("mousedown",function(y){e._mousedown(y)}),z(this.element).on("mouseup",function(y){e._mouseup(y)}),z(this.element).on("mouseleave",function(y){e._mouseleave(y)}),z(this.element).on("mousemove",function(y){e._mousemove(y)}),z(this.element).on("mousewheel",function(y){e._mousewheel(y)})},e.prototype._mousedown=function(e){this.mouseCapture=!0,this.mouseClick=!0,this.mouseBegin=[e.offsetX,e.offsetY],this.mouseCurrent=[e.offsetX,e.offsetY],this.mouseLast=[e.offsetX,e.offsetY]},e.prototype._mouseup=function(e){this.mouseCapture&&(this.mouseCapture=!1,this.mouseCurrent=[e.offsetX,e.offsetY],this.mouseClick?this.processMouseClick(e.offsetX,e.offsetY,e.which):this.processMouseMove(e.shiftKey,e.ctrlKey,e.which),this.mouseLast=[e.offsetX,e.offsetY],this.mouseClick=!1)},e.prototype._mouseleave=function(e){this.mouseCapture&&(this.mouseCapture=!1,this.mouseCurrent=[e.offsetX,e.offsetY],this.processMouseMove(e.shiftKey,e.ctrlKey,e.which),this.mouseLast=[e.offsetX,e.offsetY])},e.prototype._mousemove=function(e){this.mouseCapture&&(this.mouseCurrent=[e.offsetX,e.offsetY],this.processMouseMove(e.shiftKey,e.ctrlKey,e.which),this.mouseLast=[e.offsetX,e.offsetY],e.preventDefault())},e.prototype._mousewheel=function(e){this.whellZoom(e),this.initMatrixes(),this.onRedraw(),e.preventDefault()},e.prototype.processMouseClick=function(e,y,t){1===t&&this.onClickCallBack&&this.onClickCallBack(e,y)},e.prototype.processMouseMove=function(e,y,t){if(!(this.mouseCurrent[1]===this.mouseCurrent[0]&&this.mouseLast[1]===this.mouseCurrent[1]||Math.abs(this.mouseBegin[0]-this.mouseCurrent[0])<6&&Math.abs(this.mouseBegin[2]-this.mouseCurrent[2])<6&&this.mouseClick)){switch(this.mouseClick=!1,!0){case e||2===t:this.mouseTranslate();break;case y||3===t:break;default:this.mouseRootate_XYZ()}this.initMatrixes(),this.onRedraw()}},e.prototype.mouseRootate_XYZ=function(){var e=this.mouseLast[0]-this.mouseCurrent[0],y=this.mouseLast[1]-this.mouseCurrent[1],t=x.Transform3D.fromScale(1),z=new x.Vec3(0,1,0);t=t.rotate(z,.012*e),z=new x.Vec3(1,0,0),t=t.rotate(z,.012*-y);var n=x.Transform3D.fromMultiplication(this.rootation,t);this.rootation=n},e.prototype.mouseRootateXY=function(){var e=(this.mouseLast[0],this.mouseCurrent[0],this.mouseLast[1]-this.mouseCurrent[1]),y=x.Transform3D.fromScale(1),t=new x.Vec3(0,0,1);y=y.rotate(t,.012*e);var z=x.Transform3D.fromMultiplication(this.rootation,y);this.rootation=z},e.prototype.mouseTranslate=function(){var e=this.unproject(new x.Vec3(this.mouseLast[0],this.mouseLast[1],0)),y=this.unproject(new x.Vec3(this.mouseCurrent[0],this.mouseCurrent[1],0)),t=x.Vec3.sub(y,e);this.translation=this.translation.translate(t)},e.prototype.mouseZoom=function(e){var y=this.mouseLast[1]-this.mouseCurrent[1],t=1;t=y>0?1+y/this.height*4:1/(1-y/this.height*4);var z=x.Transform3D.fromScale(t);this.rootation=x.Transform3D.fromMultiplication(this.rootation,z)},e.prototype.whellZoom=function(e){var y=e.originalEvent.wheelDelta/120*(this.height/16),t=1;t=y>0?1+y/this.height*4:1/(1-y/this.height*4);var z=x.Transform3D.fromScale(t);this.rootation=x.Transform3D.fromMultiplication(this.rootation,z)},e.prototype.detachLiseners=function(){z(this.element).off()},e.prototype.onRedraw=function(){this.onRedrawCallBack&&this.onRedrawCallBack()},e.prototype.initMatrixes=function(){this.projectionMatrix=x.Transform3D.fromMultiplication(this.translation,this.rootation),this.unprojectionMatrix=this.projectionMatrix.inverse()},e}();y.Camera=n},function(e,y,t){var x,z;/*! * jQuery JavaScript Library v3.2.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: 2017-03-20T18:59Z */ !function(y,t){"use strict";"object"==typeof e&&"object"==typeof e.exports?e.exports=y.document?t(y,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(y)}("undefined"!=typeof window?window:this,function(t,n){"use strict";function i(e,y){y=y||ie;var t=y.createElement("script");t.text=e,y.head.appendChild(t).parentNode.removeChild(t)}function o(e){var y=!!e&&"length"in e&&e.length,t=pe.type(e);return"function"!==t&&!pe.isWindow(e)&&("array"===t||0===y||"number"==typeof y&&y>0&&y-1 in e)}function s(e,y){return e.nodeName&&e.nodeName.toLowerCase()===y.toLowerCase()}function r(e,y,t){return pe.isFunction(y)?pe.grep(e,function(e,x){return!!y.call(e,x,e)!==t}):y.nodeType?pe.grep(e,function(e){return e===y!==t}):"string"!=typeof y?pe.grep(e,function(e){return he.call(y,e)>-1!==t}):Te.test(y)?pe.filter(y,e,t):(y=pe.filter(y,e),pe.grep(e,function(e){return he.call(y,e)>-1!==t&&1===e.nodeType}))}function a(e,y){for(;(e=e[y])&&1!==e.nodeType;);return e}function h(e){var y={};return pe.each(e.match(je)||[],function(e,t){y[t]=!0}),y}function c(e){return e}function u(e){throw e}function l(e,y,t,x){var z;try{e&&pe.isFunction(z=e.promise)?z.call(e).done(y).fail(t):e&&pe.isFunction(z=e.then)?z.call(e,y,t):y.apply(void 0,[e].slice(x))}catch(e){t.apply(void 0,[e])}}function d(){ie.removeEventListener("DOMContentLoaded",d),t.removeEventListener("load",d),pe.ready()}function f(){this.expando=pe.expando+f.uid++}function m(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Re.test(e)?JSON.parse(e):e)}function p(e,y,t){var x;if(void 0===t&&1===e.nodeType)if(x="data-"+y.replace(qe,"-$&").toLowerCase(),"string"==typeof(t=e.getAttribute(x))){try{t=m(t)}catch(e){}_e.set(e,y,t)}else t=void 0;return t}function g(e,y,t,x){var z,n=1,i=20,o=x?function(){return x.cur()}:function(){return pe.css(e,y,"")},s=o(),r=t&&t[3]||(pe.cssNumber[y]?"":"px"),a=(pe.cssNumber[y]||"px"!==r&&+s)&&$e.exec(pe.css(e,y));if(a&&a[3]!==r){r=r||a[3],t=t||[],a=+s||1;do{n=n||".5",a/=n,pe.style(e,y,a+r)}while(n!==(n=o()/s)&&1!==n&&--i)}return t&&(a=+a||+s||0,z=t[1]?a+(t[1]+1)*t[2]:+t[2],x&&(x.unit=r,x.start=a,x.end=z)),z}function v(e){var y,t=e.ownerDocument,x=e.nodeName,z=Xe[x];return z||(y=t.body.appendChild(t.createElement(x)),z=pe.css(y,"display"),y.parentNode.removeChild(y),"none"===z&&(z="block"),Xe[x]=z,z)}function b(e,y){for(var t,x,z=[],n=0,i=e.length;n<i;n++)x=e[n],x.style&&(t=x.style.display,y?("none"===t&&(z[n]=De.get(x,"display")||null,z[n]||(x.style.display="")),""===x.style.display&&We(x)&&(z[n]=v(x))):"none"!==t&&(z[n]="none",De.set(x,"display",t)));for(n=0;n<i;n++)null!=z[n]&&(e[n].style.display=z[n]);return e}function P(e,y){var t;return t=void 0!==e.getElementsByTagName?e.getElementsByTagName(y||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(y||"*"):[],void 0===y||y&&s(e,y)?pe.merge([e],t):t}function w(e,y){for(var t=0,x=e.length;t<x;t++)De.set(e[t],"globalEval",!y||De.get(y[t],"globalEval"))}function C(e,y,t,x,z){for(var n,i,o,s,r,a,h=y.createDocumentFragment(),c=[],u=0,l=e.length;u<l;u++)if((n=e[u])||0===n)if("object"===pe.type(n))pe.merge(c,n.nodeType?[n]:n);else if(Qe.test(n)){for(i=i||h.appendChild(y.createElement("div")),o=(Ge.exec(n)||["",""])[1].toLowerCase(),s=Ke[o]||Ke._default,i.innerHTML=s[1]+pe.htmlPrefilter(n)+s[2],a=s[0];a--;)i=i.lastChild;pe.merge(c,i.childNodes),i=h.firstChild,i.textContent=""}else c.push(y.createTextNode(n));for(h.textContent="",u=0;n=c[u++];)if(x&&pe.inArray(n,x)>-1)z&&z.push(n);else if(r=pe.contains(n.ownerDocument,n),i=P(h.appendChild(n),"script"),r&&w(i),t)for(a=0;n=i[a++];)Ze.test(n.type||"")&&t.push(n);return h}function M(){return!0}function A(){return!1}function I(){try{return ie.activeElement}catch(e){}}function T(e,y,t,x,z,n){var i,o;if("object"==typeof y){"string"!=typeof t&&(x=x||t,t=void 0);for(o in y)T(e,o,t,x,y[o],n);return e}if(null==x&&null==z?(z=t,x=t=void 0):null==z&&("string"==typeof t?(z=x,x=void 0):(z=x,x=t,t=void 0)),!1===z)z=A;else if(!z)return e;return 1===n&&(i=z,z=function(e){return pe().off(e),i.apply(this,arguments)},z.guid=i.guid||(i.guid=pe.guid++)),e.each(function(){pe.event.add(this,y,z,x,t)})}function F(e,y){return s(e,"table")&&s(11!==y.nodeType?y:y.firstChild,"tr")?pe(">tbody",e)[0]||e:e}function E(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function k(e){var y=iy.exec(e.type);return y?e.type=y[1]:e.removeAttribute("type"),e}function S(e,y){var t,x,z,n,i,o,s,r;if(1===y.nodeType){if(De.hasData(e)&&(n=De.access(e),i=De.set(y,n),r=n.events)){delete i.handle,i.events={};for(z in r)for(t=0,x=r[z].length;t<x;t++)pe.event.add(y,z,r[z][t])}_e.hasData(e)&&(o=_e.access(e),s=pe.extend({},o),_e.set(y,s))}}function j(e,y){var t=y.nodeName.toLowerCase();"input"===t&&Ye.test(e.type)?y.checked=e.checked:"input"!==t&&"textarea"!==t||(y.defaultValue=e.defaultValue)}function L(e,y,t,x){y=re.apply([],y);var z,n,o,s,r,a,h=0,c=e.length,u=c-1,l=y[0],d=pe.isFunction(l);if(d||c>1&&"string"==typeof l&&!me.checkClone&&ny.test(l))return e.each(function(z){var n=e.eq(z);d&&(y[0]=l.call(this,z,n.html())),L(n,y,t,x)});if(c&&(z=C(y,e[0].ownerDocument,!1,e,x),n=z.firstChild,1===z.childNodes.length&&(z=n),n||x)){for(o=pe.map(P(z,"script"),E),s=o.length;h<c;h++)r=z,h!==u&&(r=pe.clone(r,!0,!0),s&&pe.merge(o,P(r,"script"))),t.call(e[h],r,h);if(s)for(a=o[o.length-1].ownerDocument,pe.map(o,k),h=0;h<s;h++)r=o[h],Ze.test(r.type||"")&&!De.access(r,"globalEval")&&pe.contains(a,r)&&(r.src?pe._evalUrl&&pe._evalUrl(r.src):i(r.textContent.replace(oy,""),a))}return e}function B(e,y,t){for(var x,z=y?pe.filter(y,e):e,n=0;null!=(x=z[n]);n++)t||1!==x.nodeType||pe.cleanData(P(x)),x.parentNode&&(t&&pe.contains(x.ownerDocument,x)&&w(P(x,"script")),x.parentNode.removeChild(x));return e}function O(e,y,t){var x,z,n,i,o=e.style;return t=t||ay(e),t&&(i=t.getPropertyValue(y)||t[y],""!==i||pe.contains(e.ownerDocument,e)||(i=pe.style(e,y)),!me.pixelMarginRight()&&ry.test(i)&&sy.test(y)&&(x=o.width,z=o.minWidth,n=o.maxWidth,o.minWidth=o.maxWidth=o.width=i,i=t.width,o.width=x,o.minWidth=z,o.maxWidth=n)),void 0!==i?i+"":i}function N(e,y){return{get:function(){return e()?void delete this.get:(this.get=y).apply(this,arguments)}}}function D(e){if(e in fy)return e;for(var y=e[0].toUpperCase()+e.slice(1),t=dy.length;t--;)if((e=dy[t]+y)in fy)return e}function _(e){var y=pe.cssProps[e];return y||(y=pe.cssProps[e]=D(e)||e),y}function R(e,y,t){var x=$e.exec(y);return x?Math.max(0,x[2]-(t||0))+(x[3]||"px"):y}function q(e,y,t,x,z){var n,i=0;for(n=t===(x?"border":"content")?4:"width"===y?1:0;n<4;n+=2)"margin"===t&&(i+=pe.css(e,t+Ve[n],!0,z)),x?("content"===t&&(i-=pe.css(e,"padding"+Ve[n],!0,z)),"margin"!==t&&(i-=pe.css(e,"border"+Ve[n]+"Width",!0,z))):(i+=pe.css(e,"padding"+Ve[n],!0,z),"padding"!==t&&(i+=pe.css(e,"border"+Ve[n]+"Width",!0,z)));return i}function H(e,y,t){var x,z=ay(e),n=O(e,y,z),i="border-box"===pe.css(e,"boxSizing",!1,z);return ry.test(n)?n:(x=i&&(me.boxSizingReliable()||n===e.style[y]),"auto"===n&&(n=e["offset"+y[0].toUpperCase()+y.slice(1)]),(n=parseFloat(n)||0)+q(e,y,t||(i?"border":"content"),x,z)+"px")}function $(e,y,t,x,z){return new $.prototype.init(e,y,t,x,z)}function V(){py&&(!1===ie.hidden&&t.requestAnimationFrame?t.requestAnimationFrame(V):t.setTimeout(V,pe.fx.interval),pe.fx.tick())}function W(){return t.setTimeout(function(){my=void 0}),my=pe.now()}function U(e,y){var t,x=0,z={height:e};for(y=y?1:0;x<4;x+=2-y)t=Ve[x],z["margin"+t]=z["padding"+t]=e;return y&&(z.opacity=z.width=e),z}function X(e,y,t){for(var x,z=(Z.tweeners[y]||[]).concat(Z.tweeners["*"]),n=0,i=z.length;n<i;n++)if(x=z[n].call(t,y,e))return x}function Y(e,y,t){var x,z,n,i,o,s,r,a,h="width"in y||"height"in y,c=this,u={},l=e.style,d=e.nodeType&&We(e),f=De.get(e,"fxshow");t.queue||(i=pe._queueHooks(e,"fx"),null==i.unqueued&&(i.unqueued=0,o=i.empty.fire,i.empty.fire=function(){i.unqueued||o()}),i.unqueued++,c.always(function(){c.always(function(){i.unqueued--,pe.queue(e,"fx").length||i.empty.fire()})}));for(x in y)if(z=y[x],gy.test(z)){if(delete y[x],n=n||"toggle"===z,z===(d?"hide":"show")){if("show"!==z||!f||void 0===f[x])continue;d=!0}u[x]=f&&f[x]||pe.style(e,x)}if((s=!pe.isEmptyObject(y))||!pe.isEmptyObject(u)){h&&1===e.nodeType&&(t.overflow=[l.overflow,l.overflowX,l.overflowY],r=f&&f.display,null==r&&(r=De.get(e,"display")),a=pe.css(e,"display"),"none"===a&&(r?a=r:(b([e],!0),r=e.style.display||r,a=pe.css(e,"display"),b([e]))),("inline"===a||"inline-block"===a&&null!=r)&&"none"===pe.css(e,"float")&&(s||(c.done(function(){l.display=r}),null==r&&(a=l.display,r="none"===a?"":a)),l.display="inline-block")),t.overflow&&(l.overflow="hidden",c.always(function(){l.overflow=t.overflow[0],l.overflowX=t.overflow[1],l.overflowY=t.overflow[2]})),s=!1;for(x in u)s||(f?"hidden"in f&&(d=f.hidden):f=De.access(e,"fxshow",{display:r}),n&&(f.hidden=!d),d&&b([e],!0),c.done(function(){d||b([e]),De.remove(e,"fxshow");for(x in u)pe.style(e,x,u[x])})),s=X(d?f[x]:0,x,c),x in f||(f[x]=s.start,d&&(s.end=s.start,s.start=0))}}function G(e,y){var t,x,z,n,i;for(t in e)if(x=pe.camelCase(t),z=y[x],n=e[t],Array.isArray(n)&&(z=n[1],n=e[t]=n[0]),t!==x&&(e[x]=n,delete e[t]),(i=pe.cssHooks[x])&&"expand"in i){n=i.expand(n),delete e[x];for(t in n)t in e||(e[t]=n[t],y[t]=z)}else y[x]=z}function Z(e,y,t){var x,z,n=0,i=Z.prefilters.length,o=pe.Deferred().always(function(){delete s.elem}),s=function(){if(z)return!1;for(var y=my||W(),t=Math.max(0,r.startTime+r.duration-y),x=t/r.duration||0,n=1-x,i=0,s=r.tweens.length;i<s;i++)r.tweens[i].run(n);return o.notifyWith(e,[r,n,t]),n<1&&s?t:(s||o.notifyWith(e,[r,1,0]),o.resolveWith(e,[r]),!1)},r=o.promise({elem:e,props:pe.extend({},y),opts:pe.extend(!0,{specialEasing:{},easing:pe.easing._default},t),originalProperties:y,originalOptions:t,startTime:my||W(),duration:t.duration,tweens:[],createTween:function(y,t){var x=pe.Tween(e,r.opts,y,t,r.opts.specialEasing[y]||r.opts.easing);return r.tweens.push(x),x},stop:function(y){var t=0,x=y?r.tweens.length:0;if(z)return this;for(z=!0;t<x;t++)r.tweens[t].run(1);return y?(o.notifyWith(e,[r,1,0]),o.resolveWith(e,[r,y])):o.rejectWith(e,[r,y]),this}}),a=r.props;for(G(a,r.opts.specialEasing);n<i;n++)if(x=Z.prefilters[n].call(r,e,a,r.opts))return pe.isFunction(x.stop)&&(pe._queueHooks(r.elem,r.opts.queue).stop=pe.proxy(x.stop,x)),x;return pe.map(a,X,r),pe.isFunction(r.opts.start)&&r.opts.start.call(e,r),r.progress(r.opts.progress).done(r.opts.done,r.opts.complete).fail(r.opts.fail).always(r.opts.always),pe.fx.timer(pe.extend(s,{elem:e,anim:r,queue:r.opts.queue})),r}function K(e){return(e.match(je)||[]).join(" ")}function Q(e){return e.getAttribute&&e.getAttribute("class")||""}function J(e,y,t,x){var z;if(Array.isArray(y))pe.each(y,function(y,z){t||Ey.test(e)?x(e,z):J(e+"["+("object"==typeof z&&null!=z?y:"")+"]",z,t,x)});else if(t||"object"!==pe.type(y))x(e,y);else for(z in y)J(e+"["+z+"]",y[z],t,x)}function ee(e){return function(y,t){"string"!=typeof y&&(t=y,y="*");var x,z=0,n=y.toLowerCase().match(je)||[];if(pe.isFunction(t))for(;x=n[z++];)"+"===x[0]?(x=x.slice(1)||"*",(e[x]=e[x]||[]).unshift(t)):(e[x]=e[x]||[]).push(t)}}function ye(e,y,t,x){function z(o){var s;return n[o]=!0,pe.each(e[o]||[],function(e,o){var r=o(y,t,x);return"string"!=typeof r||i||n[r]?i?!(s=r):void 0:(y.dataTypes.unshift(r),z(r),!1)}),s}var n={},i=e===Hy;return z(y.dataTypes[0])||!n["*"]&&z("*")}function te(e,y){var t,x,z=pe.ajaxSettings.flatOptions||{};for(t in y)void 0!==y[t]&&((z[t]?e:x||(x={}))[t]=y[t]);return x&&pe.extend(!0,e,x),e}function xe(e,y,t){for(var x,z,n,i,o=e.contents,s=e.dataTypes;"*"===s[0];)s.shift(),void 0===x&&(x=e.mimeType||y.getResponseHeader("Content-Type"));if(x)for(z in o)if(o[z]&&o[z].test(x)){s.unshift(z);break}if(s[0]in t)n=s[0];else{for(z in t){if(!s[0]||e.converters[z+" "+s[0]]){n=z;break}i||(i=z)}n=n||i}if(n)return n!==s[0]&&s.unshift(n),t[n]}function ze(e,y,t,x){var z,n,i,o,s,r={},a=e.dataTypes.slice();if(a[1])for(i in e.converters)r[i.toLowerCase()]=e.converters[i];for(n=a.shift();n;)if(e.responseFields[n]&&(t[e.responseFields[n]]=y),!s&&x&&e.dataFilter&&(y=e.dataFilter(y,e.dataType)),s=n,n=a.shift())if("*"===n)n=s;else if("*"!==s&&s!==n){if(!(i=r[s+" "+n]||r["* "+n]))for(z in r)if(o=z.split(" "),o[1]===n&&(i=r[s+" "+o[0]]||r["* "+o[0]])){!0===i?i=r[z]:!0!==r[z]&&(n=o[0],a.unshift(o[1]));break}if(!0!==i)if(i&&e.throws)y=i(y);else try{y=i(y)}catch(e){return{state:"parsererror",error:i?e:"No conversion from "+s+" to "+n}}}return{state:"success",data:y}}var ne=[],ie=t.document,oe=Object.getPrototypeOf,se=ne.slice,re=ne.concat,ae=ne.push,he=ne.indexOf,ce={},ue=ce.toString,le=ce.hasOwnProperty,de=le.toString,fe=de.call(Object),me={},pe=function(e,y){return new pe.fn.init(e,y)},ge=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ve=/^-ms-/,be=/-([a-z])/g,Pe=function(e,y){return y.toUpperCase()};pe.fn=pe.prototype={jquery:"3.2.1",constructor:pe,length:0,toArray:function(){return se.call(this)},get:function(e){return null==e?se.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var y=pe.merge(this.constructor(),e);return y.prevObject=this,y},each:function(e){return pe.each(this,e)},map:function(e){return this.pushStack(pe.map(this,function(y,t){return e.call(y,t,y)}))},slice:function(){return this.pushStack(se.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var y=this.length,t=+e+(e<0?y:0);return this.pushStack(t>=0&&t<y?[this[t]]:[])},end:function(){return this.prevObject||this.constructor()},push:ae,sort:ne.sort,splice:ne.splice},pe.extend=pe.fn.extend=function(){var e,y,t,x,z,n,i=arguments[0]||{},o=1,s=arguments.length,r=!1;for("boolean"==typeof i&&(r=i,i=arguments[o]||{},o++),"object"==typeof i||pe.isFunction(i)||(i={}),o===s&&(i=this,o--);o<s;o++)if(null!=(e=arguments[o]))for(y in e)t=i[y],x=e[y],i!==x&&(r&&x&&(pe.isPlainObject(x)||(z=Array.isArray(x)))?(z?(z=!1,n=t&&Array.isArray(t)?t:[]):n=t&&pe.isPlainObject(t)?t:{},i[y]=pe.extend(r,n,x)):void 0!==x&&(i[y]=x));return i},pe.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"===pe.type(e)},isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var y=pe.type(e);return("number"===y||"string"===y)&&!isNaN(e-parseFloat(e))},isPlainObject:function(e){var y,t;return!(!e||"[object Object]"!==ue.call(e))&&(!(y=oe(e))||"function"==typeof(t=le.call(y,"constructor")&&y.constructor)&&de.call(t)===fe)},isEmptyObject:function(e){var y;for(y in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ce[ue.call(e)]||"object":typeof e},globalEval:function(e){i(e)},camelCase:function(e){return e.replace(ve,"ms-").replace(be,Pe)},each:function(e,y){var t,x=0;if(o(e))for(t=e.length;x<t&&!1!==y.call(e[x],x,e[x]);x++);else for(x in e)if(!1===y.call(e[x],x,e[x]))break;return e},trim:function(e){return null==e?"":(e+"").replace(ge,"")},makeArray:function(e,y){var t=y||[];return null!=e&&(o(Object(e))?pe.merge(t,"string"==typeof e?[e]:e):ae.call(t,e)),t},inArray:function(e,y,t){return null==y?-1:he.call(y,e,t)},merge:function(e,y){for(var t=+y.length,x=0,z=e.length;x<t;x++)e[z++]=y[x];return e.length=z,e},grep:function(e,y,t){for(var x=[],z=0,n=e.length,i=!t;z<n;z++)!y(e[z],z)!==i&&x.push(e[z]);return x},map:function(e,y,t){var x,z,n=0,i=[];if(o(e))for(x=e.length;n<x;n++)null!=(z=y(e[n],n,t))&&i.push(z);else for(n in e)null!=(z=y(e[n],n,t))&&i.push(z);return re.apply([],i)},guid:1,proxy:function(e,y){var t,x,z;if("string"==typeof y&&(t=e[y],y=e,e=t),pe.isFunction(e))return x=se.call(arguments,2),z=function(){return e.apply(y||this,x.concat(se.call(arguments)))},z.guid=e.guid=e.guid||pe.guid++,z},now:Date.now,support:me}),"function"==typeof Symbol&&(pe.fn[Symbol.iterator]=ne[Symbol.iterator]),pe.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,y){ce["[object "+y+"]"]=y.toLowerCase()});var we=/*! * Sizzle CSS Selector Engine v2.3.3 * https://sizzlejs.com/ * * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2016-08-08 */ function(e){function y(e,y,t,x){var z,n,i,o,s,a,c,u=y&&y.ownerDocument,l=y?y.nodeType:9;if(t=t||[],"string"!=typeof e||!e||1!==l&&9!==l&&11!==l)return t;if(!x&&((y?y.ownerDocument||y:_)!==k&&E(y),y=y||k,j)){if(11!==l&&(s=de.exec(e)))if(z=s[1]){if(9===l){if(!(i=y.getElementById(z)))return t;if(i.id===z)return t.push(i),t}else if(u&&(i=u.getElementById(z))&&N(y,i)&&i.id===z)return t.push(i),t}else{if(s[2])return Z.apply(t,y.getElementsByTagName(e)),t;if((z=s[3])&&v.getElementsByClassName&&y.getElementsByClassName)return Z.apply(t,y.getElementsByClassName(z)),t}if(v.qsa&&!V[e+" "]&&(!L||!L.test(e))){if(1!==l)u=y,c=e;else if("object"!==y.nodeName.toLowerCase()){for((o=y.getAttribute("id"))?o=o.replace(ge,ve):y.setAttribute("id",o=D),a=C(e),n=a.length;n--;)a[n]="#"+o+" "+h(a[n]);c=a.join(","),u=fe.test(e)&&r(y.parentNode)||y}if(c)try{return Z.apply(t,u.querySelectorAll(c)),t}catch(e){}finally{o===D&&y.removeAttribute("id")}}}return A(e.replace(ne,"$1"),y,t,x)}function t(){function e(t,x){return y.push(t+" ")>b.cacheLength