-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwallet.js
More file actions
569 lines (518 loc) · 374 KB
/
wallet.js
File metadata and controls
569 lines (518 loc) · 374 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
var TelosWallet=(()=>{var $l=Object.create;var Xa=Object.defineProperty;var jl=Object.getOwnPropertyDescriptor;var Kl=Object.getOwnPropertyNames;var Vl=Object.getPrototypeOf,Zl=Object.prototype.hasOwnProperty;var te=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Wl=(r,e)=>{for(var t in e)Xa(r,t,{get:e[t],enumerable:!0})},cc=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Kl(e))!Zl.call(r,n)&&n!==t&&Xa(r,n,{get:()=>e[n],enumerable:!(i=jl(e,n))||i.enumerable});return r};var ji=(r,e,t)=>(t=r!=null?$l(Vl(r)):{},cc(e||!r||!r.__esModule?Xa(t,"default",{value:r,enumerable:!0}):t,r)),Gl=r=>cc(Xa({},"__esModule",{value:!0}),r);var Td=te(()=>{});var lo=te((F2,tf)=>{var Qs;tf.exports=function(e){return Qs||(Qs=new $r(null)),Qs.generate(e)};function $r(r){this.rand=r}tf.exports.Rand=$r;$r.prototype.generate=function(e){return this._rand(e)};$r.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),i=0;i<t.length;i++)t[i]=this.rand.getByte();return t};if(typeof self=="object")self.crypto&&self.crypto.getRandomValues?$r.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?$r.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:typeof window=="object"&&($r.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(ef=Td(),typeof ef.randomBytes!="function")throw new Error("Not supported");$r.prototype._rand=function(e){return ef.randomBytes(e)}}catch{}var ef});var jr=te((U2,Pd)=>{Pd.exports=Rd;function Rd(r,e){if(!r)throw new Error(e||"Assertion failed")}Rd.equal=function(e,t,i){if(e!=t)throw new Error(i||"Assertion failed: "+e+" != "+t)}});var Qn=te((H2,rf)=>{typeof Object.create=="function"?rf.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:rf.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}});var Wt=te(pe=>{"use strict";var K1=jr(),V1=Qn();pe.inherits=V1;function Z1(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}function W1(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),n=0;n<r.length;n+=2)t.push(parseInt(r[n]+r[n+1],16))}else for(var i=0,n=0;n<r.length;n++){var a=r.charCodeAt(n);a<128?t[i++]=a:a<2048?(t[i++]=a>>6|192,t[i++]=a&63|128):Z1(r,n)?(a=65536+((a&1023)<<10)+(r.charCodeAt(++n)&1023),t[i++]=a>>18|240,t[i++]=a>>12&63|128,t[i++]=a>>6&63|128,t[i++]=a&63|128):(t[i++]=a>>12|224,t[i++]=a>>6&63|128,t[i++]=a&63|128)}else for(n=0;n<r.length;n++)t[n]=r[n]|0;return t}pe.toArray=W1;function G1(r){for(var e="",t=0;t<r.length;t++)e+=Bd(r[t].toString(16));return e}pe.toHex=G1;function Nd(r){var e=r>>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}pe.htonl=Nd;function J1(r,e){for(var t="",i=0;i<r.length;i++){var n=r[i];e==="little"&&(n=Nd(n)),t+=Cd(n.toString(16))}return t}pe.toHex32=J1;function Bd(r){return r.length===1?"0"+r:r}pe.zero2=Bd;function Cd(r){return r.length===7?"0"+r:r.length===6?"00"+r:r.length===5?"000"+r:r.length===4?"0000"+r:r.length===3?"00000"+r:r.length===2?"000000"+r:r.length===1?"0000000"+r:r}pe.zero8=Cd;function X1(r,e,t,i){var n=t-e;K1(n%4===0);for(var a=new Array(n/4),o=0,s=e;o<a.length;o++,s+=4){var h;i==="big"?h=r[s]<<24|r[s+1]<<16|r[s+2]<<8|r[s+3]:h=r[s+3]<<24|r[s+2]<<16|r[s+1]<<8|r[s],a[o]=h>>>0}return a}pe.join32=X1;function Y1(r,e){for(var t=new Array(r.length*4),i=0,n=0;i<r.length;i++,n+=4){var a=r[i];e==="big"?(t[n]=a>>>24,t[n+1]=a>>>16&255,t[n+2]=a>>>8&255,t[n+3]=a&255):(t[n+3]=a>>>24,t[n+2]=a>>>16&255,t[n+1]=a>>>8&255,t[n]=a&255)}return t}pe.split32=Y1;function Q1(r,e){return r>>>e|r<<32-e}pe.rotr32=Q1;function ep(r,e){return r<<e|r>>>32-e}pe.rotl32=ep;function tp(r,e){return r+e>>>0}pe.sum32=tp;function rp(r,e,t){return r+e+t>>>0}pe.sum32_3=rp;function ip(r,e,t,i){return r+e+t+i>>>0}pe.sum32_4=ip;function np(r,e,t,i,n){return r+e+t+i+n>>>0}pe.sum32_5=np;function ap(r,e,t,i){var n=r[e],a=r[e+1],o=i+a>>>0,s=(o<i?1:0)+t+n;r[e]=s>>>0,r[e+1]=o}pe.sum64=ap;function op(r,e,t,i){var n=e+i>>>0,a=(n<e?1:0)+r+t;return a>>>0}pe.sum64_hi=op;function sp(r,e,t,i){var n=e+i;return n>>>0}pe.sum64_lo=sp;function fp(r,e,t,i,n,a,o,s){var h=0,d=e;d=d+i>>>0,h+=d<e?1:0,d=d+a>>>0,h+=d<a?1:0,d=d+s>>>0,h+=d<s?1:0;var p=r+t+n+o+h;return p>>>0}pe.sum64_4_hi=fp;function cp(r,e,t,i,n,a,o,s){var h=e+i+a+s;return h>>>0}pe.sum64_4_lo=cp;function dp(r,e,t,i,n,a,o,s,h,d){var p=0,A=e;A=A+i>>>0,p+=A<e?1:0,A=A+a>>>0,p+=A<a?1:0,A=A+s>>>0,p+=A<s?1:0,A=A+d>>>0,p+=A<d?1:0;var k=r+t+n+o+h+p;return k>>>0}pe.sum64_5_hi=dp;function lp(r,e,t,i,n,a,o,s,h,d){var p=e+i+a+s+d;return p>>>0}pe.sum64_5_lo=lp;function hp(r,e,t){var i=e<<32-t|r>>>t;return i>>>0}pe.rotr64_hi=hp;function up(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}pe.rotr64_lo=up;function pp(r,e,t){return r>>>t}pe.shr64_hi=pp;function bp(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}pe.shr64_lo=bp});var Qi=te(qd=>{"use strict";var zd=Wt(),yp=jr();function ho(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}qd.BlockHash=ho;ho.prototype.update=function(e,t){if(e=zd.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var i=e.length%this._delta8;this.pending=e.slice(e.length-i,e.length),this.pending.length===0&&(this.pending=null),e=zd.join32(e,0,e.length-i,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this};ho.prototype.digest=function(e){return this.update(this._pad()),yp(this.pending===null),this._digest(e)};ho.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,i=t-(e+this.padLength)%t,n=new Array(i+this.padLength);n[0]=128;for(var a=1;a<i;a++)n[a]=0;if(e<<=3,this.endian==="big"){for(var o=8;o<this.padLength;o++)n[a++]=0;n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=e>>>24&255,n[a++]=e>>>16&255,n[a++]=e>>>8&255,n[a++]=e&255}else for(n[a++]=e&255,n[a++]=e>>>8&255,n[a++]=e>>>16&255,n[a++]=e>>>24&255,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,o=8;o<this.padLength;o++)n[a++]=0;return n}});var nf=te(Sr=>{"use strict";var mp=Wt(),or=mp.rotr32;function vp(r,e,t,i){if(r===0)return Dd(e,t,i);if(r===1||r===3)return Od(e,t,i);if(r===2)return Ld(e,t,i)}Sr.ft_1=vp;function Dd(r,e,t){return r&e^~r&t}Sr.ch32=Dd;function Ld(r,e,t){return r&e^r&t^e&t}Sr.maj32=Ld;function Od(r,e,t){return r^e^t}Sr.p32=Od;function gp(r){return or(r,2)^or(r,13)^or(r,22)}Sr.s0_256=gp;function _p(r){return or(r,6)^or(r,11)^or(r,25)}Sr.s1_256=_p;function wp(r){return or(r,7)^or(r,18)^r>>>3}Sr.g0_256=wp;function xp(r){return or(r,17)^or(r,19)^r>>>10}Sr.g1_256=xp});var Hd=te((V2,Ud)=>{"use strict";var en=Wt(),Ap=Qi(),Sp=nf(),af=en.rotl32,ea=en.sum32,kp=en.sum32_5,Ep=Sp.ft_1,Fd=Ap.BlockHash,Mp=[1518500249,1859775393,2400959708,3395469782];function sr(){if(!(this instanceof sr))return new sr;Fd.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}en.inherits(sr,Fd);Ud.exports=sr;sr.blockSize=512;sr.outSize=160;sr.hmacStrength=80;sr.padLength=64;sr.prototype._update=function(e,t){for(var i=this.W,n=0;n<16;n++)i[n]=e[t+n];for(;n<i.length;n++)i[n]=af(i[n-3]^i[n-8]^i[n-14]^i[n-16],1);var a=this.h[0],o=this.h[1],s=this.h[2],h=this.h[3],d=this.h[4];for(n=0;n<i.length;n++){var p=~~(n/20),A=kp(af(a,5),Ep(p,o,s,h),d,i[n],Mp[p]);d=h,h=s,s=af(o,30),o=a,a=A}this.h[0]=ea(this.h[0],a),this.h[1]=ea(this.h[1],o),this.h[2]=ea(this.h[2],s),this.h[3]=ea(this.h[3],h),this.h[4]=ea(this.h[4],d)};sr.prototype._digest=function(e){return e==="hex"?en.toHex32(this.h,"big"):en.split32(this.h,"big")}});var of=te((Z2,jd)=>{"use strict";var tn=Wt(),Ip=Qi(),rn=nf(),Tp=jr(),Gt=tn.sum32,Rp=tn.sum32_4,Pp=tn.sum32_5,Np=rn.ch32,Bp=rn.maj32,Cp=rn.s0_256,zp=rn.s1_256,qp=rn.g0_256,Dp=rn.g1_256,$d=Ip.BlockHash,Lp=[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];function fr(){if(!(this instanceof fr))return new fr;$d.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Lp,this.W=new Array(64)}tn.inherits(fr,$d);jd.exports=fr;fr.blockSize=512;fr.outSize=256;fr.hmacStrength=192;fr.padLength=64;fr.prototype._update=function(e,t){for(var i=this.W,n=0;n<16;n++)i[n]=e[t+n];for(;n<i.length;n++)i[n]=Rp(Dp(i[n-2]),i[n-7],qp(i[n-15]),i[n-16]);var a=this.h[0],o=this.h[1],s=this.h[2],h=this.h[3],d=this.h[4],p=this.h[5],A=this.h[6],k=this.h[7];for(Tp(this.k.length===i.length),n=0;n<i.length;n++){var S=Pp(k,zp(d),Np(d,p,A),this.k[n],i[n]),E=Gt(Cp(a),Bp(a,o,s));k=A,A=p,p=d,d=Gt(h,S),h=s,s=o,o=a,a=Gt(S,E)}this.h[0]=Gt(this.h[0],a),this.h[1]=Gt(this.h[1],o),this.h[2]=Gt(this.h[2],s),this.h[3]=Gt(this.h[3],h),this.h[4]=Gt(this.h[4],d),this.h[5]=Gt(this.h[5],p),this.h[6]=Gt(this.h[6],A),this.h[7]=Gt(this.h[7],k)};fr.prototype._digest=function(e){return e==="hex"?tn.toHex32(this.h,"big"):tn.split32(this.h,"big")}});var Zd=te((W2,Vd)=>{"use strict";var sf=Wt(),Kd=of();function kr(){if(!(this instanceof kr))return new kr;Kd.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}sf.inherits(kr,Kd);Vd.exports=kr;kr.blockSize=512;kr.outSize=224;kr.hmacStrength=192;kr.padLength=64;kr.prototype._digest=function(e){return e==="hex"?sf.toHex32(this.h.slice(0,7),"big"):sf.split32(this.h.slice(0,7),"big")}});var df=te((G2,Xd)=>{"use strict";var wt=Wt(),Op=Qi(),Fp=jr(),cr=wt.rotr64_hi,dr=wt.rotr64_lo,Wd=wt.shr64_hi,Gd=wt.shr64_lo,Kr=wt.sum64,ff=wt.sum64_hi,cf=wt.sum64_lo,Up=wt.sum64_4_hi,Hp=wt.sum64_4_lo,$p=wt.sum64_5_hi,jp=wt.sum64_5_lo,Jd=Op.BlockHash,Kp=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Jt(){if(!(this instanceof Jt))return new Jt;Jd.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Kp,this.W=new Array(160)}wt.inherits(Jt,Jd);Xd.exports=Jt;Jt.blockSize=1024;Jt.outSize=512;Jt.hmacStrength=192;Jt.padLength=128;Jt.prototype._prepareBlock=function(e,t){for(var i=this.W,n=0;n<32;n++)i[n]=e[t+n];for(;n<i.length;n+=2){var a=rb(i[n-4],i[n-3]),o=ib(i[n-4],i[n-3]),s=i[n-14],h=i[n-13],d=eb(i[n-30],i[n-29]),p=tb(i[n-30],i[n-29]),A=i[n-32],k=i[n-31];i[n]=Up(a,o,s,h,d,p,A,k),i[n+1]=Hp(a,o,s,h,d,p,A,k)}};Jt.prototype._update=function(e,t){this._prepareBlock(e,t);var i=this.W,n=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],h=this.h[4],d=this.h[5],p=this.h[6],A=this.h[7],k=this.h[8],S=this.h[9],E=this.h[10],I=this.h[11],P=this.h[12],T=this.h[13],C=this.h[14],z=this.h[15];Fp(this.k.length===i.length);for(var N=0;N<i.length;N+=2){var j=C,J=z,D=Yp(k,S),O=Qp(k,S),L=Vp(k,S,E,I,P,T),x=Zp(k,S,E,I,P,T),f=this.k[N],u=this.k[N+1],m=i[N],v=i[N+1],y=$p(j,J,D,O,L,x,f,u,m,v),_=jp(j,J,D,O,L,x,f,u,m,v);j=Jp(n,a),J=Xp(n,a),D=Wp(n,a,o,s,h,d),O=Gp(n,a,o,s,h,d);var M=ff(j,J,D,O),g=cf(j,J,D,O);C=P,z=T,P=E,T=I,E=k,I=S,k=ff(p,A,y,_),S=cf(A,A,y,_),p=h,A=d,h=o,d=s,o=n,s=a,n=ff(y,_,M,g),a=cf(y,_,M,g)}Kr(this.h,0,n,a),Kr(this.h,2,o,s),Kr(this.h,4,h,d),Kr(this.h,6,p,A),Kr(this.h,8,k,S),Kr(this.h,10,E,I),Kr(this.h,12,P,T),Kr(this.h,14,C,z)};Jt.prototype._digest=function(e){return e==="hex"?wt.toHex32(this.h,"big"):wt.split32(this.h,"big")};function Vp(r,e,t,i,n){var a=r&t^~r&n;return a<0&&(a+=4294967296),a}function Zp(r,e,t,i,n,a){var o=e&i^~e&a;return o<0&&(o+=4294967296),o}function Wp(r,e,t,i,n){var a=r&t^r&n^t&n;return a<0&&(a+=4294967296),a}function Gp(r,e,t,i,n,a){var o=e&i^e&a^i&a;return o<0&&(o+=4294967296),o}function Jp(r,e){var t=cr(r,e,28),i=cr(e,r,2),n=cr(e,r,7),a=t^i^n;return a<0&&(a+=4294967296),a}function Xp(r,e){var t=dr(r,e,28),i=dr(e,r,2),n=dr(e,r,7),a=t^i^n;return a<0&&(a+=4294967296),a}function Yp(r,e){var t=cr(r,e,14),i=cr(r,e,18),n=cr(e,r,9),a=t^i^n;return a<0&&(a+=4294967296),a}function Qp(r,e){var t=dr(r,e,14),i=dr(r,e,18),n=dr(e,r,9),a=t^i^n;return a<0&&(a+=4294967296),a}function eb(r,e){var t=cr(r,e,1),i=cr(r,e,8),n=Wd(r,e,7),a=t^i^n;return a<0&&(a+=4294967296),a}function tb(r,e){var t=dr(r,e,1),i=dr(r,e,8),n=Gd(r,e,7),a=t^i^n;return a<0&&(a+=4294967296),a}function rb(r,e){var t=cr(r,e,19),i=cr(e,r,29),n=Wd(r,e,6),a=t^i^n;return a<0&&(a+=4294967296),a}function ib(r,e){var t=dr(r,e,19),i=dr(e,r,29),n=Gd(r,e,6),a=t^i^n;return a<0&&(a+=4294967296),a}});var e0=te((J2,Qd)=>{"use strict";var lf=Wt(),Yd=df();function Er(){if(!(this instanceof Er))return new Er;Yd.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}lf.inherits(Er,Yd);Qd.exports=Er;Er.blockSize=1024;Er.outSize=384;Er.hmacStrength=192;Er.padLength=128;Er.prototype._digest=function(e){return e==="hex"?lf.toHex32(this.h.slice(0,12),"big"):lf.split32(this.h.slice(0,12),"big")}});var t0=te(nn=>{"use strict";nn.sha1=Hd();nn.sha224=Zd();nn.sha256=of();nn.sha384=e0();nn.sha512=df()});var s0=te(o0=>{"use strict";var mi=Wt(),nb=Qi(),uo=mi.rotl32,r0=mi.sum32,ta=mi.sum32_3,i0=mi.sum32_4,a0=nb.BlockHash;function lr(){if(!(this instanceof lr))return new lr;a0.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}mi.inherits(lr,a0);o0.ripemd160=lr;lr.blockSize=512;lr.outSize=160;lr.hmacStrength=192;lr.padLength=64;lr.prototype._update=function(e,t){for(var i=this.h[0],n=this.h[1],a=this.h[2],o=this.h[3],s=this.h[4],h=i,d=n,p=a,A=o,k=s,S=0;S<80;S++){var E=r0(uo(i0(i,n0(S,n,a,o),e[sb[S]+t],ab(S)),cb[S]),s);i=s,s=o,o=uo(a,10),a=n,n=E,E=r0(uo(i0(h,n0(79-S,d,p,A),e[fb[S]+t],ob(S)),db[S]),k),h=k,k=A,A=uo(p,10),p=d,d=E}E=ta(this.h[1],a,A),this.h[1]=ta(this.h[2],o,k),this.h[2]=ta(this.h[3],s,h),this.h[3]=ta(this.h[4],i,d),this.h[4]=ta(this.h[0],n,p),this.h[0]=E};lr.prototype._digest=function(e){return e==="hex"?mi.toHex32(this.h,"little"):mi.split32(this.h,"little")};function n0(r,e,t,i){return r<=15?e^t^i:r<=31?e&t|~e&i:r<=47?(e|~t)^i:r<=63?e&i|t&~i:e^(t|~i)}function ab(r){return r<=15?0:r<=31?1518500249:r<=47?1859775393:r<=63?2400959708:2840853838}function ob(r){return r<=15?1352829926:r<=31?1548603684:r<=47?1836072691:r<=63?2053994217:0}var sb=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],fb=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],cb=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],db=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]});var c0=te((Q2,f0)=>{"use strict";var lb=Wt(),hb=jr();function an(r,e,t){if(!(this instanceof an))return new an(r,e,t);this.Hash=r,this.blockSize=r.blockSize/8,this.outSize=r.outSize/8,this.inner=null,this.outer=null,this._init(lb.toArray(e,t))}f0.exports=an;an.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),hb(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=new this.Hash().update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=new this.Hash().update(e)};an.prototype.update=function(e,t){return this.inner.update(e,t),this};an.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}});var ra=te(d0=>{var dt=d0;dt.utils=Wt();dt.common=Qi();dt.sha=t0();dt.ripemd=s0();dt.hmac=c0();dt.sha1=dt.sha.sha1;dt.sha256=dt.sha.sha256;dt.sha224=dt.sha.sha224;dt.sha384=dt.sha.sha384;dt.sha512=dt.sha.sha512;dt.ripemd160=dt.ripemd.ripemd160});var l0=te(()=>{});var Xt=te((h0,hf)=>{(function(r,e){"use strict";function t(x,f){if(!x)throw new Error(f||"Assertion failed")}function i(x,f){x.super_=f;var u=function(){};u.prototype=f.prototype,x.prototype=new u,x.prototype.constructor=x}function n(x,f,u){if(n.isBN(x))return x;this.negative=0,this.words=null,this.length=0,this.red=null,x!==null&&((f==="le"||f==="be")&&(u=f,f=10),this._init(x||0,f||10,u||"be"))}typeof r=="object"?r.exports=n:e.BN=n,n.BN=n,n.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=l0().Buffer}catch{}n.isBN=function(f){return f instanceof n?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===n.wordSize&&Array.isArray(f.words)},n.max=function(f,u){return f.cmp(u)>0?f:u},n.min=function(f,u){return f.cmp(u)<0?f:u},n.prototype._init=function(f,u,m){if(typeof f=="number")return this._initNumber(f,u,m);if(typeof f=="object")return this._initArray(f,u,m);u==="hex"&&(u=16),t(u===(u|0)&&u>=2&&u<=36),f=f.toString().replace(/\s+/g,"");var v=0;f[0]==="-"&&(v++,this.negative=1),v<f.length&&(u===16?this._parseHex(f,v,m):(this._parseBase(f,u,v),m==="le"&&this._initArray(this.toArray(),u,m)))},n.prototype._initNumber=function(f,u,m){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(t(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),m==="le"&&this._initArray(this.toArray(),u,m)},n.prototype._initArray=function(f,u,m){if(t(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var y,_,M=0;if(m==="be")for(v=f.length-1,y=0;v>=0;v-=3)_=f[v]|f[v-1]<<8|f[v-2]<<16,this.words[y]|=_<<M&67108863,this.words[y+1]=_>>>26-M&67108863,M+=24,M>=26&&(M-=26,y++);else if(m==="le")for(v=0,y=0;v<f.length;v+=3)_=f[v]|f[v+1]<<8|f[v+2]<<16,this.words[y]|=_<<M&67108863,this.words[y+1]=_>>>26-M&67108863,M+=24,M>=26&&(M-=26,y++);return this.strip()};function o(x,f){var u=x.charCodeAt(f);return u>=65&&u<=70?u-55:u>=97&&u<=102?u-87:u-48&15}function s(x,f,u){var m=o(x,u);return u-1>=f&&(m|=o(x,u-1)<<4),m}n.prototype._parseHex=function(f,u,m){this.length=Math.ceil((f.length-u)/6),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var y=0,_=0,M;if(m==="be")for(v=f.length-1;v>=u;v-=2)M=s(f,u,v)<<y,this.words[_]|=M&67108863,y>=18?(y-=18,_+=1,this.words[_]|=M>>>26):y+=8;else{var g=f.length-u;for(v=g%2===0?u+1:u;v<f.length;v+=2)M=s(f,u,v)<<y,this.words[_]|=M&67108863,y>=18?(y-=18,_+=1,this.words[_]|=M>>>26):y+=8}this.strip()};function h(x,f,u,m){for(var v=0,y=Math.min(x.length,u),_=f;_<y;_++){var M=x.charCodeAt(_)-48;v*=m,M>=49?v+=M-49+10:M>=17?v+=M-17+10:v+=M}return v}n.prototype._parseBase=function(f,u,m){this.words=[0],this.length=1;for(var v=0,y=1;y<=67108863;y*=u)v++;v--,y=y/u|0;for(var _=f.length-m,M=_%v,g=Math.min(_,_-M)+m,c=0,w=m;w<g;w+=v)c=h(f,w,w+v,u),this.imuln(y),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(M!==0){var $=1;for(c=h(f,w,f.length,u),w=0;w<M;w++)$*=u;this.imuln($),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},n.prototype.copy=function(f){f.words=new Array(this.length);for(var u=0;u<this.length;u++)f.words[u]=this.words[u];f.length=this.length,f.negative=this.negative,f.red=this.red},n.prototype.clone=function(){var f=new n(null);return this.copy(f),f},n.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},n.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},n.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];n.prototype.toString=function(f,u){f=f||10,u=u|0||1;var m;if(f===16||f==="hex"){m="";for(var v=0,y=0,_=0;_<this.length;_++){var M=this.words[_],g=((M<<v|y)&16777215).toString(16);y=M>>>24-v&16777215,v+=2,v>=26&&(v-=26,_--),y!==0||_!==this.length-1?m=d[6-g.length]+g+m:m=g+m}for(y!==0&&(m=y.toString(16)+m);m.length%u!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(f===(f|0)&&f>=2&&f<=36){var c=p[f],w=A[f];m="";var $=this.clone();for($.negative=0;!$.isZero();){var K=$.modn(w).toString(f);$=$.idivn(w),$.isZero()?m=K+m:m=d[c-K.length]+K+m}for(this.isZero()&&(m="0"+m);m.length%u!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}t(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(f,u){return t(typeof a<"u"),this.toArrayLike(a,f,u)},n.prototype.toArray=function(f,u){return this.toArrayLike(Array,f,u)},n.prototype.toArrayLike=function(f,u,m){var v=this.byteLength(),y=m||Math.max(1,v);t(v<=y,"byte array longer than desired length"),t(y>0,"Requested array length <= 0"),this.strip();var _=u==="le",M=new f(y),g,c,w=this.clone();if(_){for(c=0;!w.isZero();c++)g=w.andln(255),w.iushrn(8),M[c]=g;for(;c<y;c++)M[c]=0}else{for(c=0;c<y-v;c++)M[c]=0;for(c=0;!w.isZero();c++)g=w.andln(255),w.iushrn(8),M[y-c-1]=g}return M},Math.clz32?n.prototype._countBits=function(f){return 32-Math.clz32(f)}:n.prototype._countBits=function(f){var u=f,m=0;return u>=4096&&(m+=13,u>>>=13),u>=64&&(m+=7,u>>>=7),u>=8&&(m+=4,u>>>=4),u>=2&&(m+=2,u>>>=2),m+u},n.prototype._zeroBits=function(f){if(f===0)return 26;var u=f,m=0;return(u&8191)===0&&(m+=13,u>>>=13),(u&127)===0&&(m+=7,u>>>=7),(u&15)===0&&(m+=4,u>>>=4),(u&3)===0&&(m+=2,u>>>=2),(u&1)===0&&m++,m},n.prototype.bitLength=function(){var f=this.words[this.length-1],u=this._countBits(f);return(this.length-1)*26+u};function k(x){for(var f=new Array(x.bitLength()),u=0;u<f.length;u++){var m=u/26|0,v=u%26;f[u]=(x.words[m]&1<<v)>>>v}return f}n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,u=0;u<this.length;u++){var m=this._zeroBits(this.words[u]);if(f+=m,m!==26)break}return f},n.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},n.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},n.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},n.prototype.isNeg=function(){return this.negative!==0},n.prototype.neg=function(){return this.clone().ineg()},n.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},n.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var u=0;u<f.length;u++)this.words[u]=this.words[u]|f.words[u];return this.strip()},n.prototype.ior=function(f){return t((this.negative|f.negative)===0),this.iuor(f)},n.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},n.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},n.prototype.iuand=function(f){var u;this.length>f.length?u=f:u=this;for(var m=0;m<u.length;m++)this.words[m]=this.words[m]&f.words[m];return this.length=u.length,this.strip()},n.prototype.iand=function(f){return t((this.negative|f.negative)===0),this.iuand(f)},n.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},n.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},n.prototype.iuxor=function(f){var u,m;this.length>f.length?(u=this,m=f):(u=f,m=this);for(var v=0;v<m.length;v++)this.words[v]=u.words[v]^m.words[v];if(this!==u)for(;v<u.length;v++)this.words[v]=u.words[v];return this.length=u.length,this.strip()},n.prototype.ixor=function(f){return t((this.negative|f.negative)===0),this.iuxor(f)},n.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},n.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},n.prototype.inotn=function(f){t(typeof f=="number"&&f>=0);var u=Math.ceil(f/26)|0,m=f%26;this._expand(u),m>0&&u--;for(var v=0;v<u;v++)this.words[v]=~this.words[v]&67108863;return m>0&&(this.words[v]=~this.words[v]&67108863>>26-m),this.strip()},n.prototype.notn=function(f){return this.clone().inotn(f)},n.prototype.setn=function(f,u){t(typeof f=="number"&&f>=0);var m=f/26|0,v=f%26;return this._expand(m+1),u?this.words[m]=this.words[m]|1<<v:this.words[m]=this.words[m]&~(1<<v),this.strip()},n.prototype.iadd=function(f){var u;if(this.negative!==0&&f.negative===0)return this.negative=0,u=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,u=this.isub(f),f.negative=1,u._normSign();var m,v;this.length>f.length?(m=this,v=f):(m=f,v=this);for(var y=0,_=0;_<v.length;_++)u=(m.words[_]|0)+(v.words[_]|0)+y,this.words[_]=u&67108863,y=u>>>26;for(;y!==0&&_<m.length;_++)u=(m.words[_]|0)+y,this.words[_]=u&67108863,y=u>>>26;if(this.length=m.length,y!==0)this.words[this.length]=y,this.length++;else if(m!==this)for(;_<m.length;_++)this.words[_]=m.words[_];return this},n.prototype.add=function(f){var u;return f.negative!==0&&this.negative===0?(f.negative=0,u=this.sub(f),f.negative^=1,u):f.negative===0&&this.negative!==0?(this.negative=0,u=f.sub(this),this.negative=1,u):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},n.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var u=this.iadd(f);return f.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var m=this.cmp(f);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,y;m>0?(v=this,y=f):(v=f,y=this);for(var _=0,M=0;M<y.length;M++)u=(v.words[M]|0)-(y.words[M]|0)+_,_=u>>26,this.words[M]=u&67108863;for(;_!==0&&M<v.length;M++)u=(v.words[M]|0)+_,_=u>>26,this.words[M]=u&67108863;if(_===0&&M<v.length&&v!==this)for(;M<v.length;M++)this.words[M]=v.words[M];return this.length=Math.max(this.length,M),v!==this&&(this.negative=1),this.strip()},n.prototype.sub=function(f){return this.clone().isub(f)};function S(x,f,u){u.negative=f.negative^x.negative;var m=x.length+f.length|0;u.length=m,m=m-1|0;var v=x.words[0]|0,y=f.words[0]|0,_=v*y,M=_&67108863,g=_/67108864|0;u.words[0]=M;for(var c=1;c<m;c++){for(var w=g>>>26,$=g&67108863,K=Math.min(c,f.length-1),U=Math.max(0,c-x.length+1);U<=K;U++){var X=c-U|0;v=x.words[X]|0,y=f.words[U]|0,_=v*y+$,w+=_/67108864|0,$=_&67108863}u.words[c]=$|0,g=w|0}return g!==0?u.words[c]=g|0:u.length--,u.strip()}var E=function(f,u,m){var v=f.words,y=u.words,_=m.words,M=0,g,c,w,$=v[0]|0,K=$&8191,U=$>>>13,X=v[1]|0,oe=X&8191,le=X>>>13,Pt=v[2]|0,F=Pt&8191,q=Pt>>>13,Bn=v[3]|0,be=Bn&8191,ye=Bn>>>13,is=v[4]|0,ke=is&8191,Ee=is>>>13,Za=v[5]|0,Me=Za&8191,Ie=Za>>>13,Wa=v[6]|0,Te=Wa&8191,Re=Wa>>>13,Ga=v[7]|0,Pe=Ga&8191,Ne=Ga>>>13,Ja=v[8]|0,B=Ja&8191,R=Ja>>>13,V=v[9]|0,H=V&8191,Y=V>>>13,Ce=y[0]|0,Q=Ce&8191,ee=Ce>>>13,Nt=y[1]|0,fe=Nt&8191,ce=Nt>>>13,_r=y[2]|0,ue=_r&8191,me=_r>>>13,Cn=y[3]|0,ne=Cn&8191,De=Cn>>>13,ic=y[4]|0,Le=ic&8191,Oe=ic>>>13,nc=y[5]|0,Fe=nc&8191,Ue=nc>>>13,ac=y[6]|0,He=ac&8191,$e=ac>>>13,oc=y[7]|0,je=oc&8191,Ke=oc>>>13,sc=y[8]|0,Ve=sc&8191,Ze=sc>>>13,fc=y[9]|0,We=fc&8191,Ge=fc>>>13;m.negative=f.negative^u.negative,m.length=19,g=Math.imul(K,Q),c=Math.imul(K,ee),c=c+Math.imul(U,Q)|0,w=Math.imul(U,ee);var ns=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(ns>>>26)|0,ns&=67108863,g=Math.imul(oe,Q),c=Math.imul(oe,ee),c=c+Math.imul(le,Q)|0,w=Math.imul(le,ee),g=g+Math.imul(K,fe)|0,c=c+Math.imul(K,ce)|0,c=c+Math.imul(U,fe)|0,w=w+Math.imul(U,ce)|0;var as=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(as>>>26)|0,as&=67108863,g=Math.imul(F,Q),c=Math.imul(F,ee),c=c+Math.imul(q,Q)|0,w=Math.imul(q,ee),g=g+Math.imul(oe,fe)|0,c=c+Math.imul(oe,ce)|0,c=c+Math.imul(le,fe)|0,w=w+Math.imul(le,ce)|0,g=g+Math.imul(K,ue)|0,c=c+Math.imul(K,me)|0,c=c+Math.imul(U,ue)|0,w=w+Math.imul(U,me)|0;var os=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(os>>>26)|0,os&=67108863,g=Math.imul(be,Q),c=Math.imul(be,ee),c=c+Math.imul(ye,Q)|0,w=Math.imul(ye,ee),g=g+Math.imul(F,fe)|0,c=c+Math.imul(F,ce)|0,c=c+Math.imul(q,fe)|0,w=w+Math.imul(q,ce)|0,g=g+Math.imul(oe,ue)|0,c=c+Math.imul(oe,me)|0,c=c+Math.imul(le,ue)|0,w=w+Math.imul(le,me)|0,g=g+Math.imul(K,ne)|0,c=c+Math.imul(K,De)|0,c=c+Math.imul(U,ne)|0,w=w+Math.imul(U,De)|0;var ss=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(ss>>>26)|0,ss&=67108863,g=Math.imul(ke,Q),c=Math.imul(ke,ee),c=c+Math.imul(Ee,Q)|0,w=Math.imul(Ee,ee),g=g+Math.imul(be,fe)|0,c=c+Math.imul(be,ce)|0,c=c+Math.imul(ye,fe)|0,w=w+Math.imul(ye,ce)|0,g=g+Math.imul(F,ue)|0,c=c+Math.imul(F,me)|0,c=c+Math.imul(q,ue)|0,w=w+Math.imul(q,me)|0,g=g+Math.imul(oe,ne)|0,c=c+Math.imul(oe,De)|0,c=c+Math.imul(le,ne)|0,w=w+Math.imul(le,De)|0,g=g+Math.imul(K,Le)|0,c=c+Math.imul(K,Oe)|0,c=c+Math.imul(U,Le)|0,w=w+Math.imul(U,Oe)|0;var fs=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(fs>>>26)|0,fs&=67108863,g=Math.imul(Me,Q),c=Math.imul(Me,ee),c=c+Math.imul(Ie,Q)|0,w=Math.imul(Ie,ee),g=g+Math.imul(ke,fe)|0,c=c+Math.imul(ke,ce)|0,c=c+Math.imul(Ee,fe)|0,w=w+Math.imul(Ee,ce)|0,g=g+Math.imul(be,ue)|0,c=c+Math.imul(be,me)|0,c=c+Math.imul(ye,ue)|0,w=w+Math.imul(ye,me)|0,g=g+Math.imul(F,ne)|0,c=c+Math.imul(F,De)|0,c=c+Math.imul(q,ne)|0,w=w+Math.imul(q,De)|0,g=g+Math.imul(oe,Le)|0,c=c+Math.imul(oe,Oe)|0,c=c+Math.imul(le,Le)|0,w=w+Math.imul(le,Oe)|0,g=g+Math.imul(K,Fe)|0,c=c+Math.imul(K,Ue)|0,c=c+Math.imul(U,Fe)|0,w=w+Math.imul(U,Ue)|0;var cs=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(cs>>>26)|0,cs&=67108863,g=Math.imul(Te,Q),c=Math.imul(Te,ee),c=c+Math.imul(Re,Q)|0,w=Math.imul(Re,ee),g=g+Math.imul(Me,fe)|0,c=c+Math.imul(Me,ce)|0,c=c+Math.imul(Ie,fe)|0,w=w+Math.imul(Ie,ce)|0,g=g+Math.imul(ke,ue)|0,c=c+Math.imul(ke,me)|0,c=c+Math.imul(Ee,ue)|0,w=w+Math.imul(Ee,me)|0,g=g+Math.imul(be,ne)|0,c=c+Math.imul(be,De)|0,c=c+Math.imul(ye,ne)|0,w=w+Math.imul(ye,De)|0,g=g+Math.imul(F,Le)|0,c=c+Math.imul(F,Oe)|0,c=c+Math.imul(q,Le)|0,w=w+Math.imul(q,Oe)|0,g=g+Math.imul(oe,Fe)|0,c=c+Math.imul(oe,Ue)|0,c=c+Math.imul(le,Fe)|0,w=w+Math.imul(le,Ue)|0,g=g+Math.imul(K,He)|0,c=c+Math.imul(K,$e)|0,c=c+Math.imul(U,He)|0,w=w+Math.imul(U,$e)|0;var ds=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(ds>>>26)|0,ds&=67108863,g=Math.imul(Pe,Q),c=Math.imul(Pe,ee),c=c+Math.imul(Ne,Q)|0,w=Math.imul(Ne,ee),g=g+Math.imul(Te,fe)|0,c=c+Math.imul(Te,ce)|0,c=c+Math.imul(Re,fe)|0,w=w+Math.imul(Re,ce)|0,g=g+Math.imul(Me,ue)|0,c=c+Math.imul(Me,me)|0,c=c+Math.imul(Ie,ue)|0,w=w+Math.imul(Ie,me)|0,g=g+Math.imul(ke,ne)|0,c=c+Math.imul(ke,De)|0,c=c+Math.imul(Ee,ne)|0,w=w+Math.imul(Ee,De)|0,g=g+Math.imul(be,Le)|0,c=c+Math.imul(be,Oe)|0,c=c+Math.imul(ye,Le)|0,w=w+Math.imul(ye,Oe)|0,g=g+Math.imul(F,Fe)|0,c=c+Math.imul(F,Ue)|0,c=c+Math.imul(q,Fe)|0,w=w+Math.imul(q,Ue)|0,g=g+Math.imul(oe,He)|0,c=c+Math.imul(oe,$e)|0,c=c+Math.imul(le,He)|0,w=w+Math.imul(le,$e)|0,g=g+Math.imul(K,je)|0,c=c+Math.imul(K,Ke)|0,c=c+Math.imul(U,je)|0,w=w+Math.imul(U,Ke)|0;var ls=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(ls>>>26)|0,ls&=67108863,g=Math.imul(B,Q),c=Math.imul(B,ee),c=c+Math.imul(R,Q)|0,w=Math.imul(R,ee),g=g+Math.imul(Pe,fe)|0,c=c+Math.imul(Pe,ce)|0,c=c+Math.imul(Ne,fe)|0,w=w+Math.imul(Ne,ce)|0,g=g+Math.imul(Te,ue)|0,c=c+Math.imul(Te,me)|0,c=c+Math.imul(Re,ue)|0,w=w+Math.imul(Re,me)|0,g=g+Math.imul(Me,ne)|0,c=c+Math.imul(Me,De)|0,c=c+Math.imul(Ie,ne)|0,w=w+Math.imul(Ie,De)|0,g=g+Math.imul(ke,Le)|0,c=c+Math.imul(ke,Oe)|0,c=c+Math.imul(Ee,Le)|0,w=w+Math.imul(Ee,Oe)|0,g=g+Math.imul(be,Fe)|0,c=c+Math.imul(be,Ue)|0,c=c+Math.imul(ye,Fe)|0,w=w+Math.imul(ye,Ue)|0,g=g+Math.imul(F,He)|0,c=c+Math.imul(F,$e)|0,c=c+Math.imul(q,He)|0,w=w+Math.imul(q,$e)|0,g=g+Math.imul(oe,je)|0,c=c+Math.imul(oe,Ke)|0,c=c+Math.imul(le,je)|0,w=w+Math.imul(le,Ke)|0,g=g+Math.imul(K,Ve)|0,c=c+Math.imul(K,Ze)|0,c=c+Math.imul(U,Ve)|0,w=w+Math.imul(U,Ze)|0;var hs=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(hs>>>26)|0,hs&=67108863,g=Math.imul(H,Q),c=Math.imul(H,ee),c=c+Math.imul(Y,Q)|0,w=Math.imul(Y,ee),g=g+Math.imul(B,fe)|0,c=c+Math.imul(B,ce)|0,c=c+Math.imul(R,fe)|0,w=w+Math.imul(R,ce)|0,g=g+Math.imul(Pe,ue)|0,c=c+Math.imul(Pe,me)|0,c=c+Math.imul(Ne,ue)|0,w=w+Math.imul(Ne,me)|0,g=g+Math.imul(Te,ne)|0,c=c+Math.imul(Te,De)|0,c=c+Math.imul(Re,ne)|0,w=w+Math.imul(Re,De)|0,g=g+Math.imul(Me,Le)|0,c=c+Math.imul(Me,Oe)|0,c=c+Math.imul(Ie,Le)|0,w=w+Math.imul(Ie,Oe)|0,g=g+Math.imul(ke,Fe)|0,c=c+Math.imul(ke,Ue)|0,c=c+Math.imul(Ee,Fe)|0,w=w+Math.imul(Ee,Ue)|0,g=g+Math.imul(be,He)|0,c=c+Math.imul(be,$e)|0,c=c+Math.imul(ye,He)|0,w=w+Math.imul(ye,$e)|0,g=g+Math.imul(F,je)|0,c=c+Math.imul(F,Ke)|0,c=c+Math.imul(q,je)|0,w=w+Math.imul(q,Ke)|0,g=g+Math.imul(oe,Ve)|0,c=c+Math.imul(oe,Ze)|0,c=c+Math.imul(le,Ve)|0,w=w+Math.imul(le,Ze)|0,g=g+Math.imul(K,We)|0,c=c+Math.imul(K,Ge)|0,c=c+Math.imul(U,We)|0,w=w+Math.imul(U,Ge)|0;var us=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(us>>>26)|0,us&=67108863,g=Math.imul(H,fe),c=Math.imul(H,ce),c=c+Math.imul(Y,fe)|0,w=Math.imul(Y,ce),g=g+Math.imul(B,ue)|0,c=c+Math.imul(B,me)|0,c=c+Math.imul(R,ue)|0,w=w+Math.imul(R,me)|0,g=g+Math.imul(Pe,ne)|0,c=c+Math.imul(Pe,De)|0,c=c+Math.imul(Ne,ne)|0,w=w+Math.imul(Ne,De)|0,g=g+Math.imul(Te,Le)|0,c=c+Math.imul(Te,Oe)|0,c=c+Math.imul(Re,Le)|0,w=w+Math.imul(Re,Oe)|0,g=g+Math.imul(Me,Fe)|0,c=c+Math.imul(Me,Ue)|0,c=c+Math.imul(Ie,Fe)|0,w=w+Math.imul(Ie,Ue)|0,g=g+Math.imul(ke,He)|0,c=c+Math.imul(ke,$e)|0,c=c+Math.imul(Ee,He)|0,w=w+Math.imul(Ee,$e)|0,g=g+Math.imul(be,je)|0,c=c+Math.imul(be,Ke)|0,c=c+Math.imul(ye,je)|0,w=w+Math.imul(ye,Ke)|0,g=g+Math.imul(F,Ve)|0,c=c+Math.imul(F,Ze)|0,c=c+Math.imul(q,Ve)|0,w=w+Math.imul(q,Ze)|0,g=g+Math.imul(oe,We)|0,c=c+Math.imul(oe,Ge)|0,c=c+Math.imul(le,We)|0,w=w+Math.imul(le,Ge)|0;var ps=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(ps>>>26)|0,ps&=67108863,g=Math.imul(H,ue),c=Math.imul(H,me),c=c+Math.imul(Y,ue)|0,w=Math.imul(Y,me),g=g+Math.imul(B,ne)|0,c=c+Math.imul(B,De)|0,c=c+Math.imul(R,ne)|0,w=w+Math.imul(R,De)|0,g=g+Math.imul(Pe,Le)|0,c=c+Math.imul(Pe,Oe)|0,c=c+Math.imul(Ne,Le)|0,w=w+Math.imul(Ne,Oe)|0,g=g+Math.imul(Te,Fe)|0,c=c+Math.imul(Te,Ue)|0,c=c+Math.imul(Re,Fe)|0,w=w+Math.imul(Re,Ue)|0,g=g+Math.imul(Me,He)|0,c=c+Math.imul(Me,$e)|0,c=c+Math.imul(Ie,He)|0,w=w+Math.imul(Ie,$e)|0,g=g+Math.imul(ke,je)|0,c=c+Math.imul(ke,Ke)|0,c=c+Math.imul(Ee,je)|0,w=w+Math.imul(Ee,Ke)|0,g=g+Math.imul(be,Ve)|0,c=c+Math.imul(be,Ze)|0,c=c+Math.imul(ye,Ve)|0,w=w+Math.imul(ye,Ze)|0,g=g+Math.imul(F,We)|0,c=c+Math.imul(F,Ge)|0,c=c+Math.imul(q,We)|0,w=w+Math.imul(q,Ge)|0;var bs=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(bs>>>26)|0,bs&=67108863,g=Math.imul(H,ne),c=Math.imul(H,De),c=c+Math.imul(Y,ne)|0,w=Math.imul(Y,De),g=g+Math.imul(B,Le)|0,c=c+Math.imul(B,Oe)|0,c=c+Math.imul(R,Le)|0,w=w+Math.imul(R,Oe)|0,g=g+Math.imul(Pe,Fe)|0,c=c+Math.imul(Pe,Ue)|0,c=c+Math.imul(Ne,Fe)|0,w=w+Math.imul(Ne,Ue)|0,g=g+Math.imul(Te,He)|0,c=c+Math.imul(Te,$e)|0,c=c+Math.imul(Re,He)|0,w=w+Math.imul(Re,$e)|0,g=g+Math.imul(Me,je)|0,c=c+Math.imul(Me,Ke)|0,c=c+Math.imul(Ie,je)|0,w=w+Math.imul(Ie,Ke)|0,g=g+Math.imul(ke,Ve)|0,c=c+Math.imul(ke,Ze)|0,c=c+Math.imul(Ee,Ve)|0,w=w+Math.imul(Ee,Ze)|0,g=g+Math.imul(be,We)|0,c=c+Math.imul(be,Ge)|0,c=c+Math.imul(ye,We)|0,w=w+Math.imul(ye,Ge)|0;var ys=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(ys>>>26)|0,ys&=67108863,g=Math.imul(H,Le),c=Math.imul(H,Oe),c=c+Math.imul(Y,Le)|0,w=Math.imul(Y,Oe),g=g+Math.imul(B,Fe)|0,c=c+Math.imul(B,Ue)|0,c=c+Math.imul(R,Fe)|0,w=w+Math.imul(R,Ue)|0,g=g+Math.imul(Pe,He)|0,c=c+Math.imul(Pe,$e)|0,c=c+Math.imul(Ne,He)|0,w=w+Math.imul(Ne,$e)|0,g=g+Math.imul(Te,je)|0,c=c+Math.imul(Te,Ke)|0,c=c+Math.imul(Re,je)|0,w=w+Math.imul(Re,Ke)|0,g=g+Math.imul(Me,Ve)|0,c=c+Math.imul(Me,Ze)|0,c=c+Math.imul(Ie,Ve)|0,w=w+Math.imul(Ie,Ze)|0,g=g+Math.imul(ke,We)|0,c=c+Math.imul(ke,Ge)|0,c=c+Math.imul(Ee,We)|0,w=w+Math.imul(Ee,Ge)|0;var ms=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(ms>>>26)|0,ms&=67108863,g=Math.imul(H,Fe),c=Math.imul(H,Ue),c=c+Math.imul(Y,Fe)|0,w=Math.imul(Y,Ue),g=g+Math.imul(B,He)|0,c=c+Math.imul(B,$e)|0,c=c+Math.imul(R,He)|0,w=w+Math.imul(R,$e)|0,g=g+Math.imul(Pe,je)|0,c=c+Math.imul(Pe,Ke)|0,c=c+Math.imul(Ne,je)|0,w=w+Math.imul(Ne,Ke)|0,g=g+Math.imul(Te,Ve)|0,c=c+Math.imul(Te,Ze)|0,c=c+Math.imul(Re,Ve)|0,w=w+Math.imul(Re,Ze)|0,g=g+Math.imul(Me,We)|0,c=c+Math.imul(Me,Ge)|0,c=c+Math.imul(Ie,We)|0,w=w+Math.imul(Ie,Ge)|0;var vs=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(vs>>>26)|0,vs&=67108863,g=Math.imul(H,He),c=Math.imul(H,$e),c=c+Math.imul(Y,He)|0,w=Math.imul(Y,$e),g=g+Math.imul(B,je)|0,c=c+Math.imul(B,Ke)|0,c=c+Math.imul(R,je)|0,w=w+Math.imul(R,Ke)|0,g=g+Math.imul(Pe,Ve)|0,c=c+Math.imul(Pe,Ze)|0,c=c+Math.imul(Ne,Ve)|0,w=w+Math.imul(Ne,Ze)|0,g=g+Math.imul(Te,We)|0,c=c+Math.imul(Te,Ge)|0,c=c+Math.imul(Re,We)|0,w=w+Math.imul(Re,Ge)|0;var gs=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(gs>>>26)|0,gs&=67108863,g=Math.imul(H,je),c=Math.imul(H,Ke),c=c+Math.imul(Y,je)|0,w=Math.imul(Y,Ke),g=g+Math.imul(B,Ve)|0,c=c+Math.imul(B,Ze)|0,c=c+Math.imul(R,Ve)|0,w=w+Math.imul(R,Ze)|0,g=g+Math.imul(Pe,We)|0,c=c+Math.imul(Pe,Ge)|0,c=c+Math.imul(Ne,We)|0,w=w+Math.imul(Ne,Ge)|0;var _s=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(_s>>>26)|0,_s&=67108863,g=Math.imul(H,Ve),c=Math.imul(H,Ze),c=c+Math.imul(Y,Ve)|0,w=Math.imul(Y,Ze),g=g+Math.imul(B,We)|0,c=c+Math.imul(B,Ge)|0,c=c+Math.imul(R,We)|0,w=w+Math.imul(R,Ge)|0;var ws=(M+g|0)+((c&8191)<<13)|0;M=(w+(c>>>13)|0)+(ws>>>26)|0,ws&=67108863,g=Math.imul(H,We),c=Math.imul(H,Ge),c=c+Math.imul(Y,We)|0,w=Math.imul(Y,Ge);var xs=(M+g|0)+((c&8191)<<13)|0;return M=(w+(c>>>13)|0)+(xs>>>26)|0,xs&=67108863,_[0]=ns,_[1]=as,_[2]=os,_[3]=ss,_[4]=fs,_[5]=cs,_[6]=ds,_[7]=ls,_[8]=hs,_[9]=us,_[10]=ps,_[11]=bs,_[12]=ys,_[13]=ms,_[14]=vs,_[15]=gs,_[16]=_s,_[17]=ws,_[18]=xs,M!==0&&(_[19]=M,m.length++),m};Math.imul||(E=S);function I(x,f,u){u.negative=f.negative^x.negative,u.length=x.length+f.length;for(var m=0,v=0,y=0;y<u.length-1;y++){var _=v;v=0;for(var M=m&67108863,g=Math.min(y,f.length-1),c=Math.max(0,y-x.length+1);c<=g;c++){var w=y-c,$=x.words[w]|0,K=f.words[c]|0,U=$*K,X=U&67108863;_=_+(U/67108864|0)|0,X=X+M|0,M=X&67108863,_=_+(X>>>26)|0,v+=_>>>26,_&=67108863}u.words[y]=M,m=_,_=v}return m!==0?u.words[y]=m:u.length--,u.strip()}function P(x,f,u){var m=new T;return m.mulp(x,f,u)}n.prototype.mulTo=function(f,u){var m,v=this.length+f.length;return this.length===10&&f.length===10?m=E(this,f,u):v<63?m=S(this,f,u):v<1024?m=I(this,f,u):m=P(this,f,u),m};function T(x,f){this.x=x,this.y=f}T.prototype.makeRBT=function(f){for(var u=new Array(f),m=n.prototype._countBits(f)-1,v=0;v<f;v++)u[v]=this.revBin(v,m,f);return u},T.prototype.revBin=function(f,u,m){if(f===0||f===m-1)return f;for(var v=0,y=0;y<u;y++)v|=(f&1)<<u-y-1,f>>=1;return v},T.prototype.permute=function(f,u,m,v,y,_){for(var M=0;M<_;M++)v[M]=u[f[M]],y[M]=m[f[M]]},T.prototype.transform=function(f,u,m,v,y,_){this.permute(_,f,u,m,v,y);for(var M=1;M<y;M<<=1)for(var g=M<<1,c=Math.cos(2*Math.PI/g),w=Math.sin(2*Math.PI/g),$=0;$<y;$+=g)for(var K=c,U=w,X=0;X<M;X++){var oe=m[$+X],le=v[$+X],Pt=m[$+X+M],F=v[$+X+M],q=K*Pt-U*F;F=K*F+U*Pt,Pt=q,m[$+X]=oe+Pt,v[$+X]=le+F,m[$+X+M]=oe-Pt,v[$+X+M]=le-F,X!==g&&(q=c*K-w*U,U=c*U+w*K,K=q)}},T.prototype.guessLen13b=function(f,u){var m=Math.max(u,f)|1,v=m&1,y=0;for(m=m/2|0;m;m=m>>>1)y++;return 1<<y+1+v},T.prototype.conjugate=function(f,u,m){if(!(m<=1))for(var v=0;v<m/2;v++){var y=f[v];f[v]=f[m-v-1],f[m-v-1]=y,y=u[v],u[v]=-u[m-v-1],u[m-v-1]=-y}},T.prototype.normalize13b=function(f,u){for(var m=0,v=0;v<u/2;v++){var y=Math.round(f[2*v+1]/u)*8192+Math.round(f[2*v]/u)+m;f[v]=y&67108863,y<67108864?m=0:m=y/67108864|0}return f},T.prototype.convert13b=function(f,u,m,v){for(var y=0,_=0;_<u;_++)y=y+(f[_]|0),m[2*_]=y&8191,y=y>>>13,m[2*_+1]=y&8191,y=y>>>13;for(_=2*u;_<v;++_)m[_]=0;t(y===0),t((y&-8192)===0)},T.prototype.stub=function(f){for(var u=new Array(f),m=0;m<f;m++)u[m]=0;return u},T.prototype.mulp=function(f,u,m){var v=2*this.guessLen13b(f.length,u.length),y=this.makeRBT(v),_=this.stub(v),M=new Array(v),g=new Array(v),c=new Array(v),w=new Array(v),$=new Array(v),K=new Array(v),U=m.words;U.length=v,this.convert13b(f.words,f.length,M,v),this.convert13b(u.words,u.length,w,v),this.transform(M,_,g,c,v,y),this.transform(w,_,$,K,v,y);for(var X=0;X<v;X++){var oe=g[X]*$[X]-c[X]*K[X];c[X]=g[X]*K[X]+c[X]*$[X],g[X]=oe}return this.conjugate(g,c,v),this.transform(g,c,U,_,v,y),this.conjugate(U,_,v),this.normalize13b(U,v),m.negative=f.negative^u.negative,m.length=f.length+u.length,m.strip()},n.prototype.mul=function(f){var u=new n(null);return u.words=new Array(this.length+f.length),this.mulTo(f,u)},n.prototype.mulf=function(f){var u=new n(null);return u.words=new Array(this.length+f.length),P(this,f,u)},n.prototype.imul=function(f){return this.clone().mulTo(f,this)},n.prototype.imuln=function(f){t(typeof f=="number"),t(f<67108864);for(var u=0,m=0;m<this.length;m++){var v=(this.words[m]|0)*f,y=(v&67108863)+(u&67108863);u>>=26,u+=v/67108864|0,u+=y>>>26,this.words[m]=y&67108863}return u!==0&&(this.words[m]=u,this.length++),this.length=f===0?1:this.length,this},n.prototype.muln=function(f){return this.clone().imuln(f)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(f){var u=k(f);if(u.length===0)return new n(1);for(var m=this,v=0;v<u.length&&u[v]===0;v++,m=m.sqr());if(++v<u.length)for(var y=m.sqr();v<u.length;v++,y=y.sqr())u[v]!==0&&(m=m.mul(y));return m},n.prototype.iushln=function(f){t(typeof f=="number"&&f>=0);var u=f%26,m=(f-u)/26,v=67108863>>>26-u<<26-u,y;if(u!==0){var _=0;for(y=0;y<this.length;y++){var M=this.words[y]&v,g=(this.words[y]|0)-M<<u;this.words[y]=g|_,_=M>>>26-u}_&&(this.words[y]=_,this.length++)}if(m!==0){for(y=this.length-1;y>=0;y--)this.words[y+m]=this.words[y];for(y=0;y<m;y++)this.words[y]=0;this.length+=m}return this.strip()},n.prototype.ishln=function(f){return t(this.negative===0),this.iushln(f)},n.prototype.iushrn=function(f,u,m){t(typeof f=="number"&&f>=0);var v;u?v=(u-u%26)/26:v=0;var y=f%26,_=Math.min((f-y)/26,this.length),M=67108863^67108863>>>y<<y,g=m;if(v-=_,v=Math.max(0,v),g){for(var c=0;c<_;c++)g.words[c]=this.words[c];g.length=_}if(_!==0)if(this.length>_)for(this.length-=_,c=0;c<this.length;c++)this.words[c]=this.words[c+_];else this.words[0]=0,this.length=1;var w=0;for(c=this.length-1;c>=0&&(w!==0||c>=v);c--){var $=this.words[c]|0;this.words[c]=w<<26-y|$>>>y,w=$&M}return g&&w!==0&&(g.words[g.length++]=w),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(f,u,m){return t(this.negative===0),this.iushrn(f,u,m)},n.prototype.shln=function(f){return this.clone().ishln(f)},n.prototype.ushln=function(f){return this.clone().iushln(f)},n.prototype.shrn=function(f){return this.clone().ishrn(f)},n.prototype.ushrn=function(f){return this.clone().iushrn(f)},n.prototype.testn=function(f){t(typeof f=="number"&&f>=0);var u=f%26,m=(f-u)/26,v=1<<u;if(this.length<=m)return!1;var y=this.words[m];return!!(y&v)},n.prototype.imaskn=function(f){t(typeof f=="number"&&f>=0);var u=f%26,m=(f-u)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(u!==0&&m++,this.length=Math.min(m,this.length),u!==0){var v=67108863^67108863>>>u<<u;this.words[this.length-1]&=v}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.maskn=function(f){return this.clone().imaskn(f)},n.prototype.iaddn=function(f){return t(typeof f=="number"),t(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},n.prototype._iaddn=function(f){this.words[0]+=f;for(var u=0;u<this.length&&this.words[u]>=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},n.prototype.isubn=function(f){if(t(typeof f=="number"),t(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u<this.length&&this.words[u]<0;u++)this.words[u]+=67108864,this.words[u+1]-=1;return this.strip()},n.prototype.addn=function(f){return this.clone().iaddn(f)},n.prototype.subn=function(f){return this.clone().isubn(f)},n.prototype.iabs=function(){return this.negative=0,this},n.prototype.abs=function(){return this.clone().iabs()},n.prototype._ishlnsubmul=function(f,u,m){var v=f.length+m,y;this._expand(v);var _,M=0;for(y=0;y<f.length;y++){_=(this.words[y+m]|0)+M;var g=(f.words[y]|0)*u;_-=g&67108863,M=(_>>26)-(g/67108864|0),this.words[y+m]=_&67108863}for(;y<this.length-m;y++)_=(this.words[y+m]|0)+M,M=_>>26,this.words[y+m]=_&67108863;if(M===0)return this.strip();for(t(M===-1),M=0,y=0;y<this.length;y++)_=-(this.words[y]|0)+M,M=_>>26,this.words[y]=_&67108863;return this.negative=1,this.strip()},n.prototype._wordDiv=function(f,u){var m=this.length-f.length,v=this.clone(),y=f,_=y.words[y.length-1]|0,M=this._countBits(_);m=26-M,m!==0&&(y=y.ushln(m),v.iushln(m),_=y.words[y.length-1]|0);var g=v.length-y.length,c;if(u!=="mod"){c=new n(null),c.length=g+1,c.words=new Array(c.length);for(var w=0;w<c.length;w++)c.words[w]=0}var $=v.clone()._ishlnsubmul(y,1,g);$.negative===0&&(v=$,c&&(c.words[g]=1));for(var K=g-1;K>=0;K--){var U=(v.words[y.length+K]|0)*67108864+(v.words[y.length+K-1]|0);for(U=Math.min(U/_|0,67108863),v._ishlnsubmul(y,U,K);v.negative!==0;)U--,v.negative=0,v._ishlnsubmul(y,1,K),v.isZero()||(v.negative^=1);c&&(c.words[K]=U)}return c&&c.strip(),v.strip(),u!=="div"&&m!==0&&v.iushrn(m),{div:c||null,mod:v}},n.prototype.divmod=function(f,u,m){if(t(!f.isZero()),this.isZero())return{div:new n(0),mod:new n(0)};var v,y,_;return this.negative!==0&&f.negative===0?(_=this.neg().divmod(f,u),u!=="mod"&&(v=_.div.neg()),u!=="div"&&(y=_.mod.neg(),m&&y.negative!==0&&y.iadd(f)),{div:v,mod:y}):this.negative===0&&f.negative!==0?(_=this.divmod(f.neg(),u),u!=="mod"&&(v=_.div.neg()),{div:v,mod:_.mod}):(this.negative&f.negative)!==0?(_=this.neg().divmod(f.neg(),u),u!=="div"&&(y=_.mod.neg(),m&&y.negative!==0&&y.isub(f)),{div:_.div,mod:y}):f.length>this.length||this.cmp(f)<0?{div:new n(0),mod:this}:f.length===1?u==="div"?{div:this.divn(f.words[0]),mod:null}:u==="mod"?{div:null,mod:new n(this.modn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new n(this.modn(f.words[0]))}:this._wordDiv(f,u)},n.prototype.div=function(f){return this.divmod(f,"div",!1).div},n.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},n.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},n.prototype.divRound=function(f){var u=this.divmod(f);if(u.mod.isZero())return u.div;var m=u.div.negative!==0?u.mod.isub(f):u.mod,v=f.ushrn(1),y=f.andln(1),_=m.cmp(v);return _<0||y===1&&_===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},n.prototype.modn=function(f){t(f<=67108863);for(var u=(1<<26)%f,m=0,v=this.length-1;v>=0;v--)m=(u*m+(this.words[v]|0))%f;return m},n.prototype.idivn=function(f){t(f<=67108863);for(var u=0,m=this.length-1;m>=0;m--){var v=(this.words[m]|0)+u*67108864;this.words[m]=v/f|0,u=v%f}return this.strip()},n.prototype.divn=function(f){return this.clone().idivn(f)},n.prototype.egcd=function(f){t(f.negative===0),t(!f.isZero());var u=this,m=f.clone();u.negative!==0?u=u.umod(f):u=u.clone();for(var v=new n(1),y=new n(0),_=new n(0),M=new n(1),g=0;u.isEven()&&m.isEven();)u.iushrn(1),m.iushrn(1),++g;for(var c=m.clone(),w=u.clone();!u.isZero();){for(var $=0,K=1;(u.words[0]&K)===0&&$<26;++$,K<<=1);if($>0)for(u.iushrn($);$-- >0;)(v.isOdd()||y.isOdd())&&(v.iadd(c),y.isub(w)),v.iushrn(1),y.iushrn(1);for(var U=0,X=1;(m.words[0]&X)===0&&U<26;++U,X<<=1);if(U>0)for(m.iushrn(U);U-- >0;)(_.isOdd()||M.isOdd())&&(_.iadd(c),M.isub(w)),_.iushrn(1),M.iushrn(1);u.cmp(m)>=0?(u.isub(m),v.isub(_),y.isub(M)):(m.isub(u),_.isub(v),M.isub(y))}return{a:_,b:M,gcd:m.iushln(g)}},n.prototype._invmp=function(f){t(f.negative===0),t(!f.isZero());var u=this,m=f.clone();u.negative!==0?u=u.umod(f):u=u.clone();for(var v=new n(1),y=new n(0),_=m.clone();u.cmpn(1)>0&&m.cmpn(1)>0;){for(var M=0,g=1;(u.words[0]&g)===0&&M<26;++M,g<<=1);if(M>0)for(u.iushrn(M);M-- >0;)v.isOdd()&&v.iadd(_),v.iushrn(1);for(var c=0,w=1;(m.words[0]&w)===0&&c<26;++c,w<<=1);if(c>0)for(m.iushrn(c);c-- >0;)y.isOdd()&&y.iadd(_),y.iushrn(1);u.cmp(m)>=0?(u.isub(m),v.isub(y)):(m.isub(u),y.isub(v))}var $;return u.cmpn(1)===0?$=v:$=y,$.cmpn(0)<0&&$.iadd(f),$},n.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var u=this.clone(),m=f.clone();u.negative=0,m.negative=0;for(var v=0;u.isEven()&&m.isEven();v++)u.iushrn(1),m.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;m.isEven();)m.iushrn(1);var y=u.cmp(m);if(y<0){var _=u;u=m,m=_}else if(y===0||m.cmpn(1)===0)break;u.isub(m)}while(!0);return m.iushln(v)},n.prototype.invm=function(f){return this.egcd(f).a.umod(f)},n.prototype.isEven=function(){return(this.words[0]&1)===0},n.prototype.isOdd=function(){return(this.words[0]&1)===1},n.prototype.andln=function(f){return this.words[0]&f},n.prototype.bincn=function(f){t(typeof f=="number");var u=f%26,m=(f-u)/26,v=1<<u;if(this.length<=m)return this._expand(m+1),this.words[m]|=v,this;for(var y=v,_=m;y!==0&&_<this.length;_++){var M=this.words[_]|0;M+=y,y=M>>>26,M&=67108863,this.words[_]=M}return y!==0&&(this.words[_]=y,this.length++),this},n.prototype.isZero=function(){return this.length===1&&this.words[0]===0},n.prototype.cmpn=function(f){var u=f<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this.strip();var m;if(this.length>1)m=1;else{u&&(f=-f),t(f<=67108863,"Number is too big");var v=this.words[0]|0;m=v===f?0:v<f?-1:1}return this.negative!==0?-m|0:m},n.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var u=this.ucmp(f);return this.negative!==0?-u|0:u},n.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var u=0,m=this.length-1;m>=0;m--){var v=this.words[m]|0,y=f.words[m]|0;if(v!==y){v<y?u=-1:v>y&&(u=1);break}}return u},n.prototype.gtn=function(f){return this.cmpn(f)===1},n.prototype.gt=function(f){return this.cmp(f)===1},n.prototype.gten=function(f){return this.cmpn(f)>=0},n.prototype.gte=function(f){return this.cmp(f)>=0},n.prototype.ltn=function(f){return this.cmpn(f)===-1},n.prototype.lt=function(f){return this.cmp(f)===-1},n.prototype.lten=function(f){return this.cmpn(f)<=0},n.prototype.lte=function(f){return this.cmp(f)<=0},n.prototype.eqn=function(f){return this.cmpn(f)===0},n.prototype.eq=function(f){return this.cmp(f)===0},n.red=function(f){return new O(f)},n.prototype.toRed=function(f){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},n.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(f){return this.red=f,this},n.prototype.forceRed=function(f){return t(!this.red,"Already a number in reduction context"),this._forceRed(f)},n.prototype.redAdd=function(f){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},n.prototype.redIAdd=function(f){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},n.prototype.redSub=function(f){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},n.prototype.redISub=function(f){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},n.prototype.redShl=function(f){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},n.prototype.redMul=function(f){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},n.prototype.redIMul=function(f){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},n.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(f){return t(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var C={k256:null,p224:null,p192:null,p25519:null};function z(x,f){this.name=x,this.p=new n(f,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var f=new n(null);return f.words=new Array(Math.ceil(this.n/13)),f},z.prototype.ireduce=function(f){var u=f,m;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),m=u.bitLength();while(m>this.n);var v=m<this.n?-1:u.ucmp(this.p);return v===0?(u.words[0]=0,u.length=1):v>0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},z.prototype.split=function(f,u){f.iushrn(this.n,0,u)},z.prototype.imulK=function(f){return f.imul(this.k)};function N(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(N,z),N.prototype.split=function(f,u){for(var m=4194303,v=Math.min(f.length,9),y=0;y<v;y++)u.words[y]=f.words[y];if(u.length=v,f.length<=9){f.words[0]=0,f.length=1;return}var _=f.words[9];for(u.words[u.length++]=_&m,y=10;y<f.length;y++){var M=f.words[y]|0;f.words[y-10]=(M&m)<<4|_>>>22,_=M}_>>>=22,f.words[y-10]=_,_===0&&f.length>10?f.length-=10:f.length-=9},N.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var u=0,m=0;m<f.length;m++){var v=f.words[m]|0;u+=v*977,f.words[m]=u&67108863,u=v*64+(u/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function j(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(j,z);function J(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(J,z);function D(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(D,z),D.prototype.imulK=function(f){for(var u=0,m=0;m<f.length;m++){var v=(f.words[m]|0)*19+u,y=v&67108863;v>>>=26,f.words[m]=y,u=v}return u!==0&&(f.words[f.length++]=u),f},n._prime=function(f){if(C[f])return C[f];var u;if(f==="k256")u=new N;else if(f==="p224")u=new j;else if(f==="p192")u=new J;else if(f==="p25519")u=new D;else throw new Error("Unknown prime "+f);return C[f]=u,u};function O(x){if(typeof x=="string"){var f=n._prime(x);this.m=f.p,this.prime=f}else t(x.gtn(1),"modulus must be greater than 1"),this.m=x,this.prime=null}O.prototype._verify1=function(f){t(f.negative===0,"red works only with positives"),t(f.red,"red works only with red numbers")},O.prototype._verify2=function(f,u){t((f.negative|u.negative)===0,"red works only with positives"),t(f.red&&f.red===u.red,"red works only with red numbers")},O.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):f.umod(this.m)._forceRed(this)},O.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},O.prototype.add=function(f,u){this._verify2(f,u);var m=f.add(u);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},O.prototype.iadd=function(f,u){this._verify2(f,u);var m=f.iadd(u);return m.cmp(this.m)>=0&&m.isub(this.m),m},O.prototype.sub=function(f,u){this._verify2(f,u);var m=f.sub(u);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},O.prototype.isub=function(f,u){this._verify2(f,u);var m=f.isub(u);return m.cmpn(0)<0&&m.iadd(this.m),m},O.prototype.shl=function(f,u){return this._verify1(f),this.imod(f.ushln(u))},O.prototype.imul=function(f,u){return this._verify2(f,u),this.imod(f.imul(u))},O.prototype.mul=function(f,u){return this._verify2(f,u),this.imod(f.mul(u))},O.prototype.isqr=function(f){return this.imul(f,f.clone())},O.prototype.sqr=function(f){return this.mul(f,f)},O.prototype.sqrt=function(f){if(f.isZero())return f.clone();var u=this.m.andln(3);if(t(u%2===1),u===3){var m=this.m.add(new n(1)).iushrn(2);return this.pow(f,m)}for(var v=this.m.subn(1),y=0;!v.isZero()&&v.andln(1)===0;)y++,v.iushrn(1);t(!v.isZero());var _=new n(1).toRed(this),M=_.redNeg(),g=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new n(2*c*c).toRed(this);this.pow(c,g).cmp(M)!==0;)c.redIAdd(M);for(var w=this.pow(c,v),$=this.pow(f,v.addn(1).iushrn(1)),K=this.pow(f,v),U=y;K.cmp(_)!==0;){for(var X=K,oe=0;X.cmp(_)!==0;oe++)X=X.redSqr();t(oe<U);var le=this.pow(w,new n(1).iushln(U-oe-1));$=$.redMul(le),w=le.redSqr(),K=K.redMul(w),U=oe}return $},O.prototype.invm=function(f){var u=f._invmp(this.m);return u.negative!==0?(u.negative=0,this.imod(u).redNeg()):this.imod(u)},O.prototype.pow=function(f,u){if(u.isZero())return new n(1).toRed(this);if(u.cmpn(1)===0)return f.clone();var m=4,v=new Array(1<<m);v[0]=new n(1).toRed(this),v[1]=f;for(var y=2;y<v.length;y++)v[y]=this.mul(v[y-1],f);var _=v[0],M=0,g=0,c=u.bitLength()%26;for(c===0&&(c=26),y=u.length-1;y>=0;y--){for(var w=u.words[y],$=c-1;$>=0;$--){var K=w>>$&1;if(_!==v[0]&&(_=this.sqr(_)),K===0&&M===0){g=0;continue}M<<=1,M|=K,g++,!(g!==m&&(y!==0||$!==0))&&(_=this.mul(_,v[M]),g=0,M=0)}c=26}return _},O.prototype.convertTo=function(f){var u=f.umod(this.m);return u===f?u.clone():u},O.prototype.convertFrom=function(f){var u=f.clone();return u.red=null,u},n.mont=function(f){return new L(f)};function L(x){O.call(this,x),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(L,O),L.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},L.prototype.convertFrom=function(f){var u=this.imod(f.mul(this.rinv));return u.red=null,u},L.prototype.imul=function(f,u){if(f.isZero()||u.isZero())return f.words[0]=0,f.length=1,f;var m=f.imul(u),v=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=m.isub(v).iushrn(this.shift),_=y;return y.cmp(this.m)>=0?_=y.isub(this.m):y.cmpn(0)<0&&(_=y.iadd(this.m)),_._forceRed(this)},L.prototype.mul=function(f,u){if(f.isZero()||u.isZero())return new n(0)._forceRed(this);var m=f.mul(u),v=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=m.isub(v).iushrn(this.shift),_=y;return y.cmp(this.m)>=0?_=y.isub(this.m):y.cmpn(0)<0&&(_=y.iadd(this.m)),_._forceRed(this)},L.prototype.invm=function(f){var u=this.imod(f._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(typeof hf>"u"||hf,h0)});var u0=te((i3,ub)=>{ub.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}});var uf=te(y0=>{"use strict";var po=y0;function pb(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r!="string"){for(var i=0;i<r.length;i++)t[i]=r[i]|0;return t}if(e==="hex"){r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r);for(var i=0;i<r.length;i+=2)t.push(parseInt(r[i]+r[i+1],16))}else for(var i=0;i<r.length;i++){var n=r.charCodeAt(i),a=n>>8,o=n&255;a?t.push(a,o):t.push(o)}return t}po.toArray=pb;function p0(r){return r.length===1?"0"+r:r}po.zero2=p0;function b0(r){for(var e="",t=0;t<r.length;t++)e+=p0(r[t].toString(16));return e}po.toHex=b0;po.encode=function(e,t){return t==="hex"?b0(e):e}});var Mt=te(m0=>{"use strict";var Yt=m0,bb=Xt(),yb=jr(),bo=uf();Yt.assert=yb;Yt.toArray=bo.toArray;Yt.zero2=bo.zero2;Yt.toHex=bo.toHex;Yt.encode=bo.encode;function mb(r,e,t){var i=new Array(Math.max(r.bitLength(),t)+1),n;for(n=0;n<i.length;n+=1)i[n]=0;var a=1<<e+1,o=r.clone();for(n=0;n<i.length;n++){var s,h=o.andln(a-1);o.isOdd()?(h>(a>>1)-1?s=(a>>1)-h:s=h,o.isubn(s)):s=0,i[n]=s,o.iushrn(1)}return i}Yt.getNAF=mb;function vb(r,e){var t=[[],[]];r=r.clone(),e=e.clone();for(var i=0,n=0,a;r.cmpn(-i)>0||e.cmpn(-n)>0;){var o=r.andln(3)+i&3,s=e.andln(3)+n&3;o===3&&(o=-1),s===3&&(s=-1);var h;(o&1)===0?h=0:(a=r.andln(7)+i&7,(a===3||a===5)&&s===2?h=-o:h=o),t[0].push(h);var d;(s&1)===0?d=0:(a=e.andln(7)+n&7,(a===3||a===5)&&o===2?d=-s:d=s),t[1].push(d),2*i===h+1&&(i=1-i),2*n===d+1&&(n=1-n),r.iushrn(1),e.iushrn(1)}return t}Yt.getJSF=vb;function gb(r,e,t){var i="_"+e;r.prototype[e]=function(){return this[i]!==void 0?this[i]:this[i]=t.call(this)}}Yt.cachedProperty=gb;function _b(r){return typeof r=="string"?Yt.toArray(r,"hex"):r}Yt.parseBytes=_b;function wb(r){return new bb(r,"hex","le")}Yt.intFromLE=wb});var na=te((o3,v0)=>{"use strict";var vi=Xt(),ia=Mt(),yo=ia.getNAF,xb=ia.getJSF,mo=ia.assert;function Vr(r,e){this.type=r,this.p=new vi(e.p,16),this.red=e.prime?vi.red(e.prime):vi.mont(this.p),this.zero=new vi(0).toRed(this.red),this.one=new vi(1).toRed(this.red),this.two=new vi(2).toRed(this.red),this.n=e.n&&new vi(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}v0.exports=Vr;Vr.prototype.point=function(){throw new Error("Not implemented")};Vr.prototype.validate=function(){throw new Error("Not implemented")};Vr.prototype._fixedNafMul=function(e,t){mo(e.precomputed);var i=e._getDoubles(),n=yo(t,1,this._bitLength),a=(1<<i.step+1)-(i.step%2===0?2:1);a/=3;var o=[],s,h;for(s=0;s<n.length;s+=i.step){h=0;for(var d=s+i.step-1;d>=s;d--)h=(h<<1)+n[d];o.push(h)}for(var p=this.jpoint(null,null,null),A=this.jpoint(null,null,null),k=a;k>0;k--){for(s=0;s<o.length;s++)h=o[s],h===k?A=A.mixedAdd(i.points[s]):h===-k&&(A=A.mixedAdd(i.points[s].neg()));p=p.add(A)}return p.toP()};Vr.prototype._wnafMul=function(e,t){var i=4,n=e._getNAFPoints(i);i=n.wnd;for(var a=n.points,o=yo(t,i,this._bitLength),s=this.jpoint(null,null,null),h=o.length-1;h>=0;h--){for(var d=0;h>=0&&o[h]===0;h--)d++;if(h>=0&&d++,s=s.dblp(d),h<0)break;var p=o[h];mo(p!==0),e.type==="affine"?p>0?s=s.mixedAdd(a[p-1>>1]):s=s.mixedAdd(a[-p-1>>1].neg()):p>0?s=s.add(a[p-1>>1]):s=s.add(a[-p-1>>1].neg())}return e.type==="affine"?s.toP():s};Vr.prototype._wnafMulAdd=function(e,t,i,n,a){var o=this._wnafT1,s=this._wnafT2,h=this._wnafT3,d=0,p,A,k;for(p=0;p<n;p++){k=t[p];var S=k._getNAFPoints(e);o[p]=S.wnd,s[p]=S.points}for(p=n-1;p>=1;p-=2){var E=p-1,I=p;if(o[E]!==1||o[I]!==1){h[E]=yo(i[E],o[E],this._bitLength),h[I]=yo(i[I],o[I],this._bitLength),d=Math.max(h[E].length,d),d=Math.max(h[I].length,d);continue}var P=[t[E],null,null,t[I]];t[E].y.cmp(t[I].y)===0?(P[1]=t[E].add(t[I]),P[2]=t[E].toJ().mixedAdd(t[I].neg())):t[E].y.cmp(t[I].y.redNeg())===0?(P[1]=t[E].toJ().mixedAdd(t[I]),P[2]=t[E].add(t[I].neg())):(P[1]=t[E].toJ().mixedAdd(t[I]),P[2]=t[E].toJ().mixedAdd(t[I].neg()));var T=[-3,-1,-5,-7,0,7,5,1,3],C=xb(i[E],i[I]);for(d=Math.max(C[0].length,d),h[E]=new Array(d),h[I]=new Array(d),A=0;A<d;A++){var z=C[0][A]|0,N=C[1][A]|0;h[E][A]=T[(z+1)*3+(N+1)],h[I][A]=0,s[E]=P}}var j=this.jpoint(null,null,null),J=this._wnafT4;for(p=d;p>=0;p--){for(var D=0;p>=0;){var O=!0;for(A=0;A<n;A++)J[A]=h[A][p]|0,J[A]!==0&&(O=!1);if(!O)break;D++,p--}if(p>=0&&D++,j=j.dblp(D),p<0)break;for(A=0;A<n;A++){var L=J[A];L!==0&&(L>0?k=s[A][L-1>>1]:L<0&&(k=s[A][-L-1>>1].neg()),k.type==="affine"?j=j.mixedAdd(k):j=j.add(k))}}for(p=0;p<n;p++)s[p]=null;return a?j:j.toP()};function zt(r,e){this.curve=r,this.type=e,this.precomputed=null}Vr.BasePoint=zt;zt.prototype.eq=function(){throw new Error("Not implemented")};zt.prototype.validate=function(){return this.curve.validate(this)};Vr.prototype.decodePoint=function(e,t){e=ia.toArray(e,t);var i=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*i){e[0]===6?mo(e[e.length-1]%2===0):e[0]===7&&mo(e[e.length-1]%2===1);var n=this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));return n}else if((e[0]===2||e[0]===3)&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),e[0]===3);throw new Error("Unknown point format")};zt.prototype.encodeCompressed=function(e){return this.encode(e,!0)};zt.prototype._encode=function(e){var t=this.curve.p.byteLength(),i=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",t))};zt.prototype.encode=function(e,t){return ia.encode(this._encode(t),e)};zt.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this};zt.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return t?t.points.length>=Math.ceil((e.bitLength()+1)/t.step):!1};zt.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,a=0;a<t;a+=e){for(var o=0;o<e;o++)n=n.dbl();i.push(n)}return{step:e,points:i}};zt.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],i=(1<<e)-1,n=i===1?null:this.dbl(),a=1;a<i;a++)t[a]=t[a-1].add(n);return{wnd:e,points:t}};zt.prototype._getBeta=function(){return null};zt.prototype.dblp=function(e){for(var t=this,i=0;i<e;i++)t=t.dbl();return t}});var _0=te((s3,g0)=>{"use strict";var Ab=Mt(),Be=Xt(),pf=Qn(),on=na(),Sb=Ab.assert;function qt(r){on.call(this,"short",r),this.a=new Be(r.a,16).toRed(this.red),this.b=new Be(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}pf(qt,on);g0.exports=qt;qt.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var t,i;if(e.beta)t=new Be(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=n[0].cmp(n[1])<0?n[0]:n[1],t=t.toRed(this.red)}if(e.lambda)i=new Be(e.lambda,16);else{var a=this._getEndoRoots(this.n);this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))===0?i=a[0]:(i=a[1],Sb(this.g.mul(i).x.cmp(this.g.x.redMul(t))===0))}var o;return e.basis?o=e.basis.map(function(s){return{a:new Be(s.a,16),b:new Be(s.b,16)}}):o=this._getEndoBasis(i),{beta:t,lambda:i,basis:o}}};qt.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:Be.mont(e),i=new Be(2).toRed(t).redInvm(),n=i.redNeg(),a=new Be(3).toRed(t).redNeg().redSqrt().redMul(i),o=n.redAdd(a).fromRed(),s=n.redSub(a).fromRed();return[o,s]};qt.prototype._getEndoBasis=function(e){for(var t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),i=e,n=this.n.clone(),a=new Be(1),o=new Be(0),s=new Be(0),h=new Be(1),d,p,A,k,S,E,I,P=0,T,C;i.cmpn(0)!==0;){var z=n.div(i);T=n.sub(z.mul(i)),C=s.sub(z.mul(a));var N=h.sub(z.mul(o));if(!A&&T.cmp(t)<0)d=I.neg(),p=a,A=T.neg(),k=C;else if(A&&++P===2)break;I=T,n=i,i=T,s=a,a=C,h=o,o=N}S=T.neg(),E=C;var j=A.sqr().add(k.sqr()),J=S.sqr().add(E.sqr());return J.cmp(j)>=0&&(S=d,E=p),A.negative&&(A=A.neg(),k=k.neg()),S.negative&&(S=S.neg(),E=E.neg()),[{a:A,b:k},{a:S,b:E}]};qt.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],n=t[1],a=n.b.mul(e).divRound(this.n),o=i.b.neg().mul(e).divRound(this.n),s=a.mul(i.a),h=o.mul(n.a),d=a.mul(i.b),p=o.mul(n.b),A=e.sub(s).sub(h),k=d.add(p).neg();return{k1:A,k2:k}};qt.prototype.pointFromX=function(e,t){e=new Be(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var a=n.fromRed().isOdd();return(t&&!a||!t&&a)&&(n=n.redNeg()),this.point(e,n)};qt.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,n=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(a).cmpn(0)===0};qt.prototype._endoWnafMulAdd=function(e,t,i){for(var n=this._endoWnafT1,a=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),h=e[o],d=h._getBeta();s.k1.negative&&(s.k1.ineg(),h=h.neg(!0)),s.k2.negative&&(s.k2.ineg(),d=d.neg(!0)),n[o*2]=h,n[o*2+1]=d,a[o*2]=s.k1,a[o*2+1]=s.k2}for(var p=this._wnafMulAdd(1,n,a,o*2,i),A=0;A<o*2;A++)n[A]=null,a[A]=null;return p};function tt(r,e,t,i){on.BasePoint.call(this,r,"affine"),e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Be(e,16),this.y=new Be(t,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}pf(tt,on.BasePoint);qt.prototype.point=function(e,t,i){return new tt(this,e,t,i)};qt.prototype.pointFromJSON=function(e,t){return tt.fromJSON(this,e,t)};tt.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,n=function(a){return i.point(a.x.redMul(i.endo.beta),a.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}};tt.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};tt.fromJSON=function(e,t,i){typeof t=="string"&&(t=JSON.parse(t));var n=e.point(t[0],t[1],i);if(!t[2])return n;function a(s){return e.point(s[0],s[1],i)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(a))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(a))}},n};tt.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};tt.prototype.isInfinity=function(){return this.inf};tt.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)};tt.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),a=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(n),o=a.redSqr().redISub(this.x.redAdd(this.x)),s=a.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)};tt.prototype.getX=function(){return this.x.fromRed()};tt.prototype.getY=function(){return this.y.fromRed()};tt.prototype.mul=function(e){return e=new Be(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};tt.prototype.mulAdd=function(e,t,i){var n=[this,t],a=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,a):this.curve._wnafMulAdd(1,n,a,2)};tt.prototype.jmulAdd=function(e,t,i){var n=[this,t],a=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,a,!0):this.curve._wnafMulAdd(1,n,a,2,!0)};tt.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};tt.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(a){return a.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return t};tt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function lt(r,e,t,i){on.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Be(0)):(this.x=new Be(e,16),this.y=new Be(t,16),this.z=new Be(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}pf(lt,on.BasePoint);qt.prototype.jpoint=function(e,t,i){return new lt(this,e,t,i)};lt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(i,n)};lt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};lt.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(t),a=e.x.redMul(i),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(i.redMul(this.z)),h=n.redSub(a),d=o.redSub(s);if(h.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=h.redSqr(),A=p.redMul(h),k=n.redMul(p),S=d.redSqr().redIAdd(A).redISub(k).redISub(k),E=d.redMul(k.redISub(S)).redISub(o.redMul(A)),I=this.z.redMul(e.z).redMul(h);return this.curve.jpoint(S,E,I)};lt.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,n=e.x.redMul(t),a=this.y,o=e.y.redMul(t).redMul(this.z),s=i.redSub(n),h=a.redSub(o);if(s.cmpn(0)===0)return h.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var d=s.redSqr(),p=d.redMul(s),A=i.redMul(d),k=h.redSqr().redIAdd(p).redISub(A).redISub(A),S=h.redMul(A.redISub(k)).redISub(a.redMul(p)),E=this.z.redMul(s);return this.curve.jpoint(k,S,E)};lt.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var i=this;for(t=0;t<e;t++)i=i.dbl();return i}var n=this.curve.a,a=this.curve.tinv,o=this.x,s=this.y,h=this.z,d=h.redSqr().redSqr(),p=s.redAdd(s);for(t=0;t<e;t++){var A=o.redSqr(),k=p.redSqr(),S=k.redSqr(),E=A.redAdd(A).redIAdd(A).redIAdd(n.redMul(d)),I=o.redMul(k),P=E.redSqr().redISub(I.redAdd(I)),T=I.redISub(P),C=E.redMul(T);C=C.redIAdd(C).redISub(S);var z=p.redMul(h);t+1<e&&(d=d.redMul(S)),o=P,h=z,p=C}return this.curve.jpoint(o,p.redMul(a),h)};lt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};lt.prototype._zeroDbl=function(){var e,t,i;if(this.zOne){var n=this.x.redSqr(),a=this.y.redSqr(),o=a.redSqr(),s=this.x.redAdd(a).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var h=n.redAdd(n).redIAdd(n),d=h.redSqr().redISub(s).redISub(s),p=o.redIAdd(o);p=p.redIAdd(p),p=p.redIAdd(p),e=d,t=h.redMul(s.redISub(d)).redISub(p),i=this.y.redAdd(this.y)}else{var A=this.x.redSqr(),k=this.y.redSqr(),S=k.redSqr(),E=this.x.redAdd(k).redSqr().redISub(A).redISub(S);E=E.redIAdd(E);var I=A.redAdd(A).redIAdd(A),P=I.redSqr(),T=S.redIAdd(S);T=T.redIAdd(T),T=T.redIAdd(T),e=P.redISub(E).redISub(E),t=I.redMul(E.redISub(e)).redISub(T),i=this.y.redMul(this.z),i=i.redIAdd(i)}return this.curve.jpoint(e,t,i)};lt.prototype._threeDbl=function(){var e,t,i;if(this.zOne){var n=this.x.redSqr(),a=this.y.redSqr(),o=a.redSqr(),s=this.x.redAdd(a).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var h=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),d=h.redSqr().redISub(s).redISub(s);e=d;var p=o.redIAdd(o);p=p.redIAdd(p),p=p.redIAdd(p),t=h.redMul(s.redISub(d)).redISub(p),i=this.y.redAdd(this.y)}else{var A=this.z.redSqr(),k=this.y.redSqr(),S=this.x.redMul(k),E=this.x.redSub(A).redMul(this.x.redAdd(A));E=E.redAdd(E).redIAdd(E);var I=S.redIAdd(S);I=I.redIAdd(I);var P=I.redAdd(I);e=E.redSqr().redISub(P),i=this.y.redAdd(this.z).redSqr().redISub(k).redISub(A);var T=k.redSqr();T=T.redIAdd(T),T=T.redIAdd(T),T=T.redIAdd(T),t=E.redMul(I.redISub(e)).redISub(T)}return this.curve.jpoint(e,t,i)};lt.prototype._dbl=function(){var e=this.curve.a,t=this.x,i=this.y,n=this.z,a=n.redSqr().redSqr(),o=t.redSqr(),s=i.redSqr(),h=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(a)),d=t.redAdd(t);d=d.redIAdd(d);var p=d.redMul(s),A=h.redSqr().redISub(p.redAdd(p)),k=p.redISub(A),S=s.redSqr();S=S.redIAdd(S),S=S.redIAdd(S),S=S.redIAdd(S);var E=h.redMul(k).redISub(S),I=i.redAdd(i).redMul(n);return this.curve.jpoint(A,E,I)};lt.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr(),n=t.redSqr(),a=e.redAdd(e).redIAdd(e),o=a.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n);s=s.redIAdd(s),s=s.redAdd(s).redIAdd(s),s=s.redISub(o);var h=s.redSqr(),d=n.redIAdd(n);d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var p=a.redIAdd(s).redSqr().redISub(o).redISub(h).redISub(d),A=t.redMul(p);A=A.redIAdd(A),A=A.redIAdd(A);var k=this.x.redMul(h).redISub(A);k=k.redIAdd(k),k=k.redIAdd(k);var S=this.y.redMul(p.redMul(d.redISub(p)).redISub(s.redMul(h)));S=S.redIAdd(S),S=S.redIAdd(S),S=S.redIAdd(S);var E=this.z.redAdd(s).redSqr().redISub(i).redISub(h);return this.curve.jpoint(k,S,E)};lt.prototype.mul=function(e,t){return e=new Be(e,t),this.curve._wnafMul(this,e)};lt.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),i=e.z.redSqr();if(this.x.redMul(i).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;var n=t.redMul(this.z),a=i.redMul(e.z);return this.y.redMul(a).redISub(e.y.redMul(n)).cmpn(0)===0};lt.prototype.eqXToP=function(e){var t=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(i)===0)return!0;for(var n=e.clone(),a=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(a),this.x.cmp(i)===0)return!0}};lt.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};lt.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var A0=te((f3,x0)=>{"use strict";var sn=Xt(),w0=Qn(),vo=na(),kb=Mt();function fn(r){vo.call(this,"mont",r),this.a=new sn(r.a,16).toRed(this.red),this.b=new sn(r.b,16).toRed(this.red),this.i4=new sn(4).toRed(this.red).redInvm(),this.two=new sn(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}w0(fn,vo);x0.exports=fn;fn.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),n=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t),a=n.redSqrt();return a.redSqr().cmp(n)===0};function rt(r,e,t){vo.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new sn(e,16),this.z=new sn(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}w0(rt,vo.BasePoint);fn.prototype.decodePoint=function(e,t){return this.point(kb.toArray(e,t),1)};fn.prototype.point=function(e,t){return new rt(this,e,t)};fn.prototype.pointFromJSON=function(e){return rt.fromJSON(this,e)};rt.prototype.precompute=function(){};rt.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};rt.fromJSON=function(e,t){return new rt(e,t[0],t[1]||e.one)};rt.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};rt.prototype.isInfinity=function(){return this.z.cmpn(0)===0};rt.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),i=this.x.redSub(this.z),n=i.redSqr(),a=t.redSub(n),o=t.redMul(n),s=a.redMul(n.redAdd(this.curve.a24.redMul(a)));return this.curve.point(o,s)};rt.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};rt.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),a=e.x.redAdd(e.z),o=e.x.redSub(e.z),s=o.redMul(i),h=a.redMul(n),d=t.z.redMul(s.redAdd(h).redSqr()),p=t.x.redMul(s.redISub(h).redSqr());return this.curve.point(d,p)};rt.prototype.mul=function(e){for(var t=e.clone(),i=this,n=this.curve.point(null,null),a=this,o=[];t.cmpn(0)!==0;t.iushrn(1))o.push(t.andln(1));for(var s=o.length-1;s>=0;s--)o[s]===0?(i=i.diffAdd(n,a),n=n.dbl()):(n=i.diffAdd(n,a),i=i.dbl());return n};rt.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};rt.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};rt.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};rt.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};rt.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var E0=te((c3,k0)=>{"use strict";var Eb=Mt(),Mr=Xt(),S0=Qn(),go=na(),Mb=Eb.assert;function hr(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,go.call(this,"edwards",r),this.a=new Mr(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Mr(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Mr(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Mb(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}S0(hr,go);k0.exports=hr;hr.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};hr.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};hr.prototype.jpoint=function(e,t,i,n){return this.point(e,t,i,n)};hr.prototype.pointFromX=function(e,t){e=new Mr(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),a=this.one.redSub(this.c2.redMul(this.d).redMul(i)),o=n.redMul(a.redInvm()),s=o.redSqrt();if(s.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");var h=s.fromRed().isOdd();return(t&&!h||!t&&h)&&(s=s.redNeg()),this.point(e,s)};hr.prototype.pointFromY=function(e,t){e=new Mr(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),a=i.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(a.redInvm());if(o.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=o.redSqrt();if(s.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)};hr.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),i=e.y.redSqr(),n=t.redMul(this.a).redAdd(i),a=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return n.cmp(a)===0};function ve(r,e,t,i,n){go.BasePoint.call(this,r,"projective"),e===null&&t===null&&i===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Mr(e,16),this.y=new Mr(t,16),this.z=i?new Mr(i,16):this.curve.one,this.t=n&&new Mr(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}S0(ve,go.BasePoint);hr.prototype.pointFromJSON=function(e){return ve.fromJSON(this,e)};hr.prototype.point=function(e,t,i,n){return new ve(this,e,t,i,n)};ve.fromJSON=function(e,t){return new ve(e,t[0],t[1],t[2])};ve.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};ve.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};ve.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(i),h=n.redSub(t),d=a.redMul(s),p=o.redMul(h),A=a.redMul(h),k=s.redMul(o);return this.curve.point(d,p,k,A)};ve.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),i=this.y.redSqr(),n,a,o,s,h,d;if(this.curve.twisted){s=this.curve._mulA(t);var p=s.redAdd(i);this.zOne?(n=e.redSub(t).redSub(i).redMul(p.redSub(this.curve.two)),a=p.redMul(s.redSub(i)),o=p.redSqr().redSub(p).redSub(p)):(h=this.z.redSqr(),d=p.redSub(h).redISub(h),n=e.redSub(t).redISub(i).redMul(d),a=p.redMul(s.redSub(i)),o=p.redMul(d))}else s=t.redAdd(i),h=this.curve._mulC(this.z).redSqr(),d=s.redSub(h).redSub(h),n=this.curve._mulC(e.redISub(s)).redMul(d),a=this.curve._mulC(s).redMul(t.redISub(i)),o=s.redMul(d);return this.curve.point(n,a,o)};ve.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};ve.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),o=i.redSub(t),s=a.redSub(n),h=a.redAdd(n),d=i.redAdd(t),p=o.redMul(s),A=h.redMul(d),k=o.redMul(d),S=s.redMul(h);return this.curve.point(p,A,S,k)};ve.prototype._projAdd=function(e){var t=this.z.redMul(e.z),i=t.redSqr(),n=this.x.redMul(e.x),a=this.y.redMul(e.y),o=this.curve.d.redMul(n).redMul(a),s=i.redSub(o),h=i.redAdd(o),d=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(a),p=t.redMul(s).redMul(d),A,k;return this.curve.twisted?(A=t.redMul(h).redMul(a.redSub(this.curve._mulA(n))),k=s.redMul(h)):(A=t.redMul(h).redMul(a.redSub(n)),k=this.curve._mulC(s).redMul(h)),this.curve.point(p,A,k)};ve.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};ve.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};ve.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)};ve.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)};ve.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};ve.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};ve.prototype.getX=function(){return this.normalize(),this.x.fromRed()};ve.prototype.getY=function(){return this.normalize(),this.y.fromRed()};ve.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};ve.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),this.x.cmp(t)===0)return!0}};ve.prototype.toP=ve.prototype.normalize;ve.prototype.mixedAdd=ve.prototype.add});var bf=te(M0=>{"use strict";var _o=M0;_o.base=na();_o.short=_0();_o.mont=A0();_o.edwards=E0()});var T0=te((l3,I0)=>{I0.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var wo=te(N0=>{"use strict";var mf=N0,Zr=ra(),yf=bf(),Ib=Mt(),R0=Ib.assert;function P0(r){r.type==="short"?this.curve=new yf.short(r):r.type==="edwards"?this.curve=new yf.edwards(r):this.curve=new yf.mont(r),this.g=this.curve.g,this.n=this.curve.n,this.hash=r.hash,R0(this.g.validate(),"Invalid curve"),R0(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}mf.PresetCurve=P0;function Wr(r,e){Object.defineProperty(mf,r,{configurable:!0,enumerable:!0,get:function(){var t=new P0(e);return Object.defineProperty(mf,r,{configurable:!0,enumerable:!0,value:t}),t}})}Wr("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Zr.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Wr("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Zr.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Wr("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Zr.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Wr("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Zr.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});Wr("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Zr.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});Wr("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Zr.sha256,gRed:!1,g:["9"]});Wr("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Zr.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var vf;try{vf=T0()}catch{vf=void 0}Wr("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Zr.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",vf]})});var z0=te((u3,C0)=>{"use strict";var Tb=ra(),gi=uf(),B0=jr();function Gr(r){if(!(this instanceof Gr))return new Gr(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=gi.toArray(r.entropy,r.entropyEnc||"hex"),t=gi.toArray(r.nonce,r.nonceEnc||"hex"),i=gi.toArray(r.pers,r.persEnc||"hex");B0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,i)}C0.exports=Gr;Gr.prototype._init=function(e,t,i){var n=e.concat(t).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656};Gr.prototype._hmac=function(){return new Tb.hmac(this.hash,this.K)};Gr.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())};Gr.prototype.reseed=function(e,t,i,n){typeof t!="string"&&(n=i,i=t,t=null),e=gi.toArray(e,t),i=gi.toArray(i,n),B0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1};Gr.prototype.generate=function(e,t,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(n=i,i=t,t=null),i&&(i=gi.toArray(i,n||"hex"),this._update(i));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var o=a.slice(0,e);return this._update(i),this._reseed++,gi.encode(o,t)}});var D0=te((p3,q0)=>{"use strict";var Rb=Xt(),Pb=Mt(),gf=Pb.assert;function bt(r,e){this.ec=r,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}q0.exports=bt;bt.fromPublic=function(e,t,i){return t instanceof bt?t:new bt(e,{pub:t,pubEnc:i})};bt.fromPrivate=function(e,t,i){return t instanceof bt?t:new bt(e,{priv:t,privEnc:i})};bt.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};bt.prototype.getPublic=function(e,t){return typeof e=="string"&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub};bt.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};bt.prototype._importPrivate=function(e,t){this.priv=new Rb(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)};bt.prototype._importPublic=function(e,t){if(e.x||e.y){this.ec.curve.type==="mont"?gf(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&gf(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)};bt.prototype.derive=function(e){return e.validate()||gf(e.validate(),"public point not validated"),e.mul(this.priv).getX()};bt.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)};bt.prototype.verify=function(e,t,i){return this.ec.verify(e,t,this,void 0,i)};bt.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}});var F0=te((b3,O0)=>{"use strict";var xo=Xt(),xf=Mt(),Nb=xf.assert;function Ao(r,e){if(r instanceof Ao)return r;this._importDER(r,e)||(Nb(r.r&&r.s,"Signature without r or s"),this.r=new xo(r.r,16),this.s=new xo(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}O0.exports=Ao;function Bb(){this.place=0}function _f(r,e){var t=r[e.place++];if(!(t&128))return t;var i=t&15;if(i===0||i>4||r[e.place]===0)return!1;for(var n=0,a=0,o=e.place;a<i;a++,o++)n<<=8,n|=r[o],n>>>=0;return n<=127?!1:(e.place=o,n)}function L0(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e<t;)e++;return e===0?r:r.slice(e)}Ao.prototype._importDER=function(e,t){e=xf.toArray(e,t);var i=new Bb;if(e[i.place++]!==48)return!1;var n=_f(e,i);if(n===!1||n+i.place!==e.length||e[i.place++]!==2)return!1;var a=_f(e,i);if(a===!1||(e[i.place]&128)!==0)return!1;var o=e.slice(i.place,a+i.place);if(i.place+=a,e[i.place++]!==2)return!1;var s=_f(e,i);if(s===!1||e.length!==s+i.place||(e[i.place]&128)!==0)return!1;var h=e.slice(i.place,s+i.place);if(o[0]===0)if(o[1]&128)o=o.slice(1);else return!1;if(h[0]===0)if(h[1]&128)h=h.slice(1);else return!1;return this.r=new xo(o),this.s=new xo(h),this.recoveryParam=null,!0};function wf(r,e){if(e<128){r.push(e);return}var t=1+(Math.log(e)/Math.LN2>>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}Ao.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),i[0]&128&&(i=[0].concat(i)),t=L0(t),i=L0(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];wf(n,t.length),n=n.concat(t),n.push(2),wf(n,i.length);var a=n.concat(i),o=[48];return wf(o,a.length),o=o.concat(a),xf.encode(o,e)}});var $0=te((y3,H0)=>{"use strict";var Qt=Xt(),U0=z0(),Cb=Mt(),Af=wo(),zb=lo(),_i=Cb.assert,Sf=D0(),So=F0();function Dt(r){if(!(this instanceof Dt))return new Dt(r);typeof r=="string"&&(_i(Object.prototype.hasOwnProperty.call(Af,r),"Unknown curve "+r),r=Af[r]),r instanceof Af.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}H0.exports=Dt;Dt.prototype.keyPair=function(e){return new Sf(this,e)};Dt.prototype.keyFromPrivate=function(e,t){return Sf.fromPrivate(this,e,t)};Dt.prototype.keyFromPublic=function(e,t){return Sf.fromPublic(this,e,t)};Dt.prototype.genKeyPair=function(e){e||(e={});for(var t=new U0({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||zb(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new Qt(2));;){var a=new Qt(t.generate(i));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}};Dt.prototype._truncateToN=function(e,t,i){var n;if(Qt.isBN(e)||typeof e=="number")e=new Qt(e,16),n=e.byteLength();else if(typeof e=="object")n=e.length,e=new Qt(e,16);else{var a=e.toString();n=a.length+1>>>1,e=new Qt(a,16)}typeof i!="number"&&(i=n*8);var o=i-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e};Dt.prototype.sign=function(e,t,i,n){if(typeof i=="object"&&(n=i,i=null),n||(n={}),typeof e!="string"&&typeof e!="number"&&!Qt.isBN(e)){_i(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),_i(e.length>>>0===e.length);for(var a=0;a<e.length;a++)_i((e[a]&255)===e[a])}t=this.keyFromPrivate(t,i),e=this._truncateToN(e,!1,n.msgBitLength),_i(!e.isNeg(),"Can not sign a negative message");var o=this.n.byteLength(),s=t.getPrivate().toArray("be",o),h=e.toArray("be",o);_i(new Qt(h).eq(e),"Can not sign message");for(var d=new U0({hash:this.hash,entropy:s,nonce:h,pers:n.pers,persEnc:n.persEnc||"utf8"}),p=this.n.sub(new Qt(1)),A=0;;A++){var k=n.k?n.k(A):new Qt(d.generate(this.n.byteLength()));if(k=this._truncateToN(k,!0),!(k.cmpn(1)<=0||k.cmp(p)>=0)){var S=this.g.mul(k);if(!S.isInfinity()){var E=S.getX(),I=E.umod(this.n);if(I.cmpn(0)!==0){var P=k.invm(this.n).mul(I.mul(t.getPrivate()).iadd(e));if(P=P.umod(this.n),P.cmpn(0)!==0){var T=(S.getY().isOdd()?1:0)|(E.cmp(I)!==0?2:0);return n.canonical&&P.cmp(this.nh)>0&&(P=this.n.sub(P),T^=1),new So({r:I,s:P,recoveryParam:T})}}}}}};Dt.prototype.verify=function(e,t,i,n,a){a||(a={}),e=this._truncateToN(e,!1,a.msgBitLength),i=this.keyFromPublic(i,n),t=new So(t,"hex");var o=t.r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var h=s.invm(this.n),d=h.mul(e).umod(this.n),p=h.mul(o).umod(this.n),A;return this.curve._maxwellTrick?(A=this.g.jmulAdd(d,i.getPublic(),p),A.isInfinity()?!1:A.eqXToP(o)):(A=this.g.mulAdd(d,i.getPublic(),p),A.isInfinity()?!1:A.getX().umod(this.n).cmp(o)===0)};Dt.prototype.recoverPubKey=function(r,e,t,i){_i((3&t)===t,"The recovery param is more than two bits"),e=new So(e,i);var n=this.n,a=new Qt(r),o=e.r,s=e.s,h=t&1,d=t>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");d?o=this.curve.pointFromX(o.add(this.curve.n),h):o=this.curve.pointFromX(o,h);var p=e.r.invm(n),A=n.sub(a).mul(p).umod(n),k=s.mul(p).umod(n);return this.g.mulAdd(A,o,k)};Dt.prototype.getKeyRecoveryParam=function(r,e,t,i){if(e=new So(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(r,e,n)}catch{continue}if(a.eq(t))return n}throw new Error("Unable to find valid recovery factor")}});var Z0=te((m3,V0)=>{"use strict";var aa=Mt(),K0=aa.assert,j0=aa.parseBytes,cn=aa.cachedProperty;function it(r,e){this.eddsa=r,this._secret=j0(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=j0(e.pub)}it.fromPublic=function(e,t){return t instanceof it?t:new it(e,{pub:t})};it.fromSecret=function(e,t){return t instanceof it?t:new it(e,{secret:t})};it.prototype.secret=function(){return this._secret};cn(it,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});cn(it,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});cn(it,"privBytes",function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n});cn(it,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});cn(it,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});cn(it,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});it.prototype.sign=function(e){return K0(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};it.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)};it.prototype.getSecret=function(e){return K0(this._secret,"KeyPair is public only"),aa.encode(this.secret(),e)};it.prototype.getPublic=function(e){return aa.encode(this.pubBytes(),e)};V0.exports=it});var J0=te((v3,G0)=>{"use strict";var qb=Xt(),ko=Mt(),W0=ko.assert,Eo=ko.cachedProperty,Db=ko.parseBytes;function wi(r,e){this.eddsa=r,typeof e!="object"&&(e=Db(e)),Array.isArray(e)&&(W0(e.length===r.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),W0(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof qb&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}Eo(wi,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});Eo(wi,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});Eo(wi,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});Eo(wi,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});wi.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};wi.prototype.toHex=function(){return ko.encode(this.toBytes(),"hex").toUpperCase()};G0.exports=wi});var tl=te((g3,el)=>{"use strict";var Lb=ra(),Ob=wo(),dn=Mt(),Fb=dn.assert,Y0=dn.parseBytes,Q0=Z0(),X0=J0();function xt(r){if(Fb(r==="ed25519","only tested with ed25519 so far"),!(this instanceof xt))return new xt(r);r=Ob[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=Lb.sha512}el.exports=xt;xt.prototype.sign=function(e,t){e=Y0(e);var i=this.keyFromSecret(t),n=this.hashInt(i.messagePrefix(),e),a=this.g.mul(n),o=this.encodePoint(a),s=this.hashInt(o,i.pubBytes(),e).mul(i.priv()),h=n.add(s).umod(this.curve.n);return this.makeSignature({R:a,S:h,Rencoded:o})};xt.prototype.verify=function(e,t,i){if(e=Y0(e),t=this.makeSignature(t),t.S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(i),a=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S()),s=t.R().add(n.pub().mul(a));return s.eq(o)};xt.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return dn.intFromLE(e.digest()).umod(this.curve.n)};xt.prototype.keyFromPublic=function(e){return Q0.fromPublic(this,e)};xt.prototype.keyFromSecret=function(e){return Q0.fromSecret(this,e)};xt.prototype.makeSignature=function(e){return e instanceof X0?e:new X0(this,e)};xt.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t};xt.prototype.decodePoint=function(e){e=dn.parseBytes(e);var t=e.length-1,i=e.slice(0,t).concat(e[t]&-129),n=(e[t]&128)!==0,a=dn.intFromLE(i);return this.curve.pointFromY(a,n)};xt.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)};xt.prototype.decodeInt=function(e){return dn.intFromLE(e)};xt.prototype.isPoint=function(e){return e instanceof this.pointClass}});var il=te(rl=>{"use strict";var xi=rl;xi.version=u0().version;xi.utils=Mt();xi.rand=lo();xi.curve=bf();xi.curves=wo();xi.ec=$0();xi.eddsa=tl()});var Sl=te((za,Zf)=>{(function(r){"use strict";function e(t){var i=t&&t.Promise||r.Promise,n=t&&t.XMLHttpRequest||r.XMLHttpRequest;return(function(){var a=Object.create(r,{fetch:{value:void 0,writable:!0}});return(function(o,s){typeof za=="object"&&typeof Zf<"u"?s(za):typeof define=="function"&&define.amd?define(["exports"],s):s(o.WHATWGFetch={})})(this,(function(o){"use strict";var s=typeof a<"u"&&a||typeof self<"u"&&self||typeof s<"u"&&s,h={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function d(y){return y&&DataView.prototype.isPrototypeOf(y)}if(h.arrayBuffer)var p=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],A=ArrayBuffer.isView||function(y){return y&&p.indexOf(Object.prototype.toString.call(y))>-1};function k(y){if(typeof y!="string"&&(y=String(y)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(y)||y==="")throw new TypeError("Invalid character in header field name");return y.toLowerCase()}function S(y){return typeof y!="string"&&(y=String(y)),y}function E(y){var _={next:function(){var M=y.shift();return{done:M===void 0,value:M}}};return h.iterable&&(_[Symbol.iterator]=function(){return _}),_}function I(y){this.map={},y instanceof I?y.forEach(function(_,M){this.append(M,_)},this):Array.isArray(y)?y.forEach(function(_){this.append(_[0],_[1])},this):y&&Object.getOwnPropertyNames(y).forEach(function(_){this.append(_,y[_])},this)}I.prototype.append=function(y,_){y=k(y),_=S(_);var M=this.map[y];this.map[y]=M?M+", "+_:_},I.prototype.delete=function(y){delete this.map[k(y)]},I.prototype.get=function(y){return y=k(y),this.has(y)?this.map[y]:null},I.prototype.has=function(y){return this.map.hasOwnProperty(k(y))},I.prototype.set=function(y,_){this.map[k(y)]=S(_)},I.prototype.forEach=function(y,_){for(var M in this.map)this.map.hasOwnProperty(M)&&y.call(_,this.map[M],M,this)},I.prototype.keys=function(){var y=[];return this.forEach(function(_,M){y.push(M)}),E(y)},I.prototype.values=function(){var y=[];return this.forEach(function(_){y.push(_)}),E(y)},I.prototype.entries=function(){var y=[];return this.forEach(function(_,M){y.push([M,_])}),E(y)},h.iterable&&(I.prototype[Symbol.iterator]=I.prototype.entries);function P(y){if(y.bodyUsed)return i.reject(new TypeError("Already read"));y.bodyUsed=!0}function T(y){return new i(function(_,M){y.onload=function(){_(y.result)},y.onerror=function(){M(y.error)}})}function C(y){var _=new FileReader,M=T(_);return _.readAsArrayBuffer(y),M}function z(y){var _=new FileReader,M=T(_);return _.readAsText(y),M}function N(y){for(var _=new Uint8Array(y),M=new Array(_.length),g=0;g<_.length;g++)M[g]=String.fromCharCode(_[g]);return M.join("")}function j(y){if(y.slice)return y.slice(0);var _=new Uint8Array(y.byteLength);return _.set(new Uint8Array(y)),_.buffer}function J(){return this.bodyUsed=!1,this._initBody=function(y){this.bodyUsed=this.bodyUsed,this._bodyInit=y,y?typeof y=="string"?this._bodyText=y:h.blob&&Blob.prototype.isPrototypeOf(y)?this._bodyBlob=y:h.formData&&FormData.prototype.isPrototypeOf(y)?this._bodyFormData=y:h.searchParams&&URLSearchParams.prototype.isPrototypeOf(y)?this._bodyText=y.toString():h.arrayBuffer&&h.blob&&d(y)?(this._bodyArrayBuffer=j(y.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):h.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(y)||A(y))?this._bodyArrayBuffer=j(y):this._bodyText=y=Object.prototype.toString.call(y):this._bodyText="",this.headers.get("content-type")||(typeof y=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):h.searchParams&&URLSearchParams.prototype.isPrototypeOf(y)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},h.blob&&(this.blob=function(){var y=P(this);if(y)return y;if(this._bodyBlob)return i.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return i.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return i.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var y=P(this);return y||(ArrayBuffer.isView(this._bodyArrayBuffer)?i.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):i.resolve(this._bodyArrayBuffer))}else return this.blob().then(C)}),this.text=function(){var y=P(this);if(y)return y;if(this._bodyBlob)return z(this._bodyBlob);if(this._bodyArrayBuffer)return i.resolve(N(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return i.resolve(this._bodyText)},h.formData&&(this.formData=function(){return this.text().then(x)}),this.json=function(){return this.text().then(JSON.parse)},this}var D=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function O(y){var _=y.toUpperCase();return D.indexOf(_)>-1?_:y}function L(y,_){if(!(this instanceof L))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');_=_||{};var M=_.body;if(y instanceof L){if(y.bodyUsed)throw new TypeError("Already read");this.url=y.url,this.credentials=y.credentials,_.headers||(this.headers=new I(y.headers)),this.method=y.method,this.mode=y.mode,this.signal=y.signal,!M&&y._bodyInit!=null&&(M=y._bodyInit,y.bodyUsed=!0)}else this.url=String(y);if(this.credentials=_.credentials||this.credentials||"same-origin",(_.headers||!this.headers)&&(this.headers=new I(_.headers)),this.method=O(_.method||this.method||"GET"),this.mode=_.mode||this.mode||null,this.signal=_.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&M)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(M),(this.method==="GET"||this.method==="HEAD")&&(_.cache==="no-store"||_.cache==="no-cache")){var g=/([?&])_=[^&]*/;if(g.test(this.url))this.url=this.url.replace(g,"$1_="+new Date().getTime());else{var c=/\?/;this.url+=(c.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}L.prototype.clone=function(){return new L(this,{body:this._bodyInit})};function x(y){var _=new FormData;return y.trim().split("&").forEach(function(M){if(M){var g=M.split("="),c=g.shift().replace(/\+/g," "),w=g.join("=").replace(/\+/g," ");_.append(decodeURIComponent(c),decodeURIComponent(w))}}),_}function f(y){var _=new I,M=y.replace(/\r?\n[\t ]+/g," ");return M.split("\r").map(function(g){return g.indexOf(`
`)===0?g.substr(1,g.length):g}).forEach(function(g){var c=g.split(":"),w=c.shift().trim();if(w){var $=c.join(":").trim();_.append(w,$)}}),_}J.call(L.prototype);function u(y,_){if(!(this instanceof u))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');_||(_={}),this.type="default",this.status=_.status===void 0?200:_.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in _?_.statusText:"",this.headers=new I(_.headers),this.url=_.url||"",this._initBody(y)}J.call(u.prototype),u.prototype.clone=function(){return new u(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new I(this.headers),url:this.url})},u.error=function(){var y=new u(null,{status:0,statusText:""});return y.type="error",y};var m=[301,302,303,307,308];u.redirect=function(y,_){if(m.indexOf(_)===-1)throw new RangeError("Invalid status code");return new u(null,{status:_,headers:{location:y}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(_,M){this.message=_,this.name=M;var g=Error(_);this.stack=g.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function v(y,_){return new i(function(M,g){var c=new L(y,_);if(c.signal&&c.signal.aborted)return g(new o.DOMException("Aborted","AbortError"));var w=new n;function $(){w.abort()}w.onload=function(){var U={status:w.status,statusText:w.statusText,headers:f(w.getAllResponseHeaders()||"")};U.url="responseURL"in w?w.responseURL:U.headers.get("X-Request-URL");var X="response"in w?w.response:w.responseText;setTimeout(function(){M(new u(X,U))},0)},w.onerror=function(){setTimeout(function(){g(new TypeError("Network request failed"))},0)},w.ontimeout=function(){setTimeout(function(){g(new TypeError("Network request failed"))},0)},w.onabort=function(){setTimeout(function(){g(new o.DOMException("Aborted","AbortError"))},0)};function K(U){try{return U===""&&s.location.href?s.location.href:U}catch{return U}}w.open(c.method,K(c.url),!0),c.credentials==="include"?w.withCredentials=!0:c.credentials==="omit"&&(w.withCredentials=!1),"responseType"in w&&(h.blob?w.responseType="blob":h.arrayBuffer&&c.headers.get("Content-Type")&&c.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(w.responseType="arraybuffer")),_&&typeof _.headers=="object"&&!(_.headers instanceof I)?Object.getOwnPropertyNames(_.headers).forEach(function(U){w.setRequestHeader(U,S(_.headers[U]))}):c.headers.forEach(function(U,X){w.setRequestHeader(X,U)}),c.signal&&(c.signal.addEventListener("abort",$),w.onreadystatechange=function(){w.readyState===4&&c.signal.removeEventListener("abort",$)}),w.send(typeof c._bodyInit>"u"?null:c._bodyInit)})}v.polyfill=!0,s.fetch||(s.fetch=v,s.Headers=I,s.Request=L,s.Response=u),o.Headers=I,o.Request=L,o.Response=u,o.fetch=v,Object.defineProperty(o,"__esModule",{value:!0})})),{fetch:a.fetch,Headers:a.Headers,Request:a.Request,Response:a.Response,DOMException:a.DOMException}})()}typeof define=="function"&&define.amd?define(function(){return e}):typeof za=="object"?Zf.exports=e:r.fetchPonyfill=e})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:za)});var Nl=te((Ay,Pl)=>{var Pn=null;typeof WebSocket<"u"?Pn=WebSocket:typeof MozWebSocket<"u"?Pn=MozWebSocket:typeof global<"u"?Pn=global.WebSocket||global.MozWebSocket:typeof window<"u"?Pn=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(Pn=self.WebSocket||self.MozWebSocket);Pl.exports=Pn});var z2={};Wl(z2,{AnchorLink:()=>$i,AnchorLinkBrowserTransport:()=>Va});function Ji(r){let e=r.length;for(;--e>=0;)r[e]=0}var Jl=0,Wc=1,Xl=2,Yl=3,Ql=258,Vs=29,Gn=256,Un=Gn+1+Vs,Zi=30,Zs=19,Gc=2*Un+1,ci=15,As=16,eh=7,Ws=256,Jc=16,Xc=17,Yc=18,Ds=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),io=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),th=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Qc=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rh=512,xr=new Array((Un+2)*2);Ji(xr);var Ln=new Array(Zi*2);Ji(Ln);var Hn=new Array(rh);Ji(Hn);var $n=new Array(Ql-Yl+1);Ji($n);var Gs=new Array(Vs);Ji(Gs);var no=new Array(Zi);Ji(no);function Ss(r,e,t,i,n){this.static_tree=r,this.extra_bits=e,this.extra_base=t,this.elems=i,this.max_length=n,this.has_stree=r&&r.length}var ed,td,rd;function ks(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}var id=r=>r<256?Hn[r]:Hn[256+(r>>>7)],jn=(r,e)=>{r.pending_buf[r.pending++]=e&255,r.pending_buf[r.pending++]=e>>>8&255},_t=(r,e,t)=>{r.bi_valid>As-t?(r.bi_buf|=e<<r.bi_valid&65535,jn(r,r.bi_buf),r.bi_buf=e>>As-r.bi_valid,r.bi_valid+=t-As):(r.bi_buf|=e<<r.bi_valid&65535,r.bi_valid+=t)},rr=(r,e,t)=>{_t(r,t[e*2],t[e*2+1])},nd=(r,e)=>{let t=0;do t|=r&1,r>>>=1,t<<=1;while(--e>0);return t>>>1},ih=r=>{r.bi_valid===16?(jn(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):r.bi_valid>=8&&(r.pending_buf[r.pending++]=r.bi_buf&255,r.bi_buf>>=8,r.bi_valid-=8)},nh=(r,e)=>{let t=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,a=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,s=e.stat_desc.extra_base,h=e.stat_desc.max_length,d,p,A,k,S,E,I=0;for(k=0;k<=ci;k++)r.bl_count[k]=0;for(t[r.heap[r.heap_max]*2+1]=0,d=r.heap_max+1;d<Gc;d++)p=r.heap[d],k=t[t[p*2+1]*2+1]+1,k>h&&(k=h,I++),t[p*2+1]=k,!(p>i)&&(r.bl_count[k]++,S=0,p>=s&&(S=o[p-s]),E=t[p*2],r.opt_len+=E*(k+S),a&&(r.static_len+=E*(n[p*2+1]+S)));if(I!==0){do{for(k=h-1;r.bl_count[k]===0;)k--;r.bl_count[k]--,r.bl_count[k+1]+=2,r.bl_count[h]--,I-=2}while(I>0);for(k=h;k!==0;k--)for(p=r.bl_count[k];p!==0;)A=r.heap[--d],!(A>i)&&(t[A*2+1]!==k&&(r.opt_len+=(k-t[A*2+1])*t[A*2],t[A*2+1]=k),p--)}},ad=(r,e,t)=>{let i=new Array(ci+1),n=0,a,o;for(a=1;a<=ci;a++)n=n+t[a-1]<<1,i[a]=n;for(o=0;o<=e;o++){let s=r[o*2+1];s!==0&&(r[o*2]=nd(i[s]++,s))}},ah=()=>{let r,e,t,i,n,a=new Array(ci+1);for(t=0,i=0;i<Vs-1;i++)for(Gs[i]=t,r=0;r<1<<Ds[i];r++)$n[t++]=i;for($n[t-1]=i,n=0,i=0;i<16;i++)for(no[i]=n,r=0;r<1<<io[i];r++)Hn[n++]=i;for(n>>=7;i<Zi;i++)for(no[i]=n<<7,r=0;r<1<<io[i]-7;r++)Hn[256+n++]=i;for(e=0;e<=ci;e++)a[e]=0;for(r=0;r<=143;)xr[r*2+1]=8,r++,a[8]++;for(;r<=255;)xr[r*2+1]=9,r++,a[9]++;for(;r<=279;)xr[r*2+1]=7,r++,a[7]++;for(;r<=287;)xr[r*2+1]=8,r++,a[8]++;for(ad(xr,Un+1,a),r=0;r<Zi;r++)Ln[r*2+1]=5,Ln[r*2]=nd(r,5);ed=new Ss(xr,Ds,Gn+1,Un,ci),td=new Ss(Ln,io,0,Zi,ci),rd=new Ss(new Array(0),th,0,Zs,eh)},od=r=>{let e;for(e=0;e<Un;e++)r.dyn_ltree[e*2]=0;for(e=0;e<Zi;e++)r.dyn_dtree[e*2]=0;for(e=0;e<Zs;e++)r.bl_tree[e*2]=0;r.dyn_ltree[Ws*2]=1,r.opt_len=r.static_len=0,r.sym_next=r.matches=0},sd=r=>{r.bi_valid>8?jn(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0},dc=(r,e,t,i)=>{let n=e*2,a=t*2;return r[n]<r[a]||r[n]===r[a]&&i[e]<=i[t]},Es=(r,e,t)=>{let i=r.heap[t],n=t<<1;for(;n<=r.heap_len&&(n<r.heap_len&&dc(e,r.heap[n+1],r.heap[n],r.depth)&&n++,!dc(e,i,r.heap[n],r.depth));)r.heap[t]=r.heap[n],t=n,n<<=1;r.heap[t]=i},lc=(r,e,t)=>{let i,n,a=0,o,s;if(r.sym_next!==0)do i=r.pending_buf[r.sym_buf+a++]&255,i+=(r.pending_buf[r.sym_buf+a++]&255)<<8,n=r.pending_buf[r.sym_buf+a++],i===0?rr(r,n,e):(o=$n[n],rr(r,o+Gn+1,e),s=Ds[o],s!==0&&(n-=Gs[o],_t(r,n,s)),i--,o=id(i),rr(r,o,t),s=io[o],s!==0&&(i-=no[o],_t(r,i,s)));while(a<r.sym_next);rr(r,Ws,e)},Ls=(r,e)=>{let t=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,a=e.stat_desc.elems,o,s,h=-1,d;for(r.heap_len=0,r.heap_max=Gc,o=0;o<a;o++)t[o*2]!==0?(r.heap[++r.heap_len]=h=o,r.depth[o]=0):t[o*2+1]=0;for(;r.heap_len<2;)d=r.heap[++r.heap_len]=h<2?++h:0,t[d*2]=1,r.depth[d]=0,r.opt_len--,n&&(r.static_len-=i[d*2+1]);for(e.max_code=h,o=r.heap_len>>1;o>=1;o--)Es(r,t,o);d=a;do o=r.heap[1],r.heap[1]=r.heap[r.heap_len--],Es(r,t,1),s=r.heap[1],r.heap[--r.heap_max]=o,r.heap[--r.heap_max]=s,t[d*2]=t[o*2]+t[s*2],r.depth[d]=(r.depth[o]>=r.depth[s]?r.depth[o]:r.depth[s])+1,t[o*2+1]=t[s*2+1]=d,r.heap[1]=d++,Es(r,t,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],nh(r,e),ad(t,h,r.bl_count)},hc=(r,e,t)=>{let i,n=-1,a,o=e[1],s=0,h=7,d=4;for(o===0&&(h=138,d=3),e[(t+1)*2+1]=65535,i=0;i<=t;i++)a=o,o=e[(i+1)*2+1],!(++s<h&&a===o)&&(s<d?r.bl_tree[a*2]+=s:a!==0?(a!==n&&r.bl_tree[a*2]++,r.bl_tree[Jc*2]++):s<=10?r.bl_tree[Xc*2]++:r.bl_tree[Yc*2]++,s=0,n=a,o===0?(h=138,d=3):a===o?(h=6,d=3):(h=7,d=4))},uc=(r,e,t)=>{let i,n=-1,a,o=e[1],s=0,h=7,d=4;for(o===0&&(h=138,d=3),i=0;i<=t;i++)if(a=o,o=e[(i+1)*2+1],!(++s<h&&a===o)){if(s<d)do rr(r,a,r.bl_tree);while(--s!==0);else a!==0?(a!==n&&(rr(r,a,r.bl_tree),s--),rr(r,Jc,r.bl_tree),_t(r,s-3,2)):s<=10?(rr(r,Xc,r.bl_tree),_t(r,s-3,3)):(rr(r,Yc,r.bl_tree),_t(r,s-11,7));s=0,n=a,o===0?(h=138,d=3):a===o?(h=6,d=3):(h=7,d=4)}},oh=r=>{let e;for(hc(r,r.dyn_ltree,r.l_desc.max_code),hc(r,r.dyn_dtree,r.d_desc.max_code),Ls(r,r.bl_desc),e=Zs-1;e>=3&&r.bl_tree[Qc[e]*2+1]===0;e--);return r.opt_len+=3*(e+1)+5+5+4,e},sh=(r,e,t,i)=>{let n;for(_t(r,e-257,5),_t(r,t-1,5),_t(r,i-4,4),n=0;n<i;n++)_t(r,r.bl_tree[Qc[n]*2+1],3);uc(r,r.dyn_ltree,e-1),uc(r,r.dyn_dtree,t-1)},fh=r=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&r.dyn_ltree[t*2]!==0)return 0;if(r.dyn_ltree[18]!==0||r.dyn_ltree[20]!==0||r.dyn_ltree[26]!==0)return 1;for(t=32;t<Gn;t++)if(r.dyn_ltree[t*2]!==0)return 1;return 0},pc=!1,ch=r=>{pc||(ah(),pc=!0),r.l_desc=new ks(r.dyn_ltree,ed),r.d_desc=new ks(r.dyn_dtree,td),r.bl_desc=new ks(r.bl_tree,rd),r.bi_buf=0,r.bi_valid=0,od(r)},fd=(r,e,t,i)=>{_t(r,(Jl<<1)+(i?1:0),3),sd(r),jn(r,t),jn(r,~t),t&&r.pending_buf.set(r.window.subarray(e,e+t),r.pending),r.pending+=t},dh=r=>{_t(r,Wc<<1,3),rr(r,Ws,xr),ih(r)},lh=(r,e,t,i)=>{let n,a,o=0;r.level>0?(r.strm.data_type===2&&(r.strm.data_type=fh(r)),Ls(r,r.l_desc),Ls(r,r.d_desc),o=oh(r),n=r.opt_len+3+7>>>3,a=r.static_len+3+7>>>3,a<=n&&(n=a)):n=a=t+5,t+4<=n&&e!==-1?fd(r,e,t,i):r.strategy===4||a===n?(_t(r,(Wc<<1)+(i?1:0),3),lc(r,xr,Ln)):(_t(r,(Xl<<1)+(i?1:0),3),sh(r,r.l_desc.max_code+1,r.d_desc.max_code+1,o+1),lc(r,r.dyn_ltree,r.dyn_dtree)),od(r),i&&sd(r)},hh=(r,e,t)=>(r.pending_buf[r.sym_buf+r.sym_next++]=e,r.pending_buf[r.sym_buf+r.sym_next++]=e>>8,r.pending_buf[r.sym_buf+r.sym_next++]=t,e===0?r.dyn_ltree[t*2]++:(r.matches++,e--,r.dyn_ltree[($n[t]+Gn+1)*2]++,r.dyn_dtree[id(e)*2]++),r.sym_next===r.sym_end),uh=ch,ph=fd,bh=lh,yh=hh,mh=dh,vh={_tr_init:uh,_tr_stored_block:ph,_tr_flush_block:bh,_tr_tally:yh,_tr_align:mh},gh=(r,e,t,i)=>{let n=r&65535|0,a=r>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do n=n+e[i++]|0,a=a+n|0;while(--o);n%=65521,a%=65521}return n|a<<16|0},Kn=gh,_h=()=>{let r,e=[];for(var t=0;t<256;t++){r=t;for(var i=0;i<8;i++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r}return e},wh=new Uint32Array(_h()),xh=(r,e,t,i)=>{let n=wh,a=i+t;r^=-1;for(let o=i;o<a;o++)r=r>>>8^n[(r^e[o])&255];return r^-1},et=xh,hi={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},bi={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:Ah,_tr_stored_block:Os,_tr_flush_block:Sh,_tr_tally:Fr,_tr_align:kh}=vh,{Z_NO_FLUSH:Ur,Z_PARTIAL_FLUSH:Eh,Z_FULL_FLUSH:Mh,Z_FINISH:Bt,Z_BLOCK:bc,Z_OK:ct,Z_STREAM_END:yc,Z_STREAM_ERROR:ir,Z_DATA_ERROR:Ih,Z_BUF_ERROR:Ms,Z_DEFAULT_COMPRESSION:Th,Z_FILTERED:Rh,Z_HUFFMAN_ONLY:Ya,Z_RLE:Ph,Z_FIXED:Nh,Z_DEFAULT_STRATEGY:Bh,Z_UNKNOWN:Ch,Z_DEFLATED:so}=bi,zh=9,qh=15,Dh=8,Lh=29,Oh=256,Fs=Oh+1+Lh,Fh=30,Uh=19,Hh=2*Fs+1,$h=15,ie=3,Or=258,nr=Or+ie+1,jh=32,Wi=42,Js=57,Us=69,Hs=73,$s=91,js=103,di=113,qn=666,yt=1,Xi=2,ui=3,Yi=4,Kh=3,li=(r,e)=>(r.msg=hi[e],e),mc=r=>r*2-(r>4?9:0),Lr=r=>{let e=r.length;for(;--e>=0;)r[e]=0},Vh=r=>{let e,t,i,n=r.w_size;e=r.hash_size,i=e;do t=r.head[--i],r.head[i]=t>=n?t-n:0;while(--e);e=n,i=e;do t=r.prev[--i],r.prev[i]=t>=n?t-n:0;while(--e)},Zh=(r,e,t)=>(e<<r.hash_shift^t)&r.hash_mask,Hr=Zh,kt=r=>{let e=r.state,t=e.pending;t>r.avail_out&&(t=r.avail_out),t!==0&&(r.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),r.next_out),r.next_out+=t,e.pending_out+=t,r.total_out+=t,r.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},Et=(r,e)=>{Sh(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,e),r.block_start=r.strstart,kt(r.strm)},se=(r,e)=>{r.pending_buf[r.pending++]=e},zn=(r,e)=>{r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=e&255},Ks=(r,e,t,i)=>{let n=r.avail_in;return n>i&&(n=i),n===0?0:(r.avail_in-=n,e.set(r.input.subarray(r.next_in,r.next_in+n),t),r.state.wrap===1?r.adler=Kn(r.adler,e,n,t):r.state.wrap===2&&(r.adler=et(r.adler,e,n,t)),r.next_in+=n,r.total_in+=n,n)},cd=(r,e)=>{let t=r.max_chain_length,i=r.strstart,n,a,o=r.prev_length,s=r.nice_match,h=r.strstart>r.w_size-nr?r.strstart-(r.w_size-nr):0,d=r.window,p=r.w_mask,A=r.prev,k=r.strstart+Or,S=d[i+o-1],E=d[i+o];r.prev_length>=r.good_match&&(t>>=2),s>r.lookahead&&(s=r.lookahead);do if(n=e,!(d[n+o]!==E||d[n+o-1]!==S||d[n]!==d[i]||d[++n]!==d[i+1])){i+=2,n++;do;while(d[++i]===d[++n]&&d[++i]===d[++n]&&d[++i]===d[++n]&&d[++i]===d[++n]&&d[++i]===d[++n]&&d[++i]===d[++n]&&d[++i]===d[++n]&&d[++i]===d[++n]&&i<k);if(a=Or-(k-i),i=k-Or,a>o){if(r.match_start=e,o=a,a>=s)break;S=d[i+o-1],E=d[i+o]}}while((e=A[e&p])>h&&--t!==0);return o<=r.lookahead?o:r.lookahead},Gi=r=>{let e=r.w_size,t,i,n;do{if(i=r.window_size-r.lookahead-r.strstart,r.strstart>=e+(e-nr)&&(r.window.set(r.window.subarray(e,e+e-i),0),r.match_start-=e,r.strstart-=e,r.block_start-=e,r.insert>r.strstart&&(r.insert=r.strstart),Vh(r),i+=e),r.strm.avail_in===0)break;if(t=Ks(r.strm,r.window,r.strstart+r.lookahead,i),r.lookahead+=t,r.lookahead+r.insert>=ie)for(n=r.strstart-r.insert,r.ins_h=r.window[n],r.ins_h=Hr(r,r.ins_h,r.window[n+1]);r.insert&&(r.ins_h=Hr(r,r.ins_h,r.window[n+ie-1]),r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,r.insert--,!(r.lookahead+r.insert<ie)););}while(r.lookahead<nr&&r.strm.avail_in!==0)},dd=(r,e)=>{let t=r.pending_buf_size-5>r.w_size?r.w_size:r.pending_buf_size-5,i,n,a,o=0,s=r.strm.avail_in;do{if(i=65535,a=r.bi_valid+42>>3,r.strm.avail_out<a||(a=r.strm.avail_out-a,n=r.strstart-r.block_start,i>n+r.strm.avail_in&&(i=n+r.strm.avail_in),i>a&&(i=a),i<t&&(i===0&&e!==Bt||e===Ur||i!==n+r.strm.avail_in)))break;o=e===Bt&&i===n+r.strm.avail_in?1:0,Os(r,0,0,o),r.pending_buf[r.pending-4]=i,r.pending_buf[r.pending-3]=i>>8,r.pending_buf[r.pending-2]=~i,r.pending_buf[r.pending-1]=~i>>8,kt(r.strm),n&&(n>i&&(n=i),r.strm.output.set(r.window.subarray(r.block_start,r.block_start+n),r.strm.next_out),r.strm.next_out+=n,r.strm.avail_out-=n,r.strm.total_out+=n,r.block_start+=n,i-=n),i&&(Ks(r.strm,r.strm.output,r.strm.next_out,i),r.strm.next_out+=i,r.strm.avail_out-=i,r.strm.total_out+=i)}while(o===0);return s-=r.strm.avail_in,s&&(s>=r.w_size?(r.matches=2,r.window.set(r.strm.input.subarray(r.strm.next_in-r.w_size,r.strm.next_in),0),r.strstart=r.w_size,r.insert=r.strstart):(r.window_size-r.strstart<=s&&(r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,r.insert>r.strstart&&(r.insert=r.strstart)),r.window.set(r.strm.input.subarray(r.strm.next_in-s,r.strm.next_in),r.strstart),r.strstart+=s,r.insert+=s>r.w_size-r.insert?r.w_size-r.insert:s),r.block_start=r.strstart),r.high_water<r.strstart&&(r.high_water=r.strstart),o?Yi:e!==Ur&&e!==Bt&&r.strm.avail_in===0&&r.strstart===r.block_start?Xi:(a=r.window_size-r.strstart,r.strm.avail_in>a&&r.block_start>=r.w_size&&(r.block_start-=r.w_size,r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,a+=r.w_size,r.insert>r.strstart&&(r.insert=r.strstart)),a>r.strm.avail_in&&(a=r.strm.avail_in),a&&(Ks(r.strm,r.window,r.strstart,a),r.strstart+=a,r.insert+=a>r.w_size-r.insert?r.w_size-r.insert:a),r.high_water<r.strstart&&(r.high_water=r.strstart),a=r.bi_valid+42>>3,a=r.pending_buf_size-a>65535?65535:r.pending_buf_size-a,t=a>r.w_size?r.w_size:a,n=r.strstart-r.block_start,(n>=t||(n||e===Bt)&&e!==Ur&&r.strm.avail_in===0&&n<=a)&&(i=n>a?a:n,o=e===Bt&&r.strm.avail_in===0&&i===n?1:0,Os(r,r.block_start,i,o),r.block_start+=i,kt(r.strm)),o?ui:yt)},Is=(r,e)=>{let t,i;for(;;){if(r.lookahead<nr){if(Gi(r),r.lookahead<nr&&e===Ur)return yt;if(r.lookahead===0)break}if(t=0,r.lookahead>=ie&&(r.ins_h=Hr(r,r.ins_h,r.window[r.strstart+ie-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),t!==0&&r.strstart-t<=r.w_size-nr&&(r.match_length=cd(r,t)),r.match_length>=ie)if(i=Fr(r,r.strstart-r.match_start,r.match_length-ie),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=ie){r.match_length--;do r.strstart++,r.ins_h=Hr(r,r.ins_h,r.window[r.strstart+ie-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart;while(--r.match_length!==0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.ins_h=r.window[r.strstart],r.ins_h=Hr(r,r.ins_h,r.window[r.strstart+1]);else i=Fr(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(i&&(Et(r,!1),r.strm.avail_out===0))return yt}return r.insert=r.strstart<ie-1?r.strstart:ie-1,e===Bt?(Et(r,!0),r.strm.avail_out===0?ui:Yi):r.sym_next&&(Et(r,!1),r.strm.avail_out===0)?yt:Xi},Ki=(r,e)=>{let t,i,n;for(;;){if(r.lookahead<nr){if(Gi(r),r.lookahead<nr&&e===Ur)return yt;if(r.lookahead===0)break}if(t=0,r.lookahead>=ie&&(r.ins_h=Hr(r,r.ins_h,r.window[r.strstart+ie-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=ie-1,t!==0&&r.prev_length<r.max_lazy_match&&r.strstart-t<=r.w_size-nr&&(r.match_length=cd(r,t),r.match_length<=5&&(r.strategy===Rh||r.match_length===ie&&r.strstart-r.match_start>4096)&&(r.match_length=ie-1)),r.prev_length>=ie&&r.match_length<=r.prev_length){n=r.strstart+r.lookahead-ie,i=Fr(r,r.strstart-1-r.prev_match,r.prev_length-ie),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=n&&(r.ins_h=Hr(r,r.ins_h,r.window[r.strstart+ie-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart);while(--r.prev_length!==0);if(r.match_available=0,r.match_length=ie-1,r.strstart++,i&&(Et(r,!1),r.strm.avail_out===0))return yt}else if(r.match_available){if(i=Fr(r,0,r.window[r.strstart-1]),i&&Et(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return yt}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(i=Fr(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<ie-1?r.strstart:ie-1,e===Bt?(Et(r,!0),r.strm.avail_out===0?ui:Yi):r.sym_next&&(Et(r,!1),r.strm.avail_out===0)?yt:Xi},Wh=(r,e)=>{let t,i,n,a,o=r.window;for(;;){if(r.lookahead<=Or){if(Gi(r),r.lookahead<=Or&&e===Ur)return yt;if(r.lookahead===0)break}if(r.match_length=0,r.lookahead>=ie&&r.strstart>0&&(n=r.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){a=r.strstart+Or;do;while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&n<a);r.match_length=Or-(a-n),r.match_length>r.lookahead&&(r.match_length=r.lookahead)}if(r.match_length>=ie?(t=Fr(r,1,r.match_length-ie),r.lookahead-=r.match_length,r.strstart+=r.match_length,r.match_length=0):(t=Fr(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++),t&&(Et(r,!1),r.strm.avail_out===0))return yt}return r.insert=0,e===Bt?(Et(r,!0),r.strm.avail_out===0?ui:Yi):r.sym_next&&(Et(r,!1),r.strm.avail_out===0)?yt:Xi},Gh=(r,e)=>{let t;for(;;){if(r.lookahead===0&&(Gi(r),r.lookahead===0)){if(e===Ur)return yt;break}if(r.match_length=0,t=Fr(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++,t&&(Et(r,!1),r.strm.avail_out===0))return yt}return r.insert=0,e===Bt?(Et(r,!0),r.strm.avail_out===0?ui:Yi):r.sym_next&&(Et(r,!1),r.strm.avail_out===0)?yt:Xi};function tr(r,e,t,i,n){this.good_length=r,this.max_lazy=e,this.nice_length=t,this.max_chain=i,this.func=n}var Dn=[new tr(0,0,0,0,dd),new tr(4,4,8,4,Is),new tr(4,5,16,8,Is),new tr(4,6,32,32,Is),new tr(4,4,16,16,Ki),new tr(8,16,32,32,Ki),new tr(8,16,128,128,Ki),new tr(8,32,128,256,Ki),new tr(32,128,258,1024,Ki),new tr(32,258,258,4096,Ki)],Jh=r=>{r.window_size=2*r.w_size,Lr(r.head),r.max_lazy_match=Dn[r.level].max_lazy,r.good_match=Dn[r.level].good_length,r.nice_match=Dn[r.level].nice_length,r.max_chain_length=Dn[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=ie-1,r.match_available=0,r.ins_h=0};function Xh(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=so,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Hh*2),this.dyn_dtree=new Uint16Array((2*Fh+1)*2),this.bl_tree=new Uint16Array((2*Uh+1)*2),Lr(this.dyn_ltree),Lr(this.dyn_dtree),Lr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array($h+1),this.heap=new Uint16Array(2*Fs+1),Lr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Fs+1),Lr(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Jn=r=>{if(!r)return 1;let e=r.state;return!e||e.strm!==r||e.status!==Wi&&e.status!==Js&&e.status!==Us&&e.status!==Hs&&e.status!==$s&&e.status!==js&&e.status!==di&&e.status!==qn?1:0},ld=r=>{if(Jn(r))return li(r,ir);r.total_in=r.total_out=0,r.data_type=Ch;let e=r.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Js:e.wrap?Wi:di,r.adler=e.wrap===2?0:1,e.last_flush=-2,Ah(e),ct},hd=r=>{let e=ld(r);return e===ct&&Jh(r.state),e},Yh=(r,e)=>Jn(r)||r.state.wrap!==2?ir:(r.state.gzhead=e,ct),ud=(r,e,t,i,n,a)=>{if(!r)return ir;let o=1;if(e===Th&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>zh||t!==so||i<8||i>15||e<0||e>9||a<0||a>Nh||i===8&&o!==1)return li(r,ir);i===8&&(i=9);let s=new Xh;return r.state=s,s.strm=r,s.status=Wi,s.wrap=o,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=n+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+ie-1)/ie),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<n+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=e,s.strategy=a,s.method=t,hd(r)},Qh=(r,e)=>ud(r,e,so,qh,Dh,Bh),eu=(r,e)=>{if(Jn(r)||e>bc||e<0)return r?li(r,ir):ir;let t=r.state;if(!r.output||r.avail_in!==0&&!r.input||t.status===qn&&e!==Bt)return li(r,r.avail_out===0?Ms:ir);let i=t.last_flush;if(t.last_flush=e,t.pending!==0){if(kt(r),r.avail_out===0)return t.last_flush=-1,ct}else if(r.avail_in===0&&mc(e)<=mc(i)&&e!==Bt)return li(r,Ms);if(t.status===qn&&r.avail_in!==0)return li(r,Ms);if(t.status===Wi&&t.wrap===0&&(t.status=di),t.status===Wi){let n=so+(t.w_bits-8<<4)<<8,a=-1;if(t.strategy>=Ya||t.level<2?a=0:t.level<6?a=1:t.level===6?a=2:a=3,n|=a<<6,t.strstart!==0&&(n|=jh),n+=31-n%31,zn(t,n),t.strstart!==0&&(zn(t,r.adler>>>16),zn(t,r.adler&65535)),r.adler=1,t.status=di,kt(r),t.pending!==0)return t.last_flush=-1,ct}if(t.status===Js){if(r.adler=0,se(t,31),se(t,139),se(t,8),t.gzhead)se(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),se(t,t.gzhead.time&255),se(t,t.gzhead.time>>8&255),se(t,t.gzhead.time>>16&255),se(t,t.gzhead.time>>24&255),se(t,t.level===9?2:t.strategy>=Ya||t.level<2?4:0),se(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(se(t,t.gzhead.extra.length&255),se(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(r.adler=et(r.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Us;else if(se(t,0),se(t,0),se(t,0),se(t,0),se(t,0),se(t,t.level===9?2:t.strategy>=Ya||t.level<2?4:0),se(t,Kh),t.status=di,kt(r),t.pending!==0)return t.last_flush=-1,ct}if(t.status===Us){if(t.gzhead.extra){let n=t.pending,a=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+a>t.pending_buf_size;){let s=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>n&&(r.adler=et(r.adler,t.pending_buf,t.pending-n,n)),t.gzindex+=s,kt(r),t.pending!==0)return t.last_flush=-1,ct;n=0,a-=s}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+a),t.pending),t.pending+=a,t.gzhead.hcrc&&t.pending>n&&(r.adler=et(r.adler,t.pending_buf,t.pending-n,n)),t.gzindex=0}t.status=Hs}if(t.status===Hs){if(t.gzhead.name){let n=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>n&&(r.adler=et(r.adler,t.pending_buf,t.pending-n,n)),kt(r),t.pending!==0)return t.last_flush=-1,ct;n=0}t.gzindex<t.gzhead.name.length?a=t.gzhead.name.charCodeAt(t.gzindex++)&255:a=0,se(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>n&&(r.adler=et(r.adler,t.pending_buf,t.pending-n,n)),t.gzindex=0}t.status=$s}if(t.status===$s){if(t.gzhead.comment){let n=t.pending,a;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>n&&(r.adler=et(r.adler,t.pending_buf,t.pending-n,n)),kt(r),t.pending!==0)return t.last_flush=-1,ct;n=0}t.gzindex<t.gzhead.comment.length?a=t.gzhead.comment.charCodeAt(t.gzindex++)&255:a=0,se(t,a)}while(a!==0);t.gzhead.hcrc&&t.pending>n&&(r.adler=et(r.adler,t.pending_buf,t.pending-n,n))}t.status=js}if(t.status===js){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(kt(r),t.pending!==0))return t.last_flush=-1,ct;se(t,r.adler&255),se(t,r.adler>>8&255),r.adler=0}if(t.status=di,kt(r),t.pending!==0)return t.last_flush=-1,ct}if(r.avail_in!==0||t.lookahead!==0||e!==Ur&&t.status!==qn){let n=t.level===0?dd(t,e):t.strategy===Ya?Gh(t,e):t.strategy===Ph?Wh(t,e):Dn[t.level].func(t,e);if((n===ui||n===Yi)&&(t.status=qn),n===yt||n===ui)return r.avail_out===0&&(t.last_flush=-1),ct;if(n===Xi&&(e===Eh?kh(t):e!==bc&&(Os(t,0,0,!1),e===Mh&&(Lr(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),kt(r),r.avail_out===0))return t.last_flush=-1,ct}return e!==Bt?ct:t.wrap<=0?yc:(t.wrap===2?(se(t,r.adler&255),se(t,r.adler>>8&255),se(t,r.adler>>16&255),se(t,r.adler>>24&255),se(t,r.total_in&255),se(t,r.total_in>>8&255),se(t,r.total_in>>16&255),se(t,r.total_in>>24&255)):(zn(t,r.adler>>>16),zn(t,r.adler&65535)),kt(r),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?ct:yc)},tu=r=>{if(Jn(r))return ir;let e=r.state.status;return r.state=null,e===di?li(r,Ih):ct},ru=(r,e)=>{let t=e.length;if(Jn(r))return ir;let i=r.state,n=i.wrap;if(n===2||n===1&&i.status!==Wi||i.lookahead)return ir;if(n===1&&(r.adler=Kn(r.adler,e,t,0)),i.wrap=0,t>=i.w_size){n===0&&(Lr(i.head),i.strstart=0,i.block_start=0,i.insert=0);let h=new Uint8Array(i.w_size);h.set(e.subarray(t-i.w_size,t),0),e=h,t=i.w_size}let a=r.avail_in,o=r.next_in,s=r.input;for(r.avail_in=t,r.next_in=0,r.input=e,Gi(i);i.lookahead>=ie;){let h=i.strstart,d=i.lookahead-(ie-1);do i.ins_h=Hr(i,i.ins_h,i.window[h+ie-1]),i.prev[h&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=h,h++;while(--d);i.strstart=h,i.lookahead=ie-1,Gi(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=ie-1,i.match_available=0,r.next_in=o,r.input=s,r.avail_in=a,i.wrap=n,ct},iu=Qh,nu=ud,au=hd,ou=ld,su=Yh,fu=eu,cu=tu,du=ru,lu="pako deflate (from Nodeca project)",On={deflateInit:iu,deflateInit2:nu,deflateReset:au,deflateResetKeep:ou,deflateSetHeader:su,deflate:fu,deflateEnd:cu,deflateSetDictionary:du,deflateInfo:lu},hu=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),uu=function(r){let e=Array.prototype.slice.call(arguments,1);for(;e.length;){let t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(let i in t)hu(t,i)&&(r[i]=t[i])}}return r},pu=r=>{let e=0;for(let i=0,n=r.length;i<n;i++)e+=r[i].length;let t=new Uint8Array(e);for(let i=0,n=0,a=r.length;i<a;i++){let o=r[i];t.set(o,n),n+=o.length}return t},fo={assign:uu,flattenChunks:pu},pd=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{pd=!1}var Vn=new Uint8Array(256);for(let r=0;r<256;r++)Vn[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Vn[254]=Vn[254]=1;var bu=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let e,t,i,n,a,o=r.length,s=0;for(n=0;n<o;n++)t=r.charCodeAt(n),(t&64512)===55296&&n+1<o&&(i=r.charCodeAt(n+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),n++)),s+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(s),a=0,n=0;a<s;n++)t=r.charCodeAt(n),(t&64512)===55296&&n+1<o&&(i=r.charCodeAt(n+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),n++)),t<128?e[a++]=t:t<2048?(e[a++]=192|t>>>6,e[a++]=128|t&63):t<65536?(e[a++]=224|t>>>12,e[a++]=128|t>>>6&63,e[a++]=128|t&63):(e[a++]=240|t>>>18,e[a++]=128|t>>>12&63,e[a++]=128|t>>>6&63,e[a++]=128|t&63);return e},yu=(r,e)=>{if(e<65534&&r.subarray&&pd)return String.fromCharCode.apply(null,r.length===e?r:r.subarray(0,e));let t="";for(let i=0;i<e;i++)t+=String.fromCharCode(r[i]);return t},mu=(r,e)=>{let t=e||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,e));let i,n,a=new Array(t*2);for(n=0,i=0;i<t;){let o=r[i++];if(o<128){a[n++]=o;continue}let s=Vn[o];if(s>4){a[n++]=65533,i+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&i<t;)o=o<<6|r[i++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return yu(a,n)},vu=(r,e)=>{e=e||r.length,e>r.length&&(e=r.length);let t=e-1;for(;t>=0&&(r[t]&192)===128;)t--;return t<0||t===0?e:t+Vn[r[t]]>e?t:e},Zn={string2buf:bu,buf2string:mu,utf8border:vu};function gu(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var bd=gu,yd=Object.prototype.toString,{Z_NO_FLUSH:_u,Z_SYNC_FLUSH:wu,Z_FULL_FLUSH:xu,Z_FINISH:Au,Z_OK:ao,Z_STREAM_END:Su,Z_DEFAULT_COMPRESSION:ku,Z_DEFAULT_STRATEGY:Eu,Z_DEFLATED:Mu}=bi;function Xn(r){this.options=fo.assign({level:ku,method:Mu,chunkSize:16384,windowBits:15,memLevel:8,strategy:Eu},r||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bd,this.strm.avail_out=0;let t=On.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==ao)throw new Error(hi[t]);if(e.header&&On.deflateSetHeader(this.strm,e.header),e.dictionary){let i;if(typeof e.dictionary=="string"?i=Zn.string2buf(e.dictionary):yd.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,t=On.deflateSetDictionary(this.strm,i),t!==ao)throw new Error(hi[t]);this._dict_set=!0}}Xn.prototype.push=function(r,e){let t=this.strm,i=this.options.chunkSize,n,a;if(this.ended)return!1;for(e===~~e?a=e:a=e===!0?Au:_u,typeof r=="string"?t.input=Zn.string2buf(r):yd.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(a===wu||a===xu)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(n=On.deflate(t,a),n===Su)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),n=On.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===ao;if(t.avail_out===0){this.onData(t.output);continue}if(a>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};Xn.prototype.onData=function(r){this.chunks.push(r)};Xn.prototype.onEnd=function(r){r===ao&&(this.result=fo.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function Xs(r,e){let t=new Xn(e);if(t.push(r,!0),t.err)throw t.msg||hi[t.err];return t.result}function Iu(r,e){return e=e||{},e.raw=!0,Xs(r,e)}function Tu(r,e){return e=e||{},e.gzip=!0,Xs(r,e)}var Ru=Xn,Pu=Xs,Nu=Iu,Bu=Tu,Cu=bi,zu={Deflate:Ru,deflate:Pu,deflateRaw:Nu,gzip:Bu,constants:Cu},Qa=16209,qu=16191,Du=function(e,t){let i,n,a,o,s,h,d,p,A,k,S,E,I,P,T,C,z,N,j,J,D,O,L,x,f=e.state;i=e.next_in,L=e.input,n=i+(e.avail_in-5),a=e.next_out,x=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),h=f.dmax,d=f.wsize,p=f.whave,A=f.wnext,k=f.window,S=f.hold,E=f.bits,I=f.lencode,P=f.distcode,T=(1<<f.lenbits)-1,C=(1<<f.distbits)-1;e:do{E<15&&(S+=L[i++]<<E,E+=8,S+=L[i++]<<E,E+=8),z=I[S&T];t:for(;;){if(N=z>>>24,S>>>=N,E-=N,N=z>>>16&255,N===0)x[a++]=z&65535;else if(N&16){j=z&65535,N&=15,N&&(E<N&&(S+=L[i++]<<E,E+=8),j+=S&(1<<N)-1,S>>>=N,E-=N),E<15&&(S+=L[i++]<<E,E+=8,S+=L[i++]<<E,E+=8),z=P[S&C];r:for(;;){if(N=z>>>24,S>>>=N,E-=N,N=z>>>16&255,N&16){if(J=z&65535,N&=15,E<N&&(S+=L[i++]<<E,E+=8,E<N&&(S+=L[i++]<<E,E+=8)),J+=S&(1<<N)-1,J>h){e.msg="invalid distance too far back",f.mode=Qa;break e}if(S>>>=N,E-=N,N=a-o,J>N){if(N=J-N,N>p&&f.sane){e.msg="invalid distance too far back",f.mode=Qa;break e}if(D=0,O=k,A===0){if(D+=d-N,N<j){j-=N;do x[a++]=k[D++];while(--N);D=a-J,O=x}}else if(A<N){if(D+=d+A-N,N-=A,N<j){j-=N;do x[a++]=k[D++];while(--N);if(D=0,A<j){N=A,j-=N;do x[a++]=k[D++];while(--N);D=a-J,O=x}}}else if(D+=A-N,N<j){j-=N;do x[a++]=k[D++];while(--N);D=a-J,O=x}for(;j>2;)x[a++]=O[D++],x[a++]=O[D++],x[a++]=O[D++],j-=3;j&&(x[a++]=O[D++],j>1&&(x[a++]=O[D++]))}else{D=a-J;do x[a++]=x[D++],x[a++]=x[D++],x[a++]=x[D++],j-=3;while(j>2);j&&(x[a++]=x[D++],j>1&&(x[a++]=x[D++]))}}else if((N&64)===0){z=P[(z&65535)+(S&(1<<N)-1)];continue r}else{e.msg="invalid distance code",f.mode=Qa;break e}break}}else if((N&64)===0){z=I[(z&65535)+(S&(1<<N)-1)];continue t}else if(N&32){f.mode=qu;break e}else{e.msg="invalid literal/length code",f.mode=Qa;break e}break}}while(i<n&&a<s);j=E>>3,i-=j,E-=j<<3,S&=(1<<E)-1,e.next_in=i,e.next_out=a,e.avail_in=i<n?5+(n-i):5-(i-n),e.avail_out=a<s?257+(s-a):257-(a-s),f.hold=S,f.bits=E},Vi=15,vc=852,gc=592,_c=0,Ts=1,wc=2,Lu=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Ou=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Fu=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Uu=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Hu=(r,e,t,i,n,a,o,s)=>{let h=s.bits,d=0,p=0,A=0,k=0,S=0,E=0,I=0,P=0,T=0,C=0,z,N,j,J,D,O=null,L,x=new Uint16Array(Vi+1),f=new Uint16Array(Vi+1),u=null,m,v,y;for(d=0;d<=Vi;d++)x[d]=0;for(p=0;p<i;p++)x[e[t+p]]++;for(S=h,k=Vi;k>=1&&x[k]===0;k--);if(S>k&&(S=k),k===0)return n[a++]=1<<24|64<<16|0,n[a++]=1<<24|64<<16|0,s.bits=1,0;for(A=1;A<k&&x[A]===0;A++);for(S<A&&(S=A),P=1,d=1;d<=Vi;d++)if(P<<=1,P-=x[d],P<0)return-1;if(P>0&&(r===_c||k!==1))return-1;for(f[1]=0,d=1;d<Vi;d++)f[d+1]=f[d]+x[d];for(p=0;p<i;p++)e[t+p]!==0&&(o[f[e[t+p]]++]=p);if(r===_c?(O=u=o,L=20):r===Ts?(O=Lu,u=Ou,L=257):(O=Fu,u=Uu,L=0),C=0,p=0,d=A,D=a,E=S,I=0,j=-1,T=1<<S,J=T-1,r===Ts&&T>vc||r===wc&&T>gc)return 1;for(;;){m=d-I,o[p]+1<L?(v=0,y=o[p]):o[p]>=L?(v=u[o[p]-L],y=O[o[p]-L]):(v=96,y=0),z=1<<d-I,N=1<<E,A=N;do N-=z,n[D+(C>>I)+N]=m<<24|v<<16|y|0;while(N!==0);for(z=1<<d-1;C&z;)z>>=1;if(z!==0?(C&=z-1,C+=z):C=0,p++,--x[d]===0){if(d===k)break;d=e[t+o[p]]}if(d>S&&(C&J)!==j){for(I===0&&(I=S),D+=A,E=d-I,P=1<<E;E+I<k&&(P-=x[E+I],!(P<=0));)E++,P<<=1;if(T+=1<<E,r===Ts&&T>vc||r===wc&&T>gc)return 1;j=C&J,n[j]=S<<24|E<<16|D-a|0}}return C!==0&&(n[D+C]=d-I<<24|64<<16|0),s.bits=S,0},Fn=Hu,$u=0,md=1,vd=2,{Z_FINISH:xc,Z_BLOCK:ju,Z_TREES:eo,Z_OK:pi,Z_STREAM_END:Ku,Z_NEED_DICT:Vu,Z_STREAM_ERROR:Ct,Z_DATA_ERROR:gd,Z_MEM_ERROR:_d,Z_BUF_ERROR:Zu,Z_DEFLATED:Ac}=bi,co=16180,Sc=16181,kc=16182,Ec=16183,Mc=16184,Ic=16185,Tc=16186,Rc=16187,Pc=16188,Nc=16189,oo=16190,wr=16191,Rs=16192,Bc=16193,Ps=16194,Cc=16195,zc=16196,qc=16197,Dc=16198,to=16199,ro=16200,Lc=16201,Oc=16202,Fc=16203,Uc=16204,Hc=16205,Ns=16206,$c=16207,jc=16208,_e=16209,wd=16210,xd=16211,Wu=852,Gu=592,Ju=15,Xu=Ju,Kc=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function Yu(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var yi=r=>{if(!r)return 1;let e=r.state;return!e||e.strm!==r||e.mode<co||e.mode>xd?1:0},Ad=r=>{if(yi(r))return Ct;let e=r.state;return r.total_in=r.total_out=e.total=0,r.msg="",e.wrap&&(r.adler=e.wrap&1),e.mode=co,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(Wu),e.distcode=e.distdyn=new Int32Array(Gu),e.sane=1,e.back=-1,pi},Sd=r=>{if(yi(r))return Ct;let e=r.state;return e.wsize=0,e.whave=0,e.wnext=0,Ad(r)},kd=(r,e)=>{let t;if(yi(r))return Ct;let i=r.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Ct:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=t,i.wbits=e,Sd(r))},Ed=(r,e)=>{if(!r)return Ct;let t=new Yu;r.state=t,t.strm=r,t.window=null,t.mode=co;let i=kd(r,e);return i!==pi&&(r.state=null),i},Qu=r=>Ed(r,Xu),Vc=!0,Bs,Cs,e1=r=>{if(Vc){Bs=new Int32Array(512),Cs=new Int32Array(32);let e=0;for(;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for(Fn(md,r.lens,0,288,Bs,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;Fn(vd,r.lens,0,32,Cs,0,r.work,{bits:5}),Vc=!1}r.lencode=Bs,r.lenbits=9,r.distcode=Cs,r.distbits=5},Md=(r,e,t,i)=>{let n,a=r.state;return a.window===null&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(e.subarray(t-a.wsize,t),0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>i&&(n=i),a.window.set(e.subarray(t-i,t-i+n),a.wnext),i-=n,i?(a.window.set(e.subarray(t-i,t),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0},t1=(r,e)=>{let t,i,n,a,o,s,h,d,p,A,k,S,E,I,P=0,T,C,z,N,j,J,D,O,L=new Uint8Array(4),x,f,u=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(yi(r)||!r.output||!r.input&&r.avail_in!==0)return Ct;t=r.state,t.mode===wr&&(t.mode=Rs),o=r.next_out,n=r.output,h=r.avail_out,a=r.next_in,i=r.input,s=r.avail_in,d=t.hold,p=t.bits,A=s,k=h,O=pi;e:for(;;)switch(t.mode){case co:if(t.wrap===0){t.mode=Rs;break}for(;p<16;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}if(t.wrap&2&&d===35615){t.wbits===0&&(t.wbits=15),t.check=0,L[0]=d&255,L[1]=d>>>8&255,t.check=et(t.check,L,2,0),d=0,p=0,t.mode=Sc;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((d&255)<<8)+(d>>8))%31){r.msg="incorrect header check",t.mode=_e;break}if((d&15)!==Ac){r.msg="unknown compression method",t.mode=_e;break}if(d>>>=4,p-=4,D=(d&15)+8,t.wbits===0&&(t.wbits=D),D>15||D>t.wbits){r.msg="invalid window size",t.mode=_e;break}t.dmax=1<<t.wbits,t.flags=0,r.adler=t.check=1,t.mode=d&512?Nc:wr,d=0,p=0;break;case Sc:for(;p<16;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}if(t.flags=d,(t.flags&255)!==Ac){r.msg="unknown compression method",t.mode=_e;break}if(t.flags&57344){r.msg="unknown header flags set",t.mode=_e;break}t.head&&(t.head.text=d>>8&1),t.flags&512&&t.wrap&4&&(L[0]=d&255,L[1]=d>>>8&255,t.check=et(t.check,L,2,0)),d=0,p=0,t.mode=kc;case kc:for(;p<32;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}t.head&&(t.head.time=d),t.flags&512&&t.wrap&4&&(L[0]=d&255,L[1]=d>>>8&255,L[2]=d>>>16&255,L[3]=d>>>24&255,t.check=et(t.check,L,4,0)),d=0,p=0,t.mode=Ec;case Ec:for(;p<16;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}t.head&&(t.head.xflags=d&255,t.head.os=d>>8),t.flags&512&&t.wrap&4&&(L[0]=d&255,L[1]=d>>>8&255,t.check=et(t.check,L,2,0)),d=0,p=0,t.mode=Mc;case Mc:if(t.flags&1024){for(;p<16;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}t.length=d,t.head&&(t.head.extra_len=d),t.flags&512&&t.wrap&4&&(L[0]=d&255,L[1]=d>>>8&255,t.check=et(t.check,L,2,0)),d=0,p=0}else t.head&&(t.head.extra=null);t.mode=Ic;case Ic:if(t.flags&1024&&(S=t.length,S>s&&(S=s),S&&(t.head&&(D=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(a,a+S),D)),t.flags&512&&t.wrap&4&&(t.check=et(t.check,i,S,a)),s-=S,a+=S,t.length-=S),t.length))break e;t.length=0,t.mode=Tc;case Tc:if(t.flags&2048){if(s===0)break e;S=0;do D=i[a+S++],t.head&&D&&t.length<65536&&(t.head.name+=String.fromCharCode(D));while(D&&S<s);if(t.flags&512&&t.wrap&4&&(t.check=et(t.check,i,S,a)),s-=S,a+=S,D)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=Rc;case Rc:if(t.flags&4096){if(s===0)break e;S=0;do D=i[a+S++],t.head&&D&&t.length<65536&&(t.head.comment+=String.fromCharCode(D));while(D&&S<s);if(t.flags&512&&t.wrap&4&&(t.check=et(t.check,i,S,a)),s-=S,a+=S,D)break e}else t.head&&(t.head.comment=null);t.mode=Pc;case Pc:if(t.flags&512){for(;p<16;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}if(t.wrap&4&&d!==(t.check&65535)){r.msg="header crc mismatch",t.mode=_e;break}d=0,p=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=wr;break;case Nc:for(;p<32;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}r.adler=t.check=Kc(d),d=0,p=0,t.mode=oo;case oo:if(t.havedict===0)return r.next_out=o,r.avail_out=h,r.next_in=a,r.avail_in=s,t.hold=d,t.bits=p,Vu;r.adler=t.check=1,t.mode=wr;case wr:if(e===ju||e===eo)break e;case Rs:if(t.last){d>>>=p&7,p-=p&7,t.mode=Ns;break}for(;p<3;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}switch(t.last=d&1,d>>>=1,p-=1,d&3){case 0:t.mode=Bc;break;case 1:if(e1(t),t.mode=to,e===eo){d>>>=2,p-=2;break e}break;case 2:t.mode=zc;break;case 3:r.msg="invalid block type",t.mode=_e}d>>>=2,p-=2;break;case Bc:for(d>>>=p&7,p-=p&7;p<32;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}if((d&65535)!==(d>>>16^65535)){r.msg="invalid stored block lengths",t.mode=_e;break}if(t.length=d&65535,d=0,p=0,t.mode=Ps,e===eo)break e;case Ps:t.mode=Cc;case Cc:if(S=t.length,S){if(S>s&&(S=s),S>h&&(S=h),S===0)break e;n.set(i.subarray(a,a+S),o),s-=S,a+=S,h-=S,o+=S,t.length-=S;break}t.mode=wr;break;case zc:for(;p<14;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}if(t.nlen=(d&31)+257,d>>>=5,p-=5,t.ndist=(d&31)+1,d>>>=5,p-=5,t.ncode=(d&15)+4,d>>>=4,p-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=_e;break}t.have=0,t.mode=qc;case qc:for(;t.have<t.ncode;){for(;p<3;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}t.lens[u[t.have++]]=d&7,d>>>=3,p-=3}for(;t.have<19;)t.lens[u[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,x={bits:t.lenbits},O=Fn($u,t.lens,0,19,t.lencode,0,t.work,x),t.lenbits=x.bits,O){r.msg="invalid code lengths set",t.mode=_e;break}t.have=0,t.mode=Dc;case Dc:for(;t.have<t.nlen+t.ndist;){for(;P=t.lencode[d&(1<<t.lenbits)-1],T=P>>>24,C=P>>>16&255,z=P&65535,!(T<=p);){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}if(z<16)d>>>=T,p-=T,t.lens[t.have++]=z;else{if(z===16){for(f=T+2;p<f;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}if(d>>>=T,p-=T,t.have===0){r.msg="invalid bit length repeat",t.mode=_e;break}D=t.lens[t.have-1],S=3+(d&3),d>>>=2,p-=2}else if(z===17){for(f=T+3;p<f;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}d>>>=T,p-=T,D=0,S=3+(d&7),d>>>=3,p-=3}else{for(f=T+7;p<f;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}d>>>=T,p-=T,D=0,S=11+(d&127),d>>>=7,p-=7}if(t.have+S>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=_e;break}for(;S--;)t.lens[t.have++]=D}}if(t.mode===_e)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=_e;break}if(t.lenbits=9,x={bits:t.lenbits},O=Fn(md,t.lens,0,t.nlen,t.lencode,0,t.work,x),t.lenbits=x.bits,O){r.msg="invalid literal/lengths set",t.mode=_e;break}if(t.distbits=6,t.distcode=t.distdyn,x={bits:t.distbits},O=Fn(vd,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,x),t.distbits=x.bits,O){r.msg="invalid distances set",t.mode=_e;break}if(t.mode=to,e===eo)break e;case to:t.mode=ro;case ro:if(s>=6&&h>=258){r.next_out=o,r.avail_out=h,r.next_in=a,r.avail_in=s,t.hold=d,t.bits=p,Du(r,k),o=r.next_out,n=r.output,h=r.avail_out,a=r.next_in,i=r.input,s=r.avail_in,d=t.hold,p=t.bits,t.mode===wr&&(t.back=-1);break}for(t.back=0;P=t.lencode[d&(1<<t.lenbits)-1],T=P>>>24,C=P>>>16&255,z=P&65535,!(T<=p);){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}if(C&&(C&240)===0){for(N=T,j=C,J=z;P=t.lencode[J+((d&(1<<N+j)-1)>>N)],T=P>>>24,C=P>>>16&255,z=P&65535,!(N+T<=p);){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}d>>>=N,p-=N,t.back+=N}if(d>>>=T,p-=T,t.back+=T,t.length=z,C===0){t.mode=Hc;break}if(C&32){t.back=-1,t.mode=wr;break}if(C&64){r.msg="invalid literal/length code",t.mode=_e;break}t.extra=C&15,t.mode=Lc;case Lc:if(t.extra){for(f=t.extra;p<f;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}t.length+=d&(1<<t.extra)-1,d>>>=t.extra,p-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Oc;case Oc:for(;P=t.distcode[d&(1<<t.distbits)-1],T=P>>>24,C=P>>>16&255,z=P&65535,!(T<=p);){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}if((C&240)===0){for(N=T,j=C,J=z;P=t.distcode[J+((d&(1<<N+j)-1)>>N)],T=P>>>24,C=P>>>16&255,z=P&65535,!(N+T<=p);){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}d>>>=N,p-=N,t.back+=N}if(d>>>=T,p-=T,t.back+=T,C&64){r.msg="invalid distance code",t.mode=_e;break}t.offset=z,t.extra=C&15,t.mode=Fc;case Fc:if(t.extra){for(f=t.extra;p<f;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}t.offset+=d&(1<<t.extra)-1,d>>>=t.extra,p-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=_e;break}t.mode=Uc;case Uc:if(h===0)break e;if(S=k-h,t.offset>S){if(S=t.offset-S,S>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=_e;break}S>t.wnext?(S-=t.wnext,E=t.wsize-S):E=t.wnext-S,S>t.length&&(S=t.length),I=t.window}else I=n,E=o-t.offset,S=t.length;S>h&&(S=h),h-=S,t.length-=S;do n[o++]=I[E++];while(--S);t.length===0&&(t.mode=ro);break;case Hc:if(h===0)break e;n[o++]=t.length,h--,t.mode=ro;break;case Ns:if(t.wrap){for(;p<32;){if(s===0)break e;s--,d|=i[a++]<<p,p+=8}if(k-=h,r.total_out+=k,t.total+=k,t.wrap&4&&k&&(r.adler=t.check=t.flags?et(t.check,n,k,o-k):Kn(t.check,n,k,o-k)),k=h,t.wrap&4&&(t.flags?d:Kc(d))!==t.check){r.msg="incorrect data check",t.mode=_e;break}d=0,p=0}t.mode=$c;case $c:if(t.wrap&&t.flags){for(;p<32;){if(s===0)break e;s--,d+=i[a++]<<p,p+=8}if(t.wrap&4&&d!==(t.total&4294967295)){r.msg="incorrect length check",t.mode=_e;break}d=0,p=0}t.mode=jc;case jc:O=Ku;break e;case _e:O=gd;break e;case wd:return _d;case xd:default:return Ct}return r.next_out=o,r.avail_out=h,r.next_in=a,r.avail_in=s,t.hold=d,t.bits=p,(t.wsize||k!==r.avail_out&&t.mode<_e&&(t.mode<Ns||e!==xc))&&Md(r,r.output,r.next_out,k-r.avail_out),A-=r.avail_in,k-=r.avail_out,r.total_in+=A,r.total_out+=k,t.total+=k,t.wrap&4&&k&&(r.adler=t.check=t.flags?et(t.check,n,k,r.next_out-k):Kn(t.check,n,k,r.next_out-k)),r.data_type=t.bits+(t.last?64:0)+(t.mode===wr?128:0)+(t.mode===to||t.mode===Ps?256:0),(A===0&&k===0||e===xc)&&O===pi&&(O=Zu),O},r1=r=>{if(yi(r))return Ct;let e=r.state;return e.window&&(e.window=null),r.state=null,pi},i1=(r,e)=>{if(yi(r))return Ct;let t=r.state;return(t.wrap&2)===0?Ct:(t.head=e,e.done=!1,pi)},n1=(r,e)=>{let t=e.length,i,n,a;return yi(r)||(i=r.state,i.wrap!==0&&i.mode!==oo)?Ct:i.mode===oo&&(n=1,n=Kn(n,e,t,0),n!==i.check)?gd:(a=Md(r,e,t,t),a?(i.mode=wd,_d):(i.havedict=1,pi))},a1=Sd,o1=kd,s1=Ad,f1=Qu,c1=Ed,d1=t1,l1=r1,h1=i1,u1=n1,p1="pako inflate (from Nodeca project)",Ar={inflateReset:a1,inflateReset2:o1,inflateResetKeep:s1,inflateInit:f1,inflateInit2:c1,inflate:d1,inflateEnd:l1,inflateGetHeader:h1,inflateSetDictionary:u1,inflateInfo:p1};function b1(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var y1=b1,Id=Object.prototype.toString,{Z_NO_FLUSH:m1,Z_FINISH:v1,Z_OK:Wn,Z_STREAM_END:zs,Z_NEED_DICT:qs,Z_STREAM_ERROR:g1,Z_DATA_ERROR:Zc,Z_MEM_ERROR:_1}=bi;function Yn(r){this.options=fo.assign({chunkSize:1024*64,windowBits:15,to:""},r||{});let e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(r&&r.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bd,this.strm.avail_out=0;let t=Ar.inflateInit2(this.strm,e.windowBits);if(t!==Wn)throw new Error(hi[t]);if(this.header=new y1,Ar.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Zn.string2buf(e.dictionary):Id.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=Ar.inflateSetDictionary(this.strm,e.dictionary),t!==Wn)))throw new Error(hi[t])}Yn.prototype.push=function(r,e){let t=this.strm,i=this.options.chunkSize,n=this.options.dictionary,a,o,s;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?v1:m1,Id.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),a=Ar.inflate(t,o),a===qs&&n&&(a=Ar.inflateSetDictionary(t,n),a===Wn?a=Ar.inflate(t,o):a===Zc&&(a=qs));t.avail_in>0&&a===zs&&t.state.wrap>0&&r[t.next_in]!==0;)Ar.inflateReset(t),a=Ar.inflate(t,o);switch(a){case g1:case Zc:case qs:case _1:return this.onEnd(a),this.ended=!0,!1}if(s=t.avail_out,t.next_out&&(t.avail_out===0||a===zs))if(this.options.to==="string"){let h=Zn.utf8border(t.output,t.next_out),d=t.next_out-h,p=Zn.buf2string(t.output,h);t.next_out=d,t.avail_out=i-d,d&&t.output.set(t.output.subarray(h,h+d),0),this.onData(p)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(a===Wn&&s===0)){if(a===zs)return a=Ar.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};Yn.prototype.onData=function(r){this.chunks.push(r)};Yn.prototype.onEnd=function(r){r===Wn&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=fo.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function Ys(r,e){let t=new Yn(e);if(t.push(r),t.err)throw t.msg||hi[t.err];return t.result}function w1(r,e){return e=e||{},e.raw=!0,Ys(r,e)}var x1=Yn,A1=Ys,S1=w1,k1=Ys,E1=bi,M1={Inflate:x1,inflate:A1,inflateRaw:S1,ungzip:k1,constants:E1},{Deflate:I1,deflate:T1,deflateRaw:R1,gzip:P1}=zu,{Inflate:N1,inflate:B1,inflateRaw:C1,ungzip:z1}=M1,q1=I1,D1=T1,L1=R1,O1=P1,F1=N1,U1=B1,H1=C1,$1=z1,j1=bi,ar={Deflate:q1,deflate:D1,deflateRaw:L1,gzip:O1,Inflate:F1,inflate:U1,inflateRaw:H1,ungzip:$1,constants:j1};var fl=ji(lo()),Ir=ji(ra()),Lt=ji(Xt()),Io=ji(il());function b(r,e,t,i){var n=arguments.length,a=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,i);else for(var s=r.length-1;s>=0;s--)(o=r[s])&&(a=(n<3?o(a):n>3?o(e,t,a):o(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a}function hn(r,e){let t=r.length;if(t!==e.length)return!1;for(let i=0;i<t;i++)if(r[i]!==e[i])return!1;return!0}function Ub(r,e){let t=r.length;if(t!==e.length)return!1;for(let i=0;i<t;i++)if(!r[i].equals(e[i]))return!1;return!0}var Jr={};function cl(){Jr.enc=new Array(255),Jr.dec={};for(let r=0;r<=255;++r){let e=r.toString(16).padStart(2,"0");Jr.enc[r]=e,Jr.dec[e]=r}}function Of(r){Jr.enc||cl();let e=r.length,t=new Array(e);for(let i=0;i<e;++i)t[i]=Jr.enc[r[i]];return t.join("")}function Hb(r){if(Jr.dec||cl(),typeof r!="string")throw new Error("Expected string containing hex digits");if(r.length%2)throw new Error("Odd number of hex digits");r=r.toLowerCase();let e=r.length/2,t=new Uint8Array(e);for(let i=0;i<e;i++){let n=Jr.dec[r[i*2]+r[i*2+1]];if(n===void 0)throw new Error("Expected hex string");t[i]=n}return t}function Zo(r){return(0,fl.default)(r)}var nl=!1;function Z(r,e){if(r instanceof e)return!0;if(r==null||typeof r!="object")return!1;let t=e.__className||e.abiName;if(!t)return!1;let i=r.constructor,n=!1;for(;i&&!n;){let a=i.__className||i.abiName;if(!a)break;n=t==a,i=Object.getPrototypeOf(i)}return n&&!nl&&(console.warn(`Detected alien instance of ${t}, this usually means more than one version of @wharfkit/antelope has been included in your bundle.`),nl=!0),n}var fa=class{static from(e){if(Z(e,this))return e;if(typeof e=="string")return this.fromString(e);throw new Error("Invalid blob")}static fromString(e){if(typeof Buffer=="function")return new this(new Uint8Array(Buffer.from(e,"base64")));switch(e.length%4){case 2:e+="==";break;case 3:e+="=";break;case 1:e=e.substring(0,e.length-1);break}let t=atob(e),i=new Uint8Array(t.length);for(let n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return new this(i)}constructor(e){this.array=e}equals(e){let t=this.constructor;try{return hn(this.array,t.from(e).array)}catch{return!1}}get base64String(){return typeof Buffer=="function"?Buffer.from(this.array).toString("base64"):btoa(this.utf8String)}get utf8String(){return new TextDecoder().decode(this.array)}toABI(e){e.writeArray(this.array)}toString(){return this.base64String}toJSON(){return this.toString()}};fa.abiName="blob";var W=class r{static from(e,t){return Z(e,this)?e:typeof e=="string"?this.fromString(e,t):ArrayBuffer.isView(e)?new this(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):Z(e.array,Uint8Array)?new this(e.array):new this(new Uint8Array(e))}static fromString(e,t="hex"){if(t==="hex"){let i=Hb(e);return new this(i)}else if(t=="utf8"){let i=new TextEncoder;return new this(i.encode(e))}else throw new Error(`Unknown encoding: ${t}`)}static fromABI(e){let t=e.readVaruint32();return new this(e.readArray(t))}static abiDefault(){return new r}static equal(e,t){return this.from(e).equals(this.from(t))}static random(e){return new this(Zo(e))}static isBytes(e){return!!(Z(e,r)||Z(e,Uint8Array)||Array.isArray(e)&&e.every(t=>typeof t=="number")||typeof e=="string"&&(/[\da-f]/i.test(e)||e===""))}constructor(e=new Uint8Array){this.array=e}get length(){return this.array.byteLength}get hexString(){return Of(this.array)}get utf8String(){return new TextDecoder().decode(this.array)}append(e){e=r.from(e);let t=this.array.byteLength+e.array.byteLength,i=new ArrayBuffer(t),n=new Uint8Array(i);n.set(this.array),n.set(e.array,this.array.byteLength),this.array=n}appending(e){let t=new r(this.array);return t.append(e),t}zeropad(e,t=!1){let i=t?e:Math.max(e,this.array.byteLength),n=new ArrayBuffer(i),a=new Uint8Array(n);a.fill(0),t&&this.array.byteLength>i?a.set(this.array.slice(0,i),0):a.set(this.array,i-this.array.byteLength),this.array=a}zeropadded(e,t=!1){let i=new r(this.array);return i.zeropad(e,t),i}dropFirst(e=1){this.array=this.array.subarray(e)}droppingFirst(e=1){return new r(this.array.subarray(e))}copy(){let e=new ArrayBuffer(this.array.byteLength),t=new Uint8Array(e);return t.set(this.array),new r(t)}equals(e){return hn(this.array,r.from(e).array)}toString(e="hex"){if(e==="hex")return this.hexString;if(e==="utf8")return this.utf8String;throw new Error(`Unknown encoding: ${e}`)}toABI(e){e.writeVaruint32(this.array.byteLength),e.writeArray(this.array)}toJSON(){return this.hexString}};W.abiName="bytes";var un=class r{static from(e){return Z(e,this)?e:Z(e,r)?new this(e.array):new this(W.from(e).array)}static fromABI(e){return new this(e.readArray(this.byteSize))}static abiDefault(){return new this(new Uint8Array(this.byteSize))}constructor(e){let t=this.constructor.byteSize;if(e.byteLength!==t)throw new Error(`Checksum size mismatch, expected ${t} bytes got ${e.byteLength}`);this.array=e}equals(e){let t=this.constructor;try{return hn(this.array,t.from(e).array)}catch{return!1}}get hexString(){return Of(this.array)}toABI(e){e.writeArray(this.array)}toString(){return this.hexString}toJSON(){return this.toString()}};un.abiName="__checksum";var de=class r extends un{static from(e){return super.from(e)}static hash(e){let t=new Uint8Array((0,Ir.sha256)().update(W.from(e).array).digest());return new r(t)}};de.abiName="checksum256";de.byteSize=32;var Xr=class r extends un{static from(e){return super.from(e)}static hash(e){let t=new Uint8Array((0,Ir.sha512)().update(W.from(e).array).digest());return new r(t)}};Xr.abiName="checksum512";Xr.byteSize=64;var Ai=class r extends un{static from(e){return super.from(e)}static hash(e){let t=new Uint8Array((0,Ir.ripemd160)().update(W.from(e).array).digest());return new r(t)}};Ai.abiName="checksum160";Ai.byteSize=20;var re;(function(r){r.K1="K1",r.R1="R1",r.WA="WA"})(re||(re={}));(function(r){function e(i){switch(i){case r.K1:return 0;case r.R1:return 1;case r.WA:return 2;default:throw new Error(`Unknown curve type: ${i}`)}}r.indexFor=e;function t(i){let n;switch(typeof i!="number"?n=r.indexFor(i):n=i,n){case 0:return r.K1;case 1:return r.R1;case 2:return r.WA;default:throw new Error("Unknown curve type")}}r.from=t})(re||(re={}));var mt=class r{static get max(){return new Lt.default(2).pow(new Lt.default(this.byteWidth*8-(this.isSigned?1:0))).isubn(1)}static get min(){return this.isSigned?this.max.ineg().isubn(1):new Lt.default(0)}static get zero(){return this.from(0)}static add(e,t,i="truncate"){return r.operator(e,t,i,(n,a)=>n.add(a))}static sub(e,t,i){return r.operator(e,t,i,(n,a)=>n.sub(a))}static mul(e,t,i){return r.operator(e,t,i,(n,a)=>n.mul(a))}static div(e,t,i){return r.operator(e,t,i,(n,a)=>{if(a.isZero())throw new Error("Division by zero");return n.div(a)})}static divRound(e,t,i){return r.operator(e,t,i,(n,a)=>{if(a.isZero())throw new Error("Division by zero");return n.divRound(a)})}static divCeil(e,t,i){return r.operator(e,t,i,(n,a)=>{if(a.isZero())throw new Error("Division by zero");let o=n.divmod(a);return o.mod.isZero()?o.div:o.div.negative!==0?o.div.isubn(1):o.div.iaddn(1)})}static gt(e,t){return e.value.gt(t.value)}static lt(e,t){return e.value.lt(t.value)}static gte(e,t){return e.value.gte(t.value)}static lte(e,t){return e.value.lte(t.value)}static operator(e,t,i="truncate",n){let{a,b:o}=Kb(e,t),s=a.constructor,h=n(a.value,o.value);return s.from(h,i)}static from(e,t){if(Z(e,this))return e;let i=this,n;if(Z(e,r))i=e.constructor,n=e.value.clone();else if(e instanceof Uint8Array)n=new Lt.default(e,void 0,"le"),i.isSigned&&(n=n.fromTwos(i.byteWidth*8));else{if(typeof e=="string"&&!/[0-9]+/.test(e)||typeof e=="number"&&!Number.isFinite(e))throw new Error("Invalid number");n=Lt.default.isBN(e)?e.clone():new Lt.default(e,10),n.isNeg()&&!i.isSigned&&(i={byteWidth:i.byteWidth,isSigned:!0})}switch(t){case"clamp":n=$b(n,this.min,this.max);break;case"truncate":n=jb(n,i,this);break}return new this(n)}static fromABI(e){return this.from(e.readArray(this.byteWidth))}static abiDefault(){return this.from(0)}static random(){return this.from(Zo(this.byteWidth))}constructor(e){let t=this.constructor;if(t.isSigned===void 0||t.byteWidth===void 0)throw new Error("Cannot instantiate abstract class Int");if(e.gt(t.max))throw new Error(`Number ${e} overflows ${t.abiName}`);if(e.lt(t.min))throw new Error(`Number ${e} underflows ${t.abiName}`);this.value=e}cast(e,t="truncate"){return this.constructor===e?this:e.from(this,t)}get byteArray(){let e=this.constructor;return(e.isSigned?this.value.toTwos(e.byteWidth*8):this.value).toArrayLike(Uint8Array,"le",e.byteWidth)}equals(e,t=!1){let i=this.constructor;if(t===!0&&Z(e,r)){let n=e.constructor;if(i.byteWidth!==n.byteWidth||i.isSigned!==n.isSigned)return!1}try{return this.value.eq(i.from(e).value)}catch{return!1}}add(e){this.value=this.operator(e,r.add).value}adding(e){return this.operator(e,r.add)}subtract(e){this.value=this.operator(e,r.sub).value}subtracting(e){return this.operator(e,r.sub)}multiply(e){this.value=this.operator(e,r.mul).value}multiplying(e){return this.operator(e,r.mul)}divide(e,t){this.value=this.dividing(e,t).value}dividing(e,t){let i=r.div;switch(t){case"ceil":i=r.divCeil;break;case"round":i=r.divRound;break}return this.operator(e,i)}gt(e){return r.gt(this,e)}lt(e){return r.lt(this,e)}gte(e){return r.gte(this,e)}lte(e){return r.lte(this,e)}operator(e,t){let i;return Z(e,r)?i=e:i=ht.from(e,"truncate"),t(this,i).cast(this.constructor)}toNumber(){return this.value.toNumber()}toString(){return this.value.toString()}[Symbol.toPrimitive](e){return e==="number"?this.toNumber():this.toString()}toABI(e){e.writeArray(this.byteArray)}toJSON(){return this.value.bitLength()>32?this.value.toString():this.value.toNumber()}};mt.abiName="__int";var pn=class extends mt{};pn.abiName="int8";pn.byteWidth=1;pn.isSigned=!0;var bn=class extends mt{};bn.abiName="int16";bn.byteWidth=2;bn.isSigned=!0;var er=class extends mt{};er.abiName="int32";er.byteWidth=4;er.isSigned=!0;var ht=class extends mt{};ht.abiName="int64";ht.byteWidth=8;ht.isSigned=!0;var yn=class extends mt{};yn.abiName="int128";yn.byteWidth=16;yn.isSigned=!0;var Ut=class extends mt{};Ut.abiName="uint8";Ut.byteWidth=1;Ut.isSigned=!1;var ur=class extends mt{};ur.abiName="uint16";ur.byteWidth=2;ur.isSigned=!1;var he=class extends mt{};he.abiName="uint32";he.byteWidth=4;he.isSigned=!1;var ge=class extends mt{};ge.abiName="uint64";ge.byteWidth=8;ge.isSigned=!1;var Yr=class extends mt{};Yr.abiName="uint128";Yr.byteWidth=16;Yr.isSigned=!1;var mn=class extends mt{static fromABI(e){return new this(new Lt.default(e.readVarint32()))}toABI(e){e.writeVarint32(Number(this))}};mn.abiName="varint32";mn.byteWidth=32;mn.isSigned=!0;var Si=class extends mt{static fromABI(e){return new this(new Lt.default(e.readVaruint32()))}toABI(e){e.writeVaruint32(Number(this))}};Si.abiName="varuint32";Si.byteWidth=32;Si.isSigned=!1;function $b(r,e,t){return Lt.default.min(Lt.default.max(r,e),t)}function jb(r,e,t){let i=r.isNeg()?255:0,a=(e.isSigned?r.toTwos(e.byteWidth*8):r).toArrayLike(Uint8Array,"le"),o=new Uint8Array(t.byteWidth);o.fill(i),o.set(a.slice(0,t.byteWidth));let s=new Lt.default(o,void 0,"le");return t.isSigned?s.fromTwos(t.byteWidth*8):s}function Kb(r,e){r=al(r),e=al(e);let t=r.constructor,i=e.constructor;return t!==i&&(t.isSigned===i.isSigned?t.byteWidth>i.byteWidth?e=e.cast(t):i.byteWidth>t.byteWidth&&(r=r.cast(i)):t.isSigned===!1&&t.byteWidth>=i.byteWidth?e=e.cast(t):i.isSigned===!1&&i.byteWidth>=t.byteWidth?r=r.cast(i):t.isSigned===!0&&t.max.gte(i.max)&&t.min.lte(i.min)?e=e.cast(t):i.isSigned===!0&&i.max.gte(t.max)&&i.min.lte(t.min)&&(r=r.cast(i))),{a:r,b:e}}function al(r){let e=r;return r.constructor.byteWidth<4&&(e=r.cast(er)),e}function Wo(r){let e=[],t=[],i=[],n=new Set,a=h=>{let d;return typeof h.type!="string"?d=o(h.type):d=h.type,h.array===!0&&(h.size?d+=`[${h.size}]`:d+="[]"),h.optional===!0&&(d+="?"),h.extension===!0&&(d+="$"),d},o=h=>{if(h.abiName){if(h.abiName==="__struct")throw new Error("Misconfigured Struct subclass, did you forget @Struct.type?")}else throw new Error("Encountered non-conforming type");if(n.has(h))return h.abiName;if(n.add(h),h.abiAlias)i.push({new_type_name:h.abiName,type:a(h.abiAlias)});else if(h.abiFields){let d=h.abiFields.map(A=>({name:A.name,type:a(A)})),p={base:h.abiBase?o(h.abiBase):"",name:h.abiName,fields:d};e.push(p)}else if(h.abiVariant){let d={name:h.abiName,types:h.abiVariant.map(a)};t.push(d)}return h.abiName},s=o(r);return{abi:ze.from({structs:e,variants:t,types:i}),types:Array.from(n),root:s}}function Po(r){let e=typeof r.type=="string"?r.type:r.type.abiName;return r.array===!0&&(r.size?e+=`[${r.size}]`:e+="[]"),r.optional===!0&&(e+="?"),r.extension===!0&&(e+="$"),e}function Vb(r){return typeof r!="string"&&r.abiName===void 0&&r.type!==void 0}function dl(r){return typeof r=="string"?{type:r}:typeof r.abiName<"u"?{type:r}:r}var ll={abiName:"string",abiDefault:()=>"",fromABI:r=>r.readString(),from:r=>r,toABI:(r,e)=>{e.writeString(r)}},hl={abiName:"bool",abiDefault:()=>!1,fromABI:r=>r.readByte()===1,from:r=>r,toABI:(r,e)=>{e.writeByte(r===!0?1:0)}};function Zb(){return[hl,ll,Ft,Ft.Symbol,Ft.SymbolCode,xn,W,Ai,de,Xr,qo,_n,da,gn,yn,bn,er,ht,pn,G,St,vt,zo,$t,Yr,ur,he,ge,Ut,mn,Si]}function Ef(r=[]){let e={},t=Zb();for(let i of t)e[i.abiName]=i;for(let i of r){if(!i.abiName)throw new Error("Invalid type");e[i.abiName]=i}return e}function Ff(r){if(r.constructor&&r.constructor.abiName!==void 0)return r.constructor.abiName;if(Array.isArray(r)){let e=r.map(Ff),t=e[0];return!t||!e.every(i=>i===t)?void 0:t+"[]"}switch(typeof r){case"boolean":return"bool";case"string":return"string"}}function No(r,e="jsobj"){var t;if(r.constructor&&r.constructor.abiName!==void 0)return r.constructor;if(Array.isArray(r)){let n=r.map(o=>No(o,e)),a=n[0];return!a||!n.every(o=>o&&o.abiName===a.abiName)?void 0:a}let i=typeof r;if(i==="object"&&r!==null){let n=Object.keys(r).map(a=>({name:a,type:No(r[a],e+"_nested")}));return n.find(a=>!a.type)?void 0:(t=class extends l{},t.abiName=e,t.abiFields=n,t)}switch(i){case"boolean":return hl;case"string":return ll}}var Bo=class extends Error{constructor(e,t){let i=e.codingPath.map(({field:n,type:a})=>typeof n=="number"?n:`${n}<${a.typeName}>`).join(".");super(`Decoding error at ${i}: ${t.message}`),this.stack=t.stack,this.ctx=e,this.underlyingError=t}};Bo.__className="DecodingError";function Tr(r){let e=dl(r.type),t=Po(e),i=r.customTypes||[],n;if(r.abi)n=ze.from(r.abi);else try{let s;if(typeof e.type=="string"){let d=Ef(i),p=new ze.ResolvedType(e.type).name;if(s=d[p],!s)throw new Error(`Unknown type: ${e.type}`)}else s=e.type;let h=Wo(s);n=h.abi,i.push(...h.types)}catch(s){throw Error(`Unable to synthesize ABI for: ${t} (${s.message}). To decode non-class types you need to pass the ABI definition manually.`)}let a=n.resolveType(t);typeof e.type!="string"&&i.unshift(e.type);let o={types:Ef(i),strictExtensions:r.strictExtensions||!1,codingPath:[{field:"root",type:a}]};try{if(r.data||r.data===""){let s;if(Z(r.data,Rr))s=r.data;else{let h=W.from(r.data),d=r.ignoreInvalidUTF8===void 0?!0:!r.ignoreInvalidUTF8;s=new Rr(h.array,new TextDecoder("utf-8",{fatal:d}))}return r.metadata&&(s.metadata=r.metadata),To(a,s,o)}else{if(r.object!==void 0)return oa(r.object,a,o);if(r.json)return oa(JSON.parse(r.json),a,o);throw new Error("Nothing to decode, you must set one of data, json, object")}}catch(s){throw new Bo(o,s)}}var ki=Symbol("Resolved");function To(r,e,t){if(t.codingPath.length>32)throw new Error("Maximum decoding depth exceeded");if(r.isExtension&&!e.canRead())return t.strictExtensions?sa(r,t):null;if(r.isOptional&&e.readByte()===0)return null;if(r.isArray){let n=e.readVaruint32(),a=[];for(let o=0;o<n;o++)t.codingPath.push({field:o,type:r}),a.push(i()),t.codingPath.pop();return a}else return i();function i(){let n=t.types[r.name];if(n&&n.fromABI)return n.fromABI(e);if(r.ref){t.codingPath.push({field:"",type:r.ref});let a=To(r.ref,e,t);return t.codingPath.pop(),a}else if(r.fields){let a=r.allFields;if(!a)throw new Error("Invalid struct fields");let o={};for(let s of a)t.codingPath.push({field:s.name,type:s.type}),o[s.name]=To(s.type,e,t),t.codingPath.pop();return n?(o[ki]=!0,n.from(o)):o}else if(r.variant){let a=e.readByte(),o=r.variant[a];if(!o)throw new Error(`Unknown variant idx: ${a}`);t.codingPath.push({field:`v${a}`,type:o});let s=[o.typeName,To(o,e,t)];return t.codingPath.pop(),n?n.from(s):s}else throw n?new Error("Invalid type"):new Error(r.name==="any"?"Unable to decode 'any' type from binary":"Unknown type")}}function oa(r,e,t){if(r==null){if(e.isOptional)return null;if(e.isExtension)return t.strictExtensions?sa(e,t):null;throw new Error(`Unexpectedly encountered ${r} for non-optional (${t.codingPath.map(n=>n.field).join(".")})`)}else if(e.isArray){if(!Array.isArray(r))throw new Error("Expected array");let n=[],a=r.length;for(let o=0;o<a;o++)t.codingPath.push({field:o,type:e}),n.push(i(r[o])),t.codingPath.pop();return n}else return i(r);function i(n){let a=t.types[e.name];if(e.ref&&!a)return oa(n,e.ref,t);if(e.fields){if(typeof n!="object")throw new Error("Expected object");if(typeof a=="function"&&Z(n,a))return n;let o=e.allFields;if(!o)throw new Error("Invalid struct fields");let s={};for(let h of o)t.codingPath.push({field:h.name,type:h.type}),s[h.name]=oa(n[h.name],h.type,t),t.codingPath.pop();return a?(s[ki]=!0,a.from(s)):s}else if(e.variant){let o;Array.isArray(n)&&n.length===2&&typeof n[0]=="string"?(o=n[0],n=n[1]):Z(n,Xe)?(o=n.variantName,n=n.value):o=Ff(n);let s=e.variant.findIndex(p=>p.typeName===o);if(s===-1)throw new Error(`Unknown variant type: ${o}`);let h=e.variant[s];t.codingPath.push({field:`v${s}`,type:h});let d=[h.typeName,oa(n,h,t)];return t.codingPath.pop(),a?(d[ki]=!0,a.from(d)):d}else{if(!a){if(e.name==="any")return n;throw new Error("Unknown type")}return a.from(n)}}}function sa(r,e,t=new Set){if(r.isArray)return[];if(r.isOptional)return null;let i=e.types[r.name];if(i&&i.abiDefault)return i.abiDefault();if(t.has(r.name))throw new Error("Circular type reference");if(t.add(r.name),r.allFields){let n={};for(let a of r.allFields)e.codingPath.push({field:a.name,type:a.type}),n[a.name]=sa(a.type,e,t),e.codingPath.pop();return i?(n[ki]=!0,i.from(n)):n}if(r.variant&&r.variant.length>0){let n=[r.variant[0].typeName,sa(r.variant[0],e)];return i?(n[ki]=!0,i.from(n)):n}if(r.ref){e.codingPath.push({field:"",type:r.ref});let n=sa(r.ref,e,t);return e.codingPath.pop(),n}throw new Error("Unable to determine default value")}var Rr=class{constructor(e,t){this.array=e,this.pos=0,this.metadata={},this.textDecoder=t||new TextDecoder("utf-8",{fatal:!0}),this.data=new DataView(e.buffer,e.byteOffset,e.byteLength)}canRead(e=1){return!(this.pos+e>this.array.byteLength)}ensure(e){if(!this.canRead(e))throw new Error("Read past end of buffer")}setPosition(e){if(e<0||e>this.array.byteLength)throw new Error("Invalid position");this.pos=e}getPosition(){return this.pos}advance(e){this.ensure(e),this.pos+=e}readByte(){return this.ensure(1),this.array[this.pos++]}readFloat(e){this.ensure(e);let t;switch(e){case 4:t=this.data.getFloat32(this.pos,!0);break;case 8:t=this.data.getFloat64(this.pos,!0);break;default:throw new Error("Invalid float size")}return this.pos+=e,t}readVaruint32(){let e=0,t=0;for(;;){let i=this.readByte();if(e|=(i&127)<<t,t+=7,!(i&128))break}return e>>>0}readVarint32(){let e=this.readVaruint32();return e&1?~e>>1|2147483648:e>>>1}readArray(e){this.ensure(e);let t=this.array.subarray(this.pos,this.pos+e);return this.pos+=e,t}readString(){let e=this.readVaruint32();return this.textDecoder.decode(this.readArray(e))}};Rr.__className="ABIDecoder";var Co=class extends Error{constructor(e,t){let i=e.codingPath.map(({field:n,type:a})=>typeof n=="number"?n:`${n}<${a.typeName}>`).join(".");super(`Encoding error at ${i}: ${t.message}`),this.stack=t.stack,this.ctx=e,this.underlyingError=t}};Co.__className="EncodingError";function Ht(r){let e,t;typeof r.type=="string"?t=r.type:r.type&&Vb(r.type)?(typeof r.type.type!="string"&&(e=r.type.type),t=Po(r.type)):r.type&&r.type.abiName!==void 0?(e=r.type,t=r.type.abiName):(e=No(r.object),e&&(t=e.abiName,Array.isArray(r.object)&&(t+="[]")));let i=r.customTypes?r.customTypes.slice():[];if(e)i.unshift(e);else if(t){let h=new ze.ResolvedType(t).name;e=i.find(d=>d.abiName===h)}let n;if(r.abi&&t)n=ze.from(r.abi).resolveType(t);else if(e){let h=Wo(e);n=h.abi.resolveType(t||e.abiName),i.push(...h.types)}else if(t)n=new ze.ResolvedType(t);else throw new Error("Unable to determine the type of the object to be encoded. To encode custom ABI types you must pass the type argument.");let a=Ef(i),o=r.encoder||new vn;r.metadata&&(o.metadata=r.metadata);let s={types:a,encoder:o,codingPath:[{field:"root",type:n}]};try{Ro(r.object,n,s)}catch(h){throw new Co(s,h)}return W.from(o.getData())}function Ro(r,e,t){let i=r!=null;if(e.isOptional&&(t.encoder.writeByte(i?1:0),!i))return;if(e.isArray){if(!Array.isArray(r))throw new Error(`Expected array for: ${e.typeName}`);let a=r.length;e.size||t.encoder.writeVaruint32(a);for(let o=0;o<a;o++)t.codingPath.push({field:o,type:e}),n(r[o]),t.codingPath.pop()}else n(r);function n(a){let o=t.types[e.name];if(e.ref&&!o){Ro(a,e.ref,t);return}if(!i){if(e.isExtension)return;throw new Error(`Found ${a} for non-optional type: ${e.typeName} (${t.codingPath.map(s=>s.field).join(".")})`)}if(o&&o.toABI)o.toABI(a,t.encoder);else if(typeof a.toABI=="function"&&a.constructor.abiName===e.name)a.toABI(t.encoder);else if(e.fields){if(typeof a!="object")throw new Error(`Expected object for: ${e.name}`);let s=e.allFields;if(!s)throw new Error("Invalid struct fields");for(let h of s)t.codingPath.push({field:h.name,type:h.type}),Ro(a[h.name],h.type,t),t.codingPath.pop()}else if(e.variant){let s;Array.isArray(a)&&a.length===2&&typeof a[0]=="string"?(s=a[0],a=a[1]):Z(a,Xe)?(s=a.variantName,a=a.value):s=Ff(a);let h=e.variant.findIndex(p=>p.typeName===s);if(h===-1){let p=e.variant.map(A=>`'${A.typeName}'`).join(", ");throw new Error(`Unknown variant type '${s}', expected one of ${p}`)}let d=e.variant[h];t.encoder.writeVaruint32(h),t.codingPath.push({field:`v${h}`,type:d}),Ro(a,d,t),t.codingPath.pop()}else{if(!o)throw new Error(e.name==="any"?"Unable to encode any type to binary":"Unknown type");let s=o.from(a);if(!s.toABI)throw new Error(`Invalid type ${e.name}, no encoding methods implemented`);s.toABI(t.encoder)}}}var vn=class{constructor(e=1024){this.pageSize=e,this.pos=0,this.textEncoder=new TextEncoder,this.metadata={};let t=new ArrayBuffer(e);this.data=new DataView(t),this.array=new Uint8Array(t)}ensure(e){if(this.data.byteLength>=this.pos+e)return;let t=Math.ceil(e/this.pageSize),i=this.data.byteLength+this.pageSize*t,n=new ArrayBuffer(i),a=new DataView(n),o=new Uint8Array(n);o.set(this.array),this.data=a,this.array=o}writeByte(e){this.ensure(1),this.array[this.pos++]=e}writeArray(e){let t=e.length;this.ensure(t),this.array.set(e,this.pos),this.pos+=t}writeFloat(e,t){switch(this.ensure(t),t){case 4:this.data.setFloat32(this.pos,e,!0);break;case 8:this.data.setFloat64(this.pos,e,!0);break;default:throw new Error("Invalid float size")}this.pos+=t}writeVaruint32(e){for(this.ensure(4);;)if(e>>>7)this.array[this.pos++]=128|e&127,e=e>>>7;else{this.array[this.pos++]=e;break}}writeVarint32(e){this.writeVaruint32(e<<1^e>>31)}writeString(e){let t=this.textEncoder.encode(e);this.writeVaruint32(t.byteLength),this.writeArray(t)}getData(){return new Uint8Array(this.array.buffer,this.array.byteOffset,this.pos)}getBytes(){return new W(this.getData())}};vn.__className="ABIEncoder";var ze=class r{constructor(e){this.version=e.version||r.version,this.types=e.types||[],this.variants=e.variants||[],this.structs=e.structs||[],this.actions=e.actions||[],this.tables=e.tables||[],this.ricardian_clauses=e.ricardian_clauses||[],this.action_results=e.action_results||[]}static from(e){return Z(e,r)?e:Z(e,fa)?Tr({data:e.array,type:this}):typeof e=="string"?new r(JSON.parse(e)):new r(e)}static fromABI(e){let t=e.readString(),i=[],n=e.readVaruint32();for(let T=0;T<n;T++)i.push({new_type_name:e.readString(),type:e.readString()});let a=[],o=e.readVaruint32();for(let T=0;T<o;T++){let C=e.readString(),z=e.readString(),N=e.readVaruint32(),j=[];for(let J=0;J<N;J++)j.push({name:e.readString(),type:e.readString()});a.push({base:z,name:C,fields:j})}let s=[],h=e.readVaruint32();for(let T=0;T<h;T++){let C=G.fromABI(e),z=e.readString(),N=e.readString();s.push({name:C,type:z,ricardian_contract:N})}let d=[],p=e.readVaruint32();for(let T=0;T<p;T++){let C=G.fromABI(e),z=e.readString(),N=[],j=e.readVaruint32();for(let L=0;L<j;L++)N.push(e.readString());let J=[],D=e.readVaruint32();for(let L=0;L<D;L++)J.push(e.readString());let O=e.readString();d.push({name:C,index_type:z,key_names:N,key_types:J,type:O})}let A=[],k=e.readVaruint32();for(let T=0;T<k;T++){let C=e.readString(),z=e.readString();A.push({id:C,body:z})}let S=e.readVaruint32();for(let T=0;T<S;T++)e.advance(8),e.advance(e.readVaruint32());let E=e.readVaruint32();for(let T=0;T<E;T++)e.advance(2),e.advance(e.readVaruint32());let I=[];if(e.canRead()){let T=e.readVaruint32();for(let C=0;C<T;C++){let z=e.readString(),N=[],j=e.readVaruint32();for(let J=0;J<j;J++)N.push(e.readString());I.push({name:z,types:N})}}let P=[];if(e.canRead()){let T=e.readVaruint32();for(let C=0;C<T;C++){let z=G.fromABI(e),N=e.readString();P.push({name:z,result_type:N})}}return new r({version:t,types:i,structs:a,actions:s,tables:d,ricardian_clauses:A,variants:I,action_results:P})}toABI(e){e.writeString(this.version),e.writeVaruint32(this.types.length);for(let t of this.types)e.writeString(t.new_type_name),e.writeString(t.type);e.writeVaruint32(this.structs.length);for(let t of this.structs){e.writeString(t.name),e.writeString(t.base),e.writeVaruint32(t.fields.length);for(let i of t.fields)e.writeString(i.name),e.writeString(i.type)}e.writeVaruint32(this.actions.length);for(let t of this.actions)G.from(t.name).toABI(e),e.writeString(t.type),e.writeString(t.ricardian_contract);e.writeVaruint32(this.tables.length);for(let t of this.tables){G.from(t.name).toABI(e),e.writeString(t.index_type),e.writeVaruint32(t.key_names.length);for(let i of t.key_names)e.writeString(i);e.writeVaruint32(t.key_types.length);for(let i of t.key_types)e.writeString(i);e.writeString(t.type)}e.writeVaruint32(this.ricardian_clauses.length);for(let t of this.ricardian_clauses)e.writeString(t.id),e.writeString(t.body);e.writeVaruint32(0),e.writeVaruint32(0),e.writeVaruint32(this.variants.length);for(let t of this.variants){e.writeString(t.name),e.writeVaruint32(t.types.length);for(let i of t.types)e.writeString(i)}e.writeVaruint32(this.action_results.length);for(let t of this.action_results)G.from(t.name).toABI(e),e.writeString(t.result_type)}resolveType(e){let t={};return this.resolve({name:e,types:t},{id:0})}resolveAll(){let e={},t={id:0};return{types:this.types.map(i=>this.resolve({name:i.new_type_name,types:e},t)),variants:this.variants.map(i=>this.resolve({name:i.name,types:e},t)),structs:this.structs.map(i=>this.resolve({name:i.name,types:e},t))}}resolve({name:e,types:t},i){let n=t[e];if(n)return n;let a=new r.ResolvedType(e,++i.id);t[a.typeName]=a;let o=this.types.find(d=>d.new_type_name==a.name);if(o)return a.ref=this.resolve({name:o.type,types:t},i),a;let s=this.getStruct(a.name);if(s)return s.base&&(a.base=this.resolve({name:s.base,types:t},i)),a.fields=s.fields.map(d=>({name:d.name,type:this.resolve({name:d.type,types:t},i)})),a;let h=this.getVariant(a.name);return h&&(a.variant=h.types.map(d=>this.resolve({name:d,types:t},i))),a}getStruct(e){return this.structs.find(t=>t.name==e)}getVariant(e){return this.variants.find(t=>t.name==e)}getActionType(e){let t=G.from(e).toString(),i=this.actions.find(n=>n.name.toString()===t);if(i)return i.type}equals(e){let t=r.from(e);return this.version!=t.version||this.types.length!=t.types.length||this.structs.length!=t.structs.length||this.actions.length!=t.actions.length||this.tables.length!=t.tables.length||this.ricardian_clauses.length!=t.ricardian_clauses.length||this.variants.length!=t.variants.length||this.action_results.length!=t.action_results.length?!1:Ht({object:this}).equals(Ht({object:t}))}toJSON(){return{version:this.version,types:this.types,structs:this.structs,actions:this.actions,tables:this.tables,ricardian_clauses:this.ricardian_clauses,error_messages:[],abi_extensions:[],variants:this.variants,action_results:this.action_results}}};ze.abiName="abi";ze.version="eosio::abi/1.1";(function(r){class e{constructor(i,n=0){let a=i;a.endsWith("$")?(a=a.slice(0,-1),this.isExtension=!0):this.isExtension=!1,a.endsWith("?")?(a=a.slice(0,-1),this.isOptional=!0):this.isOptional=!1,this.isArray=!1,a.endsWith("[]")&&(a=a.slice(0,-2),this.isArray=!0);let o=a.match(/(.*)\[(\d+)\]/);if(o){let[,s,h]=o;a=s,this.isArray=!0,this.size=Number(h)}this.id=n,this.name=a}get typeName(){let i=this.name;return this.isArray&&(this.size?i+=`[${this.size}]`:i+="[]"),this.isOptional&&(i+="?"),this.isExtension&&(i+="$"),i}get allFields(){let i=this,n=[],a=new Set;do{if(!i.fields||a.has(i.name))return;for(let o=i.fields.length-1;o>=0;o--)n.unshift(i.fields[o]);a.add(i.name),i=i.base}while(i!==void 0);return n}}r.ResolvedType=e})(ze||(ze={}));var l=class{static from(e){return e[ki]===!0?new this(e):Z(e,this)?e:Tr({object:e,type:this})}static get structFields(){let e=[],t=i=>{i.abiBase&&t(i.abiBase);for(let n of i.abiFields||[])e.push(n)};return t(this),e}constructor(e){let t=this.constructor;for(let i of t.structFields){let n=typeof i.type=="string"?new ze.ResolvedType(String(i.type)).isOptional:i.optional,a=e[i.name];n&&!a||(this[i.name]=a)}}equals(e){let t=this.constructor;return e.constructor&&typeof e.constructor.abiName=="string"&&e.constructor.abiName!==t.abiName?!1:Ht({object:this}).equals(Ht({object:t.from(e)}))}toJSON(){let e=this.constructor,t={};for(let i of e.structFields)i.optional&&!this[i.name]||(t[i.name]=this[i.name]);return t}};l.abiName="__struct";(function(r){let e=Symbol("FieldsOwner");function t(n){return function(a){return a.abiName=n,a}}r.type=t;function i(n,a={}){return(o,s)=>{let h=o.constructor;h.abiFields?h.abiFields[e]!==h&&(h.abiBase=h.abiFields[e],h.abiFields=[],h.abiFields[e]=h):(h.abiFields=[],h.abiFields[e]=h),h.abiFields.push({...a,name:s,type:n})}}r.field=i})(l||(l={}));function Di(r){return function(e){return e.abiAlias={type:Object.getPrototypeOf(e.prototype).constructor},e.abiName=r,e}}var Xe=class{static from(e){return e[ki]?new this(e):Z(e,this)?e:Tr({object:e,type:this})}constructor(e){let t=this.constructor.abiVariant;this.value=e[1];let i=t.map(Po).findIndex(n=>n===e[0]);if(0>i||t.length<=i)throw new Error(`Unknown variant ${e[0]}`);this.variantIdx=i}equals(e){let i=this.constructor.from(e);return this.variantIdx!==i.variantIdx?!1:Ht({object:this}).equals(Ht({object:i}))}get variantName(){let e=this.constructor.abiVariant[this.variantIdx];return Po(e)}toJSON(){return[this.variantName,this.value]}};Xe.abiName="__variant";Xe.abiVariant=[];(function(r){function e(t,i){return function(n){return n.abiName=t,n.abiVariant=i.map(dl),n}}r.type=e})(Xe||(Xe={}));var ca=class r{static from(e){return Z(e,this)?e:(typeof e=="string"?e=Number.parseFloat(e):Z(e,r)&&(e=e.value),new this(e))}static fromABI(e){return new this(e.readFloat(this.byteWidth))}static abiDefault(){return this.from(0)}static random(){let e=Zo(this.byteWidth),t=new Rr(e);return this.fromABI(t)}constructor(e){this.value=e}equals(e){let t=this.constructor;return this.value===t.from(e).value}toABI(e){let t=this.constructor;e.writeFloat(this.value,t.byteWidth)}toString(){return this.value.toString()}toJSON(){return this.toString()}};ca.abiName="__float";var da=class extends ca{toString(){return this.value.toFixed(7)}};da.abiName="float32";da.byteWidth=4;var gn=class extends ca{};gn.abiName="float64";gn.byteWidth=8;var _n=class{static from(e){return Z(e,this)?e:(typeof e=="string"&&e.startsWith("0x")&&(e=e.slice(2)),new this(W.from(e)))}static fromABI(e){return new this(new W(e.readArray(this.byteWidth)))}static random(){let e=Zo(16),t=new Rr(e);return this.fromABI(t)}constructor(e){if(e.array.length!==16)throw new Error("Invalid float128");this.data=e}equals(e){let t=this.constructor;return this.data.equals(t.from(e).data)}toABI(e){e.writeArray(this.data.array)}toString(){return"0x"+this.data.hexString}toJSON(){return this.toString()}};_n.abiName="float128";_n.byteWidth=16;var G=class r{get rawValue(){return this.value}static from(e){if(Z(e,r))return e;if(typeof e=="string")return new r(Wb(e));if(Z(e,ge))return new r(e);throw new Error("Invalid name")}static fromABI(e){return new r(ge.fromABI(e))}static abiDefault(){return new this(ge.from(0))}constructor(e){this.value=e}equals(e){return this.value.equals(r.from(e).value)}toString(){return Gb(this.value)}toABI(e){this.value.toABI(e)}toJSON(){return this.toString()}};G.abiName="name";G.pattern=/^[a-z1-5.]{0,13}$/;function Wb(r){function e(n){return n>=97&&n<=122?n-97+6:n>=49&&n<=53?n-49+1:0}let t=new Uint8Array(8),i=63;for(let n=0;n<r.length;++n){let a=e(r.charCodeAt(n));i<5&&(a=a<<1);for(let o=4;o>=0;--o)i>=0&&(t[Math.floor(i/8)]|=(a>>o&1)<<i%8,--i)}return ge.from(t)}function Gb(r){let e=r.value.toArray("le",8),t="";for(let i=63;i>=0;){let n=0;for(let a=0;a<5;++a)i>=0&&(n=n<<1|e[Math.floor(i/8)]>>i%8&1,--i);n>=6?t+=String.fromCharCode(n+97-6):n>=1?t+=String.fromCharCode(n+49-1):t+="."}for(;t.endsWith(".");)t=t.substr(0,t.length-1);return t}var wn=class r{static from(e){return Z(e,this)?e:Z(e,r)?this.fromMilliseconds(e.toMilliseconds()):Z(e,Date)?this.fromDate(e):typeof e=="string"?this.fromString(e):this.fromInteger(e)}static fromString(e){let t=Date.parse(e+"Z");if(!Number.isFinite(t))throw new Error("Invalid date string");return this.fromMilliseconds(t)}static fromDate(e){return this.fromMilliseconds(e.getTime())}static abiDefault(){return this.from(0)}toABI(e){this.value.toABI(e)}equals(e){let t=this.constructor;return this.toMilliseconds()===t.from(e).toMilliseconds()}toMilliseconds(){throw new Error("Not implemented")}toDate(){return new Date(this.toMilliseconds())}toJSON(){return this.toString()}};wn.abiName="__time_point_base";var zo=class extends wn{static fromMilliseconds(e){return new this(ht.from(Math.round(e*1e3)))}static fromInteger(e){return new this(ht.from(e))}static fromABI(e){return new this(ht.fromABI(e))}constructor(e){super(),this.value=e}toString(){return this.toDate().toISOString().slice(0,-1)}toMilliseconds(){return Number(this.value.dividing(1e3,"round"))}};zo.abiName="time_point";var $t=class extends wn{static fromMilliseconds(e){return new this(he.from(Math.round(e/1e3)))}static fromInteger(e){return new this(he.from(e))}static fromABI(e){return new this(he.fromABI(e))}constructor(e){super(),this.value=e}toString(){return this.toDate().toISOString().slice(0,-5)}toMilliseconds(){return Number(this.value.cast(ge).multiplying(1e3))}};$t.abiName="time_point_sec";var xn=class extends wn{static fromMilliseconds(e){return new this(he.from(Math.round((e-9466848e5)/500)))}static fromInteger(e){return new this(he.from(e))}static fromABI(e){return new this(he.fromABI(e))}constructor(e){super(),this.value=e}toString(){return this.toDate().toISOString().slice(0,-1)}toMilliseconds(){return Number(this.value.cast(ge).multiplying(500).adding(9466848e5))}};xn.abiName="block_timestamp_type";var Ft=class r{static from(e,t){if(Z(e,r))return e;switch(typeof e){case"number":if(!t)throw new Error("Symbol is required when creating Asset from number");return this.fromFloat(e,t);case"string":return this.fromString(e);default:throw new Error("Invalid asset")}}static fromString(e){let t=(typeof e=="string"?e:"").split(" ");if(t.length!==2)throw new Error("Invalid asset string");let i=t[0].replace(".",""),n=(t[0].split(".")[1]||"").length,a=r.Symbol.fromParts(t[1],n);return new r(ht.from(i),a)}static fromFloat(e,t){let i=r.Symbol.from(t);return new r(i.convertFloat(e),i)}static fromUnits(e,t){return new r(ht.from(e),r.Symbol.from(t))}static fromABI(e){let t=ht.fromABI(e),i=r.Symbol.fromABI(e);return new r(t,i)}static abiDefault(){return new this(ht.from(0),r.Symbol.abiDefault())}static formatUnits(e,t){let i=ht.from(e).toString().split(""),n=!1;for(i[0]==="-"&&(n=!0,i.shift());i.length<=t;)i.unshift("0");t>0&&i.splice(i.length-t,0,".");let a=i.join("");return n&&(a="-"+a),a}constructor(e,t){this.units=e,this.symbol=t}equals(e){let{symbol:t,units:i}=r.from(e);return this.symbol.value.equals(t.value)&&this.units.equals(i)}get value(){return this.symbol.convertUnits(this.units)}set value(e){this.units=this.symbol.convertFloat(e)}get quantity(){return r.formatUnits(this.units,this.symbol.precision)}toABI(e){this.units.toABI(e),this.symbol.toABI(e)}toString(){return this.quantity+" "+this.symbol.name}toJSON(){return this.toString()}};Ft.abiName="asset";(function(r){class e{static from(n){if(Z(n,e))return n;if(Z(n,ge))return new e(n);let a=n.split(",");if(a.length!==2&&n!=="0,")throw new Error("Invalid symbol string");n==="0,"&&a.push("");let o=Number.parseInt(a[0]);return e.fromParts(a[1],o)}static fromParts(n,a){return new e(Jb(n,a))}static fromABI(n){return new e(ge.fromABI(n))}static abiDefault(){return this.from("4,SYS")}constructor(n){if(ol(n)>e.maxPrecision)throw new Error("Invalid asset symbol, precision too large");if(!n.equals(0)&&!t.pattern.test(kf(n)))throw new Error("Invalid asset symbol, name must be uppercase A-Z");this.value=n}equals(n){return this.value.equals(e.from(n).value)}get name(){return kf(this.value)}get precision(){return ol(this.value)}get code(){return new t(ge.from(this.value.value.clone().iushrn(8)))}toABI(n){this.value.toABI(n)}convertUnits(n){return n.value.toNumber()/Math.pow(10,this.precision)}convertFloat(n){return ht.from(n.toFixed(this.precision).replace(".",""))}toString(){return`${this.precision},${this.name}`}toJSON(){return this.toString()}}e.abiName="symbol",e.maxPrecision=18,r.Symbol=e;class t{static from(n){return Z(n,t)?n:(typeof n=="string"&&(n=ge.from(pl(n))),new this(ge.from(n)))}static fromABI(n){return new t(ge.fromABI(n))}static abiDefault(){return this.from("SYS")}constructor(n){if(!n.equals(0)&&!t.pattern.test(kf(n)))throw new Error("Invalid asset symbol, name must be uppercase A-Z");this.value=n}equals(n){return this.value.equals(t.from(n).value)}toABI(n){this.value.toABI(n)}toString(){return ul(this.value.value.toArray("be"))}toJSON(){return this.toString()}}t.abiName="symbol_code",t.pattern=/^[A-Z]{0,7}$/,r.SymbolCode=t})(Ft||(Ft={}));var qo=class r{static from(e){return Z(e,r)?e:new this(Ft.from(e.quantity),G.from(e.contract))}static fromABI(e){return new r(Ft.fromABI(e),G.fromABI(e))}constructor(e,t){this.quantity=e,this.contract=t}equals(e){return this.quantity.equals(e.quantity)&&this.contract.equals(e.contract)}toABI(e){this.quantity.toABI(e),this.contract.toABI(e)}toJSON(){return{quantity:this.quantity,contract:this.contract}}};qo.abiName="extended_asset";var Mf=class r{static from(e){return Z(e,r)?e:new this(Ft.Symbol.from(e.sym),G.from(e.contract))}static fromABI(e){return new r(Ft.Symbol.fromABI(e),G.fromABI(e))}constructor(e,t){this.sym=e,this.contract=t}equals(e){return this.sym.equals(e.sym)&&this.contract.equals(e.contract)}toABI(e){this.sym.toABI(e),this.contract.toABI(e)}toJSON(){return{sym:this.sym,contract:this.contract}}};Mf.abiName="extended_symbol";function ol(r){return r.value.and(ge.from(255).value).toNumber()}function kf(r){let e=r.value.toArray("be").slice(0,-1);return ul(e)}function ul(r){return r.map(e=>String.fromCharCode(e)).reverse().join("")}function Jb(r,e){let t=pl(r),i=new Uint8Array(t.length+1);return i[0]=e,i.set(t,1),ge.from(i)}function pl(r){let e=Math.min(r.length,7),t=new Uint8Array(e);for(let i=0;i<e;i++)t[i]=r.charCodeAt(i);return t}var At;(function(r){let e;(function(E){E.E_CHECKSUM="E_CHECKSUM",E.E_INVALID="E_INVALID"})(e=r.ErrorCode||(r.ErrorCode={}));class t extends Error{constructor(I,P,T={}){super(I),this.code=P,this.info=T}}t.__className="DecodingError",r.DecodingError=t;let i="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",n=new Int16Array(255).fill(-1);for(let E=0;E<58;++E)n[i.charCodeAt(E)]=E;function a(E,I){if(I==null)return A(E);let P=new Uint8Array(I);for(let T=0;T<E.length;++T){let C=n[E.charCodeAt(T)];if(C<0)throw new t("Invalid Base58 character encountered",e.E_INVALID,{char:E[T]});for(let z=0;z<I;++z){let N=P[z]*58+C;P[z]=N,C=N>>8}if(C)throw new t("Base58 value is out of range",e.E_INVALID)}return P.reverse(),new W(P)}r.decode=a;function o(E,I){let P=a(E,I!=null?I+4:I),T=P.array.subarray(0,-4),C=P.array.subarray(-4),z=S(T);if(!hn(C,z))throw new t("Checksum mismatch",e.E_CHECKSUM,{actual:z,expected:C,data:T,hash:"double_sha256"});return new W(T)}r.decodeCheck=o;function s(E,I,P){let T=a(E,I!=null?I+4:I),C=T.array.subarray(0,-4),z=T.array.subarray(-4),N=k(C,P);if(!hn(z,N))throw new t("Checksum mismatch",e.E_CHECKSUM,{actual:N,expected:z,data:C,hash:"ripemd160"});return new W(C)}r.decodeRipemd160Check=s;function h(E){E=W.from(E);let I=[];for(let P of E.array){let T=P;for(let C=0;C<I.length;++C){let z=(n[I[C]]<<8)+T;I[C]=i.charCodeAt(z%58),T=z/58|0}for(;T;)I.push(i.charCodeAt(T%58)),T=T/58|0}for(let P of E.array){if(P)break;I.push(49)}return I.reverse(),String.fromCharCode(...I)}r.encode=h;function d(E){return E=W.from(E),E=E.appending(S(E.array)),h(E)}r.encodeCheck=d;function p(E,I){return E=W.from(E),E=E.appending(k(E.array,I)),h(E)}r.encodeRipemd160Check=p;function A(E){let I=[];for(let P=0;P<E.length;++P){let T=n[E.charCodeAt(P)];if(T<0)throw new t("Invalid Base58 character encountered",e.E_INVALID,{char:E[P]});for(let C=0;C<I.length;++C){let z=I[C]*58+T;I[C]=z&255,T=z>>8}T&&I.push(T)}for(let P of E)if(P==="1")I.push(0);else break;return I.reverse(),W.from(I)}function k(E,I){let P=(0,Ir.ripemd160)().update(E);return I&&P.update(I),new Uint8Array(P.digest().slice(0,4))}function S(E){let I=(0,Ir.sha256)().update(E).digest(),P=(0,Ir.sha256)().update(I).digest();return new Uint8Array(P.slice(0,4))}})(At||(At={}));var St=class r{static from(e){if(Z(e,r))return e;if(typeof e=="object"&&e.type&&e.compressed)return new r(re.from(e.type),new W(e.compressed));if(typeof e!="string")throw new Error("Invalid public key");if(e.startsWith("PUB_")){let t=e.split("_");if(t.length!==3)throw new Error("Invalid public key string");let i=re.from(t[1]),n=i===re.K1||i===re.R1?33:void 0,a=At.decodeRipemd160Check(t[2],n,i);return new r(i,a)}else if(e.length>=50){let t=At.decodeRipemd160Check(e.slice(-50));return new r(re.K1,t)}else throw new Error("Invalid public key string")}static fromABI(e){let t=re.from(e.readByte());if(t==re.WA){let i=e.getPosition();e.advance(33),e.advance(1),e.advance(e.readVaruint32());let n=e.getPosition()-i;e.setPosition(i);let a=W.from(e.readArray(n));return new r(re.WA,a)}return new r(t,new W(e.readArray(33)))}constructor(e,t){this.type=e,this.data=t}getCompressedKeyBytes(){return this.type===re.WA?this.data.array.slice(0,33):this.data.array}equals(e){let t=r.from(e);return this.type===t.type&&this.data.equals(t.data)}toLegacyString(e="EOS"){if(this.type!==re.K1)throw new Error("Unable to create legacy formatted string for non-K1 key");return`${e}${At.encodeRipemd160Check(this.data)}`}toString(){return`PUB_${this.type}_${At.encodeRipemd160Check(this.data,this.type)}`}toABI(e){e.writeByte(re.indexFor(this.type)),e.writeArray(this.data.array)}toJSON(){return this.toString()}};St.abiName="public_key";var Mo={};function Tn(r){let e=Mo[r];if(!e)if(r==="K1")e=Mo[r]=new Io.ec("secp256k1");else if(r==="R1")e=Mo[r]=new Io.ec("p256");else if(r==="WA")e=Mo[r]=new Io.ec("p256");else throw new Error(`Unknown curve type: ${r}`);return e}function Xb(r,e,t){if(t===re.WA)throw new Error("can't recover webauthn public keys, please use @wharfkit/webauthn.");let i=Tn(t),n=r[0]-31,a=r.subarray(1,33),o=r.subarray(33,65),s=i.recoverPubKey(e,{r:a,s:o},n);return new Uint8Array(s.encodeCompressed())}function Yb(r,e,t,i){let n=Tn(i),a=r.subarray(1,33),o=r.subarray(33,65);return n.verify(e,{r:a,s:o},t)}var vt=class r{static from(e){if(Z(e,r))return e;if(typeof e=="object"&&e.r&&e.s){let t=new Uint8Array(65),i=e.recid,n=re.from(e.type);return(e.type===re.K1||e.type===re.R1)&&(i+=31),t[0]=i,t.set(e.r,1),t.set(e.s,33),new r(n,new W(t))}if(typeof e!="string")throw new Error("Invalid signature");if(e.startsWith("SIG_")){let t=e.split("_");if(t.length!==3)throw new Error("Invalid signature string");let i=re.from(t[1]),n=i===re.K1||i===re.R1?65:void 0,a=At.decodeRipemd160Check(t[2],n,i);return new r(i,a)}else throw new Error("Invalid signature string")}static fromABI(e){let t=re.from(e.readByte());if(t===re.WA){let i=e.getPosition();e.advance(65),e.advance(e.readVaruint32()),e.advance(e.readVaruint32());let n=e.getPosition()-i;e.setPosition(i);let a=W.from(e.readArray(n));return new r(re.WA,a)}return new r(t,new W(e.readArray(65)))}constructor(e,t){this.type=e,this.data=t}equals(e){let t=r.from(e);return this.type===t.type&&this.data.equals(t.data)}recoverDigest(e){e=de.from(e);let t=Xb(this.data.array,e.array,this.type);return St.from({compressed:t,type:this.type})}recoverMessage(e){return this.recoverDigest(de.hash(e))}verifyDigest(e,t){return e=de.from(e),Yb(this.data.array,e.array,t.getCompressedKeyBytes(),this.type)}verifyMessage(e,t){return this.verifyDigest(de.hash(e),t)}toString(){return`SIG_${this.type}_${At.encodeRipemd160Check(this.data,this.type)}`}toABI(e){e.writeByte(re.indexFor(this.type)),e.writeArray(this.data.array)}toJSON(){return this.toString()}};vt.abiName="signature";function Qb(r,e){let n=Tn(e).keyFromPrivate(r).getPublic();return new Uint8Array(n.encodeCompressed())}function e2(r,e,t){let i=Tn(t),n=i.keyFromPrivate(r),a=i.keyFromPublic(e).getPublic();return n.derive(a).toArrayLike(Uint8Array,"be")}function t2(r,e,t){let n=Tn(t).keyFromPrivate(r),a,o,s;if(t==="K1"){let h=1;do a=n.sign(e,{canonical:!0,pers:[h++]}),o=a.r.toArrayLike(Uint8Array,"be",32),s=a.s.toArrayLike(Uint8Array,"be",32);while(!r2(o,s))}else a=n.sign(e,{canonical:!0}),o=a.r.toArrayLike(Uint8Array,"be",32),s=a.s.toArrayLike(Uint8Array,"be",32);return{type:t,r:o,s,recid:a.recoveryParam||0}}function r2(r,e){return!(r[0]&128)&&!(r[0]===0&&!(r[1]&128))&&!(e[0]&128)&&!(e[0]===0&&!(e[1]&128))}function i2(r){return Tn(r).genKeyPair().getPrivate().toArrayLike(Uint8Array,"be",32)}var la=class r{static from(e){return Z(e,r)?e:this.fromString(e)}static fromString(e,t=!1){try{let{type:i,data:n}=n2(e);if(this.isAllZero(n))throw new Error("Invalid private key: All-zero private key is not allowed");return new this(i,n)}catch(i){if(i.message=`Invalid private key (${i.message})`,t&&Z(i,At.DecodingError)&&i.code===At.ErrorCode.E_CHECKSUM){let n=e.startsWith("PVT_R1")?re.R1:re.K1,a=new W(i.info.data);if(a.length===33&&a.dropFirst(),a.zeropad(32,!0),this.isAllZero(a))throw new Error("Invalid private key: All-zero private key is not allowed");return new this(n,a)}throw i}}static generate(e){let t=re.from(e),i=3,n=0,a;do{if(n>=i)throw new Error("Failed to generate valid private key: Maximum retries exceeded");a=new W(i2(t)),n++}while(this.isAllZero(a));return new r(t,a)}constructor(e,t){if((e===re.K1||e===re.R1)&&t.length!==32)throw new Error("Invalid private key length");this.type=e,this.data=t}signDigest(e){return e=de.from(e),vt.from(t2(this.data.array,e.array,this.type))}signMessage(e){return this.signDigest(de.hash(e))}sharedSecret(e){let t=e2(this.data.array,e.data.array,this.type);return Xr.hash(t)}toPublic(){let e=Qb(this.data.array,this.type);return St.from({compressed:e,type:this.type})}toWif(){if(this.type!==re.K1)throw new Error("Unable to generate WIF for non-k1 key");return At.encodeCheck(W.from([128]).appending(this.data))}static isAllZero(e){return e.array.every(t=>t===0)}toString(){return`PVT_${this.type}_${At.encodeRipemd160Check(this.data,this.type)}`}toJSON(){return this.toString()}};function n2(r){let e=typeof r;if(e!=="string")throw new Error(`Expected string, got ${e}`);if(r.startsWith("PVT_")){let t=r.split("_");if(t.length!==3)throw new Error("Invalid PVT format");let i=re.from(t[1]),n;switch(i){case re.K1:case re.R1:n=32;break}let a=At.decodeRipemd160Check(t[2],n,i);return{type:i,data:a}}else{let t=re.K1,i=At.decodeCheck(r);if(i.array[0]!==128)throw new Error("Invalid WIF");return{type:t,data:i.droppingFirst()}}}var If,Ae=If=class extends l{static from(e){if(typeof e=="string"){let t=e.split("@");if(t.length!==2&&t[0].length>0&&t[1].length>0)throw new Error("Invalid permission level string, should be in the format <actor>@<permission>");e={actor:t[0],permission:t[1]}}return super.from(e)}equals(e){let t=If.from(e);return this.actor.equals(t.actor)&&this.permission.equals(t.permission)}toString(){return`${this.actor}@${this.permission}`}};b([l.field("name")],Ae.prototype,"actor",void 0);b([l.field("name")],Ae.prototype,"permission",void 0);Ae=If=b([l.type("permission_level")],Ae);var Tf,qe=Tf=class extends l{static from(e,t){let i={...e},n=i.data;if(!W.isBytes(n)){let o;if(t){if(o=ze.from(t).getActionType(i.name),!o)throw new Error(`The action "${i.name}" does not exist on the ABI provided.`)}else if(!n.constructor||n.constructor.abiName===void 0)throw new Error("Missing ABI definition when creating action with untyped action data");i={...i,data:Ht({object:n,type:o,abi:t})}}let a=super.from(i);if(t)a.abi=ze.from(t);else{let o=No(n);o&&(a.abi=ze.from({...Wo(o).abi,actions:[{name:a.name,type:o.abiName,ricardian_contract:""}]}))}return a}equals(e){let t=Tf.from(e,this.abi);return this.account.equals(t.account)&&this.name.equals(t.name)&&Ub(this.authorization,t.authorization)&&this.data.equals(t.data)}decodeData(e){if(typeof e=="string"||e.abiName)return Tr({data:this.data,type:e});{let t=ze.from(e),i=t.getActionType(this.name);if(!i)throw new Error(`Action ${this.name} does not exist in provided ABI`);return Tr({data:this.data,type:i,abi:t})}}get decoded(){if(!this.abi)throw new Error("Missing ABI definition when decoding action data");return{...this.toJSON(),data:this.decodeData(this.abi)}}};b([l.field("name")],qe.prototype,"account",void 0);b([l.field("name")],qe.prototype,"name",void 0);b([l.field(Ae,{array:!0})],qe.prototype,"authorization",void 0);b([l.field("bytes")],qe.prototype,"data",void 0);qe=Tf=b([l.type("action")],qe);var Rf,ha=class extends l{};b([l.field("uint16")],ha.prototype,"type",void 0);b([l.field("bytes")],ha.prototype,"data",void 0);ha=b([l.type("transaction_extension")],ha);var pr=class extends l{static from(e){return super.from({max_net_usage_words:0,max_cpu_usage_ms:0,delay_sec:0,...e})}};b([l.field("time_point_sec")],pr.prototype,"expiration",void 0);b([l.field("uint16")],pr.prototype,"ref_block_num",void 0);b([l.field("uint32")],pr.prototype,"ref_block_prefix",void 0);b([l.field("varuint32")],pr.prototype,"max_net_usage_words",void 0);b([l.field("uint8")],pr.prototype,"max_cpu_usage_ms",void 0);b([l.field("varuint32")],pr.prototype,"delay_sec",void 0);pr=b([l.type("transaction_header")],pr);var Je=Rf=class extends pr{static from(e,t){let i=h=>{if(t)return Array.isArray(t)?t.filter(d=>G.from(d.contract).equals(h)).map(({abi:d})=>d)[0]:t},n=h=>h instanceof qe?h:qe.from(h,i(h.account)),a=(e.actions||[]).map(n),o=(e.context_free_actions||[]).map(n),s={transaction_extensions:[],...e,context_free_actions:o,actions:a};return super.from(s)}equals(e){let t=Rf.from(e);return this.id.equals(t.id)}get id(){return de.hash(Ht({object:this}))}signingDigest(e){let t=this.signingData(e);return de.hash(t)}signingData(e){let t=W.from(de.from(e).array);return t=t.appending(Ht({object:this})),t=t.appending(new Uint8Array(32)),t}};b([l.field(qe,{array:!0})],Je.prototype,"context_free_actions",void 0);b([l.field(qe,{array:!0})],Je.prototype,"actions",void 0);b([l.field(ha,{array:!0})],Je.prototype,"transaction_extensions",void 0);Je=Rf=b([l.type("transaction")],Je);var Ot=class extends Je{get transaction(){return Je.from({...this,signatures:void 0,context_free_data:void 0})}get id(){return this.transaction.id}static from(e){return super.from({signatures:[],context_free_data:[],...e})}};b([l.field("signature[]")],Ot.prototype,"signatures",void 0);b([l.field("bytes[]")],Ot.prototype,"context_free_data",void 0);Ot=b([l.type("signed_transaction")],Ot);var ln;(function(r){r[r.none=0]="none",r[r.zlib=1]="zlib"})(ln||(ln={}));var nt=class extends l{static from(e){return super.from({signatures:[],packed_context_free_data:"",compression:0,...e})}static fromSigned(e,t=1){let i=Ht({object:Je.from(e)}),n=Ht({object:e.context_free_data,type:"bytes[]"});switch(t){case ln.zlib:{i=ar.deflate(i.array),n=ar.deflate(n.array);break}case ln.none:break}return this.from({compression:t,signatures:e.signatures,packed_context_free_data:n,packed_trx:i})}getTransaction(){switch(Number(this.compression)){case ln.none:return Tr({data:this.packed_trx,type:Je});case ln.zlib:{let e=ar.inflate(this.packed_trx.array);return Tr({data:e,type:Je})}default:throw new Error(`Unknown transaction compression ${this.compression}`)}}getSignedTransaction(){let e=this.getTransaction();return Ot.from({...e,signatures:this.signatures})}};b([l.field("signature[]")],nt.prototype,"signatures",void 0);b([l.field("uint8")],nt.prototype,"compression",void 0);b([l.field("bytes")],nt.prototype,"packed_context_free_data",void 0);b([l.field("bytes")],nt.prototype,"packed_trx",void 0);nt=b([l.type("packed_transaction")],nt);var Ei=class extends l{};b([l.field("string")],Ei.prototype,"status",void 0);b([l.field("uint32")],Ei.prototype,"cpu_usage_us",void 0);b([l.field("uint32")],Ei.prototype,"net_usage_words",void 0);Ei=b([l.type("transaction_receipt")],Ei);var Pf,An=class extends ur{};An=b([Di("weight_type")],An);var Sn=class extends l{};b([l.field(St)],Sn.prototype,"key",void 0);b([l.field(An)],Sn.prototype,"weight",void 0);Sn=b([l.type("key_weight")],Sn);var ua=class extends l{};b([l.field(Ae)],ua.prototype,"permission",void 0);b([l.field(An)],ua.prototype,"weight",void 0);ua=b([l.type("permission_level_weight")],ua);var pa=class extends l{};b([l.field(he)],pa.prototype,"wait_sec",void 0);b([l.field(An)],pa.prototype,"weight",void 0);pa=b([l.type("wait_weight")],pa);var Pr=Pf=class extends l{static from(e){if(Z(e,Pf))return e;let t=super.from({keys:[],accounts:[],waits:[],...e});return t.sort(),t}get waitThreshold(){return this.waits.reduce((e,t)=>e+t.weight.toNumber(),0)}get keyThreshold(){return this.threshold.toNumber()-this.waitThreshold}keyWeight(e){let t=this.keys.find(({key:i})=>i.equals(e));return t?t.weight.toNumber():0}hasPermission(e,t=!1){let i=t?1:this.keyThreshold;return this.keyWeight(e)>=i}sort(){this.keys.sort((e,t)=>String(e.key).localeCompare(String(t.key))),this.accounts.sort((e,t)=>String(e.permission).localeCompare(String(t.permission))),this.waits.sort((e,t)=>String(e.wait_sec).localeCompare(String(t.wait_sec)))}};b([l.field(he)],Pr.prototype,"threshold",void 0);b([l.field(Sn,{array:!0})],Pr.prototype,"keys",void 0);b([l.field(ua,{array:!0})],Pr.prototype,"accounts",void 0);b([l.field(pa,{array:!0})],Pr.prototype,"waits",void 0);Pr=Pf=b([l.type("authority")],Pr);var we=class r{static from(e){return Z(e,this)?e:W.isBytes(e)?new this(W.from(e).array):this.fromBlockChecksum(e.checksum,e.blockNum)}static fromABI(e){return new this(e.readArray(32))}static fromBlockChecksum(e,t){let i=new r(de.from(e).array),n=new Uint8Array(4);return n[0]=Number(t)>>24&255,n[1]=Number(t)>>16&255,n[2]=Number(t)>>8&255,n[3]=Number(t)&255,i.array.set(n,0),i}constructor(e){if(e.byteLength!==32)throw new Error(`BlockId size mismatch, expected 32 bytes got ${e.byteLength}`);this.array=e}equals(e){let t=this.constructor;try{return hn(this.array,t.from(e).array)}catch{return!1}}toABI(e){e.writeArray(this.array)}toString(){return this.hexString}toJSON(){return this.toString()}get hexString(){return Of(this.array)}get blockNum(){let e=this.array.slice(0,4),t=0;for(let i=0;i<4;i++)t=(t<<8)+e[i];return he.from(t)}};we.abiName="block_id_type";var ae;(function(r){r.encode=Ht,r.decode=Tr;function e(n){return Wo(n).abi}r.synthesize=e;function t(n){return JSON.stringify(n)}r.stringify=t;function i(n){let a=o=>{switch(typeof o){case"boolean":case"number":case"string":return o;case"object":{if(o===null)return o;if(typeof o.toJSON=="function")return a(o.toJSON());if(Array.isArray(o))return o.map(a);let s={};for(let h of Object.keys(o))s[h]=a(o[h]);return s}}};return a(n)}r.objectify=i})(ae||(ae={}));var Nf=class{constructor(e,t={}){if(this.headers={},e=e.trim(),e.endsWith("/")&&(e=e.slice(0,-1)),this.url=e,t.headers&&(this.headers=t.headers),t.fetch)this.fetch=t.fetch;else if(typeof window<"u"&&window.fetch)this.fetch=window.fetch.bind(window);else if(typeof global<"u"&&global.fetch)this.fetch=global.fetch.bind(global);else throw new Error("Missing fetch")}async call(e){let t=this.url+e.path,i=e.params!==void 0?JSON.stringify(e.params):void 0,n={...this.headers,...e.headers},a=await this.fetch(t,{method:e.method||"POST",body:i,headers:n}),o=await a.text(),s;try{s=JSON.parse(o)}catch{}let h={};for(let[d,p]of a.headers.entries())h[d]=p;return{headers:h,status:a.status,json:s,text:o}}},ba=class extends l{};b([l.field("name")],ba.prototype,"account",void 0);b([l.field("name",{optional:!0})],ba.prototype,"action",void 0);ba=b([l.type("account_linked_action")],ba);var Mi=class extends l{};b([l.field("name")],Mi.prototype,"perm_name",void 0);b([l.field("name")],Mi.prototype,"parent",void 0);b([l.field(Pr)],Mi.prototype,"required_auth",void 0);b([l.field(ba,{optional:!0,array:!0})],Mi.prototype,"linked_actions",void 0);Mi=b([l.type("account_permission")],Mi);var br=class extends l{};b([l.field("int64")],br.prototype,"used",void 0);b([l.field("int64")],br.prototype,"available",void 0);b([l.field("int64")],br.prototype,"max",void 0);b([l.field("time_point",{optional:!0})],br.prototype,"last_usage_update_time",void 0);b([l.field("int64",{optional:!0})],br.prototype,"current_used",void 0);br=b([l.type("account_resource_limit")],br);var Ii=class extends l{};b([l.field("name")],Ii.prototype,"owner",void 0);b([l.field("asset")],Ii.prototype,"net_weight",void 0);b([l.field("asset")],Ii.prototype,"cpu_weight",void 0);b([l.field("uint64")],Ii.prototype,"ram_bytes",void 0);Ii=b([l.type("account_total_resources")],Ii);var Ti=class extends l{};b([l.field("name")],Ti.prototype,"from",void 0);b([l.field("name")],Ti.prototype,"to",void 0);b([l.field("asset")],Ti.prototype,"net_weight",void 0);b([l.field("asset")],Ti.prototype,"cpu_weight",void 0);Ti=b([l.type("account_self_delegated_bandwidth")],Ti);var Ri=class extends l{};b([l.field("name")],Ri.prototype,"owner",void 0);b([l.field("time_point")],Ri.prototype,"request_time",void 0);b([l.field("asset")],Ri.prototype,"net_amount",void 0);b([l.field("asset")],Ri.prototype,"cpu_amount",void 0);Ri=b([l.type("account_refund_request")],Ri);var It=class extends l{};b([l.field("name")],It.prototype,"owner",void 0);b([l.field("name")],It.prototype,"proxy",void 0);b([l.field("name",{array:!0})],It.prototype,"producers",void 0);b([l.field("int64",{optional:!0})],It.prototype,"staked",void 0);b([l.field("float64")],It.prototype,"last_vote_weight",void 0);b([l.field("float64")],It.prototype,"proxied_vote_weight",void 0);b([l.field("bool")],It.prototype,"is_proxy",void 0);b([l.field("uint32",{optional:!0})],It.prototype,"flags1",void 0);b([l.field("uint32")],It.prototype,"reserved2",void 0);b([l.field("string")],It.prototype,"reserved3",void 0);It=b([l.type("account_voter_info")],It);var Pi=class extends l{};b([l.field("time_point",{optional:!0})],Pi.prototype,"key",void 0);b([l.field("int64",{optional:!0})],Pi.prototype,"value",void 0);b([l.field("time_point",{optional:!0})],Pi.prototype,"first",void 0);b([l.field("int64",{optional:!0})],Pi.prototype,"second",void 0);Pi=b([l.type("account_rex_info_maturities")],Pi);var Nr=class extends l{};b([l.field("uint32")],Nr.prototype,"version",void 0);b([l.field("name")],Nr.prototype,"owner",void 0);b([l.field("asset")],Nr.prototype,"vote_stake",void 0);b([l.field("asset")],Nr.prototype,"rex_balance",void 0);b([l.field("int64")],Nr.prototype,"matured_rex",void 0);b([l.field(Pi,{array:!0})],Nr.prototype,"rex_maturities",void 0);Nr=b([l.type("account_rex_info")],Nr);var Ni=class extends l{};b([l.field("name")],Ni.prototype,"account_name",void 0);b([l.field("checksum256")],Ni.prototype,"code_hash",void 0);b([l.field("checksum256")],Ni.prototype,"abi_hash",void 0);b([l.field(fa)],Ni.prototype,"abi",void 0);Ni=b([l.type("get_raw_abi_response")],Ni);var Se=class extends l{getPermission(e){let t=G.from(e),i=this.permissions.find(n=>n.perm_name.equals(t));if(!i)throw new Error(`Unknown permission ${t} on account ${this.account_name}.`);return i}};b([l.field("name")],Se.prototype,"account_name",void 0);b([l.field("uint32")],Se.prototype,"head_block_num",void 0);b([l.field("time_point")],Se.prototype,"head_block_time",void 0);b([l.field("bool")],Se.prototype,"privileged",void 0);b([l.field("time_point")],Se.prototype,"last_code_update",void 0);b([l.field("time_point")],Se.prototype,"created",void 0);b([l.field("asset?")],Se.prototype,"core_liquid_balance",void 0);b([l.field("int64")],Se.prototype,"ram_quota",void 0);b([l.field("int64")],Se.prototype,"net_weight",void 0);b([l.field("int64")],Se.prototype,"cpu_weight",void 0);b([l.field(br)],Se.prototype,"net_limit",void 0);b([l.field(br)],Se.prototype,"cpu_limit",void 0);b([l.field(br,{optional:!0})],Se.prototype,"subjective_cpu_bill_limit",void 0);b([l.field("uint64")],Se.prototype,"ram_usage",void 0);b([l.field(Mi,{array:!0})],Se.prototype,"permissions",void 0);b([l.field(Ii,{optional:!0})],Se.prototype,"total_resources",void 0);b([l.field(Ti,{optional:!0})],Se.prototype,"self_delegated_bandwidth",void 0);b([l.field(Ri,{optional:!0})],Se.prototype,"refund_request",void 0);b([l.field(It,{optional:!0})],Se.prototype,"voter_info",void 0);b([l.field(Nr,{optional:!0})],Se.prototype,"rex_info",void 0);Se=b([l.type("account_object")],Se);var Br=class extends l{};b([l.field(G)],Br.prototype,"account_name",void 0);b([l.field(G)],Br.prototype,"permission_name",void 0);b([l.field(St,{optional:!0})],Br.prototype,"authorizing_key",void 0);b([l.field(Ae,{optional:!0})],Br.prototype,"authorizing_account",void 0);b([l.field(An)],Br.prototype,"weight",void 0);b([l.field(he)],Br.prototype,"threshold",void 0);Br=b([l.type("account_by_authorizers_row")],Br);var Do=class extends l{};b([l.field(Br,{array:!0})],Do.prototype,"accounts",void 0);Do=b([l.type("account_by_authorizers")],Do);var ya=class extends l{};b([l.field("name")],ya.prototype,"producer_name",void 0);b([l.field("public_key")],ya.prototype,"block_signing_key",void 0);ya=b([l.type("new_producers_entry")],ya);var ma=class extends l{};b([l.field("uint32")],ma.prototype,"version",void 0);b([l.field(ya,{array:!0})],ma.prototype,"producers",void 0);ma=b([l.type("new_producers")],ma);var Lo=class extends l{};b([l.field("uint16")],Lo.prototype,"type",void 0);b([l.field("bytes")],Lo.prototype,"data",void 0);Lo=b([l.type("block_extension")],Lo);var Oo=class extends l{};b([l.field("uint16")],Oo.prototype,"type",void 0);b([l.field("bytes")],Oo.prototype,"data",void 0);Oo=b([l.type("header_extension")],Oo);var bl=class{static from(e){let t,i;return typeof e=="string"?(t=de.from(e),i={}):(t=de.from(e.id),i=e),new this(t,i)}constructor(e,t){this.id=e,this.extra=t}get transaction(){if(this.extra.packed_trx)switch(this.extra.compression){case"zlib":{let e=ar.inflate(W.from(this.extra.packed_trx,"hex").array);return ae.decode({data:e,type:Je})}case"none":return ae.decode({data:this.extra.packed_trx,type:Je});default:throw new Error(`Unsupported compression type ${this.extra.compression}`)}}get signatures(){if(this.extra.signatures)return this.extra.signatures.map(vt.from)}equals(e){return this.id.equals(e.id)}toJSON(){return this.id}};bl.abiName="trx_variant";var Fo=class extends Ei{get id(){return this.trx.id}};b([l.field(bl)],Fo.prototype,"trx",void 0);Fo=b([l.type("get_block_response_receipt")],Fo);var Ye=class extends l{};b([l.field("time_point")],Ye.prototype,"timestamp",void 0);b([l.field("name")],Ye.prototype,"producer",void 0);b([l.field("uint16")],Ye.prototype,"confirmed",void 0);b([l.field(we)],Ye.prototype,"previous",void 0);b([l.field("checksum256")],Ye.prototype,"transaction_mroot",void 0);b([l.field("checksum256")],Ye.prototype,"action_mroot",void 0);b([l.field("uint32")],Ye.prototype,"schedule_version",void 0);b([l.field(ma,{optional:!0})],Ye.prototype,"new_producers",void 0);b([l.field("any",{optional:!0})],Ye.prototype,"header_extensions",void 0);b([l.field("any",{optional:!0})],Ye.prototype,"new_protocol_features",void 0);b([l.field("signature")],Ye.prototype,"producer_signature",void 0);b([l.field(Fo,{array:!0})],Ye.prototype,"transactions",void 0);b([l.field("block_extension",{optional:!0})],Ye.prototype,"block_extensions",void 0);b([l.field(we)],Ye.prototype,"id",void 0);b([l.field("uint32")],Ye.prototype,"block_num",void 0);b([l.field("uint32")],Ye.prototype,"ref_block_prefix",void 0);Ye=b([l.type("get_block_response")],Ye);var gt=class extends l{};b([l.field("uint32")],gt.prototype,"block_num",void 0);b([l.field("uint32")],gt.prototype,"ref_block_num",void 0);b([l.field(we)],gt.prototype,"id",void 0);b([l.field("time_point")],gt.prototype,"timestamp",void 0);b([l.field("name")],gt.prototype,"producer",void 0);b([l.field("uint16")],gt.prototype,"confirmed",void 0);b([l.field(we)],gt.prototype,"previous",void 0);b([l.field("checksum256")],gt.prototype,"transaction_mroot",void 0);b([l.field("checksum256")],gt.prototype,"action_mroot",void 0);b([l.field("uint32")],gt.prototype,"schedule_version",void 0);b([l.field("signature")],gt.prototype,"producer_signature",void 0);b([l.field("uint32")],gt.prototype,"ref_block_prefix",void 0);gt=b([l.type("get_block_response")],gt);var va=class extends l{};b([l.field("name")],va.prototype,"producer_name",void 0);b([l.field("any")],va.prototype,"authority",void 0);va=b([l.type("active_schedule_producer_authority")],va);var ga=class extends l{};b([l.field("name")],ga.prototype,"producer_name",void 0);b([l.field(va)],ga.prototype,"authority",void 0);ga=b([l.type("active_schedule_producer")],ga);var Uo=class extends l{};b([l.field("uint32")],Uo.prototype,"version",void 0);b([l.field(ga,{array:!0})],Uo.prototype,"producers",void 0);Uo=b([l.type("active_schedule")],Uo);var jt=class extends l{};b([l.field("time_point")],jt.prototype,"timestamp",void 0);b([l.field("name")],jt.prototype,"producer",void 0);b([l.field("uint16")],jt.prototype,"confirmed",void 0);b([l.field(we)],jt.prototype,"previous",void 0);b([l.field("checksum256")],jt.prototype,"transaction_mroot",void 0);b([l.field("checksum256")],jt.prototype,"action_mroot",void 0);b([l.field("uint32")],jt.prototype,"schedule_version",void 0);b([l.field("any",{array:!0,optional:!0})],jt.prototype,"header_extensions",void 0);b([l.field("signature")],jt.prototype,"producer_signature",void 0);jt=b([l.type("block_state_header")],jt);var ut=class extends l{};b([l.field("uint32")],ut.prototype,"block_num",void 0);b([l.field("uint32")],ut.prototype,"dpos_proposed_irreversible_blocknum",void 0);b([l.field("uint32")],ut.prototype,"dpos_irreversible_blocknum",void 0);b([l.field(we)],ut.prototype,"id",void 0);b([l.field(jt)],ut.prototype,"header",void 0);b([l.field("any")],ut.prototype,"active_schedule",void 0);b([l.field("any")],ut.prototype,"blockroot_merkle",void 0);b([l.field("any")],ut.prototype,"producer_to_last_produced",void 0);b([l.field("any")],ut.prototype,"producer_to_last_implied_irb",void 0);b([l.field("any")],ut.prototype,"valid_block_signing_authority",void 0);b([l.field("any")],ut.prototype,"confirm_count",void 0);b([l.field("any")],ut.prototype,"pending_schedule",void 0);b([l.field("any",{optional:!0})],ut.prototype,"activated_protocol_features",void 0);b([l.field("any")],ut.prototype,"additional_signatures",void 0);ut=b([l.type("get_block_header_state_response")],ut);var at=class extends l{getTransactionHeader(e=120){let t=$t.fromMilliseconds(this.head_block_time.toMilliseconds()+e*1e3),n=this.last_irreversible_block_id.array.subarray(8,12),a=new Uint32Array(n.buffer,n.byteOffset,1)[0];return pr.from({expiration:t,ref_block_num:Number(this.last_irreversible_block_num)&65535,ref_block_prefix:a})}};b([l.field("string")],at.prototype,"server_version",void 0);b([l.field("checksum256")],at.prototype,"chain_id",void 0);b([l.field("uint32")],at.prototype,"head_block_num",void 0);b([l.field("uint32")],at.prototype,"last_irreversible_block_num",void 0);b([l.field(we)],at.prototype,"last_irreversible_block_id",void 0);b([l.field(we)],at.prototype,"head_block_id",void 0);b([l.field("time_point")],at.prototype,"head_block_time",void 0);b([l.field("name")],at.prototype,"head_block_producer",void 0);b([l.field("uint64")],at.prototype,"virtual_block_cpu_limit",void 0);b([l.field("uint64")],at.prototype,"virtual_block_net_limit",void 0);b([l.field("uint64")],at.prototype,"block_cpu_limit",void 0);b([l.field("uint64")],at.prototype,"block_net_limit",void 0);b([l.field("string?")],at.prototype,"server_version_string",void 0);b([l.field("uint32?")],at.prototype,"fork_db_head_block_num",void 0);b([l.field("block_id_type?")],at.prototype,"fork_db_head_block_id",void 0);at=b([l.type("get_info_response")],at);var Qr=class extends l{};b([l.field("name")],Qr.prototype,"code",void 0);b([l.field("name")],Qr.prototype,"scope",void 0);b([l.field("name")],Qr.prototype,"table",void 0);b([l.field("name")],Qr.prototype,"payer",void 0);b([l.field("uint32")],Qr.prototype,"count",void 0);Qr=b([l.type("get_table_by_scope_response_row")],Qr);var _a=class extends l{};b([l.field(Qr,{array:!0})],_a.prototype,"rows",void 0);b([l.field("string")],_a.prototype,"more",void 0);_a=b([l.type("get_table_by_scope_response")],_a);var Cr=class extends l{};b([l.field(ge)],Cr.prototype,"global_action_seq",void 0);b([l.field(ht)],Cr.prototype,"account_action_seq",void 0);b([l.field(he)],Cr.prototype,"block_num",void 0);b([l.field(xn)],Cr.prototype,"block_time",void 0);b([l.field("any")],Cr.prototype,"action_trace",void 0);b([l.field("boolean?")],Cr.prototype,"irrevirsible",void 0);Cr=b([l.type("ordered_action_result")],Cr);var Bi=class extends l{};b([l.field(Cr,{array:!0})],Bi.prototype,"actions",void 0);b([l.field(er)],Bi.prototype,"last_irreversible_block",void 0);b([l.field(er)],Bi.prototype,"head_block_num",void 0);b([l.field("boolean?")],Bi.prototype,"time_limit_exceeded_error",void 0);Bi=b([l.type("get_actions_response")],Bi);var sl=class extends l{};sl=b([l.type("transaction_trace")],sl);var Kt=class extends l{};b([l.field("any")],Kt.prototype,"actions",void 0);b([l.field("any")],Kt.prototype,"context_free_actions",void 0);b([l.field("any")],Kt.prototype,"context_free_data",void 0);b([l.field("number")],Kt.prototype,"delay_sec",void 0);b([l.field("string")],Kt.prototype,"expiration",void 0);b([l.field("number")],Kt.prototype,"max_cpu_usage_ms",void 0);b([l.field("number")],Kt.prototype,"max_net_usage_words",void 0);b([l.field("number")],Kt.prototype,"ref_block_num",void 0);b([l.field("number")],Kt.prototype,"ref_block_prefix",void 0);b([l.field("string",{array:!0})],Kt.prototype,"signatures",void 0);Kt=b([l.type("trx")],Kt);var Ho=class extends l{};b([l.field(Ei)],Ho.prototype,"receipt",void 0);b([l.field("trx")],Ho.prototype,"trx",void 0);Ho=b([l.type("transaction_info")],Ho);var zr=class extends l{};b([l.field(de)],zr.prototype,"id",void 0);b([l.field(he)],zr.prototype,"block_num",void 0);b([l.field(xn)],zr.prototype,"block_time",void 0);b([l.field(he)],zr.prototype,"last_irreversible_block",void 0);b([l.field("any?")],zr.prototype,"traces",void 0);b([l.field("any")],zr.prototype,"trx",void 0);zr=b([l.type("get_transaction_response")],zr);var $o=class extends l{};b([l.field("name",{array:!0})],$o.prototype,"account_names",void 0);$o=b([l.type("get_key_accounts_response")],$o);var ei=class extends l{};b([l.field(ze)],ei.prototype,"abi",void 0);b([l.field("name")],ei.prototype,"account_name",void 0);b([l.field("checksum256")],ei.prototype,"code_hash",void 0);b([l.field("string")],ei.prototype,"wast",void 0);b([l.field("string")],ei.prototype,"wasm",void 0);ei=b([l.type("get_code_response")],ei);var jo=class extends l{};b([l.field("name",{array:!0})],jo.prototype,"controlled_accounts",void 0);jo=b([l.type("get_controlled_accounts_response")],jo);var kn=class extends l{};b([l.field("asset")],kn.prototype,"supply",void 0);b([l.field("asset")],kn.prototype,"max_supply",void 0);b([l.field("name")],kn.prototype,"issuer",void 0);kn=b([l.type("get_currency_stats_item_response")],kn);var Vt=class extends l{};b([l.field("string")],Vt.prototype,"state",void 0);b([l.field("uint32")],Vt.prototype,"head_number",void 0);b([l.field(we)],Vt.prototype,"head_id",void 0);b([l.field("time_point")],Vt.prototype,"head_timestamp",void 0);b([l.field("uint32")],Vt.prototype,"irreversible_number",void 0);b([l.field(we)],Vt.prototype,"irreversible_id",void 0);b([l.field("time_point")],Vt.prototype,"irreversible_timestamp",void 0);b([l.field(we)],Vt.prototype,"earliest_tracked_block_id",void 0);b([l.field("uint32")],Vt.prototype,"earliest_tracked_block_number",void 0);Vt=b([l.type("get_transaction_status_response")],Vt);var wa=class extends l{};b([l.field(he)],wa.prototype,"threshold",void 0);b([l.field(Sn,{array:!0})],wa.prototype,"keys",void 0);wa=b([l.type("producer_authority")],wa);var xa=class extends l{static from(e){return super.from({...e,authority:[e.authority[0],wa.from(e.authority[1])]})}};b([l.field("name")],xa.prototype,"producer_name",void 0);b([l.field("any",{array:!0})],xa.prototype,"authority",void 0);xa=b([l.type("producer")],xa);var Ci=class extends l{};b([l.field("uint32")],Ci.prototype,"version",void 0);b([l.field(xa,{array:!0})],Ci.prototype,"producers",void 0);Ci=b([l.type("producer_schedule")],Ci);var En=class extends l{};b([l.field(Ci,{optional:!0})],En.prototype,"active",void 0);b([l.field(Ci,{optional:!0})],En.prototype,"pending",void 0);b([l.field(Ci,{optional:!0})],En.prototype,"proposed",void 0);En=b([l.type("get_producer_schedule_response")],En);var yr=class extends l{};b([l.field("checksum256")],yr.prototype,"feature_digest",void 0);b([l.field("uint32")],yr.prototype,"activation_ordinal",void 0);b([l.field("uint32")],yr.prototype,"activation_block_num",void 0);b([l.field("checksum256")],yr.prototype,"description_digest",void 0);b([l.field("string",{array:!0})],yr.prototype,"dependencies",void 0);b([l.field("string")],yr.prototype,"protocol_feature_type",void 0);b([l.field("any",{array:!0})],yr.prototype,"specification",void 0);yr=b([l.type("protocol_feature")],yr);var Aa=class extends l{};b([l.field(yr,{array:!0})],Aa.prototype,"activated_protocol_features",void 0);b([l.field("uint32",{optional:!0})],Aa.prototype,"more",void 0);Aa=b([l.type("get_protocol_features_response")],Aa);var Bf=class{constructor(e){this.client=e}async get_abi(e){return this.client.call({path:"/v1/chain/get_abi",params:{account_name:G.from(e)}})}async get_code(e){return this.client.call({path:"/v1/chain/get_code",params:{account_name:G.from(e)},responseType:ei})}async get_raw_abi(e){return this.client.call({path:"/v1/chain/get_raw_abi",params:{account_name:G.from(e)},responseType:Ni})}async get_account(e,t=Se){return this.client.call({path:"/v1/chain/get_account",params:{account_name:G.from(e)},responseType:t})}async get_accounts_by_authorizers(e){return this.client.call({path:"/v1/chain/get_accounts_by_authorizers",params:e,responseType:Do})}async get_activated_protocol_features(e){return this.client.call({path:"/v1/chain/get_activated_protocol_features",params:e,responseType:Aa})}async get_block(e){return this.client.call({path:"/v1/chain/get_block",params:{block_num_or_id:e},responseType:Ye})}async get_block_header_state(e){return this.client.call({path:"/v1/chain/get_block_header_state",params:{block_num_or_id:e},responseType:ut})}async get_block_info(e){return this.client.call({path:"/v1/chain/get_block_info",params:{block_num:e},responseType:gt})}async get_currency_balance(e,t,i){let n={account:G.from(t),code:G.from(e)};return i&&(n.symbol=i),this.client.call({path:"/v1/chain/get_currency_balance",params:n,responseType:"asset[]"})}async get_currency_stats(e,t){let i={code:G.from(e),symbol:t},n=await this.client.call({path:"/v1/chain/get_currency_stats",params:i}),a={};return Object.keys(n).forEach(o=>a[o]=kn.from(n[o])),a}async get_info(){return this.client.call({path:"/v1/chain/get_info",responseType:at,method:"GET"})}async get_producer_schedule(){return this.client.call({path:"/v1/chain/get_producer_schedule",responseType:En})}async compute_transaction(e){return Z(e,nt)||(e=nt.fromSigned(Ot.from(e))),this.client.call({path:"/v1/chain/compute_transaction",params:{transaction:e}})}async send_read_only_transaction(e){return Z(e,nt)||(e=nt.fromSigned(Ot.from(e))),this.client.call({path:"/v1/chain/send_read_only_transaction",params:{transaction:e}})}async push_transaction(e){return Z(e,nt)||(e=nt.fromSigned(Ot.from(e))),this.client.call({path:"/v1/chain/push_transaction",params:e})}async send_transaction(e){return Z(e,nt)||(e=nt.fromSigned(Ot.from(e))),this.client.call({path:"/v1/chain/send_transaction",params:e})}async send_transaction2(e,t){return Z(e,nt)||(e=nt.fromSigned(Ot.from(e))),this.client.call({path:"/v1/chain/send_transaction2",params:{return_failure_trace:!0,retry_trx:!1,retry_trx_num_blocks:0,transaction:e,...t}})}async get_table_rows(e){let t=e.type,i=e.key_type,n=e.lower_bound||e.upper_bound;!i&&n&&(Z(n,ge)?i="i64":Z(n,Yr)?i="i128":Z(n,de)?i="sha256":Z(n,Ai)&&(i="ripemd160")),i||(i="name");let a=e.json;a===void 0&&(a=t===void 0);let o=e.upper_bound;o&&typeof o!="string"&&(o=String(o));let s=e.lower_bound;s&&typeof s!="string"&&(s=String(s));let h=e.scope;typeof h>"u"?h=String(G.from(e.code)):typeof h!="string"&&(h=String(h));let{rows:d,more:p,next_key:A}=await this.client.call({path:"/v1/chain/get_table_rows",params:{...e,code:G.from(e.code),table:G.from(e.table),limit:e.limit!==void 0?he.from(e.limit):void 0,scope:h,key_type:i,json:a,upper_bound:o,lower_bound:s}}),k;if(e.show_payer&&(k=[],d=d.map(({data:S,payer:E})=>(k.push(G.from(E)),S))),t&&(a?d=d.map(S=>typeof S=="string"&&W.isBytes(S)?ae.decode({data:W.from(S),type:t}):ae.decode({object:S,type:t})):d=d.map(S=>W.from(S)).map(S=>ae.decode({data:S,type:t}))),A&&A.length>0){let S;switch(i){case"i64":S=ge;break;case"i128":S=Yr;break;case"name":S=G;break;case"float64":S=gn;break;case"float128":S=_n;break;case"sha256":S=de;break;case"ripemd160":S=Ai;break;default:throw new Error(`Unsupported key type: ${i}`)}S===G?A=G.from(ae.decode({object:A,type:ge})):A=ae.decode({object:A,type:S})}else A=void 0;return{rows:d,more:p,next_key:A,ram_payers:k}}async get_table_by_scope(e){return this.client.call({path:"/v1/chain/get_table_by_scope",params:e,responseType:_a})}async get_transaction_status(e){return this.client.call({path:"/v1/chain/get_transaction_status",params:{id:de.from(e)},responseType:Vt})}},Cf=class{constructor(e){this.client=e}async get_actions(e,t,i){return this.client.call({path:"/v1/history/get_actions",params:{account_name:G.from(e),pos:er.from(t),offset:er.from(i)},responseType:Bi})}async get_transaction(e,t={}){return this.client.call({path:"/v1/history/get_transaction",params:{id:de.from(e),block_num_hint:t.blockNumHint&&he.from(t.blockNumHint),traces:t.excludeTraces===!0?!1:void 0},responseType:zr})}async get_key_accounts(e){return this.client.call({path:"/v1/history/get_key_accounts",params:{public_key:St.from(e)},responseType:$o})}async get_controlled_accounts(e){return this.client.call({path:"/v1/history/get_controlled_accounts",params:{controlling_account:G.from(e)},responseType:jo})}},Mn=class r extends Error{static formatError(e){return e.what==="unspecified"&&e.details[0].file&&e.details[0].file==="http_plugin.cpp"&&e.details[0].message.slice(0,11)==="unknown key"?"Account not found":e.what==="unspecified"&&e.details&&e.details.length>0?e.details[0].message:e.what&&e.what.length>0?e.what:"Unknown API error"}constructor(e,t){let i;t.json&&t.json.error?i=`${r.formatError(t.json.error)} at ${e}`:i=`HTTP ${t.status} at ${e}`,super(i),this.path=e,this.response=t}get error(){let{json:e}=this.response;return e?e.error:void 0}get name(){let{error:e}=this;return e?e.name:"unspecified"}get code(){let{error:e}=this;return e?e.code:0}get details(){let{error:e}=this;return e?e.details:[]}};Mn.__className="APIError";var Sa=class{constructor(e){if(this.v1={chain:new Bf(this),history:new Cf(this)},e.provider)this.provider=e.provider;else if(e.url)this.provider=new Nf(e.url,e);else throw new Error("Missing url or provider")}async call(e){let t=await this.provider.call(e),{json:i}=t;if(Math.floor(t.status/100)!==2||i&&typeof i.error=="object")throw new Mn(e.path,t);return e.responseType?Tr({type:e.responseType,object:t.json}):t.json||t.text}};Sa.__className="APIClient";var zf,ot=class extends l{};b([l.field("uint16")],ot.prototype,"networkVersion",void 0);b([l.field("checksum256")],ot.prototype,"chainId",void 0);b([l.field("checksum256")],ot.prototype,"nodeId",void 0);b([l.field("public_key")],ot.prototype,"key",void 0);b([l.field("int64")],ot.prototype,"time",void 0);b([l.field("checksum256")],ot.prototype,"token",void 0);b([l.field("signature")],ot.prototype,"sig",void 0);b([l.field("string")],ot.prototype,"p2pAddress",void 0);b([l.field("uint32")],ot.prototype,"lastIrreversibleBlockNumber",void 0);b([l.field(we)],ot.prototype,"lastIrreversibleBlockId",void 0);b([l.field("uint32")],ot.prototype,"headNum",void 0);b([l.field(we)],ot.prototype,"headId",void 0);b([l.field("string")],ot.prototype,"os",void 0);b([l.field("string")],ot.prototype,"agent",void 0);b([l.field("int16")],ot.prototype,"generation",void 0);ot=b([l.type("handshake_message")],ot);var zi=class extends l{};b([l.field("uint32")],zi.prototype,"lastIrreversibleBlockNumber",void 0);b([l.field(we)],zi.prototype,"lastIrreversibleBlockId",void 0);b([l.field("uint32")],zi.prototype,"headNum",void 0);b([l.field(we)],zi.prototype,"headId",void 0);zi=b([l.type("chain_size_message")],zi);var ka=class extends l{};b([l.field("uint8")],ka.prototype,"reason",void 0);b([l.field("checksum256")],ka.prototype,"nodeId",void 0);ka=b([l.type("go_away_message")],ka);var ti=class extends l{};b([l.field("int64")],ti.prototype,"org",void 0);b([l.field("int64")],ti.prototype,"rec",void 0);b([l.field("int64")],ti.prototype,"xmt",void 0);b([l.field("int64")],ti.prototype,"dst",void 0);ti=b([l.type("time_message")],ti);var Ea=class extends l{};b([l.field("checksum256",{array:!0})],Ea.prototype,"knownTrx",void 0);b([l.field(we,{array:!0})],Ea.prototype,"knownBlocks",void 0);Ea=b([l.type("notice_message")],Ea);var Ma=class extends l{};b([l.field("checksum256",{array:!0})],Ma.prototype,"reqTrx",void 0);b([l.field(we,{array:!0})],Ma.prototype,"reqBlocks",void 0);Ma=b([l.type("request_message")],Ma);var Ia=class extends l{};b([l.field("uint32")],Ia.prototype,"startBlock",void 0);b([l.field("uint32")],Ia.prototype,"endBlock",void 0);Ia=b([l.type("sync_request_message")],Ia);var Ta=class extends l{};b([l.field("name")],Ta.prototype,"producer_name",void 0);b([l.field("public_key")],Ta.prototype,"block_signing_key",void 0);Ta=b([l.type("new_producers_entry")],Ta);var Ra=class extends l{};b([l.field("uint32")],Ra.prototype,"version",void 0);b([l.field(Ta,{array:!0})],Ra.prototype,"producers",void 0);Ra=b([l.type("new_producers")],Ra);var Pa=class extends l{};b([l.field("uint16")],Pa.prototype,"type",void 0);b([l.field("bytes")],Pa.prototype,"data",void 0);Pa=b([l.type("block_extension")],Pa);var Ko=class extends l{};b([l.field("uint16")],Ko.prototype,"type",void 0);b([l.field("bytes")],Ko.prototype,"data",void 0);Ko=b([l.type("header_extension")],Ko);var qf=class extends Xe{};qf=b([Xe.type("trx_variant",[de,nt])],qf);var qi=class extends l{};b([l.field(Ut)],qi.prototype,"status",void 0);b([l.field(he)],qi.prototype,"cpu_usage_us",void 0);b([l.field(Si)],qi.prototype,"net_usage_words",void 0);b([l.field(qf)],qi.prototype,"trx",void 0);qi=b([l.type("full_transaction_receipt")],qi);var Zt=zf=class extends l{get blockNum(){return this.previous.blockNum.adding(1)}get id(){let e=de.hash(ae.encode({object:this,type:zf}));return we.fromBlockChecksum(e,this.blockNum)}};b([l.field("uint32")],Zt.prototype,"timeSlot",void 0);b([l.field("name")],Zt.prototype,"producer",void 0);b([l.field("uint16")],Zt.prototype,"confirmed",void 0);b([l.field(we)],Zt.prototype,"previous",void 0);b([l.field(we)],Zt.prototype,"transaction_mroot",void 0);b([l.field(we)],Zt.prototype,"action_mroot",void 0);b([l.field("uint32")],Zt.prototype,"schedule_version",void 0);b([l.field(Ra,{optional:!0})],Zt.prototype,"new_producers",void 0);b([l.field("any",{array:!0})],Zt.prototype,"header_extensions",void 0);Zt=zf=b([l.type("block_header")],Zt);var In=class extends Zt{};b([l.field("signature")],In.prototype,"producer_signature",void 0);b([l.field(qi,{array:!0})],In.prototype,"transactions",void 0);b([l.field(Pa,{array:!0})],In.prototype,"block_extensions",void 0);In=b([l.type("signed_block")],In);var Vo=class extends Xe{};Vo=b([Xe.type("net_message",[ot,zi,ka,ti,Ea,Ma,Ia,In,nt])],Vo);var Df=class{constructor(e){if(e.provider)this.provider=e.provider;else throw new Error("Missing provider");e.setTimeoutImpl!==void 0?this.setTimeoutImpl=e.setTimeoutImpl:this.setTimeoutImpl=setTimeout,e.heartbeatTimoutMs!==void 0&&(this.heartbeatTimoutMs=e.heartbeatTimoutMs,this.resetHeartbeat()),this.provider.on("data",t=>{this.handleData(t)}),this.provider.on("error",t=>{this.emit("error",[t])}),this.provider.on("close",()=>{this.emit("close",[])}),this.eventListeners={}}send(e,t){let i=Vo.from(e),n=ae.encode({object:i});this.provider.write(n.array,t)}end(e){this.endHeartbeat(),this.provider.end(e)}destroy(e){this.endHeartbeat(),this.provider.destroy(e)}handleData(e){try{let t=ae.decode({type:Vo,data:e});this.emit("message",[t])}catch(t){this.emit("error",[t])}}endHeartbeat(){this.heartbeatTimoutId!==void 0&&(clearTimeout(this.heartbeatTimoutId),this.heartbeatTimoutId=void 0)}resetHeartbeat(){this.endHeartbeat(),this.heartbeatTimoutMs!==void 0&&this.setTimeoutImpl(()=>{this.handleHeartbeat()},this.heartbeatTimoutMs)}handleHeartbeat(){let e=Date.now(),t=ti.from({org:e,rec:0,xmt:0,dst:0});this.send(t,()=>{this.resetHeartbeat()})}on(e,t){return this.addListenerInternal(e,t,!1,!1)}once(e,t){return this.addListenerInternal(e,t,!0,!1)}addListener(e,t){return this.addListenerInternal(e,t,!1,!1)}prependListener(e,t){return this.addListenerInternal(e,t,!1,!0)}removeListener(e,t){return this.eventListeners[e]!==void 0&&(this.eventListeners[e]=this.eventListeners[e].filter(i=>i.handler!==t)),this}addListenerInternal(e,t,i,n){return this.eventListeners[e]===void 0&&(this.eventListeners[e]=[]),n?this.eventListeners[e].unshift({once:i,handler:t}):this.eventListeners[e].push({once:i,handler:t}),this}emit(e,t){if(this.eventListeners[e]!==void 0){for(let{handler:i}of this.eventListeners[e])i(...t);this.eventListeners[e]=this.eventListeners[e].filter(i=>i.once!==!0)}}};Df.__className="P2PClient";var Lf=class r{constructor(e){this.nextProvider=e,this.remainingData=new Uint8Array(0),this.dataHandlers=[],this.errorHandlers=[],this.nextProvider.on("data",t=>{let i=new Uint8Array(this.remainingData.byteLength+t.byteLength);for(i.set(this.remainingData,0),i.set(t,this.remainingData.byteLength),this.remainingData=i;this.remainingData.byteLength>=4;){let a=new DataView(this.remainingData.buffer).getUint32(0,!0);if(a>r.maxReadLength&&this.emitError(new Error("Incoming Message too long")),this.remainingData.byteLength<4+a)break;let o=this.remainingData.subarray(4,4+a);this.remainingData=this.remainingData.slice(4+a),this.emitData(o)}}),this.nextProvider.on("error",t=>{this.emitError(t)})}write(e,t){let i=new Uint8Array(4+e.byteLength);new DataView(i.buffer).setUint32(0,e.byteLength,!0),i.set(e,4),this.nextProvider.write(i,t)}end(e){this.nextProvider.end(e)}destroy(e){this.nextProvider.destroy(e)}on(e,t){return e==="data"?this.dataHandlers.push(t):e==="error"?this.errorHandlers.push(t):this.nextProvider.on(e,t),this}emitData(e){for(let t of this.dataHandlers)t(e)}emitError(e){for(let t of this.errorHandlers)t(e)}};Lf.maxReadLength=8*1024*1024;var xl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Dr=new Uint8Array(256);for(let r=0;r<62;r++)Dr[xl.charCodeAt(r)]=r;Dr[43]=Dr[45]=62;Dr[47]=Dr[95]=63;function Kf(r,e=!0){let t=r.byteLength,i=t%3,n=t-i,a=xl+(e?"-_":"+/"),o=[],s,h,d,p,A;for(let k=0;k<n;k+=3)A=r[k]<<16|r[k+1]<<8|r[k+2],s=(A&16515072)>>18,h=(A&258048)>>12,d=(A&4032)>>6,p=A&63,o.push(a[s]+a[h]+a[d]+a[p]);return i===1?(A=r[n],s=(A&252)>>2,h=(A&3)<<4,o.push(a[s]+a[h])):i===2&&(A=r[n]<<8|r[n+1],s=(A&64512)>>10,h=(A&1008)>>4,d=(A&15)<<2,o.push(a[s]+a[h]+a[d])),o.join("")}function Vf(r){let e=r.length*.75,t=new Uint8Array(e),i,n,a,o,s=0;for(let h=0;h<r.length;h+=4)i=Dr[r.charCodeAt(h)],n=Dr[r.charCodeAt(h+1)],a=Dr[r.charCodeAt(h+2)],o=Dr[r.charCodeAt(h+3)],t[s++]=i<<2|n>>4,t[s++]=(n&15)<<4|a>>2,t[s++]=(a&3)<<6|o&63;return t}var Al=Object.freeze({__proto__:null,encode:Kf,decode:Vf}),st;(function(r){r[r.UNKNOWN=0]="UNKNOWN",r[r.EOS=1]="EOS",r[r.TELOS=2]="TELOS",r[r.JUNGLE=3]="JUNGLE",r[r.KYLIN=4]="KYLIN",r[r.WORBLI=5]="WORBLI",r[r.BOS=6]="BOS",r[r.MEETONE=7]="MEETONE",r[r.INSIGHTS=8]="INSIGHTS",r[r.BEOS=9]="BEOS",r[r.WAX=10]="WAX",r[r.PROTON=11]="PROTON",r[r.FIO=12]="FIO"})(st||(st={}));var Qe=class extends de{static from(e){if(Z(e,this))return e;if(typeof e=="number"&&(e=yl.get(e),!e))throw new Error("Unknown chain id alias");return super.from(e)}get chainVariant(){let e=this.chainName;return e!==st.UNKNOWN?mr.from(["chain_alias",e]):mr.from(this)}get chainName(){let e=this.hexString;for(let[t,i]of yl)if(i===e)return t;return st.UNKNOWN}};Qe=b([Di("chain_id")],Qe);var Hf=class extends Ut{};Hf=b([Di("chain_alias")],Hf);var mr=class extends Xe{get chainId(){return Z(this.value,Qe)?this.value:Qe.from(Number(this.value.value))}};mr=b([Xe.type("variant_id",[Hf,Qe])],mr);var yl=new Map([[st.EOS,"aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906"],[st.TELOS,"4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11"],[st.JUNGLE,"e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473"],[st.KYLIN,"5fff1dae8dc8e2fc4d5b23b2c7665c97f9e9d8edf2b6485a86ba311c25639191"],[st.WORBLI,"73647cde120091e0a4b85bced2f3cfdb3041e266cbbe95cee59b73235a1b3b6f"],[st.BOS,"d5a3d18fbb3c084e3b1f3fa98c21014b5f3db536cc15d08f9f6479517c6a3d86"],[st.MEETONE,"cfe6486a83bad4962f232d48003b1824ab5665c36778141034d75e57b956e422"],[st.INSIGHTS,"b042025541e25a472bffde2d62edd457b7e70cee943412b1ea0f044f88591664"],[st.BEOS,"b912d19a6abd2b1b05611ae5be473355d64d95aeff0c09bedc8c166cd6468fe4"],[st.WAX,"1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4"],[st.PROTON,"384da888112027f0321850a169f737c33e53b388aad48b5adace4bab97f437e0"],[st.FIO,"21dcae42c0182200e93f954a074011f9048a7624c6fe81d3c9541a614a88bd1c"]]),Rn,ml=class extends G{};ml=b([Di("account_name")],ml);var vl=class extends G{};vl=b([Di("permission_name")],vl);var Ba=class extends l{};b([l.field(Ae,{optional:!0})],Ba.prototype,"permission",void 0);Ba=b([l.type("identity")],Ba);var ii=class extends l{};b([l.field("name")],ii.prototype,"scope",void 0);b([l.field(Ae,{optional:!0})],ii.prototype,"permission",void 0);ii=b([l.type("identity")],ii);var $f=class extends Xe{};$f=b([Xe.type("variant_req",[qe,{type:qe,array:!0},Je,Ba])],$f);var jf=class extends Xe{};jf=b([Xe.type("variant_req",[qe,{type:qe,array:!0},Je,ii])],jf);var ni=Rn=class extends Ut{get broadcast(){return(Number(this)&Rn.broadcast)!==0}set broadcast(e){this.setFlag(Rn.broadcast,e)}get background(){return(Number(this)&Rn.background)!==0}set background(e){this.setFlag(Rn.background,e)}setFlag(e,t){t?this.value=Ut.from(Number(this)|e).value:this.value=Ut.from(Number(this)&~e).value}};ni.broadcast=1;ni.background=2;ni=Rn=b([Di("request_flags")],ni);var Li=class extends l{};b([l.field("string")],Li.prototype,"key",void 0);b([l.field("bytes")],Li.prototype,"value",void 0);Li=b([l.type("info_pair")],Li);var ai=class extends l{};b([l.field(mr)],ai.prototype,"chain_id",void 0);b([l.field($f)],ai.prototype,"req",void 0);b([l.field(ni)],ai.prototype,"flags",void 0);b([l.field("string")],ai.prototype,"callback",void 0);b([l.field(Li,{array:!0})],ai.prototype,"info",void 0);ai=b([l.type("signing_request")],ai);var oi=class extends l{};b([l.field(mr)],oi.prototype,"chain_id",void 0);b([l.field(jf)],oi.prototype,"req",void 0);b([l.field(ni)],oi.prototype,"flags",void 0);b([l.field("string")],oi.prototype,"callback",void 0);b([l.field(Li,{array:!0})],oi.prototype,"info",void 0);oi=b([l.type("signing_request")],oi);var ri=class extends l{};b([l.field("name")],ri.prototype,"signer",void 0);b([l.field("signature")],ri.prototype,"signature",void 0);ri=b([l.type("request_signature")],ri);var Na,si=Na=class extends l{static from(e){return Z(e,Na)?e:typeof e=="string"?Na.fromString(e):super.from(e)}static fromString(e){let t=e.split(" ");if(t.length!==2||t[0]!=="EOSIO")throw new Error("Invalid IdentityProof string");let i=Vf(t[1]);return ae.decode({data:i,type:Na})}static fromPayload(e,t={}){let i=vr.from(e.req,t);if(!(i.version>=3&&i.isIdentity()))throw new Error("Not an identity request");return this.from({chainId:e.cid||i.getChainId(),scope:i.getIdentityScope(),expiration:e.ex,signer:{actor:e.sa,permission:e.sp},signature:e.sig})}get transaction(){let e=qe.from({account:"",name:"identity",authorization:[this.signer],data:ii.from({scope:this.scope,permission:this.signer})});return Je.from({ref_block_num:0,ref_block_prefix:0,expiration:this.expiration,actions:[e]})}recover(){return this.signature.recoverDigest(this.transaction.signingDigest(this.chainId))}verify(e,t){return $t.from(t||new Date).toMilliseconds()<this.expiration.toMilliseconds()&&Pr.from(e).hasPermission(this.recover())}toString(){let e=ae.encode({object:this});return`EOSIO ${Kf(e.array,!1)}`}};b([l.field(Qe)],si.prototype,"chainId",void 0);b([l.field(G)],si.prototype,"scope",void 0);b([l.field($t)],si.prototype,"expiration",void 0);b([l.field(Ae)],si.prototype,"signer",void 0);b([l.field(vt)],si.prototype,"signature",void 0);si=Na=b([l.type("identity_proof")],si);var Tt=G.from("............1"),qr=G.from("............2"),gl=Ae.from({actor:Tt,permission:qr}),vr=class r{constructor(e,t,i,n,a){if(t.flags.broadcast&&t.req.variantName==="identity")throw new Error("Invalid request (identity request cannot be broadcast)");this.version=e,this.data=t,this.zlib=i,this.abiProvider=n,this.signature=a}static identityAbi(e){let t=ae.synthesize(this.identityType(e));return t.actions=[{name:"identity",type:"identity",ricardian_contract:""}],t}static identityType(e){return e===2?Ba:ii}static storageType(e){return e===2?ai:oi}static async create(e,t={}){let i;e.action?i=[e.action]:e.actions?i=e.actions:e.transaction?i=e.transaction.actions||[]:i=[];let n=i.filter(o=>!W.isBytes(o.data)&&o.data.constructor.abiName===void 0).map(o=>G.from(o.account)),a={};if(n.length>0){let o=t.abiProvider;if(!o)throw new Error("Missing abi provider");let s=await Promise.all(n.map(h=>o.getAbi(h)));for(let[h,d]of s.entries())a[n[h].toString()]=d}return this.createSync(e,t,a)}static createSync(e,t={},i={}){let n=2,a={},o=p=>a2(p,i);if(e.chainId===null&&(n=3),e.identity!==void 0)e.identity.scope&&(n=3),a.req=["identity",this.identityType(n).from(e.identity)];else if(e.action&&!e.actions&&!e.transaction)a.req=["action",o(e.action)];else if(e.actions&&!e.action&&!e.transaction)e.actions.length===1?a.req=["action",o(e.actions[0])]:a.req=["action[]",e.actions.map(o)];else if(e.transaction&&!e.action&&!e.actions){let p=e.transaction;p.expiration===void 0&&(p.expiration="1970-01-01T00:00:00.000"),p.ref_block_num===void 0&&(p.ref_block_num=0),p.ref_block_prefix===void 0&&(p.ref_block_prefix=0),p.context_free_actions===void 0&&(p.context_free_actions=[]),p.transaction_extensions===void 0&&(p.transaction_extensions=[]),p.delay_sec===void 0&&(p.delay_sec=0),p.max_cpu_usage_ms===void 0&&(p.max_cpu_usage_ms=0),p.max_net_usage_words===void 0&&(p.max_net_usage_words=0),p.actions===void 0&&(p.actions=[]),p.context_free_actions===void 0&&(p.context_free_actions=[]),p.actions=p.actions.map(o),a.req=["transaction",p]}else throw new TypeError("Invalid arguments: Must have exactly one of action, actions or transaction");e.chainId===null?a.chain_id=mr.from(["chain_alias",0]):a.chain_id=Qe.from(e.chainId||st.EOS).chainVariant;let s=ni.from(0),h="";if(s.broadcast=e.broadcast!==void 0?e.broadcast:a.req[0]!=="identity",typeof e.callback=="string"?h=e.callback:typeof e.callback=="object"&&(h=e.callback.url,s.background=e.callback.background||!1),a.flags=s,a.callback=h,a.info=[],typeof e.info=="object"){for(let p in e.info)if(Object.prototype.hasOwnProperty.call(e.info,p)){let k=e.info[p];typeof k=="string"?k=W.from(k,"utf8"):k instanceof W||(k=ae.encode({object:k})),a.info.push({key:p,value:k})}}if(e.chainIds&&e.chainId===null){let p=e.chainIds.map(A=>Qe.from(A).chainVariant);a.info.push({key:"chain_ids",value:ae.encode({object:p,type:{type:mr,array:!0}})})}let d=new r(n,this.storageType(n).from(a),t.zlib,t.abiProvider);return t.signatureProvider&&d.sign(t.signatureProvider),d}static identity(e,t={}){let i={actor:e.account||Tt,permission:e.permission||qr};return i.actor===Tt&&i.permission===qr&&(i=void 0),this.createSync({...e,identity:{permission:i,scope:e.scope},broadcast:!1},t)}static fromTransaction(e,t,i={}){let n=Qe.from(e);t=W.from(t);let a=new vn;return a.writeByte(2),a.writeArray(ae.encode({object:n.chainVariant}).array),a.writeByte(2),a.writeArray(W.from(t).array),a.writeByte(ni.broadcast),a.writeByte(0),a.writeByte(0),r.fromData(a.getData(),i)}static from(e,t={}){if(typeof e!="string")throw new Error("Invalid request uri");let[,i]=e.split(":"),n=Vf(i.startsWith("//")?i.slice(2):i);return r.fromData(n,t)}static fromData(e,t={}){e=W.from(e);let i=e.array[0],n=i&-129;if(n!==2&&n!==3)throw new Error("Unsupported protocol version");let a=e.droppingFirst(1);if((i&128)!==0){if(!t.zlib)throw new Error("Compressed URI needs zlib");a=W.from(t.zlib.inflateRaw(a.array))}let o=new Rr(a.array),s=ae.decode({data:o,type:this.storageType(n)}),h;return o.canRead()&&(h=ae.decode({data:o,type:ri})),new r(n,s,t.zlib,t.abiProvider,h)}sign(e){let t=this.getSignatureDigest();this.signature=ri.from(e.sign(t))}getSignatureDigest(){let e=[this.version,114,101,113,117,101,115,116];return de.hash(W.from(e).appending(this.getData()))}setSignature(e,t){this.signature=ri.from({signer:e,signature:t})}setCallback(e,t){this.data.callback=e,this.data.flags.background=t}setBroadcast(e){this.data.flags.broadcast=e}encode(e,t,i="esr:"){let n=e!==void 0?e:this.zlib!==void 0;if(n&&this.zlib===void 0)throw new Error("Need zlib to compress");let a=this.version,o=this.getData(),s=this.getSignatureData(),h=new Uint8Array(o.byteLength+s.byteLength);if(h.set(o,0),h.set(s,o.byteLength),n){let p=this.zlib.deflateRaw(h);h.byteLength>p.byteLength&&(a|=128,h=p)}let d=new Uint8Array(1+h.byteLength);return d[0]=a,d.set(h,1),t!==!1&&(i+="//"),i+Kf(d)}getData(){return ae.encode({object:this.data}).array}getSignatureData(){return this.signature?ae.encode({object:this.signature}).array:new Uint8Array(0)}getRequiredAbis(){return this.getRawActions().filter(e=>!Uf(e)).map(e=>e.account).filter((e,t,i)=>i.indexOf(e)===t)}requiresTapos(){let e=this.getRawTransaction();return!this.isIdentity()&&!_l(e)}async fetchAbis(e){let t=this.getRequiredAbis();if(t.length>0){let i=e||this.abiProvider;if(!i)throw new Error("Missing ABI provider");let n=new Map;return await Promise.all(t.map(async a=>{n.set(a.toString(),ze.from(await i.getAbi(a)))})),n}else return new Map}resolveActions(e,t){return this.getRawActions().map(i=>{let n;if(Uf(i))n=this.constructor.identityAbi(this.version);else{let h=e.get(i.account.toString());if(!h)throw new Error(`Missing ABI definition for ${i.account}`);n=ze.from(h)}if(!n.getActionType(i.name))throw new Error(`Missing type for action ${i.account}:${i.name} in ABI`);let o=i.decodeData(n),s=i.authorization;if(t){let h=Ae.from(t),d=p=>{if(p instanceof G)return p.equals(Tt)?h.actor:p.equals(qr)?h.permission:p;if(Array.isArray(p))return p.map(d);if(typeof p=="object"&&p!==null){for(let A of Object.keys(p))p[A]=d(p[A]);return p}else return p};o=d(o),s=s.map(p=>{let{actor:A,permission:k}=p;return A.equals(Tt)&&(A=h.actor),k.equals(qr)&&(k=h.permission),k.equals(Tt)&&(k=h.permission),Ae.from({actor:A,permission:k})})}return{...i,authorization:s,data:o}})}resolveTransaction(e,t,i={}){let n=this.getRawTransaction();if(!this.isIdentity()&&!_l(n))if(i.expiration!==void 0&&i.ref_block_num!==void 0&&i.ref_block_prefix!==void 0)n.expiration=$t.from(i.expiration),n.ref_block_num=ur.from(i.ref_block_num,"truncate"),n.ref_block_prefix=he.from(i.ref_block_prefix);else if(i.block_num!==void 0&&i.ref_block_prefix!==void 0&&i.timestamp!==void 0)n.expiration=wl(i.timestamp,i.expire_seconds),n.ref_block_num=ur.from(i.block_num,"truncate"),n.ref_block_prefix=he.from(i.ref_block_prefix);else throw new Error("Invalid transaction context, need either a reference block or explicit TaPoS values");else this.isIdentity()&&this.version>2&&(n.expiration=i.expiration?$t.from(i.expiration):wl(i.timestamp,i.expire_seconds));let a=this.resolveActions(e,t),o=n.context_free_actions;return{...n,context_free_actions:o,actions:a}}resolve(e,t,i={}){let n=this.resolveTransaction(e,t,i),a=n.actions.map(h=>{let d;if(Uf(h)?d=this.constructor.identityAbi(this.version):d=e.get(h.account.toString()),!d)throw new Error(`Missing ABI definition for ${h.account}`);let p=d.getActionType(h.name),A=ae.encode({object:h.data,type:p,abi:d});return qe.from({...h,data:A})}),o=Je.from({...n,actions:a}),s;if(this.isMultiChain()){if(!i.chainId)throw new Error("Missing chosen chain ID for multi-chain request");s=Qe.from(i.chainId);let h=this.getChainIds();if(h&&!h.some(d=>s.equals(d)))throw new Error("Trying to resolve for chain ID not defined in request")}else s=this.getChainId();return new Ca(this,Ae.from(t),o,n,s)}getChainId(){return this.data.chain_id.chainId}getChainIds(){if(!this.isMultiChain())return null;let e=this.getInfoKey("chain_ids",{type:mr,array:!0});return e?e.map(t=>t.chainId):null}setChainIds(e){let t=e.map(i=>Qe.from(i).chainVariant);this.setInfoKey("chain_ids",t,{type:mr,array:!0})}isMultiChain(){return this.data.chain_id.variantIdx===0&&this.data.chain_id.value.equals(st.UNKNOWN)}getRawActions(){let e=this.data.req;switch(e.variantName){case"action":return[e.value];case"action[]":return e.value;case"identity":if(this.version===2){let t=e.value,i="0101000000000000000200000000000000",n=[gl];t.permission&&(i=ae.encode({object:t}),n=[t.permission]);let a=qe.from({account:"",name:"identity",authorization:n,data:i});return delete a.abi,[a]}else{let{scope:t,permission:i}=e.value;i||(i=gl);let n=ae.encode({object:{scope:t,permission:i},type:ii}),a=qe.from({account:"",name:"identity",authorization:[i],data:n});return delete a.abi,[a]}case"transaction":return e.value.actions;default:throw new Error("Invalid signing request data")}}getRawTransaction(){let e=this.data.req;switch(e.variantName){case"transaction":return Je.from({...e.value});case"action":case"action[]":case"identity":return Je.from({actions:this.getRawActions(),context_free_actions:[],transaction_extensions:[],expiration:"1970-01-01T00:00:00.000",ref_block_num:0,ref_block_prefix:0,max_cpu_usage_ms:0,max_net_usage_words:0,delay_sec:0});default:throw new Error("Invalid signing request data")}}isIdentity(){return this.data.req.variantName==="identity"}shouldBroadcast(){return this.isIdentity()?!1:this.data.flags.broadcast}getIdentity(){if(!this.isIdentity())return null;let e=this.data.req.value;return e.permission&&!e.permission.actor.equals(Tt)?e.permission.actor:null}getIdentityPermission(){if(!this.isIdentity())return null;let e=this.data.req.value;return e.permission&&!e.permission.permission.equals(qr)?e.permission.permission:null}getIdentityScope(){return!this.isIdentity()||this.version<=2?null:this.data.req.value.scope}getRawInfo(){let e={};for(let{key:t,value:i}of this.data.info)e[t]=i;return e}getRawInfoKey(e){let t=this.data.info.find(i=>i.key===e);if(t)return t.value}setRawInfoKey(e,t){let i=this.data.info.find(n=>n.key===e);i?i.value=W.from(t):(i=Li.from({key:e,value:t}),this.data.info.push(i))}setInfoKey(e,t,i){let n;typeof t=="string"&&!i?n=W.from(t,"utf8"):n=ae.encode({object:t,type:i}),this.setRawInfoKey(e,n)}getInfoKey(e,t){let i=this.getRawInfoKey(e);if(i)return t?ae.decode({data:i,type:t}):i.utf8String}clone(){let e;this.signature&&(e=ri.from(JSON.parse(JSON.stringify(this.signature))));let i=this.constructor.storageType(this.version).from(JSON.parse(JSON.stringify(this.data)));return new r(this.version,i,this.zlib,this.abiProvider,e)}toString(){return this.encode()}toJSON(){return this.encode()}},Ca=class{constructor(e,t,i,n,a){this.request=e,this.signer=t,this.transaction=i,this.resolvedTransaction=n,this.chainId=a}static async fromPayload(e,t={}){let i=vr.from(e.req,t),n=await i.fetchAbis();return i.resolve(n,{actor:e.sa,permission:e.sp},{ref_block_num:e.rbn,ref_block_prefix:e.rid,expiration:e.ex,chainId:e.cid||i.getChainId()})}get serializedTransaction(){return ae.encode({object:this.transaction}).array}get signingDigest(){return this.transaction.signingDigest(this.chainId)}get signingData(){return this.transaction.signingData(this.chainId)}getCallback(e,t){let{callback:i,flags:n}=this.request.data;if(!i||i.length===0)return null;if(!e||e.length===0)throw new Error("Must have at least one signature to resolve callback");let a=e.map(h=>vt.from(h)),o={sig:String(a[0]),tx:String(this.transaction.id),rbn:String(this.transaction.ref_block_num),rid:String(this.transaction.ref_block_prefix),ex:String(this.transaction.expiration),req:this.request.encode(),sa:String(this.signer.actor),sp:String(this.signer.permission),cid:String(this.chainId)};for(let[h,d]of a.slice(1).entries())o[`sig${h}`]=String(d);t&&(o.bn=String(he.from(t)));let s=i.replace(/({{([a-z0-9]+)}})/g,(h,d,p)=>o[p]||"");return{background:n.background,payload:o,url:s}}getIdentityProof(e){if(!this.request.isIdentity())throw new Error("Not a identity request");return si.from({chainId:this.chainId,scope:this.request.getIdentityScope(),expiration:this.transaction.expiration,signer:this.signer,signature:e})}};function a2(r,e){if(W.isBytes(r.data)||r.data.constructor.abiName!==void 0)return qe.from(r);let t=e[String(G.from(r.account))];if(!t)throw new Error(`Missing ABI for ${r.account}`);let i=qe.from(r,t);return delete i.abi,i}function Uf(r){let e=G.from(r.account),t=G.from(r.name);return e.rawValue.equals(0)&&t.equals("identity")}function _l(r){return!(r.expiration.equals(0)&&r.ref_block_num.equals(0)&&r.ref_block_prefix.equals(0))}function wl(r,e=60){let t=$t.from(r||new Date),i=he.from(e);return $t.fromInteger(t.value.adding(i))}var Bl=ji(Sl());var gr=(function(){var r=!1,e,t;function i(){e=[],t=[];var S=1,E,I;for(E=0;E<255;E++)e[E]=S,I=S&128,S<<=1,S&=255,I===128&&(S^=27),S^=e[E],t[e[E]]=E;e[255]=e[0],t[0]=0,r=!0}function n(S,E){var I=e[(t[S]+t[E])%255];return(S===0||E===0)&&(I=0),I}function a(S){var E=e[255-t[S]];return S===0&&(E=0),E}var o=!1,s,h,d,p;function A(){r||i();function S(T){var C,z,N;for(z=N=a(T),C=0;C<4;C++)z=(z<<1|z>>>7)&255,N^=z;return N^=99,N}s=[],h=[],d=[[],[],[],[]],p=[[],[],[],[]];for(var E=0;E<256;E++){var I=S(E);s[E]=I,h[I]=E,d[0][E]=n(2,I)<<24|I<<16|I<<8|n(3,I),p[0][I]=n(14,E)<<24|n(9,E)<<16|n(13,E)<<8|n(11,E);for(var P=1;P<4;P++)d[P][E]=d[P-1][E]>>>8|d[P-1][E]<<24,p[P][I]=p[P-1][I]>>>8|p[P-1][I]<<24}o=!0}var k=function(S,E){o||A();var I=new Uint32Array(E);I.set(s,512),I.set(h,768);for(var P=0;P<4;P++)I.set(d[P],4096+1024*P>>2),I.set(p[P],8192+1024*P>>2);function T(N,j,J,D,O,L,x,f,u){var m=I.subarray(0,60),v=I.subarray(256,316);m.set([j,J,D,O,L,x,f,u]);for(var y=N,_=1;y<4*N+28;y++){var M=m[y-1];(y%N===0||N===8&&y%N===4)&&(M=s[M>>>24]<<24^s[M>>>16&255]<<16^s[M>>>8&255]<<8^s[M&255]),y%N===0&&(M=M<<8^M>>>24^_<<24,_=_<<1^(_&128?27:0)),m[y]=m[y-N]^M}for(var g=0;g<y;g+=4)for(var c=0;c<4;c++){var M=m[y-(4+g)+(4-c)%4];g<4||g>=y-4?v[g+c]=M:v[g+c]=p[0][s[M>>>24]]^p[1][s[M>>>16&255]]^p[2][s[M>>>8&255]]^p[3][s[M&255]]}z.set_rounds(N+5)}var C={Uint8Array,Uint32Array},z=(function(N,j,J){var D=0,O=0,L=0,x=0,f=0,u=0,m=0,v=0,y=0,_=0,M=0,g=0,c=0,w=0,$=0,K=0,U=0,X=0,oe=0,le=0,Pt=0,F=new N.Uint32Array(J),q=new N.Uint8Array(J);function Bn(B,R,V,H,Y,Ce,Q,ee){B=B|0,R=R|0,V=V|0,H=H|0,Y=Y|0,Ce=Ce|0,Q=Q|0,ee=ee|0;var Nt=0,fe=0,ce=0,_r=0,ue=0,me=0,Cn=0,ne=0;for(Nt=V|1024,fe=V|2048,ce=V|3072,Y=Y^F[(B|0)>>2],Ce=Ce^F[(B|4)>>2],Q=Q^F[(B|8)>>2],ee=ee^F[(B|12)>>2],ne=16;(ne|0)<=H<<4;ne=ne+16|0)_r=F[(V|Y>>22&1020)>>2]^F[(Nt|Ce>>14&1020)>>2]^F[(fe|Q>>6&1020)>>2]^F[(ce|ee<<2&1020)>>2]^F[(B|ne|0)>>2],ue=F[(V|Ce>>22&1020)>>2]^F[(Nt|Q>>14&1020)>>2]^F[(fe|ee>>6&1020)>>2]^F[(ce|Y<<2&1020)>>2]^F[(B|ne|4)>>2],me=F[(V|Q>>22&1020)>>2]^F[(Nt|ee>>14&1020)>>2]^F[(fe|Y>>6&1020)>>2]^F[(ce|Ce<<2&1020)>>2]^F[(B|ne|8)>>2],Cn=F[(V|ee>>22&1020)>>2]^F[(Nt|Y>>14&1020)>>2]^F[(fe|Ce>>6&1020)>>2]^F[(ce|Q<<2&1020)>>2]^F[(B|ne|12)>>2],Y=_r,Ce=ue,Q=me,ee=Cn;D=F[(R|Y>>22&1020)>>2]<<24^F[(R|Ce>>14&1020)>>2]<<16^F[(R|Q>>6&1020)>>2]<<8^F[(R|ee<<2&1020)>>2]^F[(B|ne|0)>>2],O=F[(R|Ce>>22&1020)>>2]<<24^F[(R|Q>>14&1020)>>2]<<16^F[(R|ee>>6&1020)>>2]<<8^F[(R|Y<<2&1020)>>2]^F[(B|ne|4)>>2],L=F[(R|Q>>22&1020)>>2]<<24^F[(R|ee>>14&1020)>>2]<<16^F[(R|Y>>6&1020)>>2]<<8^F[(R|Ce<<2&1020)>>2]^F[(B|ne|8)>>2],x=F[(R|ee>>22&1020)>>2]<<24^F[(R|Y>>14&1020)>>2]<<16^F[(R|Ce>>6&1020)>>2]<<8^F[(R|Q<<2&1020)>>2]^F[(B|ne|12)>>2]}function be(B,R,V,H){B=B|0,R=R|0,V=V|0,H=H|0,Bn(0,2048,4096,Pt,f^B,u^R,m^V,v^H),f=D,u=O,m=L,v=x}function ye(B,R,V,H){B=B|0,R=R|0,V=V|0,H=H|0;var Y=0;Bn(1024,3072,8192,Pt,B,H,V,R),Y=O,O=x,x=Y,D=D^f,O=O^u,L=L^m,x=x^v,f=B,u=R,m=V,v=H}function is(B,R,V,H){B=B|0,R=R|0,V=V|0,H=H|0;var Y=0,Ce=0,Q=0,ee=0,Nt=0,fe=0,ce=0,_r=0,ue=0,me=0;for(B=B^f,R=R^u,V=V^m,H=H^v,Y=U|0,Ce=X|0,Q=oe|0,ee=le|0;(ue|0)<128;ue=ue+1|0)Y>>>31&&(Nt=Nt^B,fe=fe^R,ce=ce^V,_r=_r^H),Y=Y<<1|Ce>>>31,Ce=Ce<<1|Q>>>31,Q=Q<<1|ee>>>31,ee=ee<<1,me=H&1,H=H>>>1|V<<31,V=V>>>1|R<<31,R=R>>>1|B<<31,B=B>>>1,me&&(B=B^3774873600);f=Nt,u=fe,m=ce,v=_r}function ke(B){B=B|0,Pt=B}function Ee(B,R,V,H){B=B|0,R=R|0,V=V|0,H=H|0,D=B,O=R,L=V,x=H}function Za(B,R,V,H){B=B|0,R=R|0,V=V|0,H=H|0,f=B,u=R,m=V,v=H}function Me(B,R,V,H){B=B|0,R=R|0,V=V|0,H=H|0,y=B,_=R,M=V,g=H}function Ie(B,R,V,H){B=B|0,R=R|0,V=V|0,H=H|0,c=B,w=R,$=V,K=H}function Wa(B,R,V,H){B=B|0,R=R|0,V=V|0,H=H|0,g=~K&g|K&H,M=~$&M|$&V,_=~w&_|w&R,y=~c&y|c&B}function Te(B){return B=B|0,B&15?-1:(q[B|0]=D>>>24,q[B|1]=D>>>16&255,q[B|2]=D>>>8&255,q[B|3]=D&255,q[B|4]=O>>>24,q[B|5]=O>>>16&255,q[B|6]=O>>>8&255,q[B|7]=O&255,q[B|8]=L>>>24,q[B|9]=L>>>16&255,q[B|10]=L>>>8&255,q[B|11]=L&255,q[B|12]=x>>>24,q[B|13]=x>>>16&255,q[B|14]=x>>>8&255,q[B|15]=x&255,16)}function Re(B){return B=B|0,B&15?-1:(q[B|0]=f>>>24,q[B|1]=f>>>16&255,q[B|2]=f>>>8&255,q[B|3]=f&255,q[B|4]=u>>>24,q[B|5]=u>>>16&255,q[B|6]=u>>>8&255,q[B|7]=u&255,q[B|8]=m>>>24,q[B|9]=m>>>16&255,q[B|10]=m>>>8&255,q[B|11]=m&255,q[B|12]=v>>>24,q[B|13]=v>>>16&255,q[B|14]=v>>>8&255,q[B|15]=v&255,16)}function Ga(B,R,V){B=B|0,R=R|0,V=V|0;var H=0;if(R&15)return-1;for(;(V|0)>=16;)Ne[B&7](q[R|0]<<24|q[R|1]<<16|q[R|2]<<8|q[R|3],q[R|4]<<24|q[R|5]<<16|q[R|6]<<8|q[R|7],q[R|8]<<24|q[R|9]<<16|q[R|10]<<8|q[R|11],q[R|12]<<24|q[R|13]<<16|q[R|14]<<8|q[R|15]),q[R|0]=D>>>24,q[R|1]=D>>>16&255,q[R|2]=D>>>8&255,q[R|3]=D&255,q[R|4]=O>>>24,q[R|5]=O>>>16&255,q[R|6]=O>>>8&255,q[R|7]=O&255,q[R|8]=L>>>24,q[R|9]=L>>>16&255,q[R|10]=L>>>8&255,q[R|11]=L&255,q[R|12]=x>>>24,q[R|13]=x>>>16&255,q[R|14]=x>>>8&255,q[R|15]=x&255,H=H+16|0,R=R+16|0,V=V-16|0;return H|0}function Pe(B,R,V){B=B|0,R=R|0,V=V|0;var H=0;if(R&15)return-1;for(;(V|0)>=16;)Ja[B&1](q[R|0]<<24|q[R|1]<<16|q[R|2]<<8|q[R|3],q[R|4]<<24|q[R|5]<<16|q[R|6]<<8|q[R|7],q[R|8]<<24|q[R|9]<<16|q[R|10]<<8|q[R|11],q[R|12]<<24|q[R|13]<<16|q[R|14]<<8|q[R|15]),H=H+16|0,R=R+16|0,V=V-16|0;return H|0}var Ne=[be,be,be,ye,ye,ye,ye,ye],Ja=[be,be];return{set_rounds:ke,set_state:Ee,set_iv:Za,set_nonce:Me,set_mask:Ie,set_counter:Wa,get_state:Te,get_iv:Re,cipher:Ga,mac:Pe}})(C,S,E);return z.set_key=T,z};return k.ENC={CBC:2},k.DEC={CBC:3},k.MAC={CBC:0},k.HEAP_DATA=16384,k})();function o2(r,e){let t=r?r.byteLength:e||65536;if(t&4095||t<=0)throw new Error("heap size must be a positive integer and a multiple of 4096");return r=r||new Uint8Array(new ArrayBuffer(t)),r}function kl(r,e,t,i,n){let a=r.length-e,o=a<n?a:n;return r.set(t.subarray(i,i+o),e),o}function El(r){return r instanceof Uint8Array}function Ml(...r){let e=r.reduce((n,a)=>n+a.length,0),t=new Uint8Array(e),i=0;for(let n=0;n<r.length;n++)t.set(r[n],i),i+=r[n].length;return t}var Wf=class{constructor(e,t,i=!0,n){this.pos=0,this.len=0,this.mode=n,this.heap=o2().subarray(gr.HEAP_DATA),this.asm=new gr(null,this.heap.buffer),this.pos=0,this.len=0;let a=e.length;if(a!==16&&a!==24&&a!==32)throw new TypeError("illegal key size");let o=new DataView(e.buffer,e.byteOffset,e.byteLength);if(this.asm.set_key(a>>2,o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12),a>16?o.getUint32(16):0,a>16?o.getUint32(20):0,a>24?o.getUint32(24):0,a>24?o.getUint32(28):0),t!==void 0){if(t.length!==16)throw new TypeError("illegal iv size");let s=new DataView(t.buffer,t.byteOffset,t.byteLength);this.asm.set_iv(s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12))}else this.asm.set_iv(0,0,0,0);this.padding=i}AES_Encrypt_process(e){if(!El(e))throw new TypeError("data isn't of expected type");let t=this.asm,i=this.heap,n=gr.ENC[this.mode],a=gr.HEAP_DATA,o=this.pos,s=this.len,h=0,d=e.length||0,p=0,A=s+d&-16,k=0,S=new Uint8Array(A);for(;d>0;)k=kl(i,o+s,e,h,d),s+=k,h+=k,d-=k,k=t.cipher(n,a+o,s),k&&S.set(i.subarray(o,o+k),p),p+=k,k<s?(o+=k,s-=k):(o=0,s=0);return this.pos=o,this.len=s,S}AES_Encrypt_finish(){let e=this.asm,t=this.heap,i=gr.ENC[this.mode],n=gr.HEAP_DATA,a=this.pos,o=this.len,s=16-o%16,h=o;if(this.padding){for(let p=0;p<s;++p)t[a+o+p]=s;o+=s,h=o}else if(o%16)throw new TypeError("data length must be a multiple of the block size");let d=new Uint8Array(h);return o&&e.cipher(i,n+a,o),h&&d.set(t.subarray(a,a+h)),this.pos=0,this.len=0,d}AES_Decrypt_process(e){if(!El(e))throw new TypeError("data isn't of expected type");let t=this.asm,i=this.heap,n=gr.DEC[this.mode],a=gr.HEAP_DATA,o=this.pos,s=this.len,h=0,d=e.length||0,p=0,A=s+d&-16,k=0,S=0;this.padding&&(k=s+d-A||16,A-=k);let E=new Uint8Array(A);for(;d>0;)S=kl(i,o+s,e,h,d),s+=S,h+=S,d-=S,S=t.cipher(n,a+o,s-(d?0:k)),S&&E.set(i.subarray(o,o+S),p),p+=S,S<s?(o+=S,s-=S):(o=0,s=0);return this.pos=o,this.len=s,E}AES_Decrypt_finish(){let e=this.asm,t=this.heap,i=gr.DEC[this.mode],n=gr.HEAP_DATA,a=this.pos,o=this.len,s=o;if(o>0){if(o%16)throw new Error("data length must be a multiple of the block size");if(e.cipher(i,n+a,o),this.padding){let d=t[a+s-1];if(d<1||d>16||d>s)throw new Error("bad padding");let p=0;for(let A=d;A>1;A--)p|=d^t[a+s-A];if(p)throw new Error("bad padding");s-=d}}let h=new Uint8Array(s);return s>0&&h.set(t.subarray(a,a+s)),this.pos=0,this.len=0,h}},Go=class r{constructor(e,t,i=!0,n){this.aes=n||new Wf(e,t,i,"CBC")}static encrypt(e,t,i=!0,n){return new r(t,n,i).encrypt(e)}static decrypt(e,t,i=!0,n){return new r(t,n,i).decrypt(e)}encrypt(e){let t=this.aes.AES_Encrypt_process(e),i=this.aes.AES_Encrypt_finish();return Ml(t,i)}decrypt(e){let t=this.aes.AES_Decrypt_process(e),i=this.aes.AES_Decrypt_finish();return Ml(t,i)}};var Jo,s2=new Uint8Array(16);function Gf(){if(!Jo&&(Jo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Jo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Jo(s2)}var Il=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function f2(r){return typeof r=="string"&&Il.test(r)}var Tl=f2;var pt=[];for(Xo=0;Xo<256;++Xo)pt.push((Xo+256).toString(16).substr(1));var Xo;function c2(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(pt[r[e+0]]+pt[r[e+1]]+pt[r[e+2]]+pt[r[e+3]]+"-"+pt[r[e+4]]+pt[r[e+5]]+"-"+pt[r[e+6]]+pt[r[e+7]]+"-"+pt[r[e+8]]+pt[r[e+9]]+"-"+pt[r[e+10]]+pt[r[e+11]]+pt[r[e+12]]+pt[r[e+13]]+pt[r[e+14]]+pt[r[e+15]]).toLowerCase();if(!Tl(t))throw TypeError("Stringified UUID is invalid");return t}var Rl=c2;function d2(r,e,t){r=r||{};var i=r.random||(r.rng||Gf)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(var n=0;n<16;++n)e[t+n]=i[n];return e}return Rl(i)}var Jf=d2;var Da=ji(Nl());var Yo=class extends Error{constructor(e){super(`User canceled request ${e?"("+e+")":""}`),this.code="E_CANCEL"}},Oi=class extends Error{constructor(e){super(`Unable to verify identity ${e?"("+e+")":""}`),this.code="E_IDENTITY"}},Fi=class extends Error{constructor(e,t,i){super(e),this.code=t,this.session=i}},La;(function(r){r.defaults={service:"https://cb.anchor.link",verifyProofs:!1,encodeChainIds:!0}})(La||(La={}));var Ui=class extends l{};b([l.field("public_key")],Ui.prototype,"from",void 0);b([l.field("uint64")],Ui.prototype,"nonce",void 0);b([l.field("bytes")],Ui.prototype,"ciphertext",void 0);b([l.field("uint32")],Ui.prototype,"checksum",void 0);Ui=b([l.type("sealed_message")],Ui);var Hi=class extends l{};b([l.field("name")],Hi.prototype,"session_name",void 0);b([l.field("public_key")],Hi.prototype,"request_key",void 0);b([l.field("string",{extension:!0})],Hi.prototype,"user_agent",void 0);Hi=b([l.type("link_create")],Hi);var Qo=class extends l{};b([l.field("time_point_sec")],Qo.prototype,"expiration",void 0);Qo=b([l.type("link_info")],Qo);var Cl=(0,Bl.default)().fetch;function l2(r,e,t,i){let n=e.sharedSecret(t);i||(i=ge.random());let a=Xr.hash(ae.encode({object:i}).appending(n.array)),o=new Go(a.array.slice(0,32),a.array.slice(32,48)),s=W.from(o.encrypt(W.from(r,"utf8").array)),d=new DataView(de.hash(a.array).array.buffer).getUint32(0,!0);return Ui.from({from:e.toPublic(),nonce:i,ciphertext:s,checksum:d})}function zl(r,e){let t={sameDevice:e.getRawInfo().return_path!==void 0};if(r.link_meta)try{let i=JSON.parse(r.link_meta);for(let n of Object.keys(i))t[u2(n)]=i[n]}catch(i){Oa("Unable to parse link metadata",i,r.link_meta)}return t}function h2(r){return r.split("_").map(e=>(e[0]?e[0].toUpperCase():"_")+e.slice(1)).join("")}function u2(r){let e=h2(r);return e[0].toLowerCase()+e.slice(1)}function Oa(...r){console.warn("[anchor-link]",...r)}var Ua=class{constructor(){}async remove(){this.link.storage&&await this.link.removeSession(this.identifier,this.auth,this.chainId)}get client(){return this.link.getChain(this.chainId).client}static restore(e,t){switch(t.type){case"channel":return new es(e,t.data,t.metadata);case"fallback":return new ts(e,t.data,t.metadata);default:throw new Error("Unable to restore, session data invalid")}}},es=class extends Ua{constructor(e,t,i){super(),this.type="channel",this.timeout=120*1e3,this.link=e,this.chainId=Qe.from(t.chainId),this.auth=Ae.from(t.auth),this.publicKey=St.from(t.publicKey),this.identifier=G.from(t.identifier);let n=la.from(t.requestKey);this.channelKey=St.from(t.channel.key),this.channelUrl=t.channel.url,this.channelName=t.channel.name,this.encrypt=a=>l2(a.encode(!0,!1),n,this.channelKey),this.metadata={...i||{},timeout:this.timeout,name:this.channelName,request_key:n.toPublic()},this.serialize=()=>({type:"channel",data:{...t,channel:{url:this.channelUrl,key:this.channelKey,name:this.channelName}},metadata:this.metadata})}onSuccess(e,t){this.link.transport.onSuccess&&this.link.transport.onSuccess(e,t)}onFailure(e,t){this.link.transport.onFailure&&this.link.transport.onFailure(e,t)}onRequest(e,t){let i=Qo.from({expiration:new Date(Date.now()+this.timeout)});this.link.transport.onSessionRequest&&this.link.transport.onSessionRequest(this,e,t);let n=setTimeout(()=>{t(new Fi("Wallet did not respond in time","E_TIMEOUT",this))},this.timeout);e.setInfoKey("link",i);let a=!1,o=ae.encode({object:this.encrypt(e)});if(this.link.transport.sendSessionPayload)try{a=this.link.transport.sendSessionPayload(o,this)}catch(s){Oa("Unexpected error when transport tried to send session payload",s)}a||Cl(this.channelUrl,{method:"POST",headers:{"X-Buoy-Soft-Wait":"10"},body:o.array}).then(s=>{Math.floor(s.status/100)!==2&&(clearTimeout(n),s.status===202&&Oa("Missing delivery ack from session channel"),t(new Fi("Unable to push message","E_DELIVERY",this)))}).catch(s=>{clearTimeout(n),t(new Fi(`Unable to reach link service (${s.message||String(s)})`,"E_DELIVERY",this))})}addLinkInfo(e){let t=Hi.from({session_name:this.identifier,request_key:this.metadata.request_key,user_agent:this.link.getUserAgent()});e.setInfoKey("link",t)}prepare(e){return this.link.transport.prepare?this.link.transport.prepare(e,this):Promise.resolve(e)}showLoading(){if(this.link.transport.showLoading)return this.link.transport.showLoading()}recoverError(e,t){return this.link.transport.recoverError?this.link.transport.recoverError(e,t):!1}makeSignatureProvider(){return this.link.makeSignatureProvider([this.publicKey.toString()],this.chainId,this)}async transact(e,t){let i=await this.link.transact(e,{...t,chain:this.chainId},this);if(i.payload.link_ch&&i.payload.link_key&&i.payload.link_name)try{let n={...this.metadata,...zl(i.payload,i.resolved.request)};this.channelUrl=i.payload.link_ch,this.channelKey=St.from(i.payload.link_key),this.channelName=i.payload.link_name,n.name=i.payload.link_name,this.metadata=n}catch(n){Oa("Unable to recover link session",n)}return i}},ts=class extends Ua{constructor(e,t,i){super(),this.type="fallback",this.link=e,this.auth=Ae.from(t.auth),this.publicKey=St.from(t.publicKey),this.chainId=Qe.from(t.chainId),this.metadata=i||{},this.identifier=G.from(t.identifier),this.serialize=()=>({type:this.type,data:t,metadata:this.metadata})}onSuccess(e,t){this.link.transport.onSuccess&&this.link.transport.onSuccess(e,t)}onFailure(e,t){this.link.transport.onFailure&&this.link.transport.onFailure(e,t)}onRequest(e,t){this.link.transport.onSessionRequest?this.link.transport.onSessionRequest(this,e,t):this.link.transport.onRequest(e,t)}prepare(e){return this.link.transport.prepare?this.link.transport.prepare(e,this):Promise.resolve(e)}showLoading(){if(this.link.transport.showLoading)return this.link.transport.showLoading()}makeSignatureProvider(){return this.link.makeSignatureProvider([this.publicKey.toString()],this.chainId,this)}transact(e,t){return this.link.transact(e,{...t,chain:this.chainId},this)}},Xf=class{constructor(e){this.address=e.trim().replace(/\/$/,"")}create(){let e=`${this.address}/${Jf()}`;return new Yf(e)}},Yf=class{constructor(e){this.url=e,this.ctx={}}wait(){return this.url.includes("hyperbuoy")?b2(this.url,this.ctx):p2(this.url,this.ctx)}cancel(){this.ctx.cancel&&this.ctx.cancel()}};function p2(r,e){return new Promise((t,i)=>{let n=!0,a=0,o=r.replace(/^http/,"ws"),s=d=>{try{t(JSON.parse(d))}catch(p){p.message="Unable to parse callback JSON: "+p.message,i(p)}},h=()=>{let d=new Da.default(o);e.cancel=()=>{n=!1,(d.readyState===Da.default.OPEN||d.readyState===Da.default.CONNECTING)&&d.close()},d.onmessage=p=>{if(n=!1,d.readyState===Da.default.OPEN&&d.close(),typeof Blob<"u"&&p.data instanceof Blob){let A=new FileReader;A.onload=()=>{s(A.result)},A.onerror=k=>{i(k)},A.readAsText(p.data)}else typeof p.data=="string"?s(p.data):s(p.data.toString())},d.onopen=()=>{a=0},d.onclose=()=>{n&&setTimeout(h,y2(a++))}};h()})}async function b2(r,e){let t=!0;for(e.cancel=()=>{t=!1};t;){try{let i=await Cl(r);if(i.status===408)continue;if(i.status===200)return await i.json();throw new Error(`HTTP ${i.status}: ${i.statusText}`)}catch(i){Oa("Unexpected hyperbuoy error",i)}await m2(1e3)}return null}function y2(r){return Math.min(Math.pow(r*10,2),10*1e3)}function m2(r){return new Promise(e=>{setTimeout(e,r)})}var Fa=class{constructor(e,t){this.abiCache=new Map,this.pendingAbis=new Map,this.chainId=Qe.from(e),this.client=typeof t=="string"?new Sa({url:t}):t}async getAbi(e){let t=String(e),i=this.abiCache.get(t);if(!i){let n=this.pendingAbis.get(t);n||(n=this.client.v1.chain.get_abi(e),this.pendingAbis.set(t,n)),i=(await n).abi,this.pendingAbis.delete(t),i&&this.abiCache.set(t,i)}return i}},$i=class r{constructor(e){if(typeof e!="object")throw new TypeError("Missing options object");if(!e.transport)throw new TypeError("options.transport is required");let t=e.chains||[];if(e.chainId&&e.client){if(e.chains.length>0)throw new TypeError("options.chainId and options.client are deprecated and cannot be used together with options.chains");t=[{chainId:e.chainId,nodeUrl:e.client}]}if(t.length===0)throw new TypeError("options.chains is required");this.chains=t.map(i=>{if(i instanceof Fa)return i;if(!i.chainId)throw new TypeError("options.chains[].chainId is required");if(!i.nodeUrl)throw new TypeError("options.chains[].nodeUrl is required");return new Fa(i.chainId,i.nodeUrl)}),e.service===void 0||typeof e.service=="string"?this.callbackService=new Xf(e.service||La.defaults.service):this.callbackService=e.service,this.transport=e.transport,e.storage!==null&&(this.storage=e.storage||this.transport.storage),this.verifyProofs=e.verifyProofs!==void 0?e.verifyProofs:La.defaults.verifyProofs,this.encodeChainIds=e.encodeChainIds!==void 0?e.encodeChainIds:La.defaults.encodeChainIds}get client(){return this.chains[0].client}getChain(e){if(e instanceof Fa)return e;if(typeof e=="number"){let n=this.chains[e];if(!n)throw new Error(`Invalid chain index: ${e}`);return n}let t=Qe.from(e),i=this.chains.find(n=>n.chainId.equals(t));if(!i)throw new Error(`Unsupported chain: ${t}`);return i}async createRequest(e,t,i){let n=i||this.transport,a;if(t||this.chains.length===1){let s=t||this.chains[0];a=await vr.create({...e,chainId:s.chainId,broadcast:!1},{abiProvider:s,zlib:ar})}else a=await vr.create({...e,chainId:null,chainIds:this.encodeChainIds?this.chains.map(s=>s.chainId):void 0,broadcast:!1},{abiProvider:this.chains[0],zlib:ar});n.prepare&&(a=await n.prepare(a));let o=this.callbackService.create();return a.setCallback(o.url,!0),{request:a,callback:o}}async sendRequest(e,t,i,n,a=!1){let o=n||this.transport;try{if(e.data.callback!==t.url)throw new Error("Invalid request callback");if(e.data.flags.broadcast===!0||e.data.flags.background===!1)throw new Error("Invalid request flags");let h=!1,d=new Promise((C,z)=>{o.onRequest(e,N=>{if(h)return;let j=typeof N=="string"?new Yo(N):N;o.recoverError&&o.recoverError(j,e)===!0||(t.cancel(),z(j))})}),p=await Promise.race([t.wait(),d]);if(h=!0,typeof p.rejected=="string")throw new Yo(p.rejected);let A=p,k=Ae.from({actor:A.sa,permission:A.sp}),S=Object.keys(A).filter(C=>C.startsWith("sig")&&C!=="sig0").map(C=>vt.from(A[C])),E;if(!i&&this.chains.length>1){if(!A.cid)throw new Error("Multi chain response payload must specify resolved chain id (cid)");E=this.getChain(A.cid)}else if(E=i||this.getChain(0),A.cid&&!E.chainId.equals(A.cid))throw new Error("Got response for wrong chain id");let I=await Ca.fromPayload(A,{zlib:ar,abiProvider:E}),P=I.request.getInfoKey("cosig",{type:vt,array:!0});P&&S.unshift(...P);let T={resolved:I,chain:E,transaction:I.transaction,resolvedTransaction:I.resolvedTransaction,signatures:S,payload:A,signer:k};if(a){let C=Ot.from({...I.transaction,signatures:S}),z=await E.client.v1.chain.push_transaction(C);T.processed=z.processed}return o.onSuccess&&o.onSuccess(e,T),T}catch(s){throw o.onFailure&&o.onFailure(e,s),s}}async transact(e,t,i){let n=t||{},a=i||this.transport,o=n.chain!==void 0?this.getChain(n.chain):void 0,s=n.broadcast!==!1,h=n.noModify!==void 0?n.noModify:!s;a&&a.showLoading&&a.showLoading();let d=e;e.actions&&(d.expiration||d.ref_block_num||d.ref_block_prefix||d.max_net_usage_words||d.max_cpu_usage_ms||d.delay_sec)&&(e={transaction:{expiration:"1970-01-01T00:00:00",ref_block_num:0,ref_block_prefix:0,max_net_usage_words:0,max_cpu_usage_ms:0,delay_sec:0,...d}});let{request:p,callback:A}=await this.createRequest(e,o,a);return h&&p.setInfoKey("no_modify",!0,"bool"),await this.sendRequest(p,A,o,a,s)}async identify(e){let{request:t,callback:i}=await this.createRequest({identity:{permission:e.requestPermission,scope:e.scope},info:e.info}),n=await this.sendRequest(t,i);if(!n.resolved.request.isIdentity())throw new Oi("Unexpected response");let a,o=n.resolved.getIdentityProof(n.signatures[0]);if(this.verifyProofs){if(a=await n.chain.client.v1.chain.get_account(n.signer.actor),!a)throw new Oi(`Signature from unknown account: ${o.signer.actor}`);let s=a.permissions.find(({perm_name:d})=>o.signer.permission.equals(d));if(!s)throw new Oi(`${o.signer.actor} signed for unknown permission: ${o.signer.permission}`);if(!o.verify(s.required_auth,a.head_block_time))throw new Oi(`Invalid identify proof for: ${o.signer}`)}if(e.requestPermission){let s=Ae.from(e.requestPermission);if(!s.actor.equals(Tt)&&!s.actor.equals(o.signer.actor)||!s.permission.equals(qr)&&!s.permission.equals(o.signer.permission))throw new Oi(`Identity proof singed by ${o.signer}, expected: ${qa(s)} `)}return{...n,account:a,proof:o}}async login(e){let t=la.generate("K1"),i=t.toPublic(),n=Hi.from({session_name:e,request_key:i,user_agent:this.getUserAgent()}),a=await this.identify({scope:e,info:{link:n,scope:e}}),o=zl(a.payload,a.resolved.request),s=a.proof.recover(),h;return a.payload.link_ch&&a.payload.link_key&&a.payload.link_name?h=new es(this,{identifier:e,chainId:a.chain.chainId,auth:a.signer,publicKey:s,channel:{url:a.payload.link_ch,key:a.payload.link_key,name:a.payload.link_name},requestKey:t},o):h=new ts(this,{identifier:e,chainId:a.chain.chainId,auth:a.signer,publicKey:s},o),await this.storeSession(h),{...a,session:h}}async restoreSession(e,t,i){if(!this.storage)throw new Error("Unable to restore session: No storage adapter configured");let n;if(t&&i)n=this.sessionKey(e,qa(Ae.from(t)),String(Qe.from(i)));else{let h=await this.listSessions(e);if(t&&(h=h.filter(p=>p.auth.equals(t))),i){let p=Qe.from(i);h=h.filter(A=>A.chainId.equals(p))}let d=h[0];if(!d)return null;n=this.sessionKey(e,qa(d.auth),String(d.chainId))}let a=await this.storage.read(n);if(!a)return null;let o;try{o=JSON.parse(a)}catch(h){throw new Error(`Unable to restore session: Stored JSON invalid (${h.message||String(h)})`)}let s=Ua.restore(this,o);return(t||i)&&await this.touchSession(e,s.auth,s.chainId),s}async listSessions(e){if(!this.storage)throw new Error("Unable to list sessions: No storage adapter configured");let t=this.sessionKey(e,"list"),i;try{i=JSON.parse(await this.storage.read(t)||"[]")}catch(n){throw new Error(`Unable to list sessions: ${n.message||String(n)}`)}return i.map(({auth:n,chainId:a})=>({auth:Ae.from(n),chainId:Qe.from(a)}))}async removeSession(e,t,i){if(!this.storage)throw new Error("Unable to remove session: No storage adapter configured");let n=this.sessionKey(e,qa(t),String(i));await this.storage.remove(n),await this.touchSession(e,t,i,!0)}async clearSessions(e){if(!this.storage)throw new Error("Unable to clear sessions: No storage adapter configured");for(let{auth:t,chainId:i}of await this.listSessions(e))await this.removeSession(e,t,i)}makeSignatureProvider(e,t,i){return{getAvailableKeys:async()=>e,sign:async n=>{let a=i||this.transport,o=t?this.getChain(t):this.chains[0],s=vr.fromTransaction(n.chainId,n.serializedTransaction,{abiProvider:o,zlib:ar}),h=this.callbackService.create();s.setCallback(h.url,!0),s.setBroadcast(!1),a.prepare&&(s=await a.prepare(s));let{transaction:d,signatures:p}=await this.sendRequest(s,h,o,a),A=ae.encode({object:d});return{...n,serializedTransaction:A,signatures:p}}}}async touchSession(e,t,i,n=!1){let a=await this.listSessions(e),o=a.findIndex(h=>h.auth.equals(t)&&h.chainId.equals(i));o>=0&&a.splice(o,1),n===!1&&a.unshift({auth:t,chainId:i});let s=this.sessionKey(e,"list");await this.storage.write(s,JSON.stringify(a))}async storeSession(e){if(this.storage){let t=this.sessionKey(e.identifier,qa(e.auth),String(e.chainId)),i=JSON.stringify(e.serialize());await this.storage.write(t,i),await this.touchSession(e.identifier,e.auth,e.chainId)}}sessionKey(e,...t){return[String(G.from(e)),...t].join("-")}getUserAgent(){let e=`AnchorLink/${r.version}`;return this.transport.userAgent&&(e+=" "+this.transport.userAgent()),e}};$i.version="3.6.0";function qa(r){let e=Ae.from(r),t=e.actor.equals(Tt)?"<any>":String(e.actor),i;return e.permission.equals(Tt)||e.permission.equals(qr)?i="<any>":i=String(e.permission),`${t}@${i}`}var v2=`
/* Anchor Link */
.%prefix% * {
box-sizing: border-box;
line-height: 1;
font-variant-numeric: tabular-nums;
}
.%prefix% {
font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
Arial, sans-serif;
font-size: 13px;
background: rgba(0, 0, 0, 0.65);
position: fixed;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
z-index: 2147483647;
display: none;
align-items: center;
justify-content: center;
}
.%prefix%-active {
display: flex;
}
.%prefix%-inner {
background: #EFF1F7;
margin: 20px;
padding-top: 50px;
border-radius: 20px;
box-shadow: 0px 4px 100px rgba(0, 0, 0, .5);
width: 340px;
position: relative;
}
.%prefix%-close {
display: block;
position: absolute;
top: 11px;
right: 16px;
width: 28px;
height: 28px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.57 12.1a.96.96 0 000 1.34c.37.36 1 .36 1.34 0L7 8.37l5.09 5.09c.36.35.97.35 1.34-.01a.96.96 0 000-1.34L8.34 7.01l5.08-5.08a.95.95 0 000-1.33.97.97 0 00-1.34-.01L6.99 5.68 1.91.59a.96.96 0 00-1.33 0 .97.97 0 00-.01 1.34l5.09 5.08-5.1 5.1z' fill='%23007AFF'/%3E%3C/svg%3E");
background-size: 14px;
background-repeat: no-repeat;
background-position: 50% 7px;
border-radius: 100%;
cursor: pointer;
}
.%prefix%-close:hover {
background-color: white;
}
.%prefix%-version {
position: absolute;
top: 19px;
left: 20px;
cursor: help;
color: #B8C0DA;
opacity: 0.1;
}
.%prefix%-version:hover {
opacity: 1;
}
.%prefix%-logo {
width: 70px;
height: 70px;
margin: 0 auto;
margin-top: -56px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23fff' d='M18.81 9.19h33.25V59.5H18.81z'/%3E%3Cpath d='M38.45 28.88h-6.9L35 21.77l3.45 7.1z' fill='%233650A2'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M35 70a35 35 0 100-70 35 35 0 000 70zm2.36-55.4a2.62 2.62 0 00-4.72 0L21.9 36.75h5.84l1.7-3.5h11.13l1.7 3.5h5.83L37.36 14.6zM48.13 44.2h-5.26a7.76 7.76 0 01-5.24 7v-10.5a2.62 2.62 0 10-5.25 0v10.5a7.76 7.76 0 01-5.25-7h-5.25c.16 7.06 6 12.69 13.12 12.69 7.12 0 12.97-5.63 13.13-12.7z' fill='%233650A2'/%3E%3C/svg%3E");
}
.%prefix%-logo.loading {
border-radius: 100%;
background-color: #3650A2;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0.5 0.5 45 45' xmlns='http://www.w3.org/2000/svg' stroke='%23fff'%3E%3Cg fill='none' fill-rule='evenodd' transform='translate(1 1)' stroke-width='2'%3E%3Ccircle cx='22' cy='22' r='6' stroke-opacity='0'%3E%3Canimate attributeName='r' begin='1.5s' dur='3s' values='6;22' calcMode='linear' repeatCount='indefinite' /%3E%3Canimate attributeName='stroke-opacity' begin='1.5s' dur='3s' values='1;0' calcMode='linear' repeatCount='indefinite' /%3E%3Canimate attributeName='stroke-width' begin='1.5s' dur='3s' values='2;0' calcMode='linear' repeatCount='indefinite' /%3E%3C/circle%3E%3Ccircle cx='22' cy='22' r='6' stroke-opacity='0'%3E%3Canimate attributeName='r' begin='3s' dur='3s' values='6;22' calcMode='linear' repeatCount='indefinite' /%3E%3Canimate attributeName='stroke-opacity' begin='3s' dur='3s' values='1;0' calcMode='linear' repeatCount='indefinite' /%3E%3Canimate attributeName='stroke-width' begin='3s' dur='3s' values='2;0' calcMode='linear' repeatCount='indefinite' /%3E%3C/circle%3E%3Ccircle cx='22' cy='22' r='8'%3E%3Canimate attributeName='r' begin='0s' dur='1.5s' values='6;1;2;3;4;5;6' calcMode='linear' repeatCount='indefinite' /%3E%3C/circle%3E%3C/g%3E%3C/svg%3E");
}
.%prefix%-logo.error {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70' fill='none'%3E%3Ccircle cx='35' cy='35' r='35' fill='%23fc3d39'/%3E%3Cpath fill-rule='evenodd' d='M32.88 17.614c.715-.403 1.522-.614 2.343-.614s1.628.212 2.343.614 1.314.983 1.74 1.685l.005.008 13.483 22.508.013.022c.417.722.638 1.541.64 2.375s-.214 1.654-.627 2.378-1.008 1.328-1.727 1.751-1.535.65-2.369.659h-.017-26.983c-.834-.009-1.651-.237-2.369-.659s-1.314-1.027-1.727-1.751-.629-1.544-.627-2.378.223-1.653.64-2.375l.013-.022L31.14 19.299c.426-.702 1.025-1.282 1.74-1.685zm2.343 2.569a1.59 1.59 0 0 0-1.359.763L20.392 43.438a1.59 1.59 0 0 0-.208.782c-.001.278.071.551.209.793a1.59 1.59 0 0 0 1.358.803h26.945a1.59 1.59 0 0 0 1.358-.803 1.59 1.59 0 0 0 .209-.793c-.001-.274-.073-.544-.208-.782L36.584 20.95c-.144-.236-.343-.428-.58-.561a1.59 1.59 0 0 0-.781-.205zm0 6.531a1.59 1.59 0 0 1 1.592 1.592v6.367a1.59 1.59 0 1 1-3.184 0v-6.367a1.59 1.59 0 0 1 1.592-1.592zm-1.592 14.326a1.59 1.59 0 0 1 1.592-1.592h.016a1.59 1.59 0 1 1 0 3.184h-.016a1.59 1.59 0 0 1-1.592-1.592z' fill='%23fff'/%3E%3C/svg%3E");
}
.%prefix%-logo.warning {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70' fill='none' %3E%3Ccircle cx='35' cy='35' r='35' fill='%23f8b826'/%3E%3Cpath d='M35 20c-8.284 0-15 6.716-15 15s6.716 15 15 15 15-6.716 15-15-6.716-15-15-15zM16.667 35c0-10.125 8.208-18.333 18.333-18.333S53.333 24.875 53.333 35 45.125 53.334 35 53.334 16.667 45.126 16.667 35zM35 26.667c.921 0 1.667.746 1.667 1.667V35A1.67 1.67 0 0 1 35 36.667c-.921 0-1.667-.746-1.667-1.667v-6.667c0-.921.746-1.667 1.667-1.667zm-1.667 15A1.67 1.67 0 0 1 35 40h.017c.921 0 1.667.746 1.667 1.667s-.746 1.667-1.667 1.667H35a1.67 1.67 0 0 1-1.667-1.667z' fill-rule='evenodd' fill='%23fff'/%3E%3C/svg%3E");
}
.%prefix%-logo.success {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 70 70'%3E%3Cdefs/%3E%3Ccircle cx='35' cy='35' r='35' fill='%233DC55D'/%3E%3Cpath fill='%23fff' d='M30.9 49.7a2 2 0 001.8-1L48 24.9c.3-.5.4-1 .4-1.4 0-1-.7-1.7-1.7-1.7-.8 0-1.2.3-1.6 1L30.8 45.4 23.5 36c-.5-.6-1-.9-1.6-.9-1 0-1.8.8-1.8 1.8 0 .4.2.9.6 1.3L29 48.7c.6.7 1.1 1 1.9 1z'/%3E%3C/svg%3E");
}
.%prefix%-logo.fuel {
background-image: url("data:image/svg+xml,%3Csvg width='70' height='70' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0)'%3E%3Cpath d='M69.23 30.31l-8.46-11a6.58 6.58 0 00-3.4-2.19L35.91 12.1a7.16 7.16 0 00-1.6-.16 7.73 7.73 0 00-2.18.28l-5.1 1.57a1.76 1.76 0 00-.17-1.4l-1.46-2.5a1.76 1.76 0 00-2.06-.8l-9.98 3.2a1.76 1.76 0 00-1.23 1.74l.13 3.39c.01.27.09.54.22.78l-2.28.7a5.85 5.85 0 00-3.24 2.7L.48 34.23a4.96 4.96 0 00.14 4.53l3.5 5.83a4.49 4.49 0 004.19 2.05l9.29-1.13a4.79 4.79 0 002.54 3.78l3.55 1.68a8.9 8.9 0 003.39.73h.27l8.06-.45c.26.04.5.13.73.28l8.02 8c1 .92 2.3 1.45 3.67 1.47.14 0 .28 0 .42-.03l6.6-.68a2.85 2.85 0 002.5-1.8c.36-1 .1-2.12-.73-3l-2.78-2.96 5.26-1.56a4.35 4.35 0 003-3.64l.41-4.29c.09-.42.26-.82.52-1.16l6-6.66a3.91 3.91 0 00.2-4.9z' fill='%23fff'/%3E%3Cpath d='M49.08 29.96a1.72 1.72 0 00-.92-2.25 1.72 1.72 0 00-1.3 3.17 1.7 1.7 0 002.22-.92zM27.54 26.41a1.02 1.02 0 001-1.23 1.02 1.02 0 00-1.85-.37 1.03 1.03 0 00.46 1.52c.12.05.25.08.39.08zM37.05 21.67a1.03 1.03 0 000-2.06 1.03 1.03 0 000 2.06zM21.54 35c-4.62 0-10.44 2.04-13.52 3.24a.68.68 0 00-.24.16.68.68 0 00-.18.53c.01.1.04.19.1.27l1.28 2.16c.07.1.17.2.28.25.11.06.24.08.37.07l9.15-1.13.45-.03a3.64 3.64 0 013.67 3.55v.3a.67.67 0 00.39.59l2.9 1.38c.42.16.86.26 1.3.28h.05l7.74-.45h.23c1.45.03 2.83.59 3.9 1.58l7.68 7.65c.1.06.22.1.35.12l1.67-.2c.06-.01.12-.03.16-.07a.32.32 0 00.1-.13.33.33 0 00-.03-.33l-.82-1.21a3.22 3.22 0 01-.01-4.58c.4-.4.9-.68 1.45-.82l6.47-1.92a.4.4 0 00.19-.13.41.41 0 00.08-.22l.35-3.53c.01-.06 0-.13-.02-.2a.41.41 0 00-.28-.24.37.37 0 00-.2.01c-2.27.62-6.27 1.6-8.73 1.6C37.4 43.53 29.68 35 21.54 35zm8.97 7.49a.8.8 0 01-.27.28c-.2.13-.45.19-.68.17a1.05 1.05 0 01-.77-1.62.73.73 0 01.28-.28 1.05 1.05 0 011.44 1.45zm17.6 3.72a.76.76 0 01-.27.28 1.05 1.05 0 01-1.17-1.73 1.05 1.05 0 011.32.13 1.04 1.04 0 01.13 1.32z' fill='%23F8B826'/%3E%3Cpath d='M21.54 35c-4.85 0-11.03 2.25-13.96 3.42a.29.29 0 00-.15.16c-.01.03-.02.07-.01.11 0 .04.01.07.03.1L9 41.38c.06.11.16.2.27.26.12.05.25.07.37.06l9.15-1.13c.15-.02.3-.02.46-.03a3.63 3.63 0 013.66 3.54l.02.56c0 .04.02.09.05.13.02.04.06.07.1.1l3.13 1.48c.41.16.85.26 1.3.28h.04l7.74-.45h.23c1.45.03 2.84.59 3.9 1.58l7.68 7.65c.1.06.23.1.35.12l2.22-.27-1.58-1.66c-.82-.88-.7-2.05-.4-3.13a3.28 3.28 0 012.3-2.27l6.71-2 .38-3.8.06-.58c-2.13.59-6.6 1.74-9.3 1.74C37.4 43.54 29.69 35 21.54 35zm8.89 7.62a.38.38 0 01-.07.07c-1.07.77-2.26-.42-1.49-1.5a.25.25 0 01.06-.07c1.08-.77 2.27.42 1.5 1.5zm17.6 3.72a.25.25 0 01-.06.06c-1.07.78-2.26-.42-1.49-1.5a.25.25 0 01.07-.06c1.07-.78 2.26.42 1.49 1.5z' fill='%23E99123'/%3E%3Cpath d='M47.53 34.9c-10.41 0-19.22-4.65-25.54-4.65-4.44 0-11.97 3.38-15.28 5.83a.55.55 0 00-.18.69l.35.78a.55.55 0 00.72.28c2.84-1.18 8.9-3.42 13.94-3.42 8.4 0 16.15 7.48 25.16 7.48 4 0 9.88-1.58 11.41-2.82.67-.7 2.86-3.32 4.4-4.93a.67.67 0 00.1-.8.67.67 0 00-.32-.28.65.65 0 00-.42-.03 64.85 64.85 0 01-14.34 1.86zm-.47 3.95c-.14.3-.38.55-.68.7a1.73 1.73 0 01-2.34-2.36c.14-.3.38-.55.68-.7a1.72 1.72 0 012.04.32 1.75 1.75 0 01.3 2.04z' fill='%23F8B826'/%3E%3Cpath d='M68.34 30.87l-8.46-11a5.52 5.52 0 00-2.77-1.78l-21.46-5.03a7.08 7.08 0 00-3.2.1l-7.55 2.3-.01.01h-.01l-.5-1.3v-.01l1.13-.4a.65.65 0 00.36-.93l-1.47-2.5a.64.64 0 00-.73-.27l-9.98 3.17a.64.64 0 00-.44.63l.13 3.39a.64.64 0 00.63.6c.07 0 .15-.02.22-.04l2.53-.91h.02l.44.87v.02l-6.7 2.05c-1.08.38-2 1.15-2.56 2.15L1.47 34.61a3.8 3.8 0 00.11 3.43l3.5 5.84a3.32 3.32 0 003.1 1.51l10.23-1.26a.2.2 0 01.2.04.2.2 0 01.06.08l.02.1.03.9a3.69 3.69 0 001.9 2.88l3.56 1.69c.98.42 2.05.63 3.12.61l8.06-.44c.58.02 1.13.23 1.57.6l8.03 8a4.38 4.38 0 003.18 1.12l6.6-.69c.77-.07 1.33-.46 1.55-1.07.23-.6.05-1.26-.48-1.82l-4.02-4.26-.01-.01v-.01l7-2.09a3.25 3.25 0 002.2-2.66l.43-4.3a4 4 0 01.8-1.81l6.01-6.67a2.76 2.76 0 00.12-3.45zM15.14 15.2l-.03-.51c0-.08.02-.16.06-.22.04-.07.1-.11.18-.14l7.73-2.5a.35.35 0 01.41.16l.13.23c.03.05.04.1.05.15 0 .05 0 .1-.02.14a.35.35 0 01-.08.13.38.38 0 01-.12.09L15.6 15.5a.34.34 0 01-.31-.04.36.36 0 01-.16-.27zm51.53 17.75l-6 6.66a5.95 5.95 0 00-1.32 3l-.42 4.3a1.22 1.22 0 01-.73.87l-7.32 2.17a1.8 1.8 0 00-1.34 2.28c.1.32.27.6.52.83l3.19 3.37a.4.4 0 01.09.43.42.42 0 01-.14.19.42.42 0 01-.21.08l-5.06.53c-.55 0-1.09-.19-1.51-.54l-8.03-8a4.62 4.62 0 00-3.14-1.2l-8.07.45c-.73.01-1.45-.13-2.12-.41l-3.56-1.7a1.4 1.4 0 01-.72-1.08l-.04-.9a2.35 2.35 0 00-.8-1.68 2.24 2.24 0 00-1.78-.53L7.92 43.32a1.32 1.32 0 01-1.07-.53l-3.49-5.82a1.78 1.78 0 01-.05-1.4L9.8 22.94c.32-.5.78-.89 1.33-1.1l21.94-6.67c.69-.18 1.42-.2 2.12-.07l21.46 5.02c.62.19 1.18.55 1.6 1.03l8.47 11c.08.11.12.25.12.4a.69.69 0 01-.16.39z' fill='%2329363F'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0'%3E%3Cpath fill='%23fff' transform='translate(0 9)' d='M0 0h70v52H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
}
.%prefix%-request {
padding: 20px;
border-radius: 20px;
border-top-left-radius: 0;
border-top-right-radius: 0;
background: white;
}
.%prefix%-info {
display: flex;
flex-direction: column;
align-items: center;
}
.%prefix%-title {
color: #000000;
font-size: 25px;
margin-top: 14px;
font-weight: 700;
line-height: 30px;
letter-spacing: 0.5px;
}
.%prefix%-subtitle {
margin-top: 14px;
color: #5C5C5C;
text-align: center;
line-height: 1.4;
word-break: break-word;
}
.%prefix%-subtitle a {
color: #000000;
cursor: pointer;
text-decoration: underline;
}
.%prefix%-manual {
color: #007AFF;
cursor: pointer;
}
.%prefix%-info hr {
border: 0;
height: 1px;
width: 100%;
background: #EFF1F7;
margin: 24px 0 14px;
}
.%prefix%-uri {
width: 100%;
}
.%prefix%-button {
color: #007AFF;
background: #EFF1F7;
border: 1px solid #EFF1F7;
text-decoration: none;
font-size: 17px;
flex-grow: 1;
flex: 1;
width: 100%;
line-height: 1;
padding: 20px 18px;
border-radius: 12px;
font-weight: 400;
text-align: center;
display: block;
margin-top: 21px;
cursor: pointer;
}
.%prefix%-button:hover {
border: 1px solid #007AFF;
}
.%prefix%-qr {
position: relative;
margin-top: 21px;
border: 4px solid #EFF1F7;
padding: 11px;
border-radius: 12px;
background: #FFFFFF;
transition: all 400ms ease-in-out;
transform: scale(1) translateY(0);
}
.%prefix%-qr svg {
width: 100%;
display: block;
cursor: zoom-in;
shape-rendering: crispEdges;
}
.%prefix%-qr.zoom {
transform: scale(2) translateY(-25px);
border: 2px solid #1E89FE;
box-sizing: border-box;
box-shadow: 0px 4px 154px rgba(0, 0, 0, 0.35);
border-radius: 10px;
padding: 5px;
z-index: 2147483647;
}
.%prefix%-qr.zoom svg {
cursor: zoom-out;
}
.%prefix%-qr svg rect {
fill: black;
}
.%prefix%-copy {
position: absolute;
bottom: -10px;
left: 0px;
width: 100%;
color: green;
text-align: center;
opacity: 1;
transition: all 200ms ease-in-out;
transition-delay: 400ms;
}
.%prefix%-qr.zoom .%prefix%-copy {
transition-delay: 0ms;
background: transparent;
opacity: 0;
}
.%prefix%-copy span,
.%prefix%-copy a {
display: inline-block;
background: white;
padding: 0 20px;
color: #007AFF;
cursor: pointer;
text-decoration: none;
}
.%prefix%-copy span {
display: none;
color: #5C5C5C;
cursor: default;
}
.%prefix%-copy.copied a {
display: none;
}
.%prefix%-copy.copied span {
display: inline-block;
}
.%prefix%-copy span:before,
.%prefix%-copy a:before {
content: '';
display: inline-block;
width: 26px;
height: 16px;
position: relative;
top: 2px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' fill='none'%3E%3Cg clip-path='url(%23A)' stroke='%23157efa' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M13.83 6.5h-6c-.73 0-1.33.6-1.33 1.33v6c0 .74.6 1.34 1.33 1.34h6c.74 0 1.34-.6 1.34-1.34v-6c0-.73-.6-1.33-1.34-1.33z'/%3E%3Cpath d='M3.83 10.5h-.66a1.33 1.33 0 01-1.34-1.33v-6a1.33 1.33 0 011.34-1.34h6a1.33 1.33 0 011.33 1.34v.66' stroke-linecap='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='A'%3E%3Cpath fill='%23fff' transform='translate(.5 .5)' d='M0 0h16v16H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
background-repeat: no-repeat;
}
.%prefix%-copy span:before {
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.33 4L6 11.33 2.67 8' stroke='%23157EFA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
top: 3.5px;
}
.%prefix%-footnote {
text-align: center;
width: 100%;
position: absolute;
bottom: -26px;
left: 0;
color: white;
}
.%prefix%-footnote a {
color: white;
text-decoration: underline;
}
.%prefix%-wskeepalive {
display: none;
}
@media (prefers-color-scheme: dark) {
.%prefix%-info hr,
.%prefix%-inner {
background: #262D43;
color: white;
}
.%prefix%-request,
.%prefix%-qr a,
.%prefix%-qr span,
.%prefix%-qr {
background: #131B33;
}
.%prefix%-title {
color: #FCFCFC;
}
.%prefix%-qr span,
.%prefix%-subtitle {
color: #B8C0DA;
}
.%prefix%-subtitle a {
color: #FCFCFC;
}
.%prefix%-qr svg rect {
fill: white;
}
.%prefix%-version {
color: #546AAF;
}
.%prefix%-qr a,
.%prefix%-manual,
.%prefix%-button {
color: #FCFCFC;
}
.%prefix%-button {
background: #262D43;
border: 1px solid #262D43;
}
.%prefix%-qr {
border-color: #262D43;
}
.%prefix%-qr.zoom {
border-color: #131B33;
}
.%prefix%-copy a:before {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' fill='none'%3E%3Cg clip-path='url(%23A)' stroke='%23fff' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M13.83 6.5h-6c-.73 0-1.33.6-1.33 1.33v6c0 .74.6 1.34 1.33 1.34h6c.74 0 1.34-.6 1.34-1.34v-6c0-.73-.6-1.33-1.34-1.33z'/%3E%3Cpath d='M3.83 10.5h-.66a1.33 1.33 0 01-1.34-1.33v-6a1.33 1.33 0 011.34-1.34h6a1.33 1.33 0 011.33 1.34v.66' stroke-linecap='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='A'%3E%3Cpath fill='%23fff' transform='translate(.5 .5)' d='M0 0h16v16H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E");
}
.%prefix%-copy span:before {
background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13.33 4L6 11.33 2.67 8' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.%prefix%-button:hover {
color: #FCFCFC;
border: 1px solid #FCFCFC;
background: #333A50;
}
.%prefix%-close {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M.57 12.1a.96.96 0 000 1.34c.37.36 1 .36 1.34 0L7 8.37l5.09 5.09c.36.35.97.35 1.34-.01a.96.96 0 000-1.34L8.34 7.01l5.08-5.08a.95.95 0 000-1.33.97.97 0 00-1.34-.01L6.99 5.68 1.91.59a.96.96 0 00-1.33 0 .97.97 0 00-.01 1.34l5.09 5.08-5.1 5.1z' fill='%23FCFCFC'/%3E%3C/svg%3E");
}
.%prefix%-close:hover {
background-color: black;
}
}
@media (max-height: 600px) { .%prefix%-inner { transform: scale(0.9); } }
@media (max-height: 540px) { .%prefix%-inner { transform: scale(0.8); } }
@media (max-height: 480px) { .%prefix%-inner { transform: scale(0.7); } }
@media (max-height: 420px) { .%prefix%-inner { transform: scale(0.6); } }
@media (max-height: 360px) { .%prefix%-inner { transform: scale(0.5); } }
@media (max-height: 300px) { .%prefix%-inner { transform: scale(0.4); } }
@media (max-width: 600px) and (orientation: portrait) {
.%prefix%-qr.zoom {
transform: scale(1.5) translateY(-25px);
}
}
@media (max-width: 450px) and (orientation: portrait) {
.%prefix%-qr.zoom {
transform: scale(1.3) translateY(-25px);
}
}
`,Ha={L:1,M:0,Q:3,H:2},Rt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Qf=class{constructor(e){this.mode=Rt.MODE_8BIT_BYTE,this.data=e}getLength(){return this.data.length}write(e){for(let t=0;t<this.data.length;t++)e.put(this.data.charCodeAt(t),8)}},rs=class{constructor(){this.buffer=[],this.length=0}get(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1}put(e,t){for(let i=0;i<t;i++)this.putBit((e>>>t-i-1&1)==1)}getLengthInBits(){return this.length}putBit(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},ft={glog:function(r){if(r<1)throw new Error("glog("+r+")");return ft.LOG_TABLE[r]},gexp:function(r){for(;r<0;)r+=255;for(;r>=256;)r-=255;return ft.EXP_TABLE[r]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let r=0;r<8;r++)ft.EXP_TABLE[r]=1<<r;for(let r=8;r<256;r++)ft.EXP_TABLE[r]=ft.EXP_TABLE[r-4]^ft.EXP_TABLE[r-5]^ft.EXP_TABLE[r-6]^ft.EXP_TABLE[r-8];for(let r=0;r<255;r++)ft.LOG_TABLE[ft.EXP_TABLE[r]]=r;var $a=class r{constructor(e,t){if(e.length==null)throw new Error(e.length+"/"+t);let i=0;for(;i<e.length&&e[i]==0;)i++;this.num=new Array(e.length-i+t);for(let n=0;n<e.length-i;n++)this.num[n]=e[n+i]}get(e){return this.num[e]}getLength(){return this.num.length}multiply(e){let t=new Array(this.getLength()+e.getLength()-1);for(let i=0;i<this.getLength();i++)for(let n=0;n<e.getLength();n++)t[i+n]^=ft.gexp(ft.glog(this.get(i))+ft.glog(e.get(n)));return new r(t,0)}mod(e){if(this.getLength()-e.getLength()<0)return this;let t=ft.glog(this.get(0))-ft.glog(e.get(0)),i=new Array(this.getLength());for(let n=0;n<this.getLength();n++)i[n]=this.get(n);for(let n=0;n<e.getLength();n++)i[n]^=ft.gexp(ft.glog(e.get(n))+t);return new r(i,0).mod(e)}},ja=class r{constructor(e,t){this.totalCount=e,this.dataCount=t}static getRSBlocks(e,t){let i=r.getRsBlockTable(e,t);if(i==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);let n=i.length/3,a=[];for(let o=0;o<n;o++){let s=i[o*3+0],h=i[o*3+1],d=i[o*3+2];for(let p=0;p<s;p++)a.push(new r(h,d))}return a}static getRsBlockTable(e,t){switch(t){case Ha.L:return r.RS_BLOCK_TABLE[(e-1)*4+0];case Ha.M:return r.RS_BLOCK_TABLE[(e-1)*4+1];case Ha.Q:return r.RS_BLOCK_TABLE[(e-1)*4+2];case Ha.H:return r.RS_BLOCK_TABLE[(e-1)*4+3];default:return}}};ja.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];var fi={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},xe={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(r){let e=r<<10;for(;xe.getBCHDigit(e)-xe.getBCHDigit(xe.G15)>=0;)e^=xe.G15<<xe.getBCHDigit(e)-xe.getBCHDigit(xe.G15);return(r<<10|e)^xe.G15_MASK},getBCHTypeNumber:function(r){let e=r<<12;for(;xe.getBCHDigit(e)-xe.getBCHDigit(xe.G18)>=0;)e^=xe.G18<<xe.getBCHDigit(e)-xe.getBCHDigit(xe.G18);return r<<12|e},getBCHDigit:function(r){let e=0;for(;r!=0;)e++,r>>>=1;return e},getPatternPosition:function(r){return xe.PATTERN_POSITION_TABLE[r-1]},getMask:function(r,e,t){switch(r){case fi.PATTERN000:return(e+t)%2==0;case fi.PATTERN001:return e%2==0;case fi.PATTERN010:return t%3==0;case fi.PATTERN011:return(e+t)%3==0;case fi.PATTERN100:return(Math.floor(e/2)+Math.floor(t/3))%2==0;case fi.PATTERN101:return e*t%2+e*t%3==0;case fi.PATTERN110:return(e*t%2+e*t%3)%2==0;case fi.PATTERN111:return(e*t%3+(e+t)%2)%2==0;default:throw new Error("bad maskPattern:"+r)}},getErrorCorrectPolynomial:function(r){let e=new $a([1],0);for(let t=0;t<r;t++)e=e.multiply(new $a([1,ft.gexp(t)],0));return e},getLengthInBits:function(r,e){if(1<=e&&e<10)switch(r){case Rt.MODE_NUMBER:return 10;case Rt.MODE_ALPHA_NUM:return 9;case Rt.MODE_8BIT_BYTE:return 8;case Rt.MODE_KANJI:return 8;default:throw new Error("mode:"+r)}else if(e<27)switch(r){case Rt.MODE_NUMBER:return 12;case Rt.MODE_ALPHA_NUM:return 11;case Rt.MODE_8BIT_BYTE:return 16;case Rt.MODE_KANJI:return 10;default:throw new Error("mode:"+r)}else if(e<41)switch(r){case Rt.MODE_NUMBER:return 14;case Rt.MODE_ALPHA_NUM:return 13;case Rt.MODE_8BIT_BYTE:return 16;case Rt.MODE_KANJI:return 12;default:throw new Error("mode:"+r)}else throw new Error("type:"+e)},getLostPoint:function(r){let e=r.getModuleCount(),t=0;for(let a=0;a<e;a++)for(let o=0;o<e;o++){let s=0,h=r.isDark(a,o);for(let d=-1;d<=1;d++)if(!(a+d<0||e<=a+d))for(let p=-1;p<=1;p++)o+p<0||e<=o+p||d==0&&p==0||h==r.isDark(a+d,o+p)&&s++;s>5&&(t+=3+s-5)}for(let a=0;a<e-1;a++)for(let o=0;o<e-1;o++){let s=0;r.isDark(a,o)&&s++,r.isDark(a+1,o)&&s++,r.isDark(a,o+1)&&s++,r.isDark(a+1,o+1)&&s++,(s==0||s==4)&&(t+=3)}for(let a=0;a<e;a++)for(let o=0;o<e-6;o++)r.isDark(a,o)&&!r.isDark(a,o+1)&&r.isDark(a,o+2)&&r.isDark(a,o+3)&&r.isDark(a,o+4)&&!r.isDark(a,o+5)&&r.isDark(a,o+6)&&(t+=40);for(let a=0;a<e;a++)for(let o=0;o<e-6;o++)r.isDark(o,a)&&!r.isDark(o+1,a)&&r.isDark(o+2,a)&&r.isDark(o+3,a)&&r.isDark(o+4,a)&&!r.isDark(o+5,a)&&r.isDark(o+6,a)&&(t+=40);let i=0;for(let a=0;a<e;a++)for(let o=0;o<e;o++)r.isDark(o,a)&&i++;let n=Math.abs(100*i/e/e-50)/5;return t+=n*10,t}},Ka=class r{constructor(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(e){let t=new Qf(e);this.dataList.push(t),this.dataCache=null}isDark(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let e=1;for(e=1;e<40;e++){let t=ja.getRSBlocks(e,this.errorCorrectLevel),i=new rs,n=0;for(let a=0;a<t.length;a++)n+=t[a].dataCount;for(let a=0;a<this.dataList.length;a++){let o=this.dataList[a];i.put(o.mode,4),i.put(o.getLength(),xe.getLengthInBits(o.mode,e)),o.write(i)}if(i.getLengthInBits()<=n*8)break}this.typeNumber=e}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++){this.modules[i]=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++)this.modules[i][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=r.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)}setupPositionProbePattern(e,t){for(let i=-1;i<=7;i++)if(!(e+i<=-1||this.moduleCount<=e+i))for(let n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=i&&i<=6&&(n==0||n==6)||0<=n&&n<=6&&(i==0||i==6)||2<=i&&i<=4&&2<=n&&n<=4?this.modules[e+i][t+n]=!0:this.modules[e+i][t+n]=!1)}getBestMaskPattern(){let e=0,t=0;for(let i=0;i<8;i++){this.makeImpl(!0,i);let n=xe.getLostPoint(this);(i==0||e>n)&&(e=n,t=i)}return t}setupTimingPattern(){for(let e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(let e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)}setupPositionAdjustPattern(){let e=xe.getPatternPosition(this.typeNumber);for(let t=0;t<e.length;t++)for(let i=0;i<e.length;i++){let n=e[t],a=e[i];if(this.modules[n][a]==null)for(let o=-2;o<=2;o++)for(let s=-2;s<=2;s++)o==-2||o==2||s==-2||s==2||o==0&&s==0?this.modules[n+o][a+s]=!0:this.modules[n+o][a+s]=!1}}setupTypeNumber(e){let t=xe.getBCHTypeNumber(this.typeNumber);for(let i=0;i<18;i++){let n=!e&&(t>>i&1)==1;this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=n}for(let i=0;i<18;i++){let n=!e&&(t>>i&1)==1;this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=n}}setupTypeInfo(e,t){let i=this.errorCorrectLevel<<3|t,n=xe.getBCHTypeInfo(i);for(let a=0;a<15;a++){let o=!e&&(n>>a&1)==1;a<6?this.modules[a][8]=o:a<8?this.modules[a+1][8]=o:this.modules[this.moduleCount-15+a][8]=o}for(let a=0;a<15;a++){let o=!e&&(n>>a&1)==1;a<8?this.modules[8][this.moduleCount-a-1]=o:a<9?this.modules[8][15-a-1+1]=o:this.modules[8][15-a-1]=o}this.modules[this.moduleCount-8][8]=!e}mapData(e,t){let i=-1,n=this.moduleCount-1,a=7,o=0;for(let s=this.moduleCount-1;s>0;s-=2)for(s==6&&s--;;){for(let h=0;h<2;h++)if(this.modules[n][s-h]==null){let d=!1;o<e.length&&(d=(e[o]>>>a&1)==1),xe.getMask(t,n,s-h)&&(d=!d),this.modules[n][s-h]=d,a--,a==-1&&(o++,a=7)}if(n+=i,n<0||this.moduleCount<=n){n-=i,i=-i;break}}}static createData(e,t,i){let n=ja.getRSBlocks(e,t),a=new rs;for(let s=0;s<i.length;s++){let h=i[s];a.put(h.mode,4),a.put(h.getLength(),xe.getLengthInBits(h.mode,e)),h.write(a)}let o=0;for(let s=0;s<n.length;s++)o+=n[s].dataCount;if(a.getLengthInBits()>o*8)throw new Error("code length overflow. ("+a.getLengthInBits()+">"+o*8+")");for(a.getLengthInBits()+4<=o*8&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(!1);for(;!(a.getLengthInBits()>=o*8||(a.put(r.PAD0,8),a.getLengthInBits()>=o*8));)a.put(r.PAD1,8);return r.createBytes(a,n)}static createBytes(e,t){let i=0,n=0,a=0,o=new Array(t.length),s=new Array(t.length);for(let A=0;A<t.length;A++){let k=t[A].dataCount,S=t[A].totalCount-k;n=Math.max(n,k),a=Math.max(a,S),o[A]=new Array(k);for(let T=0;T<o[A].length;T++)o[A][T]=255&e.buffer[T+i];i+=k;let E=xe.getErrorCorrectPolynomial(S),P=new $a(o[A],E.getLength()-1).mod(E);s[A]=new Array(E.getLength()-1);for(let T=0;T<s[A].length;T++){let C=T+P.getLength()-s[A].length;s[A][T]=C>=0?P.get(C):0}}let h=0;for(let A=0;A<t.length;A++)h+=t[A].totalCount;let d=new Array(h),p=0;for(let A=0;A<n;A++)for(let k=0;k<t.length;k++)A<o[k].length&&(d[p++]=o[k][A]);for(let A=0;A<a;A++)for(let k=0;k<t.length;k++)A<s[k].length&&(d[p++]=s[k][A]);return d}};Ka.PAD0=236;Ka.PAD1=17;function g2(r,e="L",t=-1){let i=new Ka(t,Ha[e]),n=[];i.addData(r),i.make();let a=i.modules,o=a.length;for(let[h,d]of a.entries()){let p;for(let[A,k]of d.entries())k?(p||(p={x:A,y:h,width:0,height:1}),p.width++):(p&&p.width>0&&n.push(p),p=void 0);p&&p.width>0&&n.push(p)}let s=[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${o} ${o}">`];for(let{x:h,y:d,width:p,height:A}of n)s.push(`<rect x="${h}" y="${d}" width="${p}" height="${A}" />`);return s.push("</svg>"),s.join("")}async function _2(r,e){return(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:e?JSON.stringify(e):void 0})).json()}var w2="fuel/2";function x2(r){return ql(r)>=ql(w2)}function ql(r){let e=r.trim().split("/");return e.length===2&&e[0]==="fuel"?parseInt(e[1])||0:-1}async function A2(r,e,t,i,n){S2(r,e),t("Detecting if network resources are required.");let a=r.getChainId(),o=i[String(a)];if(!o)throw new Error("Blockchain not supported by this resource provider.");let s=await _2(o+"/v1/resource_provider/request_transaction",{ref:n,request:r,signer:e.auth});if(!s||!s.data)throw new Error("Invalid response from resource provider.");if(!s.data.signatures||!s.data.signatures[0])throw new Error("No signature returned from resource provider.");if(s.code===402&&!s.data.fee)throw new Error("Resource provider returned a response indicating required payment, but provided no fee amount.");let h=r.clone();if(s.code===402){if(r.getInfoKey("no_fee"))throw new Error("Fee required but sender opted out.");h.setInfoKey("txfee",s.data.fee)}s.data.costs&&(h.setInfoKey("txfeecpu",s.data.costs.cpu),h.setInfoKey("txfeenet",s.data.costs.net),h.setInfoKey("txfeeram",s.data.costs.ram));let d=s.data.signatures.map(p=>vt.from(p));return h.setInfoKey("cosig",d,{type:vt,array:!0}),h.data.req=(await vr.create({transaction:{...s.data.request[1]}},{abiProvider:r.abiProvider})).data.req,h}function S2(r,e){if(r.getRawInfoKey("no_modify"))throw new Error("Request cannot be modified.");if(r.isIdentity())throw new Error("Identity requests cannot be co-signed.");let t=r.getRawActions()[0];if(!t)throw new Error("No actions in request.");let i=t.authorization[0];if(!t)throw new Error("First authorization missing.");if(!i.actor.equals(e.auth.actor)&&!i.actor.equals(Tt))throw new Error("Not first authorizer.")}var Dl=Symbol(),Ll=Symbol(),Ol=Symbol(),k2={aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906:"https://eos.greymass.com","2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840":"https://jungle3.greymass.com","4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11":"https://telos.greymass.com","1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4":"https://wax.greymass.com"},ec=class{constructor(e){this.keyPrefix=e}async write(e,t){localStorage.setItem(this.storageKey(e),t)}async read(e){return localStorage.getItem(this.storageKey(e))}async remove(e){localStorage.removeItem(this.storageKey(e))}storageKey(e){return`${this.keyPrefix}-${e}`}},Va=class r{constructor(e={}){this.options=e,this.classPrefix=e.classPrefix||"anchor-link",this.injectStyles=e.injectStyles!==!1,this.importantStyles=e.importantStyles!==!1,this.requestStatus=e.requestStatus!==!1,this.fuelEnabled=e.disableGreymassFuel!==!0,this.fuelReferrer=e.fuelReferrer||"teamgreymass",this.storage=new ec(e.storagePrefix||"anchor-link"),this.supportedChains=e.supportedChains||k2,this.showingManual=!1}closeModal(){this.hide(),this.activeCancel&&(this.activeRequest=void 0,this.activeCancel("Modal closed"),this.activeCancel=void 0)}setupElements(){if(this.showingManual=!1,this.injectStyles&&!this.styleEl){this.styleEl=document.createElement("style"),this.styleEl.type="text/css";let e=v2.replace(/%prefix%/g,this.classPrefix);this.importantStyles&&(e=e.split(`
`).map(t=>t.replace(/;$/i," !important;")).join(`
`)),this.styleEl.appendChild(document.createTextNode(e)),document.head.appendChild(this.styleEl)}if(this.containerEl||(this.containerEl=this.createEl(),this.containerEl.className=this.classPrefix,this.containerEl.onclick=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.closeModal())},document.body.appendChild(this.containerEl)),!this.requestEl){let e=this.createEl({class:"inner"}),t=this.createEl({class:"close"});t.onclick=n=>{n.stopPropagation(),this.closeModal()},this.requestEl=this.createEl({class:"request"}),e.appendChild(this.requestEl),e.appendChild(t);let i=this.createEl({class:"version",text:`${r.version} (${$i.version})`});i.onclick=n=>{n.stopPropagation(),window.open("https://github.com/greymass/anchor-link","_blank")},e.appendChild(i),this.containerEl.appendChild(e)}}createEl(e){e||(e={});let t=document.createElement(e.tag||"div");for(let i of Object.keys(e)){let n=e[i];switch(i){case"src":t.setAttribute(i,n);break;case"tag":break;case"content":typeof n=="string"?t.appendChild(document.createTextNode(n)):t.appendChild(n);break;case"text":t.appendChild(document.createTextNode(n));break;case"class":t.className=`${this.classPrefix}-${n}`;break;default:t.setAttribute(i,n)}}return t}hide(){this.containerEl&&this.containerEl.classList.remove(`${this.classPrefix}-active`),this.clearTimers()}show(){this.containerEl&&this.containerEl.classList.add(`${this.classPrefix}-active`)}showDialog(e){this.setupElements();let t=this.createEl({class:"info"}),i=this.createEl({class:"title",tag:"span",content:e.title}),n=this.createEl({class:"subtitle",tag:"span",content:e.subtitle});t.appendChild(i),t.appendChild(n);let a=this.createEl({class:"logo"});if(e.type&&a.classList.add(e.type),M2(this.requestEl),this.requestEl.appendChild(a),this.requestEl.appendChild(t),e.content&&this.requestEl.appendChild(e.content),e.action){let o=this.createEl({tag:"a",class:"button",text:e.action.text});o.addEventListener("click",s=>{s.preventDefault(),e.action.callback()}),this.requestEl.appendChild(o)}if(e.footnote){let o=this.createEl({class:"footnote",content:e.footnote});this.requestEl.appendChild(o)}this.show()}async displayRequest(e,t,i,n=!0){let a=e.clone(),o=Ul();a.setInfoKey("same_device",!0),a.setInfoKey("return_path",o);let s=a.encode(!0,!1),h=e.encode(!0,!1),d=this.createEl({class:"qr"});try{d.innerHTML=g2(h)}catch(C){console.warn("Unable to generate QR code",C)}let p=this.createEl({class:"copy"}),A=this.createEl({tag:"a",text:"Copy request link"}),k=this.createEl({tag:"span",text:"Link copied - Paste in Anchor"});p.appendChild(A),p.appendChild(k),d.appendChild(p),A.addEventListener("click",C=>{C.preventDefault(),C2(h),p.classList.add("copied"),setTimeout(()=>{p.classList.remove("copied")},2e3)});let S=d.querySelector("svg");S&&S.addEventListener("click",C=>{C.preventDefault(),d.classList.toggle("zoom")});let E=this.createEl({class:"uri"}),I=this.createEl({tag:"a",class:"button",href:h,text:"Launch Anchor"});if(E.appendChild(I),Hl()||rc()){let C=this.createEl({class:"wskeepalive",src:"about:blank",tag:"iframe"});E.appendChild(C),I.addEventListener("click",z=>{z.preventDefault(),C.setAttribute("src",s)})}else I.addEventListener("click",C=>{C.preventDefault(),window.location.href=s});let P=this.createEl({class:"info"});P.appendChild(d),P.appendChild(E);let T;if(n){T=this.createEl({text:"Don't have Anchor yet? "});let C=this.createEl({tag:"a",target:"_blank",href:"https://greymass.com/anchor",text:"Download now"});T.appendChild(C)}this.showDialog({title:t,subtitle:i,footnote:T,content:P})}async showLoading(){let e=this.createEl({tag:"span",text:"Preparing request..."});this.prepareStatusEl=e,this.showDialog({title:"Loading",subtitle:e,type:"loading"})}onRequest(e,t){this.clearTimers(),this.activeRequest=e,this.activeCancel=t;let i=e.isIdentity()?"Login":"Sign";this.displayRequest(e,i,"Scan the QR-code with Anchor on another device or use the button to open it here.").catch(t)}onSessionRequest(e,t,i){if(e.metadata.sameDevice&&t.setInfoKey("return_path",Ul()),e.type==="fallback"){this.onRequest(t,i),e.metadata.sameDevice&&(window.location.href=t.encode());return}this.clearTimers(),this.activeRequest=t,this.activeCancel=i;let n=e.metadata.timeout||60*1e3*2,a=e.metadata.name,o;a&&a.length>0?o=`Please open Anchor Wallet on \u201C${a}\u201D to review and sign the transaction.`:o="Please review and sign the transaction in the linked wallet.";let s=this.createEl({tag:"span",text:"Sign"}),h=new Date(Date.now()+n),d=()=>{s.textContent=`Sign - ${Fl(h)}`};this.countdownTimer=setInterval(d,200),d();let p=this.createEl({class:"info"}),A=this.createEl({tag:"hr"}),k=this.createEl({tag:"a",text:"Sign manually or with another device",class:"manual"});k.addEventListener("click",S=>{S.preventDefault();let E=new Fi("Manual","E_TIMEOUT",e);E[Ol]=!0,i(E)}),p.appendChild(A),p.appendChild(k),this.showDialog({title:s,subtitle:o,content:p}),e.metadata.sameDevice&&(e.metadata.launchUrl?window.location.href=e.metadata.launchUrl:tc()&&(window.location.href="anchor://link"))}sendSessionPayload(e,t){return!t.metadata.triggerUrl||!t.metadata.sameDevice||e.array.length>700?!1:(window.location.href=t.metadata.triggerUrl.replace("%s",Al.encode(e.array)),!0)}clearTimers(){this.closeTimer&&(clearTimeout(this.closeTimer),this.closeTimer=void 0),this.countdownTimer&&(clearTimeout(this.countdownTimer),this.countdownTimer=void 0)}async showFee(e,t){this.activeRequest=e;let i=new Promise((P,T)=>{this.activeCancel=C=>{let z;typeof C=="string"?z=new Error(C):z=C,z[Dl]=!0,T(z)}}),n=this.createEl({class:"info"}),a=this.createEl({tag:"span",text:"You can try to "}),o=this.createEl({tag:"a",text:"proceed without the fee"}),s=this.createEl({tag:"span",text:" or accept the fee shown below to pay for these costs."}),h=this.createEl({class:"subtitle",tag:"span"});h.appendChild(a),h.appendChild(o),h.appendChild(s),n.appendChild(h);let d=this.createEl({tag:"span",class:"subtitle",text:"Offer expires in --:--"});n.appendChild(d);let p=e.getRawTransaction().expiration.toDate(),A=setInterval(()=>{d.textContent=`Offer expires in ${Fl(p)}`,p.getTime()<Date.now()&&this.activeCancel("Offer expired")},200),k=this.createEl({tag:"span",text:"Resources offered by "}),S=this.createEl({tag:"a",target:"_blank",href:"https://greymass.com/en/fuel",text:"Greymass Fuel"});k.appendChild(S);let E=E2(o,"click").then(()=>{let P=new Error("Skipped fee");throw P[Ll]=!0,P}),I=new Promise(P=>{this.showDialog({title:"Transaction Fee",subtitle:"Your account lacks the network resources for this transaction and it cannot be covered for free.",type:"fuel",content:n,action:{text:`Accept Fee of ${t}`,callback:P},footnote:k})});await Promise.race([I,E,i]).finally(()=>{clearInterval(A)})}showRecovery(e,t){if(e.data.info=e.data.info.filter(i=>i.key!=="return_path"),t.type==="channel"){let i=t;i.addLinkInfo&&i.addLinkInfo(e)}this.displayRequest(e,"Sign manually","Want to sign with another device or didn\u2019t get the signing request in your wallet, scan this QR or copy request and paste in app.",!1),this.showingManual=!0}async prepare(e,t){if(this.showLoading(),!this.fuelEnabled||!t||e.isIdentity()||typeof t.metadata.cosignerVersion=="string"&&x2(t.metadata.cosignerVersion))return e;try{let i=A2(e,t,s=>{this.prepareStatusEl&&(this.prepareStatusEl.textContent=s)},this.supportedChains,this.fuelReferrer),n=new Promise(s=>setTimeout(s,5e3)).then(()=>{throw new Error("API timeout after 5000ms")}),a=await Promise.race([i,n]),o=a.getInfoKey("txfee");return o&&await this.showFee(a,String(o)),a}catch(i){if(i[Dl])throw this.hide(),i;if(console.info(`Skipping resource provider: ${i.message||i}`),i[Ll]){let n=e.clone();return n.setInfoKey("no_fee",!0,"bool"),n}}return e}recoverError(e,t){if(t===this.activeRequest&&(e.code==="E_DELIVERY"||e.code==="E_TIMEOUT")&&e.session){if(this.showingManual)return!0;let i=e.session;if(e[Ol])return this.showRecovery(t,i),!0;let n=i.metadata.name,a;return n&&n.length>0?a=`Unable to deliver the request to \u201C${n}\u201D.`:a="Unable to deliver the request to the linked wallet.",a+=` ${e.message}.`,this.showDialog({title:"Unable to reach device",subtitle:a,type:"warning",action:{text:"Sign manually",callback:()=>{this.showRecovery(t,i)}}}),!0}return!1}onSuccess(e){e===this.activeRequest&&(this.clearTimers(),this.requestStatus?(this.showDialog({title:"Success!",subtitle:e.isIdentity()?"Login completed.":"Transaction signed.",type:"success"}),this.closeTimer=setTimeout(()=>{this.hide()},1.5*1e3)):this.hide())}onFailure(e,t){if(e===this.activeRequest&&t.code!=="E_CANCEL")if(this.clearTimers(),this.requestStatus){let i;Z(t,Mn)?t.name==="eosio_assert_message_exception"?i=t.details[0].message:t.details.length>0?i=t.details.map(n=>n.message).join(`
`):i=t.message:i=t.message||String(t),this.showDialog({title:"Transaction Error",subtitle:i,type:"error"})}else this.hide();else this.hide()}userAgent(){return`BrowserTransport/${r.version} ${navigator.userAgent}`}};Va.version="3.6.0";function E2(r,e,t){return new Promise((i,n)=>{let a=o=>{r.removeEventListener(e,a),i(o)};r.addEventListener(e,a),t&&setTimeout(()=>{r.removeEventListener(e,a),n(new Error(`Timed out waiting for ${e}`))},t)})}function Fl(r){let e=r.getTime()-Date.now();return e>0?new Date(e).toISOString().substr(14,5):"00:00"}function M2(r){for(;r.firstChild;)r.removeChild(r.firstChild)}function Ul(){if(I2())return"googlechrome://";if(R2())return"firefox:://";if(tc()&&rc())return"brave://";if(tc()){let r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e=window.location.href.split("#")[0]+"#";for(let t=0;t<8;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e}return Nn()&&Hl()?"android-intent://org.mozilla.firefox":Nn()&&N2()?"android-intent://com.microsoft.emmx":Nn()&&P2()?"android-intent://com.opera.browser":Nn()&&rc()?"android-intent://com.brave.browser":Nn()&&B2()?"android-intent://webview":Nn()&&T2()?"android-intent://com.android.chrome":window.location.href}function tc(){return/iP(ad|od|hone)/i.test(navigator.userAgent)}function I2(){return/CriOS/.test(navigator.userAgent)}function T2(){return/Chrome\/[.0-9]* Mobile/i.test(navigator.userAgent)}function Hl(){return/Firefox/i.test(navigator.userAgent)}function R2(){return/FxiOS/.test(navigator.userAgent)}function P2(){return/OPR/.test(navigator.userAgent)||/Opera/.test(navigator.userAgent)}function N2(){return/Edg/.test(navigator.userAgent)}function rc(){return navigator.brave&&typeof navigator.brave.isBrave=="function"}function Nn(){return/Android/.test(navigator.userAgent)}function B2(){return/wv/.test(navigator.userAgent)||/Android.*AppleWebKit/.test(navigator.userAgent)}function C2(r){if(navigator.clipboard&&navigator.clipboard.writeText)navigator.clipboard.writeText(r);else{let e=document.createElement("textarea");try{e.setAttribute("contentEditable",""),e.value=r,document.body.appendChild(e),e.select();let t=document.createRange();t.selectNodeContents(e);let i=window.getSelection();i.removeAllRanges(),i.addRange(t),e.setSelectionRange(0,e.value.length),document.execCommand("copy")}finally{document.body.removeChild(e)}}}return Gl(z2);})();
/*! Bundled license information:
pako/dist/pako.esm.mjs:
(*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) *)
@wharfkit/antelope/lib/antelope.m.js:
(**
* @wharfkit/antelope v1.1.1
* https://github.com/wharfkit/antelope
*
* @license
* Copyright (c) 2023 FFF00 Agents AB & Greymass Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistribution in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR INTENDED FOR USE
* IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY MILITARY FACILITY.
*)
@wharfkit/signing-request/lib/signing-request.m.js:
(**
* EOSIO Signing Request v3.4.0
* https://github.com/greymass/eosio-signing-request
*
* @license
* Copyright © 2021 Greymass Inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the “Software”), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR
* INTENDED FOR USE IN THE DESIGN, CONSTRUCTION, OPERATION OR
* MAINTENANCE OF ANY MILITARY FACILITY.
*)
@greymass/miniaes/lib/miniaes.m.js:
(**
* @greymass/miniaes v1.0.0
* https://github.com/greymass/miniaes-js
*
* @license
* Copyright (c) 2021 FFF00 Agents AB & Greymass Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistribution in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR INTENDED FOR USE
* IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY MILITARY FACILITY.
*)
(**
* @file {@link http://asmjs.org Asm.js} implementation of the {@link https://en.wikipedia.org/wiki/Advanced_Encryption_Standard Advanced Encryption Standard}.
* @author Artem S Vybornov <vybornov@gmail.com>
* @license MIT
*)
anchor-link/lib/anchor-link.m.js:
(**
* Anchor Link v3.6.0
* https://github.com/greymass/anchor-link
*
* @license
* Copyright (c) 2020 Greymass Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistribution in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR INTENDED FOR USE
* IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY MILITARY FACILITY.
*)
anchor-link-browser-transport/lib/anchor-link-browser-transport.m.js:
(**
* Anchor Link Browser Transport v3.6.0
* https://github.com/greymass/anchor-link-browser-transport
*
* @license
* Copyright (c) 2020 Greymass Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistribution of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistribution in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR INTENDED FOR USE
* IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY MILITARY FACILITY.
*)
*/