fhj-tools-v3 1.1.109 → 1.1.111
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 +54 -32
- 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 g=A.toString(16);return g.length%2==1&&(g="0"+g),g},this.bigIntToMinTwosComplementsHex=function(A){var g=A.toString(16);if("-"!=g.substr(0,1))g.length%2==1?g="0"+g:g.match(/^[0-7]/)||(g="00"+g);else{var I=g.substr(1).length;I%2==1?I+=1:g.match(/^[0-7]/)||(I+=2);for(var B="",C=0;C<I;C++)B+="f";g=new BigInteger(B,16).xor(A).add(BigInteger.ONE).toString(16).replace(/^-/,"")}return g},this.getPEMStringFromHex=function(A,g){return hextopem(A,g)},this.newObject=function(A){var g=KJUR.asn1,I=g.DERBoolean,B=g.DERInteger,C=g.DERBitString,E=g.DEROctetString,Q=g.DERNull,t=g.DERObjectIdentifier,i=g.DEREnumerated,s=g.DERUTF8String,k=g.DERNumericString,r=g.DERPrintableString,Y=g.DERTeletexString,S=g.DERIA5String,J=g.DERUTCTime,G=g.DERGeneralizedTime,a=g.DERSequence,w=g.DERSet,e=g.DERTaggedObject,M=g.ASN1Util.newObject,o=Object.keys(A);if(1!=o.length)throw"key of param shall be only one.";var h=o[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+h+":"))throw"undefined key: "+h;if("bool"==h)return new I(A[h]);if("int"==h)return new B(A[h]);if("bitstr"==h)return new C(A[h]);if("octstr"==h)return new E(A[h]);if("null"==h)return new Q(A[h]);if("oid"==h)return new t(A[h]);if("enum"==h)return new i(A[h]);if("utf8str"==h)return new s(A[h]);if("numstr"==h)return new k(A[h]);if("prnstr"==h)return new r(A[h]);if("telstr"==h)return new Y(A[h]);if("ia5str"==h)return new S(A[h]);if("utctime"==h)return new J(A[h]);if("gentime"==h)return new G(A[h]);if("seq"==h){for(var W=A[h],D=[],l=0;l<W.length;l++){var R=M(W[l]);D.push(R)}return new a({array:D})}if("set"==h){for(W=A[h],D=[],l=0;l<W.length;l++){R=M(W[l]);D.push(R)}return new w({array:D})}if("tag"==h){var V=A[h];if("[object Array]"===Object.prototype.toString.call(V)&&3==V.length){var K=M(V[2]);return new e({tag:V[0],explicit:V[1],obj:K})}var F={};if(void 0!==V.explicit&&(F.explicit=V.explicit),void 0!==V.tag&&(F.tag=V.tag),void 0===V.obj)throw"obj shall be specified for 'tag'.";return F.obj=M(V.obj),new e(F)}},this.jsonToASN1HEX=function(A){return this.newObject(A).getEncodedHex()}},KJUR.asn1.ASN1Util.oidHexToInt=function(A){for(var g="",I=parseInt(A.substr(0,2),16),B=(g=Math.floor(I/40)+"."+I%40,""),C=2;C<A.length;C+=2){var E=("00000000"+parseInt(A.substr(C,2),16).toString(2)).slice(-8);if(B+=E.substr(1,7),"0"==E.substr(0,1))g=g+"."+new BigInteger(B,2).toString(10),B=""}return g},KJUR.asn1.ASN1Util.oidIntToHex=function(A){var g=function(A){var g=A.toString(16);return 1==g.length&&(g="0"+g),g},I=function(A){var I="",B=new BigInteger(A,10).toString(2),C=7-B.length%7;7==C&&(C=0);for(var E="",Q=0;Q<C;Q++)E+="0";B=E+B;for(Q=0;Q<B.length-1;Q+=7){var t=B.substr(Q,7);Q!=B.length-7&&(t="1"+t),I+=g(parseInt(t,2))}return I};if(!A.match(/^[0-9.]+$/))throw"malformed oid string: "+A;var B="",C=A.split("."),E=40*parseInt(C[0])+parseInt(C[1]);B+=g(E),C.splice(0,2);for(var Q=0;Q<C.length;Q++)B+=I(C[Q]);return B},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,g=A.toString(16);if(g.length%2==1&&(g="0"+g),A<128)return g;var I=g.length/2;if(I>15)throw"ASN.1 length too long to represent by 8x: n = "+A.toString(16);return(128+I).toString(16)+g},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,g,I){var B=this.zeroPadding,C=this.localDateToUTC(A),E=String(C.getFullYear());"utc"==g&&(E=E.substr(2,2));var Q=E+B(String(C.getMonth()+1),2)+B(String(C.getDate()),2)+B(String(C.getHours()),2)+B(String(C.getMinutes()),2)+B(String(C.getSeconds()),2);if(!0===I){var t=C.getMilliseconds();if(0!=t){var i=B(String(t),3);Q=Q+"."+(i=i.replace(/[0]+$/,""))}}return Q+"Z"},this.zeroPadding=function(A,g){return A.length>=g?A:new Array(g-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,g,I,B,C,E){var Q=new Date(Date.UTC(A,g-1,I,B,C,E,0));this.setByDate(Q)},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 g=new BigInteger(String(A),10);this.setByBigInteger(g)},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 g=KJUR.asn1.ASN1Util.newObject(A.obj);A.hex="00"+g.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,g){if(A<0||7<A)throw"unused bits shall be from 0 to 7: u = "+A;var I="0"+A;this.hTLV=null,this.isModified=!0,this.hV=I+g},this.setByBinaryString=function(A){var g=8-(A=A.replace(/0+$/,"")).length%8;8==g&&(g=0);for(var I=0;I<=g;I++)A+="0";var B="";for(I=0;I<A.length-1;I+=8){var C=A.substr(I,8),E=parseInt(C,2).toString(16);1==E.length&&(E="0"+E),B+=E}this.hTLV=null,this.isModified=!0,this.hV="0"+g+B},this.setByBooleanArray=function(A){for(var g="",I=0;I<A.length;I++)1==A[I]?g+="1":g+="0";this.setByBinaryString(g)},this.newFalseArray=function(A){for(var g=new Array(A),I=0;I<A;I++)g[I]=!1;return g},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 g=KJUR.asn1.ASN1Util.newObject(A.obj);A.hex=g.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 g=function(A){var g=A.toString(16);return 1==g.length&&(g="0"+g),g},I=function(A){var I="",B=new BigInteger(A,10).toString(2),C=7-B.length%7;7==C&&(C=0);for(var E="",Q=0;Q<C;Q++)E+="0";B=E+B;for(Q=0;Q<B.length-1;Q+=7){var t=B.substr(Q,7);Q!=B.length-7&&(t="1"+t),I+=g(parseInt(t,2))}return I};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 B="",C=A.split("."),E=40*parseInt(C[0])+parseInt(C[1]);B+=g(E),C.splice(0,2);for(var Q=0;Q<C.length;Q++)B+=I(C[Q]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=B},this.setValueName=function(A){var g=KJUR.asn1.x509.OID.name2oid(A);if(""===g)throw"DERObjectIdentifier oidName undefined: "+A;this.setValueOidString(g)},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 g=new BigInteger(String(A),10);this.setByBigInteger(g)},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="",g=0;g<this.asn1Array.length;g++){A+=this.asn1Array[g].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,g=0;g<this.asn1Array.length;g++){var I=this.asn1Array[g];A.push(I.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,g,I){this.hT=g,this.isExplicit=A,this.asn1Object=I,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=I.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,g),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(g,I){return(A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,g){A.__proto__=g}||function(A,g){for(var I in g)Object.prototype.hasOwnProperty.call(g,I)&&(A[I]=g[I])})(g,I)};return function(g,I){if("function"!=typeof I&&null!==I)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function B(){this.constructor=g}A(g,I),g.prototype=null===I?Object.create(I):(B.prototype=I.prototype,new B)}}(),JSEncryptRSAKey=function(A){function g(I){var B=A.call(this)||this;return I&&("string"==typeof I?B.parseKey(I):(g.hasPrivateKeyProperty(I)||g.hasPublicKeyProperty(I))&&B.parsePropertiesFrom(I)),B}return __extends(g,A),g.prototype.parseKey=function(A){try{var g=0,I=0,B=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(A)?Hex_decode(A):Base64.unarmor(A),C=ASN1.decode(B);if(3===C.sub.length&&(C=C.sub[2].sub[0]),9===C.sub.length){g=C.sub[1].getHexStringValue(),this.n=parseBigInt(g,16),I=C.sub[2].getHexStringValue(),this.e=parseInt(I,16);var E=C.sub[3].getHexStringValue();this.d=parseBigInt(E,16);var Q=C.sub[4].getHexStringValue();this.p=parseBigInt(Q,16);var t=C.sub[5].getHexStringValue();this.q=parseBigInt(t,16);var i=C.sub[6].getHexStringValue();this.dmp1=parseBigInt(i,16);var s=C.sub[7].getHexStringValue();this.dmq1=parseBigInt(s,16);var k=C.sub[8].getHexStringValue();this.coeff=parseBigInt(k,16)}else{if(2!==C.sub.length)return!1;if(C.sub[0].sub){var r=C.sub[1].sub[0];g=r.sub[0].getHexStringValue(),this.n=parseBigInt(g,16),I=r.sub[1].getHexStringValue(),this.e=parseInt(I,16)}else g=C.sub[0].getHexStringValue(),this.n=parseBigInt(g,16),I=C.sub[1].getHexStringValue(),this.e=parseInt(I,16)}return!0}catch(Y){return!1}},g.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()},g.prototype.getPrivateBaseKeyB64=function(){return hex2b64(this.getPrivateBaseKey())},g.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]}),g=new KJUR.asn1.DERSequence({array:[new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({int:this.e})]}),I=new KJUR.asn1.DERBitString({hex:"00"+g.getEncodedHex()});return new KJUR.asn1.DERSequence({array:[A,I]}).getEncodedHex()},g.prototype.getPublicBaseKeyB64=function(){return hex2b64(this.getPublicBaseKey())},g.wordwrap=function(A,g){if(!A)return A;var I="(.{1,"+(g=g||64)+"})( +|$\n?)|(.{1,"+g+"})";return A.match(RegExp(I,"g")).join("\n")},g.prototype.getPrivateKey=function(){var A="-----BEGIN RSA PRIVATE KEY-----\n";return A+=g.wordwrap(this.getPrivateBaseKeyB64())+"\n",A+="-----END RSA PRIVATE KEY-----"},g.prototype.getPublicKey=function(){var A="-----BEGIN PUBLIC KEY-----\n";return A+=g.wordwrap(this.getPublicBaseKeyB64())+"\n",A+="-----END PUBLIC KEY-----"},g.hasPublicKeyProperty=function(A){return(A=A||{}).hasOwnProperty("n")&&A.hasOwnProperty("e")},g.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")},g.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)},g}(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(g){return!1}},A.prototype.encrypt=function(A){try{return hex2b64(this.getKey().encrypt(A))}catch(g){return!1}},A.prototype.sign=function(A,g,I){try{return hex2b64(this.getKey().sign(A,g,I))}catch(B){return!1}},A.prototype.verify=function(A,g,I){try{return this.getKey().verify(A,b64tohex(g),I)}catch(B){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 g;function I(A,g,I){null!=A&&("number"==typeof A?this.fromNumber(A,g,I):null==g&&"string"!=typeof A?this.fromString(A,256):this.fromString(A,g))}function B(){return new I(null)}var C="undefined"!=typeof navigator;C&&"Microsoft Internet Explorer"==navigator.appName?(I.prototype.am=function(A,g,I,B,C,E){for(var Q=32767&g,t=g>>15;--E>=0;){var i=32767&this[A],s=this[A++]>>15,k=t*i+s*Q;C=((i=Q*i+((32767&k)<<15)+I[B]+(1073741823&C))>>>30)+(k>>>15)+t*s+(C>>>30),I[B++]=1073741823&i}return C},g=30):C&&"Netscape"!=navigator.appName?(I.prototype.am=function(A,g,I,B,C,E){for(;--E>=0;){var Q=g*this[A++]+I[B]+C;C=Math.floor(Q/67108864),I[B++]=67108863&Q}return C},g=26):(I.prototype.am=function(A,g,I,B,C,E){for(var Q=16383&g,t=g>>14;--E>=0;){var i=16383&this[A],s=this[A++]>>14,k=t*i+s*Q;C=((i=Q*i+((16383&k)<<14)+I[B]+C)>>28)+(k>>14)+t*s,I[B++]=268435455&i}return C},g=28),I.prototype.DB=g,I.prototype.DM=(1<<g)-1,I.prototype.DV=1<<g,I.prototype.FV=Math.pow(2,52),I.prototype.F1=52-g,I.prototype.F2=2*g-52;var E,Q,t=new Array;for(E="0".charCodeAt(0),Q=0;Q<=9;++Q)t[E++]=Q;for(E="a".charCodeAt(0),Q=10;Q<36;++Q)t[E++]=Q;for(E="A".charCodeAt(0),Q=10;Q<36;++Q)t[E++]=Q;function i(A){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(A)}function s(A,g){var I=t[A.charCodeAt(g)];return null==I?-1:I}function k(A){var g=B();return g.fromInt(A),g}function r(A){var g,I=1;return 0!=(g=A>>>16)&&(A=g,I+=16),0!=(g=A>>8)&&(A=g,I+=8),0!=(g=A>>4)&&(A=g,I+=4),0!=(g=A>>2)&&(A=g,I+=2),0!=(g=A>>1)&&(A=g,I+=1),I}function Y(A){this.m=A}function S(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 J(A,g){return A&g}function G(A,g){return A|g}function a(A,g){return A^g}function w(A,g){return A&~g}function e(A){if(0==A)return-1;var g=0;return 65535&A||(A>>=16,g+=16),255&A||(A>>=8,g+=8),15&A||(A>>=4,g+=4),3&A||(A>>=2,g+=2),1&A||++g,g}function M(A){for(var g=0;0!=A;)A&=A-1,++g;return g}function o(){}function h(A){return A}function W(A){this.r2=B(),this.q3=B(),I.ONE.dlShiftTo(2*A.t,this.r2),this.mu=this.r2.divide(A),this.m=A}Y.prototype.convert=function(A){return A.s<0||A.compareTo(this.m)>=0?A.mod(this.m):A},Y.prototype.revert=function(A){return A},Y.prototype.reduce=function(A){A.divRemTo(this.m,null,A)},Y.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I),this.reduce(I)},Y.prototype.sqrTo=function(A,g){A.squareTo(g),this.reduce(g)},S.prototype.convert=function(A){var g=B();return A.abs().dlShiftTo(this.m.t,g),g.divRemTo(this.m,null,g),A.s<0&&g.compareTo(I.ZERO)>0&&this.m.subTo(g,g),g},S.prototype.revert=function(A){var g=B();return A.copyTo(g),this.reduce(g),g},S.prototype.reduce=function(A){for(;A.t<=this.mt2;)A[A.t++]=0;for(var g=0;g<this.m.t;++g){var I=32767&A[g],B=I*this.mpl+((I*this.mph+(A[g]>>15)*this.mpl&this.um)<<15)&A.DM;for(A[I=g+this.m.t]+=this.m.am(0,B,A,g,0,this.m.t);A[I]>=A.DV;)A[I]-=A.DV,A[++I]++}A.clamp(),A.drShiftTo(this.m.t,A),A.compareTo(this.m)>=0&&A.subTo(this.m,A)},S.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I),this.reduce(I)},S.prototype.sqrTo=function(A,g){A.squareTo(g),this.reduce(g)},I.prototype.copyTo=function(A){for(var g=this.t-1;g>=0;--g)A[g]=this[g];A.t=this.t,A.s=this.s},I.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},I.prototype.fromString=function(A,g){var B;if(16==g)B=4;else if(8==g)B=3;else if(256==g)B=8;else if(2==g)B=1;else if(32==g)B=5;else{if(4!=g)return void this.fromRadix(A,g);B=2}this.t=0,this.s=0;for(var C=A.length,E=!1,Q=0;--C>=0;){var t=8==B?255&A[C]:s(A,C);t<0?"-"==A.charAt(C)&&(E=!0):(E=!1,0==Q?this[this.t++]=t:Q+B>this.DB?(this[this.t-1]|=(t&(1<<this.DB-Q)-1)<<Q,this[this.t++]=t>>this.DB-Q):this[this.t-1]|=t<<Q,(Q+=B)>=this.DB&&(Q-=this.DB))}8==B&&128&A[0]&&(this.s=-1,Q>0&&(this[this.t-1]|=(1<<this.DB-Q)-1<<Q)),this.clamp(),E&&I.ZERO.subTo(this,this)},I.prototype.clamp=function(){for(var A=this.s&this.DM;this.t>0&&this[this.t-1]==A;)--this.t},I.prototype.dlShiftTo=function(A,g){var I;for(I=this.t-1;I>=0;--I)g[I+A]=this[I];for(I=A-1;I>=0;--I)g[I]=0;g.t=this.t+A,g.s=this.s},I.prototype.drShiftTo=function(A,g){for(var I=A;I<this.t;++I)g[I-A]=this[I];g.t=Math.max(this.t-A,0),g.s=this.s},I.prototype.lShiftTo=function(A,g){var I,B=A%this.DB,C=this.DB-B,E=(1<<C)-1,Q=Math.floor(A/this.DB),t=this.s<<B&this.DM;for(I=this.t-1;I>=0;--I)g[I+Q+1]=this[I]>>C|t,t=(this[I]&E)<<B;for(I=Q-1;I>=0;--I)g[I]=0;g[Q]=t,g.t=this.t+Q+1,g.s=this.s,g.clamp()},I.prototype.rShiftTo=function(A,g){g.s=this.s;var I=Math.floor(A/this.DB);if(I>=this.t)g.t=0;else{var B=A%this.DB,C=this.DB-B,E=(1<<B)-1;g[0]=this[I]>>B;for(var Q=I+1;Q<this.t;++Q)g[Q-I-1]|=(this[Q]&E)<<C,g[Q-I]=this[Q]>>B;B>0&&(g[this.t-I-1]|=(this.s&E)<<C),g.t=this.t-I,g.clamp()}},I.prototype.subTo=function(A,g){for(var I=0,B=0,C=Math.min(A.t,this.t);I<C;)B+=this[I]-A[I],g[I++]=B&this.DM,B>>=this.DB;if(A.t<this.t){for(B-=A.s;I<this.t;)B+=this[I],g[I++]=B&this.DM,B>>=this.DB;B+=this.s}else{for(B+=this.s;I<A.t;)B-=A[I],g[I++]=B&this.DM,B>>=this.DB;B-=A.s}g.s=B<0?-1:0,B<-1?g[I++]=this.DV+B:B>0&&(g[I++]=B),g.t=I,g.clamp()},I.prototype.multiplyTo=function(A,g){var B=this.abs(),C=A.abs(),E=B.t;for(g.t=E+C.t;--E>=0;)g[E]=0;for(E=0;E<C.t;++E)g[E+B.t]=B.am(0,C[E],g,E,0,B.t);g.s=0,g.clamp(),this.s!=A.s&&I.ZERO.subTo(g,g)},I.prototype.squareTo=function(A){for(var g=this.abs(),I=A.t=2*g.t;--I>=0;)A[I]=0;for(I=0;I<g.t-1;++I){var B=g.am(I,g[I],A,2*I,0,1);(A[I+g.t]+=g.am(I+1,2*g[I],A,2*I+1,B,g.t-I-1))>=g.DV&&(A[I+g.t]-=g.DV,A[I+g.t+1]=1)}A.t>0&&(A[A.t-1]+=g.am(I,g[I],A,2*I,0,1)),A.s=0,A.clamp()},I.prototype.divRemTo=function(A,g,C){var E=A.abs();if(!(E.t<=0)){var Q=this.abs();if(Q.t<E.t)return null!=g&&g.fromInt(0),void(null!=C&&this.copyTo(C));null==C&&(C=B());var t=B(),i=this.s,s=A.s,k=this.DB-r(E[E.t-1]);k>0?(E.lShiftTo(k,t),Q.lShiftTo(k,C)):(E.copyTo(t),Q.copyTo(C));var Y=t.t,S=t[Y-1];if(0!=S){var J=S*(1<<this.F1)+(Y>1?t[Y-2]>>this.F2:0),G=this.FV/J,a=(1<<this.F1)/J,w=1<<this.F2,e=C.t,M=e-Y,o=null==g?B():g;for(t.dlShiftTo(M,o),C.compareTo(o)>=0&&(C[C.t++]=1,C.subTo(o,C)),I.ONE.dlShiftTo(Y,o),o.subTo(t,t);t.t<Y;)t[t.t++]=0;for(;--M>=0;){var h=C[--e]==S?this.DM:Math.floor(C[e]*G+(C[e-1]+w)*a);if((C[e]+=t.am(0,h,C,M,0,Y))<h)for(t.dlShiftTo(M,o),C.subTo(o,C);C[e]<--h;)C.subTo(o,C)}null!=g&&(C.drShiftTo(Y,g),i!=s&&I.ZERO.subTo(g,g)),C.t=Y,C.clamp(),k>0&&C.rShiftTo(k,C),i<0&&I.ZERO.subTo(C,C)}}},I.prototype.invDigit=function(){if(this.t<1)return 0;var A=this[0];if(!(1&A))return 0;var g=3&A;return(g=(g=(g=(g=g*(2-(15&A)*g)&15)*(2-(255&A)*g)&255)*(2-((65535&A)*g&65535))&65535)*(2-A*g%this.DV)%this.DV)>0?this.DV-g:-g},I.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},I.prototype.exp=function(A,g){if(A>4294967295||A<1)return I.ONE;var C=B(),E=B(),Q=g.convert(this),t=r(A)-1;for(Q.copyTo(C);--t>=0;)if(g.sqrTo(C,E),(A&1<<t)>0)g.mulTo(E,Q,C);else{var i=C;C=E,E=i}return g.revert(C)},I.prototype.toString=function(A){if(this.s<0)return"-"+this.negate().toString(A);var g;if(16==A)g=4;else if(8==A)g=3;else if(2==A)g=1;else if(32==A)g=5;else{if(4!=A)return this.toRadix(A);g=2}var I,B=(1<<g)-1,C=!1,E="",Q=this.t,t=this.DB-Q*this.DB%g;if(Q-- >0)for(t<this.DB&&(I=this[Q]>>t)>0&&(C=!0,E=i(I));Q>=0;)t<g?(I=(this[Q]&(1<<t)-1)<<g-t,I|=this[--Q]>>(t+=this.DB-g)):(I=this[Q]>>(t-=g)&B,t<=0&&(t+=this.DB,--Q)),I>0&&(C=!0),C&&(E+=i(I));return C?E:"0"},I.prototype.negate=function(){var A=B();return I.ZERO.subTo(this,A),A},I.prototype.abs=function(){return this.s<0?this.negate():this},I.prototype.compareTo=function(A){var g=this.s-A.s;if(0!=g)return g;var I=this.t;if(0!=(g=I-A.t))return this.s<0?-g:g;for(;--I>=0;)if(0!=(g=this[I]-A[I]))return g;return 0},I.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+r(this[this.t-1]^this.s&this.DM)},I.prototype.mod=function(A){var g=B();return this.abs().divRemTo(A,null,g),this.s<0&&g.compareTo(I.ZERO)>0&&A.subTo(g,g),g},I.prototype.modPowInt=function(A,g){var I;return I=A<256||g.isEven()?new Y(g):new S(g),this.exp(A,I)},I.ZERO=k(0),I.ONE=k(1),o.prototype.convert=h,o.prototype.revert=h,o.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I)},o.prototype.sqrTo=function(A,g){A.squareTo(g)},W.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 g=B();return A.copyTo(g),this.reduce(g),g},W.prototype.revert=function(A){return A},W.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)},W.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I),this.reduce(I)},W.prototype.sqrTo=function(A,g){A.squareTo(g),this.reduce(g)};var D,l,R,V=[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],K=(1<<26)/V[V.length-1];function F(){var A;A=(new Date).getTime(),l[R++]^=255&A,l[R++]^=A>>8&255,l[R++]^=A>>16&255,l[R++]^=A>>24&255,R>=Z&&(R-=Z)}if(I.prototype.chunkSize=function(A){return Math.floor(Math.LN2*this.DB/Math.log(A))},I.prototype.toRadix=function(A){if(null==A&&(A=10),0==this.signum()||A<2||A>36)return"0";var g=this.chunkSize(A),I=Math.pow(A,g),C=k(I),E=B(),Q=B(),t="";for(this.divRemTo(C,E,Q);E.signum()>0;)t=(I+Q.intValue()).toString(A).substr(1)+t,E.divRemTo(C,E,Q);return Q.intValue().toString(A)+t},I.prototype.fromRadix=function(A,g){this.fromInt(0),null==g&&(g=10);for(var B=this.chunkSize(g),C=Math.pow(g,B),E=!1,Q=0,t=0,i=0;i<A.length;++i){var k=s(A,i);k<0?"-"==A.charAt(i)&&0==this.signum()&&(E=!0):(t=g*t+k,++Q>=B&&(this.dMultiply(C),this.dAddOffset(t,0),Q=0,t=0))}Q>0&&(this.dMultiply(Math.pow(g,Q)),this.dAddOffset(t,0)),E&&I.ZERO.subTo(this,this)},I.prototype.fromNumber=function(A,g,B){if("number"==typeof g)if(A<2)this.fromInt(1);else for(this.fromNumber(A,B),this.testBit(A-1)||this.bitwiseTo(I.ONE.shiftLeft(A-1),G,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(g);)this.dAddOffset(2,0),this.bitLength()>A&&this.subTo(I.ONE.shiftLeft(A-1),this);else{var C=new Array,E=7&A;C.length=1+(A>>3),g.nextBytes(C),E>0?C[0]&=(1<<E)-1:C[0]=0,this.fromString(C,256)}},I.prototype.bitwiseTo=function(A,g,I){var B,C,E=Math.min(A.t,this.t);for(B=0;B<E;++B)I[B]=g(this[B],A[B]);if(A.t<this.t){for(C=A.s&this.DM,B=E;B<this.t;++B)I[B]=g(this[B],C);I.t=this.t}else{for(C=this.s&this.DM,B=E;B<A.t;++B)I[B]=g(C,A[B]);I.t=A.t}I.s=g(this.s,A.s),I.clamp()},I.prototype.changeBit=function(A,g){var B=I.ONE.shiftLeft(A);return this.bitwiseTo(B,g,B),B},I.prototype.addTo=function(A,g){for(var I=0,B=0,C=Math.min(A.t,this.t);I<C;)B+=this[I]+A[I],g[I++]=B&this.DM,B>>=this.DB;if(A.t<this.t){for(B+=A.s;I<this.t;)B+=this[I],g[I++]=B&this.DM,B>>=this.DB;B+=this.s}else{for(B+=this.s;I<A.t;)B+=A[I],g[I++]=B&this.DM,B>>=this.DB;B+=A.s}g.s=B<0?-1:0,B>0?g[I++]=B:B<-1&&(g[I++]=this.DV+B),g.t=I,g.clamp()},I.prototype.dMultiply=function(A){this[this.t]=this.am(0,A-1,this,0,0,this.t),++this.t,this.clamp()},I.prototype.dAddOffset=function(A,g){if(0!=A){for(;this.t<=g;)this[this.t++]=0;for(this[g]+=A;this[g]>=this.DV;)this[g]-=this.DV,++g>=this.t&&(this[this.t++]=0),++this[g]}},I.prototype.multiplyLowerTo=function(A,g,I){var B,C=Math.min(this.t+A.t,g);for(I.s=0,I.t=C;C>0;)I[--C]=0;for(B=I.t-this.t;C<B;++C)I[C+this.t]=this.am(0,A[C],I,C,0,this.t);for(B=Math.min(A.t,g);C<B;++C)this.am(0,A[C],I,C,0,g-C);I.clamp()},I.prototype.multiplyUpperTo=function(A,g,I){--g;var B=I.t=this.t+A.t-g;for(I.s=0;--B>=0;)I[B]=0;for(B=Math.max(g-this.t,0);B<A.t;++B)I[this.t+B-g]=this.am(g-B,A[B],I,0,0,this.t+B-g);I.clamp(),I.drShiftTo(1,I)},I.prototype.modInt=function(A){if(A<=0)return 0;var g=this.DV%A,I=this.s<0?A-1:0;if(this.t>0)if(0==g)I=this[0]%A;else for(var B=this.t-1;B>=0;--B)I=(g*I+this[B])%A;return I},I.prototype.millerRabin=function(A){var g=this.subtract(I.ONE),C=g.getLowestSetBit();if(C<=0)return!1;var E=g.shiftRight(C);(A=A+1>>1)>V.length&&(A=V.length);for(var Q=B(),t=0;t<A;++t){Q.fromInt(V[Math.floor(Math.random()*V.length)]);var i=Q.modPow(E,this);if(0!=i.compareTo(I.ONE)&&0!=i.compareTo(g)){for(var s=1;s++<C&&0!=i.compareTo(g);)if(0==(i=i.modPowInt(2,this)).compareTo(I.ONE))return!1;if(0!=i.compareTo(g))return!1}}return!0},I.prototype.clone=function(){var A=B();return this.copyTo(A),A},I.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]},I.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},I.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},I.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},I.prototype.toByteArray=function(){var A=this.t,g=new Array;g[0]=this.s;var I,B=this.DB-A*this.DB%8,C=0;if(A-- >0)for(B<this.DB&&(I=this[A]>>B)!=(this.s&this.DM)>>B&&(g[C++]=I|this.s<<this.DB-B);A>=0;)B<8?(I=(this[A]&(1<<B)-1)<<8-B,I|=this[--A]>>(B+=this.DB-8)):(I=this[A]>>(B-=8)&255,B<=0&&(B+=this.DB,--A)),128&I&&(I|=-256),0==C&&(128&this.s)!=(128&I)&&++C,(C>0||I!=this.s)&&(g[C++]=I);return g},I.prototype.equals=function(A){return 0==this.compareTo(A)},I.prototype.min=function(A){return this.compareTo(A)<0?this:A},I.prototype.max=function(A){return this.compareTo(A)>0?this:A},I.prototype.and=function(A){var g=B();return this.bitwiseTo(A,J,g),g},I.prototype.or=function(A){var g=B();return this.bitwiseTo(A,G,g),g},I.prototype.xor=function(A){var g=B();return this.bitwiseTo(A,a,g),g},I.prototype.andNot=function(A){var g=B();return this.bitwiseTo(A,w,g),g},I.prototype.not=function(){for(var A=B(),g=0;g<this.t;++g)A[g]=this.DM&~this[g];return A.t=this.t,A.s=~this.s,A},I.prototype.shiftLeft=function(A){var g=B();return A<0?this.rShiftTo(-A,g):this.lShiftTo(A,g),g},I.prototype.shiftRight=function(A){var g=B();return A<0?this.lShiftTo(-A,g):this.rShiftTo(A,g),g},I.prototype.getLowestSetBit=function(){for(var A=0;A<this.t;++A)if(0!=this[A])return A*this.DB+e(this[A]);return this.s<0?this.t*this.DB:-1},I.prototype.bitCount=function(){for(var A=0,g=this.s&this.DM,I=0;I<this.t;++I)A+=M(this[I]^g);return A},I.prototype.testBit=function(A){var g=Math.floor(A/this.DB);return g>=this.t?0!=this.s:!!(this[g]&1<<A%this.DB)},I.prototype.setBit=function(A){return this.changeBit(A,G)},I.prototype.clearBit=function(A){return this.changeBit(A,w)},I.prototype.flipBit=function(A){return this.changeBit(A,a)},I.prototype.add=function(A){var g=B();return this.addTo(A,g),g},I.prototype.subtract=function(A){var g=B();return this.subTo(A,g),g},I.prototype.multiply=function(A){var g=B();return this.multiplyTo(A,g),g},I.prototype.divide=function(A){var g=B();return this.divRemTo(A,g,null),g},I.prototype.remainder=function(A){var g=B();return this.divRemTo(A,null,g),g},I.prototype.divideAndRemainder=function(A){var g=B(),I=B();return this.divRemTo(A,g,I),new Array(g,I)},I.prototype.modPow=function(A,g){var I,C,E=A.bitLength(),Q=k(1);if(E<=0)return Q;I=E<18?1:E<48?3:E<144?4:E<768?5:6,C=E<8?new Y(g):g.isEven()?new W(g):new S(g);var t=new Array,i=3,s=I-1,J=(1<<I)-1;if(t[1]=C.convert(this),I>1){var G=B();for(C.sqrTo(t[1],G);i<=J;)t[i]=B(),C.mulTo(G,t[i-2],t[i]),i+=2}var a,w,e=A.t-1,M=!0,o=B();for(E=r(A[e])-1;e>=0;){for(E>=s?a=A[e]>>E-s&J:(a=(A[e]&(1<<E+1)-1)<<s-E,e>0&&(a|=A[e-1]>>this.DB+E-s)),i=I;!(1&a);)a>>=1,--i;if((E-=i)<0&&(E+=this.DB,--e),M)t[a].copyTo(Q),M=!1;else{for(;i>1;)C.sqrTo(Q,o),C.sqrTo(o,Q),i-=2;i>0?C.sqrTo(Q,o):(w=Q,Q=o,o=w),C.mulTo(o,t[a],Q)}for(;e>=0&&!(A[e]&1<<E);)C.sqrTo(Q,o),w=Q,Q=o,o=w,--E<0&&(E=this.DB-1,--e)}return C.revert(Q)},I.prototype.modInverse=function(A){var g=A.isEven();if(this.isEven()&&g||0==A.signum())return I.ZERO;for(var B=A.clone(),C=this.clone(),E=k(1),Q=k(0),t=k(0),i=k(1);0!=B.signum();){for(;B.isEven();)B.rShiftTo(1,B),g?(E.isEven()&&Q.isEven()||(E.addTo(this,E),Q.subTo(A,Q)),E.rShiftTo(1,E)):Q.isEven()||Q.subTo(A,Q),Q.rShiftTo(1,Q);for(;C.isEven();)C.rShiftTo(1,C),g?(t.isEven()&&i.isEven()||(t.addTo(this,t),i.subTo(A,i)),t.rShiftTo(1,t)):i.isEven()||i.subTo(A,i),i.rShiftTo(1,i);B.compareTo(C)>=0?(B.subTo(C,B),g&&E.subTo(t,E),Q.subTo(i,Q)):(C.subTo(B,C),g&&t.subTo(E,t),i.subTo(Q,i))}return 0!=C.compareTo(I.ONE)?I.ZERO:i.compareTo(A)>=0?i.subtract(A):i.signum()<0?(i.addTo(A,i),i.signum()<0?i.add(A):i):i},I.prototype.pow=function(A){return this.exp(A,new o)},I.prototype.gcd=function(A){var g=this.s<0?this.negate():this.clone(),I=A.s<0?A.negate():A.clone();if(g.compareTo(I)<0){var B=g;g=I,I=B}var C=g.getLowestSetBit(),E=I.getLowestSetBit();if(E<0)return g;for(C<E&&(E=C),E>0&&(g.rShiftTo(E,g),I.rShiftTo(E,I));g.signum()>0;)(C=g.getLowestSetBit())>0&&g.rShiftTo(C,g),(C=I.getLowestSetBit())>0&&I.rShiftTo(C,I),g.compareTo(I)>=0?(g.subTo(I,g),g.rShiftTo(1,g)):(I.subTo(g,I),I.rShiftTo(1,I));return E>0&&I.lShiftTo(E,I),I},I.prototype.isProbablePrime=function(A){var g,I=this.abs();if(1==I.t&&I[0]<=V[V.length-1]){for(g=0;g<V.length;++g)if(I[0]==V[g])return!0;return!1}if(I.isEven())return!1;for(g=1;g<V.length;){for(var B=V[g],C=g+1;C<V.length&&B<K;)B*=V[C++];for(B=I.modInt(B);g<C;)if(B%V[g++]==0)return!1}return I.millerRabin(A)},I.prototype.square=function(){var A=B();return this.squareTo(A),A},I.prototype.Barrett=W,null==l){var n;if(l=new Array,R=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var y=new Uint8Array(32);for(window.crypto.getRandomValues(y),n=0;n<32;++n)l[R++]=y[n]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var U=window.crypto.random(32);for(n=0;n<U.length;++n)l[R++]=255&U.charCodeAt(n)}for(;R<Z;)n=Math.floor(65536*Math.random()),l[R++]=n>>>8,l[R++]=255&n;R=0,F()}function q(){if(null==D){for(F(),(D=new b).init(l),R=0;R<l.length;++R)l[R]=0;R=0}return D.next()}function x(){}function b(){this.i=0,this.j=0,this.S=new Array}x.prototype.nextBytes=function(A){var g;for(g=0;g<A.length;++g)A[g]=q()},b.prototype.init=function(A){var g,I,B;for(g=0;g<256;++g)this.S[g]=g;for(I=0,g=0;g<256;++g)I=I+this.S[g]+A[g%A.length]&255,B=this.S[g],this.S[g]=this.S[I],this.S[I]=B;this.i=0,this.j=0},b.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 Z=256;A.exports={default:I,BigInteger:I,SecureRandom:x}}.call(jsbn)),jsbn$1.exports;var A}function requireAsn1(){if(hasRequiredAsn1)return asn1;hasRequiredAsn1=1;const{BigInteger:A}=requireJsbn();class g{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 g=A.toString(16);if(g.length%2==1&&(g="0"+g),A<128)return g;return(128+g.length/2).toString(16)+g}getValue(){return""}}class I extends g{constructor(g){super(),this.t="02",g&&(this.v=function(g){let I=g.toString(16);if("-"!==I[0])I.length%2==1?I="0"+I:I.match(/^[0-7]/)||(I="00"+I);else{I=I.substr(1);let B=I.length;B%2==1?B+=1:I.match(/^[0-7]/)||(B+=2);let C="";for(let A=0;A<B;A++)C+="f";C=new A(C,16),I=C.xor(g).add(A.ONE),I=I.toString(16).replace(/^-/,"")}return I}(g))}getValue(){return this.v}}class B extends g{constructor(A){super(),this.t="30",this.asn1Array=A}getValue(){return this.v=this.asn1Array.map(A=>A.getEncodedHex()).join(""),this.v}}function C(A,g){return+A[g+2]<8?1:128&+A.substr(g+2,2)}function E(g,I){const B=C(g,I),E=g.substr(I+2,2*B);if(!E)return-1;return(+E[0]<8?new A(E,16):new A(E.substr(2),16)).intValue()}function Q(A,g){return g+2*(C(A,g)+1)}return asn1={encodeDer(A,g){const C=new I(A),E=new I(g);return new B([C,E]).getEncodedHex()},decodeDer(g){const I=Q(g,0),B=Q(g,I),C=E(g,I),t=g.substr(B,2*C),i=B+t.length,s=Q(g,i),k=E(g,i),r=g.substr(s,2*k);return{r:new A(t,16),s:new A(r,16)}}}}function requireUtils(){if(hasRequiredUtils)return utils$2;hasRequiredUtils=1;const{BigInteger:A,SecureRandom:g}=requireJsbn(),{ECCurveFp:I}=function(){if(hasRequiredEc)return ec;hasRequiredEc=1;const{BigInteger:A}=requireJsbn(),g=new A("2"),I=new A("3");class B{constructor(A,g){this.x=g,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 B(this.q,this.x.negate().mod(this.q))}add(A){return new B(this.q,this.x.add(A.toBigInteger()).mod(this.q))}subtract(A){return new B(this.q,this.x.subtract(A.toBigInteger()).mod(this.q))}multiply(A){return new B(this.q,this.x.multiply(A.toBigInteger()).mod(this.q))}divide(A){return new B(this.q,this.x.multiply(A.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new B(this.q,this.x.square().mod(this.q))}}class C{constructor(g,I,B,C){this.curve=g,this.x=I,this.y=B,this.z=null==C?A.ONE:C,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(g){return g===this||(this.isInfinity()?g.isInfinity():g.isInfinity()?this.isInfinity():!!g.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(g.z)).mod(this.curve.q).equals(A.ZERO)&&g.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(g.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 C(this.curve,this.x,this.y.negate(),this.z)}add(g){if(this.isInfinity())return g;if(g.isInfinity())return this;const I=this.x.toBigInteger(),B=this.y.toBigInteger(),E=this.z,Q=g.x.toBigInteger(),t=g.y.toBigInteger(),i=g.z,s=this.curve.q,k=I.multiply(i).mod(s),r=Q.multiply(E).mod(s),Y=k.subtract(r),S=B.multiply(i).mod(s),J=t.multiply(E).mod(s),G=S.subtract(J);if(A.ZERO.equals(Y))return A.ZERO.equals(G)?this.twice():this.curve.infinity;const a=k.add(r),w=E.multiply(i).mod(s),e=Y.square().mod(s),M=Y.multiply(e).mod(s),o=w.multiply(G.square()).subtract(a.multiply(e)).mod(s),h=Y.multiply(o).mod(s),W=G.multiply(e.multiply(k).subtract(o)).subtract(S.multiply(M)).mod(s),D=M.multiply(w).mod(s);return new C(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(W),D)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const A=this.x.toBigInteger(),g=this.y.toBigInteger(),B=this.z,E=this.curve.q,Q=this.curve.a.toBigInteger(),t=A.square().multiply(I).add(Q.multiply(B.square())).mod(E),i=g.shiftLeft(1).multiply(B).mod(E),s=g.square().mod(E),k=s.multiply(A).multiply(B).mod(E),r=i.square().mod(E),Y=t.square().subtract(k.shiftLeft(3)).mod(E),S=i.multiply(Y).mod(E),J=t.multiply(k.shiftLeft(2).subtract(Y)).subtract(r.shiftLeft(1).multiply(s)).mod(E),G=i.multiply(r).mod(E);return new C(this.curve,this.curve.fromBigInteger(S),this.curve.fromBigInteger(J),G)}multiply(A){if(this.isInfinity())return this;if(!A.signum())return this.curve.infinity;const g=A.multiply(I),B=this.negate();let C=this;for(let I=g.bitLength()-2;I>0;I--){C=C.twice();const E=g.testBit(I);E!==A.testBit(I)&&(C=C.add(E?this:B))}return C}}return ec={ECPointFp:C,ECCurveFp:class{constructor(A,g,I){this.q=A,this.a=this.fromBigInteger(g),this.b=this.fromBigInteger(I),this.infinity=new C(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 B(this.q,A)}decodePointHex(I){switch(parseInt(I.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const B=this.fromBigInteger(new A(I.substr(2),16));let E=this.fromBigInteger(B.multiply(B.square()).add(B.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new A("4")).add(A.ONE),this.q));return E.toBigInteger().mod(g).equals(new A(I.substr(0,2),16).subtract(g))||(E=E.negate()),new C(this,B,E);case 4:case 6:case 7:const Q=(I.length-2)/2,t=I.substr(2,Q),i=I.substr(Q+2,Q);return new C(this,this.fromBigInteger(new A(t,16)),this.fromBigInteger(new A(i,16)));default:return null}}}}}(),B=new g,{curve:C,G:E,n:Q}=t();function t(){const g=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),B=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),C=new A("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),E=new I(g,B,C),Q=E.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:E,G:Q,n:new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function i(A,g){return A.length>=g?A:new Array(g-A.length+1).join("0")+A}return utils$2={getGlobalCurve:function(){return C},generateEcparam:t,generateKeyPairHex:function(g,I,C){const t=(g?new A(g,I,C):new A(Q.bitLength(),B)).mod(Q.subtract(A.ONE)).add(A.ONE),s=i(t.toString(16),64),k=E.multiply(t);return{privateKey:s,publicKey:"04"+i(k.getX().toBigInteger().toString(16),64)+i(k.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(g){if(130!==g.length)throw new Error("Invalid public key to compress");const I=(g.length-2)/2,B=g.substr(2,I);let C="03";return new A(g.substr(I+2,I),16).mod(new A("2")).equals(A.ZERO)&&(C="02"),C+B},utf8ToHex:function(A){const g=(A=unescape(encodeURIComponent(A))).length,I=[];for(let C=0;C<g;C++)I[C>>>2]|=(255&A.charCodeAt(C))<<24-C%4*8;const B=[];for(let C=0;C<g;C++){const A=I[C>>>2]>>>24-C%4*8&255;B.push((A>>>4).toString(16)),B.push((15&A).toString(16))}return B.join("")},leftPad:i,arrayToHex:function(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")},arrayToUtf8:function(A){const g=[];let I=0;for(let C=0;C<2*A.length;C+=2)g[C>>>3]|=parseInt(A[I],10)<<24-C%8*4,I++;try{const I=[];for(let B=0;B<A.length;B++){const A=g[B>>>2]>>>24-B%4*8&255;I.push(String.fromCharCode(A))}return decodeURIComponent(escape(I.join("")))}catch(B){throw new Error("Malformed UTF-8 data")}},hexToArray:function(A){const g=[];let I=A.length;I%2!=0&&(A=i(A,I+1)),I=A.length;for(let B=0;B<I;B+=2)g.push(parseInt(A.substr(B,2),16));return g},verifyPublicKey:function(A){const g=C.decodePointHex(A);if(!g)return!1;const I=g.getX();return g.getY().square().equals(I.multiply(I.square()).add(I.multiply(C.a)).add(C.b))},comparePublicKeyHex:function(A,g){const I=C.decodePointHex(A);if(!I)return!1;const B=C.decodePointHex(g);return!!B&&I.equals(B)}}}function requireSm3$1(){if(hasRequiredSm3$1)return sm3_1$1;hasRequiredSm3$1=1;const A=new Uint32Array(68),g=new Uint32Array(64);function I(A,g){const I=31&g;return A<<I|A>>>32-I}function B(A,g){const I=[];for(let B=A.length-1;B>=0;B--)I[B]=255&(A[B]^g[B]);return I}function C(A){return A^I(A,9)^I(A,17)}function E(A){return A^I(A,15)^I(A,23)}function Q(B){let Q=8*B.length,t=Q%512;t=t>=448?512-t%448-1:448-t-1;const i=new Array((t-7)/8),s=new Array(8);for(let A=0,g=i.length;A<g;A++)i[A]=0;for(let A=0,g=s.length;A<g;A++)s[A]=0;Q=Q.toString(2);for(let A=7;A>=0;A--)if(Q.length>8){const g=Q.length-8;s[A]=parseInt(Q.substr(g),2),Q=Q.substr(0,g)}else Q.length>0&&(s[A]=parseInt(Q,2),Q="");const k=new Uint8Array([...B,128,...i,...s]),r=new DataView(k.buffer,0),Y=k.length/64,S=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let G=0;G<Y;G++){A.fill(0),g.fill(0);const B=16*G;for(let g=0;g<16;g++)A[g]=r.getUint32(4*(B+g),!1);for(let g=16;g<68;g++)A[g]=E(A[g-16]^A[g-9]^I(A[g-3],15))^I(A[g-13],7)^A[g-6];for(let I=0;I<64;I++)g[I]=A[I]^A[I+4];const Q=2043430169,t=2055708042;let i,s,k,Y,J,a=S[0],w=S[1],e=S[2],M=S[3],o=S[4],h=S[5],W=S[6],D=S[7];for(let E=0;E<64;E++)J=E>=0&&E<=15?Q:t,i=I(I(a,12)+o+I(J,E),7),s=i^I(a,12),k=(E>=0&&E<=15?a^w^e:a&w|a&e|w&e)+M+s+g[E],Y=(E>=0&&E<=15?o^h^W:o&h|~o&W)+D+i+A[E],M=e,e=I(w,9),w=a,a=k,D=W,W=I(h,19),h=o,o=C(Y);S[0]^=a,S[1]^=w,S[2]^=e,S[3]^=M,S[4]^=o,S[5]^=h,S[6]^=W,S[7]^=D}const J=[];for(let A=0,g=S.length;A<g;A++){const g=S[A];J.push((4278190080&g)>>>24,(16711680&g)>>>16,(65280&g)>>>8,255&g)}return J}const t=new Uint8Array(64),i=new Uint8Array(64);for(let s=0;s<64;s++)t[s]=54,i[s]=92;return sm3_1$1={sm3:Q,hmac:function(A,g){for(g.length>64&&(g=Q(g));g.length<64;)g.push(0);const I=B(g,t),C=B(g,i),E=Q([...I,...A]);return Q([...C,...E])}}}function requireSm2(){if(hasRequiredSm2)return sm2;hasRequiredSm2=1;const{BigInteger:A}=requireJsbn(),{encodeDer:g,decodeDer:I}=requireAsn1(),B=requireUtils(),C=requireSm3$1().sm3,{G:E,curve:Q,n:t}=B.generateEcparam();function i(A,g,I="1234567812345678"){I=B.utf8ToHex(I);const Q=B.leftPad(E.curve.a.toBigInteger().toRadix(16),64),t=B.leftPad(E.curve.b.toBigInteger().toRadix(16),64),i=B.leftPad(E.getX().toBigInteger().toRadix(16),64),s=B.leftPad(E.getY().toBigInteger().toRadix(16),64);let k,r;if(128===g.length)k=g.substr(0,64),r=g.substr(64,64);else{const A=E.curve.decodePointHex(g);k=B.leftPad(A.getX().toBigInteger().toRadix(16),64),r=B.leftPad(A.getY().toBigInteger().toRadix(16),64)}const Y=B.hexToArray(I+Q+t+i+s+k+r),S=4*I.length;Y.unshift(255&S),Y.unshift(S>>8&255);const J=C(Y);return B.arrayToHex(C(J.concat(B.hexToArray(A))))}function s(g){const I=E.multiply(new A(g,16));return"04"+B.leftPad(I.getX().toBigInteger().toString(16),64)+B.leftPad(I.getY().toBigInteger().toString(16),64)}function k(){const g=B.generateKeyPairHex(),I=Q.decodePointHex(g.publicKey);return g.k=new A(g.privateKey,16),g.x1=I.getX().toBigInteger(),g}return sm2={generateKeyPairHex:B.generateKeyPairHex,compressPublicKeyHex:B.compressPublicKeyHex,comparePublicKeyHex:B.comparePublicKeyHex,doEncrypt:function(g,I,E=1){g="string"==typeof g?B.hexToArray(B.utf8ToHex(g)):Array.prototype.slice.call(g),I=B.getGlobalCurve().decodePointHex(I);const Q=B.generateKeyPairHex(),t=new A(Q.privateKey,16);let i=Q.publicKey;i.length>128&&(i=i.substr(i.length-128));const s=I.multiply(t),k=B.hexToArray(B.leftPad(s.getX().toBigInteger().toRadix(16),64)),r=B.hexToArray(B.leftPad(s.getY().toBigInteger().toRadix(16),64)),Y=B.arrayToHex(C([].concat(k,g,r)));let S=1,J=0,G=[];const a=[].concat(k,r),w=()=>{G=C([...a,S>>24&255,S>>16&255,S>>8&255,255&S]),S++,J=0};w();for(let A=0,B=g.length;A<B;A++)J===G.length&&w(),g[A]^=255&G[J++];const e=B.arrayToHex(g);return 0===E?i+e+Y:i+Y+e},doDecrypt:function(g,I,E=1,{output:Q="string"}={}){I=new A(I,16);let t=g.substr(128,64),i=g.substr(192);0===E&&(t=g.substr(g.length-64),i=g.substr(128,g.length-128-64));const s=B.hexToArray(i),k=B.getGlobalCurve().decodePointHex("04"+g.substr(0,128)).multiply(I),r=B.hexToArray(B.leftPad(k.getX().toBigInteger().toRadix(16),64)),Y=B.hexToArray(B.leftPad(k.getY().toBigInteger().toRadix(16),64));let S=1,J=0,G=[];const a=[].concat(r,Y),w=()=>{G=C([...a,S>>24&255,S>>16&255,S>>8&255,255&S]),S++,J=0};w();for(let A=0,B=s.length;A<B;A++)J===G.length&&w(),s[A]^=255&G[J++];return B.arrayToHex(C([].concat(r,s,Y)))===t.toLowerCase()?"array"===Q?s:B.arrayToUtf8(s):"array"===Q?[]:""},doSignature:function(I,C,{pointPool:E,der:Q,hash:r,publicKey:Y,userId:S}={}){let J="string"==typeof I?B.utf8ToHex(I):B.arrayToHex(I);r&&(J=i(J,Y=Y||s(C),S));const G=new A(C,16),a=new A(J,16);let w=null,e=null,M=null;do{do{let A;A=E&&E.length?E.pop():k(),w=A.k,e=a.add(A.x1).mod(t)}while(e.equals(A.ZERO)||e.add(w).equals(t));M=G.add(A.ONE).modInverse(t).multiply(w.subtract(e.multiply(G))).mod(t)}while(M.equals(A.ZERO));return Q?g(e,M):B.leftPad(e.toString(16),64)+B.leftPad(M.toString(16),64)},doVerifySignature:function(g,C,s,{der:k,hash:r,userId:Y}={}){let S,J,G="string"==typeof g?B.utf8ToHex(g):B.arrayToHex(g);if(r&&(G=i(G,s,Y)),k){const A=I(C);S=A.r,J=A.s}else S=new A(C.substring(0,64),16),J=new A(C.substring(64),16);const a=Q.decodePointHex(s),w=new A(G,16),e=S.add(J).mod(t);if(e.equals(A.ZERO))return!1;const M=E.multiply(J).add(a.multiply(e)),o=w.add(M.getX().toBigInteger()).mod(t);return S.equals(o)},getPublicKeyFromPrivateKey:s,getPoint:k,verifyPublicKey:B.verifyPublicKey},sm2}function requireSm3(){if(hasRequiredSm3)return sm3_1;hasRequiredSm3=1;const{sm3:A,hmac:g}=requireSm3$1();function I(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")}function B(A){const g=[];let I=A.length;var B,C;I%2!=0&&(C=I+1,A=(B=A).length>=C?B:new Array(C-B.length+1).join("0")+B),I=A.length;for(let E=0;E<I;E+=2)g.push(parseInt(A.substr(E,2),16));return g}return sm3_1=function(C,E){if(C="string"==typeof C?function(A){const g=[];for(let I=0,B=A.length;I<B;I++){const B=A.codePointAt(I);if(B<=127)g.push(B);else if(B<=2047)g.push(192|B>>>6),g.push(128|63&B);else if(B<=55295||B>=57344&&B<=65535)g.push(224|B>>>12),g.push(128|B>>>6&63),g.push(128|63&B);else{if(!(B>=65536&&B<=1114111))throw g.push(B),new Error("input is not supported");I++,g.push(240|B>>>18&28),g.push(128|B>>>12&63),g.push(128|B>>>6&63),g.push(128|63&B)}}return g}(C):Array.prototype.slice.call(C),E){if("hmac"!==(E.mode||"hmac"))throw new Error("invalid mode");let A=E.key;if(!A)throw new Error("invalid key");return A="string"==typeof A?B(A):Array.prototype.slice.call(A),I(g(C,A))}return I(A(C))}}function requireSm4(){if(hasRequiredSm4)return sm4_1;hasRequiredSm4=1;const A=16,g=[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],I=[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 B(A){const g=[];for(let I=0,B=A.length;I<B;I+=2)g.push(parseInt(A.substr(I,2),16));return g}function C(A,g){const I=31&g;return A<<I|A>>>32-I}function E(A){return(255&g[A>>>24&255])<<24|(255&g[A>>>16&255])<<16|(255&g[A>>>8&255])<<8|255&g[255&A]}function Q(A){return A^C(A,2)^C(A,10)^C(A,18)^C(A,24)}function t(A){return A^C(A,13)^C(A,23)}function i(A,g,I){const B=new Array(4),C=new Array(4);for(let E=0;E<4;E++)C[0]=255&A[4*E],C[1]=255&A[4*E+1],C[2]=255&A[4*E+2],C[3]=255&A[4*E+3],B[E]=C[0]<<24|C[1]<<16|C[2]<<8|C[3];for(let t,i=0;i<32;i+=4)t=B[1]^B[2]^B[3]^I[i+0],B[0]^=Q(E(t)),t=B[2]^B[3]^B[0]^I[i+1],B[1]^=Q(E(t)),t=B[3]^B[0]^B[1]^I[i+2],B[2]^=Q(E(t)),t=B[0]^B[1]^B[2]^I[i+3],B[3]^=Q(E(t));for(let E=0;E<16;E+=4)g[E]=B[3-E/4]>>>24&255,g[E+1]=B[3-E/4]>>>16&255,g[E+2]=B[3-E/4]>>>8&255,g[E+3]=255&B[3-E/4]}function s(g,C,Q,{padding:s="pkcs#7",mode:k,iv:r=[],output:Y="string"}={}){if("cbc"===k&&("string"==typeof r&&(r=B(r)),16!==r.length))throw new Error("iv is invalid");if("string"==typeof C&&(C=B(C)),16!==C.length)throw new Error("key is invalid");if(g="string"==typeof g?0!==Q?function(A){const g=[];for(let I=0,B=A.length;I<B;I++){const B=A.codePointAt(I);if(B<=127)g.push(B);else if(B<=2047)g.push(192|B>>>6),g.push(128|63&B);else if(B<=55295||B>=57344&&B<=65535)g.push(224|B>>>12),g.push(128|B>>>6&63),g.push(128|63&B);else{if(!(B>=65536&&B<=1114111))throw g.push(B),new Error("input is not supported");I++,g.push(240|B>>>18&28),g.push(128|B>>>12&63),g.push(128|B>>>6&63),g.push(128|63&B)}}return g}(g):B(g):[...g],("pkcs#5"===s||"pkcs#7"===s)&&0!==Q){const I=A-g.length%A;for(let A=0;A<I;A++)g.push(I)}const S=new Array(32);!function(A,g,B){const C=new Array(4),Q=new Array(4);for(let I=0;I<4;I++)Q[0]=255&A[0+4*I],Q[1]=255&A[1+4*I],Q[2]=255&A[2+4*I],Q[3]=255&A[3+4*I],C[I]=Q[0]<<24|Q[1]<<16|Q[2]<<8|Q[3];C[0]^=2746333894,C[1]^=1453994832,C[2]^=1736282519,C[3]^=2993693404;for(let i,s=0;s<32;s+=4)i=C[1]^C[2]^C[3]^I[s+0],g[s+0]=C[0]^=t(E(i)),i=C[2]^C[3]^C[0]^I[s+1],g[s+1]=C[1]^=t(E(i)),i=C[3]^C[0]^C[1]^I[s+2],g[s+2]=C[2]^=t(E(i)),i=C[0]^C[1]^C[2]^I[s+3],g[s+3]=C[3]^=t(E(i));if(0===B)for(let I,E=0;E<16;E++)I=g[E],g[E]=g[31-E],g[31-E]=I}(C,S,Q);const J=[];let G=r,a=g.length,w=0;for(;a>=A;){const I=g.slice(w,w+16),B=new Array(16);if("cbc"===k)for(let g=0;g<A;g++)0!==Q&&(I[g]^=G[g]);i(I,B,S);for(let g=0;g<A;g++)"cbc"===k&&0===Q&&(B[g]^=G[g]),J[w+g]=B[g];"cbc"===k&&(G=0!==Q?B:I),a-=A,w+=A}if(("pkcs#5"===s||"pkcs#7"===s)&&0===Q){const A=J.length,g=J[A-1];for(let I=1;I<=g;I++)if(J[A-I]!==g)throw new Error("padding is invalid");J.splice(A-g,g)}return"array"!==Y?0!==Q?J.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join(""):function(A){const g=[];for(let I=0,B=A.length;I<B;I++)A[I]>=240&&A[I]<=247?(g.push(String.fromCodePoint(((7&A[I])<<18)+((63&A[I+1])<<12)+((63&A[I+2])<<6)+(63&A[I+3]))),I+=3):A[I]>=224&&A[I]<=239?(g.push(String.fromCodePoint(((15&A[I])<<12)+((63&A[I+1])<<6)+(63&A[I+2]))),I+=2):A[I]>=192&&A[I]<=223?(g.push(String.fromCodePoint(((31&A[I])<<6)+(63&A[I+1]))),I++):g.push(String.fromCodePoint(A[I]));return g.join("")}(J):J}return sm4_1={encrypt:(A,g,I)=>s(A,g,1,I),decrypt:(A,g,I)=>s(A,g,0,I)}}const smCrypto=getDefaultExportFromCjs(hasRequiredSrc?src:(hasRequiredSrc=1,src={sm2:requireSm2(),sm3:requireSm3(),sm4:requireSm4()}));class MyCryptoJS{constructor(A,g,I,B){__privateAdd(this,_key,null),__privateAdd(this,_iv,null),__privateAdd(this,_publicKey,null),__privateAdd(this,_privateKey,null),__privateAdd(this,_formatType,(A,g=!1)=>{if(!g)return"object"==typeof A?JSON.stringify(A):String(A);try{return JSON.parse(A)}catch(I){return A}}),this.setkey(A),this.setiv(g),this.setPublicKey(I),this.setPrivateKey(B)}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,g){return smCrypto.sm2.doEncrypt(A,g,{inputEncoding:"utf8",outputEncoding:"hex",pointFormat:"uncompressed",cipherMode:1})}sm2Decrypt(A,g){return smCrypto.sm2.doDecrypt(A,g,1)}RSAencrypt(A){A=__privateGet(this,_formatType).call(this,A);const g=new JSEncrypt;return g.setPublicKey(__privateGet(this,_publicKey)),g.encrypt(A)}RSAdecrypt(A){const g=new JSEncrypt;return g.setPrivateKey(__privateGet(this,_privateKey)),__privateGet(this,_formatType).call(this,g.decrypt(A),!0)}stringToWordArray(A){return CryptoJS.enc.Utf8.parse(A)}wordArrayToString(A){return A.toString(CryptoJS.enc.Utf8)}AESencrypt(A,g=!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(g?CryptoJS.enc.Base64:CryptoJS.enc.Hex)}AESdecrypt(A,g=!0){A=g?A:CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(A));let I=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,I.toString(CryptoJS.enc.Utf8),!0)}DESencrypt(A,g=!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(g?CryptoJS.enc.Base64:CryptoJS.enc.Hex)}DESdecrypt(A,g=!0){A=g?A:CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(A));let I=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,I.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,g,I){return new Promise((B,C)=>{if(!A)return void C("");const E=new FileReader;if(E.onerror=A=>{C(A)},g){const t=CryptoJS.algo.MD5.create();let i=0;try{let C=function(){const I=A.slice(i,i+g);E.readAsArrayBuffer(I)};E.onload=E=>{const Q=CryptoJS.lib.WordArray.create(new Uint8Array(E.target.result));if(t.update(Q),"function"==typeof I&&I(i,A.size),i+=g,i<A.size)C();else{const A=t.finalize();B(A.toString(CryptoJS.enc.Hex))}},C()}catch(Q){C(Q)}}else E.onload=g=>{"function"==typeof I&&I(A.size,A.size),B(CryptoJS.MD5(CryptoJS.lib.WordArray.create(g.target.result)).toString())},E.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 g=CryptoJS.lib.WordArray.random(16);return CryptoJS.PBKDF2(A,g,{keySize:8,iterations:1e3}).toString()}hmac(A,g){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.HmacSHA256(A,g).toString(CryptoJS.enc.Hex)}}function randomStr$1(A=18,g=36){(g<2||g>36)&&(g=36);var I=Math.random().toString(g).substring(2,13).padEnd(11,"0").slice(0,A);return A<=11?I:I+randomStr$1(A-11)}function hexToRgb(A){A=A.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(A,g,I,B)=>g+g+I+I+B+B);const g=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);return g?{r:parseInt(g[1],16),g:parseInt(g[2],16),b:parseInt(g[3],16)}:null}function fileTurnBase64(A){return new Promise((g,I)=>{if(A)try{var B=new FileReader;let C="";B.readAsDataURL(A),B.onload=function(){C=B.result},B.onerror=function(A){I(A)},B.onloadend=function(){g(C)}}catch(C){I(C)}else I("")})}_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",g=new Date,I=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]){!g&&(g=new Date),"string"==typeof g&&(g=new Date(g));const B={"M+":g.getMonth()+1,"d+":g.getDate(),"h+":g.getHours(),"m+":g.getMinutes(),"s+":g.getSeconds(),S:g.getMilliseconds(),w:I[g.getDay()]};/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(g.getFullYear()+"").substr(4-RegExp.$1.length)));for(const C in B)new RegExp("("+C+")").test(A)&&(A=A.replace(RegExp.$1,1===RegExp.$1.length?B[C]:("00"+B[C]).substr((""+B[C]).length)));return A},throttle:function(A,g=500){var I=Date.now();return function(...B){Date.now()-I>=g&&(A.apply(this,B),I=Date.now())}},debounce:function(A,g=500){let I=null;return function(...B){clearTimeout(I),I=setTimeout(()=>{A.apply(this,B)},g)}},rgbToHex:function(A,g,I){return"#"+((1<<24)+(A<<16)+(g<<8)+I).toString(16).slice(1)},hexToRgb:hexToRgb,hslToRgb:function(A,g,I){let B,C,E;if(A/=360,I/=100,0===(g/=100))B=C=E=I;else{const Q=(A,g,I)=>(I<0&&(I+=1),I>1&&(I-=1),I<1/6?A+6*(g-A)*I:I<.5?g:I<2/3?A+(g-A)*(2/3-I)*6:A),t=I<.5?I*(1+g):I+g-I*g,i=2*I-t;B=Q(i,t,A+1/3),C=Q(i,t,A),E=Q(i,t,A-1/3)}return{r:Math.round(255*B),g:Math.round(255*C),b:Math.round(255*E)}},rgbOrHexToHsl:function(A){let g,I,B;if("string"==typeof A&&"#"===A.charAt(0)){const C=hexToRgb(A);g=C.r/255,I=C.g/255,B=C.b/255}else{if("object"!=typeof A)throw new Error("Invalid input format");g=A.r/255,I=A.g/255,B=A.b/255}const C=Math.max(g,I,B),E=Math.min(g,I,B);let Q,t,i=(C+E)/2;if(C===E)Q=t=0;else{const A=C-E;switch(t=i>.5?A/(2-C-E):A/(C+E),C){case g:Q=(I-B)/A+(I<B?6:0);break;case I:Q=(B-g)/A+2;break;case B:Q=(g-I)/A+4}Q/=6}return{h:Math.round(360*Q),s:Math.round(100*t),l:Math.round(100*i)}},preciseInterval:function(A,g){let I,B=null;return I=requestAnimationFrame(function C(E){B||(B=E),E-B>=g&&(A(),B=E),I=requestAnimationFrame(C)}),{clear:function(){cancelAnimationFrame(I)}}},convertImgToBase64:function(A,g){return new Promise(function(I){var B=document.createElement("CANVAS"),C=B.getContext("2d"),E=new Image;E.crossOrigin="Anonymous",E.onload=function(){B.height=E.height,B.width=E.width,C.drawImage(E,0,0);var A=B.toDataURL(g||"image/jpg");I(A),B=null},E.src=A})},objectGroupBy:function(A,g){if("string"==typeof g){const A=g;g=g=>g[A]}var I={};return A.forEach((B,C)=>{const E=g(B,C,A);I[E]||(I[E]=[]),I[E].push(B)}),I},randomNum:function(A,g){return Math.floor(Math.random()*(g+1-A))+A},randomColor:function(){return"#"+Math.floor(16777215*Math.random()).toString(16).padEnd(6,"0")},deepCloning:function A(g,I=new WeakMap){if("object"!=typeof g||null===g)return g;if(I.has(g))return I.get(g);var B=Array.isArray(g)?[]:{};I.set(g,B);for(const E in g)if(g.hasOwnProperty(E)){const Q=g[E];if("object"!=typeof Q||null===Q)B[E]=Q;else try{B[E]=A(Q,I)}catch(C){}}return B},randomStr:randomStr$1,getUrlParams:function(A){const g={};let I=A.substring(A.lastIndexOf("?")+1);return I=decodeURIComponent(I),I.replace(/([^?&=]+)=([^?&=]*)/g,(A,I,B)=>{const C=decodeURIComponent(I);let E=decodeURIComponent(B);try{E=JSON.parse(E)}catch(Q){}return g[C]=E,A}),g},getBroswer:function(){let A="";const g=window.navigator.userAgent.toLowerCase();if(/(msie|firefox|opera|chrome|netscape)\D+(\d[\d.]*)/.test(g)){const I=g.search(RegExp.$1);A=g.substring(I,g.length).replace(/safari\D+(\d[\d.]*)/,"")}else/version\D+(\d[\d.]*).*safari/.test(g)&&(A="safari "+RegExp.$2);return A},fileTurnBase64:fileTurnBase64,fileChunks:function(A,g,I,B){return new Promise((C,E)=>{const Q=new MyCryptoJS,t={fileHash:"",fileName:A.name,chunkSize:g,fileSize:A.size,fileType:A.type,chunks:[]};let i=new Promise((I,C)=>{Q.fileMd5(A,g,B).then(A=>{t.fileHash=A,I(t)}).catch(A=>{C(A)})}),s=new Promise((B,C)=>{let E=0;!async function C(){if(E>=A.size)return void B(t);let Q=A.slice(E,Math.min(E+g,A.size));I&&(Q=await fileTurnBase64(Q)),t.chunks.push({chunk:Q,index:E/g}),E+=g,C()}()});Promise.all([i,s]).then(()=>{C(t)}).catch(A=>{E(A)})})},base64ArrayMerge:function(A,g=!0){let I=(A=A.map(A=>function(A){const g="=".repeat((4-A.length%4)%4),I=(A+g).replace(/\-/g,"+").replace(/_/g,"/"),B=window.atob(I),C=new Uint8Array(B.length);for(let E=0;E<B.length;++E)C[E]=B.charCodeAt(E);return C}(A.split(",")[1]))).reduce((A,g)=>A+g.length,0);const B=new Uint8Array(I);let C=0;A.forEach(A=>{B.set(A,C),C+=A.length});const E=new Blob([B]);return new Promise((A,I)=>{g?fileTurnBase64(E).then(g=>{A(g)}).catch(A=>{I(A)}):A(E)})},toChineseNumber:function(A,g=!0){let I=A.toString().replace(/(?=(\d{4})+$)/g,",").split(",").filter(Boolean);const B=["零","一","二","三","四","五","六","七","八","九"],C=["","十","百","千"],E=["","万","亿"];let Q=I.map((A,g)=>function(A){let g="";for(let I=0;I<A.length;I++){let E=B[A[I]],Q=C[A.length-I-1];"零"===E&&(Q=""),g+=E+Q}return g=g.replace(/零+/g,"零").replace(/零$/,""),g}(A)+E[I.length-1-g]).join("");if(Q=Q||"零",g){let A={"零":"零","一":"壹","二":"贰","三":"叁","四":"肆","五":"伍","六":"陆","七":"柒","八":"捌","九":"玖","十":"拾","百":"佰","千":"仟"};Q=Q.split("").map(g=>A[g]||g).join("")}return Q},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,g){if(!A)return;"object"==typeof A&&(A=JSON.stringify(A));const I=new Blob([A],{type:"application/json;charset=utf-8"}),B=URL.createObjectURL(I),C=document.createElement("a");C.href=B,C.download=0==g.indexOf(".")?randomStr$1()+g:g,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(B)}};const BaseClass=(null==(_a2=window.Cesium)?void 0:_a2.WebMapTileServiceImageryProvider)||Object;class CustomImageryProvider extends BaseClass{constructor(A){super(A),__publicField(this,"myAlp",0),__publicField(this,"myRgb",[20,107,173]),this.myAlp=A.alp||0,this.myRgb=A.rgb||[20,107,173]}requestImage(A,g,I){return super.requestImage(A,g,I).then(A=>{if(!this.myAlp)return A;const g=document.createElement("canvas");g.width=A.width,g.height=A.height;const I=g.getContext("2d");return I.translate(0,g.height),I.scale(1,-1),I.drawImage(A,0,0),I.globalCompositeOperation="source-atop",I.fillStyle=`rgba(${this.myRgb[0]},${this.myRgb[1]},${this.myRgb[2]}, ${this.myAlp})`,I.fillRect(0,0,g.width,g.height),I.globalCompositeOperation="source-over",I.stroke(),g})}}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={},g=[])=>{const I=__privateGet(this,_parent).viewer;var B={tdtyxType:"img_w",maximumLevel:18,...A},C=new CustomImageryProvider({rgb:g,alp:g[3],url:`http://t{s}.tianditu.gov.cn/${B.tdtyxType}/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=${"img_w"==B.tdtyxType?"img":"vec"}&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:B.maximumLevel,minimumLevel:0}),E=I.imageryLayers.addImageryProvider(C);return I.imageryLayers.lowerToBottom(E),{entity:E,remove(){I.imageryLayers.remove(E)}}}),__publicField(this,"loadTdtZhuJi",(A={},g=[])=>{const I=__privateGet(this,_parent).viewer;var B={maximumLevel:18,...A},C=new CustomImageryProvider({rgb:g,alp:g[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:B.maximumLevel,show:!0}),E=I.imageryLayers.addImageryProvider(C);return I.imageryLayers.raiseToTop(E),{entity:E,remove(){I.imageryLayers.remove(E)}}}),__publicField(this,"setImageLayerFilter",(A={},g=0)=>{var I={invertColor:!0,alpha:1,dayAlpha:1,nightAlpha:1,brightness:1,contrast:1,hue:50,saturation:1,gamma:1,...A},B=__privateGet(this,_parent).viewer.imageryLayers.get(g);B.invertColor=I.invertColor,B.alpha=I.alpha,B.dayAlpha=I.dayAlpha,B.nightAlpha=I.nightAlpha,B.brightness=I.brightness,B.contrast=I.contrast,B.hue=I.hue,B.saturation=I.saturation,B.gamma=I.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={},g=[]){const I=__privateGet(this,_parent).viewer;var B={maximumLevel:18,show:!0,...A},C=new CustomImageryProvider({rgb:g,alp:g[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:B.maximumLevel,show:B.show}),E=I.imageryLayers.addImageryProvider(C);return I.imageryLayers.raiseToTop(E),{entity:E,remove(){I.imageryLayers.remove(E)}}}}_yingXiangLayer=new WeakMap,_luWangLayer=new WeakMap,_zhuJiLayer=new WeakMap,_parent=new WeakMap;const configProviderContextKey=Symbol(),_bem=(A,g,I,B,C)=>{let E=`${A}-${g}`;return I&&(E+=`-${I}`),B&&(E+=`__${B}`),C&&(E+=`--${C}`),E},namespaceContextKey=Symbol("namespaceContextKey"),useNamespace=(A,g)=>{const I=(A=>{const g=A||(vue.getCurrentInstance()?vue.inject(namespaceContextKey,vue.ref("el")):vue.ref("el"));return vue.computed(()=>vue.unref(g)||"el")})(g);return{namespace:I,b:(g="")=>_bem(I.value,A,g,"",""),e:g=>g?_bem(I.value,A,"",g,""):"",m:g=>g?_bem(I.value,A,"","",g):"",be:(g,B)=>g&&B?_bem(I.value,A,g,B,""):"",em:(g,B)=>g&&B?_bem(I.value,A,"",g,B):"",bm:(g,B)=>g&&B?_bem(I.value,A,g,"",B):"",bem:(g,B,C)=>g&&B&&C?_bem(I.value,A,g,B,C):"",is:(A,...g)=>{const I=!(g.length>=1)||g[0];return A&&I?`is-${A}`:""},cssVar:A=>{const g={};for(const B in A)A[B]&&(g[`--${I.value}-${B}`]=A[B]);return g},cssVarName:A=>`--${I.value}-${A}`,cssVarBlock:g=>{const B={};for(const C in g)g[C]&&(B[`--${I.value}-${A}-${C}`]=g[C]);return B},cssVarBlockName:g=>`--${I.value}-${A}-${g}`}};
|
|
33
|
+
var KJUR={};void 0!==KJUR.asn1&&KJUR.asn1||(KJUR.asn1={}),KJUR.asn1.ASN1Util=new function(){this.integerToByteHex=function(A){var g=A.toString(16);return g.length%2==1&&(g="0"+g),g},this.bigIntToMinTwosComplementsHex=function(A){var g=A.toString(16);if("-"!=g.substr(0,1))g.length%2==1?g="0"+g:g.match(/^[0-7]/)||(g="00"+g);else{var I=g.substr(1).length;I%2==1?I+=1:g.match(/^[0-7]/)||(I+=2);for(var B="",C=0;C<I;C++)B+="f";g=new BigInteger(B,16).xor(A).add(BigInteger.ONE).toString(16).replace(/^-/,"")}return g},this.getPEMStringFromHex=function(A,g){return hextopem(A,g)},this.newObject=function(A){var g=KJUR.asn1,I=g.DERBoolean,B=g.DERInteger,C=g.DERBitString,E=g.DEROctetString,Q=g.DERNull,t=g.DERObjectIdentifier,i=g.DEREnumerated,s=g.DERUTF8String,k=g.DERNumericString,r=g.DERPrintableString,Y=g.DERTeletexString,S=g.DERIA5String,J=g.DERUTCTime,G=g.DERGeneralizedTime,a=g.DERSequence,w=g.DERSet,e=g.DERTaggedObject,M=g.ASN1Util.newObject,o=Object.keys(A);if(1!=o.length)throw"key of param shall be only one.";var h=o[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+h+":"))throw"undefined key: "+h;if("bool"==h)return new I(A[h]);if("int"==h)return new B(A[h]);if("bitstr"==h)return new C(A[h]);if("octstr"==h)return new E(A[h]);if("null"==h)return new Q(A[h]);if("oid"==h)return new t(A[h]);if("enum"==h)return new i(A[h]);if("utf8str"==h)return new s(A[h]);if("numstr"==h)return new k(A[h]);if("prnstr"==h)return new r(A[h]);if("telstr"==h)return new Y(A[h]);if("ia5str"==h)return new S(A[h]);if("utctime"==h)return new J(A[h]);if("gentime"==h)return new G(A[h]);if("seq"==h){for(var W=A[h],D=[],l=0;l<W.length;l++){var R=M(W[l]);D.push(R)}return new a({array:D})}if("set"==h){for(W=A[h],D=[],l=0;l<W.length;l++){R=M(W[l]);D.push(R)}return new w({array:D})}if("tag"==h){var V=A[h];if("[object Array]"===Object.prototype.toString.call(V)&&3==V.length){var K=M(V[2]);return new e({tag:V[0],explicit:V[1],obj:K})}var F={};if(void 0!==V.explicit&&(F.explicit=V.explicit),void 0!==V.tag&&(F.tag=V.tag),void 0===V.obj)throw"obj shall be specified for 'tag'.";return F.obj=M(V.obj),new e(F)}},this.jsonToASN1HEX=function(A){return this.newObject(A).getEncodedHex()}},KJUR.asn1.ASN1Util.oidHexToInt=function(A){for(var g="",I=parseInt(A.substr(0,2),16),B=(g=Math.floor(I/40)+"."+I%40,""),C=2;C<A.length;C+=2){var E=("00000000"+parseInt(A.substr(C,2),16).toString(2)).slice(-8);if(B+=E.substr(1,7),"0"==E.substr(0,1))g=g+"."+new BigInteger(B,2).toString(10),B=""}return g},KJUR.asn1.ASN1Util.oidIntToHex=function(A){var g=function(A){var g=A.toString(16);return 1==g.length&&(g="0"+g),g},I=function(A){var I="",B=new BigInteger(A,10).toString(2),C=7-B.length%7;7==C&&(C=0);for(var E="",Q=0;Q<C;Q++)E+="0";B=E+B;for(Q=0;Q<B.length-1;Q+=7){var t=B.substr(Q,7);Q!=B.length-7&&(t="1"+t),I+=g(parseInt(t,2))}return I};if(!A.match(/^[0-9.]+$/))throw"malformed oid string: "+A;var B="",C=A.split("."),E=40*parseInt(C[0])+parseInt(C[1]);B+=g(E),C.splice(0,2);for(var Q=0;Q<C.length;Q++)B+=I(C[Q]);return B},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,g=A.toString(16);if(g.length%2==1&&(g="0"+g),A<128)return g;var I=g.length/2;if(I>15)throw"ASN.1 length too long to represent by 8x: n = "+A.toString(16);return(128+I).toString(16)+g},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,g,I){var B=this.zeroPadding,C=this.localDateToUTC(A),E=String(C.getFullYear());"utc"==g&&(E=E.substr(2,2));var Q=E+B(String(C.getMonth()+1),2)+B(String(C.getDate()),2)+B(String(C.getHours()),2)+B(String(C.getMinutes()),2)+B(String(C.getSeconds()),2);if(!0===I){var t=C.getMilliseconds();if(0!=t){var i=B(String(t),3);Q=Q+"."+(i=i.replace(/[0]+$/,""))}}return Q+"Z"},this.zeroPadding=function(A,g){return A.length>=g?A:new Array(g-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,g,I,B,C,E){var Q=new Date(Date.UTC(A,g-1,I,B,C,E,0));this.setByDate(Q)},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 g=new BigInteger(String(A),10);this.setByBigInteger(g)},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 g=KJUR.asn1.ASN1Util.newObject(A.obj);A.hex="00"+g.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,g){if(A<0||7<A)throw"unused bits shall be from 0 to 7: u = "+A;var I="0"+A;this.hTLV=null,this.isModified=!0,this.hV=I+g},this.setByBinaryString=function(A){var g=8-(A=A.replace(/0+$/,"")).length%8;8==g&&(g=0);for(var I=0;I<=g;I++)A+="0";var B="";for(I=0;I<A.length-1;I+=8){var C=A.substr(I,8),E=parseInt(C,2).toString(16);1==E.length&&(E="0"+E),B+=E}this.hTLV=null,this.isModified=!0,this.hV="0"+g+B},this.setByBooleanArray=function(A){for(var g="",I=0;I<A.length;I++)1==A[I]?g+="1":g+="0";this.setByBinaryString(g)},this.newFalseArray=function(A){for(var g=new Array(A),I=0;I<A;I++)g[I]=!1;return g},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 g=KJUR.asn1.ASN1Util.newObject(A.obj);A.hex=g.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 g=function(A){var g=A.toString(16);return 1==g.length&&(g="0"+g),g},I=function(A){var I="",B=new BigInteger(A,10).toString(2),C=7-B.length%7;7==C&&(C=0);for(var E="",Q=0;Q<C;Q++)E+="0";B=E+B;for(Q=0;Q<B.length-1;Q+=7){var t=B.substr(Q,7);Q!=B.length-7&&(t="1"+t),I+=g(parseInt(t,2))}return I};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 B="",C=A.split("."),E=40*parseInt(C[0])+parseInt(C[1]);B+=g(E),C.splice(0,2);for(var Q=0;Q<C.length;Q++)B+=I(C[Q]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=B},this.setValueName=function(A){var g=KJUR.asn1.x509.OID.name2oid(A);if(""===g)throw"DERObjectIdentifier oidName undefined: "+A;this.setValueOidString(g)},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 g=new BigInteger(String(A),10);this.setByBigInteger(g)},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="",g=0;g<this.asn1Array.length;g++){A+=this.asn1Array[g].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,g=0;g<this.asn1Array.length;g++){var I=this.asn1Array[g];A.push(I.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,g,I){this.hT=g,this.isExplicit=A,this.asn1Object=I,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=I.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,g),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(g,I){return(A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,g){A.__proto__=g}||function(A,g){for(var I in g)Object.prototype.hasOwnProperty.call(g,I)&&(A[I]=g[I])})(g,I)};return function(g,I){if("function"!=typeof I&&null!==I)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function B(){this.constructor=g}A(g,I),g.prototype=null===I?Object.create(I):(B.prototype=I.prototype,new B)}}(),JSEncryptRSAKey=function(A){function g(I){var B=A.call(this)||this;return I&&("string"==typeof I?B.parseKey(I):(g.hasPrivateKeyProperty(I)||g.hasPublicKeyProperty(I))&&B.parsePropertiesFrom(I)),B}return __extends(g,A),g.prototype.parseKey=function(A){try{var g=0,I=0,B=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(A)?Hex_decode(A):Base64.unarmor(A),C=ASN1.decode(B);if(3===C.sub.length&&(C=C.sub[2].sub[0]),9===C.sub.length){g=C.sub[1].getHexStringValue(),this.n=parseBigInt(g,16),I=C.sub[2].getHexStringValue(),this.e=parseInt(I,16);var E=C.sub[3].getHexStringValue();this.d=parseBigInt(E,16);var Q=C.sub[4].getHexStringValue();this.p=parseBigInt(Q,16);var t=C.sub[5].getHexStringValue();this.q=parseBigInt(t,16);var i=C.sub[6].getHexStringValue();this.dmp1=parseBigInt(i,16);var s=C.sub[7].getHexStringValue();this.dmq1=parseBigInt(s,16);var k=C.sub[8].getHexStringValue();this.coeff=parseBigInt(k,16)}else{if(2!==C.sub.length)return!1;if(C.sub[0].sub){var r=C.sub[1].sub[0];g=r.sub[0].getHexStringValue(),this.n=parseBigInt(g,16),I=r.sub[1].getHexStringValue(),this.e=parseInt(I,16)}else g=C.sub[0].getHexStringValue(),this.n=parseBigInt(g,16),I=C.sub[1].getHexStringValue(),this.e=parseInt(I,16)}return!0}catch(Y){return!1}},g.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()},g.prototype.getPrivateBaseKeyB64=function(){return hex2b64(this.getPrivateBaseKey())},g.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]}),g=new KJUR.asn1.DERSequence({array:[new KJUR.asn1.DERInteger({bigint:this.n}),new KJUR.asn1.DERInteger({int:this.e})]}),I=new KJUR.asn1.DERBitString({hex:"00"+g.getEncodedHex()});return new KJUR.asn1.DERSequence({array:[A,I]}).getEncodedHex()},g.prototype.getPublicBaseKeyB64=function(){return hex2b64(this.getPublicBaseKey())},g.wordwrap=function(A,g){if(!A)return A;var I="(.{1,"+(g=g||64)+"})( +|$\n?)|(.{1,"+g+"})";return A.match(RegExp(I,"g")).join("\n")},g.prototype.getPrivateKey=function(){var A="-----BEGIN RSA PRIVATE KEY-----\n";return A+=g.wordwrap(this.getPrivateBaseKeyB64())+"\n",A+="-----END RSA PRIVATE KEY-----"},g.prototype.getPublicKey=function(){var A="-----BEGIN PUBLIC KEY-----\n";return A+=g.wordwrap(this.getPublicBaseKeyB64())+"\n",A+="-----END PUBLIC KEY-----"},g.hasPublicKeyProperty=function(A){return(A=A||{}).hasOwnProperty("n")&&A.hasOwnProperty("e")},g.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")},g.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)},g}(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(g){return!1}},A.prototype.encrypt=function(A){try{return hex2b64(this.getKey().encrypt(A))}catch(g){return!1}},A.prototype.sign=function(A,g,I){try{return hex2b64(this.getKey().sign(A,g,I))}catch(B){return!1}},A.prototype.verify=function(A,g,I){try{return this.getKey().verify(A,b64tohex(g),I)}catch(B){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 g;function I(A,g,I){null!=A&&("number"==typeof A?this.fromNumber(A,g,I):null==g&&"string"!=typeof A?this.fromString(A,256):this.fromString(A,g))}function B(){return new I(null)}var C="undefined"!=typeof navigator;C&&"Microsoft Internet Explorer"==navigator.appName?(I.prototype.am=function(A,g,I,B,C,E){for(var Q=32767&g,t=g>>15;--E>=0;){var i=32767&this[A],s=this[A++]>>15,k=t*i+s*Q;C=((i=Q*i+((32767&k)<<15)+I[B]+(1073741823&C))>>>30)+(k>>>15)+t*s+(C>>>30),I[B++]=1073741823&i}return C},g=30):C&&"Netscape"!=navigator.appName?(I.prototype.am=function(A,g,I,B,C,E){for(;--E>=0;){var Q=g*this[A++]+I[B]+C;C=Math.floor(Q/67108864),I[B++]=67108863&Q}return C},g=26):(I.prototype.am=function(A,g,I,B,C,E){for(var Q=16383&g,t=g>>14;--E>=0;){var i=16383&this[A],s=this[A++]>>14,k=t*i+s*Q;C=((i=Q*i+((16383&k)<<14)+I[B]+C)>>28)+(k>>14)+t*s,I[B++]=268435455&i}return C},g=28),I.prototype.DB=g,I.prototype.DM=(1<<g)-1,I.prototype.DV=1<<g,I.prototype.FV=Math.pow(2,52),I.prototype.F1=52-g,I.prototype.F2=2*g-52;var E,Q,t=new Array;for(E="0".charCodeAt(0),Q=0;Q<=9;++Q)t[E++]=Q;for(E="a".charCodeAt(0),Q=10;Q<36;++Q)t[E++]=Q;for(E="A".charCodeAt(0),Q=10;Q<36;++Q)t[E++]=Q;function i(A){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(A)}function s(A,g){var I=t[A.charCodeAt(g)];return null==I?-1:I}function k(A){var g=B();return g.fromInt(A),g}function r(A){var g,I=1;return 0!=(g=A>>>16)&&(A=g,I+=16),0!=(g=A>>8)&&(A=g,I+=8),0!=(g=A>>4)&&(A=g,I+=4),0!=(g=A>>2)&&(A=g,I+=2),0!=(g=A>>1)&&(A=g,I+=1),I}function Y(A){this.m=A}function S(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 J(A,g){return A&g}function G(A,g){return A|g}function a(A,g){return A^g}function w(A,g){return A&~g}function e(A){if(0==A)return-1;var g=0;return 65535&A||(A>>=16,g+=16),255&A||(A>>=8,g+=8),15&A||(A>>=4,g+=4),3&A||(A>>=2,g+=2),1&A||++g,g}function M(A){for(var g=0;0!=A;)A&=A-1,++g;return g}function o(){}function h(A){return A}function W(A){this.r2=B(),this.q3=B(),I.ONE.dlShiftTo(2*A.t,this.r2),this.mu=this.r2.divide(A),this.m=A}Y.prototype.convert=function(A){return A.s<0||A.compareTo(this.m)>=0?A.mod(this.m):A},Y.prototype.revert=function(A){return A},Y.prototype.reduce=function(A){A.divRemTo(this.m,null,A)},Y.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I),this.reduce(I)},Y.prototype.sqrTo=function(A,g){A.squareTo(g),this.reduce(g)},S.prototype.convert=function(A){var g=B();return A.abs().dlShiftTo(this.m.t,g),g.divRemTo(this.m,null,g),A.s<0&&g.compareTo(I.ZERO)>0&&this.m.subTo(g,g),g},S.prototype.revert=function(A){var g=B();return A.copyTo(g),this.reduce(g),g},S.prototype.reduce=function(A){for(;A.t<=this.mt2;)A[A.t++]=0;for(var g=0;g<this.m.t;++g){var I=32767&A[g],B=I*this.mpl+((I*this.mph+(A[g]>>15)*this.mpl&this.um)<<15)&A.DM;for(A[I=g+this.m.t]+=this.m.am(0,B,A,g,0,this.m.t);A[I]>=A.DV;)A[I]-=A.DV,A[++I]++}A.clamp(),A.drShiftTo(this.m.t,A),A.compareTo(this.m)>=0&&A.subTo(this.m,A)},S.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I),this.reduce(I)},S.prototype.sqrTo=function(A,g){A.squareTo(g),this.reduce(g)},I.prototype.copyTo=function(A){for(var g=this.t-1;g>=0;--g)A[g]=this[g];A.t=this.t,A.s=this.s},I.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},I.prototype.fromString=function(A,g){var B;if(16==g)B=4;else if(8==g)B=3;else if(256==g)B=8;else if(2==g)B=1;else if(32==g)B=5;else{if(4!=g)return void this.fromRadix(A,g);B=2}this.t=0,this.s=0;for(var C=A.length,E=!1,Q=0;--C>=0;){var t=8==B?255&A[C]:s(A,C);t<0?"-"==A.charAt(C)&&(E=!0):(E=!1,0==Q?this[this.t++]=t:Q+B>this.DB?(this[this.t-1]|=(t&(1<<this.DB-Q)-1)<<Q,this[this.t++]=t>>this.DB-Q):this[this.t-1]|=t<<Q,(Q+=B)>=this.DB&&(Q-=this.DB))}8==B&&128&A[0]&&(this.s=-1,Q>0&&(this[this.t-1]|=(1<<this.DB-Q)-1<<Q)),this.clamp(),E&&I.ZERO.subTo(this,this)},I.prototype.clamp=function(){for(var A=this.s&this.DM;this.t>0&&this[this.t-1]==A;)--this.t},I.prototype.dlShiftTo=function(A,g){var I;for(I=this.t-1;I>=0;--I)g[I+A]=this[I];for(I=A-1;I>=0;--I)g[I]=0;g.t=this.t+A,g.s=this.s},I.prototype.drShiftTo=function(A,g){for(var I=A;I<this.t;++I)g[I-A]=this[I];g.t=Math.max(this.t-A,0),g.s=this.s},I.prototype.lShiftTo=function(A,g){var I,B=A%this.DB,C=this.DB-B,E=(1<<C)-1,Q=Math.floor(A/this.DB),t=this.s<<B&this.DM;for(I=this.t-1;I>=0;--I)g[I+Q+1]=this[I]>>C|t,t=(this[I]&E)<<B;for(I=Q-1;I>=0;--I)g[I]=0;g[Q]=t,g.t=this.t+Q+1,g.s=this.s,g.clamp()},I.prototype.rShiftTo=function(A,g){g.s=this.s;var I=Math.floor(A/this.DB);if(I>=this.t)g.t=0;else{var B=A%this.DB,C=this.DB-B,E=(1<<B)-1;g[0]=this[I]>>B;for(var Q=I+1;Q<this.t;++Q)g[Q-I-1]|=(this[Q]&E)<<C,g[Q-I]=this[Q]>>B;B>0&&(g[this.t-I-1]|=(this.s&E)<<C),g.t=this.t-I,g.clamp()}},I.prototype.subTo=function(A,g){for(var I=0,B=0,C=Math.min(A.t,this.t);I<C;)B+=this[I]-A[I],g[I++]=B&this.DM,B>>=this.DB;if(A.t<this.t){for(B-=A.s;I<this.t;)B+=this[I],g[I++]=B&this.DM,B>>=this.DB;B+=this.s}else{for(B+=this.s;I<A.t;)B-=A[I],g[I++]=B&this.DM,B>>=this.DB;B-=A.s}g.s=B<0?-1:0,B<-1?g[I++]=this.DV+B:B>0&&(g[I++]=B),g.t=I,g.clamp()},I.prototype.multiplyTo=function(A,g){var B=this.abs(),C=A.abs(),E=B.t;for(g.t=E+C.t;--E>=0;)g[E]=0;for(E=0;E<C.t;++E)g[E+B.t]=B.am(0,C[E],g,E,0,B.t);g.s=0,g.clamp(),this.s!=A.s&&I.ZERO.subTo(g,g)},I.prototype.squareTo=function(A){for(var g=this.abs(),I=A.t=2*g.t;--I>=0;)A[I]=0;for(I=0;I<g.t-1;++I){var B=g.am(I,g[I],A,2*I,0,1);(A[I+g.t]+=g.am(I+1,2*g[I],A,2*I+1,B,g.t-I-1))>=g.DV&&(A[I+g.t]-=g.DV,A[I+g.t+1]=1)}A.t>0&&(A[A.t-1]+=g.am(I,g[I],A,2*I,0,1)),A.s=0,A.clamp()},I.prototype.divRemTo=function(A,g,C){var E=A.abs();if(!(E.t<=0)){var Q=this.abs();if(Q.t<E.t)return null!=g&&g.fromInt(0),void(null!=C&&this.copyTo(C));null==C&&(C=B());var t=B(),i=this.s,s=A.s,k=this.DB-r(E[E.t-1]);k>0?(E.lShiftTo(k,t),Q.lShiftTo(k,C)):(E.copyTo(t),Q.copyTo(C));var Y=t.t,S=t[Y-1];if(0!=S){var J=S*(1<<this.F1)+(Y>1?t[Y-2]>>this.F2:0),G=this.FV/J,a=(1<<this.F1)/J,w=1<<this.F2,e=C.t,M=e-Y,o=null==g?B():g;for(t.dlShiftTo(M,o),C.compareTo(o)>=0&&(C[C.t++]=1,C.subTo(o,C)),I.ONE.dlShiftTo(Y,o),o.subTo(t,t);t.t<Y;)t[t.t++]=0;for(;--M>=0;){var h=C[--e]==S?this.DM:Math.floor(C[e]*G+(C[e-1]+w)*a);if((C[e]+=t.am(0,h,C,M,0,Y))<h)for(t.dlShiftTo(M,o),C.subTo(o,C);C[e]<--h;)C.subTo(o,C)}null!=g&&(C.drShiftTo(Y,g),i!=s&&I.ZERO.subTo(g,g)),C.t=Y,C.clamp(),k>0&&C.rShiftTo(k,C),i<0&&I.ZERO.subTo(C,C)}}},I.prototype.invDigit=function(){if(this.t<1)return 0;var A=this[0];if(!(1&A))return 0;var g=3&A;return(g=(g=(g=(g=g*(2-(15&A)*g)&15)*(2-(255&A)*g)&255)*(2-((65535&A)*g&65535))&65535)*(2-A*g%this.DV)%this.DV)>0?this.DV-g:-g},I.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},I.prototype.exp=function(A,g){if(A>4294967295||A<1)return I.ONE;var C=B(),E=B(),Q=g.convert(this),t=r(A)-1;for(Q.copyTo(C);--t>=0;)if(g.sqrTo(C,E),(A&1<<t)>0)g.mulTo(E,Q,C);else{var i=C;C=E,E=i}return g.revert(C)},I.prototype.toString=function(A){if(this.s<0)return"-"+this.negate().toString(A);var g;if(16==A)g=4;else if(8==A)g=3;else if(2==A)g=1;else if(32==A)g=5;else{if(4!=A)return this.toRadix(A);g=2}var I,B=(1<<g)-1,C=!1,E="",Q=this.t,t=this.DB-Q*this.DB%g;if(Q-- >0)for(t<this.DB&&(I=this[Q]>>t)>0&&(C=!0,E=i(I));Q>=0;)t<g?(I=(this[Q]&(1<<t)-1)<<g-t,I|=this[--Q]>>(t+=this.DB-g)):(I=this[Q]>>(t-=g)&B,t<=0&&(t+=this.DB,--Q)),I>0&&(C=!0),C&&(E+=i(I));return C?E:"0"},I.prototype.negate=function(){var A=B();return I.ZERO.subTo(this,A),A},I.prototype.abs=function(){return this.s<0?this.negate():this},I.prototype.compareTo=function(A){var g=this.s-A.s;if(0!=g)return g;var I=this.t;if(0!=(g=I-A.t))return this.s<0?-g:g;for(;--I>=0;)if(0!=(g=this[I]-A[I]))return g;return 0},I.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+r(this[this.t-1]^this.s&this.DM)},I.prototype.mod=function(A){var g=B();return this.abs().divRemTo(A,null,g),this.s<0&&g.compareTo(I.ZERO)>0&&A.subTo(g,g),g},I.prototype.modPowInt=function(A,g){var I;return I=A<256||g.isEven()?new Y(g):new S(g),this.exp(A,I)},I.ZERO=k(0),I.ONE=k(1),o.prototype.convert=h,o.prototype.revert=h,o.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I)},o.prototype.sqrTo=function(A,g){A.squareTo(g)},W.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 g=B();return A.copyTo(g),this.reduce(g),g},W.prototype.revert=function(A){return A},W.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)},W.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I),this.reduce(I)},W.prototype.sqrTo=function(A,g){A.squareTo(g),this.reduce(g)};var D,l,R,V=[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],K=(1<<26)/V[V.length-1];function F(){var A;A=(new Date).getTime(),l[R++]^=255&A,l[R++]^=A>>8&255,l[R++]^=A>>16&255,l[R++]^=A>>24&255,R>=Z&&(R-=Z)}if(I.prototype.chunkSize=function(A){return Math.floor(Math.LN2*this.DB/Math.log(A))},I.prototype.toRadix=function(A){if(null==A&&(A=10),0==this.signum()||A<2||A>36)return"0";var g=this.chunkSize(A),I=Math.pow(A,g),C=k(I),E=B(),Q=B(),t="";for(this.divRemTo(C,E,Q);E.signum()>0;)t=(I+Q.intValue()).toString(A).substr(1)+t,E.divRemTo(C,E,Q);return Q.intValue().toString(A)+t},I.prototype.fromRadix=function(A,g){this.fromInt(0),null==g&&(g=10);for(var B=this.chunkSize(g),C=Math.pow(g,B),E=!1,Q=0,t=0,i=0;i<A.length;++i){var k=s(A,i);k<0?"-"==A.charAt(i)&&0==this.signum()&&(E=!0):(t=g*t+k,++Q>=B&&(this.dMultiply(C),this.dAddOffset(t,0),Q=0,t=0))}Q>0&&(this.dMultiply(Math.pow(g,Q)),this.dAddOffset(t,0)),E&&I.ZERO.subTo(this,this)},I.prototype.fromNumber=function(A,g,B){if("number"==typeof g)if(A<2)this.fromInt(1);else for(this.fromNumber(A,B),this.testBit(A-1)||this.bitwiseTo(I.ONE.shiftLeft(A-1),G,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(g);)this.dAddOffset(2,0),this.bitLength()>A&&this.subTo(I.ONE.shiftLeft(A-1),this);else{var C=new Array,E=7&A;C.length=1+(A>>3),g.nextBytes(C),E>0?C[0]&=(1<<E)-1:C[0]=0,this.fromString(C,256)}},I.prototype.bitwiseTo=function(A,g,I){var B,C,E=Math.min(A.t,this.t);for(B=0;B<E;++B)I[B]=g(this[B],A[B]);if(A.t<this.t){for(C=A.s&this.DM,B=E;B<this.t;++B)I[B]=g(this[B],C);I.t=this.t}else{for(C=this.s&this.DM,B=E;B<A.t;++B)I[B]=g(C,A[B]);I.t=A.t}I.s=g(this.s,A.s),I.clamp()},I.prototype.changeBit=function(A,g){var B=I.ONE.shiftLeft(A);return this.bitwiseTo(B,g,B),B},I.prototype.addTo=function(A,g){for(var I=0,B=0,C=Math.min(A.t,this.t);I<C;)B+=this[I]+A[I],g[I++]=B&this.DM,B>>=this.DB;if(A.t<this.t){for(B+=A.s;I<this.t;)B+=this[I],g[I++]=B&this.DM,B>>=this.DB;B+=this.s}else{for(B+=this.s;I<A.t;)B+=A[I],g[I++]=B&this.DM,B>>=this.DB;B+=A.s}g.s=B<0?-1:0,B>0?g[I++]=B:B<-1&&(g[I++]=this.DV+B),g.t=I,g.clamp()},I.prototype.dMultiply=function(A){this[this.t]=this.am(0,A-1,this,0,0,this.t),++this.t,this.clamp()},I.prototype.dAddOffset=function(A,g){if(0!=A){for(;this.t<=g;)this[this.t++]=0;for(this[g]+=A;this[g]>=this.DV;)this[g]-=this.DV,++g>=this.t&&(this[this.t++]=0),++this[g]}},I.prototype.multiplyLowerTo=function(A,g,I){var B,C=Math.min(this.t+A.t,g);for(I.s=0,I.t=C;C>0;)I[--C]=0;for(B=I.t-this.t;C<B;++C)I[C+this.t]=this.am(0,A[C],I,C,0,this.t);for(B=Math.min(A.t,g);C<B;++C)this.am(0,A[C],I,C,0,g-C);I.clamp()},I.prototype.multiplyUpperTo=function(A,g,I){--g;var B=I.t=this.t+A.t-g;for(I.s=0;--B>=0;)I[B]=0;for(B=Math.max(g-this.t,0);B<A.t;++B)I[this.t+B-g]=this.am(g-B,A[B],I,0,0,this.t+B-g);I.clamp(),I.drShiftTo(1,I)},I.prototype.modInt=function(A){if(A<=0)return 0;var g=this.DV%A,I=this.s<0?A-1:0;if(this.t>0)if(0==g)I=this[0]%A;else for(var B=this.t-1;B>=0;--B)I=(g*I+this[B])%A;return I},I.prototype.millerRabin=function(A){var g=this.subtract(I.ONE),C=g.getLowestSetBit();if(C<=0)return!1;var E=g.shiftRight(C);(A=A+1>>1)>V.length&&(A=V.length);for(var Q=B(),t=0;t<A;++t){Q.fromInt(V[Math.floor(Math.random()*V.length)]);var i=Q.modPow(E,this);if(0!=i.compareTo(I.ONE)&&0!=i.compareTo(g)){for(var s=1;s++<C&&0!=i.compareTo(g);)if(0==(i=i.modPowInt(2,this)).compareTo(I.ONE))return!1;if(0!=i.compareTo(g))return!1}}return!0},I.prototype.clone=function(){var A=B();return this.copyTo(A),A},I.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]},I.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},I.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},I.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},I.prototype.toByteArray=function(){var A=this.t,g=new Array;g[0]=this.s;var I,B=this.DB-A*this.DB%8,C=0;if(A-- >0)for(B<this.DB&&(I=this[A]>>B)!=(this.s&this.DM)>>B&&(g[C++]=I|this.s<<this.DB-B);A>=0;)B<8?(I=(this[A]&(1<<B)-1)<<8-B,I|=this[--A]>>(B+=this.DB-8)):(I=this[A]>>(B-=8)&255,B<=0&&(B+=this.DB,--A)),128&I&&(I|=-256),0==C&&(128&this.s)!=(128&I)&&++C,(C>0||I!=this.s)&&(g[C++]=I);return g},I.prototype.equals=function(A){return 0==this.compareTo(A)},I.prototype.min=function(A){return this.compareTo(A)<0?this:A},I.prototype.max=function(A){return this.compareTo(A)>0?this:A},I.prototype.and=function(A){var g=B();return this.bitwiseTo(A,J,g),g},I.prototype.or=function(A){var g=B();return this.bitwiseTo(A,G,g),g},I.prototype.xor=function(A){var g=B();return this.bitwiseTo(A,a,g),g},I.prototype.andNot=function(A){var g=B();return this.bitwiseTo(A,w,g),g},I.prototype.not=function(){for(var A=B(),g=0;g<this.t;++g)A[g]=this.DM&~this[g];return A.t=this.t,A.s=~this.s,A},I.prototype.shiftLeft=function(A){var g=B();return A<0?this.rShiftTo(-A,g):this.lShiftTo(A,g),g},I.prototype.shiftRight=function(A){var g=B();return A<0?this.lShiftTo(-A,g):this.rShiftTo(A,g),g},I.prototype.getLowestSetBit=function(){for(var A=0;A<this.t;++A)if(0!=this[A])return A*this.DB+e(this[A]);return this.s<0?this.t*this.DB:-1},I.prototype.bitCount=function(){for(var A=0,g=this.s&this.DM,I=0;I<this.t;++I)A+=M(this[I]^g);return A},I.prototype.testBit=function(A){var g=Math.floor(A/this.DB);return g>=this.t?0!=this.s:!!(this[g]&1<<A%this.DB)},I.prototype.setBit=function(A){return this.changeBit(A,G)},I.prototype.clearBit=function(A){return this.changeBit(A,w)},I.prototype.flipBit=function(A){return this.changeBit(A,a)},I.prototype.add=function(A){var g=B();return this.addTo(A,g),g},I.prototype.subtract=function(A){var g=B();return this.subTo(A,g),g},I.prototype.multiply=function(A){var g=B();return this.multiplyTo(A,g),g},I.prototype.divide=function(A){var g=B();return this.divRemTo(A,g,null),g},I.prototype.remainder=function(A){var g=B();return this.divRemTo(A,null,g),g},I.prototype.divideAndRemainder=function(A){var g=B(),I=B();return this.divRemTo(A,g,I),new Array(g,I)},I.prototype.modPow=function(A,g){var I,C,E=A.bitLength(),Q=k(1);if(E<=0)return Q;I=E<18?1:E<48?3:E<144?4:E<768?5:6,C=E<8?new Y(g):g.isEven()?new W(g):new S(g);var t=new Array,i=3,s=I-1,J=(1<<I)-1;if(t[1]=C.convert(this),I>1){var G=B();for(C.sqrTo(t[1],G);i<=J;)t[i]=B(),C.mulTo(G,t[i-2],t[i]),i+=2}var a,w,e=A.t-1,M=!0,o=B();for(E=r(A[e])-1;e>=0;){for(E>=s?a=A[e]>>E-s&J:(a=(A[e]&(1<<E+1)-1)<<s-E,e>0&&(a|=A[e-1]>>this.DB+E-s)),i=I;!(1&a);)a>>=1,--i;if((E-=i)<0&&(E+=this.DB,--e),M)t[a].copyTo(Q),M=!1;else{for(;i>1;)C.sqrTo(Q,o),C.sqrTo(o,Q),i-=2;i>0?C.sqrTo(Q,o):(w=Q,Q=o,o=w),C.mulTo(o,t[a],Q)}for(;e>=0&&!(A[e]&1<<E);)C.sqrTo(Q,o),w=Q,Q=o,o=w,--E<0&&(E=this.DB-1,--e)}return C.revert(Q)},I.prototype.modInverse=function(A){var g=A.isEven();if(this.isEven()&&g||0==A.signum())return I.ZERO;for(var B=A.clone(),C=this.clone(),E=k(1),Q=k(0),t=k(0),i=k(1);0!=B.signum();){for(;B.isEven();)B.rShiftTo(1,B),g?(E.isEven()&&Q.isEven()||(E.addTo(this,E),Q.subTo(A,Q)),E.rShiftTo(1,E)):Q.isEven()||Q.subTo(A,Q),Q.rShiftTo(1,Q);for(;C.isEven();)C.rShiftTo(1,C),g?(t.isEven()&&i.isEven()||(t.addTo(this,t),i.subTo(A,i)),t.rShiftTo(1,t)):i.isEven()||i.subTo(A,i),i.rShiftTo(1,i);B.compareTo(C)>=0?(B.subTo(C,B),g&&E.subTo(t,E),Q.subTo(i,Q)):(C.subTo(B,C),g&&t.subTo(E,t),i.subTo(Q,i))}return 0!=C.compareTo(I.ONE)?I.ZERO:i.compareTo(A)>=0?i.subtract(A):i.signum()<0?(i.addTo(A,i),i.signum()<0?i.add(A):i):i},I.prototype.pow=function(A){return this.exp(A,new o)},I.prototype.gcd=function(A){var g=this.s<0?this.negate():this.clone(),I=A.s<0?A.negate():A.clone();if(g.compareTo(I)<0){var B=g;g=I,I=B}var C=g.getLowestSetBit(),E=I.getLowestSetBit();if(E<0)return g;for(C<E&&(E=C),E>0&&(g.rShiftTo(E,g),I.rShiftTo(E,I));g.signum()>0;)(C=g.getLowestSetBit())>0&&g.rShiftTo(C,g),(C=I.getLowestSetBit())>0&&I.rShiftTo(C,I),g.compareTo(I)>=0?(g.subTo(I,g),g.rShiftTo(1,g)):(I.subTo(g,I),I.rShiftTo(1,I));return E>0&&I.lShiftTo(E,I),I},I.prototype.isProbablePrime=function(A){var g,I=this.abs();if(1==I.t&&I[0]<=V[V.length-1]){for(g=0;g<V.length;++g)if(I[0]==V[g])return!0;return!1}if(I.isEven())return!1;for(g=1;g<V.length;){for(var B=V[g],C=g+1;C<V.length&&B<K;)B*=V[C++];for(B=I.modInt(B);g<C;)if(B%V[g++]==0)return!1}return I.millerRabin(A)},I.prototype.square=function(){var A=B();return this.squareTo(A),A},I.prototype.Barrett=W,null==l){var n;if(l=new Array,R=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var y=new Uint8Array(32);for(window.crypto.getRandomValues(y),n=0;n<32;++n)l[R++]=y[n]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var U=window.crypto.random(32);for(n=0;n<U.length;++n)l[R++]=255&U.charCodeAt(n)}for(;R<Z;)n=Math.floor(65536*Math.random()),l[R++]=n>>>8,l[R++]=255&n;R=0,F()}function q(){if(null==D){for(F(),(D=new b).init(l),R=0;R<l.length;++R)l[R]=0;R=0}return D.next()}function x(){}function b(){this.i=0,this.j=0,this.S=new Array}x.prototype.nextBytes=function(A){var g;for(g=0;g<A.length;++g)A[g]=q()},b.prototype.init=function(A){var g,I,B;for(g=0;g<256;++g)this.S[g]=g;for(I=0,g=0;g<256;++g)I=I+this.S[g]+A[g%A.length]&255,B=this.S[g],this.S[g]=this.S[I],this.S[I]=B;this.i=0,this.j=0},b.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 Z=256;A.exports={default:I,BigInteger:I,SecureRandom:x}}.call(jsbn)),jsbn$1.exports;var A}function requireAsn1(){if(hasRequiredAsn1)return asn1;hasRequiredAsn1=1;const{BigInteger:A}=requireJsbn();class g{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 g=A.toString(16);if(g.length%2==1&&(g="0"+g),A<128)return g;return(128+g.length/2).toString(16)+g}getValue(){return""}}class I extends g{constructor(g){super(),this.t="02",g&&(this.v=function(g){let I=g.toString(16);if("-"!==I[0])I.length%2==1?I="0"+I:I.match(/^[0-7]/)||(I="00"+I);else{I=I.substr(1);let B=I.length;B%2==1?B+=1:I.match(/^[0-7]/)||(B+=2);let C="";for(let A=0;A<B;A++)C+="f";C=new A(C,16),I=C.xor(g).add(A.ONE),I=I.toString(16).replace(/^-/,"")}return I}(g))}getValue(){return this.v}}class B extends g{constructor(A){super(),this.t="30",this.asn1Array=A}getValue(){return this.v=this.asn1Array.map(A=>A.getEncodedHex()).join(""),this.v}}function C(A,g){return+A[g+2]<8?1:128&+A.substr(g+2,2)}function E(g,I){const B=C(g,I),E=g.substr(I+2,2*B);if(!E)return-1;return(+E[0]<8?new A(E,16):new A(E.substr(2),16)).intValue()}function Q(A,g){return g+2*(C(A,g)+1)}return asn1={encodeDer(A,g){const C=new I(A),E=new I(g);return new B([C,E]).getEncodedHex()},decodeDer(g){const I=Q(g,0),B=Q(g,I),C=E(g,I),t=g.substr(B,2*C),i=B+t.length,s=Q(g,i),k=E(g,i),r=g.substr(s,2*k);return{r:new A(t,16),s:new A(r,16)}}}}function requireUtils(){if(hasRequiredUtils)return utils$2;hasRequiredUtils=1;const{BigInteger:A,SecureRandom:g}=requireJsbn(),{ECCurveFp:I}=function(){if(hasRequiredEc)return ec;hasRequiredEc=1;const{BigInteger:A}=requireJsbn(),g=new A("2"),I=new A("3");class B{constructor(A,g){this.x=g,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 B(this.q,this.x.negate().mod(this.q))}add(A){return new B(this.q,this.x.add(A.toBigInteger()).mod(this.q))}subtract(A){return new B(this.q,this.x.subtract(A.toBigInteger()).mod(this.q))}multiply(A){return new B(this.q,this.x.multiply(A.toBigInteger()).mod(this.q))}divide(A){return new B(this.q,this.x.multiply(A.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new B(this.q,this.x.square().mod(this.q))}}class C{constructor(g,I,B,C){this.curve=g,this.x=I,this.y=B,this.z=null==C?A.ONE:C,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(g){return g===this||(this.isInfinity()?g.isInfinity():g.isInfinity()?this.isInfinity():!!g.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(g.z)).mod(this.curve.q).equals(A.ZERO)&&g.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(g.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 C(this.curve,this.x,this.y.negate(),this.z)}add(g){if(this.isInfinity())return g;if(g.isInfinity())return this;const I=this.x.toBigInteger(),B=this.y.toBigInteger(),E=this.z,Q=g.x.toBigInteger(),t=g.y.toBigInteger(),i=g.z,s=this.curve.q,k=I.multiply(i).mod(s),r=Q.multiply(E).mod(s),Y=k.subtract(r),S=B.multiply(i).mod(s),J=t.multiply(E).mod(s),G=S.subtract(J);if(A.ZERO.equals(Y))return A.ZERO.equals(G)?this.twice():this.curve.infinity;const a=k.add(r),w=E.multiply(i).mod(s),e=Y.square().mod(s),M=Y.multiply(e).mod(s),o=w.multiply(G.square()).subtract(a.multiply(e)).mod(s),h=Y.multiply(o).mod(s),W=G.multiply(e.multiply(k).subtract(o)).subtract(S.multiply(M)).mod(s),D=M.multiply(w).mod(s);return new C(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(W),D)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const A=this.x.toBigInteger(),g=this.y.toBigInteger(),B=this.z,E=this.curve.q,Q=this.curve.a.toBigInteger(),t=A.square().multiply(I).add(Q.multiply(B.square())).mod(E),i=g.shiftLeft(1).multiply(B).mod(E),s=g.square().mod(E),k=s.multiply(A).multiply(B).mod(E),r=i.square().mod(E),Y=t.square().subtract(k.shiftLeft(3)).mod(E),S=i.multiply(Y).mod(E),J=t.multiply(k.shiftLeft(2).subtract(Y)).subtract(r.shiftLeft(1).multiply(s)).mod(E),G=i.multiply(r).mod(E);return new C(this.curve,this.curve.fromBigInteger(S),this.curve.fromBigInteger(J),G)}multiply(A){if(this.isInfinity())return this;if(!A.signum())return this.curve.infinity;const g=A.multiply(I),B=this.negate();let C=this;for(let I=g.bitLength()-2;I>0;I--){C=C.twice();const E=g.testBit(I);E!==A.testBit(I)&&(C=C.add(E?this:B))}return C}}return ec={ECPointFp:C,ECCurveFp:class{constructor(A,g,I){this.q=A,this.a=this.fromBigInteger(g),this.b=this.fromBigInteger(I),this.infinity=new C(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 B(this.q,A)}decodePointHex(I){switch(parseInt(I.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const B=this.fromBigInteger(new A(I.substr(2),16));let E=this.fromBigInteger(B.multiply(B.square()).add(B.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new A("4")).add(A.ONE),this.q));return E.toBigInteger().mod(g).equals(new A(I.substr(0,2),16).subtract(g))||(E=E.negate()),new C(this,B,E);case 4:case 6:case 7:const Q=(I.length-2)/2,t=I.substr(2,Q),i=I.substr(Q+2,Q);return new C(this,this.fromBigInteger(new A(t,16)),this.fromBigInteger(new A(i,16)));default:return null}}}}}(),B=new g,{curve:C,G:E,n:Q}=t();function t(){const g=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),B=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),C=new A("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),E=new I(g,B,C),Q=E.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:E,G:Q,n:new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function i(A,g){return A.length>=g?A:new Array(g-A.length+1).join("0")+A}return utils$2={getGlobalCurve:function(){return C},generateEcparam:t,generateKeyPairHex:function(g,I,C){const t=(g?new A(g,I,C):new A(Q.bitLength(),B)).mod(Q.subtract(A.ONE)).add(A.ONE),s=i(t.toString(16),64),k=E.multiply(t);return{privateKey:s,publicKey:"04"+i(k.getX().toBigInteger().toString(16),64)+i(k.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(g){if(130!==g.length)throw new Error("Invalid public key to compress");const I=(g.length-2)/2,B=g.substr(2,I);let C="03";return new A(g.substr(I+2,I),16).mod(new A("2")).equals(A.ZERO)&&(C="02"),C+B},utf8ToHex:function(A){const g=(A=unescape(encodeURIComponent(A))).length,I=[];for(let C=0;C<g;C++)I[C>>>2]|=(255&A.charCodeAt(C))<<24-C%4*8;const B=[];for(let C=0;C<g;C++){const A=I[C>>>2]>>>24-C%4*8&255;B.push((A>>>4).toString(16)),B.push((15&A).toString(16))}return B.join("")},leftPad:i,arrayToHex:function(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")},arrayToUtf8:function(A){const g=[];let I=0;for(let C=0;C<2*A.length;C+=2)g[C>>>3]|=parseInt(A[I],10)<<24-C%8*4,I++;try{const I=[];for(let B=0;B<A.length;B++){const A=g[B>>>2]>>>24-B%4*8&255;I.push(String.fromCharCode(A))}return decodeURIComponent(escape(I.join("")))}catch(B){throw new Error("Malformed UTF-8 data")}},hexToArray:function(A){const g=[];let I=A.length;I%2!=0&&(A=i(A,I+1)),I=A.length;for(let B=0;B<I;B+=2)g.push(parseInt(A.substr(B,2),16));return g},verifyPublicKey:function(A){const g=C.decodePointHex(A);if(!g)return!1;const I=g.getX();return g.getY().square().equals(I.multiply(I.square()).add(I.multiply(C.a)).add(C.b))},comparePublicKeyHex:function(A,g){const I=C.decodePointHex(A);if(!I)return!1;const B=C.decodePointHex(g);return!!B&&I.equals(B)}}}function requireSm3$1(){if(hasRequiredSm3$1)return sm3_1$1;hasRequiredSm3$1=1;const A=new Uint32Array(68),g=new Uint32Array(64);function I(A,g){const I=31&g;return A<<I|A>>>32-I}function B(A,g){const I=[];for(let B=A.length-1;B>=0;B--)I[B]=255&(A[B]^g[B]);return I}function C(A){return A^I(A,9)^I(A,17)}function E(A){return A^I(A,15)^I(A,23)}function Q(B){let Q=8*B.length,t=Q%512;t=t>=448?512-t%448-1:448-t-1;const i=new Array((t-7)/8),s=new Array(8);for(let A=0,g=i.length;A<g;A++)i[A]=0;for(let A=0,g=s.length;A<g;A++)s[A]=0;Q=Q.toString(2);for(let A=7;A>=0;A--)if(Q.length>8){const g=Q.length-8;s[A]=parseInt(Q.substr(g),2),Q=Q.substr(0,g)}else Q.length>0&&(s[A]=parseInt(Q,2),Q="");const k=new Uint8Array([...B,128,...i,...s]),r=new DataView(k.buffer,0),Y=k.length/64,S=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let G=0;G<Y;G++){A.fill(0),g.fill(0);const B=16*G;for(let g=0;g<16;g++)A[g]=r.getUint32(4*(B+g),!1);for(let g=16;g<68;g++)A[g]=E(A[g-16]^A[g-9]^I(A[g-3],15))^I(A[g-13],7)^A[g-6];for(let I=0;I<64;I++)g[I]=A[I]^A[I+4];const Q=2043430169,t=2055708042;let i,s,k,Y,J,a=S[0],w=S[1],e=S[2],M=S[3],o=S[4],h=S[5],W=S[6],D=S[7];for(let E=0;E<64;E++)J=E>=0&&E<=15?Q:t,i=I(I(a,12)+o+I(J,E),7),s=i^I(a,12),k=(E>=0&&E<=15?a^w^e:a&w|a&e|w&e)+M+s+g[E],Y=(E>=0&&E<=15?o^h^W:o&h|~o&W)+D+i+A[E],M=e,e=I(w,9),w=a,a=k,D=W,W=I(h,19),h=o,o=C(Y);S[0]^=a,S[1]^=w,S[2]^=e,S[3]^=M,S[4]^=o,S[5]^=h,S[6]^=W,S[7]^=D}const J=[];for(let A=0,g=S.length;A<g;A++){const g=S[A];J.push((4278190080&g)>>>24,(16711680&g)>>>16,(65280&g)>>>8,255&g)}return J}const t=new Uint8Array(64),i=new Uint8Array(64);for(let s=0;s<64;s++)t[s]=54,i[s]=92;return sm3_1$1={sm3:Q,hmac:function(A,g){for(g.length>64&&(g=Q(g));g.length<64;)g.push(0);const I=B(g,t),C=B(g,i),E=Q([...I,...A]);return Q([...C,...E])}}}function requireSm2(){if(hasRequiredSm2)return sm2;hasRequiredSm2=1;const{BigInteger:A}=requireJsbn(),{encodeDer:g,decodeDer:I}=requireAsn1(),B=requireUtils(),C=requireSm3$1().sm3,{G:E,curve:Q,n:t}=B.generateEcparam();function i(A,g,I="1234567812345678"){I=B.utf8ToHex(I);const Q=B.leftPad(E.curve.a.toBigInteger().toRadix(16),64),t=B.leftPad(E.curve.b.toBigInteger().toRadix(16),64),i=B.leftPad(E.getX().toBigInteger().toRadix(16),64),s=B.leftPad(E.getY().toBigInteger().toRadix(16),64);let k,r;if(128===g.length)k=g.substr(0,64),r=g.substr(64,64);else{const A=E.curve.decodePointHex(g);k=B.leftPad(A.getX().toBigInteger().toRadix(16),64),r=B.leftPad(A.getY().toBigInteger().toRadix(16),64)}const Y=B.hexToArray(I+Q+t+i+s+k+r),S=4*I.length;Y.unshift(255&S),Y.unshift(S>>8&255);const J=C(Y);return B.arrayToHex(C(J.concat(B.hexToArray(A))))}function s(g){const I=E.multiply(new A(g,16));return"04"+B.leftPad(I.getX().toBigInteger().toString(16),64)+B.leftPad(I.getY().toBigInteger().toString(16),64)}function k(){const g=B.generateKeyPairHex(),I=Q.decodePointHex(g.publicKey);return g.k=new A(g.privateKey,16),g.x1=I.getX().toBigInteger(),g}return sm2={generateKeyPairHex:B.generateKeyPairHex,compressPublicKeyHex:B.compressPublicKeyHex,comparePublicKeyHex:B.comparePublicKeyHex,doEncrypt:function(g,I,E=1){g="string"==typeof g?B.hexToArray(B.utf8ToHex(g)):Array.prototype.slice.call(g),I=B.getGlobalCurve().decodePointHex(I);const Q=B.generateKeyPairHex(),t=new A(Q.privateKey,16);let i=Q.publicKey;i.length>128&&(i=i.substr(i.length-128));const s=I.multiply(t),k=B.hexToArray(B.leftPad(s.getX().toBigInteger().toRadix(16),64)),r=B.hexToArray(B.leftPad(s.getY().toBigInteger().toRadix(16),64)),Y=B.arrayToHex(C([].concat(k,g,r)));let S=1,J=0,G=[];const a=[].concat(k,r),w=()=>{G=C([...a,S>>24&255,S>>16&255,S>>8&255,255&S]),S++,J=0};w();for(let A=0,B=g.length;A<B;A++)J===G.length&&w(),g[A]^=255&G[J++];const e=B.arrayToHex(g);return 0===E?i+e+Y:i+Y+e},doDecrypt:function(g,I,E=1,{output:Q="string"}={}){I=new A(I,16);let t=g.substr(128,64),i=g.substr(192);0===E&&(t=g.substr(g.length-64),i=g.substr(128,g.length-128-64));const s=B.hexToArray(i),k=B.getGlobalCurve().decodePointHex("04"+g.substr(0,128)).multiply(I),r=B.hexToArray(B.leftPad(k.getX().toBigInteger().toRadix(16),64)),Y=B.hexToArray(B.leftPad(k.getY().toBigInteger().toRadix(16),64));let S=1,J=0,G=[];const a=[].concat(r,Y),w=()=>{G=C([...a,S>>24&255,S>>16&255,S>>8&255,255&S]),S++,J=0};w();for(let A=0,B=s.length;A<B;A++)J===G.length&&w(),s[A]^=255&G[J++];return B.arrayToHex(C([].concat(r,s,Y)))===t.toLowerCase()?"array"===Q?s:B.arrayToUtf8(s):"array"===Q?[]:""},doSignature:function(I,C,{pointPool:E,der:Q,hash:r,publicKey:Y,userId:S}={}){let J="string"==typeof I?B.utf8ToHex(I):B.arrayToHex(I);r&&(J=i(J,Y=Y||s(C),S));const G=new A(C,16),a=new A(J,16);let w=null,e=null,M=null;do{do{let A;A=E&&E.length?E.pop():k(),w=A.k,e=a.add(A.x1).mod(t)}while(e.equals(A.ZERO)||e.add(w).equals(t));M=G.add(A.ONE).modInverse(t).multiply(w.subtract(e.multiply(G))).mod(t)}while(M.equals(A.ZERO));return Q?g(e,M):B.leftPad(e.toString(16),64)+B.leftPad(M.toString(16),64)},doVerifySignature:function(g,C,s,{der:k,hash:r,userId:Y}={}){let S,J,G="string"==typeof g?B.utf8ToHex(g):B.arrayToHex(g);if(r&&(G=i(G,s,Y)),k){const A=I(C);S=A.r,J=A.s}else S=new A(C.substring(0,64),16),J=new A(C.substring(64),16);const a=Q.decodePointHex(s),w=new A(G,16),e=S.add(J).mod(t);if(e.equals(A.ZERO))return!1;const M=E.multiply(J).add(a.multiply(e)),o=w.add(M.getX().toBigInteger()).mod(t);return S.equals(o)},getPublicKeyFromPrivateKey:s,getPoint:k,verifyPublicKey:B.verifyPublicKey},sm2}function requireSm3(){if(hasRequiredSm3)return sm3_1;hasRequiredSm3=1;const{sm3:A,hmac:g}=requireSm3$1();function I(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")}function B(A){const g=[];let I=A.length;var B,C;I%2!=0&&(C=I+1,A=(B=A).length>=C?B:new Array(C-B.length+1).join("0")+B),I=A.length;for(let E=0;E<I;E+=2)g.push(parseInt(A.substr(E,2),16));return g}return sm3_1=function(C,E){if(C="string"==typeof C?function(A){const g=[];for(let I=0,B=A.length;I<B;I++){const B=A.codePointAt(I);if(B<=127)g.push(B);else if(B<=2047)g.push(192|B>>>6),g.push(128|63&B);else if(B<=55295||B>=57344&&B<=65535)g.push(224|B>>>12),g.push(128|B>>>6&63),g.push(128|63&B);else{if(!(B>=65536&&B<=1114111))throw g.push(B),new Error("input is not supported");I++,g.push(240|B>>>18&28),g.push(128|B>>>12&63),g.push(128|B>>>6&63),g.push(128|63&B)}}return g}(C):Array.prototype.slice.call(C),E){if("hmac"!==(E.mode||"hmac"))throw new Error("invalid mode");let A=E.key;if(!A)throw new Error("invalid key");return A="string"==typeof A?B(A):Array.prototype.slice.call(A),I(g(C,A))}return I(A(C))}}function requireSm4(){if(hasRequiredSm4)return sm4_1;hasRequiredSm4=1;const A=16,g=[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],I=[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 B(A){const g=[];for(let I=0,B=A.length;I<B;I+=2)g.push(parseInt(A.substr(I,2),16));return g}function C(A,g){const I=31&g;return A<<I|A>>>32-I}function E(A){return(255&g[A>>>24&255])<<24|(255&g[A>>>16&255])<<16|(255&g[A>>>8&255])<<8|255&g[255&A]}function Q(A){return A^C(A,2)^C(A,10)^C(A,18)^C(A,24)}function t(A){return A^C(A,13)^C(A,23)}function i(A,g,I){const B=new Array(4),C=new Array(4);for(let E=0;E<4;E++)C[0]=255&A[4*E],C[1]=255&A[4*E+1],C[2]=255&A[4*E+2],C[3]=255&A[4*E+3],B[E]=C[0]<<24|C[1]<<16|C[2]<<8|C[3];for(let t,i=0;i<32;i+=4)t=B[1]^B[2]^B[3]^I[i+0],B[0]^=Q(E(t)),t=B[2]^B[3]^B[0]^I[i+1],B[1]^=Q(E(t)),t=B[3]^B[0]^B[1]^I[i+2],B[2]^=Q(E(t)),t=B[0]^B[1]^B[2]^I[i+3],B[3]^=Q(E(t));for(let E=0;E<16;E+=4)g[E]=B[3-E/4]>>>24&255,g[E+1]=B[3-E/4]>>>16&255,g[E+2]=B[3-E/4]>>>8&255,g[E+3]=255&B[3-E/4]}function s(g,C,Q,{padding:s="pkcs#7",mode:k,iv:r=[],output:Y="string"}={}){if("cbc"===k&&("string"==typeof r&&(r=B(r)),16!==r.length))throw new Error("iv is invalid");if("string"==typeof C&&(C=B(C)),16!==C.length)throw new Error("key is invalid");if(g="string"==typeof g?0!==Q?function(A){const g=[];for(let I=0,B=A.length;I<B;I++){const B=A.codePointAt(I);if(B<=127)g.push(B);else if(B<=2047)g.push(192|B>>>6),g.push(128|63&B);else if(B<=55295||B>=57344&&B<=65535)g.push(224|B>>>12),g.push(128|B>>>6&63),g.push(128|63&B);else{if(!(B>=65536&&B<=1114111))throw g.push(B),new Error("input is not supported");I++,g.push(240|B>>>18&28),g.push(128|B>>>12&63),g.push(128|B>>>6&63),g.push(128|63&B)}}return g}(g):B(g):[...g],("pkcs#5"===s||"pkcs#7"===s)&&0!==Q){const I=A-g.length%A;for(let A=0;A<I;A++)g.push(I)}const S=new Array(32);!function(A,g,B){const C=new Array(4),Q=new Array(4);for(let I=0;I<4;I++)Q[0]=255&A[0+4*I],Q[1]=255&A[1+4*I],Q[2]=255&A[2+4*I],Q[3]=255&A[3+4*I],C[I]=Q[0]<<24|Q[1]<<16|Q[2]<<8|Q[3];C[0]^=2746333894,C[1]^=1453994832,C[2]^=1736282519,C[3]^=2993693404;for(let i,s=0;s<32;s+=4)i=C[1]^C[2]^C[3]^I[s+0],g[s+0]=C[0]^=t(E(i)),i=C[2]^C[3]^C[0]^I[s+1],g[s+1]=C[1]^=t(E(i)),i=C[3]^C[0]^C[1]^I[s+2],g[s+2]=C[2]^=t(E(i)),i=C[0]^C[1]^C[2]^I[s+3],g[s+3]=C[3]^=t(E(i));if(0===B)for(let I,E=0;E<16;E++)I=g[E],g[E]=g[31-E],g[31-E]=I}(C,S,Q);const J=[];let G=r,a=g.length,w=0;for(;a>=A;){const I=g.slice(w,w+16),B=new Array(16);if("cbc"===k)for(let g=0;g<A;g++)0!==Q&&(I[g]^=G[g]);i(I,B,S);for(let g=0;g<A;g++)"cbc"===k&&0===Q&&(B[g]^=G[g]),J[w+g]=B[g];"cbc"===k&&(G=0!==Q?B:I),a-=A,w+=A}if(("pkcs#5"===s||"pkcs#7"===s)&&0===Q){const A=J.length,g=J[A-1];for(let I=1;I<=g;I++)if(J[A-I]!==g)throw new Error("padding is invalid");J.splice(A-g,g)}return"array"!==Y?0!==Q?J.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join(""):function(A){const g=[];for(let I=0,B=A.length;I<B;I++)A[I]>=240&&A[I]<=247?(g.push(String.fromCodePoint(((7&A[I])<<18)+((63&A[I+1])<<12)+((63&A[I+2])<<6)+(63&A[I+3]))),I+=3):A[I]>=224&&A[I]<=239?(g.push(String.fromCodePoint(((15&A[I])<<12)+((63&A[I+1])<<6)+(63&A[I+2]))),I+=2):A[I]>=192&&A[I]<=223?(g.push(String.fromCodePoint(((31&A[I])<<6)+(63&A[I+1]))),I++):g.push(String.fromCodePoint(A[I]));return g.join("")}(J):J}return sm4_1={encrypt:(A,g,I)=>s(A,g,1,I),decrypt:(A,g,I)=>s(A,g,0,I)}}const smCrypto=getDefaultExportFromCjs(hasRequiredSrc?src:(hasRequiredSrc=1,src={sm2:requireSm2(),sm3:requireSm3(),sm4:requireSm4()}));class MyCryptoJS{constructor(A,g,I,B){__privateAdd(this,_key,null),__privateAdd(this,_iv,null),__privateAdd(this,_publicKey,null),__privateAdd(this,_privateKey,null),__privateAdd(this,_formatType,(A,g=!1)=>{if(!g)return"object"==typeof A?JSON.stringify(A):String(A);try{return JSON.parse(A)}catch(I){return A}}),this.setkey(A),this.setiv(g),this.setPublicKey(I),this.setPrivateKey(B)}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,g){return smCrypto.sm2.doEncrypt(A,g,{inputEncoding:"utf8",outputEncoding:"hex",pointFormat:"uncompressed",cipherMode:1})}sm2Decrypt(A,g){return smCrypto.sm2.doDecrypt(A,g,1)}RSAencrypt(A){A=__privateGet(this,_formatType).call(this,A);const g=new JSEncrypt;return g.setPublicKey(__privateGet(this,_publicKey)),g.encrypt(A)}RSAdecrypt(A){const g=new JSEncrypt;return g.setPrivateKey(__privateGet(this,_privateKey)),__privateGet(this,_formatType).call(this,g.decrypt(A),!0)}stringToWordArray(A){return CryptoJS.enc.Utf8.parse(A)}wordArrayToString(A){return A.toString(CryptoJS.enc.Utf8)}AESencrypt(A,g=!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(g?CryptoJS.enc.Base64:CryptoJS.enc.Hex)}AESdecrypt(A,g=!0){A=g?A:CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(A));let I=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,I.toString(CryptoJS.enc.Utf8),!0)}DESencrypt(A,g=!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(g?CryptoJS.enc.Base64:CryptoJS.enc.Hex)}DESdecrypt(A,g=!0){A=g?A:CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(A));let I=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,I.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,g,I){return new Promise((B,C)=>{if(!A)return void C("");const E=new FileReader;if(E.onerror=A=>{C(A)},g){const t=CryptoJS.algo.MD5.create();let i=0;try{let C=function(){const I=A.slice(i,i+g);E.readAsArrayBuffer(I)};E.onload=E=>{const Q=CryptoJS.lib.WordArray.create(new Uint8Array(E.target.result));if(t.update(Q),"function"==typeof I&&I(i,A.size),i+=g,i<A.size)C();else{const A=t.finalize();B(A.toString(CryptoJS.enc.Hex))}},C()}catch(Q){C(Q)}}else E.onload=g=>{"function"==typeof I&&I(A.size,A.size),B(CryptoJS.MD5(CryptoJS.lib.WordArray.create(g.target.result)).toString())},E.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 g=CryptoJS.lib.WordArray.random(16);return CryptoJS.PBKDF2(A,g,{keySize:8,iterations:1e3}).toString()}hmac(A,g){return A=__privateGet(this,_formatType).call(this,A),CryptoJS.HmacSHA256(A,g).toString(CryptoJS.enc.Hex)}}function randomStr$1(A=18,g=36){(g<2||g>36)&&(g=36);var I=Math.random().toString(g).substring(2,13).padEnd(11,"0").slice(0,A);return A<=11?I:I+randomStr$1(A-11)}function hexToRgb(A){A=A.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(A,g,I,B)=>g+g+I+I+B+B);const g=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);return g?{r:parseInt(g[1],16),g:parseInt(g[2],16),b:parseInt(g[3],16)}:null}function fileTurnBase64(A){return new Promise((g,I)=>{if(A)try{var B=new FileReader;let C="";B.readAsDataURL(A),B.onload=function(){C=B.result},B.onerror=function(A){I(A)},B.onloadend=function(){g(C)}}catch(C){I(C)}else I("")})}_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",g=new Date,I=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]){!g&&(g=new Date),"string"==typeof g&&(g=new Date(g));const B={"M+":g.getMonth()+1,"d+":g.getDate(),"h+":g.getHours(),"m+":g.getMinutes(),"s+":g.getSeconds(),S:g.getMilliseconds(),w:I[g.getDay()]};/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(g.getFullYear()+"").substr(4-RegExp.$1.length)));for(const C in B)new RegExp("("+C+")").test(A)&&(A=A.replace(RegExp.$1,1===RegExp.$1.length?B[C]:("00"+B[C]).substr((""+B[C]).length)));return A},throttle:function(A,g=500){var I=Date.now();return function(...B){Date.now()-I>=g&&(A.apply(this,B),I=Date.now())}},debounce:function(A,g=500){let I=null;return function(...B){clearTimeout(I),I=setTimeout(()=>{A.apply(this,B)},g)}},rgbToHex:function(A,g,I){return"#"+((1<<24)+(A<<16)+(g<<8)+I).toString(16).slice(1)},hexToRgb:hexToRgb,hslToRgb:function(A,g,I){let B,C,E;if(A/=360,I/=100,0===(g/=100))B=C=E=I;else{const Q=(A,g,I)=>(I<0&&(I+=1),I>1&&(I-=1),I<1/6?A+6*(g-A)*I:I<.5?g:I<2/3?A+(g-A)*(2/3-I)*6:A),t=I<.5?I*(1+g):I+g-I*g,i=2*I-t;B=Q(i,t,A+1/3),C=Q(i,t,A),E=Q(i,t,A-1/3)}return{r:Math.round(255*B),g:Math.round(255*C),b:Math.round(255*E)}},rgbOrHexToHsl:function(A){let g,I,B;if("string"==typeof A&&"#"===A.charAt(0)){const C=hexToRgb(A);g=C.r/255,I=C.g/255,B=C.b/255}else{if("object"!=typeof A)throw new Error("Invalid input format");g=A.r/255,I=A.g/255,B=A.b/255}const C=Math.max(g,I,B),E=Math.min(g,I,B);let Q,t,i=(C+E)/2;if(C===E)Q=t=0;else{const A=C-E;switch(t=i>.5?A/(2-C-E):A/(C+E),C){case g:Q=(I-B)/A+(I<B?6:0);break;case I:Q=(B-g)/A+2;break;case B:Q=(g-I)/A+4}Q/=6}return{h:Math.round(360*Q),s:Math.round(100*t),l:Math.round(100*i)}},preciseInterval:function(A,g){let I,B=null;return I=requestAnimationFrame(function C(E){B||(B=E),E-B>=g&&(A(),B=E),I=requestAnimationFrame(C)}),{clear:function(){cancelAnimationFrame(I)}}},convertImgToBase64:function(A,g){return new Promise(function(I){var B=document.createElement("CANVAS"),C=B.getContext("2d"),E=new Image;E.crossOrigin="Anonymous",E.onload=function(){B.height=E.height,B.width=E.width,C.drawImage(E,0,0);var A=B.toDataURL(g||"image/jpg");I(A),B=null},E.src=A})},objectGroupBy:function(A,g){if("string"==typeof g){const A=g;g=g=>g[A]}var I={};return A.forEach((B,C)=>{const E=g(B,C,A);I[E]||(I[E]=[]),I[E].push(B)}),I},randomNum:function(A,g){return Math.floor(Math.random()*(g+1-A))+A},randomColor:function(){return"#"+Math.floor(16777215*Math.random()).toString(16).padEnd(6,"0")},deepCloning:function A(g,I=new WeakMap){if("object"!=typeof g||null===g)return g;if(I.has(g))return I.get(g);var B=Array.isArray(g)?[]:{};I.set(g,B);for(const E in g)if(g.hasOwnProperty(E)){const Q=g[E];if("object"!=typeof Q||null===Q)B[E]=Q;else try{B[E]=A(Q,I)}catch(C){}}return B},randomStr:randomStr$1,getUrlParams:function(A){const g={};let I=A.substring(A.lastIndexOf("?")+1);return I=decodeURIComponent(I),I.replace(/([^?&=]+)=([^?&=]*)/g,(A,I,B)=>{const C=decodeURIComponent(I);let E=decodeURIComponent(B);try{E=JSON.parse(E)}catch(Q){}return g[C]=E,A}),g},getBroswer:function(){let A="";const g=window.navigator.userAgent.toLowerCase();if(/(msie|firefox|opera|chrome|netscape)\D+(\d[\d.]*)/.test(g)){const I=g.search(RegExp.$1);A=g.substring(I,g.length).replace(/safari\D+(\d[\d.]*)/,"")}else/version\D+(\d[\d.]*).*safari/.test(g)&&(A="safari "+RegExp.$2);return A},fileTurnBase64:fileTurnBase64,fileChunks:function(A,g,I,B){return new Promise((C,E)=>{const Q=new MyCryptoJS,t={fileHash:"",fileName:A.name,chunkSize:g,fileSize:A.size,fileType:A.type,chunks:[]};let i=new Promise((I,C)=>{Q.fileMd5(A,g,B).then(A=>{t.fileHash=A,I(t)}).catch(A=>{C(A)})}),s=new Promise((B,C)=>{let E=0;!async function C(){if(E>=A.size)return void B(t);let Q=A.slice(E,Math.min(E+g,A.size));I&&(Q=await fileTurnBase64(Q)),t.chunks.push({chunk:Q,index:E/g}),E+=g,C()}()});Promise.all([i,s]).then(()=>{C(t)}).catch(A=>{E(A)})})},base64ArrayMerge:function(A,g=!0){let I=(A=A.map(A=>function(A){const g="=".repeat((4-A.length%4)%4),I=(A+g).replace(/\-/g,"+").replace(/_/g,"/"),B=window.atob(I),C=new Uint8Array(B.length);for(let E=0;E<B.length;++E)C[E]=B.charCodeAt(E);return C}(A.split(",")[1]))).reduce((A,g)=>A+g.length,0);const B=new Uint8Array(I);let C=0;A.forEach(A=>{B.set(A,C),C+=A.length});const E=new Blob([B]);return new Promise((A,I)=>{g?fileTurnBase64(E).then(g=>{A(g)}).catch(A=>{I(A)}):A(E)})},toChineseNumber:function(A,g=!0){let I=A.toString().replace(/(?=(\d{4})+$)/g,",").split(",").filter(Boolean);const B=["零","一","二","三","四","五","六","七","八","九"],C=["","十","百","千"],E=["","万","亿"];let Q=I.map((A,g)=>function(A){let g="";for(let I=0;I<A.length;I++){let E=B[A[I]],Q=C[A.length-I-1];"零"===E&&(Q=""),g+=E+Q}return g=g.replace(/零+/g,"零").replace(/零$/,""),g}(A)+E[I.length-1-g]).join("");if(Q=Q||"零",g){let A={"零":"零","一":"壹","二":"贰","三":"叁","四":"肆","五":"伍","六":"陆","七":"柒","八":"捌","九":"玖","十":"拾","百":"佰","千":"仟"};Q=Q.split("").map(g=>A[g]||g).join("")}return Q},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,g){if(!A)return;"object"==typeof A&&(A=JSON.stringify(A));const I=new Blob([A],{type:"application/json;charset=utf-8"}),B=URL.createObjectURL(I),C=document.createElement("a");C.href=B,C.download=0==g.indexOf(".")?randomStr$1()+g:g,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(B)}};const BaseClass=(null==(_a2=window.Cesium)?void 0:_a2.WebMapTileServiceImageryProvider)||Object;class CustomImageryProvider extends BaseClass{constructor(A){super(A),__publicField(this,"options",{isFilter:!1,blur:0,brightness:1,contrast:1,grayscale:0,hueRotate:0,invert:0,opacity:1,saturate:1,sepia:0,filterColor:"#0668d2",operation:"overlay"}),this.options={...this.options,...A.filterConfig||{}}}requestImage(A,g,I){return super.requestImage(A,g,I).then(A=>{if(!this.options.isFilter)return A;const g=document.createElement("canvas");g.width=A.width,g.height=A.height;const I=g.getContext("2d");return I.translate(0,g.height),I.scale(1,-1),I.filter=`invert(${this.options.invert}) saturate(${this.options.saturate}) brightness(${this.options.brightness}) hue-rotate(${this.options.hueRotate}deg) contrast(${this.options.contrast}) sepia(${this.options.sepia}) opacity(${this.options.opacity}) grayscale(${this.options.grayscale}) blur(${this.options.blur}px)`,I.drawImage(A,0,0,g.width,g.height),I.filter="none",this.options.operation&&(I.globalCompositeOperation=this.options.operation,I.fillStyle=this.options.filterColor,I.fillRect(0,0,g.width,g.height),I.globalCompositeOperation="source-over"),I.stroke(),g})}}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={},g={})=>{const I=__privateGet(this,_parent).viewer;var B={tdtyxType:"img_w",maximumLevel:18,minimumLevel:0,...A},C=new CustomImageryProvider({filterConfig:g,url:`http://t{s}.tianditu.gov.cn/${B.tdtyxType}/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=${"img_w"==B.tdtyxType?"img":"vec"}&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:B.maximumLevel,minimumLevel:B.minimumLevel}),E=I.imageryLayers.addImageryProvider(C);return I.imageryLayers.lowerToBottom(E),{entity:E,remove(){I.imageryLayers.remove(E)}}}),__publicField(this,"loadTdtZhuJi",(A={},g={})=>{const I=__privateGet(this,_parent).viewer;var B={maximumLevel:18,minimumLevel:0,...A},C=new CustomImageryProvider({filterConfig:g,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:B.minimumLevel,maximumLevel:B.maximumLevel,show:!0}),E=I.imageryLayers.addImageryProvider(C);return I.imageryLayers.raiseToTop(E),{entity:E,remove(){I.imageryLayers.remove(E)}}}),__publicField(this,"setImageLayerFilter",(A={},g=0)=>{var I={invertColor:!0,alpha:1,dayAlpha:1,nightAlpha:1,brightness:1,contrast:1,hue:50,saturation:1,gamma:1,...A},B=__privateGet(this,_parent).viewer.imageryLayers.get(g);B.invertColor=I.invertColor,B.alpha=I.alpha,B.dayAlpha=I.dayAlpha,B.nightAlpha=I.nightAlpha,B.brightness=I.brightness,B.contrast=I.contrast,B.hue=I.hue,B.saturation=I.saturation,B.gamma=I.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={},g={}){const I=__privateGet(this,_parent).viewer;var B={maximumLevel:18,minimumLevel:0,show:!0,...A},C=new CustomImageryProvider({filterConfig:g,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:B.maximumLevel,minimumLevel:B.minimumLevel,show:B.show}),E=I.imageryLayers.addImageryProvider(C);return I.imageryLayers.raiseToTop(E),{entity:E,remove(){I.imageryLayers.remove(E)}}}}_yingXiangLayer=new WeakMap,_luWangLayer=new WeakMap,_zhuJiLayer=new WeakMap,_parent=new WeakMap;const configProviderContextKey=Symbol(),_bem=(A,g,I,B,C)=>{let E=`${A}-${g}`;return I&&(E+=`-${I}`),B&&(E+=`__${B}`),C&&(E+=`--${C}`),E},namespaceContextKey=Symbol("namespaceContextKey"),useNamespace=(A,g)=>{const I=(A=>{const g=A||(vue.getCurrentInstance()?vue.inject(namespaceContextKey,vue.ref("el")):vue.ref("el"));return vue.computed(()=>vue.unref(g)||"el")})(g);return{namespace:I,b:(g="")=>_bem(I.value,A,g,"",""),e:g=>g?_bem(I.value,A,"",g,""):"",m:g=>g?_bem(I.value,A,"","",g):"",be:(g,B)=>g&&B?_bem(I.value,A,g,B,""):"",em:(g,B)=>g&&B?_bem(I.value,A,"",g,B):"",bm:(g,B)=>g&&B?_bem(I.value,A,g,"",B):"",bem:(g,B,C)=>g&&B&&C?_bem(I.value,A,g,B,C):"",is:(A,...g)=>{const I=!(g.length>=1)||g[0];return A&&I?`is-${A}`:""},cssVar:A=>{const g={};for(const B in A)A[B]&&(g[`--${I.value}-${B}`]=A[B]);return g},cssVarName:A=>`--${I.value}-${A}`,cssVarBlock:g=>{const B={};for(const C in g)g[C]&&(B[`--${I.value}-${A}-${C}`]=g[C]);return B},cssVarBlockName:g=>`--${I.value}-${A}-${g}`}};
|
|
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
|
@@ -14221,31 +14221,56 @@ const imgReversemask = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICA
|
|
|
14221
14221
|
const imgWallline = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAAUCAYAAADIpHLKAAAACXBIWXMAABYlAAAWJQFJUiTwAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAArnSURBVHjajFvLkhzJDSMiOqy1NJL26P//Pd/25FPBhypmAiSzducwM931yuQTBFn411//+UZGABEMBoggGIj8yf8YwYgA7j8RwefC+5vnLCIA+RwRuM+OPI33wyKCASCCDOK5p/wOWUVef5/33K+tMSL2ZiIwncO1/vxnrzEvew6sY+HHsD/v1Uyyu3eCfOYjv7wr12597/vTLZtci8lCxYI879k6IwA8+tl72/LZ52y9uhy5nqGakO+anKEKt71VTUbca4OdgLK3PGefRJG1Sj6a3ezl7XVxyf62UVlsdNnmkU/wj3/f1z0LBlRH9y/AroctdxsOI51jK3adkfdIXUNEJ/pHW/PjFfE4B/ffLfl0vseon72Q23mZjpyGIXYBMR7EfXMyAnn9Y3WAGwHUw6I705JpChPV4GlbUHtdHxBr/2Zt6ajAkgWxv47iV2rHZgIZnHaEcns1f5RFNkf3oIRnQei+abIjwh0wdS02s7YqrlBiyZaDLu/gABmyQN1DBJCBbK/7E/H9x3IEFY5cbN4XaTTPYYbEyCjRyDxtclRzkh2V6nWeVZCKYLi3SCTdjvzc/nGgWzAZfySr5efANmzW4FOz6VbONgp63LXP0QONbvMxUpAuf9AjLWdZw8VVDGbfx9eGJ2OWjLoCUc/iW23zc0fnBsf9Lssp6gbVBocARM8gKOc2gFEOWyDOQEhHQ0HEB/H9q5nvNTmep7Bq8wZ7Bn/YQimOEcXQiTjehG/3ezfGGFP9y/csUZiDli4xwMGhzz8qK3To0vQhQYDndXbZ/I1OYtaTZfNJLhju33Ry2GPVf4VaPOjFIFO1w39gewZvD/aEbkufiK+fLX1LQI8Yg7nlawuuETNEOylx8u6S1ePFZ2ydJbhRAzBO2aujyqnCeTX3IfJGUaxC9qPRtYLnLev2BWpyCfTPJq+pQHjTdxQ8Oq15iNyjLjWziZk0WyiIlMX8psxTZWr2IdCYhK8P5Z7Pz4f8+uVF7i7SkNj9qS+WkB+MbqUbtez06MPRcrpx58LbxjlbDIKr4Ecpr1QoFHzrMtznblTJVQMkEcFVHGB02tzeKiCpxeQmJMgC8ledtjVD9trLjbdaBgrG5ypwWT1s3ZIlqmO0eDT5rdWWjMHoOfR+BqPonvLMtCNGq1tVjsGKbGVvGhhEnnygOBVLLcDCh8TYW7/1/zyTm2L4BH//XkJv0QsR1865uG6HYSkuOUQKwmtJ1ckmsbCdraALsOhxzGKeWZFCD4fA9/aEbRqqm6xNKAtZ4qYbTxo0V3HIts7FLKEEYm7HQwHlPO0PBXtTSk0UwU3li0ZH1cdzArhJjJQjpc7SrGOsXHSSTfdJ45Z27ccs5K95rckyJUtKSb9a/6odhTCqyhjufXcDRDB4WQxr9vxB/PxtHooB0UxYTVwPHEhXdhgAFjZD/ueQ7gmvfSg1C8JTNGqy0fpd6/hw53U4LE+h15xqEA1+oWdE8FxSVASa68MJ0B1KGxZuQ7OZMX0xJq4O2+mwnoeah2KhG01stNGdZWbFLJCx1xcowloxh4WZO0FtzvanpKcxd+FJ7qZ549efAljuKEwaO+MMEu2buGjRx7XHxpjob6WKPa3uSLbhw74X6RI3blyT4aFoBHvXIR2RdkToSu2fDMoJoTUpGQFR6eT7TivyKUWevaWM0svZttxUamTxFpEtyNXrgEIX0hmf/HOF9LQmJjFJiX6t0qYL/Ij+qTDuUJKiBreJLBAyZGd22TXTFtPIbyi14V6xtxZg2SzzE/z9Z5ReDeEReuoZGp5jaevBIa72a3AK97l0OIaNB0YknkTs9KsVBVCw8LOBZVxwvHxir7D8WYw2VsvBnlsdkQe2B1Mkw1w44kB+IHqkM1y9nsXVzHWoxt0QFfSnGDwqmxxhDlyFBamL7ibp3M9EWLtIsmVI/wHRygWGS/pE8oQjBUJqjLmPaYig6Vge8Yn49TsKZQbtfzN2Z7ylNo8m7lhuAZkBqLz7BLiv4mnCs4Oe0dKg1npkAbggBRoH1IKibxZr02hD58u1VKUT3eaAWlyhZDP2tSEG2ondmzJK5/moeMjIiHL/jOLLoA79pqs4ia05Rmoa9LBjIeaCN1cNRkkM55Y3xihQAupVO6yOEIKFvi5dZlQ8bpQ9EmJhntxQ4cMHR3ozTkYjXLIW2XCYENkuXNz9lL3UgPOZNSpbV5jG51UHrjjfMbNVhL1qrjxq1GbzsCerngejQ292tgZjYyrw97w0Jial7Jt1O/SC7iS3cA4ZxqOydevrMNJyIGXv8NJTq93WKYVJo1JZSBg3P3TemZ103hlEUTboaCxa9Oi0qhfynoHq96+cOc8NrFj03O57G9UItPPb2pStmpoNnBiKLhNIzeJ5ue6dlnlYqSZ6vcOKmbS7364P61Kvu7DjEMf47LNflVInpurccF+lsrtflokDzXg27YVVZ7qN0Yr3I8aq9F+l2YdWAZR2VxQAf+ZyEB0b4EuTZ6r0OURODv5gGKw1BMu4SpSgnbK4fMzhrZFmajwlpommbi0HNHqYp87+gaZ1OfqQIOYk5oFPBjVJLw7B98YjClytM1u0woiLImWxh0ncu/TzdRm+L7CGnOZslEQpLBp6f3r58FUut2vhrA2H/lrRPUuA/ET8/JVSg0Yj9RKhB9UZ6uxdvXkbI1I2Ck7t1Tazdp/bsB3DG2ppAjaRPCEkqS8ES1QZjt18iUg2JNqmQKRBJhCVkGKXs8KnySPCoQkH2jaoREa0CJx0uQ7f8kBPHxMARX9PATySXazjYsrKYS7yK0pbtPdu5Go2YGmctfav9DtQG8cDmPHBb9os+Qfx4yeJAxxRA/dR4jsMZVdduucFb4/jLmQpdZUifGhQYsjS7MNz4VOcTs/ImdduzDmdyN01Dx+Khw15exjiUxziiqc52bv8TkGeJm+4ZGnTygUq5nAeiiOGUcbS7b5awt4UL1iGBR0C1skITo3zFQAi1H7cETgycBxm0GyahW6mL6NaI6IJsSl30WG8pcoZRqTHh/H1ZaMl1PFzHobsUHiKzbnzxMOJpdO4+eyWunMl4NJMNtU9EM6wvqKQnLhHF8H6eK6XPgPRwwqkU28RMTZTtmjaYJ/yLZCiGmQdv4j1Xknv9UDqDKC8UZLvetQUrE4Hlu69k9YSsp6R84R1G+8tulv1zT2+rq8PsLzzYWPmQGsktrcBsF9RWNeC7T2j8lbSalyOxEFKHht+EygjMvfxD/j9B0HnrMtI8y5QlVV5Ci4OhInZA1r4ABoh5c/FHHFYGKlaR9bezX7PAgbmG5FUuqytCzxAcMapHsNm1eRFMGOkWN5POfWeOJQt2OeTM8mDARpB6gREffekD7naxIEGiTLagkP3Og14NZaxR4GWXact1J7ZEJd5qPcUJmIaVj2UH/VdMQ69KjICf/z3r/+9VZeFe3Eocpge7gOWI7/hPHTjHaYUTOvT1G2Pz1wvR3Hk4Py5UxXQ+JCWGZ385pg/h4rJookOf2J8nr3qU+Tm2DnedPb64zItffshj3FmJExvLLjjhDFQ7iyQvmRc1B5LDHN57VnljcMmK++057UfxrdviDPXrJEEhV3C5Xj55SXEwDAFW2ecomJvDFkpBoyOYXZHjw/9lDo6HcOgLuKdjrcoiiEj/kPL1Hk0lL1U+ba1DM+ehhzHKfoDy42ZGGqs2+ke7T27Uyvo1KKp5IXcC3FGIXN6d1a23f/Ulnue8f8BACBq3pqhueqOAAAAAElFTkSuQmCC";
|
|
14222
14222
|
const BaseClass = ((_a2 = window.Cesium) == null ? void 0 : _a2.WebMapTileServiceImageryProvider) || Object;
|
|
14223
14223
|
class CustomImageryProvider extends BaseClass {
|
|
14224
|
-
//[6, 27, 198] // 颜色
|
|
14225
14224
|
constructor(options) {
|
|
14226
14225
|
super(options);
|
|
14227
|
-
__publicField(this, "
|
|
14228
|
-
|
|
14229
|
-
|
|
14230
|
-
|
|
14231
|
-
|
|
14226
|
+
__publicField(this, "options", {
|
|
14227
|
+
isFilter: false,
|
|
14228
|
+
// 是否开启滤镜
|
|
14229
|
+
blur: 0,
|
|
14230
|
+
// cavans模糊度
|
|
14231
|
+
brightness: 1,
|
|
14232
|
+
// 亮度调整 ≥0;<1 压暗,>1 提亮;`brightness(0)` 纯黑
|
|
14233
|
+
contrast: 1,
|
|
14234
|
+
// 对比度调整 ≥0;<1 压暗,>1 提对比;`contrast(0)` 全灰
|
|
14235
|
+
grayscale: 0,
|
|
14236
|
+
// 灰度调整 0 ~ 1;0 原色,1 完全灰度;>1 同 1
|
|
14237
|
+
hueRotate: 0,
|
|
14238
|
+
// 色相旋转 0 ~ 360;0 原色,360 完全旋转;>360 同 360
|
|
14239
|
+
invert: 0,
|
|
14240
|
+
// 反转颜色 0 ~ 1;0 原色,1 完全反转;>1 同 1
|
|
14241
|
+
opacity: 1,
|
|
14242
|
+
// 透明度 0 ~ 1;0 透明,1 不透明
|
|
14243
|
+
saturate: 1,
|
|
14244
|
+
// 饱和度调整 ≥0;0 灰度,0~1 降低饱和度,>1 增加饱和度
|
|
14245
|
+
sepia: 0,
|
|
14246
|
+
// 红色调 0 ~ 1;0 原色,1 完全复古褐色;>1 同 1
|
|
14247
|
+
filterColor: "#0668d2",
|
|
14248
|
+
// 滤镜颜色
|
|
14249
|
+
operation: "overlay"
|
|
14250
|
+
// 合成操作
|
|
14251
|
+
});
|
|
14252
|
+
this.options = { ...this.options, ...options.filterConfig || {} };
|
|
14232
14253
|
}
|
|
14233
14254
|
// 重写获取图像的方法
|
|
14234
14255
|
requestImage(x, y, level) {
|
|
14235
14256
|
const imagePromise = super.requestImage(x, y, level);
|
|
14236
14257
|
return imagePromise.then((image) => {
|
|
14237
|
-
if (!this.
|
|
14258
|
+
if (!this.options.isFilter) return image;
|
|
14238
14259
|
const canvas = document.createElement("canvas");
|
|
14239
14260
|
canvas.width = image.width;
|
|
14240
14261
|
canvas.height = image.height;
|
|
14241
14262
|
const context = canvas.getContext("2d");
|
|
14242
14263
|
context.translate(0, canvas.height);
|
|
14243
14264
|
context.scale(1, -1);
|
|
14244
|
-
context.
|
|
14245
|
-
context.
|
|
14246
|
-
context.
|
|
14247
|
-
|
|
14248
|
-
|
|
14265
|
+
context.filter = `invert(${this.options.invert}) saturate(${this.options.saturate}) brightness(${this.options.brightness}) hue-rotate(${this.options.hueRotate}deg) contrast(${this.options.contrast}) sepia(${this.options.sepia}) opacity(${this.options.opacity}) grayscale(${this.options.grayscale}) blur(${this.options.blur}px)`;
|
|
14266
|
+
context.drawImage(image, 0, 0, canvas.width, canvas.height);
|
|
14267
|
+
context.filter = "none";
|
|
14268
|
+
if (this.options.operation) {
|
|
14269
|
+
context.globalCompositeOperation = this.options.operation;
|
|
14270
|
+
context.fillStyle = this.options.filterColor;
|
|
14271
|
+
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
14272
|
+
context.globalCompositeOperation = "source-over";
|
|
14273
|
+
}
|
|
14249
14274
|
context.stroke();
|
|
14250
14275
|
return canvas;
|
|
14251
14276
|
});
|
|
@@ -14261,19 +14286,20 @@ class TianDiTu {
|
|
|
14261
14286
|
/**
|
|
14262
14287
|
* 加载天地图影像图层
|
|
14263
14288
|
* @param {Object} conPar 天地图参数
|
|
14264
|
-
* @param {
|
|
14289
|
+
* @param {Object} filterConfig 滤镜配置
|
|
14265
14290
|
* @returns {Cesium.ImageryLayer} 图层实例
|
|
14266
14291
|
*/
|
|
14267
|
-
__publicField(this, "loadTdtYingXiang", (conPar = {},
|
|
14292
|
+
__publicField(this, "loadTdtYingXiang", (conPar = {}, filterConfig = {}) => {
|
|
14268
14293
|
const viewer = __privateGet(this, _parent).viewer;
|
|
14269
14294
|
var config = {
|
|
14270
14295
|
tdtyxType: "img_w",
|
|
14296
|
+
// img_w vec_w
|
|
14271
14297
|
maximumLevel: 18,
|
|
14298
|
+
minimumLevel: 0,
|
|
14272
14299
|
...conPar
|
|
14273
14300
|
};
|
|
14274
14301
|
var yx = new CustomImageryProvider({
|
|
14275
|
-
|
|
14276
|
-
alp: rgba[3],
|
|
14302
|
+
filterConfig,
|
|
14277
14303
|
//影像底图
|
|
14278
14304
|
// url: `https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{TileMatrix}/{TileRow}/{TileCol}`,
|
|
14279
14305
|
url: `http://t{s}.tianditu.gov.cn/${config.tdtyxType}/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=${config.tdtyxType == "img_w" ? "img" : "vec"}&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&format=tiles&tk=${this.TianDiTuToken}`,
|
|
@@ -14282,13 +14308,7 @@ class TianDiTu {
|
|
|
14282
14308
|
//URL模板中用于{s}占位符的子域。如果该参数是单个字符串,则字符串中的每个字符都是一个子域。如果它是一个数组,数组中的每个元素都是一个子域
|
|
14283
14309
|
show: true,
|
|
14284
14310
|
maximumLevel: config.maximumLevel,
|
|
14285
|
-
minimumLevel:
|
|
14286
|
-
// screenSpaceError: 16, // 调整屏幕空间误差
|
|
14287
|
-
// styels: [
|
|
14288
|
-
// {
|
|
14289
|
-
// stylers: [{ hue: "#fc0505ff" }, { saturation: -20 }],
|
|
14290
|
-
// }
|
|
14291
|
-
// ]
|
|
14311
|
+
minimumLevel: config.minimumLevel
|
|
14292
14312
|
});
|
|
14293
14313
|
var tdtyx = viewer.imageryLayers.addImageryProvider(yx);
|
|
14294
14314
|
viewer.imageryLayers.lowerToBottom(tdtyx);
|
|
@@ -14301,21 +14321,22 @@ class TianDiTu {
|
|
|
14301
14321
|
});
|
|
14302
14322
|
/**
|
|
14303
14323
|
* 加载天地图注记图层
|
|
14304
|
-
* @param {
|
|
14324
|
+
* @param {Object} conPar 天地图参数
|
|
14325
|
+
* @param {Object} filterConfig 滤镜配置
|
|
14305
14326
|
* @returns {Object} 图层实例和移除函数
|
|
14306
14327
|
*/
|
|
14307
|
-
__publicField(this, "loadTdtZhuJi", (conPar = {},
|
|
14328
|
+
__publicField(this, "loadTdtZhuJi", (conPar = {}, filterConfig = {}) => {
|
|
14308
14329
|
const viewer = __privateGet(this, _parent).viewer;
|
|
14309
14330
|
var config = {
|
|
14310
14331
|
maximumLevel: 18,
|
|
14332
|
+
minimumLevel: 0,
|
|
14311
14333
|
...conPar
|
|
14312
14334
|
};
|
|
14313
14335
|
var zj = new CustomImageryProvider({
|
|
14314
|
-
|
|
14315
|
-
alp: rgba[3],
|
|
14336
|
+
filterConfig,
|
|
14316
14337
|
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}`,
|
|
14317
14338
|
subdomains: ["0", "1", "2", "3", "4", "5", "6", "7"],
|
|
14318
|
-
minimumLevel:
|
|
14339
|
+
minimumLevel: config.minimumLevel,
|
|
14319
14340
|
maximumLevel: config.maximumLevel,
|
|
14320
14341
|
show: true
|
|
14321
14342
|
});
|
|
@@ -14398,22 +14419,23 @@ class TianDiTu {
|
|
|
14398
14419
|
/**
|
|
14399
14420
|
* 加载天地图路网图层
|
|
14400
14421
|
* @param {Object} conPar 天地图参数
|
|
14401
|
-
* @param {
|
|
14422
|
+
* @param {Object} filterConfig 滤镜配置
|
|
14402
14423
|
* @returns {Cesium.ImageryLayer} 图层实例
|
|
14403
14424
|
*/
|
|
14404
|
-
loadTdtLuWang(conPar = {},
|
|
14425
|
+
loadTdtLuWang(conPar = {}, filterConfig = {}) {
|
|
14405
14426
|
const viewer = __privateGet(this, _parent).viewer;
|
|
14406
14427
|
var config = {
|
|
14407
14428
|
maximumLevel: 18,
|
|
14429
|
+
minimumLevel: 0,
|
|
14408
14430
|
show: true,
|
|
14409
14431
|
...conPar
|
|
14410
14432
|
};
|
|
14411
14433
|
var lw = new CustomImageryProvider({
|
|
14412
|
-
|
|
14413
|
-
alp: rgba[3],
|
|
14434
|
+
filterConfig,
|
|
14414
14435
|
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}`,
|
|
14415
14436
|
subdomains: ["0", "1", "2", "3", "4", "5", "6", "7"],
|
|
14416
14437
|
maximumLevel: config.maximumLevel,
|
|
14438
|
+
minimumLevel: config.minimumLevel,
|
|
14417
14439
|
show: config.show
|
|
14418
14440
|
});
|
|
14419
14441
|
var tdtlw = viewer.imageryLayers.addImageryProvider(lw);
|
package/fhj-tools.umd.js
CHANGED
|
@@ -30,7 +30,7 @@ function(){var g=A,I=g.lib,B=I.WordArray,C=I.Hasher,E=g.algo,Q=B.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 lI={};void 0!==lI.asn1&&lI.asn1||(lI.asn1={}),lI.asn1.ASN1Util=new function(){this.integerToByteHex=function(A){var g=A.toString(16);return g.length%2==1&&(g="0"+g),g},this.bigIntToMinTwosComplementsHex=function(A){var g=A.toString(16);if("-"!=g.substr(0,1))g.length%2==1?g="0"+g:g.match(/^[0-7]/)||(g="00"+g);else{var I=g.substr(1).length;I%2==1?I+=1:g.match(/^[0-7]/)||(I+=2);for(var B="",C=0;C<I;C++)B+="f";g=new zg(B,16).xor(A).add(zg.ONE).toString(16).replace(/^-/,"")}return g},this.getPEMStringFromHex=function(A,g){return hextopem(A,g)},this.newObject=function(A){var g=lI.asn1,I=g.DERBoolean,B=g.DERInteger,C=g.DERBitString,E=g.DEROctetString,Q=g.DERNull,t=g.DERObjectIdentifier,i=g.DEREnumerated,s=g.DERUTF8String,k=g.DERNumericString,Y=g.DERPrintableString,r=g.DERTeletexString,S=g.DERIA5String,J=g.DERUTCTime,G=g.DERGeneralizedTime,w=g.DERSequence,a=g.DERSet,M=g.DERTaggedObject,o=g.ASN1Util.newObject,h=Object.keys(A);if(1!=h.length)throw"key of param shall be only one.";var e=h[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+e+":"))throw"undefined key: "+e;if("bool"==e)return new I(A[e]);if("int"==e)return new B(A[e]);if("bitstr"==e)return new C(A[e]);if("octstr"==e)return new E(A[e]);if("null"==e)return new Q(A[e]);if("oid"==e)return new t(A[e]);if("enum"==e)return new i(A[e]);if("utf8str"==e)return new s(A[e]);if("numstr"==e)return new k(A[e]);if("prnstr"==e)return new Y(A[e]);if("telstr"==e)return new r(A[e]);if("ia5str"==e)return new S(A[e]);if("utctime"==e)return new J(A[e]);if("gentime"==e)return new G(A[e]);if("seq"==e){for(var W=A[e],D=[],l=0;l<W.length;l++){var R=o(W[l]);D.push(R)}return new w({array:D})}if("set"==e){for(W=A[e],D=[],l=0;l<W.length;l++){R=o(W[l]);D.push(R)}return new a({array:D})}if("tag"==e){var V=A[e];if("[object Array]"===Object.prototype.toString.call(V)&&3==V.length){var K=o(V[2]);return new M({tag:V[0],explicit:V[1],obj:K})}var F={};if(void 0!==V.explicit&&(F.explicit=V.explicit),void 0!==V.tag&&(F.tag=V.tag),void 0===V.obj)throw"obj shall be specified for 'tag'.";return F.obj=o(V.obj),new M(F)}},this.jsonToASN1HEX=function(A){return this.newObject(A).getEncodedHex()}},lI.asn1.ASN1Util.oidHexToInt=function(A){for(var g="",I=parseInt(A.substr(0,2),16),B=(g=Math.floor(I/40)+"."+I%40,""),C=2;C<A.length;C+=2){var E=("00000000"+parseInt(A.substr(C,2),16).toString(2)).slice(-8);if(B+=E.substr(1,7),"0"==E.substr(0,1))g=g+"."+new zg(B,2).toString(10),B=""}return g},lI.asn1.ASN1Util.oidIntToHex=function(A){var g=function(A){var g=A.toString(16);return 1==g.length&&(g="0"+g),g},I=function(A){var I="",B=new zg(A,10).toString(2),C=7-B.length%7;7==C&&(C=0);for(var E="",Q=0;Q<C;Q++)E+="0";B=E+B;for(Q=0;Q<B.length-1;Q+=7){var t=B.substr(Q,7);Q!=B.length-7&&(t="1"+t),I+=g(parseInt(t,2))}return I};if(!A.match(/^[0-9.]+$/))throw"malformed oid string: "+A;var B="",C=A.split("."),E=40*parseInt(C[0])+parseInt(C[1]);B+=g(E),C.splice(0,2);for(var Q=0;Q<C.length;Q++)B+=I(C[Q]);return B},lI.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,g=A.toString(16);if(g.length%2==1&&(g="0"+g),A<128)return g;var I=g.length/2;if(I>15)throw"ASN.1 length too long to represent by 8x: n = "+A.toString(16);return(128+I).toString(16)+g},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""}},lI.asn1.DERAbstractString=function(A){lI.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))},DI.lang.extend(lI.asn1.DERAbstractString,lI.asn1.ASN1Object),lI.asn1.DERAbstractTime=function(A){lI.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(A){return utc=A.getTime()+6e4*A.getTimezoneOffset(),new Date(utc)},this.formatDate=function(A,g,I){var B=this.zeroPadding,C=this.localDateToUTC(A),E=String(C.getFullYear());"utc"==g&&(E=E.substr(2,2));var Q=E+B(String(C.getMonth()+1),2)+B(String(C.getDate()),2)+B(String(C.getHours()),2)+B(String(C.getMinutes()),2)+B(String(C.getSeconds()),2);if(!0===I){var t=C.getMilliseconds();if(0!=t){var i=B(String(t),3);Q=Q+"."+(i=i.replace(/[0]+$/,""))}}return Q+"Z"},this.zeroPadding=function(A,g){return A.length>=g?A:new Array(g-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,g,I,B,C,E){var Q=new Date(Date.UTC(A,g-1,I,B,C,E,0));this.setByDate(Q)},this.getFreshValueHex=function(){return this.hV}},DI.lang.extend(lI.asn1.DERAbstractTime,lI.asn1.ASN1Object),lI.asn1.DERAbstractStructured=function(A){lI.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)},DI.lang.extend(lI.asn1.DERAbstractStructured,lI.asn1.ASN1Object),lI.asn1.DERBoolean=function(){lI.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},DI.lang.extend(lI.asn1.DERBoolean,lI.asn1.ASN1Object),lI.asn1.DERInteger=function(A){lI.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(A){this.hTLV=null,this.isModified=!0,this.hV=lI.asn1.ASN1Util.bigIntToMinTwosComplementsHex(A)},this.setByInteger=function(A){var g=new zg(String(A),10);this.setByBigInteger(g)},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))},DI.lang.extend(lI.asn1.DERInteger,lI.asn1.ASN1Object),lI.asn1.DERBitString=function(A){if(void 0!==A&&void 0!==A.obj){var g=lI.asn1.ASN1Util.newObject(A.obj);A.hex="00"+g.getEncodedHex()}lI.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,g){if(A<0||7<A)throw"unused bits shall be from 0 to 7: u = "+A;var I="0"+A;this.hTLV=null,this.isModified=!0,this.hV=I+g},this.setByBinaryString=function(A){var g=8-(A=A.replace(/0+$/,"")).length%8;8==g&&(g=0);for(var I=0;I<=g;I++)A+="0";var B="";for(I=0;I<A.length-1;I+=8){var C=A.substr(I,8),E=parseInt(C,2).toString(16);1==E.length&&(E="0"+E),B+=E}this.hTLV=null,this.isModified=!0,this.hV="0"+g+B},this.setByBooleanArray=function(A){for(var g="",I=0;I<A.length;I++)1==A[I]?g+="1":g+="0";this.setByBinaryString(g)},this.newFalseArray=function(A){for(var g=new Array(A),I=0;I<A;I++)g[I]=!1;return g},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))},DI.lang.extend(lI.asn1.DERBitString,lI.asn1.ASN1Object),lI.asn1.DEROctetString=function(A){if(void 0!==A&&void 0!==A.obj){var g=lI.asn1.ASN1Util.newObject(A.obj);A.hex=g.getEncodedHex()}lI.asn1.DEROctetString.superclass.constructor.call(this,A),this.hT="04"},DI.lang.extend(lI.asn1.DEROctetString,lI.asn1.DERAbstractString),lI.asn1.DERNull=function(){lI.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},DI.lang.extend(lI.asn1.DERNull,lI.asn1.ASN1Object),lI.asn1.DERObjectIdentifier=function(A){var g=function(A){var g=A.toString(16);return 1==g.length&&(g="0"+g),g},I=function(A){var I="",B=new zg(A,10).toString(2),C=7-B.length%7;7==C&&(C=0);for(var E="",Q=0;Q<C;Q++)E+="0";B=E+B;for(Q=0;Q<B.length-1;Q+=7){var t=B.substr(Q,7);Q!=B.length-7&&(t="1"+t),I+=g(parseInt(t,2))}return I};lI.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 B="",C=A.split("."),E=40*parseInt(C[0])+parseInt(C[1]);B+=g(E),C.splice(0,2);for(var Q=0;Q<C.length;Q++)B+=I(C[Q]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=B},this.setValueName=function(A){var g=lI.asn1.x509.OID.name2oid(A);if(""===g)throw"DERObjectIdentifier oidName undefined: "+A;this.setValueOidString(g)},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))},DI.lang.extend(lI.asn1.DERObjectIdentifier,lI.asn1.ASN1Object),lI.asn1.DEREnumerated=function(A){lI.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(A){this.hTLV=null,this.isModified=!0,this.hV=lI.asn1.ASN1Util.bigIntToMinTwosComplementsHex(A)},this.setByInteger=function(A){var g=new zg(String(A),10);this.setByBigInteger(g)},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))},DI.lang.extend(lI.asn1.DEREnumerated,lI.asn1.ASN1Object),lI.asn1.DERUTF8String=function(A){lI.asn1.DERUTF8String.superclass.constructor.call(this,A),this.hT="0c"},DI.lang.extend(lI.asn1.DERUTF8String,lI.asn1.DERAbstractString),lI.asn1.DERNumericString=function(A){lI.asn1.DERNumericString.superclass.constructor.call(this,A),this.hT="12"},DI.lang.extend(lI.asn1.DERNumericString,lI.asn1.DERAbstractString),lI.asn1.DERPrintableString=function(A){lI.asn1.DERPrintableString.superclass.constructor.call(this,A),this.hT="13"},DI.lang.extend(lI.asn1.DERPrintableString,lI.asn1.DERAbstractString),lI.asn1.DERTeletexString=function(A){lI.asn1.DERTeletexString.superclass.constructor.call(this,A),this.hT="14"},DI.lang.extend(lI.asn1.DERTeletexString,lI.asn1.DERAbstractString),lI.asn1.DERIA5String=function(A){lI.asn1.DERIA5String.superclass.constructor.call(this,A),this.hT="16"},DI.lang.extend(lI.asn1.DERIA5String,lI.asn1.DERAbstractString),lI.asn1.DERUTCTime=function(A){lI.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))},DI.lang.extend(lI.asn1.DERUTCTime,lI.asn1.DERAbstractTime),lI.asn1.DERGeneralizedTime=function(A){lI.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))},DI.lang.extend(lI.asn1.DERGeneralizedTime,lI.asn1.DERAbstractTime),lI.asn1.DERSequence=function(A){lI.asn1.DERSequence.superclass.constructor.call(this,A),this.hT="30",this.getFreshValueHex=function(){for(var A="",g=0;g<this.asn1Array.length;g++){A+=this.asn1Array[g].getEncodedHex()}return this.hV=A,this.hV}},DI.lang.extend(lI.asn1.DERSequence,lI.asn1.DERAbstractStructured),lI.asn1.DERSet=function(A){lI.asn1.DERSet.superclass.constructor.call(this,A),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var A=new Array,g=0;g<this.asn1Array.length;g++){var I=this.asn1Array[g];A.push(I.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)},DI.lang.extend(lI.asn1.DERSet,lI.asn1.DERAbstractStructured),lI.asn1.DERTaggedObject=function(A){lI.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(A,g,I){this.hT=g,this.isExplicit=A,this.asn1Object=I,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=I.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,g),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)))},DI.lang.extend(lI.asn1.DERTaggedObject,lI.asn1.ASN1Object);var RI,VI,KI,FI,yI,UI,nI,qI,xI,bI,ZI,pI,cI,jI,uI,mI,LI,NI,TI=function(){var A=function(g,I){return(A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,g){A.__proto__=g}||function(A,g){for(var I in g)Object.prototype.hasOwnProperty.call(g,I)&&(A[I]=g[I])})(g,I)};return function(g,I){if("function"!=typeof I&&null!==I)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function B(){this.constructor=g}A(g,I),g.prototype=null===I?Object.create(I):(B.prototype=I.prototype,new B)}}(),dI=function(A){function g(I){var B=A.call(this)||this;return I&&("string"==typeof I?B.parseKey(I):(g.hasPrivateKeyProperty(I)||g.hasPublicKeyProperty(I))&&B.parsePropertiesFrom(I)),B}return TI(g,A),g.prototype.parseKey=function(A){try{var g=0,I=0,B=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(A)?jg(A):ug.unarmor(A),C=fg.decode(B);if(3===C.sub.length&&(C=C.sub[2].sub[0]),9===C.sub.length){g=C.sub[1].getHexStringValue(),this.n=BI(g,16),I=C.sub[2].getHexStringValue(),this.e=parseInt(I,16);var E=C.sub[3].getHexStringValue();this.d=BI(E,16);var Q=C.sub[4].getHexStringValue();this.p=BI(Q,16);var t=C.sub[5].getHexStringValue();this.q=BI(t,16);var i=C.sub[6].getHexStringValue();this.dmp1=BI(i,16);var s=C.sub[7].getHexStringValue();this.dmq1=BI(s,16);var k=C.sub[8].getHexStringValue();this.coeff=BI(k,16)}else{if(2!==C.sub.length)return!1;if(C.sub[0].sub){var Y=C.sub[1].sub[0];g=Y.sub[0].getHexStringValue(),this.n=BI(g,16),I=Y.sub[1].getHexStringValue(),this.e=parseInt(I,16)}else g=C.sub[0].getHexStringValue(),this.n=BI(g,16),I=C.sub[1].getHexStringValue(),this.e=parseInt(I,16)}return!0}catch(r){return!1}},g.prototype.getPrivateBaseKey=function(){var A={array:[new lI.asn1.DERInteger({int:0}),new lI.asn1.DERInteger({bigint:this.n}),new lI.asn1.DERInteger({int:this.e}),new lI.asn1.DERInteger({bigint:this.d}),new lI.asn1.DERInteger({bigint:this.p}),new lI.asn1.DERInteger({bigint:this.q}),new lI.asn1.DERInteger({bigint:this.dmp1}),new lI.asn1.DERInteger({bigint:this.dmq1}),new lI.asn1.DERInteger({bigint:this.coeff})]};return new lI.asn1.DERSequence(A).getEncodedHex()},g.prototype.getPrivateBaseKeyB64=function(){return Zg(this.getPrivateBaseKey())},g.prototype.getPublicBaseKey=function(){var A=new lI.asn1.DERSequence({array:[new lI.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new lI.asn1.DERNull]}),g=new lI.asn1.DERSequence({array:[new lI.asn1.DERInteger({bigint:this.n}),new lI.asn1.DERInteger({int:this.e})]}),I=new lI.asn1.DERBitString({hex:"00"+g.getEncodedHex()});return new lI.asn1.DERSequence({array:[A,I]}).getEncodedHex()},g.prototype.getPublicBaseKeyB64=function(){return Zg(this.getPublicBaseKey())},g.wordwrap=function(A,g){if(!A)return A;var I="(.{1,"+(g=g||64)+"})( +|$\n?)|(.{1,"+g+"})";return A.match(RegExp(I,"g")).join("\n")},g.prototype.getPrivateKey=function(){var A="-----BEGIN RSA PRIVATE KEY-----\n";return A+=g.wordwrap(this.getPrivateBaseKeyB64())+"\n",A+="-----END RSA PRIVATE KEY-----"},g.prototype.getPublicKey=function(){var A="-----BEGIN PUBLIC KEY-----\n";return A+=g.wordwrap(this.getPublicBaseKeyB64())+"\n",A+="-----END PUBLIC KEY-----"},g.hasPublicKeyProperty=function(A){return(A=A||{}).hasOwnProperty("n")&&A.hasOwnProperty("e")},g.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")},g.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)},g}(eI),OI="undefined"!=typeof process?null===(RI=process.env)||void 0===RI?void 0:RI.npm_package_version:void 0,HI=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 dI(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(pg(A))}catch(g){return!1}},A.prototype.encrypt=function(A){try{return Zg(this.getKey().encrypt(A))}catch(g){return!1}},A.prototype.sign=function(A,g,I){try{return Zg(this.getKey().sign(A,g,I))}catch(B){return!1}},A.prototype.verify=function(A,g,I){try{return this.getKey().verify(A,pg(g),I)}catch(B){return!1}},A.prototype.getKey=function(A){if(!this.key){if(this.key=new dI,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=OI,A}(),fI={exports:{}},PI=fI.exports;function XI(){return VI||(VI=1,A=fI,function(){var g;function I(A,g,I){null!=A&&("number"==typeof A?this.fromNumber(A,g,I):null==g&&"string"!=typeof A?this.fromString(A,256):this.fromString(A,g))}function B(){return new I(null)}var C="undefined"!=typeof navigator;C&&"Microsoft Internet Explorer"==navigator.appName?(I.prototype.am=function(A,g,I,B,C,E){for(var Q=32767&g,t=g>>15;--E>=0;){var i=32767&this[A],s=this[A++]>>15,k=t*i+s*Q;C=((i=Q*i+((32767&k)<<15)+I[B]+(1073741823&C))>>>30)+(k>>>15)+t*s+(C>>>30),I[B++]=1073741823&i}return C},g=30):C&&"Netscape"!=navigator.appName?(I.prototype.am=function(A,g,I,B,C,E){for(;--E>=0;){var Q=g*this[A++]+I[B]+C;C=Math.floor(Q/67108864),I[B++]=67108863&Q}return C},g=26):(I.prototype.am=function(A,g,I,B,C,E){for(var Q=16383&g,t=g>>14;--E>=0;){var i=16383&this[A],s=this[A++]>>14,k=t*i+s*Q;C=((i=Q*i+((16383&k)<<14)+I[B]+C)>>28)+(k>>14)+t*s,I[B++]=268435455&i}return C},g=28),I.prototype.DB=g,I.prototype.DM=(1<<g)-1,I.prototype.DV=1<<g,I.prototype.FV=Math.pow(2,52),I.prototype.F1=52-g,I.prototype.F2=2*g-52;var E,Q,t=new Array;for(E="0".charCodeAt(0),Q=0;Q<=9;++Q)t[E++]=Q;for(E="a".charCodeAt(0),Q=10;Q<36;++Q)t[E++]=Q;for(E="A".charCodeAt(0),Q=10;Q<36;++Q)t[E++]=Q;function i(A){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(A)}function s(A,g){var I=t[A.charCodeAt(g)];return null==I?-1:I}function k(A){var g=B();return g.fromInt(A),g}function Y(A){var g,I=1;return 0!=(g=A>>>16)&&(A=g,I+=16),0!=(g=A>>8)&&(A=g,I+=8),0!=(g=A>>4)&&(A=g,I+=4),0!=(g=A>>2)&&(A=g,I+=2),0!=(g=A>>1)&&(A=g,I+=1),I}function r(A){this.m=A}function S(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 J(A,g){return A&g}function G(A,g){return A|g}function w(A,g){return A^g}function a(A,g){return A&~g}function M(A){if(0==A)return-1;var g=0;return 65535&A||(A>>=16,g+=16),255&A||(A>>=8,g+=8),15&A||(A>>=4,g+=4),3&A||(A>>=2,g+=2),1&A||++g,g}function o(A){for(var g=0;0!=A;)A&=A-1,++g;return g}function h(){}function e(A){return A}function W(A){this.r2=B(),this.q3=B(),I.ONE.dlShiftTo(2*A.t,this.r2),this.mu=this.r2.divide(A),this.m=A}r.prototype.convert=function(A){return A.s<0||A.compareTo(this.m)>=0?A.mod(this.m):A},r.prototype.revert=function(A){return A},r.prototype.reduce=function(A){A.divRemTo(this.m,null,A)},r.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I),this.reduce(I)},r.prototype.sqrTo=function(A,g){A.squareTo(g),this.reduce(g)},S.prototype.convert=function(A){var g=B();return A.abs().dlShiftTo(this.m.t,g),g.divRemTo(this.m,null,g),A.s<0&&g.compareTo(I.ZERO)>0&&this.m.subTo(g,g),g},S.prototype.revert=function(A){var g=B();return A.copyTo(g),this.reduce(g),g},S.prototype.reduce=function(A){for(;A.t<=this.mt2;)A[A.t++]=0;for(var g=0;g<this.m.t;++g){var I=32767&A[g],B=I*this.mpl+((I*this.mph+(A[g]>>15)*this.mpl&this.um)<<15)&A.DM;for(A[I=g+this.m.t]+=this.m.am(0,B,A,g,0,this.m.t);A[I]>=A.DV;)A[I]-=A.DV,A[++I]++}A.clamp(),A.drShiftTo(this.m.t,A),A.compareTo(this.m)>=0&&A.subTo(this.m,A)},S.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I),this.reduce(I)},S.prototype.sqrTo=function(A,g){A.squareTo(g),this.reduce(g)},I.prototype.copyTo=function(A){for(var g=this.t-1;g>=0;--g)A[g]=this[g];A.t=this.t,A.s=this.s},I.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},I.prototype.fromString=function(A,g){var B;if(16==g)B=4;else if(8==g)B=3;else if(256==g)B=8;else if(2==g)B=1;else if(32==g)B=5;else{if(4!=g)return void this.fromRadix(A,g);B=2}this.t=0,this.s=0;for(var C=A.length,E=!1,Q=0;--C>=0;){var t=8==B?255&A[C]:s(A,C);t<0?"-"==A.charAt(C)&&(E=!0):(E=!1,0==Q?this[this.t++]=t:Q+B>this.DB?(this[this.t-1]|=(t&(1<<this.DB-Q)-1)<<Q,this[this.t++]=t>>this.DB-Q):this[this.t-1]|=t<<Q,(Q+=B)>=this.DB&&(Q-=this.DB))}8==B&&128&A[0]&&(this.s=-1,Q>0&&(this[this.t-1]|=(1<<this.DB-Q)-1<<Q)),this.clamp(),E&&I.ZERO.subTo(this,this)},I.prototype.clamp=function(){for(var A=this.s&this.DM;this.t>0&&this[this.t-1]==A;)--this.t},I.prototype.dlShiftTo=function(A,g){var I;for(I=this.t-1;I>=0;--I)g[I+A]=this[I];for(I=A-1;I>=0;--I)g[I]=0;g.t=this.t+A,g.s=this.s},I.prototype.drShiftTo=function(A,g){for(var I=A;I<this.t;++I)g[I-A]=this[I];g.t=Math.max(this.t-A,0),g.s=this.s},I.prototype.lShiftTo=function(A,g){var I,B=A%this.DB,C=this.DB-B,E=(1<<C)-1,Q=Math.floor(A/this.DB),t=this.s<<B&this.DM;for(I=this.t-1;I>=0;--I)g[I+Q+1]=this[I]>>C|t,t=(this[I]&E)<<B;for(I=Q-1;I>=0;--I)g[I]=0;g[Q]=t,g.t=this.t+Q+1,g.s=this.s,g.clamp()},I.prototype.rShiftTo=function(A,g){g.s=this.s;var I=Math.floor(A/this.DB);if(I>=this.t)g.t=0;else{var B=A%this.DB,C=this.DB-B,E=(1<<B)-1;g[0]=this[I]>>B;for(var Q=I+1;Q<this.t;++Q)g[Q-I-1]|=(this[Q]&E)<<C,g[Q-I]=this[Q]>>B;B>0&&(g[this.t-I-1]|=(this.s&E)<<C),g.t=this.t-I,g.clamp()}},I.prototype.subTo=function(A,g){for(var I=0,B=0,C=Math.min(A.t,this.t);I<C;)B+=this[I]-A[I],g[I++]=B&this.DM,B>>=this.DB;if(A.t<this.t){for(B-=A.s;I<this.t;)B+=this[I],g[I++]=B&this.DM,B>>=this.DB;B+=this.s}else{for(B+=this.s;I<A.t;)B-=A[I],g[I++]=B&this.DM,B>>=this.DB;B-=A.s}g.s=B<0?-1:0,B<-1?g[I++]=this.DV+B:B>0&&(g[I++]=B),g.t=I,g.clamp()},I.prototype.multiplyTo=function(A,g){var B=this.abs(),C=A.abs(),E=B.t;for(g.t=E+C.t;--E>=0;)g[E]=0;for(E=0;E<C.t;++E)g[E+B.t]=B.am(0,C[E],g,E,0,B.t);g.s=0,g.clamp(),this.s!=A.s&&I.ZERO.subTo(g,g)},I.prototype.squareTo=function(A){for(var g=this.abs(),I=A.t=2*g.t;--I>=0;)A[I]=0;for(I=0;I<g.t-1;++I){var B=g.am(I,g[I],A,2*I,0,1);(A[I+g.t]+=g.am(I+1,2*g[I],A,2*I+1,B,g.t-I-1))>=g.DV&&(A[I+g.t]-=g.DV,A[I+g.t+1]=1)}A.t>0&&(A[A.t-1]+=g.am(I,g[I],A,2*I,0,1)),A.s=0,A.clamp()},I.prototype.divRemTo=function(A,g,C){var E=A.abs();if(!(E.t<=0)){var Q=this.abs();if(Q.t<E.t)return null!=g&&g.fromInt(0),void(null!=C&&this.copyTo(C));null==C&&(C=B());var t=B(),i=this.s,s=A.s,k=this.DB-Y(E[E.t-1]);k>0?(E.lShiftTo(k,t),Q.lShiftTo(k,C)):(E.copyTo(t),Q.copyTo(C));var r=t.t,S=t[r-1];if(0!=S){var J=S*(1<<this.F1)+(r>1?t[r-2]>>this.F2:0),G=this.FV/J,w=(1<<this.F1)/J,a=1<<this.F2,M=C.t,o=M-r,h=null==g?B():g;for(t.dlShiftTo(o,h),C.compareTo(h)>=0&&(C[C.t++]=1,C.subTo(h,C)),I.ONE.dlShiftTo(r,h),h.subTo(t,t);t.t<r;)t[t.t++]=0;for(;--o>=0;){var e=C[--M]==S?this.DM:Math.floor(C[M]*G+(C[M-1]+a)*w);if((C[M]+=t.am(0,e,C,o,0,r))<e)for(t.dlShiftTo(o,h),C.subTo(h,C);C[M]<--e;)C.subTo(h,C)}null!=g&&(C.drShiftTo(r,g),i!=s&&I.ZERO.subTo(g,g)),C.t=r,C.clamp(),k>0&&C.rShiftTo(k,C),i<0&&I.ZERO.subTo(C,C)}}},I.prototype.invDigit=function(){if(this.t<1)return 0;var A=this[0];if(!(1&A))return 0;var g=3&A;return(g=(g=(g=(g=g*(2-(15&A)*g)&15)*(2-(255&A)*g)&255)*(2-((65535&A)*g&65535))&65535)*(2-A*g%this.DV)%this.DV)>0?this.DV-g:-g},I.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},I.prototype.exp=function(A,g){if(A>4294967295||A<1)return I.ONE;var C=B(),E=B(),Q=g.convert(this),t=Y(A)-1;for(Q.copyTo(C);--t>=0;)if(g.sqrTo(C,E),(A&1<<t)>0)g.mulTo(E,Q,C);else{var i=C;C=E,E=i}return g.revert(C)},I.prototype.toString=function(A){if(this.s<0)return"-"+this.negate().toString(A);var g;if(16==A)g=4;else if(8==A)g=3;else if(2==A)g=1;else if(32==A)g=5;else{if(4!=A)return this.toRadix(A);g=2}var I,B=(1<<g)-1,C=!1,E="",Q=this.t,t=this.DB-Q*this.DB%g;if(Q-- >0)for(t<this.DB&&(I=this[Q]>>t)>0&&(C=!0,E=i(I));Q>=0;)t<g?(I=(this[Q]&(1<<t)-1)<<g-t,I|=this[--Q]>>(t+=this.DB-g)):(I=this[Q]>>(t-=g)&B,t<=0&&(t+=this.DB,--Q)),I>0&&(C=!0),C&&(E+=i(I));return C?E:"0"},I.prototype.negate=function(){var A=B();return I.ZERO.subTo(this,A),A},I.prototype.abs=function(){return this.s<0?this.negate():this},I.prototype.compareTo=function(A){var g=this.s-A.s;if(0!=g)return g;var I=this.t;if(0!=(g=I-A.t))return this.s<0?-g:g;for(;--I>=0;)if(0!=(g=this[I]-A[I]))return g;return 0},I.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+Y(this[this.t-1]^this.s&this.DM)},I.prototype.mod=function(A){var g=B();return this.abs().divRemTo(A,null,g),this.s<0&&g.compareTo(I.ZERO)>0&&A.subTo(g,g),g},I.prototype.modPowInt=function(A,g){var I;return I=A<256||g.isEven()?new r(g):new S(g),this.exp(A,I)},I.ZERO=k(0),I.ONE=k(1),h.prototype.convert=e,h.prototype.revert=e,h.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I)},h.prototype.sqrTo=function(A,g){A.squareTo(g)},W.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 g=B();return A.copyTo(g),this.reduce(g),g},W.prototype.revert=function(A){return A},W.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)},W.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I),this.reduce(I)},W.prototype.sqrTo=function(A,g){A.squareTo(g),this.reduce(g)};var D,l,R,V=[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],K=(1<<26)/V[V.length-1];function F(){var A;A=(new Date).getTime(),l[R++]^=255&A,l[R++]^=A>>8&255,l[R++]^=A>>16&255,l[R++]^=A>>24&255,R>=Z&&(R-=Z)}if(I.prototype.chunkSize=function(A){return Math.floor(Math.LN2*this.DB/Math.log(A))},I.prototype.toRadix=function(A){if(null==A&&(A=10),0==this.signum()||A<2||A>36)return"0";var g=this.chunkSize(A),I=Math.pow(A,g),C=k(I),E=B(),Q=B(),t="";for(this.divRemTo(C,E,Q);E.signum()>0;)t=(I+Q.intValue()).toString(A).substr(1)+t,E.divRemTo(C,E,Q);return Q.intValue().toString(A)+t},I.prototype.fromRadix=function(A,g){this.fromInt(0),null==g&&(g=10);for(var B=this.chunkSize(g),C=Math.pow(g,B),E=!1,Q=0,t=0,i=0;i<A.length;++i){var k=s(A,i);k<0?"-"==A.charAt(i)&&0==this.signum()&&(E=!0):(t=g*t+k,++Q>=B&&(this.dMultiply(C),this.dAddOffset(t,0),Q=0,t=0))}Q>0&&(this.dMultiply(Math.pow(g,Q)),this.dAddOffset(t,0)),E&&I.ZERO.subTo(this,this)},I.prototype.fromNumber=function(A,g,B){if("number"==typeof g)if(A<2)this.fromInt(1);else for(this.fromNumber(A,B),this.testBit(A-1)||this.bitwiseTo(I.ONE.shiftLeft(A-1),G,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(g);)this.dAddOffset(2,0),this.bitLength()>A&&this.subTo(I.ONE.shiftLeft(A-1),this);else{var C=new Array,E=7&A;C.length=1+(A>>3),g.nextBytes(C),E>0?C[0]&=(1<<E)-1:C[0]=0,this.fromString(C,256)}},I.prototype.bitwiseTo=function(A,g,I){var B,C,E=Math.min(A.t,this.t);for(B=0;B<E;++B)I[B]=g(this[B],A[B]);if(A.t<this.t){for(C=A.s&this.DM,B=E;B<this.t;++B)I[B]=g(this[B],C);I.t=this.t}else{for(C=this.s&this.DM,B=E;B<A.t;++B)I[B]=g(C,A[B]);I.t=A.t}I.s=g(this.s,A.s),I.clamp()},I.prototype.changeBit=function(A,g){var B=I.ONE.shiftLeft(A);return this.bitwiseTo(B,g,B),B},I.prototype.addTo=function(A,g){for(var I=0,B=0,C=Math.min(A.t,this.t);I<C;)B+=this[I]+A[I],g[I++]=B&this.DM,B>>=this.DB;if(A.t<this.t){for(B+=A.s;I<this.t;)B+=this[I],g[I++]=B&this.DM,B>>=this.DB;B+=this.s}else{for(B+=this.s;I<A.t;)B+=A[I],g[I++]=B&this.DM,B>>=this.DB;B+=A.s}g.s=B<0?-1:0,B>0?g[I++]=B:B<-1&&(g[I++]=this.DV+B),g.t=I,g.clamp()},I.prototype.dMultiply=function(A){this[this.t]=this.am(0,A-1,this,0,0,this.t),++this.t,this.clamp()},I.prototype.dAddOffset=function(A,g){if(0!=A){for(;this.t<=g;)this[this.t++]=0;for(this[g]+=A;this[g]>=this.DV;)this[g]-=this.DV,++g>=this.t&&(this[this.t++]=0),++this[g]}},I.prototype.multiplyLowerTo=function(A,g,I){var B,C=Math.min(this.t+A.t,g);for(I.s=0,I.t=C;C>0;)I[--C]=0;for(B=I.t-this.t;C<B;++C)I[C+this.t]=this.am(0,A[C],I,C,0,this.t);for(B=Math.min(A.t,g);C<B;++C)this.am(0,A[C],I,C,0,g-C);I.clamp()},I.prototype.multiplyUpperTo=function(A,g,I){--g;var B=I.t=this.t+A.t-g;for(I.s=0;--B>=0;)I[B]=0;for(B=Math.max(g-this.t,0);B<A.t;++B)I[this.t+B-g]=this.am(g-B,A[B],I,0,0,this.t+B-g);I.clamp(),I.drShiftTo(1,I)},I.prototype.modInt=function(A){if(A<=0)return 0;var g=this.DV%A,I=this.s<0?A-1:0;if(this.t>0)if(0==g)I=this[0]%A;else for(var B=this.t-1;B>=0;--B)I=(g*I+this[B])%A;return I},I.prototype.millerRabin=function(A){var g=this.subtract(I.ONE),C=g.getLowestSetBit();if(C<=0)return!1;var E=g.shiftRight(C);(A=A+1>>1)>V.length&&(A=V.length);for(var Q=B(),t=0;t<A;++t){Q.fromInt(V[Math.floor(Math.random()*V.length)]);var i=Q.modPow(E,this);if(0!=i.compareTo(I.ONE)&&0!=i.compareTo(g)){for(var s=1;s++<C&&0!=i.compareTo(g);)if(0==(i=i.modPowInt(2,this)).compareTo(I.ONE))return!1;if(0!=i.compareTo(g))return!1}}return!0},I.prototype.clone=function(){var A=B();return this.copyTo(A),A},I.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]},I.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},I.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},I.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},I.prototype.toByteArray=function(){var A=this.t,g=new Array;g[0]=this.s;var I,B=this.DB-A*this.DB%8,C=0;if(A-- >0)for(B<this.DB&&(I=this[A]>>B)!=(this.s&this.DM)>>B&&(g[C++]=I|this.s<<this.DB-B);A>=0;)B<8?(I=(this[A]&(1<<B)-1)<<8-B,I|=this[--A]>>(B+=this.DB-8)):(I=this[A]>>(B-=8)&255,B<=0&&(B+=this.DB,--A)),128&I&&(I|=-256),0==C&&(128&this.s)!=(128&I)&&++C,(C>0||I!=this.s)&&(g[C++]=I);return g},I.prototype.equals=function(A){return 0==this.compareTo(A)},I.prototype.min=function(A){return this.compareTo(A)<0?this:A},I.prototype.max=function(A){return this.compareTo(A)>0?this:A},I.prototype.and=function(A){var g=B();return this.bitwiseTo(A,J,g),g},I.prototype.or=function(A){var g=B();return this.bitwiseTo(A,G,g),g},I.prototype.xor=function(A){var g=B();return this.bitwiseTo(A,w,g),g},I.prototype.andNot=function(A){var g=B();return this.bitwiseTo(A,a,g),g},I.prototype.not=function(){for(var A=B(),g=0;g<this.t;++g)A[g]=this.DM&~this[g];return A.t=this.t,A.s=~this.s,A},I.prototype.shiftLeft=function(A){var g=B();return A<0?this.rShiftTo(-A,g):this.lShiftTo(A,g),g},I.prototype.shiftRight=function(A){var g=B();return A<0?this.lShiftTo(-A,g):this.rShiftTo(A,g),g},I.prototype.getLowestSetBit=function(){for(var A=0;A<this.t;++A)if(0!=this[A])return A*this.DB+M(this[A]);return this.s<0?this.t*this.DB:-1},I.prototype.bitCount=function(){for(var A=0,g=this.s&this.DM,I=0;I<this.t;++I)A+=o(this[I]^g);return A},I.prototype.testBit=function(A){var g=Math.floor(A/this.DB);return g>=this.t?0!=this.s:!!(this[g]&1<<A%this.DB)},I.prototype.setBit=function(A){return this.changeBit(A,G)},I.prototype.clearBit=function(A){return this.changeBit(A,a)},I.prototype.flipBit=function(A){return this.changeBit(A,w)},I.prototype.add=function(A){var g=B();return this.addTo(A,g),g},I.prototype.subtract=function(A){var g=B();return this.subTo(A,g),g},I.prototype.multiply=function(A){var g=B();return this.multiplyTo(A,g),g},I.prototype.divide=function(A){var g=B();return this.divRemTo(A,g,null),g},I.prototype.remainder=function(A){var g=B();return this.divRemTo(A,null,g),g},I.prototype.divideAndRemainder=function(A){var g=B(),I=B();return this.divRemTo(A,g,I),new Array(g,I)},I.prototype.modPow=function(A,g){var I,C,E=A.bitLength(),Q=k(1);if(E<=0)return Q;I=E<18?1:E<48?3:E<144?4:E<768?5:6,C=E<8?new r(g):g.isEven()?new W(g):new S(g);var t=new Array,i=3,s=I-1,J=(1<<I)-1;if(t[1]=C.convert(this),I>1){var G=B();for(C.sqrTo(t[1],G);i<=J;)t[i]=B(),C.mulTo(G,t[i-2],t[i]),i+=2}var w,a,M=A.t-1,o=!0,h=B();for(E=Y(A[M])-1;M>=0;){for(E>=s?w=A[M]>>E-s&J:(w=(A[M]&(1<<E+1)-1)<<s-E,M>0&&(w|=A[M-1]>>this.DB+E-s)),i=I;!(1&w);)w>>=1,--i;if((E-=i)<0&&(E+=this.DB,--M),o)t[w].copyTo(Q),o=!1;else{for(;i>1;)C.sqrTo(Q,h),C.sqrTo(h,Q),i-=2;i>0?C.sqrTo(Q,h):(a=Q,Q=h,h=a),C.mulTo(h,t[w],Q)}for(;M>=0&&!(A[M]&1<<E);)C.sqrTo(Q,h),a=Q,Q=h,h=a,--E<0&&(E=this.DB-1,--M)}return C.revert(Q)},I.prototype.modInverse=function(A){var g=A.isEven();if(this.isEven()&&g||0==A.signum())return I.ZERO;for(var B=A.clone(),C=this.clone(),E=k(1),Q=k(0),t=k(0),i=k(1);0!=B.signum();){for(;B.isEven();)B.rShiftTo(1,B),g?(E.isEven()&&Q.isEven()||(E.addTo(this,E),Q.subTo(A,Q)),E.rShiftTo(1,E)):Q.isEven()||Q.subTo(A,Q),Q.rShiftTo(1,Q);for(;C.isEven();)C.rShiftTo(1,C),g?(t.isEven()&&i.isEven()||(t.addTo(this,t),i.subTo(A,i)),t.rShiftTo(1,t)):i.isEven()||i.subTo(A,i),i.rShiftTo(1,i);B.compareTo(C)>=0?(B.subTo(C,B),g&&E.subTo(t,E),Q.subTo(i,Q)):(C.subTo(B,C),g&&t.subTo(E,t),i.subTo(Q,i))}return 0!=C.compareTo(I.ONE)?I.ZERO:i.compareTo(A)>=0?i.subtract(A):i.signum()<0?(i.addTo(A,i),i.signum()<0?i.add(A):i):i},I.prototype.pow=function(A){return this.exp(A,new h)},I.prototype.gcd=function(A){var g=this.s<0?this.negate():this.clone(),I=A.s<0?A.negate():A.clone();if(g.compareTo(I)<0){var B=g;g=I,I=B}var C=g.getLowestSetBit(),E=I.getLowestSetBit();if(E<0)return g;for(C<E&&(E=C),E>0&&(g.rShiftTo(E,g),I.rShiftTo(E,I));g.signum()>0;)(C=g.getLowestSetBit())>0&&g.rShiftTo(C,g),(C=I.getLowestSetBit())>0&&I.rShiftTo(C,I),g.compareTo(I)>=0?(g.subTo(I,g),g.rShiftTo(1,g)):(I.subTo(g,I),I.rShiftTo(1,I));return E>0&&I.lShiftTo(E,I),I},I.prototype.isProbablePrime=function(A){var g,I=this.abs();if(1==I.t&&I[0]<=V[V.length-1]){for(g=0;g<V.length;++g)if(I[0]==V[g])return!0;return!1}if(I.isEven())return!1;for(g=1;g<V.length;){for(var B=V[g],C=g+1;C<V.length&&B<K;)B*=V[C++];for(B=I.modInt(B);g<C;)if(B%V[g++]==0)return!1}return I.millerRabin(A)},I.prototype.square=function(){var A=B();return this.squareTo(A),A},I.prototype.Barrett=W,null==l){var y;if(l=new Array,R=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var U=new Uint8Array(32);for(window.crypto.getRandomValues(U),y=0;y<32;++y)l[R++]=U[y]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var n=window.crypto.random(32);for(y=0;y<n.length;++y)l[R++]=255&n.charCodeAt(y)}for(;R<Z;)y=Math.floor(65536*Math.random()),l[R++]=y>>>8,l[R++]=255&y;R=0,F()}function q(){if(null==D){for(F(),(D=new b).init(l),R=0;R<l.length;++R)l[R]=0;R=0}return D.next()}function x(){}function b(){this.i=0,this.j=0,this.S=new Array}x.prototype.nextBytes=function(A){var g;for(g=0;g<A.length;++g)A[g]=q()},b.prototype.init=function(A){var g,I,B;for(g=0;g<256;++g)this.S[g]=g;for(I=0,g=0;g<256;++g)I=I+this.S[g]+A[g%A.length]&255,B=this.S[g],this.S[g]=this.S[I],this.S[I]=B;this.i=0,this.j=0},b.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 Z=256;A.exports={default:I,BigInteger:I,SecureRandom:x}}.call(PI)),fI.exports;var A}function vI(){if(FI)return KI;FI=1;const{BigInteger:A}=XI();class g{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 g=A.toString(16);if(g.length%2==1&&(g="0"+g),A<128)return g;return(128+g.length/2).toString(16)+g}getValue(){return""}}class I extends g{constructor(g){super(),this.t="02",g&&(this.v=function(g){let I=g.toString(16);if("-"!==I[0])I.length%2==1?I="0"+I:I.match(/^[0-7]/)||(I="00"+I);else{I=I.substr(1);let B=I.length;B%2==1?B+=1:I.match(/^[0-7]/)||(B+=2);let C="";for(let A=0;A<B;A++)C+="f";C=new A(C,16),I=C.xor(g).add(A.ONE),I=I.toString(16).replace(/^-/,"")}return I}(g))}getValue(){return this.v}}class B extends g{constructor(A){super(),this.t="30",this.asn1Array=A}getValue(){return this.v=this.asn1Array.map(A=>A.getEncodedHex()).join(""),this.v}}function C(A,g){return+A[g+2]<8?1:128&+A.substr(g+2,2)}function E(g,I){const B=C(g,I),E=g.substr(I+2,2*B);if(!E)return-1;return(+E[0]<8?new A(E,16):new A(E.substr(2),16)).intValue()}function Q(A,g){return g+2*(C(A,g)+1)}return KI={encodeDer(A,g){const C=new I(A),E=new I(g);return new B([C,E]).getEncodedHex()},decodeDer(g){const I=Q(g,0),B=Q(g,I),C=E(g,I),t=g.substr(B,2*C),i=B+t.length,s=Q(g,i),k=E(g,i),Y=g.substr(s,2*k);return{r:new A(t,16),s:new A(Y,16)}}}}function zI(){if(qI)return nI;qI=1;const{BigInteger:A,SecureRandom:g}=XI(),{ECCurveFp:I}=function(){if(UI)return yI;UI=1;const{BigInteger:A}=XI(),g=new A("2"),I=new A("3");class B{constructor(A,g){this.x=g,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 B(this.q,this.x.negate().mod(this.q))}add(A){return new B(this.q,this.x.add(A.toBigInteger()).mod(this.q))}subtract(A){return new B(this.q,this.x.subtract(A.toBigInteger()).mod(this.q))}multiply(A){return new B(this.q,this.x.multiply(A.toBigInteger()).mod(this.q))}divide(A){return new B(this.q,this.x.multiply(A.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new B(this.q,this.x.square().mod(this.q))}}class C{constructor(g,I,B,C){this.curve=g,this.x=I,this.y=B,this.z=null==C?A.ONE:C,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(g){return g===this||(this.isInfinity()?g.isInfinity():g.isInfinity()?this.isInfinity():!!g.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(g.z)).mod(this.curve.q).equals(A.ZERO)&&g.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(g.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 C(this.curve,this.x,this.y.negate(),this.z)}add(g){if(this.isInfinity())return g;if(g.isInfinity())return this;const I=this.x.toBigInteger(),B=this.y.toBigInteger(),E=this.z,Q=g.x.toBigInteger(),t=g.y.toBigInteger(),i=g.z,s=this.curve.q,k=I.multiply(i).mod(s),Y=Q.multiply(E).mod(s),r=k.subtract(Y),S=B.multiply(i).mod(s),J=t.multiply(E).mod(s),G=S.subtract(J);if(A.ZERO.equals(r))return A.ZERO.equals(G)?this.twice():this.curve.infinity;const w=k.add(Y),a=E.multiply(i).mod(s),M=r.square().mod(s),o=r.multiply(M).mod(s),h=a.multiply(G.square()).subtract(w.multiply(M)).mod(s),e=r.multiply(h).mod(s),W=G.multiply(M.multiply(k).subtract(h)).subtract(S.multiply(o)).mod(s),D=o.multiply(a).mod(s);return new C(this.curve,this.curve.fromBigInteger(e),this.curve.fromBigInteger(W),D)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const A=this.x.toBigInteger(),g=this.y.toBigInteger(),B=this.z,E=this.curve.q,Q=this.curve.a.toBigInteger(),t=A.square().multiply(I).add(Q.multiply(B.square())).mod(E),i=g.shiftLeft(1).multiply(B).mod(E),s=g.square().mod(E),k=s.multiply(A).multiply(B).mod(E),Y=i.square().mod(E),r=t.square().subtract(k.shiftLeft(3)).mod(E),S=i.multiply(r).mod(E),J=t.multiply(k.shiftLeft(2).subtract(r)).subtract(Y.shiftLeft(1).multiply(s)).mod(E),G=i.multiply(Y).mod(E);return new C(this.curve,this.curve.fromBigInteger(S),this.curve.fromBigInteger(J),G)}multiply(A){if(this.isInfinity())return this;if(!A.signum())return this.curve.infinity;const g=A.multiply(I),B=this.negate();let C=this;for(let I=g.bitLength()-2;I>0;I--){C=C.twice();const E=g.testBit(I);E!==A.testBit(I)&&(C=C.add(E?this:B))}return C}}return yI={ECPointFp:C,ECCurveFp:class{constructor(A,g,I){this.q=A,this.a=this.fromBigInteger(g),this.b=this.fromBigInteger(I),this.infinity=new C(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 B(this.q,A)}decodePointHex(I){switch(parseInt(I.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const B=this.fromBigInteger(new A(I.substr(2),16));let E=this.fromBigInteger(B.multiply(B.square()).add(B.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new A("4")).add(A.ONE),this.q));return E.toBigInteger().mod(g).equals(new A(I.substr(0,2),16).subtract(g))||(E=E.negate()),new C(this,B,E);case 4:case 6:case 7:const Q=(I.length-2)/2,t=I.substr(2,Q),i=I.substr(Q+2,Q);return new C(this,this.fromBigInteger(new A(t,16)),this.fromBigInteger(new A(i,16)));default:return null}}}}}(),B=new g,{curve:C,G:E,n:Q}=t();function t(){const g=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),B=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),C=new A("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),E=new I(g,B,C),Q=E.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:E,G:Q,n:new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function i(A,g){return A.length>=g?A:new Array(g-A.length+1).join("0")+A}return nI={getGlobalCurve:function(){return C},generateEcparam:t,generateKeyPairHex:function(g,I,C){const t=(g?new A(g,I,C):new A(Q.bitLength(),B)).mod(Q.subtract(A.ONE)).add(A.ONE),s=i(t.toString(16),64),k=E.multiply(t);return{privateKey:s,publicKey:"04"+i(k.getX().toBigInteger().toString(16),64)+i(k.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(g){if(130!==g.length)throw new Error("Invalid public key to compress");const I=(g.length-2)/2,B=g.substr(2,I);let C="03";return new A(g.substr(I+2,I),16).mod(new A("2")).equals(A.ZERO)&&(C="02"),C+B},utf8ToHex:function(A){const g=(A=unescape(encodeURIComponent(A))).length,I=[];for(let C=0;C<g;C++)I[C>>>2]|=(255&A.charCodeAt(C))<<24-C%4*8;const B=[];for(let C=0;C<g;C++){const A=I[C>>>2]>>>24-C%4*8&255;B.push((A>>>4).toString(16)),B.push((15&A).toString(16))}return B.join("")},leftPad:i,arrayToHex:function(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")},arrayToUtf8:function(A){const g=[];let I=0;for(let C=0;C<2*A.length;C+=2)g[C>>>3]|=parseInt(A[I],10)<<24-C%8*4,I++;try{const I=[];for(let B=0;B<A.length;B++){const A=g[B>>>2]>>>24-B%4*8&255;I.push(String.fromCharCode(A))}return decodeURIComponent(escape(I.join("")))}catch(B){throw new Error("Malformed UTF-8 data")}},hexToArray:function(A){const g=[];let I=A.length;I%2!=0&&(A=i(A,I+1)),I=A.length;for(let B=0;B<I;B+=2)g.push(parseInt(A.substr(B,2),16));return g},verifyPublicKey:function(A){const g=C.decodePointHex(A);if(!g)return!1;const I=g.getX();return g.getY().square().equals(I.multiply(I.square()).add(I.multiply(C.a)).add(C.b))},comparePublicKeyHex:function(A,g){const I=C.decodePointHex(A);if(!I)return!1;const B=C.decodePointHex(g);return!!B&&I.equals(B)}}}function _I(){if(bI)return xI;bI=1;const A=new Uint32Array(68),g=new Uint32Array(64);function I(A,g){const I=31&g;return A<<I|A>>>32-I}function B(A,g){const I=[];for(let B=A.length-1;B>=0;B--)I[B]=255&(A[B]^g[B]);return I}function C(A){return A^I(A,9)^I(A,17)}function E(A){return A^I(A,15)^I(A,23)}function Q(B){let Q=8*B.length,t=Q%512;t=t>=448?512-t%448-1:448-t-1;const i=new Array((t-7)/8),s=new Array(8);for(let A=0,g=i.length;A<g;A++)i[A]=0;for(let A=0,g=s.length;A<g;A++)s[A]=0;Q=Q.toString(2);for(let A=7;A>=0;A--)if(Q.length>8){const g=Q.length-8;s[A]=parseInt(Q.substr(g),2),Q=Q.substr(0,g)}else Q.length>0&&(s[A]=parseInt(Q,2),Q="");const k=new Uint8Array([...B,128,...i,...s]),Y=new DataView(k.buffer,0),r=k.length/64,S=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let G=0;G<r;G++){A.fill(0),g.fill(0);const B=16*G;for(let g=0;g<16;g++)A[g]=Y.getUint32(4*(B+g),!1);for(let g=16;g<68;g++)A[g]=E(A[g-16]^A[g-9]^I(A[g-3],15))^I(A[g-13],7)^A[g-6];for(let I=0;I<64;I++)g[I]=A[I]^A[I+4];const Q=2043430169,t=2055708042;let i,s,k,r,J,w=S[0],a=S[1],M=S[2],o=S[3],h=S[4],e=S[5],W=S[6],D=S[7];for(let E=0;E<64;E++)J=E>=0&&E<=15?Q:t,i=I(I(w,12)+h+I(J,E),7),s=i^I(w,12),k=(E>=0&&E<=15?w^a^M:w&a|w&M|a&M)+o+s+g[E],r=(E>=0&&E<=15?h^e^W:h&e|~h&W)+D+i+A[E],o=M,M=I(a,9),a=w,w=k,D=W,W=I(e,19),e=h,h=C(r);S[0]^=w,S[1]^=a,S[2]^=M,S[3]^=o,S[4]^=h,S[5]^=e,S[6]^=W,S[7]^=D}const J=[];for(let A=0,g=S.length;A<g;A++){const g=S[A];J.push((4278190080&g)>>>24,(16711680&g)>>>16,(65280&g)>>>8,255&g)}return J}const t=new Uint8Array(64),i=new Uint8Array(64);for(let s=0;s<64;s++)t[s]=54,i[s]=92;return xI={sm3:Q,hmac:function(A,g){for(g.length>64&&(g=Q(g));g.length<64;)g.push(0);const I=B(g,t),C=B(g,i),E=Q([...I,...A]);return Q([...C,...E])}}}function $I(){if(pI)return ZI;pI=1;const{BigInteger:A}=XI(),{encodeDer:g,decodeDer:I}=vI(),B=zI(),C=_I().sm3,{G:E,curve:Q,n:t}=B.generateEcparam();function i(A,g,I="1234567812345678"){I=B.utf8ToHex(I);const Q=B.leftPad(E.curve.a.toBigInteger().toRadix(16),64),t=B.leftPad(E.curve.b.toBigInteger().toRadix(16),64),i=B.leftPad(E.getX().toBigInteger().toRadix(16),64),s=B.leftPad(E.getY().toBigInteger().toRadix(16),64);let k,Y;if(128===g.length)k=g.substr(0,64),Y=g.substr(64,64);else{const A=E.curve.decodePointHex(g);k=B.leftPad(A.getX().toBigInteger().toRadix(16),64),Y=B.leftPad(A.getY().toBigInteger().toRadix(16),64)}const r=B.hexToArray(I+Q+t+i+s+k+Y),S=4*I.length;r.unshift(255&S),r.unshift(S>>8&255);const J=C(r);return B.arrayToHex(C(J.concat(B.hexToArray(A))))}function s(g){const I=E.multiply(new A(g,16));return"04"+B.leftPad(I.getX().toBigInteger().toString(16),64)+B.leftPad(I.getY().toBigInteger().toString(16),64)}function k(){const g=B.generateKeyPairHex(),I=Q.decodePointHex(g.publicKey);return g.k=new A(g.privateKey,16),g.x1=I.getX().toBigInteger(),g}return ZI={generateKeyPairHex:B.generateKeyPairHex,compressPublicKeyHex:B.compressPublicKeyHex,comparePublicKeyHex:B.comparePublicKeyHex,doEncrypt:function(g,I,E=1){g="string"==typeof g?B.hexToArray(B.utf8ToHex(g)):Array.prototype.slice.call(g),I=B.getGlobalCurve().decodePointHex(I);const Q=B.generateKeyPairHex(),t=new A(Q.privateKey,16);let i=Q.publicKey;i.length>128&&(i=i.substr(i.length-128));const s=I.multiply(t),k=B.hexToArray(B.leftPad(s.getX().toBigInteger().toRadix(16),64)),Y=B.hexToArray(B.leftPad(s.getY().toBigInteger().toRadix(16),64)),r=B.arrayToHex(C([].concat(k,g,Y)));let S=1,J=0,G=[];const w=[].concat(k,Y),a=()=>{G=C([...w,S>>24&255,S>>16&255,S>>8&255,255&S]),S++,J=0};a();for(let A=0,B=g.length;A<B;A++)J===G.length&&a(),g[A]^=255&G[J++];const M=B.arrayToHex(g);return 0===E?i+M+r:i+r+M},doDecrypt:function(g,I,E=1,{output:Q="string"}={}){I=new A(I,16);let t=g.substr(128,64),i=g.substr(192);0===E&&(t=g.substr(g.length-64),i=g.substr(128,g.length-128-64));const s=B.hexToArray(i),k=B.getGlobalCurve().decodePointHex("04"+g.substr(0,128)).multiply(I),Y=B.hexToArray(B.leftPad(k.getX().toBigInteger().toRadix(16),64)),r=B.hexToArray(B.leftPad(k.getY().toBigInteger().toRadix(16),64));let S=1,J=0,G=[];const w=[].concat(Y,r),a=()=>{G=C([...w,S>>24&255,S>>16&255,S>>8&255,255&S]),S++,J=0};a();for(let A=0,B=s.length;A<B;A++)J===G.length&&a(),s[A]^=255&G[J++];return B.arrayToHex(C([].concat(Y,s,r)))===t.toLowerCase()?"array"===Q?s:B.arrayToUtf8(s):"array"===Q?[]:""},doSignature:function(I,C,{pointPool:E,der:Q,hash:Y,publicKey:r,userId:S}={}){let J="string"==typeof I?B.utf8ToHex(I):B.arrayToHex(I);Y&&(J=i(J,r=r||s(C),S));const G=new A(C,16),w=new A(J,16);let a=null,M=null,o=null;do{do{let A;A=E&&E.length?E.pop():k(),a=A.k,M=w.add(A.x1).mod(t)}while(M.equals(A.ZERO)||M.add(a).equals(t));o=G.add(A.ONE).modInverse(t).multiply(a.subtract(M.multiply(G))).mod(t)}while(o.equals(A.ZERO));return Q?g(M,o):B.leftPad(M.toString(16),64)+B.leftPad(o.toString(16),64)},doVerifySignature:function(g,C,s,{der:k,hash:Y,userId:r}={}){let S,J,G="string"==typeof g?B.utf8ToHex(g):B.arrayToHex(g);if(Y&&(G=i(G,s,r)),k){const A=I(C);S=A.r,J=A.s}else S=new A(C.substring(0,64),16),J=new A(C.substring(64),16);const w=Q.decodePointHex(s),a=new A(G,16),M=S.add(J).mod(t);if(M.equals(A.ZERO))return!1;const o=E.multiply(J).add(w.multiply(M)),h=a.add(o.getX().toBigInteger()).mod(t);return S.equals(h)},getPublicKeyFromPrivateKey:s,getPoint:k,verifyPublicKey:B.verifyPublicKey}}function AB(){if(jI)return cI;jI=1;const{sm3:A,hmac:g}=_I();function I(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")}function B(A){const g=[];let I=A.length;var B,C;I%2!=0&&(C=I+1,A=(B=A).length>=C?B:new Array(C-B.length+1).join("0")+B),I=A.length;for(let E=0;E<I;E+=2)g.push(parseInt(A.substr(E,2),16));return g}return cI=function(C,E){if(C="string"==typeof C?function(A){const g=[];for(let I=0,B=A.length;I<B;I++){const B=A.codePointAt(I);if(B<=127)g.push(B);else if(B<=2047)g.push(192|B>>>6),g.push(128|63&B);else if(B<=55295||B>=57344&&B<=65535)g.push(224|B>>>12),g.push(128|B>>>6&63),g.push(128|63&B);else{if(!(B>=65536&&B<=1114111))throw g.push(B),new Error("input is not supported");I++,g.push(240|B>>>18&28),g.push(128|B>>>12&63),g.push(128|B>>>6&63),g.push(128|63&B)}}return g}(C):Array.prototype.slice.call(C),E){if("hmac"!==(E.mode||"hmac"))throw new Error("invalid mode");let A=E.key;if(!A)throw new Error("invalid key");return A="string"==typeof A?B(A):Array.prototype.slice.call(A),I(g(C,A))}return I(A(C))}}function gB(){if(mI)return uI;mI=1;const A=16,g=[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],I=[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 B(A){const g=[];for(let I=0,B=A.length;I<B;I+=2)g.push(parseInt(A.substr(I,2),16));return g}function C(A,g){const I=31&g;return A<<I|A>>>32-I}function E(A){return(255&g[A>>>24&255])<<24|(255&g[A>>>16&255])<<16|(255&g[A>>>8&255])<<8|255&g[255&A]}function Q(A){return A^C(A,2)^C(A,10)^C(A,18)^C(A,24)}function t(A){return A^C(A,13)^C(A,23)}function i(A,g,I){const B=new Array(4),C=new Array(4);for(let E=0;E<4;E++)C[0]=255&A[4*E],C[1]=255&A[4*E+1],C[2]=255&A[4*E+2],C[3]=255&A[4*E+3],B[E]=C[0]<<24|C[1]<<16|C[2]<<8|C[3];for(let t,i=0;i<32;i+=4)t=B[1]^B[2]^B[3]^I[i+0],B[0]^=Q(E(t)),t=B[2]^B[3]^B[0]^I[i+1],B[1]^=Q(E(t)),t=B[3]^B[0]^B[1]^I[i+2],B[2]^=Q(E(t)),t=B[0]^B[1]^B[2]^I[i+3],B[3]^=Q(E(t));for(let E=0;E<16;E+=4)g[E]=B[3-E/4]>>>24&255,g[E+1]=B[3-E/4]>>>16&255,g[E+2]=B[3-E/4]>>>8&255,g[E+3]=255&B[3-E/4]}function s(g,C,Q,{padding:s="pkcs#7",mode:k,iv:Y=[],output:r="string"}={}){if("cbc"===k&&("string"==typeof Y&&(Y=B(Y)),16!==Y.length))throw new Error("iv is invalid");if("string"==typeof C&&(C=B(C)),16!==C.length)throw new Error("key is invalid");if(g="string"==typeof g?0!==Q?function(A){const g=[];for(let I=0,B=A.length;I<B;I++){const B=A.codePointAt(I);if(B<=127)g.push(B);else if(B<=2047)g.push(192|B>>>6),g.push(128|63&B);else if(B<=55295||B>=57344&&B<=65535)g.push(224|B>>>12),g.push(128|B>>>6&63),g.push(128|63&B);else{if(!(B>=65536&&B<=1114111))throw g.push(B),new Error("input is not supported");I++,g.push(240|B>>>18&28),g.push(128|B>>>12&63),g.push(128|B>>>6&63),g.push(128|63&B)}}return g}(g):B(g):[...g],("pkcs#5"===s||"pkcs#7"===s)&&0!==Q){const I=A-g.length%A;for(let A=0;A<I;A++)g.push(I)}const S=new Array(32);!function(A,g,B){const C=new Array(4),Q=new Array(4);for(let I=0;I<4;I++)Q[0]=255&A[0+4*I],Q[1]=255&A[1+4*I],Q[2]=255&A[2+4*I],Q[3]=255&A[3+4*I],C[I]=Q[0]<<24|Q[1]<<16|Q[2]<<8|Q[3];C[0]^=2746333894,C[1]^=1453994832,C[2]^=1736282519,C[3]^=2993693404;for(let i,s=0;s<32;s+=4)i=C[1]^C[2]^C[3]^I[s+0],g[s+0]=C[0]^=t(E(i)),i=C[2]^C[3]^C[0]^I[s+1],g[s+1]=C[1]^=t(E(i)),i=C[3]^C[0]^C[1]^I[s+2],g[s+2]=C[2]^=t(E(i)),i=C[0]^C[1]^C[2]^I[s+3],g[s+3]=C[3]^=t(E(i));if(0===B)for(let I,E=0;E<16;E++)I=g[E],g[E]=g[31-E],g[31-E]=I}(C,S,Q);const J=[];let G=Y,w=g.length,a=0;for(;w>=A;){const I=g.slice(a,a+16),B=new Array(16);if("cbc"===k)for(let g=0;g<A;g++)0!==Q&&(I[g]^=G[g]);i(I,B,S);for(let g=0;g<A;g++)"cbc"===k&&0===Q&&(B[g]^=G[g]),J[a+g]=B[g];"cbc"===k&&(G=0!==Q?B:I),w-=A,a+=A}if(("pkcs#5"===s||"pkcs#7"===s)&&0===Q){const A=J.length,g=J[A-1];for(let I=1;I<=g;I++)if(J[A-I]!==g)throw new Error("padding is invalid");J.splice(A-g,g)}return"array"!==r?0!==Q?J.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join(""):function(A){const g=[];for(let I=0,B=A.length;I<B;I++)A[I]>=240&&A[I]<=247?(g.push(String.fromCodePoint(((7&A[I])<<18)+((63&A[I+1])<<12)+((63&A[I+2])<<6)+(63&A[I+3]))),I+=3):A[I]>=224&&A[I]<=239?(g.push(String.fromCodePoint(((15&A[I])<<12)+((63&A[I+1])<<6)+(63&A[I+2]))),I+=2):A[I]>=192&&A[I]<=223?(g.push(String.fromCodePoint(((31&A[I])<<6)+(63&A[I+1]))),I++):g.push(String.fromCodePoint(A[I]));return g.join("")}(J):J}return uI={encrypt:(A,g,I)=>s(A,g,1,I),decrypt:(A,g,I)=>s(A,g,0,I)}}const IB=Z(NI?LI:(NI=1,LI={sm2:$I(),sm3:AB(),sm4:gB()}));class BB{constructor(A,g,I,B){U(this,Q,null),U(this,t,null),U(this,i,null),U(this,s,null),U(this,k,(A,g=!1)=>{if(!g)return"object"==typeof A?JSON.stringify(A):String(A);try{return JSON.parse(A)}catch(I){return A}}),this.setkey(A),this.setiv(g),this.setPublicKey(I),this.setPrivateKey(B)}setPublicKey(A){n(this,i,A)}setPrivateKey(A){n(this,s,A)}setkey(A){n(this,Q,A&&this.stringToWordArray(A.padEnd(16,"0")))}setiv(A){n(this,t,A&&this.stringToWordArray(A))}sm2Encrypt(A,g){return IB.sm2.doEncrypt(A,g,{inputEncoding:"utf8",outputEncoding:"hex",pointFormat:"uncompressed",cipherMode:1})}sm2Decrypt(A,g){return IB.sm2.doDecrypt(A,g,1)}RSAencrypt(A){A=y(this,k).call(this,A);const g=new HI;return g.setPublicKey(y(this,i)),g.encrypt(A)}RSAdecrypt(A){const g=new HI;return g.setPrivateKey(y(this,s)),y(this,k).call(this,g.decrypt(A),!0)}stringToWordArray(A){return Rg.enc.Utf8.parse(A)}wordArrayToString(A){return A.toString(Rg.enc.Utf8)}AESencrypt(A,g=!0){return A=y(this,k).call(this,A),Rg.AES.encrypt(A,y(this,Q),{iv:y(this,t),mode:Rg.mode.CBC,padding:Rg.pad.Pkcs7}).ciphertext.toString(g?Rg.enc.Base64:Rg.enc.Hex)}AESdecrypt(A,g=!0){A=g?A:Rg.enc.Base64.stringify(Rg.enc.Hex.parse(A));let I=Rg.AES.decrypt(A,y(this,Q),{iv:y(this,t),mode:Rg.mode.CBC,padding:Rg.pad.Pkcs7});return y(this,k).call(this,I.toString(Rg.enc.Utf8),!0)}DESencrypt(A,g=!0){return A=y(this,k).call(this,A),Rg.DES.encrypt(A,y(this,Q),{iv:y(this,t),mode:Rg.mode.CBC,padding:Rg.pad.Pkcs7}).ciphertext.toString(g?Rg.enc.Base64:Rg.enc.Hex)}DESdecrypt(A,g=!0){A=g?A:Rg.enc.Base64.stringify(Rg.enc.Hex.parse(A));let I=Rg.DES.decrypt(A,y(this,Q),{iv:y(this,t),mode:Rg.mode.CBC,padding:Rg.pad.Pkcs7});return y(this,k).call(this,I.toString(Rg.enc.Utf8),!0)}base64Encode(A){return A=y(this,k).call(this,A),Rg.enc.Base64.stringify(Rg.enc.Utf8.parse(A))}base64Decode(A){return y(this,k).call(this,Rg.enc.Base64.parse(A).toString(Rg.enc.Utf8),!0)}md5(A){return A=y(this,k).call(this,A),Rg.MD5(A).toString()}fileMd5(A,g,I){return new Promise((B,C)=>{if(!A)return void C("");const E=new FileReader;if(E.onerror=A=>{C(A)},g){const t=Rg.algo.MD5.create();let i=0;try{let C=function(){const I=A.slice(i,i+g);E.readAsArrayBuffer(I)};E.onload=E=>{const Q=Rg.lib.WordArray.create(new Uint8Array(E.target.result));if(t.update(Q),"function"==typeof I&&I(i,A.size),i+=g,i<A.size)C();else{const A=t.finalize();B(A.toString(Rg.enc.Hex))}},C()}catch(Q){C(Q)}}else E.onload=g=>{"function"==typeof I&&I(A.size,A.size),B(Rg.MD5(Rg.lib.WordArray.create(g.target.result)).toString())},E.readAsArrayBuffer(A)})}sha1(A){return A=y(this,k).call(this,A),Rg.SHA1(A).toString()}sha256(A){return A=y(this,k).call(this,A),Rg.SHA256(A).toString()}sha3(A){return A=y(this,k).call(this,A),Rg.SHA3(A,{outputLength:256}).toString()}pbkdf2(A){A=y(this,k).call(this,A);let g=Rg.lib.WordArray.random(16);return Rg.PBKDF2(A,g,{keySize:8,iterations:1e3}).toString()}hmac(A,g){return A=y(this,k).call(this,A),Rg.HmacSHA256(A,g).toString(Rg.enc.Hex)}}function CB(A=18,g=36){(g<2||g>36)&&(g=36);var I=Math.random().toString(g).substring(2,13).padEnd(11,"0").slice(0,A);return A<=11?I:I+CB(A-11)}function EB(A){A=A.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(A,g,I,B)=>g+g+I+I+B+B);const g=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);return g?{r:parseInt(g[1],16),g:parseInt(g[2],16),b:parseInt(g[3],16)}:null}function QB(A){return new Promise((g,I)=>{if(A)try{var B=new FileReader;let C="";B.readAsDataURL(A),B.onload=function(){C=B.result},B.onerror=function(A){I(A)},B.onloadend=function(){g(C)}}catch(C){I(C)}else I("")})}Q=new WeakMap,t=new WeakMap,i=new WeakMap,s=new WeakMap,k=new WeakMap;const tB={formatDateTime:function(A="yyyy-MM-dd hh:mm:ss",g=new Date,I=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]){!g&&(g=new Date),"string"==typeof g&&(g=new Date(g));const B={"M+":g.getMonth()+1,"d+":g.getDate(),"h+":g.getHours(),"m+":g.getMinutes(),"s+":g.getSeconds(),S:g.getMilliseconds(),w:I[g.getDay()]};/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(g.getFullYear()+"").substr(4-RegExp.$1.length)));for(const C in B)new RegExp("("+C+")").test(A)&&(A=A.replace(RegExp.$1,1===RegExp.$1.length?B[C]:("00"+B[C]).substr((""+B[C]).length)));return A},throttle:function(A,g=500){var I=Date.now();return function(...B){Date.now()-I>=g&&(A.apply(this,B),I=Date.now())}},debounce:function(A,g=500){let I=null;return function(...B){clearTimeout(I),I=setTimeout(()=>{A.apply(this,B)},g)}},rgbToHex:function(A,g,I){return"#"+((1<<24)+(A<<16)+(g<<8)+I).toString(16).slice(1)},hexToRgb:EB,hslToRgb:function(A,g,I){let B,C,E;if(A/=360,I/=100,0===(g/=100))B=C=E=I;else{const Q=(A,g,I)=>(I<0&&(I+=1),I>1&&(I-=1),I<1/6?A+6*(g-A)*I:I<.5?g:I<2/3?A+(g-A)*(2/3-I)*6:A),t=I<.5?I*(1+g):I+g-I*g,i=2*I-t;B=Q(i,t,A+1/3),C=Q(i,t,A),E=Q(i,t,A-1/3)}return{r:Math.round(255*B),g:Math.round(255*C),b:Math.round(255*E)}},rgbOrHexToHsl:function(A){let g,I,B;if("string"==typeof A&&"#"===A.charAt(0)){const C=EB(A);g=C.r/255,I=C.g/255,B=C.b/255}else{if("object"!=typeof A)throw new Error("Invalid input format");g=A.r/255,I=A.g/255,B=A.b/255}const C=Math.max(g,I,B),E=Math.min(g,I,B);let Q,t,i=(C+E)/2;if(C===E)Q=t=0;else{const A=C-E;switch(t=i>.5?A/(2-C-E):A/(C+E),C){case g:Q=(I-B)/A+(I<B?6:0);break;case I:Q=(B-g)/A+2;break;case B:Q=(g-I)/A+4}Q/=6}return{h:Math.round(360*Q),s:Math.round(100*t),l:Math.round(100*i)}},preciseInterval:function(A,g){let I,B=null;return I=requestAnimationFrame(function C(E){B||(B=E),E-B>=g&&(A(),B=E),I=requestAnimationFrame(C)}),{clear:function(){cancelAnimationFrame(I)}}},convertImgToBase64:function(A,g){return new Promise(function(I){var B=document.createElement("CANVAS"),C=B.getContext("2d"),E=new Image;E.crossOrigin="Anonymous",E.onload=function(){B.height=E.height,B.width=E.width,C.drawImage(E,0,0);var A=B.toDataURL(g||"image/jpg");I(A),B=null},E.src=A})},objectGroupBy:function(A,g){if("string"==typeof g){const A=g;g=g=>g[A]}var I={};return A.forEach((B,C)=>{const E=g(B,C,A);I[E]||(I[E]=[]),I[E].push(B)}),I},randomNum:function(A,g){return Math.floor(Math.random()*(g+1-A))+A},randomColor:function(){return"#"+Math.floor(16777215*Math.random()).toString(16).padEnd(6,"0")},deepCloning:function A(g,I=new WeakMap){if("object"!=typeof g||null===g)return g;if(I.has(g))return I.get(g);var B=Array.isArray(g)?[]:{};I.set(g,B);for(const E in g)if(g.hasOwnProperty(E)){const Q=g[E];if("object"!=typeof Q||null===Q)B[E]=Q;else try{B[E]=A(Q,I)}catch(C){}}return B},randomStr:CB,getUrlParams:function(A){const g={};let I=A.substring(A.lastIndexOf("?")+1);return I=decodeURIComponent(I),I.replace(/([^?&=]+)=([^?&=]*)/g,(A,I,B)=>{const C=decodeURIComponent(I);let E=decodeURIComponent(B);try{E=JSON.parse(E)}catch(Q){}return g[C]=E,A}),g},getBroswer:function(){let A="";const g=window.navigator.userAgent.toLowerCase();if(/(msie|firefox|opera|chrome|netscape)\D+(\d[\d.]*)/.test(g)){const I=g.search(RegExp.$1);A=g.substring(I,g.length).replace(/safari\D+(\d[\d.]*)/,"")}else/version\D+(\d[\d.]*).*safari/.test(g)&&(A="safari "+RegExp.$2);return A},fileTurnBase64:QB,fileChunks:function(A,g,I,B){return new Promise((C,E)=>{const Q=new BB,t={fileHash:"",fileName:A.name,chunkSize:g,fileSize:A.size,fileType:A.type,chunks:[]};let i=new Promise((I,C)=>{Q.fileMd5(A,g,B).then(A=>{t.fileHash=A,I(t)}).catch(A=>{C(A)})}),s=new Promise((B,C)=>{let E=0;!async function C(){if(E>=A.size)return void B(t);let Q=A.slice(E,Math.min(E+g,A.size));I&&(Q=await QB(Q)),t.chunks.push({chunk:Q,index:E/g}),E+=g,C()}()});Promise.all([i,s]).then(()=>{C(t)}).catch(A=>{E(A)})})},base64ArrayMerge:function(A,g=!0){let I=(A=A.map(A=>function(A){const g="=".repeat((4-A.length%4)%4),I=(A+g).replace(/\-/g,"+").replace(/_/g,"/"),B=window.atob(I),C=new Uint8Array(B.length);for(let E=0;E<B.length;++E)C[E]=B.charCodeAt(E);return C}(A.split(",")[1]))).reduce((A,g)=>A+g.length,0);const B=new Uint8Array(I);let C=0;A.forEach(A=>{B.set(A,C),C+=A.length});const E=new Blob([B]);return new Promise((A,I)=>{g?QB(E).then(g=>{A(g)}).catch(A=>{I(A)}):A(E)})},toChineseNumber:function(A,g=!0){let I=A.toString().replace(/(?=(\d{4})+$)/g,",").split(",").filter(Boolean);const B=["零","一","二","三","四","五","六","七","八","九"],C=["","十","百","千"],E=["","万","亿"];let Q=I.map((A,g)=>function(A){let g="";for(let I=0;I<A.length;I++){let E=B[A[I]],Q=C[A.length-I-1];"零"===E&&(Q=""),g+=E+Q}return g=g.replace(/零+/g,"零").replace(/零$/,""),g}(A)+E[I.length-1-g]).join("");if(Q=Q||"零",g){let A={"零":"零","一":"壹","二":"贰","三":"叁","四":"肆","五":"伍","六":"陆","七":"柒","八":"捌","九":"玖","十":"拾","百":"佰","千":"仟"};Q=Q.split("").map(g=>A[g]||g).join("")}return Q},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,g){if(!A)return;"object"==typeof A&&(A=JSON.stringify(A));const I=new Blob([A],{type:"application/json;charset=utf-8"}),B=URL.createObjectURL(I),C=document.createElement("a");C.href=B,C.download=0==g.indexOf(".")?CB()+g:g,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(B)}};const iB=(null==(Y=window.Cesium)?void 0:Y.WebMapTileServiceImageryProvider)||Object;class sB extends iB{constructor(A){super(A),K(this,"myAlp",0),K(this,"myRgb",[20,107,173]),this.myAlp=A.alp||0,this.myRgb=A.rgb||[20,107,173]}requestImage(A,g,I){return super.requestImage(A,g,I).then(A=>{if(!this.myAlp)return A;const g=document.createElement("canvas");g.width=A.width,g.height=A.height;const I=g.getContext("2d");return I.translate(0,g.height),I.scale(1,-1),I.drawImage(A,0,0),I.globalCompositeOperation="source-atop",I.fillStyle=`rgba(${this.myRgb[0]},${this.myRgb[1]},${this.myRgb[2]}, ${this.myAlp})`,I.fillRect(0,0,g.width,g.height),I.globalCompositeOperation="source-over",I.stroke(),g})}}class kB{constructor(A){U(this,r,null),U(this,S,null),U(this,J,null),U(this,G,null),K(this,"TianDiTuToken",""),K(this,"loadTdtYingXiang",(A={},g=[])=>{const I=y(this,G).viewer;var B={tdtyxType:"img_w",maximumLevel:18,...A},C=new sB({rgb:g,alp:g[3],url:`http://t{s}.tianditu.gov.cn/${B.tdtyxType}/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=${"img_w"==B.tdtyxType?"img":"vec"}&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:B.maximumLevel,minimumLevel:0}),E=I.imageryLayers.addImageryProvider(C);return I.imageryLayers.lowerToBottom(E),{entity:E,remove(){I.imageryLayers.remove(E)}}}),K(this,"loadTdtZhuJi",(A={},g=[])=>{const I=y(this,G).viewer;var B={maximumLevel:18,...A},C=new sB({rgb:g,alp:g[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:B.maximumLevel,show:!0}),E=I.imageryLayers.addImageryProvider(C);return I.imageryLayers.raiseToTop(E),{entity:E,remove(){I.imageryLayers.remove(E)}}}),K(this,"setImageLayerFilter",(A={},g=0)=>{var I={invertColor:!0,alpha:1,dayAlpha:1,nightAlpha:1,brightness:1,contrast:1,hue:50,saturation:1,gamma:1,...A},B=y(this,G).viewer.imageryLayers.get(g);B.invertColor=I.invertColor,B.alpha=I.alpha,B.dayAlpha=I.dayAlpha,B.nightAlpha=I.nightAlpha,B.brightness=I.brightness,B.contrast=I.contrast,B.hue=I.hue,B.saturation=I.saturation,B.gamma=I.gamma}),n(this,G,A),this.TianDiTuToken=A.TianDiTuToken,this.showTdtYX=!0,this.showTdtLW=!0}set showTdtYX(A){A?y(this,r)||n(this,r,this.loadTdtYingXiang()):(y(this,r)&&y(this,r).remove(),n(this,r,null))}set showTdtLW(A){A?y(this,S)||n(this,S,this.loadTdtLuWang()):(y(this,S)&&y(this,S).remove(),n(this,S,null))}set showTdtZJ(A){A?y(this,J)||n(this,J,this.loadTdtZhuJi()):(y(this,J)&&y(this,J).remove(),n(this,J,null))}loadTdtLuWang(A={},g=[]){const I=y(this,G).viewer;var B={maximumLevel:18,show:!0,...A},C=new sB({rgb:g,alp:g[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:B.maximumLevel,show:B.show}),E=I.imageryLayers.addImageryProvider(C);return I.imageryLayers.raiseToTop(E),{entity:E,remove(){I.imageryLayers.remove(E)}}}}r=new WeakMap,S=new WeakMap,J=new WeakMap,G=new WeakMap;const YB=Symbol(),rB="el",SB=(A,g,I,B,C)=>{let E=`${A}-${g}`;return I&&(E+=`-${I}`),B&&(E+=`__${B}`),C&&(E+=`--${C}`),E},JB=Symbol("namespaceContextKey"),GB=(A,I)=>{const B=(A=>{const I=A||(g.getCurrentInstance()?g.inject(JB,g.ref(rB)):g.ref(rB));return g.computed(()=>g.unref(I)||rB)})(I);return{namespace:B,b:(g="")=>SB(B.value,A,g,"",""),e:g=>g?SB(B.value,A,"",g,""):"",m:g=>g?SB(B.value,A,"","",g):"",be:(g,I)=>g&&I?SB(B.value,A,g,I,""):"",em:(g,I)=>g&&I?SB(B.value,A,"",g,I):"",bm:(g,I)=>g&&I?SB(B.value,A,g,"",I):"",bem:(g,I,C)=>g&&I&&C?SB(B.value,A,g,I,C):"",is:(A,...g)=>{const I=!(g.length>=1)||g[0];return A&&I?`is-${A}`:""},cssVar:A=>{const g={};for(const I in A)A[I]&&(g[`--${B.value}-${I}`]=A[I]);return g},cssVarName:A=>`--${B.value}-${A}`,cssVarBlock:g=>{const I={};for(const C in g)g[C]&&(I[`--${B.value}-${A}-${C}`]=g[C]);return I},cssVarBlockName:g=>`--${B.value}-${A}-${g}`}};
|
|
33
|
+
var lI={};void 0!==lI.asn1&&lI.asn1||(lI.asn1={}),lI.asn1.ASN1Util=new function(){this.integerToByteHex=function(A){var g=A.toString(16);return g.length%2==1&&(g="0"+g),g},this.bigIntToMinTwosComplementsHex=function(A){var g=A.toString(16);if("-"!=g.substr(0,1))g.length%2==1?g="0"+g:g.match(/^[0-7]/)||(g="00"+g);else{var I=g.substr(1).length;I%2==1?I+=1:g.match(/^[0-7]/)||(I+=2);for(var B="",C=0;C<I;C++)B+="f";g=new zg(B,16).xor(A).add(zg.ONE).toString(16).replace(/^-/,"")}return g},this.getPEMStringFromHex=function(A,g){return hextopem(A,g)},this.newObject=function(A){var g=lI.asn1,I=g.DERBoolean,B=g.DERInteger,C=g.DERBitString,E=g.DEROctetString,Q=g.DERNull,t=g.DERObjectIdentifier,i=g.DEREnumerated,s=g.DERUTF8String,k=g.DERNumericString,Y=g.DERPrintableString,r=g.DERTeletexString,S=g.DERIA5String,J=g.DERUTCTime,G=g.DERGeneralizedTime,w=g.DERSequence,a=g.DERSet,M=g.DERTaggedObject,o=g.ASN1Util.newObject,h=Object.keys(A);if(1!=h.length)throw"key of param shall be only one.";var e=h[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+e+":"))throw"undefined key: "+e;if("bool"==e)return new I(A[e]);if("int"==e)return new B(A[e]);if("bitstr"==e)return new C(A[e]);if("octstr"==e)return new E(A[e]);if("null"==e)return new Q(A[e]);if("oid"==e)return new t(A[e]);if("enum"==e)return new i(A[e]);if("utf8str"==e)return new s(A[e]);if("numstr"==e)return new k(A[e]);if("prnstr"==e)return new Y(A[e]);if("telstr"==e)return new r(A[e]);if("ia5str"==e)return new S(A[e]);if("utctime"==e)return new J(A[e]);if("gentime"==e)return new G(A[e]);if("seq"==e){for(var W=A[e],D=[],l=0;l<W.length;l++){var R=o(W[l]);D.push(R)}return new w({array:D})}if("set"==e){for(W=A[e],D=[],l=0;l<W.length;l++){R=o(W[l]);D.push(R)}return new a({array:D})}if("tag"==e){var V=A[e];if("[object Array]"===Object.prototype.toString.call(V)&&3==V.length){var K=o(V[2]);return new M({tag:V[0],explicit:V[1],obj:K})}var F={};if(void 0!==V.explicit&&(F.explicit=V.explicit),void 0!==V.tag&&(F.tag=V.tag),void 0===V.obj)throw"obj shall be specified for 'tag'.";return F.obj=o(V.obj),new M(F)}},this.jsonToASN1HEX=function(A){return this.newObject(A).getEncodedHex()}},lI.asn1.ASN1Util.oidHexToInt=function(A){for(var g="",I=parseInt(A.substr(0,2),16),B=(g=Math.floor(I/40)+"."+I%40,""),C=2;C<A.length;C+=2){var E=("00000000"+parseInt(A.substr(C,2),16).toString(2)).slice(-8);if(B+=E.substr(1,7),"0"==E.substr(0,1))g=g+"."+new zg(B,2).toString(10),B=""}return g},lI.asn1.ASN1Util.oidIntToHex=function(A){var g=function(A){var g=A.toString(16);return 1==g.length&&(g="0"+g),g},I=function(A){var I="",B=new zg(A,10).toString(2),C=7-B.length%7;7==C&&(C=0);for(var E="",Q=0;Q<C;Q++)E+="0";B=E+B;for(Q=0;Q<B.length-1;Q+=7){var t=B.substr(Q,7);Q!=B.length-7&&(t="1"+t),I+=g(parseInt(t,2))}return I};if(!A.match(/^[0-9.]+$/))throw"malformed oid string: "+A;var B="",C=A.split("."),E=40*parseInt(C[0])+parseInt(C[1]);B+=g(E),C.splice(0,2);for(var Q=0;Q<C.length;Q++)B+=I(C[Q]);return B},lI.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,g=A.toString(16);if(g.length%2==1&&(g="0"+g),A<128)return g;var I=g.length/2;if(I>15)throw"ASN.1 length too long to represent by 8x: n = "+A.toString(16);return(128+I).toString(16)+g},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""}},lI.asn1.DERAbstractString=function(A){lI.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))},DI.lang.extend(lI.asn1.DERAbstractString,lI.asn1.ASN1Object),lI.asn1.DERAbstractTime=function(A){lI.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(A){return utc=A.getTime()+6e4*A.getTimezoneOffset(),new Date(utc)},this.formatDate=function(A,g,I){var B=this.zeroPadding,C=this.localDateToUTC(A),E=String(C.getFullYear());"utc"==g&&(E=E.substr(2,2));var Q=E+B(String(C.getMonth()+1),2)+B(String(C.getDate()),2)+B(String(C.getHours()),2)+B(String(C.getMinutes()),2)+B(String(C.getSeconds()),2);if(!0===I){var t=C.getMilliseconds();if(0!=t){var i=B(String(t),3);Q=Q+"."+(i=i.replace(/[0]+$/,""))}}return Q+"Z"},this.zeroPadding=function(A,g){return A.length>=g?A:new Array(g-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,g,I,B,C,E){var Q=new Date(Date.UTC(A,g-1,I,B,C,E,0));this.setByDate(Q)},this.getFreshValueHex=function(){return this.hV}},DI.lang.extend(lI.asn1.DERAbstractTime,lI.asn1.ASN1Object),lI.asn1.DERAbstractStructured=function(A){lI.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)},DI.lang.extend(lI.asn1.DERAbstractStructured,lI.asn1.ASN1Object),lI.asn1.DERBoolean=function(){lI.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},DI.lang.extend(lI.asn1.DERBoolean,lI.asn1.ASN1Object),lI.asn1.DERInteger=function(A){lI.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(A){this.hTLV=null,this.isModified=!0,this.hV=lI.asn1.ASN1Util.bigIntToMinTwosComplementsHex(A)},this.setByInteger=function(A){var g=new zg(String(A),10);this.setByBigInteger(g)},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))},DI.lang.extend(lI.asn1.DERInteger,lI.asn1.ASN1Object),lI.asn1.DERBitString=function(A){if(void 0!==A&&void 0!==A.obj){var g=lI.asn1.ASN1Util.newObject(A.obj);A.hex="00"+g.getEncodedHex()}lI.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,g){if(A<0||7<A)throw"unused bits shall be from 0 to 7: u = "+A;var I="0"+A;this.hTLV=null,this.isModified=!0,this.hV=I+g},this.setByBinaryString=function(A){var g=8-(A=A.replace(/0+$/,"")).length%8;8==g&&(g=0);for(var I=0;I<=g;I++)A+="0";var B="";for(I=0;I<A.length-1;I+=8){var C=A.substr(I,8),E=parseInt(C,2).toString(16);1==E.length&&(E="0"+E),B+=E}this.hTLV=null,this.isModified=!0,this.hV="0"+g+B},this.setByBooleanArray=function(A){for(var g="",I=0;I<A.length;I++)1==A[I]?g+="1":g+="0";this.setByBinaryString(g)},this.newFalseArray=function(A){for(var g=new Array(A),I=0;I<A;I++)g[I]=!1;return g},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))},DI.lang.extend(lI.asn1.DERBitString,lI.asn1.ASN1Object),lI.asn1.DEROctetString=function(A){if(void 0!==A&&void 0!==A.obj){var g=lI.asn1.ASN1Util.newObject(A.obj);A.hex=g.getEncodedHex()}lI.asn1.DEROctetString.superclass.constructor.call(this,A),this.hT="04"},DI.lang.extend(lI.asn1.DEROctetString,lI.asn1.DERAbstractString),lI.asn1.DERNull=function(){lI.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},DI.lang.extend(lI.asn1.DERNull,lI.asn1.ASN1Object),lI.asn1.DERObjectIdentifier=function(A){var g=function(A){var g=A.toString(16);return 1==g.length&&(g="0"+g),g},I=function(A){var I="",B=new zg(A,10).toString(2),C=7-B.length%7;7==C&&(C=0);for(var E="",Q=0;Q<C;Q++)E+="0";B=E+B;for(Q=0;Q<B.length-1;Q+=7){var t=B.substr(Q,7);Q!=B.length-7&&(t="1"+t),I+=g(parseInt(t,2))}return I};lI.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 B="",C=A.split("."),E=40*parseInt(C[0])+parseInt(C[1]);B+=g(E),C.splice(0,2);for(var Q=0;Q<C.length;Q++)B+=I(C[Q]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=B},this.setValueName=function(A){var g=lI.asn1.x509.OID.name2oid(A);if(""===g)throw"DERObjectIdentifier oidName undefined: "+A;this.setValueOidString(g)},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))},DI.lang.extend(lI.asn1.DERObjectIdentifier,lI.asn1.ASN1Object),lI.asn1.DEREnumerated=function(A){lI.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(A){this.hTLV=null,this.isModified=!0,this.hV=lI.asn1.ASN1Util.bigIntToMinTwosComplementsHex(A)},this.setByInteger=function(A){var g=new zg(String(A),10);this.setByBigInteger(g)},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))},DI.lang.extend(lI.asn1.DEREnumerated,lI.asn1.ASN1Object),lI.asn1.DERUTF8String=function(A){lI.asn1.DERUTF8String.superclass.constructor.call(this,A),this.hT="0c"},DI.lang.extend(lI.asn1.DERUTF8String,lI.asn1.DERAbstractString),lI.asn1.DERNumericString=function(A){lI.asn1.DERNumericString.superclass.constructor.call(this,A),this.hT="12"},DI.lang.extend(lI.asn1.DERNumericString,lI.asn1.DERAbstractString),lI.asn1.DERPrintableString=function(A){lI.asn1.DERPrintableString.superclass.constructor.call(this,A),this.hT="13"},DI.lang.extend(lI.asn1.DERPrintableString,lI.asn1.DERAbstractString),lI.asn1.DERTeletexString=function(A){lI.asn1.DERTeletexString.superclass.constructor.call(this,A),this.hT="14"},DI.lang.extend(lI.asn1.DERTeletexString,lI.asn1.DERAbstractString),lI.asn1.DERIA5String=function(A){lI.asn1.DERIA5String.superclass.constructor.call(this,A),this.hT="16"},DI.lang.extend(lI.asn1.DERIA5String,lI.asn1.DERAbstractString),lI.asn1.DERUTCTime=function(A){lI.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))},DI.lang.extend(lI.asn1.DERUTCTime,lI.asn1.DERAbstractTime),lI.asn1.DERGeneralizedTime=function(A){lI.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))},DI.lang.extend(lI.asn1.DERGeneralizedTime,lI.asn1.DERAbstractTime),lI.asn1.DERSequence=function(A){lI.asn1.DERSequence.superclass.constructor.call(this,A),this.hT="30",this.getFreshValueHex=function(){for(var A="",g=0;g<this.asn1Array.length;g++){A+=this.asn1Array[g].getEncodedHex()}return this.hV=A,this.hV}},DI.lang.extend(lI.asn1.DERSequence,lI.asn1.DERAbstractStructured),lI.asn1.DERSet=function(A){lI.asn1.DERSet.superclass.constructor.call(this,A),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var A=new Array,g=0;g<this.asn1Array.length;g++){var I=this.asn1Array[g];A.push(I.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)},DI.lang.extend(lI.asn1.DERSet,lI.asn1.DERAbstractStructured),lI.asn1.DERTaggedObject=function(A){lI.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(A,g,I){this.hT=g,this.isExplicit=A,this.asn1Object=I,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=I.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,g),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)))},DI.lang.extend(lI.asn1.DERTaggedObject,lI.asn1.ASN1Object);var RI,VI,KI,FI,yI,UI,nI,qI,xI,bI,ZI,pI,cI,jI,uI,mI,LI,NI,TI=function(){var A=function(g,I){return(A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,g){A.__proto__=g}||function(A,g){for(var I in g)Object.prototype.hasOwnProperty.call(g,I)&&(A[I]=g[I])})(g,I)};return function(g,I){if("function"!=typeof I&&null!==I)throw new TypeError("Class extends value "+String(I)+" is not a constructor or null");function B(){this.constructor=g}A(g,I),g.prototype=null===I?Object.create(I):(B.prototype=I.prototype,new B)}}(),dI=function(A){function g(I){var B=A.call(this)||this;return I&&("string"==typeof I?B.parseKey(I):(g.hasPrivateKeyProperty(I)||g.hasPublicKeyProperty(I))&&B.parsePropertiesFrom(I)),B}return TI(g,A),g.prototype.parseKey=function(A){try{var g=0,I=0,B=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(A)?jg(A):ug.unarmor(A),C=fg.decode(B);if(3===C.sub.length&&(C=C.sub[2].sub[0]),9===C.sub.length){g=C.sub[1].getHexStringValue(),this.n=BI(g,16),I=C.sub[2].getHexStringValue(),this.e=parseInt(I,16);var E=C.sub[3].getHexStringValue();this.d=BI(E,16);var Q=C.sub[4].getHexStringValue();this.p=BI(Q,16);var t=C.sub[5].getHexStringValue();this.q=BI(t,16);var i=C.sub[6].getHexStringValue();this.dmp1=BI(i,16);var s=C.sub[7].getHexStringValue();this.dmq1=BI(s,16);var k=C.sub[8].getHexStringValue();this.coeff=BI(k,16)}else{if(2!==C.sub.length)return!1;if(C.sub[0].sub){var Y=C.sub[1].sub[0];g=Y.sub[0].getHexStringValue(),this.n=BI(g,16),I=Y.sub[1].getHexStringValue(),this.e=parseInt(I,16)}else g=C.sub[0].getHexStringValue(),this.n=BI(g,16),I=C.sub[1].getHexStringValue(),this.e=parseInt(I,16)}return!0}catch(r){return!1}},g.prototype.getPrivateBaseKey=function(){var A={array:[new lI.asn1.DERInteger({int:0}),new lI.asn1.DERInteger({bigint:this.n}),new lI.asn1.DERInteger({int:this.e}),new lI.asn1.DERInteger({bigint:this.d}),new lI.asn1.DERInteger({bigint:this.p}),new lI.asn1.DERInteger({bigint:this.q}),new lI.asn1.DERInteger({bigint:this.dmp1}),new lI.asn1.DERInteger({bigint:this.dmq1}),new lI.asn1.DERInteger({bigint:this.coeff})]};return new lI.asn1.DERSequence(A).getEncodedHex()},g.prototype.getPrivateBaseKeyB64=function(){return Zg(this.getPrivateBaseKey())},g.prototype.getPublicBaseKey=function(){var A=new lI.asn1.DERSequence({array:[new lI.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new lI.asn1.DERNull]}),g=new lI.asn1.DERSequence({array:[new lI.asn1.DERInteger({bigint:this.n}),new lI.asn1.DERInteger({int:this.e})]}),I=new lI.asn1.DERBitString({hex:"00"+g.getEncodedHex()});return new lI.asn1.DERSequence({array:[A,I]}).getEncodedHex()},g.prototype.getPublicBaseKeyB64=function(){return Zg(this.getPublicBaseKey())},g.wordwrap=function(A,g){if(!A)return A;var I="(.{1,"+(g=g||64)+"})( +|$\n?)|(.{1,"+g+"})";return A.match(RegExp(I,"g")).join("\n")},g.prototype.getPrivateKey=function(){var A="-----BEGIN RSA PRIVATE KEY-----\n";return A+=g.wordwrap(this.getPrivateBaseKeyB64())+"\n",A+="-----END RSA PRIVATE KEY-----"},g.prototype.getPublicKey=function(){var A="-----BEGIN PUBLIC KEY-----\n";return A+=g.wordwrap(this.getPublicBaseKeyB64())+"\n",A+="-----END PUBLIC KEY-----"},g.hasPublicKeyProperty=function(A){return(A=A||{}).hasOwnProperty("n")&&A.hasOwnProperty("e")},g.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")},g.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)},g}(eI),OI="undefined"!=typeof process?null===(RI=process.env)||void 0===RI?void 0:RI.npm_package_version:void 0,HI=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 dI(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(pg(A))}catch(g){return!1}},A.prototype.encrypt=function(A){try{return Zg(this.getKey().encrypt(A))}catch(g){return!1}},A.prototype.sign=function(A,g,I){try{return Zg(this.getKey().sign(A,g,I))}catch(B){return!1}},A.prototype.verify=function(A,g,I){try{return this.getKey().verify(A,pg(g),I)}catch(B){return!1}},A.prototype.getKey=function(A){if(!this.key){if(this.key=new dI,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=OI,A}(),fI={exports:{}},PI=fI.exports;function XI(){return VI||(VI=1,A=fI,function(){var g;function I(A,g,I){null!=A&&("number"==typeof A?this.fromNumber(A,g,I):null==g&&"string"!=typeof A?this.fromString(A,256):this.fromString(A,g))}function B(){return new I(null)}var C="undefined"!=typeof navigator;C&&"Microsoft Internet Explorer"==navigator.appName?(I.prototype.am=function(A,g,I,B,C,E){for(var Q=32767&g,t=g>>15;--E>=0;){var i=32767&this[A],s=this[A++]>>15,k=t*i+s*Q;C=((i=Q*i+((32767&k)<<15)+I[B]+(1073741823&C))>>>30)+(k>>>15)+t*s+(C>>>30),I[B++]=1073741823&i}return C},g=30):C&&"Netscape"!=navigator.appName?(I.prototype.am=function(A,g,I,B,C,E){for(;--E>=0;){var Q=g*this[A++]+I[B]+C;C=Math.floor(Q/67108864),I[B++]=67108863&Q}return C},g=26):(I.prototype.am=function(A,g,I,B,C,E){for(var Q=16383&g,t=g>>14;--E>=0;){var i=16383&this[A],s=this[A++]>>14,k=t*i+s*Q;C=((i=Q*i+((16383&k)<<14)+I[B]+C)>>28)+(k>>14)+t*s,I[B++]=268435455&i}return C},g=28),I.prototype.DB=g,I.prototype.DM=(1<<g)-1,I.prototype.DV=1<<g,I.prototype.FV=Math.pow(2,52),I.prototype.F1=52-g,I.prototype.F2=2*g-52;var E,Q,t=new Array;for(E="0".charCodeAt(0),Q=0;Q<=9;++Q)t[E++]=Q;for(E="a".charCodeAt(0),Q=10;Q<36;++Q)t[E++]=Q;for(E="A".charCodeAt(0),Q=10;Q<36;++Q)t[E++]=Q;function i(A){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(A)}function s(A,g){var I=t[A.charCodeAt(g)];return null==I?-1:I}function k(A){var g=B();return g.fromInt(A),g}function Y(A){var g,I=1;return 0!=(g=A>>>16)&&(A=g,I+=16),0!=(g=A>>8)&&(A=g,I+=8),0!=(g=A>>4)&&(A=g,I+=4),0!=(g=A>>2)&&(A=g,I+=2),0!=(g=A>>1)&&(A=g,I+=1),I}function r(A){this.m=A}function S(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 J(A,g){return A&g}function G(A,g){return A|g}function w(A,g){return A^g}function a(A,g){return A&~g}function M(A){if(0==A)return-1;var g=0;return 65535&A||(A>>=16,g+=16),255&A||(A>>=8,g+=8),15&A||(A>>=4,g+=4),3&A||(A>>=2,g+=2),1&A||++g,g}function o(A){for(var g=0;0!=A;)A&=A-1,++g;return g}function h(){}function e(A){return A}function W(A){this.r2=B(),this.q3=B(),I.ONE.dlShiftTo(2*A.t,this.r2),this.mu=this.r2.divide(A),this.m=A}r.prototype.convert=function(A){return A.s<0||A.compareTo(this.m)>=0?A.mod(this.m):A},r.prototype.revert=function(A){return A},r.prototype.reduce=function(A){A.divRemTo(this.m,null,A)},r.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I),this.reduce(I)},r.prototype.sqrTo=function(A,g){A.squareTo(g),this.reduce(g)},S.prototype.convert=function(A){var g=B();return A.abs().dlShiftTo(this.m.t,g),g.divRemTo(this.m,null,g),A.s<0&&g.compareTo(I.ZERO)>0&&this.m.subTo(g,g),g},S.prototype.revert=function(A){var g=B();return A.copyTo(g),this.reduce(g),g},S.prototype.reduce=function(A){for(;A.t<=this.mt2;)A[A.t++]=0;for(var g=0;g<this.m.t;++g){var I=32767&A[g],B=I*this.mpl+((I*this.mph+(A[g]>>15)*this.mpl&this.um)<<15)&A.DM;for(A[I=g+this.m.t]+=this.m.am(0,B,A,g,0,this.m.t);A[I]>=A.DV;)A[I]-=A.DV,A[++I]++}A.clamp(),A.drShiftTo(this.m.t,A),A.compareTo(this.m)>=0&&A.subTo(this.m,A)},S.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I),this.reduce(I)},S.prototype.sqrTo=function(A,g){A.squareTo(g),this.reduce(g)},I.prototype.copyTo=function(A){for(var g=this.t-1;g>=0;--g)A[g]=this[g];A.t=this.t,A.s=this.s},I.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},I.prototype.fromString=function(A,g){var B;if(16==g)B=4;else if(8==g)B=3;else if(256==g)B=8;else if(2==g)B=1;else if(32==g)B=5;else{if(4!=g)return void this.fromRadix(A,g);B=2}this.t=0,this.s=0;for(var C=A.length,E=!1,Q=0;--C>=0;){var t=8==B?255&A[C]:s(A,C);t<0?"-"==A.charAt(C)&&(E=!0):(E=!1,0==Q?this[this.t++]=t:Q+B>this.DB?(this[this.t-1]|=(t&(1<<this.DB-Q)-1)<<Q,this[this.t++]=t>>this.DB-Q):this[this.t-1]|=t<<Q,(Q+=B)>=this.DB&&(Q-=this.DB))}8==B&&128&A[0]&&(this.s=-1,Q>0&&(this[this.t-1]|=(1<<this.DB-Q)-1<<Q)),this.clamp(),E&&I.ZERO.subTo(this,this)},I.prototype.clamp=function(){for(var A=this.s&this.DM;this.t>0&&this[this.t-1]==A;)--this.t},I.prototype.dlShiftTo=function(A,g){var I;for(I=this.t-1;I>=0;--I)g[I+A]=this[I];for(I=A-1;I>=0;--I)g[I]=0;g.t=this.t+A,g.s=this.s},I.prototype.drShiftTo=function(A,g){for(var I=A;I<this.t;++I)g[I-A]=this[I];g.t=Math.max(this.t-A,0),g.s=this.s},I.prototype.lShiftTo=function(A,g){var I,B=A%this.DB,C=this.DB-B,E=(1<<C)-1,Q=Math.floor(A/this.DB),t=this.s<<B&this.DM;for(I=this.t-1;I>=0;--I)g[I+Q+1]=this[I]>>C|t,t=(this[I]&E)<<B;for(I=Q-1;I>=0;--I)g[I]=0;g[Q]=t,g.t=this.t+Q+1,g.s=this.s,g.clamp()},I.prototype.rShiftTo=function(A,g){g.s=this.s;var I=Math.floor(A/this.DB);if(I>=this.t)g.t=0;else{var B=A%this.DB,C=this.DB-B,E=(1<<B)-1;g[0]=this[I]>>B;for(var Q=I+1;Q<this.t;++Q)g[Q-I-1]|=(this[Q]&E)<<C,g[Q-I]=this[Q]>>B;B>0&&(g[this.t-I-1]|=(this.s&E)<<C),g.t=this.t-I,g.clamp()}},I.prototype.subTo=function(A,g){for(var I=0,B=0,C=Math.min(A.t,this.t);I<C;)B+=this[I]-A[I],g[I++]=B&this.DM,B>>=this.DB;if(A.t<this.t){for(B-=A.s;I<this.t;)B+=this[I],g[I++]=B&this.DM,B>>=this.DB;B+=this.s}else{for(B+=this.s;I<A.t;)B-=A[I],g[I++]=B&this.DM,B>>=this.DB;B-=A.s}g.s=B<0?-1:0,B<-1?g[I++]=this.DV+B:B>0&&(g[I++]=B),g.t=I,g.clamp()},I.prototype.multiplyTo=function(A,g){var B=this.abs(),C=A.abs(),E=B.t;for(g.t=E+C.t;--E>=0;)g[E]=0;for(E=0;E<C.t;++E)g[E+B.t]=B.am(0,C[E],g,E,0,B.t);g.s=0,g.clamp(),this.s!=A.s&&I.ZERO.subTo(g,g)},I.prototype.squareTo=function(A){for(var g=this.abs(),I=A.t=2*g.t;--I>=0;)A[I]=0;for(I=0;I<g.t-1;++I){var B=g.am(I,g[I],A,2*I,0,1);(A[I+g.t]+=g.am(I+1,2*g[I],A,2*I+1,B,g.t-I-1))>=g.DV&&(A[I+g.t]-=g.DV,A[I+g.t+1]=1)}A.t>0&&(A[A.t-1]+=g.am(I,g[I],A,2*I,0,1)),A.s=0,A.clamp()},I.prototype.divRemTo=function(A,g,C){var E=A.abs();if(!(E.t<=0)){var Q=this.abs();if(Q.t<E.t)return null!=g&&g.fromInt(0),void(null!=C&&this.copyTo(C));null==C&&(C=B());var t=B(),i=this.s,s=A.s,k=this.DB-Y(E[E.t-1]);k>0?(E.lShiftTo(k,t),Q.lShiftTo(k,C)):(E.copyTo(t),Q.copyTo(C));var r=t.t,S=t[r-1];if(0!=S){var J=S*(1<<this.F1)+(r>1?t[r-2]>>this.F2:0),G=this.FV/J,w=(1<<this.F1)/J,a=1<<this.F2,M=C.t,o=M-r,h=null==g?B():g;for(t.dlShiftTo(o,h),C.compareTo(h)>=0&&(C[C.t++]=1,C.subTo(h,C)),I.ONE.dlShiftTo(r,h),h.subTo(t,t);t.t<r;)t[t.t++]=0;for(;--o>=0;){var e=C[--M]==S?this.DM:Math.floor(C[M]*G+(C[M-1]+a)*w);if((C[M]+=t.am(0,e,C,o,0,r))<e)for(t.dlShiftTo(o,h),C.subTo(h,C);C[M]<--e;)C.subTo(h,C)}null!=g&&(C.drShiftTo(r,g),i!=s&&I.ZERO.subTo(g,g)),C.t=r,C.clamp(),k>0&&C.rShiftTo(k,C),i<0&&I.ZERO.subTo(C,C)}}},I.prototype.invDigit=function(){if(this.t<1)return 0;var A=this[0];if(!(1&A))return 0;var g=3&A;return(g=(g=(g=(g=g*(2-(15&A)*g)&15)*(2-(255&A)*g)&255)*(2-((65535&A)*g&65535))&65535)*(2-A*g%this.DV)%this.DV)>0?this.DV-g:-g},I.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},I.prototype.exp=function(A,g){if(A>4294967295||A<1)return I.ONE;var C=B(),E=B(),Q=g.convert(this),t=Y(A)-1;for(Q.copyTo(C);--t>=0;)if(g.sqrTo(C,E),(A&1<<t)>0)g.mulTo(E,Q,C);else{var i=C;C=E,E=i}return g.revert(C)},I.prototype.toString=function(A){if(this.s<0)return"-"+this.negate().toString(A);var g;if(16==A)g=4;else if(8==A)g=3;else if(2==A)g=1;else if(32==A)g=5;else{if(4!=A)return this.toRadix(A);g=2}var I,B=(1<<g)-1,C=!1,E="",Q=this.t,t=this.DB-Q*this.DB%g;if(Q-- >0)for(t<this.DB&&(I=this[Q]>>t)>0&&(C=!0,E=i(I));Q>=0;)t<g?(I=(this[Q]&(1<<t)-1)<<g-t,I|=this[--Q]>>(t+=this.DB-g)):(I=this[Q]>>(t-=g)&B,t<=0&&(t+=this.DB,--Q)),I>0&&(C=!0),C&&(E+=i(I));return C?E:"0"},I.prototype.negate=function(){var A=B();return I.ZERO.subTo(this,A),A},I.prototype.abs=function(){return this.s<0?this.negate():this},I.prototype.compareTo=function(A){var g=this.s-A.s;if(0!=g)return g;var I=this.t;if(0!=(g=I-A.t))return this.s<0?-g:g;for(;--I>=0;)if(0!=(g=this[I]-A[I]))return g;return 0},I.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+Y(this[this.t-1]^this.s&this.DM)},I.prototype.mod=function(A){var g=B();return this.abs().divRemTo(A,null,g),this.s<0&&g.compareTo(I.ZERO)>0&&A.subTo(g,g),g},I.prototype.modPowInt=function(A,g){var I;return I=A<256||g.isEven()?new r(g):new S(g),this.exp(A,I)},I.ZERO=k(0),I.ONE=k(1),h.prototype.convert=e,h.prototype.revert=e,h.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I)},h.prototype.sqrTo=function(A,g){A.squareTo(g)},W.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 g=B();return A.copyTo(g),this.reduce(g),g},W.prototype.revert=function(A){return A},W.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)},W.prototype.mulTo=function(A,g,I){A.multiplyTo(g,I),this.reduce(I)},W.prototype.sqrTo=function(A,g){A.squareTo(g),this.reduce(g)};var D,l,R,V=[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],K=(1<<26)/V[V.length-1];function F(){var A;A=(new Date).getTime(),l[R++]^=255&A,l[R++]^=A>>8&255,l[R++]^=A>>16&255,l[R++]^=A>>24&255,R>=Z&&(R-=Z)}if(I.prototype.chunkSize=function(A){return Math.floor(Math.LN2*this.DB/Math.log(A))},I.prototype.toRadix=function(A){if(null==A&&(A=10),0==this.signum()||A<2||A>36)return"0";var g=this.chunkSize(A),I=Math.pow(A,g),C=k(I),E=B(),Q=B(),t="";for(this.divRemTo(C,E,Q);E.signum()>0;)t=(I+Q.intValue()).toString(A).substr(1)+t,E.divRemTo(C,E,Q);return Q.intValue().toString(A)+t},I.prototype.fromRadix=function(A,g){this.fromInt(0),null==g&&(g=10);for(var B=this.chunkSize(g),C=Math.pow(g,B),E=!1,Q=0,t=0,i=0;i<A.length;++i){var k=s(A,i);k<0?"-"==A.charAt(i)&&0==this.signum()&&(E=!0):(t=g*t+k,++Q>=B&&(this.dMultiply(C),this.dAddOffset(t,0),Q=0,t=0))}Q>0&&(this.dMultiply(Math.pow(g,Q)),this.dAddOffset(t,0)),E&&I.ZERO.subTo(this,this)},I.prototype.fromNumber=function(A,g,B){if("number"==typeof g)if(A<2)this.fromInt(1);else for(this.fromNumber(A,B),this.testBit(A-1)||this.bitwiseTo(I.ONE.shiftLeft(A-1),G,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(g);)this.dAddOffset(2,0),this.bitLength()>A&&this.subTo(I.ONE.shiftLeft(A-1),this);else{var C=new Array,E=7&A;C.length=1+(A>>3),g.nextBytes(C),E>0?C[0]&=(1<<E)-1:C[0]=0,this.fromString(C,256)}},I.prototype.bitwiseTo=function(A,g,I){var B,C,E=Math.min(A.t,this.t);for(B=0;B<E;++B)I[B]=g(this[B],A[B]);if(A.t<this.t){for(C=A.s&this.DM,B=E;B<this.t;++B)I[B]=g(this[B],C);I.t=this.t}else{for(C=this.s&this.DM,B=E;B<A.t;++B)I[B]=g(C,A[B]);I.t=A.t}I.s=g(this.s,A.s),I.clamp()},I.prototype.changeBit=function(A,g){var B=I.ONE.shiftLeft(A);return this.bitwiseTo(B,g,B),B},I.prototype.addTo=function(A,g){for(var I=0,B=0,C=Math.min(A.t,this.t);I<C;)B+=this[I]+A[I],g[I++]=B&this.DM,B>>=this.DB;if(A.t<this.t){for(B+=A.s;I<this.t;)B+=this[I],g[I++]=B&this.DM,B>>=this.DB;B+=this.s}else{for(B+=this.s;I<A.t;)B+=A[I],g[I++]=B&this.DM,B>>=this.DB;B+=A.s}g.s=B<0?-1:0,B>0?g[I++]=B:B<-1&&(g[I++]=this.DV+B),g.t=I,g.clamp()},I.prototype.dMultiply=function(A){this[this.t]=this.am(0,A-1,this,0,0,this.t),++this.t,this.clamp()},I.prototype.dAddOffset=function(A,g){if(0!=A){for(;this.t<=g;)this[this.t++]=0;for(this[g]+=A;this[g]>=this.DV;)this[g]-=this.DV,++g>=this.t&&(this[this.t++]=0),++this[g]}},I.prototype.multiplyLowerTo=function(A,g,I){var B,C=Math.min(this.t+A.t,g);for(I.s=0,I.t=C;C>0;)I[--C]=0;for(B=I.t-this.t;C<B;++C)I[C+this.t]=this.am(0,A[C],I,C,0,this.t);for(B=Math.min(A.t,g);C<B;++C)this.am(0,A[C],I,C,0,g-C);I.clamp()},I.prototype.multiplyUpperTo=function(A,g,I){--g;var B=I.t=this.t+A.t-g;for(I.s=0;--B>=0;)I[B]=0;for(B=Math.max(g-this.t,0);B<A.t;++B)I[this.t+B-g]=this.am(g-B,A[B],I,0,0,this.t+B-g);I.clamp(),I.drShiftTo(1,I)},I.prototype.modInt=function(A){if(A<=0)return 0;var g=this.DV%A,I=this.s<0?A-1:0;if(this.t>0)if(0==g)I=this[0]%A;else for(var B=this.t-1;B>=0;--B)I=(g*I+this[B])%A;return I},I.prototype.millerRabin=function(A){var g=this.subtract(I.ONE),C=g.getLowestSetBit();if(C<=0)return!1;var E=g.shiftRight(C);(A=A+1>>1)>V.length&&(A=V.length);for(var Q=B(),t=0;t<A;++t){Q.fromInt(V[Math.floor(Math.random()*V.length)]);var i=Q.modPow(E,this);if(0!=i.compareTo(I.ONE)&&0!=i.compareTo(g)){for(var s=1;s++<C&&0!=i.compareTo(g);)if(0==(i=i.modPowInt(2,this)).compareTo(I.ONE))return!1;if(0!=i.compareTo(g))return!1}}return!0},I.prototype.clone=function(){var A=B();return this.copyTo(A),A},I.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]},I.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},I.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},I.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},I.prototype.toByteArray=function(){var A=this.t,g=new Array;g[0]=this.s;var I,B=this.DB-A*this.DB%8,C=0;if(A-- >0)for(B<this.DB&&(I=this[A]>>B)!=(this.s&this.DM)>>B&&(g[C++]=I|this.s<<this.DB-B);A>=0;)B<8?(I=(this[A]&(1<<B)-1)<<8-B,I|=this[--A]>>(B+=this.DB-8)):(I=this[A]>>(B-=8)&255,B<=0&&(B+=this.DB,--A)),128&I&&(I|=-256),0==C&&(128&this.s)!=(128&I)&&++C,(C>0||I!=this.s)&&(g[C++]=I);return g},I.prototype.equals=function(A){return 0==this.compareTo(A)},I.prototype.min=function(A){return this.compareTo(A)<0?this:A},I.prototype.max=function(A){return this.compareTo(A)>0?this:A},I.prototype.and=function(A){var g=B();return this.bitwiseTo(A,J,g),g},I.prototype.or=function(A){var g=B();return this.bitwiseTo(A,G,g),g},I.prototype.xor=function(A){var g=B();return this.bitwiseTo(A,w,g),g},I.prototype.andNot=function(A){var g=B();return this.bitwiseTo(A,a,g),g},I.prototype.not=function(){for(var A=B(),g=0;g<this.t;++g)A[g]=this.DM&~this[g];return A.t=this.t,A.s=~this.s,A},I.prototype.shiftLeft=function(A){var g=B();return A<0?this.rShiftTo(-A,g):this.lShiftTo(A,g),g},I.prototype.shiftRight=function(A){var g=B();return A<0?this.lShiftTo(-A,g):this.rShiftTo(A,g),g},I.prototype.getLowestSetBit=function(){for(var A=0;A<this.t;++A)if(0!=this[A])return A*this.DB+M(this[A]);return this.s<0?this.t*this.DB:-1},I.prototype.bitCount=function(){for(var A=0,g=this.s&this.DM,I=0;I<this.t;++I)A+=o(this[I]^g);return A},I.prototype.testBit=function(A){var g=Math.floor(A/this.DB);return g>=this.t?0!=this.s:!!(this[g]&1<<A%this.DB)},I.prototype.setBit=function(A){return this.changeBit(A,G)},I.prototype.clearBit=function(A){return this.changeBit(A,a)},I.prototype.flipBit=function(A){return this.changeBit(A,w)},I.prototype.add=function(A){var g=B();return this.addTo(A,g),g},I.prototype.subtract=function(A){var g=B();return this.subTo(A,g),g},I.prototype.multiply=function(A){var g=B();return this.multiplyTo(A,g),g},I.prototype.divide=function(A){var g=B();return this.divRemTo(A,g,null),g},I.prototype.remainder=function(A){var g=B();return this.divRemTo(A,null,g),g},I.prototype.divideAndRemainder=function(A){var g=B(),I=B();return this.divRemTo(A,g,I),new Array(g,I)},I.prototype.modPow=function(A,g){var I,C,E=A.bitLength(),Q=k(1);if(E<=0)return Q;I=E<18?1:E<48?3:E<144?4:E<768?5:6,C=E<8?new r(g):g.isEven()?new W(g):new S(g);var t=new Array,i=3,s=I-1,J=(1<<I)-1;if(t[1]=C.convert(this),I>1){var G=B();for(C.sqrTo(t[1],G);i<=J;)t[i]=B(),C.mulTo(G,t[i-2],t[i]),i+=2}var w,a,M=A.t-1,o=!0,h=B();for(E=Y(A[M])-1;M>=0;){for(E>=s?w=A[M]>>E-s&J:(w=(A[M]&(1<<E+1)-1)<<s-E,M>0&&(w|=A[M-1]>>this.DB+E-s)),i=I;!(1&w);)w>>=1,--i;if((E-=i)<0&&(E+=this.DB,--M),o)t[w].copyTo(Q),o=!1;else{for(;i>1;)C.sqrTo(Q,h),C.sqrTo(h,Q),i-=2;i>0?C.sqrTo(Q,h):(a=Q,Q=h,h=a),C.mulTo(h,t[w],Q)}for(;M>=0&&!(A[M]&1<<E);)C.sqrTo(Q,h),a=Q,Q=h,h=a,--E<0&&(E=this.DB-1,--M)}return C.revert(Q)},I.prototype.modInverse=function(A){var g=A.isEven();if(this.isEven()&&g||0==A.signum())return I.ZERO;for(var B=A.clone(),C=this.clone(),E=k(1),Q=k(0),t=k(0),i=k(1);0!=B.signum();){for(;B.isEven();)B.rShiftTo(1,B),g?(E.isEven()&&Q.isEven()||(E.addTo(this,E),Q.subTo(A,Q)),E.rShiftTo(1,E)):Q.isEven()||Q.subTo(A,Q),Q.rShiftTo(1,Q);for(;C.isEven();)C.rShiftTo(1,C),g?(t.isEven()&&i.isEven()||(t.addTo(this,t),i.subTo(A,i)),t.rShiftTo(1,t)):i.isEven()||i.subTo(A,i),i.rShiftTo(1,i);B.compareTo(C)>=0?(B.subTo(C,B),g&&E.subTo(t,E),Q.subTo(i,Q)):(C.subTo(B,C),g&&t.subTo(E,t),i.subTo(Q,i))}return 0!=C.compareTo(I.ONE)?I.ZERO:i.compareTo(A)>=0?i.subtract(A):i.signum()<0?(i.addTo(A,i),i.signum()<0?i.add(A):i):i},I.prototype.pow=function(A){return this.exp(A,new h)},I.prototype.gcd=function(A){var g=this.s<0?this.negate():this.clone(),I=A.s<0?A.negate():A.clone();if(g.compareTo(I)<0){var B=g;g=I,I=B}var C=g.getLowestSetBit(),E=I.getLowestSetBit();if(E<0)return g;for(C<E&&(E=C),E>0&&(g.rShiftTo(E,g),I.rShiftTo(E,I));g.signum()>0;)(C=g.getLowestSetBit())>0&&g.rShiftTo(C,g),(C=I.getLowestSetBit())>0&&I.rShiftTo(C,I),g.compareTo(I)>=0?(g.subTo(I,g),g.rShiftTo(1,g)):(I.subTo(g,I),I.rShiftTo(1,I));return E>0&&I.lShiftTo(E,I),I},I.prototype.isProbablePrime=function(A){var g,I=this.abs();if(1==I.t&&I[0]<=V[V.length-1]){for(g=0;g<V.length;++g)if(I[0]==V[g])return!0;return!1}if(I.isEven())return!1;for(g=1;g<V.length;){for(var B=V[g],C=g+1;C<V.length&&B<K;)B*=V[C++];for(B=I.modInt(B);g<C;)if(B%V[g++]==0)return!1}return I.millerRabin(A)},I.prototype.square=function(){var A=B();return this.squareTo(A),A},I.prototype.Barrett=W,null==l){var y;if(l=new Array,R=0,"undefined"!=typeof window&&window.crypto)if(window.crypto.getRandomValues){var U=new Uint8Array(32);for(window.crypto.getRandomValues(U),y=0;y<32;++y)l[R++]=U[y]}else if("Netscape"==navigator.appName&&navigator.appVersion<"5"){var n=window.crypto.random(32);for(y=0;y<n.length;++y)l[R++]=255&n.charCodeAt(y)}for(;R<Z;)y=Math.floor(65536*Math.random()),l[R++]=y>>>8,l[R++]=255&y;R=0,F()}function q(){if(null==D){for(F(),(D=new b).init(l),R=0;R<l.length;++R)l[R]=0;R=0}return D.next()}function x(){}function b(){this.i=0,this.j=0,this.S=new Array}x.prototype.nextBytes=function(A){var g;for(g=0;g<A.length;++g)A[g]=q()},b.prototype.init=function(A){var g,I,B;for(g=0;g<256;++g)this.S[g]=g;for(I=0,g=0;g<256;++g)I=I+this.S[g]+A[g%A.length]&255,B=this.S[g],this.S[g]=this.S[I],this.S[I]=B;this.i=0,this.j=0},b.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 Z=256;A.exports={default:I,BigInteger:I,SecureRandom:x}}.call(PI)),fI.exports;var A}function vI(){if(FI)return KI;FI=1;const{BigInteger:A}=XI();class g{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 g=A.toString(16);if(g.length%2==1&&(g="0"+g),A<128)return g;return(128+g.length/2).toString(16)+g}getValue(){return""}}class I extends g{constructor(g){super(),this.t="02",g&&(this.v=function(g){let I=g.toString(16);if("-"!==I[0])I.length%2==1?I="0"+I:I.match(/^[0-7]/)||(I="00"+I);else{I=I.substr(1);let B=I.length;B%2==1?B+=1:I.match(/^[0-7]/)||(B+=2);let C="";for(let A=0;A<B;A++)C+="f";C=new A(C,16),I=C.xor(g).add(A.ONE),I=I.toString(16).replace(/^-/,"")}return I}(g))}getValue(){return this.v}}class B extends g{constructor(A){super(),this.t="30",this.asn1Array=A}getValue(){return this.v=this.asn1Array.map(A=>A.getEncodedHex()).join(""),this.v}}function C(A,g){return+A[g+2]<8?1:128&+A.substr(g+2,2)}function E(g,I){const B=C(g,I),E=g.substr(I+2,2*B);if(!E)return-1;return(+E[0]<8?new A(E,16):new A(E.substr(2),16)).intValue()}function Q(A,g){return g+2*(C(A,g)+1)}return KI={encodeDer(A,g){const C=new I(A),E=new I(g);return new B([C,E]).getEncodedHex()},decodeDer(g){const I=Q(g,0),B=Q(g,I),C=E(g,I),t=g.substr(B,2*C),i=B+t.length,s=Q(g,i),k=E(g,i),Y=g.substr(s,2*k);return{r:new A(t,16),s:new A(Y,16)}}}}function zI(){if(qI)return nI;qI=1;const{BigInteger:A,SecureRandom:g}=XI(),{ECCurveFp:I}=function(){if(UI)return yI;UI=1;const{BigInteger:A}=XI(),g=new A("2"),I=new A("3");class B{constructor(A,g){this.x=g,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 B(this.q,this.x.negate().mod(this.q))}add(A){return new B(this.q,this.x.add(A.toBigInteger()).mod(this.q))}subtract(A){return new B(this.q,this.x.subtract(A.toBigInteger()).mod(this.q))}multiply(A){return new B(this.q,this.x.multiply(A.toBigInteger()).mod(this.q))}divide(A){return new B(this.q,this.x.multiply(A.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new B(this.q,this.x.square().mod(this.q))}}class C{constructor(g,I,B,C){this.curve=g,this.x=I,this.y=B,this.z=null==C?A.ONE:C,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(g){return g===this||(this.isInfinity()?g.isInfinity():g.isInfinity()?this.isInfinity():!!g.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(g.z)).mod(this.curve.q).equals(A.ZERO)&&g.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(g.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 C(this.curve,this.x,this.y.negate(),this.z)}add(g){if(this.isInfinity())return g;if(g.isInfinity())return this;const I=this.x.toBigInteger(),B=this.y.toBigInteger(),E=this.z,Q=g.x.toBigInteger(),t=g.y.toBigInteger(),i=g.z,s=this.curve.q,k=I.multiply(i).mod(s),Y=Q.multiply(E).mod(s),r=k.subtract(Y),S=B.multiply(i).mod(s),J=t.multiply(E).mod(s),G=S.subtract(J);if(A.ZERO.equals(r))return A.ZERO.equals(G)?this.twice():this.curve.infinity;const w=k.add(Y),a=E.multiply(i).mod(s),M=r.square().mod(s),o=r.multiply(M).mod(s),h=a.multiply(G.square()).subtract(w.multiply(M)).mod(s),e=r.multiply(h).mod(s),W=G.multiply(M.multiply(k).subtract(h)).subtract(S.multiply(o)).mod(s),D=o.multiply(a).mod(s);return new C(this.curve,this.curve.fromBigInteger(e),this.curve.fromBigInteger(W),D)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const A=this.x.toBigInteger(),g=this.y.toBigInteger(),B=this.z,E=this.curve.q,Q=this.curve.a.toBigInteger(),t=A.square().multiply(I).add(Q.multiply(B.square())).mod(E),i=g.shiftLeft(1).multiply(B).mod(E),s=g.square().mod(E),k=s.multiply(A).multiply(B).mod(E),Y=i.square().mod(E),r=t.square().subtract(k.shiftLeft(3)).mod(E),S=i.multiply(r).mod(E),J=t.multiply(k.shiftLeft(2).subtract(r)).subtract(Y.shiftLeft(1).multiply(s)).mod(E),G=i.multiply(Y).mod(E);return new C(this.curve,this.curve.fromBigInteger(S),this.curve.fromBigInteger(J),G)}multiply(A){if(this.isInfinity())return this;if(!A.signum())return this.curve.infinity;const g=A.multiply(I),B=this.negate();let C=this;for(let I=g.bitLength()-2;I>0;I--){C=C.twice();const E=g.testBit(I);E!==A.testBit(I)&&(C=C.add(E?this:B))}return C}}return yI={ECPointFp:C,ECCurveFp:class{constructor(A,g,I){this.q=A,this.a=this.fromBigInteger(g),this.b=this.fromBigInteger(I),this.infinity=new C(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 B(this.q,A)}decodePointHex(I){switch(parseInt(I.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const B=this.fromBigInteger(new A(I.substr(2),16));let E=this.fromBigInteger(B.multiply(B.square()).add(B.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new A("4")).add(A.ONE),this.q));return E.toBigInteger().mod(g).equals(new A(I.substr(0,2),16).subtract(g))||(E=E.negate()),new C(this,B,E);case 4:case 6:case 7:const Q=(I.length-2)/2,t=I.substr(2,Q),i=I.substr(Q+2,Q);return new C(this,this.fromBigInteger(new A(t,16)),this.fromBigInteger(new A(i,16)));default:return null}}}}}(),B=new g,{curve:C,G:E,n:Q}=t();function t(){const g=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),B=new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),C=new A("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),E=new I(g,B,C),Q=E.decodePointHex("0432C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0");return{curve:E,G:Q,n:new A("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16)}}function i(A,g){return A.length>=g?A:new Array(g-A.length+1).join("0")+A}return nI={getGlobalCurve:function(){return C},generateEcparam:t,generateKeyPairHex:function(g,I,C){const t=(g?new A(g,I,C):new A(Q.bitLength(),B)).mod(Q.subtract(A.ONE)).add(A.ONE),s=i(t.toString(16),64),k=E.multiply(t);return{privateKey:s,publicKey:"04"+i(k.getX().toBigInteger().toString(16),64)+i(k.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(g){if(130!==g.length)throw new Error("Invalid public key to compress");const I=(g.length-2)/2,B=g.substr(2,I);let C="03";return new A(g.substr(I+2,I),16).mod(new A("2")).equals(A.ZERO)&&(C="02"),C+B},utf8ToHex:function(A){const g=(A=unescape(encodeURIComponent(A))).length,I=[];for(let C=0;C<g;C++)I[C>>>2]|=(255&A.charCodeAt(C))<<24-C%4*8;const B=[];for(let C=0;C<g;C++){const A=I[C>>>2]>>>24-C%4*8&255;B.push((A>>>4).toString(16)),B.push((15&A).toString(16))}return B.join("")},leftPad:i,arrayToHex:function(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")},arrayToUtf8:function(A){const g=[];let I=0;for(let C=0;C<2*A.length;C+=2)g[C>>>3]|=parseInt(A[I],10)<<24-C%8*4,I++;try{const I=[];for(let B=0;B<A.length;B++){const A=g[B>>>2]>>>24-B%4*8&255;I.push(String.fromCharCode(A))}return decodeURIComponent(escape(I.join("")))}catch(B){throw new Error("Malformed UTF-8 data")}},hexToArray:function(A){const g=[];let I=A.length;I%2!=0&&(A=i(A,I+1)),I=A.length;for(let B=0;B<I;B+=2)g.push(parseInt(A.substr(B,2),16));return g},verifyPublicKey:function(A){const g=C.decodePointHex(A);if(!g)return!1;const I=g.getX();return g.getY().square().equals(I.multiply(I.square()).add(I.multiply(C.a)).add(C.b))},comparePublicKeyHex:function(A,g){const I=C.decodePointHex(A);if(!I)return!1;const B=C.decodePointHex(g);return!!B&&I.equals(B)}}}function _I(){if(bI)return xI;bI=1;const A=new Uint32Array(68),g=new Uint32Array(64);function I(A,g){const I=31&g;return A<<I|A>>>32-I}function B(A,g){const I=[];for(let B=A.length-1;B>=0;B--)I[B]=255&(A[B]^g[B]);return I}function C(A){return A^I(A,9)^I(A,17)}function E(A){return A^I(A,15)^I(A,23)}function Q(B){let Q=8*B.length,t=Q%512;t=t>=448?512-t%448-1:448-t-1;const i=new Array((t-7)/8),s=new Array(8);for(let A=0,g=i.length;A<g;A++)i[A]=0;for(let A=0,g=s.length;A<g;A++)s[A]=0;Q=Q.toString(2);for(let A=7;A>=0;A--)if(Q.length>8){const g=Q.length-8;s[A]=parseInt(Q.substr(g),2),Q=Q.substr(0,g)}else Q.length>0&&(s[A]=parseInt(Q,2),Q="");const k=new Uint8Array([...B,128,...i,...s]),Y=new DataView(k.buffer,0),r=k.length/64,S=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let G=0;G<r;G++){A.fill(0),g.fill(0);const B=16*G;for(let g=0;g<16;g++)A[g]=Y.getUint32(4*(B+g),!1);for(let g=16;g<68;g++)A[g]=E(A[g-16]^A[g-9]^I(A[g-3],15))^I(A[g-13],7)^A[g-6];for(let I=0;I<64;I++)g[I]=A[I]^A[I+4];const Q=2043430169,t=2055708042;let i,s,k,r,J,w=S[0],a=S[1],M=S[2],o=S[3],h=S[4],e=S[5],W=S[6],D=S[7];for(let E=0;E<64;E++)J=E>=0&&E<=15?Q:t,i=I(I(w,12)+h+I(J,E),7),s=i^I(w,12),k=(E>=0&&E<=15?w^a^M:w&a|w&M|a&M)+o+s+g[E],r=(E>=0&&E<=15?h^e^W:h&e|~h&W)+D+i+A[E],o=M,M=I(a,9),a=w,w=k,D=W,W=I(e,19),e=h,h=C(r);S[0]^=w,S[1]^=a,S[2]^=M,S[3]^=o,S[4]^=h,S[5]^=e,S[6]^=W,S[7]^=D}const J=[];for(let A=0,g=S.length;A<g;A++){const g=S[A];J.push((4278190080&g)>>>24,(16711680&g)>>>16,(65280&g)>>>8,255&g)}return J}const t=new Uint8Array(64),i=new Uint8Array(64);for(let s=0;s<64;s++)t[s]=54,i[s]=92;return xI={sm3:Q,hmac:function(A,g){for(g.length>64&&(g=Q(g));g.length<64;)g.push(0);const I=B(g,t),C=B(g,i),E=Q([...I,...A]);return Q([...C,...E])}}}function $I(){if(pI)return ZI;pI=1;const{BigInteger:A}=XI(),{encodeDer:g,decodeDer:I}=vI(),B=zI(),C=_I().sm3,{G:E,curve:Q,n:t}=B.generateEcparam();function i(A,g,I="1234567812345678"){I=B.utf8ToHex(I);const Q=B.leftPad(E.curve.a.toBigInteger().toRadix(16),64),t=B.leftPad(E.curve.b.toBigInteger().toRadix(16),64),i=B.leftPad(E.getX().toBigInteger().toRadix(16),64),s=B.leftPad(E.getY().toBigInteger().toRadix(16),64);let k,Y;if(128===g.length)k=g.substr(0,64),Y=g.substr(64,64);else{const A=E.curve.decodePointHex(g);k=B.leftPad(A.getX().toBigInteger().toRadix(16),64),Y=B.leftPad(A.getY().toBigInteger().toRadix(16),64)}const r=B.hexToArray(I+Q+t+i+s+k+Y),S=4*I.length;r.unshift(255&S),r.unshift(S>>8&255);const J=C(r);return B.arrayToHex(C(J.concat(B.hexToArray(A))))}function s(g){const I=E.multiply(new A(g,16));return"04"+B.leftPad(I.getX().toBigInteger().toString(16),64)+B.leftPad(I.getY().toBigInteger().toString(16),64)}function k(){const g=B.generateKeyPairHex(),I=Q.decodePointHex(g.publicKey);return g.k=new A(g.privateKey,16),g.x1=I.getX().toBigInteger(),g}return ZI={generateKeyPairHex:B.generateKeyPairHex,compressPublicKeyHex:B.compressPublicKeyHex,comparePublicKeyHex:B.comparePublicKeyHex,doEncrypt:function(g,I,E=1){g="string"==typeof g?B.hexToArray(B.utf8ToHex(g)):Array.prototype.slice.call(g),I=B.getGlobalCurve().decodePointHex(I);const Q=B.generateKeyPairHex(),t=new A(Q.privateKey,16);let i=Q.publicKey;i.length>128&&(i=i.substr(i.length-128));const s=I.multiply(t),k=B.hexToArray(B.leftPad(s.getX().toBigInteger().toRadix(16),64)),Y=B.hexToArray(B.leftPad(s.getY().toBigInteger().toRadix(16),64)),r=B.arrayToHex(C([].concat(k,g,Y)));let S=1,J=0,G=[];const w=[].concat(k,Y),a=()=>{G=C([...w,S>>24&255,S>>16&255,S>>8&255,255&S]),S++,J=0};a();for(let A=0,B=g.length;A<B;A++)J===G.length&&a(),g[A]^=255&G[J++];const M=B.arrayToHex(g);return 0===E?i+M+r:i+r+M},doDecrypt:function(g,I,E=1,{output:Q="string"}={}){I=new A(I,16);let t=g.substr(128,64),i=g.substr(192);0===E&&(t=g.substr(g.length-64),i=g.substr(128,g.length-128-64));const s=B.hexToArray(i),k=B.getGlobalCurve().decodePointHex("04"+g.substr(0,128)).multiply(I),Y=B.hexToArray(B.leftPad(k.getX().toBigInteger().toRadix(16),64)),r=B.hexToArray(B.leftPad(k.getY().toBigInteger().toRadix(16),64));let S=1,J=0,G=[];const w=[].concat(Y,r),a=()=>{G=C([...w,S>>24&255,S>>16&255,S>>8&255,255&S]),S++,J=0};a();for(let A=0,B=s.length;A<B;A++)J===G.length&&a(),s[A]^=255&G[J++];return B.arrayToHex(C([].concat(Y,s,r)))===t.toLowerCase()?"array"===Q?s:B.arrayToUtf8(s):"array"===Q?[]:""},doSignature:function(I,C,{pointPool:E,der:Q,hash:Y,publicKey:r,userId:S}={}){let J="string"==typeof I?B.utf8ToHex(I):B.arrayToHex(I);Y&&(J=i(J,r=r||s(C),S));const G=new A(C,16),w=new A(J,16);let a=null,M=null,o=null;do{do{let A;A=E&&E.length?E.pop():k(),a=A.k,M=w.add(A.x1).mod(t)}while(M.equals(A.ZERO)||M.add(a).equals(t));o=G.add(A.ONE).modInverse(t).multiply(a.subtract(M.multiply(G))).mod(t)}while(o.equals(A.ZERO));return Q?g(M,o):B.leftPad(M.toString(16),64)+B.leftPad(o.toString(16),64)},doVerifySignature:function(g,C,s,{der:k,hash:Y,userId:r}={}){let S,J,G="string"==typeof g?B.utf8ToHex(g):B.arrayToHex(g);if(Y&&(G=i(G,s,r)),k){const A=I(C);S=A.r,J=A.s}else S=new A(C.substring(0,64),16),J=new A(C.substring(64),16);const w=Q.decodePointHex(s),a=new A(G,16),M=S.add(J).mod(t);if(M.equals(A.ZERO))return!1;const o=E.multiply(J).add(w.multiply(M)),h=a.add(o.getX().toBigInteger()).mod(t);return S.equals(h)},getPublicKeyFromPrivateKey:s,getPoint:k,verifyPublicKey:B.verifyPublicKey}}function AB(){if(jI)return cI;jI=1;const{sm3:A,hmac:g}=_I();function I(A){return A.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join("")}function B(A){const g=[];let I=A.length;var B,C;I%2!=0&&(C=I+1,A=(B=A).length>=C?B:new Array(C-B.length+1).join("0")+B),I=A.length;for(let E=0;E<I;E+=2)g.push(parseInt(A.substr(E,2),16));return g}return cI=function(C,E){if(C="string"==typeof C?function(A){const g=[];for(let I=0,B=A.length;I<B;I++){const B=A.codePointAt(I);if(B<=127)g.push(B);else if(B<=2047)g.push(192|B>>>6),g.push(128|63&B);else if(B<=55295||B>=57344&&B<=65535)g.push(224|B>>>12),g.push(128|B>>>6&63),g.push(128|63&B);else{if(!(B>=65536&&B<=1114111))throw g.push(B),new Error("input is not supported");I++,g.push(240|B>>>18&28),g.push(128|B>>>12&63),g.push(128|B>>>6&63),g.push(128|63&B)}}return g}(C):Array.prototype.slice.call(C),E){if("hmac"!==(E.mode||"hmac"))throw new Error("invalid mode");let A=E.key;if(!A)throw new Error("invalid key");return A="string"==typeof A?B(A):Array.prototype.slice.call(A),I(g(C,A))}return I(A(C))}}function gB(){if(mI)return uI;mI=1;const A=16,g=[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],I=[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 B(A){const g=[];for(let I=0,B=A.length;I<B;I+=2)g.push(parseInt(A.substr(I,2),16));return g}function C(A,g){const I=31&g;return A<<I|A>>>32-I}function E(A){return(255&g[A>>>24&255])<<24|(255&g[A>>>16&255])<<16|(255&g[A>>>8&255])<<8|255&g[255&A]}function Q(A){return A^C(A,2)^C(A,10)^C(A,18)^C(A,24)}function t(A){return A^C(A,13)^C(A,23)}function i(A,g,I){const B=new Array(4),C=new Array(4);for(let E=0;E<4;E++)C[0]=255&A[4*E],C[1]=255&A[4*E+1],C[2]=255&A[4*E+2],C[3]=255&A[4*E+3],B[E]=C[0]<<24|C[1]<<16|C[2]<<8|C[3];for(let t,i=0;i<32;i+=4)t=B[1]^B[2]^B[3]^I[i+0],B[0]^=Q(E(t)),t=B[2]^B[3]^B[0]^I[i+1],B[1]^=Q(E(t)),t=B[3]^B[0]^B[1]^I[i+2],B[2]^=Q(E(t)),t=B[0]^B[1]^B[2]^I[i+3],B[3]^=Q(E(t));for(let E=0;E<16;E+=4)g[E]=B[3-E/4]>>>24&255,g[E+1]=B[3-E/4]>>>16&255,g[E+2]=B[3-E/4]>>>8&255,g[E+3]=255&B[3-E/4]}function s(g,C,Q,{padding:s="pkcs#7",mode:k,iv:Y=[],output:r="string"}={}){if("cbc"===k&&("string"==typeof Y&&(Y=B(Y)),16!==Y.length))throw new Error("iv is invalid");if("string"==typeof C&&(C=B(C)),16!==C.length)throw new Error("key is invalid");if(g="string"==typeof g?0!==Q?function(A){const g=[];for(let I=0,B=A.length;I<B;I++){const B=A.codePointAt(I);if(B<=127)g.push(B);else if(B<=2047)g.push(192|B>>>6),g.push(128|63&B);else if(B<=55295||B>=57344&&B<=65535)g.push(224|B>>>12),g.push(128|B>>>6&63),g.push(128|63&B);else{if(!(B>=65536&&B<=1114111))throw g.push(B),new Error("input is not supported");I++,g.push(240|B>>>18&28),g.push(128|B>>>12&63),g.push(128|B>>>6&63),g.push(128|63&B)}}return g}(g):B(g):[...g],("pkcs#5"===s||"pkcs#7"===s)&&0!==Q){const I=A-g.length%A;for(let A=0;A<I;A++)g.push(I)}const S=new Array(32);!function(A,g,B){const C=new Array(4),Q=new Array(4);for(let I=0;I<4;I++)Q[0]=255&A[0+4*I],Q[1]=255&A[1+4*I],Q[2]=255&A[2+4*I],Q[3]=255&A[3+4*I],C[I]=Q[0]<<24|Q[1]<<16|Q[2]<<8|Q[3];C[0]^=2746333894,C[1]^=1453994832,C[2]^=1736282519,C[3]^=2993693404;for(let i,s=0;s<32;s+=4)i=C[1]^C[2]^C[3]^I[s+0],g[s+0]=C[0]^=t(E(i)),i=C[2]^C[3]^C[0]^I[s+1],g[s+1]=C[1]^=t(E(i)),i=C[3]^C[0]^C[1]^I[s+2],g[s+2]=C[2]^=t(E(i)),i=C[0]^C[1]^C[2]^I[s+3],g[s+3]=C[3]^=t(E(i));if(0===B)for(let I,E=0;E<16;E++)I=g[E],g[E]=g[31-E],g[31-E]=I}(C,S,Q);const J=[];let G=Y,w=g.length,a=0;for(;w>=A;){const I=g.slice(a,a+16),B=new Array(16);if("cbc"===k)for(let g=0;g<A;g++)0!==Q&&(I[g]^=G[g]);i(I,B,S);for(let g=0;g<A;g++)"cbc"===k&&0===Q&&(B[g]^=G[g]),J[a+g]=B[g];"cbc"===k&&(G=0!==Q?B:I),w-=A,a+=A}if(("pkcs#5"===s||"pkcs#7"===s)&&0===Q){const A=J.length,g=J[A-1];for(let I=1;I<=g;I++)if(J[A-I]!==g)throw new Error("padding is invalid");J.splice(A-g,g)}return"array"!==r?0!==Q?J.map(A=>1===(A=A.toString(16)).length?"0"+A:A).join(""):function(A){const g=[];for(let I=0,B=A.length;I<B;I++)A[I]>=240&&A[I]<=247?(g.push(String.fromCodePoint(((7&A[I])<<18)+((63&A[I+1])<<12)+((63&A[I+2])<<6)+(63&A[I+3]))),I+=3):A[I]>=224&&A[I]<=239?(g.push(String.fromCodePoint(((15&A[I])<<12)+((63&A[I+1])<<6)+(63&A[I+2]))),I+=2):A[I]>=192&&A[I]<=223?(g.push(String.fromCodePoint(((31&A[I])<<6)+(63&A[I+1]))),I++):g.push(String.fromCodePoint(A[I]));return g.join("")}(J):J}return uI={encrypt:(A,g,I)=>s(A,g,1,I),decrypt:(A,g,I)=>s(A,g,0,I)}}const IB=Z(NI?LI:(NI=1,LI={sm2:$I(),sm3:AB(),sm4:gB()}));class BB{constructor(A,g,I,B){U(this,Q,null),U(this,t,null),U(this,i,null),U(this,s,null),U(this,k,(A,g=!1)=>{if(!g)return"object"==typeof A?JSON.stringify(A):String(A);try{return JSON.parse(A)}catch(I){return A}}),this.setkey(A),this.setiv(g),this.setPublicKey(I),this.setPrivateKey(B)}setPublicKey(A){n(this,i,A)}setPrivateKey(A){n(this,s,A)}setkey(A){n(this,Q,A&&this.stringToWordArray(A.padEnd(16,"0")))}setiv(A){n(this,t,A&&this.stringToWordArray(A))}sm2Encrypt(A,g){return IB.sm2.doEncrypt(A,g,{inputEncoding:"utf8",outputEncoding:"hex",pointFormat:"uncompressed",cipherMode:1})}sm2Decrypt(A,g){return IB.sm2.doDecrypt(A,g,1)}RSAencrypt(A){A=y(this,k).call(this,A);const g=new HI;return g.setPublicKey(y(this,i)),g.encrypt(A)}RSAdecrypt(A){const g=new HI;return g.setPrivateKey(y(this,s)),y(this,k).call(this,g.decrypt(A),!0)}stringToWordArray(A){return Rg.enc.Utf8.parse(A)}wordArrayToString(A){return A.toString(Rg.enc.Utf8)}AESencrypt(A,g=!0){return A=y(this,k).call(this,A),Rg.AES.encrypt(A,y(this,Q),{iv:y(this,t),mode:Rg.mode.CBC,padding:Rg.pad.Pkcs7}).ciphertext.toString(g?Rg.enc.Base64:Rg.enc.Hex)}AESdecrypt(A,g=!0){A=g?A:Rg.enc.Base64.stringify(Rg.enc.Hex.parse(A));let I=Rg.AES.decrypt(A,y(this,Q),{iv:y(this,t),mode:Rg.mode.CBC,padding:Rg.pad.Pkcs7});return y(this,k).call(this,I.toString(Rg.enc.Utf8),!0)}DESencrypt(A,g=!0){return A=y(this,k).call(this,A),Rg.DES.encrypt(A,y(this,Q),{iv:y(this,t),mode:Rg.mode.CBC,padding:Rg.pad.Pkcs7}).ciphertext.toString(g?Rg.enc.Base64:Rg.enc.Hex)}DESdecrypt(A,g=!0){A=g?A:Rg.enc.Base64.stringify(Rg.enc.Hex.parse(A));let I=Rg.DES.decrypt(A,y(this,Q),{iv:y(this,t),mode:Rg.mode.CBC,padding:Rg.pad.Pkcs7});return y(this,k).call(this,I.toString(Rg.enc.Utf8),!0)}base64Encode(A){return A=y(this,k).call(this,A),Rg.enc.Base64.stringify(Rg.enc.Utf8.parse(A))}base64Decode(A){return y(this,k).call(this,Rg.enc.Base64.parse(A).toString(Rg.enc.Utf8),!0)}md5(A){return A=y(this,k).call(this,A),Rg.MD5(A).toString()}fileMd5(A,g,I){return new Promise((B,C)=>{if(!A)return void C("");const E=new FileReader;if(E.onerror=A=>{C(A)},g){const t=Rg.algo.MD5.create();let i=0;try{let C=function(){const I=A.slice(i,i+g);E.readAsArrayBuffer(I)};E.onload=E=>{const Q=Rg.lib.WordArray.create(new Uint8Array(E.target.result));if(t.update(Q),"function"==typeof I&&I(i,A.size),i+=g,i<A.size)C();else{const A=t.finalize();B(A.toString(Rg.enc.Hex))}},C()}catch(Q){C(Q)}}else E.onload=g=>{"function"==typeof I&&I(A.size,A.size),B(Rg.MD5(Rg.lib.WordArray.create(g.target.result)).toString())},E.readAsArrayBuffer(A)})}sha1(A){return A=y(this,k).call(this,A),Rg.SHA1(A).toString()}sha256(A){return A=y(this,k).call(this,A),Rg.SHA256(A).toString()}sha3(A){return A=y(this,k).call(this,A),Rg.SHA3(A,{outputLength:256}).toString()}pbkdf2(A){A=y(this,k).call(this,A);let g=Rg.lib.WordArray.random(16);return Rg.PBKDF2(A,g,{keySize:8,iterations:1e3}).toString()}hmac(A,g){return A=y(this,k).call(this,A),Rg.HmacSHA256(A,g).toString(Rg.enc.Hex)}}function CB(A=18,g=36){(g<2||g>36)&&(g=36);var I=Math.random().toString(g).substring(2,13).padEnd(11,"0").slice(0,A);return A<=11?I:I+CB(A-11)}function EB(A){A=A.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(A,g,I,B)=>g+g+I+I+B+B);const g=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(A);return g?{r:parseInt(g[1],16),g:parseInt(g[2],16),b:parseInt(g[3],16)}:null}function QB(A){return new Promise((g,I)=>{if(A)try{var B=new FileReader;let C="";B.readAsDataURL(A),B.onload=function(){C=B.result},B.onerror=function(A){I(A)},B.onloadend=function(){g(C)}}catch(C){I(C)}else I("")})}Q=new WeakMap,t=new WeakMap,i=new WeakMap,s=new WeakMap,k=new WeakMap;const tB={formatDateTime:function(A="yyyy-MM-dd hh:mm:ss",g=new Date,I=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]){!g&&(g=new Date),"string"==typeof g&&(g=new Date(g));const B={"M+":g.getMonth()+1,"d+":g.getDate(),"h+":g.getHours(),"m+":g.getMinutes(),"s+":g.getSeconds(),S:g.getMilliseconds(),w:I[g.getDay()]};/(y+)/.test(A)&&(A=A.replace(RegExp.$1,(g.getFullYear()+"").substr(4-RegExp.$1.length)));for(const C in B)new RegExp("("+C+")").test(A)&&(A=A.replace(RegExp.$1,1===RegExp.$1.length?B[C]:("00"+B[C]).substr((""+B[C]).length)));return A},throttle:function(A,g=500){var I=Date.now();return function(...B){Date.now()-I>=g&&(A.apply(this,B),I=Date.now())}},debounce:function(A,g=500){let I=null;return function(...B){clearTimeout(I),I=setTimeout(()=>{A.apply(this,B)},g)}},rgbToHex:function(A,g,I){return"#"+((1<<24)+(A<<16)+(g<<8)+I).toString(16).slice(1)},hexToRgb:EB,hslToRgb:function(A,g,I){let B,C,E;if(A/=360,I/=100,0===(g/=100))B=C=E=I;else{const Q=(A,g,I)=>(I<0&&(I+=1),I>1&&(I-=1),I<1/6?A+6*(g-A)*I:I<.5?g:I<2/3?A+(g-A)*(2/3-I)*6:A),t=I<.5?I*(1+g):I+g-I*g,i=2*I-t;B=Q(i,t,A+1/3),C=Q(i,t,A),E=Q(i,t,A-1/3)}return{r:Math.round(255*B),g:Math.round(255*C),b:Math.round(255*E)}},rgbOrHexToHsl:function(A){let g,I,B;if("string"==typeof A&&"#"===A.charAt(0)){const C=EB(A);g=C.r/255,I=C.g/255,B=C.b/255}else{if("object"!=typeof A)throw new Error("Invalid input format");g=A.r/255,I=A.g/255,B=A.b/255}const C=Math.max(g,I,B),E=Math.min(g,I,B);let Q,t,i=(C+E)/2;if(C===E)Q=t=0;else{const A=C-E;switch(t=i>.5?A/(2-C-E):A/(C+E),C){case g:Q=(I-B)/A+(I<B?6:0);break;case I:Q=(B-g)/A+2;break;case B:Q=(g-I)/A+4}Q/=6}return{h:Math.round(360*Q),s:Math.round(100*t),l:Math.round(100*i)}},preciseInterval:function(A,g){let I,B=null;return I=requestAnimationFrame(function C(E){B||(B=E),E-B>=g&&(A(),B=E),I=requestAnimationFrame(C)}),{clear:function(){cancelAnimationFrame(I)}}},convertImgToBase64:function(A,g){return new Promise(function(I){var B=document.createElement("CANVAS"),C=B.getContext("2d"),E=new Image;E.crossOrigin="Anonymous",E.onload=function(){B.height=E.height,B.width=E.width,C.drawImage(E,0,0);var A=B.toDataURL(g||"image/jpg");I(A),B=null},E.src=A})},objectGroupBy:function(A,g){if("string"==typeof g){const A=g;g=g=>g[A]}var I={};return A.forEach((B,C)=>{const E=g(B,C,A);I[E]||(I[E]=[]),I[E].push(B)}),I},randomNum:function(A,g){return Math.floor(Math.random()*(g+1-A))+A},randomColor:function(){return"#"+Math.floor(16777215*Math.random()).toString(16).padEnd(6,"0")},deepCloning:function A(g,I=new WeakMap){if("object"!=typeof g||null===g)return g;if(I.has(g))return I.get(g);var B=Array.isArray(g)?[]:{};I.set(g,B);for(const E in g)if(g.hasOwnProperty(E)){const Q=g[E];if("object"!=typeof Q||null===Q)B[E]=Q;else try{B[E]=A(Q,I)}catch(C){}}return B},randomStr:CB,getUrlParams:function(A){const g={};let I=A.substring(A.lastIndexOf("?")+1);return I=decodeURIComponent(I),I.replace(/([^?&=]+)=([^?&=]*)/g,(A,I,B)=>{const C=decodeURIComponent(I);let E=decodeURIComponent(B);try{E=JSON.parse(E)}catch(Q){}return g[C]=E,A}),g},getBroswer:function(){let A="";const g=window.navigator.userAgent.toLowerCase();if(/(msie|firefox|opera|chrome|netscape)\D+(\d[\d.]*)/.test(g)){const I=g.search(RegExp.$1);A=g.substring(I,g.length).replace(/safari\D+(\d[\d.]*)/,"")}else/version\D+(\d[\d.]*).*safari/.test(g)&&(A="safari "+RegExp.$2);return A},fileTurnBase64:QB,fileChunks:function(A,g,I,B){return new Promise((C,E)=>{const Q=new BB,t={fileHash:"",fileName:A.name,chunkSize:g,fileSize:A.size,fileType:A.type,chunks:[]};let i=new Promise((I,C)=>{Q.fileMd5(A,g,B).then(A=>{t.fileHash=A,I(t)}).catch(A=>{C(A)})}),s=new Promise((B,C)=>{let E=0;!async function C(){if(E>=A.size)return void B(t);let Q=A.slice(E,Math.min(E+g,A.size));I&&(Q=await QB(Q)),t.chunks.push({chunk:Q,index:E/g}),E+=g,C()}()});Promise.all([i,s]).then(()=>{C(t)}).catch(A=>{E(A)})})},base64ArrayMerge:function(A,g=!0){let I=(A=A.map(A=>function(A){const g="=".repeat((4-A.length%4)%4),I=(A+g).replace(/\-/g,"+").replace(/_/g,"/"),B=window.atob(I),C=new Uint8Array(B.length);for(let E=0;E<B.length;++E)C[E]=B.charCodeAt(E);return C}(A.split(",")[1]))).reduce((A,g)=>A+g.length,0);const B=new Uint8Array(I);let C=0;A.forEach(A=>{B.set(A,C),C+=A.length});const E=new Blob([B]);return new Promise((A,I)=>{g?QB(E).then(g=>{A(g)}).catch(A=>{I(A)}):A(E)})},toChineseNumber:function(A,g=!0){let I=A.toString().replace(/(?=(\d{4})+$)/g,",").split(",").filter(Boolean);const B=["零","一","二","三","四","五","六","七","八","九"],C=["","十","百","千"],E=["","万","亿"];let Q=I.map((A,g)=>function(A){let g="";for(let I=0;I<A.length;I++){let E=B[A[I]],Q=C[A.length-I-1];"零"===E&&(Q=""),g+=E+Q}return g=g.replace(/零+/g,"零").replace(/零$/,""),g}(A)+E[I.length-1-g]).join("");if(Q=Q||"零",g){let A={"零":"零","一":"壹","二":"贰","三":"叁","四":"肆","五":"伍","六":"陆","七":"柒","八":"捌","九":"玖","十":"拾","百":"佰","千":"仟"};Q=Q.split("").map(g=>A[g]||g).join("")}return Q},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,g){if(!A)return;"object"==typeof A&&(A=JSON.stringify(A));const I=new Blob([A],{type:"application/json;charset=utf-8"}),B=URL.createObjectURL(I),C=document.createElement("a");C.href=B,C.download=0==g.indexOf(".")?CB()+g:g,document.body.appendChild(C),C.click(),document.body.removeChild(C),URL.revokeObjectURL(B)}};const iB=(null==(Y=window.Cesium)?void 0:Y.WebMapTileServiceImageryProvider)||Object;class sB extends iB{constructor(A){super(A),K(this,"options",{isFilter:!1,blur:0,brightness:1,contrast:1,grayscale:0,hueRotate:0,invert:0,opacity:1,saturate:1,sepia:0,filterColor:"#0668d2",operation:"overlay"}),this.options={...this.options,...A.filterConfig||{}}}requestImage(A,g,I){return super.requestImage(A,g,I).then(A=>{if(!this.options.isFilter)return A;const g=document.createElement("canvas");g.width=A.width,g.height=A.height;const I=g.getContext("2d");return I.translate(0,g.height),I.scale(1,-1),I.filter=`invert(${this.options.invert}) saturate(${this.options.saturate}) brightness(${this.options.brightness}) hue-rotate(${this.options.hueRotate}deg) contrast(${this.options.contrast}) sepia(${this.options.sepia}) opacity(${this.options.opacity}) grayscale(${this.options.grayscale}) blur(${this.options.blur}px)`,I.drawImage(A,0,0,g.width,g.height),I.filter="none",this.options.operation&&(I.globalCompositeOperation=this.options.operation,I.fillStyle=this.options.filterColor,I.fillRect(0,0,g.width,g.height),I.globalCompositeOperation="source-over"),I.stroke(),g})}}class kB{constructor(A){U(this,r,null),U(this,S,null),U(this,J,null),U(this,G,null),K(this,"TianDiTuToken",""),K(this,"loadTdtYingXiang",(A={},g={})=>{const I=y(this,G).viewer;var B={tdtyxType:"img_w",maximumLevel:18,minimumLevel:0,...A},C=new sB({filterConfig:g,url:`http://t{s}.tianditu.gov.cn/${B.tdtyxType}/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=${"img_w"==B.tdtyxType?"img":"vec"}&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:B.maximumLevel,minimumLevel:B.minimumLevel}),E=I.imageryLayers.addImageryProvider(C);return I.imageryLayers.lowerToBottom(E),{entity:E,remove(){I.imageryLayers.remove(E)}}}),K(this,"loadTdtZhuJi",(A={},g={})=>{const I=y(this,G).viewer;var B={maximumLevel:18,minimumLevel:0,...A},C=new sB({filterConfig:g,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:B.minimumLevel,maximumLevel:B.maximumLevel,show:!0}),E=I.imageryLayers.addImageryProvider(C);return I.imageryLayers.raiseToTop(E),{entity:E,remove(){I.imageryLayers.remove(E)}}}),K(this,"setImageLayerFilter",(A={},g=0)=>{var I={invertColor:!0,alpha:1,dayAlpha:1,nightAlpha:1,brightness:1,contrast:1,hue:50,saturation:1,gamma:1,...A},B=y(this,G).viewer.imageryLayers.get(g);B.invertColor=I.invertColor,B.alpha=I.alpha,B.dayAlpha=I.dayAlpha,B.nightAlpha=I.nightAlpha,B.brightness=I.brightness,B.contrast=I.contrast,B.hue=I.hue,B.saturation=I.saturation,B.gamma=I.gamma}),n(this,G,A),this.TianDiTuToken=A.TianDiTuToken,this.showTdtYX=!0,this.showTdtLW=!0}set showTdtYX(A){A?y(this,r)||n(this,r,this.loadTdtYingXiang()):(y(this,r)&&y(this,r).remove(),n(this,r,null))}set showTdtLW(A){A?y(this,S)||n(this,S,this.loadTdtLuWang()):(y(this,S)&&y(this,S).remove(),n(this,S,null))}set showTdtZJ(A){A?y(this,J)||n(this,J,this.loadTdtZhuJi()):(y(this,J)&&y(this,J).remove(),n(this,J,null))}loadTdtLuWang(A={},g={}){const I=y(this,G).viewer;var B={maximumLevel:18,minimumLevel:0,show:!0,...A},C=new sB({filterConfig:g,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:B.maximumLevel,minimumLevel:B.minimumLevel,show:B.show}),E=I.imageryLayers.addImageryProvider(C);return I.imageryLayers.raiseToTop(E),{entity:E,remove(){I.imageryLayers.remove(E)}}}}r=new WeakMap,S=new WeakMap,J=new WeakMap,G=new WeakMap;const YB=Symbol(),rB="el",SB=(A,g,I,B,C)=>{let E=`${A}-${g}`;return I&&(E+=`-${I}`),B&&(E+=`__${B}`),C&&(E+=`--${C}`),E},JB=Symbol("namespaceContextKey"),GB=(A,I)=>{const B=(A=>{const I=A||(g.getCurrentInstance()?g.inject(JB,g.ref(rB)):g.ref(rB));return g.computed(()=>g.unref(I)||rB)})(I);return{namespace:B,b:(g="")=>SB(B.value,A,g,"",""),e:g=>g?SB(B.value,A,"",g,""):"",m:g=>g?SB(B.value,A,"","",g):"",be:(g,I)=>g&&I?SB(B.value,A,g,I,""):"",em:(g,I)=>g&&I?SB(B.value,A,"",g,I):"",bm:(g,I)=>g&&I?SB(B.value,A,g,"",I):"",bem:(g,I,C)=>g&&I&&C?SB(B.value,A,g,I,C):"",is:(A,...g)=>{const I=!(g.length>=1)||g[0];return A&&I?`is-${A}`:""},cssVar:A=>{const g={};for(const I in A)A[I]&&(g[`--${B.value}-${I}`]=A[I]);return g},cssVarName:A=>`--${B.value}-${A}`,cssVarBlock:g=>{const I={};for(const C in g)g[C]&&(I[`--${B.value}-${A}-${C}`]=g[C]);return I},cssVarBlockName:g=>`--${B.value}-${A}-${g}`}};
|
|
34
34
|
/**
|
|
35
35
|
* @vue/shared v3.5.13
|
|
36
36
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|