module-develop-kit 0.1.0 → 0.1.1

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/dist/index.umd.js CHANGED
@@ -1 +1 @@
1
- (function(it,tt){typeof exports=="object"&&typeof module<"u"?tt(exports):typeof define=="function"&&define.amd?define(["exports"],tt):(it=typeof globalThis<"u"?globalThis:it||self,tt(it.DevelopKit={}))})(this,function(it){"use strict";var tt={exports:{}},Ut=tt.exports,Dt;function ft(){return Dt||(Dt=1,function(y,z){(function(){var S,T=0xdeadbeefcafe,I=(T&16777215)==15715070;function r(t,e,i){t!=null&&(typeof t=="number"?this.fromNumber(t,e,i):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}function g(){return new r(null)}function c(t,e,i,n,u,l){for(;--l>=0;){var b=e*this[t++]+i[n]+u;u=Math.floor(b/67108864),i[n++]=b&67108863}return u}function v(t,e,i,n,u,l){for(var b=e&32767,F=e>>15;--l>=0;){var V=this[t]&32767,k=this[t++]>>15,$=F*V+k*b;V=b*V+(($&32767)<<15)+i[n]+(u&1073741823),u=(V>>>30)+($>>>15)+F*k+(u>>>30),i[n++]=V&1073741823}return u}function p(t,e,i,n,u,l){for(var b=e&16383,F=e>>14;--l>=0;){var V=this[t]&16383,k=this[t++]>>14,$=F*V+k*b;V=b*V+(($&16383)<<14)+i[n]+u,u=(V>>28)+($>>14)+F*k,i[n++]=V&268435455}return u}var d=typeof navigator<"u";d&&I&&navigator.appName=="Microsoft Internet Explorer"?(r.prototype.am=v,S=30):d&&I&&navigator.appName!="Netscape"?(r.prototype.am=c,S=26):(r.prototype.am=p,S=28),r.prototype.DB=S,r.prototype.DM=(1<<S)-1,r.prototype.DV=1<<S;var w=52;r.prototype.FV=Math.pow(2,w),r.prototype.F1=w-S,r.prototype.F2=2*S-w;var B="0123456789abcdefghijklmnopqrstuvwxyz",E=new Array,D,M;for(D=48,M=0;M<=9;++M)E[D++]=M;for(D=97,M=10;M<36;++M)E[D++]=M;for(D=65,M=10;M<36;++M)E[D++]=M;function f(t){return B.charAt(t)}function a(t,e){var i=E[t.charCodeAt(e)];return i??-1}function h(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function o(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function x(t){var e=g();return e.fromInt(t),e}function s(t,e){var i;if(e==16)i=4;else if(e==8)i=3;else if(e==256)i=8;else if(e==2)i=1;else if(e==32)i=5;else if(e==4)i=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,u=!1,l=0;--n>=0;){var b=i==8?t[n]&255:a(t,n);if(b<0){t.charAt(n)=="-"&&(u=!0);continue}u=!1,l==0?this[this.t++]=b:l+i>this.DB?(this[this.t-1]|=(b&(1<<this.DB-l)-1)<<l,this[this.t++]=b>>this.DB-l):this[this.t-1]|=b<<l,l+=i,l>=this.DB&&(l-=this.DB)}i==8&&(t[0]&128)!=0&&(this.s=-1,l>0&&(this[this.t-1]|=(1<<this.DB-l)-1<<l)),this.clamp(),u&&r.ZERO.subTo(this,this)}function m(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function R(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var i=(1<<e)-1,n,u=!1,l="",b=this.t,F=this.DB-b*this.DB%e;if(b-- >0)for(F<this.DB&&(n=this[b]>>F)>0&&(u=!0,l=f(n));b>=0;)F<e?(n=(this[b]&(1<<F)-1)<<e-F,n|=this[--b]>>(F+=this.DB-e)):(n=this[b]>>(F-=e)&i,F<=0&&(F+=this.DB,--b)),n>0&&(u=!0),u&&(l+=f(n));return u?l:"0"}function P(){var t=g();return r.ZERO.subTo(this,t),t}function C(){return this.s<0?this.negate():this}function N(t){var e=this.s-t.s;if(e!=0)return e;var i=this.t;if(e=i-t.t,e!=0)return this.s<0?-e:e;for(;--i>=0;)if((e=this[i]-t[i])!=0)return e;return 0}function q(t){var e=1,i;return(i=t>>>16)!=0&&(t=i,e+=16),(i=t>>8)!=0&&(t=i,e+=8),(i=t>>4)!=0&&(t=i,e+=4),(i=t>>2)!=0&&(t=i,e+=2),(i=t>>1)!=0&&(t=i,e+=1),e}function O(){return this.t<=0?0:this.DB*(this.t-1)+q(this[this.t-1]^this.s&this.DM)}function H(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s}function L(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s}function Z(t,e){var i=t%this.DB,n=this.DB-i,u=(1<<n)-1,l=Math.floor(t/this.DB),b=this.s<<i&this.DM,F;for(F=this.t-1;F>=0;--F)e[F+l+1]=this[F]>>n|b,b=(this[F]&u)<<i;for(F=l-1;F>=0;--F)e[F]=0;e[l]=b,e.t=this.t+l+1,e.s=this.s,e.clamp()}function W(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t){e.t=0;return}var n=t%this.DB,u=this.DB-n,l=(1<<n)-1;e[0]=this[i]>>n;for(var b=i+1;b<this.t;++b)e[b-i-1]|=(this[b]&l)<<u,e[b-i]=this[b]>>n;n>0&&(e[this.t-i-1]|=(this.s&l)<<u),e.t=this.t-i,e.clamp()}function G(t,e){for(var i=0,n=0,u=Math.min(t.t,this.t);i<u;)n+=this[i]-t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n-=t[i],e[i++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[i++]=this.DV+n:n>0&&(e[i++]=n),e.t=i,e.clamp()}function st(t,e){var i=this.abs(),n=t.abs(),u=i.t;for(e.t=u+n.t;--u>=0;)e[u]=0;for(u=0;u<n.t;++u)e[u+i.t]=i.am(0,n[u],e,u,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)}function ht(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var n=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,n,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()}function ut(t,e,i){var n=t.abs();if(!(n.t<=0)){var u=this.abs();if(u.t<n.t){e!=null&&e.fromInt(0),i!=null&&this.copyTo(i);return}i==null&&(i=g());var l=g(),b=this.s,F=t.s,V=this.DB-q(n[n.t-1]);V>0?(n.lShiftTo(V,l),u.lShiftTo(V,i)):(n.copyTo(l),u.copyTo(i));var k=l.t,$=l[k-1];if($!=0){var X=$*(1<<this.F1)+(k>1?l[k-2]>>this.F2:0),Q=this.FV/X,at=(1<<this.F1)/X,K=1<<this.F2,J=i.t,xt=J-k,et=e??g();for(l.dlShiftTo(xt,et),i.compareTo(et)>=0&&(i[i.t++]=1,i.subTo(et,i)),r.ONE.dlShiftTo(k,et),et.subTo(l,l);l.t<k;)l[l.t++]=0;for(;--xt>=0;){var St=i[--J]==$?this.DM:Math.floor(i[J]*Q+(i[J-1]+K)*at);if((i[J]+=l.am(0,St,i,xt,0,k))<St)for(l.dlShiftTo(xt,et),i.subTo(et,i);i[J]<--St;)i.subTo(et,i)}e!=null&&(i.drShiftTo(k,e),b!=F&&r.ZERO.subTo(e,e)),i.t=k,i.clamp(),V>0&&i.rShiftTo(V,i),b<0&&r.ZERO.subTo(i,i)}}}function ct(t){var e=g();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e}function A(t){this.m=t}function te(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function ee(t){return t}function ie(t){t.divRemTo(this.m,null,t)}function ne(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function re(t,e){t.squareTo(e),this.reduce(e)}A.prototype.convert=te,A.prototype.revert=ee,A.prototype.reduce=ie,A.prototype.mulTo=ne,A.prototype.sqrTo=re;function se(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function nt(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function oe(t){var e=g();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(r.ZERO)>0&&this.m.subTo(e,e),e}function fe(t){var e=g();return t.copyTo(e),this.reduce(e),e}function he(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=t[e]&32767,n=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(i=e+this.m.t,t[i]+=this.m.am(0,n,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function ue(t,e){t.squareTo(e),this.reduce(e)}function ce(t,e,i){t.multiplyTo(e,i),this.reduce(i)}nt.prototype.convert=oe,nt.prototype.revert=fe,nt.prototype.reduce=he,nt.prototype.mulTo=ce,nt.prototype.sqrTo=ue;function le(){return(this.t>0?this[0]&1:this.s)==0}function ae(t,e){if(t>4294967295||t<1)return r.ONE;var i=g(),n=g(),u=e.convert(this),l=q(t)-1;for(u.copyTo(i);--l>=0;)if(e.sqrTo(i,n),(t&1<<l)>0)e.mulTo(n,u,i);else{var b=i;i=n,n=b}return e.revert(i)}function xe(t,e){var i;return t<256||e.isEven()?i=new A(e):i=new nt(e),this.exp(t,i)}r.prototype.copyTo=h,r.prototype.fromInt=o,r.prototype.fromString=s,r.prototype.clamp=m,r.prototype.dlShiftTo=H,r.prototype.drShiftTo=L,r.prototype.lShiftTo=Z,r.prototype.rShiftTo=W,r.prototype.subTo=G,r.prototype.multiplyTo=st,r.prototype.squareTo=ht,r.prototype.divRemTo=ut,r.prototype.invDigit=se,r.prototype.isEven=le,r.prototype.exp=ae,r.prototype.toString=R,r.prototype.negate=P,r.prototype.abs=C,r.prototype.compareTo=N,r.prototype.bitLength=O,r.prototype.mod=ct,r.prototype.modPowInt=xe,r.ZERO=x(0),r.ONE=x(1);function pe(){var t=g();return this.copyTo(t),t}function de(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function ge(){return this.t==0?this.s:this[0]<<24>>24}function me(){return this.t==0?this.s:this[0]<<16>>16}function ye(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function ve(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function be(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),n=x(i),u=g(),l=g(),b="";for(this.divRemTo(n,u,l);u.signum()>0;)b=(i+l.intValue()).toString(t).substr(1)+b,u.divRemTo(n,u,l);return l.intValue().toString(t)+b}function Te(t,e){this.fromInt(0),e==null&&(e=10);for(var i=this.chunkSize(e),n=Math.pow(e,i),u=!1,l=0,b=0,F=0;F<t.length;++F){var V=a(t,F);if(V<0){t.charAt(F)=="-"&&this.signum()==0&&(u=!0);continue}b=e*b+V,++l>=i&&(this.dMultiply(n),this.dAddOffset(b,0),l=0,b=0)}l>0&&(this.dMultiply(Math.pow(e,l)),this.dAddOffset(b,0)),u&&r.ZERO.subTo(this,this)}function we(t,e,i){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),wt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var n=new Array,u=t&7;n.length=(t>>3)+1,e.nextBytes(n),u>0?n[0]&=(1<<u)-1:n[0]=0,this.fromString(n,256)}}function Fe(){var t=this.t,e=new Array;e[0]=this.s;var i=this.DB-t*this.DB%8,n,u=0;if(t-- >0)for(i<this.DB&&(n=this[t]>>i)!=(this.s&this.DM)>>i&&(e[u++]=n|this.s<<this.DB-i);t>=0;)i<8?(n=(this[t]&(1<<i)-1)<<8-i,n|=this[--t]>>(i+=this.DB-8)):(n=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),(n&128)!=0&&(n|=-256),u==0&&(this.s&128)!=(n&128)&&++u,(u>0||n!=this.s)&&(e[u++]=n);return e}function Be(t){return this.compareTo(t)==0}function Se(t){return this.compareTo(t)<0?this:t}function De(t){return this.compareTo(t)>0?this:t}function qe(t,e,i){var n,u,l=Math.min(t.t,this.t);for(n=0;n<l;++n)i[n]=e(this[n],t[n]);if(t.t<this.t){for(u=t.s&this.DM,n=l;n<this.t;++n)i[n]=e(this[n],u);i.t=this.t}else{for(u=this.s&this.DM,n=l;n<t.t;++n)i[n]=e(u,t[n]);i.t=t.t}i.s=e(this.s,t.s),i.clamp()}function Ie(t,e){return t&e}function Ee(t){var e=g();return this.bitwiseTo(t,Ie,e),e}function wt(t,e){return t|e}function Re(t){var e=g();return this.bitwiseTo(t,wt,e),e}function Ht(t,e){return t^e}function Ae(t){var e=g();return this.bitwiseTo(t,Ht,e),e}function Nt(t,e){return t&~e}function Pe(t){var e=g();return this.bitwiseTo(t,Nt,e),e}function Me(){for(var t=g(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}function Ce(t){var e=g();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function Oe(t){var e=g();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function He(t){if(t==0)return-1;var e=0;return(t&65535)==0&&(t>>=16,e+=16),(t&255)==0&&(t>>=8,e+=8),(t&15)==0&&(t>>=4,e+=4),(t&3)==0&&(t>>=2,e+=2),(t&1)==0&&++e,e}function Ne(){for(var t=0;t<this.t;++t)if(this[t]!=0)return t*this.DB+He(this[t]);return this.s<0?this.t*this.DB:-1}function Le(t){for(var e=0;t!=0;)t&=t-1,++e;return e}function Ve(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=Le(this[i]^e);return t}function ze(t){var e=Math.floor(t/this.DB);return e>=this.t?this.s!=0:(this[e]&1<<t%this.DB)!=0}function je(t,e){var i=r.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i}function ke(t){return this.changeBit(t,wt)}function Ue(t){return this.changeBit(t,Nt)}function Ze(t){return this.changeBit(t,Ht)}function _e(t,e){for(var i=0,n=0,u=Math.min(t.t,this.t);i<u;)n+=this[i]+t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n+=t[i],e[i++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[i++]=n:n<-1&&(e[i++]=this.DV+n),e.t=i,e.clamp()}function Xe(t){var e=g();return this.addTo(t,e),e}function $e(t){var e=g();return this.subTo(t,e),e}function Ge(t){var e=g();return this.multiplyTo(t,e),e}function Ye(){var t=g();return this.squareTo(t),t}function Ke(t){var e=g();return this.divRemTo(t,e,null),e}function Je(t){var e=g();return this.divRemTo(t,null,e),e}function We(t){var e=g(),i=g();return this.divRemTo(t,e,i),new Array(e,i)}function Qe(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function ti(t,e){if(t!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function ot(){}function Lt(t){return t}function ei(t,e,i){t.multiplyTo(e,i)}function ii(t,e){t.squareTo(e)}ot.prototype.convert=Lt,ot.prototype.revert=Lt,ot.prototype.mulTo=ei,ot.prototype.sqrTo=ii;function ni(t){return this.exp(t,new ot)}function ri(t,e,i){var n=Math.min(this.t+t.t,e);for(i.s=0,i.t=n;n>0;)i[--n]=0;var u;for(u=i.t-this.t;n<u;++n)i[n+this.t]=this.am(0,t[n],i,n,0,this.t);for(u=Math.min(t.t,e);n<u;++n)this.am(0,t[n],i,n,0,e-n);i.clamp()}function si(t,e,i){--e;var n=i.t=this.t+t.t-e;for(i.s=0;--n>=0;)i[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)i[this.t+n-e]=this.am(e-n,t[n],i,0,0,this.t+n-e);i.clamp(),i.drShiftTo(1,i)}function rt(t){this.r2=g(),this.q3=g(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function oi(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=g();return t.copyTo(e),this.reduce(e),e}function fi(t){return t}function hi(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function ui(t,e){t.squareTo(e),this.reduce(e)}function ci(t,e,i){t.multiplyTo(e,i),this.reduce(i)}rt.prototype.convert=oi,rt.prototype.revert=fi,rt.prototype.reduce=hi,rt.prototype.mulTo=ci,rt.prototype.sqrTo=ui;function li(t,e){var i=t.bitLength(),n,u=x(1),l;if(i<=0)return u;i<18?n=1:i<48?n=3:i<144?n=4:i<768?n=5:n=6,i<8?l=new A(e):e.isEven()?l=new rt(e):l=new nt(e);var b=new Array,F=3,V=n-1,k=(1<<n)-1;if(b[1]=l.convert(this),n>1){var $=g();for(l.sqrTo(b[1],$);F<=k;)b[F]=g(),l.mulTo($,b[F-2],b[F]),F+=2}var X=t.t-1,Q,at=!0,K=g(),J;for(i=q(t[X])-1;X>=0;){for(i>=V?Q=t[X]>>i-V&k:(Q=(t[X]&(1<<i+1)-1)<<V-i,X>0&&(Q|=t[X-1]>>this.DB+i-V)),F=n;(Q&1)==0;)Q>>=1,--F;if((i-=F)<0&&(i+=this.DB,--X),at)b[Q].copyTo(u),at=!1;else{for(;F>1;)l.sqrTo(u,K),l.sqrTo(K,u),F-=2;F>0?l.sqrTo(u,K):(J=u,u=K,K=J),l.mulTo(K,b[Q],u)}for(;X>=0&&(t[X]&1<<i)==0;)l.sqrTo(u,K),J=u,u=K,K=J,--i<0&&(i=this.DB-1,--X)}return l.revert(u)}function ai(t){var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(e.compareTo(i)<0){var n=e;e=i,i=n}var u=e.getLowestSetBit(),l=i.getLowestSetBit();if(l<0)return e;for(u<l&&(l=u),l>0&&(e.rShiftTo(l,e),i.rShiftTo(l,i));e.signum()>0;)(u=e.getLowestSetBit())>0&&e.rShiftTo(u,e),(u=i.getLowestSetBit())>0&&i.rShiftTo(u,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return l>0&&i.lShiftTo(l,i),i}function xi(t){if(t<=0)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(e==0)i=this[0]%t;else for(var n=this.t-1;n>=0;--n)i=(e*i+this[n])%t;return i}function pi(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return r.ZERO;for(var i=t.clone(),n=this.clone(),u=x(1),l=x(0),b=x(0),F=x(1);i.signum()!=0;){for(;i.isEven();)i.rShiftTo(1,i),e?((!u.isEven()||!l.isEven())&&(u.addTo(this,u),l.subTo(t,l)),u.rShiftTo(1,u)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);for(;n.isEven();)n.rShiftTo(1,n),e?((!b.isEven()||!F.isEven())&&(b.addTo(this,b),F.subTo(t,F)),b.rShiftTo(1,b)):F.isEven()||F.subTo(t,F),F.rShiftTo(1,F);i.compareTo(n)>=0?(i.subTo(n,i),e&&u.subTo(b,u),l.subTo(F,l)):(n.subTo(i,n),e&&b.subTo(u,b),F.subTo(l,F))}if(n.compareTo(r.ONE)!=0)return r.ZERO;if(F.compareTo(t)>=0)return F.subtract(t);if(F.signum()<0)F.addTo(t,F);else return F;return F.signum()<0?F.add(t):F}var U=[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],di=(1<<26)/U[U.length-1];function gi(t){var e,i=this.abs();if(i.t==1&&i[0]<=U[U.length-1]){for(e=0;e<U.length;++e)if(i[0]==U[e])return!0;return!1}if(i.isEven())return!1;for(e=1;e<U.length;){for(var n=U[e],u=e+1;u<U.length&&n<di;)n*=U[u++];for(n=i.modInt(n);e<u;)if(n%U[e++]==0)return!1}return i.millerRabin(t)}function mi(t){var e=this.subtract(r.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var n=e.shiftRight(i);t=t+1>>1,t>U.length&&(t=U.length);for(var u=g(),l=0;l<t;++l){u.fromInt(U[Math.floor(Math.random()*U.length)]);var b=u.modPow(n,this);if(b.compareTo(r.ONE)!=0&&b.compareTo(e)!=0){for(var F=1;F++<i&&b.compareTo(e)!=0;)if(b=b.modPowInt(2,this),b.compareTo(r.ONE)==0)return!1;if(b.compareTo(e)!=0)return!1}}return!0}r.prototype.chunkSize=ye,r.prototype.toRadix=be,r.prototype.fromRadix=Te,r.prototype.fromNumber=we,r.prototype.bitwiseTo=qe,r.prototype.changeBit=je,r.prototype.addTo=_e,r.prototype.dMultiply=Qe,r.prototype.dAddOffset=ti,r.prototype.multiplyLowerTo=ri,r.prototype.multiplyUpperTo=si,r.prototype.modInt=xi,r.prototype.millerRabin=mi,r.prototype.clone=pe,r.prototype.intValue=de,r.prototype.byteValue=ge,r.prototype.shortValue=me,r.prototype.signum=ve,r.prototype.toByteArray=Fe,r.prototype.equals=Be,r.prototype.min=Se,r.prototype.max=De,r.prototype.and=Ee,r.prototype.or=Re,r.prototype.xor=Ae,r.prototype.andNot=Pe,r.prototype.not=Me,r.prototype.shiftLeft=Ce,r.prototype.shiftRight=Oe,r.prototype.getLowestSetBit=Ne,r.prototype.bitCount=Ve,r.prototype.testBit=ze,r.prototype.setBit=ke,r.prototype.clearBit=Ue,r.prototype.flipBit=Ze,r.prototype.add=Xe,r.prototype.subtract=$e,r.prototype.multiply=Ge,r.prototype.divide=Ke,r.prototype.remainder=Je,r.prototype.divideAndRemainder=We,r.prototype.modPow=li,r.prototype.modInverse=pi,r.prototype.pow=ni,r.prototype.gcd=ai,r.prototype.isProbablePrime=gi,r.prototype.square=Ye,r.prototype.Barrett=rt;var lt,_,j;function yi(t){_[j++]^=t&255,_[j++]^=t>>8&255,_[j++]^=t>>16&255,_[j++]^=t>>24&255,j>=Bt&&(j-=Bt)}function Vt(){yi(new Date().getTime())}if(_==null){_=new Array,j=0;var Y;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var zt=new Uint8Array(32);for(window.crypto.getRandomValues(zt),Y=0;Y<32;++Y)_[j++]=zt[Y]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var jt=window.crypto.random(32);for(Y=0;Y<jt.length;++Y)_[j++]=jt.charCodeAt(Y)&255}}for(;j<Bt;)Y=Math.floor(65536*Math.random()),_[j++]=Y>>>8,_[j++]=Y&255;j=0,Vt()}function vi(){if(lt==null){for(Vt(),lt=Fi(),lt.init(_),j=0;j<_.length;++j)_[j]=0;j=0}return lt.next()}function bi(t){var e;for(e=0;e<t.length;++e)t[e]=vi()}function kt(){}kt.prototype.nextBytes=bi;function Ft(){this.i=0,this.j=0,this.S=new Array}function Ti(t){var e,i,n;for(e=0;e<256;++e)this.S[e]=e;for(i=0,e=0;e<256;++e)i=i+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[i],this.S[i]=n;this.i=0,this.j=0}function wi(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]}Ft.prototype.init=Ti,Ft.prototype.next=wi;function Fi(){return new Ft}var Bt=256;y.exports={default:r,BigInteger:r,SecureRandom:kt}}).call(Ut)}(tt)),tt.exports}var pt,qt;function Zt(){if(qt)return pt;qt=1;const{BigInteger:y}=ft();function z(v){let p=v.toString(16);if(p[0]!=="-")p.length%2===1?p="0"+p:p.match(/^[0-7]/)||(p="00"+p);else{p=p.substr(1);let d=p.length;d%2===1?d+=1:p.match(/^[0-7]/)||(d+=2);let w="";for(let B=0;B<d;B++)w+="f";w=new y(w,16),p=w.xor(v).add(y.ONE),p=p.toString(16).replace(/^-/,"")}return p}class S{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 p=this.v.length/2;let d=p.toString(16);return d.length%2===1&&(d="0"+d),p<128?d:(128+d.length/2).toString(16)+d}getValue(){return""}}class T extends S{constructor(p){super(),this.t="02",p&&(this.v=z(p))}getValue(){return this.v}}class I extends S{constructor(p){super(),this.t="30",this.asn1Array=p}getValue(){return this.v=this.asn1Array.map(p=>p.getEncodedHex()).join(""),this.v}}function r(v,p){return+v[p+2]<8?1:+v.substr(p+2,2)&128}function g(v,p){const d=r(v,p),w=v.substr(p+2,d*2);return w?(+w[0]<8?new y(w,16):new y(w.substr(2),16)).intValue():-1}function c(v,p){const d=r(v,p);return p+(d+1)*2}return pt={encodeDer(v,p){const d=new T(v),w=new T(p);return new I([d,w]).getEncodedHex()},decodeDer(v){const p=c(v,0),d=c(v,p),w=g(v,p),B=v.substr(d,w*2),E=d+B.length,D=c(v,E),M=g(v,E),f=v.substr(D,M*2),a=new y(B,16),h=new y(f,16);return{r:a,s:h}}},pt}var dt,It;function _t(){if(It)return dt;It=1;const{BigInteger:y}=ft(),z=new y("2"),S=new y("3");class T{constructor(c,v){this.x=v,this.q=c}equals(c){return c===this?!0:this.q.equals(c.q)&&this.x.equals(c.x)}toBigInteger(){return this.x}negate(){return new T(this.q,this.x.negate().mod(this.q))}add(c){return new T(this.q,this.x.add(c.toBigInteger()).mod(this.q))}subtract(c){return new T(this.q,this.x.subtract(c.toBigInteger()).mod(this.q))}multiply(c){return new T(this.q,this.x.multiply(c.toBigInteger()).mod(this.q))}divide(c){return new T(this.q,this.x.multiply(c.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new T(this.q,this.x.square().mod(this.q))}}class I{constructor(c,v,p,d){this.curve=c,this.x=v,this.y=p,this.z=d??y.ONE,this.zinv=null}getX(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}getY(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}equals(c){return c===this?!0:this.isInfinity()?c.isInfinity():c.isInfinity()?this.isInfinity():c.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(c.z)).mod(this.curve.q).equals(y.ZERO)?c.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(c.z)).mod(this.curve.q).equals(y.ZERO):!1}isInfinity(){return this.x===null&&this.y===null?!0:this.z.equals(y.ZERO)&&!this.y.toBigInteger().equals(y.ZERO)}negate(){return new I(this.curve,this.x,this.y.negate(),this.z)}add(c){if(this.isInfinity())return c;if(c.isInfinity())return this;const v=this.x.toBigInteger(),p=this.y.toBigInteger(),d=this.z,w=c.x.toBigInteger(),B=c.y.toBigInteger(),E=c.z,D=this.curve.q,M=v.multiply(E).mod(D),f=w.multiply(d).mod(D),a=M.subtract(f),h=p.multiply(E).mod(D),o=B.multiply(d).mod(D),x=h.subtract(o);if(y.ZERO.equals(a))return y.ZERO.equals(x)?this.twice():this.curve.infinity;const s=M.add(f),m=d.multiply(E).mod(D),R=a.square().mod(D),P=a.multiply(R).mod(D),C=m.multiply(x.square()).subtract(s.multiply(R)).mod(D),N=a.multiply(C).mod(D),q=x.multiply(R.multiply(M).subtract(C)).subtract(h.multiply(P)).mod(D),O=P.multiply(m).mod(D);return new I(this.curve,this.curve.fromBigInteger(N),this.curve.fromBigInteger(q),O)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const c=this.x.toBigInteger(),v=this.y.toBigInteger(),p=this.z,d=this.curve.q,w=this.curve.a.toBigInteger(),B=c.square().multiply(S).add(w.multiply(p.square())).mod(d),E=v.shiftLeft(1).multiply(p).mod(d),D=v.square().mod(d),M=D.multiply(c).multiply(p).mod(d),f=E.square().mod(d),a=B.square().subtract(M.shiftLeft(3)).mod(d),h=E.multiply(a).mod(d),o=B.multiply(M.shiftLeft(2).subtract(a)).subtract(f.shiftLeft(1).multiply(D)).mod(d),x=E.multiply(f).mod(d);return new I(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(o),x)}multiply(c){if(this.isInfinity())return this;if(!c.signum())return this.curve.infinity;const v=c.multiply(S),p=this.negate();let d=this;for(let w=v.bitLength()-2;w>0;w--){d=d.twice();const B=v.testBit(w),E=c.testBit(w);B!==E&&(d=d.add(B?this:p))}return d}}class r{constructor(c,v,p){this.q=c,this.a=this.fromBigInteger(v),this.b=this.fromBigInteger(p),this.infinity=new I(this,null,null)}equals(c){return c===this?!0:this.q.equals(c.q)&&this.a.equals(c.a)&&this.b.equals(c.b)}fromBigInteger(c){return new T(this.q,c)}decodePointHex(c){switch(parseInt(c.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const v=this.fromBigInteger(new y(c.substr(2),16));let p=this.fromBigInteger(v.multiply(v.square()).add(v.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new y("4")).add(y.ONE),this.q));return p.toBigInteger().mod(z).equals(new y(c.substr(0,2),16).subtract(z))||(p=p.negate()),new I(this,v,p);case 4:case 6:case 7:const d=(c.length-2)/2,w=c.substr(2,d),B=c.substr(d+2,d);return new I(this,this.fromBigInteger(new y(w,16)),this.fromBigInteger(new y(B,16)));default:return null}}}return dt={ECPointFp:I,ECCurveFp:r},dt}var gt,Et;function Xt(){if(Et)return gt;Et=1;const{BigInteger:y,SecureRandom:z}=ft(),{ECCurveFp:S}=_t(),T=new z,{curve:I,G:r,n:g}=v();function c(){return I}function v(){const h=new y("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),o=new y("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),x=new y("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),s=new S(h,o,x),P=s.decodePointHex("04"+"32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7"+"BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),C=new y("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16);return{curve:s,G:P,n:C}}function p(h,o,x){const m=(h?new y(h,o,x):new y(g.bitLength(),T)).mod(g.subtract(y.ONE)).add(y.ONE),R=B(m.toString(16),64),P=r.multiply(m),C=B(P.getX().toBigInteger().toString(16),64),N=B(P.getY().toBigInteger().toString(16),64),q="04"+C+N;return{privateKey:R,publicKey:q}}function d(h){if(h.length!==130)throw new Error("Invalid public key to compress");const o=(h.length-2)/2,x=h.substr(2,o),s=new y(h.substr(o+2,o),16);let m="03";return s.mod(new y("2")).equals(y.ZERO)&&(m="02"),m+x}function w(h){h=unescape(encodeURIComponent(h));const o=h.length,x=[];for(let m=0;m<o;m++)x[m>>>2]|=(h.charCodeAt(m)&255)<<24-m%4*8;const s=[];for(let m=0;m<o;m++){const R=x[m>>>2]>>>24-m%4*8&255;s.push((R>>>4).toString(16)),s.push((R&15).toString(16))}return s.join("")}function B(h,o){return h.length>=o?h:new Array(o-h.length+1).join("0")+h}function E(h){return h.map(o=>(o=o.toString(16),o.length===1?"0"+o:o)).join("")}function D(h){const o=[];let x=0;for(let s=0;s<h.length*2;s+=2)o[s>>>3]|=parseInt(h[x],10)<<24-s%8*4,x++;try{const s=[];for(let m=0;m<h.length;m++){const R=o[m>>>2]>>>24-m%4*8&255;s.push(String.fromCharCode(R))}return decodeURIComponent(escape(s.join("")))}catch{throw new Error("Malformed UTF-8 data")}}function M(h){const o=[];let x=h.length;x%2!==0&&(h=B(h,x+1)),x=h.length;for(let s=0;s<x;s+=2)o.push(parseInt(h.substr(s,2),16));return o}function f(h){const o=I.decodePointHex(h);if(!o)return!1;const x=o.getX();return o.getY().square().equals(x.multiply(x.square()).add(x.multiply(I.a)).add(I.b))}function a(h,o){const x=I.decodePointHex(h);if(!x)return!1;const s=I.decodePointHex(o);return s?x.equals(s):!1}return gt={getGlobalCurve:c,generateEcparam:v,generateKeyPairHex:p,compressPublicKeyHex:d,utf8ToHex:w,leftPad:B,arrayToHex:E,arrayToUtf8:D,hexToArray:M,verifyPublicKey:f,comparePublicKeyHex:a},gt}var mt,Rt;function At(){if(Rt)return mt;Rt=1;const y=new Uint32Array(68),z=new Uint32Array(64);function S(w,B){const E=B&31;return w<<E|w>>>32-E}function T(w,B){const E=[];for(let D=w.length-1;D>=0;D--)E[D]=(w[D]^B[D])&255;return E}function I(w){return w^S(w,9)^S(w,17)}function r(w){return w^S(w,15)^S(w,23)}function g(w){let B=w.length*8,E=B%512;E=E>=448?512-E%448-1:448-E-1;const D=new Array((E-7)/8),M=new Array(8);for(let s=0,m=D.length;s<m;s++)D[s]=0;for(let s=0,m=M.length;s<m;s++)M[s]=0;B=B.toString(2);for(let s=7;s>=0;s--)if(B.length>8){const m=B.length-8;M[s]=parseInt(B.substr(m),2),B=B.substr(0,m)}else B.length>0&&(M[s]=parseInt(B,2),B="");const f=new Uint8Array([...w,128,...D,...M]),a=new DataView(f.buffer,0),h=f.length/64,o=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let s=0;s<h;s++){y.fill(0),z.fill(0);const m=16*s;for(let A=0;A<16;A++)y[A]=a.getUint32((m+A)*4,!1);for(let A=16;A<68;A++)y[A]=r(y[A-16]^y[A-9]^S(y[A-3],15))^S(y[A-13],7)^y[A-6];for(let A=0;A<64;A++)z[A]=y[A]^y[A+4];const R=2043430169,P=2055708042;let C=o[0],N=o[1],q=o[2],O=o[3],H=o[4],L=o[5],Z=o[6],W=o[7],G,st,ht,ut,ct;for(let A=0;A<64;A++)ct=A>=0&&A<=15?R:P,G=S(S(C,12)+H+S(ct,A),7),st=G^S(C,12),ht=(A>=0&&A<=15?C^N^q:C&N|C&q|N&q)+O+st+z[A],ut=(A>=0&&A<=15?H^L^Z:H&L|~H&Z)+W+G+y[A],O=q,q=S(N,9),N=C,C=ht,W=Z,Z=S(L,19),L=H,H=I(ut);o[0]^=C,o[1]^=N,o[2]^=q,o[3]^=O,o[4]^=H,o[5]^=L,o[6]^=Z,o[7]^=W}const x=[];for(let s=0,m=o.length;s<m;s++){const R=o[s];x.push((R&4278190080)>>>24,(R&16711680)>>>16,(R&65280)>>>8,R&255)}return x}const c=64,v=new Uint8Array(c),p=new Uint8Array(c);for(let w=0;w<c;w++)v[w]=54,p[w]=92;function d(w,B){for(B.length>c&&(B=g(B));B.length<c;)B.push(0);const E=T(B,v),D=T(B,p),M=g([...E,...w]);return g([...D,...M])}return mt={sm3:g,hmac:d},mt}var yt,Pt;function $t(){if(Pt)return yt;Pt=1;const{BigInteger:y}=ft(),{encodeDer:z,decodeDer:S}=Zt(),T=Xt(),I=At().sm3,{G:r,curve:g,n:c}=T.generateEcparam(),v=0;function p(f,a,h=1){f=typeof f=="string"?T.hexToArray(T.utf8ToHex(f)):Array.prototype.slice.call(f),a=T.getGlobalCurve().decodePointHex(a);const o=T.generateKeyPairHex(),x=new y(o.privateKey,16);let s=o.publicKey;s.length>128&&(s=s.substr(s.length-128));const m=a.multiply(x),R=T.hexToArray(T.leftPad(m.getX().toBigInteger().toRadix(16),64)),P=T.hexToArray(T.leftPad(m.getY().toBigInteger().toRadix(16),64)),C=T.arrayToHex(I([].concat(R,f,P)));let N=1,q=0,O=[];const H=[].concat(R,P),L=()=>{O=I([...H,N>>24&255,N>>16&255,N>>8&255,N&255]),N++,q=0};L();for(let W=0,G=f.length;W<G;W++)q===O.length&&L(),f[W]^=O[q++]&255;const Z=T.arrayToHex(f);return h===v?s+Z+C:s+C+Z}function d(f,a,h=1,{output:o="string"}={}){a=new y(a,16);let x=f.substr(128,64),s=f.substr(192);h===v&&(x=f.substr(f.length-64),s=f.substr(128,f.length-128-64));const m=T.hexToArray(s),P=T.getGlobalCurve().decodePointHex("04"+f.substr(0,128)).multiply(a),C=T.hexToArray(T.leftPad(P.getX().toBigInteger().toRadix(16),64)),N=T.hexToArray(T.leftPad(P.getY().toBigInteger().toRadix(16),64));let q=1,O=0,H=[];const L=[].concat(C,N),Z=()=>{H=I([...L,q>>24&255,q>>16&255,q>>8&255,q&255]),q++,O=0};Z();for(let G=0,st=m.length;G<st;G++)O===H.length&&Z(),m[G]^=H[O++]&255;return T.arrayToHex(I([].concat(C,m,N)))===x.toLowerCase()?o==="array"?m:T.arrayToUtf8(m):o==="array"?[]:""}function w(f,a,{pointPool:h,der:o,hash:x,publicKey:s,userId:m}={}){let R=typeof f=="string"?T.utf8ToHex(f):T.arrayToHex(f);x&&(s=s||D(a),R=E(R,s,m));const P=new y(a,16),C=new y(R,16);let N=null,q=null,O=null;do{do{let H;h&&h.length?H=h.pop():H=M(),N=H.k,q=C.add(H.x1).mod(c)}while(q.equals(y.ZERO)||q.add(N).equals(c));O=P.add(y.ONE).modInverse(c).multiply(N.subtract(q.multiply(P))).mod(c)}while(O.equals(y.ZERO));return o?z(q,O):T.leftPad(q.toString(16),64)+T.leftPad(O.toString(16),64)}function B(f,a,h,{der:o,hash:x,userId:s}={}){let m=typeof f=="string"?T.utf8ToHex(f):T.arrayToHex(f);x&&(m=E(m,h,s));let R,P;if(o){const L=S(a);R=L.r,P=L.s}else R=new y(a.substring(0,64),16),P=new y(a.substring(64),16);const C=g.decodePointHex(h),N=new y(m,16),q=R.add(P).mod(c);if(q.equals(y.ZERO))return!1;const O=r.multiply(P).add(C.multiply(q)),H=N.add(O.getX().toBigInteger()).mod(c);return R.equals(H)}function E(f,a,h="1234567812345678"){h=T.utf8ToHex(h);const o=T.leftPad(r.curve.a.toBigInteger().toRadix(16),64),x=T.leftPad(r.curve.b.toBigInteger().toRadix(16),64),s=T.leftPad(r.getX().toBigInteger().toRadix(16),64),m=T.leftPad(r.getY().toBigInteger().toRadix(16),64);let R,P;if(a.length===128)R=a.substr(0,64),P=a.substr(64,64);else{const O=r.curve.decodePointHex(a);R=T.leftPad(O.getX().toBigInteger().toRadix(16),64),P=T.leftPad(O.getY().toBigInteger().toRadix(16),64)}const C=T.hexToArray(h+o+x+s+m+R+P),N=h.length*4;C.unshift(N&255),C.unshift(N>>8&255);const q=I(C);return T.arrayToHex(I(q.concat(T.hexToArray(f))))}function D(f){const a=r.multiply(new y(f,16)),h=T.leftPad(a.getX().toBigInteger().toString(16),64),o=T.leftPad(a.getY().toBigInteger().toString(16),64);return"04"+h+o}function M(){const f=T.generateKeyPairHex(),a=g.decodePointHex(f.publicKey);return f.k=new y(f.privateKey,16),f.x1=a.getX().toBigInteger(),f}return yt={generateKeyPairHex:T.generateKeyPairHex,compressPublicKeyHex:T.compressPublicKeyHex,comparePublicKeyHex:T.comparePublicKeyHex,doEncrypt:p,doDecrypt:d,doSignature:w,doVerifySignature:B,getPublicKeyFromPrivateKey:D,getPoint:M,verifyPublicKey:T.verifyPublicKey},yt}var vt,Mt;function Gt(){if(Mt)return vt;Mt=1;const{sm3:y,hmac:z}=At();function S(g,c){return g.length>=c?g:new Array(c-g.length+1).join("0")+g}function T(g){return g.map(c=>(c=c.toString(16),c.length===1?"0"+c:c)).join("")}function I(g){const c=[];let v=g.length;v%2!==0&&(g=S(g,v+1)),v=g.length;for(let p=0;p<v;p+=2)c.push(parseInt(g.substr(p,2),16));return c}function r(g){const c=[];for(let v=0,p=g.length;v<p;v++){const d=g.codePointAt(v);if(d<=127)c.push(d);else if(d<=2047)c.push(192|d>>>6),c.push(128|d&63);else if(d<=55295||d>=57344&&d<=65535)c.push(224|d>>>12),c.push(128|d>>>6&63),c.push(128|d&63);else if(d>=65536&&d<=1114111)v++,c.push(240|d>>>18&28),c.push(128|d>>>12&63),c.push(128|d>>>6&63),c.push(128|d&63);else throw c.push(d),new Error("input is not supported")}return c}return vt=function(g,c){if(g=typeof g=="string"?r(g):Array.prototype.slice.call(g),c){if((c.mode||"hmac")!=="hmac")throw new Error("invalid mode");let p=c.key;if(!p)throw new Error("invalid key");return p=typeof p=="string"?I(p):Array.prototype.slice.call(p),T(z(g,p))}return T(y(g))},vt}var bt,Ct;function Yt(){if(Ct)return bt;Ct=1;const y=0,z=32,S=16,T=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],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 r(f){const a=[];for(let h=0,o=f.length;h<o;h+=2)a.push(parseInt(f.substr(h,2),16));return a}function g(f){return f.map(a=>(a=a.toString(16),a.length===1?"0"+a:a)).join("")}function c(f){const a=[];for(let h=0,o=f.length;h<o;h++){const x=f.codePointAt(h);if(x<=127)a.push(x);else if(x<=2047)a.push(192|x>>>6),a.push(128|x&63);else if(x<=55295||x>=57344&&x<=65535)a.push(224|x>>>12),a.push(128|x>>>6&63),a.push(128|x&63);else if(x>=65536&&x<=1114111)h++,a.push(240|x>>>18&28),a.push(128|x>>>12&63),a.push(128|x>>>6&63),a.push(128|x&63);else throw a.push(x),new Error("input is not supported")}return a}function v(f){const a=[];for(let h=0,o=f.length;h<o;h++)f[h]>=240&&f[h]<=247?(a.push(String.fromCodePoint(((f[h]&7)<<18)+((f[h+1]&63)<<12)+((f[h+2]&63)<<6)+(f[h+3]&63))),h+=3):f[h]>=224&&f[h]<=239?(a.push(String.fromCodePoint(((f[h]&15)<<12)+((f[h+1]&63)<<6)+(f[h+2]&63))),h+=2):f[h]>=192&&f[h]<=223?(a.push(String.fromCodePoint(((f[h]&31)<<6)+(f[h+1]&63))),h++):a.push(String.fromCodePoint(f[h]));return a.join("")}function p(f,a){const h=a&31;return f<<h|f>>>32-h}function d(f){return(T[f>>>24&255]&255)<<24|(T[f>>>16&255]&255)<<16|(T[f>>>8&255]&255)<<8|T[f&255]&255}function w(f){return f^p(f,2)^p(f,10)^p(f,18)^p(f,24)}function B(f){return f^p(f,13)^p(f,23)}function E(f,a,h){const o=new Array(4),x=new Array(4);for(let s=0;s<4;s++)x[0]=f[4*s]&255,x[1]=f[4*s+1]&255,x[2]=f[4*s+2]&255,x[3]=f[4*s+3]&255,o[s]=x[0]<<24|x[1]<<16|x[2]<<8|x[3];for(let s=0,m;s<32;s+=4)m=o[1]^o[2]^o[3]^h[s+0],o[0]^=w(d(m)),m=o[2]^o[3]^o[0]^h[s+1],o[1]^=w(d(m)),m=o[3]^o[0]^o[1]^h[s+2],o[2]^=w(d(m)),m=o[0]^o[1]^o[2]^h[s+3],o[3]^=w(d(m));for(let s=0;s<16;s+=4)a[s]=o[3-s/4]>>>24&255,a[s+1]=o[3-s/4]>>>16&255,a[s+2]=o[3-s/4]>>>8&255,a[s+3]=o[3-s/4]&255}function D(f,a,h){const o=new Array(4),x=new Array(4);for(let s=0;s<4;s++)x[0]=f[0+4*s]&255,x[1]=f[1+4*s]&255,x[2]=f[2+4*s]&255,x[3]=f[3+4*s]&255,o[s]=x[0]<<24|x[1]<<16|x[2]<<8|x[3];o[0]^=2746333894,o[1]^=1453994832,o[2]^=1736282519,o[3]^=2993693404;for(let s=0,m;s<32;s+=4)m=o[1]^o[2]^o[3]^I[s+0],a[s+0]=o[0]^=B(d(m)),m=o[2]^o[3]^o[0]^I[s+1],a[s+1]=o[1]^=B(d(m)),m=o[3]^o[0]^o[1]^I[s+2],a[s+2]=o[2]^=B(d(m)),m=o[0]^o[1]^o[2]^I[s+3],a[s+3]=o[3]^=B(d(m));if(h===y)for(let s=0,m;s<16;s++)m=a[s],a[s]=a[31-s],a[31-s]=m}function M(f,a,h,{padding:o="pkcs#7",mode:x,iv:s=[],output:m="string"}={}){if(x==="cbc"&&(typeof s=="string"&&(s=r(s)),s.length!==128/8))throw new Error("iv is invalid");if(typeof a=="string"&&(a=r(a)),a.length!==128/8)throw new Error("key is invalid");if(typeof f=="string"?h!==y?f=c(f):f=r(f):f=[...f],(o==="pkcs#5"||o==="pkcs#7")&&h!==y){const O=S-f.length%S;for(let H=0;H<O;H++)f.push(O)}const R=new Array(z);D(a,R,h);const P=[];let C=s,N=f.length,q=0;for(;N>=S;){const O=f.slice(q,q+16),H=new Array(16);if(x==="cbc")for(let L=0;L<S;L++)h!==y&&(O[L]^=C[L]);E(O,H,R);for(let L=0;L<S;L++)x==="cbc"&&h===y&&(H[L]^=C[L]),P[q+L]=H[L];x==="cbc"&&(h!==y?C=H:C=O),N-=S,q+=S}if((o==="pkcs#5"||o==="pkcs#7")&&h===y){const O=P.length,H=P[O-1];for(let L=1;L<=H;L++)if(P[O-L]!==H)throw new Error("padding is invalid");P.splice(O-H,H)}return m!=="array"?h!==y?g(P):v(P):P}return bt={encrypt(f,a,h){return M(f,a,1,h)},decrypt(f,a,h){return M(f,a,0,h)}},bt}var Tt,Ot;function Kt(){return Ot||(Ot=1,Tt={sm2:$t(),sm3:Gt(),sm4:Yt()}),Tt}var Jt=Kt();function Wt({uid:y="",salt:z="",ts:S=0,data:T}){const I=Date.now()+S,r=Math.random().toString(36).substring(2,15),g=JSON.stringify(T??""),c=`${I}${y}${r}${g}${z}`,v=Jt.sm3(c);return{headers:{"X-Sign-Timestamp":String(I),"X-Sign-Nonce":r,"X-Sign-Client":v}}}function Qt(y){const z=["script","iframe","object","embed","link","meta","style"],S=["onerror","onload","onclick","onmouseover","onfocus","onmouseenter","onmouseleave"],T=v=>/^javascript:/i.test(v)||/^data:text\/html/i.test(v),r=new DOMParser().parseFromString(`<div>${y}</div>`,"text/html"),g=r.body.firstChild;function c(v){if(v.nodeType===Node.ELEMENT_NODE){const p=v,d=p.tagName.toLowerCase();if(z.includes(d)){const w=p.outerHTML,B=r.createTextNode(w);p.replaceWith(B);return}[...p.attributes].forEach(w=>{const B=w.name.toLowerCase(),E=w.value;(S.includes(B)||T(E))&&p.removeAttribute(w.name)}),[...p.childNodes].forEach(c)}}return[...g.childNodes].forEach(c),g.innerHTML}it.htmlSanitize=Qt,it.transmissionDataEncryption=Wt,Object.defineProperty(it,Symbol.toStringTag,{value:"Module"})});
1
+ (function(it,tt){typeof exports=="object"&&typeof module<"u"?tt(exports):typeof define=="function"&&define.amd?define(["exports"],tt):(it=typeof globalThis<"u"?globalThis:it||self,tt(it.DevelopKit={}))})(this,function(it){"use strict";var tt={exports:{}},Ut=tt.exports,Dt;function ft(){return Dt||(Dt=1,function(y,z){(function(){var S,v=0xdeadbeefcafe,I=(v&16777215)==15715070;function r(t,e,i){t!=null&&(typeof t=="number"?this.fromNumber(t,e,i):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}function g(){return new r(null)}function c(t,e,i,n,u,l){for(;--l>=0;){var T=e*this[t++]+i[n]+u;u=Math.floor(T/67108864),i[n++]=T&67108863}return u}function b(t,e,i,n,u,l){for(var T=e&32767,F=e>>15;--l>=0;){var V=this[t]&32767,k=this[t++]>>15,$=F*V+k*T;V=T*V+(($&32767)<<15)+i[n]+(u&1073741823),u=(V>>>30)+($>>>15)+F*k+(u>>>30),i[n++]=V&1073741823}return u}function p(t,e,i,n,u,l){for(var T=e&16383,F=e>>14;--l>=0;){var V=this[t]&16383,k=this[t++]>>14,$=F*V+k*T;V=T*V+(($&16383)<<14)+i[n]+u,u=(V>>28)+($>>14)+F*k,i[n++]=V&268435455}return u}var d=typeof navigator<"u";d&&I&&navigator.appName=="Microsoft Internet Explorer"?(r.prototype.am=b,S=30):d&&I&&navigator.appName!="Netscape"?(r.prototype.am=c,S=26):(r.prototype.am=p,S=28),r.prototype.DB=S,r.prototype.DM=(1<<S)-1,r.prototype.DV=1<<S;var w=52;r.prototype.FV=Math.pow(2,w),r.prototype.F1=w-S,r.prototype.F2=2*S-w;var B="0123456789abcdefghijklmnopqrstuvwxyz",E=new Array,D,M;for(D=48,M=0;M<=9;++M)E[D++]=M;for(D=97,M=10;M<36;++M)E[D++]=M;for(D=65,M=10;M<36;++M)E[D++]=M;function f(t){return B.charAt(t)}function a(t,e){var i=E[t.charCodeAt(e)];return i??-1}function h(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function o(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function x(t){var e=g();return e.fromInt(t),e}function s(t,e){var i;if(e==16)i=4;else if(e==8)i=3;else if(e==256)i=8;else if(e==2)i=1;else if(e==32)i=5;else if(e==4)i=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var n=t.length,u=!1,l=0;--n>=0;){var T=i==8?t[n]&255:a(t,n);if(T<0){t.charAt(n)=="-"&&(u=!0);continue}u=!1,l==0?this[this.t++]=T:l+i>this.DB?(this[this.t-1]|=(T&(1<<this.DB-l)-1)<<l,this[this.t++]=T>>this.DB-l):this[this.t-1]|=T<<l,l+=i,l>=this.DB&&(l-=this.DB)}i==8&&(t[0]&128)!=0&&(this.s=-1,l>0&&(this[this.t-1]|=(1<<this.DB-l)-1<<l)),this.clamp(),u&&r.ZERO.subTo(this,this)}function m(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function R(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var i=(1<<e)-1,n,u=!1,l="",T=this.t,F=this.DB-T*this.DB%e;if(T-- >0)for(F<this.DB&&(n=this[T]>>F)>0&&(u=!0,l=f(n));T>=0;)F<e?(n=(this[T]&(1<<F)-1)<<e-F,n|=this[--T]>>(F+=this.DB-e)):(n=this[T]>>(F-=e)&i,F<=0&&(F+=this.DB,--T)),n>0&&(u=!0),u&&(l+=f(n));return u?l:"0"}function P(){var t=g();return r.ZERO.subTo(this,t),t}function C(){return this.s<0?this.negate():this}function N(t){var e=this.s-t.s;if(e!=0)return e;var i=this.t;if(e=i-t.t,e!=0)return this.s<0?-e:e;for(;--i>=0;)if((e=this[i]-t[i])!=0)return e;return 0}function q(t){var e=1,i;return(i=t>>>16)!=0&&(t=i,e+=16),(i=t>>8)!=0&&(t=i,e+=8),(i=t>>4)!=0&&(t=i,e+=4),(i=t>>2)!=0&&(t=i,e+=2),(i=t>>1)!=0&&(t=i,e+=1),e}function O(){return this.t<=0?0:this.DB*(this.t-1)+q(this[this.t-1]^this.s&this.DM)}function H(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s}function L(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s}function Z(t,e){var i=t%this.DB,n=this.DB-i,u=(1<<n)-1,l=Math.floor(t/this.DB),T=this.s<<i&this.DM,F;for(F=this.t-1;F>=0;--F)e[F+l+1]=this[F]>>n|T,T=(this[F]&u)<<i;for(F=l-1;F>=0;--F)e[F]=0;e[l]=T,e.t=this.t+l+1,e.s=this.s,e.clamp()}function W(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t){e.t=0;return}var n=t%this.DB,u=this.DB-n,l=(1<<n)-1;e[0]=this[i]>>n;for(var T=i+1;T<this.t;++T)e[T-i-1]|=(this[T]&l)<<u,e[T-i]=this[T]>>n;n>0&&(e[this.t-i-1]|=(this.s&l)<<u),e.t=this.t-i,e.clamp()}function G(t,e){for(var i=0,n=0,u=Math.min(t.t,this.t);i<u;)n+=this[i]-t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n-=t[i],e[i++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[i++]=this.DV+n:n>0&&(e[i++]=n),e.t=i,e.clamp()}function st(t,e){var i=this.abs(),n=t.abs(),u=i.t;for(e.t=u+n.t;--u>=0;)e[u]=0;for(u=0;u<n.t;++u)e[u+i.t]=i.am(0,n[u],e,u,0,i.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)}function ht(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var n=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,n,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()}function ut(t,e,i){var n=t.abs();if(!(n.t<=0)){var u=this.abs();if(u.t<n.t){e!=null&&e.fromInt(0),i!=null&&this.copyTo(i);return}i==null&&(i=g());var l=g(),T=this.s,F=t.s,V=this.DB-q(n[n.t-1]);V>0?(n.lShiftTo(V,l),u.lShiftTo(V,i)):(n.copyTo(l),u.copyTo(i));var k=l.t,$=l[k-1];if($!=0){var X=$*(1<<this.F1)+(k>1?l[k-2]>>this.F2:0),Q=this.FV/X,at=(1<<this.F1)/X,K=1<<this.F2,J=i.t,xt=J-k,et=e??g();for(l.dlShiftTo(xt,et),i.compareTo(et)>=0&&(i[i.t++]=1,i.subTo(et,i)),r.ONE.dlShiftTo(k,et),et.subTo(l,l);l.t<k;)l[l.t++]=0;for(;--xt>=0;){var St=i[--J]==$?this.DM:Math.floor(i[J]*Q+(i[J-1]+K)*at);if((i[J]+=l.am(0,St,i,xt,0,k))<St)for(l.dlShiftTo(xt,et),i.subTo(et,i);i[J]<--St;)i.subTo(et,i)}e!=null&&(i.drShiftTo(k,e),T!=F&&r.ZERO.subTo(e,e)),i.t=k,i.clamp(),V>0&&i.rShiftTo(V,i),T<0&&r.ZERO.subTo(i,i)}}}function ct(t){var e=g();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e}function A(t){this.m=t}function te(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function ee(t){return t}function ie(t){t.divRemTo(this.m,null,t)}function ne(t,e,i){t.multiplyTo(e,i),this.reduce(i)}function re(t,e){t.squareTo(e),this.reduce(e)}A.prototype.convert=te,A.prototype.revert=ee,A.prototype.reduce=ie,A.prototype.mulTo=ne,A.prototype.sqrTo=re;function se(){if(this.t<1)return 0;var t=this[0];if((t&1)==0)return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function nt(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function oe(t){var e=g();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(r.ZERO)>0&&this.m.subTo(e,e),e}function fe(t){var e=g();return t.copyTo(e),this.reduce(e),e}function he(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=t[e]&32767,n=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(i=e+this.m.t,t[i]+=this.m.am(0,n,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function ue(t,e){t.squareTo(e),this.reduce(e)}function ce(t,e,i){t.multiplyTo(e,i),this.reduce(i)}nt.prototype.convert=oe,nt.prototype.revert=fe,nt.prototype.reduce=he,nt.prototype.mulTo=ce,nt.prototype.sqrTo=ue;function le(){return(this.t>0?this[0]&1:this.s)==0}function ae(t,e){if(t>4294967295||t<1)return r.ONE;var i=g(),n=g(),u=e.convert(this),l=q(t)-1;for(u.copyTo(i);--l>=0;)if(e.sqrTo(i,n),(t&1<<l)>0)e.mulTo(n,u,i);else{var T=i;i=n,n=T}return e.revert(i)}function xe(t,e){var i;return t<256||e.isEven()?i=new A(e):i=new nt(e),this.exp(t,i)}r.prototype.copyTo=h,r.prototype.fromInt=o,r.prototype.fromString=s,r.prototype.clamp=m,r.prototype.dlShiftTo=H,r.prototype.drShiftTo=L,r.prototype.lShiftTo=Z,r.prototype.rShiftTo=W,r.prototype.subTo=G,r.prototype.multiplyTo=st,r.prototype.squareTo=ht,r.prototype.divRemTo=ut,r.prototype.invDigit=se,r.prototype.isEven=le,r.prototype.exp=ae,r.prototype.toString=R,r.prototype.negate=P,r.prototype.abs=C,r.prototype.compareTo=N,r.prototype.bitLength=O,r.prototype.mod=ct,r.prototype.modPowInt=xe,r.ZERO=x(0),r.ONE=x(1);function pe(){var t=g();return this.copyTo(t),t}function de(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function ge(){return this.t==0?this.s:this[0]<<24>>24}function me(){return this.t==0?this.s:this[0]<<16>>16}function ye(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function ve(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function be(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),n=x(i),u=g(),l=g(),T="";for(this.divRemTo(n,u,l);u.signum()>0;)T=(i+l.intValue()).toString(t).substr(1)+T,u.divRemTo(n,u,l);return l.intValue().toString(t)+T}function Te(t,e){this.fromInt(0),e==null&&(e=10);for(var i=this.chunkSize(e),n=Math.pow(e,i),u=!1,l=0,T=0,F=0;F<t.length;++F){var V=a(t,F);if(V<0){t.charAt(F)=="-"&&this.signum()==0&&(u=!0);continue}T=e*T+V,++l>=i&&(this.dMultiply(n),this.dAddOffset(T,0),l=0,T=0)}l>0&&(this.dMultiply(Math.pow(e,l)),this.dAddOffset(T,0)),u&&r.ZERO.subTo(this,this)}function we(t,e,i){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),wt,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var n=new Array,u=t&7;n.length=(t>>3)+1,e.nextBytes(n),u>0?n[0]&=(1<<u)-1:n[0]=0,this.fromString(n,256)}}function Fe(){var t=this.t,e=new Array;e[0]=this.s;var i=this.DB-t*this.DB%8,n,u=0;if(t-- >0)for(i<this.DB&&(n=this[t]>>i)!=(this.s&this.DM)>>i&&(e[u++]=n|this.s<<this.DB-i);t>=0;)i<8?(n=(this[t]&(1<<i)-1)<<8-i,n|=this[--t]>>(i+=this.DB-8)):(n=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),(n&128)!=0&&(n|=-256),u==0&&(this.s&128)!=(n&128)&&++u,(u>0||n!=this.s)&&(e[u++]=n);return e}function Be(t){return this.compareTo(t)==0}function Se(t){return this.compareTo(t)<0?this:t}function De(t){return this.compareTo(t)>0?this:t}function qe(t,e,i){var n,u,l=Math.min(t.t,this.t);for(n=0;n<l;++n)i[n]=e(this[n],t[n]);if(t.t<this.t){for(u=t.s&this.DM,n=l;n<this.t;++n)i[n]=e(this[n],u);i.t=this.t}else{for(u=this.s&this.DM,n=l;n<t.t;++n)i[n]=e(u,t[n]);i.t=t.t}i.s=e(this.s,t.s),i.clamp()}function Ie(t,e){return t&e}function Ee(t){var e=g();return this.bitwiseTo(t,Ie,e),e}function wt(t,e){return t|e}function Re(t){var e=g();return this.bitwiseTo(t,wt,e),e}function Ht(t,e){return t^e}function Ae(t){var e=g();return this.bitwiseTo(t,Ht,e),e}function Nt(t,e){return t&~e}function Pe(t){var e=g();return this.bitwiseTo(t,Nt,e),e}function Me(){for(var t=g(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t}function Ce(t){var e=g();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e}function Oe(t){var e=g();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e}function He(t){if(t==0)return-1;var e=0;return(t&65535)==0&&(t>>=16,e+=16),(t&255)==0&&(t>>=8,e+=8),(t&15)==0&&(t>>=4,e+=4),(t&3)==0&&(t>>=2,e+=2),(t&1)==0&&++e,e}function Ne(){for(var t=0;t<this.t;++t)if(this[t]!=0)return t*this.DB+He(this[t]);return this.s<0?this.t*this.DB:-1}function Le(t){for(var e=0;t!=0;)t&=t-1,++e;return e}function Ve(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=Le(this[i]^e);return t}function ze(t){var e=Math.floor(t/this.DB);return e>=this.t?this.s!=0:(this[e]&1<<t%this.DB)!=0}function je(t,e){var i=r.ONE.shiftLeft(t);return this.bitwiseTo(i,e,i),i}function ke(t){return this.changeBit(t,wt)}function Ue(t){return this.changeBit(t,Nt)}function Ze(t){return this.changeBit(t,Ht)}function _e(t,e){for(var i=0,n=0,u=Math.min(t.t,this.t);i<u;)n+=this[i]+t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n+=t[i],e[i++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[i++]=n:n<-1&&(e[i++]=this.DV+n),e.t=i,e.clamp()}function Xe(t){var e=g();return this.addTo(t,e),e}function $e(t){var e=g();return this.subTo(t,e),e}function Ge(t){var e=g();return this.multiplyTo(t,e),e}function Ye(){var t=g();return this.squareTo(t),t}function Ke(t){var e=g();return this.divRemTo(t,e,null),e}function Je(t){var e=g();return this.divRemTo(t,null,e),e}function We(t){var e=g(),i=g();return this.divRemTo(t,e,i),new Array(e,i)}function Qe(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function ti(t,e){if(t!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function ot(){}function Lt(t){return t}function ei(t,e,i){t.multiplyTo(e,i)}function ii(t,e){t.squareTo(e)}ot.prototype.convert=Lt,ot.prototype.revert=Lt,ot.prototype.mulTo=ei,ot.prototype.sqrTo=ii;function ni(t){return this.exp(t,new ot)}function ri(t,e,i){var n=Math.min(this.t+t.t,e);for(i.s=0,i.t=n;n>0;)i[--n]=0;var u;for(u=i.t-this.t;n<u;++n)i[n+this.t]=this.am(0,t[n],i,n,0,this.t);for(u=Math.min(t.t,e);n<u;++n)this.am(0,t[n],i,n,0,e-n);i.clamp()}function si(t,e,i){--e;var n=i.t=this.t+t.t-e;for(i.s=0;--n>=0;)i[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)i[this.t+n-e]=this.am(e-n,t[n],i,0,0,this.t+n-e);i.clamp(),i.drShiftTo(1,i)}function rt(t){this.r2=g(),this.q3=g(),r.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function oi(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=g();return t.copyTo(e),this.reduce(e),e}function fi(t){return t}function hi(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function ui(t,e){t.squareTo(e),this.reduce(e)}function ci(t,e,i){t.multiplyTo(e,i),this.reduce(i)}rt.prototype.convert=oi,rt.prototype.revert=fi,rt.prototype.reduce=hi,rt.prototype.mulTo=ci,rt.prototype.sqrTo=ui;function li(t,e){var i=t.bitLength(),n,u=x(1),l;if(i<=0)return u;i<18?n=1:i<48?n=3:i<144?n=4:i<768?n=5:n=6,i<8?l=new A(e):e.isEven()?l=new rt(e):l=new nt(e);var T=new Array,F=3,V=n-1,k=(1<<n)-1;if(T[1]=l.convert(this),n>1){var $=g();for(l.sqrTo(T[1],$);F<=k;)T[F]=g(),l.mulTo($,T[F-2],T[F]),F+=2}var X=t.t-1,Q,at=!0,K=g(),J;for(i=q(t[X])-1;X>=0;){for(i>=V?Q=t[X]>>i-V&k:(Q=(t[X]&(1<<i+1)-1)<<V-i,X>0&&(Q|=t[X-1]>>this.DB+i-V)),F=n;(Q&1)==0;)Q>>=1,--F;if((i-=F)<0&&(i+=this.DB,--X),at)T[Q].copyTo(u),at=!1;else{for(;F>1;)l.sqrTo(u,K),l.sqrTo(K,u),F-=2;F>0?l.sqrTo(u,K):(J=u,u=K,K=J),l.mulTo(K,T[Q],u)}for(;X>=0&&(t[X]&1<<i)==0;)l.sqrTo(u,K),J=u,u=K,K=J,--i<0&&(i=this.DB-1,--X)}return l.revert(u)}function ai(t){var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(e.compareTo(i)<0){var n=e;e=i,i=n}var u=e.getLowestSetBit(),l=i.getLowestSetBit();if(l<0)return e;for(u<l&&(l=u),l>0&&(e.rShiftTo(l,e),i.rShiftTo(l,i));e.signum()>0;)(u=e.getLowestSetBit())>0&&e.rShiftTo(u,e),(u=i.getLowestSetBit())>0&&i.rShiftTo(u,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return l>0&&i.lShiftTo(l,i),i}function xi(t){if(t<=0)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(e==0)i=this[0]%t;else for(var n=this.t-1;n>=0;--n)i=(e*i+this[n])%t;return i}function pi(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return r.ZERO;for(var i=t.clone(),n=this.clone(),u=x(1),l=x(0),T=x(0),F=x(1);i.signum()!=0;){for(;i.isEven();)i.rShiftTo(1,i),e?((!u.isEven()||!l.isEven())&&(u.addTo(this,u),l.subTo(t,l)),u.rShiftTo(1,u)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);for(;n.isEven();)n.rShiftTo(1,n),e?((!T.isEven()||!F.isEven())&&(T.addTo(this,T),F.subTo(t,F)),T.rShiftTo(1,T)):F.isEven()||F.subTo(t,F),F.rShiftTo(1,F);i.compareTo(n)>=0?(i.subTo(n,i),e&&u.subTo(T,u),l.subTo(F,l)):(n.subTo(i,n),e&&T.subTo(u,T),F.subTo(l,F))}if(n.compareTo(r.ONE)!=0)return r.ZERO;if(F.compareTo(t)>=0)return F.subtract(t);if(F.signum()<0)F.addTo(t,F);else return F;return F.signum()<0?F.add(t):F}var U=[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],di=(1<<26)/U[U.length-1];function gi(t){var e,i=this.abs();if(i.t==1&&i[0]<=U[U.length-1]){for(e=0;e<U.length;++e)if(i[0]==U[e])return!0;return!1}if(i.isEven())return!1;for(e=1;e<U.length;){for(var n=U[e],u=e+1;u<U.length&&n<di;)n*=U[u++];for(n=i.modInt(n);e<u;)if(n%U[e++]==0)return!1}return i.millerRabin(t)}function mi(t){var e=this.subtract(r.ONE),i=e.getLowestSetBit();if(i<=0)return!1;var n=e.shiftRight(i);t=t+1>>1,t>U.length&&(t=U.length);for(var u=g(),l=0;l<t;++l){u.fromInt(U[Math.floor(Math.random()*U.length)]);var T=u.modPow(n,this);if(T.compareTo(r.ONE)!=0&&T.compareTo(e)!=0){for(var F=1;F++<i&&T.compareTo(e)!=0;)if(T=T.modPowInt(2,this),T.compareTo(r.ONE)==0)return!1;if(T.compareTo(e)!=0)return!1}}return!0}r.prototype.chunkSize=ye,r.prototype.toRadix=be,r.prototype.fromRadix=Te,r.prototype.fromNumber=we,r.prototype.bitwiseTo=qe,r.prototype.changeBit=je,r.prototype.addTo=_e,r.prototype.dMultiply=Qe,r.prototype.dAddOffset=ti,r.prototype.multiplyLowerTo=ri,r.prototype.multiplyUpperTo=si,r.prototype.modInt=xi,r.prototype.millerRabin=mi,r.prototype.clone=pe,r.prototype.intValue=de,r.prototype.byteValue=ge,r.prototype.shortValue=me,r.prototype.signum=ve,r.prototype.toByteArray=Fe,r.prototype.equals=Be,r.prototype.min=Se,r.prototype.max=De,r.prototype.and=Ee,r.prototype.or=Re,r.prototype.xor=Ae,r.prototype.andNot=Pe,r.prototype.not=Me,r.prototype.shiftLeft=Ce,r.prototype.shiftRight=Oe,r.prototype.getLowestSetBit=Ne,r.prototype.bitCount=Ve,r.prototype.testBit=ze,r.prototype.setBit=ke,r.prototype.clearBit=Ue,r.prototype.flipBit=Ze,r.prototype.add=Xe,r.prototype.subtract=$e,r.prototype.multiply=Ge,r.prototype.divide=Ke,r.prototype.remainder=Je,r.prototype.divideAndRemainder=We,r.prototype.modPow=li,r.prototype.modInverse=pi,r.prototype.pow=ni,r.prototype.gcd=ai,r.prototype.isProbablePrime=gi,r.prototype.square=Ye,r.prototype.Barrett=rt;var lt,_,j;function yi(t){_[j++]^=t&255,_[j++]^=t>>8&255,_[j++]^=t>>16&255,_[j++]^=t>>24&255,j>=Bt&&(j-=Bt)}function Vt(){yi(new Date().getTime())}if(_==null){_=new Array,j=0;var Y;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var zt=new Uint8Array(32);for(window.crypto.getRandomValues(zt),Y=0;Y<32;++Y)_[j++]=zt[Y]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var jt=window.crypto.random(32);for(Y=0;Y<jt.length;++Y)_[j++]=jt.charCodeAt(Y)&255}}for(;j<Bt;)Y=Math.floor(65536*Math.random()),_[j++]=Y>>>8,_[j++]=Y&255;j=0,Vt()}function vi(){if(lt==null){for(Vt(),lt=Fi(),lt.init(_),j=0;j<_.length;++j)_[j]=0;j=0}return lt.next()}function bi(t){var e;for(e=0;e<t.length;++e)t[e]=vi()}function kt(){}kt.prototype.nextBytes=bi;function Ft(){this.i=0,this.j=0,this.S=new Array}function Ti(t){var e,i,n;for(e=0;e<256;++e)this.S[e]=e;for(i=0,e=0;e<256;++e)i=i+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[i],this.S[i]=n;this.i=0,this.j=0}function wi(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]}Ft.prototype.init=Ti,Ft.prototype.next=wi;function Fi(){return new Ft}var Bt=256;y.exports={default:r,BigInteger:r,SecureRandom:kt}}).call(Ut)}(tt)),tt.exports}var pt,qt;function Zt(){if(qt)return pt;qt=1;const{BigInteger:y}=ft();function z(b){let p=b.toString(16);if(p[0]!=="-")p.length%2===1?p="0"+p:p.match(/^[0-7]/)||(p="00"+p);else{p=p.substr(1);let d=p.length;d%2===1?d+=1:p.match(/^[0-7]/)||(d+=2);let w="";for(let B=0;B<d;B++)w+="f";w=new y(w,16),p=w.xor(b).add(y.ONE),p=p.toString(16).replace(/^-/,"")}return p}class S{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 p=this.v.length/2;let d=p.toString(16);return d.length%2===1&&(d="0"+d),p<128?d:(128+d.length/2).toString(16)+d}getValue(){return""}}class v extends S{constructor(p){super(),this.t="02",p&&(this.v=z(p))}getValue(){return this.v}}class I extends S{constructor(p){super(),this.t="30",this.asn1Array=p}getValue(){return this.v=this.asn1Array.map(p=>p.getEncodedHex()).join(""),this.v}}function r(b,p){return+b[p+2]<8?1:+b.substr(p+2,2)&128}function g(b,p){const d=r(b,p),w=b.substr(p+2,d*2);return w?(+w[0]<8?new y(w,16):new y(w.substr(2),16)).intValue():-1}function c(b,p){const d=r(b,p);return p+(d+1)*2}return pt={encodeDer(b,p){const d=new v(b),w=new v(p);return new I([d,w]).getEncodedHex()},decodeDer(b){const p=c(b,0),d=c(b,p),w=g(b,p),B=b.substr(d,w*2),E=d+B.length,D=c(b,E),M=g(b,E),f=b.substr(D,M*2),a=new y(B,16),h=new y(f,16);return{r:a,s:h}}},pt}var dt,It;function _t(){if(It)return dt;It=1;const{BigInteger:y}=ft(),z=new y("2"),S=new y("3");class v{constructor(c,b){this.x=b,this.q=c}equals(c){return c===this?!0:this.q.equals(c.q)&&this.x.equals(c.x)}toBigInteger(){return this.x}negate(){return new v(this.q,this.x.negate().mod(this.q))}add(c){return new v(this.q,this.x.add(c.toBigInteger()).mod(this.q))}subtract(c){return new v(this.q,this.x.subtract(c.toBigInteger()).mod(this.q))}multiply(c){return new v(this.q,this.x.multiply(c.toBigInteger()).mod(this.q))}divide(c){return new v(this.q,this.x.multiply(c.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new v(this.q,this.x.square().mod(this.q))}}class I{constructor(c,b,p,d){this.curve=c,this.x=b,this.y=p,this.z=d??y.ONE,this.zinv=null}getX(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}getY(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}equals(c){return c===this?!0:this.isInfinity()?c.isInfinity():c.isInfinity()?this.isInfinity():c.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(c.z)).mod(this.curve.q).equals(y.ZERO)?c.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(c.z)).mod(this.curve.q).equals(y.ZERO):!1}isInfinity(){return this.x===null&&this.y===null?!0:this.z.equals(y.ZERO)&&!this.y.toBigInteger().equals(y.ZERO)}negate(){return new I(this.curve,this.x,this.y.negate(),this.z)}add(c){if(this.isInfinity())return c;if(c.isInfinity())return this;const b=this.x.toBigInteger(),p=this.y.toBigInteger(),d=this.z,w=c.x.toBigInteger(),B=c.y.toBigInteger(),E=c.z,D=this.curve.q,M=b.multiply(E).mod(D),f=w.multiply(d).mod(D),a=M.subtract(f),h=p.multiply(E).mod(D),o=B.multiply(d).mod(D),x=h.subtract(o);if(y.ZERO.equals(a))return y.ZERO.equals(x)?this.twice():this.curve.infinity;const s=M.add(f),m=d.multiply(E).mod(D),R=a.square().mod(D),P=a.multiply(R).mod(D),C=m.multiply(x.square()).subtract(s.multiply(R)).mod(D),N=a.multiply(C).mod(D),q=x.multiply(R.multiply(M).subtract(C)).subtract(h.multiply(P)).mod(D),O=P.multiply(m).mod(D);return new I(this.curve,this.curve.fromBigInteger(N),this.curve.fromBigInteger(q),O)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const c=this.x.toBigInteger(),b=this.y.toBigInteger(),p=this.z,d=this.curve.q,w=this.curve.a.toBigInteger(),B=c.square().multiply(S).add(w.multiply(p.square())).mod(d),E=b.shiftLeft(1).multiply(p).mod(d),D=b.square().mod(d),M=D.multiply(c).multiply(p).mod(d),f=E.square().mod(d),a=B.square().subtract(M.shiftLeft(3)).mod(d),h=E.multiply(a).mod(d),o=B.multiply(M.shiftLeft(2).subtract(a)).subtract(f.shiftLeft(1).multiply(D)).mod(d),x=E.multiply(f).mod(d);return new I(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(o),x)}multiply(c){if(this.isInfinity())return this;if(!c.signum())return this.curve.infinity;const b=c.multiply(S),p=this.negate();let d=this;for(let w=b.bitLength()-2;w>0;w--){d=d.twice();const B=b.testBit(w),E=c.testBit(w);B!==E&&(d=d.add(B?this:p))}return d}}class r{constructor(c,b,p){this.q=c,this.a=this.fromBigInteger(b),this.b=this.fromBigInteger(p),this.infinity=new I(this,null,null)}equals(c){return c===this?!0:this.q.equals(c.q)&&this.a.equals(c.a)&&this.b.equals(c.b)}fromBigInteger(c){return new v(this.q,c)}decodePointHex(c){switch(parseInt(c.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const b=this.fromBigInteger(new y(c.substr(2),16));let p=this.fromBigInteger(b.multiply(b.square()).add(b.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new y("4")).add(y.ONE),this.q));return p.toBigInteger().mod(z).equals(new y(c.substr(0,2),16).subtract(z))||(p=p.negate()),new I(this,b,p);case 4:case 6:case 7:const d=(c.length-2)/2,w=c.substr(2,d),B=c.substr(d+2,d);return new I(this,this.fromBigInteger(new y(w,16)),this.fromBigInteger(new y(B,16)));default:return null}}}return dt={ECPointFp:I,ECCurveFp:r},dt}var gt,Et;function Xt(){if(Et)return gt;Et=1;const{BigInteger:y,SecureRandom:z}=ft(),{ECCurveFp:S}=_t(),v=new z,{curve:I,G:r,n:g}=b();function c(){return I}function b(){const h=new y("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),o=new y("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),x=new y("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),s=new S(h,o,x),P=s.decodePointHex("04"+"32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7"+"BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),C=new y("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16);return{curve:s,G:P,n:C}}function p(h,o,x){const m=(h?new y(h,o,x):new y(g.bitLength(),v)).mod(g.subtract(y.ONE)).add(y.ONE),R=B(m.toString(16),64),P=r.multiply(m),C=B(P.getX().toBigInteger().toString(16),64),N=B(P.getY().toBigInteger().toString(16),64),q="04"+C+N;return{privateKey:R,publicKey:q}}function d(h){if(h.length!==130)throw new Error("Invalid public key to compress");const o=(h.length-2)/2,x=h.substr(2,o),s=new y(h.substr(o+2,o),16);let m="03";return s.mod(new y("2")).equals(y.ZERO)&&(m="02"),m+x}function w(h){h=unescape(encodeURIComponent(h));const o=h.length,x=[];for(let m=0;m<o;m++)x[m>>>2]|=(h.charCodeAt(m)&255)<<24-m%4*8;const s=[];for(let m=0;m<o;m++){const R=x[m>>>2]>>>24-m%4*8&255;s.push((R>>>4).toString(16)),s.push((R&15).toString(16))}return s.join("")}function B(h,o){return h.length>=o?h:new Array(o-h.length+1).join("0")+h}function E(h){return h.map(o=>(o=o.toString(16),o.length===1?"0"+o:o)).join("")}function D(h){const o=[];let x=0;for(let s=0;s<h.length*2;s+=2)o[s>>>3]|=parseInt(h[x],10)<<24-s%8*4,x++;try{const s=[];for(let m=0;m<h.length;m++){const R=o[m>>>2]>>>24-m%4*8&255;s.push(String.fromCharCode(R))}return decodeURIComponent(escape(s.join("")))}catch{throw new Error("Malformed UTF-8 data")}}function M(h){const o=[];let x=h.length;x%2!==0&&(h=B(h,x+1)),x=h.length;for(let s=0;s<x;s+=2)o.push(parseInt(h.substr(s,2),16));return o}function f(h){const o=I.decodePointHex(h);if(!o)return!1;const x=o.getX();return o.getY().square().equals(x.multiply(x.square()).add(x.multiply(I.a)).add(I.b))}function a(h,o){const x=I.decodePointHex(h);if(!x)return!1;const s=I.decodePointHex(o);return s?x.equals(s):!1}return gt={getGlobalCurve:c,generateEcparam:b,generateKeyPairHex:p,compressPublicKeyHex:d,utf8ToHex:w,leftPad:B,arrayToHex:E,arrayToUtf8:D,hexToArray:M,verifyPublicKey:f,comparePublicKeyHex:a},gt}var mt,Rt;function At(){if(Rt)return mt;Rt=1;const y=new Uint32Array(68),z=new Uint32Array(64);function S(w,B){const E=B&31;return w<<E|w>>>32-E}function v(w,B){const E=[];for(let D=w.length-1;D>=0;D--)E[D]=(w[D]^B[D])&255;return E}function I(w){return w^S(w,9)^S(w,17)}function r(w){return w^S(w,15)^S(w,23)}function g(w){let B=w.length*8,E=B%512;E=E>=448?512-E%448-1:448-E-1;const D=new Array((E-7)/8),M=new Array(8);for(let s=0,m=D.length;s<m;s++)D[s]=0;for(let s=0,m=M.length;s<m;s++)M[s]=0;B=B.toString(2);for(let s=7;s>=0;s--)if(B.length>8){const m=B.length-8;M[s]=parseInt(B.substr(m),2),B=B.substr(0,m)}else B.length>0&&(M[s]=parseInt(B,2),B="");const f=new Uint8Array([...w,128,...D,...M]),a=new DataView(f.buffer,0),h=f.length/64,o=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let s=0;s<h;s++){y.fill(0),z.fill(0);const m=16*s;for(let A=0;A<16;A++)y[A]=a.getUint32((m+A)*4,!1);for(let A=16;A<68;A++)y[A]=r(y[A-16]^y[A-9]^S(y[A-3],15))^S(y[A-13],7)^y[A-6];for(let A=0;A<64;A++)z[A]=y[A]^y[A+4];const R=2043430169,P=2055708042;let C=o[0],N=o[1],q=o[2],O=o[3],H=o[4],L=o[5],Z=o[6],W=o[7],G,st,ht,ut,ct;for(let A=0;A<64;A++)ct=A>=0&&A<=15?R:P,G=S(S(C,12)+H+S(ct,A),7),st=G^S(C,12),ht=(A>=0&&A<=15?C^N^q:C&N|C&q|N&q)+O+st+z[A],ut=(A>=0&&A<=15?H^L^Z:H&L|~H&Z)+W+G+y[A],O=q,q=S(N,9),N=C,C=ht,W=Z,Z=S(L,19),L=H,H=I(ut);o[0]^=C,o[1]^=N,o[2]^=q,o[3]^=O,o[4]^=H,o[5]^=L,o[6]^=Z,o[7]^=W}const x=[];for(let s=0,m=o.length;s<m;s++){const R=o[s];x.push((R&4278190080)>>>24,(R&16711680)>>>16,(R&65280)>>>8,R&255)}return x}const c=64,b=new Uint8Array(c),p=new Uint8Array(c);for(let w=0;w<c;w++)b[w]=54,p[w]=92;function d(w,B){for(B.length>c&&(B=g(B));B.length<c;)B.push(0);const E=v(B,b),D=v(B,p),M=g([...E,...w]);return g([...D,...M])}return mt={sm3:g,hmac:d},mt}var yt,Pt;function $t(){if(Pt)return yt;Pt=1;const{BigInteger:y}=ft(),{encodeDer:z,decodeDer:S}=Zt(),v=Xt(),I=At().sm3,{G:r,curve:g,n:c}=v.generateEcparam(),b=0;function p(f,a,h=1){f=typeof f=="string"?v.hexToArray(v.utf8ToHex(f)):Array.prototype.slice.call(f),a=v.getGlobalCurve().decodePointHex(a);const o=v.generateKeyPairHex(),x=new y(o.privateKey,16);let s=o.publicKey;s.length>128&&(s=s.substr(s.length-128));const m=a.multiply(x),R=v.hexToArray(v.leftPad(m.getX().toBigInteger().toRadix(16),64)),P=v.hexToArray(v.leftPad(m.getY().toBigInteger().toRadix(16),64)),C=v.arrayToHex(I([].concat(R,f,P)));let N=1,q=0,O=[];const H=[].concat(R,P),L=()=>{O=I([...H,N>>24&255,N>>16&255,N>>8&255,N&255]),N++,q=0};L();for(let W=0,G=f.length;W<G;W++)q===O.length&&L(),f[W]^=O[q++]&255;const Z=v.arrayToHex(f);return h===b?s+Z+C:s+C+Z}function d(f,a,h=1,{output:o="string"}={}){a=new y(a,16);let x=f.substr(128,64),s=f.substr(192);h===b&&(x=f.substr(f.length-64),s=f.substr(128,f.length-128-64));const m=v.hexToArray(s),P=v.getGlobalCurve().decodePointHex("04"+f.substr(0,128)).multiply(a),C=v.hexToArray(v.leftPad(P.getX().toBigInteger().toRadix(16),64)),N=v.hexToArray(v.leftPad(P.getY().toBigInteger().toRadix(16),64));let q=1,O=0,H=[];const L=[].concat(C,N),Z=()=>{H=I([...L,q>>24&255,q>>16&255,q>>8&255,q&255]),q++,O=0};Z();for(let G=0,st=m.length;G<st;G++)O===H.length&&Z(),m[G]^=H[O++]&255;return v.arrayToHex(I([].concat(C,m,N)))===x.toLowerCase()?o==="array"?m:v.arrayToUtf8(m):o==="array"?[]:""}function w(f,a,{pointPool:h,der:o,hash:x,publicKey:s,userId:m}={}){let R=typeof f=="string"?v.utf8ToHex(f):v.arrayToHex(f);x&&(s=s||D(a),R=E(R,s,m));const P=new y(a,16),C=new y(R,16);let N=null,q=null,O=null;do{do{let H;h&&h.length?H=h.pop():H=M(),N=H.k,q=C.add(H.x1).mod(c)}while(q.equals(y.ZERO)||q.add(N).equals(c));O=P.add(y.ONE).modInverse(c).multiply(N.subtract(q.multiply(P))).mod(c)}while(O.equals(y.ZERO));return o?z(q,O):v.leftPad(q.toString(16),64)+v.leftPad(O.toString(16),64)}function B(f,a,h,{der:o,hash:x,userId:s}={}){let m=typeof f=="string"?v.utf8ToHex(f):v.arrayToHex(f);x&&(m=E(m,h,s));let R,P;if(o){const L=S(a);R=L.r,P=L.s}else R=new y(a.substring(0,64),16),P=new y(a.substring(64),16);const C=g.decodePointHex(h),N=new y(m,16),q=R.add(P).mod(c);if(q.equals(y.ZERO))return!1;const O=r.multiply(P).add(C.multiply(q)),H=N.add(O.getX().toBigInteger()).mod(c);return R.equals(H)}function E(f,a,h="1234567812345678"){h=v.utf8ToHex(h);const o=v.leftPad(r.curve.a.toBigInteger().toRadix(16),64),x=v.leftPad(r.curve.b.toBigInteger().toRadix(16),64),s=v.leftPad(r.getX().toBigInteger().toRadix(16),64),m=v.leftPad(r.getY().toBigInteger().toRadix(16),64);let R,P;if(a.length===128)R=a.substr(0,64),P=a.substr(64,64);else{const O=r.curve.decodePointHex(a);R=v.leftPad(O.getX().toBigInteger().toRadix(16),64),P=v.leftPad(O.getY().toBigInteger().toRadix(16),64)}const C=v.hexToArray(h+o+x+s+m+R+P),N=h.length*4;C.unshift(N&255),C.unshift(N>>8&255);const q=I(C);return v.arrayToHex(I(q.concat(v.hexToArray(f))))}function D(f){const a=r.multiply(new y(f,16)),h=v.leftPad(a.getX().toBigInteger().toString(16),64),o=v.leftPad(a.getY().toBigInteger().toString(16),64);return"04"+h+o}function M(){const f=v.generateKeyPairHex(),a=g.decodePointHex(f.publicKey);return f.k=new y(f.privateKey,16),f.x1=a.getX().toBigInteger(),f}return yt={generateKeyPairHex:v.generateKeyPairHex,compressPublicKeyHex:v.compressPublicKeyHex,comparePublicKeyHex:v.comparePublicKeyHex,doEncrypt:p,doDecrypt:d,doSignature:w,doVerifySignature:B,getPublicKeyFromPrivateKey:D,getPoint:M,verifyPublicKey:v.verifyPublicKey},yt}var vt,Mt;function Gt(){if(Mt)return vt;Mt=1;const{sm3:y,hmac:z}=At();function S(g,c){return g.length>=c?g:new Array(c-g.length+1).join("0")+g}function v(g){return g.map(c=>(c=c.toString(16),c.length===1?"0"+c:c)).join("")}function I(g){const c=[];let b=g.length;b%2!==0&&(g=S(g,b+1)),b=g.length;for(let p=0;p<b;p+=2)c.push(parseInt(g.substr(p,2),16));return c}function r(g){const c=[];for(let b=0,p=g.length;b<p;b++){const d=g.codePointAt(b);if(d<=127)c.push(d);else if(d<=2047)c.push(192|d>>>6),c.push(128|d&63);else if(d<=55295||d>=57344&&d<=65535)c.push(224|d>>>12),c.push(128|d>>>6&63),c.push(128|d&63);else if(d>=65536&&d<=1114111)b++,c.push(240|d>>>18&28),c.push(128|d>>>12&63),c.push(128|d>>>6&63),c.push(128|d&63);else throw c.push(d),new Error("input is not supported")}return c}return vt=function(g,c){if(g=typeof g=="string"?r(g):Array.prototype.slice.call(g),c){if((c.mode||"hmac")!=="hmac")throw new Error("invalid mode");let p=c.key;if(!p)throw new Error("invalid key");return p=typeof p=="string"?I(p):Array.prototype.slice.call(p),v(z(g,p))}return v(y(g))},vt}var bt,Ct;function Yt(){if(Ct)return bt;Ct=1;const y=0,z=32,S=16,v=[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 r(f){const a=[];for(let h=0,o=f.length;h<o;h+=2)a.push(parseInt(f.substr(h,2),16));return a}function g(f){return f.map(a=>(a=a.toString(16),a.length===1?"0"+a:a)).join("")}function c(f){const a=[];for(let h=0,o=f.length;h<o;h++){const x=f.codePointAt(h);if(x<=127)a.push(x);else if(x<=2047)a.push(192|x>>>6),a.push(128|x&63);else if(x<=55295||x>=57344&&x<=65535)a.push(224|x>>>12),a.push(128|x>>>6&63),a.push(128|x&63);else if(x>=65536&&x<=1114111)h++,a.push(240|x>>>18&28),a.push(128|x>>>12&63),a.push(128|x>>>6&63),a.push(128|x&63);else throw a.push(x),new Error("input is not supported")}return a}function b(f){const a=[];for(let h=0,o=f.length;h<o;h++)f[h]>=240&&f[h]<=247?(a.push(String.fromCodePoint(((f[h]&7)<<18)+((f[h+1]&63)<<12)+((f[h+2]&63)<<6)+(f[h+3]&63))),h+=3):f[h]>=224&&f[h]<=239?(a.push(String.fromCodePoint(((f[h]&15)<<12)+((f[h+1]&63)<<6)+(f[h+2]&63))),h+=2):f[h]>=192&&f[h]<=223?(a.push(String.fromCodePoint(((f[h]&31)<<6)+(f[h+1]&63))),h++):a.push(String.fromCodePoint(f[h]));return a.join("")}function p(f,a){const h=a&31;return f<<h|f>>>32-h}function d(f){return(v[f>>>24&255]&255)<<24|(v[f>>>16&255]&255)<<16|(v[f>>>8&255]&255)<<8|v[f&255]&255}function w(f){return f^p(f,2)^p(f,10)^p(f,18)^p(f,24)}function B(f){return f^p(f,13)^p(f,23)}function E(f,a,h){const o=new Array(4),x=new Array(4);for(let s=0;s<4;s++)x[0]=f[4*s]&255,x[1]=f[4*s+1]&255,x[2]=f[4*s+2]&255,x[3]=f[4*s+3]&255,o[s]=x[0]<<24|x[1]<<16|x[2]<<8|x[3];for(let s=0,m;s<32;s+=4)m=o[1]^o[2]^o[3]^h[s+0],o[0]^=w(d(m)),m=o[2]^o[3]^o[0]^h[s+1],o[1]^=w(d(m)),m=o[3]^o[0]^o[1]^h[s+2],o[2]^=w(d(m)),m=o[0]^o[1]^o[2]^h[s+3],o[3]^=w(d(m));for(let s=0;s<16;s+=4)a[s]=o[3-s/4]>>>24&255,a[s+1]=o[3-s/4]>>>16&255,a[s+2]=o[3-s/4]>>>8&255,a[s+3]=o[3-s/4]&255}function D(f,a,h){const o=new Array(4),x=new Array(4);for(let s=0;s<4;s++)x[0]=f[0+4*s]&255,x[1]=f[1+4*s]&255,x[2]=f[2+4*s]&255,x[3]=f[3+4*s]&255,o[s]=x[0]<<24|x[1]<<16|x[2]<<8|x[3];o[0]^=2746333894,o[1]^=1453994832,o[2]^=1736282519,o[3]^=2993693404;for(let s=0,m;s<32;s+=4)m=o[1]^o[2]^o[3]^I[s+0],a[s+0]=o[0]^=B(d(m)),m=o[2]^o[3]^o[0]^I[s+1],a[s+1]=o[1]^=B(d(m)),m=o[3]^o[0]^o[1]^I[s+2],a[s+2]=o[2]^=B(d(m)),m=o[0]^o[1]^o[2]^I[s+3],a[s+3]=o[3]^=B(d(m));if(h===y)for(let s=0,m;s<16;s++)m=a[s],a[s]=a[31-s],a[31-s]=m}function M(f,a,h,{padding:o="pkcs#7",mode:x,iv:s=[],output:m="string"}={}){if(x==="cbc"&&(typeof s=="string"&&(s=r(s)),s.length!==128/8))throw new Error("iv is invalid");if(typeof a=="string"&&(a=r(a)),a.length!==128/8)throw new Error("key is invalid");if(typeof f=="string"?h!==y?f=c(f):f=r(f):f=[...f],(o==="pkcs#5"||o==="pkcs#7")&&h!==y){const O=S-f.length%S;for(let H=0;H<O;H++)f.push(O)}const R=new Array(z);D(a,R,h);const P=[];let C=s,N=f.length,q=0;for(;N>=S;){const O=f.slice(q,q+16),H=new Array(16);if(x==="cbc")for(let L=0;L<S;L++)h!==y&&(O[L]^=C[L]);E(O,H,R);for(let L=0;L<S;L++)x==="cbc"&&h===y&&(H[L]^=C[L]),P[q+L]=H[L];x==="cbc"&&(h!==y?C=H:C=O),N-=S,q+=S}if((o==="pkcs#5"||o==="pkcs#7")&&h===y){const O=P.length,H=P[O-1];for(let L=1;L<=H;L++)if(P[O-L]!==H)throw new Error("padding is invalid");P.splice(O-H,H)}return m!=="array"?h!==y?g(P):b(P):P}return bt={encrypt(f,a,h){return M(f,a,1,h)},decrypt(f,a,h){return M(f,a,0,h)}},bt}var Tt,Ot;function Kt(){return Ot||(Ot=1,Tt={sm2:$t(),sm3:Gt(),sm4:Yt()}),Tt}var Jt=Kt();function Wt({uid:y="",salt:z="",ts:S=0,data:v}){const I=Date.now()+S,r=Math.random().toString(36).substring(2,15),g=typeof v=="object"?JSON.stringify(v??{}):v??"",c=`${I}${y}${r}${g}${z}`,b=Jt.sm3(c);return{headers:{"X-Sign-Timestamp":String(I),"X-Sign-Nonce":r,"X-Sign-Client":b}}}function Qt(y){const z=["script","iframe","object","embed","link","meta","style"],S=["onerror","onload","onclick","onmouseover","onfocus","onmouseenter","onmouseleave"],v=b=>/^javascript:/i.test(b)||/^data:text\/html/i.test(b),r=new DOMParser().parseFromString(`<div>${y}</div>`,"text/html"),g=r.body.firstChild;function c(b){if(b.nodeType===Node.ELEMENT_NODE){const p=b,d=p.tagName.toLowerCase();if(z.includes(d)){const w=p.outerHTML,B=r.createTextNode(w);p.replaceWith(B);return}[...p.attributes].forEach(w=>{const B=w.name.toLowerCase(),E=w.value;(S.includes(B)||v(E))&&p.removeAttribute(w.name)}),[...p.childNodes].forEach(c)}}return[...g.childNodes].forEach(c),g.innerHTML}it.htmlSanitize=Qt,it.transmissionDataEncryption=Wt,Object.defineProperty(it,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "module-develop-kit",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "前端项目通用工具包",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",