geekin-devtoys 0.2.4-r1 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const gt=require("element-plus"),Z=require("vue"),Ot=require("../_plugin-vue_export-helper-BHFhmbuH.js");var ht=typeof document<"u"?document.currentScript:null,Mt="0123456789abcdefghijklmnopqrstuvwxyz";function P(r){return Mt.charAt(r)}function Nt(r,t){return r&t}function Y(r,t){return r|t}function vt(r,t){return r^t}function yt(r,t){return r&~t}function _t(r){if(r==0)return-1;var t=0;return(r&65535)==0&&(r>>=16,t+=16),(r&255)==0&&(r>>=8,t+=8),(r&15)==0&&(r>>=4,t+=4),(r&3)==0&&(r>>=2,t+=2),(r&1)==0&&++t,t}function qt(r){for(var t=0;r!=0;)r&=r-1,++t;return t}var F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bt="=";function J(r){var t,e,i="";for(t=0;t+3<=r.length;t+=3)e=parseInt(r.substring(t,t+3),16),i+=F.charAt(e>>6)+F.charAt(e&63);for(t+1==r.length?(e=parseInt(r.substring(t,t+1),16),i+=F.charAt(e<<2)):t+2==r.length&&(e=parseInt(r.substring(t,t+2),16),i+=F.charAt(e>>2)+F.charAt((e&3)<<4));(i.length&3)>0;)i+=Bt;return i}function mt(r){var t="",e,i=0,n=0;for(e=0;e<r.length&&r.charAt(e)!=Bt;++e){var s=F.indexOf(r.charAt(e));s<0||(i==0?(t+=P(s>>2),n=s&3,i=1):i==1?(t+=P(n<<2|s>>4),n=s&15,i=2):i==2?(t+=P(n),t+=P(s>>2),n=s&3,i=3):(t+=P(n<<2|s>>4),t+=P(s&15),i=0))}return i==1&&(t+=P(n<<2)),t}var H,Ht={decode:function(r){var t;if(H===void 0){var e="0123456789ABCDEF",i=` \f
2
- \r  \u2028\u2029`;for(H={},t=0;t<16;++t)H[e.charAt(t)]=t;for(e=e.toLowerCase(),t=10;t<16;++t)H[e.charAt(t)]=t;for(t=0;t<i.length;++t)H[i.charAt(t)]=-1}var n=[],s=0,o=0;for(t=0;t<r.length;++t){var h=r.charAt(t);if(h=="=")break;if(h=H[h],h!=-1){if(h===void 0)throw new Error("Illegal character at offset "+t);s|=h,++o>=2?(n[n.length]=s,s=0,o=0):s<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return n}},N,lt={decode:function(r){var t;if(N===void 0){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=`= \f
3
- \r  \u2028\u2029`;for(N=Object.create(null),t=0;t<64;++t)N[e.charAt(t)]=t;for(N["-"]=62,N._=63,t=0;t<i.length;++t)N[i.charAt(t)]=-1}var n=[],s=0,o=0;for(t=0;t<r.length;++t){var h=r.charAt(t);if(h=="=")break;if(h=N[h],h!=-1){if(h===void 0)throw new Error("Illegal character at offset "+t);s|=h,++o>=4?(n[n.length]=s>>16,n[n.length]=s>>8&255,n[n.length]=s&255,s=0,o=0):s<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=s>>10;break;case 3:n[n.length]=s>>16,n[n.length]=s>>8&255;break}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(r){var t=lt.re.exec(r);if(t)if(t[1])r=t[1];else if(t[2])r=t[2];else throw new Error("RegExp out of sync");return lt.decode(r)}},k=1e13,W=(function(){function r(t){this.buf=[+t||0]}return r.prototype.mulAdd=function(t,e){var i=this.buf,n=i.length,s,o;for(s=0;s<n;++s)o=i[s]*t+e,o<k?e=0:(e=0|o/k,o-=e*k),i[s]=o;e>0&&(i[s]=e)},r.prototype.sub=function(t){var e=this.buf,i=e.length,n,s;for(n=0;n<i;++n)s=e[n]-t,s<0?(s+=k,t=1):t=0,e[n]=s;for(;e[e.length-1]===0;)e.pop()},r.prototype.toString=function(t){if((t||10)!=10)throw new Error("only base 10 is supported");for(var e=this.buf,i=e[e.length-1].toString(),n=e.length-2;n>=0;--n)i+=(k+e[n]).toString().substring(1);return i},r.prototype.valueOf=function(){for(var t=this.buf,e=0,i=t.length-1;i>=0;--i)e=e*k+t[i];return e},r.prototype.simplify=function(){var t=this.buf;return t.length==1?t[0]:this},r})(),It="…",kt=/^(\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)?)?$/,Ft=/^(\d\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)?)?$/;function L(r,t){return r.length>t&&(r=r.substring(0,t)+It),r}var at=(function(){function r(t,e){this.hexDigits="0123456789ABCDEF",t instanceof r?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=e)}return r.prototype.get=function(t){if(t===void 0&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset ".concat(t," on a stream of length ").concat(this.enc.length));return typeof this.enc=="string"?this.enc.charCodeAt(t):this.enc[t]},r.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(t&15)},r.prototype.hexDump=function(t,e,i){for(var n="",s=t;s<e;++s)if(n+=this.hexByte(this.get(s)),i!==!0)switch(s&15){case 7:n+=" ";break;case 15:n+=`
4
- `;break;default:n+=" "}return n},r.prototype.isASCII=function(t,e){for(var i=t;i<e;++i){var n=this.get(i);if(n<32||n>176)return!1}return!0},r.prototype.parseStringISO=function(t,e){for(var i="",n=t;n<e;++n)i+=String.fromCharCode(this.get(n));return i},r.prototype.parseStringUTF=function(t,e){for(var i="",n=t;n<e;){var s=this.get(n++);s<128?i+=String.fromCharCode(s):s>191&&s<224?i+=String.fromCharCode((s&31)<<6|this.get(n++)&63):i+=String.fromCharCode((s&15)<<12|(this.get(n++)&63)<<6|this.get(n++)&63)}return i},r.prototype.parseStringBMP=function(t,e){for(var i="",n,s,o=t;o<e;)n=this.get(o++),s=this.get(o++),i+=String.fromCharCode(n<<8|s);return i},r.prototype.parseTime=function(t,e,i){var n=this.parseStringISO(t,e),s=(i?kt:Ft).exec(n);return s?(i&&(s[1]=+s[1],s[1]+=+s[1]<70?2e3:1900),n=s[1]+"-"+s[2]+"-"+s[3]+" "+s[4],s[5]&&(n+=":"+s[5],s[6]&&(n+=":"+s[6],s[7]&&(n+="."+s[7]))),s[8]&&(n+=" UTC",s[8]!="Z"&&(n+=s[8],s[9]&&(n+=":"+s[9]))),n):"Unrecognized time: "+n},r.prototype.parseInteger=function(t,e){for(var i=this.get(t),n=i>127,s=n?255:0,o,h="";i==s&&++t<e;)i=this.get(t);if(o=e-t,o===0)return n?-1:0;if(o>4){for(h=i,o<<=3;((+h^s)&128)==0;)h=+h<<1,--o;h="("+o+` bit)
5
- `}n&&(i=i-256);for(var a=new W(i),f=t+1;f<e;++f)a.mulAdd(256,this.get(f));return h+a.toString()},r.prototype.parseBitString=function(t,e,i){for(var n=this.get(t),s=(e-t-1<<3)-n,o="("+s+` bit)
6
- `,h="",a=t+1;a<e;++a){for(var f=this.get(a),l=a==e-1?n:0,c=7;c>=l;--c)h+=f>>c&1?"1":"0";if(h.length>i)return o+L(h,i)}return o+h},r.prototype.parseOctetString=function(t,e,i){if(this.isASCII(t,e))return L(this.parseStringISO(t,e),i);var n=e-t,s="("+n+` byte)
7
- `;i/=2,n>i&&(e=t+i);for(var o=t;o<e;++o)s+=this.hexByte(this.get(o));return n>i&&(s+=It),s},r.prototype.parseOID=function(t,e,i){for(var n="",s=new W,o=0,h=t;h<e;++h){var a=this.get(h);if(s.mulAdd(128,a&127),o+=7,!(a&128)){if(n==="")if(s=s.simplify(),s instanceof W)s.sub(80),n="2."+s.toString();else{var f=s<80?s<40?0:1:2;n=f+"."+(s-f*40)}else n+="."+s.toString();if(n.length>i)return L(n,i);s=new W,o=0}}return o>0&&(n+=".incomplete"),n},r})(),Lt=(function(){function r(t,e,i,n,s){if(!(n instanceof St))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=i,this.tag=n,this.sub=s}return r.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){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"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},r.prototype.content=function(t){if(this.tag===void 0)return null;t===void 0&&(t=1/0);var e=this.posContent(),i=Math.abs(this.length);if(!this.tag.isUniversal())return this.sub!==null?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+i,t);switch(this.tag.tagNumber){case 1:return this.stream.get(e)===0?"false":"true";case 2:return this.stream.parseInteger(e,e+i);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+i,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+i,t);case 6:return this.stream.parseOID(e,e+i,t);case 16:case 17:return this.sub!==null?"("+this.sub.length+" elem)":"(no elem)";case 12:return L(this.stream.parseStringUTF(e,e+i),t);case 18:case 19:case 20:case 21:case 22:case 26:return L(this.stream.parseStringISO(e,e+i),t);case 30:return L(this.stream.parseStringBMP(e,e+i),t);case 23:case 24:return this.stream.parseTime(e,e+i,this.tag.tagNumber==23)}return null},r.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(this.sub===null?"null":this.sub.length)+"]"},r.prototype.toPrettyString=function(t){t===void 0&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":this.tag.isUniversal()&&(this.tag.tagNumber==3||this.tag.tagNumber==4)&&this.sub!==null&&(e+=" (encapsulates)"),e+=`
8
- `,this.sub!==null){t+=" ";for(var i=0,n=this.sub.length;i<n;++i)e+=this.sub[i].toPrettyString(t)}return e},r.prototype.posStart=function(){return this.stream.pos},r.prototype.posContent=function(){return this.stream.pos+this.header},r.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},r.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},r.decodeLength=function(t){var e=t.get(),i=e&127;if(i==e)return i;if(i>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(i===0)return null;e=0;for(var n=0;n<i;++n)e=e*256+t.get();return e},r.prototype.getHexStringValue=function(){var t=this.toHexString(),e=this.header*2,i=this.length*2;return t.substring(e,e+i)},r.decode=function(t){var e;t instanceof at?e=t:e=new at(t,0);var i=new at(e),n=new St(e),s=r.decodeLength(e),o=e.pos,h=o-i.pos,a=null,f=function(){var c=[];if(s!==null){for(var g=o+s;e.pos<g;)c[c.length]=r.decode(e);if(e.pos!=g)throw new Error("Content size is not correct for container starting at offset "+o)}else try{for(;;){var d=r.decode(e);if(d.tag.isEOC())break;c[c.length]=d}s=o-e.pos}catch(m){throw new Error("Exception while decoding undefined length content: "+m)}return c};if(n.tagConstructed)a=f();else if(n.isUniversal()&&(n.tagNumber==3||n.tagNumber==4))try{if(n.tagNumber==3&&e.get()!=0)throw new Error("BIT STRINGs with unused bits cannot encapsulate.");a=f();for(var l=0;l<a.length;++l)if(a[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch{a=null}if(a===null){if(s===null)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);e.pos=o+Math.abs(s)}return new r(i,h,s,n,a)},r})(),St=(function(){function r(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=(e&32)!==0,this.tagNumber=e&31,this.tagNumber==31){var i=new W;do e=t.get(),i.mulAdd(128,e&127);while(e&128);this.tagNumber=i.simplify()}}return r.prototype.isUniversal=function(){return this.tagClass===0},r.prototype.isEOC=function(){return this.tagClass===0&&this.tagNumber===0},r})(),O,Kt=0xdeadbeefcafe,bt=(Kt&16777215)==15715070,E=[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],Ut=(1<<26)/E[E.length-1],p=(function(){function r(t,e,i){t!=null&&(typeof t=="number"?this.fromNumber(t,e,i):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}return r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var i=(1<<e)-1,n,s=!1,o="",h=this.t,a=this.DB-h*this.DB%e;if(h-- >0)for(a<this.DB&&(n=this[h]>>a)>0&&(s=!0,o=P(n));h>=0;)a<e?(n=(this[h]&(1<<a)-1)<<e-a,n|=this[--h]>>(a+=this.DB-e)):(n=this[h]>>(a-=e)&i,a<=0&&(a+=this.DB,--h)),n>0&&(s=!0),s&&(o+=P(n));return s?o:"0"},r.prototype.negate=function(){var t=v();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(e!=0)return e;var i=this.t;if(e=i-t.t,e!=0)return this.s<0?-e:e;for(;--i>=0;)if((e=this[i]-t[i])!=0)return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+Q(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=v();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var i;return t<256||e.isEven()?i=new Tt(e):i=new wt(e),this.exp(t,i)},r.prototype.clone=function(){var t=v();return this.copyTo(t),t},r.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var i=this.DB-t*this.DB%8,n,s=0;if(t-- >0)for(i<this.DB&&(n=this[t]>>i)!=(this.s&this.DM)>>i&&(e[s++]=n|this.s<<this.DB-i);t>=0;)i<8?(n=(this[t]&(1<<i)-1)<<8-i,n|=this[--t]>>(i+=this.DB-8)):(n=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),(n&128)!=0&&(n|=-256),s==0&&(this.s&128)!=(n&128)&&++s,(s>0||n!=this.s)&&(e[s++]=n);return e},r.prototype.equals=function(t){return this.compareTo(t)==0},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=v();return this.bitwiseTo(t,Nt,e),e},r.prototype.or=function(t){var e=v();return this.bitwiseTo(t,Y,e),e},r.prototype.xor=function(t){var e=v();return this.bitwiseTo(t,vt,e),e},r.prototype.andNot=function(t){var e=v();return this.bitwiseTo(t,yt,e),e},r.prototype.not=function(){for(var t=v(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},r.prototype.shiftLeft=function(t){var e=v();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},r.prototype.shiftRight=function(t){var e=v();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},r.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(this[t]!=0)return t*this.DB+_t(this[t]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=qt(this[i]^e);return t},r.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?this.s!=0:(this[e]&1<<t%this.DB)!=0},r.prototype.setBit=function(t){return this.changeBit(t,Y)},r.prototype.clearBit=function(t){return this.changeBit(t,yt)},r.prototype.flipBit=function(t){return this.changeBit(t,vt)},r.prototype.add=function(t){var e=v();return this.addTo(t,e),e},r.prototype.subtract=function(t){var e=v();return this.subTo(t,e),e},r.prototype.multiply=function(t){var e=v();return this.multiplyTo(t,e),e},r.prototype.divide=function(t){var e=v();return this.divRemTo(t,e,null),e},r.prototype.remainder=function(t){var e=v();return this.divRemTo(t,null,e),e},r.prototype.divideAndRemainder=function(t){var e=v(),i=v();return this.divRemTo(t,e,i),[e,i]},r.prototype.modPow=function(t,e){var i=t.bitLength(),n,s=V(1),o;if(i<=0)return s;i<18?n=1:i<48?n=3:i<144?n=4:i<768?n=5:n=6,i<8?o=new Tt(e):e.isEven()?o=new Wt(e):o=new wt(e);var h=[],a=3,f=n-1,l=(1<<n)-1;if(h[1]=o.convert(this),n>1){var c=v();for(o.sqrTo(h[1],c);a<=l;)h[a]=v(),o.mulTo(c,h[a-2],h[a]),a+=2}var g=t.t-1,d,m=!0,S=v(),D;for(i=Q(t[g])-1;g>=0;){for(i>=f?d=t[g]>>i-f&l:(d=(t[g]&(1<<i+1)-1)<<f-i,g>0&&(d|=t[g-1]>>this.DB+i-f)),a=n;(d&1)==0;)d>>=1,--a;if((i-=a)<0&&(i+=this.DB,--g),m)h[d].copyTo(s),m=!1;else{for(;a>1;)o.sqrTo(s,S),o.sqrTo(S,s),a-=2;a>0?o.sqrTo(s,S):(D=s,s=S,S=D),o.mulTo(S,h[d],s)}for(;g>=0&&(t[g]&1<<i)==0;)o.sqrTo(s,S),D=s,s=S,S=D,--i<0&&(i=this.DB-1,--g)}return o.revert(s)},r.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return r.ZERO;for(var i=t.clone(),n=this.clone(),s=V(1),o=V(0),h=V(0),a=V(1);i.signum()!=0;){for(;i.isEven();)i.rShiftTo(1,i),e?((!s.isEven()||!o.isEven())&&(s.addTo(this,s),o.subTo(t,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),e?((!h.isEven()||!a.isEven())&&(h.addTo(this,h),a.subTo(t,a)),h.rShiftTo(1,h)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);i.compareTo(n)>=0?(i.subTo(n,i),e&&s.subTo(h,s),o.subTo(a,o)):(n.subTo(i,n),e&&h.subTo(s,h),a.subTo(o,a))}if(n.compareTo(r.ONE)!=0)return r.ZERO;if(a.compareTo(t)>=0)return a.subtract(t);if(a.signum()<0)a.addTo(t,a);else return a;return a.signum()<0?a.add(t):a},r.prototype.pow=function(t){return this.exp(t,new jt)},r.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 n=e;e=i,i=n}var s=e.getLowestSetBit(),o=i.getLowestSetBit();if(o<0)return e;for(s<o&&(o=s),o>0&&(e.rShiftTo(o,e),i.rShiftTo(o,i));e.signum()>0;)(s=e.getLowestSetBit())>0&&e.rShiftTo(s,e),(s=i.getLowestSetBit())>0&&i.rShiftTo(s,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return o>0&&i.lShiftTo(o,i),i},r.prototype.isProbablePrime=function(t){var e,i=this.abs();if(i.t==1&&i[0]<=E[E.length-1]){for(e=0;e<E.length;++e)if(i[0]==E[e])return!0;return!1}if(i.isEven())return!1;for(e=1;e<E.length;){for(var n=E[e],s=e+1;s<E.length&&n<Ut;)n*=E[s++];for(n=i.modInt(n);e<s;)if(n%E[e++]==0)return!1}return i.millerRabin(t)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var i;if(e==16)i=4;else if(e==8)i=3;else if(e==256)i=8;else if(e==2)i=1;else if(e==32)i=5;else if(e==4)i=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,s=!1,o=0;--n>=0;){var h=i==8?+t[n]&255:Dt(t,n);if(h<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,o==0?this[this.t++]=h:o+i>this.DB?(this[this.t-1]|=(h&(1<<this.DB-o)-1)<<o,this[this.t++]=h>>this.DB-o):this[this.t-1]|=h<<o,o+=i,o>=this.DB&&(o-=this.DB)}i==8&&(+t[0]&128)!=0&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),s&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s},r.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},r.prototype.lShiftTo=function(t,e){for(var i=t%this.DB,n=this.DB-i,s=(1<<n)-1,o=Math.floor(t/this.DB),h=this.s<<i&this.DM,a=this.t-1;a>=0;--a)e[a+o+1]=this[a]>>n|h,h=(this[a]&s)<<i;for(var a=o-1;a>=0;--a)e[a]=0;e[o]=h,e.t=this.t+o+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t){e.t=0;return}var n=t%this.DB,s=this.DB-n,o=(1<<n)-1;e[0]=this[i]>>n;for(var h=i+1;h<this.t;++h)e[h-i-1]|=(this[h]&o)<<s,e[h-i]=this[h]>>n;n>0&&(e[this.t-i-1]|=(this.s&o)<<s),e.t=this.t-i,e.clamp()},r.prototype.subTo=function(t,e){for(var i=0,n=0,s=Math.min(t.t,this.t);i<s;)n+=this[i]-t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n-=t[i],e[i++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[i++]=this.DV+n:n>0&&(e[i++]=n),e.t=i,e.clamp()},r.prototype.multiplyTo=function(t,e){var i=this.abs(),n=t.abs(),s=i.t;for(e.t=s+n.t;--s>=0;)e[s]=0;for(s=0;s<n.t;++s)e[s+i.t]=i.am(0,n[s],e,s,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)},r.prototype.squareTo=function(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var n=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,n,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,i){var n=t.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t){e?.fromInt(0),i!=null&&this.copyTo(i);return}i==null&&(i=v());var o=v(),h=this.s,a=t.s,f=this.DB-Q(n[n.t-1]);f>0?(n.lShiftTo(f,o),s.lShiftTo(f,i)):(n.copyTo(o),s.copyTo(i));var l=o.t,c=o[l-1];if(c!=0){var g=c*(1<<this.F1)+(l>1?o[l-2]>>this.F2:0),d=this.FV/g,m=(1<<this.F1)/g,S=1<<this.F2,D=i.t,_=D-l,B=e??v();for(o.dlShiftTo(_,B),i.compareTo(B)>=0&&(i[i.t++]=1,i.subTo(B,i)),r.ONE.dlShiftTo(l,B),B.subTo(o,o);o.t<l;)o[o.t++]=0;for(;--_>=0;){var q=i[--D]==c?this.DM:Math.floor(i[D]*d+(i[D-1]+S)*m);if((i[D]+=o.am(0,q,i,_,0,l))<q)for(o.dlShiftTo(_,B),i.subTo(B,i);i[D]<--q;)i.subTo(B,i)}e!=null&&(i.drShiftTo(l,e),h!=a&&r.ZERO.subTo(e,e)),i.t=l,i.clamp(),f>0&&i.rShiftTo(f,i),h<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e},r.prototype.isEven=function(){return(this.t>0?this[0]&1:this.s)==0},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var i=v(),n=v(),s=e.convert(this),o=Q(t)-1;for(s.copyTo(i);--o>=0;)if(e.sqrTo(i,n),(t&1<<o)>0)e.mulTo(n,s,i);else{var h=i;i=n,n=h}return e.revert(i)},r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),n=V(i),s=v(),o=v(),h="";for(this.divRemTo(n,s,o);s.signum()>0;)h=(i+o.intValue()).toString(t).substring(1)+h,s.divRemTo(n,s,o);return o.intValue().toString(t)+h},r.prototype.fromRadix=function(t,e){this.fromInt(0),e==null&&(e=10);for(var i=this.chunkSize(e),n=Math.pow(e,i),s=!1,o=0,h=0,a=0;a<t.length;++a){var f=Dt(t,a);if(f<0){t.charAt(a)=="-"&&this.signum()==0&&(s=!0);continue}h=e*h+f,++o>=i&&(this.dMultiply(n),this.dAddOffset(h,0),o=0,h=0)}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(h,0)),s&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,i){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),Y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var n=[],s=t&7;n.length=(t>>3)+1,e.nextBytes(n),s>0?n[0]&=(1<<s)-1:n[0]=0,this.fromString(n,256)}},r.prototype.bitwiseTo=function(t,e,i){var n,s,o=Math.min(t.t,this.t);for(n=0;n<o;++n)i[n]=e(this[n],t[n]);if(t.t<this.t){for(s=t.s&this.DM,n=o;n<this.t;++n)i[n]=e(this[n],s);i.t=this.t}else{for(s=this.s&this.DM,n=o;n<t.t;++n)i[n]=e(s,t[n]);i.t=t.t}i.s=e(this.s,t.s),i.clamp()},r.prototype.changeBit=function(t,e){var i=r.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i},r.prototype.addTo=function(t,e){for(var i=0,n=0,s=Math.min(t.t,this.t);i<s;)n+=this[i]+t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n+=t[i],e[i++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[i++]=n:n<-1&&(e[i++]=this.DV+n),e.t=i,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(t!=0){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]}},r.prototype.multiplyLowerTo=function(t,e,i){var n=Math.min(this.t+t.t,e);for(i.s=0,i.t=n;n>0;)i[--n]=0;for(var s=i.t-this.t;n<s;++n)i[n+this.t]=this.am(0,t[n],i,n,0,this.t);for(var s=Math.min(t.t,e);n<s;++n)this.am(0,t[n],i,n,0,e-n);i.clamp()},r.prototype.multiplyUpperTo=function(t,e,i){--e;var n=i.t=this.t+t.t-e;for(i.s=0;--n>=0;)i[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)i[this.t+n-e]=this.am(e-n,t[n],i,0,0,this.t+n-e);i.clamp(),i.drShiftTo(1,i)},r.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(e==0)i=this[0]%t;else for(var n=this.t-1;n>=0;--n)i=(e*i+this[n])%t;return i},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var n=e.shiftRight(i);t=t+1>>1,t>E.length&&(t=E.length);for(var s=v(),o=0;o<t;++o){s.fromInt(E[Math.floor(Math.random()*E.length)]);var h=s.modPow(n,this);if(h.compareTo(r.ONE)!=0&&h.compareTo(e)!=0){for(var a=1;a++<i&&h.compareTo(e)!=0;)if(h=h.modPowInt(2,this),h.compareTo(r.ONE)==0)return!1;if(h.compareTo(e)!=0)return!1}}return!0},r.prototype.square=function(){var t=v();return this.squareTo(t),t},r.prototype.gcda=function(t,e){var i=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(i.compareTo(n)<0){var s=i;i=n,n=s}var o=i.getLowestSetBit(),h=n.getLowestSetBit();if(h<0){e(i);return}o<h&&(h=o),h>0&&(i.rShiftTo(h,i),n.rShiftTo(h,n));var a=function(){(o=i.getLowestSetBit())>0&&i.rShiftTo(o,i),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),i.compareTo(n)>=0?(i.subTo(n,i),i.rShiftTo(1,i)):(n.subTo(i,n),n.rShiftTo(1,n)),i.signum()>0?setTimeout(a,0):(h>0&&n.lShiftTo(h,n),setTimeout(function(){e(n)},0))};setTimeout(a,10)},r.prototype.fromNumberAsync=function(t,e,i,n){if(typeof e=="number")if(t<2)this.fromInt(1);else{this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),Y,this),this.isEven()&&this.dAddOffset(1,0);var s=this,o=function(){s.dAddOffset(2,0),s.bitLength()>t&&s.subTo(r.ONE.shiftLeft(t-1),s),s.isProbablePrime(e)?setTimeout(function(){n()},0):setTimeout(o,0)};setTimeout(o,0)}else{var h=[],a=t&7;h.length=(t>>3)+1,e.nextBytes(h),a>0?h[0]&=(1<<a)-1:h[0]=0,this.fromString(h,256)}},r})(),jt=(function(){function r(){}return r.prototype.convert=function(t){return t},r.prototype.revert=function(t){return t},r.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i)},r.prototype.sqrTo=function(t,e){t.squareTo(e)},r})(),Tt=(function(){function r(t){this.m=t}return r.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},r.prototype.revert=function(t){return t},r.prototype.reduce=function(t){t.divRemTo(this.m,null,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)},r})(),wt=(function(){function r(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}return r.prototype.convert=function(t){var e=v();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(p.ZERO)>0&&this.m.subTo(e,e),e},r.prototype.revert=function(t){var e=v();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=t[e]&32767,n=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(i=e+this.m.t,t[i]+=this.m.am(0,n,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&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)},r})(),Wt=(function(){function r(t){this.m=t,this.r2=v(),this.q3=v(),p.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return r.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=v();return t.copyTo(e),this.reduce(e),e},r.prototype.revert=function(t){return t},r.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);t.compareTo(this.m)>=0;)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)},r})();function v(){return new p(null)}function b(r,t){return new p(r,t)}var Et=typeof navigator<"u";Et&&bt&&navigator.appName=="Microsoft Internet Explorer"?(p.prototype.am=function(t,e,i,n,s,o){for(var h=e&32767,a=e>>15;--o>=0;){var f=this[t]&32767,l=this[t++]>>15,c=a*f+l*h;f=h*f+((c&32767)<<15)+i[n]+(s&1073741823),s=(f>>>30)+(c>>>15)+a*l+(s>>>30),i[n++]=f&1073741823}return s},O=30):Et&&bt&&navigator.appName!="Netscape"?(p.prototype.am=function(t,e,i,n,s,o){for(;--o>=0;){var h=e*this[t++]+i[n]+s;s=Math.floor(h/67108864),i[n++]=h&67108863}return s},O=26):(p.prototype.am=function(t,e,i,n,s,o){for(var h=e&16383,a=e>>14;--o>=0;){var f=this[t]&16383,l=this[t++]>>14,c=a*f+l*h;f=h*f+((c&16383)<<14)+i[n]+s,s=(f>>28)+(c>>14)+a*l,i[n++]=f&268435455}return s},O=28);p.prototype.DB=O;p.prototype.DM=(1<<O)-1;p.prototype.DV=1<<O;var dt=52;p.prototype.FV=Math.pow(2,dt);p.prototype.F1=dt-O;p.prototype.F2=2*O-dt;var st=[],K,x;K=48;for(x=0;x<=9;++x)st[K++]=x;K=97;for(x=10;x<36;++x)st[K++]=x;K=65;for(x=10;x<36;++x)st[K++]=x;function Dt(r,t){var e=st[r.charCodeAt(t)];return e??-1}function V(r){var t=v();return t.fromInt(r),t}function Q(r){var t=1,e;return(e=r>>>16)!=0&&(r=e,t+=16),(e=r>>8)!=0&&(r=e,t+=8),(e=r>>4)!=0&&(r=e,t+=4),(e=r>>2)!=0&&(r=e,t+=2),(e=r>>1)!=0&&(r=e,t+=1),t}p.ZERO=V(0);p.ONE=V(1);var Jt=(function(){function r(){this.i=0,this.j=0,this.S=[]}return r.prototype.init=function(t){var e,i,n;for(e=0;e<256;++e)this.S[e]=e;for(i=0,e=0;e<256;++e)i=i+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[i],this.S[i]=n;this.i=0,this.j=0},r.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]},r})();function zt(){return new Jt}var Pt=256,X,C=null,A;if(C==null){C=[],A=0;var tt=void 0;if(typeof window<"u"&&self.crypto&&self.crypto.getRandomValues){var ut=new Uint32Array(256);for(self.crypto.getRandomValues(ut),tt=0;tt<ut.length;++tt)C[A++]=ut[tt]&255}var et=0,it=function(r){if(et=et||0,et>=256||A>=Pt){self.removeEventListener?self.removeEventListener("mousemove",it,!1):self.detachEvent&&self.detachEvent("onmousemove",it);return}try{var t=r.x+r.y;C[A++]=t&255,et+=1}catch{}};typeof window<"u"&&(self.addEventListener?self.addEventListener("mousemove",it,!1):self.attachEvent&&self.attachEvent("onmousemove",it))}function $t(){if(X==null){for(X=zt();A<Pt;){var r=Math.floor(65536*Math.random());C[A++]=r&255}for(X.init(C),A=0;A<C.length;++A)C[A]=0;A=0}return X.next()}var nt=(function(){function r(){}return r.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=$t()},r})();function ct(r){return Zt(ne(Gt(r),r.length*8))}function xt(r){for(var t="0123456789abcdef",e="",i=0;i<r.length;i++){var n=r.charCodeAt(i);e+=t.charAt(n>>>4&15)+t.charAt(n&15)}return e}function Gt(r){for(var t=Array(r.length>>2),e=0;e<t.length;e++)t[e]=0;for(var e=0;e<r.length*8;e+=8)t[e>>5]|=(r.charCodeAt(e/8)&255)<<24-e%32;return t}function Zt(r){for(var t="",e=0;e<r.length*32;e+=8)t+=String.fromCharCode(r[e>>5]>>>24-e%32&255);return t}function I(r,t){return r>>>t|r<<32-t}function Vt(r,t){return r>>>t}function Yt(r,t,e){return r&t^~r&e}function Qt(r,t,e){return r&t^r&e^t&e}function Xt(r){return I(r,2)^I(r,13)^I(r,22)}function te(r){return I(r,6)^I(r,11)^I(r,25)}function ee(r){return I(r,7)^I(r,18)^Vt(r,3)}function ie(r){return I(r,17)^I(r,19)^Vt(r,10)}var re=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function ne(r,t){var e=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),i=new Array(64),n,s,o,h,a,f,l,c,g,d,m,S;for(r[t>>5]|=128<<24-t%32,r[(t+64>>9<<4)+15]=t,g=0;g<r.length;g+=16){for(n=e[0],s=e[1],o=e[2],h=e[3],a=e[4],f=e[5],l=e[6],c=e[7],d=0;d<64;d++)d<16?i[d]=r[d+g]:i[d]=w(w(w(ie(i[d-2]),i[d-7]),ee(i[d-15])),i[d-16]),m=w(w(w(w(c,te(a)),Yt(a,f,l)),re[d]),i[d]),S=w(Xt(n),Qt(n,s,o)),c=l,l=f,f=a,a=w(h,m),h=o,o=s,s=n,n=w(m,S);e[0]=w(n,e[0]),e[1]=w(s,e[1]),e[2]=w(o,e[2]),e[3]=w(h,e[3]),e[4]=w(a,e[4]),e[5]=w(f,e[5]),e[6]=w(l,e[6]),e[7]=w(c,e[7])}return e}function w(r,t){var e=(r&65535)+(t&65535),i=(r>>16)+(t>>16)+(e>>16);return i<<16|e&65535}function se(r,t){if(t<r.length+22)return console.error("Message too long for RSA"),null;for(var e=t-r.length-6,i="",n=0;n<e;n+=2)i+="ff";var s="0001"+i+"00"+r;return b(s,16)}function oe(r,t){if(t<r.length+11)return console.error("Message too long for RSA"),null;for(var e=[],i=r.length-1;i>=0&&t>0;){var n=r.charCodeAt(i--);n<128?e[--t]=n:n>127&&n<2048?(e[--t]=n&63|128,e[--t]=n>>6|192):(e[--t]=n&63|128,e[--t]=n>>6&63|128,e[--t]=n>>12|224)}e[--t]=0;for(var s=new nt,o=[];t>2;){for(o[0]=0;o[0]==0;)s.nextBytes(o);e[--t]=o[0]}return e[--t]=2,e[--t]=0,new p(e)}function Rt(r,t,e){for(var i="",n=0;i.length<t;)i+=e(String.fromCharCode.apply(String,r.concat([(n&4278190080)>>24,(n&16711680)>>16,(n&65280)>>8,n&255]))),n+=1;return i}var he=32;function ae(r,t){var e=he,i=ct;if(r.length+2*e+2>t)throw"Message too long for RSA";var n="",s;for(s=0;s<t-r.length-2*e-2;s+=1)n+="\0";var o=i("")+n+""+r,h=new Array(e);new nt().nextBytes(h);var a=Rt(h,o.length,i),f=[];for(s=0;s<o.length;s+=1)f[s]=o.charCodeAt(s)^a.charCodeAt(s);var l=Rt(f,h.length,i),c=[0];for(s=0;s<h.length;s+=1)c[s+1]=h[s]^l.charCodeAt(s);return new p(c.concat(f))}var ue=(function(){function r(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return r.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},r.prototype.doPrivate=function(t){if(this.p==null||this.q==null)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)},r.prototype.setPublic=function(t,e){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=b(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},r.prototype.encrypt=function(t,e){typeof e>"u"&&(e=oe);var i=this.n.bitLength()+7>>3,n=e(t,i);if(n==null)return null;var s=this.doPublic(n);if(s==null)return null;for(var o=s.toString(16),h=o.length,a=0;a<i*2-h;a++)o="0"+o;return o},r.prototype.setPrivate=function(t,e,i){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=b(t,16),this.e=parseInt(e,16),this.d=b(i,16)):console.error("Invalid RSA private key")},r.prototype.setPrivateEx=function(t,e,i,n,s,o,h,a){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=b(t,16),this.e=parseInt(e,16),this.d=b(i,16),this.p=b(n,16),this.q=b(s,16),this.dmp1=b(o,16),this.dmq1=b(h,16),this.coeff=b(a,16)):console.error("Invalid RSA private key")},r.prototype.generate=function(t,e){var i=new nt,n=t>>1;this.e=parseInt(e,16);for(var s=new p(e,16);;){for(;this.p=new p(t-n,1,i),!(this.p.subtract(p.ONE).gcd(s).compareTo(p.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new p(n,1,i),!(this.q.subtract(p.ONE).gcd(s).compareTo(p.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var h=this.p.subtract(p.ONE),a=this.q.subtract(p.ONE),f=h.multiply(a);if(f.gcd(s).compareTo(p.ONE)==0){this.n=this.p.multiply(this.q),this.d=s.modInverse(f),this.dmp1=this.d.mod(h),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);break}}},r.prototype.decrypt=function(t){var e=b(t,16),i=this.doPrivate(e);return i==null?null:fe(i,this.n.bitLength()+7>>3)},r.prototype.generateAsync=function(t,e,i){var n=new nt,s=t>>1;this.e=parseInt(e,16);var o=new p(e,16),h=this,a=function(){var f=function(){if(h.p.compareTo(h.q)<=0){var g=h.p;h.p=h.q,h.q=g}var d=h.p.subtract(p.ONE),m=h.q.subtract(p.ONE),S=d.multiply(m);S.gcd(o).compareTo(p.ONE)==0?(h.n=h.p.multiply(h.q),h.d=o.modInverse(S),h.dmp1=h.d.mod(d),h.dmq1=h.d.mod(m),h.coeff=h.q.modInverse(h.p),setTimeout(function(){i()},0)):setTimeout(a,0)},l=function(){h.q=v(),h.q.fromNumberAsync(s,1,n,function(){h.q.subtract(p.ONE).gcda(o,function(g){g.compareTo(p.ONE)==0&&h.q.isProbablePrime(10)?setTimeout(f,0):setTimeout(l,0)})})},c=function(){h.p=v(),h.p.fromNumberAsync(t-s,1,n,function(){h.p.subtract(p.ONE).gcda(o,function(g){g.compareTo(p.ONE)==0&&h.p.isProbablePrime(10)?setTimeout(l,0):setTimeout(c,0)})})};setTimeout(c,0)};setTimeout(a,0)},r.prototype.sign=function(t,e,i){var n=le(i),s=n+e(t).toString(),o=this.n.bitLength()/4,h=se(s,o);if(h==null)return null;var a=this.doPrivate(h);if(a==null)return null;for(var f=a.toString(16),l=f.length,c=0;c<o-l;c++)f="0"+f;return f},r.prototype.verify=function(t,e,i){var n=b(e,16),s=this.doPublic(n);if(s==null)return null;var o=s.toString(16).replace(/^1f+00/,""),h=ce(o);return h==i(t).toString()},r})();function fe(r,t){for(var e=r.toByteArray(),i=0;i<e.length&&e[i]==0;)++i;if(e.length-i!=t-1||e[i]!=2)return null;for(++i;e[i]!=0;)if(++i>=e.length)return null;for(var n="";++i<e.length;){var s=e[i]&255;s<128?n+=String.fromCharCode(s):s>191&&s<224?(n+=String.fromCharCode((s&31)<<6|e[i+1]&63),++i):(n+=String.fromCharCode((s&15)<<12|(e[i+1]&63)<<6|e[i+2]&63),i+=2)}return n}var rt={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function le(r){return rt[r]||""}function ce(r){for(var t in rt)if(rt.hasOwnProperty(t)){var e=rt[t],i=e.length;if(r.substring(0,i)==e)return r.substring(i)}return r}function T(r,t,e){if(!t||!r)throw new Error("extend failed, please check that all dependencies are included.");var i=function(){};i.prototype=t.prototype,r.prototype=new i,r.prototype.constructor=r,r.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}var u={};(typeof u.asn1>"u"||!u.asn1)&&(u.asn1={});u.asn1.ASN1Util=new function(){this.integerToByteHex=function(r){var t=r.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(r){var t=r.toString(16);if(t.substring(0,1)!="-")t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var e=t.substring(1),i=e.length;i%2==1?i+=1:t.match(/^[0-7]/)||(i+=2);for(var n="",s=0;s<i;s++)n+="f";var o=new p(n,16),h=o.xor(r).add(p.ONE);t=h.toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(r,t){return hextopem(r,t)},this.newObject=function(r){var t=u,e=t.asn1,i=e.DERBoolean,n=e.DERInteger,s=e.DERBitString,o=e.DEROctetString,h=e.DERNull,a=e.DERObjectIdentifier,f=e.DEREnumerated,l=e.DERUTF8String,c=e.DERNumericString,g=e.DERPrintableString,d=e.DERTeletexString,m=e.DERIA5String,S=e.DERUTCTime,D=e.DERGeneralizedTime,_=e.DERSequence,B=e.DERSet,q=e.DERTaggedObject,$=e.ASN1Util.newObject,pt=Object.keys(r);if(pt.length!=1)throw"key of param shall be only one.";var y=pt[0];if(":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+y+":")==-1)throw"undefined key: "+y;if(y=="bool")return new i(r[y]);if(y=="int")return new n(r[y]);if(y=="bitstr")return new s(r[y]);if(y=="octstr")return new o(r[y]);if(y=="null")return new h(r[y]);if(y=="oid")return new a(r[y]);if(y=="enum")return new f(r[y]);if(y=="utf8str")return new l(r[y]);if(y=="numstr")return new c(r[y]);if(y=="prnstr")return new g(r[y]);if(y=="telstr")return new d(r[y]);if(y=="ia5str")return new m(r[y]);if(y=="utctime")return new S(r[y]);if(y=="gentime")return new D(r[y]);if(y=="seq"){for(var U=r[y],j=[],M=0;M<U.length;M++){var ot=$(U[M]);j.push(ot)}return new _({array:j})}if(y=="set"){for(var U=r[y],j=[],M=0;M<U.length;M++){var ot=$(U[M]);j.push(ot)}return new B({array:j})}if(y=="tag"){var R=r[y];if(Object.prototype.toString.call(R)==="[object Array]"&&R.length==3){var Ct=$(R[2]);return new q({tag:R[0],explicit:R[1],obj:Ct})}else{var G={};if(R.explicit!==void 0&&(G.explicit=R.explicit),R.tag!==void 0&&(G.tag=R.tag),R.obj===void 0)throw"obj shall be specified for 'tag'.";return G.obj=$(R.obj),new q(G)}}},this.jsonToASN1HEX=function(r){var t=this.newObject(r);return t.getEncodedHex()}};u.asn1.ASN1Util.oidHexToInt=function(r){for(var n="",t=parseInt(r.substring(0,2),16),e=Math.floor(t/40),i=t%40,n=e+"."+i,s="",o=2;o<r.length;o+=2){var h=parseInt(r.substring(o,o+2),16),a=("00000000"+h.toString(2)).slice(-8);if(s=s+a.substring(1,8),a.substring(0,1)=="0"){var f=new p(s,2);n=n+"."+f.toString(10),s=""}}return n};u.asn1.ASN1Util.oidIntToHex=function(r){var t=function(h){var a=h.toString(16);return a.length==1&&(a="0"+a),a},e=function(h){var a="",f=new p(h,10),l=f.toString(2),c=7-l.length%7;c==7&&(c=0);for(var g="",d=0;d<c;d++)g+="0";l=g+l;for(var d=0;d<l.length-1;d+=7){var m=l.substring(d,d+7);d!=l.length-7&&(m="1"+m),a+=t(parseInt(m,2))}return a};if(!r.match(/^[0-9.]+$/))throw"malformed oid string: "+r;var i="",n=r.split("."),s=parseInt(n[0])*40+parseInt(n[1]);i+=t(s),n.splice(0,2);for(var o=0;o<n.length;o++)i+=e(n[o]);return i};u.asn1.ASN1Object=function(){var r="";this.getLengthHexFromValue=function(){if(typeof this.hV>"u"||this.hV==null)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+r.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(i>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var n=128+i;return n.toString(16)+e},this.getEncodedHex=function(){return(this.hTLV==null||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""}};u.asn1.DERAbstractString=function(r){u.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},typeof r<"u"&&(typeof r=="string"?this.setString(r):typeof r.str<"u"?this.setString(r.str):typeof r.hex<"u"&&this.setStringHex(r.hex))};T(u.asn1.DERAbstractString,u.asn1.ASN1Object);u.asn1.DERAbstractTime=function(r){u.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){utc=t.getTime()+t.getTimezoneOffset()*6e4;var e=new Date(utc);return e},this.formatDate=function(t,e,i){var n=this.zeroPadding,s=this.localDateToUTC(t),o=String(s.getFullYear());e=="utc"&&(o=o.substring(2,4));var h=n(String(s.getMonth()+1),2),a=n(String(s.getDate()),2),f=n(String(s.getHours()),2),l=n(String(s.getMinutes()),2),c=n(String(s.getSeconds()),2),g=o+h+a+f+l+c;if(i===!0){var d=s.getMilliseconds();if(d!=0){var m=n(String(d),3);m=m.replace(/[0]+$/,""),g=g+"."+m}}return g+"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(t)},this.setByDateValue=function(t,e,i,n,s,o){var h=new Date(Date.UTC(t,e-1,i,n,s,o,0));this.setByDate(h)},this.getFreshValueHex=function(){return this.hV}};T(u.asn1.DERAbstractTime,u.asn1.ASN1Object);u.asn1.DERAbstractStructured=function(r){u.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,typeof r<"u"&&typeof r.array<"u"&&(this.asn1Array=r.array)};T(u.asn1.DERAbstractStructured,u.asn1.ASN1Object);u.asn1.DERBoolean=function(){u.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"};T(u.asn1.DERBoolean,u.asn1.ASN1Object);u.asn1.DERInteger=function(r){u.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=u.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new p(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r.bigint<"u"?this.setByBigInteger(r.bigint):typeof r.int<"u"?this.setByInteger(r.int):typeof r=="number"?this.setByInteger(r):typeof r.hex<"u"&&this.setValueHex(r.hex))};T(u.asn1.DERInteger,u.asn1.ASN1Object);u.asn1.DERBitString=function(r){if(r!==void 0&&typeof r.obj<"u"){var t=u.asn1.ASN1Util.newObject(r.obj);r.hex="00"+t.getEncodedHex()}u.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,i){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var n="0"+e;this.hTLV=null,this.isModified=!0,this.hV=n+i},this.setByBinaryString=function(e){e=e.replace(/0+$/,"");var i=8-e.length%8;i==8&&(i=0);for(var n=0;n<=i;n++)e+="0";for(var s="",n=0;n<e.length-1;n+=8){var o=e.substring(n,n+8),h=parseInt(o,2).toString(16);h.length==1&&(h="0"+h),s+=h}this.hTLV=null,this.isModified=!0,this.hV="0"+i+s},this.setByBooleanArray=function(e){for(var i="",n=0;n<e.length;n++)e[n]==!0?i+="1":i+="0";this.setByBinaryString(i)},this.newFalseArray=function(e){for(var i=new Array(e),n=0;n<e;n++)i[n]=!1;return i},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r=="string"&&r.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(r):typeof r.hex<"u"?this.setHexValueIncludingUnusedBits(r.hex):typeof r.bin<"u"?this.setByBinaryString(r.bin):typeof r.array<"u"&&this.setByBooleanArray(r.array))};T(u.asn1.DERBitString,u.asn1.ASN1Object);u.asn1.DEROctetString=function(r){if(r!==void 0&&typeof r.obj<"u"){var t=u.asn1.ASN1Util.newObject(r.obj);r.hex=t.getEncodedHex()}u.asn1.DEROctetString.superclass.constructor.call(this,r),this.hT="04"};T(u.asn1.DEROctetString,u.asn1.DERAbstractString);u.asn1.DERNull=function(){u.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"};T(u.asn1.DERNull,u.asn1.ASN1Object);u.asn1.DERObjectIdentifier=function(r){var t=function(i){var n=i.toString(16);return n.length==1&&(n="0"+n),n},e=function(i){var n="",s=new p(i,10),o=s.toString(2),h=7-o.length%7;h==7&&(h=0);for(var a="",f=0;f<h;f++)a+="0";o=a+o;for(var f=0;f<o.length-1;f+=7){var l=o.substring(f,f+7);f!=o.length-7&&(l="1"+l),n+=t(parseInt(l,2))}return n};u.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(i){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=i},this.setValueOidString=function(i){if(!i.match(/^[0-9.]+$/))throw"malformed oid string: "+i;var n="",s=i.split("."),o=parseInt(s[0])*40+parseInt(s[1]);n+=t(o),s.splice(0,2);for(var h=0;h<s.length;h++)n+=e(s[h]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(i){var n=u.asn1.x509.OID.name2oid(i);if(n!=="")this.setValueOidString(n);else throw"DERObjectIdentifier oidName undefined: "+i},this.getFreshValueHex=function(){return this.hV},r!==void 0&&(typeof r=="string"?r.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(r):this.setValueName(r):r.oid!==void 0?this.setValueOidString(r.oid):r.hex!==void 0?this.setValueHex(r.hex):r.name!==void 0&&this.setValueName(r.name))};T(u.asn1.DERObjectIdentifier,u.asn1.ASN1Object);u.asn1.DEREnumerated=function(r){u.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=u.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new p(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r.int<"u"?this.setByInteger(r.int):typeof r=="number"?this.setByInteger(r):typeof r.hex<"u"&&this.setValueHex(r.hex))};T(u.asn1.DEREnumerated,u.asn1.ASN1Object);u.asn1.DERUTF8String=function(r){u.asn1.DERUTF8String.superclass.constructor.call(this,r),this.hT="0c"};T(u.asn1.DERUTF8String,u.asn1.DERAbstractString);u.asn1.DERNumericString=function(r){u.asn1.DERNumericString.superclass.constructor.call(this,r),this.hT="12"};T(u.asn1.DERNumericString,u.asn1.DERAbstractString);u.asn1.DERPrintableString=function(r){u.asn1.DERPrintableString.superclass.constructor.call(this,r),this.hT="13"};T(u.asn1.DERPrintableString,u.asn1.DERAbstractString);u.asn1.DERTeletexString=function(r){u.asn1.DERTeletexString.superclass.constructor.call(this,r),this.hT="14"};T(u.asn1.DERTeletexString,u.asn1.DERAbstractString);u.asn1.DERIA5String=function(r){u.asn1.DERIA5String.superclass.constructor.call(this,r),this.hT="16"};T(u.asn1.DERIA5String,u.asn1.DERAbstractString);u.asn1.DERUTCTime=function(r){u.asn1.DERUTCTime.superclass.constructor.call(this,r),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)},this.getFreshValueHex=function(){return typeof this.date>"u"&&typeof this.s>"u"&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},r!==void 0&&(r.str!==void 0?this.setString(r.str):typeof r=="string"&&r.match(/^[0-9]{12}Z$/)?this.setString(r):r.hex!==void 0?this.setStringHex(r.hex):r.date!==void 0&&this.setByDate(r.date))};T(u.asn1.DERUTCTime,u.asn1.DERAbstractTime);u.asn1.DERGeneralizedTime=function(r){u.asn1.DERGeneralizedTime.superclass.constructor.call(this,r),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},r!==void 0&&(r.str!==void 0?this.setString(r.str):typeof r=="string"&&r.match(/^[0-9]{14}Z$/)?this.setString(r):r.hex!==void 0?this.setStringHex(r.hex):r.date!==void 0&&this.setByDate(r.date),r.millis===!0&&(this.withMillis=!0))};T(u.asn1.DERGeneralizedTime,u.asn1.DERAbstractTime);u.asn1.DERSequence=function(r){u.asn1.DERSequence.superclass.constructor.call(this,r),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){var i=this.asn1Array[e];t+=i.getEncodedHex()}return this.hV=t,this.hV}};T(u.asn1.DERSequence,u.asn1.DERAbstractStructured);u.asn1.DERSet=function(r){u.asn1.DERSet.superclass.constructor.call(this,r),this.hT="31",this.sortFlag=!0,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 this.sortFlag==!0&&t.sort(),this.hV=t.join(""),this.hV},typeof r<"u"&&typeof r.sortflag<"u"&&r.sortflag==!1&&(this.sortFlag=!1)};T(u.asn1.DERSet,u.asn1.DERAbstractStructured);u.asn1.DERTaggedObject=function(r){u.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},typeof r<"u"&&(typeof r.tag<"u"&&(this.hT=r.tag),typeof r.explicit<"u"&&(this.isExplicit=r.explicit),typeof r.obj<"u"&&(this.asn1Object=r.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))};T(u.asn1.DERTaggedObject,u.asn1.ASN1Object);var de=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function i(){this.constructor=t}t.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}})(),At=(function(r){de(t,r);function t(e){var i=r.call(this)||this;return e&&(typeof e=="string"?i.parseKey(e):(t.hasPrivateKeyProperty(e)||t.hasPublicKeyProperty(e))&&i.parsePropertiesFrom(e)),i}return t.prototype.parseKey=function(e){try{var i=0,n=0,s=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,o=s.test(e)?Ht.decode(e):lt.unarmor(e),h=Lt.decode(o);if(h.sub.length===3&&(h=h.sub[2].sub[0]),h.sub.length===9){i=h.sub[1].getHexStringValue(),this.n=b(i,16),n=h.sub[2].getHexStringValue(),this.e=parseInt(n,16);var a=h.sub[3].getHexStringValue();this.d=b(a,16);var f=h.sub[4].getHexStringValue();this.p=b(f,16);var l=h.sub[5].getHexStringValue();this.q=b(l,16);var c=h.sub[6].getHexStringValue();this.dmp1=b(c,16);var g=h.sub[7].getHexStringValue();this.dmq1=b(g,16);var d=h.sub[8].getHexStringValue();this.coeff=b(d,16)}else if(h.sub.length===2)if(h.sub[0].sub){var m=h.sub[1],S=m.sub[0];i=S.sub[0].getHexStringValue(),this.n=b(i,16),n=S.sub[1].getHexStringValue(),this.e=parseInt(n,16)}else i=h.sub[0].getHexStringValue(),this.n=b(i,16),n=h.sub[1].getHexStringValue(),this.e=parseInt(n,16);else return!1;return!0}catch{return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new u.asn1.DERInteger({int:0}),new u.asn1.DERInteger({bigint:this.n}),new u.asn1.DERInteger({int:this.e}),new u.asn1.DERInteger({bigint:this.d}),new u.asn1.DERInteger({bigint:this.p}),new u.asn1.DERInteger({bigint:this.q}),new u.asn1.DERInteger({bigint:this.dmp1}),new u.asn1.DERInteger({bigint:this.dmq1}),new u.asn1.DERInteger({bigint:this.coeff})]},i=new u.asn1.DERSequence(e);return i.getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return J(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new u.asn1.DERSequence({array:[new u.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new u.asn1.DERNull]}),i=new u.asn1.DERSequence({array:[new u.asn1.DERInteger({bigint:this.n}),new u.asn1.DERInteger({int:this.e})]}),n=new u.asn1.DERBitString({hex:"00"+i.getEncodedHex()}),s=new u.asn1.DERSequence({array:[e,n]});return s.getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return J(this.getPublicBaseKey())},t.wordwrap=function(e,i){if(i=i||64,!e)return e;var n="(.{1,"+i+`})( +|$
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const E=require("vue"),Q=require("element-plus");var Ut="0123456789abcdefghijklmnopqrstuvwxyz";function H(r){return Ut.charAt(r)}function Jt(r,t){return r&t}function nt(r,t){return r|t}function Et(r,t){return r^t}function Dt(r,t){return r&~t}function zt(r){if(r==0)return-1;var t=0;return(r&65535)==0&&(r>>=16,t+=16),(r&255)==0&&(r>>=8,t+=8),(r&15)==0&&(r>>=4,t+=4),(r&3)==0&&(r>>=2,t+=2),(r&1)==0&&++t,t}function Wt(r){for(var t=0;r!=0;)r&=r-1,++t;return t}var $="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qt="=";function et(r){var t,e,i="";for(t=0;t+3<=r.length;t+=3)e=parseInt(r.substring(t,t+3),16),i+=$.charAt(e>>6)+$.charAt(e&63);for(t+1==r.length?(e=parseInt(r.substring(t,t+1),16),i+=$.charAt(e<<2)):t+2==r.length&&(e=parseInt(r.substring(t,t+2),16),i+=$.charAt(e>>2)+$.charAt((e&3)<<4));(i.length&3)>0;)i+=qt;return i}function xt(r){var t="",e,i=0,n=0;for(e=0;e<r.length&&r.charAt(e)!=qt;++e){var s=$.indexOf(r.charAt(e));s<0||(i==0?(t+=H(s>>2),n=s&3,i=1):i==1?(t+=H(n<<2|s>>4),n=s&15,i=2):i==2?(t+=H(n),t+=H(s>>2),n=s&3,i=3):(t+=H(n<<2|s>>4),t+=H(s&15),i=0))}return i==1&&(t+=H(n<<2)),t}var G,Gt={decode:function(r){var t;if(G===void 0){var e="0123456789ABCDEF",i=` \f
2
+ \r  \u2028\u2029`;for(G={},t=0;t<16;++t)G[e.charAt(t)]=t;for(e=e.toLowerCase(),t=10;t<16;++t)G[e.charAt(t)]=t;for(t=0;t<i.length;++t)G[i.charAt(t)]=-1}var n=[],s=0,o=0;for(t=0;t<r.length;++t){var a=r.charAt(t);if(a=="=")break;if(a=G[a],a!=-1){if(a===void 0)throw new Error("Illegal character at offset "+t);s|=a,++o>=2?(n[n.length]=s,s=0,o=0):s<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return n}},z,St={decode:function(r){var t;if(z===void 0){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=`= \f
3
+ \r  \u2028\u2029`;for(z=Object.create(null),t=0;t<64;++t)z[e.charAt(t)]=t;for(z["-"]=62,z._=63,t=0;t<i.length;++t)z[i.charAt(t)]=-1}var n=[],s=0,o=0;for(t=0;t<r.length;++t){var a=r.charAt(t);if(a=="=")break;if(a=z[a],a!=-1){if(a===void 0)throw new Error("Illegal character at offset "+t);s|=a,++o>=4?(n[n.length]=s>>16,n[n.length]=s>>8&255,n[n.length]=s&255,s=0,o=0):s<<=6}}switch(o){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=s>>10;break;case 3:n[n.length]=s>>16,n[n.length]=s>>8&255;break}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(r){var t=St.re.exec(r);if(t)if(t[1])r=t[1];else if(t[2])r=t[2];else throw new Error("RegExp out of sync");return St.decode(r)}},Z=1e13,tt=(function(){function r(t){this.buf=[+t||0]}return r.prototype.mulAdd=function(t,e){var i=this.buf,n=i.length,s,o;for(s=0;s<n;++s)o=i[s]*t+e,o<Z?e=0:(e=0|o/Z,o-=e*Z),i[s]=o;e>0&&(i[s]=e)},r.prototype.sub=function(t){var e=this.buf,i=e.length,n,s;for(n=0;n<i;++n)s=e[n]-t,s<0?(s+=Z,t=1):t=0,e[n]=s;for(;e[e.length-1]===0;)e.pop()},r.prototype.toString=function(t){if((t||10)!=10)throw new Error("only base 10 is supported");for(var e=this.buf,i=e[e.length-1].toString(),n=e.length-2;n>=0;--n)i+=(Z+e[n]).toString().substring(1);return i},r.prototype.valueOf=function(){for(var t=this.buf,e=0,i=t.length-1;i>=0;--i)e=e*Z+t[i];return e},r.prototype.simplify=function(){var t=this.buf;return t.length==1?t[0]:this},r})(),Ht="…",Zt=/^(\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)?)?$/,$t=/^(\d\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)?)?$/;function Y(r,t){return r.length>t&&(r=r.substring(0,t)+Ht),r}var vt=(function(){function r(t,e){this.hexDigits="0123456789ABCDEF",t instanceof r?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=e)}return r.prototype.get=function(t){if(t===void 0&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset ".concat(t," on a stream of length ").concat(this.enc.length));return typeof this.enc=="string"?this.enc.charCodeAt(t):this.enc[t]},r.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(t&15)},r.prototype.hexDump=function(t,e,i){for(var n="",s=t;s<e;++s)if(n+=this.hexByte(this.get(s)),i!==!0)switch(s&15){case 7:n+=" ";break;case 15:n+=`
4
+ `;break;default:n+=" "}return n},r.prototype.isASCII=function(t,e){for(var i=t;i<e;++i){var n=this.get(i);if(n<32||n>176)return!1}return!0},r.prototype.parseStringISO=function(t,e){for(var i="",n=t;n<e;++n)i+=String.fromCharCode(this.get(n));return i},r.prototype.parseStringUTF=function(t,e){for(var i="",n=t;n<e;){var s=this.get(n++);s<128?i+=String.fromCharCode(s):s>191&&s<224?i+=String.fromCharCode((s&31)<<6|this.get(n++)&63):i+=String.fromCharCode((s&15)<<12|(this.get(n++)&63)<<6|this.get(n++)&63)}return i},r.prototype.parseStringBMP=function(t,e){for(var i="",n,s,o=t;o<e;)n=this.get(o++),s=this.get(o++),i+=String.fromCharCode(n<<8|s);return i},r.prototype.parseTime=function(t,e,i){var n=this.parseStringISO(t,e),s=(i?Zt:$t).exec(n);return s?(i&&(s[1]=+s[1],s[1]+=+s[1]<70?2e3:1900),n=s[1]+"-"+s[2]+"-"+s[3]+" "+s[4],s[5]&&(n+=":"+s[5],s[6]&&(n+=":"+s[6],s[7]&&(n+="."+s[7]))),s[8]&&(n+=" UTC",s[8]!="Z"&&(n+=s[8],s[9]&&(n+=":"+s[9]))),n):"Unrecognized time: "+n},r.prototype.parseInteger=function(t,e){for(var i=this.get(t),n=i>127,s=n?255:0,o,a="";i==s&&++t<e;)i=this.get(t);if(o=e-t,o===0)return n?-1:0;if(o>4){for(a=i,o<<=3;((+a^s)&128)==0;)a=+a<<1,--o;a="("+o+` bit)
5
+ `}n&&(i=i-256);for(var h=new tt(i),f=t+1;f<e;++f)h.mulAdd(256,this.get(f));return a+h.toString()},r.prototype.parseBitString=function(t,e,i){for(var n=this.get(t),s=(e-t-1<<3)-n,o="("+s+` bit)
6
+ `,a="",h=t+1;h<e;++h){for(var f=this.get(h),l=h==e-1?n:0,c=7;c>=l;--c)a+=f>>c&1?"1":"0";if(a.length>i)return o+Y(a,i)}return o+a},r.prototype.parseOctetString=function(t,e,i){if(this.isASCII(t,e))return Y(this.parseStringISO(t,e),i);var n=e-t,s="("+n+` byte)
7
+ `;i/=2,n>i&&(e=t+i);for(var o=t;o<e;++o)s+=this.hexByte(this.get(o));return n>i&&(s+=Ht),s},r.prototype.parseOID=function(t,e,i){for(var n="",s=new tt,o=0,a=t;a<e;++a){var h=this.get(a);if(s.mulAdd(128,h&127),o+=7,!(h&128)){if(n==="")if(s=s.simplify(),s instanceof tt)s.sub(80),n="2."+s.toString();else{var f=s<80?s<40?0:1:2;n=f+"."+(s-f*40)}else n+="."+s.toString();if(n.length>i)return Y(n,i);s=new tt,o=0}}return o>0&&(n+=".incomplete"),n},r})(),Yt=(function(){function r(t,e,i,n,s){if(!(n instanceof Rt))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=i,this.tag=n,this.sub=s}return r.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){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"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},r.prototype.content=function(t){if(this.tag===void 0)return null;t===void 0&&(t=1/0);var e=this.posContent(),i=Math.abs(this.length);if(!this.tag.isUniversal())return this.sub!==null?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+i,t);switch(this.tag.tagNumber){case 1:return this.stream.get(e)===0?"false":"true";case 2:return this.stream.parseInteger(e,e+i);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+i,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+i,t);case 6:return this.stream.parseOID(e,e+i,t);case 16:case 17:return this.sub!==null?"("+this.sub.length+" elem)":"(no elem)";case 12:return Y(this.stream.parseStringUTF(e,e+i),t);case 18:case 19:case 20:case 21:case 22:case 26:return Y(this.stream.parseStringISO(e,e+i),t);case 30:return Y(this.stream.parseStringBMP(e,e+i),t);case 23:case 24:return this.stream.parseTime(e,e+i,this.tag.tagNumber==23)}return null},r.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(this.sub===null?"null":this.sub.length)+"]"},r.prototype.toPrettyString=function(t){t===void 0&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":this.tag.isUniversal()&&(this.tag.tagNumber==3||this.tag.tagNumber==4)&&this.sub!==null&&(e+=" (encapsulates)"),e+=`
8
+ `,this.sub!==null){t+=" ";for(var i=0,n=this.sub.length;i<n;++i)e+=this.sub[i].toPrettyString(t)}return e},r.prototype.posStart=function(){return this.stream.pos},r.prototype.posContent=function(){return this.stream.pos+this.header},r.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},r.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},r.decodeLength=function(t){var e=t.get(),i=e&127;if(i==e)return i;if(i>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(i===0)return null;e=0;for(var n=0;n<i;++n)e=e*256+t.get();return e},r.prototype.getHexStringValue=function(){var t=this.toHexString(),e=this.header*2,i=this.length*2;return t.substring(e,e+i)},r.decode=function(t){var e;t instanceof vt?e=t:e=new vt(t,0);var i=new vt(e),n=new Rt(e),s=r.decodeLength(e),o=e.pos,a=o-i.pos,h=null,f=function(){var c=[];if(s!==null){for(var v=o+s;e.pos<v;)c[c.length]=r.decode(e);if(e.pos!=v)throw new Error("Content size is not correct for container starting at offset "+o)}else try{for(;;){var p=r.decode(e);if(p.tag.isEOC())break;c[c.length]=p}s=o-e.pos}catch(T){throw new Error("Exception while decoding undefined length content: "+T)}return c};if(n.tagConstructed)h=f();else if(n.isUniversal()&&(n.tagNumber==3||n.tagNumber==4))try{if(n.tagNumber==3&&e.get()!=0)throw new Error("BIT STRINGs with unused bits cannot encapsulate.");h=f();for(var l=0;l<h.length;++l)if(h[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch{h=null}if(h===null){if(s===null)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);e.pos=o+Math.abs(s)}return new r(i,a,s,n,h)},r})(),Rt=(function(){function r(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=(e&32)!==0,this.tagNumber=e&31,this.tagNumber==31){var i=new tt;do e=t.get(),i.mulAdd(128,e&127);while(e&128);this.tagNumber=i.simplify()}}return r.prototype.isUniversal=function(){return this.tagClass===0},r.prototype.isEOC=function(){return this.tagClass===0&&this.tagNumber===0},r})(),U,Xt=0xdeadbeefcafe,At=(Xt&16777215)==15715070,A=[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],Qt=(1<<26)/A[A.length-1],g=(function(){function r(t,e,i){t!=null&&(typeof t=="number"?this.fromNumber(t,e,i):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}return r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var i=(1<<e)-1,n,s=!1,o="",a=this.t,h=this.DB-a*this.DB%e;if(a-- >0)for(h<this.DB&&(n=this[a]>>h)>0&&(s=!0,o=H(n));a>=0;)h<e?(n=(this[a]&(1<<h)-1)<<e-h,n|=this[--a]>>(h+=this.DB-e)):(n=this[a]>>(h-=e)&i,h<=0&&(h+=this.DB,--a)),n>0&&(s=!0),s&&(o+=H(n));return s?o:"0"},r.prototype.negate=function(){var t=S();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(e!=0)return e;var i=this.t;if(e=i-t.t,e!=0)return this.s<0?-e:e;for(;--i>=0;)if((e=this[i]-t[i])!=0)return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+st(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=S();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var i;return t<256||e.isEven()?i=new Bt(e):i=new It(e),this.exp(t,i)},r.prototype.clone=function(){var t=S();return this.copyTo(t),t},r.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var i=this.DB-t*this.DB%8,n,s=0;if(t-- >0)for(i<this.DB&&(n=this[t]>>i)!=(this.s&this.DM)>>i&&(e[s++]=n|this.s<<this.DB-i);t>=0;)i<8?(n=(this[t]&(1<<i)-1)<<8-i,n|=this[--t]>>(i+=this.DB-8)):(n=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),(n&128)!=0&&(n|=-256),s==0&&(this.s&128)!=(n&128)&&++s,(s>0||n!=this.s)&&(e[s++]=n);return e},r.prototype.equals=function(t){return this.compareTo(t)==0},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=S();return this.bitwiseTo(t,Jt,e),e},r.prototype.or=function(t){var e=S();return this.bitwiseTo(t,nt,e),e},r.prototype.xor=function(t){var e=S();return this.bitwiseTo(t,Et,e),e},r.prototype.andNot=function(t){var e=S();return this.bitwiseTo(t,Dt,e),e},r.prototype.not=function(){for(var t=S(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},r.prototype.shiftLeft=function(t){var e=S();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},r.prototype.shiftRight=function(t){var e=S();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},r.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(this[t]!=0)return t*this.DB+zt(this[t]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=Wt(this[i]^e);return t},r.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?this.s!=0:(this[e]&1<<t%this.DB)!=0},r.prototype.setBit=function(t){return this.changeBit(t,nt)},r.prototype.clearBit=function(t){return this.changeBit(t,Dt)},r.prototype.flipBit=function(t){return this.changeBit(t,Et)},r.prototype.add=function(t){var e=S();return this.addTo(t,e),e},r.prototype.subtract=function(t){var e=S();return this.subTo(t,e),e},r.prototype.multiply=function(t){var e=S();return this.multiplyTo(t,e),e},r.prototype.divide=function(t){var e=S();return this.divRemTo(t,e,null),e},r.prototype.remainder=function(t){var e=S();return this.divRemTo(t,null,e),e},r.prototype.divideAndRemainder=function(t){var e=S(),i=S();return this.divRemTo(t,e,i),[e,i]},r.prototype.modPow=function(t,e){var i=t.bitLength(),n,s=j(1),o;if(i<=0)return s;i<18?n=1:i<48?n=3:i<144?n=4:i<768?n=5:n=6,i<8?o=new Bt(e):e.isEven()?o=new ee(e):o=new It(e);var a=[],h=3,f=n-1,l=(1<<n)-1;if(a[1]=o.convert(this),n>1){var c=S();for(o.sqrTo(a[1],c);h<=l;)a[h]=S(),o.mulTo(c,a[h-2],a[h]),h+=2}var v=t.t-1,p,T=!0,b=S(),R;for(i=st(t[v])-1;v>=0;){for(i>=f?p=t[v]>>i-f&l:(p=(t[v]&(1<<i+1)-1)<<f-i,v>0&&(p|=t[v-1]>>this.DB+i-f)),h=n;(p&1)==0;)p>>=1,--h;if((i-=h)<0&&(i+=this.DB,--v),T)a[p].copyTo(s),T=!1;else{for(;h>1;)o.sqrTo(s,b),o.sqrTo(b,s),h-=2;h>0?o.sqrTo(s,b):(R=s,s=b,b=R),o.mulTo(b,a[p],s)}for(;v>=0&&(t[v]&1<<i)==0;)o.sqrTo(s,b),R=s,s=b,b=R,--i<0&&(i=this.DB-1,--v)}return o.revert(s)},r.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return r.ZERO;for(var i=t.clone(),n=this.clone(),s=j(1),o=j(0),a=j(0),h=j(1);i.signum()!=0;){for(;i.isEven();)i.rShiftTo(1,i),e?((!s.isEven()||!o.isEven())&&(s.addTo(this,s),o.subTo(t,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),e?((!a.isEven()||!h.isEven())&&(a.addTo(this,a),h.subTo(t,h)),a.rShiftTo(1,a)):h.isEven()||h.subTo(t,h),h.rShiftTo(1,h);i.compareTo(n)>=0?(i.subTo(n,i),e&&s.subTo(a,s),o.subTo(h,o)):(n.subTo(i,n),e&&a.subTo(s,a),h.subTo(o,h))}if(n.compareTo(r.ONE)!=0)return r.ZERO;if(h.compareTo(t)>=0)return h.subtract(t);if(h.signum()<0)h.addTo(t,h);else return h;return h.signum()<0?h.add(t):h},r.prototype.pow=function(t){return this.exp(t,new te)},r.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 n=e;e=i,i=n}var s=e.getLowestSetBit(),o=i.getLowestSetBit();if(o<0)return e;for(s<o&&(o=s),o>0&&(e.rShiftTo(o,e),i.rShiftTo(o,i));e.signum()>0;)(s=e.getLowestSetBit())>0&&e.rShiftTo(s,e),(s=i.getLowestSetBit())>0&&i.rShiftTo(s,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return o>0&&i.lShiftTo(o,i),i},r.prototype.isProbablePrime=function(t){var e,i=this.abs();if(i.t==1&&i[0]<=A[A.length-1]){for(e=0;e<A.length;++e)if(i[0]==A[e])return!0;return!1}if(i.isEven())return!1;for(e=1;e<A.length;){for(var n=A[e],s=e+1;s<A.length&&n<Qt;)n*=A[s++];for(n=i.modInt(n);e<s;)if(n%A[e++]==0)return!1}return i.millerRabin(t)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var i;if(e==16)i=4;else if(e==8)i=3;else if(e==256)i=8;else if(e==2)i=1;else if(e==32)i=5;else if(e==4)i=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,s=!1,o=0;--n>=0;){var a=i==8?+t[n]&255:Ot(t,n);if(a<0){t.charAt(n)=="-"&&(s=!0);continue}s=!1,o==0?this[this.t++]=a:o+i>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=i,o>=this.DB&&(o-=this.DB)}i==8&&(+t[0]&128)!=0&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),s&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s},r.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},r.prototype.lShiftTo=function(t,e){for(var i=t%this.DB,n=this.DB-i,s=(1<<n)-1,o=Math.floor(t/this.DB),a=this.s<<i&this.DM,h=this.t-1;h>=0;--h)e[h+o+1]=this[h]>>n|a,a=(this[h]&s)<<i;for(var h=o-1;h>=0;--h)e[h]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t){e.t=0;return}var n=t%this.DB,s=this.DB-n,o=(1<<n)-1;e[0]=this[i]>>n;for(var a=i+1;a<this.t;++a)e[a-i-1]|=(this[a]&o)<<s,e[a-i]=this[a]>>n;n>0&&(e[this.t-i-1]|=(this.s&o)<<s),e.t=this.t-i,e.clamp()},r.prototype.subTo=function(t,e){for(var i=0,n=0,s=Math.min(t.t,this.t);i<s;)n+=this[i]-t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n-=t[i],e[i++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[i++]=this.DV+n:n>0&&(e[i++]=n),e.t=i,e.clamp()},r.prototype.multiplyTo=function(t,e){var i=this.abs(),n=t.abs(),s=i.t;for(e.t=s+n.t;--s>=0;)e[s]=0;for(s=0;s<n.t;++s)e[s+i.t]=i.am(0,n[s],e,s,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)},r.prototype.squareTo=function(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var n=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,n,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,i){var n=t.abs();if(!(n.t<=0)){var s=this.abs();if(s.t<n.t){e?.fromInt(0),i!=null&&this.copyTo(i);return}i==null&&(i=S());var o=S(),a=this.s,h=t.s,f=this.DB-st(n[n.t-1]);f>0?(n.lShiftTo(f,o),s.lShiftTo(f,i)):(n.copyTo(o),s.copyTo(i));var l=o.t,c=o[l-1];if(c!=0){var v=c*(1<<this.F1)+(l>1?o[l-2]>>this.F2:0),p=this.FV/v,T=(1<<this.F1)/v,b=1<<this.F2,R=i.t,q=R-l,I=e??S();for(o.dlShiftTo(q,I),i.compareTo(I)>=0&&(i[i.t++]=1,i.subTo(I,i)),r.ONE.dlShiftTo(l,I),I.subTo(o,o);o.t<l;)o[o.t++]=0;for(;--q>=0;){var F=i[--R]==c?this.DM:Math.floor(i[R]*p+(i[R-1]+b)*T);if((i[R]+=o.am(0,F,i,q,0,l))<F)for(o.dlShiftTo(q,I),i.subTo(I,i);i[R]<--F;)i.subTo(I,i)}e!=null&&(i.drShiftTo(l,e),a!=h&&r.ZERO.subTo(e,e)),i.t=l,i.clamp(),f>0&&i.rShiftTo(f,i),a<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e},r.prototype.isEven=function(){return(this.t>0?this[0]&1:this.s)==0},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var i=S(),n=S(),s=e.convert(this),o=st(t)-1;for(s.copyTo(i);--o>=0;)if(e.sqrTo(i,n),(t&1<<o)>0)e.mulTo(n,s,i);else{var a=i;i=n,n=a}return e.revert(i)},r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),n=j(i),s=S(),o=S(),a="";for(this.divRemTo(n,s,o);s.signum()>0;)a=(i+o.intValue()).toString(t).substring(1)+a,s.divRemTo(n,s,o);return o.intValue().toString(t)+a},r.prototype.fromRadix=function(t,e){this.fromInt(0),e==null&&(e=10);for(var i=this.chunkSize(e),n=Math.pow(e,i),s=!1,o=0,a=0,h=0;h<t.length;++h){var f=Ot(t,h);if(f<0){t.charAt(h)=="-"&&this.signum()==0&&(s=!0);continue}a=e*a+f,++o>=i&&(this.dMultiply(n),this.dAddOffset(a,0),o=0,a=0)}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(a,0)),s&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,i){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),nt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var n=[],s=t&7;n.length=(t>>3)+1,e.nextBytes(n),s>0?n[0]&=(1<<s)-1:n[0]=0,this.fromString(n,256)}},r.prototype.bitwiseTo=function(t,e,i){var n,s,o=Math.min(t.t,this.t);for(n=0;n<o;++n)i[n]=e(this[n],t[n]);if(t.t<this.t){for(s=t.s&this.DM,n=o;n<this.t;++n)i[n]=e(this[n],s);i.t=this.t}else{for(s=this.s&this.DM,n=o;n<t.t;++n)i[n]=e(s,t[n]);i.t=t.t}i.s=e(this.s,t.s),i.clamp()},r.prototype.changeBit=function(t,e){var i=r.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i},r.prototype.addTo=function(t,e){for(var i=0,n=0,s=Math.min(t.t,this.t);i<s;)n+=this[i]+t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n+=t[i],e[i++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[i++]=n:n<-1&&(e[i++]=this.DV+n),e.t=i,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(t!=0){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]}},r.prototype.multiplyLowerTo=function(t,e,i){var n=Math.min(this.t+t.t,e);for(i.s=0,i.t=n;n>0;)i[--n]=0;for(var s=i.t-this.t;n<s;++n)i[n+this.t]=this.am(0,t[n],i,n,0,this.t);for(var s=Math.min(t.t,e);n<s;++n)this.am(0,t[n],i,n,0,e-n);i.clamp()},r.prototype.multiplyUpperTo=function(t,e,i){--e;var n=i.t=this.t+t.t-e;for(i.s=0;--n>=0;)i[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)i[this.t+n-e]=this.am(e-n,t[n],i,0,0,this.t+n-e);i.clamp(),i.drShiftTo(1,i)},r.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(e==0)i=this[0]%t;else for(var n=this.t-1;n>=0;--n)i=(e*i+this[n])%t;return i},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var n=e.shiftRight(i);t=t+1>>1,t>A.length&&(t=A.length);for(var s=S(),o=0;o<t;++o){s.fromInt(A[Math.floor(Math.random()*A.length)]);var a=s.modPow(n,this);if(a.compareTo(r.ONE)!=0&&a.compareTo(e)!=0){for(var h=1;h++<i&&a.compareTo(e)!=0;)if(a=a.modPowInt(2,this),a.compareTo(r.ONE)==0)return!1;if(a.compareTo(e)!=0)return!1}}return!0},r.prototype.square=function(){var t=S();return this.squareTo(t),t},r.prototype.gcda=function(t,e){var i=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(i.compareTo(n)<0){var s=i;i=n,n=s}var o=i.getLowestSetBit(),a=n.getLowestSetBit();if(a<0){e(i);return}o<a&&(a=o),a>0&&(i.rShiftTo(a,i),n.rShiftTo(a,n));var h=function(){(o=i.getLowestSetBit())>0&&i.rShiftTo(o,i),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),i.compareTo(n)>=0?(i.subTo(n,i),i.rShiftTo(1,i)):(n.subTo(i,n),n.rShiftTo(1,n)),i.signum()>0?setTimeout(h,0):(a>0&&n.lShiftTo(a,n),setTimeout(function(){e(n)},0))};setTimeout(h,10)},r.prototype.fromNumberAsync=function(t,e,i,n){if(typeof e=="number")if(t<2)this.fromInt(1);else{this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),nt,this),this.isEven()&&this.dAddOffset(1,0);var s=this,o=function(){s.dAddOffset(2,0),s.bitLength()>t&&s.subTo(r.ONE.shiftLeft(t-1),s),s.isProbablePrime(e)?setTimeout(function(){n()},0):setTimeout(o,0)};setTimeout(o,0)}else{var a=[],h=t&7;a.length=(t>>3)+1,e.nextBytes(a),h>0?a[0]&=(1<<h)-1:a[0]=0,this.fromString(a,256)}},r})(),te=(function(){function r(){}return r.prototype.convert=function(t){return t},r.prototype.revert=function(t){return t},r.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i)},r.prototype.sqrTo=function(t,e){t.squareTo(e)},r})(),Bt=(function(){function r(t){this.m=t}return r.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},r.prototype.revert=function(t){return t},r.prototype.reduce=function(t){t.divRemTo(this.m,null,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)},r})(),It=(function(){function r(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}return r.prototype.convert=function(t){var e=S();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(g.ZERO)>0&&this.m.subTo(e,e),e},r.prototype.revert=function(t){var e=S();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=t[e]&32767,n=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(i=e+this.m.t,t[i]+=this.m.am(0,n,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&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)},r})(),ee=(function(){function r(t){this.m=t,this.r2=S(),this.q3=S(),g.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return r.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=S();return t.copyTo(e),this.reduce(e),e},r.prototype.revert=function(t){return t},r.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);t.compareTo(this.m)>=0;)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)},r})();function S(){return new g(null)}function w(r,t){return new g(r,t)}var Vt=typeof navigator<"u";Vt&&At&&navigator.appName=="Microsoft Internet Explorer"?(g.prototype.am=function(t,e,i,n,s,o){for(var a=e&32767,h=e>>15;--o>=0;){var f=this[t]&32767,l=this[t++]>>15,c=h*f+l*a;f=a*f+((c&32767)<<15)+i[n]+(s&1073741823),s=(f>>>30)+(c>>>15)+h*l+(s>>>30),i[n++]=f&1073741823}return s},U=30):Vt&&At&&navigator.appName!="Netscape"?(g.prototype.am=function(t,e,i,n,s,o){for(;--o>=0;){var a=e*this[t++]+i[n]+s;s=Math.floor(a/67108864),i[n++]=a&67108863}return s},U=26):(g.prototype.am=function(t,e,i,n,s,o){for(var a=e&16383,h=e>>14;--o>=0;){var f=this[t]&16383,l=this[t++]>>14,c=h*f+l*a;f=a*f+((c&16383)<<14)+i[n]+s,s=(f>>28)+(c>>14)+h*l,i[n++]=f&268435455}return s},U=28);g.prototype.DB=U;g.prototype.DM=(1<<U)-1;g.prototype.DV=1<<U;var bt=52;g.prototype.FV=Math.pow(2,bt);g.prototype.F1=bt-U;g.prototype.F2=2*U-bt;var pt=[],X,O;X=48;for(O=0;O<=9;++O)pt[X++]=O;X=97;for(O=10;O<36;++O)pt[X++]=O;X=65;for(O=10;O<36;++O)pt[X++]=O;function Ot(r,t){var e=pt[r.charCodeAt(t)];return e??-1}function j(r){var t=S();return t.fromInt(r),t}function st(r){var t=1,e;return(e=r>>>16)!=0&&(r=e,t+=16),(e=r>>8)!=0&&(r=e,t+=8),(e=r>>4)!=0&&(r=e,t+=4),(e=r>>2)!=0&&(r=e,t+=2),(e=r>>1)!=0&&(r=e,t+=1),t}g.ZERO=j(0);g.ONE=j(1);var ie=(function(){function r(){this.i=0,this.j=0,this.S=[]}return r.prototype.init=function(t){var e,i,n;for(e=0;e<256;++e)this.S[e]=e;for(i=0,e=0;e<256;++e)i=i+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[i],this.S[i]=n;this.i=0,this.j=0},r.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]},r})();function re(){return new ie}var Ft=256,ot,K=null,_;if(K==null){K=[],_=0;var at=void 0;if(typeof window<"u"&&self.crypto&&self.crypto.getRandomValues){var gt=new Uint32Array(256);for(self.crypto.getRandomValues(gt),at=0;at<gt.length;++at)K[_++]=gt[at]&255}var ht=0,ut=function(r){if(ht=ht||0,ht>=256||_>=Ft){self.removeEventListener?self.removeEventListener("mousemove",ut,!1):self.detachEvent&&self.detachEvent("onmousemove",ut);return}try{var t=r.x+r.y;K[_++]=t&255,ht+=1}catch{}};typeof window<"u"&&(self.addEventListener?self.addEventListener("mousemove",ut,!1):self.attachEvent&&self.attachEvent("onmousemove",ut))}function ne(){if(ot==null){for(ot=re();_<Ft;){var r=Math.floor(65536*Math.random());K[_++]=r&255}for(ot.init(K),_=0;_<K.length;++_)K[_]=0;_=0}return ot.next()}var ct=(function(){function r(){}return r.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=ne()},r})();function Tt(r){return oe(de(se(r),r.length*8))}function Nt(r){for(var t="0123456789abcdef",e="",i=0;i<r.length;i++){var n=r.charCodeAt(i);e+=t.charAt(n>>>4&15)+t.charAt(n&15)}return e}function se(r){for(var t=Array(r.length>>2),e=0;e<t.length;e++)t[e]=0;for(var e=0;e<r.length*8;e+=8)t[e>>5]|=(r.charCodeAt(e/8)&255)<<24-e%32;return t}function oe(r){for(var t="",e=0;e<r.length*32;e+=8)t+=String.fromCharCode(r[e>>5]>>>24-e%32&255);return t}function C(r,t){return r>>>t|r<<32-t}function kt(r,t){return r>>>t}function ae(r,t,e){return r&t^~r&e}function he(r,t,e){return r&t^r&e^t&e}function ue(r){return C(r,2)^C(r,13)^C(r,22)}function fe(r){return C(r,6)^C(r,11)^C(r,25)}function le(r){return C(r,7)^C(r,18)^kt(r,3)}function ce(r){return C(r,17)^C(r,19)^kt(r,10)}var pe=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function de(r,t){var e=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),i=new Array(64),n,s,o,a,h,f,l,c,v,p,T,b;for(r[t>>5]|=128<<24-t%32,r[(t+64>>9<<4)+15]=t,v=0;v<r.length;v+=16){for(n=e[0],s=e[1],o=e[2],a=e[3],h=e[4],f=e[5],l=e[6],c=e[7],p=0;p<64;p++)p<16?i[p]=r[p+v]:i[p]=x(x(x(ce(i[p-2]),i[p-7]),le(i[p-15])),i[p-16]),T=x(x(x(x(c,fe(h)),ae(h,f,l)),pe[p]),i[p]),b=x(ue(n),he(n,s,o)),c=l,l=f,f=h,h=x(a,T),a=o,o=s,s=n,n=x(T,b);e[0]=x(n,e[0]),e[1]=x(s,e[1]),e[2]=x(o,e[2]),e[3]=x(a,e[3]),e[4]=x(h,e[4]),e[5]=x(f,e[5]),e[6]=x(l,e[6]),e[7]=x(c,e[7])}return e}function x(r,t){var e=(r&65535)+(t&65535),i=(r>>16)+(t>>16)+(e>>16);return i<<16|e&65535}function ve(r,t){if(t<r.length+22)return console.error("Message too long for RSA"),null;for(var e=t-r.length-6,i="",n=0;n<e;n+=2)i+="ff";var s="0001"+i+"00"+r;return w(s,16)}function ge(r,t){if(t<r.length+11)return console.error("Message too long for RSA"),null;for(var e=[],i=r.length-1;i>=0&&t>0;){var n=r.charCodeAt(i--);n<128?e[--t]=n:n>127&&n<2048?(e[--t]=n&63|128,e[--t]=n>>6|192):(e[--t]=n&63|128,e[--t]=n>>6&63|128,e[--t]=n>>12|224)}e[--t]=0;for(var s=new ct,o=[];t>2;){for(o[0]=0;o[0]==0;)s.nextBytes(o);e[--t]=o[0]}return e[--t]=2,e[--t]=0,new g(e)}function Pt(r,t,e){for(var i="",n=0;i.length<t;)i+=e(String.fromCharCode.apply(String,r.concat([(n&4278190080)>>24,(n&16711680)>>16,(n&65280)>>8,n&255]))),n+=1;return i}var ye=32;function me(r,t){var e=ye,i=Tt;if(r.length+2*e+2>t)throw"Message too long for RSA";var n="",s;for(s=0;s<t-r.length-2*e-2;s+=1)n+="\0";var o=i("")+n+""+r,a=new Array(e);new ct().nextBytes(a);var h=Pt(a,o.length,i),f=[];for(s=0;s<o.length;s+=1)f[s]=o.charCodeAt(s)^h.charCodeAt(s);var l=Pt(f,a.length,i),c=[0];for(s=0;s<a.length;s+=1)c[s+1]=a[s]^l.charCodeAt(s);return new g(c.concat(f))}var Se=(function(){function r(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return r.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},r.prototype.doPrivate=function(t){if(this.p==null||this.q==null)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)},r.prototype.setPublic=function(t,e){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=w(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},r.prototype.encrypt=function(t,e){typeof e>"u"&&(e=ge);var i=this.n.bitLength()+7>>3,n=e(t,i);if(n==null)return null;var s=this.doPublic(n);if(s==null)return null;for(var o=s.toString(16),a=o.length,h=0;h<i*2-a;h++)o="0"+o;return o},r.prototype.setPrivate=function(t,e,i){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=w(t,16),this.e=parseInt(e,16),this.d=w(i,16)):console.error("Invalid RSA private key")},r.prototype.setPrivateEx=function(t,e,i,n,s,o,a,h){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=w(t,16),this.e=parseInt(e,16),this.d=w(i,16),this.p=w(n,16),this.q=w(s,16),this.dmp1=w(o,16),this.dmq1=w(a,16),this.coeff=w(h,16)):console.error("Invalid RSA private key")},r.prototype.generate=function(t,e){var i=new ct,n=t>>1;this.e=parseInt(e,16);for(var s=new g(e,16);;){for(;this.p=new g(t-n,1,i),!(this.p.subtract(g.ONE).gcd(s).compareTo(g.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new g(n,1,i),!(this.q.subtract(g.ONE).gcd(s).compareTo(g.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var a=this.p.subtract(g.ONE),h=this.q.subtract(g.ONE),f=a.multiply(h);if(f.gcd(s).compareTo(g.ONE)==0){this.n=this.p.multiply(this.q),this.d=s.modInverse(f),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(h),this.coeff=this.q.modInverse(this.p);break}}},r.prototype.decrypt=function(t){var e=w(t,16),i=this.doPrivate(e);return i==null?null:Te(i,this.n.bitLength()+7>>3)},r.prototype.generateAsync=function(t,e,i){var n=new ct,s=t>>1;this.e=parseInt(e,16);var o=new g(e,16),a=this,h=function(){var f=function(){if(a.p.compareTo(a.q)<=0){var v=a.p;a.p=a.q,a.q=v}var p=a.p.subtract(g.ONE),T=a.q.subtract(g.ONE),b=p.multiply(T);b.gcd(o).compareTo(g.ONE)==0?(a.n=a.p.multiply(a.q),a.d=o.modInverse(b),a.dmp1=a.d.mod(p),a.dmq1=a.d.mod(T),a.coeff=a.q.modInverse(a.p),setTimeout(function(){i()},0)):setTimeout(h,0)},l=function(){a.q=S(),a.q.fromNumberAsync(s,1,n,function(){a.q.subtract(g.ONE).gcda(o,function(v){v.compareTo(g.ONE)==0&&a.q.isProbablePrime(10)?setTimeout(f,0):setTimeout(l,0)})})},c=function(){a.p=S(),a.p.fromNumberAsync(t-s,1,n,function(){a.p.subtract(g.ONE).gcda(o,function(v){v.compareTo(g.ONE)==0&&a.p.isProbablePrime(10)?setTimeout(l,0):setTimeout(c,0)})})};setTimeout(c,0)};setTimeout(h,0)},r.prototype.sign=function(t,e,i){var n=be(i),s=n+e(t).toString(),o=this.n.bitLength()/4,a=ve(s,o);if(a==null)return null;var h=this.doPrivate(a);if(h==null)return null;for(var f=h.toString(16),l=f.length,c=0;c<o-l;c++)f="0"+f;return f},r.prototype.verify=function(t,e,i){var n=w(e,16),s=this.doPublic(n);if(s==null)return null;var o=s.toString(16).replace(/^1f+00/,""),a=we(o);return a==i(t).toString()},r})();function Te(r,t){for(var e=r.toByteArray(),i=0;i<e.length&&e[i]==0;)++i;if(e.length-i!=t-1||e[i]!=2)return null;for(++i;e[i]!=0;)if(++i>=e.length)return null;for(var n="";++i<e.length;){var s=e[i]&255;s<128?n+=String.fromCharCode(s):s>191&&s<224?(n+=String.fromCharCode((s&31)<<6|e[i+1]&63),++i):(n+=String.fromCharCode((s&15)<<12|(e[i+1]&63)<<6|e[i+2]&63),i+=2)}return n}var lt={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function be(r){return lt[r]||""}function we(r){for(var t in lt)if(lt.hasOwnProperty(t)){var e=lt[t],i=e.length;if(r.substring(0,i)==e)return r.substring(i)}return r}function D(r,t,e){if(!t||!r)throw new Error("extend failed, please check that all dependencies are included.");var i=function(){};i.prototype=t.prototype,r.prototype=new i,r.prototype.constructor=r,r.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}var u={};(typeof u.asn1>"u"||!u.asn1)&&(u.asn1={});u.asn1.ASN1Util=new function(){this.integerToByteHex=function(r){var t=r.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(r){var t=r.toString(16);if(t.substring(0,1)!="-")t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var e=t.substring(1),i=e.length;i%2==1?i+=1:t.match(/^[0-7]/)||(i+=2);for(var n="",s=0;s<i;s++)n+="f";var o=new g(n,16),a=o.xor(r).add(g.ONE);t=a.toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(r,t){return hextopem(r,t)},this.newObject=function(r){var t=u,e=t.asn1,i=e.DERBoolean,n=e.DERInteger,s=e.DERBitString,o=e.DEROctetString,a=e.DERNull,h=e.DERObjectIdentifier,f=e.DEREnumerated,l=e.DERUTF8String,c=e.DERNumericString,v=e.DERPrintableString,p=e.DERTeletexString,T=e.DERIA5String,b=e.DERUTCTime,R=e.DERGeneralizedTime,q=e.DERSequence,I=e.DERSet,F=e.DERTaggedObject,N=e.ASN1Util.newObject,rt=Object.keys(r);if(rt.length!=1)throw"key of param shall be only one.";var y=rt[0];if(":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+y+":")==-1)throw"undefined key: "+y;if(y=="bool")return new i(r[y]);if(y=="int")return new n(r[y]);if(y=="bitstr")return new s(r[y]);if(y=="octstr")return new o(r[y]);if(y=="null")return new a(r[y]);if(y=="oid")return new h(r[y]);if(y=="enum")return new f(r[y]);if(y=="utf8str")return new l(r[y]);if(y=="numstr")return new c(r[y]);if(y=="prnstr")return new v(r[y]);if(y=="telstr")return new p(r[y]);if(y=="ia5str")return new T(r[y]);if(y=="utctime")return new b(r[y]);if(y=="gentime")return new R(r[y]);if(y=="seq"){for(var k=r[y],L=[],M=0;M<k.length;M++){var J=N(k[M]);L.push(J)}return new q({array:L})}if(y=="set"){for(var k=r[y],L=[],M=0;M<k.length;M++){var J=N(k[M]);L.push(J)}return new I({array:L})}if(y=="tag"){var V=r[y];if(Object.prototype.toString.call(V)==="[object Array]"&&V.length==3){var dt=N(V[2]);return new F({tag:V[0],explicit:V[1],obj:dt})}else{var P={};if(V.explicit!==void 0&&(P.explicit=V.explicit),V.tag!==void 0&&(P.tag=V.tag),V.obj===void 0)throw"obj shall be specified for 'tag'.";return P.obj=N(V.obj),new F(P)}}},this.jsonToASN1HEX=function(r){var t=this.newObject(r);return t.getEncodedHex()}};u.asn1.ASN1Util.oidHexToInt=function(r){for(var n="",t=parseInt(r.substring(0,2),16),e=Math.floor(t/40),i=t%40,n=e+"."+i,s="",o=2;o<r.length;o+=2){var a=parseInt(r.substring(o,o+2),16),h=("00000000"+a.toString(2)).slice(-8);if(s=s+h.substring(1,8),h.substring(0,1)=="0"){var f=new g(s,2);n=n+"."+f.toString(10),s=""}}return n};u.asn1.ASN1Util.oidIntToHex=function(r){var t=function(a){var h=a.toString(16);return h.length==1&&(h="0"+h),h},e=function(a){var h="",f=new g(a,10),l=f.toString(2),c=7-l.length%7;c==7&&(c=0);for(var v="",p=0;p<c;p++)v+="0";l=v+l;for(var p=0;p<l.length-1;p+=7){var T=l.substring(p,p+7);p!=l.length-7&&(T="1"+T),h+=t(parseInt(T,2))}return h};if(!r.match(/^[0-9.]+$/))throw"malformed oid string: "+r;var i="",n=r.split("."),s=parseInt(n[0])*40+parseInt(n[1]);i+=t(s),n.splice(0,2);for(var o=0;o<n.length;o++)i+=e(n[o]);return i};u.asn1.ASN1Object=function(){var r="";this.getLengthHexFromValue=function(){if(typeof this.hV>"u"||this.hV==null)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+r.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(i>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var n=128+i;return n.toString(16)+e},this.getEncodedHex=function(){return(this.hTLV==null||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""}};u.asn1.DERAbstractString=function(r){u.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},typeof r<"u"&&(typeof r=="string"?this.setString(r):typeof r.str<"u"?this.setString(r.str):typeof r.hex<"u"&&this.setStringHex(r.hex))};D(u.asn1.DERAbstractString,u.asn1.ASN1Object);u.asn1.DERAbstractTime=function(r){u.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){utc=t.getTime()+t.getTimezoneOffset()*6e4;var e=new Date(utc);return e},this.formatDate=function(t,e,i){var n=this.zeroPadding,s=this.localDateToUTC(t),o=String(s.getFullYear());e=="utc"&&(o=o.substring(2,4));var a=n(String(s.getMonth()+1),2),h=n(String(s.getDate()),2),f=n(String(s.getHours()),2),l=n(String(s.getMinutes()),2),c=n(String(s.getSeconds()),2),v=o+a+h+f+l+c;if(i===!0){var p=s.getMilliseconds();if(p!=0){var T=n(String(p),3);T=T.replace(/[0]+$/,""),v=v+"."+T}}return v+"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(t)},this.setByDateValue=function(t,e,i,n,s,o){var a=new Date(Date.UTC(t,e-1,i,n,s,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}};D(u.asn1.DERAbstractTime,u.asn1.ASN1Object);u.asn1.DERAbstractStructured=function(r){u.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,typeof r<"u"&&typeof r.array<"u"&&(this.asn1Array=r.array)};D(u.asn1.DERAbstractStructured,u.asn1.ASN1Object);u.asn1.DERBoolean=function(){u.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"};D(u.asn1.DERBoolean,u.asn1.ASN1Object);u.asn1.DERInteger=function(r){u.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=u.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new g(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r.bigint<"u"?this.setByBigInteger(r.bigint):typeof r.int<"u"?this.setByInteger(r.int):typeof r=="number"?this.setByInteger(r):typeof r.hex<"u"&&this.setValueHex(r.hex))};D(u.asn1.DERInteger,u.asn1.ASN1Object);u.asn1.DERBitString=function(r){if(r!==void 0&&typeof r.obj<"u"){var t=u.asn1.ASN1Util.newObject(r.obj);r.hex="00"+t.getEncodedHex()}u.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,i){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var n="0"+e;this.hTLV=null,this.isModified=!0,this.hV=n+i},this.setByBinaryString=function(e){e=e.replace(/0+$/,"");var i=8-e.length%8;i==8&&(i=0);for(var n=0;n<=i;n++)e+="0";for(var s="",n=0;n<e.length-1;n+=8){var o=e.substring(n,n+8),a=parseInt(o,2).toString(16);a.length==1&&(a="0"+a),s+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+i+s},this.setByBooleanArray=function(e){for(var i="",n=0;n<e.length;n++)e[n]==!0?i+="1":i+="0";this.setByBinaryString(i)},this.newFalseArray=function(e){for(var i=new Array(e),n=0;n<e;n++)i[n]=!1;return i},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r=="string"&&r.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(r):typeof r.hex<"u"?this.setHexValueIncludingUnusedBits(r.hex):typeof r.bin<"u"?this.setByBinaryString(r.bin):typeof r.array<"u"&&this.setByBooleanArray(r.array))};D(u.asn1.DERBitString,u.asn1.ASN1Object);u.asn1.DEROctetString=function(r){if(r!==void 0&&typeof r.obj<"u"){var t=u.asn1.ASN1Util.newObject(r.obj);r.hex=t.getEncodedHex()}u.asn1.DEROctetString.superclass.constructor.call(this,r),this.hT="04"};D(u.asn1.DEROctetString,u.asn1.DERAbstractString);u.asn1.DERNull=function(){u.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"};D(u.asn1.DERNull,u.asn1.ASN1Object);u.asn1.DERObjectIdentifier=function(r){var t=function(i){var n=i.toString(16);return n.length==1&&(n="0"+n),n},e=function(i){var n="",s=new g(i,10),o=s.toString(2),a=7-o.length%7;a==7&&(a=0);for(var h="",f=0;f<a;f++)h+="0";o=h+o;for(var f=0;f<o.length-1;f+=7){var l=o.substring(f,f+7);f!=o.length-7&&(l="1"+l),n+=t(parseInt(l,2))}return n};u.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(i){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=i},this.setValueOidString=function(i){if(!i.match(/^[0-9.]+$/))throw"malformed oid string: "+i;var n="",s=i.split("."),o=parseInt(s[0])*40+parseInt(s[1]);n+=t(o),s.splice(0,2);for(var a=0;a<s.length;a++)n+=e(s[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(i){var n=u.asn1.x509.OID.name2oid(i);if(n!=="")this.setValueOidString(n);else throw"DERObjectIdentifier oidName undefined: "+i},this.getFreshValueHex=function(){return this.hV},r!==void 0&&(typeof r=="string"?r.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(r):this.setValueName(r):r.oid!==void 0?this.setValueOidString(r.oid):r.hex!==void 0?this.setValueHex(r.hex):r.name!==void 0&&this.setValueName(r.name))};D(u.asn1.DERObjectIdentifier,u.asn1.ASN1Object);u.asn1.DEREnumerated=function(r){u.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=u.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new g(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r.int<"u"?this.setByInteger(r.int):typeof r=="number"?this.setByInteger(r):typeof r.hex<"u"&&this.setValueHex(r.hex))};D(u.asn1.DEREnumerated,u.asn1.ASN1Object);u.asn1.DERUTF8String=function(r){u.asn1.DERUTF8String.superclass.constructor.call(this,r),this.hT="0c"};D(u.asn1.DERUTF8String,u.asn1.DERAbstractString);u.asn1.DERNumericString=function(r){u.asn1.DERNumericString.superclass.constructor.call(this,r),this.hT="12"};D(u.asn1.DERNumericString,u.asn1.DERAbstractString);u.asn1.DERPrintableString=function(r){u.asn1.DERPrintableString.superclass.constructor.call(this,r),this.hT="13"};D(u.asn1.DERPrintableString,u.asn1.DERAbstractString);u.asn1.DERTeletexString=function(r){u.asn1.DERTeletexString.superclass.constructor.call(this,r),this.hT="14"};D(u.asn1.DERTeletexString,u.asn1.DERAbstractString);u.asn1.DERIA5String=function(r){u.asn1.DERIA5String.superclass.constructor.call(this,r),this.hT="16"};D(u.asn1.DERIA5String,u.asn1.DERAbstractString);u.asn1.DERUTCTime=function(r){u.asn1.DERUTCTime.superclass.constructor.call(this,r),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)},this.getFreshValueHex=function(){return typeof this.date>"u"&&typeof this.s>"u"&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},r!==void 0&&(r.str!==void 0?this.setString(r.str):typeof r=="string"&&r.match(/^[0-9]{12}Z$/)?this.setString(r):r.hex!==void 0?this.setStringHex(r.hex):r.date!==void 0&&this.setByDate(r.date))};D(u.asn1.DERUTCTime,u.asn1.DERAbstractTime);u.asn1.DERGeneralizedTime=function(r){u.asn1.DERGeneralizedTime.superclass.constructor.call(this,r),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},r!==void 0&&(r.str!==void 0?this.setString(r.str):typeof r=="string"&&r.match(/^[0-9]{14}Z$/)?this.setString(r):r.hex!==void 0?this.setStringHex(r.hex):r.date!==void 0&&this.setByDate(r.date),r.millis===!0&&(this.withMillis=!0))};D(u.asn1.DERGeneralizedTime,u.asn1.DERAbstractTime);u.asn1.DERSequence=function(r){u.asn1.DERSequence.superclass.constructor.call(this,r),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){var i=this.asn1Array[e];t+=i.getEncodedHex()}return this.hV=t,this.hV}};D(u.asn1.DERSequence,u.asn1.DERAbstractStructured);u.asn1.DERSet=function(r){u.asn1.DERSet.superclass.constructor.call(this,r),this.hT="31",this.sortFlag=!0,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 this.sortFlag==!0&&t.sort(),this.hV=t.join(""),this.hV},typeof r<"u"&&typeof r.sortflag<"u"&&r.sortflag==!1&&(this.sortFlag=!1)};D(u.asn1.DERSet,u.asn1.DERAbstractStructured);u.asn1.DERTaggedObject=function(r){u.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},typeof r<"u"&&(typeof r.tag<"u"&&(this.hT=r.tag),typeof r.explicit<"u"&&(this.isExplicit=r.explicit),typeof r.obj<"u"&&(this.asn1Object=r.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))};D(u.asn1.DERTaggedObject,u.asn1.ASN1Object);var Ee=(function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function i(){this.constructor=t}t.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}})(),_t=(function(r){Ee(t,r);function t(e){var i=r.call(this)||this;return e&&(typeof e=="string"?i.parseKey(e):(t.hasPrivateKeyProperty(e)||t.hasPublicKeyProperty(e))&&i.parsePropertiesFrom(e)),i}return t.prototype.parseKey=function(e){try{var i=0,n=0,s=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,o=s.test(e)?Gt.decode(e):St.unarmor(e),a=Yt.decode(o);if(a.sub.length===3&&(a=a.sub[2].sub[0]),a.sub.length===9){i=a.sub[1].getHexStringValue(),this.n=w(i,16),n=a.sub[2].getHexStringValue(),this.e=parseInt(n,16);var h=a.sub[3].getHexStringValue();this.d=w(h,16);var f=a.sub[4].getHexStringValue();this.p=w(f,16);var l=a.sub[5].getHexStringValue();this.q=w(l,16);var c=a.sub[6].getHexStringValue();this.dmp1=w(c,16);var v=a.sub[7].getHexStringValue();this.dmq1=w(v,16);var p=a.sub[8].getHexStringValue();this.coeff=w(p,16)}else if(a.sub.length===2)if(a.sub[0].sub){var T=a.sub[1],b=T.sub[0];i=b.sub[0].getHexStringValue(),this.n=w(i,16),n=b.sub[1].getHexStringValue(),this.e=parseInt(n,16)}else i=a.sub[0].getHexStringValue(),this.n=w(i,16),n=a.sub[1].getHexStringValue(),this.e=parseInt(n,16);else return!1;return!0}catch{return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new u.asn1.DERInteger({int:0}),new u.asn1.DERInteger({bigint:this.n}),new u.asn1.DERInteger({int:this.e}),new u.asn1.DERInteger({bigint:this.d}),new u.asn1.DERInteger({bigint:this.p}),new u.asn1.DERInteger({bigint:this.q}),new u.asn1.DERInteger({bigint:this.dmp1}),new u.asn1.DERInteger({bigint:this.dmq1}),new u.asn1.DERInteger({bigint:this.coeff})]},i=new u.asn1.DERSequence(e);return i.getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return et(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new u.asn1.DERSequence({array:[new u.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new u.asn1.DERNull]}),i=new u.asn1.DERSequence({array:[new u.asn1.DERInteger({bigint:this.n}),new u.asn1.DERInteger({int:this.e})]}),n=new u.asn1.DERBitString({hex:"00"+i.getEncodedHex()}),s=new u.asn1.DERSequence({array:[e,n]});return s.getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return et(this.getPublicBaseKey())},t.wordwrap=function(e,i){if(i=i||64,!e)return e;var n="(.{1,"+i+`})( +|$
9
9
  ?)|(.{1,`+i+"})";return e.match(RegExp(n,"g")).join(`
10
10
  `)},t.prototype.getPrivateKey=function(){var e=`-----BEGIN RSA PRIVATE KEY-----
11
11
  `;return e+=t.wordwrap(this.getPrivateBaseKeyB64())+`
12
12
  `,e+="-----END RSA PRIVATE KEY-----",e},t.prototype.getPublicKey=function(){var e=`-----BEGIN PUBLIC KEY-----
13
13
  `;return e+=t.wordwrap(this.getPublicBaseKeyB64())+`
14
- `,e+="-----END PUBLIC KEY-----",e},t.hasPublicKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t})(ue),ft,pe=typeof process<"u"?(ft=process.env)===null||ft===void 0?void 0:ft.npm_package_version:void 0,ge=(function(){function r(t){t===void 0&&(t={}),this.default_key_size=t.default_key_size?parseInt(t.default_key_size,10):1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=t.key||null}return r.prototype.setKey=function(t){t?(this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new At(t)):!this.key&&this.log&&console.error("A key was not set.")},r.prototype.setPrivateKey=function(t){this.setKey(t)},r.prototype.setPublicKey=function(t){this.setKey(t)},r.prototype.decrypt=function(t){try{return this.getKey().decrypt(mt(t))}catch{return!1}},r.prototype.encrypt=function(t){try{return J(this.getKey().encrypt(t))}catch{return!1}},r.prototype.encryptOAEP=function(t){try{return J(this.getKey().encrypt(t,ae))}catch{return!1}},r.prototype.sign=function(t,e,i){e===void 0&&(e=function(n){return n}),i===void 0&&(i="");try{return J(this.getKey().sign(t,e,i))}catch{return!1}},r.prototype.signSha256=function(t){return this.sign(t,function(e){return xt(ct(e))},"sha256")},r.prototype.verify=function(t,e,i){i===void 0&&(i=function(n){return n});try{return this.getKey().verify(t,mt(e),i)}catch{return!1}},r.prototype.verifySha256=function(t,e){return this.verify(t,e,function(i){return xt(ct(i))})},r.prototype.getKey=function(t){if(!this.key){if(this.key=new At,t&&{}.toString.call(t)==="[object Function]"){this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);return}this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},r.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},r.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},r.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},r.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},r.version=pe,r})();const ve={name:"GPluginVideo",props:{isPlayVideo:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},cameraIndexCode:{type:String,default:""},currentPlayType:{type:Number,default:0},baseUrl:{type:String,default:"http://92.97.137.81:48181"},usefullData:{type:Object,default:{appkey:"24460774",secret:"vphyI4pTqEVk4lT67jVe",ip:"61.27.16.15",port:443}},size:{type:Object,default:{windowWidth:300,windowHeight:200}},isMulTip:{type:Boolean,default:!1},multipPointsArr:{type:Array,default:()=>[]},happenedTime:{type:String,default:""}},data(){return{camlength:"1x1",layoutMode:"1x1",oWebControl:null,initCount:0,pubKey:"",isLoading:!0,playText:"",videoTotal:0,selectAll:[],currentPage:1,currentArr:[],pageSize:0}},mounted(){this.loadH5PlayerScript().then(()=>{this.isPlayVideo&&this.initPlugin()}).catch(()=>{this.showPluginDownloadDialog()}),this.isMulTip&&(this.pageSize=4,this.videoTotal=this.multipPointsArr.length,this.videoTotal===1?this.layoutMode="1x1":this.videoTotal===2?this.layoutMode="2x2":this.videoTotal>2&&(this.layoutMode="2x2"),this.selectAll=this.multipPointsArr,this.selectAll=this.chunkArray(this.selectAll,4),this.currentArr=[...this.selectAll[this.currentPage-1]])},beforeDestroy(){this.oWebControl.JS_RequestInterface({funcName:"stopAllPreview"}),this.oWebControl.JS_HideWnd(),this.oWebControl.JS_RequestInterface({funcName:"destroyWnd"})},watch:{happenedTime(){this.startMultiPlayback()},cameraIndexCode(r,t){r!==t&&(this.oWebControl.JS_RequestInterface({funcName:"stopAllPreview"}),this.oWebControl.JS_HideWnd(),this.oWebControl.JS_RequestInterface({funcName:"destroyWnd"}),this.oWebControl.JS_Disconnect().then(()=>{this.initPlugin()},()=>{}))},playText(r){r!=""&&this.showPluginDownloadDialog()}},methods:{loadH5PlayerScript(){return new Promise((r,t)=>{if(window.WebControl){r();return}const e=document.createElement("script");let i;try{i=new URL("./web-control_1.2.5.min.js",typeof document>"u"?require("url").pathToFileURL(__filename).href:ht&&ht.tagName.toUpperCase()==="SCRIPT"&&ht.src||new URL("GPluginVideo/index.js",document.baseURI).href).href}catch{i="./web-control_1.2.5.min.js"}e.src=i,e.async=!0,e.onload=()=>{console.log("web-control_1.2.5.min.js加载成功"),r()},e.onerror=()=>{console.error("web-control_1.2.5.min加载失败"),t(new Error("加载hweb-control_1.2.5.min.js失败"))},document.head.appendChild(e)})},getPreviousMinute(r){const t=new Date(Number(r));return t.setMinutes(t.getMinutes()-1),t.getTime()},getNextMinute(r){const t=new Date(Number(r));return t.setMinutes(t.getMinutes()+1),t.getTime()},chunkArray(r,t){let e=[];for(let i=0;i<r.length;i+=t){let n=r.slice(i,i+t);e.push(n)}return e},closeVideo(){this.$emit("closeVideoEmit"),this.oWebControl!==null&&(this.oWebControl.JS_RequestInterface({funcName:"stopAllPreview"}),this.oWebControl.JS_HideWnd(),this.oWebControl.JS_Disconnect().then(()=>{},()=>{}))},startMultiPreview(){const r={argument:{list:[]}};for(let t=0;t<this.currentArr.length;t++){let i={cameraIndexCode:this.currentArr[t].indexCode.replace(/(^\s*)/g,""),gpuMode:0,streamMode:0,transMode:1,wndId:t+1};r.argument.list.unshift(i)}this.oWebControl.JS_RequestInterface({funcName:"startMultiPreviewByCameraIndexCode",argument:JSON.stringify(r.argument)})},startMultiPlayback(){let r="",t="";this.happenedTime?(console.log(this.getPreviousMinute(this.happenedTime),this.getNextMinute(this.happenedTime)),r=this.getPreviousMinute(this.happenedTime),t=this.getNextMinute(this.happenedTime)):(r=new Date().getTime()-1440*60*1e3,t=new Date().getTime());const e={argument:{list:[]}};for(let i=0;i<this.currentArr.length;i++){let n=this.currentArr[i],s={startTimeStamp:Math.floor(r/1e3).toString(),endTimeStamp:Math.floor(t/1e3).toString(),cameraIndexCode:n.indexCode.replace(/(^\s*)/g,""),gpuMode:0,streamMode:0,transMode:1,wndId:i+1};e.argument.list.unshift(s)}this.oWebControl.JS_RequestInterface({funcName:"startMultiPlaybackByCameraIndexCode",argument:JSON.stringify(e.argument)})},startPlayback(){console.log(this.getPreviousMinute(this.happenedTime));let r="",t="",e="";this.happenedTime?(console.log(this.getPreviousMinute(this.happenedTime),this.getNextMinute(this.happenedTime)),r=this.cameraIndexCode,t=this.getPreviousMinute(this.happenedTime),e=this.getNextMinute(this.happenedTime)):(r=this.cameraIndexCode,t=new Date().getTime()-1440*60*1e3,e=new Date().getTime()),this.oWebControl.JS_RequestInterface({funcName:"startPlayback",argument:JSON.stringify({cameraIndexCode:r,startTimeStamp:Math.floor(t/1e3).toString(),endTimeStamp:Math.floor(e/1e3).toString(),recordLocation:1,transMode:1,gpuMode:0,wndId:-1})})},startPlay(){let r=this.cameraIndexCode;const t=0,e=1,i=0,n=-1;r=r.replace(/(^\s*)/g,""),r=r.replace(/(\s*$)/g,""),this.oWebControl.JS_RequestInterface({funcName:"startPreview",argument:JSON.stringify({cameraIndexCode:r,streamMode:t,transMode:e,gpuMode:i,wndId:n})})},initPlugin(){this.oWebControl=new window.WebControl({szPluginContainer:"playWnd",iServicePortStart:15900,iServicePortEnd:15900,szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11",cbConnectSuccess:()=>{this.oWebControl.JS_StartService("window",{dllPath:"./VideoPluginConnect.dll"}).then(()=>{this.oWebControl.JS_SetWindowControlCallback({cbIntegrationCallBack:this.cbIntegrationCallBack}),this.oWebControl.JS_CreateWnd("playWnd",this.size.windowWidth,this.size.windowHeight).then(()=>{this.init()})},function(){})},cbConnectError:()=>{this.oWebControl=null,this.$message.error("插件未启动,正在尝试启动,请稍候..."),this.playText="插件未启动,正在尝试启动,请稍候...",window.WebControl.JS_WakeUp("VideoWebPlugin://"),this.initCount++,this.initCount<3?setTimeout(()=>{this.initPlugin()},3e3):(this.$message.error("插件启动失败,请检查插件是否安装!"),this.playText="插件启动失败,请检查插件是否安装!")},cbConnectClose:r=>{r||(this.oWebControl=null,this.playText="插件未启动,正在尝试启动,请稍候...",this.initCount++,this.initCount<3?setTimeout(()=>{this.initPlugin()},3e3):(this.$message.error("插件启动失败,请检查插件是否安装!"),this.playText="插件启动失败,请检查插件是否安装!"))}})},init(){this.getPubKey(()=>{this.oWebControl.JS_RequestInterface({funcName:"init",argument:JSON.stringify({appkey:this.usefullData.appkey,secret:this.setEncrypt(this.usefullData.secret),ip:this.usefullData.ip,playMode:this.currentPlayType,port:this.usefullData.port,snapDir:"D:\\SnapDir",videoDir:"D:\\VideoDir",layout:this.layoutMode,enableHTTPS:1,encryptedFields:"secret",showToolbar:1,showSmart:0,buttonIDs:"0,256,257,258,259,260,512,513,514,515,516,517,768,769"})}).then(()=>{this.oWebControl.JS_Resize(this.size.windowWidth,this.size.windowHeight),this.isMulTip?this.currentPlayType===1?this.startMultiPlayback():this.startMultiPreview():this.currentPlayType===1?this.startPlayback():this.startPlay()}),this.isFullScreen&&this.oWebControl.JS_RequestInterface({funcName:"setFullScreen"})})},getPubKey(r){this.oWebControl.JS_RequestInterface({funcName:"getRSAPubKey",argument:JSON.stringify({keyLength:1024})}).then(t=>{t.responseMsg.data&&(this.pubKey=t.responseMsg.data,r())})},setEncrypt(r){let t=new ge;return t.setPublicKey(this.pubKey),t.encrypt(r)},dateFormat(r,t){let e={"M+":r.getMonth()+1,"d+":r.getDate(),"h+":r.getHours(),"m+":r.getMinutes(),"s+":r.getSeconds(),"q+":Math.floor((r.getMonth()+3)/3),S:r.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(r.getFullYear()+"").substr(4-RegExp.$1.length)));for(let i in e)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,RegExp.$1.length==1?e[i]:("00"+e[i]).substr((""+e[i]).length)));return t},cbIntegrationCallBack(r){const{responseMsg:t,responseMsg:e}=r;t.type===6&&(this.videoTotal=this.multipPointsArr.length,this.currentPage=1,this.selectAll=this.multipPointsArr,this.layoutMode=t.msg.layout,this.pageSize=t.msg.wndNum,this.selectAll=this.chunkArray(this.selectAll,t.msg.wndNum),this.currentArr=[...this.selectAll[this.currentPage-1]],this.oWebControl.JS_Disconnect().then(()=>{this.initPlugin()},()=>{})),t.type===7&&this.closeVideo()},showPluginDownloadDialog(){gt.ElMessageBox.alert("播放视频需要下载插件","提示",{confirmButtonText:"下载插件",cancelButtonText:"取消",type:"info",showCancelButton:!0}).then(()=>{deleteSysMenu(row.id).then(()=>{this.downloadPlugin(),this.showLoading.close(),gt.ElMessage({type:"success",message:"下载插件成功"})})}).catch(()=>{this.closeVideo(),this.showLoading.close()})},downloadPlugin(){try{const r=this.baseUrl+"static/VideoWebPlugin.exe",t=document.createElement("a");t.href=r,t.download="VideoWebPlugin.exe",t.style.display="none",document.body.appendChild(t),t.click(),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),this.closeVideo()},100)}catch{this.closeVideo()}}}},ye={ref:"playWnd",id:"playWnd",class:"playWnd"};function me(r,t,e,i,n,s){return Z.withDirectives((Z.openBlock(),Z.createElementBlock("div",ye,null,512)),[[Z.vShow,!e.isFullScreen]])}const z=Ot._export_sfc(ve,[["render",me]]);z.install=r=>{r.component(z.name,z)};exports.GPluginVideo=z;exports.default=z;
14
+ `,e+="-----END PUBLIC KEY-----",e},t.hasPublicKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t})(Se),yt,De=typeof process<"u"?(yt=process.env)===null||yt===void 0?void 0:yt.npm_package_version:void 0,xe=(function(){function r(t){t===void 0&&(t={}),this.default_key_size=t.default_key_size?parseInt(t.default_key_size,10):1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=t.key||null}return r.prototype.setKey=function(t){t?(this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new _t(t)):!this.key&&this.log&&console.error("A key was not set.")},r.prototype.setPrivateKey=function(t){this.setKey(t)},r.prototype.setPublicKey=function(t){this.setKey(t)},r.prototype.decrypt=function(t){try{return this.getKey().decrypt(xt(t))}catch{return!1}},r.prototype.encrypt=function(t){try{return et(this.getKey().encrypt(t))}catch{return!1}},r.prototype.encryptOAEP=function(t){try{return et(this.getKey().encrypt(t,me))}catch{return!1}},r.prototype.sign=function(t,e,i){e===void 0&&(e=function(n){return n}),i===void 0&&(i="");try{return et(this.getKey().sign(t,e,i))}catch{return!1}},r.prototype.signSha256=function(t){return this.sign(t,function(e){return Nt(Tt(e))},"sha256")},r.prototype.verify=function(t,e,i){i===void 0&&(i=function(n){return n});try{return this.getKey().verify(t,xt(e),i)}catch{return!1}},r.prototype.verifySha256=function(t,e){return this.verify(t,e,function(i){return Nt(Tt(i))})},r.prototype.getKey=function(t){if(!this.key){if(this.key=new _t,t&&{}.toString.call(t)==="[object Function]"){this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);return}this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},r.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},r.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},r.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},r.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},r.version=De,r})();const Re={id:"playWnd",class:"playWnd"},Mt=3,Ct=3e3,mt="插件未启动,正在尝试启动,请稍候...",ft="插件启动失败,请检查插件是否安装!",it=Object.assign({name:"GPluginVideo"},{__name:"index",props:{isPlayVideo:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},cameraIndexCode:{type:String,default:""},currentPlayType:{type:Number,default:0},baseUrl:{type:String,default:"http://92.97.137.81:48181"},usefullData:{type:Object,default:()=>({appkey:"24460774",secret:"vphyI4pTqEVk4lT67jVe",ip:"61.27.16.15",port:443})},size:{type:Object,default:()=>({windowWidth:300,windowHeight:200})},isMulTip:{type:Boolean,default:!1},multipPointsArr:{type:Array,default:()=>[]},happenedTime:{type:String,default:""}},emits:["closeVideoEmit"],setup(r,{expose:t,emit:e}){const i=r,n=e,s=E.ref(null),o=E.ref(0),a=E.ref(""),h=E.ref(""),f=E.ref("1x1"),l=E.ref(0),c=E.ref([]),v=E.ref(1),p=E.ref([]),T=E.ref(0);function b(){return new Promise((m,d)=>{if(window.WebControl){m();return}Promise.resolve().then(()=>require("../web-control.esm.min-DLrkEUOV.js")).then(B=>{window.WebControl=B.WebControl,console.log("web-control.esm.min.js加载成功"),m()}).catch(B=>{console.error("web-control.esm.min.js加载失败",B),d(new Error("加载web-control.esm.min.js失败"))})})}function R(m){const d=new Date(Number(m));return d.setMinutes(d.getMinutes()-1),d.getTime()}function q(m){const d=new Date(Number(m));return d.setMinutes(d.getMinutes()+1),d.getTime()}function I(m,d){const B=[];for(let W=0;W<m.length;W+=d)B.push(m.slice(W,W+d));return B}function F(m){const d=new xe;return d.setPublicKey(a.value),d.encrypt(m)}function N(){n("closeVideoEmit"),s.value!==null&&(s.value.JS_RequestInterface({funcName:"stopAllPreview"}),s.value.JS_HideWnd(),s.value.JS_Disconnect().then(()=>{},()=>{}))}function rt(){s.value&&(s.value.JS_RequestInterface({funcName:"stopAllPreview"}),s.value.JS_HideWnd(),s.value.JS_RequestInterface({funcName:"destroyWnd"}))}function y(m){s.value.JS_RequestInterface({funcName:"getRSAPubKey",argument:JSON.stringify({keyLength:1024})}).then(d=>{d.responseMsg.data&&(a.value=d.responseMsg.data,m())})}function k(){let m=i.cameraIndexCode.trim();s.value.JS_RequestInterface({funcName:"startPreview",argument:JSON.stringify({cameraIndexCode:m,streamMode:0,transMode:1,gpuMode:0,wndId:-1})})}function L(){let m=i.cameraIndexCode,d="",B="";i.happenedTime?(d=R(i.happenedTime),B=q(i.happenedTime)):(d=Date.now()-1440*60*1e3,B=Date.now()),s.value.JS_RequestInterface({funcName:"startPlayback",argument:JSON.stringify({cameraIndexCode:m,startTimeStamp:Math.floor(d/1e3).toString(),endTimeStamp:Math.floor(B/1e3).toString(),recordLocation:1,transMode:1,gpuMode:0,wndId:-1})})}function M(){const m=p.value.map((d,B)=>({cameraIndexCode:d.indexCode.trim(),gpuMode:0,streamMode:0,transMode:1,wndId:B+1}));s.value.JS_RequestInterface({funcName:"startMultiPreviewByCameraIndexCode",argument:JSON.stringify({list:m})})}function J(){let m="",d="";i.happenedTime?(m=R(i.happenedTime),d=q(i.happenedTime)):(m=Date.now()-1440*60*1e3,d=Date.now());const B=p.value.map((W,Kt)=>({startTimeStamp:Math.floor(m/1e3).toString(),endTimeStamp:Math.floor(d/1e3).toString(),cameraIndexCode:W.indexCode.trim(),gpuMode:0,streamMode:0,transMode:1,wndId:Kt+1}));s.value.JS_RequestInterface({funcName:"startMultiPlaybackByCameraIndexCode",argument:JSON.stringify({list:B})})}function V(){y(()=>{s.value.JS_RequestInterface({funcName:"init",argument:JSON.stringify({appkey:i.usefullData.appkey,secret:F(i.usefullData.secret),ip:i.usefullData.ip,playMode:i.currentPlayType,port:i.usefullData.port,snapDir:"D:\\SnapDir",videoDir:"D:\\VideoDir",layout:f.value,enableHTTPS:1,encryptedFields:"secret",showToolbar:1,showSmart:0,buttonIDs:"0,256,257,258,259,260,512,513,514,515,516,517,768,769"})}).then(()=>{s.value.JS_Resize(i.size.windowWidth,i.size.windowHeight),i.isMulTip?i.currentPlayType===1?J():M():i.currentPlayType===1?L():k()}),i.isFullScreen&&s.value.JS_RequestInterface({funcName:"setFullScreen"})})}function dt(m){const{responseMsg:d}=m;d.type===6&&(l.value=i.multipPointsArr.length,v.value=1,c.value=i.multipPointsArr,f.value=d.msg.layout,T.value=d.msg.wndNum,c.value=I(c.value,d.msg.wndNum),p.value=[...c.value[v.value-1]],s.value.JS_Disconnect().then(()=>{P()},()=>{})),d.type===7&&N()}function P(){s.value=new window.WebControl({szPluginContainer:"playWnd",iServicePortStart:15900,iServicePortEnd:15900,szClassId:"23BF3B0A-2C56-4D97-9C03-0CB103AA8F11",cbConnectSuccess:()=>{s.value.JS_StartService("window",{dllPath:"./VideoPluginConnect.dll"}).then(()=>{s.value.JS_SetWindowControlCallback({cbIntegrationCallBack:dt}),s.value.JS_CreateWnd("playWnd",i.size.windowWidth,i.size.windowHeight).then(()=>{V()})})},cbConnectError:()=>{s.value=null,Q.ElMessage.error(mt),h.value=mt,window.WebControl.JS_WakeUp("VideoWebPlugin://"),o.value++,o.value<Mt?setTimeout(()=>P(),Ct):(Q.ElMessage.error(ft),h.value=ft)},cbConnectClose:m=>{m||(s.value=null,h.value=mt,o.value++,o.value<Mt?setTimeout(()=>P(),Ct):(Q.ElMessage.error(ft),h.value=ft))}})}function wt(){Q.ElMessageBox.alert("播放视频需要下载插件","提示",{confirmButtonText:"下载插件",cancelButtonText:"取消",type:"info",showCancelButton:!0}).then(()=>{Lt(),Q.ElMessage({type:"success",message:"下载插件成功"})}).catch(()=>{N()})}function Lt(){try{const m=i.baseUrl+"static/VideoWebPlugin.exe",d=document.createElement("a");d.href=m,d.download="VideoWebPlugin.exe",d.style.display="none",document.body.appendChild(d),d.click(),setTimeout(()=>{d.parentNode&&d.parentNode.removeChild(d),N()},100)}catch{N()}}function jt(){i.isMulTip&&(T.value=4,l.value=i.multipPointsArr.length,f.value=l.value<=1?"1x1":"2x2",c.value=I(i.multipPointsArr,4),p.value=[...c.value[v.value-1]])}return E.watch(()=>i.isPlayVideo,m=>{m===!1&&N()}),E.watch(()=>i.happenedTime,()=>{J()}),E.watch(()=>i.cameraIndexCode,(m,d)=>{m!==d&&(rt(),s.value.JS_Disconnect().then(()=>{P()},()=>{}))}),E.watch(h,m=>{m!==""&&wt()}),E.onMounted(()=>{jt(),b().then(()=>{i.isPlayVideo&&P()}).catch(()=>{wt()})}),E.onBeforeUnmount(()=>{s.value&&(s.value.JS_RequestInterface({funcName:"stopAllPreview"}),s.value.JS_HideWnd(),s.value.JS_RequestInterface({funcName:"destroyWnd"}))}),t({closeVideo:N,initPlugin:P,startPlay:k,startPlayback:L,startMultiPreview:M,startMultiPlayback:J}),(m,d)=>E.withDirectives((E.openBlock(),E.createElementBlock("div",Re,null,512)),[[E.vShow,!r.isFullScreen]])}});it.install=r=>{r.component(it.name,it)};exports.GPluginVideo=it;exports.default=it;