@skip-go/widget-web-component 3.12.10 → 3.13.0
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/build/1934.index.js +2 -0
- package/build/5902.index.js +2 -0
- package/build/6700.index.js +1 -1
- package/build/8780.index.js +1 -0
- package/build/index.js +72 -72
- package/build/index.js.LICENSE.txt +0 -48
- package/package.json +1 -1
- package/build/2098.index.js +0 -2
- package/build/352.index.js +0 -1
- package/build/8226.index.js +0 -2
- /package/build/{2098.index.js.LICENSE.txt → 1934.index.js.LICENSE.txt} +0 -0
- /package/build/{8226.index.js.LICENSE.txt → 5902.index.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 5902.index.js.LICENSE.txt */
|
|
2
|
+
export const __webpack_id__=5902;export const __webpack_ids__=[5902];export const __webpack_modules__={65902:(t,e,n)=>{n.d(e,{secp256k1:()=>Ct});var r={};n.r(r),n.d(r,{aK:()=>z,e8:()=>b,DO:()=>E,dJ:()=>F,OG:()=>P,My:()=>v,Ph:()=>q,lX:()=>R,Id:()=>C,fg:()=>T,qj:()=>H,aT:()=>I,r4:()=>k,aY:()=>m,x:()=>j,lq:()=>N,z:()=>L,zW:()=>x,Q5:()=>D});var o=n(39074),i=n(5143);function s(t,e,n){return t&e^t&n^e&n}class f extends i.Vw{constructor(t,e,n,r){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,i.O8)(this.buffer)}update(t){(0,o.CC)(this);const{view:e,buffer:n,blockLen:r}=this,s=(t=(0,i.ZJ)(t)).length;for(let o=0;o<s;){const f=Math.min(r-this.pos,s-o);if(f!==r)n.set(t.subarray(o,o+f),this.pos),this.pos+=f,o+=f,this.pos===r&&(this.process(e,0),this.pos=0);else{const e=(0,i.O8)(t);for(;r<=s-o;o+=r)this.process(e,o)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,o.CC)(this),(0,o.Ht)(t,this),this.finished=!0;const{buffer:e,view:n,blockLen:r,isLE:s}=this;let{pos:f}=this;e[f++]=128,this.buffer.subarray(f).fill(0),this.padOffset>r-f&&(this.process(n,0),f=0);for(let t=f;t<r;t++)e[t]=0;!function(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const o=BigInt(32),i=BigInt(4294967295),s=Number(n>>o&i),f=Number(n&i),a=r?4:0,c=r?0:4;t.setUint32(e+a,s,r),t.setUint32(e+c,f,r)}(n,r-8,BigInt(8*this.length),s),this.process(n,0);const a=(0,i.O8)(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=c/4,h=this.get();if(u>h.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<u;t++)a.setUint32(4*t,h[t],s)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:n,length:r,finished:o,destroyed:i,pos:s}=this;return t.length=r,t.pos=s,t.finished=o,t.destroyed=i,r%e&&t.buffer.set(n),t}}const a=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),c=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=new Uint32Array(64);class h extends f{constructor(){super(64,32,8,!1),this.A=0|c[0],this.B=0|c[1],this.C=0|c[2],this.D=0|c[3],this.E=0|c[4],this.F=0|c[5],this.G=0|c[6],this.H=0|c[7]}get(){const{A:t,B:e,C:n,D:r,E:o,F:i,G:s,H:f}=this;return[t,e,n,r,o,i,s,f]}set(t,e,n,r,o,i,s,f){this.A=0|t,this.B=0|e,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|f}process(t,e){for(let n=0;n<16;n++,e+=4)u[n]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=u[t-15],n=u[t-2],r=(0,i.Ow)(e,7)^(0,i.Ow)(e,18)^e>>>3,o=(0,i.Ow)(n,17)^(0,i.Ow)(n,19)^n>>>10;u[t]=o+u[t-7]+r+u[t-16]|0}let{A:n,B:r,C:o,D:f,E:c,F:h,G:l,H:d}=this;for(let t=0;t<64;t++){const e=d+((0,i.Ow)(c,6)^(0,i.Ow)(c,11)^(0,i.Ow)(c,25))+((w=c)&h^~w&l)+a[t]+u[t]|0,g=((0,i.Ow)(n,2)^(0,i.Ow)(n,13)^(0,i.Ow)(n,22))+s(n,r,o)|0;d=l,l=h,h=c,c=f+e|0,f=o,o=r,r=n,n=e+g|0}var w;n=n+this.A|0,r=r+this.B|0,o=o+this.C|0,f=f+this.D|0,c=c+this.E|0,h=h+this.F|0,l=l+this.G|0,d=d+this.H|0,this.set(n,r,o,f,c,h,l,d)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const l=(0,i.ld)((()=>new h));class d extends i.Vw{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,o.sd)(t);const n=(0,i.ZJ)(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,s=new Uint8Array(r);s.set(n.length>r?t.create().update(n).digest():n);for(let t=0;t<s.length;t++)s[t]^=54;this.iHash.update(s),this.oHash=t.create();for(let t=0;t<s.length;t++)s[t]^=106;this.oHash.update(s),s.fill(0)}update(t){return(0,o.CC)(this),this.iHash.update(t),this}digestInto(t){(0,o.CC)(this),(0,o.DO)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:o,blockLen:i,outputLen:s}=this;return t.finished=r,t.destroyed=o,t.blockLen=i,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const w=(t,e,n)=>new d(t,e).update(n).digest();w.create=(t,e)=>new d(t,e);const g=BigInt(0),p=BigInt(1),y=BigInt(2);function m(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function E(t){if(!m(t))throw new Error("Uint8Array expected")}function b(t,e){if("boolean"!=typeof e)throw new Error(t+" boolean expected, got "+e)}const B=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function v(t){E(t);let e="";for(let n=0;n<t.length;n++)e+=B[t[n]];return e}function x(t){const e=t.toString(16);return 1&e.length?"0"+e:e}function S(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?g:BigInt("0x"+t)}const A={_0:48,_9:57,A:65,F:70,a:97,f:102};function O(t){return t>=A._0&&t<=A._9?t-A._0:t>=A.A&&t<=A.F?t-(A.A-10):t>=A.a&&t<=A.f?t-(A.a-10):void 0}function I(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let e=0,o=0;e<n;e++,o+=2){const n=O(t.charCodeAt(o)),i=O(t.charCodeAt(o+1));if(void 0===n||void 0===i){const e=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+o)}r[e]=16*n+i}return r}function q(t){return S(v(t))}function R(t){return E(t),S(v(Uint8Array.from(t).reverse()))}function N(t,e){return I(t.toString(16).padStart(2*e,"0"))}function L(t,e){return N(t,e).reverse()}function H(t,e,n){let r;if("string"==typeof e)try{r=I(e)}catch(e){throw new Error(t+" must be hex string or Uint8Array, cause: "+e)}else{if(!m(e))throw new Error(t+" must be hex string or Uint8Array");r=Uint8Array.from(e)}const o=r.length;if("number"==typeof n&&o!==n)throw new Error(t+" of length "+n+" expected, got "+o);return r}function C(...t){let e=0;for(let n=0;n<t.length;n++){const r=t[n];E(r),e+=r.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const o=t[e];n.set(o,r),r+=o.length}return n}const U=t=>"bigint"==typeof t&&g<=t;function k(t,e,n){return U(t)&&U(e)&&U(n)&&e<=t&&t<n}function z(t,e,n,r){if(!k(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function F(t){let e;for(e=0;t>g;t>>=p,e+=1);return e}const P=t=>(y<<BigInt(t-1))-p,_=t=>new Uint8Array(t),Z=t=>Uint8Array.from(t);function T(t,e,n){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=_(t),o=_(t),i=0;const s=()=>{r.fill(1),o.fill(0),i=0},f=(...t)=>n(o,r,...t),a=(t=_())=>{o=f(Z([0]),t),r=f(),0!==t.length&&(o=f(Z([1]),t),r=f())},c=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const n=[];for(;t<e;){r=f();const e=r.slice();n.push(e),t+=r.length}return C(...n)};return(t,e)=>{let n;for(s(),a(t);!(n=e(c()));)a();return s(),n}}const V={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||m(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function D(t,e,n={}){const r=(e,n,r)=>{const o=V[n];if("function"!=typeof o)throw new Error("invalid validator function");const i=t[e];if(!(r&&void 0===i||o(i,t)))throw new Error("param "+String(e)+" is invalid. Expected "+n+", got "+i)};for(const[t,n]of Object.entries(e))r(t,n,!1);for(const[t,e]of Object.entries(n))r(t,e,!0);return t}function j(t){const e=new WeakMap;return(n,...r)=>{const o=e.get(n);if(void 0!==o)return o;const i=t(n,...r);return e.set(n,i),i}}const K=BigInt(0),M=BigInt(1),G=BigInt(2),W=BigInt(3),Y=BigInt(4),J=BigInt(5),Q=BigInt(8);function X(t,e){const n=t%e;return n>=K?n:e+n}function $(t,e,n){if(e<K)throw new Error("invalid exponent, negatives unsupported");if(n<=K)throw new Error("invalid modulus");if(n===M)return K;let r=M;for(;e>K;)e&M&&(r=r*t%n),t=t*t%n,e>>=M;return r}function tt(t,e,n){let r=t;for(;e-- >K;)r*=r,r%=n;return r}function et(t,e){if(t===K)throw new Error("invert: expected non-zero number");if(e<=K)throw new Error("invert: expected positive modulus, got "+e);let n=X(t,e),r=e,o=K,i=M,s=M,f=K;for(;n!==K;){const t=r/n,e=r%n,a=o-s*t,c=i-f*t;r=n,n=e,o=s,i=f,s=a,f=c}if(r!==M)throw new Error("invert: does not exist");return X(o,e)}const nt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function rt(t,e){const n=void 0!==e?e:t.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function ot(t,e,n=!1,r={}){if(t<=K)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:o,nByteLength:i}=rt(t,e);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const f=Object.freeze({ORDER:t,isLE:n,BITS:o,BYTES:i,MASK:P(o),ZERO:K,ONE:M,create:e=>X(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return K<=e&&e<t},is0:t=>t===K,isOdd:t=>(t&M)===M,neg:e=>X(-e,t),eql:(t,e)=>t===e,sqr:e=>X(e*e,t),add:(e,n)=>X(e+n,t),sub:(e,n)=>X(e-n,t),mul:(e,n)=>X(e*n,t),pow:(t,e)=>function(t,e,n){if(n<K)throw new Error("invalid exponent, negatives unsupported");if(n===K)return t.ONE;if(n===M)return e;let r=t.ONE,o=e;for(;n>K;)n&M&&(r=t.mul(r,o)),o=t.sqr(o),n>>=M;return r}(f,t,e),div:(e,n)=>X(e*et(n,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>et(e,t),sqrt:r.sqrt||(e=>(s||(s=function(t){if(t%Y===W){const e=(t+M)/Y;return function(t,n){const r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}}if(t%Q===J){const e=(t-J)/Q;return function(t,n){const r=t.mul(n,G),o=t.pow(r,e),i=t.mul(n,o),s=t.mul(t.mul(i,G),o),f=t.mul(i,t.sub(s,t.ONE));if(!t.eql(t.sqr(f),n))throw new Error("Cannot find square root");return f}}return function(t){const e=(t-M)/G;let n,r,o;for(n=t-M,r=0;n%G===K;n/=G,r++);for(o=G;o<t&&$(o,e,t)!==t-M;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===r){const e=(t+M)/Y;return function(t,n){const r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}}const i=(n+M)/G;return function(t,s){if(t.pow(s,e)===t.neg(t.ONE))throw new Error("Cannot find square root");let f=r,a=t.pow(t.mul(t.ONE,o),n),c=t.pow(s,i),u=t.pow(s,n);for(;!t.eql(u,t.ONE);){if(t.eql(u,t.ZERO))return t.ZERO;let e=1;for(let n=t.sqr(u);e<f&&!t.eql(n,t.ONE);e++)n=t.sqr(n);const n=t.pow(a,M<<BigInt(f-e-1));a=t.sqr(n),c=t.mul(c,n),u=t.mul(u,a),f=e}return c}}(t)}(t)),s(f,e))),invertBatch:t=>function(t,e){const n=new Array(e.length),r=e.reduce(((e,r,o)=>t.is0(r)?e:(n[o]=e,t.mul(e,r))),t.ONE),o=t.inv(r);return e.reduceRight(((e,r,o)=>t.is0(r)?e:(n[o]=t.mul(e,n[o]),t.mul(e,r))),o),n}(f,t),cmov:(t,e,n)=>n?e:t,toBytes:t=>n?L(t,i):N(t,i),fromBytes:t=>{if(t.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);return n?R(t):q(t)}});return Object.freeze(f)}function it(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function st(t){const e=it(t);return e+Math.ceil(e/2)}const ft=BigInt(0),at=BigInt(1);function ct(t,e){const n=e.negate();return t?n:e}function ut(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function ht(t,e){return ut(t,e),{windows:Math.ceil(e/t)+1,windowSize:2**(t-1)}}const lt=new WeakMap,dt=new WeakMap;function wt(t){return dt.get(t)||1}function gt(t){return D(t.Fp,nt.reduce(((t,e)=>(t[e]="function",t)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),D(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...rt(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}function pt(t){void 0!==t.lowS&&b("lowS",t.lowS),void 0!==t.prehash&&b("prehash",t.prehash)}const{Ph:yt,aT:mt}=r;class Et extends Error{constructor(t=""){super(t)}}const bt={Err:Et,_tlv:{encode:(t,e)=>{const{Err:n}=bt;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(1&e.length)throw new n("tlv.encode: unpadded data");const r=e.length/2,o=x(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const i=r>127?x(o.length/2|128):"";return x(t)+i+o+e},decode(t,e){const{Err:n}=bt;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const o=e[r++];let i=0;if(128&o){const t=127&o;if(!t)throw new n("tlv.decode(long): indefinite length not supported");if(t>4)throw new n("tlv.decode(long): byte length is too big");const s=e.subarray(r,r+t);if(s.length!==t)throw new n("tlv.decode: length bytes not complete");if(0===s[0])throw new n("tlv.decode(long): zero leftmost byte");for(const t of s)i=i<<8|t;if(r+=t,i<128)throw new n("tlv.decode(long): not minimal encoding")}else i=o;const s=e.subarray(r,r+i);if(s.length!==i)throw new n("tlv.decode: wrong value length");return{v:s,l:e.subarray(r+i)}}},_int:{encode(t){const{Err:e}=bt;if(t<Bt)throw new e("integer: negative integers are not allowed");let n=x(t);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=bt;if(128&t[0])throw new e("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new e("invalid signature integer: unnecessary leading zero");return yt(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=bt,o="string"==typeof t?mt(t):t;E(o);const{v:i,l:s}=r.decode(48,o);if(s.length)throw new e("invalid signature: left bytes after parsing");const{v:f,l:a}=r.decode(2,i),{v:c,l:u}=r.decode(2,a);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(f),s:n.decode(c)}},hexFromSig(t){const{_tlv:e,_int:n}=bt,r=e.encode(2,n.encode(t.r))+e.encode(2,n.encode(t.s));return e.encode(48,r)}},Bt=BigInt(0),vt=BigInt(1),xt=(BigInt(2),BigInt(3));function St(t){const e=function(t){const e=gt(t);D(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:o}=e;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}(t),{Fp:n}=e,r=ot(e.n,e.nBitLength),o=e.toBytes||((t,e,r)=>{const o=e.toAffine();return C(Uint8Array.from([4]),n.toBytes(o.x),n.toBytes(o.y))}),i=e.fromBytes||(t=>{const e=t.subarray(1);return{x:n.fromBytes(e.subarray(0,n.BYTES)),y:n.fromBytes(e.subarray(n.BYTES,2*n.BYTES))}});function s(t){const{a:r,b:o}=e,i=n.sqr(t),s=n.mul(i,t);return n.add(n.add(s,n.mul(t,r)),o)}if(!n.eql(n.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function f(t){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:o,n:i}=e;if(n&&"bigint"!=typeof t){if(m(t)&&(t=v(t)),"string"!=typeof t||!n.includes(t.length))throw new Error("invalid private key");t=t.padStart(2*r,"0")}let s;try{s="bigint"==typeof t?t:q(H("private key",t,r))}catch(e){throw new Error("invalid private key, expected hex or "+r+" bytes, got "+typeof t)}return o&&(s=X(s,i)),z("private key",s,vt,i),s}function a(t){if(!(t instanceof h))throw new Error("ProjectivePoint expected")}const c=j(((t,e)=>{const{px:r,py:o,pz:i}=t;if(n.eql(i,n.ONE))return{x:r,y:o};const s=t.is0();null==e&&(e=s?n.ONE:n.inv(i));const f=n.mul(r,e),a=n.mul(o,e),c=n.mul(i,e);if(s)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw new Error("invZ was invalid");return{x:f,y:a}})),u=j((t=>{if(t.is0()){if(e.allowInfinityPoint&&!n.is0(t.py))return;throw new Error("bad point: ZERO")}const{x:r,y:o}=t.toAffine();if(!n.isValid(r)||!n.isValid(o))throw new Error("bad point: x or y not FE");const i=n.sqr(o),f=s(r);if(!n.eql(i,f))throw new Error("bad point: equation left != right");if(!t.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0}));class h{constructor(t,e,r){if(this.px=t,this.py=e,this.pz=r,null==t||!n.isValid(t))throw new Error("x required");if(null==e||!n.isValid(e))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required");Object.freeze(this)}static fromAffine(t){const{x:e,y:r}=t||{};if(!t||!n.isValid(e)||!n.isValid(r))throw new Error("invalid affine point");if(t instanceof h)throw new Error("projective point not allowed");const o=t=>n.eql(t,n.ZERO);return o(e)&&o(r)?h.ZERO:new h(e,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){const e=n.invertBatch(t.map((t=>t.pz)));return t.map(((t,n)=>t.toAffine(e[n]))).map(h.fromAffine)}static fromHex(t){const e=h.fromAffine(i(H("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return h.BASE.multiply(f(t))}static msm(t,e){return function(t,e,n,r){if(function(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach(((t,n)=>{if(!(t instanceof e))throw new Error("invalid point at index "+n)}))}(n,t),function(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach(((t,n)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+n)}))}(r,e),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,i=F(BigInt(n.length)),s=i>12?i-3:i>4?i-2:i?2:1,f=(1<<s)-1,a=new Array(f+1).fill(o);let c=o;for(let t=Math.floor((e.BITS-1)/s)*s;t>=0;t-=s){a.fill(o);for(let e=0;e<r.length;e++){const o=r[e],i=Number(o>>BigInt(t)&BigInt(f));a[i]=a[i].add(n[e])}let e=o;for(let t=a.length-1,n=o;t>0;t--)n=n.add(a[t]),e=e.add(n);if(c=c.add(e),0!==t)for(let t=0;t<s;t++)c=c.double()}return c}(h,r,t,e)}_setWindowSize(t){d.setWindowSize(this,t)}assertValidity(){u(this)}hasEvenY(){const{y:t}=this.toAffine();if(n.isOdd)return!n.isOdd(t);throw new Error("Field doesn't support isOdd")}equals(t){a(t);const{px:e,py:r,pz:o}=this,{px:i,py:s,pz:f}=t,c=n.eql(n.mul(e,f),n.mul(i,o)),u=n.eql(n.mul(r,f),n.mul(s,o));return c&&u}negate(){return new h(this.px,n.neg(this.py),this.pz)}double(){const{a:t,b:r}=e,o=n.mul(r,xt),{px:i,py:s,pz:f}=this;let a=n.ZERO,c=n.ZERO,u=n.ZERO,l=n.mul(i,i),d=n.mul(s,s),w=n.mul(f,f),g=n.mul(i,s);return g=n.add(g,g),u=n.mul(i,f),u=n.add(u,u),a=n.mul(t,u),c=n.mul(o,w),c=n.add(a,c),a=n.sub(d,c),c=n.add(d,c),c=n.mul(a,c),a=n.mul(g,a),u=n.mul(o,u),w=n.mul(t,w),g=n.sub(l,w),g=n.mul(t,g),g=n.add(g,u),u=n.add(l,l),l=n.add(u,l),l=n.add(l,w),l=n.mul(l,g),c=n.add(c,l),w=n.mul(s,f),w=n.add(w,w),l=n.mul(w,g),a=n.sub(a,l),u=n.mul(w,d),u=n.add(u,u),u=n.add(u,u),new h(a,c,u)}add(t){a(t);const{px:r,py:o,pz:i}=this,{px:s,py:f,pz:c}=t;let u=n.ZERO,l=n.ZERO,d=n.ZERO;const w=e.a,g=n.mul(e.b,xt);let p=n.mul(r,s),y=n.mul(o,f),m=n.mul(i,c),E=n.add(r,o),b=n.add(s,f);E=n.mul(E,b),b=n.add(p,y),E=n.sub(E,b),b=n.add(r,i);let B=n.add(s,c);return b=n.mul(b,B),B=n.add(p,m),b=n.sub(b,B),B=n.add(o,i),u=n.add(f,c),B=n.mul(B,u),u=n.add(y,m),B=n.sub(B,u),d=n.mul(w,b),u=n.mul(g,m),d=n.add(u,d),u=n.sub(y,d),d=n.add(y,d),l=n.mul(u,d),y=n.add(p,p),y=n.add(y,p),m=n.mul(w,m),b=n.mul(g,b),y=n.add(y,m),m=n.sub(p,m),m=n.mul(w,m),b=n.add(b,m),p=n.mul(y,b),l=n.add(l,p),p=n.mul(B,b),u=n.mul(E,u),u=n.sub(u,p),p=n.mul(E,y),d=n.mul(B,d),d=n.add(d,p),new h(u,l,d)}subtract(t){return this.add(t.negate())}is0(){return this.equals(h.ZERO)}wNAF(t){return d.wNAFCached(this,t,h.normalizeZ)}multiplyUnsafe(t){const{endo:r,n:o}=e;z("scalar",t,Bt,o);const i=h.ZERO;if(t===Bt)return i;if(this.is0()||t===vt)return this;if(!r||d.hasPrecomputes(this))return d.wNAFCachedUnsafe(this,t,h.normalizeZ);let{k1neg:s,k1:f,k2neg:a,k2:c}=r.splitScalar(t),u=i,l=i,w=this;for(;f>Bt||c>Bt;)f&vt&&(u=u.add(w)),c&vt&&(l=l.add(w)),w=w.double(),f>>=vt,c>>=vt;return s&&(u=u.negate()),a&&(l=l.negate()),l=new h(n.mul(l.px,r.beta),l.py,l.pz),u.add(l)}multiply(t){const{endo:r,n:o}=e;let i,s;if(z("scalar",t,vt,o),r){const{k1neg:e,k1:o,k2neg:f,k2:a}=r.splitScalar(t);let{p:c,f:u}=this.wNAF(o),{p:l,f:w}=this.wNAF(a);c=d.constTimeNegate(e,c),l=d.constTimeNegate(f,l),l=new h(n.mul(l.px,r.beta),l.py,l.pz),i=c.add(l),s=u.add(w)}else{const{p:e,f:n}=this.wNAF(t);i=e,s=n}return h.normalizeZ([i,s])[0]}multiplyAndAddUnsafe(t,e,n){const r=h.BASE,o=(t,e)=>e!==Bt&&e!==vt&&t.equals(r)?t.multiply(e):t.multiplyUnsafe(e),i=o(this,e).add(o(t,n));return i.is0()?void 0:i}toAffine(t){return c(this,t)}isTorsionFree(){const{h:t,isTorsionFree:n}=e;if(t===vt)return!0;if(n)return n(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:t,clearCofactor:n}=e;return t===vt?this:n?n(h,this):this.multiplyUnsafe(e.h)}toRawBytes(t=!0){return b("isCompressed",t),this.assertValidity(),o(h,this,t)}toHex(t=!0){return b("isCompressed",t),v(this.toRawBytes(t))}}h.BASE=new h(e.Gx,e.Gy,n.ONE),h.ZERO=new h(n.ZERO,n.ONE,n.ZERO);const l=e.nBitLength,d=(w=h,g=e.endo?Math.ceil(l/2):l,{constTimeNegate:ct,hasPrecomputes:t=>1!==wt(t),unsafeLadder(t,e,n=w.ZERO){let r=t;for(;e>ft;)e&at&&(n=n.add(r)),r=r.double(),e>>=at;return n},precomputeWindow(t,e){const{windows:n,windowSize:r}=ht(e,g),o=[];let i=t,s=i;for(let t=0;t<n;t++){s=i,o.push(s);for(let t=1;t<r;t++)s=s.add(i),o.push(s);i=s.double()}return o},wNAF(t,e,n){const{windows:r,windowSize:o}=ht(t,g);let i=w.ZERO,s=w.BASE;const f=BigInt(2**t-1),a=2**t,c=BigInt(t);for(let t=0;t<r;t++){const r=t*o;let u=Number(n&f);n>>=c,u>o&&(u-=a,n+=at);const h=r,l=r+Math.abs(u)-1,d=t%2!=0,w=u<0;0===u?s=s.add(ct(d,e[h])):i=i.add(ct(w,e[l]))}return{p:i,f:s}},wNAFUnsafe(t,e,n,r=w.ZERO){const{windows:o,windowSize:i}=ht(t,g),s=BigInt(2**t-1),f=2**t,a=BigInt(t);for(let t=0;t<o;t++){const o=t*i;if(n===ft)break;let c=Number(n&s);if(n>>=a,c>i&&(c-=f,n+=at),0===c)continue;let u=e[o+Math.abs(c)-1];c<0&&(u=u.negate()),r=r.add(u)}return r},getPrecomputes(t,e,n){let r=lt.get(e);return r||(r=this.precomputeWindow(e,t),1!==t&<.set(e,n(r))),r},wNAFCached(t,e,n){const r=wt(t);return this.wNAF(r,this.getPrecomputes(r,t,n),e)},wNAFCachedUnsafe(t,e,n,r){const o=wt(t);return 1===o?this.unsafeLadder(t,e,r):this.wNAFUnsafe(o,this.getPrecomputes(o,t,n),e,r)},setWindowSize(t,e){ut(e,g),dt.set(t,e),lt.delete(t)}});var w,g;return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:f,weierstrassEquation:s,isWithinCurveOrder:function(t){return k(t,vt,e.n)}}}function At(t){const e=function(t){const e=gt(t);return D(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:n,n:r}=e,o=n.BYTES+1,i=2*n.BYTES+1;function s(t){return X(t,r)}function f(t){return et(t,r)}const{ProjectivePoint:a,normPrivateKeyToScalar:c,weierstrassEquation:u,isWithinCurveOrder:h}=St({...e,toBytes(t,e,r){const o=e.toAffine(),i=n.toBytes(o.x),s=C;return b("isCompressed",r),r?s(Uint8Array.from([e.hasEvenY()?2:3]),i):s(Uint8Array.from([4]),i,n.toBytes(o.y))},fromBytes(t){const e=t.length,r=t[0],s=t.subarray(1);if(e!==o||2!==r&&3!==r){if(e===i&&4===r)return{x:n.fromBytes(s.subarray(0,n.BYTES)),y:n.fromBytes(s.subarray(n.BYTES,2*n.BYTES))};throw new Error("invalid Point, expected length of "+o+", or uncompressed "+i+", got "+e)}{const t=q(s);if(!k(t,vt,n.ORDER))throw new Error("Point is not on curve");const e=u(t);let o;try{o=n.sqrt(e)}catch(t){const e=t instanceof Error?": "+t.message:"";throw new Error("Point is not on curve"+e)}return!(1&~r)!=((o&vt)===vt)&&(o=n.neg(o)),{x:t,y:o}}}}),l=t=>v(N(t,e.nByteLength));function d(t){return t>r>>vt}const w=(t,e,n)=>q(t.slice(e,n));class g{constructor(t,e,n){this.r=t,this.s=e,this.recovery=n,this.assertValidity()}static fromCompact(t){const n=e.nByteLength;return t=H("compactSignature",t,2*n),new g(w(t,0,n),w(t,n,2*n))}static fromDER(t){const{r:e,s:n}=bt.toSig(H("DER",t));return new g(e,n)}assertValidity(){z("r",this.r,vt,r),z("s",this.s,vt,r)}addRecoveryBit(t){return new g(this.r,this.s,t)}recoverPublicKey(t){const{r,s:o,recovery:i}=this,c=B(H("msgHash",t));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const u=2===i||3===i?r+e.n:r;if(u>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const h=1&i?"03":"02",d=a.fromHex(h+l(u)),w=f(u),g=s(-c*w),p=s(o*w),y=a.BASE.multiplyAndAddUnsafe(d,g,p);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return I(this.toDERHex())}toDERHex(){return bt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return I(this.toCompactHex())}toCompactHex(){return l(this.r)+l(this.s)}}const p={isValidPrivateKey(t){try{return c(t),!0}catch(t){return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const t=st(e.n);return function(t,e,n=!1){const r=t.length,o=it(e),i=st(e);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const s=X(n?R(t):q(t),e-M)+M;return n?L(s,o):N(s,o)}(e.randomBytes(t),e.n)},precompute:(t=8,e=a.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)};function y(t){const e=m(t),n="string"==typeof t,r=(e||n)&&t.length;return e?r===o||r===i:n?r===2*o||r===2*i:t instanceof a}const E=e.bits2int||function(t){if(t.length>8192)throw new Error("input is too large");const n=q(t),r=8*t.length-e.nBitLength;return r>0?n>>BigInt(r):n},B=e.bits2int_modN||function(t){return s(E(t))},x=P(e.nBitLength);function S(t){return z("num < 2^"+e.nBitLength,t,Bt,x),N(t,e.nByteLength)}const A={lowS:e.lowS,prehash:!1},O={lowS:e.lowS,prehash:!1};return a.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t,e=!0){return a.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,n=!0){if(y(t))throw new Error("first arg must be private key");if(!y(e))throw new Error("second arg must be public key");return a.fromHex(e).multiply(c(t)).toRawBytes(n)},sign:function(t,r,o=A){const{seed:i,k2sig:u}=function(t,r,o=A){if(["recovered","canonical"].some((t=>t in o)))throw new Error("sign() legacy options not supported");const{hash:i,randomBytes:u}=e;let{lowS:l,prehash:w,extraEntropy:p}=o;null==l&&(l=!0),t=H("msgHash",t),pt(o),w&&(t=H("prehashed msgHash",i(t)));const y=B(t),m=c(r),b=[S(m),S(y)];if(null!=p&&!1!==p){const t=!0===p?u(n.BYTES):p;b.push(H("extraEntropy",t))}const v=C(...b),x=y;return{seed:v,k2sig:function(t){const e=E(t);if(!h(e))return;const n=f(e),r=a.BASE.multiply(e).toAffine(),o=s(r.x);if(o===Bt)return;const i=s(n*s(x+o*m));if(i===Bt)return;let c=(r.x===o?0:2)|Number(r.y&vt),u=i;return l&&d(i)&&(u=function(t){return d(t)?s(-t):t}(i),c^=1),new g(o,u,c)}}}(t,r,o),l=e;return T(l.hash.outputLen,l.nByteLength,l.hmac)(i,u)},verify:function(t,n,r,o=O){const i=t;n=H("msgHash",n),r=H("publicKey",r);const{lowS:c,prehash:u,format:h}=o;if(pt(o),"strict"in o)throw new Error("options.strict was renamed to lowS");if(void 0!==h&&"compact"!==h&&"der"!==h)throw new Error("format must be compact or der");const l="string"==typeof i||m(i),d=!l&&!h&&"object"==typeof i&&null!==i&&"bigint"==typeof i.r&&"bigint"==typeof i.s;if(!l&&!d)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let w,p;try{if(d&&(w=new g(i.r,i.s)),l){try{"compact"!==h&&(w=g.fromDER(i))}catch(t){if(!(t instanceof bt.Err))throw t}w||"der"===h||(w=g.fromCompact(i))}p=a.fromHex(r)}catch(t){return!1}if(!w)return!1;if(c&&w.hasHighS())return!1;u&&(n=e.hash(n));const{r:y,s:E}=w,b=B(n),v=f(E),x=s(b*v),S=s(y*v),A=a.BASE.multiplyAndAddUnsafe(p,x,S)?.toAffine();return!!A&&s(A.x)===y},ProjectivePoint:a,Signature:g,utils:p}}function Ot(t){return{hash:t,hmac:(e,...n)=>w(t,e,(0,i.Id)(...n)),randomBytes:i.po}}BigInt(4);const It=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),qt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Rt=BigInt(1),Nt=BigInt(2),Lt=(t,e)=>(t+e/Nt)/e;const Ht=ot(It,void 0,void 0,{sqrt:function(t){const e=It,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),s=BigInt(23),f=BigInt(44),a=BigInt(88),c=t*t*t%e,u=c*c*t%e,h=tt(u,n,e)*u%e,l=tt(h,n,e)*u%e,d=tt(l,Nt,e)*c%e,w=tt(d,o,e)*d%e,g=tt(w,i,e)*w%e,p=tt(g,f,e)*g%e,y=tt(p,a,e)*p%e,m=tt(y,f,e)*g%e,E=tt(m,n,e)*u%e,b=tt(E,s,e)*w%e,B=tt(b,r,e)*c%e,v=tt(B,Nt,e);if(!Ht.eql(Ht.sqr(v),t))throw new Error("Cannot find square root");return v}}),Ct=function(t,e){const n=e=>At({...t,...Ot(e)});return{...n(e),create:n}}({a:BigInt(0),b:BigInt(7),Fp:Ht,n:qt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=qt,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Rt*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,s=BigInt("0x100000000000000000000000000000000"),f=Lt(i*t,e),a=Lt(-r*t,e);let c=X(t-f*n-a*o,e),u=X(-f*r-a*i,e);const h=c>s,l=u>s;if(h&&(c=e-c),l&&(u=e-u),c>s||u>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:c,k2neg:l,k2:u}}}},l);BigInt(0),Ct.ProjectivePoint}};
|
package/build/6700.index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __webpack_id__=6700;export const __webpack_ids__=[6700];export const __webpack_modules__={62174:(e,t,n)=>{var r=n(33486).hp,o=n(75765),i={data:r.alloc(0),dataLength:0,sequence:0};t.A=function(e,t){return{makeBlocks:function(n){var o,i,c=r.concat([(o=n.length,i=r.alloc(2),i.writeUInt16BE(o,0),i),n]),s=t-5,a=Math.ceil(c.length/s);c=r.concat([c,r.alloc(a*s-c.length+1).fill(0)]);for(var u=[],d=0;d<a;d++){var l=r.alloc(5);l.writeUInt16BE(e,0),l.writeUInt8(5,2),l.writeUInt16BE(d,3);var h=c.slice(d*s,(d+1)*s);u.push(r.concat([l,h]))}return u},reduceResponse:function(t,n){var c=t||i,s=c.data,a=c.dataLength,u=c.sequence;if(n.readUInt16BE(0)!==e)throw new o.TransportError("Invalid channel","InvalidChannel");if(5!==n.readUInt8(2))throw new o.TransportError("Invalid tag","InvalidTag");if(n.readUInt16BE(3)!==u)throw new o.TransportError("Invalid sequence","InvalidSequence");t||(a=n.readUInt16BE(5)),u++;var d=n.slice(t?5:7);return(s=r.concat([s,d])).length>a&&(s=s.slice(0,a)),{data:s,dataLength:a,sequence:u}},getReducedResult:function(e){if(e&&e.dataLength===e.data.length)return e.data}}}},86700:(e,t,n)=>{n.r(t),n.d(t,{default:()=>X});var r=n(50046),o=n.n(r),i=n(75765);let c=0;const s=[],a=(e,t,n)=>{const r={type:e,id:String(++c),date:new Date};t&&(r.message=t),n&&(r.data=n),d(r)};class u{constructor(e,t){this.type=e,this.context=t}trace(e,t){(({type:e,message:t,data:n,context:r})=>{const o={type:e,id:String(++c),date:new Date};t&&(o.message=t),n&&(o.data=n),r&&(o.context=r),d(o)})({type:this.type,message:e,data:t,context:this.context})}getContext(){return this.context}setContext(e){this.context=e}updateContext(e){this.context=Object.assign(Object.assign({},this.context),e)}getType(){return this.type}setType(e){this.type=e}withType(e){return new u(e,this.context)}withContext(e){return new u(this.type,e)}withUpdatedContext(e){return new u(this.type,Object.assign(Object.assign({},this.context),e))}}function d(e){for(let t=0;t<s.length;t++)try{s[t](e)}catch(e){console.error(e)}}"undefined"!=typeof window&&(window.__ledgerLogsListen=e=>(s.push(e),()=>{const t=s.indexOf(e);-1!==t&&(s[t]=s[s.length-1],s.pop())}));var l=n(33486).hp,h=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function s(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((r=r.apply(e,t||[])).next())}))};class p{constructor({context:e,logType:t}={}){this.exchangeTimeout=3e4,this.unresponsiveTimeout=15e3,this.deviceModel=null,this._events=new(o()),this.send=(e,t,n,r,...o)=>h(this,[e,t,n,r,...o],void 0,(function*(e,t,n,r,o=l.alloc(0),c=[i.StatusCodes.OK],{abortTimeoutMs:s}={}){const a=this.tracer.withUpdatedContext({function:"send"});if(o.length>=256)throw a.trace("data.length exceeded 256 bytes limit",{dataLength:o.length}),new i.TransportError("data.length exceed 256 bytes limit. Got: "+o.length,"DataLengthTooBig");a.trace("Starting an exchange",{abortTimeoutMs:s});const u=yield this.exchange(l.concat([l.from([e,t,n,r]),l.from([o.length]),o]),{abortTimeoutMs:s});a.trace("Received response from exchange");const d=u.readUInt16BE(u.length-2);if(!c.some((e=>e===d)))throw new i.TransportStatusError(d);return u})),this._appAPIlock=null,this.tracer=new u(null!=t?t:"transport",e)}exchange(e,{abortTimeoutMs:t}={}){throw new Error("exchange not implemented")}exchangeBulk(e,t){let n=!1;return(()=>h(this,void 0,void 0,(function*(){if(!n)for(const r of e){const e=yield this.exchange(r);if(n)return;const o=e.readUInt16BE(e.length-2);if(o!==i.StatusCodes.OK)throw new i.TransportStatusError(o);t.next(e)}})))().then((()=>!n&&t.complete()),(e=>!n&&t.error(e))),{unsubscribe:()=>{n=!0}}}setScrambleKey(e){}close(){return Promise.resolve()}on(e,t){this._events.on(e,t)}off(e,t){this._events.removeListener(e,t)}emit(e,...t){this._events.emit(e,...t)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(e){this.exchangeTimeout=e}setExchangeUnresponsiveTimeout(e){this.unresponsiveTimeout=e}static create(e=3e3,t){return new Promise(((n,r)=>{let o=!1;const c=this.listen({next:t=>{o=!0,c&&c.unsubscribe(),s&&clearTimeout(s),this.open(t.descriptor,e).then(n,r)},error:e=>{s&&clearTimeout(s),r(e)},complete:()=>{s&&clearTimeout(s),o||r(new i.TransportError(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),s=t?setTimeout((()=>{c.unsubscribe(),r(new i.TransportError(this.ErrorMessage_ListenTimeout,"ListenTimeout"))}),t):null}))}exchangeAtomicImpl(e){return h(this,void 0,void 0,(function*(){const t=this.tracer.withUpdatedContext({function:"exchangeAtomicImpl",unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw t.trace("Atomic exchange is already busy"),new i.TransportRaceCondition("An action was already pending on the Ledger device. Please deny or reconnect.");let n;const r=new Promise((e=>{n=e}));this.exchangeBusyPromise=r;let o=!1;const c=setTimeout((()=>{t.trace('Timeout reached, emitting Transport event "unresponsive"',{unresponsiveTimeout:this.unresponsiveTimeout}),o=!0,this.emit("unresponsive")}),this.unresponsiveTimeout);try{const n=yield e();return o&&(t.trace("Device was unresponsive, emitting responsive"),this.emit("responsive")),n}finally{t.trace("Finalize, clearing busy guard"),clearTimeout(c),n&&n(),this.exchangeBusyPromise=null}}))}decorateAppAPIMethods(e,t,n){for(const r of t)e[r]=this.decorateAppAPIMethod(r,e[r],e,n)}decorateAppAPIMethod(e,t,n,r){return(...o)=>h(this,void 0,void 0,(function*(){const{_appAPIlock:c}=this;if(c)return Promise.reject(new i.TransportError("Ledger Device is busy (lock "+c+")","TransportLocked"));try{return this._appAPIlock=e,this.setScrambleKey(r),yield t.apply(n,o)}finally{this._appAPIlock=null}}))}setTraceContext(e){this.tracer=this.tracer.withContext(e)}updateTraceContext(e){this.tracer.updateContext(e)}getTraceContext(){return this.tracer.getContext()}}p.ErrorMessage_ListenTimeout="No Ledger device found (timeout)",p.ErrorMessage_NoDeviceFound="No Ledger device found";const f=p;var v,g,m=n(62174),y=n(2722),w=n.n(y),b=function(){return b=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},b.apply(this,arguments)};!function(e){e.blue="blue",e.nanoS="nanoS",e.nanoSP="nanoSP",e.nanoX="nanoX",e.nanoFTS="nanoFTS"}(g||(g={}));var x=((v={})[g.blue]={id:g.blue,productName:"Ledger Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:491520,masks:[822083584,822149120],getBlockSize:function(e){return 4096}},v[g.nanoS]={id:g.nanoS,productName:"Ledger Nano S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,masks:[823132160],getBlockSize:function(e){var t;return w().lt(null!==(t=w().coerce(e))&&void 0!==t?t:"","2.0.0")?4096:2048}},v[g.nanoSP]={id:g.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1572864,masks:[856686592],getBlockSize:function(e){return 32}},v[g.nanoX]={id:g.nanoX,productName:"Ledger Nano X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,masks:[855638016],getBlockSize:function(e){return 4096},bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},v[g.nanoFTS]={id:g.nanoFTS,productName:"Ledger Nano FTS",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:2097152,masks:[857735168],getBlockSize:function(e){return 4096},bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]},v),T=(g.blue,g.nanoS,g.nanoSP,g.nanoX,g.nanoFTS,Object.values(x)),S=function(e){var t=T.find((function(t){return t.legacyUsbProductId===e}));if(t)return t;var n=e>>8;return T.find((function(e){return e.productIdMM===n}))},I=[],_={};for(var P in x){var k=x[P],E=k.bluetoothSpec;if(E)for(var U=0;U<E.length;U++){var M=E[U];I.push(M.serviceUuid),_[M.serviceUuid]=_[M.serviceUuid.replace(/-/g,"")]=b({deviceModel:k},M)}}var C,L=n(33486).hp,O=(C=function(e,t){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},C(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}C(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),B=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function s(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,s)}a((r=r.apply(e,t||[])).next())}))},A=function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return c.label++,{value:i[1],done:!1};case 5:c.label++,r=i[1],i=[0];continue;case 7:i=c.ops.pop(),c.trys.pop();continue;default:if(!((o=(o=c.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){c=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(6===i[0]&&c.label<o[1]){c.label=o[1],o=i;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(i);break}o[2]&&c.ops.pop(),c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},D=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),c=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)c.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return c},N=[{vendorId:11415}],z=function(){return Promise.resolve(!(!window.navigator||!window.navigator.hid))},R=function(){var e=navigator.hid;if(!e)throw new i.TransportError("navigator.hid is not supported","HIDNotSupported");return e};function j(){return B(this,void 0,void 0,(function(){var e;return A(this,(function(t){switch(t.label){case 0:return[4,R().requestDevice({filters:N})];case 1:return e=t.sent(),Array.isArray(e)?[2,e]:[2,[e]]}}))}))}function F(){return B(this,void 0,void 0,(function(){return A(this,(function(e){switch(e.label){case 0:return[4,R().getDevices()];case 1:return[2,e.sent().filter((function(e){return 11415===e.vendorId}))]}}))}))}var q=function(e){function t(t){var n=e.call(this)||this;return n.channel=Math.floor(65535*Math.random()),n.packetSize=64,n.inputs=[],n.read=function(){return n.inputs.length?Promise.resolve(n.inputs.shift()):new Promise((function(e){n.inputCallback=e}))},n.onInputReport=function(e){var t=L.from(e.data.buffer);n.inputCallback?(n.inputCallback(t),n.inputCallback=null):n.inputs.push(t)},n._disconnectEmitted=!1,n._emitDisconnect=function(e){n._disconnectEmitted||(n._disconnectEmitted=!0,n.emit("disconnect",e))},n.exchange=function(e){return B(n,void 0,void 0,(function(){var t=this;return A(this,(function(n){switch(n.label){case 0:return[4,this.exchangeAtomicImpl((function(){return B(t,void 0,void 0,(function(){var t,n,r,o,i,c,s,u,d;return A(this,(function(l){switch(l.label){case 0:n=(t=this).channel,r=t.packetSize,a("apdu","=> "+e.toString("hex")),o=(0,m.A)(n,r),i=o.makeBlocks(e),c=0,l.label=1;case 1:return c<i.length?[4,this.device.sendReport(0,i[c])]:[3,4];case 2:l.sent(),l.label=3;case 3:return c++,[3,1];case 4:return(s=o.getReducedResult(u))?[3,6]:[4,this.read()];case 5:return d=l.sent(),u=o.reduceResponse(u,d),[3,4];case 6:return a("apdu","<= "+s.toString("hex")),[2,s]}}))}))})).catch((function(e){if(e&&e.message&&e.message.includes("write"))throw t._emitDisconnect(e),new i.DisconnectedDeviceDuringOperation(e.message);throw e}))];case 1:return[2,n.sent()]}}))}))},n.device=t,n.deviceModel="number"==typeof t.productId?S(t.productId):void 0,t.addEventListener("inputreport",n.onInputReport),n}return O(t,e),t.request=function(){return B(this,void 0,void 0,(function(){var e,n;return A(this,(function(r){switch(r.label){case 0:return[4,j()];case 1:return e=D.apply(void 0,[r.sent(),1]),n=e[0],[2,t.open(n)]}}))}))},t.openConnected=function(){return B(this,void 0,void 0,(function(){var e;return A(this,(function(n){switch(n.label){case 0:return[4,F()];case 1:return 0===(e=n.sent()).length?[2,null]:[2,t.open(e[0])]}}))}))},t.open=function(e){return B(this,void 0,void 0,(function(){var n,r;return A(this,(function(o){switch(o.label){case 0:return[4,e.open()];case 1:return o.sent(),n=new t(e),r=function(t){e===t.device&&(R().removeEventListener("disconnect",r),n._emitDisconnect(new i.DisconnectedDevice))},R().addEventListener("disconnect",r),[2,n]}}))}))},t.prototype.close=function(){return B(this,void 0,void 0,(function(){return A(this,(function(e){switch(e.label){case 0:return[4,this.exchangeBusyPromise];case 1:return e.sent(),this.device.removeEventListener("inputreport",this.onInputReport),[4,this.device.close()];case 2:return e.sent(),[2]}}))}))},t.prototype.setScrambleKey=function(){},t.isSupported=z,t.list=F,t.listen=function(e){var t=!1;return function(){return B(this,void 0,void 0,(function(){var e;return A(this,(function(t){switch(t.label){case 0:return[4,F()];case 1:return(e=t.sent()).length>0?[2,e[0]]:[4,j()];case 2:return[2,t.sent()[0]]}}))}))}().then((function(n){if(n){if(!t){var r="number"==typeof n.productId?S(n.productId):void 0;e.next({type:"add",descriptor:n,deviceModel:r}),e.complete()}}else e.error(new i.TransportOpenUserCancelled("Access denied to use Ledger device"))}),(function(t){e.error(new i.TransportOpenUserCancelled(t.message))})),{unsubscribe:function(){t=!0}}},t}(f);const X=q}};
|
|
1
|
+
export const __webpack_id__=6700;export const __webpack_ids__=[6700];export const __webpack_modules__={2722:(e,t,r)=>{const n=r(72841),s=r(79543),o=r(24517),i=r(93806),a=r(93955),c=r(28474),l=r(92281),u=r(38868),p=r(73269),h=r(26381),d=r(31353),E=r(96082),f=r(69428),m=r(87851),v=r(87555),I=r(52132),g=r(6106),$=r(34042),R=r(93810),w=r(89761),L=r(51262),T=r(28848),N=r(28220),O=r(72386),S=r(89639),y=r(54004),A=r(56783),x=r(51565),b=r(37476),P=r(27229),C=r(26364),M=r(55039),_=r(55357),D=r(71280),U=r(37403),F=r(58854),j=r(27226),G=r(37183),k=r(18623),X=r(76486),B=r(40583);e.exports={parse:a,valid:c,clean:l,inc:u,diff:p,major:h,minor:d,patch:E,prerelease:f,compare:m,rcompare:v,compareLoose:I,compareBuild:g,sort:$,rsort:R,gt:w,lt:L,eq:T,neq:N,gte:O,lte:S,cmp:y,coerce:A,Comparator:x,Range:b,satisfies:P,toComparators:C,maxSatisfying:M,minSatisfying:_,minVersion:D,validRange:U,outside:F,gtr:j,ltr:G,intersects:k,simplifyRange:X,subset:B,SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:s.SEMVER_SPEC_VERSION,RELEASE_TYPES:s.RELEASE_TYPES,compareIdentifiers:i.compareIdentifiers,rcompareIdentifiers:i.rcompareIdentifiers}},6106:(e,t,r)=>{const n=r(24517);e.exports=(e,t,r)=>{const s=new n(e,r),o=new n(t,r);return s.compare(o)||s.compareBuild(o)}},13990:e=>{const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},18623:(e,t,r)=>{const n=r(37476);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},24517:(e,t,r)=>{const n=r(41361),{MAX_LENGTH:s,MAX_SAFE_INTEGER:o}=r(79543),{safeRe:i,t:a}=r(72841),c=r(13990),{compareIdentifiers:l}=r(93806);class u{constructor(e,t){if(t=c(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>s)throw new TypeError(`version is longer than ${s} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?i[a.LOOSE]:i[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<o)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),l(this.major,e.major)||l(this.minor,e.minor)||l(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],s=e.prerelease[t];if(n("prerelease compare",t,r,s),void 0===r&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===r)return-1;if(r!==s)return l(r,s)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const r=this.build[t],s=e.build[t];if(n("build compare",t,r,s),void 0===r&&void 0===s)return 0;if(void 0===s)return 1;if(void 0===r)return-1;if(r!==s)return l(r,s)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===l(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},26364:(e,t,r)=>{const n=r(37476);e.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},26381:(e,t,r)=>{const n=r(24517);e.exports=(e,t)=>new n(e,t).major},27226:(e,t,r)=>{const n=r(58854);e.exports=(e,t,r)=>n(e,t,">",r)},27229:(e,t,r)=>{const n=r(37476);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},28220:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>0!==n(e,t,r)},28474:(e,t,r)=>{const n=r(93955);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},28848:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>0===n(e,t,r)},31353:(e,t,r)=>{const n=r(24517);e.exports=(e,t)=>new n(e,t).minor},34042:(e,t,r)=>{const n=r(6106);e.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))},37183:(e,t,r)=>{const n=r(58854);e.exports=(e,t,r)=>n(e,t,"<",r)},37403:(e,t,r)=>{const n=r(37476);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},37476:(e,t,r)=>{class n{constructor(e,t){if(t=o(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof i)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!m(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&E)|(this.options.loose&&f))+":"+e,r=s.get(t);if(r)return r;const n=this.options.loose,o=n?l[u.HYPHENRANGELOOSE]:l[u.HYPHENRANGE];e=e.replace(o,A(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(l[u.COMPARATORTRIM],p),a("comparator trim",e),e=e.replace(l[u.TILDETRIM],h),a("tilde trim",e),e=e.replace(l[u.CARETTRIM],d),a("caret trim",e);let c=e.split(" ").map((e=>g(e,this.options))).join(" ").split(/\s+/).map((e=>y(e,this.options)));n&&(c=c.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(l[u.COMPARATORLOOSE]))))),a("range list",c);const v=new Map,I=c.map((e=>new i(e,this.options)));for(const e of I){if(m(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const $=[...v.values()];return s.set(t,$),$}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>I(r,t)&&e.set.some((e=>I(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(x(this.set[t],e,this.options))return!0;return!1}}e.exports=n;const s=new(r(58953)),o=r(13990),i=r(51565),a=r(41361),c=r(24517),{safeRe:l,t:u,comparatorTrimReplace:p,tildeTrimReplace:h,caretTrimReplace:d}=r(72841),{FLAG_INCLUDE_PRERELEASE:E,FLAG_LOOSE:f}=r(79543),m=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,I=(e,t)=>{let r=!0;const n=e.slice();let s=n.pop();for(;r&&n.length;)r=n.every((e=>s.intersects(e,t))),s=n.pop();return r},g=(e,t)=>(a("comp",e,t),e=L(e,t),a("caret",e),e=R(e,t),a("tildes",e),e=N(e,t),a("xrange",e),e=S(e,t),a("stars",e),e),$=e=>!e||"x"===e.toLowerCase()||"*"===e,R=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{const r=t.loose?l[u.TILDELOOSE]:l[u.TILDE];return e.replace(r,((t,r,n,s,o)=>{let i;return a("tilde",e,t,r,n,s,o),$(r)?i="":$(n)?i=`>=${r}.0.0 <${+r+1}.0.0-0`:$(s)?i=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(a("replaceTilde pr",o),i=`>=${r}.${n}.${s}-${o} <${r}.${+n+1}.0-0`):i=`>=${r}.${n}.${s} <${r}.${+n+1}.0-0`,a("tilde return",i),i}))},L=(e,t)=>e.trim().split(/\s+/).map((e=>T(e,t))).join(" "),T=(e,t)=>{a("caret",e,t);const r=t.loose?l[u.CARETLOOSE]:l[u.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,s,o,i)=>{let c;return a("caret",e,t,r,s,o,i),$(r)?c="":$(s)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:$(o)?c="0"===r?`>=${r}.${s}.0${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.0${n} <${+r+1}.0.0-0`:i?(a("replaceCaret pr",i),c="0"===r?"0"===s?`>=${r}.${s}.${o}-${i} <${r}.${s}.${+o+1}-0`:`>=${r}.${s}.${o}-${i} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${o}-${i} <${+r+1}.0.0-0`):(a("no pr"),c="0"===r?"0"===s?`>=${r}.${s}.${o}${n} <${r}.${s}.${+o+1}-0`:`>=${r}.${s}.${o}${n} <${r}.${+s+1}.0-0`:`>=${r}.${s}.${o} <${+r+1}.0.0-0`),a("caret return",c),c}))},N=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>O(e,t))).join(" ")),O=(e,t)=>{e=e.trim();const r=t.loose?l[u.XRANGELOOSE]:l[u.XRANGE];return e.replace(r,((r,n,s,o,i,c)=>{a("xRange",e,r,n,s,o,i,c);const l=$(s),u=l||$(o),p=u||$(i),h=p;return"="===n&&h&&(n=""),c=t.includePrerelease?"-0":"",l?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(u&&(o=0),i=0,">"===n?(n=">=",u?(s=+s+1,o=0,i=0):(o=+o+1,i=0)):"<="===n&&(n="<",u?s=+s+1:o=+o+1),"<"===n&&(c="-0"),r=`${n+s}.${o}.${i}${c}`):u?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:p&&(r=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`),a("xRange return",r),r}))},S=(e,t)=>(a("replaceStars",e,t),e.trim().replace(l[u.STAR],"")),y=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(l[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),A=e=>(t,r,n,s,o,i,a,c,l,u,p,h)=>`${r=$(n)?"":$(s)?`>=${n}.0.0${e?"-0":""}`:$(o)?`>=${n}.${s}.0${e?"-0":""}`:i?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=$(l)?"":$(u)?`<${+l+1}.0.0-0`:$(p)?`<${l}.${+u+1}.0-0`:h?`<=${l}.${u}.${p}-${h}`:e?`<${l}.${u}.${+p+1}-0`:`<=${c}`}`.trim(),x=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==i.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},38868:(e,t,r)=>{const n=r(24517);e.exports=(e,t,r,s,o)=>{"string"==typeof r&&(o=s,s=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,s,o).version}catch(e){return null}}},40583:(e,t,r)=>{const n=r(37476),s=r(51565),{ANY:o}=s,i=r(27229),a=r(87851),c=[new s(">=0.0.0-0")],l=[new s(">=0.0.0")],u=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=r.includePrerelease?c:l}if(1===t.length&&t[0].semver===o){if(r.includePrerelease)return!0;t=l}const n=new Set;let s,u,d,E,f,m,v;for(const t of e)">"===t.operator||">="===t.operator?s=p(s,t,r):"<"===t.operator||"<="===t.operator?u=h(u,t,r):n.add(t.semver);if(n.size>1)return null;if(s&&u){if(d=a(s.semver,u.semver,r),d>0)return null;if(0===d&&(">="!==s.operator||"<="!==u.operator))return null}for(const e of n){if(s&&!i(e,String(s),r))return null;if(u&&!i(e,String(u),r))return null;for(const n of t)if(!i(e,String(n),r))return!1;return!0}let I=!(!u||r.includePrerelease||!u.semver.prerelease.length)&&u.semver,g=!(!s||r.includePrerelease||!s.semver.prerelease.length)&&s.semver;I&&1===I.prerelease.length&&"<"===u.operator&&0===I.prerelease[0]&&(I=!1);for(const e of t){if(v=v||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,s)if(g&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===g.major&&e.semver.minor===g.minor&&e.semver.patch===g.patch&&(g=!1),">"===e.operator||">="===e.operator){if(E=p(s,e,r),E===e&&E!==s)return!1}else if(">="===s.operator&&!i(s.semver,String(e),r))return!1;if(u)if(I&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===I.major&&e.semver.minor===I.minor&&e.semver.patch===I.patch&&(I=!1),"<"===e.operator||"<="===e.operator){if(f=h(u,e,r),f===e&&f!==u)return!1}else if("<="===u.operator&&!i(u.semver,String(e),r))return!1;if(!e.operator&&(u||s)&&0!==d)return!1}return!(s&&m&&!u&&0!==d||u&&v&&!s&&0!==d||g||I)},p=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const n=a(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let s=!1;e:for(const n of e.set){for(const e of t.set){const t=u(n,e,r);if(s=s||null!==t,t)continue e}if(s)return!1}return!0}},41361:(e,t,r)=>{var n=r(39907);const s=("object"==typeof n&&n.env,()=>{});e.exports=s},51262:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>n(e,t,r)<0},51565:(e,t,r)=>{const n=Symbol("SemVer ANY");class s{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof s){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),l("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(e){const t=this.options.loose?i[a.COMPARATORLOOSE]:i[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(l("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof s))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=s;const o=r(13990),{safeRe:i,t:a}=r(72841),c=r(54004),l=r(41361),u=r(24517),p=r(37476)},52132:(e,t,r)=>{const n=r(87851);e.exports=(e,t)=>n(e,t,!0)},54004:(e,t,r)=>{const n=r(28848),s=r(28220),o=r(89761),i=r(72386),a=r(51262),c=r(89639);e.exports=(e,t,r,l)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,l);case"!=":return s(e,r,l);case">":return o(e,r,l);case">=":return i(e,r,l);case"<":return a(e,r,l);case"<=":return c(e,r,l);default:throw new TypeError(`Invalid operator: ${t}`)}}},55039:(e,t,r)=>{const n=r(24517),s=r(37476);e.exports=(e,t,r)=>{let o=null,i=null,a=null;try{a=new s(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&-1!==i.compare(e)||(o=e,i=new n(o,r)))})),o}},55357:(e,t,r)=>{const n=r(24517),s=r(37476);e.exports=(e,t,r)=>{let o=null,i=null,a=null;try{a=new s(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&1!==i.compare(e)||(o=e,i=new n(o,r)))})),o}},56783:(e,t,r)=>{const n=r(24517),s=r(93955),{safeRe:o,t:i}=r(72841);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const n=t.includePrerelease?o[i.COERCERTLFULL]:o[i.COERCERTL];let s;for(;(s=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&s.index+s[0].length===r.index+r[0].length||(r=s),n.lastIndex=s.index+s[1].length+s[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?o[i.COERCEFULL]:o[i.COERCE]);if(null===r)return null;const a=r[2],c=r[3]||"0",l=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",p=t.includePrerelease&&r[6]?`+${r[6]}`:"";return s(`${a}.${c}.${l}${u}${p}`,t)}},58854:(e,t,r)=>{const n=r(24517),s=r(51565),{ANY:o}=s,i=r(37476),a=r(27229),c=r(89761),l=r(51262),u=r(89639),p=r(72386);e.exports=(e,t,r,h)=>{let d,E,f,m,v;switch(e=new n(e,h),t=new i(t,h),r){case">":d=c,E=u,f=l,m=">",v=">=";break;case"<":d=l,E=p,f=c,m="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let i=null,a=null;if(n.forEach((e=>{e.semver===o&&(e=new s(">=0.0.0")),i=i||e,a=a||e,d(e.semver,i.semver,h)?i=e:f(e.semver,a.semver,h)&&(a=e)})),i.operator===m||i.operator===v)return!1;if((!a.operator||a.operator===m)&&E(e,a.semver))return!1;if(a.operator===v&&f(e,a.semver))return!1}return!0}},58953:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},62174:(e,t,r)=>{var n=r(33486).hp,s=r(75765),o={data:n.alloc(0),dataLength:0,sequence:0};t.A=function(e,t){return{makeBlocks:function(r){var s,o,i=n.concat([(s=r.length,o=n.alloc(2),o.writeUInt16BE(s,0),o),r]),a=t-5,c=Math.ceil(i.length/a);i=n.concat([i,n.alloc(c*a-i.length+1).fill(0)]);for(var l=[],u=0;u<c;u++){var p=n.alloc(5);p.writeUInt16BE(e,0),p.writeUInt8(5,2),p.writeUInt16BE(u,3);var h=i.slice(u*a,(u+1)*a);l.push(n.concat([p,h]))}return l},reduceResponse:function(t,r){var i=t||o,a=i.data,c=i.dataLength,l=i.sequence;if(r.readUInt16BE(0)!==e)throw new s.TransportError("Invalid channel","InvalidChannel");if(5!==r.readUInt8(2))throw new s.TransportError("Invalid tag","InvalidTag");if(r.readUInt16BE(3)!==l)throw new s.TransportError("Invalid sequence","InvalidSequence");t||(c=r.readUInt16BE(5)),l++;var u=r.slice(t?5:7);return(a=n.concat([a,u])).length>c&&(a=a.slice(0,c)),{data:a,dataLength:c,sequence:l}},getReducedResult:function(e){if(e&&e.dataLength===e.data.length)return e.data}}}},69428:(e,t,r)=>{const n=r(93955);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},71280:(e,t,r)=>{const n=r(24517),s=r(37476),o=r(89761);e.exports=(e,t)=>{e=new s(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const s=e.set[t];let i=null;s.forEach((e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!o(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||r&&!o(r,i)||(r=i)}return r&&e.test(r)?r:null}},72386:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>n(e,t,r)>=0},72841:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:o}=r(79543),i=r(41361),a=(t=e.exports={}).re=[],c=t.safeRe=[],l=t.src=[],u=t.t={};let p=0;const h="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",o],[h,s]],E=(e,t,r)=>{const n=(e=>{for(const[t,r]of d)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),s=p++;i(e,s,t),u[e]=s,l[s]=t,a[s]=new RegExp(t,r?"g":void 0),c[s]=new RegExp(n,r?"g":void 0)};E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),E("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),E("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${h}+`),E("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),E("FULL",`^${l[u.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),E("LOOSE",`^${l[u.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),E("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),E("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?`+`(?:${l[u.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",l[u.COERCE],!0),E("COERCERTLFULL",l[u.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",E("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",E("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},73269:(e,t,r)=>{const n=r(93955);e.exports=(e,t)=>{const r=n(e,null,!0),s=n(t,null,!0),o=r.compare(s);if(0===o)return null;const i=o>0,a=i?r:s,c=i?s:r,l=!!a.prerelease.length;if(c.prerelease.length&&!l)return c.patch||c.minor?a.patch?"patch":a.minor?"minor":"major":"major";const u=l?"pre":"";return r.major!==s.major?u+"major":r.minor!==s.minor?u+"minor":r.patch!==s.patch?u+"patch":"prerelease"}},76486:(e,t,r)=>{const n=r(27229),s=r(87851);e.exports=(e,t,r)=>{const o=[];let i=null,a=null;const c=e.sort(((e,t)=>s(e,t,r)));for(const e of c)n(e,t,r)?(a=e,i||(i=e)):(a&&o.push([i,a]),a=null,i=null);i&&o.push([i,null]);const l=[];for(const[e,t]of o)e===t?l.push(e):t||e!==c[0]?t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`):l.push("*");const u=l.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return u.length<p.length?u:t}},79543:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},86700:(e,t,r)=>{r.r(t),r.d(t,{default:()=>B});var n=r(50046),s=r.n(n),o=r(75765);let i=0;const a=[],c=(e,t,r)=>{const n={type:e,id:String(++i),date:new Date};t&&(n.message=t),r&&(n.data=r),u(n)};class l{constructor(e,t){this.type=e,this.context=t}trace(e,t){(({type:e,message:t,data:r,context:n})=>{const s={type:e,id:String(++i),date:new Date};t&&(s.message=t),r&&(s.data=r),n&&(s.context=n),u(s)})({type:this.type,message:e,data:t,context:this.context})}getContext(){return this.context}setContext(e){this.context=e}updateContext(e){this.context=Object.assign(Object.assign({},this.context),e)}getType(){return this.type}setType(e){this.type=e}withType(e){return new l(e,this.context)}withContext(e){return new l(this.type,e)}withUpdatedContext(e){return new l(this.type,Object.assign(Object.assign({},this.context),e))}}function u(e){for(let t=0;t<a.length;t++)try{a[t](e)}catch(e){console.error(e)}}"undefined"!=typeof window&&(window.__ledgerLogsListen=e=>(a.push(e),()=>{const t=a.indexOf(e);-1!==t&&(a[t]=a[a.length-1],a.pop())}));var p=r(33486).hp,h=function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))};class d{constructor({context:e,logType:t}={}){this.exchangeTimeout=3e4,this.unresponsiveTimeout=15e3,this.deviceModel=null,this._events=new(s()),this.send=(e,t,r,n,...s)=>h(this,[e,t,r,n,...s],void 0,(function*(e,t,r,n,s=p.alloc(0),i=[o.StatusCodes.OK],{abortTimeoutMs:a}={}){const c=this.tracer.withUpdatedContext({function:"send"});if(s.length>=256)throw c.trace("data.length exceeded 256 bytes limit",{dataLength:s.length}),new o.TransportError("data.length exceed 256 bytes limit. Got: "+s.length,"DataLengthTooBig");c.trace("Starting an exchange",{abortTimeoutMs:a});const l=yield this.exchange(p.concat([p.from([e,t,r,n]),p.from([s.length]),s]),{abortTimeoutMs:a});c.trace("Received response from exchange");const u=l.readUInt16BE(l.length-2);if(!i.some((e=>e===u)))throw new o.TransportStatusError(u);return l})),this._appAPIlock=null,this.tracer=new l(null!=t?t:"transport",e)}exchange(e,{abortTimeoutMs:t}={}){throw new Error("exchange not implemented")}exchangeBulk(e,t){let r=!1;return(()=>h(this,void 0,void 0,(function*(){if(!r)for(const n of e){const e=yield this.exchange(n);if(r)return;const s=e.readUInt16BE(e.length-2);if(s!==o.StatusCodes.OK)throw new o.TransportStatusError(s);t.next(e)}})))().then((()=>!r&&t.complete()),(e=>!r&&t.error(e))),{unsubscribe:()=>{r=!0}}}setScrambleKey(e){}close(){return Promise.resolve()}on(e,t){this._events.on(e,t)}off(e,t){this._events.removeListener(e,t)}emit(e,...t){this._events.emit(e,...t)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(e){this.exchangeTimeout=e}setExchangeUnresponsiveTimeout(e){this.unresponsiveTimeout=e}static create(e=3e3,t){return new Promise(((r,n)=>{let s=!1;const i=this.listen({next:t=>{s=!0,i&&i.unsubscribe(),a&&clearTimeout(a),this.open(t.descriptor,e).then(r,n)},error:e=>{a&&clearTimeout(a),n(e)},complete:()=>{a&&clearTimeout(a),s||n(new o.TransportError(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),a=t?setTimeout((()=>{i.unsubscribe(),n(new o.TransportError(this.ErrorMessage_ListenTimeout,"ListenTimeout"))}),t):null}))}exchangeAtomicImpl(e){return h(this,void 0,void 0,(function*(){const t=this.tracer.withUpdatedContext({function:"exchangeAtomicImpl",unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw t.trace("Atomic exchange is already busy"),new o.TransportRaceCondition("An action was already pending on the Ledger device. Please deny or reconnect.");let r;const n=new Promise((e=>{r=e}));this.exchangeBusyPromise=n;let s=!1;const i=setTimeout((()=>{t.trace('Timeout reached, emitting Transport event "unresponsive"',{unresponsiveTimeout:this.unresponsiveTimeout}),s=!0,this.emit("unresponsive")}),this.unresponsiveTimeout);try{const r=yield e();return s&&(t.trace("Device was unresponsive, emitting responsive"),this.emit("responsive")),r}finally{t.trace("Finalize, clearing busy guard"),clearTimeout(i),r&&r(),this.exchangeBusyPromise=null}}))}decorateAppAPIMethods(e,t,r){for(const n of t)e[n]=this.decorateAppAPIMethod(n,e[n],e,r)}decorateAppAPIMethod(e,t,r,n){return(...s)=>h(this,void 0,void 0,(function*(){const{_appAPIlock:i}=this;if(i)return Promise.reject(new o.TransportError("Ledger Device is busy (lock "+i+")","TransportLocked"));try{return this._appAPIlock=e,this.setScrambleKey(n),yield t.apply(r,s)}finally{this._appAPIlock=null}}))}setTraceContext(e){this.tracer=this.tracer.withContext(e)}updateTraceContext(e){this.tracer.updateContext(e)}getTraceContext(){return this.tracer.getContext()}}d.ErrorMessage_ListenTimeout="No Ledger device found (timeout)",d.ErrorMessage_NoDeviceFound="No Ledger device found";const E=d;var f,m,v=r(62174),I=r(2722),g=r.n(I),$=function(){return $=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},$.apply(this,arguments)};!function(e){e.blue="blue",e.nanoS="nanoS",e.nanoSP="nanoSP",e.nanoX="nanoX",e.nanoFTS="nanoFTS"}(m||(m={}));var R=((f={})[m.blue]={id:m.blue,productName:"Ledger Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:491520,masks:[822083584,822149120],getBlockSize:function(e){return 4096}},f[m.nanoS]={id:m.nanoS,productName:"Ledger Nano S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,masks:[823132160],getBlockSize:function(e){var t;return g().lt(null!==(t=g().coerce(e))&&void 0!==t?t:"","2.0.0")?4096:2048}},f[m.nanoSP]={id:m.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1572864,masks:[856686592],getBlockSize:function(e){return 32}},f[m.nanoX]={id:m.nanoX,productName:"Ledger Nano X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,masks:[855638016],getBlockSize:function(e){return 4096},bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},f[m.nanoFTS]={id:m.nanoFTS,productName:"Ledger Nano FTS",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:2097152,masks:[857735168],getBlockSize:function(e){return 4096},bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]},f),w=(m.blue,m.nanoS,m.nanoSP,m.nanoX,m.nanoFTS,Object.values(R)),L=function(e){var t=w.find((function(t){return t.legacyUsbProductId===e}));if(t)return t;var r=e>>8;return w.find((function(e){return e.productIdMM===r}))},T=[],N={};for(var O in R){var S=R[O],y=S.bluetoothSpec;if(y)for(var A=0;A<y.length;A++){var x=y[A];T.push(x.serviceUuid),N[x.serviceUuid]=N[x.serviceUuid.replace(/-/g,"")]=$({deviceModel:S},x)}}var b,P=r(33486).hp,C=(b=function(e,t){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},b(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),M=function(e,t,r,n){return new(r||(r=Promise))((function(s,o){function i(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}c((n=n.apply(e,t||[])).next())}))},_=function(e,t){var r,n,s,o,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(s=2&o[0]?n.return:o[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,o[1])).done)return s;switch(n=0,s&&(o=[2&o[0],s.value]),o[0]){case 0:case 1:s=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,n=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!((s=(s=i.trys).length>0&&s[s.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!s||o[1]>s[0]&&o[1]<s[3])){i.label=o[1];break}if(6===o[0]&&i.label<s[1]){i.label=s[1],s=o;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(o);break}s[2]&&i.ops.pop(),i.trys.pop();continue}o=t.call(e,i)}catch(e){o=[6,e],n=0}finally{r=s=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},D=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,s,o=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(e){s={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(s)throw s.error}}return i},U=[{vendorId:11415}],F=function(){return Promise.resolve(!(!window.navigator||!window.navigator.hid))},j=function(){var e=navigator.hid;if(!e)throw new o.TransportError("navigator.hid is not supported","HIDNotSupported");return e};function G(){return M(this,void 0,void 0,(function(){var e;return _(this,(function(t){switch(t.label){case 0:return[4,j().requestDevice({filters:U})];case 1:return e=t.sent(),Array.isArray(e)?[2,e]:[2,[e]]}}))}))}function k(){return M(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return[4,j().getDevices()];case 1:return[2,e.sent().filter((function(e){return 11415===e.vendorId}))]}}))}))}var X=function(e){function t(t){var r=e.call(this)||this;return r.channel=Math.floor(65535*Math.random()),r.packetSize=64,r.inputs=[],r.read=function(){return r.inputs.length?Promise.resolve(r.inputs.shift()):new Promise((function(e){r.inputCallback=e}))},r.onInputReport=function(e){var t=P.from(e.data.buffer);r.inputCallback?(r.inputCallback(t),r.inputCallback=null):r.inputs.push(t)},r._disconnectEmitted=!1,r._emitDisconnect=function(e){r._disconnectEmitted||(r._disconnectEmitted=!0,r.emit("disconnect",e))},r.exchange=function(e){return M(r,void 0,void 0,(function(){var t=this;return _(this,(function(r){switch(r.label){case 0:return[4,this.exchangeAtomicImpl((function(){return M(t,void 0,void 0,(function(){var t,r,n,s,o,i,a,l,u;return _(this,(function(p){switch(p.label){case 0:r=(t=this).channel,n=t.packetSize,c("apdu","=> "+e.toString("hex")),s=(0,v.A)(r,n),o=s.makeBlocks(e),i=0,p.label=1;case 1:return i<o.length?[4,this.device.sendReport(0,o[i])]:[3,4];case 2:p.sent(),p.label=3;case 3:return i++,[3,1];case 4:return(a=s.getReducedResult(l))?[3,6]:[4,this.read()];case 5:return u=p.sent(),l=s.reduceResponse(l,u),[3,4];case 6:return c("apdu","<= "+a.toString("hex")),[2,a]}}))}))})).catch((function(e){if(e&&e.message&&e.message.includes("write"))throw t._emitDisconnect(e),new o.DisconnectedDeviceDuringOperation(e.message);throw e}))];case 1:return[2,r.sent()]}}))}))},r.device=t,r.deviceModel="number"==typeof t.productId?L(t.productId):void 0,t.addEventListener("inputreport",r.onInputReport),r}return C(t,e),t.request=function(){return M(this,void 0,void 0,(function(){var e,r;return _(this,(function(n){switch(n.label){case 0:return[4,G()];case 1:return e=D.apply(void 0,[n.sent(),1]),r=e[0],[2,t.open(r)]}}))}))},t.openConnected=function(){return M(this,void 0,void 0,(function(){var e;return _(this,(function(r){switch(r.label){case 0:return[4,k()];case 1:return 0===(e=r.sent()).length?[2,null]:[2,t.open(e[0])]}}))}))},t.open=function(e){return M(this,void 0,void 0,(function(){var r,n;return _(this,(function(s){switch(s.label){case 0:return[4,e.open()];case 1:return s.sent(),r=new t(e),n=function(t){e===t.device&&(j().removeEventListener("disconnect",n),r._emitDisconnect(new o.DisconnectedDevice))},j().addEventListener("disconnect",n),[2,r]}}))}))},t.prototype.close=function(){return M(this,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return[4,this.exchangeBusyPromise];case 1:return e.sent(),this.device.removeEventListener("inputreport",this.onInputReport),[4,this.device.close()];case 2:return e.sent(),[2]}}))}))},t.prototype.setScrambleKey=function(){},t.isSupported=F,t.list=k,t.listen=function(e){var t=!1;return function(){return M(this,void 0,void 0,(function(){var e;return _(this,(function(t){switch(t.label){case 0:return[4,k()];case 1:return(e=t.sent()).length>0?[2,e[0]]:[4,G()];case 2:return[2,t.sent()[0]]}}))}))}().then((function(r){if(r){if(!t){var n="number"==typeof r.productId?L(r.productId):void 0;e.next({type:"add",descriptor:r,deviceModel:n}),e.complete()}}else e.error(new o.TransportOpenUserCancelled("Access denied to use Ledger device"))}),(function(t){e.error(new o.TransportOpenUserCancelled(t.message))})),{unsubscribe:function(){t=!0}}},t}(E);const B=X},87555:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>n(t,e,r)},87851:(e,t,r)=>{const n=r(24517);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},89639:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>n(e,t,r)<=0},89761:(e,t,r)=>{const n=r(87851);e.exports=(e,t,r)=>n(e,t,r)>0},92281:(e,t,r)=>{const n=r(93955);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},93806:e=>{const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),s=t.test(r);return n&&s&&(e=+e,r=+r),e===r?0:n&&!s?-1:s&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},93810:(e,t,r)=>{const n=r(6106);e.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))},93955:(e,t,r)=>{const n=r(24517);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},96082:(e,t,r)=>{const n=r(24517);e.exports=(e,t)=>new n(e,t).patch}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const __webpack_id__=8780;export const __webpack_ids__=[8780];export const __webpack_modules__={25278:()=>{},45423:()=>{}};
|