var JSEncryptV=1,JSEncryptExports={};!function(t){var e;function b(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function T(){return new b(null)}e="Microsoft Internet Explorer"==navigator.appName?(b.prototype.am=function(t,e,i,r,s,n){for(var o=32767&e,h=e>>15;0<=--n;){var a=32767&this[t],u=this[t++]>>15,c=h*a+u*o;s=((a=o*a+((32767&c)<<15)+i[r]+(1073741823&s))>>>30)+(c>>>15)+h*u+(s>>>30),i[r++]=1073741823&a}return s},30):"Netscape"!=navigator.appName?(b.prototype.am=function(t,e,i,r,s,n){for(;0<=--n;){var o=e*this[t++]+i[r]+s;s=Math.floor(o/67108864),i[r++]=67108863&o}return s},26):(b.prototype.am=function(t,e,i,r,s,n){for(var o=16383&e,h=e>>14;0<=--n;){var a=16383&this[t],u=this[t++]>>14,c=h*a+u*o;s=((a=o*a+((16383&c)<<14)+i[r]+s)>>28)+(c>>14)+h*u,i[r++]=268435455&a}return s},28),b.prototype.DB=e,b.prototype.DM=(1<<e)-1,b.prototype.DV=1<<e;b.prototype.FV=Math.pow(2,52),b.prototype.F1=52-e,b.prototype.F2=2*e-52;var i,r,s="0123456789abcdefghijklmnopqrstuvwxyz",n=new Array;for(i="0".charCodeAt(0),r=0;r<=9;++r)n[i++]=r;for(i="a".charCodeAt(0),r=10;r<36;++r)n[i++]=r;for(i="A".charCodeAt(0),r=10;r<36;++r)n[i++]=r;function a(t){return s.charAt(t)}function u(t,e){var i=n[t.charCodeAt(e)];return null==i?-1:i}function m(t){var e=T();return e.fromInt(t),e}function S(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function y(t){this.m=t}function R(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function o(t,e){return t&e}function c(t,e){return t|e}function h(t,e){return t^e}function f(t,e){return t&~e}function p(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function l(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function d(){}function g(t){return t}function E(t){this.r2=T(),this.q3=T(),b.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}y.prototype.convert=function(t){return t.s<0||0<=t.compareTo(this.m)?t.mod(this.m):t},y.prototype.revert=function(t){return t},y.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},y.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},y.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},R.prototype.convert=function(t){var e=T();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&0<e.compareTo(b.ZERO)&&this.m.subTo(e,e),e},R.prototype.revert=function(t){var e=T();return t.copyTo(e),this.reduce(e),e},R.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=32767&t[e],r=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[i=e+this.m.t]+=this.m.am(0,r,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),0<=t.compareTo(this.m)&&t.subTo(this.m,t)},R.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},R.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},b.prototype.copyTo=function(t){for(var e=this.t-1;0<=e;--e)t[e]=this[e];t.t=this.t,t.s=this.s},b.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,0<t?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},b.prototype.fromString=function(t,e){var i;if(16==e)i=4;else if(8==e)i=3;else if(256==e)i=8;else if(2==e)i=1;else if(32==e)i=5;else{if(4!=e)return void this.fromRadix(t,e);i=2}this.t=0,this.s=0;for(var r=t.length,s=!1,n=0;0<=--r;){var o=8==i?255&t[r]:u(t,r);o<0?"-"==t.charAt(r)&&(s=!0):(s=!1,0==n?this[this.t++]=o:n+i>this.DB?(this[this.t-1]|=(o&(1<<this.DB-n)-1)<<n,this[this.t++]=o>>this.DB-n):this[this.t-1]|=o<<n,(n+=i)>=this.DB&&(n-=this.DB))}8==i&&0!=(128&t[0])&&(this.s=-1,0<n&&(this[this.t-1]|=(1<<this.DB-n)-1<<n)),this.clamp(),s&&b.ZERO.subTo(this,this)},b.prototype.clamp=function(){for(var t=this.s&this.DM;0<this.t&&this[this.t-1]==t;)--this.t},b.prototype.dlShiftTo=function(t,e){var i;for(i=this.t-1;0<=i;--i)e[i+t]=this[i];for(i=t-1;0<=i;--i)e[i]=0;e.t=this.t+t,e.s=this.s},b.prototype.drShiftTo=function(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s},b.prototype.lShiftTo=function(t,e){var i,r=t%this.DB,s=this.DB-r,n=(1<<s)-1,o=Math.floor(t/this.DB),h=this.s<<r&this.DM;for(i=this.t-1;0<=i;--i)e[i+o+1]=this[i]>>s|h,h=(this[i]&n)<<r;for(i=o-1;0<=i;--i)e[i]=0;e[o]=h,e.t=this.t+o+1,e.s=this.s,e.clamp()},b.prototype.rShiftTo=function(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)e.t=0;else{var r=t%this.DB,s=this.DB-r,n=(1<<r)-1;e[0]=this[i]>>r;for(var o=i+1;o<this.t;++o)e[o-i-1]|=(this[o]&n)<<s,e[o-i]=this[o]>>r;0<r&&(e[this.t-i-1]|=(this.s&n)<<s),e.t=this.t-i,e.clamp()}},b.prototype.subTo=function(t,e){for(var i=0,r=0,s=Math.min(t.t,this.t);i<s;)r+=this[i]-t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<t.t;)r-=t[i],e[i++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[i++]=this.DV+r:0<r&&(e[i++]=r),e.t=i,e.clamp()},b.prototype.multiplyTo=function(t,e){var i=this.abs(),r=t.abs(),s=i.t;for(e.t=s+r.t;0<=--s;)e[s]=0;for(s=0;s<r.t;++s)e[s+i.t]=i.am(0,r[s],e,s,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&b.ZERO.subTo(e,e)},b.prototype.squareTo=function(t){for(var e=this.abs(),i=t.t=2*e.t;0<=--i;)t[i]=0;for(i=0;i<e.t-1;++i){var r=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,r,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}0<t.t&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()},b.prototype.divRemTo=function(t,e,i){var r=t.abs();if(!(r.t<=0)){var s=this.abs();if(s.t<r.t)return null!=e&&e.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=T());var n=T(),o=this.s,h=t.s,a=this.DB-S(r[r.t-1]);0<a?(r.lShiftTo(a,n),s.lShiftTo(a,i)):(r.copyTo(n),s.copyTo(i));var u=n.t,c=n[u-1];if(0!=c){var f=c*(1<<this.F1)+(1<u?n[u-2]>>this.F2:0),p=this.FV/f,l=(1<<this.F1)/f,d=1<<this.F2,g=i.t,m=g-u,v=null==e?T():e;for(n.dlShiftTo(m,v),0<=i.compareTo(v)&&(i[i.t++]=1,i.subTo(v,i)),b.ONE.dlShiftTo(u,v),v.subTo(n,n);n.t<u;)n[n.t++]=0;for(;0<=--m;){var y=i[--g]==c?this.DM:Math.floor(i[g]*p+(i[g-1]+d)*l);if((i[g]+=n.am(0,y,i,m,0,u))<y)for(n.dlShiftTo(m,v),i.subTo(v,i);i[g]<--y;)i.subTo(v,i)}null!=e&&(i.drShiftTo(u,e),o!=h&&b.ZERO.subTo(e,e)),i.t=u,i.clamp(),0<a&&i.rShiftTo(a,i),o<0&&b.ZERO.subTo(i,i)}}},b.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return 0<(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)?this.DV-e:-e},b.prototype.isEven=function(){return 0==(0<this.t?1&this[0]:this.s)},b.prototype.exp=function(t,e){if(4294967295<t||t<1)return b.ONE;var i=T(),r=T(),s=e.convert(this),n=S(t)-1;for(s.copyTo(i);0<=--n;)if(e.sqrTo(i,r),0<(t&1<<n))e.mulTo(r,s,i);else{var o=i;i=r,r=o}return e.revert(i)},b.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var i,r=(1<<e)-1,s=!1,n="",o=this.t,h=this.DB-o*this.DB%e;if(0<o--)for(h<this.DB&&0<(i=this[o]>>h)&&(s=!0,n=a(i));0<=o;)h<e?(i=(this[o]&(1<<h)-1)<<e-h,i|=this[--o]>>(h+=this.DB-e)):(i=this[o]>>(h-=e)&r,h<=0&&(h+=this.DB,--o)),0<i&&(s=!0),s&&(n+=a(i));return s?n:"0"},b.prototype.negate=function(){var t=T();return b.ZERO.subTo(this,t),t},b.prototype.abs=function(){return this.s<0?this.negate():this},b.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(0!=(e=i-t.t))return this.s<0?-e:e;for(;0<=--i;)if(0!=(e=this[i]-t[i]))return e;return 0},b.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+S(this[this.t-1]^this.s&this.DM)},b.prototype.mod=function(t){var e=T();return this.abs().divRemTo(t,null,e),this.s<0&&0<e.compareTo(b.ZERO)&&t.subTo(e,e),e},b.prototype.modPowInt=function(t,e){var i;return i=t<256||e.isEven()?new y(e):new R(e),this.exp(t,i)},b.ZERO=m(0),b.ONE=m(1),d.prototype.convert=g,d.prototype.revert=g,d.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i)},d.prototype.sqrTo=function(t,e){t.squareTo(e)},E.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=T();return t.copyTo(e),this.reduce(e),e},E.prototype.revert=function(t){return t},E.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);0<=t.compareTo(this.m);)t.subTo(this.m,t)},E.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},E.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var D=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],w=(1<<26)/D[D.length-1];function x(){this.i=0,this.j=0,this.S=new Array}b.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},b.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||36<t)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),r=m(i),s=T(),n=T(),o="";for(this.divRemTo(r,s,n);0<s.signum();)o=(i+n.intValue()).toString(t).substr(1)+o,s.divRemTo(r,s,n);return n.intValue().toString(t)+o},b.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var i=this.chunkSize(e),r=Math.pow(e,i),s=!1,n=0,o=0,h=0;h<t.length;++h){var a=u(t,h);a<0?"-"==t.charAt(h)&&0==this.signum()&&(s=!0):(o=e*o+a,++n>=i&&(this.dMultiply(r),this.dAddOffset(o,0),o=n=0))}0<n&&(this.dMultiply(Math.pow(e,n)),this.dAddOffset(o,0)),s&&b.ZERO.subTo(this,this)},b.prototype.fromNumber=function(t,e,i){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(b.ONE.shiftLeft(t-1),c,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(b.ONE.shiftLeft(t-1),this);else{var r=new Array,s=7&t;r.length=1+(t>>3),e.nextBytes(r),0<s?r[0]&=(1<<s)-1:r[0]=0,this.fromString(r,256)}},b.prototype.bitwiseTo=function(t,e,i){var r,s,n=Math.min(t.t,this.t);for(r=0;r<n;++r)i[r]=e(this[r],t[r]);if(t.t<this.t){for(s=t.s&this.DM,r=n;r<this.t;++r)i[r]=e(this[r],s);i.t=this.t}else{for(s=this.s&this.DM,r=n;r<t.t;++r)i[r]=e(s,t[r]);i.t=t.t}i.s=e(this.s,t.s),i.clamp()},b.prototype.changeBit=function(t,e){var i=b.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i},b.prototype.addTo=function(t,e){for(var i=0,r=0,s=Math.min(t.t,this.t);i<s;)r+=this[i]+t[i],e[i++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;i<this.t;)r+=this[i],e[i++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;i<t.t;)r+=t[i],e[i++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=r<0?-1:0,0<r?e[i++]=r:r<-1&&(e[i++]=this.DV+r),e.t=i,e.clamp()},b.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},b.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},b.prototype.multiplyLowerTo=function(t,e,i){var r,s=Math.min(this.t+t.t,e);for(i.s=0,i.t=s;0<s;)i[--s]=0;for(r=i.t-this.t;s<r;++s)i[s+this.t]=this.am(0,t[s],i,s,0,this.t);for(r=Math.min(t.t,e);s<r;++s)this.am(0,t[s],i,s,0,e-s);i.clamp()},b.prototype.multiplyUpperTo=function(t,e,i){--e;var r=i.t=this.t+t.t-e;for(i.s=0;0<=--r;)i[r]=0;for(r=Math.max(e-this.t,0);r<t.t;++r)i[this.t+r-e]=this.am(e-r,t[r],i,0,0,this.t+r-e);i.clamp(),i.drShiftTo(1,i)},b.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(0<this.t)if(0==e)i=this[0]%t;else for(var r=this.t-1;0<=r;--r)i=(e*i+this[r])%t;return i},b.prototype.millerRabin=function(t){var e=this.subtract(b.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var r=e.shiftRight(i);D.length<(t=t+1>>1)&&(t=D.length);for(var s=T(),n=0;n<t;++n){s.fromInt(D[Math.floor(Math.random()*D.length)]);var o=s.modPow(r,this);if(0!=o.compareTo(b.ONE)&&0!=o.compareTo(e)){for(var h=1;h++<i&&0!=o.compareTo(e);)if(0==(o=o.modPowInt(2,this)).compareTo(b.ONE))return!1;if(0!=o.compareTo(e))return!1}}return!0},b.prototype.clone=function(){var t=T();return this.copyTo(t),t},b.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},b.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},b.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},b.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},b.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var i,r=this.DB-t*this.DB%8,s=0;if(0<t--)for(r<this.DB&&(i=this[t]>>r)!=(this.s&this.DM)>>r&&(e[s++]=i|this.s<<this.DB-r);0<=t;)r<8?(i=(this[t]&(1<<r)-1)<<8-r,i|=this[--t]>>(r+=this.DB-8)):(i=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==s&&(128&this.s)!=(128&i)&&++s,(0<s||i!=this.s)&&(e[s++]=i);return e},b.prototype.equals=function(t){return 0==this.compareTo(t)},b.prototype.min=function(t){return this.compareTo(t)<0?this:t},b.prototype.max=function(t){return 0<this.compareTo(t)?this:t},b.prototype.and=function(t){var e=T();return this.bitwiseTo(t,o,e),e},b.prototype.or=function(t){var e=T();return this.bitwiseTo(t,c,e),e},b.prototype.xor=function(t){var e=T();return this.bitwiseTo(t,h,e),e},b.prototype.andNot=function(t){var e=T();return this.bitwiseTo(t,f,e),e},b.prototype.not=function(){for(var t=T(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},b.prototype.shiftLeft=function(t){var e=T();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},b.prototype.shiftRight=function(t){var e=T();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},b.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+p(this[t]);return this.s<0?this.t*this.DB:-1},b.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=l(this[i]^e);return t},b.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},b.prototype.setBit=function(t){return this.changeBit(t,c)},b.prototype.clearBit=function(t){return this.changeBit(t,f)},b.prototype.flipBit=function(t){return this.changeBit(t,h)},b.prototype.add=function(t){var e=T();return this.addTo(t,e),e},b.prototype.subtract=function(t){var e=T();return this.subTo(t,e),e},b.prototype.multiply=function(t){var e=T();return this.multiplyTo(t,e),e},b.prototype.divide=function(t){var e=T();return this.divRemTo(t,e,null),e},b.prototype.remainder=function(t){var e=T();return this.divRemTo(t,null,e),e},b.prototype.divideAndRemainder=function(t){var e=T(),i=T();return this.divRemTo(t,e,i),new Array(e,i)},b.prototype.modPow=function(t,e){var i,r,s=t.bitLength(),n=m(1);if(s<=0)return n;i=s<18?1:s<48?3:s<144?4:s<768?5:6,r=s<8?new y(e):e.isEven()?new E(e):new R(e);var o=new Array,h=3,a=i-1,u=(1<<i)-1;if(o[1]=r.convert(this),1<i){var c=T();for(r.sqrTo(o[1],c);h<=u;)o[h]=T(),r.mulTo(c,o[h-2],o[h]),h+=2}var f,p,l=t.t-1,d=!0,g=T();for(s=S(t[l])-1;0<=l;){for(a<=s?f=t[l]>>s-a&u:(f=(t[l]&(1<<s+1)-1)<<a-s,0<l&&(f|=t[l-1]>>this.DB+s-a)),h=i;0==(1&f);)f>>=1,--h;if((s-=h)<0&&(s+=this.DB,--l),d)o[f].copyTo(n),d=!1;else{for(;1<h;)r.sqrTo(n,g),r.sqrTo(g,n),h-=2;0<h?r.sqrTo(n,g):(p=n,n=g,g=p),r.mulTo(g,o[f],n)}for(;0<=l&&0==(t[l]&1<<s);)r.sqrTo(n,g),p=n,n=g,g=p,--s<0&&(s=this.DB-1,--l)}return r.revert(n)},b.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return b.ZERO;for(var i=t.clone(),r=this.clone(),s=m(1),n=m(0),o=m(0),h=m(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),e?(s.isEven()&&n.isEven()||(s.addTo(this,s),n.subTo(t,n)),s.rShiftTo(1,s)):n.isEven()||n.subTo(t,n),n.rShiftTo(1,n);for(;r.isEven();)r.rShiftTo(1,r),e?(o.isEven()&&h.isEven()||(o.addTo(this,o),h.subTo(t,h)),o.rShiftTo(1,o)):h.isEven()||h.subTo(t,h),h.rShiftTo(1,h);0<=i.compareTo(r)?(i.subTo(r,i),e&&s.subTo(o,s),n.subTo(h,n)):(r.subTo(i,r),e&&o.subTo(s,o),h.subTo(n,h))}return 0!=r.compareTo(b.ONE)?b.ZERO:0<=h.compareTo(t)?h.subtract(t):h.signum()<0?(h.addTo(t,h),h.signum()<0?h.add(t):h):h},b.prototype.pow=function(t){return this.exp(t,new d)},b.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(e.compareTo(i)<0){var r=e;e=i,i=r}var s=e.getLowestSetBit(),n=i.getLowestSetBit();if(n<0)return e;for(s<n&&(n=s),0<n&&(e.rShiftTo(n,e),i.rShiftTo(n,i));0<e.signum();)0<(s=e.getLowestSetBit())&&e.rShiftTo(s,e),0<(s=i.getLowestSetBit())&&i.rShiftTo(s,i),0<=e.compareTo(i)?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return 0<n&&i.lShiftTo(n,i),i},b.prototype.isProbablePrime=function(t){var e,i=this.abs();if(1==i.t&&i[0]<=D[D.length-1]){for(e=0;e<D.length;++e)if(i[0]==D[e])return!0;return!1}if(i.isEven())return!1;for(e=1;e<D.length;){for(var r=D[e],s=e+1;s<D.length&&r<w;)r*=D[s++];for(r=i.modInt(r);e<s;)if(r%D[e++]==0)return!1}return i.millerRabin(t)},b.prototype.square=function(){var t=T();return this.squareTo(t),t},x.prototype.init=function(t){var e,i,r;for(e=0;e<256;++e)this.S[e]=e;for(e=i=0;e<256;++e)i=i+this.S[e]+t[e%t.length]&255,r=this.S[e],this.S[e]=this.S[i],this.S[i]=r;this.i=0,this.j=0},x.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var B,K,A,U=256;if(null==K){var O;if(K=new Array,A=0,window.crypto&&window.crypto.getRandomValues){var V=new Uint32Array(256);for(window.crypto.getRandomValues(V),O=0;O<V.length;++O)K[A++]=255&V[O]}var J=function(t){if(this.count=this.count||0,256<=this.count||U<=A)window.removeEventListener?window.removeEventListener("mousemove",J):window.detachEvent&&window.detachEvent("onmousemove",J);else{this.count+=1;var e=t.x+t.y;K[A++]=255&e}};window.addEventListener?window.addEventListener("mousemove",J):window.attachEvent&&window.attachEvent("onmousemove",J)}function N(){if(null==B){for(B=new x;A<U;){var t=Math.floor(65536*Math.random());K[A++]=255&t}for(B.init(K),A=0;A<K.length;++A)K[A]=0;A=0}return B.next()}function I(){}function P(t,e){return new b(t,e)}function M(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}I.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=N()},M.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},M.prototype.setPublic=function(t,e){null!=t&&null!=e&&0<t.length&&0<e.length?(this.n=P(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},M.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)return console.error("Message too long for RSA"),null;for(var i=new Array,r=t.length-1;0<=r&&0<e;){var s=t.charCodeAt(r--);s<128?i[--e]=s:127<s&&s<2048?(i[--e]=63&s|128,i[--e]=s>>6|192):(i[--e]=63&s|128,i[--e]=s>>6&63|128,i[--e]=s>>12|224)}i[--e]=0;for(var n=new I,o=new Array;2<e;){for(o[0]=0;0==o[0];)n.nextBytes(o);i[--e]=o[0]}return i[--e]=2,i[--e]=0,new b(i)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var i=this.doPublic(e);if(null==i)return null;var r=i.toString(16);return 0==(1&r.length)?r:"0"+r},M.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),i=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(i)<0;)e=e.add(this.p);return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)},M.prototype.setPrivate=function(t,e,i){null!=t&&null!=e&&0<t.length&&0<e.length?(this.n=P(t,16),this.e=parseInt(e,16),this.d=P(i,16)):console.error("Invalid RSA private key")},M.prototype.setPrivateEx=function(t,e,i,r,s,n,o,h){null!=t&&null!=e&&0<t.length&&0<e.length?(this.n=P(t,16),this.e=parseInt(e,16),this.d=P(i,16),this.p=P(r,16),this.q=P(s,16),this.dmp1=P(n,16),this.dmq1=P(o,16),this.coeff=P(h,16)):console.error("Invalid RSA private key")},M.prototype.generate=function(t,e){var i=new I,r=t>>1;this.e=parseInt(e,16);for(var s=new b(e,16);;){for(;this.p=new b(t-r,1,i),0!=this.p.subtract(b.ONE).gcd(s).compareTo(b.ONE)||!this.p.isProbablePrime(10););for(;this.q=new b(r,1,i),0!=this.q.subtract(b.ONE).gcd(s).compareTo(b.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var n=this.p;this.p=this.q,this.q=n}var o=this.p.subtract(b.ONE),h=this.q.subtract(b.ONE),a=o.multiply(h);if(0==a.gcd(s).compareTo(b.ONE)){this.n=this.p.multiply(this.q),this.d=s.modInverse(a),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(h),this.coeff=this.q.modInverse(this.p);break}}},M.prototype.decrypt=function(t){var e=P(t,16),i=this.doPrivate(e);return null==i?null:function(t,e){for(var i=t.toByteArray(),r=0;r<i.length&&0==i[r];)++r;if(i.length-r!=e-1||2!=i[r])return null;for(++r;0!=i[r];)if(++r>=i.length)return null;for(var s="";++r<i.length;){var n=255&i[r];n<128?s+=String.fromCharCode(n):191<n&&n<224?(s+=String.fromCharCode((31&n)<<6|63&i[r+1]),++r):(s+=String.fromCharCode((15&n)<<12|(63&i[r+1])<<6|63&i[r+2]),r+=2)}return s}(i,this.n.bitLength()+7>>3)},function(){M.prototype.generateAsync=function(t,e,s){var n=new I,o=t>>1;this.e=parseInt(e,16);var h=new b(e,16),a=this,u=function(){function e(){if(a.p.compareTo(a.q)<=0){var t=a.p;a.p=a.q,a.q=t}var e=a.p.subtract(b.ONE),i=a.q.subtract(b.ONE),r=e.multiply(i);0==r.gcd(h).compareTo(b.ONE)?(a.n=a.p.multiply(a.q),a.d=h.modInverse(r),a.dmp1=a.d.mod(e),a.dmq1=a.d.mod(i),a.coeff=a.q.modInverse(a.p),setTimeout(function(){s()},0)):setTimeout(u,0)}var i=function(){a.q=T(),a.q.fromNumberAsync(o,1,n,function(){a.q.subtract(b.ONE).gcda(h,function(t){0==t.compareTo(b.ONE)&&a.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(i,0)})})},r=function(){a.p=T(),a.p.fromNumberAsync(t-o,1,n,function(){a.p.subtract(b.ONE).gcda(h,function(t){0==t.compareTo(b.ONE)&&a.p.isProbablePrime(10)?setTimeout(i,0):setTimeout(r,0)})})};setTimeout(r,0)};setTimeout(u,0)};b.prototype.gcda=function(t,e){var i=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(i.compareTo(r)<0){var s=i;i=r,r=s}var n=i.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)e(i);else{n<o&&(o=n),0<o&&(i.rShiftTo(o,i),r.rShiftTo(o,r));var h=function(){0<(n=i.getLowestSetBit())&&i.rShiftTo(n,i),0<(n=r.getLowestSetBit())&&r.rShiftTo(n,r),0<=i.compareTo(r)?(i.subTo(r,i),i.rShiftTo(1,i)):(r.subTo(i,r),r.rShiftTo(1,r)),0<i.signum()?setTimeout(h,0):(0<o&&r.lShiftTo(o,r),setTimeout(function(){e(r)},0))};setTimeout(h,10)}};b.prototype.fromNumberAsync=function(t,e,i,r){if("number"==typeof e)if(t<2)this.fromInt(1);else{this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(b.ONE.shiftLeft(t-1),c,this),this.isEven()&&this.dAddOffset(1,0);var s=this,n=function(){s.dAddOffset(2,0),s.bitLength()>t&&s.subTo(b.ONE.shiftLeft(t-1),s),s.isProbablePrime(e)?setTimeout(function(){r()},0):setTimeout(n,0)};setTimeout(n,0)}else{var o=new Array,h=7&t;o.length=1+(t>>3),e.nextBytes(o),0<h?o[0]&=(1<<h)-1:o[0]=0,this.fromString(o,256)}}}();var L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",q="=";function C(t){var e,i,r="";for(e=0;e+3<=t.length;e+=3)i=parseInt(t.substring(e,e+3),16),r+=L.charAt(i>>6)+L.charAt(63&i);for(e+1==t.length?(i=parseInt(t.substring(e,e+1),16),r+=L.charAt(i<<2)):e+2==t.length&&(i=parseInt(t.substring(e,e+2),16),r+=L.charAt(i>>2)+L.charAt((3&i)<<4));0<(3&r.length);)r+=q;return r}function H(t){var e,i,r="",s=0;for(e=0;e<t.length&&t.charAt(e)!=q;++e)v=L.indexOf(t.charAt(e)),v<0||(s=0==s?(r+=a(v>>2),i=3&v,1):1==s?(r+=a(i<<2|v>>4),i=15&v,2):2==s?(r+=a(i),r+=a(v>>2),i=3&v,3):(r+=a(i<<2|v>>4),r+=a(15&v),0));return 1==s&&(r+=a(i<<2)),r}var j=j||{};j.env=j.env||{};var k=j,F=Object.prototype,_=["toString","valueOf"];j.env.parseUA=function(t){function e(t){var e=0;return parseFloat(t.replace(/\./g,function(){return 1==e++?"":"."}))}var i,r=navigator,s={ie:0,opera:0,gecko:0,webkit:0,chrome:0,mobile:null,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,webos:0,caja:r&&r.cajaVersion,secure:!1,os:null},n=t||navigator&&navigator.userAgent,o=window&&window.location,h=o&&o.href;return s.secure=h&&0===h.toLowerCase().indexOf("https"),n&&(/windows|win32/i.test(n)?s.os="windows":/macintosh/i.test(n)?s.os="macintosh":/rhino/i.test(n)&&(s.os="rhino"),/KHTML/.test(n)&&(s.webkit=1),(i=n.match(/AppleWebKit\/([^\s]*)/))&&i[1]&&(s.webkit=e(i[1]),/ Mobile\//.test(n)?(s.mobile="Apple",(i=n.match(/OS ([^\s]*)/))&&i[1]&&(i=e(i[1].replace("_","."))),s.ios=i,s.ipad=s.ipod=s.iphone=0,(i=n.match(/iPad|iPod|iPhone/))&&i[0]&&(s[i[0].toLowerCase()]=s.ios)):((i=n.match(/NokiaN[^\/]*|Android \d\.\d|webOS\/\d\.\d/))&&(s.mobile=i[0]),/webOS/.test(n)&&(s.mobile="WebOS",(i=n.match(/webOS\/([^\s]*);/))&&i[1]&&(s.webos=e(i[1]))),/ Android/.test(n)&&(s.mobile="Android",(i=n.match(/Android ([^\s]*);/))&&i[1]&&(s.android=e(i[1])))),(i=n.match(/Chrome\/([^\s]*)/))&&i[1]?s.chrome=e(i[1]):(i=n.match(/AdobeAIR\/([^\s]*)/))&&(s.air=i[0])),s.webkit||((i=n.match(/Opera[\s\/]([^\s]*)/))&&i[1]?(s.opera=e(i[1]),(i=n.match(/Version\/([^\s]*)/))&&i[1]&&(s.opera=e(i[1])),(i=n.match(/Opera Mini[^;]*/))&&(s.mobile=i[0])):(i=n.match(/MSIE\s([^;]*)/))&&i[1]?s.ie=e(i[1]):(i=n.match(/Gecko\/([^\s]*)/))&&(s.gecko=1,(i=n.match(/rv:([^\s\)]*)/))&&i[1]&&(s.gecko=e(i[1]))))),s},j.env.ua=j.env.parseUA(),j.isFunction=function(t){return"function"==typeof t||"[object Function]"===F.toString.apply(t)},j._IEEnumFix=j.env.ua.ie?function(t,e){var i,r,s;for(i=0;i<_.length;i+=1)s=e[r=_[i]],k.isFunction(s)&&s!=F[r]&&(t[r]=s)}:function(){},j.extend=function(t,e,i){if(!e||!t)throw new Error("extend failed, please check that all dependencies are included.");function r(){}var s;if(r.prototype=e.prototype,t.prototype=new r,(t.prototype.constructor=t).superclass=e.prototype,e.prototype.constructor==F.constructor&&(e.prototype.constructor=e),i){for(s in i)k.hasOwnProperty(i,s)&&(t.prototype[s]=i[s]);k._IEEnumFix(t.prototype,i)}},"undefined"!=typeof KJUR&&KJUR||(KJUR={}),void 0!==KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var i=e.substr(1).length;i%2==1?i+=1:e.match(/^[0-7]/)||(i+=2);for(var r="",s=0;s<i;s++)r+="f";e=new b(r,16).xor(t).add(b.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){var i=CryptoJS.enc.Hex.parse(t),r=CryptoJS.enc.Base64.stringify(i).replace(/(.{64})/g,"$1\r\n");return"-----BEGIN "+e+"-----\r\n"+(r=r.replace(/\r\n$/,""))+"\r\n-----END "+e+"-----\r\n"}},KJUR.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var i=e.length/2;if(15<i)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+i).toString(16)+e},this.getEncodedHex=function(){return null!=this.hTLV&&!this.isModified||(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},KJUR.asn1.DERAbstractString=function(t){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},j.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractTime=function(t){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(t){return utc=t.getTime()+6e4*t.getTimezoneOffset(),new Date(utc)},this.formatDate=function(t,e){var i=this.zeroPadding,r=this.localDateToUTC(t),s=String(r.getFullYear());return"utc"==e&&(s=s.substr(2,2)),s+i(String(r.getMonth()+1),2)+i(String(r.getDate()),2)+i(String(r.getHours()),2)+i(String(r.getMinutes()),2)+i(String(r.getSeconds()),2)+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setByDateValue=function(t,e,i,r,s,n){var o=new Date(Date.UTC(t,e-1,i,r,s,n,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},j.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractStructured=function(t){KJUR.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},j.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object),KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},j.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object),KJUR.asn1.DERInteger=function(t){KJUR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new b(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):void 0!==t.hex&&this.setValueHex(t.hex))},j.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object),KJUR.asn1.DERBitString=function(t){KJUR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var i="0"+t;this.hTLV=null,this.isModified=!0,this.hV=i+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0);for(var i=0;i<=e;i++)t+="0";var r="";for(i=0;i<t.length-1;i+=8){var s=t.substr(i,8),n=parseInt(s,2).toString(16);1==n.length&&(n="0"+n),r+=n}this.hTLV=null,this.isModified=!0,this.hV="0"+e+r},this.setByBooleanArray=function(t){for(var e="",i=0;i<t.length;i++)1==t[i]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},j.extend(KJUR.asn1.DERBitString,KJUR.asn1.ASN1Object),KJUR.asn1.DEROctetString=function(t){KJUR.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},j.extend(KJUR.asn1.DEROctetString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNull=function(){KJUR.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},j.extend(KJUR.asn1.DERNull,KJUR.asn1.ASN1Object),KJUR.asn1.DERObjectIdentifier=function(t){function h(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e}function n(t){var e="",i=new b(t,10).toString(2),r=7-i.length%7;7==r&&(r=0);for(var s="",n=0;n<r;n++)s+="0";for(i=s+i,n=0;n<i.length-1;n+=7){var o=i.substr(n,7);n!=i.length-7&&(o="1"+o),e+=h(parseInt(o,2))}return e}KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var e="",i=t.split("."),r=40*parseInt(i[0])+parseInt(i[1]);e+=h(r),i.splice(0,2);for(var s=0;s<i.length;s++)e+=n(i[s]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(t){if(void 0===KJUR.asn1.x509.OID.name2oidList[t])throw"DERObjectIdentifier oidName undefined: "+t;var e=KJUR.asn1.x509.OID.name2oidList[t];this.setValueOidString(e)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.oid?this.setValueOidString(t.oid):void 0!==t.hex?this.setValueHex(t.hex):void 0!==t.name&&this.setValueName(t.name))},j.extend(KJUR.asn1.DERObjectIdentifier,KJUR.asn1.ASN1Object),KJUR.asn1.DERUTF8String=function(t){KJUR.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},j.extend(KJUR.asn1.DERUTF8String,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNumericString=function(t){KJUR.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},j.extend(KJUR.asn1.DERNumericString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERPrintableString=function(t){KJUR.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},j.extend(KJUR.asn1.DERPrintableString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERTeletexString=function(t){KJUR.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},j.extend(KJUR.asn1.DERTeletexString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERIA5String=function(t){KJUR.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},j.extend(KJUR.asn1.DERIA5String,KJUR.asn1.DERAbstractString),KJUR.asn1.DERUTCTime=function(t){KJUR.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},void 0!==t&&(void 0!==t.str?this.setString(t.str):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},j.extend(KJUR.asn1.DERUTCTime,KJUR.asn1.DERAbstractTime),KJUR.asn1.DERGeneralizedTime=function(t){KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen"),this.hV=stohex(this.s)},void 0!==t&&(void 0!==t.str?this.setString(t.str):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},j.extend(KJUR.asn1.DERGeneralizedTime,KJUR.asn1.DERAbstractTime),KJUR.asn1.DERSequence=function(t){KJUR.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){t+=this.asn1Array[e].getEncodedHex()}return this.hV=t,this.hV}},j.extend(KJUR.asn1.DERSequence,KJUR.asn1.DERAbstractStructured),KJUR.asn1.DERSet=function(t){KJUR.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var i=this.asn1Array[e];t.push(i.getEncodedHex())}return t.sort(),this.hV=t.join(""),this.hV}},j.extend(KJUR.asn1.DERSet,KJUR.asn1.DERAbstractStructured),KJUR.asn1.DERTaggedObject=function(t){KJUR.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,i){this.hT=e,this.isExplicit=t,this.asn1Object=i,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=i.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.tag&&(this.hT=t.tag),void 0!==t.explicit&&(this.isExplicit=t.explicit),void 0!==t.obj&&(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},j.extend(KJUR.asn1.DERTaggedObject,KJUR.asn1.ASN1Object),function(){"use strict";var a,t={};t.decode=function(t){var e;if(void 0===a){var i="0123456789ABCDEF",r=" \f\n\r\t \u2028\u2029";for(a=[],e=0;e<16;++e)a[i.charAt(e)]=e;for(i=i.toLowerCase(),e=10;e<16;++e)a[i.charAt(e)]=e;for(e=0;e<r.length;++e)a[r.charAt(e)]=-1}var s=[],n=0,o=0;for(e=0;e<t.length;++e){var h=t.charAt(e);if("="==h)break;if(-1!=(h=a[h])){if(void 0===h)throw"Illegal character at offset "+e;n|=h,2<=++o?(s[s.length]=n,o=n=0):n<<=4}}if(o)throw"Hex encoding incomplete: 4 bits missing";return s},window.Hex=t}(),function(){"use strict";var h,i={};i.decode=function(t){var e;if(void 0===h){var i="= \f\n\r\t \u2028\u2029";for(h=[],e=0;e<64;++e)h["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)]=e;for(e=0;e<i.length;++e)h[i.charAt(e)]=-1}var r=[],s=0,n=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;if(-1!=(o=h[o])){if(void 0===o)throw"Illegal character at offset "+e;s|=o,4<=++n?(r[r.length]=s>>16,r[r.length]=s>>8&255,r[r.length]=255&s,n=s=0):s<<=6}}switch(n){case 1:throw"Base64 encoding incomplete: at least 2 bits missing";case 2:r[r.length]=s>>10;break;case 3:r[r.length]=s>>16,r[r.length]=s>>8&255}return r},i.re=/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,i.unarmor=function(t){var e=i.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw"RegExp out of sync";t=e[2]}return i.decode(t)},window.Base64=i}(),function(o){"use strict";var c=function(t,e){var i=document.createElement(t);return i.className=e,i},f=function(t){return document.createTextNode(t)};function u(t,e){t instanceof u?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=e)}function p(t,e,i,r,s){this.stream=t,this.header=e,this.length=i,this.tag=r,this.sub=s}u.prototype.get=function(t){if(t===o&&(t=this.pos++),t>=this.enc.length)throw"Requesting byte offset "+t+" on a stream of length "+this.enc.length;return this.enc[t]},u.prototype.hexDigits="0123456789ABCDEF",u.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},u.prototype.hexDump=function(t,e,i){for(var r="",s=t;s<e;++s)if(r+=this.hexByte(this.get(s)),!0!==i)switch(15&s){case 7:r+="  ";break;case 15:r+="\n";break;default:r+=" "}return r},u.prototype.parseStringISO=function(t,e){for(var i="",r=t;r<e;++r)i+=String.fromCharCode(this.get(r));return i},u.prototype.parseStringUTF=function(t,e){for(var i="",r=t;r<e;){var s=this.get(r++);i+=s<128?String.fromCharCode(s):191<s&&s<224?String.fromCharCode((31&s)<<6|63&this.get(r++)):String.fromCharCode((15&s)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return i},u.prototype.parseStringBMP=function(t,e){for(var i="",r=t;r<e;r+=2){var s=this.get(r),n=this.get(r+1);i+=String.fromCharCode((s<<8)+n)}return i},u.prototype.reTime=/^((?:1[89]|2\d)?\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,u.prototype.parseTime=function(t,e){var i=this.parseStringISO(t,e),r=this.reTime.exec(i);return r?(i=r[1]+"-"+r[2]+"-"+r[3]+" "+r[4],r[5]&&(i+=":"+r[5],r[6]&&(i+=":"+r[6],r[7]&&(i+="."+r[7]))),r[8]&&(i+=" UTC","Z"!=r[8]&&(i+=r[8],r[9]&&(i+=":"+r[9]))),i):"Unrecognized time: "+i},u.prototype.parseInteger=function(t,e){var i=e-t;if(4<i){i<<=3;var r=this.get(t);if(0===r)i-=8;else for(;r<128;)r<<=1,--i;return"("+i+" bit)"}for(var s=0,n=t;n<e;++n)s=s<<8|this.get(n);return s},u.prototype.parseBitString=function(t,e){var i=this.get(t),r=(e-t-1<<3)-i,s="("+r+" bit)";if(r<=20){var n=i;s+=" ";for(var o=e-1;t<o;--o){for(var h=this.get(o),a=n;a<8;++a)s+=h>>a&1?"1":"0";n=0}}return s},u.prototype.parseOctetString=function(t,e){var i=e-t,r="("+i+" byte) ";100<i&&(e=t+100);for(var s=t;s<e;++s)r+=this.hexByte(this.get(s));return 100<i&&(r+="…"),r},u.prototype.parseOID=function(t,e){for(var i="",r=0,s=0,n=t;n<e;++n){var o=this.get(n);if(r=r<<7|127&o,s+=7,!(128&o)){if(""===i){var h=r<80?r<40?0:1:2;i=h+"."+(r-40*h)}else i+="."+(31<=s?"bigint":r);r=s=0}}return i},p.prototype.typeName=function(){if(this.tag===o)return"unknown";var t=this.tag>>6,e=(this.tag,31&this.tag);switch(t){case 0:switch(e){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString";default:return"Universal_"+e.toString(16)}case 1:return"Application_"+e.toString(16);case 2:return"["+e+"]";case 3:return"Private_"+e.toString(16)}},p.prototype.reSeemsASCII=/^[ -~]+$/,p.prototype.content=function(){if(this.tag===o)return null;var t=this.tag>>6,e=31&this.tag,i=this.posContent(),r=Math.abs(this.length);if(0!=t){if(null!==this.sub)return"("+this.sub.length+" elem)";var s=this.stream.parseStringISO(i,i+Math.min(r,100));return this.reSeemsASCII.test(s)?s.substring(0,200)+(200<s.length?"…":""):this.stream.parseOctetString(i,i+r)}switch(e){case 1:return 0===this.stream.get(i)?"false":"true";case 2:return this.stream.parseInteger(i,i+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(i,i+r);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(i,i+r);case 6:return this.stream.parseOID(i,i+r);case 16:case 17:return"("+this.sub.length+" elem)";case 12:return this.stream.parseStringUTF(i,i+r);case 18:case 19:case 20:case 21:case 22:case 26:return this.stream.parseStringISO(i,i+r);case 30:return this.stream.parseStringBMP(i,i+r);case 23:case 24:return this.stream.parseTime(i,i+r)}return null},p.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},p.prototype.print=function(t){if(t===o&&(t=""),document.writeln(t+this),null!==this.sub){t+="  ";for(var e=0,i=this.sub.length;e<i;++e)this.sub[e].print(t)}},p.prototype.toPrettyString=function(t){t===o&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(0<=this.length&&(e+="+"),e+=this.length,32&this.tag?e+=" (constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+="  ";for(var i=0,r=this.sub.length;i<r;++i)e+=this.sub[i].toPrettyString(t)}return e},p.prototype.toDOM=function(){var t=c("div","node");t.asn1=this;var e=c("div","head"),i=this.typeName().replace(/_/g," ");e.innerHTML=i;var r=this.content();if(null!==r){r=String(r).replace(/</g,"&lt;");var s=c("span","preview");s.appendChild(f(r)),e.appendChild(s)}t.appendChild(e),this.node=t,this.head=e;var n=c("div","value");if(i="Offset: "+this.stream.pos+"<br/>",i+="Length: "+this.header+"+",0<=this.length?i+=this.length:i+=-this.length+" (undefined)",32&this.tag?i+="<br/>(constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(i+="<br/>(encapsulates)"),null!==r&&(i+="<br/>Value:<br/><b>"+r+"</b>","object"==typeof oids&&6==this.tag)){var o=oids[r];o&&(o.d&&(i+="<br/>"+o.d),o.c&&(i+="<br/>"+o.c),o.w&&(i+="<br/>(warning!)"))}n.innerHTML=i,t.appendChild(n);var h=c("div","sub");if(null!==this.sub)for(var a=0,u=this.sub.length;a<u;++a)h.appendChild(this.sub[a].toDOM());return t.appendChild(h),e.onclick=function(){t.className="node collapsed"==t.className?"node":"node collapsed"},t},p.prototype.posStart=function(){return this.stream.pos},p.prototype.posContent=function(){return this.stream.pos+this.header},p.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},p.prototype.fakeHover=function(t){this.node.className+=" hover",t&&(this.head.className+=" hover")},p.prototype.fakeOut=function(t){var e=/ ?hover/;this.node.className=this.node.className.replace(e,""),t&&(this.head.className=this.head.className.replace(e,""))},p.prototype.toHexDOM_sub=function(t,e,i,r,s){if(!(s<=r)){var n=c("span",e);n.appendChild(f(i.hexDump(r,s))),t.appendChild(n)}},p.prototype.toHexDOM=function(e){var t=c("span","hex");if(e===o&&(e=t),this.head.hexNode=t,this.head.onmouseover=function(){this.hexNode.className="hexCurrent"},this.head.onmouseout=function(){this.hexNode.className="hex"},t.asn1=this,t.onmouseover=function(){var t=!e.selected;t&&(e.selected=this.asn1,this.className="hexCurrent"),this.asn1.fakeHover(t)},t.onmouseout=function(){var t=e.selected==this.asn1;this.asn1.fakeOut(t),t&&(e.selected=null,this.className="hex")},this.toHexDOM_sub(t,"tag",this.stream,this.posStart(),this.posStart()+1),this.toHexDOM_sub(t,0<=this.length?"dlen":"ulen",this.stream,this.posStart()+1,this.posContent()),null===this.sub)t.appendChild(f(this.stream.hexDump(this.posContent(),this.posEnd())));else if(0<this.sub.length){var i=this.sub[0],r=this.sub[this.sub.length-1];this.toHexDOM_sub(t,"intro",this.stream,this.posContent(),i.posStart());for(var s=0,n=this.sub.length;s<n;++s)t.appendChild(this.sub[s].toHexDOM(e));this.toHexDOM_sub(t,"outro",this.stream,r.posEnd(),this.posEnd())}return t},p.prototype.toHexString=function(t){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},p.decodeLength=function(t){var e=t.get(),i=127&e;if(i==e)return i;if(3<i)throw"Length over 24 bits not supported at position "+(t.pos-1);if(0==i)return-1;for(var r=e=0;r<i;++r)e=e<<8|t.get();return e},p.hasContent=function(t,e,i){if(32&t)return!0;if(t<3||4<t)return!1;var r=new u(i);if(3==t&&r.get(),r.get()>>6&1)return!1;try{var s=p.decodeLength(r);return r.pos-i.pos+s==e}catch(t){return!1}},p.decode=function(t){t instanceof u||(t=new u(t,0));var e=new u(t),i=t.get(),r=p.decodeLength(t),s=t.pos-e.pos,n=null;if(p.hasContent(i,r,t)){var o=t.pos;if(3==i&&t.get(),n=[],0<=r){for(var h=o+r;t.pos<h;)n[n.length]=p.decode(t);if(t.pos!=h)throw"Content size is not correct for container starting at offset "+o}else try{for(;;){var a=p.decode(t);if(0===a.tag)break;n[n.length]=a}r=o-t.pos}catch(t){throw"Exception while decoding undefined length content: "+t}}else t.pos+=r;return new p(e,s,r,i,n)},p.test=function(){for(var t=[{value:[39],expected:39},{value:[129,201],expected:201},{value:[131,254,220,186],expected:16702650}],e=0,i=t.length;e<i;++e){var r=new u(t[e].value,0),s=p.decodeLength(r);s!=t[e].expected&&document.write("In test["+e+"] expected "+t[e].expected+" got "+s+"\n")}},window.ASN1=p}(),ASN1.prototype.getHexStringValue=function(){var t=this.toHexString(),e=2*this.header,i=2*this.length;return t.substr(e,i)},M.prototype.parseKey=function(t){try{var e=0,i=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t)?Hex.decode(t):Base64.unarmor(t),s=ASN1.decode(r);if(3===s.sub.length&&(s=s.sub[2].sub[0]),9===s.sub.length){e=s.sub[1].getHexStringValue(),this.n=P(e,16),i=s.sub[2].getHexStringValue(),this.e=parseInt(i,16);var n=s.sub[3].getHexStringValue();this.d=P(n,16);var o=s.sub[4].getHexStringValue();this.p=P(o,16);var h=s.sub[5].getHexStringValue();this.q=P(h,16);var a=s.sub[6].getHexStringValue();this.dmp1=P(a,16);var u=s.sub[7].getHexStringValue();this.dmq1=P(u,16);var c=s.sub[8].getHexStringValue();this.coeff=P(c,16)}else{if(2!==s.sub.length)return!1;var f=s.sub[1].sub[0];e=f.sub[0].getHexStringValue(),this.n=P(e,16),i=f.sub[1].getHexStringValue(),this.e=parseInt(i,16)}return!0}catch(t){return!1}},M.prototype.getPrivateBaseKey=function(){var t={array:[new KJUR.asn1.DERInteger({int:0}),new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({int:this.e}),new KJUR.asn1.DERInteger({bigint:this.d}),new KJUR.asn1.DERInteger({bigint:this.p}),new KJUR.asn1.DERInteger({bigint:this.q}),new KJUR.asn1.DERInteger({bigint:this.dmp1}),new KJUR.asn1.DERInteger({bigint:this.dmq1}),new KJUR.asn1.DERInteger({bigint:this.coeff})]};return new KJUR.asn1.DERSequence(t).getEncodedHex()},M.prototype.getPrivateBaseKeyB64=function(){return C(this.getPrivateBaseKey())},M.prototype.getPublicBaseKey=function(){var t={array:[new KJUR.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new KJUR.asn1.DERNull]},e=new KJUR.asn1.DERSequence(t);return t={array:[new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({int:this.e})]},t={hex:"00"+new KJUR.asn1.DERSequence(t).getEncodedHex()},t={array:[e,new KJUR.asn1.DERBitString(t)]},new KJUR.asn1.DERSequence(t).getEncodedHex()},M.prototype.getPublicBaseKeyB64=function(){return C(this.getPublicBaseKey())},M.prototype.wordwrap=function(t,e){if(!t)return t;var i="(.{1,"+(e=e||64)+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(i,"g")).join("\n")},M.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";return t+=this.wordwrap(this.getPrivateBaseKeyB64())+"\n",t+="-----END RSA PRIVATE KEY-----"},M.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";return t+=this.wordwrap(this.getPublicBaseKeyB64())+"\n",t+="-----END PUBLIC KEY-----"},M.prototype.hasPublicKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")},M.prototype.hasPrivateKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")},M.prototype.parsePropertiesFrom=function(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)};function z(t){M.call(this),t&&("string"==typeof t?this.parseKey(t):(this.hasPrivateKeyProperty(t)||this.hasPublicKeyProperty(t))&&this.parsePropertiesFrom(t))}(z.prototype=new M).constructor=z;function Z(t){t=t||{},this.default_key_size=parseInt(t.default_key_size)||1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}Z.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new z(t)},Z.prototype.setPrivateKey=function(t){this.setKey(t)},Z.prototype.setPublicKey=function(t){this.setKey(t)},Z.prototype.decrypt=function(t){try{return this.getKey().decrypt(H(t))}catch(t){return!1}},Z.prototype.encrypt=function(t){try{return C(this.getKey().encrypt(t))}catch(t){return!1}},Z.prototype.getKey=function(t){if(!this.key){if(this.key=new z,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},Z.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},Z.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},Z.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},Z.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},t.JSEncrypt=Z}(JSEncryptExports);var JSEncrypt=JSEncryptExports.JSEncrypt;