fhj-tools-v3 1.1.73 → 1.1.75
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.
- package/fhj-tools.cjs.js +1 -1
- package/fhj-tools.es.js +10 -1
- package/fhj-tools.umd.js +1 -1
- package/package.json +1 -1
package/fhj-tools.cjs.js
CHANGED
|
@@ -30,7 +30,7 @@ version: 2.9.0
|
|
|
30
30
|
* @since jsrsasign 2.1
|
|
31
31
|
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
32
32
|
*/
|
|
33
|
-
var KJUR={};void 0!==KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(A){var t=A.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(A){var t=A.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var e="",i=0;i<r;i++)e+="f";t=new BigInteger(e,16).xor(A).add(BigInteger.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(A,t){return hextopem(A,t)},this.newObject=function(A){var t=KJUR.asn1,r=t.DERBoolean,e=t.DERInteger,i=t.DERBitString,s=t.DEROctetString,g=t.DERNull,a=t.DERObjectIdentifier,B=t.DEREnumerated,n=t.DERUTF8String,o=t.DERNumericString,V=t.DERPrintableString,I=t.DERTeletexString,E=t.DERIA5String,C=t.DERUTCTime,W=t.DERGeneralizedTime,u=t.DERSequence,q=t.DERSet,l=t.DERTaggedObject,Q=t.ASN1Util.newObject,c=Object.keys(A);if(1!=c.length)throw"key of param shall be only one.";var k=c[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+k+":"))throw"undefined key: "+k;if("bool"==k)return new r(A[k]);if("int"==k)return new e(A[k]);if("bitstr"==k)return new i(A[k]);if("octstr"==k)return new s(A[k]);if("null"==k)return new g(A[k]);if("oid"==k)return new a(A[k]);if("enum"==k)return new B(A[k]);if("utf8str"==k)return new n(A[k]);if("numstr"==k)return new o(A[k]);if("prnstr"==k)return new V(A[k]);if("telstr"==k)return new I(A[k]);if("ia5str"==k)return new E(A[k]);if("utctime"==k)return new C(A[k]);if("gentime"==k)return new W(A[k]);if("seq"==k){for(var d=A[k],Y=[],w=0;w<d.length;w++){var x=Q(d[w]);Y.push(x)}return new u({array:Y})}if("set"==k){for(d=A[k],Y=[],w=0;w<d.length;w++){x=Q(d[w]);Y.push(x)}return new q({array:Y})}if("tag"==k){var y=A[k];if("[object Array]"===Object.prototype.toString.call(y)&&3==y.length){var S=Q(y[2]);return new l({tag:y[0],explicit:y[1],obj:S})}var D={};if(void 0!==y.explicit&&(D.explicit=y.explicit),void 0!==y.tag&&(D.tag=y.tag),void 0===y.obj)throw"obj shall be specified for 'tag'.";return D.obj=Q(y.obj),new l(D)}},this.jsonToASN1HEX=function(A){return this.newObject(A).getEncodedHex()}},KJUR.asn1.ASN1Util.oidHexToInt=function(A){for(var t="",r=parseInt(A.substr(0,2),16),e=(t=Math.floor(r/40)+"."+r%40,""),i=2;i<A.length;i+=2){var s=("00000000"+parseInt(A.substr(i,2),16).toString(2)).slice(-8);if(e+=s.substr(1,7),"0"==s.substr(0,1))t=t+"."+new BigInteger(e,2).toString(10),e=""}return t},KJUR.asn1.ASN1Util.oidIntToHex=function(A){var t=function(A){var t=A.toString(16);return 1==t.length&&(t="0"+t),t},r=function(A){var r="",e=new BigInteger(A,10).toString(2),i=7-e.length%7;7==i&&(i=0);for(var s="",g=0;g<i;g++)s+="0";e=s+e;for(g=0;g<e.length-1;g+=7){var a=e.substr(g,7);g!=e.length-7&&(a="1"+a),r+=t(parseInt(a,2))}return r};if(!A.match(/^[0-9.]+$/))throw"malformed oid string: "+A;var e="",i=A.split("."),s=40*parseInt(i[0])+parseInt(i[1]);e+=t(s),i.splice(0,2);for(var g=0;g<i.length;g++)e+=r(i[g]);return e},KJUR.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n=0,v="+this.hV;var A=this.hV.length/2,t=A.toString(16);if(t.length%2==1&&(t="0"+t),A<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+A.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},KJUR.asn1.DERAbstractString=function(A){KJUR.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(A){this.hTLV=null,this.isModified=!0,this.s=A,this.hV=stohex(this.s)},this.setStringHex=function(A){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=A},this.getFreshValueHex=function(){return this.hV},void 0!==A&&("string"==typeof A?this.setString(A):void 0!==A.str?this.setString(A.str):void 0!==A.hex&&this.setStringHex(A.hex))},YAHOO.lang.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractTime=function(A){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(A){return utc=A.getTime()+6e4*A.getTimezoneOffset(),new Date(utc)},this.formatDate=function(A,t,r){var e=this.zeroPadding,i=this.localDateToUTC(A),s=String(i.getFullYear());"utc"==t&&(s=s.substr(2,2));var g=s+e(String(i.getMonth()+1),2)+e(String(i.getDate()),2)+e(String(i.getHours()),2)+e(String(i.getMinutes()),2)+e(String(i.getSeconds()),2);if(!0===r){var a=i.getMilliseconds();if(0!=a){var B=e(String(a),3);g=g+"."+(B=B.replace(/[0]+$/,""))}}return g+"Z"},this.zeroPadding=function(A,t){return A.length>=t?A:new Array(t-A.length+1).join("0")+A},this.getString=function(){return this.s},this.setString=function(A){this.hTLV=null,this.isModified=!0,this.s=A,this.hV=stohex(A)},this.setByDateValue=function(A,t,r,e,i,s){var g=new Date(Date.UTC(A,t-1,r,e,i,s,0));this.setByDate(g)},this.getFreshValueHex=function(){return this.hV}},YAHOO.lang.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractStructured=function(A){KJUR.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(A){this.hTLV=null,this.isModified=!0,this.asn1Array=A},this.appendASN1Object=function(A){this.hTLV=null,this.isModified=!0,this.asn1Array.push(A)},this.asn1Array=new Array,void 0!==A&&void 0!==A.array&&(this.asn1Array=A.array)},YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object),KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object),KJUR.asn1.DERInteger=function(A){KJUR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(A){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(A)},this.setByInteger=function(A){var t=new BigInteger(String(A),10);this.setByBigInteger(t)},this.setValueHex=function(A){this.hV=A},this.getFreshValueHex=function(){return this.hV},void 0!==A&&(void 0!==A.bigint?this.setByBigInteger(A.bigint):void 0!==A.int?this.setByInteger(A.int):"number"==typeof A?this.setByInteger(A):void 0!==A.hex&&this.setValueHex(A.hex))},YAHOO.lang.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object),KJUR.asn1.DERBitString=function(A){if(void 0!==A&&void 0!==A.obj){var t=KJUR.asn1.ASN1Util.newObject(A.obj);A.hex="00"+t.getEncodedHex()}KJUR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(A){this.hTLV=null,this.isModified=!0,this.hV=A},this.setUnusedBitsAndHexValue=function(A,t){if(A<0||7<A)throw"unused bits shall be from 0 to 7: u = "+A;var r="0"+A;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(A){var t=8-(A=A.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)A+="0";var e="";for(r=0;r<A.length-1;r+=8){var i=A.substr(r,8),s=parseInt(i,2).toString(16);1==s.length&&(s="0"+s),e+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+t+e},this.setByBooleanArray=function(A){for(var t="",r=0;r<A.length;r++)1==A[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(A){for(var t=new Array(A),r=0;r<A;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==A&&("string"==typeof A&&A.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(A):void 0!==A.hex?this.setHexValueIncludingUnusedBits(A.hex):void 0!==A.bin?this.setByBinaryString(A.bin):void 0!==A.array&&this.setByBooleanArray(A.array))},YAHOO.lang.extend(KJUR.asn1.DERBitString,KJUR.asn1.ASN1Object),KJUR.asn1.DEROctetString=function(A){if(void 0!==A&&void 0!==A.obj){var t=KJUR.asn1.ASN1Util.newObject(A.obj);A.hex=t.getEncodedHex()}KJUR.asn1.DEROctetString.superclass.constructor.call(this,A),this.hT="04"},YAHOO.lang.extend(KJUR.asn1.DEROctetString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNull=function(){KJUR.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},YAHOO.lang.extend(KJUR.asn1.DERNull,KJUR.asn1.ASN1Object),KJUR.asn1.DERObjectIdentifier=function(A){var t=function(A){var t=A.toString(16);return 1==t.length&&(t="0"+t),t},r=function(A){var r="",e=new BigInteger(A,10).toString(2),i=7-e.length%7;7==i&&(i=0);for(var s="",g=0;g<i;g++)s+="0";e=s+e;for(g=0;g<e.length-1;g+=7){var a=e.substr(g,7);g!=e.length-7&&(a="1"+a),r+=t(parseInt(a,2))}return r};KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(A){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=A},this.setValueOidString=function(A){if(!A.match(/^[0-9.]+$/))throw"malformed oid string: "+A;var e="",i=A.split("."),s=40*parseInt(i[0])+parseInt(i[1]);e+=t(s),i.splice(0,2);for(var g=0;g<i.length;g++)e+=r(i[g]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(A){var t=KJUR.asn1.x509.OID.name2oid(A);if(""===t)throw"DERObjectIdentifier oidName undefined: "+A;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==A&&("string"==typeof A?A.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(A):this.setValueName(A):void 0!==A.oid?this.setValueOidString(A.oid):void 0!==A.hex?this.setValueHex(A.hex):void 0!==A.name&&this.setValueName(A.name))},YAHOO.lang.extend(KJUR.asn1.DERObjectIdentifier,KJUR.asn1.ASN1Object),KJUR.asn1.DEREnumerated=function(A){KJUR.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(A){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(A)},this.setByInteger=function(A){var t=new BigInteger(String(A),10);this.setByBigInteger(t)},this.setValueHex=function(A){this.hV=A},this.getFreshValueHex=function(){return this.hV},void 0!==A&&(void 0!==A.int?this.setByInteger(A.int):"number"==typeof A?this.setByInteger(A):void 0!==A.hex&&this.setValueHex(A.hex))},YAHOO.lang.extend(KJUR.asn1.DEREnumerated,KJUR.asn1.ASN1Object),KJUR.asn1.DERUTF8String=function(A){KJUR.asn1.DERUTF8String.superclass.constructor.call(this,A),this.hT="0c"},YAHOO.lang.extend(KJUR.asn1.DERUTF8String,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNumericString=function(A){KJUR.asn1.DERNumericString.superclass.constructor.call(this,A),this.hT="12"},YAHOO.lang.extend(KJUR.asn1.DERNumericString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERPrintableString=function(A){KJUR.asn1.DERPrintableString.superclass.constructor.call(this,A),this.hT="13"},YAHOO.lang.extend(KJUR.asn1.DERPrintableString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERTeletexString=function(A){KJUR.asn1.DERTeletexString.superclass.constructor.call(this,A),this.hT="14"},YAHOO.lang.extend(KJUR.asn1.DERTeletexString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERIA5String=function(A){KJUR.asn1.DERIA5String.superclass.constructor.call(this,A),this.hT="16"},YAHOO.lang.extend(KJUR.asn1.DERIA5String,KJUR.asn1.DERAbstractString),KJUR.asn1.DERUTCTime=function(A){KJUR.asn1.DERUTCTime.superclass.constructor.call(this,A),this.hT="17",this.setByDate=function(A){this.hTLV=null,this.isModified=!0,this.date=A,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==A&&(void 0!==A.str?this.setString(A.str):"string"==typeof A&&A.match(/^[0-9]{12}Z$/)?this.setString(A):void 0!==A.hex?this.setStringHex(A.hex):void 0!==A.date&&this.setByDate(A.date))},YAHOO.lang.extend(KJUR.asn1.DERUTCTime,KJUR.asn1.DERAbstractTime),KJUR.asn1.DERGeneralizedTime=function(A){KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this,A),this.hT="18",this.withMillis=!1,this.setByDate=function(A){this.hTLV=null,this.isModified=!0,this.date=A,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==A&&(void 0!==A.str?this.setString(A.str):"string"==typeof A&&A.match(/^[0-9]{14}Z$/)?this.setString(A):void 0!==A.hex?this.setStringHex(A.hex):void 0!==A.date&&this.setByDate(A.date),!0===A.millis&&(this.withMillis=!0))},YAHOO.lang.extend(KJUR.asn1.DERGeneralizedTime,KJUR.asn1.DERAbstractTime),KJUR.asn1.DERSequence=function(A){KJUR.asn1.DERSequence.superclass.constructor.call(this,A),this.hT="30",this.getFreshValueHex=function(){for(var A="",t=0;t<this.asn1Array.length;t++){A+=this.asn1Array[t].getEncodedHex()}return this.hV=A,this.hV}},YAHOO.lang.extend(KJUR.asn1.DERSequence,KJUR.asn1.DERAbstractStructured),KJUR.asn1.DERSet=function(A){KJUR.asn1.DERSet.superclass.constructor.call(this,A),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var A=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];A.push(r.getEncodedHex())}return 1==this.sortFlag&&A.sort(),this.hV=A.join(""),this.hV},void 0!==A&&void 0!==A.sortflag&&0==A.sortflag&&(this.sortFlag=!1)},YAHOO.lang.extend(KJUR.asn1.DERSet,KJUR.asn1.DERAbstractStructured),KJUR.asn1.DERTaggedObject=function(A){KJUR.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(A,t,r){this.hT=t,this.isExplicit=A,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==A&&(void 0!==A.tag&&(this.hT=A.tag),void 0!==A.explicit&&(this.isExplicit=A.explicit),void 0!==A.obj&&(this.asn1Object=A.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},YAHOO.lang.extend(KJUR.asn1.DERTaggedObject,KJUR.asn1.ASN1Object);var _a$1,hasRequiredJsbn,asn1,hasRequiredAsn1,ec,hasRequiredEc,utils$2,hasRequiredUtils,sm3_1$1,hasRequiredSm3$1,sm2,hasRequiredSm2,sm3_1,hasRequiredSm3,sm4_1,hasRequiredSm4,src,hasRequiredSrc,__extends=function(){var A=function(t,r){return(A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,t){A.__proto__=t}||function(A,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(A[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function e(){this.constructor=t}A(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}}(),JSEncryptRSAKey=function(A){function t(r){var e=A.call(this)||this;return r&&("string"==typeof r?e.parseKey(r):(t.hasPrivateKeyProperty(r)||t.hasPublicKeyProperty(r))&&e.parsePropertiesFrom(r)),e}return __extends(t,A),t.prototype.parseKey=function(A){try{var t=0,r=0,e=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(A)?Hex_decode(A):Base64.unarmor(A),i=ASN1.decode(e);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=parseBigInt(t,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var s=i.sub[3].getHexStringValue();this.d=parseBigInt(s,16);var g=i.sub[4].getHexStringValue();this.p=parseBigInt(g,16);var a=i.sub[5].getHexStringValue();this.q=parseBigInt(a,16);var B=i.sub[6].getHexStringValue();this.dmp1=parseBigInt(B,16);var n=i.sub[7].getHexStringValue();this.dmq1=parseBigInt(n,16);var o=i.sub[8].getHexStringValue();this.coeff=parseBigInt(o,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var V=i.sub[1].sub[0];t=V.sub[0].getHexStringValue(),this.n=parseBigInt(t,16),r=V.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=i.sub[0].getHexStringValue(),this.n=parseBigInt(t,16),r=i.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(I){return!1}},t.prototype.getPrivateBaseKey=function(){var A={array:[new KJUR.asn1.DERInteger({int:0}),new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({int:this.e}),new KJUR.asn1.DERInteger({bigint:this.d}),new KJUR.asn1.DERInteger({bigint:this.p}),new KJUR.asn1.DERInteger({bigint:this.q}),new KJUR.asn1.DERInteger({bigint:this.dmp1}),new KJUR.asn1.DERInteger({bigint:this.dmq1}),new KJUR.asn1.DERInteger({bigint:this.coeff})]};return new KJUR.asn1.DERSequence(A).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return hex2b64(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var A=new KJUR.asn1.DERSequence({array:[new KJUR.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new KJUR.asn1.DERNull]}),t=new KJUR.asn1.DERSequence({array:[new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({int:this.e})]}),r=new KJUR.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new KJUR.asn1.DERSequence({array:[A,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return hex2b64(this.getPublicBaseKey())},t.wordwrap=function(A,t){if(!A)return A;var r="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return A.match(RegExp(r,"g")).join("\n")},t.prototype.getPrivateKey=function(){var A="-----BEGIN RSA PRIVATE KEY-----\n";return A+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n",A+="-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var A="-----BEGIN PUBLIC KEY-----\n";return A+=t.wordwrap(this.getPublicBaseKeyB64())+"\n",A+="-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(A){return(A=A||{}).hasOwnProperty("n")&&A.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(A){return(A=A||{}).hasOwnProperty("n")&&A.hasOwnProperty("e")&&A.hasOwnProperty("d")&&A.hasOwnProperty("p")&&A.hasOwnProperty("q")&&A.hasOwnProperty("dmp1")&&A.hasOwnProperty("dmq1")&&A.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(A){this.n=A.n,this.e=A.e,A.hasOwnProperty("d")&&(this.d=A.d,this.p=A.p,this.q=A.q,this.dmp1=A.dmp1,this.dmq1=A.dmq1,this.coeff=A.coeff)},t}(RSAKey),version$1="undefined"!=typeof process?null===(_a$1=process.env)||void 0===_a$1?void 0:_a$1.npm_package_version:void 0,JSEncrypt=function(){function A(A){void 0===A&&(A={}),A=A||{},this.default_key_size=A.default_key_size?parseInt(A.default_key_size,10):1024,this.default_public_exponent=A.default_public_exponent||"010001",this.log=A.log||!1,this.key=null}return A.prototype.setKey=function(A){this.log&&this.key,this.key=new JSEncryptRSAKey(A)},A.prototype.setPrivateKey=function(A){this.setKey(A)},A.prototype.setPublicKey=function(A){this.setKey(A)},A.prototype.decrypt=function(A){try{return this.getKey().decrypt(b64tohex(A))}catch(t){return!1}},A.prototype.encrypt=function(A){try{return hex2b64(this.getKey().encrypt(A))}catch(t){return!1}},A.prototype.sign=function(A,t,r){try{return hex2b64(this.getKey().sign(A,t,r))}catch(e){return!1}},A.prototype.verify=function(A,t,r){try{return this.getKey().verify(A,b64tohex(t),r)}catch(e){return!1}},A.prototype.getKey=function(A){if(!this.key){if(this.key=new JSEncryptRSAKey,A&&"[object Function]"==={}.toString.call(A))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,A);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},A.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},A.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},A.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},A.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},A.version=version$1,A}(),jsbn$1={exports:{}},jsbn=jsbn$1.exports;function requireJsbn(){return hasRequiredJsbn||(hasRequiredJsbn=1,A=jsbn$1,function(){var t;function r(A,t,r){null!=A&&("number"==typeof A?this.fromNumber(A,t,r):null==t&&"string"!=typeof A?this.fromString(A,256):this.fromString(A,t))}function e(){return new r(null)}var i="undefined"!=typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(A,t,r,e,i,s){for(var g=32767&t,a=t>>15;--s>=0;){var B=32767&this[A],n=this[A++]>>15,o=a*B+n*g;i=((B=g*B+((32767&o)<<15)+r[e]+(1073741823&i))>>>30)+(o>>>15)+a*n+(i>>>30),r[e++]=1073741823&B}return i},t=30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(A,t,r,e,i,s){for(;--s>=0;){var g=t*this[A++]+r[e]+i;i=Math.floor(g/67108864),r[e++]=67108863&g}return i},t=26):(r.prototype.am=function(A,t,r,e,i,s){for(var g=16383&t,a=t>>14;--s>=0;){var B=16383&this[A],n=this[A++]>>14,o=a*B+n*g;i=((B=g*B+((16383&o)<<14)+r[e]+i)>>28)+(o>>14)+a*n,r[e++]=268435455&B}return i},t=28),r.prototype.DB=t,r.prototype.DM=(1<<t)-1,r.prototype.DV=1<<t,r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-t,r.prototype.F2=2*t-52;var s,g,a=new Array;for(s="0".charCodeAt(0),g=0;g<=9;++g)a[s++]=g;for(s="a".charCodeAt(0),g=10;g<36;++g)a[s++]=g;for(s="A".charCodeAt(0),g=10;g<36;++g)a[s++]=g;function B(A){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(A)}function n(A,t){var r=a[A.charCodeAt(t)];return null==r?-1:r}function o(A){var t=e();return t.fromInt(A),t}function V(A){var t,r=1;return 0!=(t=A>>>16)&&(A=t,r+=16),0!=(t=A>>8)&&(A=t,r+=8),0!=(t=A>>4)&&(A=t,r+=4),0!=(t=A>>2)&&(A=t,r+=2),0!=(t=A>>1)&&(A=t,r+=1),r}function I(A){this.m=A}function E(A){this.m=A,this.mp=A.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<A.DB-15)-1,this.mt2=2*A.t}function C(A,t){return A&t}function W(A,t){return A|t}function u(A,t){return A^t}function q(A,t){return A&~t}function l(A){if(0==A)return-1;var t=0;return 65535&A||(A>>=16,t+=16),255&A||(A>>=8,t+=8),15&A||(A>>=4,t+=4),3&A||(A>>=2,t+=2),1&A||++t,t}function Q(A){for(var t=0;0!=A;)A&=A-1,++t;return t}function c(){}function k(A){return A}function d(A){this.r2=e(),this.q3=e(),r.ONE.dlShiftTo(2*A.t,this.r2),this.mu=this.r2.divide(A),this.m=A}I.prototype.convert=function(A){return A.s<0||A.compareTo(this.m)>=0?A.mod(this.m):A},I.prototype.revert=function(A){return A},I.prototype.reduce=function(A){A.divRemTo(this.m,null,A)},I.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r),this.reduce(r)},I.prototype.sqrTo=function(A,t){A.squareTo(t),this.reduce(t)},E.prototype.convert=function(A){var t=e();return A.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),A.s<0&&t.compareTo(r.ZERO)>0&&this.m.subTo(t,t),t},E.prototype.revert=function(A){var t=e();return A.copyTo(t),this.reduce(t),t},E.prototype.reduce=function(A){for(;A.t<=this.mt2;)A[A.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&A[t],e=r*this.mpl+((r*this.mph+(A[t]>>15)*this.mpl&this.um)<<15)&A.DM;for(A[r=t+this.m.t]+=this.m.am(0,e,A,t,0,this.m.t);A[r]>=A.DV;)A[r]-=A.DV,A[++r]++}A.clamp(),A.drShiftTo(this.m.t,A),A.compareTo(this.m)>=0&&A.subTo(this.m,A)},E.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r),this.reduce(r)},E.prototype.sqrTo=function(A,t){A.squareTo(t),this.reduce(t)},r.prototype.copyTo=function(A){for(var t=this.t-1;t>=0;--t)A[t]=this[t];A.t=this.t,A.s=this.s},r.prototype.fromInt=function(A){this.t=1,this.s=A<0?-1:0,A>0?this[0]=A:A<-1?this[0]=A+this.DV:this.t=0},r.prototype.fromString=function(A,t){var e;if(16==t)e=4;else if(8==t)e=3;else if(256==t)e=8;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return void this.fromRadix(A,t);e=2}this.t=0,this.s=0;for(var i=A.length,s=!1,g=0;--i>=0;){var a=8==e?255&A[i]:n(A,i);a<0?"-"==A.charAt(i)&&(s=!0):(s=!1,0==g?this[this.t++]=a:g+e>this.DB?(this[this.t-1]|=(a&(1<<this.DB-g)-1)<<g,this[this.t++]=a>>this.DB-g):this[this.t-1]|=a<<g,(g+=e)>=this.DB&&(g-=this.DB))}8==e&&128&A[0]&&(this.s=-1,g>0&&(this[this.t-1]|=(1<<this.DB-g)-1<<g)),this.clamp(),s&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var A=this.s&this.DM;this.t>0&&this[this.t-1]==A;)--this.t},r.prototype.dlShiftTo=function(A,t){var r;for(r=this.t-1;r>=0;--r)t[r+A]=this[r];for(r=A-1;r>=0;--r)t[r]=0;t.t=this.t+A,t.s=this.s},r.prototype.drShiftTo=function(A,t){for(var r=A;r<this.t;++r)t[r-A]=this[r];t.t=Math.max(this.t-A,0),t.s=this.s},r.prototype.lShiftTo=function(A,t){var r,e=A%this.DB,i=this.DB-e,s=(1<<i)-1,g=Math.floor(A/this.DB),a=this.s<<e&this.DM;for(r=this.t-1;r>=0;--r)t[r+g+1]=this[r]>>i|a,a=(this[r]&s)<<e;for(r=g-1;r>=0;--r)t[r]=0;t[g]=a,t.t=this.t+g+1,t.s=this.s,t.clamp()},r.prototype.rShiftTo=function(A,t){t.s=this.s;var r=Math.floor(A/this.DB);if(r>=this.t)t.t=0;else{var e=A%this.DB,i=this.DB-e,s=(1<<e)-1;t[0]=this[r]>>e;for(var g=r+1;g<this.t;++g)t[g-r-1]|=(this[g]&s)<<i,t[g-r]=this[g]>>e;e>0&&(t[this.t-r-1]|=(this.s&s)<<i),t.t=this.t-r,t.clamp()}},r.prototype.subTo=function(A,t){for(var r=0,e=0,i=Math.min(A.t,this.t);r<i;)e+=this[r]-A[r],t[r++]=e&this.DM,e>>=this.DB;if(A.t<this.t){for(e-=A.s;r<this.t;)e+=this[r],t[r++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;r<A.t;)e-=A[r],t[r++]=e&this.DM,e>>=this.DB;e-=A.s}t.s=e<0?-1:0,e<-1?t[r++]=this.DV+e:e>0&&(t[r++]=e),t.t=r,t.clamp()},r.prototype.multiplyTo=function(A,t){var e=this.abs(),i=A.abs(),s=e.t;for(t.t=s+i.t;--s>=0;)t[s]=0;for(s=0;s<i.t;++s)t[s+e.t]=e.am(0,i[s],t,s,0,e.t);t.s=0,t.clamp(),this.s!=A.s&&r.ZERO.subTo(t,t)},r.prototype.squareTo=function(A){for(var t=this.abs(),r=A.t=2*t.t;--r>=0;)A[r]=0;for(r=0;r<t.t-1;++r){var e=t.am(r,t[r],A,2*r,0,1);(A[r+t.t]+=t.am(r+1,2*t[r],A,2*r+1,e,t.t-r-1))>=t.DV&&(A[r+t.t]-=t.DV,A[r+t.t+1]=1)}A.t>0&&(A[A.t-1]+=t.am(r,t[r],A,2*r,0,1)),A.s=0,A.clamp()},r.prototype.divRemTo=function(A,t,i){var s=A.abs();if(!(s.t<=0)){var g=this.abs();if(g.t<s.t)return null!=t&&t.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=e());var a=e(),B=this.s,n=A.s,o=this.DB-V(s[s.t-1]);o>0?(s.lShiftTo(o,a),g.lShiftTo(o,i)):(s.copyTo(a),g.copyTo(i));var I=a.t,E=a[I-1];if(0!=E){var C=E*(1<<this.F1)+(I>1?a[I-2]>>this.F2:0),W=this.FV/C,u=(1<<this.F1)/C,q=1<<this.F2,l=i.t,Q=l-I,c=null==t?e():t;for(a.dlShiftTo(Q,c),i.compareTo(c)>=0&&(i[i.t++]=1,i.subTo(c,i)),r.ONE.dlShiftTo(I,c),c.subTo(a,a);a.t<I;)a[a.t++]=0;for(;--Q>=0;){var k=i[--l]==E?this.DM:Math.floor(i[l]*W+(i[l-1]+q)*u);if((i[l]+=a.am(0,k,i,Q,0,I))<k)for(a.dlShiftTo(Q,c),i.subTo(c,i);i[l]<--k;)i.subTo(c,i)}null!=t&&(i.drShiftTo(I,t),B!=n&&r.ZERO.subTo(t,t)),i.t=I,i.clamp(),o>0&&i.rShiftTo(o,i),B<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var A=this[0];if(!(1&A))return 0;var t=3&A;return(t=(t=(t=(t=t*(2-(15&A)*t)&15)*(2-(255&A)*t)&255)*(2-((65535&A)*t&65535))&65535)*(2-A*t%this.DV)%this.DV)>0?this.DV-t:-t},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(A,t){if(A>4294967295||A<1)return r.ONE;var i=e(),s=e(),g=t.convert(this),a=V(A)-1;for(g.copyTo(i);--a>=0;)if(t.sqrTo(i,s),(A&1<<a)>0)t.mulTo(s,g,i);else{var B=i;i=s,s=B}return t.revert(i)},r.prototype.toString=function(A){if(this.s<0)return"-"+this.negate().toString(A);var t;if(16==A)t=4;else if(8==A)t=3;else if(2==A)t=1;else if(32==A)t=5;else{if(4!=A)return this.toRadix(A);t=2}var r,e=(1<<t)-1,i=!1,s="",g=this.t,a=this.DB-g*this.DB%t;if(g-- >0)for(a<this.DB&&(r=this[g]>>a)>0&&(i=!0,s=B(r));g>=0;)a<t?(r=(this[g]&(1<<a)-1)<<t-a,r|=this[--g]>>(a+=this.DB-t)):(r=this[g]>>(a-=t)&e,a<=0&&(a+=this.DB,--g)),r>0&&(i=!0),i&&(s+=B(r));return i?s:"0"},r.prototype.negate=function(){var A=e();return r.ZERO.subTo(this,A),A},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(A){var t=this.s-A.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-A.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-A[r]))return t;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+V(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(A){var t=e();return this.abs().divRemTo(A,null,t),this.s<0&&t.compareTo(r.ZERO)>0&&A.subTo(t,t),t},r.prototype.modPowInt=function(A,t){var r;return r=A<256||t.isEven()?new I(t):new E(t),this.exp(A,r)},r.ZERO=o(0),r.ONE=o(1),c.prototype.convert=k,c.prototype.revert=k,c.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r)},c.prototype.sqrTo=function(A,t){A.squareTo(t)},d.prototype.convert=function(A){if(A.s<0||A.t>2*this.m.t)return A.mod(this.m);if(A.compareTo(this.m)<0)return A;var t=e();return A.copyTo(t),this.reduce(t),t},d.prototype.revert=function(A){return A},d.prototype.reduce=function(A){for(A.drShiftTo(this.m.t-1,this.r2),A.t>this.m.t+1&&(A.t=this.m.t+1,A.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);A.compareTo(this.r2)<0;)A.dAddOffset(1,this.m.t+1);for(A.subTo(this.r2,A);A.compareTo(this.m)>=0;)A.subTo(this.m,A)},d.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r),this.reduce(r)},d.prototype.sqrTo=function(A,t){A.squareTo(t),this.reduce(t)};var Y,w,x,y=[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],S=(1<<26)/y[y.length-1];function D(){var A;A=(new Date).getTime(),w[x++]^=255&A,w[x++]^=A>>8&255,w[x++]^=A>>16&255,w[x++]^=A>>24&255,x>=F&&(x-=F)}if(r.prototype.chunkSize=function(A){return Math.floor(Math.LN2*this.DB/Math.log(A))},r.prototype.toRadix=function(A){if(null==A&&(A=10),0==this.signum()||A<2||A>36)return"0";var t=this.chunkSize(A),r=Math.pow(A,t),i=o(r),s=e(),g=e(),a="";for(this.divRemTo(i,s,g);s.signum()>0;)a=(r+g.intValue()).toString(A).substr(1)+a,s.divRemTo(i,s,g);return g.intValue().toString(A)+a},r.prototype.fromRadix=function(A,t){this.fromInt(0),null==t&&(t=10);for(var e=this.chunkSize(t),i=Math.pow(t,e),s=!1,g=0,a=0,B=0;B<A.length;++B){var o=n(A,B);o<0?"-"==A.charAt(B)&&0==this.signum()&&(s=!0):(a=t*a+o,++g>=e&&(this.dMultiply(i),this.dAddOffset(a,0),g=0,a=0))}g>0&&(this.dMultiply(Math.pow(t,g)),this.dAddOffset(a,0)),s&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(A,t,e){if("number"==typeof t)if(A<2)this.fromInt(1);else for(this.fromNumber(A,e),this.testBit(A-1)||this.bitwiseTo(r.ONE.shiftLeft(A-1),W,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>A&&this.subTo(r.ONE.shiftLeft(A-1),this);else{var i=new Array,s=7&A;i.length=1+(A>>3),t.nextBytes(i),s>0?i[0]&=(1<<s)-1:i[0]=0,this.fromString(i,256)}},r.prototype.bitwiseTo=function(A,t,r){var e,i,s=Math.min(A.t,this.t);for(e=0;e<s;++e)r[e]=t(this[e],A[e]);if(A.t<this.t){for(i=A.s&this.DM,e=s;e<this.t;++e)r[e]=t(this[e],i);r.t=this.t}else{for(i=this.s&this.DM,e=s;e<A.t;++e)r[e]=t(i,A[e]);r.t=A.t}r.s=t(this.s,A.s),r.clamp()},r.prototype.changeBit=function(A,t){var e=r.ONE.shiftLeft(A);return this.bitwiseTo(e,t,e),e},r.prototype.addTo=function(A,t){for(var r=0,e=0,i=Math.min(A.t,this.t);r<i;)e+=this[r]+A[r],t[r++]=e&this.DM,e>>=this.DB;if(A.t<this.t){for(e+=A.s;r<this.t;)e+=this[r],t[r++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;r<A.t;)e+=A[r],t[r++]=e&this.DM,e>>=this.DB;e+=A.s}t.s=e<0?-1:0,e>0?t[r++]=e:e<-1&&(t[r++]=this.DV+e),t.t=r,t.clamp()},r.prototype.dMultiply=function(A){this[this.t]=this.am(0,A-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(A,t){if(0!=A){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=A;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},r.prototype.multiplyLowerTo=function(A,t,r){var e,i=Math.min(this.t+A.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(e=r.t-this.t;i<e;++i)r[i+this.t]=this.am(0,A[i],r,i,0,this.t);for(e=Math.min(A.t,t);i<e;++i)this.am(0,A[i],r,i,0,t-i);r.clamp()},r.prototype.multiplyUpperTo=function(A,t,r){--t;var e=r.t=this.t+A.t-t;for(r.s=0;--e>=0;)r[e]=0;for(e=Math.max(t-this.t,0);e<A.t;++e)r[this.t+e-t]=this.am(t-e,A[e],r,0,0,this.t+e-t);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function(A){if(A<=0)return 0;var t=this.DV%A,r=this.s<0?A-1:0;if(this.t>0)if(0==t)r=this[0]%A;else for(var e=this.t-1;e>=0;--e)r=(t*r+this[e])%A;return r},r.prototype.millerRabin=function(A){var t=this.subtract(r.ONE),i=t.getLowestSetBit();if(i<=0)return!1;var s=t.shiftRight(i);(A=A+1>>1)>y.length&&(A=y.length);for(var g=e(),a=0;a<A;++a){g.fromInt(y[Math.floor(Math.random()*y.length)]);var B=g.modPow(s,this);if(0!=B.compareTo(r.ONE)&&0!=B.compareTo(t)){for(var n=1;n++<i&&0!=B.compareTo(t);)if(0==(B=B.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=B.compareTo(t))return!1}}return!0},r.prototype.clone=function(){var A=e();return this.copyTo(A),A},r.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var A=this.t,t=new Array;t[0]=this.s;var r,e=this.DB-A*this.DB%8,i=0;if(A-- >0)for(e<this.DB&&(r=this[A]>>e)!=(this.s&this.DM)>>e&&(t[i++]=r|this.s<<this.DB-e);A>=0;)e<8?(r=(this[A]&(1<<e)-1)<<8-e,r|=this[--A]>>(e+=this.DB-8)):(r=this[A]>>(e-=8)&255,e<=0&&(e+=this.DB,--A)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},r.prototype.equals=function(A){return 0==this.compareTo(A)},r.prototype.min=function(A){return this.compareTo(A)<0?this:A},r.prototype.max=function(A){return this.compareTo(A)>0?this:A},r.prototype.and=function(A){var t=e();return this.bitwiseTo(A,C,t),t},r.prototype.or=function(A){var t=e();return this.bitwiseTo(A,W,t),t},r.prototype.xor=function(A){var t=e();return this.bitwiseTo(A,u,t),t},r.prototype.andNot=function(A){var t=e();return this.bitwiseTo(A,q,t),t},r.prototype.not=function(){for(var A=e(),t=0;t<this.t;++t)A[t]=this.DM&~this[t];return A.t=this.t,A.s=~this.s,A},r.prototype.shiftLeft=function(A){var t=e();return A<0?this.rShiftTo(-A,t):this.lShiftTo(A,t),t},r.prototype.shiftRight=function(A){var t=e();return A<0?this.lShiftTo(-A,t):this.rShiftTo(A,t),t},r.prototype.getLowestSetBit=function(){for(var A=0;A<this.t;++A)if(0!=this[A])return A*this.DB+l(this[A]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var A=0,t=this.s&this.DM,r=0;r<this.t;++r)A+=Q(this[r]^t);return A},r.prototype.testBit=function(A){var t=Math.floor(A/this.DB);return t>=this.t?0!=this.s:!!(this[t]&1<<A%this.DB)},r.prototype.setBit=function(A){return this.changeBit(A,W)},r.prototype.clearBit=function(A){return this.changeBit(A,q)},r.prototype.flipBit=function(A){return this.changeBit(A,u)},r.prototype.add=function(A){var t=e();return this.addTo(A,t),t},r.prototype.subtract=function(A){var t=e();return this.subTo(A,t),t},r.prototype.multiply=function(A){var t=e();return this.multiplyTo(A,t),t},r.prototype.divide=function(A){var t=e();return this.divRemTo(A,t,null),t},r.prototype.remainder=function(A){var t=e();return this.divRemTo(A,null,t),t},r.prototype.divideAndRemainder=function(A){var t=e(),r=e();return this.divRemTo(A,t,r),new Array(t,r)},r.prototype.modPow=function(A,t){var r,i,s=A.bitLength(),g=o(1);if(s<=0)return g;r=s<18?1:s<48?3:s<144?4:s<768?5:6,i=s<8?new I(t):t.isEven()?new d(t):new E(t);var a=new Array,B=3,n=r-1,C=(1<<r)-1;if(a[1]=i.convert(this),r>1){var W=e();for(i.sqrTo(a[1],W);B<=C;)a[B]=e(),i.mulTo(W,a[B-2],a[B]),B+=2}var u,q,l=A.t-1,Q=!0,c=e();for(s=V(A[l])-1;l>=0;){for(s>=n?u=A[l]>>s-n&C:(u=(A[l]&(1<<s+1)-1)<<n-s,l>0&&(u|=A[l-1]>>this.DB+s-n)),B=r;!(1&u);)u>>=1,--B;if((s-=B)<0&&(s+=this.DB,--l),Q)a[u].copyTo(g),Q=!1;else{for(;B>1;)i.sqrTo(g,c),i.sqrTo(c,g),B-=2;B>0?i.sqrTo(g,c):(q=g,g=c,c=q),i.mulTo(c,a[u],g)}for(;l>=0&&!(A[l]&1<<s);)i.sqrTo(g,c),q=g,g=c,c=q,--s<0&&(s=this.DB-1,--l)}return i.revert(g)},r.prototype.modInverse=function(A){var t=A.isEven();if(this.isEven()&&t||0==A.signum())return r.ZERO;for(var e=A.clone(),i=this.clone(),s=o(1),g=o(0),a=o(0),B=o(1);0!=e.signum();){for(;e.isEven();)e.rShiftTo(1,e),t?(s.isEven()&&g.isEven()||(s.addTo(this,s),g.subTo(A,g)),s.rShiftTo(1,s)):g.isEven()||g.subTo(A,g),g.rShiftTo(1,g);for(;i.isEven();)i.rShiftTo(1,i),t?(a.isEven()&&B.isEven()||(a.addTo(this,a),B.subTo(A,B)),a.rShiftTo(1,a)):B.isEven()||B.subTo(A,B),B.rShiftTo(1,B);e.compareTo(i)>=0?(e.subTo(i,e),t&&s.subTo(a,s),g.subTo(B,g)):(i.subTo(e,i),t&&a.subTo(s,a),B.subTo(g,B))}return 0!=i.compareTo(r.ONE)?r.ZERO:B.compareTo(A)>=0?B.subtract(A):B.signum()<0?(B.addTo(A,B),B.signum()<0?B.add(A):B):B},r.prototype.pow=function(A){return this.exp(A,new c)},r.prototype.gcd=function(A){var t=this.s<0?this.negate():this.clone(),r=A.s<0?A.negate():A.clone();if(t.compareTo(r)<0){var e=t;t=r,r=e}var i=t.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return t;for(i<s&&(s=i),s>0&&(t.rShiftTo(s,t),r.rShiftTo(s,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r},r.prototype.isProbablePrime=function(A){var t,r=this.abs();if(1==r.t&&r[0]<=y[y.length-1]){for(t=0;t<y.length;++t)if(r[0]==y[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<y.length;){for(var e=y[t],i=t+1;i<y.length&&e<S;)e*=y[i++];for(e=r.modInt(e);t<i;)if(e%y[t++]==0)return!1}return r.millerRabin(A)},r.prototype.square=function(){var A=e();return this.squareTo(A),A},r.prototype.Barrett=d,null==w){var f;if(w=new Array,x=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var J=new Uint8Array(32);for(window.crypto.getRandomValues(J),f=0;f<32;++f)w[x++]=J[f]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var b=window.crypto.random(32);for(f=0;f<b.length;++f)w[x++]=255&b.charCodeAt(f)}for(;x<F;)f=Math.floor(65536*Math.random()),w[x++]=f>>>8,w[x++]=255&f;x=0,D()}function p(){if(null==Y){for(D(),(Y=new h).init(w),x=0;x<w.length;++x)w[x]=0;x=0}return Y.next()}function K(){}function h(){this.i=0,this.j=0,this.S=new Array}K.prototype.nextBytes=function(A){var t;for(t=0;t<A.length;++t)A[t]=p()},h.prototype.init=function(A){var t,r,e;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+A[t%A.length]&255,e=this.S[t],this.S[t]=this.S[r],this.S[r]=e;this.i=0,this.j=0},h.prototype.next=function(){var A;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,A=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=A,this.S[A+this.S[this.i]&255]};var F=256;A.exports={default:r,BigInteger:r,SecureRandom:K}}.call(jsbn)),jsbn$1.exports;var A}function requireAsn1(){if(hasRequiredAsn1)return asn1;hasRequiredAsn1=1;const{BigInteger:A}=requireJsbn();class t{constructor(){this.tlv=null,this.t="00",this.l="00",this.v=""}getEncodedHex(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}getLength(){const A=this.v.length/2;let t=A.toString(16);if(t.length%2==1&&(t="0"+t),A<128)return t;return(128+t.length/2).toString(16)+t}getValue(){return""}}class r extends t{constructor(t){super(),this.t="02",t&&(this.v=function(t){let r=t.toString(16);if("-"!==r[0])r.length%2==1?r="0"+r:r.match(/^[0-7]/)||(r="00"+r);else{r=r.substr(1);let e=r.length;e%2==1?e+=1:r.match(/^[0-7]/)||(e+=2);let i="";for(let A=0;A<e;A++)i+="f";i=new A(i,16),r=i.xor(t).add(A.ONE),r=r.toString(16).replace(/^-/,"")}return r}(t))}getValue(){return this.v}}class e extends t{constructor(A){super(),this.t="30",this.asn1Array=A}getValue(){return this.v=this.asn1Array.map(A=>A.getEncodedHex()).join(""),this.v}}function i(A,t){return+A[t+2]<8?1:128&+A.substr(t+2,2)}function s(t,r){const e=i(t,r),s=t.substr(r+2,2*e);if(!s)return-1;return(+s[0]<8?new A(s,16):new A(s.substr(2),16)).intValue()}function g(A,t){return t+2*(i(A,t)+1)}return asn1={encodeDer(A,t){const i=new r(A),s=new r(t);return new e([i,s]).getEncodedHex()},decodeDer(t){const r=g(t,0),e=g(t,r),i=s(t,r),a=t.substr(e,2*i),B=e+a.length,n=g(t,B),o=s(t,B),V=t.substr(n,2*o);return{r:new A(a,16),s:new A(V,16)}}}}function requireUtils(){if(hasRequiredUtils)return utils$2;hasRequiredUtils=1;const{BigInteger:A,SecureRandom:t}=requireJsbn(),{ECCurveFp:r}=function(){if(hasRequiredEc)return ec;hasRequiredEc=1;const{BigInteger:A}=requireJsbn(),t=new A("2"),r=new A("3");class e{constructor(A,t){this.x=t,this.q=A}equals(A){return A===this||this.q.equals(A.q)&&this.x.equals(A.x)}toBigInteger(){return this.x}negate(){return new e(this.q,this.x.negate().mod(this.q))}add(A){return new e(this.q,this.x.add(A.toBigInteger()).mod(this.q))}subtract(A){return new e(this.q,this.x.subtract(A.toBigInteger()).mod(this.q))}multiply(A){return new e(this.q,this.x.multiply(A.toBigInteger()).mod(this.q))}divide(A){return new e(this.q,this.x.multiply(A.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new e(this.q,this.x.square().mod(this.q))}}class i{constructor(t,r,e,i){this.curve=t,this.x=r,this.y=e,this.z=null==i?A.ONE:i,this.zinv=null}getX(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}getY(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}equals(t){return t===this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(A.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(A.ZERO))}isInfinity(){return null===this.x&&null===this.y||this.z.equals(A.ZERO)&&!this.y.toBigInteger().equals(A.ZERO)}negate(){return new i(this.curve,this.x,this.y.negate(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;const r=this.x.toBigInteger(),e=this.y.toBigInteger(),s=this.z,g=t.x.toBigInteger(),a=t.y.toBigInteger(),B=t.z,n=this.curve.q,o=r.multiply(B).mod(n),V=g.multiply(s).mod(n),I=o.subtract(V),E=e.multiply(B).mod(n),C=a.multiply(s).mod(n),W=E.subtract(C);if(A.ZERO.equals(I))return A.ZERO.equals(W)?this.twice():this.curve.infinity;const u=o.add(V),q=s.multiply(B).mod(n),l=I.square().mod(n),Q=I.multiply(l).mod(n),c=q.multiply(W.square()).subtract(u.multiply(l)).mod(n),k=I.multiply(c).mod(n),d=W.multiply(l.multiply(o).subtract(c)).subtract(E.multiply(Q)).mod(n),Y=Q.multiply(q).mod(n);return new i(this.curve,this.curve.fromBigInteger(k),this.curve.fromBigInteger(d),Y)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const A=this.x.toBigInteger(),t=this.y.toBigInteger(),e=this.z,s=this.curve.q,g=this.curve.a.toBigInteger(),a=A.square().multiply(r).add(g.multiply(e.square())).mod(s),B=t.shiftLeft(1).multiply(e).mod(s),n=t.square().mod(s),o=n.multiply(A).multiply(e).mod(s),V=B.square().mod(s),I=a.square().subtract(o.shiftLeft(3)).mod(s),E=B.multiply(I).mod(s),C=a.multiply(o.shiftLeft(2).subtract(I)).subtract(V.shiftLeft(1).multiply(n)).mod(s),W=B.multiply(V).mod(s);return new i(this.curve,this.curve.fromBigInteger(E),this.curve.fromBigInteger(C),W)}multiply(A){if(this.isInfinity())return this;if(!A.signum())return this.curve.infinity;const t=A.multiply(r),e=this.negate();let i=this;for(let r=t.bitLength()-2;r>0;r--){i=i.twice();const s=t.testBit(r);s!==A.testBit(r)&&(i=i.add(s?this:e))}return i}}return ec={ECPointFp:i,ECCurveFp:class{constructor(A,t,r){this.q=A,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new i(this,null,null)}equals(A){return A===this||this.q.equals(A.q)&&this.a.equals(A.a)&&this.b.equals(A.b)}fromBigInteger(A){return new e(this.q,A)}decodePointHex(r){switch(parseInt(r.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const e=this.fromBigInteger(new A(r.substr(2),16));let s=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new A("4")).add(A.ONE),this.q));return s.toBigInteger().mod(t).equals(new A(r.substr(0,2),16).subtract(t))||(s=s.negate()),new i(this,e,s);case 4:case 6:case 7:const g=(r.length-2)/2,a=r.substr(2,g),B=r.substr(g+2,g);return new i(this,this.fromBigInteger(new A(a,16)),this.fromBigInteger(new A(B,16)));default:return null}}}}}(),e=new t,{curve:i,G:s,n:g}=a();function a(){const t=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),e=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),i=new A("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),s=new r(t,e,i),g=s.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:s,G:g,n:new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function B(A,t){return A.length>=t?A:new Array(t-A.length+1).join("0")+A}return utils$2={getGlobalCurve:function(){return i},generateEcparam:a,generateKeyPairHex:function(t,r,i){const a=(t?new A(t,r,i):new A(g.bitLength(),e)).mod(g.subtract(A.ONE)).add(A.ONE),n=B(a.toString(16),64),o=s.multiply(a);return{privateKey:n,publicKey:"04"+B(o.getX().toBigInteger().toString(16),64)+B(o.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(t){if(130!==t.length)throw new Error("Invalid public key to compress");const r=(t.length-2)/2,e=t.substr(2,r);let i="03";return new A(t.substr(r+2,r),16).mod(new A("2")).equals(A.ZERO)&&(i="02"),i+e},utf8ToHex:function(A){const t=(A=unescape(encodeURIComponent(A))).length,r=[];for(let i=0;i<t;i++)r[i>>>2]|=(255&A.charCodeAt(i))<<24-i%4*8;const e=[];for(let i=0;i<t;i++){const A=r[i>>>2]>>>24-i%4*8&255;e.push((A>>>4).toString(16)),e.push((15&A).toString(16))}return e.join("")},leftPad:B,arrayToHex:function(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")},arrayToUtf8:function(A){const t=[];let r=0;for(let i=0;i<2*A.length;i+=2)t[i>>>3]|=parseInt(A[r],10)<<24-i%8*4,r++;try{const r=[];for(let e=0;e<A.length;e++){const A=t[e>>>2]>>>24-e%4*8&255;r.push(String.fromCharCode(A))}return decodeURIComponent(escape(r.join("")))}catch(e){throw new Error("Malformed UTF-8 data")}},hexToArray:function(A){const t=[];let r=A.length;r%2!=0&&(A=B(A,r+1)),r=A.length;for(let e=0;e<r;e+=2)t.push(parseInt(A.substr(e,2),16));return t},verifyPublicKey:function(A){const t=i.decodePointHex(A);if(!t)return!1;const r=t.getX();return t.getY().square().equals(r.multiply(r.square()).add(r.multiply(i.a)).add(i.b))},comparePublicKeyHex:function(A,t){const r=i.decodePointHex(A);if(!r)return!1;const e=i.decodePointHex(t);return!!e&&r.equals(e)}}}function requireSm3$1(){if(hasRequiredSm3$1)return sm3_1$1;hasRequiredSm3$1=1;const A=new Uint32Array(68),t=new Uint32Array(64);function r(A,t){const r=31&t;return A<<r|A>>>32-r}function e(A,t){const r=[];for(let e=A.length-1;e>=0;e--)r[e]=255&(A[e]^t[e]);return r}function i(A){return A^r(A,9)^r(A,17)}function s(A){return A^r(A,15)^r(A,23)}function g(e){let g=8*e.length,a=g%512;a=a>=448?512-a%448-1:448-a-1;const B=new Array((a-7)/8),n=new Array(8);for(let A=0,t=B.length;A<t;A++)B[A]=0;for(let A=0,t=n.length;A<t;A++)n[A]=0;g=g.toString(2);for(let A=7;A>=0;A--)if(g.length>8){const t=g.length-8;n[A]=parseInt(g.substr(t),2),g=g.substr(0,t)}else g.length>0&&(n[A]=parseInt(g,2),g="");const o=new Uint8Array([...e,128,...B,...n]),V=new DataView(o.buffer,0),I=o.length/64,E=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let W=0;W<I;W++){A.fill(0),t.fill(0);const e=16*W;for(let t=0;t<16;t++)A[t]=V.getUint32(4*(e+t),!1);for(let t=16;t<68;t++)A[t]=s(A[t-16]^A[t-9]^r(A[t-3],15))^r(A[t-13],7)^A[t-6];for(let r=0;r<64;r++)t[r]=A[r]^A[r+4];const g=2043430169,a=2055708042;let B,n,o,I,C,u=E[0],q=E[1],l=E[2],Q=E[3],c=E[4],k=E[5],d=E[6],Y=E[7];for(let s=0;s<64;s++)C=s>=0&&s<=15?g:a,B=r(r(u,12)+c+r(C,s),7),n=B^r(u,12),o=(s>=0&&s<=15?u^q^l:u&q|u&l|q&l)+Q+n+t[s],I=(s>=0&&s<=15?c^k^d:c&k|~c&d)+Y+B+A[s],Q=l,l=r(q,9),q=u,u=o,Y=d,d=r(k,19),k=c,c=i(I);E[0]^=u,E[1]^=q,E[2]^=l,E[3]^=Q,E[4]^=c,E[5]^=k,E[6]^=d,E[7]^=Y}const C=[];for(let A=0,t=E.length;A<t;A++){const t=E[A];C.push((4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t)}return C}const a=new Uint8Array(64),B=new Uint8Array(64);for(let n=0;n<64;n++)a[n]=54,B[n]=92;return sm3_1$1={sm3:g,hmac:function(A,t){for(t.length>64&&(t=g(t));t.length<64;)t.push(0);const r=e(t,a),i=e(t,B),s=g([...r,...A]);return g([...i,...s])}}}function requireSm2(){if(hasRequiredSm2)return sm2;hasRequiredSm2=1;const{BigInteger:A}=requireJsbn(),{encodeDer:t,decodeDer:r}=requireAsn1(),e=requireUtils(),i=requireSm3$1().sm3,{G:s,curve:g,n:a}=e.generateEcparam();function B(A,t,r="1234567812345678"){r=e.utf8ToHex(r);const g=e.leftPad(s.curve.a.toBigInteger().toRadix(16),64),a=e.leftPad(s.curve.b.toBigInteger().toRadix(16),64),B=e.leftPad(s.getX().toBigInteger().toRadix(16),64),n=e.leftPad(s.getY().toBigInteger().toRadix(16),64);let o,V;if(128===t.length)o=t.substr(0,64),V=t.substr(64,64);else{const A=s.curve.decodePointHex(t);o=e.leftPad(A.getX().toBigInteger().toRadix(16),64),V=e.leftPad(A.getY().toBigInteger().toRadix(16),64)}const I=e.hexToArray(r+g+a+B+n+o+V),E=4*r.length;I.unshift(255&E),I.unshift(E>>8&255);const C=i(I);return e.arrayToHex(i(C.concat(e.hexToArray(A))))}function n(t){const r=s.multiply(new A(t,16));return"04"+e.leftPad(r.getX().toBigInteger().toString(16),64)+e.leftPad(r.getY().toBigInteger().toString(16),64)}function o(){const t=e.generateKeyPairHex(),r=g.decodePointHex(t.publicKey);return t.k=new A(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}return sm2={generateKeyPairHex:e.generateKeyPairHex,compressPublicKeyHex:e.compressPublicKeyHex,comparePublicKeyHex:e.comparePublicKeyHex,doEncrypt:function(t,r,s=1){t="string"==typeof t?e.hexToArray(e.utf8ToHex(t)):Array.prototype.slice.call(t),r=e.getGlobalCurve().decodePointHex(r);const g=e.generateKeyPairHex(),a=new A(g.privateKey,16);let B=g.publicKey;B.length>128&&(B=B.substr(B.length-128));const n=r.multiply(a),o=e.hexToArray(e.leftPad(n.getX().toBigInteger().toRadix(16),64)),V=e.hexToArray(e.leftPad(n.getY().toBigInteger().toRadix(16),64)),I=e.arrayToHex(i([].concat(o,t,V)));let E=1,C=0,W=[];const u=[].concat(o,V),q=()=>{W=i([...u,E>>24&255,E>>16&255,E>>8&255,255&E]),E++,C=0};q();for(let A=0,e=t.length;A<e;A++)C===W.length&&q(),t[A]^=255&W[C++];const l=e.arrayToHex(t);return 0===s?B+l+I:B+I+l},doDecrypt:function(t,r,s=1,{output:g="string"}={}){r=new A(r,16);let a=t.substr(128,64),B=t.substr(192);0===s&&(a=t.substr(t.length-64),B=t.substr(128,t.length-128-64));const n=e.hexToArray(B),o=e.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),V=e.hexToArray(e.leftPad(o.getX().toBigInteger().toRadix(16),64)),I=e.hexToArray(e.leftPad(o.getY().toBigInteger().toRadix(16),64));let E=1,C=0,W=[];const u=[].concat(V,I),q=()=>{W=i([...u,E>>24&255,E>>16&255,E>>8&255,255&E]),E++,C=0};q();for(let A=0,e=n.length;A<e;A++)C===W.length&&q(),n[A]^=255&W[C++];return e.arrayToHex(i([].concat(V,n,I)))===a.toLowerCase()?"array"===g?n:e.arrayToUtf8(n):"array"===g?[]:""},doSignature:function(r,i,{pointPool:s,der:g,hash:V,publicKey:I,userId:E}={}){let C="string"==typeof r?e.utf8ToHex(r):e.arrayToHex(r);V&&(C=B(C,I=I||n(i),E));const W=new A(i,16),u=new A(C,16);let q=null,l=null,Q=null;do{do{let A;A=s&&s.length?s.pop():o(),q=A.k,l=u.add(A.x1).mod(a)}while(l.equals(A.ZERO)||l.add(q).equals(a));Q=W.add(A.ONE).modInverse(a).multiply(q.subtract(l.multiply(W))).mod(a)}while(Q.equals(A.ZERO));return g?t(l,Q):e.leftPad(l.toString(16),64)+e.leftPad(Q.toString(16),64)},doVerifySignature:function(t,i,n,{der:o,hash:V,userId:I}={}){let E,C,W="string"==typeof t?e.utf8ToHex(t):e.arrayToHex(t);if(V&&(W=B(W,n,I)),o){const A=r(i);E=A.r,C=A.s}else E=new A(i.substring(0,64),16),C=new A(i.substring(64),16);const u=g.decodePointHex(n),q=new A(W,16),l=E.add(C).mod(a);if(l.equals(A.ZERO))return!1;const Q=s.multiply(C).add(u.multiply(l)),c=q.add(Q.getX().toBigInteger()).mod(a);return E.equals(c)},getPublicKeyFromPrivateKey:n,getPoint:o,verifyPublicKey:e.verifyPublicKey},sm2}function requireSm3(){if(hasRequiredSm3)return sm3_1;hasRequiredSm3=1;const{sm3:A,hmac:t}=requireSm3$1();function r(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")}function e(A){const t=[];let r=A.length;var e,i;r%2!=0&&(i=r+1,A=(e=A).length>=i?e:new Array(i-e.length+1).join("0")+e),r=A.length;for(let s=0;s<r;s+=2)t.push(parseInt(A.substr(s,2),16));return t}return sm3_1=function(i,s){if(i="string"==typeof i?function(A){const t=[];for(let r=0,e=A.length;r<e;r++){const e=A.codePointAt(r);if(e<=127)t.push(e);else if(e<=2047)t.push(192|e>>>6),t.push(128|63&e);else if(e<=55295||e>=57344&&e<=65535)t.push(224|e>>>12),t.push(128|e>>>6&63),t.push(128|63&e);else{if(!(e>=65536&&e<=1114111))throw t.push(e),new Error("input is not supported");r++,t.push(240|e>>>18&28),t.push(128|e>>>12&63),t.push(128|e>>>6&63),t.push(128|63&e)}}return t}(i):Array.prototype.slice.call(i),s){if("hmac"!==(s.mode||"hmac"))throw new Error("invalid mode");let A=s.key;if(!A)throw new Error("invalid key");return A="string"==typeof A?e(A):Array.prototype.slice.call(A),r(t(i,A))}return r(A(i))}}function requireSm4(){if(hasRequiredSm4)return sm4_1;hasRequiredSm4=1;const A=16,t=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],r=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function e(A){const t=[];for(let r=0,e=A.length;r<e;r+=2)t.push(parseInt(A.substr(r,2),16));return t}function i(A,t){const r=31&t;return A<<r|A>>>32-r}function s(A){return(255&t[A>>>24&255])<<24|(255&t[A>>>16&255])<<16|(255&t[A>>>8&255])<<8|255&t[255&A]}function g(A){return A^i(A,2)^i(A,10)^i(A,18)^i(A,24)}function a(A){return A^i(A,13)^i(A,23)}function B(A,t,r){const e=new Array(4),i=new Array(4);for(let s=0;s<4;s++)i[0]=255&A[4*s],i[1]=255&A[4*s+1],i[2]=255&A[4*s+2],i[3]=255&A[4*s+3],e[s]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];for(let a,B=0;B<32;B+=4)a=e[1]^e[2]^e[3]^r[B+0],e[0]^=g(s(a)),a=e[2]^e[3]^e[0]^r[B+1],e[1]^=g(s(a)),a=e[3]^e[0]^e[1]^r[B+2],e[2]^=g(s(a)),a=e[0]^e[1]^e[2]^r[B+3],e[3]^=g(s(a));for(let s=0;s<16;s+=4)t[s]=e[3-s/4]>>>24&255,t[s+1]=e[3-s/4]>>>16&255,t[s+2]=e[3-s/4]>>>8&255,t[s+3]=255&e[3-s/4]}function n(t,i,g,{padding:n="pkcs#7",mode:o,iv:V=[],output:I="string"}={}){if("cbc"===o&&("string"==typeof V&&(V=e(V)),16!==V.length))throw new Error("iv is invalid");if("string"==typeof i&&(i=e(i)),16!==i.length)throw new Error("key is invalid");if(t="string"==typeof t?0!==g?function(A){const t=[];for(let r=0,e=A.length;r<e;r++){const e=A.codePointAt(r);if(e<=127)t.push(e);else if(e<=2047)t.push(192|e>>>6),t.push(128|63&e);else if(e<=55295||e>=57344&&e<=65535)t.push(224|e>>>12),t.push(128|e>>>6&63),t.push(128|63&e);else{if(!(e>=65536&&e<=1114111))throw t.push(e),new Error("input is not supported");r++,t.push(240|e>>>18&28),t.push(128|e>>>12&63),t.push(128|e>>>6&63),t.push(128|63&e)}}return t}(t):e(t):[...t],("pkcs#5"===n||"pkcs#7"===n)&&0!==g){const r=A-t.length%A;for(let A=0;A<r;A++)t.push(r)}const E=new Array(32);!function(A,t,e){const i=new Array(4),g=new Array(4);for(let r=0;r<4;r++)g[0]=255&A[0+4*r],g[1]=255&A[1+4*r],g[2]=255&A[2+4*r],g[3]=255&A[3+4*r],i[r]=g[0]<<24|g[1]<<16|g[2]<<8|g[3];i[0]^=2746333894,i[1]^=1453994832,i[2]^=1736282519,i[3]^=2993693404;for(let B,n=0;n<32;n+=4)B=i[1]^i[2]^i[3]^r[n+0],t[n+0]=i[0]^=a(s(B)),B=i[2]^i[3]^i[0]^r[n+1],t[n+1]=i[1]^=a(s(B)),B=i[3]^i[0]^i[1]^r[n+2],t[n+2]=i[2]^=a(s(B)),B=i[0]^i[1]^i[2]^r[n+3],t[n+3]=i[3]^=a(s(B));if(0===e)for(let r,s=0;s<16;s++)r=t[s],t[s]=t[31-s],t[31-s]=r}(i,E,g);const C=[];let W=V,u=t.length,q=0;for(;u>=A;){const r=t.slice(q,q+16),e=new Array(16);if("cbc"===o)for(let t=0;t<A;t++)0!==g&&(r[t]^=W[t]);B(r,e,E);for(let t=0;t<A;t++)"cbc"===o&&0===g&&(e[t]^=W[t]),C[q+t]=e[t];"cbc"===o&&(W=0!==g?e:r),u-=A,q+=A}if(("pkcs#5"===n||"pkcs#7"===n)&&0===g){const A=C.length,t=C[A-1];for(let r=1;r<=t;r++)if(C[A-r]!==t)throw new Error("padding is invalid");C.splice(A-t,t)}return"array"!==I?0!==g?C.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join(""):function(A){const t=[];for(let r=0,e=A.length;r<e;r++)A[r]>=240&&A[r]<=247?(t.push(String.fromCodePoint(((7&A[r])<<18)+((63&A[r+1])<<12)+((63&A[r+2])<<6)+(63&A[r+3]))),r+=3):A[r]>=224&&A[r]<=239?(t.push(String.fromCodePoint(((15&A[r])<<12)+((63&A[r+1])<<6)+(63&A[r+2]))),r+=2):A[r]>=192&&A[r]<=223?(t.push(String.fromCodePoint(((31&A[r])<<6)+(63&A[r+1]))),r++):t.push(String.fromCodePoint(A[r]));return t.join("")}(C):C}return sm4_1={encrypt:(A,t,r)=>n(A,t,1,r),decrypt:(A,t,r)=>n(A,t,0,r)}}const smCrypto=getDefaultExportFromCjs(hasRequiredSrc?src:(hasRequiredSrc=1,src={sm2:requireSm2(),sm3:requireSm3(),sm4:requireSm4()}));class MyCryptoJS{constructor(A,t,r,e){__privateAdd(this,_key,null),__privateAdd(this,_iv,null),__privateAdd(this,_publicKey,null),__privateAdd(this,_privateKey,null),__privateAdd(this,_formatType,(A,t=!1)=>{if(!t)return"object"==typeof A?JSON.stringify(A):String(A);try{return JSON.parse(A)}catch(r){return A}}),this.setkey(A),this.setiv(t),this.setPublicKey(r),this.setPrivateKey(e)}setPublicKey(A){__privateSet(this,_publicKey,A)}setPrivateKey(A){__privateSet(this,_privateKey,A)}setkey(A){__privateSet(this,_key,A&&this.stringToWordArray(A.padEnd(16,"0")))}setiv(A){__privateSet(this,_iv,A&&this.stringToWordArray(A))}sm2Encrypt(A,t){return smCrypto.sm2.doEncrypt(A,t,{inputEncoding:"utf8",outputEncoding:"hex",pointFormat:"uncompressed",cipherMode:1})}sm2Decrypt(A,t){return smCrypto.sm2.doDecrypt(A,t,1)}RSAencrypt(A){A=__privateGet(this,_formatType).call(this,A);const t=new JSEncrypt;return t.setPublicKey(__privateGet(this,_publicKey)),t.encrypt(A)}RSAdecrypt(A){const t=new JSEncrypt;return t.setPrivateKey(__privateGet(this,_privateKey)),__privateGet(this,_formatType).call(this,t.decrypt(A),!0)}stringToWordArray(A){return CryptoJS.enc.Utf8.parse(A)}wordArrayToString(A){return A.toString(CryptoJS.enc.Utf8)}AESencrypt(A,t=!0){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.AES.encrypt(A,__privateGet(this,_key),{iv:__privateGet(this,_iv),mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).ciphertext.toString(t?CryptoJS.enc.Base64:CryptoJS.enc.Hex)}AESdecrypt(A,t=!0){A=t?A:CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(A));let r=CryptoJS.AES.decrypt(A,__privateGet(this,_key),{iv:__privateGet(this,_iv),mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return __privateGet(this,_formatType).call(this,r.toString(CryptoJS.enc.Utf8),!0)}DESencrypt(A,t=!0){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.DES.encrypt(A,__privateGet(this,_key),{iv:__privateGet(this,_iv),mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).ciphertext.toString(t?CryptoJS.enc.Base64:CryptoJS.enc.Hex)}DESdecrypt(A,t=!0){A=t?A:CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(A));let r=CryptoJS.DES.decrypt(A,__privateGet(this,_key),{iv:__privateGet(this,_iv),mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return __privateGet(this,_formatType).call(this,r.toString(CryptoJS.enc.Utf8),!0)}base64Encode(A){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(A))}base64Decode(A){return __privateGet(this,_formatType).call(this,CryptoJS.enc.Base64.parse(A).toString(CryptoJS.enc.Utf8),!0)}md5(A){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.MD5(A).toString()}fileMd5(A,t,r){return new Promise((e,i)=>{if(!A)return void i("");const s=new FileReader;if(s.onerror=A=>{i(A)},t){const a=CryptoJS.algo.MD5.create();let B=0;try{let i=function(){const r=A.slice(B,B+t);s.readAsArrayBuffer(r)};s.onload=s=>{const g=CryptoJS.lib.WordArray.create(new Uint8Array(s.target.result));if(a.update(g),"function"==typeof r&&r(B,A.size),B+=t,B<A.size)i();else{const A=a.finalize();e(A.toString(CryptoJS.enc.Hex))}},i()}catch(g){i(g)}}else s.onload=t=>{"function"==typeof r&&r(A.size,A.size),e(CryptoJS.MD5(CryptoJS.lib.WordArray.create(t.target.result)).toString())},s.readAsArrayBuffer(A)})}sha1(A){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.SHA1(A).toString()}sha256(A){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.SHA256(A).toString()}sha3(A){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.SHA3(A,{outputLength:256}).toString()}pbkdf2(A){A=__privateGet(this,_formatType).call(this,A);let t=CryptoJS.lib.WordArray.random(16);return CryptoJS.PBKDF2(A,t,{keySize:8,iterations:1e3}).toString()}hmac(A,t){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.HmacSHA256(A,t).toString(CryptoJS.enc.Hex)}}function randomStr$1(A=18,t=36){(t<2||t>36)&&(t=36);var r=Math.random().toString(t).substring(2,13).padEnd(11,"0").slice(0,A);return A<=11?r:r+randomStr$1(A-11)}function hexToRgb(A){A=A.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(A,t,r,e)=>t+t+r+r+e+e);const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function fileTurnBase64(A){return new Promise((t,r)=>{if(A)try{var e=new FileReader;let i="";e.readAsDataURL(A),e.onload=function(){i=e.result},e.onerror=function(A){r(A)},e.onloadend=function(){t(i)}}catch(i){r(i)}else r("")})}_key=new WeakMap,_iv=new WeakMap,_publicKey=new WeakMap,_privateKey=new WeakMap,_formatType=new WeakMap;const tools={formatDateTime:function(A="yyyy-MM-dd hh:mm:ss",t=new Date,r=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]){!t&&(t=new Date),"string"==typeof t&&(t=new Date(t));const e={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),S:t.getMilliseconds(),w:r[t.getDay()]};/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(const i in e)new RegExp("("+i+")").test(A)&&(A=A.replace(RegExp.$1,1===RegExp.$1.length?e[i]:("00"+e[i]).substr((""+e[i]).length)));return A},throttle:function(A,t=500){var r=Date.now();return function(...e){Date.now()-r>=t&&(A.apply(this,e),r=Date.now())}},debounce:function(A,t=500){let r=null;return function(...e){clearTimeout(r),r=setTimeout(()=>{A.apply(this,e)},t)}},rgbToHex:function(A,t,r){return"#"+((1<<24)+(A<<16)+(t<<8)+r).toString(16).slice(1)},hexToRgb:hexToRgb,hslToRgb:function(A,t,r){let e,i,s;if(A/=360,r/=100,0===(t/=100))e=i=s=r;else{const g=(A,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?A+6*(t-A)*r:r<.5?t:r<2/3?A+(t-A)*(2/3-r)*6:A),a=r<.5?r*(1+t):r+t-r*t,B=2*r-a;e=g(B,a,A+1/3),i=g(B,a,A),s=g(B,a,A-1/3)}return{r:Math.round(255*e),g:Math.round(255*i),b:Math.round(255*s)}},rgbOrHexToHsl:function(A){let t,r,e;if("string"==typeof A&&"#"===A.charAt(0)){const i=hexToRgb(A);t=i.r/255,r=i.g/255,e=i.b/255}else{if("object"!=typeof A)throw new Error("Invalid input format");t=A.r/255,r=A.g/255,e=A.b/255}const i=Math.max(t,r,e),s=Math.min(t,r,e);let g,a,B=(i+s)/2;if(i===s)g=a=0;else{const A=i-s;switch(a=B>.5?A/(2-i-s):A/(i+s),i){case t:g=(r-e)/A+(r<e?6:0);break;case r:g=(e-t)/A+2;break;case e:g=(t-r)/A+4}g/=6}return{h:Math.round(360*g),s:Math.round(100*a),l:Math.round(100*B)}},preciseInterval:function(A,t){let r,e=null;return r=requestAnimationFrame(function i(s){e||(e=s),s-e>=t&&(A(),e=s),r=requestAnimationFrame(i)}),{clear:function(){cancelAnimationFrame(r)}}},convertImgToBase64:function(A,t){return new Promise(function(r){var e=document.createElement("CANVAS"),i=e.getContext("2d"),s=new Image;s.crossOrigin="Anonymous",s.onload=function(){e.height=s.height,e.width=s.width,i.drawImage(s,0,0);var A=e.toDataURL(t||"image/jpg");r(A),e=null},s.src=A})},objectGroupBy:function(A,t){if("string"==typeof t){const A=t;t=t=>t[A]}var r={};return A.forEach((e,i)=>{const s=t(e,i,A);r[s]||(r[s]=[]),r[s].push(e)}),r},randomNum:function(A,t){return Math.floor(Math.random()*(t+1-A))+A},randomColor:function(){return"#"+Math.floor(16777215*Math.random()).toString(16).padEnd(6,"0")},deepCloning:function A(t,r=new WeakMap){if("object"!=typeof t||null===t)return t;if(r.has(t))return r.get(t);var e=Array.isArray(t)?[]:{};r.set(t,e);for(const s in t)if(t.hasOwnProperty(s)){const g=t[s];if("object"!=typeof g||null===g)e[s]=g;else try{e[s]=A(g,r)}catch(i){}}return e},randomStr:randomStr$1,getUrlParams:function(A){const t={};let r=A.substring(A.lastIndexOf("?")+1);return r=decodeURIComponent(r),r.replace(/([^?&=]+)=([^?&=]*)/g,(A,r,e)=>{const i=decodeURIComponent(r);let s=decodeURIComponent(e);try{s=JSON.parse(s)}catch(g){}return t[i]=s,A}),t},getBroswer:function(){let A="";const t=window.navigator.userAgent.toLowerCase();if(/(msie|firefox|opera|chrome|netscape)\D+(\d[\d.]*)/.test(t)){const r=t.search(RegExp.$1);A=t.substring(r,t.length).replace(/safari\D+(\d[\d.]*)/,"")}else/version\D+(\d[\d.]*).*safari/.test(t)&&(A="safari "+RegExp.$2);return A},fileTurnBase64:fileTurnBase64,fileChunks:function(A,t,r,e){return new Promise((i,s)=>{const g=new MyCryptoJS,a={fileHash:"",fileName:A.name,chunkSize:t,fileSize:A.size,fileType:A.type,chunks:[]};let B=new Promise((r,i)=>{g.fileMd5(A,t,e).then(A=>{a.fileHash=A,r(a)}).catch(A=>{i(A)})}),n=new Promise((e,i)=>{let s=0;!async function i(){if(s>=A.size)return void e(a);let g=A.slice(s,Math.min(s+t,A.size));r&&(g=await fileTurnBase64(g)),a.chunks.push({chunk:g,index:s/t}),s+=t,i()}()});Promise.all([B,n]).then(()=>{i(a)}).catch(A=>{s(A)})})},base64ArrayMerge:function(A,t=!0){let r=(A=A.map(A=>function(A){const t="=".repeat((4-A.length%4)%4),r=(A+t).replace(/\-/g,"+").replace(/_/g,"/"),e=window.atob(r),i=new Uint8Array(e.length);for(let s=0;s<e.length;++s)i[s]=e.charCodeAt(s);return i}(A.split(",")[1]))).reduce((A,t)=>A+t.length,0);const e=new Uint8Array(r);let i=0;A.forEach(A=>{e.set(A,i),i+=A.length});const s=new Blob([e]);return new Promise((A,r)=>{t?fileTurnBase64(s).then(t=>{A(t)}).catch(A=>{r(A)}):A(s)})},toChineseNumber:function(A,t=!0){let r=A.toString().replace(/(?=(\d{4})+$)/g,",").split(",").filter(Boolean);const e=["零","一","二","三","四","五","六","七","八","九"],i=["","十","百","千"],s=["","万","亿"];let g=r.map((A,t)=>function(A){let t="";for(let r=0;r<A.length;r++){let s=e[A[r]],g=i[A.length-r-1];"零"===s&&(g=""),t+=s+g}return t=t.replace(/零+/g,"零").replace(/零$/,""),t}(A)+s[r.length-1-t]).join("");if(g=g||"零",t){let A={"零":"零","一":"壹","二":"贰","三":"叁","四":"肆","五":"伍","六":"陆","七":"柒","八":"捌","九":"玖","十":"拾","百":"佰","千":"仟"};g=g.split("").map(t=>A[t]||t).join("")}return g},getExplorerInfo:function(){let A=navigator.userAgent.toLowerCase();return 0<=A.indexOf("msie")?{type:"IE",version:Number(A.match(/msie ([\d]+)/)[1])}:A.match(/trident\/.+?rv:(([\d.]+))/)?{type:"IE",version:11}:0<=A.indexOf("edge")?{type:"Edge",version:Number(A.match(/edge\/([\d]+)/)[1])}:0<=A.indexOf("firefox")?{type:"Firefox",version:Number(A.match(/firefox\/([\d]+)/)[1])}:0<=A.indexOf("chrome")?{type:"Chrome",version:Number(A.match(/chrome\/([\d]+)/)[1])}:0<=A.indexOf("opera")?{type:"Opera",version:Number(A.match(/opera.([\d]+)/)[1])}:0<=A.indexOf("Safari")?{type:"Safari",version:Number(A.match(/version\/([\d]+)/)[1])}:{type:A,version:-1}},exportFile:function(A,t){if(!A)return;"object"==typeof A&&(A=JSON.stringify(A));const r=new Blob([A],{type:"application/json;charset=utf-8"}),e=URL.createObjectURL(r),i=document.createElement("a");i.href=e,i.download=0==t.indexOf(".")?randomStr$1()+t:t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(e)}};window.Cesium||(window.Cesium={WebMapTileServiceImageryProvider:function(){}});class CustomImageryProvider extends Cesium.WebMapTileServiceImageryProvider{constructor(A){super(A),__privateAdd(this,_alp,0),__privateAdd(this,_rgb,[6,27,98]),__privateSet(this,_alp,A.alp||0),__privateSet(this,_rgb,A.rgb||[6,27,98])}requestImage(A,t,r){return super.requestImage(A,t,r).then(A=>{if(!__privateGet(this,_alp))return A;const t=document.createElement("canvas");t.width=A.width,t.height=A.height;const r=t.getContext("2d");return r.translate(0,t.height),r.scale(1,-1),r.drawImage(A,0,0),r.globalCompositeOperation="source-atop",r.fillStyle=`rgba(${__privateGet(this,_rgb)[0]},${__privateGet(this,_rgb)[1]},${__privateGet(this,_rgb)[2]}, ${__privateGet(this,_alp)})`,r.fillRect(0,0,t.width,t.height),r.globalCompositeOperation="source-over",r.stroke(),t})}}_alp=new WeakMap,_rgb=new WeakMap;class TianDiTu{constructor(A){__privateAdd(this,_yingXiangLayer,null),__privateAdd(this,_luWangLayer,null),__privateAdd(this,_zhuJiLayer,null),__privateAdd(this,_parent,null),__publicField(this,"TianDiTuToken",""),__publicField(this,"loadTdtYingXiang",(A={},t=[])=>{const r=__privateGet(this,_parent).viewer;var e={tdtyxType:"img_w",...A},i=new CustomImageryProvider({rgb:t,alp:t[3],url:`http://t{s}.tianditu.gov.cn/${e.tdtyxType}/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&format=tiles&tk=${this.TianDiTuToken}`,subdomains:["0","1","2","3","4","5","6","7"],show:!0,maximumLevel:18,minimumLevel:0,screenSpaceError:16,styels:[{stylers:[{hue:"#fc0505ff"},{saturation:-20}]}]}),s=r.imageryLayers.addImageryProvider(i);return r.imageryLayers.lowerToBottom(s),{entity:s,remove(){r.imageryLayers.remove(s)}}}),__publicField(this,"loadTdtZhuJi",(A={},t=[])=>{const r=__privateGet(this,_parent).viewer;var e={maximumLevel:18,...A},i=new CustomImageryProvider({rgb:t,alp:t[3],url:`https://t{s}.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={TileCol}&TILEROW={TileRow}&TILEMATRIX={TileMatrix}&tk=${this.TianDiTuToken}`,subdomains:["0","1","2","3","4","5","6","7"],minimumLevel:0,maximumLevel:e.maximumLevel,show:!0}),s=r.imageryLayers.addImageryProvider(i);return r.imageryLayers.raiseToTop(s),{entity:s,remove(){r.imageryLayers.remove(s)}}}),__publicField(this,"setImageLayerFilter",(A={},t=0)=>{var r={invertColor:!0,alpha:1,dayAlpha:1,nightAlpha:1,brightness:1,contrast:1,hue:50,saturation:1,gamma:1,...A},e=this.viewer.imageryLayers.get(t);e.invertColor=r.invertColor,e.alpha=r.alpha,e.dayAlpha=r.dayAlpha,e.nightAlpha=r.nightAlpha,e.brightness=r.brightness,e.contrast=r.contrast,e.hue=r.hue,e.saturation=r.saturation,e.gamma=r.gamma}),__privateSet(this,_parent,A),this.TianDiTuToken=A.TianDiTuToken,this.showTdtYX=!0,this.showTdtLW=!0}set showTdtYX(A){A?__privateGet(this,_yingXiangLayer)||__privateSet(this,_yingXiangLayer,this.loadTdtYingXiang()):(__privateGet(this,_yingXiangLayer)&&__privateGet(this,_yingXiangLayer).remove(),__privateSet(this,_yingXiangLayer,null))}set showTdtLW(A){A?__privateGet(this,_luWangLayer)||__privateSet(this,_luWangLayer,this.loadTdtLuWang()):(__privateGet(this,_luWangLayer)&&__privateGet(this,_luWangLayer).remove(),__privateSet(this,_luWangLayer,null))}set showTdtZJ(A){A?__privateGet(this,_zhuJiLayer)||__privateSet(this,_zhuJiLayer,this.loadTdtZhuJi()):(__privateGet(this,_zhuJiLayer)&&__privateGet(this,_zhuJiLayer).remove(),__privateSet(this,_zhuJiLayer,null))}loadTdtLuWang(A={},t=[]){const r=__privateGet(this,_parent).viewer;var e={maximumLevel:18,show:!0,...A},i=new CustomImageryProvider({rgb:t,alp:t[3],url:`http://t{s}.tianditu.gov.cn/cia_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cia&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default.jpg&tk=${this.TianDiTuToken}`,subdomains:["0","1","2","3","4","5","6","7"],maximumLevel:e.maximumLevel,show:e.show}),s=r.imageryLayers.addImageryProvider(i);return r.imageryLayers.raiseToTop(s),{entity:s,remove(){r.imageryLayers.remove(s)}}}}_yingXiangLayer=new WeakMap,_luWangLayer=new WeakMap,_zhuJiLayer=new WeakMap,_parent=new WeakMap;const configProviderContextKey=Symbol(),_bem=(A,t,r,e,i)=>{let s=`${A}-${t}`;return r&&(s+=`-${r}`),e&&(s+=`__${e}`),i&&(s+=`--${i}`),s},namespaceContextKey=Symbol("namespaceContextKey"),useNamespace=(A,t)=>{const r=(A=>{const t=A||(vue.getCurrentInstance()?vue.inject(namespaceContextKey,vue.ref("el")):vue.ref("el"));return vue.computed(()=>vue.unref(t)||"el")})(t);return{namespace:r,b:(t="")=>_bem(r.value,A,t,"",""),e:t=>t?_bem(r.value,A,"",t,""):"",m:t=>t?_bem(r.value,A,"","",t):"",be:(t,e)=>t&&e?_bem(r.value,A,t,e,""):"",em:(t,e)=>t&&e?_bem(r.value,A,"",t,e):"",bm:(t,e)=>t&&e?_bem(r.value,A,t,"",e):"",bem:(t,e,i)=>t&&e&&i?_bem(r.value,A,t,e,i):"",is:(A,...t)=>{const r=!(t.length>=1)||t[0];return A&&r?`is-${A}`:""},cssVar:A=>{const t={};for(const e in A)A[e]&&(t[`--${r.value}-${e}`]=A[e]);return t},cssVarName:A=>`--${r.value}-${A}`,cssVarBlock:t=>{const e={};for(const i in t)t[i]&&(e[`--${r.value}-${A}-${i}`]=t[i]);return e},cssVarBlockName:t=>`--${r.value}-${A}-${t}`}};
|
|
33
|
+
var KJUR={};void 0!==KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(A){var t=A.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(A){var t=A.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var e="",i=0;i<r;i++)e+="f";t=new BigInteger(e,16).xor(A).add(BigInteger.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(A,t){return hextopem(A,t)},this.newObject=function(A){var t=KJUR.asn1,r=t.DERBoolean,e=t.DERInteger,i=t.DERBitString,s=t.DEROctetString,g=t.DERNull,a=t.DERObjectIdentifier,B=t.DEREnumerated,n=t.DERUTF8String,o=t.DERNumericString,V=t.DERPrintableString,I=t.DERTeletexString,E=t.DERIA5String,C=t.DERUTCTime,W=t.DERGeneralizedTime,u=t.DERSequence,q=t.DERSet,l=t.DERTaggedObject,Q=t.ASN1Util.newObject,c=Object.keys(A);if(1!=c.length)throw"key of param shall be only one.";var k=c[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+k+":"))throw"undefined key: "+k;if("bool"==k)return new r(A[k]);if("int"==k)return new e(A[k]);if("bitstr"==k)return new i(A[k]);if("octstr"==k)return new s(A[k]);if("null"==k)return new g(A[k]);if("oid"==k)return new a(A[k]);if("enum"==k)return new B(A[k]);if("utf8str"==k)return new n(A[k]);if("numstr"==k)return new o(A[k]);if("prnstr"==k)return new V(A[k]);if("telstr"==k)return new I(A[k]);if("ia5str"==k)return new E(A[k]);if("utctime"==k)return new C(A[k]);if("gentime"==k)return new W(A[k]);if("seq"==k){for(var d=A[k],Y=[],w=0;w<d.length;w++){var x=Q(d[w]);Y.push(x)}return new u({array:Y})}if("set"==k){for(d=A[k],Y=[],w=0;w<d.length;w++){x=Q(d[w]);Y.push(x)}return new q({array:Y})}if("tag"==k){var y=A[k];if("[object Array]"===Object.prototype.toString.call(y)&&3==y.length){var S=Q(y[2]);return new l({tag:y[0],explicit:y[1],obj:S})}var D={};if(void 0!==y.explicit&&(D.explicit=y.explicit),void 0!==y.tag&&(D.tag=y.tag),void 0===y.obj)throw"obj shall be specified for 'tag'.";return D.obj=Q(y.obj),new l(D)}},this.jsonToASN1HEX=function(A){return this.newObject(A).getEncodedHex()}},KJUR.asn1.ASN1Util.oidHexToInt=function(A){for(var t="",r=parseInt(A.substr(0,2),16),e=(t=Math.floor(r/40)+"."+r%40,""),i=2;i<A.length;i+=2){var s=("00000000"+parseInt(A.substr(i,2),16).toString(2)).slice(-8);if(e+=s.substr(1,7),"0"==s.substr(0,1))t=t+"."+new BigInteger(e,2).toString(10),e=""}return t},KJUR.asn1.ASN1Util.oidIntToHex=function(A){var t=function(A){var t=A.toString(16);return 1==t.length&&(t="0"+t),t},r=function(A){var r="",e=new BigInteger(A,10).toString(2),i=7-e.length%7;7==i&&(i=0);for(var s="",g=0;g<i;g++)s+="0";e=s+e;for(g=0;g<e.length-1;g+=7){var a=e.substr(g,7);g!=e.length-7&&(a="1"+a),r+=t(parseInt(a,2))}return r};if(!A.match(/^[0-9.]+$/))throw"malformed oid string: "+A;var e="",i=A.split("."),s=40*parseInt(i[0])+parseInt(i[1]);e+=t(s),i.splice(0,2);for(var g=0;g<i.length;g++)e+=r(i[g]);return e},KJUR.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n=0,v="+this.hV;var A=this.hV.length/2,t=A.toString(16);if(t.length%2==1&&(t="0"+t),A<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+A.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},KJUR.asn1.DERAbstractString=function(A){KJUR.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(A){this.hTLV=null,this.isModified=!0,this.s=A,this.hV=stohex(this.s)},this.setStringHex=function(A){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=A},this.getFreshValueHex=function(){return this.hV},void 0!==A&&("string"==typeof A?this.setString(A):void 0!==A.str?this.setString(A.str):void 0!==A.hex&&this.setStringHex(A.hex))},YAHOO.lang.extend(KJUR.asn1.DERAbstractString,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractTime=function(A){KJUR.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(A){return utc=A.getTime()+6e4*A.getTimezoneOffset(),new Date(utc)},this.formatDate=function(A,t,r){var e=this.zeroPadding,i=this.localDateToUTC(A),s=String(i.getFullYear());"utc"==t&&(s=s.substr(2,2));var g=s+e(String(i.getMonth()+1),2)+e(String(i.getDate()),2)+e(String(i.getHours()),2)+e(String(i.getMinutes()),2)+e(String(i.getSeconds()),2);if(!0===r){var a=i.getMilliseconds();if(0!=a){var B=e(String(a),3);g=g+"."+(B=B.replace(/[0]+$/,""))}}return g+"Z"},this.zeroPadding=function(A,t){return A.length>=t?A:new Array(t-A.length+1).join("0")+A},this.getString=function(){return this.s},this.setString=function(A){this.hTLV=null,this.isModified=!0,this.s=A,this.hV=stohex(A)},this.setByDateValue=function(A,t,r,e,i,s){var g=new Date(Date.UTC(A,t-1,r,e,i,s,0));this.setByDate(g)},this.getFreshValueHex=function(){return this.hV}},YAHOO.lang.extend(KJUR.asn1.DERAbstractTime,KJUR.asn1.ASN1Object),KJUR.asn1.DERAbstractStructured=function(A){KJUR.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(A){this.hTLV=null,this.isModified=!0,this.asn1Array=A},this.appendASN1Object=function(A){this.hTLV=null,this.isModified=!0,this.asn1Array.push(A)},this.asn1Array=new Array,void 0!==A&&void 0!==A.array&&(this.asn1Array=A.array)},YAHOO.lang.extend(KJUR.asn1.DERAbstractStructured,KJUR.asn1.ASN1Object),KJUR.asn1.DERBoolean=function(){KJUR.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},YAHOO.lang.extend(KJUR.asn1.DERBoolean,KJUR.asn1.ASN1Object),KJUR.asn1.DERInteger=function(A){KJUR.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(A){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(A)},this.setByInteger=function(A){var t=new BigInteger(String(A),10);this.setByBigInteger(t)},this.setValueHex=function(A){this.hV=A},this.getFreshValueHex=function(){return this.hV},void 0!==A&&(void 0!==A.bigint?this.setByBigInteger(A.bigint):void 0!==A.int?this.setByInteger(A.int):"number"==typeof A?this.setByInteger(A):void 0!==A.hex&&this.setValueHex(A.hex))},YAHOO.lang.extend(KJUR.asn1.DERInteger,KJUR.asn1.ASN1Object),KJUR.asn1.DERBitString=function(A){if(void 0!==A&&void 0!==A.obj){var t=KJUR.asn1.ASN1Util.newObject(A.obj);A.hex="00"+t.getEncodedHex()}KJUR.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(A){this.hTLV=null,this.isModified=!0,this.hV=A},this.setUnusedBitsAndHexValue=function(A,t){if(A<0||7<A)throw"unused bits shall be from 0 to 7: u = "+A;var r="0"+A;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(A){var t=8-(A=A.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)A+="0";var e="";for(r=0;r<A.length-1;r+=8){var i=A.substr(r,8),s=parseInt(i,2).toString(16);1==s.length&&(s="0"+s),e+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+t+e},this.setByBooleanArray=function(A){for(var t="",r=0;r<A.length;r++)1==A[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(A){for(var t=new Array(A),r=0;r<A;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==A&&("string"==typeof A&&A.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(A):void 0!==A.hex?this.setHexValueIncludingUnusedBits(A.hex):void 0!==A.bin?this.setByBinaryString(A.bin):void 0!==A.array&&this.setByBooleanArray(A.array))},YAHOO.lang.extend(KJUR.asn1.DERBitString,KJUR.asn1.ASN1Object),KJUR.asn1.DEROctetString=function(A){if(void 0!==A&&void 0!==A.obj){var t=KJUR.asn1.ASN1Util.newObject(A.obj);A.hex=t.getEncodedHex()}KJUR.asn1.DEROctetString.superclass.constructor.call(this,A),this.hT="04"},YAHOO.lang.extend(KJUR.asn1.DEROctetString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNull=function(){KJUR.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},YAHOO.lang.extend(KJUR.asn1.DERNull,KJUR.asn1.ASN1Object),KJUR.asn1.DERObjectIdentifier=function(A){var t=function(A){var t=A.toString(16);return 1==t.length&&(t="0"+t),t},r=function(A){var r="",e=new BigInteger(A,10).toString(2),i=7-e.length%7;7==i&&(i=0);for(var s="",g=0;g<i;g++)s+="0";e=s+e;for(g=0;g<e.length-1;g+=7){var a=e.substr(g,7);g!=e.length-7&&(a="1"+a),r+=t(parseInt(a,2))}return r};KJUR.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(A){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=A},this.setValueOidString=function(A){if(!A.match(/^[0-9.]+$/))throw"malformed oid string: "+A;var e="",i=A.split("."),s=40*parseInt(i[0])+parseInt(i[1]);e+=t(s),i.splice(0,2);for(var g=0;g<i.length;g++)e+=r(i[g]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(A){var t=KJUR.asn1.x509.OID.name2oid(A);if(""===t)throw"DERObjectIdentifier oidName undefined: "+A;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==A&&("string"==typeof A?A.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(A):this.setValueName(A):void 0!==A.oid?this.setValueOidString(A.oid):void 0!==A.hex?this.setValueHex(A.hex):void 0!==A.name&&this.setValueName(A.name))},YAHOO.lang.extend(KJUR.asn1.DERObjectIdentifier,KJUR.asn1.ASN1Object),KJUR.asn1.DEREnumerated=function(A){KJUR.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(A){this.hTLV=null,this.isModified=!0,this.hV=KJUR.asn1.ASN1Util.bigIntToMinTwosComplementsHex(A)},this.setByInteger=function(A){var t=new BigInteger(String(A),10);this.setByBigInteger(t)},this.setValueHex=function(A){this.hV=A},this.getFreshValueHex=function(){return this.hV},void 0!==A&&(void 0!==A.int?this.setByInteger(A.int):"number"==typeof A?this.setByInteger(A):void 0!==A.hex&&this.setValueHex(A.hex))},YAHOO.lang.extend(KJUR.asn1.DEREnumerated,KJUR.asn1.ASN1Object),KJUR.asn1.DERUTF8String=function(A){KJUR.asn1.DERUTF8String.superclass.constructor.call(this,A),this.hT="0c"},YAHOO.lang.extend(KJUR.asn1.DERUTF8String,KJUR.asn1.DERAbstractString),KJUR.asn1.DERNumericString=function(A){KJUR.asn1.DERNumericString.superclass.constructor.call(this,A),this.hT="12"},YAHOO.lang.extend(KJUR.asn1.DERNumericString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERPrintableString=function(A){KJUR.asn1.DERPrintableString.superclass.constructor.call(this,A),this.hT="13"},YAHOO.lang.extend(KJUR.asn1.DERPrintableString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERTeletexString=function(A){KJUR.asn1.DERTeletexString.superclass.constructor.call(this,A),this.hT="14"},YAHOO.lang.extend(KJUR.asn1.DERTeletexString,KJUR.asn1.DERAbstractString),KJUR.asn1.DERIA5String=function(A){KJUR.asn1.DERIA5String.superclass.constructor.call(this,A),this.hT="16"},YAHOO.lang.extend(KJUR.asn1.DERIA5String,KJUR.asn1.DERAbstractString),KJUR.asn1.DERUTCTime=function(A){KJUR.asn1.DERUTCTime.superclass.constructor.call(this,A),this.hT="17",this.setByDate=function(A){this.hTLV=null,this.isModified=!0,this.date=A,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==A&&(void 0!==A.str?this.setString(A.str):"string"==typeof A&&A.match(/^[0-9]{12}Z$/)?this.setString(A):void 0!==A.hex?this.setStringHex(A.hex):void 0!==A.date&&this.setByDate(A.date))},YAHOO.lang.extend(KJUR.asn1.DERUTCTime,KJUR.asn1.DERAbstractTime),KJUR.asn1.DERGeneralizedTime=function(A){KJUR.asn1.DERGeneralizedTime.superclass.constructor.call(this,A),this.hT="18",this.withMillis=!1,this.setByDate=function(A){this.hTLV=null,this.isModified=!0,this.date=A,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==A&&(void 0!==A.str?this.setString(A.str):"string"==typeof A&&A.match(/^[0-9]{14}Z$/)?this.setString(A):void 0!==A.hex?this.setStringHex(A.hex):void 0!==A.date&&this.setByDate(A.date),!0===A.millis&&(this.withMillis=!0))},YAHOO.lang.extend(KJUR.asn1.DERGeneralizedTime,KJUR.asn1.DERAbstractTime),KJUR.asn1.DERSequence=function(A){KJUR.asn1.DERSequence.superclass.constructor.call(this,A),this.hT="30",this.getFreshValueHex=function(){for(var A="",t=0;t<this.asn1Array.length;t++){A+=this.asn1Array[t].getEncodedHex()}return this.hV=A,this.hV}},YAHOO.lang.extend(KJUR.asn1.DERSequence,KJUR.asn1.DERAbstractStructured),KJUR.asn1.DERSet=function(A){KJUR.asn1.DERSet.superclass.constructor.call(this,A),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var A=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];A.push(r.getEncodedHex())}return 1==this.sortFlag&&A.sort(),this.hV=A.join(""),this.hV},void 0!==A&&void 0!==A.sortflag&&0==A.sortflag&&(this.sortFlag=!1)},YAHOO.lang.extend(KJUR.asn1.DERSet,KJUR.asn1.DERAbstractStructured),KJUR.asn1.DERTaggedObject=function(A){KJUR.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(A,t,r){this.hT=t,this.isExplicit=A,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==A&&(void 0!==A.tag&&(this.hT=A.tag),void 0!==A.explicit&&(this.isExplicit=A.explicit),void 0!==A.obj&&(this.asn1Object=A.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},YAHOO.lang.extend(KJUR.asn1.DERTaggedObject,KJUR.asn1.ASN1Object);var _a$1,hasRequiredJsbn,asn1,hasRequiredAsn1,ec,hasRequiredEc,utils$2,hasRequiredUtils,sm3_1$1,hasRequiredSm3$1,sm2,hasRequiredSm2,sm3_1,hasRequiredSm3,sm4_1,hasRequiredSm4,src,hasRequiredSrc,__extends=function(){var A=function(t,r){return(A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,t){A.__proto__=t}||function(A,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(A[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function e(){this.constructor=t}A(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}}(),JSEncryptRSAKey=function(A){function t(r){var e=A.call(this)||this;return r&&("string"==typeof r?e.parseKey(r):(t.hasPrivateKeyProperty(r)||t.hasPublicKeyProperty(r))&&e.parsePropertiesFrom(r)),e}return __extends(t,A),t.prototype.parseKey=function(A){try{var t=0,r=0,e=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(A)?Hex_decode(A):Base64.unarmor(A),i=ASN1.decode(e);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=parseBigInt(t,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var s=i.sub[3].getHexStringValue();this.d=parseBigInt(s,16);var g=i.sub[4].getHexStringValue();this.p=parseBigInt(g,16);var a=i.sub[5].getHexStringValue();this.q=parseBigInt(a,16);var B=i.sub[6].getHexStringValue();this.dmp1=parseBigInt(B,16);var n=i.sub[7].getHexStringValue();this.dmq1=parseBigInt(n,16);var o=i.sub[8].getHexStringValue();this.coeff=parseBigInt(o,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var V=i.sub[1].sub[0];t=V.sub[0].getHexStringValue(),this.n=parseBigInt(t,16),r=V.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=i.sub[0].getHexStringValue(),this.n=parseBigInt(t,16),r=i.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(I){return!1}},t.prototype.getPrivateBaseKey=function(){var A={array:[new KJUR.asn1.DERInteger({int:0}),new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({int:this.e}),new KJUR.asn1.DERInteger({bigint:this.d}),new KJUR.asn1.DERInteger({bigint:this.p}),new KJUR.asn1.DERInteger({bigint:this.q}),new KJUR.asn1.DERInteger({bigint:this.dmp1}),new KJUR.asn1.DERInteger({bigint:this.dmq1}),new KJUR.asn1.DERInteger({bigint:this.coeff})]};return new KJUR.asn1.DERSequence(A).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return hex2b64(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var A=new KJUR.asn1.DERSequence({array:[new KJUR.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new KJUR.asn1.DERNull]}),t=new KJUR.asn1.DERSequence({array:[new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({int:this.e})]}),r=new KJUR.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new KJUR.asn1.DERSequence({array:[A,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return hex2b64(this.getPublicBaseKey())},t.wordwrap=function(A,t){if(!A)return A;var r="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return A.match(RegExp(r,"g")).join("\n")},t.prototype.getPrivateKey=function(){var A="-----BEGIN RSA PRIVATE KEY-----\n";return A+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n",A+="-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var A="-----BEGIN PUBLIC KEY-----\n";return A+=t.wordwrap(this.getPublicBaseKeyB64())+"\n",A+="-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(A){return(A=A||{}).hasOwnProperty("n")&&A.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(A){return(A=A||{}).hasOwnProperty("n")&&A.hasOwnProperty("e")&&A.hasOwnProperty("d")&&A.hasOwnProperty("p")&&A.hasOwnProperty("q")&&A.hasOwnProperty("dmp1")&&A.hasOwnProperty("dmq1")&&A.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(A){this.n=A.n,this.e=A.e,A.hasOwnProperty("d")&&(this.d=A.d,this.p=A.p,this.q=A.q,this.dmp1=A.dmp1,this.dmq1=A.dmq1,this.coeff=A.coeff)},t}(RSAKey),version$1="undefined"!=typeof process?null===(_a$1=process.env)||void 0===_a$1?void 0:_a$1.npm_package_version:void 0,JSEncrypt=function(){function A(A){void 0===A&&(A={}),A=A||{},this.default_key_size=A.default_key_size?parseInt(A.default_key_size,10):1024,this.default_public_exponent=A.default_public_exponent||"010001",this.log=A.log||!1,this.key=null}return A.prototype.setKey=function(A){this.log&&this.key,this.key=new JSEncryptRSAKey(A)},A.prototype.setPrivateKey=function(A){this.setKey(A)},A.prototype.setPublicKey=function(A){this.setKey(A)},A.prototype.decrypt=function(A){try{return this.getKey().decrypt(b64tohex(A))}catch(t){return!1}},A.prototype.encrypt=function(A){try{return hex2b64(this.getKey().encrypt(A))}catch(t){return!1}},A.prototype.sign=function(A,t,r){try{return hex2b64(this.getKey().sign(A,t,r))}catch(e){return!1}},A.prototype.verify=function(A,t,r){try{return this.getKey().verify(A,b64tohex(t),r)}catch(e){return!1}},A.prototype.getKey=function(A){if(!this.key){if(this.key=new JSEncryptRSAKey,A&&"[object Function]"==={}.toString.call(A))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,A);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},A.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},A.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},A.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},A.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},A.version=version$1,A}(),jsbn$1={exports:{}},jsbn=jsbn$1.exports;function requireJsbn(){return hasRequiredJsbn||(hasRequiredJsbn=1,A=jsbn$1,function(){var t;function r(A,t,r){null!=A&&("number"==typeof A?this.fromNumber(A,t,r):null==t&&"string"!=typeof A?this.fromString(A,256):this.fromString(A,t))}function e(){return new r(null)}var i="undefined"!=typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(A,t,r,e,i,s){for(var g=32767&t,a=t>>15;--s>=0;){var B=32767&this[A],n=this[A++]>>15,o=a*B+n*g;i=((B=g*B+((32767&o)<<15)+r[e]+(1073741823&i))>>>30)+(o>>>15)+a*n+(i>>>30),r[e++]=1073741823&B}return i},t=30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(A,t,r,e,i,s){for(;--s>=0;){var g=t*this[A++]+r[e]+i;i=Math.floor(g/67108864),r[e++]=67108863&g}return i},t=26):(r.prototype.am=function(A,t,r,e,i,s){for(var g=16383&t,a=t>>14;--s>=0;){var B=16383&this[A],n=this[A++]>>14,o=a*B+n*g;i=((B=g*B+((16383&o)<<14)+r[e]+i)>>28)+(o>>14)+a*n,r[e++]=268435455&B}return i},t=28),r.prototype.DB=t,r.prototype.DM=(1<<t)-1,r.prototype.DV=1<<t,r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-t,r.prototype.F2=2*t-52;var s,g,a=new Array;for(s="0".charCodeAt(0),g=0;g<=9;++g)a[s++]=g;for(s="a".charCodeAt(0),g=10;g<36;++g)a[s++]=g;for(s="A".charCodeAt(0),g=10;g<36;++g)a[s++]=g;function B(A){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(A)}function n(A,t){var r=a[A.charCodeAt(t)];return null==r?-1:r}function o(A){var t=e();return t.fromInt(A),t}function V(A){var t,r=1;return 0!=(t=A>>>16)&&(A=t,r+=16),0!=(t=A>>8)&&(A=t,r+=8),0!=(t=A>>4)&&(A=t,r+=4),0!=(t=A>>2)&&(A=t,r+=2),0!=(t=A>>1)&&(A=t,r+=1),r}function I(A){this.m=A}function E(A){this.m=A,this.mp=A.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<A.DB-15)-1,this.mt2=2*A.t}function C(A,t){return A&t}function W(A,t){return A|t}function u(A,t){return A^t}function q(A,t){return A&~t}function l(A){if(0==A)return-1;var t=0;return 65535&A||(A>>=16,t+=16),255&A||(A>>=8,t+=8),15&A||(A>>=4,t+=4),3&A||(A>>=2,t+=2),1&A||++t,t}function Q(A){for(var t=0;0!=A;)A&=A-1,++t;return t}function c(){}function k(A){return A}function d(A){this.r2=e(),this.q3=e(),r.ONE.dlShiftTo(2*A.t,this.r2),this.mu=this.r2.divide(A),this.m=A}I.prototype.convert=function(A){return A.s<0||A.compareTo(this.m)>=0?A.mod(this.m):A},I.prototype.revert=function(A){return A},I.prototype.reduce=function(A){A.divRemTo(this.m,null,A)},I.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r),this.reduce(r)},I.prototype.sqrTo=function(A,t){A.squareTo(t),this.reduce(t)},E.prototype.convert=function(A){var t=e();return A.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),A.s<0&&t.compareTo(r.ZERO)>0&&this.m.subTo(t,t),t},E.prototype.revert=function(A){var t=e();return A.copyTo(t),this.reduce(t),t},E.prototype.reduce=function(A){for(;A.t<=this.mt2;)A[A.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&A[t],e=r*this.mpl+((r*this.mph+(A[t]>>15)*this.mpl&this.um)<<15)&A.DM;for(A[r=t+this.m.t]+=this.m.am(0,e,A,t,0,this.m.t);A[r]>=A.DV;)A[r]-=A.DV,A[++r]++}A.clamp(),A.drShiftTo(this.m.t,A),A.compareTo(this.m)>=0&&A.subTo(this.m,A)},E.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r),this.reduce(r)},E.prototype.sqrTo=function(A,t){A.squareTo(t),this.reduce(t)},r.prototype.copyTo=function(A){for(var t=this.t-1;t>=0;--t)A[t]=this[t];A.t=this.t,A.s=this.s},r.prototype.fromInt=function(A){this.t=1,this.s=A<0?-1:0,A>0?this[0]=A:A<-1?this[0]=A+this.DV:this.t=0},r.prototype.fromString=function(A,t){var e;if(16==t)e=4;else if(8==t)e=3;else if(256==t)e=8;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return void this.fromRadix(A,t);e=2}this.t=0,this.s=0;for(var i=A.length,s=!1,g=0;--i>=0;){var a=8==e?255&A[i]:n(A,i);a<0?"-"==A.charAt(i)&&(s=!0):(s=!1,0==g?this[this.t++]=a:g+e>this.DB?(this[this.t-1]|=(a&(1<<this.DB-g)-1)<<g,this[this.t++]=a>>this.DB-g):this[this.t-1]|=a<<g,(g+=e)>=this.DB&&(g-=this.DB))}8==e&&128&A[0]&&(this.s=-1,g>0&&(this[this.t-1]|=(1<<this.DB-g)-1<<g)),this.clamp(),s&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var A=this.s&this.DM;this.t>0&&this[this.t-1]==A;)--this.t},r.prototype.dlShiftTo=function(A,t){var r;for(r=this.t-1;r>=0;--r)t[r+A]=this[r];for(r=A-1;r>=0;--r)t[r]=0;t.t=this.t+A,t.s=this.s},r.prototype.drShiftTo=function(A,t){for(var r=A;r<this.t;++r)t[r-A]=this[r];t.t=Math.max(this.t-A,0),t.s=this.s},r.prototype.lShiftTo=function(A,t){var r,e=A%this.DB,i=this.DB-e,s=(1<<i)-1,g=Math.floor(A/this.DB),a=this.s<<e&this.DM;for(r=this.t-1;r>=0;--r)t[r+g+1]=this[r]>>i|a,a=(this[r]&s)<<e;for(r=g-1;r>=0;--r)t[r]=0;t[g]=a,t.t=this.t+g+1,t.s=this.s,t.clamp()},r.prototype.rShiftTo=function(A,t){t.s=this.s;var r=Math.floor(A/this.DB);if(r>=this.t)t.t=0;else{var e=A%this.DB,i=this.DB-e,s=(1<<e)-1;t[0]=this[r]>>e;for(var g=r+1;g<this.t;++g)t[g-r-1]|=(this[g]&s)<<i,t[g-r]=this[g]>>e;e>0&&(t[this.t-r-1]|=(this.s&s)<<i),t.t=this.t-r,t.clamp()}},r.prototype.subTo=function(A,t){for(var r=0,e=0,i=Math.min(A.t,this.t);r<i;)e+=this[r]-A[r],t[r++]=e&this.DM,e>>=this.DB;if(A.t<this.t){for(e-=A.s;r<this.t;)e+=this[r],t[r++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;r<A.t;)e-=A[r],t[r++]=e&this.DM,e>>=this.DB;e-=A.s}t.s=e<0?-1:0,e<-1?t[r++]=this.DV+e:e>0&&(t[r++]=e),t.t=r,t.clamp()},r.prototype.multiplyTo=function(A,t){var e=this.abs(),i=A.abs(),s=e.t;for(t.t=s+i.t;--s>=0;)t[s]=0;for(s=0;s<i.t;++s)t[s+e.t]=e.am(0,i[s],t,s,0,e.t);t.s=0,t.clamp(),this.s!=A.s&&r.ZERO.subTo(t,t)},r.prototype.squareTo=function(A){for(var t=this.abs(),r=A.t=2*t.t;--r>=0;)A[r]=0;for(r=0;r<t.t-1;++r){var e=t.am(r,t[r],A,2*r,0,1);(A[r+t.t]+=t.am(r+1,2*t[r],A,2*r+1,e,t.t-r-1))>=t.DV&&(A[r+t.t]-=t.DV,A[r+t.t+1]=1)}A.t>0&&(A[A.t-1]+=t.am(r,t[r],A,2*r,0,1)),A.s=0,A.clamp()},r.prototype.divRemTo=function(A,t,i){var s=A.abs();if(!(s.t<=0)){var g=this.abs();if(g.t<s.t)return null!=t&&t.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=e());var a=e(),B=this.s,n=A.s,o=this.DB-V(s[s.t-1]);o>0?(s.lShiftTo(o,a),g.lShiftTo(o,i)):(s.copyTo(a),g.copyTo(i));var I=a.t,E=a[I-1];if(0!=E){var C=E*(1<<this.F1)+(I>1?a[I-2]>>this.F2:0),W=this.FV/C,u=(1<<this.F1)/C,q=1<<this.F2,l=i.t,Q=l-I,c=null==t?e():t;for(a.dlShiftTo(Q,c),i.compareTo(c)>=0&&(i[i.t++]=1,i.subTo(c,i)),r.ONE.dlShiftTo(I,c),c.subTo(a,a);a.t<I;)a[a.t++]=0;for(;--Q>=0;){var k=i[--l]==E?this.DM:Math.floor(i[l]*W+(i[l-1]+q)*u);if((i[l]+=a.am(0,k,i,Q,0,I))<k)for(a.dlShiftTo(Q,c),i.subTo(c,i);i[l]<--k;)i.subTo(c,i)}null!=t&&(i.drShiftTo(I,t),B!=n&&r.ZERO.subTo(t,t)),i.t=I,i.clamp(),o>0&&i.rShiftTo(o,i),B<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var A=this[0];if(!(1&A))return 0;var t=3&A;return(t=(t=(t=(t=t*(2-(15&A)*t)&15)*(2-(255&A)*t)&255)*(2-((65535&A)*t&65535))&65535)*(2-A*t%this.DV)%this.DV)>0?this.DV-t:-t},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(A,t){if(A>4294967295||A<1)return r.ONE;var i=e(),s=e(),g=t.convert(this),a=V(A)-1;for(g.copyTo(i);--a>=0;)if(t.sqrTo(i,s),(A&1<<a)>0)t.mulTo(s,g,i);else{var B=i;i=s,s=B}return t.revert(i)},r.prototype.toString=function(A){if(this.s<0)return"-"+this.negate().toString(A);var t;if(16==A)t=4;else if(8==A)t=3;else if(2==A)t=1;else if(32==A)t=5;else{if(4!=A)return this.toRadix(A);t=2}var r,e=(1<<t)-1,i=!1,s="",g=this.t,a=this.DB-g*this.DB%t;if(g-- >0)for(a<this.DB&&(r=this[g]>>a)>0&&(i=!0,s=B(r));g>=0;)a<t?(r=(this[g]&(1<<a)-1)<<t-a,r|=this[--g]>>(a+=this.DB-t)):(r=this[g]>>(a-=t)&e,a<=0&&(a+=this.DB,--g)),r>0&&(i=!0),i&&(s+=B(r));return i?s:"0"},r.prototype.negate=function(){var A=e();return r.ZERO.subTo(this,A),A},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(A){var t=this.s-A.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-A.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-A[r]))return t;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+V(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(A){var t=e();return this.abs().divRemTo(A,null,t),this.s<0&&t.compareTo(r.ZERO)>0&&A.subTo(t,t),t},r.prototype.modPowInt=function(A,t){var r;return r=A<256||t.isEven()?new I(t):new E(t),this.exp(A,r)},r.ZERO=o(0),r.ONE=o(1),c.prototype.convert=k,c.prototype.revert=k,c.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r)},c.prototype.sqrTo=function(A,t){A.squareTo(t)},d.prototype.convert=function(A){if(A.s<0||A.t>2*this.m.t)return A.mod(this.m);if(A.compareTo(this.m)<0)return A;var t=e();return A.copyTo(t),this.reduce(t),t},d.prototype.revert=function(A){return A},d.prototype.reduce=function(A){for(A.drShiftTo(this.m.t-1,this.r2),A.t>this.m.t+1&&(A.t=this.m.t+1,A.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);A.compareTo(this.r2)<0;)A.dAddOffset(1,this.m.t+1);for(A.subTo(this.r2,A);A.compareTo(this.m)>=0;)A.subTo(this.m,A)},d.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r),this.reduce(r)},d.prototype.sqrTo=function(A,t){A.squareTo(t),this.reduce(t)};var Y,w,x,y=[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],S=(1<<26)/y[y.length-1];function D(){var A;A=(new Date).getTime(),w[x++]^=255&A,w[x++]^=A>>8&255,w[x++]^=A>>16&255,w[x++]^=A>>24&255,x>=F&&(x-=F)}if(r.prototype.chunkSize=function(A){return Math.floor(Math.LN2*this.DB/Math.log(A))},r.prototype.toRadix=function(A){if(null==A&&(A=10),0==this.signum()||A<2||A>36)return"0";var t=this.chunkSize(A),r=Math.pow(A,t),i=o(r),s=e(),g=e(),a="";for(this.divRemTo(i,s,g);s.signum()>0;)a=(r+g.intValue()).toString(A).substr(1)+a,s.divRemTo(i,s,g);return g.intValue().toString(A)+a},r.prototype.fromRadix=function(A,t){this.fromInt(0),null==t&&(t=10);for(var e=this.chunkSize(t),i=Math.pow(t,e),s=!1,g=0,a=0,B=0;B<A.length;++B){var o=n(A,B);o<0?"-"==A.charAt(B)&&0==this.signum()&&(s=!0):(a=t*a+o,++g>=e&&(this.dMultiply(i),this.dAddOffset(a,0),g=0,a=0))}g>0&&(this.dMultiply(Math.pow(t,g)),this.dAddOffset(a,0)),s&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(A,t,e){if("number"==typeof t)if(A<2)this.fromInt(1);else for(this.fromNumber(A,e),this.testBit(A-1)||this.bitwiseTo(r.ONE.shiftLeft(A-1),W,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>A&&this.subTo(r.ONE.shiftLeft(A-1),this);else{var i=new Array,s=7&A;i.length=1+(A>>3),t.nextBytes(i),s>0?i[0]&=(1<<s)-1:i[0]=0,this.fromString(i,256)}},r.prototype.bitwiseTo=function(A,t,r){var e,i,s=Math.min(A.t,this.t);for(e=0;e<s;++e)r[e]=t(this[e],A[e]);if(A.t<this.t){for(i=A.s&this.DM,e=s;e<this.t;++e)r[e]=t(this[e],i);r.t=this.t}else{for(i=this.s&this.DM,e=s;e<A.t;++e)r[e]=t(i,A[e]);r.t=A.t}r.s=t(this.s,A.s),r.clamp()},r.prototype.changeBit=function(A,t){var e=r.ONE.shiftLeft(A);return this.bitwiseTo(e,t,e),e},r.prototype.addTo=function(A,t){for(var r=0,e=0,i=Math.min(A.t,this.t);r<i;)e+=this[r]+A[r],t[r++]=e&this.DM,e>>=this.DB;if(A.t<this.t){for(e+=A.s;r<this.t;)e+=this[r],t[r++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;r<A.t;)e+=A[r],t[r++]=e&this.DM,e>>=this.DB;e+=A.s}t.s=e<0?-1:0,e>0?t[r++]=e:e<-1&&(t[r++]=this.DV+e),t.t=r,t.clamp()},r.prototype.dMultiply=function(A){this[this.t]=this.am(0,A-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(A,t){if(0!=A){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=A;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},r.prototype.multiplyLowerTo=function(A,t,r){var e,i=Math.min(this.t+A.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(e=r.t-this.t;i<e;++i)r[i+this.t]=this.am(0,A[i],r,i,0,this.t);for(e=Math.min(A.t,t);i<e;++i)this.am(0,A[i],r,i,0,t-i);r.clamp()},r.prototype.multiplyUpperTo=function(A,t,r){--t;var e=r.t=this.t+A.t-t;for(r.s=0;--e>=0;)r[e]=0;for(e=Math.max(t-this.t,0);e<A.t;++e)r[this.t+e-t]=this.am(t-e,A[e],r,0,0,this.t+e-t);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function(A){if(A<=0)return 0;var t=this.DV%A,r=this.s<0?A-1:0;if(this.t>0)if(0==t)r=this[0]%A;else for(var e=this.t-1;e>=0;--e)r=(t*r+this[e])%A;return r},r.prototype.millerRabin=function(A){var t=this.subtract(r.ONE),i=t.getLowestSetBit();if(i<=0)return!1;var s=t.shiftRight(i);(A=A+1>>1)>y.length&&(A=y.length);for(var g=e(),a=0;a<A;++a){g.fromInt(y[Math.floor(Math.random()*y.length)]);var B=g.modPow(s,this);if(0!=B.compareTo(r.ONE)&&0!=B.compareTo(t)){for(var n=1;n++<i&&0!=B.compareTo(t);)if(0==(B=B.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=B.compareTo(t))return!1}}return!0},r.prototype.clone=function(){var A=e();return this.copyTo(A),A},r.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var A=this.t,t=new Array;t[0]=this.s;var r,e=this.DB-A*this.DB%8,i=0;if(A-- >0)for(e<this.DB&&(r=this[A]>>e)!=(this.s&this.DM)>>e&&(t[i++]=r|this.s<<this.DB-e);A>=0;)e<8?(r=(this[A]&(1<<e)-1)<<8-e,r|=this[--A]>>(e+=this.DB-8)):(r=this[A]>>(e-=8)&255,e<=0&&(e+=this.DB,--A)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},r.prototype.equals=function(A){return 0==this.compareTo(A)},r.prototype.min=function(A){return this.compareTo(A)<0?this:A},r.prototype.max=function(A){return this.compareTo(A)>0?this:A},r.prototype.and=function(A){var t=e();return this.bitwiseTo(A,C,t),t},r.prototype.or=function(A){var t=e();return this.bitwiseTo(A,W,t),t},r.prototype.xor=function(A){var t=e();return this.bitwiseTo(A,u,t),t},r.prototype.andNot=function(A){var t=e();return this.bitwiseTo(A,q,t),t},r.prototype.not=function(){for(var A=e(),t=0;t<this.t;++t)A[t]=this.DM&~this[t];return A.t=this.t,A.s=~this.s,A},r.prototype.shiftLeft=function(A){var t=e();return A<0?this.rShiftTo(-A,t):this.lShiftTo(A,t),t},r.prototype.shiftRight=function(A){var t=e();return A<0?this.lShiftTo(-A,t):this.rShiftTo(A,t),t},r.prototype.getLowestSetBit=function(){for(var A=0;A<this.t;++A)if(0!=this[A])return A*this.DB+l(this[A]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var A=0,t=this.s&this.DM,r=0;r<this.t;++r)A+=Q(this[r]^t);return A},r.prototype.testBit=function(A){var t=Math.floor(A/this.DB);return t>=this.t?0!=this.s:!!(this[t]&1<<A%this.DB)},r.prototype.setBit=function(A){return this.changeBit(A,W)},r.prototype.clearBit=function(A){return this.changeBit(A,q)},r.prototype.flipBit=function(A){return this.changeBit(A,u)},r.prototype.add=function(A){var t=e();return this.addTo(A,t),t},r.prototype.subtract=function(A){var t=e();return this.subTo(A,t),t},r.prototype.multiply=function(A){var t=e();return this.multiplyTo(A,t),t},r.prototype.divide=function(A){var t=e();return this.divRemTo(A,t,null),t},r.prototype.remainder=function(A){var t=e();return this.divRemTo(A,null,t),t},r.prototype.divideAndRemainder=function(A){var t=e(),r=e();return this.divRemTo(A,t,r),new Array(t,r)},r.prototype.modPow=function(A,t){var r,i,s=A.bitLength(),g=o(1);if(s<=0)return g;r=s<18?1:s<48?3:s<144?4:s<768?5:6,i=s<8?new I(t):t.isEven()?new d(t):new E(t);var a=new Array,B=3,n=r-1,C=(1<<r)-1;if(a[1]=i.convert(this),r>1){var W=e();for(i.sqrTo(a[1],W);B<=C;)a[B]=e(),i.mulTo(W,a[B-2],a[B]),B+=2}var u,q,l=A.t-1,Q=!0,c=e();for(s=V(A[l])-1;l>=0;){for(s>=n?u=A[l]>>s-n&C:(u=(A[l]&(1<<s+1)-1)<<n-s,l>0&&(u|=A[l-1]>>this.DB+s-n)),B=r;!(1&u);)u>>=1,--B;if((s-=B)<0&&(s+=this.DB,--l),Q)a[u].copyTo(g),Q=!1;else{for(;B>1;)i.sqrTo(g,c),i.sqrTo(c,g),B-=2;B>0?i.sqrTo(g,c):(q=g,g=c,c=q),i.mulTo(c,a[u],g)}for(;l>=0&&!(A[l]&1<<s);)i.sqrTo(g,c),q=g,g=c,c=q,--s<0&&(s=this.DB-1,--l)}return i.revert(g)},r.prototype.modInverse=function(A){var t=A.isEven();if(this.isEven()&&t||0==A.signum())return r.ZERO;for(var e=A.clone(),i=this.clone(),s=o(1),g=o(0),a=o(0),B=o(1);0!=e.signum();){for(;e.isEven();)e.rShiftTo(1,e),t?(s.isEven()&&g.isEven()||(s.addTo(this,s),g.subTo(A,g)),s.rShiftTo(1,s)):g.isEven()||g.subTo(A,g),g.rShiftTo(1,g);for(;i.isEven();)i.rShiftTo(1,i),t?(a.isEven()&&B.isEven()||(a.addTo(this,a),B.subTo(A,B)),a.rShiftTo(1,a)):B.isEven()||B.subTo(A,B),B.rShiftTo(1,B);e.compareTo(i)>=0?(e.subTo(i,e),t&&s.subTo(a,s),g.subTo(B,g)):(i.subTo(e,i),t&&a.subTo(s,a),B.subTo(g,B))}return 0!=i.compareTo(r.ONE)?r.ZERO:B.compareTo(A)>=0?B.subtract(A):B.signum()<0?(B.addTo(A,B),B.signum()<0?B.add(A):B):B},r.prototype.pow=function(A){return this.exp(A,new c)},r.prototype.gcd=function(A){var t=this.s<0?this.negate():this.clone(),r=A.s<0?A.negate():A.clone();if(t.compareTo(r)<0){var e=t;t=r,r=e}var i=t.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return t;for(i<s&&(s=i),s>0&&(t.rShiftTo(s,t),r.rShiftTo(s,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r},r.prototype.isProbablePrime=function(A){var t,r=this.abs();if(1==r.t&&r[0]<=y[y.length-1]){for(t=0;t<y.length;++t)if(r[0]==y[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<y.length;){for(var e=y[t],i=t+1;i<y.length&&e<S;)e*=y[i++];for(e=r.modInt(e);t<i;)if(e%y[t++]==0)return!1}return r.millerRabin(A)},r.prototype.square=function(){var A=e();return this.squareTo(A),A},r.prototype.Barrett=d,null==w){var f;if(w=new Array,x=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var J=new Uint8Array(32);for(window.crypto.getRandomValues(J),f=0;f<32;++f)w[x++]=J[f]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var b=window.crypto.random(32);for(f=0;f<b.length;++f)w[x++]=255&b.charCodeAt(f)}for(;x<F;)f=Math.floor(65536*Math.random()),w[x++]=f>>>8,w[x++]=255&f;x=0,D()}function p(){if(null==Y){for(D(),(Y=new h).init(w),x=0;x<w.length;++x)w[x]=0;x=0}return Y.next()}function K(){}function h(){this.i=0,this.j=0,this.S=new Array}K.prototype.nextBytes=function(A){var t;for(t=0;t<A.length;++t)A[t]=p()},h.prototype.init=function(A){var t,r,e;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+A[t%A.length]&255,e=this.S[t],this.S[t]=this.S[r],this.S[r]=e;this.i=0,this.j=0},h.prototype.next=function(){var A;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,A=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=A,this.S[A+this.S[this.i]&255]};var F=256;A.exports={default:r,BigInteger:r,SecureRandom:K}}.call(jsbn)),jsbn$1.exports;var A}function requireAsn1(){if(hasRequiredAsn1)return asn1;hasRequiredAsn1=1;const{BigInteger:A}=requireJsbn();class t{constructor(){this.tlv=null,this.t="00",this.l="00",this.v=""}getEncodedHex(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}getLength(){const A=this.v.length/2;let t=A.toString(16);if(t.length%2==1&&(t="0"+t),A<128)return t;return(128+t.length/2).toString(16)+t}getValue(){return""}}class r extends t{constructor(t){super(),this.t="02",t&&(this.v=function(t){let r=t.toString(16);if("-"!==r[0])r.length%2==1?r="0"+r:r.match(/^[0-7]/)||(r="00"+r);else{r=r.substr(1);let e=r.length;e%2==1?e+=1:r.match(/^[0-7]/)||(e+=2);let i="";for(let A=0;A<e;A++)i+="f";i=new A(i,16),r=i.xor(t).add(A.ONE),r=r.toString(16).replace(/^-/,"")}return r}(t))}getValue(){return this.v}}class e extends t{constructor(A){super(),this.t="30",this.asn1Array=A}getValue(){return this.v=this.asn1Array.map(A=>A.getEncodedHex()).join(""),this.v}}function i(A,t){return+A[t+2]<8?1:128&+A.substr(t+2,2)}function s(t,r){const e=i(t,r),s=t.substr(r+2,2*e);if(!s)return-1;return(+s[0]<8?new A(s,16):new A(s.substr(2),16)).intValue()}function g(A,t){return t+2*(i(A,t)+1)}return asn1={encodeDer(A,t){const i=new r(A),s=new r(t);return new e([i,s]).getEncodedHex()},decodeDer(t){const r=g(t,0),e=g(t,r),i=s(t,r),a=t.substr(e,2*i),B=e+a.length,n=g(t,B),o=s(t,B),V=t.substr(n,2*o);return{r:new A(a,16),s:new A(V,16)}}}}function requireUtils(){if(hasRequiredUtils)return utils$2;hasRequiredUtils=1;const{BigInteger:A,SecureRandom:t}=requireJsbn(),{ECCurveFp:r}=function(){if(hasRequiredEc)return ec;hasRequiredEc=1;const{BigInteger:A}=requireJsbn(),t=new A("2"),r=new A("3");class e{constructor(A,t){this.x=t,this.q=A}equals(A){return A===this||this.q.equals(A.q)&&this.x.equals(A.x)}toBigInteger(){return this.x}negate(){return new e(this.q,this.x.negate().mod(this.q))}add(A){return new e(this.q,this.x.add(A.toBigInteger()).mod(this.q))}subtract(A){return new e(this.q,this.x.subtract(A.toBigInteger()).mod(this.q))}multiply(A){return new e(this.q,this.x.multiply(A.toBigInteger()).mod(this.q))}divide(A){return new e(this.q,this.x.multiply(A.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new e(this.q,this.x.square().mod(this.q))}}class i{constructor(t,r,e,i){this.curve=t,this.x=r,this.y=e,this.z=null==i?A.ONE:i,this.zinv=null}getX(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}getY(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}equals(t){return t===this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(A.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(A.ZERO))}isInfinity(){return null===this.x&&null===this.y||this.z.equals(A.ZERO)&&!this.y.toBigInteger().equals(A.ZERO)}negate(){return new i(this.curve,this.x,this.y.negate(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;const r=this.x.toBigInteger(),e=this.y.toBigInteger(),s=this.z,g=t.x.toBigInteger(),a=t.y.toBigInteger(),B=t.z,n=this.curve.q,o=r.multiply(B).mod(n),V=g.multiply(s).mod(n),I=o.subtract(V),E=e.multiply(B).mod(n),C=a.multiply(s).mod(n),W=E.subtract(C);if(A.ZERO.equals(I))return A.ZERO.equals(W)?this.twice():this.curve.infinity;const u=o.add(V),q=s.multiply(B).mod(n),l=I.square().mod(n),Q=I.multiply(l).mod(n),c=q.multiply(W.square()).subtract(u.multiply(l)).mod(n),k=I.multiply(c).mod(n),d=W.multiply(l.multiply(o).subtract(c)).subtract(E.multiply(Q)).mod(n),Y=Q.multiply(q).mod(n);return new i(this.curve,this.curve.fromBigInteger(k),this.curve.fromBigInteger(d),Y)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const A=this.x.toBigInteger(),t=this.y.toBigInteger(),e=this.z,s=this.curve.q,g=this.curve.a.toBigInteger(),a=A.square().multiply(r).add(g.multiply(e.square())).mod(s),B=t.shiftLeft(1).multiply(e).mod(s),n=t.square().mod(s),o=n.multiply(A).multiply(e).mod(s),V=B.square().mod(s),I=a.square().subtract(o.shiftLeft(3)).mod(s),E=B.multiply(I).mod(s),C=a.multiply(o.shiftLeft(2).subtract(I)).subtract(V.shiftLeft(1).multiply(n)).mod(s),W=B.multiply(V).mod(s);return new i(this.curve,this.curve.fromBigInteger(E),this.curve.fromBigInteger(C),W)}multiply(A){if(this.isInfinity())return this;if(!A.signum())return this.curve.infinity;const t=A.multiply(r),e=this.negate();let i=this;for(let r=t.bitLength()-2;r>0;r--){i=i.twice();const s=t.testBit(r);s!==A.testBit(r)&&(i=i.add(s?this:e))}return i}}return ec={ECPointFp:i,ECCurveFp:class{constructor(A,t,r){this.q=A,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new i(this,null,null)}equals(A){return A===this||this.q.equals(A.q)&&this.a.equals(A.a)&&this.b.equals(A.b)}fromBigInteger(A){return new e(this.q,A)}decodePointHex(r){switch(parseInt(r.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const e=this.fromBigInteger(new A(r.substr(2),16));let s=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new A("4")).add(A.ONE),this.q));return s.toBigInteger().mod(t).equals(new A(r.substr(0,2),16).subtract(t))||(s=s.negate()),new i(this,e,s);case 4:case 6:case 7:const g=(r.length-2)/2,a=r.substr(2,g),B=r.substr(g+2,g);return new i(this,this.fromBigInteger(new A(a,16)),this.fromBigInteger(new A(B,16)));default:return null}}}}}(),e=new t,{curve:i,G:s,n:g}=a();function a(){const t=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),e=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),i=new A("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),s=new r(t,e,i),g=s.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:s,G:g,n:new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function B(A,t){return A.length>=t?A:new Array(t-A.length+1).join("0")+A}return utils$2={getGlobalCurve:function(){return i},generateEcparam:a,generateKeyPairHex:function(t,r,i){const a=(t?new A(t,r,i):new A(g.bitLength(),e)).mod(g.subtract(A.ONE)).add(A.ONE),n=B(a.toString(16),64),o=s.multiply(a);return{privateKey:n,publicKey:"04"+B(o.getX().toBigInteger().toString(16),64)+B(o.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(t){if(130!==t.length)throw new Error("Invalid public key to compress");const r=(t.length-2)/2,e=t.substr(2,r);let i="03";return new A(t.substr(r+2,r),16).mod(new A("2")).equals(A.ZERO)&&(i="02"),i+e},utf8ToHex:function(A){const t=(A=unescape(encodeURIComponent(A))).length,r=[];for(let i=0;i<t;i++)r[i>>>2]|=(255&A.charCodeAt(i))<<24-i%4*8;const e=[];for(let i=0;i<t;i++){const A=r[i>>>2]>>>24-i%4*8&255;e.push((A>>>4).toString(16)),e.push((15&A).toString(16))}return e.join("")},leftPad:B,arrayToHex:function(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")},arrayToUtf8:function(A){const t=[];let r=0;for(let i=0;i<2*A.length;i+=2)t[i>>>3]|=parseInt(A[r],10)<<24-i%8*4,r++;try{const r=[];for(let e=0;e<A.length;e++){const A=t[e>>>2]>>>24-e%4*8&255;r.push(String.fromCharCode(A))}return decodeURIComponent(escape(r.join("")))}catch(e){throw new Error("Malformed UTF-8 data")}},hexToArray:function(A){const t=[];let r=A.length;r%2!=0&&(A=B(A,r+1)),r=A.length;for(let e=0;e<r;e+=2)t.push(parseInt(A.substr(e,2),16));return t},verifyPublicKey:function(A){const t=i.decodePointHex(A);if(!t)return!1;const r=t.getX();return t.getY().square().equals(r.multiply(r.square()).add(r.multiply(i.a)).add(i.b))},comparePublicKeyHex:function(A,t){const r=i.decodePointHex(A);if(!r)return!1;const e=i.decodePointHex(t);return!!e&&r.equals(e)}}}function requireSm3$1(){if(hasRequiredSm3$1)return sm3_1$1;hasRequiredSm3$1=1;const A=new Uint32Array(68),t=new Uint32Array(64);function r(A,t){const r=31&t;return A<<r|A>>>32-r}function e(A,t){const r=[];for(let e=A.length-1;e>=0;e--)r[e]=255&(A[e]^t[e]);return r}function i(A){return A^r(A,9)^r(A,17)}function s(A){return A^r(A,15)^r(A,23)}function g(e){let g=8*e.length,a=g%512;a=a>=448?512-a%448-1:448-a-1;const B=new Array((a-7)/8),n=new Array(8);for(let A=0,t=B.length;A<t;A++)B[A]=0;for(let A=0,t=n.length;A<t;A++)n[A]=0;g=g.toString(2);for(let A=7;A>=0;A--)if(g.length>8){const t=g.length-8;n[A]=parseInt(g.substr(t),2),g=g.substr(0,t)}else g.length>0&&(n[A]=parseInt(g,2),g="");const o=new Uint8Array([...e,128,...B,...n]),V=new DataView(o.buffer,0),I=o.length/64,E=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let W=0;W<I;W++){A.fill(0),t.fill(0);const e=16*W;for(let t=0;t<16;t++)A[t]=V.getUint32(4*(e+t),!1);for(let t=16;t<68;t++)A[t]=s(A[t-16]^A[t-9]^r(A[t-3],15))^r(A[t-13],7)^A[t-6];for(let r=0;r<64;r++)t[r]=A[r]^A[r+4];const g=2043430169,a=2055708042;let B,n,o,I,C,u=E[0],q=E[1],l=E[2],Q=E[3],c=E[4],k=E[5],d=E[6],Y=E[7];for(let s=0;s<64;s++)C=s>=0&&s<=15?g:a,B=r(r(u,12)+c+r(C,s),7),n=B^r(u,12),o=(s>=0&&s<=15?u^q^l:u&q|u&l|q&l)+Q+n+t[s],I=(s>=0&&s<=15?c^k^d:c&k|~c&d)+Y+B+A[s],Q=l,l=r(q,9),q=u,u=o,Y=d,d=r(k,19),k=c,c=i(I);E[0]^=u,E[1]^=q,E[2]^=l,E[3]^=Q,E[4]^=c,E[5]^=k,E[6]^=d,E[7]^=Y}const C=[];for(let A=0,t=E.length;A<t;A++){const t=E[A];C.push((4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t)}return C}const a=new Uint8Array(64),B=new Uint8Array(64);for(let n=0;n<64;n++)a[n]=54,B[n]=92;return sm3_1$1={sm3:g,hmac:function(A,t){for(t.length>64&&(t=g(t));t.length<64;)t.push(0);const r=e(t,a),i=e(t,B),s=g([...r,...A]);return g([...i,...s])}}}function requireSm2(){if(hasRequiredSm2)return sm2;hasRequiredSm2=1;const{BigInteger:A}=requireJsbn(),{encodeDer:t,decodeDer:r}=requireAsn1(),e=requireUtils(),i=requireSm3$1().sm3,{G:s,curve:g,n:a}=e.generateEcparam();function B(A,t,r="1234567812345678"){r=e.utf8ToHex(r);const g=e.leftPad(s.curve.a.toBigInteger().toRadix(16),64),a=e.leftPad(s.curve.b.toBigInteger().toRadix(16),64),B=e.leftPad(s.getX().toBigInteger().toRadix(16),64),n=e.leftPad(s.getY().toBigInteger().toRadix(16),64);let o,V;if(128===t.length)o=t.substr(0,64),V=t.substr(64,64);else{const A=s.curve.decodePointHex(t);o=e.leftPad(A.getX().toBigInteger().toRadix(16),64),V=e.leftPad(A.getY().toBigInteger().toRadix(16),64)}const I=e.hexToArray(r+g+a+B+n+o+V),E=4*r.length;I.unshift(255&E),I.unshift(E>>8&255);const C=i(I);return e.arrayToHex(i(C.concat(e.hexToArray(A))))}function n(t){const r=s.multiply(new A(t,16));return"04"+e.leftPad(r.getX().toBigInteger().toString(16),64)+e.leftPad(r.getY().toBigInteger().toString(16),64)}function o(){const t=e.generateKeyPairHex(),r=g.decodePointHex(t.publicKey);return t.k=new A(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}return sm2={generateKeyPairHex:e.generateKeyPairHex,compressPublicKeyHex:e.compressPublicKeyHex,comparePublicKeyHex:e.comparePublicKeyHex,doEncrypt:function(t,r,s=1){t="string"==typeof t?e.hexToArray(e.utf8ToHex(t)):Array.prototype.slice.call(t),r=e.getGlobalCurve().decodePointHex(r);const g=e.generateKeyPairHex(),a=new A(g.privateKey,16);let B=g.publicKey;B.length>128&&(B=B.substr(B.length-128));const n=r.multiply(a),o=e.hexToArray(e.leftPad(n.getX().toBigInteger().toRadix(16),64)),V=e.hexToArray(e.leftPad(n.getY().toBigInteger().toRadix(16),64)),I=e.arrayToHex(i([].concat(o,t,V)));let E=1,C=0,W=[];const u=[].concat(o,V),q=()=>{W=i([...u,E>>24&255,E>>16&255,E>>8&255,255&E]),E++,C=0};q();for(let A=0,e=t.length;A<e;A++)C===W.length&&q(),t[A]^=255&W[C++];const l=e.arrayToHex(t);return 0===s?B+l+I:B+I+l},doDecrypt:function(t,r,s=1,{output:g="string"}={}){r=new A(r,16);let a=t.substr(128,64),B=t.substr(192);0===s&&(a=t.substr(t.length-64),B=t.substr(128,t.length-128-64));const n=e.hexToArray(B),o=e.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),V=e.hexToArray(e.leftPad(o.getX().toBigInteger().toRadix(16),64)),I=e.hexToArray(e.leftPad(o.getY().toBigInteger().toRadix(16),64));let E=1,C=0,W=[];const u=[].concat(V,I),q=()=>{W=i([...u,E>>24&255,E>>16&255,E>>8&255,255&E]),E++,C=0};q();for(let A=0,e=n.length;A<e;A++)C===W.length&&q(),n[A]^=255&W[C++];return e.arrayToHex(i([].concat(V,n,I)))===a.toLowerCase()?"array"===g?n:e.arrayToUtf8(n):"array"===g?[]:""},doSignature:function(r,i,{pointPool:s,der:g,hash:V,publicKey:I,userId:E}={}){let C="string"==typeof r?e.utf8ToHex(r):e.arrayToHex(r);V&&(C=B(C,I=I||n(i),E));const W=new A(i,16),u=new A(C,16);let q=null,l=null,Q=null;do{do{let A;A=s&&s.length?s.pop():o(),q=A.k,l=u.add(A.x1).mod(a)}while(l.equals(A.ZERO)||l.add(q).equals(a));Q=W.add(A.ONE).modInverse(a).multiply(q.subtract(l.multiply(W))).mod(a)}while(Q.equals(A.ZERO));return g?t(l,Q):e.leftPad(l.toString(16),64)+e.leftPad(Q.toString(16),64)},doVerifySignature:function(t,i,n,{der:o,hash:V,userId:I}={}){let E,C,W="string"==typeof t?e.utf8ToHex(t):e.arrayToHex(t);if(V&&(W=B(W,n,I)),o){const A=r(i);E=A.r,C=A.s}else E=new A(i.substring(0,64),16),C=new A(i.substring(64),16);const u=g.decodePointHex(n),q=new A(W,16),l=E.add(C).mod(a);if(l.equals(A.ZERO))return!1;const Q=s.multiply(C).add(u.multiply(l)),c=q.add(Q.getX().toBigInteger()).mod(a);return E.equals(c)},getPublicKeyFromPrivateKey:n,getPoint:o,verifyPublicKey:e.verifyPublicKey},sm2}function requireSm3(){if(hasRequiredSm3)return sm3_1;hasRequiredSm3=1;const{sm3:A,hmac:t}=requireSm3$1();function r(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")}function e(A){const t=[];let r=A.length;var e,i;r%2!=0&&(i=r+1,A=(e=A).length>=i?e:new Array(i-e.length+1).join("0")+e),r=A.length;for(let s=0;s<r;s+=2)t.push(parseInt(A.substr(s,2),16));return t}return sm3_1=function(i,s){if(i="string"==typeof i?function(A){const t=[];for(let r=0,e=A.length;r<e;r++){const e=A.codePointAt(r);if(e<=127)t.push(e);else if(e<=2047)t.push(192|e>>>6),t.push(128|63&e);else if(e<=55295||e>=57344&&e<=65535)t.push(224|e>>>12),t.push(128|e>>>6&63),t.push(128|63&e);else{if(!(e>=65536&&e<=1114111))throw t.push(e),new Error("input is not supported");r++,t.push(240|e>>>18&28),t.push(128|e>>>12&63),t.push(128|e>>>6&63),t.push(128|63&e)}}return t}(i):Array.prototype.slice.call(i),s){if("hmac"!==(s.mode||"hmac"))throw new Error("invalid mode");let A=s.key;if(!A)throw new Error("invalid key");return A="string"==typeof A?e(A):Array.prototype.slice.call(A),r(t(i,A))}return r(A(i))}}function requireSm4(){if(hasRequiredSm4)return sm4_1;hasRequiredSm4=1;const A=16,t=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],r=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function e(A){const t=[];for(let r=0,e=A.length;r<e;r+=2)t.push(parseInt(A.substr(r,2),16));return t}function i(A,t){const r=31&t;return A<<r|A>>>32-r}function s(A){return(255&t[A>>>24&255])<<24|(255&t[A>>>16&255])<<16|(255&t[A>>>8&255])<<8|255&t[255&A]}function g(A){return A^i(A,2)^i(A,10)^i(A,18)^i(A,24)}function a(A){return A^i(A,13)^i(A,23)}function B(A,t,r){const e=new Array(4),i=new Array(4);for(let s=0;s<4;s++)i[0]=255&A[4*s],i[1]=255&A[4*s+1],i[2]=255&A[4*s+2],i[3]=255&A[4*s+3],e[s]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];for(let a,B=0;B<32;B+=4)a=e[1]^e[2]^e[3]^r[B+0],e[0]^=g(s(a)),a=e[2]^e[3]^e[0]^r[B+1],e[1]^=g(s(a)),a=e[3]^e[0]^e[1]^r[B+2],e[2]^=g(s(a)),a=e[0]^e[1]^e[2]^r[B+3],e[3]^=g(s(a));for(let s=0;s<16;s+=4)t[s]=e[3-s/4]>>>24&255,t[s+1]=e[3-s/4]>>>16&255,t[s+2]=e[3-s/4]>>>8&255,t[s+3]=255&e[3-s/4]}function n(t,i,g,{padding:n="pkcs#7",mode:o,iv:V=[],output:I="string"}={}){if("cbc"===o&&("string"==typeof V&&(V=e(V)),16!==V.length))throw new Error("iv is invalid");if("string"==typeof i&&(i=e(i)),16!==i.length)throw new Error("key is invalid");if(t="string"==typeof t?0!==g?function(A){const t=[];for(let r=0,e=A.length;r<e;r++){const e=A.codePointAt(r);if(e<=127)t.push(e);else if(e<=2047)t.push(192|e>>>6),t.push(128|63&e);else if(e<=55295||e>=57344&&e<=65535)t.push(224|e>>>12),t.push(128|e>>>6&63),t.push(128|63&e);else{if(!(e>=65536&&e<=1114111))throw t.push(e),new Error("input is not supported");r++,t.push(240|e>>>18&28),t.push(128|e>>>12&63),t.push(128|e>>>6&63),t.push(128|63&e)}}return t}(t):e(t):[...t],("pkcs#5"===n||"pkcs#7"===n)&&0!==g){const r=A-t.length%A;for(let A=0;A<r;A++)t.push(r)}const E=new Array(32);!function(A,t,e){const i=new Array(4),g=new Array(4);for(let r=0;r<4;r++)g[0]=255&A[0+4*r],g[1]=255&A[1+4*r],g[2]=255&A[2+4*r],g[3]=255&A[3+4*r],i[r]=g[0]<<24|g[1]<<16|g[2]<<8|g[3];i[0]^=2746333894,i[1]^=1453994832,i[2]^=1736282519,i[3]^=2993693404;for(let B,n=0;n<32;n+=4)B=i[1]^i[2]^i[3]^r[n+0],t[n+0]=i[0]^=a(s(B)),B=i[2]^i[3]^i[0]^r[n+1],t[n+1]=i[1]^=a(s(B)),B=i[3]^i[0]^i[1]^r[n+2],t[n+2]=i[2]^=a(s(B)),B=i[0]^i[1]^i[2]^r[n+3],t[n+3]=i[3]^=a(s(B));if(0===e)for(let r,s=0;s<16;s++)r=t[s],t[s]=t[31-s],t[31-s]=r}(i,E,g);const C=[];let W=V,u=t.length,q=0;for(;u>=A;){const r=t.slice(q,q+16),e=new Array(16);if("cbc"===o)for(let t=0;t<A;t++)0!==g&&(r[t]^=W[t]);B(r,e,E);for(let t=0;t<A;t++)"cbc"===o&&0===g&&(e[t]^=W[t]),C[q+t]=e[t];"cbc"===o&&(W=0!==g?e:r),u-=A,q+=A}if(("pkcs#5"===n||"pkcs#7"===n)&&0===g){const A=C.length,t=C[A-1];for(let r=1;r<=t;r++)if(C[A-r]!==t)throw new Error("padding is invalid");C.splice(A-t,t)}return"array"!==I?0!==g?C.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join(""):function(A){const t=[];for(let r=0,e=A.length;r<e;r++)A[r]>=240&&A[r]<=247?(t.push(String.fromCodePoint(((7&A[r])<<18)+((63&A[r+1])<<12)+((63&A[r+2])<<6)+(63&A[r+3]))),r+=3):A[r]>=224&&A[r]<=239?(t.push(String.fromCodePoint(((15&A[r])<<12)+((63&A[r+1])<<6)+(63&A[r+2]))),r+=2):A[r]>=192&&A[r]<=223?(t.push(String.fromCodePoint(((31&A[r])<<6)+(63&A[r+1]))),r++):t.push(String.fromCodePoint(A[r]));return t.join("")}(C):C}return sm4_1={encrypt:(A,t,r)=>n(A,t,1,r),decrypt:(A,t,r)=>n(A,t,0,r)}}const smCrypto=getDefaultExportFromCjs(hasRequiredSrc?src:(hasRequiredSrc=1,src={sm2:requireSm2(),sm3:requireSm3(),sm4:requireSm4()}));class MyCryptoJS{constructor(A,t,r,e){__privateAdd(this,_key,null),__privateAdd(this,_iv,null),__privateAdd(this,_publicKey,null),__privateAdd(this,_privateKey,null),__privateAdd(this,_formatType,(A,t=!1)=>{if(!t)return"object"==typeof A?JSON.stringify(A):String(A);try{return JSON.parse(A)}catch(r){return A}}),this.setkey(A),this.setiv(t),this.setPublicKey(r),this.setPrivateKey(e)}setPublicKey(A){__privateSet(this,_publicKey,A)}setPrivateKey(A){__privateSet(this,_privateKey,A)}setkey(A){__privateSet(this,_key,A&&this.stringToWordArray(A.padEnd(16,"0")))}setiv(A){__privateSet(this,_iv,A&&this.stringToWordArray(A))}sm2Encrypt(A,t){return smCrypto.sm2.doEncrypt(A,t,{inputEncoding:"utf8",outputEncoding:"hex",pointFormat:"uncompressed",cipherMode:1})}sm2Decrypt(A,t){return smCrypto.sm2.doDecrypt(A,t,1)}RSAencrypt(A){A=__privateGet(this,_formatType).call(this,A);const t=new JSEncrypt;return t.setPublicKey(__privateGet(this,_publicKey)),t.encrypt(A)}RSAdecrypt(A){const t=new JSEncrypt;return t.setPrivateKey(__privateGet(this,_privateKey)),__privateGet(this,_formatType).call(this,t.decrypt(A),!0)}stringToWordArray(A){return CryptoJS.enc.Utf8.parse(A)}wordArrayToString(A){return A.toString(CryptoJS.enc.Utf8)}AESencrypt(A,t=!0){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.AES.encrypt(A,__privateGet(this,_key),{iv:__privateGet(this,_iv),mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).ciphertext.toString(t?CryptoJS.enc.Base64:CryptoJS.enc.Hex)}AESdecrypt(A,t=!0){A=t?A:CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(A));let r=CryptoJS.AES.decrypt(A,__privateGet(this,_key),{iv:__privateGet(this,_iv),mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return __privateGet(this,_formatType).call(this,r.toString(CryptoJS.enc.Utf8),!0)}DESencrypt(A,t=!0){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.DES.encrypt(A,__privateGet(this,_key),{iv:__privateGet(this,_iv),mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7}).ciphertext.toString(t?CryptoJS.enc.Base64:CryptoJS.enc.Hex)}DESdecrypt(A,t=!0){A=t?A:CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(A));let r=CryptoJS.DES.decrypt(A,__privateGet(this,_key),{iv:__privateGet(this,_iv),mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7});return __privateGet(this,_formatType).call(this,r.toString(CryptoJS.enc.Utf8),!0)}base64Encode(A){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(A))}base64Decode(A){return __privateGet(this,_formatType).call(this,CryptoJS.enc.Base64.parse(A).toString(CryptoJS.enc.Utf8),!0)}md5(A){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.MD5(A).toString()}fileMd5(A,t,r){return new Promise((e,i)=>{if(!A)return void i("");const s=new FileReader;if(s.onerror=A=>{i(A)},t){const a=CryptoJS.algo.MD5.create();let B=0;try{let i=function(){const r=A.slice(B,B+t);s.readAsArrayBuffer(r)};s.onload=s=>{const g=CryptoJS.lib.WordArray.create(new Uint8Array(s.target.result));if(a.update(g),"function"==typeof r&&r(B,A.size),B+=t,B<A.size)i();else{const A=a.finalize();e(A.toString(CryptoJS.enc.Hex))}},i()}catch(g){i(g)}}else s.onload=t=>{"function"==typeof r&&r(A.size,A.size),e(CryptoJS.MD5(CryptoJS.lib.WordArray.create(t.target.result)).toString())},s.readAsArrayBuffer(A)})}sha1(A){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.SHA1(A).toString()}sha256(A){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.SHA256(A).toString()}sha3(A){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.SHA3(A,{outputLength:256}).toString()}pbkdf2(A){A=__privateGet(this,_formatType).call(this,A);let t=CryptoJS.lib.WordArray.random(16);return CryptoJS.PBKDF2(A,t,{keySize:8,iterations:1e3}).toString()}hmac(A,t){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.HmacSHA256(A,t).toString(CryptoJS.enc.Hex)}}function randomStr$1(A=18,t=36){(t<2||t>36)&&(t=36);var r=Math.random().toString(t).substring(2,13).padEnd(11,"0").slice(0,A);return A<=11?r:r+randomStr$1(A-11)}function hexToRgb(A){A=A.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(A,t,r,e)=>t+t+r+r+e+e);const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function fileTurnBase64(A){return new Promise((t,r)=>{if(A)try{var e=new FileReader;let i="";e.readAsDataURL(A),e.onload=function(){i=e.result},e.onerror=function(A){r(A)},e.onloadend=function(){t(i)}}catch(i){r(i)}else r("")})}_key=new WeakMap,_iv=new WeakMap,_publicKey=new WeakMap,_privateKey=new WeakMap,_formatType=new WeakMap;const tools={formatDateTime:function(A="yyyy-MM-dd hh:mm:ss",t=new Date,r=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]){!t&&(t=new Date),"string"==typeof t&&(t=new Date(t));const e={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),S:t.getMilliseconds(),w:r[t.getDay()]};/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(const i in e)new RegExp("("+i+")").test(A)&&(A=A.replace(RegExp.$1,1===RegExp.$1.length?e[i]:("00"+e[i]).substr((""+e[i]).length)));return A},throttle:function(A,t=500){var r=Date.now();return function(...e){Date.now()-r>=t&&(A.apply(this,e),r=Date.now())}},debounce:function(A,t=500){let r=null;return function(...e){clearTimeout(r),r=setTimeout(()=>{A.apply(this,e)},t)}},rgbToHex:function(A,t,r){return"#"+((1<<24)+(A<<16)+(t<<8)+r).toString(16).slice(1)},hexToRgb:hexToRgb,hslToRgb:function(A,t,r){let e,i,s;if(A/=360,r/=100,0===(t/=100))e=i=s=r;else{const g=(A,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?A+6*(t-A)*r:r<.5?t:r<2/3?A+(t-A)*(2/3-r)*6:A),a=r<.5?r*(1+t):r+t-r*t,B=2*r-a;e=g(B,a,A+1/3),i=g(B,a,A),s=g(B,a,A-1/3)}return{r:Math.round(255*e),g:Math.round(255*i),b:Math.round(255*s)}},rgbOrHexToHsl:function(A){let t,r,e;if("string"==typeof A&&"#"===A.charAt(0)){const i=hexToRgb(A);t=i.r/255,r=i.g/255,e=i.b/255}else{if("object"!=typeof A)throw new Error("Invalid input format");t=A.r/255,r=A.g/255,e=A.b/255}const i=Math.max(t,r,e),s=Math.min(t,r,e);let g,a,B=(i+s)/2;if(i===s)g=a=0;else{const A=i-s;switch(a=B>.5?A/(2-i-s):A/(i+s),i){case t:g=(r-e)/A+(r<e?6:0);break;case r:g=(e-t)/A+2;break;case e:g=(t-r)/A+4}g/=6}return{h:Math.round(360*g),s:Math.round(100*a),l:Math.round(100*B)}},preciseInterval:function(A,t){let r,e=null;return r=requestAnimationFrame(function i(s){e||(e=s),s-e>=t&&(A(),e=s),r=requestAnimationFrame(i)}),{clear:function(){cancelAnimationFrame(r)}}},convertImgToBase64:function(A,t){return new Promise(function(r){var e=document.createElement("CANVAS"),i=e.getContext("2d"),s=new Image;s.crossOrigin="Anonymous",s.onload=function(){e.height=s.height,e.width=s.width,i.drawImage(s,0,0);var A=e.toDataURL(t||"image/jpg");r(A),e=null},s.src=A})},objectGroupBy:function(A,t){if("string"==typeof t){const A=t;t=t=>t[A]}var r={};return A.forEach((e,i)=>{const s=t(e,i,A);r[s]||(r[s]=[]),r[s].push(e)}),r},randomNum:function(A,t){return Math.floor(Math.random()*(t+1-A))+A},randomColor:function(){return"#"+Math.floor(16777215*Math.random()).toString(16).padEnd(6,"0")},deepCloning:function A(t,r=new WeakMap){if("object"!=typeof t||null===t)return t;if(r.has(t))return r.get(t);var e=Array.isArray(t)?[]:{};r.set(t,e);for(const s in t)if(t.hasOwnProperty(s)){const g=t[s];if("object"!=typeof g||null===g)e[s]=g;else try{e[s]=A(g,r)}catch(i){}}return e},randomStr:randomStr$1,getUrlParams:function(A){const t={};let r=A.substring(A.lastIndexOf("?")+1);return r=decodeURIComponent(r),r.replace(/([^?&=]+)=([^?&=]*)/g,(A,r,e)=>{const i=decodeURIComponent(r);let s=decodeURIComponent(e);try{s=JSON.parse(s)}catch(g){}return t[i]=s,A}),t},getBroswer:function(){let A="";const t=window.navigator.userAgent.toLowerCase();if(/(msie|firefox|opera|chrome|netscape)\D+(\d[\d.]*)/.test(t)){const r=t.search(RegExp.$1);A=t.substring(r,t.length).replace(/safari\D+(\d[\d.]*)/,"")}else/version\D+(\d[\d.]*).*safari/.test(t)&&(A="safari "+RegExp.$2);return A},fileTurnBase64:fileTurnBase64,fileChunks:function(A,t,r,e){return new Promise((i,s)=>{const g=new MyCryptoJS,a={fileHash:"",fileName:A.name,chunkSize:t,fileSize:A.size,fileType:A.type,chunks:[]};let B=new Promise((r,i)=>{g.fileMd5(A,t,e).then(A=>{a.fileHash=A,r(a)}).catch(A=>{i(A)})}),n=new Promise((e,i)=>{let s=0;!async function i(){if(s>=A.size)return void e(a);let g=A.slice(s,Math.min(s+t,A.size));r&&(g=await fileTurnBase64(g)),a.chunks.push({chunk:g,index:s/t}),s+=t,i()}()});Promise.all([B,n]).then(()=>{i(a)}).catch(A=>{s(A)})})},base64ArrayMerge:function(A,t=!0){let r=(A=A.map(A=>function(A){const t="=".repeat((4-A.length%4)%4),r=(A+t).replace(/\-/g,"+").replace(/_/g,"/"),e=window.atob(r),i=new Uint8Array(e.length);for(let s=0;s<e.length;++s)i[s]=e.charCodeAt(s);return i}(A.split(",")[1]))).reduce((A,t)=>A+t.length,0);const e=new Uint8Array(r);let i=0;A.forEach(A=>{e.set(A,i),i+=A.length});const s=new Blob([e]);return new Promise((A,r)=>{t?fileTurnBase64(s).then(t=>{A(t)}).catch(A=>{r(A)}):A(s)})},toChineseNumber:function(A,t=!0){let r=A.toString().replace(/(?=(\d{4})+$)/g,",").split(",").filter(Boolean);const e=["零","一","二","三","四","五","六","七","八","九"],i=["","十","百","千"],s=["","万","亿"];let g=r.map((A,t)=>function(A){let t="";for(let r=0;r<A.length;r++){let s=e[A[r]],g=i[A.length-r-1];"零"===s&&(g=""),t+=s+g}return t=t.replace(/零+/g,"零").replace(/零$/,""),t}(A)+s[r.length-1-t]).join("");if(g=g||"零",t){let A={"零":"零","一":"壹","二":"贰","三":"叁","四":"肆","五":"伍","六":"陆","七":"柒","八":"捌","九":"玖","十":"拾","百":"佰","千":"仟"};g=g.split("").map(t=>A[t]||t).join("")}return g},getExplorerInfo:function(){let A=navigator.userAgent.toLowerCase();return 0<=A.indexOf("msie")?{type:"IE",version:Number(A.match(/msie ([\d]+)/)[1])}:A.match(/trident\/.+?rv:(([\d.]+))/)?{type:"IE",version:11}:0<=A.indexOf("edge")?{type:"Edge",version:Number(A.match(/edge\/([\d]+)/)[1])}:0<=A.indexOf("firefox")?{type:"Firefox",version:Number(A.match(/firefox\/([\d]+)/)[1])}:0<=A.indexOf("chrome")?{type:"Chrome",version:Number(A.match(/chrome\/([\d]+)/)[1])}:0<=A.indexOf("opera")?{type:"Opera",version:Number(A.match(/opera.([\d]+)/)[1])}:0<=A.indexOf("Safari")?{type:"Safari",version:Number(A.match(/version\/([\d]+)/)[1])}:{type:A,version:-1}},exportFile:function(A,t){if(!A)return;"object"==typeof A&&(A=JSON.stringify(A));const r=new Blob([A],{type:"application/json;charset=utf-8"}),e=URL.createObjectURL(r),i=document.createElement("a");i.href=e,i.download=0==t.indexOf(".")?randomStr$1()+t:t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(e)}};window.Cesium||(window.Cesium={WebMapTileServiceImageryProvider:function(){}});class CustomImageryProvider extends Cesium.WebMapTileServiceImageryProvider{constructor(A){super(A),__privateAdd(this,_alp,0),__privateAdd(this,_rgb,[6,27,98]),__privateSet(this,_alp,A.alp||0),__privateSet(this,_rgb,A.rgb||[6,27,98])}requestImage(A,t,r){return super.requestImage(A,t,r).then(A=>{if(!__privateGet(this,_alp))return A;const t=document.createElement("canvas");t.width=A.width,t.height=A.height;const r=t.getContext("2d");return r.translate(0,t.height),r.scale(1,-1),r.drawImage(A,0,0),r.globalCompositeOperation="source-atop",r.fillStyle=`rgba(${__privateGet(this,_rgb)[0]},${__privateGet(this,_rgb)[1]},${__privateGet(this,_rgb)[2]}, ${__privateGet(this,_alp)})`,r.fillRect(0,0,t.width,t.height),r.globalCompositeOperation="source-over",r.stroke(),t})}}_alp=new WeakMap,_rgb=new WeakMap;class TianDiTu{constructor(A){__privateAdd(this,_yingXiangLayer,null),__privateAdd(this,_luWangLayer,null),__privateAdd(this,_zhuJiLayer,null),__privateAdd(this,_parent,null),__publicField(this,"TianDiTuToken",""),__publicField(this,"loadTdtYingXiang",(A={},t=[])=>{const r=__privateGet(this,_parent).viewer;var e={tdtyxType:"img_w",...A},i=new CustomImageryProvider({rgb:t,alp:t[3],url:`http://t{s}.tianditu.gov.cn/${e.tdtyxType}/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&format=tiles&tk=${this.TianDiTuToken}`,subdomains:["0","1","2","3","4","5","6","7"],show:!0,maximumLevel:18,minimumLevel:0,screenSpaceError:16,styels:[{stylers:[{hue:"#fc0505ff"},{saturation:-20}]}]}),s=r.imageryLayers.addImageryProvider(i);return r.imageryLayers.lowerToBottom(s),{entity:s,remove(){r.imageryLayers.remove(s)}}}),__publicField(this,"loadTdtZhuJi",(A={},t=[])=>{const r=__privateGet(this,_parent).viewer;var e={maximumLevel:18,...A},i=new CustomImageryProvider({rgb:t,alp:t[3],url:`https://t{s}.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={TileCol}&TILEROW={TileRow}&TILEMATRIX={TileMatrix}&tk=${this.TianDiTuToken}`,subdomains:["0","1","2","3","4","5","6","7"],minimumLevel:0,maximumLevel:e.maximumLevel,show:!0}),s=r.imageryLayers.addImageryProvider(i);return r.imageryLayers.raiseToTop(s),{entity:s,remove(){r.imageryLayers.remove(s)}}}),__publicField(this,"setImageLayerFilter",(A={},t=0)=>{var r={invertColor:!0,alpha:1,dayAlpha:1,nightAlpha:1,brightness:1,contrast:1,hue:50,saturation:1,gamma:1,...A},e=__privateGet(this,_parent).viewer.imageryLayers.get(t);e.invertColor=r.invertColor,e.alpha=r.alpha,e.dayAlpha=r.dayAlpha,e.nightAlpha=r.nightAlpha,e.brightness=r.brightness,e.contrast=r.contrast,e.hue=r.hue,e.saturation=r.saturation,e.gamma=r.gamma}),__privateSet(this,_parent,A),this.TianDiTuToken=A.TianDiTuToken,this.showTdtYX=!0,this.showTdtLW=!0}set showTdtYX(A){A?__privateGet(this,_yingXiangLayer)||__privateSet(this,_yingXiangLayer,this.loadTdtYingXiang()):(__privateGet(this,_yingXiangLayer)&&__privateGet(this,_yingXiangLayer).remove(),__privateSet(this,_yingXiangLayer,null))}set showTdtLW(A){A?__privateGet(this,_luWangLayer)||__privateSet(this,_luWangLayer,this.loadTdtLuWang()):(__privateGet(this,_luWangLayer)&&__privateGet(this,_luWangLayer).remove(),__privateSet(this,_luWangLayer,null))}set showTdtZJ(A){A?__privateGet(this,_zhuJiLayer)||__privateSet(this,_zhuJiLayer,this.loadTdtZhuJi()):(__privateGet(this,_zhuJiLayer)&&__privateGet(this,_zhuJiLayer).remove(),__privateSet(this,_zhuJiLayer,null))}loadTdtLuWang(A={},t=[]){const r=__privateGet(this,_parent).viewer;var e={maximumLevel:18,show:!0,...A},i=new CustomImageryProvider({rgb:t,alp:t[3],url:`http://t{s}.tianditu.gov.cn/cia_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cia&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default.jpg&tk=${this.TianDiTuToken}`,subdomains:["0","1","2","3","4","5","6","7"],maximumLevel:e.maximumLevel,show:e.show}),s=r.imageryLayers.addImageryProvider(i);return r.imageryLayers.raiseToTop(s),{entity:s,remove(){r.imageryLayers.remove(s)}}}}_yingXiangLayer=new WeakMap,_luWangLayer=new WeakMap,_zhuJiLayer=new WeakMap,_parent=new WeakMap;const configProviderContextKey=Symbol(),_bem=(A,t,r,e,i)=>{let s=`${A}-${t}`;return r&&(s+=`-${r}`),e&&(s+=`__${e}`),i&&(s+=`--${i}`),s},namespaceContextKey=Symbol("namespaceContextKey"),useNamespace=(A,t)=>{const r=(A=>{const t=A||(vue.getCurrentInstance()?vue.inject(namespaceContextKey,vue.ref("el")):vue.ref("el"));return vue.computed(()=>vue.unref(t)||"el")})(t);return{namespace:r,b:(t="")=>_bem(r.value,A,t,"",""),e:t=>t?_bem(r.value,A,"",t,""):"",m:t=>t?_bem(r.value,A,"","",t):"",be:(t,e)=>t&&e?_bem(r.value,A,t,e,""):"",em:(t,e)=>t&&e?_bem(r.value,A,"",t,e):"",bm:(t,e)=>t&&e?_bem(r.value,A,t,"",e):"",bem:(t,e,i)=>t&&e&&i?_bem(r.value,A,t,e,i):"",is:(A,...t)=>{const r=!(t.length>=1)||t[0];return A&&r?`is-${A}`:""},cssVar:A=>{const t={};for(const e in A)A[e]&&(t[`--${r.value}-${e}`]=A[e]);return t},cssVarName:A=>`--${r.value}-${A}`,cssVarBlock:t=>{const e={};for(const i in t)t[i]&&(e[`--${r.value}-${A}-${i}`]=t[i]);return e},cssVarBlockName:t=>`--${r.value}-${A}-${t}`}};
|
|
34
34
|
/**
|
|
35
35
|
* @vue/shared v3.5.13
|
|
36
36
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
package/fhj-tools.es.js
CHANGED
|
@@ -14342,17 +14342,26 @@ class TianDiTu {
|
|
|
14342
14342
|
__publicField(this, "setImageLayerFilter", (config = {}, layerIndex = 0) => {
|
|
14343
14343
|
var obj = {
|
|
14344
14344
|
invertColor: true,
|
|
14345
|
+
// 反色
|
|
14345
14346
|
alpha: 1,
|
|
14347
|
+
// 透明度
|
|
14346
14348
|
dayAlpha: 1,
|
|
14349
|
+
// 日间透明度
|
|
14347
14350
|
nightAlpha: 1,
|
|
14351
|
+
// 夜间透明度
|
|
14348
14352
|
brightness: 1,
|
|
14353
|
+
// 亮度
|
|
14349
14354
|
contrast: 1,
|
|
14355
|
+
// 对比度
|
|
14350
14356
|
hue: 50,
|
|
14357
|
+
// 色相
|
|
14351
14358
|
saturation: 1,
|
|
14359
|
+
// 饱和度
|
|
14352
14360
|
gamma: 1,
|
|
14361
|
+
// 伽马值
|
|
14353
14362
|
...config
|
|
14354
14363
|
};
|
|
14355
|
-
var aMapImagery = this.viewer.imageryLayers.get(layerIndex);
|
|
14364
|
+
var aMapImagery = __privateGet(this, _parent).viewer.imageryLayers.get(layerIndex);
|
|
14356
14365
|
aMapImagery.invertColor = obj.invertColor;
|
|
14357
14366
|
aMapImagery.alpha = obj.alpha;
|
|
14358
14367
|
aMapImagery.dayAlpha = obj.dayAlpha;
|
package/fhj-tools.umd.js
CHANGED
|
@@ -30,7 +30,7 @@ function(){var t=A,r=t.lib,e=r.WordArray,i=r.Hasher,s=t.algo,g=e.create([0,1,2,3
|
|
|
30
30
|
* @since jsrsasign 2.1
|
|
31
31
|
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
32
32
|
*/
|
|
33
|
-
var dr={};void 0!==dr.asn1&&dr.asn1||(dr.asn1={}),dr.asn1.ASN1Util=new function(){this.integerToByteHex=function(A){var t=A.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(A){var t=A.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var e="",i=0;i<r;i++)e+="f";t=new _t(e,16).xor(A).add(_t.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(A,t){return hextopem(A,t)},this.newObject=function(A){var t=dr.asn1,r=t.DERBoolean,e=t.DERInteger,i=t.DERBitString,s=t.DEROctetString,g=t.DERNull,a=t.DERObjectIdentifier,B=t.DEREnumerated,n=t.DERUTF8String,V=t.DERNumericString,I=t.DERPrintableString,o=t.DERTeletexString,E=t.DERIA5String,C=t.DERUTCTime,W=t.DERGeneralizedTime,q=t.DERSequence,u=t.DERSet,Q=t.DERTaggedObject,l=t.ASN1Util.newObject,k=Object.keys(A);if(1!=k.length)throw"key of param shall be only one.";var c=k[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+c+":"))throw"undefined key: "+c;if("bool"==c)return new r(A[c]);if("int"==c)return new e(A[c]);if("bitstr"==c)return new i(A[c]);if("octstr"==c)return new s(A[c]);if("null"==c)return new g(A[c]);if("oid"==c)return new a(A[c]);if("enum"==c)return new B(A[c]);if("utf8str"==c)return new n(A[c]);if("numstr"==c)return new V(A[c]);if("prnstr"==c)return new I(A[c]);if("telstr"==c)return new o(A[c]);if("ia5str"==c)return new E(A[c]);if("utctime"==c)return new C(A[c]);if("gentime"==c)return new W(A[c]);if("seq"==c){for(var x=A[c],Y=[],w=0;w<x.length;w++){var d=l(x[w]);Y.push(d)}return new q({array:Y})}if("set"==c){for(x=A[c],Y=[],w=0;w<x.length;w++){d=l(x[w]);Y.push(d)}return new u({array:Y})}if("tag"==c){var y=A[c];if("[object Array]"===Object.prototype.toString.call(y)&&3==y.length){var D=l(y[2]);return new Q({tag:y[0],explicit:y[1],obj:D})}var S={};if(void 0!==y.explicit&&(S.explicit=y.explicit),void 0!==y.tag&&(S.tag=y.tag),void 0===y.obj)throw"obj shall be specified for 'tag'.";return S.obj=l(y.obj),new Q(S)}},this.jsonToASN1HEX=function(A){return this.newObject(A).getEncodedHex()}},dr.asn1.ASN1Util.oidHexToInt=function(A){for(var t="",r=parseInt(A.substr(0,2),16),e=(t=Math.floor(r/40)+"."+r%40,""),i=2;i<A.length;i+=2){var s=("00000000"+parseInt(A.substr(i,2),16).toString(2)).slice(-8);if(e+=s.substr(1,7),"0"==s.substr(0,1))t=t+"."+new _t(e,2).toString(10),e=""}return t},dr.asn1.ASN1Util.oidIntToHex=function(A){var t=function(A){var t=A.toString(16);return 1==t.length&&(t="0"+t),t},r=function(A){var r="",e=new _t(A,10).toString(2),i=7-e.length%7;7==i&&(i=0);for(var s="",g=0;g<i;g++)s+="0";e=s+e;for(g=0;g<e.length-1;g+=7){var a=e.substr(g,7);g!=e.length-7&&(a="1"+a),r+=t(parseInt(a,2))}return r};if(!A.match(/^[0-9.]+$/))throw"malformed oid string: "+A;var e="",i=A.split("."),s=40*parseInt(i[0])+parseInt(i[1]);e+=t(s),i.splice(0,2);for(var g=0;g<i.length;g++)e+=r(i[g]);return e},dr.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n=0,v="+this.hV;var A=this.hV.length/2,t=A.toString(16);if(t.length%2==1&&(t="0"+t),A<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+A.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},dr.asn1.DERAbstractString=function(A){dr.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(A){this.hTLV=null,this.isModified=!0,this.s=A,this.hV=stohex(this.s)},this.setStringHex=function(A){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=A},this.getFreshValueHex=function(){return this.hV},void 0!==A&&("string"==typeof A?this.setString(A):void 0!==A.str?this.setString(A.str):void 0!==A.hex&&this.setStringHex(A.hex))},wr.lang.extend(dr.asn1.DERAbstractString,dr.asn1.ASN1Object),dr.asn1.DERAbstractTime=function(A){dr.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(A){return utc=A.getTime()+6e4*A.getTimezoneOffset(),new Date(utc)},this.formatDate=function(A,t,r){var e=this.zeroPadding,i=this.localDateToUTC(A),s=String(i.getFullYear());"utc"==t&&(s=s.substr(2,2));var g=s+e(String(i.getMonth()+1),2)+e(String(i.getDate()),2)+e(String(i.getHours()),2)+e(String(i.getMinutes()),2)+e(String(i.getSeconds()),2);if(!0===r){var a=i.getMilliseconds();if(0!=a){var B=e(String(a),3);g=g+"."+(B=B.replace(/[0]+$/,""))}}return g+"Z"},this.zeroPadding=function(A,t){return A.length>=t?A:new Array(t-A.length+1).join("0")+A},this.getString=function(){return this.s},this.setString=function(A){this.hTLV=null,this.isModified=!0,this.s=A,this.hV=stohex(A)},this.setByDateValue=function(A,t,r,e,i,s){var g=new Date(Date.UTC(A,t-1,r,e,i,s,0));this.setByDate(g)},this.getFreshValueHex=function(){return this.hV}},wr.lang.extend(dr.asn1.DERAbstractTime,dr.asn1.ASN1Object),dr.asn1.DERAbstractStructured=function(A){dr.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(A){this.hTLV=null,this.isModified=!0,this.asn1Array=A},this.appendASN1Object=function(A){this.hTLV=null,this.isModified=!0,this.asn1Array.push(A)},this.asn1Array=new Array,void 0!==A&&void 0!==A.array&&(this.asn1Array=A.array)},wr.lang.extend(dr.asn1.DERAbstractStructured,dr.asn1.ASN1Object),dr.asn1.DERBoolean=function(){dr.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},wr.lang.extend(dr.asn1.DERBoolean,dr.asn1.ASN1Object),dr.asn1.DERInteger=function(A){dr.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(A){this.hTLV=null,this.isModified=!0,this.hV=dr.asn1.ASN1Util.bigIntToMinTwosComplementsHex(A)},this.setByInteger=function(A){var t=new _t(String(A),10);this.setByBigInteger(t)},this.setValueHex=function(A){this.hV=A},this.getFreshValueHex=function(){return this.hV},void 0!==A&&(void 0!==A.bigint?this.setByBigInteger(A.bigint):void 0!==A.int?this.setByInteger(A.int):"number"==typeof A?this.setByInteger(A):void 0!==A.hex&&this.setValueHex(A.hex))},wr.lang.extend(dr.asn1.DERInteger,dr.asn1.ASN1Object),dr.asn1.DERBitString=function(A){if(void 0!==A&&void 0!==A.obj){var t=dr.asn1.ASN1Util.newObject(A.obj);A.hex="00"+t.getEncodedHex()}dr.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(A){this.hTLV=null,this.isModified=!0,this.hV=A},this.setUnusedBitsAndHexValue=function(A,t){if(A<0||7<A)throw"unused bits shall be from 0 to 7: u = "+A;var r="0"+A;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(A){var t=8-(A=A.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)A+="0";var e="";for(r=0;r<A.length-1;r+=8){var i=A.substr(r,8),s=parseInt(i,2).toString(16);1==s.length&&(s="0"+s),e+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+t+e},this.setByBooleanArray=function(A){for(var t="",r=0;r<A.length;r++)1==A[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(A){for(var t=new Array(A),r=0;r<A;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==A&&("string"==typeof A&&A.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(A):void 0!==A.hex?this.setHexValueIncludingUnusedBits(A.hex):void 0!==A.bin?this.setByBinaryString(A.bin):void 0!==A.array&&this.setByBooleanArray(A.array))},wr.lang.extend(dr.asn1.DERBitString,dr.asn1.ASN1Object),dr.asn1.DEROctetString=function(A){if(void 0!==A&&void 0!==A.obj){var t=dr.asn1.ASN1Util.newObject(A.obj);A.hex=t.getEncodedHex()}dr.asn1.DEROctetString.superclass.constructor.call(this,A),this.hT="04"},wr.lang.extend(dr.asn1.DEROctetString,dr.asn1.DERAbstractString),dr.asn1.DERNull=function(){dr.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},wr.lang.extend(dr.asn1.DERNull,dr.asn1.ASN1Object),dr.asn1.DERObjectIdentifier=function(A){var t=function(A){var t=A.toString(16);return 1==t.length&&(t="0"+t),t},r=function(A){var r="",e=new _t(A,10).toString(2),i=7-e.length%7;7==i&&(i=0);for(var s="",g=0;g<i;g++)s+="0";e=s+e;for(g=0;g<e.length-1;g+=7){var a=e.substr(g,7);g!=e.length-7&&(a="1"+a),r+=t(parseInt(a,2))}return r};dr.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(A){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=A},this.setValueOidString=function(A){if(!A.match(/^[0-9.]+$/))throw"malformed oid string: "+A;var e="",i=A.split("."),s=40*parseInt(i[0])+parseInt(i[1]);e+=t(s),i.splice(0,2);for(var g=0;g<i.length;g++)e+=r(i[g]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(A){var t=dr.asn1.x509.OID.name2oid(A);if(""===t)throw"DERObjectIdentifier oidName undefined: "+A;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==A&&("string"==typeof A?A.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(A):this.setValueName(A):void 0!==A.oid?this.setValueOidString(A.oid):void 0!==A.hex?this.setValueHex(A.hex):void 0!==A.name&&this.setValueName(A.name))},wr.lang.extend(dr.asn1.DERObjectIdentifier,dr.asn1.ASN1Object),dr.asn1.DEREnumerated=function(A){dr.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(A){this.hTLV=null,this.isModified=!0,this.hV=dr.asn1.ASN1Util.bigIntToMinTwosComplementsHex(A)},this.setByInteger=function(A){var t=new _t(String(A),10);this.setByBigInteger(t)},this.setValueHex=function(A){this.hV=A},this.getFreshValueHex=function(){return this.hV},void 0!==A&&(void 0!==A.int?this.setByInteger(A.int):"number"==typeof A?this.setByInteger(A):void 0!==A.hex&&this.setValueHex(A.hex))},wr.lang.extend(dr.asn1.DEREnumerated,dr.asn1.ASN1Object),dr.asn1.DERUTF8String=function(A){dr.asn1.DERUTF8String.superclass.constructor.call(this,A),this.hT="0c"},wr.lang.extend(dr.asn1.DERUTF8String,dr.asn1.DERAbstractString),dr.asn1.DERNumericString=function(A){dr.asn1.DERNumericString.superclass.constructor.call(this,A),this.hT="12"},wr.lang.extend(dr.asn1.DERNumericString,dr.asn1.DERAbstractString),dr.asn1.DERPrintableString=function(A){dr.asn1.DERPrintableString.superclass.constructor.call(this,A),this.hT="13"},wr.lang.extend(dr.asn1.DERPrintableString,dr.asn1.DERAbstractString),dr.asn1.DERTeletexString=function(A){dr.asn1.DERTeletexString.superclass.constructor.call(this,A),this.hT="14"},wr.lang.extend(dr.asn1.DERTeletexString,dr.asn1.DERAbstractString),dr.asn1.DERIA5String=function(A){dr.asn1.DERIA5String.superclass.constructor.call(this,A),this.hT="16"},wr.lang.extend(dr.asn1.DERIA5String,dr.asn1.DERAbstractString),dr.asn1.DERUTCTime=function(A){dr.asn1.DERUTCTime.superclass.constructor.call(this,A),this.hT="17",this.setByDate=function(A){this.hTLV=null,this.isModified=!0,this.date=A,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==A&&(void 0!==A.str?this.setString(A.str):"string"==typeof A&&A.match(/^[0-9]{12}Z$/)?this.setString(A):void 0!==A.hex?this.setStringHex(A.hex):void 0!==A.date&&this.setByDate(A.date))},wr.lang.extend(dr.asn1.DERUTCTime,dr.asn1.DERAbstractTime),dr.asn1.DERGeneralizedTime=function(A){dr.asn1.DERGeneralizedTime.superclass.constructor.call(this,A),this.hT="18",this.withMillis=!1,this.setByDate=function(A){this.hTLV=null,this.isModified=!0,this.date=A,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==A&&(void 0!==A.str?this.setString(A.str):"string"==typeof A&&A.match(/^[0-9]{14}Z$/)?this.setString(A):void 0!==A.hex?this.setStringHex(A.hex):void 0!==A.date&&this.setByDate(A.date),!0===A.millis&&(this.withMillis=!0))},wr.lang.extend(dr.asn1.DERGeneralizedTime,dr.asn1.DERAbstractTime),dr.asn1.DERSequence=function(A){dr.asn1.DERSequence.superclass.constructor.call(this,A),this.hT="30",this.getFreshValueHex=function(){for(var A="",t=0;t<this.asn1Array.length;t++){A+=this.asn1Array[t].getEncodedHex()}return this.hV=A,this.hV}},wr.lang.extend(dr.asn1.DERSequence,dr.asn1.DERAbstractStructured),dr.asn1.DERSet=function(A){dr.asn1.DERSet.superclass.constructor.call(this,A),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var A=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];A.push(r.getEncodedHex())}return 1==this.sortFlag&&A.sort(),this.hV=A.join(""),this.hV},void 0!==A&&void 0!==A.sortflag&&0==A.sortflag&&(this.sortFlag=!1)},wr.lang.extend(dr.asn1.DERSet,dr.asn1.DERAbstractStructured),dr.asn1.DERTaggedObject=function(A){dr.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(A,t,r){this.hT=t,this.isExplicit=A,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==A&&(void 0!==A.tag&&(this.hT=A.tag),void 0!==A.explicit&&(this.isExplicit=A.explicit),void 0!==A.obj&&(this.asn1Object=A.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},wr.lang.extend(dr.asn1.DERTaggedObject,dr.asn1.ASN1Object);var yr,Dr,Sr,Jr,br,fr,pr,Kr,hr,Mr,Fr,Gr,Ur,vr,Hr,Pr,Rr,jr,Zr=function(){var A=function(t,r){return(A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,t){A.__proto__=t}||function(A,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(A[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function e(){this.constructor=t}A(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}}(),mr=function(A){function t(r){var e=A.call(this)||this;return r&&("string"==typeof r?e.parseKey(r):(t.hasPrivateKeyProperty(r)||t.hasPublicKeyProperty(r))&&e.parsePropertiesFrom(r)),e}return Zr(t,A),t.prototype.parseKey=function(A){try{var t=0,r=0,e=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(A)?vt(A):Ht.unarmor(A),i=Tt.decode(e);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=ir(t,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var s=i.sub[3].getHexStringValue();this.d=ir(s,16);var g=i.sub[4].getHexStringValue();this.p=ir(g,16);var a=i.sub[5].getHexStringValue();this.q=ir(a,16);var B=i.sub[6].getHexStringValue();this.dmp1=ir(B,16);var n=i.sub[7].getHexStringValue();this.dmq1=ir(n,16);var V=i.sub[8].getHexStringValue();this.coeff=ir(V,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var I=i.sub[1].sub[0];t=I.sub[0].getHexStringValue(),this.n=ir(t,16),r=I.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=i.sub[0].getHexStringValue(),this.n=ir(t,16),r=i.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(o){return!1}},t.prototype.getPrivateBaseKey=function(){var A={array:[new dr.asn1.DERInteger({int:0}),new dr.asn1.DERInteger({bigint:this.n}),new dr.asn1.DERInteger({int:this.e}),new dr.asn1.DERInteger({bigint:this.d}),new dr.asn1.DERInteger({bigint:this.p}),new dr.asn1.DERInteger({bigint:this.q}),new dr.asn1.DERInteger({bigint:this.dmp1}),new dr.asn1.DERInteger({bigint:this.dmq1}),new dr.asn1.DERInteger({bigint:this.coeff})]};return new dr.asn1.DERSequence(A).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return Ft(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var A=new dr.asn1.DERSequence({array:[new dr.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new dr.asn1.DERNull]}),t=new dr.asn1.DERSequence({array:[new dr.asn1.DERInteger({bigint:this.n}),new dr.asn1.DERInteger({int:this.e})]}),r=new dr.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new dr.asn1.DERSequence({array:[A,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return Ft(this.getPublicBaseKey())},t.wordwrap=function(A,t){if(!A)return A;var r="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return A.match(RegExp(r,"g")).join("\n")},t.prototype.getPrivateKey=function(){var A="-----BEGIN RSA PRIVATE KEY-----\n";return A+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n",A+="-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var A="-----BEGIN PUBLIC KEY-----\n";return A+=t.wordwrap(this.getPublicBaseKeyB64())+"\n",A+="-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(A){return(A=A||{}).hasOwnProperty("n")&&A.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(A){return(A=A||{}).hasOwnProperty("n")&&A.hasOwnProperty("e")&&A.hasOwnProperty("d")&&A.hasOwnProperty("p")&&A.hasOwnProperty("q")&&A.hasOwnProperty("dmp1")&&A.hasOwnProperty("dmq1")&&A.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(A){this.n=A.n,this.e=A.e,A.hasOwnProperty("d")&&(this.d=A.d,this.p=A.p,this.q=A.q,this.dmp1=A.dmp1,this.dmq1=A.dmq1,this.coeff=A.coeff)},t}(xr),Lr="undefined"!=typeof process?null===(yr=process.env)||void 0===yr?void 0:yr.npm_package_version:void 0,Xr=function(){function A(A){void 0===A&&(A={}),A=A||{},this.default_key_size=A.default_key_size?parseInt(A.default_key_size,10):1024,this.default_public_exponent=A.default_public_exponent||"010001",this.log=A.log||!1,this.key=null}return A.prototype.setKey=function(A){this.log&&this.key,this.key=new mr(A)},A.prototype.setPrivateKey=function(A){this.setKey(A)},A.prototype.setPublicKey=function(A){this.setKey(A)},A.prototype.decrypt=function(A){try{return this.getKey().decrypt(Gt(A))}catch(t){return!1}},A.prototype.encrypt=function(A){try{return Ft(this.getKey().encrypt(A))}catch(t){return!1}},A.prototype.sign=function(A,t,r){try{return Ft(this.getKey().sign(A,t,r))}catch(e){return!1}},A.prototype.verify=function(A,t,r){try{return this.getKey().verify(A,Gt(t),r)}catch(e){return!1}},A.prototype.getKey=function(A){if(!this.key){if(this.key=new mr,A&&"[object Function]"==={}.toString.call(A))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,A);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},A.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},A.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},A.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},A.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},A.version=Lr,A}(),Tr={exports:{}},Or=Tr.exports;function Nr(){return Dr||(Dr=1,A=Tr,function(){var t;function r(A,t,r){null!=A&&("number"==typeof A?this.fromNumber(A,t,r):null==t&&"string"!=typeof A?this.fromString(A,256):this.fromString(A,t))}function e(){return new r(null)}var i="undefined"!=typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(A,t,r,e,i,s){for(var g=32767&t,a=t>>15;--s>=0;){var B=32767&this[A],n=this[A++]>>15,V=a*B+n*g;i=((B=g*B+((32767&V)<<15)+r[e]+(1073741823&i))>>>30)+(V>>>15)+a*n+(i>>>30),r[e++]=1073741823&B}return i},t=30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(A,t,r,e,i,s){for(;--s>=0;){var g=t*this[A++]+r[e]+i;i=Math.floor(g/67108864),r[e++]=67108863&g}return i},t=26):(r.prototype.am=function(A,t,r,e,i,s){for(var g=16383&t,a=t>>14;--s>=0;){var B=16383&this[A],n=this[A++]>>14,V=a*B+n*g;i=((B=g*B+((16383&V)<<14)+r[e]+i)>>28)+(V>>14)+a*n,r[e++]=268435455&B}return i},t=28),r.prototype.DB=t,r.prototype.DM=(1<<t)-1,r.prototype.DV=1<<t,r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-t,r.prototype.F2=2*t-52;var s,g,a=new Array;for(s="0".charCodeAt(0),g=0;g<=9;++g)a[s++]=g;for(s="a".charCodeAt(0),g=10;g<36;++g)a[s++]=g;for(s="A".charCodeAt(0),g=10;g<36;++g)a[s++]=g;function B(A){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(A)}function n(A,t){var r=a[A.charCodeAt(t)];return null==r?-1:r}function V(A){var t=e();return t.fromInt(A),t}function I(A){var t,r=1;return 0!=(t=A>>>16)&&(A=t,r+=16),0!=(t=A>>8)&&(A=t,r+=8),0!=(t=A>>4)&&(A=t,r+=4),0!=(t=A>>2)&&(A=t,r+=2),0!=(t=A>>1)&&(A=t,r+=1),r}function o(A){this.m=A}function E(A){this.m=A,this.mp=A.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<A.DB-15)-1,this.mt2=2*A.t}function C(A,t){return A&t}function W(A,t){return A|t}function q(A,t){return A^t}function u(A,t){return A&~t}function Q(A){if(0==A)return-1;var t=0;return 65535&A||(A>>=16,t+=16),255&A||(A>>=8,t+=8),15&A||(A>>=4,t+=4),3&A||(A>>=2,t+=2),1&A||++t,t}function l(A){for(var t=0;0!=A;)A&=A-1,++t;return t}function k(){}function c(A){return A}function x(A){this.r2=e(),this.q3=e(),r.ONE.dlShiftTo(2*A.t,this.r2),this.mu=this.r2.divide(A),this.m=A}o.prototype.convert=function(A){return A.s<0||A.compareTo(this.m)>=0?A.mod(this.m):A},o.prototype.revert=function(A){return A},o.prototype.reduce=function(A){A.divRemTo(this.m,null,A)},o.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r),this.reduce(r)},o.prototype.sqrTo=function(A,t){A.squareTo(t),this.reduce(t)},E.prototype.convert=function(A){var t=e();return A.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),A.s<0&&t.compareTo(r.ZERO)>0&&this.m.subTo(t,t),t},E.prototype.revert=function(A){var t=e();return A.copyTo(t),this.reduce(t),t},E.prototype.reduce=function(A){for(;A.t<=this.mt2;)A[A.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&A[t],e=r*this.mpl+((r*this.mph+(A[t]>>15)*this.mpl&this.um)<<15)&A.DM;for(A[r=t+this.m.t]+=this.m.am(0,e,A,t,0,this.m.t);A[r]>=A.DV;)A[r]-=A.DV,A[++r]++}A.clamp(),A.drShiftTo(this.m.t,A),A.compareTo(this.m)>=0&&A.subTo(this.m,A)},E.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r),this.reduce(r)},E.prototype.sqrTo=function(A,t){A.squareTo(t),this.reduce(t)},r.prototype.copyTo=function(A){for(var t=this.t-1;t>=0;--t)A[t]=this[t];A.t=this.t,A.s=this.s},r.prototype.fromInt=function(A){this.t=1,this.s=A<0?-1:0,A>0?this[0]=A:A<-1?this[0]=A+this.DV:this.t=0},r.prototype.fromString=function(A,t){var e;if(16==t)e=4;else if(8==t)e=3;else if(256==t)e=8;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return void this.fromRadix(A,t);e=2}this.t=0,this.s=0;for(var i=A.length,s=!1,g=0;--i>=0;){var a=8==e?255&A[i]:n(A,i);a<0?"-"==A.charAt(i)&&(s=!0):(s=!1,0==g?this[this.t++]=a:g+e>this.DB?(this[this.t-1]|=(a&(1<<this.DB-g)-1)<<g,this[this.t++]=a>>this.DB-g):this[this.t-1]|=a<<g,(g+=e)>=this.DB&&(g-=this.DB))}8==e&&128&A[0]&&(this.s=-1,g>0&&(this[this.t-1]|=(1<<this.DB-g)-1<<g)),this.clamp(),s&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var A=this.s&this.DM;this.t>0&&this[this.t-1]==A;)--this.t},r.prototype.dlShiftTo=function(A,t){var r;for(r=this.t-1;r>=0;--r)t[r+A]=this[r];for(r=A-1;r>=0;--r)t[r]=0;t.t=this.t+A,t.s=this.s},r.prototype.drShiftTo=function(A,t){for(var r=A;r<this.t;++r)t[r-A]=this[r];t.t=Math.max(this.t-A,0),t.s=this.s},r.prototype.lShiftTo=function(A,t){var r,e=A%this.DB,i=this.DB-e,s=(1<<i)-1,g=Math.floor(A/this.DB),a=this.s<<e&this.DM;for(r=this.t-1;r>=0;--r)t[r+g+1]=this[r]>>i|a,a=(this[r]&s)<<e;for(r=g-1;r>=0;--r)t[r]=0;t[g]=a,t.t=this.t+g+1,t.s=this.s,t.clamp()},r.prototype.rShiftTo=function(A,t){t.s=this.s;var r=Math.floor(A/this.DB);if(r>=this.t)t.t=0;else{var e=A%this.DB,i=this.DB-e,s=(1<<e)-1;t[0]=this[r]>>e;for(var g=r+1;g<this.t;++g)t[g-r-1]|=(this[g]&s)<<i,t[g-r]=this[g]>>e;e>0&&(t[this.t-r-1]|=(this.s&s)<<i),t.t=this.t-r,t.clamp()}},r.prototype.subTo=function(A,t){for(var r=0,e=0,i=Math.min(A.t,this.t);r<i;)e+=this[r]-A[r],t[r++]=e&this.DM,e>>=this.DB;if(A.t<this.t){for(e-=A.s;r<this.t;)e+=this[r],t[r++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;r<A.t;)e-=A[r],t[r++]=e&this.DM,e>>=this.DB;e-=A.s}t.s=e<0?-1:0,e<-1?t[r++]=this.DV+e:e>0&&(t[r++]=e),t.t=r,t.clamp()},r.prototype.multiplyTo=function(A,t){var e=this.abs(),i=A.abs(),s=e.t;for(t.t=s+i.t;--s>=0;)t[s]=0;for(s=0;s<i.t;++s)t[s+e.t]=e.am(0,i[s],t,s,0,e.t);t.s=0,t.clamp(),this.s!=A.s&&r.ZERO.subTo(t,t)},r.prototype.squareTo=function(A){for(var t=this.abs(),r=A.t=2*t.t;--r>=0;)A[r]=0;for(r=0;r<t.t-1;++r){var e=t.am(r,t[r],A,2*r,0,1);(A[r+t.t]+=t.am(r+1,2*t[r],A,2*r+1,e,t.t-r-1))>=t.DV&&(A[r+t.t]-=t.DV,A[r+t.t+1]=1)}A.t>0&&(A[A.t-1]+=t.am(r,t[r],A,2*r,0,1)),A.s=0,A.clamp()},r.prototype.divRemTo=function(A,t,i){var s=A.abs();if(!(s.t<=0)){var g=this.abs();if(g.t<s.t)return null!=t&&t.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=e());var a=e(),B=this.s,n=A.s,V=this.DB-I(s[s.t-1]);V>0?(s.lShiftTo(V,a),g.lShiftTo(V,i)):(s.copyTo(a),g.copyTo(i));var o=a.t,E=a[o-1];if(0!=E){var C=E*(1<<this.F1)+(o>1?a[o-2]>>this.F2:0),W=this.FV/C,q=(1<<this.F1)/C,u=1<<this.F2,Q=i.t,l=Q-o,k=null==t?e():t;for(a.dlShiftTo(l,k),i.compareTo(k)>=0&&(i[i.t++]=1,i.subTo(k,i)),r.ONE.dlShiftTo(o,k),k.subTo(a,a);a.t<o;)a[a.t++]=0;for(;--l>=0;){var c=i[--Q]==E?this.DM:Math.floor(i[Q]*W+(i[Q-1]+u)*q);if((i[Q]+=a.am(0,c,i,l,0,o))<c)for(a.dlShiftTo(l,k),i.subTo(k,i);i[Q]<--c;)i.subTo(k,i)}null!=t&&(i.drShiftTo(o,t),B!=n&&r.ZERO.subTo(t,t)),i.t=o,i.clamp(),V>0&&i.rShiftTo(V,i),B<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var A=this[0];if(!(1&A))return 0;var t=3&A;return(t=(t=(t=(t=t*(2-(15&A)*t)&15)*(2-(255&A)*t)&255)*(2-((65535&A)*t&65535))&65535)*(2-A*t%this.DV)%this.DV)>0?this.DV-t:-t},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(A,t){if(A>4294967295||A<1)return r.ONE;var i=e(),s=e(),g=t.convert(this),a=I(A)-1;for(g.copyTo(i);--a>=0;)if(t.sqrTo(i,s),(A&1<<a)>0)t.mulTo(s,g,i);else{var B=i;i=s,s=B}return t.revert(i)},r.prototype.toString=function(A){if(this.s<0)return"-"+this.negate().toString(A);var t;if(16==A)t=4;else if(8==A)t=3;else if(2==A)t=1;else if(32==A)t=5;else{if(4!=A)return this.toRadix(A);t=2}var r,e=(1<<t)-1,i=!1,s="",g=this.t,a=this.DB-g*this.DB%t;if(g-- >0)for(a<this.DB&&(r=this[g]>>a)>0&&(i=!0,s=B(r));g>=0;)a<t?(r=(this[g]&(1<<a)-1)<<t-a,r|=this[--g]>>(a+=this.DB-t)):(r=this[g]>>(a-=t)&e,a<=0&&(a+=this.DB,--g)),r>0&&(i=!0),i&&(s+=B(r));return i?s:"0"},r.prototype.negate=function(){var A=e();return r.ZERO.subTo(this,A),A},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(A){var t=this.s-A.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-A.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-A[r]))return t;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+I(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(A){var t=e();return this.abs().divRemTo(A,null,t),this.s<0&&t.compareTo(r.ZERO)>0&&A.subTo(t,t),t},r.prototype.modPowInt=function(A,t){var r;return r=A<256||t.isEven()?new o(t):new E(t),this.exp(A,r)},r.ZERO=V(0),r.ONE=V(1),k.prototype.convert=c,k.prototype.revert=c,k.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r)},k.prototype.sqrTo=function(A,t){A.squareTo(t)},x.prototype.convert=function(A){if(A.s<0||A.t>2*this.m.t)return A.mod(this.m);if(A.compareTo(this.m)<0)return A;var t=e();return A.copyTo(t),this.reduce(t),t},x.prototype.revert=function(A){return A},x.prototype.reduce=function(A){for(A.drShiftTo(this.m.t-1,this.r2),A.t>this.m.t+1&&(A.t=this.m.t+1,A.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);A.compareTo(this.r2)<0;)A.dAddOffset(1,this.m.t+1);for(A.subTo(this.r2,A);A.compareTo(this.m)>=0;)A.subTo(this.m,A)},x.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r),this.reduce(r)},x.prototype.sqrTo=function(A,t){A.squareTo(t),this.reduce(t)};var Y,w,d,y=[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],D=(1<<26)/y[y.length-1];function S(){var A;A=(new Date).getTime(),w[d++]^=255&A,w[d++]^=A>>8&255,w[d++]^=A>>16&255,w[d++]^=A>>24&255,d>=M&&(d-=M)}if(r.prototype.chunkSize=function(A){return Math.floor(Math.LN2*this.DB/Math.log(A))},r.prototype.toRadix=function(A){if(null==A&&(A=10),0==this.signum()||A<2||A>36)return"0";var t=this.chunkSize(A),r=Math.pow(A,t),i=V(r),s=e(),g=e(),a="";for(this.divRemTo(i,s,g);s.signum()>0;)a=(r+g.intValue()).toString(A).substr(1)+a,s.divRemTo(i,s,g);return g.intValue().toString(A)+a},r.prototype.fromRadix=function(A,t){this.fromInt(0),null==t&&(t=10);for(var e=this.chunkSize(t),i=Math.pow(t,e),s=!1,g=0,a=0,B=0;B<A.length;++B){var V=n(A,B);V<0?"-"==A.charAt(B)&&0==this.signum()&&(s=!0):(a=t*a+V,++g>=e&&(this.dMultiply(i),this.dAddOffset(a,0),g=0,a=0))}g>0&&(this.dMultiply(Math.pow(t,g)),this.dAddOffset(a,0)),s&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(A,t,e){if("number"==typeof t)if(A<2)this.fromInt(1);else for(this.fromNumber(A,e),this.testBit(A-1)||this.bitwiseTo(r.ONE.shiftLeft(A-1),W,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>A&&this.subTo(r.ONE.shiftLeft(A-1),this);else{var i=new Array,s=7&A;i.length=1+(A>>3),t.nextBytes(i),s>0?i[0]&=(1<<s)-1:i[0]=0,this.fromString(i,256)}},r.prototype.bitwiseTo=function(A,t,r){var e,i,s=Math.min(A.t,this.t);for(e=0;e<s;++e)r[e]=t(this[e],A[e]);if(A.t<this.t){for(i=A.s&this.DM,e=s;e<this.t;++e)r[e]=t(this[e],i);r.t=this.t}else{for(i=this.s&this.DM,e=s;e<A.t;++e)r[e]=t(i,A[e]);r.t=A.t}r.s=t(this.s,A.s),r.clamp()},r.prototype.changeBit=function(A,t){var e=r.ONE.shiftLeft(A);return this.bitwiseTo(e,t,e),e},r.prototype.addTo=function(A,t){for(var r=0,e=0,i=Math.min(A.t,this.t);r<i;)e+=this[r]+A[r],t[r++]=e&this.DM,e>>=this.DB;if(A.t<this.t){for(e+=A.s;r<this.t;)e+=this[r],t[r++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;r<A.t;)e+=A[r],t[r++]=e&this.DM,e>>=this.DB;e+=A.s}t.s=e<0?-1:0,e>0?t[r++]=e:e<-1&&(t[r++]=this.DV+e),t.t=r,t.clamp()},r.prototype.dMultiply=function(A){this[this.t]=this.am(0,A-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(A,t){if(0!=A){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=A;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},r.prototype.multiplyLowerTo=function(A,t,r){var e,i=Math.min(this.t+A.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(e=r.t-this.t;i<e;++i)r[i+this.t]=this.am(0,A[i],r,i,0,this.t);for(e=Math.min(A.t,t);i<e;++i)this.am(0,A[i],r,i,0,t-i);r.clamp()},r.prototype.multiplyUpperTo=function(A,t,r){--t;var e=r.t=this.t+A.t-t;for(r.s=0;--e>=0;)r[e]=0;for(e=Math.max(t-this.t,0);e<A.t;++e)r[this.t+e-t]=this.am(t-e,A[e],r,0,0,this.t+e-t);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function(A){if(A<=0)return 0;var t=this.DV%A,r=this.s<0?A-1:0;if(this.t>0)if(0==t)r=this[0]%A;else for(var e=this.t-1;e>=0;--e)r=(t*r+this[e])%A;return r},r.prototype.millerRabin=function(A){var t=this.subtract(r.ONE),i=t.getLowestSetBit();if(i<=0)return!1;var s=t.shiftRight(i);(A=A+1>>1)>y.length&&(A=y.length);for(var g=e(),a=0;a<A;++a){g.fromInt(y[Math.floor(Math.random()*y.length)]);var B=g.modPow(s,this);if(0!=B.compareTo(r.ONE)&&0!=B.compareTo(t)){for(var n=1;n++<i&&0!=B.compareTo(t);)if(0==(B=B.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=B.compareTo(t))return!1}}return!0},r.prototype.clone=function(){var A=e();return this.copyTo(A),A},r.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var A=this.t,t=new Array;t[0]=this.s;var r,e=this.DB-A*this.DB%8,i=0;if(A-- >0)for(e<this.DB&&(r=this[A]>>e)!=(this.s&this.DM)>>e&&(t[i++]=r|this.s<<this.DB-e);A>=0;)e<8?(r=(this[A]&(1<<e)-1)<<8-e,r|=this[--A]>>(e+=this.DB-8)):(r=this[A]>>(e-=8)&255,e<=0&&(e+=this.DB,--A)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},r.prototype.equals=function(A){return 0==this.compareTo(A)},r.prototype.min=function(A){return this.compareTo(A)<0?this:A},r.prototype.max=function(A){return this.compareTo(A)>0?this:A},r.prototype.and=function(A){var t=e();return this.bitwiseTo(A,C,t),t},r.prototype.or=function(A){var t=e();return this.bitwiseTo(A,W,t),t},r.prototype.xor=function(A){var t=e();return this.bitwiseTo(A,q,t),t},r.prototype.andNot=function(A){var t=e();return this.bitwiseTo(A,u,t),t},r.prototype.not=function(){for(var A=e(),t=0;t<this.t;++t)A[t]=this.DM&~this[t];return A.t=this.t,A.s=~this.s,A},r.prototype.shiftLeft=function(A){var t=e();return A<0?this.rShiftTo(-A,t):this.lShiftTo(A,t),t},r.prototype.shiftRight=function(A){var t=e();return A<0?this.lShiftTo(-A,t):this.rShiftTo(A,t),t},r.prototype.getLowestSetBit=function(){for(var A=0;A<this.t;++A)if(0!=this[A])return A*this.DB+Q(this[A]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var A=0,t=this.s&this.DM,r=0;r<this.t;++r)A+=l(this[r]^t);return A},r.prototype.testBit=function(A){var t=Math.floor(A/this.DB);return t>=this.t?0!=this.s:!!(this[t]&1<<A%this.DB)},r.prototype.setBit=function(A){return this.changeBit(A,W)},r.prototype.clearBit=function(A){return this.changeBit(A,u)},r.prototype.flipBit=function(A){return this.changeBit(A,q)},r.prototype.add=function(A){var t=e();return this.addTo(A,t),t},r.prototype.subtract=function(A){var t=e();return this.subTo(A,t),t},r.prototype.multiply=function(A){var t=e();return this.multiplyTo(A,t),t},r.prototype.divide=function(A){var t=e();return this.divRemTo(A,t,null),t},r.prototype.remainder=function(A){var t=e();return this.divRemTo(A,null,t),t},r.prototype.divideAndRemainder=function(A){var t=e(),r=e();return this.divRemTo(A,t,r),new Array(t,r)},r.prototype.modPow=function(A,t){var r,i,s=A.bitLength(),g=V(1);if(s<=0)return g;r=s<18?1:s<48?3:s<144?4:s<768?5:6,i=s<8?new o(t):t.isEven()?new x(t):new E(t);var a=new Array,B=3,n=r-1,C=(1<<r)-1;if(a[1]=i.convert(this),r>1){var W=e();for(i.sqrTo(a[1],W);B<=C;)a[B]=e(),i.mulTo(W,a[B-2],a[B]),B+=2}var q,u,Q=A.t-1,l=!0,k=e();for(s=I(A[Q])-1;Q>=0;){for(s>=n?q=A[Q]>>s-n&C:(q=(A[Q]&(1<<s+1)-1)<<n-s,Q>0&&(q|=A[Q-1]>>this.DB+s-n)),B=r;!(1&q);)q>>=1,--B;if((s-=B)<0&&(s+=this.DB,--Q),l)a[q].copyTo(g),l=!1;else{for(;B>1;)i.sqrTo(g,k),i.sqrTo(k,g),B-=2;B>0?i.sqrTo(g,k):(u=g,g=k,k=u),i.mulTo(k,a[q],g)}for(;Q>=0&&!(A[Q]&1<<s);)i.sqrTo(g,k),u=g,g=k,k=u,--s<0&&(s=this.DB-1,--Q)}return i.revert(g)},r.prototype.modInverse=function(A){var t=A.isEven();if(this.isEven()&&t||0==A.signum())return r.ZERO;for(var e=A.clone(),i=this.clone(),s=V(1),g=V(0),a=V(0),B=V(1);0!=e.signum();){for(;e.isEven();)e.rShiftTo(1,e),t?(s.isEven()&&g.isEven()||(s.addTo(this,s),g.subTo(A,g)),s.rShiftTo(1,s)):g.isEven()||g.subTo(A,g),g.rShiftTo(1,g);for(;i.isEven();)i.rShiftTo(1,i),t?(a.isEven()&&B.isEven()||(a.addTo(this,a),B.subTo(A,B)),a.rShiftTo(1,a)):B.isEven()||B.subTo(A,B),B.rShiftTo(1,B);e.compareTo(i)>=0?(e.subTo(i,e),t&&s.subTo(a,s),g.subTo(B,g)):(i.subTo(e,i),t&&a.subTo(s,a),B.subTo(g,B))}return 0!=i.compareTo(r.ONE)?r.ZERO:B.compareTo(A)>=0?B.subtract(A):B.signum()<0?(B.addTo(A,B),B.signum()<0?B.add(A):B):B},r.prototype.pow=function(A){return this.exp(A,new k)},r.prototype.gcd=function(A){var t=this.s<0?this.negate():this.clone(),r=A.s<0?A.negate():A.clone();if(t.compareTo(r)<0){var e=t;t=r,r=e}var i=t.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return t;for(i<s&&(s=i),s>0&&(t.rShiftTo(s,t),r.rShiftTo(s,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r},r.prototype.isProbablePrime=function(A){var t,r=this.abs();if(1==r.t&&r[0]<=y[y.length-1]){for(t=0;t<y.length;++t)if(r[0]==y[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<y.length;){for(var e=y[t],i=t+1;i<y.length&&e<D;)e*=y[i++];for(e=r.modInt(e);t<i;)if(e%y[t++]==0)return!1}return r.millerRabin(A)},r.prototype.square=function(){var A=e();return this.squareTo(A),A},r.prototype.Barrett=x,null==w){var J;if(w=new Array,d=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var b=new Uint8Array(32);for(window.crypto.getRandomValues(b),J=0;J<32;++J)w[d++]=b[J]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var f=window.crypto.random(32);for(J=0;J<f.length;++J)w[d++]=255&f.charCodeAt(J)}for(;d<M;)J=Math.floor(65536*Math.random()),w[d++]=J>>>8,w[d++]=255&J;d=0,S()}function p(){if(null==Y){for(S(),(Y=new h).init(w),d=0;d<w.length;++d)w[d]=0;d=0}return Y.next()}function K(){}function h(){this.i=0,this.j=0,this.S=new Array}K.prototype.nextBytes=function(A){var t;for(t=0;t<A.length;++t)A[t]=p()},h.prototype.init=function(A){var t,r,e;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+A[t%A.length]&255,e=this.S[t],this.S[t]=this.S[r],this.S[r]=e;this.i=0,this.j=0},h.prototype.next=function(){var A;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,A=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=A,this.S[A+this.S[this.i]&255]};var M=256;A.exports={default:r,BigInteger:r,SecureRandom:K}}.call(Or)),Tr.exports;var A}function zr(){if(Jr)return Sr;Jr=1;const{BigInteger:A}=Nr();class t{constructor(){this.tlv=null,this.t="00",this.l="00",this.v=""}getEncodedHex(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}getLength(){const A=this.v.length/2;let t=A.toString(16);if(t.length%2==1&&(t="0"+t),A<128)return t;return(128+t.length/2).toString(16)+t}getValue(){return""}}class r extends t{constructor(t){super(),this.t="02",t&&(this.v=function(t){let r=t.toString(16);if("-"!==r[0])r.length%2==1?r="0"+r:r.match(/^[0-7]/)||(r="00"+r);else{r=r.substr(1);let e=r.length;e%2==1?e+=1:r.match(/^[0-7]/)||(e+=2);let i="";for(let A=0;A<e;A++)i+="f";i=new A(i,16),r=i.xor(t).add(A.ONE),r=r.toString(16).replace(/^-/,"")}return r}(t))}getValue(){return this.v}}class e extends t{constructor(A){super(),this.t="30",this.asn1Array=A}getValue(){return this.v=this.asn1Array.map(A=>A.getEncodedHex()).join(""),this.v}}function i(A,t){return+A[t+2]<8?1:128&+A.substr(t+2,2)}function s(t,r){const e=i(t,r),s=t.substr(r+2,2*e);if(!s)return-1;return(+s[0]<8?new A(s,16):new A(s.substr(2),16)).intValue()}function g(A,t){return t+2*(i(A,t)+1)}return Sr={encodeDer(A,t){const i=new r(A),s=new r(t);return new e([i,s]).getEncodedHex()},decodeDer(t){const r=g(t,0),e=g(t,r),i=s(t,r),a=t.substr(e,2*i),B=e+a.length,n=g(t,B),V=s(t,B),I=t.substr(n,2*V);return{r:new A(a,16),s:new A(I,16)}}}}function _r(){if(Kr)return pr;Kr=1;const{BigInteger:A,SecureRandom:t}=Nr(),{ECCurveFp:r}=function(){if(fr)return br;fr=1;const{BigInteger:A}=Nr(),t=new A("2"),r=new A("3");class e{constructor(A,t){this.x=t,this.q=A}equals(A){return A===this||this.q.equals(A.q)&&this.x.equals(A.x)}toBigInteger(){return this.x}negate(){return new e(this.q,this.x.negate().mod(this.q))}add(A){return new e(this.q,this.x.add(A.toBigInteger()).mod(this.q))}subtract(A){return new e(this.q,this.x.subtract(A.toBigInteger()).mod(this.q))}multiply(A){return new e(this.q,this.x.multiply(A.toBigInteger()).mod(this.q))}divide(A){return new e(this.q,this.x.multiply(A.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new e(this.q,this.x.square().mod(this.q))}}class i{constructor(t,r,e,i){this.curve=t,this.x=r,this.y=e,this.z=null==i?A.ONE:i,this.zinv=null}getX(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}getY(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}equals(t){return t===this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(A.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(A.ZERO))}isInfinity(){return null===this.x&&null===this.y||this.z.equals(A.ZERO)&&!this.y.toBigInteger().equals(A.ZERO)}negate(){return new i(this.curve,this.x,this.y.negate(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;const r=this.x.toBigInteger(),e=this.y.toBigInteger(),s=this.z,g=t.x.toBigInteger(),a=t.y.toBigInteger(),B=t.z,n=this.curve.q,V=r.multiply(B).mod(n),I=g.multiply(s).mod(n),o=V.subtract(I),E=e.multiply(B).mod(n),C=a.multiply(s).mod(n),W=E.subtract(C);if(A.ZERO.equals(o))return A.ZERO.equals(W)?this.twice():this.curve.infinity;const q=V.add(I),u=s.multiply(B).mod(n),Q=o.square().mod(n),l=o.multiply(Q).mod(n),k=u.multiply(W.square()).subtract(q.multiply(Q)).mod(n),c=o.multiply(k).mod(n),x=W.multiply(Q.multiply(V).subtract(k)).subtract(E.multiply(l)).mod(n),Y=l.multiply(u).mod(n);return new i(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(x),Y)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const A=this.x.toBigInteger(),t=this.y.toBigInteger(),e=this.z,s=this.curve.q,g=this.curve.a.toBigInteger(),a=A.square().multiply(r).add(g.multiply(e.square())).mod(s),B=t.shiftLeft(1).multiply(e).mod(s),n=t.square().mod(s),V=n.multiply(A).multiply(e).mod(s),I=B.square().mod(s),o=a.square().subtract(V.shiftLeft(3)).mod(s),E=B.multiply(o).mod(s),C=a.multiply(V.shiftLeft(2).subtract(o)).subtract(I.shiftLeft(1).multiply(n)).mod(s),W=B.multiply(I).mod(s);return new i(this.curve,this.curve.fromBigInteger(E),this.curve.fromBigInteger(C),W)}multiply(A){if(this.isInfinity())return this;if(!A.signum())return this.curve.infinity;const t=A.multiply(r),e=this.negate();let i=this;for(let r=t.bitLength()-2;r>0;r--){i=i.twice();const s=t.testBit(r);s!==A.testBit(r)&&(i=i.add(s?this:e))}return i}}return br={ECPointFp:i,ECCurveFp:class{constructor(A,t,r){this.q=A,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new i(this,null,null)}equals(A){return A===this||this.q.equals(A.q)&&this.a.equals(A.a)&&this.b.equals(A.b)}fromBigInteger(A){return new e(this.q,A)}decodePointHex(r){switch(parseInt(r.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const e=this.fromBigInteger(new A(r.substr(2),16));let s=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new A("4")).add(A.ONE),this.q));return s.toBigInteger().mod(t).equals(new A(r.substr(0,2),16).subtract(t))||(s=s.negate()),new i(this,e,s);case 4:case 6:case 7:const g=(r.length-2)/2,a=r.substr(2,g),B=r.substr(g+2,g);return new i(this,this.fromBigInteger(new A(a,16)),this.fromBigInteger(new A(B,16)));default:return null}}}}}(),e=new t,{curve:i,G:s,n:g}=a();function a(){const t=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),e=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),i=new A("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),s=new r(t,e,i),g=s.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:s,G:g,n:new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function B(A,t){return A.length>=t?A:new Array(t-A.length+1).join("0")+A}return pr={getGlobalCurve:function(){return i},generateEcparam:a,generateKeyPairHex:function(t,r,i){const a=(t?new A(t,r,i):new A(g.bitLength(),e)).mod(g.subtract(A.ONE)).add(A.ONE),n=B(a.toString(16),64),V=s.multiply(a);return{privateKey:n,publicKey:"04"+B(V.getX().toBigInteger().toString(16),64)+B(V.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(t){if(130!==t.length)throw new Error("Invalid public key to compress");const r=(t.length-2)/2,e=t.substr(2,r);let i="03";return new A(t.substr(r+2,r),16).mod(new A("2")).equals(A.ZERO)&&(i="02"),i+e},utf8ToHex:function(A){const t=(A=unescape(encodeURIComponent(A))).length,r=[];for(let i=0;i<t;i++)r[i>>>2]|=(255&A.charCodeAt(i))<<24-i%4*8;const e=[];for(let i=0;i<t;i++){const A=r[i>>>2]>>>24-i%4*8&255;e.push((A>>>4).toString(16)),e.push((15&A).toString(16))}return e.join("")},leftPad:B,arrayToHex:function(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")},arrayToUtf8:function(A){const t=[];let r=0;for(let i=0;i<2*A.length;i+=2)t[i>>>3]|=parseInt(A[r],10)<<24-i%8*4,r++;try{const r=[];for(let e=0;e<A.length;e++){const A=t[e>>>2]>>>24-e%4*8&255;r.push(String.fromCharCode(A))}return decodeURIComponent(escape(r.join("")))}catch(e){throw new Error("Malformed UTF-8 data")}},hexToArray:function(A){const t=[];let r=A.length;r%2!=0&&(A=B(A,r+1)),r=A.length;for(let e=0;e<r;e+=2)t.push(parseInt(A.substr(e,2),16));return t},verifyPublicKey:function(A){const t=i.decodePointHex(A);if(!t)return!1;const r=t.getX();return t.getY().square().equals(r.multiply(r.square()).add(r.multiply(i.a)).add(i.b))},comparePublicKeyHex:function(A,t){const r=i.decodePointHex(A);if(!r)return!1;const e=i.decodePointHex(t);return!!e&&r.equals(e)}}}function $r(){if(Mr)return hr;Mr=1;const A=new Uint32Array(68),t=new Uint32Array(64);function r(A,t){const r=31&t;return A<<r|A>>>32-r}function e(A,t){const r=[];for(let e=A.length-1;e>=0;e--)r[e]=255&(A[e]^t[e]);return r}function i(A){return A^r(A,9)^r(A,17)}function s(A){return A^r(A,15)^r(A,23)}function g(e){let g=8*e.length,a=g%512;a=a>=448?512-a%448-1:448-a-1;const B=new Array((a-7)/8),n=new Array(8);for(let A=0,t=B.length;A<t;A++)B[A]=0;for(let A=0,t=n.length;A<t;A++)n[A]=0;g=g.toString(2);for(let A=7;A>=0;A--)if(g.length>8){const t=g.length-8;n[A]=parseInt(g.substr(t),2),g=g.substr(0,t)}else g.length>0&&(n[A]=parseInt(g,2),g="");const V=new Uint8Array([...e,128,...B,...n]),I=new DataView(V.buffer,0),o=V.length/64,E=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let W=0;W<o;W++){A.fill(0),t.fill(0);const e=16*W;for(let t=0;t<16;t++)A[t]=I.getUint32(4*(e+t),!1);for(let t=16;t<68;t++)A[t]=s(A[t-16]^A[t-9]^r(A[t-3],15))^r(A[t-13],7)^A[t-6];for(let r=0;r<64;r++)t[r]=A[r]^A[r+4];const g=2043430169,a=2055708042;let B,n,V,o,C,q=E[0],u=E[1],Q=E[2],l=E[3],k=E[4],c=E[5],x=E[6],Y=E[7];for(let s=0;s<64;s++)C=s>=0&&s<=15?g:a,B=r(r(q,12)+k+r(C,s),7),n=B^r(q,12),V=(s>=0&&s<=15?q^u^Q:q&u|q&Q|u&Q)+l+n+t[s],o=(s>=0&&s<=15?k^c^x:k&c|~k&x)+Y+B+A[s],l=Q,Q=r(u,9),u=q,q=V,Y=x,x=r(c,19),c=k,k=i(o);E[0]^=q,E[1]^=u,E[2]^=Q,E[3]^=l,E[4]^=k,E[5]^=c,E[6]^=x,E[7]^=Y}const C=[];for(let A=0,t=E.length;A<t;A++){const t=E[A];C.push((4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t)}return C}const a=new Uint8Array(64),B=new Uint8Array(64);for(let n=0;n<64;n++)a[n]=54,B[n]=92;return hr={sm3:g,hmac:function(A,t){for(t.length>64&&(t=g(t));t.length<64;)t.push(0);const r=e(t,a),i=e(t,B),s=g([...r,...A]);return g([...i,...s])}}}function Ae(){if(Gr)return Fr;Gr=1;const{BigInteger:A}=Nr(),{encodeDer:t,decodeDer:r}=zr(),e=_r(),i=$r().sm3,{G:s,curve:g,n:a}=e.generateEcparam();function B(A,t,r="1234567812345678"){r=e.utf8ToHex(r);const g=e.leftPad(s.curve.a.toBigInteger().toRadix(16),64),a=e.leftPad(s.curve.b.toBigInteger().toRadix(16),64),B=e.leftPad(s.getX().toBigInteger().toRadix(16),64),n=e.leftPad(s.getY().toBigInteger().toRadix(16),64);let V,I;if(128===t.length)V=t.substr(0,64),I=t.substr(64,64);else{const A=s.curve.decodePointHex(t);V=e.leftPad(A.getX().toBigInteger().toRadix(16),64),I=e.leftPad(A.getY().toBigInteger().toRadix(16),64)}const o=e.hexToArray(r+g+a+B+n+V+I),E=4*r.length;o.unshift(255&E),o.unshift(E>>8&255);const C=i(o);return e.arrayToHex(i(C.concat(e.hexToArray(A))))}function n(t){const r=s.multiply(new A(t,16));return"04"+e.leftPad(r.getX().toBigInteger().toString(16),64)+e.leftPad(r.getY().toBigInteger().toString(16),64)}function V(){const t=e.generateKeyPairHex(),r=g.decodePointHex(t.publicKey);return t.k=new A(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}return Fr={generateKeyPairHex:e.generateKeyPairHex,compressPublicKeyHex:e.compressPublicKeyHex,comparePublicKeyHex:e.comparePublicKeyHex,doEncrypt:function(t,r,s=1){t="string"==typeof t?e.hexToArray(e.utf8ToHex(t)):Array.prototype.slice.call(t),r=e.getGlobalCurve().decodePointHex(r);const g=e.generateKeyPairHex(),a=new A(g.privateKey,16);let B=g.publicKey;B.length>128&&(B=B.substr(B.length-128));const n=r.multiply(a),V=e.hexToArray(e.leftPad(n.getX().toBigInteger().toRadix(16),64)),I=e.hexToArray(e.leftPad(n.getY().toBigInteger().toRadix(16),64)),o=e.arrayToHex(i([].concat(V,t,I)));let E=1,C=0,W=[];const q=[].concat(V,I),u=()=>{W=i([...q,E>>24&255,E>>16&255,E>>8&255,255&E]),E++,C=0};u();for(let A=0,e=t.length;A<e;A++)C===W.length&&u(),t[A]^=255&W[C++];const Q=e.arrayToHex(t);return 0===s?B+Q+o:B+o+Q},doDecrypt:function(t,r,s=1,{output:g="string"}={}){r=new A(r,16);let a=t.substr(128,64),B=t.substr(192);0===s&&(a=t.substr(t.length-64),B=t.substr(128,t.length-128-64));const n=e.hexToArray(B),V=e.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),I=e.hexToArray(e.leftPad(V.getX().toBigInteger().toRadix(16),64)),o=e.hexToArray(e.leftPad(V.getY().toBigInteger().toRadix(16),64));let E=1,C=0,W=[];const q=[].concat(I,o),u=()=>{W=i([...q,E>>24&255,E>>16&255,E>>8&255,255&E]),E++,C=0};u();for(let A=0,e=n.length;A<e;A++)C===W.length&&u(),n[A]^=255&W[C++];return e.arrayToHex(i([].concat(I,n,o)))===a.toLowerCase()?"array"===g?n:e.arrayToUtf8(n):"array"===g?[]:""},doSignature:function(r,i,{pointPool:s,der:g,hash:I,publicKey:o,userId:E}={}){let C="string"==typeof r?e.utf8ToHex(r):e.arrayToHex(r);I&&(C=B(C,o=o||n(i),E));const W=new A(i,16),q=new A(C,16);let u=null,Q=null,l=null;do{do{let A;A=s&&s.length?s.pop():V(),u=A.k,Q=q.add(A.x1).mod(a)}while(Q.equals(A.ZERO)||Q.add(u).equals(a));l=W.add(A.ONE).modInverse(a).multiply(u.subtract(Q.multiply(W))).mod(a)}while(l.equals(A.ZERO));return g?t(Q,l):e.leftPad(Q.toString(16),64)+e.leftPad(l.toString(16),64)},doVerifySignature:function(t,i,n,{der:V,hash:I,userId:o}={}){let E,C,W="string"==typeof t?e.utf8ToHex(t):e.arrayToHex(t);if(I&&(W=B(W,n,o)),V){const A=r(i);E=A.r,C=A.s}else E=new A(i.substring(0,64),16),C=new A(i.substring(64),16);const q=g.decodePointHex(n),u=new A(W,16),Q=E.add(C).mod(a);if(Q.equals(A.ZERO))return!1;const l=s.multiply(C).add(q.multiply(Q)),k=u.add(l.getX().toBigInteger()).mod(a);return E.equals(k)},getPublicKeyFromPrivateKey:n,getPoint:V,verifyPublicKey:e.verifyPublicKey}}function te(){if(vr)return Ur;vr=1;const{sm3:A,hmac:t}=$r();function r(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")}function e(A){const t=[];let r=A.length;var e,i;r%2!=0&&(i=r+1,A=(e=A).length>=i?e:new Array(i-e.length+1).join("0")+e),r=A.length;for(let s=0;s<r;s+=2)t.push(parseInt(A.substr(s,2),16));return t}return Ur=function(i,s){if(i="string"==typeof i?function(A){const t=[];for(let r=0,e=A.length;r<e;r++){const e=A.codePointAt(r);if(e<=127)t.push(e);else if(e<=2047)t.push(192|e>>>6),t.push(128|63&e);else if(e<=55295||e>=57344&&e<=65535)t.push(224|e>>>12),t.push(128|e>>>6&63),t.push(128|63&e);else{if(!(e>=65536&&e<=1114111))throw t.push(e),new Error("input is not supported");r++,t.push(240|e>>>18&28),t.push(128|e>>>12&63),t.push(128|e>>>6&63),t.push(128|63&e)}}return t}(i):Array.prototype.slice.call(i),s){if("hmac"!==(s.mode||"hmac"))throw new Error("invalid mode");let A=s.key;if(!A)throw new Error("invalid key");return A="string"==typeof A?e(A):Array.prototype.slice.call(A),r(t(i,A))}return r(A(i))}}function re(){if(Pr)return Hr;Pr=1;const A=16,t=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],r=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function e(A){const t=[];for(let r=0,e=A.length;r<e;r+=2)t.push(parseInt(A.substr(r,2),16));return t}function i(A,t){const r=31&t;return A<<r|A>>>32-r}function s(A){return(255&t[A>>>24&255])<<24|(255&t[A>>>16&255])<<16|(255&t[A>>>8&255])<<8|255&t[255&A]}function g(A){return A^i(A,2)^i(A,10)^i(A,18)^i(A,24)}function a(A){return A^i(A,13)^i(A,23)}function B(A,t,r){const e=new Array(4),i=new Array(4);for(let s=0;s<4;s++)i[0]=255&A[4*s],i[1]=255&A[4*s+1],i[2]=255&A[4*s+2],i[3]=255&A[4*s+3],e[s]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];for(let a,B=0;B<32;B+=4)a=e[1]^e[2]^e[3]^r[B+0],e[0]^=g(s(a)),a=e[2]^e[3]^e[0]^r[B+1],e[1]^=g(s(a)),a=e[3]^e[0]^e[1]^r[B+2],e[2]^=g(s(a)),a=e[0]^e[1]^e[2]^r[B+3],e[3]^=g(s(a));for(let s=0;s<16;s+=4)t[s]=e[3-s/4]>>>24&255,t[s+1]=e[3-s/4]>>>16&255,t[s+2]=e[3-s/4]>>>8&255,t[s+3]=255&e[3-s/4]}function n(t,i,g,{padding:n="pkcs#7",mode:V,iv:I=[],output:o="string"}={}){if("cbc"===V&&("string"==typeof I&&(I=e(I)),16!==I.length))throw new Error("iv is invalid");if("string"==typeof i&&(i=e(i)),16!==i.length)throw new Error("key is invalid");if(t="string"==typeof t?0!==g?function(A){const t=[];for(let r=0,e=A.length;r<e;r++){const e=A.codePointAt(r);if(e<=127)t.push(e);else if(e<=2047)t.push(192|e>>>6),t.push(128|63&e);else if(e<=55295||e>=57344&&e<=65535)t.push(224|e>>>12),t.push(128|e>>>6&63),t.push(128|63&e);else{if(!(e>=65536&&e<=1114111))throw t.push(e),new Error("input is not supported");r++,t.push(240|e>>>18&28),t.push(128|e>>>12&63),t.push(128|e>>>6&63),t.push(128|63&e)}}return t}(t):e(t):[...t],("pkcs#5"===n||"pkcs#7"===n)&&0!==g){const r=A-t.length%A;for(let A=0;A<r;A++)t.push(r)}const E=new Array(32);!function(A,t,e){const i=new Array(4),g=new Array(4);for(let r=0;r<4;r++)g[0]=255&A[0+4*r],g[1]=255&A[1+4*r],g[2]=255&A[2+4*r],g[3]=255&A[3+4*r],i[r]=g[0]<<24|g[1]<<16|g[2]<<8|g[3];i[0]^=2746333894,i[1]^=1453994832,i[2]^=1736282519,i[3]^=2993693404;for(let B,n=0;n<32;n+=4)B=i[1]^i[2]^i[3]^r[n+0],t[n+0]=i[0]^=a(s(B)),B=i[2]^i[3]^i[0]^r[n+1],t[n+1]=i[1]^=a(s(B)),B=i[3]^i[0]^i[1]^r[n+2],t[n+2]=i[2]^=a(s(B)),B=i[0]^i[1]^i[2]^r[n+3],t[n+3]=i[3]^=a(s(B));if(0===e)for(let r,s=0;s<16;s++)r=t[s],t[s]=t[31-s],t[31-s]=r}(i,E,g);const C=[];let W=I,q=t.length,u=0;for(;q>=A;){const r=t.slice(u,u+16),e=new Array(16);if("cbc"===V)for(let t=0;t<A;t++)0!==g&&(r[t]^=W[t]);B(r,e,E);for(let t=0;t<A;t++)"cbc"===V&&0===g&&(e[t]^=W[t]),C[u+t]=e[t];"cbc"===V&&(W=0!==g?e:r),q-=A,u+=A}if(("pkcs#5"===n||"pkcs#7"===n)&&0===g){const A=C.length,t=C[A-1];for(let r=1;r<=t;r++)if(C[A-r]!==t)throw new Error("padding is invalid");C.splice(A-t,t)}return"array"!==o?0!==g?C.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join(""):function(A){const t=[];for(let r=0,e=A.length;r<e;r++)A[r]>=240&&A[r]<=247?(t.push(String.fromCodePoint(((7&A[r])<<18)+((63&A[r+1])<<12)+((63&A[r+2])<<6)+(63&A[r+3]))),r+=3):A[r]>=224&&A[r]<=239?(t.push(String.fromCodePoint(((15&A[r])<<12)+((63&A[r+1])<<6)+(63&A[r+2]))),r+=2):A[r]>=192&&A[r]<=223?(t.push(String.fromCodePoint(((31&A[r])<<6)+(63&A[r+1]))),r++):t.push(String.fromCodePoint(A[r]));return t.join("")}(C):C}return Hr={encrypt:(A,t,r)=>n(A,t,1,r),decrypt:(A,t,r)=>n(A,t,0,r)}}const ee=F(jr?Rr:(jr=1,Rr={sm2:Ae(),sm3:te(),sm4:re()}));class ie{constructor(A,t,r,e){f(this,g,null),f(this,a,null),f(this,B,null),f(this,n,null),f(this,V,(A,t=!1)=>{if(!t)return"object"==typeof A?JSON.stringify(A):String(A);try{return JSON.parse(A)}catch(r){return A}}),this.setkey(A),this.setiv(t),this.setPublicKey(r),this.setPrivateKey(e)}setPublicKey(A){p(this,B,A)}setPrivateKey(A){p(this,n,A)}setkey(A){p(this,g,A&&this.stringToWordArray(A.padEnd(16,"0")))}setiv(A){p(this,a,A&&this.stringToWordArray(A))}sm2Encrypt(A,t){return ee.sm2.doEncrypt(A,t,{inputEncoding:"utf8",outputEncoding:"hex",pointFormat:"uncompressed",cipherMode:1})}sm2Decrypt(A,t){return ee.sm2.doDecrypt(A,t,1)}RSAencrypt(A){A=b(this,V).call(this,A);const t=new Xr;return t.setPublicKey(b(this,B)),t.encrypt(A)}RSAdecrypt(A){const t=new Xr;return t.setPrivateKey(b(this,n)),b(this,V).call(this,t.decrypt(A),!0)}stringToWordArray(A){return yt.enc.Utf8.parse(A)}wordArrayToString(A){return A.toString(yt.enc.Utf8)}AESencrypt(A,t=!0){return A=b(this,V).call(this,A),yt.AES.encrypt(A,b(this,g),{iv:b(this,a),mode:yt.mode.CBC,padding:yt.pad.Pkcs7}).ciphertext.toString(t?yt.enc.Base64:yt.enc.Hex)}AESdecrypt(A,t=!0){A=t?A:yt.enc.Base64.stringify(yt.enc.Hex.parse(A));let r=yt.AES.decrypt(A,b(this,g),{iv:b(this,a),mode:yt.mode.CBC,padding:yt.pad.Pkcs7});return b(this,V).call(this,r.toString(yt.enc.Utf8),!0)}DESencrypt(A,t=!0){return A=b(this,V).call(this,A),yt.DES.encrypt(A,b(this,g),{iv:b(this,a),mode:yt.mode.CBC,padding:yt.pad.Pkcs7}).ciphertext.toString(t?yt.enc.Base64:yt.enc.Hex)}DESdecrypt(A,t=!0){A=t?A:yt.enc.Base64.stringify(yt.enc.Hex.parse(A));let r=yt.DES.decrypt(A,b(this,g),{iv:b(this,a),mode:yt.mode.CBC,padding:yt.pad.Pkcs7});return b(this,V).call(this,r.toString(yt.enc.Utf8),!0)}base64Encode(A){return A=b(this,V).call(this,A),yt.enc.Base64.stringify(yt.enc.Utf8.parse(A))}base64Decode(A){return b(this,V).call(this,yt.enc.Base64.parse(A).toString(yt.enc.Utf8),!0)}md5(A){return A=b(this,V).call(this,A),yt.MD5(A).toString()}fileMd5(A,t,r){return new Promise((e,i)=>{if(!A)return void i("");const s=new FileReader;if(s.onerror=A=>{i(A)},t){const a=yt.algo.MD5.create();let B=0;try{let i=function(){const r=A.slice(B,B+t);s.readAsArrayBuffer(r)};s.onload=s=>{const g=yt.lib.WordArray.create(new Uint8Array(s.target.result));if(a.update(g),"function"==typeof r&&r(B,A.size),B+=t,B<A.size)i();else{const A=a.finalize();e(A.toString(yt.enc.Hex))}},i()}catch(g){i(g)}}else s.onload=t=>{"function"==typeof r&&r(A.size,A.size),e(yt.MD5(yt.lib.WordArray.create(t.target.result)).toString())},s.readAsArrayBuffer(A)})}sha1(A){return A=b(this,V).call(this,A),yt.SHA1(A).toString()}sha256(A){return A=b(this,V).call(this,A),yt.SHA256(A).toString()}sha3(A){return A=b(this,V).call(this,A),yt.SHA3(A,{outputLength:256}).toString()}pbkdf2(A){A=b(this,V).call(this,A);let t=yt.lib.WordArray.random(16);return yt.PBKDF2(A,t,{keySize:8,iterations:1e3}).toString()}hmac(A,t){return A=b(this,V).call(this,A),yt.HmacSHA256(A,t).toString(yt.enc.Hex)}}function se(A=18,t=36){(t<2||t>36)&&(t=36);var r=Math.random().toString(t).substring(2,13).padEnd(11,"0").slice(0,A);return A<=11?r:r+se(A-11)}function ge(A){A=A.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(A,t,r,e)=>t+t+r+r+e+e);const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function ae(A){return new Promise((t,r)=>{if(A)try{var e=new FileReader;let i="";e.readAsDataURL(A),e.onload=function(){i=e.result},e.onerror=function(A){r(A)},e.onloadend=function(){t(i)}}catch(i){r(i)}else r("")})}g=new WeakMap,a=new WeakMap,B=new WeakMap,n=new WeakMap,V=new WeakMap;const Be={formatDateTime:function(A="yyyy-MM-dd hh:mm:ss",t=new Date,r=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]){!t&&(t=new Date),"string"==typeof t&&(t=new Date(t));const e={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),S:t.getMilliseconds(),w:r[t.getDay()]};/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(const i in e)new RegExp("("+i+")").test(A)&&(A=A.replace(RegExp.$1,1===RegExp.$1.length?e[i]:("00"+e[i]).substr((""+e[i]).length)));return A},throttle:function(A,t=500){var r=Date.now();return function(...e){Date.now()-r>=t&&(A.apply(this,e),r=Date.now())}},debounce:function(A,t=500){let r=null;return function(...e){clearTimeout(r),r=setTimeout(()=>{A.apply(this,e)},t)}},rgbToHex:function(A,t,r){return"#"+((1<<24)+(A<<16)+(t<<8)+r).toString(16).slice(1)},hexToRgb:ge,hslToRgb:function(A,t,r){let e,i,s;if(A/=360,r/=100,0===(t/=100))e=i=s=r;else{const g=(A,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?A+6*(t-A)*r:r<.5?t:r<2/3?A+(t-A)*(2/3-r)*6:A),a=r<.5?r*(1+t):r+t-r*t,B=2*r-a;e=g(B,a,A+1/3),i=g(B,a,A),s=g(B,a,A-1/3)}return{r:Math.round(255*e),g:Math.round(255*i),b:Math.round(255*s)}},rgbOrHexToHsl:function(A){let t,r,e;if("string"==typeof A&&"#"===A.charAt(0)){const i=ge(A);t=i.r/255,r=i.g/255,e=i.b/255}else{if("object"!=typeof A)throw new Error("Invalid input format");t=A.r/255,r=A.g/255,e=A.b/255}const i=Math.max(t,r,e),s=Math.min(t,r,e);let g,a,B=(i+s)/2;if(i===s)g=a=0;else{const A=i-s;switch(a=B>.5?A/(2-i-s):A/(i+s),i){case t:g=(r-e)/A+(r<e?6:0);break;case r:g=(e-t)/A+2;break;case e:g=(t-r)/A+4}g/=6}return{h:Math.round(360*g),s:Math.round(100*a),l:Math.round(100*B)}},preciseInterval:function(A,t){let r,e=null;return r=requestAnimationFrame(function i(s){e||(e=s),s-e>=t&&(A(),e=s),r=requestAnimationFrame(i)}),{clear:function(){cancelAnimationFrame(r)}}},convertImgToBase64:function(A,t){return new Promise(function(r){var e=document.createElement("CANVAS"),i=e.getContext("2d"),s=new Image;s.crossOrigin="Anonymous",s.onload=function(){e.height=s.height,e.width=s.width,i.drawImage(s,0,0);var A=e.toDataURL(t||"image/jpg");r(A),e=null},s.src=A})},objectGroupBy:function(A,t){if("string"==typeof t){const A=t;t=t=>t[A]}var r={};return A.forEach((e,i)=>{const s=t(e,i,A);r[s]||(r[s]=[]),r[s].push(e)}),r},randomNum:function(A,t){return Math.floor(Math.random()*(t+1-A))+A},randomColor:function(){return"#"+Math.floor(16777215*Math.random()).toString(16).padEnd(6,"0")},deepCloning:function A(t,r=new WeakMap){if("object"!=typeof t||null===t)return t;if(r.has(t))return r.get(t);var e=Array.isArray(t)?[]:{};r.set(t,e);for(const s in t)if(t.hasOwnProperty(s)){const g=t[s];if("object"!=typeof g||null===g)e[s]=g;else try{e[s]=A(g,r)}catch(i){}}return e},randomStr:se,getUrlParams:function(A){const t={};let r=A.substring(A.lastIndexOf("?")+1);return r=decodeURIComponent(r),r.replace(/([^?&=]+)=([^?&=]*)/g,(A,r,e)=>{const i=decodeURIComponent(r);let s=decodeURIComponent(e);try{s=JSON.parse(s)}catch(g){}return t[i]=s,A}),t},getBroswer:function(){let A="";const t=window.navigator.userAgent.toLowerCase();if(/(msie|firefox|opera|chrome|netscape)\D+(\d[\d.]*)/.test(t)){const r=t.search(RegExp.$1);A=t.substring(r,t.length).replace(/safari\D+(\d[\d.]*)/,"")}else/version\D+(\d[\d.]*).*safari/.test(t)&&(A="safari "+RegExp.$2);return A},fileTurnBase64:ae,fileChunks:function(A,t,r,e){return new Promise((i,s)=>{const g=new ie,a={fileHash:"",fileName:A.name,chunkSize:t,fileSize:A.size,fileType:A.type,chunks:[]};let B=new Promise((r,i)=>{g.fileMd5(A,t,e).then(A=>{a.fileHash=A,r(a)}).catch(A=>{i(A)})}),n=new Promise((e,i)=>{let s=0;!async function i(){if(s>=A.size)return void e(a);let g=A.slice(s,Math.min(s+t,A.size));r&&(g=await ae(g)),a.chunks.push({chunk:g,index:s/t}),s+=t,i()}()});Promise.all([B,n]).then(()=>{i(a)}).catch(A=>{s(A)})})},base64ArrayMerge:function(A,t=!0){let r=(A=A.map(A=>function(A){const t="=".repeat((4-A.length%4)%4),r=(A+t).replace(/\-/g,"+").replace(/_/g,"/"),e=window.atob(r),i=new Uint8Array(e.length);for(let s=0;s<e.length;++s)i[s]=e.charCodeAt(s);return i}(A.split(",")[1]))).reduce((A,t)=>A+t.length,0);const e=new Uint8Array(r);let i=0;A.forEach(A=>{e.set(A,i),i+=A.length});const s=new Blob([e]);return new Promise((A,r)=>{t?ae(s).then(t=>{A(t)}).catch(A=>{r(A)}):A(s)})},toChineseNumber:function(A,t=!0){let r=A.toString().replace(/(?=(\d{4})+$)/g,",").split(",").filter(Boolean);const e=["零","一","二","三","四","五","六","七","八","九"],i=["","十","百","千"],s=["","万","亿"];let g=r.map((A,t)=>function(A){let t="";for(let r=0;r<A.length;r++){let s=e[A[r]],g=i[A.length-r-1];"零"===s&&(g=""),t+=s+g}return t=t.replace(/零+/g,"零").replace(/零$/,""),t}(A)+s[r.length-1-t]).join("");if(g=g||"零",t){let A={"零":"零","一":"壹","二":"贰","三":"叁","四":"肆","五":"伍","六":"陆","七":"柒","八":"捌","九":"玖","十":"拾","百":"佰","千":"仟"};g=g.split("").map(t=>A[t]||t).join("")}return g},getExplorerInfo:function(){let A=navigator.userAgent.toLowerCase();return 0<=A.indexOf("msie")?{type:"IE",version:Number(A.match(/msie ([\d]+)/)[1])}:A.match(/trident\/.+?rv:(([\d.]+))/)?{type:"IE",version:11}:0<=A.indexOf("edge")?{type:"Edge",version:Number(A.match(/edge\/([\d]+)/)[1])}:0<=A.indexOf("firefox")?{type:"Firefox",version:Number(A.match(/firefox\/([\d]+)/)[1])}:0<=A.indexOf("chrome")?{type:"Chrome",version:Number(A.match(/chrome\/([\d]+)/)[1])}:0<=A.indexOf("opera")?{type:"Opera",version:Number(A.match(/opera.([\d]+)/)[1])}:0<=A.indexOf("Safari")?{type:"Safari",version:Number(A.match(/version\/([\d]+)/)[1])}:{type:A,version:-1}},exportFile:function(A,t){if(!A)return;"object"==typeof A&&(A=JSON.stringify(A));const r=new Blob([A],{type:"application/json;charset=utf-8"}),e=URL.createObjectURL(r),i=document.createElement("a");i.href=e,i.download=0==t.indexOf(".")?se()+t:t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(e)}};window.Cesium||(window.Cesium={WebMapTileServiceImageryProvider:function(){}});class ne extends Cesium.WebMapTileServiceImageryProvider{constructor(A){super(A),f(this,I,0),f(this,o,[6,27,98]),p(this,I,A.alp||0),p(this,o,A.rgb||[6,27,98])}requestImage(A,t,r){return super.requestImage(A,t,r).then(A=>{if(!b(this,I))return A;const t=document.createElement("canvas");t.width=A.width,t.height=A.height;const r=t.getContext("2d");return r.translate(0,t.height),r.scale(1,-1),r.drawImage(A,0,0),r.globalCompositeOperation="source-atop",r.fillStyle=`rgba(${b(this,o)[0]},${b(this,o)[1]},${b(this,o)[2]}, ${b(this,I)})`,r.fillRect(0,0,t.width,t.height),r.globalCompositeOperation="source-over",r.stroke(),t})}}I=new WeakMap,o=new WeakMap;class Ve{constructor(A){f(this,E,null),f(this,C,null),f(this,W,null),f(this,q,null),S(this,"TianDiTuToken",""),S(this,"loadTdtYingXiang",(A={},t=[])=>{const r=b(this,q).viewer;var e={tdtyxType:"img_w",...A},i=new ne({rgb:t,alp:t[3],url:`http://t{s}.tianditu.gov.cn/${e.tdtyxType}/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&format=tiles&tk=${this.TianDiTuToken}`,subdomains:["0","1","2","3","4","5","6","7"],show:!0,maximumLevel:18,minimumLevel:0,screenSpaceError:16,styels:[{stylers:[{hue:"#fc0505ff"},{saturation:-20}]}]}),s=r.imageryLayers.addImageryProvider(i);return r.imageryLayers.lowerToBottom(s),{entity:s,remove(){r.imageryLayers.remove(s)}}}),S(this,"loadTdtZhuJi",(A={},t=[])=>{const r=b(this,q).viewer;var e={maximumLevel:18,...A},i=new ne({rgb:t,alp:t[3],url:`https://t{s}.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={TileCol}&TILEROW={TileRow}&TILEMATRIX={TileMatrix}&tk=${this.TianDiTuToken}`,subdomains:["0","1","2","3","4","5","6","7"],minimumLevel:0,maximumLevel:e.maximumLevel,show:!0}),s=r.imageryLayers.addImageryProvider(i);return r.imageryLayers.raiseToTop(s),{entity:s,remove(){r.imageryLayers.remove(s)}}}),S(this,"setImageLayerFilter",(A={},t=0)=>{var r={invertColor:!0,alpha:1,dayAlpha:1,nightAlpha:1,brightness:1,contrast:1,hue:50,saturation:1,gamma:1,...A},e=this.viewer.imageryLayers.get(t);e.invertColor=r.invertColor,e.alpha=r.alpha,e.dayAlpha=r.dayAlpha,e.nightAlpha=r.nightAlpha,e.brightness=r.brightness,e.contrast=r.contrast,e.hue=r.hue,e.saturation=r.saturation,e.gamma=r.gamma}),p(this,q,A),this.TianDiTuToken=A.TianDiTuToken,this.showTdtYX=!0,this.showTdtLW=!0}set showTdtYX(A){A?b(this,E)||p(this,E,this.loadTdtYingXiang()):(b(this,E)&&b(this,E).remove(),p(this,E,null))}set showTdtLW(A){A?b(this,C)||p(this,C,this.loadTdtLuWang()):(b(this,C)&&b(this,C).remove(),p(this,C,null))}set showTdtZJ(A){A?b(this,W)||p(this,W,this.loadTdtZhuJi()):(b(this,W)&&b(this,W).remove(),p(this,W,null))}loadTdtLuWang(A={},t=[]){const r=b(this,q).viewer;var e={maximumLevel:18,show:!0,...A},i=new ne({rgb:t,alp:t[3],url:`http://t{s}.tianditu.gov.cn/cia_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cia&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default.jpg&tk=${this.TianDiTuToken}`,subdomains:["0","1","2","3","4","5","6","7"],maximumLevel:e.maximumLevel,show:e.show}),s=r.imageryLayers.addImageryProvider(i);return r.imageryLayers.raiseToTop(s),{entity:s,remove(){r.imageryLayers.remove(s)}}}}E=new WeakMap,C=new WeakMap,W=new WeakMap,q=new WeakMap;const Ie=Symbol(),oe="el",Ee=(A,t,r,e,i)=>{let s=`${A}-${t}`;return r&&(s+=`-${r}`),e&&(s+=`__${e}`),i&&(s+=`--${i}`),s},Ce=Symbol("namespaceContextKey"),We=(A,r)=>{const e=(A=>{const r=A||(t.getCurrentInstance()?t.inject(Ce,t.ref(oe)):t.ref(oe));return t.computed(()=>t.unref(r)||oe)})(r);return{namespace:e,b:(t="")=>Ee(e.value,A,t,"",""),e:t=>t?Ee(e.value,A,"",t,""):"",m:t=>t?Ee(e.value,A,"","",t):"",be:(t,r)=>t&&r?Ee(e.value,A,t,r,""):"",em:(t,r)=>t&&r?Ee(e.value,A,"",t,r):"",bm:(t,r)=>t&&r?Ee(e.value,A,t,"",r):"",bem:(t,r,i)=>t&&r&&i?Ee(e.value,A,t,r,i):"",is:(A,...t)=>{const r=!(t.length>=1)||t[0];return A&&r?`is-${A}`:""},cssVar:A=>{const t={};for(const r in A)A[r]&&(t[`--${e.value}-${r}`]=A[r]);return t},cssVarName:A=>`--${e.value}-${A}`,cssVarBlock:t=>{const r={};for(const i in t)t[i]&&(r[`--${e.value}-${A}-${i}`]=t[i]);return r},cssVarBlockName:t=>`--${e.value}-${A}-${t}`}};
|
|
33
|
+
var dr={};void 0!==dr.asn1&&dr.asn1||(dr.asn1={}),dr.asn1.ASN1Util=new function(){this.integerToByteHex=function(A){var t=A.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(A){var t=A.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var e="",i=0;i<r;i++)e+="f";t=new _t(e,16).xor(A).add(_t.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(A,t){return hextopem(A,t)},this.newObject=function(A){var t=dr.asn1,r=t.DERBoolean,e=t.DERInteger,i=t.DERBitString,s=t.DEROctetString,g=t.DERNull,a=t.DERObjectIdentifier,B=t.DEREnumerated,n=t.DERUTF8String,V=t.DERNumericString,I=t.DERPrintableString,o=t.DERTeletexString,E=t.DERIA5String,C=t.DERUTCTime,W=t.DERGeneralizedTime,q=t.DERSequence,u=t.DERSet,Q=t.DERTaggedObject,l=t.ASN1Util.newObject,k=Object.keys(A);if(1!=k.length)throw"key of param shall be only one.";var c=k[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+c+":"))throw"undefined key: "+c;if("bool"==c)return new r(A[c]);if("int"==c)return new e(A[c]);if("bitstr"==c)return new i(A[c]);if("octstr"==c)return new s(A[c]);if("null"==c)return new g(A[c]);if("oid"==c)return new a(A[c]);if("enum"==c)return new B(A[c]);if("utf8str"==c)return new n(A[c]);if("numstr"==c)return new V(A[c]);if("prnstr"==c)return new I(A[c]);if("telstr"==c)return new o(A[c]);if("ia5str"==c)return new E(A[c]);if("utctime"==c)return new C(A[c]);if("gentime"==c)return new W(A[c]);if("seq"==c){for(var x=A[c],Y=[],w=0;w<x.length;w++){var d=l(x[w]);Y.push(d)}return new q({array:Y})}if("set"==c){for(x=A[c],Y=[],w=0;w<x.length;w++){d=l(x[w]);Y.push(d)}return new u({array:Y})}if("tag"==c){var y=A[c];if("[object Array]"===Object.prototype.toString.call(y)&&3==y.length){var D=l(y[2]);return new Q({tag:y[0],explicit:y[1],obj:D})}var S={};if(void 0!==y.explicit&&(S.explicit=y.explicit),void 0!==y.tag&&(S.tag=y.tag),void 0===y.obj)throw"obj shall be specified for 'tag'.";return S.obj=l(y.obj),new Q(S)}},this.jsonToASN1HEX=function(A){return this.newObject(A).getEncodedHex()}},dr.asn1.ASN1Util.oidHexToInt=function(A){for(var t="",r=parseInt(A.substr(0,2),16),e=(t=Math.floor(r/40)+"."+r%40,""),i=2;i<A.length;i+=2){var s=("00000000"+parseInt(A.substr(i,2),16).toString(2)).slice(-8);if(e+=s.substr(1,7),"0"==s.substr(0,1))t=t+"."+new _t(e,2).toString(10),e=""}return t},dr.asn1.ASN1Util.oidIntToHex=function(A){var t=function(A){var t=A.toString(16);return 1==t.length&&(t="0"+t),t},r=function(A){var r="",e=new _t(A,10).toString(2),i=7-e.length%7;7==i&&(i=0);for(var s="",g=0;g<i;g++)s+="0";e=s+e;for(g=0;g<e.length-1;g+=7){var a=e.substr(g,7);g!=e.length-7&&(a="1"+a),r+=t(parseInt(a,2))}return r};if(!A.match(/^[0-9.]+$/))throw"malformed oid string: "+A;var e="",i=A.split("."),s=40*parseInt(i[0])+parseInt(i[1]);e+=t(s),i.splice(0,2);for(var g=0;g<i.length;g++)e+=r(i[g]);return e},dr.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n=0,v="+this.hV;var A=this.hV.length/2,t=A.toString(16);if(t.length%2==1&&(t="0"+t),A<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+A.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},dr.asn1.DERAbstractString=function(A){dr.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(A){this.hTLV=null,this.isModified=!0,this.s=A,this.hV=stohex(this.s)},this.setStringHex=function(A){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=A},this.getFreshValueHex=function(){return this.hV},void 0!==A&&("string"==typeof A?this.setString(A):void 0!==A.str?this.setString(A.str):void 0!==A.hex&&this.setStringHex(A.hex))},wr.lang.extend(dr.asn1.DERAbstractString,dr.asn1.ASN1Object),dr.asn1.DERAbstractTime=function(A){dr.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(A){return utc=A.getTime()+6e4*A.getTimezoneOffset(),new Date(utc)},this.formatDate=function(A,t,r){var e=this.zeroPadding,i=this.localDateToUTC(A),s=String(i.getFullYear());"utc"==t&&(s=s.substr(2,2));var g=s+e(String(i.getMonth()+1),2)+e(String(i.getDate()),2)+e(String(i.getHours()),2)+e(String(i.getMinutes()),2)+e(String(i.getSeconds()),2);if(!0===r){var a=i.getMilliseconds();if(0!=a){var B=e(String(a),3);g=g+"."+(B=B.replace(/[0]+$/,""))}}return g+"Z"},this.zeroPadding=function(A,t){return A.length>=t?A:new Array(t-A.length+1).join("0")+A},this.getString=function(){return this.s},this.setString=function(A){this.hTLV=null,this.isModified=!0,this.s=A,this.hV=stohex(A)},this.setByDateValue=function(A,t,r,e,i,s){var g=new Date(Date.UTC(A,t-1,r,e,i,s,0));this.setByDate(g)},this.getFreshValueHex=function(){return this.hV}},wr.lang.extend(dr.asn1.DERAbstractTime,dr.asn1.ASN1Object),dr.asn1.DERAbstractStructured=function(A){dr.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(A){this.hTLV=null,this.isModified=!0,this.asn1Array=A},this.appendASN1Object=function(A){this.hTLV=null,this.isModified=!0,this.asn1Array.push(A)},this.asn1Array=new Array,void 0!==A&&void 0!==A.array&&(this.asn1Array=A.array)},wr.lang.extend(dr.asn1.DERAbstractStructured,dr.asn1.ASN1Object),dr.asn1.DERBoolean=function(){dr.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},wr.lang.extend(dr.asn1.DERBoolean,dr.asn1.ASN1Object),dr.asn1.DERInteger=function(A){dr.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(A){this.hTLV=null,this.isModified=!0,this.hV=dr.asn1.ASN1Util.bigIntToMinTwosComplementsHex(A)},this.setByInteger=function(A){var t=new _t(String(A),10);this.setByBigInteger(t)},this.setValueHex=function(A){this.hV=A},this.getFreshValueHex=function(){return this.hV},void 0!==A&&(void 0!==A.bigint?this.setByBigInteger(A.bigint):void 0!==A.int?this.setByInteger(A.int):"number"==typeof A?this.setByInteger(A):void 0!==A.hex&&this.setValueHex(A.hex))},wr.lang.extend(dr.asn1.DERInteger,dr.asn1.ASN1Object),dr.asn1.DERBitString=function(A){if(void 0!==A&&void 0!==A.obj){var t=dr.asn1.ASN1Util.newObject(A.obj);A.hex="00"+t.getEncodedHex()}dr.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(A){this.hTLV=null,this.isModified=!0,this.hV=A},this.setUnusedBitsAndHexValue=function(A,t){if(A<0||7<A)throw"unused bits shall be from 0 to 7: u = "+A;var r="0"+A;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(A){var t=8-(A=A.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)A+="0";var e="";for(r=0;r<A.length-1;r+=8){var i=A.substr(r,8),s=parseInt(i,2).toString(16);1==s.length&&(s="0"+s),e+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+t+e},this.setByBooleanArray=function(A){for(var t="",r=0;r<A.length;r++)1==A[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(A){for(var t=new Array(A),r=0;r<A;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==A&&("string"==typeof A&&A.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(A):void 0!==A.hex?this.setHexValueIncludingUnusedBits(A.hex):void 0!==A.bin?this.setByBinaryString(A.bin):void 0!==A.array&&this.setByBooleanArray(A.array))},wr.lang.extend(dr.asn1.DERBitString,dr.asn1.ASN1Object),dr.asn1.DEROctetString=function(A){if(void 0!==A&&void 0!==A.obj){var t=dr.asn1.ASN1Util.newObject(A.obj);A.hex=t.getEncodedHex()}dr.asn1.DEROctetString.superclass.constructor.call(this,A),this.hT="04"},wr.lang.extend(dr.asn1.DEROctetString,dr.asn1.DERAbstractString),dr.asn1.DERNull=function(){dr.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},wr.lang.extend(dr.asn1.DERNull,dr.asn1.ASN1Object),dr.asn1.DERObjectIdentifier=function(A){var t=function(A){var t=A.toString(16);return 1==t.length&&(t="0"+t),t},r=function(A){var r="",e=new _t(A,10).toString(2),i=7-e.length%7;7==i&&(i=0);for(var s="",g=0;g<i;g++)s+="0";e=s+e;for(g=0;g<e.length-1;g+=7){var a=e.substr(g,7);g!=e.length-7&&(a="1"+a),r+=t(parseInt(a,2))}return r};dr.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(A){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=A},this.setValueOidString=function(A){if(!A.match(/^[0-9.]+$/))throw"malformed oid string: "+A;var e="",i=A.split("."),s=40*parseInt(i[0])+parseInt(i[1]);e+=t(s),i.splice(0,2);for(var g=0;g<i.length;g++)e+=r(i[g]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(A){var t=dr.asn1.x509.OID.name2oid(A);if(""===t)throw"DERObjectIdentifier oidName undefined: "+A;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==A&&("string"==typeof A?A.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(A):this.setValueName(A):void 0!==A.oid?this.setValueOidString(A.oid):void 0!==A.hex?this.setValueHex(A.hex):void 0!==A.name&&this.setValueName(A.name))},wr.lang.extend(dr.asn1.DERObjectIdentifier,dr.asn1.ASN1Object),dr.asn1.DEREnumerated=function(A){dr.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(A){this.hTLV=null,this.isModified=!0,this.hV=dr.asn1.ASN1Util.bigIntToMinTwosComplementsHex(A)},this.setByInteger=function(A){var t=new _t(String(A),10);this.setByBigInteger(t)},this.setValueHex=function(A){this.hV=A},this.getFreshValueHex=function(){return this.hV},void 0!==A&&(void 0!==A.int?this.setByInteger(A.int):"number"==typeof A?this.setByInteger(A):void 0!==A.hex&&this.setValueHex(A.hex))},wr.lang.extend(dr.asn1.DEREnumerated,dr.asn1.ASN1Object),dr.asn1.DERUTF8String=function(A){dr.asn1.DERUTF8String.superclass.constructor.call(this,A),this.hT="0c"},wr.lang.extend(dr.asn1.DERUTF8String,dr.asn1.DERAbstractString),dr.asn1.DERNumericString=function(A){dr.asn1.DERNumericString.superclass.constructor.call(this,A),this.hT="12"},wr.lang.extend(dr.asn1.DERNumericString,dr.asn1.DERAbstractString),dr.asn1.DERPrintableString=function(A){dr.asn1.DERPrintableString.superclass.constructor.call(this,A),this.hT="13"},wr.lang.extend(dr.asn1.DERPrintableString,dr.asn1.DERAbstractString),dr.asn1.DERTeletexString=function(A){dr.asn1.DERTeletexString.superclass.constructor.call(this,A),this.hT="14"},wr.lang.extend(dr.asn1.DERTeletexString,dr.asn1.DERAbstractString),dr.asn1.DERIA5String=function(A){dr.asn1.DERIA5String.superclass.constructor.call(this,A),this.hT="16"},wr.lang.extend(dr.asn1.DERIA5String,dr.asn1.DERAbstractString),dr.asn1.DERUTCTime=function(A){dr.asn1.DERUTCTime.superclass.constructor.call(this,A),this.hT="17",this.setByDate=function(A){this.hTLV=null,this.isModified=!0,this.date=A,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==A&&(void 0!==A.str?this.setString(A.str):"string"==typeof A&&A.match(/^[0-9]{12}Z$/)?this.setString(A):void 0!==A.hex?this.setStringHex(A.hex):void 0!==A.date&&this.setByDate(A.date))},wr.lang.extend(dr.asn1.DERUTCTime,dr.asn1.DERAbstractTime),dr.asn1.DERGeneralizedTime=function(A){dr.asn1.DERGeneralizedTime.superclass.constructor.call(this,A),this.hT="18",this.withMillis=!1,this.setByDate=function(A){this.hTLV=null,this.isModified=!0,this.date=A,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==A&&(void 0!==A.str?this.setString(A.str):"string"==typeof A&&A.match(/^[0-9]{14}Z$/)?this.setString(A):void 0!==A.hex?this.setStringHex(A.hex):void 0!==A.date&&this.setByDate(A.date),!0===A.millis&&(this.withMillis=!0))},wr.lang.extend(dr.asn1.DERGeneralizedTime,dr.asn1.DERAbstractTime),dr.asn1.DERSequence=function(A){dr.asn1.DERSequence.superclass.constructor.call(this,A),this.hT="30",this.getFreshValueHex=function(){for(var A="",t=0;t<this.asn1Array.length;t++){A+=this.asn1Array[t].getEncodedHex()}return this.hV=A,this.hV}},wr.lang.extend(dr.asn1.DERSequence,dr.asn1.DERAbstractStructured),dr.asn1.DERSet=function(A){dr.asn1.DERSet.superclass.constructor.call(this,A),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var A=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];A.push(r.getEncodedHex())}return 1==this.sortFlag&&A.sort(),this.hV=A.join(""),this.hV},void 0!==A&&void 0!==A.sortflag&&0==A.sortflag&&(this.sortFlag=!1)},wr.lang.extend(dr.asn1.DERSet,dr.asn1.DERAbstractStructured),dr.asn1.DERTaggedObject=function(A){dr.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(A,t,r){this.hT=t,this.isExplicit=A,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==A&&(void 0!==A.tag&&(this.hT=A.tag),void 0!==A.explicit&&(this.isExplicit=A.explicit),void 0!==A.obj&&(this.asn1Object=A.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},wr.lang.extend(dr.asn1.DERTaggedObject,dr.asn1.ASN1Object);var yr,Dr,Sr,Jr,br,fr,pr,Kr,hr,Mr,Fr,Gr,Ur,vr,Hr,Pr,Rr,jr,Zr=function(){var A=function(t,r){return(A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,t){A.__proto__=t}||function(A,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(A[r]=t[r])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function e(){this.constructor=t}A(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}}(),mr=function(A){function t(r){var e=A.call(this)||this;return r&&("string"==typeof r?e.parseKey(r):(t.hasPrivateKeyProperty(r)||t.hasPublicKeyProperty(r))&&e.parsePropertiesFrom(r)),e}return Zr(t,A),t.prototype.parseKey=function(A){try{var t=0,r=0,e=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(A)?vt(A):Ht.unarmor(A),i=Tt.decode(e);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=ir(t,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var s=i.sub[3].getHexStringValue();this.d=ir(s,16);var g=i.sub[4].getHexStringValue();this.p=ir(g,16);var a=i.sub[5].getHexStringValue();this.q=ir(a,16);var B=i.sub[6].getHexStringValue();this.dmp1=ir(B,16);var n=i.sub[7].getHexStringValue();this.dmq1=ir(n,16);var V=i.sub[8].getHexStringValue();this.coeff=ir(V,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var I=i.sub[1].sub[0];t=I.sub[0].getHexStringValue(),this.n=ir(t,16),r=I.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=i.sub[0].getHexStringValue(),this.n=ir(t,16),r=i.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(o){return!1}},t.prototype.getPrivateBaseKey=function(){var A={array:[new dr.asn1.DERInteger({int:0}),new dr.asn1.DERInteger({bigint:this.n}),new dr.asn1.DERInteger({int:this.e}),new dr.asn1.DERInteger({bigint:this.d}),new dr.asn1.DERInteger({bigint:this.p}),new dr.asn1.DERInteger({bigint:this.q}),new dr.asn1.DERInteger({bigint:this.dmp1}),new dr.asn1.DERInteger({bigint:this.dmq1}),new dr.asn1.DERInteger({bigint:this.coeff})]};return new dr.asn1.DERSequence(A).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return Ft(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var A=new dr.asn1.DERSequence({array:[new dr.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new dr.asn1.DERNull]}),t=new dr.asn1.DERSequence({array:[new dr.asn1.DERInteger({bigint:this.n}),new dr.asn1.DERInteger({int:this.e})]}),r=new dr.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new dr.asn1.DERSequence({array:[A,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return Ft(this.getPublicBaseKey())},t.wordwrap=function(A,t){if(!A)return A;var r="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return A.match(RegExp(r,"g")).join("\n")},t.prototype.getPrivateKey=function(){var A="-----BEGIN RSA PRIVATE KEY-----\n";return A+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n",A+="-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var A="-----BEGIN PUBLIC KEY-----\n";return A+=t.wordwrap(this.getPublicBaseKeyB64())+"\n",A+="-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(A){return(A=A||{}).hasOwnProperty("n")&&A.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(A){return(A=A||{}).hasOwnProperty("n")&&A.hasOwnProperty("e")&&A.hasOwnProperty("d")&&A.hasOwnProperty("p")&&A.hasOwnProperty("q")&&A.hasOwnProperty("dmp1")&&A.hasOwnProperty("dmq1")&&A.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(A){this.n=A.n,this.e=A.e,A.hasOwnProperty("d")&&(this.d=A.d,this.p=A.p,this.q=A.q,this.dmp1=A.dmp1,this.dmq1=A.dmq1,this.coeff=A.coeff)},t}(xr),Lr="undefined"!=typeof process?null===(yr=process.env)||void 0===yr?void 0:yr.npm_package_version:void 0,Xr=function(){function A(A){void 0===A&&(A={}),A=A||{},this.default_key_size=A.default_key_size?parseInt(A.default_key_size,10):1024,this.default_public_exponent=A.default_public_exponent||"010001",this.log=A.log||!1,this.key=null}return A.prototype.setKey=function(A){this.log&&this.key,this.key=new mr(A)},A.prototype.setPrivateKey=function(A){this.setKey(A)},A.prototype.setPublicKey=function(A){this.setKey(A)},A.prototype.decrypt=function(A){try{return this.getKey().decrypt(Gt(A))}catch(t){return!1}},A.prototype.encrypt=function(A){try{return Ft(this.getKey().encrypt(A))}catch(t){return!1}},A.prototype.sign=function(A,t,r){try{return Ft(this.getKey().sign(A,t,r))}catch(e){return!1}},A.prototype.verify=function(A,t,r){try{return this.getKey().verify(A,Gt(t),r)}catch(e){return!1}},A.prototype.getKey=function(A){if(!this.key){if(this.key=new mr,A&&"[object Function]"==={}.toString.call(A))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,A);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},A.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},A.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},A.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},A.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},A.version=Lr,A}(),Tr={exports:{}},Or=Tr.exports;function Nr(){return Dr||(Dr=1,A=Tr,function(){var t;function r(A,t,r){null!=A&&("number"==typeof A?this.fromNumber(A,t,r):null==t&&"string"!=typeof A?this.fromString(A,256):this.fromString(A,t))}function e(){return new r(null)}var i="undefined"!=typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(r.prototype.am=function(A,t,r,e,i,s){for(var g=32767&t,a=t>>15;--s>=0;){var B=32767&this[A],n=this[A++]>>15,V=a*B+n*g;i=((B=g*B+((32767&V)<<15)+r[e]+(1073741823&i))>>>30)+(V>>>15)+a*n+(i>>>30),r[e++]=1073741823&B}return i},t=30):i&&"Netscape"!=navigator.appName?(r.prototype.am=function(A,t,r,e,i,s){for(;--s>=0;){var g=t*this[A++]+r[e]+i;i=Math.floor(g/67108864),r[e++]=67108863&g}return i},t=26):(r.prototype.am=function(A,t,r,e,i,s){for(var g=16383&t,a=t>>14;--s>=0;){var B=16383&this[A],n=this[A++]>>14,V=a*B+n*g;i=((B=g*B+((16383&V)<<14)+r[e]+i)>>28)+(V>>14)+a*n,r[e++]=268435455&B}return i},t=28),r.prototype.DB=t,r.prototype.DM=(1<<t)-1,r.prototype.DV=1<<t,r.prototype.FV=Math.pow(2,52),r.prototype.F1=52-t,r.prototype.F2=2*t-52;var s,g,a=new Array;for(s="0".charCodeAt(0),g=0;g<=9;++g)a[s++]=g;for(s="a".charCodeAt(0),g=10;g<36;++g)a[s++]=g;for(s="A".charCodeAt(0),g=10;g<36;++g)a[s++]=g;function B(A){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(A)}function n(A,t){var r=a[A.charCodeAt(t)];return null==r?-1:r}function V(A){var t=e();return t.fromInt(A),t}function I(A){var t,r=1;return 0!=(t=A>>>16)&&(A=t,r+=16),0!=(t=A>>8)&&(A=t,r+=8),0!=(t=A>>4)&&(A=t,r+=4),0!=(t=A>>2)&&(A=t,r+=2),0!=(t=A>>1)&&(A=t,r+=1),r}function o(A){this.m=A}function E(A){this.m=A,this.mp=A.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<A.DB-15)-1,this.mt2=2*A.t}function C(A,t){return A&t}function W(A,t){return A|t}function q(A,t){return A^t}function u(A,t){return A&~t}function Q(A){if(0==A)return-1;var t=0;return 65535&A||(A>>=16,t+=16),255&A||(A>>=8,t+=8),15&A||(A>>=4,t+=4),3&A||(A>>=2,t+=2),1&A||++t,t}function l(A){for(var t=0;0!=A;)A&=A-1,++t;return t}function k(){}function c(A){return A}function x(A){this.r2=e(),this.q3=e(),r.ONE.dlShiftTo(2*A.t,this.r2),this.mu=this.r2.divide(A),this.m=A}o.prototype.convert=function(A){return A.s<0||A.compareTo(this.m)>=0?A.mod(this.m):A},o.prototype.revert=function(A){return A},o.prototype.reduce=function(A){A.divRemTo(this.m,null,A)},o.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r),this.reduce(r)},o.prototype.sqrTo=function(A,t){A.squareTo(t),this.reduce(t)},E.prototype.convert=function(A){var t=e();return A.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),A.s<0&&t.compareTo(r.ZERO)>0&&this.m.subTo(t,t),t},E.prototype.revert=function(A){var t=e();return A.copyTo(t),this.reduce(t),t},E.prototype.reduce=function(A){for(;A.t<=this.mt2;)A[A.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&A[t],e=r*this.mpl+((r*this.mph+(A[t]>>15)*this.mpl&this.um)<<15)&A.DM;for(A[r=t+this.m.t]+=this.m.am(0,e,A,t,0,this.m.t);A[r]>=A.DV;)A[r]-=A.DV,A[++r]++}A.clamp(),A.drShiftTo(this.m.t,A),A.compareTo(this.m)>=0&&A.subTo(this.m,A)},E.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r),this.reduce(r)},E.prototype.sqrTo=function(A,t){A.squareTo(t),this.reduce(t)},r.prototype.copyTo=function(A){for(var t=this.t-1;t>=0;--t)A[t]=this[t];A.t=this.t,A.s=this.s},r.prototype.fromInt=function(A){this.t=1,this.s=A<0?-1:0,A>0?this[0]=A:A<-1?this[0]=A+this.DV:this.t=0},r.prototype.fromString=function(A,t){var e;if(16==t)e=4;else if(8==t)e=3;else if(256==t)e=8;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return void this.fromRadix(A,t);e=2}this.t=0,this.s=0;for(var i=A.length,s=!1,g=0;--i>=0;){var a=8==e?255&A[i]:n(A,i);a<0?"-"==A.charAt(i)&&(s=!0):(s=!1,0==g?this[this.t++]=a:g+e>this.DB?(this[this.t-1]|=(a&(1<<this.DB-g)-1)<<g,this[this.t++]=a>>this.DB-g):this[this.t-1]|=a<<g,(g+=e)>=this.DB&&(g-=this.DB))}8==e&&128&A[0]&&(this.s=-1,g>0&&(this[this.t-1]|=(1<<this.DB-g)-1<<g)),this.clamp(),s&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var A=this.s&this.DM;this.t>0&&this[this.t-1]==A;)--this.t},r.prototype.dlShiftTo=function(A,t){var r;for(r=this.t-1;r>=0;--r)t[r+A]=this[r];for(r=A-1;r>=0;--r)t[r]=0;t.t=this.t+A,t.s=this.s},r.prototype.drShiftTo=function(A,t){for(var r=A;r<this.t;++r)t[r-A]=this[r];t.t=Math.max(this.t-A,0),t.s=this.s},r.prototype.lShiftTo=function(A,t){var r,e=A%this.DB,i=this.DB-e,s=(1<<i)-1,g=Math.floor(A/this.DB),a=this.s<<e&this.DM;for(r=this.t-1;r>=0;--r)t[r+g+1]=this[r]>>i|a,a=(this[r]&s)<<e;for(r=g-1;r>=0;--r)t[r]=0;t[g]=a,t.t=this.t+g+1,t.s=this.s,t.clamp()},r.prototype.rShiftTo=function(A,t){t.s=this.s;var r=Math.floor(A/this.DB);if(r>=this.t)t.t=0;else{var e=A%this.DB,i=this.DB-e,s=(1<<e)-1;t[0]=this[r]>>e;for(var g=r+1;g<this.t;++g)t[g-r-1]|=(this[g]&s)<<i,t[g-r]=this[g]>>e;e>0&&(t[this.t-r-1]|=(this.s&s)<<i),t.t=this.t-r,t.clamp()}},r.prototype.subTo=function(A,t){for(var r=0,e=0,i=Math.min(A.t,this.t);r<i;)e+=this[r]-A[r],t[r++]=e&this.DM,e>>=this.DB;if(A.t<this.t){for(e-=A.s;r<this.t;)e+=this[r],t[r++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;r<A.t;)e-=A[r],t[r++]=e&this.DM,e>>=this.DB;e-=A.s}t.s=e<0?-1:0,e<-1?t[r++]=this.DV+e:e>0&&(t[r++]=e),t.t=r,t.clamp()},r.prototype.multiplyTo=function(A,t){var e=this.abs(),i=A.abs(),s=e.t;for(t.t=s+i.t;--s>=0;)t[s]=0;for(s=0;s<i.t;++s)t[s+e.t]=e.am(0,i[s],t,s,0,e.t);t.s=0,t.clamp(),this.s!=A.s&&r.ZERO.subTo(t,t)},r.prototype.squareTo=function(A){for(var t=this.abs(),r=A.t=2*t.t;--r>=0;)A[r]=0;for(r=0;r<t.t-1;++r){var e=t.am(r,t[r],A,2*r,0,1);(A[r+t.t]+=t.am(r+1,2*t[r],A,2*r+1,e,t.t-r-1))>=t.DV&&(A[r+t.t]-=t.DV,A[r+t.t+1]=1)}A.t>0&&(A[A.t-1]+=t.am(r,t[r],A,2*r,0,1)),A.s=0,A.clamp()},r.prototype.divRemTo=function(A,t,i){var s=A.abs();if(!(s.t<=0)){var g=this.abs();if(g.t<s.t)return null!=t&&t.fromInt(0),void(null!=i&&this.copyTo(i));null==i&&(i=e());var a=e(),B=this.s,n=A.s,V=this.DB-I(s[s.t-1]);V>0?(s.lShiftTo(V,a),g.lShiftTo(V,i)):(s.copyTo(a),g.copyTo(i));var o=a.t,E=a[o-1];if(0!=E){var C=E*(1<<this.F1)+(o>1?a[o-2]>>this.F2:0),W=this.FV/C,q=(1<<this.F1)/C,u=1<<this.F2,Q=i.t,l=Q-o,k=null==t?e():t;for(a.dlShiftTo(l,k),i.compareTo(k)>=0&&(i[i.t++]=1,i.subTo(k,i)),r.ONE.dlShiftTo(o,k),k.subTo(a,a);a.t<o;)a[a.t++]=0;for(;--l>=0;){var c=i[--Q]==E?this.DM:Math.floor(i[Q]*W+(i[Q-1]+u)*q);if((i[Q]+=a.am(0,c,i,l,0,o))<c)for(a.dlShiftTo(l,k),i.subTo(k,i);i[Q]<--c;)i.subTo(k,i)}null!=t&&(i.drShiftTo(o,t),B!=n&&r.ZERO.subTo(t,t)),i.t=o,i.clamp(),V>0&&i.rShiftTo(V,i),B<0&&r.ZERO.subTo(i,i)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var A=this[0];if(!(1&A))return 0;var t=3&A;return(t=(t=(t=(t=t*(2-(15&A)*t)&15)*(2-(255&A)*t)&255)*(2-((65535&A)*t&65535))&65535)*(2-A*t%this.DV)%this.DV)>0?this.DV-t:-t},r.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},r.prototype.exp=function(A,t){if(A>4294967295||A<1)return r.ONE;var i=e(),s=e(),g=t.convert(this),a=I(A)-1;for(g.copyTo(i);--a>=0;)if(t.sqrTo(i,s),(A&1<<a)>0)t.mulTo(s,g,i);else{var B=i;i=s,s=B}return t.revert(i)},r.prototype.toString=function(A){if(this.s<0)return"-"+this.negate().toString(A);var t;if(16==A)t=4;else if(8==A)t=3;else if(2==A)t=1;else if(32==A)t=5;else{if(4!=A)return this.toRadix(A);t=2}var r,e=(1<<t)-1,i=!1,s="",g=this.t,a=this.DB-g*this.DB%t;if(g-- >0)for(a<this.DB&&(r=this[g]>>a)>0&&(i=!0,s=B(r));g>=0;)a<t?(r=(this[g]&(1<<a)-1)<<t-a,r|=this[--g]>>(a+=this.DB-t)):(r=this[g]>>(a-=t)&e,a<=0&&(a+=this.DB,--g)),r>0&&(i=!0),i&&(s+=B(r));return i?s:"0"},r.prototype.negate=function(){var A=e();return r.ZERO.subTo(this,A),A},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(A){var t=this.s-A.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-A.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-A[r]))return t;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+I(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(A){var t=e();return this.abs().divRemTo(A,null,t),this.s<0&&t.compareTo(r.ZERO)>0&&A.subTo(t,t),t},r.prototype.modPowInt=function(A,t){var r;return r=A<256||t.isEven()?new o(t):new E(t),this.exp(A,r)},r.ZERO=V(0),r.ONE=V(1),k.prototype.convert=c,k.prototype.revert=c,k.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r)},k.prototype.sqrTo=function(A,t){A.squareTo(t)},x.prototype.convert=function(A){if(A.s<0||A.t>2*this.m.t)return A.mod(this.m);if(A.compareTo(this.m)<0)return A;var t=e();return A.copyTo(t),this.reduce(t),t},x.prototype.revert=function(A){return A},x.prototype.reduce=function(A){for(A.drShiftTo(this.m.t-1,this.r2),A.t>this.m.t+1&&(A.t=this.m.t+1,A.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);A.compareTo(this.r2)<0;)A.dAddOffset(1,this.m.t+1);for(A.subTo(this.r2,A);A.compareTo(this.m)>=0;)A.subTo(this.m,A)},x.prototype.mulTo=function(A,t,r){A.multiplyTo(t,r),this.reduce(r)},x.prototype.sqrTo=function(A,t){A.squareTo(t),this.reduce(t)};var Y,w,d,y=[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],D=(1<<26)/y[y.length-1];function S(){var A;A=(new Date).getTime(),w[d++]^=255&A,w[d++]^=A>>8&255,w[d++]^=A>>16&255,w[d++]^=A>>24&255,d>=M&&(d-=M)}if(r.prototype.chunkSize=function(A){return Math.floor(Math.LN2*this.DB/Math.log(A))},r.prototype.toRadix=function(A){if(null==A&&(A=10),0==this.signum()||A<2||A>36)return"0";var t=this.chunkSize(A),r=Math.pow(A,t),i=V(r),s=e(),g=e(),a="";for(this.divRemTo(i,s,g);s.signum()>0;)a=(r+g.intValue()).toString(A).substr(1)+a,s.divRemTo(i,s,g);return g.intValue().toString(A)+a},r.prototype.fromRadix=function(A,t){this.fromInt(0),null==t&&(t=10);for(var e=this.chunkSize(t),i=Math.pow(t,e),s=!1,g=0,a=0,B=0;B<A.length;++B){var V=n(A,B);V<0?"-"==A.charAt(B)&&0==this.signum()&&(s=!0):(a=t*a+V,++g>=e&&(this.dMultiply(i),this.dAddOffset(a,0),g=0,a=0))}g>0&&(this.dMultiply(Math.pow(t,g)),this.dAddOffset(a,0)),s&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(A,t,e){if("number"==typeof t)if(A<2)this.fromInt(1);else for(this.fromNumber(A,e),this.testBit(A-1)||this.bitwiseTo(r.ONE.shiftLeft(A-1),W,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>A&&this.subTo(r.ONE.shiftLeft(A-1),this);else{var i=new Array,s=7&A;i.length=1+(A>>3),t.nextBytes(i),s>0?i[0]&=(1<<s)-1:i[0]=0,this.fromString(i,256)}},r.prototype.bitwiseTo=function(A,t,r){var e,i,s=Math.min(A.t,this.t);for(e=0;e<s;++e)r[e]=t(this[e],A[e]);if(A.t<this.t){for(i=A.s&this.DM,e=s;e<this.t;++e)r[e]=t(this[e],i);r.t=this.t}else{for(i=this.s&this.DM,e=s;e<A.t;++e)r[e]=t(i,A[e]);r.t=A.t}r.s=t(this.s,A.s),r.clamp()},r.prototype.changeBit=function(A,t){var e=r.ONE.shiftLeft(A);return this.bitwiseTo(e,t,e),e},r.prototype.addTo=function(A,t){for(var r=0,e=0,i=Math.min(A.t,this.t);r<i;)e+=this[r]+A[r],t[r++]=e&this.DM,e>>=this.DB;if(A.t<this.t){for(e+=A.s;r<this.t;)e+=this[r],t[r++]=e&this.DM,e>>=this.DB;e+=this.s}else{for(e+=this.s;r<A.t;)e+=A[r],t[r++]=e&this.DM,e>>=this.DB;e+=A.s}t.s=e<0?-1:0,e>0?t[r++]=e:e<-1&&(t[r++]=this.DV+e),t.t=r,t.clamp()},r.prototype.dMultiply=function(A){this[this.t]=this.am(0,A-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(A,t){if(0!=A){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=A;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},r.prototype.multiplyLowerTo=function(A,t,r){var e,i=Math.min(this.t+A.t,t);for(r.s=0,r.t=i;i>0;)r[--i]=0;for(e=r.t-this.t;i<e;++i)r[i+this.t]=this.am(0,A[i],r,i,0,this.t);for(e=Math.min(A.t,t);i<e;++i)this.am(0,A[i],r,i,0,t-i);r.clamp()},r.prototype.multiplyUpperTo=function(A,t,r){--t;var e=r.t=this.t+A.t-t;for(r.s=0;--e>=0;)r[e]=0;for(e=Math.max(t-this.t,0);e<A.t;++e)r[this.t+e-t]=this.am(t-e,A[e],r,0,0,this.t+e-t);r.clamp(),r.drShiftTo(1,r)},r.prototype.modInt=function(A){if(A<=0)return 0;var t=this.DV%A,r=this.s<0?A-1:0;if(this.t>0)if(0==t)r=this[0]%A;else for(var e=this.t-1;e>=0;--e)r=(t*r+this[e])%A;return r},r.prototype.millerRabin=function(A){var t=this.subtract(r.ONE),i=t.getLowestSetBit();if(i<=0)return!1;var s=t.shiftRight(i);(A=A+1>>1)>y.length&&(A=y.length);for(var g=e(),a=0;a<A;++a){g.fromInt(y[Math.floor(Math.random()*y.length)]);var B=g.modPow(s,this);if(0!=B.compareTo(r.ONE)&&0!=B.compareTo(t)){for(var n=1;n++<i&&0!=B.compareTo(t);)if(0==(B=B.modPowInt(2,this)).compareTo(r.ONE))return!1;if(0!=B.compareTo(t))return!1}}return!0},r.prototype.clone=function(){var A=e();return this.copyTo(A),A},r.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var A=this.t,t=new Array;t[0]=this.s;var r,e=this.DB-A*this.DB%8,i=0;if(A-- >0)for(e<this.DB&&(r=this[A]>>e)!=(this.s&this.DM)>>e&&(t[i++]=r|this.s<<this.DB-e);A>=0;)e<8?(r=(this[A]&(1<<e)-1)<<8-e,r|=this[--A]>>(e+=this.DB-8)):(r=this[A]>>(e-=8)&255,e<=0&&(e+=this.DB,--A)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},r.prototype.equals=function(A){return 0==this.compareTo(A)},r.prototype.min=function(A){return this.compareTo(A)<0?this:A},r.prototype.max=function(A){return this.compareTo(A)>0?this:A},r.prototype.and=function(A){var t=e();return this.bitwiseTo(A,C,t),t},r.prototype.or=function(A){var t=e();return this.bitwiseTo(A,W,t),t},r.prototype.xor=function(A){var t=e();return this.bitwiseTo(A,q,t),t},r.prototype.andNot=function(A){var t=e();return this.bitwiseTo(A,u,t),t},r.prototype.not=function(){for(var A=e(),t=0;t<this.t;++t)A[t]=this.DM&~this[t];return A.t=this.t,A.s=~this.s,A},r.prototype.shiftLeft=function(A){var t=e();return A<0?this.rShiftTo(-A,t):this.lShiftTo(A,t),t},r.prototype.shiftRight=function(A){var t=e();return A<0?this.lShiftTo(-A,t):this.rShiftTo(A,t),t},r.prototype.getLowestSetBit=function(){for(var A=0;A<this.t;++A)if(0!=this[A])return A*this.DB+Q(this[A]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var A=0,t=this.s&this.DM,r=0;r<this.t;++r)A+=l(this[r]^t);return A},r.prototype.testBit=function(A){var t=Math.floor(A/this.DB);return t>=this.t?0!=this.s:!!(this[t]&1<<A%this.DB)},r.prototype.setBit=function(A){return this.changeBit(A,W)},r.prototype.clearBit=function(A){return this.changeBit(A,u)},r.prototype.flipBit=function(A){return this.changeBit(A,q)},r.prototype.add=function(A){var t=e();return this.addTo(A,t),t},r.prototype.subtract=function(A){var t=e();return this.subTo(A,t),t},r.prototype.multiply=function(A){var t=e();return this.multiplyTo(A,t),t},r.prototype.divide=function(A){var t=e();return this.divRemTo(A,t,null),t},r.prototype.remainder=function(A){var t=e();return this.divRemTo(A,null,t),t},r.prototype.divideAndRemainder=function(A){var t=e(),r=e();return this.divRemTo(A,t,r),new Array(t,r)},r.prototype.modPow=function(A,t){var r,i,s=A.bitLength(),g=V(1);if(s<=0)return g;r=s<18?1:s<48?3:s<144?4:s<768?5:6,i=s<8?new o(t):t.isEven()?new x(t):new E(t);var a=new Array,B=3,n=r-1,C=(1<<r)-1;if(a[1]=i.convert(this),r>1){var W=e();for(i.sqrTo(a[1],W);B<=C;)a[B]=e(),i.mulTo(W,a[B-2],a[B]),B+=2}var q,u,Q=A.t-1,l=!0,k=e();for(s=I(A[Q])-1;Q>=0;){for(s>=n?q=A[Q]>>s-n&C:(q=(A[Q]&(1<<s+1)-1)<<n-s,Q>0&&(q|=A[Q-1]>>this.DB+s-n)),B=r;!(1&q);)q>>=1,--B;if((s-=B)<0&&(s+=this.DB,--Q),l)a[q].copyTo(g),l=!1;else{for(;B>1;)i.sqrTo(g,k),i.sqrTo(k,g),B-=2;B>0?i.sqrTo(g,k):(u=g,g=k,k=u),i.mulTo(k,a[q],g)}for(;Q>=0&&!(A[Q]&1<<s);)i.sqrTo(g,k),u=g,g=k,k=u,--s<0&&(s=this.DB-1,--Q)}return i.revert(g)},r.prototype.modInverse=function(A){var t=A.isEven();if(this.isEven()&&t||0==A.signum())return r.ZERO;for(var e=A.clone(),i=this.clone(),s=V(1),g=V(0),a=V(0),B=V(1);0!=e.signum();){for(;e.isEven();)e.rShiftTo(1,e),t?(s.isEven()&&g.isEven()||(s.addTo(this,s),g.subTo(A,g)),s.rShiftTo(1,s)):g.isEven()||g.subTo(A,g),g.rShiftTo(1,g);for(;i.isEven();)i.rShiftTo(1,i),t?(a.isEven()&&B.isEven()||(a.addTo(this,a),B.subTo(A,B)),a.rShiftTo(1,a)):B.isEven()||B.subTo(A,B),B.rShiftTo(1,B);e.compareTo(i)>=0?(e.subTo(i,e),t&&s.subTo(a,s),g.subTo(B,g)):(i.subTo(e,i),t&&a.subTo(s,a),B.subTo(g,B))}return 0!=i.compareTo(r.ONE)?r.ZERO:B.compareTo(A)>=0?B.subtract(A):B.signum()<0?(B.addTo(A,B),B.signum()<0?B.add(A):B):B},r.prototype.pow=function(A){return this.exp(A,new k)},r.prototype.gcd=function(A){var t=this.s<0?this.negate():this.clone(),r=A.s<0?A.negate():A.clone();if(t.compareTo(r)<0){var e=t;t=r,r=e}var i=t.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return t;for(i<s&&(s=i),s>0&&(t.rShiftTo(s,t),r.rShiftTo(s,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r},r.prototype.isProbablePrime=function(A){var t,r=this.abs();if(1==r.t&&r[0]<=y[y.length-1]){for(t=0;t<y.length;++t)if(r[0]==y[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<y.length;){for(var e=y[t],i=t+1;i<y.length&&e<D;)e*=y[i++];for(e=r.modInt(e);t<i;)if(e%y[t++]==0)return!1}return r.millerRabin(A)},r.prototype.square=function(){var A=e();return this.squareTo(A),A},r.prototype.Barrett=x,null==w){var J;if(w=new Array,d=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var b=new Uint8Array(32);for(window.crypto.getRandomValues(b),J=0;J<32;++J)w[d++]=b[J]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var f=window.crypto.random(32);for(J=0;J<f.length;++J)w[d++]=255&f.charCodeAt(J)}for(;d<M;)J=Math.floor(65536*Math.random()),w[d++]=J>>>8,w[d++]=255&J;d=0,S()}function p(){if(null==Y){for(S(),(Y=new h).init(w),d=0;d<w.length;++d)w[d]=0;d=0}return Y.next()}function K(){}function h(){this.i=0,this.j=0,this.S=new Array}K.prototype.nextBytes=function(A){var t;for(t=0;t<A.length;++t)A[t]=p()},h.prototype.init=function(A){var t,r,e;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+A[t%A.length]&255,e=this.S[t],this.S[t]=this.S[r],this.S[r]=e;this.i=0,this.j=0},h.prototype.next=function(){var A;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,A=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=A,this.S[A+this.S[this.i]&255]};var M=256;A.exports={default:r,BigInteger:r,SecureRandom:K}}.call(Or)),Tr.exports;var A}function zr(){if(Jr)return Sr;Jr=1;const{BigInteger:A}=Nr();class t{constructor(){this.tlv=null,this.t="00",this.l="00",this.v=""}getEncodedHex(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}getLength(){const A=this.v.length/2;let t=A.toString(16);if(t.length%2==1&&(t="0"+t),A<128)return t;return(128+t.length/2).toString(16)+t}getValue(){return""}}class r extends t{constructor(t){super(),this.t="02",t&&(this.v=function(t){let r=t.toString(16);if("-"!==r[0])r.length%2==1?r="0"+r:r.match(/^[0-7]/)||(r="00"+r);else{r=r.substr(1);let e=r.length;e%2==1?e+=1:r.match(/^[0-7]/)||(e+=2);let i="";for(let A=0;A<e;A++)i+="f";i=new A(i,16),r=i.xor(t).add(A.ONE),r=r.toString(16).replace(/^-/,"")}return r}(t))}getValue(){return this.v}}class e extends t{constructor(A){super(),this.t="30",this.asn1Array=A}getValue(){return this.v=this.asn1Array.map(A=>A.getEncodedHex()).join(""),this.v}}function i(A,t){return+A[t+2]<8?1:128&+A.substr(t+2,2)}function s(t,r){const e=i(t,r),s=t.substr(r+2,2*e);if(!s)return-1;return(+s[0]<8?new A(s,16):new A(s.substr(2),16)).intValue()}function g(A,t){return t+2*(i(A,t)+1)}return Sr={encodeDer(A,t){const i=new r(A),s=new r(t);return new e([i,s]).getEncodedHex()},decodeDer(t){const r=g(t,0),e=g(t,r),i=s(t,r),a=t.substr(e,2*i),B=e+a.length,n=g(t,B),V=s(t,B),I=t.substr(n,2*V);return{r:new A(a,16),s:new A(I,16)}}}}function _r(){if(Kr)return pr;Kr=1;const{BigInteger:A,SecureRandom:t}=Nr(),{ECCurveFp:r}=function(){if(fr)return br;fr=1;const{BigInteger:A}=Nr(),t=new A("2"),r=new A("3");class e{constructor(A,t){this.x=t,this.q=A}equals(A){return A===this||this.q.equals(A.q)&&this.x.equals(A.x)}toBigInteger(){return this.x}negate(){return new e(this.q,this.x.negate().mod(this.q))}add(A){return new e(this.q,this.x.add(A.toBigInteger()).mod(this.q))}subtract(A){return new e(this.q,this.x.subtract(A.toBigInteger()).mod(this.q))}multiply(A){return new e(this.q,this.x.multiply(A.toBigInteger()).mod(this.q))}divide(A){return new e(this.q,this.x.multiply(A.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new e(this.q,this.x.square().mod(this.q))}}class i{constructor(t,r,e,i){this.curve=t,this.x=r,this.y=e,this.z=null==i?A.ONE:i,this.zinv=null}getX(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}getY(){return null===this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}equals(t){return t===this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(A.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(A.ZERO))}isInfinity(){return null===this.x&&null===this.y||this.z.equals(A.ZERO)&&!this.y.toBigInteger().equals(A.ZERO)}negate(){return new i(this.curve,this.x,this.y.negate(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;const r=this.x.toBigInteger(),e=this.y.toBigInteger(),s=this.z,g=t.x.toBigInteger(),a=t.y.toBigInteger(),B=t.z,n=this.curve.q,V=r.multiply(B).mod(n),I=g.multiply(s).mod(n),o=V.subtract(I),E=e.multiply(B).mod(n),C=a.multiply(s).mod(n),W=E.subtract(C);if(A.ZERO.equals(o))return A.ZERO.equals(W)?this.twice():this.curve.infinity;const q=V.add(I),u=s.multiply(B).mod(n),Q=o.square().mod(n),l=o.multiply(Q).mod(n),k=u.multiply(W.square()).subtract(q.multiply(Q)).mod(n),c=o.multiply(k).mod(n),x=W.multiply(Q.multiply(V).subtract(k)).subtract(E.multiply(l)).mod(n),Y=l.multiply(u).mod(n);return new i(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(x),Y)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const A=this.x.toBigInteger(),t=this.y.toBigInteger(),e=this.z,s=this.curve.q,g=this.curve.a.toBigInteger(),a=A.square().multiply(r).add(g.multiply(e.square())).mod(s),B=t.shiftLeft(1).multiply(e).mod(s),n=t.square().mod(s),V=n.multiply(A).multiply(e).mod(s),I=B.square().mod(s),o=a.square().subtract(V.shiftLeft(3)).mod(s),E=B.multiply(o).mod(s),C=a.multiply(V.shiftLeft(2).subtract(o)).subtract(I.shiftLeft(1).multiply(n)).mod(s),W=B.multiply(I).mod(s);return new i(this.curve,this.curve.fromBigInteger(E),this.curve.fromBigInteger(C),W)}multiply(A){if(this.isInfinity())return this;if(!A.signum())return this.curve.infinity;const t=A.multiply(r),e=this.negate();let i=this;for(let r=t.bitLength()-2;r>0;r--){i=i.twice();const s=t.testBit(r);s!==A.testBit(r)&&(i=i.add(s?this:e))}return i}}return br={ECPointFp:i,ECCurveFp:class{constructor(A,t,r){this.q=A,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new i(this,null,null)}equals(A){return A===this||this.q.equals(A.q)&&this.a.equals(A.a)&&this.b.equals(A.b)}fromBigInteger(A){return new e(this.q,A)}decodePointHex(r){switch(parseInt(r.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const e=this.fromBigInteger(new A(r.substr(2),16));let s=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new A("4")).add(A.ONE),this.q));return s.toBigInteger().mod(t).equals(new A(r.substr(0,2),16).subtract(t))||(s=s.negate()),new i(this,e,s);case 4:case 6:case 7:const g=(r.length-2)/2,a=r.substr(2,g),B=r.substr(g+2,g);return new i(this,this.fromBigInteger(new A(a,16)),this.fromBigInteger(new A(B,16)));default:return null}}}}}(),e=new t,{curve:i,G:s,n:g}=a();function a(){const t=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),e=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),i=new A("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),s=new r(t,e,i),g=s.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:s,G:g,n:new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function B(A,t){return A.length>=t?A:new Array(t-A.length+1).join("0")+A}return pr={getGlobalCurve:function(){return i},generateEcparam:a,generateKeyPairHex:function(t,r,i){const a=(t?new A(t,r,i):new A(g.bitLength(),e)).mod(g.subtract(A.ONE)).add(A.ONE),n=B(a.toString(16),64),V=s.multiply(a);return{privateKey:n,publicKey:"04"+B(V.getX().toBigInteger().toString(16),64)+B(V.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(t){if(130!==t.length)throw new Error("Invalid public key to compress");const r=(t.length-2)/2,e=t.substr(2,r);let i="03";return new A(t.substr(r+2,r),16).mod(new A("2")).equals(A.ZERO)&&(i="02"),i+e},utf8ToHex:function(A){const t=(A=unescape(encodeURIComponent(A))).length,r=[];for(let i=0;i<t;i++)r[i>>>2]|=(255&A.charCodeAt(i))<<24-i%4*8;const e=[];for(let i=0;i<t;i++){const A=r[i>>>2]>>>24-i%4*8&255;e.push((A>>>4).toString(16)),e.push((15&A).toString(16))}return e.join("")},leftPad:B,arrayToHex:function(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")},arrayToUtf8:function(A){const t=[];let r=0;for(let i=0;i<2*A.length;i+=2)t[i>>>3]|=parseInt(A[r],10)<<24-i%8*4,r++;try{const r=[];for(let e=0;e<A.length;e++){const A=t[e>>>2]>>>24-e%4*8&255;r.push(String.fromCharCode(A))}return decodeURIComponent(escape(r.join("")))}catch(e){throw new Error("Malformed UTF-8 data")}},hexToArray:function(A){const t=[];let r=A.length;r%2!=0&&(A=B(A,r+1)),r=A.length;for(let e=0;e<r;e+=2)t.push(parseInt(A.substr(e,2),16));return t},verifyPublicKey:function(A){const t=i.decodePointHex(A);if(!t)return!1;const r=t.getX();return t.getY().square().equals(r.multiply(r.square()).add(r.multiply(i.a)).add(i.b))},comparePublicKeyHex:function(A,t){const r=i.decodePointHex(A);if(!r)return!1;const e=i.decodePointHex(t);return!!e&&r.equals(e)}}}function $r(){if(Mr)return hr;Mr=1;const A=new Uint32Array(68),t=new Uint32Array(64);function r(A,t){const r=31&t;return A<<r|A>>>32-r}function e(A,t){const r=[];for(let e=A.length-1;e>=0;e--)r[e]=255&(A[e]^t[e]);return r}function i(A){return A^r(A,9)^r(A,17)}function s(A){return A^r(A,15)^r(A,23)}function g(e){let g=8*e.length,a=g%512;a=a>=448?512-a%448-1:448-a-1;const B=new Array((a-7)/8),n=new Array(8);for(let A=0,t=B.length;A<t;A++)B[A]=0;for(let A=0,t=n.length;A<t;A++)n[A]=0;g=g.toString(2);for(let A=7;A>=0;A--)if(g.length>8){const t=g.length-8;n[A]=parseInt(g.substr(t),2),g=g.substr(0,t)}else g.length>0&&(n[A]=parseInt(g,2),g="");const V=new Uint8Array([...e,128,...B,...n]),I=new DataView(V.buffer,0),o=V.length/64,E=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let W=0;W<o;W++){A.fill(0),t.fill(0);const e=16*W;for(let t=0;t<16;t++)A[t]=I.getUint32(4*(e+t),!1);for(let t=16;t<68;t++)A[t]=s(A[t-16]^A[t-9]^r(A[t-3],15))^r(A[t-13],7)^A[t-6];for(let r=0;r<64;r++)t[r]=A[r]^A[r+4];const g=2043430169,a=2055708042;let B,n,V,o,C,q=E[0],u=E[1],Q=E[2],l=E[3],k=E[4],c=E[5],x=E[6],Y=E[7];for(let s=0;s<64;s++)C=s>=0&&s<=15?g:a,B=r(r(q,12)+k+r(C,s),7),n=B^r(q,12),V=(s>=0&&s<=15?q^u^Q:q&u|q&Q|u&Q)+l+n+t[s],o=(s>=0&&s<=15?k^c^x:k&c|~k&x)+Y+B+A[s],l=Q,Q=r(u,9),u=q,q=V,Y=x,x=r(c,19),c=k,k=i(o);E[0]^=q,E[1]^=u,E[2]^=Q,E[3]^=l,E[4]^=k,E[5]^=c,E[6]^=x,E[7]^=Y}const C=[];for(let A=0,t=E.length;A<t;A++){const t=E[A];C.push((4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t)}return C}const a=new Uint8Array(64),B=new Uint8Array(64);for(let n=0;n<64;n++)a[n]=54,B[n]=92;return hr={sm3:g,hmac:function(A,t){for(t.length>64&&(t=g(t));t.length<64;)t.push(0);const r=e(t,a),i=e(t,B),s=g([...r,...A]);return g([...i,...s])}}}function Ae(){if(Gr)return Fr;Gr=1;const{BigInteger:A}=Nr(),{encodeDer:t,decodeDer:r}=zr(),e=_r(),i=$r().sm3,{G:s,curve:g,n:a}=e.generateEcparam();function B(A,t,r="1234567812345678"){r=e.utf8ToHex(r);const g=e.leftPad(s.curve.a.toBigInteger().toRadix(16),64),a=e.leftPad(s.curve.b.toBigInteger().toRadix(16),64),B=e.leftPad(s.getX().toBigInteger().toRadix(16),64),n=e.leftPad(s.getY().toBigInteger().toRadix(16),64);let V,I;if(128===t.length)V=t.substr(0,64),I=t.substr(64,64);else{const A=s.curve.decodePointHex(t);V=e.leftPad(A.getX().toBigInteger().toRadix(16),64),I=e.leftPad(A.getY().toBigInteger().toRadix(16),64)}const o=e.hexToArray(r+g+a+B+n+V+I),E=4*r.length;o.unshift(255&E),o.unshift(E>>8&255);const C=i(o);return e.arrayToHex(i(C.concat(e.hexToArray(A))))}function n(t){const r=s.multiply(new A(t,16));return"04"+e.leftPad(r.getX().toBigInteger().toString(16),64)+e.leftPad(r.getY().toBigInteger().toString(16),64)}function V(){const t=e.generateKeyPairHex(),r=g.decodePointHex(t.publicKey);return t.k=new A(t.privateKey,16),t.x1=r.getX().toBigInteger(),t}return Fr={generateKeyPairHex:e.generateKeyPairHex,compressPublicKeyHex:e.compressPublicKeyHex,comparePublicKeyHex:e.comparePublicKeyHex,doEncrypt:function(t,r,s=1){t="string"==typeof t?e.hexToArray(e.utf8ToHex(t)):Array.prototype.slice.call(t),r=e.getGlobalCurve().decodePointHex(r);const g=e.generateKeyPairHex(),a=new A(g.privateKey,16);let B=g.publicKey;B.length>128&&(B=B.substr(B.length-128));const n=r.multiply(a),V=e.hexToArray(e.leftPad(n.getX().toBigInteger().toRadix(16),64)),I=e.hexToArray(e.leftPad(n.getY().toBigInteger().toRadix(16),64)),o=e.arrayToHex(i([].concat(V,t,I)));let E=1,C=0,W=[];const q=[].concat(V,I),u=()=>{W=i([...q,E>>24&255,E>>16&255,E>>8&255,255&E]),E++,C=0};u();for(let A=0,e=t.length;A<e;A++)C===W.length&&u(),t[A]^=255&W[C++];const Q=e.arrayToHex(t);return 0===s?B+Q+o:B+o+Q},doDecrypt:function(t,r,s=1,{output:g="string"}={}){r=new A(r,16);let a=t.substr(128,64),B=t.substr(192);0===s&&(a=t.substr(t.length-64),B=t.substr(128,t.length-128-64));const n=e.hexToArray(B),V=e.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(r),I=e.hexToArray(e.leftPad(V.getX().toBigInteger().toRadix(16),64)),o=e.hexToArray(e.leftPad(V.getY().toBigInteger().toRadix(16),64));let E=1,C=0,W=[];const q=[].concat(I,o),u=()=>{W=i([...q,E>>24&255,E>>16&255,E>>8&255,255&E]),E++,C=0};u();for(let A=0,e=n.length;A<e;A++)C===W.length&&u(),n[A]^=255&W[C++];return e.arrayToHex(i([].concat(I,n,o)))===a.toLowerCase()?"array"===g?n:e.arrayToUtf8(n):"array"===g?[]:""},doSignature:function(r,i,{pointPool:s,der:g,hash:I,publicKey:o,userId:E}={}){let C="string"==typeof r?e.utf8ToHex(r):e.arrayToHex(r);I&&(C=B(C,o=o||n(i),E));const W=new A(i,16),q=new A(C,16);let u=null,Q=null,l=null;do{do{let A;A=s&&s.length?s.pop():V(),u=A.k,Q=q.add(A.x1).mod(a)}while(Q.equals(A.ZERO)||Q.add(u).equals(a));l=W.add(A.ONE).modInverse(a).multiply(u.subtract(Q.multiply(W))).mod(a)}while(l.equals(A.ZERO));return g?t(Q,l):e.leftPad(Q.toString(16),64)+e.leftPad(l.toString(16),64)},doVerifySignature:function(t,i,n,{der:V,hash:I,userId:o}={}){let E,C,W="string"==typeof t?e.utf8ToHex(t):e.arrayToHex(t);if(I&&(W=B(W,n,o)),V){const A=r(i);E=A.r,C=A.s}else E=new A(i.substring(0,64),16),C=new A(i.substring(64),16);const q=g.decodePointHex(n),u=new A(W,16),Q=E.add(C).mod(a);if(Q.equals(A.ZERO))return!1;const l=s.multiply(C).add(q.multiply(Q)),k=u.add(l.getX().toBigInteger()).mod(a);return E.equals(k)},getPublicKeyFromPrivateKey:n,getPoint:V,verifyPublicKey:e.verifyPublicKey}}function te(){if(vr)return Ur;vr=1;const{sm3:A,hmac:t}=$r();function r(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")}function e(A){const t=[];let r=A.length;var e,i;r%2!=0&&(i=r+1,A=(e=A).length>=i?e:new Array(i-e.length+1).join("0")+e),r=A.length;for(let s=0;s<r;s+=2)t.push(parseInt(A.substr(s,2),16));return t}return Ur=function(i,s){if(i="string"==typeof i?function(A){const t=[];for(let r=0,e=A.length;r<e;r++){const e=A.codePointAt(r);if(e<=127)t.push(e);else if(e<=2047)t.push(192|e>>>6),t.push(128|63&e);else if(e<=55295||e>=57344&&e<=65535)t.push(224|e>>>12),t.push(128|e>>>6&63),t.push(128|63&e);else{if(!(e>=65536&&e<=1114111))throw t.push(e),new Error("input is not supported");r++,t.push(240|e>>>18&28),t.push(128|e>>>12&63),t.push(128|e>>>6&63),t.push(128|63&e)}}return t}(i):Array.prototype.slice.call(i),s){if("hmac"!==(s.mode||"hmac"))throw new Error("invalid mode");let A=s.key;if(!A)throw new Error("invalid key");return A="string"==typeof A?e(A):Array.prototype.slice.call(A),r(t(i,A))}return r(A(i))}}function re(){if(Pr)return Hr;Pr=1;const A=16,t=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],r=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function e(A){const t=[];for(let r=0,e=A.length;r<e;r+=2)t.push(parseInt(A.substr(r,2),16));return t}function i(A,t){const r=31&t;return A<<r|A>>>32-r}function s(A){return(255&t[A>>>24&255])<<24|(255&t[A>>>16&255])<<16|(255&t[A>>>8&255])<<8|255&t[255&A]}function g(A){return A^i(A,2)^i(A,10)^i(A,18)^i(A,24)}function a(A){return A^i(A,13)^i(A,23)}function B(A,t,r){const e=new Array(4),i=new Array(4);for(let s=0;s<4;s++)i[0]=255&A[4*s],i[1]=255&A[4*s+1],i[2]=255&A[4*s+2],i[3]=255&A[4*s+3],e[s]=i[0]<<24|i[1]<<16|i[2]<<8|i[3];for(let a,B=0;B<32;B+=4)a=e[1]^e[2]^e[3]^r[B+0],e[0]^=g(s(a)),a=e[2]^e[3]^e[0]^r[B+1],e[1]^=g(s(a)),a=e[3]^e[0]^e[1]^r[B+2],e[2]^=g(s(a)),a=e[0]^e[1]^e[2]^r[B+3],e[3]^=g(s(a));for(let s=0;s<16;s+=4)t[s]=e[3-s/4]>>>24&255,t[s+1]=e[3-s/4]>>>16&255,t[s+2]=e[3-s/4]>>>8&255,t[s+3]=255&e[3-s/4]}function n(t,i,g,{padding:n="pkcs#7",mode:V,iv:I=[],output:o="string"}={}){if("cbc"===V&&("string"==typeof I&&(I=e(I)),16!==I.length))throw new Error("iv is invalid");if("string"==typeof i&&(i=e(i)),16!==i.length)throw new Error("key is invalid");if(t="string"==typeof t?0!==g?function(A){const t=[];for(let r=0,e=A.length;r<e;r++){const e=A.codePointAt(r);if(e<=127)t.push(e);else if(e<=2047)t.push(192|e>>>6),t.push(128|63&e);else if(e<=55295||e>=57344&&e<=65535)t.push(224|e>>>12),t.push(128|e>>>6&63),t.push(128|63&e);else{if(!(e>=65536&&e<=1114111))throw t.push(e),new Error("input is not supported");r++,t.push(240|e>>>18&28),t.push(128|e>>>12&63),t.push(128|e>>>6&63),t.push(128|63&e)}}return t}(t):e(t):[...t],("pkcs#5"===n||"pkcs#7"===n)&&0!==g){const r=A-t.length%A;for(let A=0;A<r;A++)t.push(r)}const E=new Array(32);!function(A,t,e){const i=new Array(4),g=new Array(4);for(let r=0;r<4;r++)g[0]=255&A[0+4*r],g[1]=255&A[1+4*r],g[2]=255&A[2+4*r],g[3]=255&A[3+4*r],i[r]=g[0]<<24|g[1]<<16|g[2]<<8|g[3];i[0]^=2746333894,i[1]^=1453994832,i[2]^=1736282519,i[3]^=2993693404;for(let B,n=0;n<32;n+=4)B=i[1]^i[2]^i[3]^r[n+0],t[n+0]=i[0]^=a(s(B)),B=i[2]^i[3]^i[0]^r[n+1],t[n+1]=i[1]^=a(s(B)),B=i[3]^i[0]^i[1]^r[n+2],t[n+2]=i[2]^=a(s(B)),B=i[0]^i[1]^i[2]^r[n+3],t[n+3]=i[3]^=a(s(B));if(0===e)for(let r,s=0;s<16;s++)r=t[s],t[s]=t[31-s],t[31-s]=r}(i,E,g);const C=[];let W=I,q=t.length,u=0;for(;q>=A;){const r=t.slice(u,u+16),e=new Array(16);if("cbc"===V)for(let t=0;t<A;t++)0!==g&&(r[t]^=W[t]);B(r,e,E);for(let t=0;t<A;t++)"cbc"===V&&0===g&&(e[t]^=W[t]),C[u+t]=e[t];"cbc"===V&&(W=0!==g?e:r),q-=A,u+=A}if(("pkcs#5"===n||"pkcs#7"===n)&&0===g){const A=C.length,t=C[A-1];for(let r=1;r<=t;r++)if(C[A-r]!==t)throw new Error("padding is invalid");C.splice(A-t,t)}return"array"!==o?0!==g?C.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join(""):function(A){const t=[];for(let r=0,e=A.length;r<e;r++)A[r]>=240&&A[r]<=247?(t.push(String.fromCodePoint(((7&A[r])<<18)+((63&A[r+1])<<12)+((63&A[r+2])<<6)+(63&A[r+3]))),r+=3):A[r]>=224&&A[r]<=239?(t.push(String.fromCodePoint(((15&A[r])<<12)+((63&A[r+1])<<6)+(63&A[r+2]))),r+=2):A[r]>=192&&A[r]<=223?(t.push(String.fromCodePoint(((31&A[r])<<6)+(63&A[r+1]))),r++):t.push(String.fromCodePoint(A[r]));return t.join("")}(C):C}return Hr={encrypt:(A,t,r)=>n(A,t,1,r),decrypt:(A,t,r)=>n(A,t,0,r)}}const ee=F(jr?Rr:(jr=1,Rr={sm2:Ae(),sm3:te(),sm4:re()}));class ie{constructor(A,t,r,e){f(this,g,null),f(this,a,null),f(this,B,null),f(this,n,null),f(this,V,(A,t=!1)=>{if(!t)return"object"==typeof A?JSON.stringify(A):String(A);try{return JSON.parse(A)}catch(r){return A}}),this.setkey(A),this.setiv(t),this.setPublicKey(r),this.setPrivateKey(e)}setPublicKey(A){p(this,B,A)}setPrivateKey(A){p(this,n,A)}setkey(A){p(this,g,A&&this.stringToWordArray(A.padEnd(16,"0")))}setiv(A){p(this,a,A&&this.stringToWordArray(A))}sm2Encrypt(A,t){return ee.sm2.doEncrypt(A,t,{inputEncoding:"utf8",outputEncoding:"hex",pointFormat:"uncompressed",cipherMode:1})}sm2Decrypt(A,t){return ee.sm2.doDecrypt(A,t,1)}RSAencrypt(A){A=b(this,V).call(this,A);const t=new Xr;return t.setPublicKey(b(this,B)),t.encrypt(A)}RSAdecrypt(A){const t=new Xr;return t.setPrivateKey(b(this,n)),b(this,V).call(this,t.decrypt(A),!0)}stringToWordArray(A){return yt.enc.Utf8.parse(A)}wordArrayToString(A){return A.toString(yt.enc.Utf8)}AESencrypt(A,t=!0){return A=b(this,V).call(this,A),yt.AES.encrypt(A,b(this,g),{iv:b(this,a),mode:yt.mode.CBC,padding:yt.pad.Pkcs7}).ciphertext.toString(t?yt.enc.Base64:yt.enc.Hex)}AESdecrypt(A,t=!0){A=t?A:yt.enc.Base64.stringify(yt.enc.Hex.parse(A));let r=yt.AES.decrypt(A,b(this,g),{iv:b(this,a),mode:yt.mode.CBC,padding:yt.pad.Pkcs7});return b(this,V).call(this,r.toString(yt.enc.Utf8),!0)}DESencrypt(A,t=!0){return A=b(this,V).call(this,A),yt.DES.encrypt(A,b(this,g),{iv:b(this,a),mode:yt.mode.CBC,padding:yt.pad.Pkcs7}).ciphertext.toString(t?yt.enc.Base64:yt.enc.Hex)}DESdecrypt(A,t=!0){A=t?A:yt.enc.Base64.stringify(yt.enc.Hex.parse(A));let r=yt.DES.decrypt(A,b(this,g),{iv:b(this,a),mode:yt.mode.CBC,padding:yt.pad.Pkcs7});return b(this,V).call(this,r.toString(yt.enc.Utf8),!0)}base64Encode(A){return A=b(this,V).call(this,A),yt.enc.Base64.stringify(yt.enc.Utf8.parse(A))}base64Decode(A){return b(this,V).call(this,yt.enc.Base64.parse(A).toString(yt.enc.Utf8),!0)}md5(A){return A=b(this,V).call(this,A),yt.MD5(A).toString()}fileMd5(A,t,r){return new Promise((e,i)=>{if(!A)return void i("");const s=new FileReader;if(s.onerror=A=>{i(A)},t){const a=yt.algo.MD5.create();let B=0;try{let i=function(){const r=A.slice(B,B+t);s.readAsArrayBuffer(r)};s.onload=s=>{const g=yt.lib.WordArray.create(new Uint8Array(s.target.result));if(a.update(g),"function"==typeof r&&r(B,A.size),B+=t,B<A.size)i();else{const A=a.finalize();e(A.toString(yt.enc.Hex))}},i()}catch(g){i(g)}}else s.onload=t=>{"function"==typeof r&&r(A.size,A.size),e(yt.MD5(yt.lib.WordArray.create(t.target.result)).toString())},s.readAsArrayBuffer(A)})}sha1(A){return A=b(this,V).call(this,A),yt.SHA1(A).toString()}sha256(A){return A=b(this,V).call(this,A),yt.SHA256(A).toString()}sha3(A){return A=b(this,V).call(this,A),yt.SHA3(A,{outputLength:256}).toString()}pbkdf2(A){A=b(this,V).call(this,A);let t=yt.lib.WordArray.random(16);return yt.PBKDF2(A,t,{keySize:8,iterations:1e3}).toString()}hmac(A,t){return A=b(this,V).call(this,A),yt.HmacSHA256(A,t).toString(yt.enc.Hex)}}function se(A=18,t=36){(t<2||t>36)&&(t=36);var r=Math.random().toString(t).substring(2,13).padEnd(11,"0").slice(0,A);return A<=11?r:r+se(A-11)}function ge(A){A=A.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(A,t,r,e)=>t+t+r+r+e+e);const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function ae(A){return new Promise((t,r)=>{if(A)try{var e=new FileReader;let i="";e.readAsDataURL(A),e.onload=function(){i=e.result},e.onerror=function(A){r(A)},e.onloadend=function(){t(i)}}catch(i){r(i)}else r("")})}g=new WeakMap,a=new WeakMap,B=new WeakMap,n=new WeakMap,V=new WeakMap;const Be={formatDateTime:function(A="yyyy-MM-dd hh:mm:ss",t=new Date,r=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]){!t&&(t=new Date),"string"==typeof t&&(t=new Date(t));const e={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),S:t.getMilliseconds(),w:r[t.getDay()]};/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(const i in e)new RegExp("("+i+")").test(A)&&(A=A.replace(RegExp.$1,1===RegExp.$1.length?e[i]:("00"+e[i]).substr((""+e[i]).length)));return A},throttle:function(A,t=500){var r=Date.now();return function(...e){Date.now()-r>=t&&(A.apply(this,e),r=Date.now())}},debounce:function(A,t=500){let r=null;return function(...e){clearTimeout(r),r=setTimeout(()=>{A.apply(this,e)},t)}},rgbToHex:function(A,t,r){return"#"+((1<<24)+(A<<16)+(t<<8)+r).toString(16).slice(1)},hexToRgb:ge,hslToRgb:function(A,t,r){let e,i,s;if(A/=360,r/=100,0===(t/=100))e=i=s=r;else{const g=(A,t,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?A+6*(t-A)*r:r<.5?t:r<2/3?A+(t-A)*(2/3-r)*6:A),a=r<.5?r*(1+t):r+t-r*t,B=2*r-a;e=g(B,a,A+1/3),i=g(B,a,A),s=g(B,a,A-1/3)}return{r:Math.round(255*e),g:Math.round(255*i),b:Math.round(255*s)}},rgbOrHexToHsl:function(A){let t,r,e;if("string"==typeof A&&"#"===A.charAt(0)){const i=ge(A);t=i.r/255,r=i.g/255,e=i.b/255}else{if("object"!=typeof A)throw new Error("Invalid input format");t=A.r/255,r=A.g/255,e=A.b/255}const i=Math.max(t,r,e),s=Math.min(t,r,e);let g,a,B=(i+s)/2;if(i===s)g=a=0;else{const A=i-s;switch(a=B>.5?A/(2-i-s):A/(i+s),i){case t:g=(r-e)/A+(r<e?6:0);break;case r:g=(e-t)/A+2;break;case e:g=(t-r)/A+4}g/=6}return{h:Math.round(360*g),s:Math.round(100*a),l:Math.round(100*B)}},preciseInterval:function(A,t){let r,e=null;return r=requestAnimationFrame(function i(s){e||(e=s),s-e>=t&&(A(),e=s),r=requestAnimationFrame(i)}),{clear:function(){cancelAnimationFrame(r)}}},convertImgToBase64:function(A,t){return new Promise(function(r){var e=document.createElement("CANVAS"),i=e.getContext("2d"),s=new Image;s.crossOrigin="Anonymous",s.onload=function(){e.height=s.height,e.width=s.width,i.drawImage(s,0,0);var A=e.toDataURL(t||"image/jpg");r(A),e=null},s.src=A})},objectGroupBy:function(A,t){if("string"==typeof t){const A=t;t=t=>t[A]}var r={};return A.forEach((e,i)=>{const s=t(e,i,A);r[s]||(r[s]=[]),r[s].push(e)}),r},randomNum:function(A,t){return Math.floor(Math.random()*(t+1-A))+A},randomColor:function(){return"#"+Math.floor(16777215*Math.random()).toString(16).padEnd(6,"0")},deepCloning:function A(t,r=new WeakMap){if("object"!=typeof t||null===t)return t;if(r.has(t))return r.get(t);var e=Array.isArray(t)?[]:{};r.set(t,e);for(const s in t)if(t.hasOwnProperty(s)){const g=t[s];if("object"!=typeof g||null===g)e[s]=g;else try{e[s]=A(g,r)}catch(i){}}return e},randomStr:se,getUrlParams:function(A){const t={};let r=A.substring(A.lastIndexOf("?")+1);return r=decodeURIComponent(r),r.replace(/([^?&=]+)=([^?&=]*)/g,(A,r,e)=>{const i=decodeURIComponent(r);let s=decodeURIComponent(e);try{s=JSON.parse(s)}catch(g){}return t[i]=s,A}),t},getBroswer:function(){let A="";const t=window.navigator.userAgent.toLowerCase();if(/(msie|firefox|opera|chrome|netscape)\D+(\d[\d.]*)/.test(t)){const r=t.search(RegExp.$1);A=t.substring(r,t.length).replace(/safari\D+(\d[\d.]*)/,"")}else/version\D+(\d[\d.]*).*safari/.test(t)&&(A="safari "+RegExp.$2);return A},fileTurnBase64:ae,fileChunks:function(A,t,r,e){return new Promise((i,s)=>{const g=new ie,a={fileHash:"",fileName:A.name,chunkSize:t,fileSize:A.size,fileType:A.type,chunks:[]};let B=new Promise((r,i)=>{g.fileMd5(A,t,e).then(A=>{a.fileHash=A,r(a)}).catch(A=>{i(A)})}),n=new Promise((e,i)=>{let s=0;!async function i(){if(s>=A.size)return void e(a);let g=A.slice(s,Math.min(s+t,A.size));r&&(g=await ae(g)),a.chunks.push({chunk:g,index:s/t}),s+=t,i()}()});Promise.all([B,n]).then(()=>{i(a)}).catch(A=>{s(A)})})},base64ArrayMerge:function(A,t=!0){let r=(A=A.map(A=>function(A){const t="=".repeat((4-A.length%4)%4),r=(A+t).replace(/\-/g,"+").replace(/_/g,"/"),e=window.atob(r),i=new Uint8Array(e.length);for(let s=0;s<e.length;++s)i[s]=e.charCodeAt(s);return i}(A.split(",")[1]))).reduce((A,t)=>A+t.length,0);const e=new Uint8Array(r);let i=0;A.forEach(A=>{e.set(A,i),i+=A.length});const s=new Blob([e]);return new Promise((A,r)=>{t?ae(s).then(t=>{A(t)}).catch(A=>{r(A)}):A(s)})},toChineseNumber:function(A,t=!0){let r=A.toString().replace(/(?=(\d{4})+$)/g,",").split(",").filter(Boolean);const e=["零","一","二","三","四","五","六","七","八","九"],i=["","十","百","千"],s=["","万","亿"];let g=r.map((A,t)=>function(A){let t="";for(let r=0;r<A.length;r++){let s=e[A[r]],g=i[A.length-r-1];"零"===s&&(g=""),t+=s+g}return t=t.replace(/零+/g,"零").replace(/零$/,""),t}(A)+s[r.length-1-t]).join("");if(g=g||"零",t){let A={"零":"零","一":"壹","二":"贰","三":"叁","四":"肆","五":"伍","六":"陆","七":"柒","八":"捌","九":"玖","十":"拾","百":"佰","千":"仟"};g=g.split("").map(t=>A[t]||t).join("")}return g},getExplorerInfo:function(){let A=navigator.userAgent.toLowerCase();return 0<=A.indexOf("msie")?{type:"IE",version:Number(A.match(/msie ([\d]+)/)[1])}:A.match(/trident\/.+?rv:(([\d.]+))/)?{type:"IE",version:11}:0<=A.indexOf("edge")?{type:"Edge",version:Number(A.match(/edge\/([\d]+)/)[1])}:0<=A.indexOf("firefox")?{type:"Firefox",version:Number(A.match(/firefox\/([\d]+)/)[1])}:0<=A.indexOf("chrome")?{type:"Chrome",version:Number(A.match(/chrome\/([\d]+)/)[1])}:0<=A.indexOf("opera")?{type:"Opera",version:Number(A.match(/opera.([\d]+)/)[1])}:0<=A.indexOf("Safari")?{type:"Safari",version:Number(A.match(/version\/([\d]+)/)[1])}:{type:A,version:-1}},exportFile:function(A,t){if(!A)return;"object"==typeof A&&(A=JSON.stringify(A));const r=new Blob([A],{type:"application/json;charset=utf-8"}),e=URL.createObjectURL(r),i=document.createElement("a");i.href=e,i.download=0==t.indexOf(".")?se()+t:t,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(e)}};window.Cesium||(window.Cesium={WebMapTileServiceImageryProvider:function(){}});class ne extends Cesium.WebMapTileServiceImageryProvider{constructor(A){super(A),f(this,I,0),f(this,o,[6,27,98]),p(this,I,A.alp||0),p(this,o,A.rgb||[6,27,98])}requestImage(A,t,r){return super.requestImage(A,t,r).then(A=>{if(!b(this,I))return A;const t=document.createElement("canvas");t.width=A.width,t.height=A.height;const r=t.getContext("2d");return r.translate(0,t.height),r.scale(1,-1),r.drawImage(A,0,0),r.globalCompositeOperation="source-atop",r.fillStyle=`rgba(${b(this,o)[0]},${b(this,o)[1]},${b(this,o)[2]}, ${b(this,I)})`,r.fillRect(0,0,t.width,t.height),r.globalCompositeOperation="source-over",r.stroke(),t})}}I=new WeakMap,o=new WeakMap;class Ve{constructor(A){f(this,E,null),f(this,C,null),f(this,W,null),f(this,q,null),S(this,"TianDiTuToken",""),S(this,"loadTdtYingXiang",(A={},t=[])=>{const r=b(this,q).viewer;var e={tdtyxType:"img_w",...A},i=new ne({rgb:t,alp:t[3],url:`http://t{s}.tianditu.gov.cn/${e.tdtyxType}/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&format=tiles&tk=${this.TianDiTuToken}`,subdomains:["0","1","2","3","4","5","6","7"],show:!0,maximumLevel:18,minimumLevel:0,screenSpaceError:16,styels:[{stylers:[{hue:"#fc0505ff"},{saturation:-20}]}]}),s=r.imageryLayers.addImageryProvider(i);return r.imageryLayers.lowerToBottom(s),{entity:s,remove(){r.imageryLayers.remove(s)}}}),S(this,"loadTdtZhuJi",(A={},t=[])=>{const r=b(this,q).viewer;var e={maximumLevel:18,...A},i=new ne({rgb:t,alp:t[3],url:`https://t{s}.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={TileCol}&TILEROW={TileRow}&TILEMATRIX={TileMatrix}&tk=${this.TianDiTuToken}`,subdomains:["0","1","2","3","4","5","6","7"],minimumLevel:0,maximumLevel:e.maximumLevel,show:!0}),s=r.imageryLayers.addImageryProvider(i);return r.imageryLayers.raiseToTop(s),{entity:s,remove(){r.imageryLayers.remove(s)}}}),S(this,"setImageLayerFilter",(A={},t=0)=>{var r={invertColor:!0,alpha:1,dayAlpha:1,nightAlpha:1,brightness:1,contrast:1,hue:50,saturation:1,gamma:1,...A},e=b(this,q).viewer.imageryLayers.get(t);e.invertColor=r.invertColor,e.alpha=r.alpha,e.dayAlpha=r.dayAlpha,e.nightAlpha=r.nightAlpha,e.brightness=r.brightness,e.contrast=r.contrast,e.hue=r.hue,e.saturation=r.saturation,e.gamma=r.gamma}),p(this,q,A),this.TianDiTuToken=A.TianDiTuToken,this.showTdtYX=!0,this.showTdtLW=!0}set showTdtYX(A){A?b(this,E)||p(this,E,this.loadTdtYingXiang()):(b(this,E)&&b(this,E).remove(),p(this,E,null))}set showTdtLW(A){A?b(this,C)||p(this,C,this.loadTdtLuWang()):(b(this,C)&&b(this,C).remove(),p(this,C,null))}set showTdtZJ(A){A?b(this,W)||p(this,W,this.loadTdtZhuJi()):(b(this,W)&&b(this,W).remove(),p(this,W,null))}loadTdtLuWang(A={},t=[]){const r=b(this,q).viewer;var e={maximumLevel:18,show:!0,...A},i=new ne({rgb:t,alp:t[3],url:`http://t{s}.tianditu.gov.cn/cia_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cia&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default.jpg&tk=${this.TianDiTuToken}`,subdomains:["0","1","2","3","4","5","6","7"],maximumLevel:e.maximumLevel,show:e.show}),s=r.imageryLayers.addImageryProvider(i);return r.imageryLayers.raiseToTop(s),{entity:s,remove(){r.imageryLayers.remove(s)}}}}E=new WeakMap,C=new WeakMap,W=new WeakMap,q=new WeakMap;const Ie=Symbol(),oe="el",Ee=(A,t,r,e,i)=>{let s=`${A}-${t}`;return r&&(s+=`-${r}`),e&&(s+=`__${e}`),i&&(s+=`--${i}`),s},Ce=Symbol("namespaceContextKey"),We=(A,r)=>{const e=(A=>{const r=A||(t.getCurrentInstance()?t.inject(Ce,t.ref(oe)):t.ref(oe));return t.computed(()=>t.unref(r)||oe)})(r);return{namespace:e,b:(t="")=>Ee(e.value,A,t,"",""),e:t=>t?Ee(e.value,A,"",t,""):"",m:t=>t?Ee(e.value,A,"","",t):"",be:(t,r)=>t&&r?Ee(e.value,A,t,r,""):"",em:(t,r)=>t&&r?Ee(e.value,A,"",t,r):"",bm:(t,r)=>t&&r?Ee(e.value,A,t,"",r):"",bem:(t,r,i)=>t&&r&&i?Ee(e.value,A,t,r,i):"",is:(A,...t)=>{const r=!(t.length>=1)||t[0];return A&&r?`is-${A}`:""},cssVar:A=>{const t={};for(const r in A)A[r]&&(t[`--${e.value}-${r}`]=A[r]);return t},cssVarName:A=>`--${e.value}-${A}`,cssVarBlock:t=>{const r={};for(const i in t)t[i]&&(r[`--${e.value}-${A}-${i}`]=t[i]);return r},cssVarBlockName:t=>`--${e.value}-${A}-${t}`}};
|
|
34
34
|
/**
|
|
35
35
|
* @vue/shared v3.5.13
|
|
36
36
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|